/* Divan Masa Takip — stil sistemi
   Düzen: üstte sabit çubuk (marka · sekmeler · durum), ortada kaydırılan görünüm,
   sağdan açılan masa paneli (telefonda tam ekran), telefonda altta sekme çubuğu. */
:root {
  --bg: #F1F0EC;
  --surface: #FFFFFF;
  --surface-2: #F7F6F2;
  --surface-3: #ECEAE4;
  --line: #E2DFD8;
  --line-strong: #C9C4BA;
  --fg: #1F1B1D;
  --fg-2: #5D5660;
  --fg-3: #8A838F;
  --brand: #6E1E2A;
  --brand-hover: #5A1622;
  --brand-ink: #FFFFFF;
  --brand-soft: #F5E6E8;
  --gold: #A77C25;
  --gold-soft: #F6EEDC;
  --ok: #257A58;
  --ok-soft: #DFF0E7;
  --warn: #A96A12;
  --warn-soft: #FBEDD6;
  --late: #B02A22;
  --late-soft: #FAE1DF;
  --info: #45567A;
  --info-soft: #E5E9F2;
  --shadow: 0 1px 2px rgba(31, 27, 29, .05), 0 10px 28px -14px rgba(31, 27, 29, .22);
  --shadow-lg: 0 24px 60px -24px rgba(31, 27, 29, .45);
  --radius: 12px;
  --radius-lg: 16px;
  --font-ui: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Sora", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, "SF Mono", monospace;
  --header-h: 58px;
  --tabbar-h: 62px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151316; --surface: #1E1B1F; --surface-2: #252228; --surface-3: #2D2930;
    --line: #322E36; --line-strong: #4A444F; --fg: #F2EEEF; --fg-2: #B8B1BB; --fg-3: #837C88;
    --brand: #C2495C; --brand-hover: #D25C6E; --brand-ink: #FFFFFF; --brand-soft: #3A2228;
    --gold: #D5A64A; --gold-soft: #3A3120;
    --ok: #5CC391; --ok-soft: #1C372B; --warn: #E3A447; --warn-soft: #3C2E14;
    --late: #F2776E; --late-soft: #45221F; --info: #9DB0D6; --info-soft: #273041;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 28px -14px rgba(0,0,0,.6);
    --shadow-lg: 0 24px 60px -24px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151316; --surface: #1E1B1F; --surface-2: #252228; --surface-3: #2D2930;
  --line: #322E36; --line-strong: #4A444F; --fg: #F2EEEF; --fg-2: #B8B1BB; --fg-3: #837C88;
  --brand: #C2495C; --brand-hover: #D25C6E; --brand-ink: #FFFFFF; --brand-soft: #3A2228;
  --gold: #D5A64A; --gold-soft: #3A3120;
  --ok: #5CC391; --ok-soft: #1C372B; --warn: #E3A447; --warn-soft: #3C2E14;
  --late: #F2776E; --late-soft: #45221F; --info: #9DB0D6; --info-soft: #273041;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 28px -14px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 60px -24px rgba(0,0,0,.8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--brand); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.muted { color: var(--fg-2); }
.faint { color: var(--fg-3); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.label { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
svg.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.ic.sm { width: 16px; height: 16px; }
svg.ic.lg { width: 24px; height: 24px; }

/* ---------- Kabuk ---------- */
.app { height: 100%; display: flex; flex-direction: column; }
.topbar {
  height: var(--header-h); flex: none;
  display: flex; align-items: center; gap: 18px;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: var(--brand-ink);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 18px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.14);
}
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; line-height: 1.1; white-space: nowrap; }
.brand-sub { font-size: 11.5px; color: var(--fg-3); white-space: nowrap; }
.nav { display: flex; gap: 2px; margin-inline: auto; }
.nav button {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 0 14px; height: 40px; border: 0; border-radius: 10px; background: transparent;
  color: var(--fg-2); font-weight: 600; font-size: 14px;
}
.nav button:hover { background: var(--surface-2); color: var(--fg); }
.nav button.active { background: var(--brand-soft); color: var(--brand); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--brand); color: var(--brand-ink); font-size: 11.5px; font-weight: 700;
  display: inline-grid; place-items: center; font-variant-numeric: tabular-nums;
}
.badge.warn { background: var(--warn); }
.badge.late { background: var(--late); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.clock { font-family: var(--font-mono); font-size: 15px; font-variant-numeric: tabular-nums; color: var(--fg-2); }
.status-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--fg-2);
  white-space: nowrap;
}
.status-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.status-chip.off .dot { background: var(--fg-3); }
.status-chip.warn .dot { background: var(--warn); }
.status-chip.late .dot { background: var(--late); }
.user-select {
  height: 34px; padding: 0 30px 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2);
  font-weight: 600; font-size: 13.5px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-3) 50%), linear-gradient(135deg, var(--fg-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px; background-size: 5px 5px; background-repeat: no-repeat;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2);
  display: inline-grid; place-items: center; color: var(--fg-2);
}
.icon-btn:hover { color: var(--fg); background: var(--surface-3); }

