/* Anka Adisyon — arayüz */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef0f4;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --primary: #0f172a;
  --primary-hover: #1e293b;
  --on-primary: #ffffff;
  --brand: #f26b1d;
  --brand-hover: #e05d12;
  --brand-soft: #fff3eb;
  --brand-ring: rgba(242, 107, 29, .22);
  --free: #12a150;
  --free-soft: #ecfdf3;
  --busy: #e8590c;
  --busy-soft: #fff5ed;
  --success: #12a150;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 12px rgba(16, 24, 40, .05);
  --shadow-lg: 0 20px 48px -12px rgba(16, 24, 40, .28);
  --r: 16px;
  --r-sm: 12px;
  --nav-h: 66px;
  --top-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12;
    --surface: #13161d;
    --surface-2: #181c24;
    --surface-3: #1f242e;
    --text: #edf0f5;
    --text-2: #c5ccd8;
    --muted: #8b94a6;
    --border: #252b36;
    --border-strong: #323a48;
    --primary: #f1f4f9;
    --primary-hover: #ffffff;
    --on-primary: #0b0d12;
    --brand: #ff8a3d;
    --brand-hover: #ff9b57;
    --brand-soft: #2a1a10;
    --brand-ring: rgba(255, 138, 61, .25);
    --free: #34d27b;
    --free-soft: #0f2419;
    --busy: #ff8a3d;
    --busy-soft: #24170e;
    --success: #22b866;
    --danger: #f87171;
    --danger-soft: #2a1414;
    --warn: #fbbf24;
    --warn-soft: #261d0b;
    --shadow-xs: none;
    --shadow: 0 1px 0 rgba(255, 255, 255, .02);
    --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  font-feature-settings: "cv11", "ss01";
}
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: 24px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Butonlar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: var(--surface-3); color: var(--text);
  font-weight: 600; font-size: 14.5px; white-space: nowrap; letter-spacing: -.005em;
  transition: transform .08s ease, background .15s ease, box-shadow .15s, opacity .15s;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-brand, .btn-success { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -6px var(--brand-ring), var(--shadow-xs); }
.btn-brand:hover, .btn-success:hover { background: var(--brand-hover); }
.btn-success { background: var(--success); box-shadow: var(--shadow-xs); }
.btn-success:hover { background: var(--success); filter: brightness(1.05); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-text-danger { background: transparent; color: var(--danger); padding: 0 10px; }
.btn-lg { min-height: 54px; font-size: 16px; border-radius: 14px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 11px;
  border: 0; background: transparent; color: var(--text-2);
  transition: background .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

/* ---------- Formlar ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea, .input {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); outline: none; box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s;
  font-size: 16px; /* iOS yakınlaştırma engeli */
}
.field input:focus, .field select:focus, .input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; color: var(--text-2); }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.hint { font-size: 13px; color: var(--muted); }
.form-title { font-size: 15px; margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--border); }
.form-title:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
textarea.code { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12px; padding: 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 14px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; font-size: 14px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { width: 44px; height: 26px; border-radius: 99px; background: var(--border-strong); position: relative; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + i { background: var(--success); }
.switch input:checked + i::after { transform: translateX(18px); }

.alert { padding: 12px 14px; border-radius: var(--r-sm); font-size: 14px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-err { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 20%, transparent); }
.alert-ok { background: var(--free-soft); color: var(--free); border-color: color-mix(in srgb, var(--free) 20%, transparent); }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 20%, transparent); }

