:root {
  --navy: #0b1b33;
  --navy-2: #12284a;
  --teal: #19d3c5;
  --teal-d: #0fa89c;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1b2433;
  --muted: #6b7686;
  --line: #e3e7ee;
  --red: #d64545;
  --amber: #e0a020;
  --green: #22a06b;
  --blue: #3b6fd8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, select, textarea { font: inherit; }
.hidden { display: none !important; }
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Giriş */
.auth-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 14px; padding: 32px 28px; box-shadow: 0 10px 40px rgba(11,27,51,.12); }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--navy); color: var(--teal); display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.brand-name { font-weight: 700; font-size: 17px; }
.brand-sub { color: var(--muted); font-size: 12px; }
.auth-card h1 { font-size: 20px; margin: 0 0 6px; }
.auth-card p.lead { color: var(--muted); margin: 0 0 20px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(25,211,197,.18); }
.field textarea { min-height: 80px; resize: vertical; }
.btn { border: 0; border-radius: 8px; padding: 10px 16px; cursor: pointer; font-weight: 600; background: var(--line); color: var(--text); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--navy-2); }
.btn.teal { background: var(--teal); color: var(--navy); }
.btn.danger { background: #fdeaea; color: var(--red); }
.btn.small { padding: 6px 10px; font-size: 12px; }
.btn.block { width: 100%; }
.link { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 0; font-size: 13px; }
.msg { padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.msg.err { background: #fdeaea; color: var(--red); }
.msg.ok { background: #e6f6ef; color: var(--green); }

/* Uygulama iskeleti */
.layout { display: flex; min-height: 100vh; }
.side { width: 230px; background: var(--navy); color: #c9d4e5; display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 0 8px; }
.side .brand-name { color: #fff; }
.side .brand-sub { color: #8496b3; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.nav button { background: none; border: 0; color: inherit; text-align: left; padding: 10px 12px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.nav button:hover { background: rgba(255,255,255,.06); }
.nav button.active { background: rgba(25,211,197,.14); color: var(--teal); font-weight: 600; }
.badge { background: var(--teal); color: var(--navy); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.side-foot { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; }
.side-foot .who { color: #fff; margin-bottom: 8px; word-break: break-all; }
.side-foot .link { color: var(--teal); }
.main { flex: 1; padding: 26px 30px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 22px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--card); border-radius: 12px; padding: 14px 16px; border: 1px solid var(--line); }
.stat .k { color: var(--muted); font-size: 12px; }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 4px; }

.card { background: var(--card); border-radius: 12px; border: 1px solid var(--line); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbfd; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f7fafc; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.sub { color: var(--muted); font-size: 12px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.pending, .pill.new { background: #fff4dc; color: #a0700b; }
.pill.confirmed, .pill.approved, .pill.on { background: #e6f6ef; color: var(--green); }
.pill.cancelled, .pill.rejected, .pill.off { background: #fdeaea; color: var(--red); }
.pill.completed, .pill.reviewing { background: #e8effc; color: var(--blue); }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(11,27,51,.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal { background: var(--card); border-radius: 14px; width: 100%; max-width: 640px; padding: 22px 24px; }
.modal h3 { margin: 0 0 16px; font-size: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid2 .full { grid-column: 1 / -1; }
.modal-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }
.modal-foot .right { display: flex; gap: 8px; margin-left: auto; }
.section-title { font-weight: 700; margin: 18px 0 8px; }
.mini td, .mini th { padding: 7px 10px; font-size: 13px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 100; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.toast.err { background: var(--red); }

@media (max-width: 820px) {
  .layout { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; }
  .nav { flex-direction: row; overflow-x: auto; }
  .nav button { white-space: nowrap; }
  .side-foot { display: flex; justify-content: space-between; align-items: center; }
  .main { padding: 18px 14px; }
  .grid2 { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}

/* compact buttons, quick filter tabs, warning stat */
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 14px; }
.tabs button { border: 1px solid var(--line); background: var(--card); padding: 6px 12px; border-radius: 999px; font-size: 13px; cursor: pointer; color: var(--muted); }
.tabs button.active { background: var(--navy, #0a192f); color: #fff; border-color: transparent; }
.stat.warn { border-color: #f5c46b; background: #fffaf0; }

/* Rezervasyon detay çekmecesi */
.pill.no_show { background: #f1f3f6; color: var(--muted); }
a.btn { text-decoration: none; display: inline-block; }
.btn.danger-o { background: #fff; color: var(--red); box-shadow: inset 0 0 0 1px #f3c4c4; }
.drawer-bg { position: fixed; inset: 0; background: rgba(11,27,51,.35); z-index: 60; display: flex; justify-content: flex-end; }
.drawer { width: 100%; max-width: 480px; height: 100%; overflow-y: auto; background: var(--card); box-shadow: -12px 0 40px rgba(11,27,51,.18); padding: 20px 22px 28px; animation: slidein .18s ease-out; }
@keyframes slidein { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.drawer-head h3 { margin: 2px 0 6px; font-size: 20px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 6px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.drawer section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.drawer h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; text-align: right; }
.kv a { color: var(--navy); }
.btnrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.note { margin-top: 8px; background: #fff8e6; border: 1px solid #f5e2b0; border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; }
.drawer-foot { padding-top: 16px; }

/* Raporlar */
.rep-block { padding: 16px; }
.rep-block h4 { margin: 0 0 10px; font-size: 14px; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); border-top: 1px solid var(--line); }
.rep-grid .rep-block { border-bottom: 1px solid var(--line); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.bar { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 4px; }
.bar i { display: block; width: 100%; background: var(--teal); border-radius: 3px 3px 0 0; }
.bar:hover i { background: var(--teal-d); }
.bars-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 4px; }

/* Tedarikçi paneli */
.partner-badge { display: flex; align-items: center; gap: 8px; margin: -6px 14px 14px; padding: 8px 10px; background: rgba(255,255,255,.06); border-radius: 10px; color: #e2e8f0; font-weight: 600; font-size: 13px; }
.partner-badge img { height: 24px; max-width: 70px; object-fit: contain; background: #fff; border-radius: 4px; padding: 2px; }
.hint { margin: 0 0 12px; padding: 10px 12px; background: #eefcf9; border: 1px solid #c4f1ea; border-radius: 10px; color: #0f5b53; font-size: 13px; }
.pill.picked_up { background: #e8effc; color: var(--blue); }
.pill.supplier_rejected { background: #fdeaea; color: var(--red); }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 22px; transition: .15s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--teal); }
.switch input:checked + span::before { transform: translateX(16px); }
.cal-wrap { overflow-x: auto; }
table.cal { border-collapse: separate; border-spacing: 2px; font-size: 11px; }
table.cal th, table.cal td { padding: 0; }
.cal-h { min-width: 34px; text-align: center; font-weight: 700; color: var(--text); }
.cal-h div { font-weight: 400; color: var(--muted); font-size: 10px; }
.cal-h.we { color: var(--blue); }
.cal-car { position: sticky; left: 0; background: var(--card); min-width: 150px; padding: 6px 8px !important; text-align: left; z-index: 1; }
.cal-c { height: 34px; text-align: center; border-radius: 6px; cursor: pointer; font-weight: 600; }
.cal-c.open { background: #e6f6ef; color: #146c47; }
.cal-c.closed { background: #fdeaea; color: var(--red); }
.cal-c.bk { box-shadow: inset 0 -3px 0 var(--blue); }
.cal-c:hover { outline: 2px solid var(--navy); }
.cal-legend { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin: 0 2px 0 8px; }
.cal-legend.open { background: #e6f6ef; } .cal-legend.closed { background: #fdeaea; } .cal-legend.bk { background: #fff; box-shadow: inset 0 -3px 0 var(--blue); border: 1px solid var(--line); }
.admin-view-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 40; background: #fff4dc; color: #7a5200; padding: 8px 16px; font-size: 13px; display: flex; gap: 10px; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
body:has(.admin-view-bar) .layout { padding-top: 40px; }

/* Supplier rules questionnaire */
.msg.warn { background: #fff7e6; color: #92400e; }
.wz-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; }
.wz-dot { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: #eef1f6; color: var(--muted); }
.wz-dot.done { background: #e6f6ef; color: var(--green); }
.wz-dot.cur { background: var(--navy); color: #fff; }
.card.wz { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; max-width: 920px; }
.card.wz h3 { margin: 0 0 14px; font-size: 16px; }
.chk { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; align-items: flex-start; }
.chk label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.terms-group { margin-bottom: 14px; }
.terms-group h4 { margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--navy); }