.main { flex: 1; min-height: 0; display: flex; position: relative; }
.view {
  flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior: contain;
  padding-block: 18px 32px;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
}
.view-inner { max-width: 1360px; margin-inline: auto; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.view-head h1 { font-size: 22px; }
.view-head .sub { color: var(--fg-2); font-size: 13.5px; margin-top: 2px; }

.tabbar { display: none; }

/* ---------- Düğmeler ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--fg); font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { filter: brightness(.95); background: var(--ok); }
.btn-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.btn-danger { background: var(--late-soft); border-color: transparent; color: var(--late); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--fg-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--fg); }
.btn-soft { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn-lg { height: 50px; padding: 0 20px; font-size: 15.5px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--fg-2); font-weight: 600; font-size: 13.5px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { background: var(--surface-2); }
.chip.active { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.chip .cnt { font-size: 11.5px; opacity: .75; font-variant-numeric: tabular-nums; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
  background: var(--surface-3); color: var(--fg-2);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.late { background: var(--late-soft); color: var(--late); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.pill.gold { background: var(--gold-soft); color: var(--gold); }
.pill.plain::before { display: none; }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 12.5px; font-weight: 700; color: var(--fg-2); }
.input, .select, .textarea {
  height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface);
  width: 100%; min-width: 0; font-size: 15px;
}
.textarea { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.input.mono { font-family: var(--font-mono); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 42px; height: 24px; border-radius: 12px; background: var(--line-strong); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(18px); }
.search { position: relative; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--fg-3); pointer-events: none; }
.search .input { padding-left: 38px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button { height: 38px; padding: 0 14px; border: 0; background: transparent; font-weight: 600; font-size: 13.5px; color: var(--fg-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--fg); color: var(--bg); }
.seg.block { display: flex; width: 100%; }
.seg.block button { flex: 1; padding: 0 6px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper button { width: 40px; height: 40px; border: 0; background: transparent; display: grid; place-items: center; color: var(--fg-2); }
.stepper button:hover { background: var(--surface-2); color: var(--fg); }
.stepper .val { min-width: 36px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.stepper.sm button { width: 32px; height: 32px; }
.stepper.sm .val { min-width: 28px; font-size: 14px; }

/* ---------- Kart / panel ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 15.5px; }
.card-body { padding: 18px; }
.section-title { font-size: 16px; margin: 26px 0 10px; display: flex; align-items: center; gap: 10px; }
.section-title:first-child { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.empty { padding: 40px 20px; text-align: center; color: var(--fg-3); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.empty strong { display: block; color: var(--fg-2); font-size: 15px; margin-bottom: 4px; }

/* ---------- Masalar ---------- */
.tables-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-left: auto; font-size: 12.5px; color: var(--fg-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.section-block + .section-block { margin-top: 22px; }
.section-block h2 { font-size: 14px; color: var(--fg-2); margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.section-block h2 .cnt { font-weight: 500; color: var(--fg-3); font-size: 12.5px; }
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 12px; }
.tcard {
  position: relative; text-align: left; min-height: 138px; padding: 14px 14px 12px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 8px;
  transition: transform .08s, box-shadow .12s, border-color .12s; color: var(--fg);
}
.tcard:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.tcard.bos { background: var(--surface-2); border-style: dashed; border-color: var(--line-strong); }
.tcard.bos:hover { background: var(--surface); }
.tcard.hesap { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.tcard.rezerve { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 35%, transparent); }
.tcard.dolu { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.tcard.selected { outline: 2px solid var(--brand); outline-offset: 1px; }
.tcard .t-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tcard .t-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1; }
.tcard.bos .t-name { color: var(--fg-2); }
.tcard .t-seats { font-size: 12px; color: var(--fg-3); margin-top: 4px; }
.tcard .t-timer { font-family: var(--font-mono); font-size: 24px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tcard .t-timer.long { color: var(--warn); }
.tcard .t-timer.verylong { color: var(--late); }
.tcard .t-bottom { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.tcard .t-total { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tcard .t-meta { font-size: 12px; color: var(--fg-2); display: flex; gap: 8px; align-items: center; }
.tcard .t-pending { display: flex; gap: 4px; flex-wrap: wrap; }
.tcard .t-free { margin-top: auto; font-size: 13px; color: var(--fg-3); display: flex; align-items: center; gap: 6px; }
.tcard .t-res { font-size: 13px; color: var(--info); font-weight: 600; margin-top: auto; }

/* ---------- Çekmece (masa paneli) ---------- */
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(480px, 100%);
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; transform: translateX(104%); transition: transform .22s ease;
  z-index: 20;
}
.drawer.open { transform: none; }
.drawer-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; flex: none; }
.drawer-title { display: flex; align-items: center; gap: 10px; }
.drawer-title h2 { font-size: 22px; }
.drawer-title .btn-icon { margin-left: auto; }
.drawer-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.meta-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--fg-2); }
.meta-chip .mono { font-size: 13px; color: var(--fg); }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 18px; overscroll-behavior: contain; }
.drawer-foot { flex: none; border-top: 1px solid var(--line); padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.totals { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.totals .row { display: flex; justify-content: space-between; color: var(--fg-2); }
.totals .row.total { color: var(--fg); font-weight: 700; font-size: 18px; font-family: var(--font-display); margin-top: 2px; }
.round { margin-bottom: 16px; }
.round-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--fg-3); margin-bottom: 6px; font-weight: 600; }
.round-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.line { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: start; }
.line:last-child { border-bottom: 0; }
.line .qty { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--fg-2); font-size: 14px; padding-top: 1px; }
.line .name { font-weight: 600; font-size: 14.5px; }
.line .note { font-size: 12.5px; color: var(--warn); margin-top: 1px; }
.line .price { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; font-size: 14px; }
.line .sub { grid-column: 2 / -1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.line.iptal .name, .line.iptal .price { text-decoration: line-through; color: var(--fg-3); }
.line.pick { cursor: pointer; align-items: center; padding: 8px 6px; border-radius: 10px; user-select: none; }
.line.pick:hover { background: var(--surface-2); }
.line.pick.on { background: var(--ok-soft); }
.line.pick .stepper { background: var(--surface); }
.line.ikram .price { text-decoration: line-through; color: var(--fg-3); }
.prep { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 700; font-family: var(--font-mono); font-variant-numeric: tabular-nums; background: var(--surface-3); color: var(--fg-2); }
.prep[data-state="ok"] { background: var(--ok-soft); color: var(--ok); }
.prep[data-state="warn"] { background: var(--warn-soft); color: var(--warn); }
.prep[data-state="late"] { background: var(--late-soft); color: var(--late); }
.prep[data-state="done"] { background: var(--surface-3); color: var(--fg-2); }
.line-actions { margin-left: auto; display: inline-flex; gap: 4px; }
.line-actions .btn-sm { height: 28px; padding: 0 8px; font-size: 12px; }
.more-menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; bottom: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 5; display: flex; flex-direction: column;
}
.menu-pop button { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px; border: 0; background: transparent; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--fg); text-align: left; }
.menu-pop button:hover { background: var(--surface-2); }
.menu-pop button.danger { color: var(--late); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* Menü seçici */
.picker-cats { padding: 10px 18px; border-bottom: 1px solid var(--line); flex: none; display: flex; flex-direction: column; gap: 10px; }
.item-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.icard {
  text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  display: flex; flex-direction: column; gap: 6px; min-height: 86px; color: var(--fg); position: relative;
}
.icard:hover { border-color: var(--line-strong); background: var(--surface-2); }
.icard.inCart { border-color: var(--brand); background: var(--brand-soft); }
.icard.off { opacity: .5; }
.icard .i-name { font-weight: 600; font-size: 14px; line-height: 1.25; }
.icard .i-row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; gap: 6px; }
.icard .i-price { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.icard .i-prep { font-size: 11.5px; color: var(--fg-3); display: inline-flex; align-items: center; gap: 4px; }
.icard .i-qty { position: absolute; top: 8px; right: 8px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 12px; display: grid; place-items: center; padding: 0 6px; }
.cart-list { display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow-y: auto; }
.cart-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.cart-row .c-name { font-weight: 600; font-size: 14px; }
.cart-row .c-note { grid-column: 1 / -1; }
.cart-row .c-note .input { height: 34px; font-size: 13.5px; }

/* ---------- Mutfak ---------- */
.kitchen-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.kstats { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.kstat { display: inline-flex; align-items: baseline; gap: 6px; height: 34px; padding: 0 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--fg-2); }
.kstat b { font-size: 16px; color: var(--fg); font-variant-numeric: tabular-nums; font-family: var(--font-display); }
.ticket-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ticket[data-state="warn"] { border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.ticket[data-state="late"] { border-color: var(--late); box-shadow: 0 0 0 3px var(--late-soft); }
.ticket-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.ticket-head .t-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.ticket-head .t-info { font-size: 12.5px; color: var(--fg-2); }
.ticket-head .t-elapsed { margin-left: auto; font-family: var(--font-mono); font-size: 20px; font-variant-numeric: tabular-nums; }
.ticket-head .t-elapsed[data-state="warn"] { color: var(--warn); }
.ticket-head .t-elapsed[data-state="late"] { color: var(--late); }
.tline { display: grid; grid-template-columns: 34px 1fr auto; gap: 4px 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); align-items: center; }
.tline:last-of-type { border-bottom: 0; }
.tline .qty { font-family: var(--font-display); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.tline .name { font-weight: 600; font-size: 15px; }
.tline .note { font-size: 12.5px; color: var(--warn); font-weight: 600; }
.tline .target { font-size: 11.5px; color: var(--fg-3); }
.tline .right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.tline.servis { opacity: .55; }
.tline.servis .name { text-decoration: line-through; }
.tline.hazirlaniyor { background: color-mix(in srgb, var(--gold-soft) 55%, var(--surface)); }
.ticket-foot { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Menü yönetimi ---------- */
.menu-layout { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.cat-list { display: flex; flex-direction: column; gap: 4px; }
.cat-list button { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 42px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; color: var(--fg-2); text-align: left; }
.cat-list button:hover { background: var(--surface-2); }
.cat-list button.active { background: var(--brand-soft); color: var(--brand); }
.cat-list .cnt { font-size: 12px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.r, .table th.r { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.off td { color: var(--fg-3); }
.table .actions { display: inline-flex; gap: 4px; justify-content: flex-end; }
.table-wrap { overflow-x: auto; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--surface-2); }

/* ---------- Raporlar ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi .k-label { font-size: 12px; font-weight: 700; color: var(--fg-3); letter-spacing: .06em; text-transform: uppercase; }
.kpi .k-val { font-family: var(--font-display); font-weight: 600; font-size: 26px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .k-sub { font-size: 12.5px; color: var(--fg-2); }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar { fill: var(--brand); }
.chart .bar:hover, .chart .bar.hot { fill: var(--gold); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-text { fill: var(--fg-3); font-size: 11px; font-family: var(--font-ui); }
.chart .bar-label { fill: var(--fg-2); font-size: 11px; font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
.tooltip { position: absolute; pointer-events: none; background: var(--fg); color: var(--bg); padding: 6px 10px; border-radius: 8px; font-size: 12.5px; white-space: nowrap; transform: translate(-50%, -115%); box-shadow: var(--shadow); z-index: 3; }
.tooltip b { font-variant-numeric: tabular-nums; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; font-size: 13.5px; }
.hbar .h-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .h-val { font-variant-numeric: tabular-nums; color: var(--fg-2); white-space: nowrap; }
.hbar .h-track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.hbar .h-fill { height: 100%; border-radius: 4px; background: var(--brand); }
.hbar.late .h-fill { background: var(--late); }
.hbar.warn .h-fill { background: var(--warn); }

/* ---------- Ayarlar ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.row-list { display: flex; flex-direction: column; }
.row-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.row-item:last-child { border-bottom: 0; }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .t { font-weight: 600; }
.row-item .s { font-size: 12.5px; color: var(--fg-3); }
.callout { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--fg-2); display: flex; gap: 10px; align-items: flex-start; }
.callout .ic { margin-top: 2px; color: var(--gold); }
.callout.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.callout.late { background: var(--late-soft); border-color: transparent; color: var(--late); }
.callout.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
code { font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }

/* ---------- Modal ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(20, 16, 18, .45); z-index: 40; display: grid; place-items: center; padding: 16px; backdrop-filter: blur(2px); }
.modal { width: min(520px, 100%); max-height: calc(100% - 20px); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); }
.modal.wide { width: min(760px, 100%); }
.modal-head { padding: 16px 20px 12px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; }
.modal-head .btn-icon { margin-left: auto; }
.modal-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-body > * { flex-shrink: 0; }
.modal-foot { padding: 12px 20px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.pay-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pay-btn { height: 56px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.pay-btn.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.big-total { text-align: center; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.big-total .v { font-family: var(--font-display); font-size: 34px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.big-total .l { font-size: 12.5px; color: var(--fg-3); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 280px; margin: 0 auto; }
.pinpad button { height: 56px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 20px; font-weight: 600; font-family: var(--font-display); }
.pinpad button:hover { background: var(--surface-2); }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 4px 0 10px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); }
.pin-dots i.on { background: var(--brand); border-color: var(--brand); }
.pin-err { color: var(--late); font-weight: 600; text-align: center; font-size: 13.5px; min-height: 20px; }
.toast-wrap { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); animation: toastin .18s ease; display: flex; align-items: center; gap: 8px; }
.toast.ok { background: var(--ok); color: #fff; }
.toast.late { background: var(--late); color: #fff; }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Erişim şifresi ekranı */
body.locked .topbar, body.locked .tabbar { display: none; }
.lock { min-height: 100%; display: grid; place-items: center; padding-block: 24px; }
.lock-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px 24px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); text-align: center; }
.lock-card h1 { font-size: 20px; }
.lock-card .field { text-align: left; }
.lock-card .pin-err { min-height: 18px; }

/* Adisyon yazdırma */
.receipt { font-family: var(--font-mono); font-size: 13px; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 16px; white-space: pre-wrap; line-height: 1.5; }
@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: fixed; inset: 0; padding: 10mm; background: #fff; color: #000; }
  .receipt { border: 0; background: #fff; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Telefon / tablet ---------- */
@media (max-width: 1180px) {
  .brand-sub, .status-chip .mono { display: none; }
  .nav button { padding: 0 10px; font-size: 13.5px; gap: 6px; }
  .topbar { gap: 12px; }
}
@media (max-width: 1000px) {
  .nav button span:not(.badge) { display: none; }
  .nav button { padding: 0 12px; }
  .clock { display: none; }
}
@media (max-width: 980px) {
  .menu-layout { grid-template-columns: 1fr; }
  .cat-list { flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 6px; padding-bottom: 4px; }
  .cat-list button { flex: none; height: 36px; border: 1px solid var(--line-strong); border-radius: 999px; }
  .cat-list button.active { border-color: var(--brand); }
}
@media (max-width: 820px) {
  :root { --header-h: 54px; }
  .nav, .clock, .brand-sub { display: none; }
  .topbar { gap: 10px; }
  .topbar-right { margin-left: auto; gap: 8px; }
  .topbar-right .icon-btn { display: none; }
  .user-select { max-width: 112px; }
  .brand-name { font-size: 14.5px; }
  .main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  .view { padding-block: 14px 24px; }
  .view-head h1 { font-size: 20px; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding: 0 max(8px, env(safe-area-inset-left, 0px)) env(safe-area-inset-bottom, 0px) max(8px, env(safe-area-inset-right, 0px));
    background: var(--surface); border-top: 1px solid var(--line);
    display: grid; grid-template-columns: repeat(5, 1fr); z-index: 30;
  }
  .tabbar button { position: relative; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--fg-3); padding: 0; }
  .tabbar button.active { color: var(--brand); }
  .tabbar .badge { position: absolute; top: 6px; left: calc(50% + 6px); }
  .drawer { position: fixed; top: 0; bottom: 0; width: 100%; border-left: 0; z-index: 50; }
  .table-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .tcard { min-height: 124px; padding: 12px; }
  .tcard .t-timer { font-size: 22px; }
  .tcard .t-top { flex-wrap: wrap; }
  .tcard .t-top .pill { order: -1; width: 100%; justify-content: flex-start; margin-bottom: 2px; }
  .tcard .t-seats { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tcard .t-bottom { flex-wrap: wrap; gap: 4px 8px; }
  .legend { display: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi .k-val { font-size: 22px; }
  .settings-grid { grid-template-columns: 1fr; }
  .modal { border-radius: 16px; }
  .ticket-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .status-chip { padding: 0 8px; gap: 0; }
  .status-chip .txt { display: none; }
  .table-grid { grid-template-columns: repeat(2, 1fr); }
  .item-grid { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .view-head h1 { font-size: 19px; }
}