/* ---------- Giriş / kurulum ---------- */
.auth-page {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(900px 480px at 85% -10%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%),
    radial-gradient(700px 420px at -10% 110%, color-mix(in srgb, var(--brand) 8%, transparent), transparent 70%),
    var(--bg);
}
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 32px 24px; box-shadow: var(--shadow-lg); }
.auth-card.wide { max-width: 560px; }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.auth-brand.center { flex-direction: column; text-align: center; gap: 6px; }
.auth-brand.center img { margin-bottom: 8px; }
.auth-brand img { border-radius: 16px; box-shadow: 0 10px 24px -8px var(--brand-ring); }
.auth-brand h1 { font-size: 22px; }
.auth-foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 18px; }
.checks { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.checks li { padding: 4px 10px; border-radius: 99px; font-weight: 600; }
.checks .ok { background: var(--free-soft); color: var(--free); }
.checks .bad { background: var(--danger-soft); color: var(--danger); }

/* ---------- Uygulama iskeleti ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h); padding: 0 16px;
  display: flex; align-items: center; gap: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16.5px; letter-spacing: -.02em; min-width: 0; }
.brand img { border-radius: 10px; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.clock { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; padding: 0 6px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 4px;
  border-radius: 99px; border: 1px solid var(--border); background: var(--surface);
  font-size: 14px; font-weight: 600; max-width: 180px; transition: background .15s;
}
.user-chip:hover { background: var(--surface-2); }
.user-chip .avatar { width: 30px; height: 30px; font-size: 13px; }
.user-chip .uname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip svg { width: 16px; height: 16px; color: var(--muted); }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--nav-h) + var(--safe-b)); padding: 0 8px var(--safe-b);
  background: var(--surface); border-top: 1px solid var(--border);
}
.nav a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.nav a svg { width: 22px; height: 22px; }
.nav a.active { color: var(--brand); }
.nav a.active::before { content: ""; position: absolute; top: -1px; left: 30%; right: 30%; height: 3px; border-radius: 0 0 4px 4px; background: var(--brand); }
.view { padding: 20px 16px calc(var(--nav-h) + var(--safe-b) + 28px); max-width: 1320px; margin: 0 auto; }

@media (min-width: 900px) {
  .topbar { padding: 0 24px; }
  .nav {
    position: static; height: auto; padding: 4px; display: flex; gap: 2px;
    background: var(--surface-3); border: 0; border-radius: 13px; margin-left: 20px;
  }
  .nav a { flex-direction: row; gap: 8px; padding: 7px 14px; border-radius: 10px; font-size: 14px; color: var(--text-2); }
  .nav a svg { width: 18px; height: 18px; }
  .nav a:hover { color: var(--text); }
  .nav a.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(16,24,40,.1); }
  .nav a.active::before { display: none; }
  .view { padding: 28px 24px 48px; }
  .only-mobile { display: none !important; }
}
@media (max-width: 520px) {
  .clock { display: none; }
  .user-chip .uname { display: none; }
  .user-chip { padding: 0 8px 0 4px; }
}

/* ---------- Sayfa ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin-top: 4px; font-size: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); }
.section { padding: 20px; margin-bottom: 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.narrow { max-width: 640px; margin: 0 auto; }
.loading { display: grid; place-items: center; padding: 64px 0; color: var(--muted); }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--border); border-top-color: var(--brand); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); font-size: 14px; }
.empty svg { width: 36px; height: 36px; stroke-width: 1.5; margin-bottom: 10px; opacity: .6; }

/* ---------- Masalar ---------- */
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.summary .sbox { padding: 12px 14px; }
.summary .sbox .k { font-size: 12.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.summary .sbox .v { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.summary .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
@media (min-width: 900px) { .summary { grid-template-columns: repeat(3, minmax(0, 220px)); } }

.table-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 560px) { .table-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .table-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; } }

.tcard {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  min-height: 112px; padding: 14px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow); transition: transform .1s ease, border-color .15s, box-shadow .15s;
}
.tcard:active { transform: scale(.97); }
@media (hover: hover) { .tcard:hover { border-color: var(--border-strong); box-shadow: 0 8px 24px -10px rgba(16,24,40,.2); } }
.tc-top { display: flex; align-items: flex-start; justify-content: space-between; }
.tcard .tlabel { font-size: 12px; font-weight: 500; color: var(--muted); }
.tcard .tno { font-size: 28px; font-weight: 700; line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tcard .sdot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--free); padding: 3px 8px; border-radius: 99px; background: var(--free-soft); }
.tcard .sdot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tcard .tamount { font-size: 17px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.tcard .ttime { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.tcard .ttime svg { width: 13px; height: 13px; }
.tcard .tempty { font-size: 13px; color: var(--muted); }
@media (max-width: 559px) {
  .tcard { padding: 12px; min-height: 104px; }
  .tcard .sdot { font-size: 0; padding: 0; background: none; gap: 0; }
  .tcard .sdot::before { width: 9px; height: 9px; margin-top: 4px; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
  .tcard .tempty { font-size: 12px; }
}
.tcard.busy { background: linear-gradient(180deg, var(--busy-soft), var(--surface) 120%); border-color: color-mix(in srgb, var(--busy) 38%, var(--border)); }
.tcard.busy .sdot { color: var(--busy); background: color-mix(in srgb, var(--busy) 12%, transparent); }

/* ---------- Adisyon ekranı ---------- */
.order-layout { display: grid; gap: 16px; }
@media (min-width: 900px) {
  .order-layout { grid-template-columns: minmax(340px, 420px) 1fr; align-items: start; gap: 20px; }
  .order-panel { position: sticky; top: calc(var(--top-h) + 28px); max-height: calc(100vh - var(--top-h) - 56px); }
}
.order-panel { display: flex; flex-direction: column; overflow: hidden; }
.order-head { display: flex; align-items: center; gap: 6px; padding: 12px 10px 12px 8px; border-bottom: 1px solid var(--border); }
.order-head .oh-title { flex: 1; min-width: 0; }
.order-head h1 { font-size: 20px; }
.order-head .oh-title .muted { font-size: 13px; margin-top: 2px; }
.order-items { flex: 1; overflow-y: auto; min-height: 120px; }
.oi { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.oi:last-child { border-bottom: 0; }
.oi-main { grid-row: span 2; min-width: 0; }
.oi-name { font-weight: 600; }
.oi-sub { font-size: 13px; margin-top: 2px; }
.oi-amt { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.oi .stepper { grid-column: 2; justify-self: end; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 11px; background: var(--surface); overflow: hidden; box-shadow: var(--shadow-xs); }
.stepper button { width: 38px; height: 34px; border: 0; background: transparent; display: grid; place-items: center; color: var(--text-2); }
.stepper button:active { background: var(--surface-3); }
.stepper button svg { width: 16px; height: 16px; }
.stepper button.del { color: var(--danger); }
.stepper button:disabled { opacity: .35; }
.stepper span { min-width: 28px; text-align: center; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.order-foot { padding: 16px; border-top: 1px solid var(--border); background: var(--surface); display: grid; gap: 12px; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; }
.total-row span { color: var(--muted); font-weight: 500; font-size: 14px; }
.total-row strong { font-size: 28px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.foot-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 900px) { .foot-actions { grid-template-columns: 1fr; } }
@media (max-width: 899px) {
  /* overflow:clip kaydırma alanı oluşturmaz; alt çubuk ekrana yapışabilir */
  .order-panel { min-height: calc(100vh - var(--top-h) - var(--nav-h) - 52px); overflow: clip; }
  .order-foot { position: sticky; bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 2; box-shadow: 0 -8px 20px -12px rgba(16,24,40,.18); border-radius: 0 0 var(--r) var(--r); }
}

.empty-table { text-align: center; padding: 44px 20px; display: grid; gap: 12px; justify-items: center; }
.empty-table .big-no { width: 88px; height: 88px; border-radius: 24px; display: grid; place-items: center; font-size: 38px; font-weight: 700; letter-spacing: -.03em; background: var(--free-soft); color: var(--free); margin-bottom: 4px; }
.empty-table .btn { margin-top: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.back-link:hover { color: var(--text); }

/* ---------- Ürün seçici ---------- */
.picker { display: flex; flex-direction: column; overflow: hidden; }
.picker-head { display: flex; gap: 8px; align-items: center; padding: 14px 14px 10px; }
.search { flex: 1; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 46px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); background: var(--surface); }
.search svg { width: 18px; height: 18px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.chips { display: flex; gap: 6px; padding: 4px 14px 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: 13.5px; color: var(--text-2); transition: all .15s; }
.chip:hover { border-color: var(--border-strong); }
.chip.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.pbody { overflow-y: auto; padding: 14px; flex: 1; }
.pgroup + .pgroup { margin-top: 20px; }
.pgroup h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 2px 10px; }
.pgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 480px) { .pgrid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .pgrid { grid-template-columns: repeat(4, 1fr); } }
.pbtn {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 8px;
  min-height: 76px; padding: 12px 13px; text-align: left;
  border: 1px solid var(--border); border-radius: 13px; background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: transform .08s ease, border-color .15s, background .15s, box-shadow .15s;
}
.pbtn:active { transform: scale(.96); }
@media (hover: hover) { .pbtn:hover { border-color: var(--border-strong); box-shadow: 0 6px 16px -8px rgba(16,24,40,.2); } }
.pbtn .pname { font-weight: 600; font-size: 14.5px; line-height: 1.25; }
.pbtn .pprice { font-size: 14px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.pbtn .pbadge {
  position: absolute; top: 8px; right: 8px; min-width: 24px; height: 24px; padding: 0 7px;
  border-radius: 99px; background: var(--brand); color: #fff;
  font-size: 12px; font-weight: 700; display: grid; place-items: center;
}
.pbtn .pbadge:empty { display: none; }
.pbtn.in-order { border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); background: var(--brand-soft); }
.pbtn.in-order .pprice { color: var(--brand); }
.pbtn.pop { animation: pop .25s ease; }
@keyframes pop { 50% { transform: scale(.94); } }
.picker-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--border); background: var(--surface); }
.picker-foot strong { font-size: 19px; color: var(--text); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.picker-foot .btn { min-width: 128px; }

@media (min-width: 900px) {
  .picker { max-height: calc(100vh - var(--top-h) - 56px); position: sticky; top: calc(var(--top-h) + 28px); }
  .picker-backdrop { display: none; }
}
@media (max-width: 899px) {
  .picker {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: 88vh; height: 88dvh; border-radius: 22px 22px 0 0; border-bottom: 0;
    transform: translateY(105%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
    box-shadow: var(--shadow-lg);
  }
  .picker::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 9px; background: var(--border-strong); margin: 8px auto 0; flex-shrink: 0; }
  .picker.open { transform: none; }
  .picker-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(9, 12, 18, .5); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .picker-backdrop.open { opacity: 1; pointer-events: auto; }
}

/* ---------- Modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(9, 12, 18, .5); opacity: 0; transition: opacity .2s; }
.modal {
  position: relative; width: 100%; max-width: 460px; max-height: 92vh; max-height: 92dvh; overflow-y: auto;
  background: var(--surface); border-radius: 22px 22px 0 0; padding: 22px 20px calc(20px + var(--safe-b));
  box-shadow: var(--shadow-lg); transform: translateY(30px); opacity: 0; transition: transform .24s cubic-bezier(.2,.8,.2,1), opacity .2s;
}
.modal-wrap.show .modal-backdrop { opacity: 1; }
.modal-wrap.show .modal { transform: none; opacity: 1; }
@media (min-width: 600px) {
  .modal-wrap { align-items: center; padding: 20px; }
  .modal { border-radius: 20px; padding-bottom: 22px; border: 1px solid var(--border); }
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.modal-head h2 { font-size: 18px; }
.modal-head .icon-btn { margin: -8px -8px -8px 0; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }
.modal-text { color: var(--muted); font-size: 14.5px; }

.sheet-list { display: grid; gap: 4px; }
.sheet-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 0 12px; border-radius: 12px; border: 0; background: transparent; font-weight: 600; font-size: 14.5px; text-align: left; color: var(--text); }
.sheet-item svg { color: var(--muted); }
.sheet-item:hover, .sheet-item:active { background: var(--surface-3); }
.sheet-item.danger, .sheet-item.danger svg { color: var(--danger); }
.sheet-sep { height: 1px; background: var(--border); margin: 6px 0; }
.profile { display: flex; align-items: center; gap: 12px; padding: 4px 4px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.profile .avatar { width: 44px; height: 44px; font-size: 17px; }
.profile b { display: block; font-size: 16px; }

.bill { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 14px; }
.bill-items { max-height: 30vh; overflow-y: auto; padding: 4px 0; }
.bill-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 14px; font-size: 14px; }
.bill-row .q { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 8px; font-weight: 600; }
.bill-row b { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.bill-sum { background: var(--surface-2); padding: 12px 14px; display: grid; gap: 10px; border-top: 1px solid var(--border); }
.bill-sum .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.bill-sum .grand { font-size: 15px; font-weight: 600; padding-top: 10px; border-top: 1px dashed var(--border-strong); }
.bill-sum .grand strong { font-size: 30px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--text); }
.input-suffix { position: relative; width: 132px; }
.input-suffix input { width: 100%; height: 40px; padding: 0 30px 0 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); text-align: right; font-size: 16px; outline: none; font-variant-numeric: tabular-nums; }
.input-suffix input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.input-suffix span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
.change { font-weight: 700; color: var(--success); font-variant-numeric: tabular-nums; }
.cash-box { border: 1px solid var(--border); border-radius: 14px; margin-bottom: 16px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 14px; background: var(--surface-3); border-radius: 14px; }
.seg button { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: 11px; border: 0; background: transparent; font-weight: 600; color: var(--text-2); transition: all .15s; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.seg button.active svg { color: var(--brand); }

.move-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.move-grid button { height: 56px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); font-weight: 700; font-size: 18px; box-shadow: var(--shadow-xs); }
.move-grid button:hover { border-color: var(--free); color: var(--free); background: var(--free-soft); }

/* ---------- Bildirim ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-b) + 14px); z-index: 200; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: #111827; color: #fff; font-weight: 500; font-size: 14px; box-shadow: var(--shadow-lg); animation: toastIn .22s ease; }
.toast svg { width: 18px; height: 18px; color: #4ade80; }
.toast.err { background: #b91c1c; }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .2s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Ayarlar ---------- */
.settings-grid { display: grid; gap: 16px; }
@media (min-width: 1000px) { .settings-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.counter { display: flex; align-items: center; gap: 8px; }
.counter input { width: 92px; text-align: center; font-weight: 700; font-size: 20px; }
.counter .btn { width: 46px; padding: 0; }
.cat-block { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.cat-block + .cat-block { margin-top: 12px; }
.cat-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cat-head h3 { flex: 1; font-size: 14.5px; }
.cat-head .muted { font-size: 13px; font-weight: 500; }
.prow { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--border); background: var(--surface); text-align: left; }
.prow:last-child { border-bottom: 0; }
.prow:hover { background: var(--surface-2); }
.prow .pn { flex: 1; font-weight: 500; font-size: 14.5px; }
.prow .pp { font-weight: 600; font-variant-numeric: tabular-nums; }
.prow.off .pn { color: var(--muted); text-decoration: line-through; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); color: var(--muted); }
.tag.red { background: var(--danger-soft); color: var(--danger); }
.tag.green { background: var(--free-soft); color: var(--free); }
.tag.amber { background: var(--warn-soft); color: var(--warn); }
.urow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.urow:last-child { border-bottom: 0; }
.urow .un { flex: 1; font-weight: 600; font-size: 14.5px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: linear-gradient(135deg, #fb923c, #e2412b); color: #fff; font-weight: 700; text-transform: uppercase; }

/* ---------- Rapor ---------- */
.range { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 20px; }
.range .input { width: auto; min-height: 40px; padding: 6px 12px; font-size: 14px; }
.range .chips { padding: 0; border: 0; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 16px 18px; }
.stat .k { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat .v { font-size: 24px; font-weight: 700; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat.hero { background: linear-gradient(135deg, #f97316, #e2412b); color: #fff; border-color: transparent; box-shadow: 0 12px 28px -12px rgba(226, 65, 43, .55); }
.stat.hero .k, .stat.hero .s { color: rgba(255,255,255,.85); }
.report-grid { display: grid; gap: 16px; }
@media (min-width: 1000px) { .report-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 11px 6px; border-bottom: 1px solid var(--border); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar { height: 4px; border-radius: 4px; background: var(--brand); margin-top: 6px; opacity: .55; }
.orow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 6px; border: 0; border-bottom: 1px solid var(--border); background: transparent; text-align: left; border-radius: 0; }
.orow:last-child { border-bottom: 0; }
.orow:hover { background: var(--surface-2); }
.orow .ot { width: 42px; height: 42px; border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.orow .om { flex: 1; min-width: 0; }
.orow .om div:last-child { font-size: 13px; color: var(--muted); margin-top: 1px; }
.orow .oa { font-weight: 700; font-variant-numeric: tabular-nums; }
.orow.cancel .oa { color: var(--muted); text-decoration: line-through; }
