:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #f0ede6;
  --line: #e3dfd5;
  --ink: #1b2420;
  --ink-2: #5b6660;
  --ink-3: #8a938e;
  --brand: #1f5c47;
  --brand-ink: #ffffff;
  --brand-soft: #e3efe9;
  --debt: #b8402a;
  --debt-soft: #fbe9e4;
  --pay: #1d7a4c;
  --pay-soft: #e2f3ea;
  --warn: #a8670a;
  --warn-soft: #fbf0d9;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 4px 16px rgba(20, 30, 25, .05);
  --nav-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121614; --surface: #1a201d; --surface-2: #222a26; --line: #2d3632;
    --ink: #e9eeeb; --ink-2: #a9b3ae; --ink-3: #7b8580;
    --brand: #4fb48c; --brand-ink: #0d1a14; --brand-soft: #1d3329;
    --debt: #f0806a; --debt-soft: #3a2420; --pay: #5cc98f; --pay-soft: #1b3326;
    --warn: #e5b05a; --warn-soft: #3a2f1c;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.45;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); font-size: 13px; }
.debt { color: var(--debt); }
.pay { color: var(--pay); }
.boot { padding: 40vh 0; text-align: center; color: var(--ink-3); }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.shell { min-height: 100vh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 18px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { font-size: 12px; color: var(--ink-3); font-weight: 500; display: block; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; flex: none;
}
.icon-btn svg { width: 20px; height: 20px; }
.page { padding: 16px; max-width: 980px; margin: 0 auto; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--ink-3); font-weight: 600; }
.nav a svg { width: 22px; height: 22px; }
.nav a.on { color: var(--brand); }
.nav .brandline { display: none; }

@media (min-width: 900px) {
  .shell { padding-bottom: 0; padding-left: 232px; }
  .nav {
    top: 0; right: auto; width: 232px; height: auto; display: flex; flex-direction: column; gap: 4px;
    padding: 20px 12px; border-top: 0; border-right: 1px solid var(--line);
  }
  .nav .brandline { display: block; padding: 4px 12px 18px; font-weight: 700; font-size: 16px; }
  .nav .brandline small { display: block; color: var(--ink-3); font-weight: 500; font-size: 12px; }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 14px; padding: 10px 12px; border-radius: 10px; }
  .nav a.on { background: var(--brand-soft); }
  .topbar { padding-left: 24px; padding-right: 24px; }
  .page { padding: 24px; }
}

/* ---------- Cards / stats ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 16px; }
.section { margin-top: 22px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 10px; }
.section-head h2 { font-size: 15px; }
.section-head a { font-size: 13px; color: var(--brand); font-weight: 600; }

.hero { padding: 18px; background: var(--brand); color: var(--brand-ink); border: 0; }
.hero .label { font-size: 13px; opacity: .85; }
.hero .big { font-size: 34px; font-weight: 750; letter-spacing: -.5px; margin-top: 2px; }
.hero .meta { font-size: 13px; opacity: .85; margin-top: 6px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 14px; }
.stat .label { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.stat .val { font-size: 20px; font-weight: 700; margin-top: 4px; }
.stat .meta { font-size: 12px; color: var(--ink-3); }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

/* ---------- Lists ---------- */
.list { overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.row:first-child { border-top: 0; }
.row:active { background: var(--surface-2); }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .amt { font-weight: 700; text-align: right; white-space: nowrap; }
.avatar {
  width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-2); font-weight: 700; font-size: 14px;
}
.avatar.debt { background: var(--debt-soft); color: var(--debt); }
.avatar.overdue { background: var(--warn-soft); color: var(--warn); }
.empty { padding: 28px 16px; text-align: center; color: var(--ink-3); }

.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; vertical-align: 1px; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.debt { background: var(--debt-soft); color: var(--debt); }
.badge.pay { background: var(--pay-soft); color: var(--pay); }
.badge.gray { background: var(--surface-2); color: var(--ink-2); }

/* ---------- Search / chips ---------- */
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); }
.search input { padding-left: 38px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-2);
}
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Forms ---------- */
input, select, textarea {
  width: 100%; padding: 11px 12px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); outline: none; font-size: 16px;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { resize: vertical; min-height: 64px; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-weight: 600; }
.check input { width: 20px; height: 20px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; }
.seg button { border: 0; background: transparent; padding: 9px; border-radius: 9px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.amount-input { font-size: 28px; font-weight: 700; text-align: center; padding: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  font-weight: 650; cursor: pointer; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.debt { background: var(--debt); color: #fff; border-color: var(--debt); }
.btn.pay { background: var(--pay); color: #fff; border-color: var(--pay); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--debt); }
.btn.block { width: 100%; }
.btn.lg { padding: 15px 16px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- Customer detail ---------- */
.balance-card { padding: 18px; text-align: center; }
.balance-card .label { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.balance-card .big { font-size: 38px; font-weight: 780; letter-spacing: -.5px; margin: 2px 0 4px; }
.balance-card .meta { font-size: 13px; color: var(--ink-3); }
.actions2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

.txn { padding: 13px 14px; border-top: 1px solid var(--line); }
.txn:first-child { border-top: 0; }
.txn-head { display: flex; align-items: flex-start; gap: 10px; }
.txn-head .main { flex: 1; min-width: 0; }
.txn-head .title { font-weight: 650; }
.txn-head .amt { font-weight: 750; white-space: nowrap; text-align: right; }
.txn-items { margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.txn-items li { display: flex; justify-content: space-between; gap: 8px; }
.txn.deleted { opacity: .55; }
.txn.deleted .amt { text-decoration: line-through; }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; }
.dot.borc { background: var(--debt); }
.dot.odeme { background: var(--pay); }
.link-btn { border: 0; background: none; padding: 0; color: var(--ink-3); font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: underline; }

/* ---------- Veresiye (menu picker) ---------- */
.pos { display: grid; gap: 16px; }
@media (min-width: 900px) { .pos { grid-template-columns: 1fr 340px; align-items: start; } .cart { position: sticky; top: 84px; } }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 12px; }
.menu-btn {
  position: relative; text-align: left; padding: 12px; min-height: 74px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; justify-content: space-between;
}
.menu-btn:active { transform: scale(.98); }
.menu-btn .n { font-weight: 650; font-size: 14px; line-height: 1.25; }
.menu-btn .p { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.menu-btn.in { border-color: var(--brand); background: var(--brand-soft); }
.menu-btn .q {
  position: absolute; top: -7px; right: -7px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px;
  background: var(--brand); color: var(--brand-ink); font-size: 12px; font-weight: 800; display: grid; place-items: center;
}
.cart-line { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.cart-line:first-child { border-top: 0; }
.cart-line .main { flex: 1; min-width: 0; }
.cart-line .n { font-weight: 600; font-size: 14px; }
.cart-line .p { font-size: 12px; color: var(--ink-3); }
.stepper { display: flex; align-items: center; gap: 2px; background: var(--surface-2); border-radius: 10px; padding: 2px; }
.stepper button { width: 32px; height: 32px; border: 0; border-radius: 8px; background: var(--surface); font-weight: 800; font-size: 16px; cursor: pointer; }
.stepper span { min-width: 30px; text-align: center; font-weight: 700; font-size: 14px; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; margin-top: 4px; border-top: 2px solid var(--ink); }
.cart-total b { font-size: 22px; }
.savebar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 25;
  padding: 10px 16px; background: var(--surface); border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.savebar .tot { flex: 1; }
.savebar .tot small { display: block; font-size: 12px; color: var(--ink-3); }
.savebar .tot b { font-size: 20px; }
@media (min-width: 900px) { .savebar { display: none; } }
.pos-page { padding-bottom: 90px; }
@media (min-width: 900px) { .pos-page { padding-bottom: 24px; } }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; border-top: 1px solid var(--line); }
.tbl th { font-size: 12px; color: var(--ink-3); font-weight: 700; border-top: 0; }
.tbl td.r, .tbl th.r { text-align: right; }

/* ---------- Sheet (modal) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(10, 15, 12, .45); animation: fade .15s ease; }
.sheet {
  width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; background: var(--bg);
  border-radius: 20px 20px 0 0; padding: 8px 18px calc(18px + env(safe-area-inset-bottom)); animation: up .2s ease;
}
.sheet .grip { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 4px auto 12px; }
.sheet h3 { font-size: 18px; margin-bottom: 4px; }
.sheet .sheet-sub { color: var(--ink-3); font-size: 13px; margin-bottom: 14px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 8px; }
@media (min-width: 600px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 20px; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.toast { animation: fade .2s ease; }

#toast-root { position: fixed; left: 50%; transform: translateX(-50%); top: calc(12px + env(safe-area-inset-top)); z-index: 200; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: up .2s ease; }
.toast.err { background: var(--debt); color: #fff; }

/* ---------- Auth ---------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px 22px; box-shadow: var(--shadow); }
.auth-card.wide { max-width: 520px; }
.auth-card h1 { font-size: 22px; margin: 14px 0 4px; }
.auth-card p { color: var(--ink-2); margin: 0 0 18px; }
.auth-card fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 4px; margin: 0 0 14px; }
.auth-card legend { font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 0 6px; }
.auth-card form > label, .auth-card fieldset label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 10px; }
.auth-card fieldset input { margin-top: 4px; }
.brand-mark { width: 52px; height: 52px; border-radius: 15px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; font-size: 24px; }
.err-box { background: var(--debt-soft); color: var(--debt); padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.ok-box { background: var(--pay-soft); color: var(--pay); padding: 12px; border-radius: 10px; }

.fab {
  position: fixed; right: 18px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); z-index: 26;
  height: 52px; padding: 0 20px; border-radius: 16px; border: 0; background: var(--brand); color: var(--brand-ink);
  font-weight: 700; display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 8px 24px rgba(31, 92, 71, .35); cursor: pointer;
}
.fab svg { width: 20px; height: 20px; }
@media (min-width: 900px) { .fab { bottom: 28px; right: 28px; } }

@media print {
  .nav, .topbar .icon-btn, .fab, .savebar, .no-print { display: none !important; }
  .shell { padding: 0 !important; }
  body { background: #fff; }
}

/* ================= v2 ================= */
.warn { color: var(--warn); }
.nowrap { white-space: nowrap; }
.dot.indirim { background: var(--warn); }
.btn.warnbtn { background: var(--warn); color: #fff; border-color: var(--warn); }
.btn.sm { padding: 9px 10px; font-size: 13px; gap: 6px; }
.btn.sm svg { width: 16px; height: 16px; }
.actions3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.stat .val.sm { font-size: 16px; }
.alloc { margin-top: 6px; font-size: 12.5px; color: var(--pay); background: var(--pay-soft); padding: 6px 9px; border-radius: 8px; }
.list-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 2px 8px; }
.mini-select { width: auto; padding: 6px 10px; font-size: 13px; border-radius: 9px; }
.fav-card .chip { background: var(--brand-soft); border-color: transparent; color: var(--brand); margin: 0 6px 6px 0; }
.nav .desk-only { display: none; }
@media (min-width: 900px) { .nav .desk-only { display: flex; } }

/* Ekstre */
.statement { padding: 18px; }
.st-head { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.st-biz { font-size: 18px; font-weight: 800; }
.st-name { font-size: 16px; font-weight: 700; }
.st-range { font-size: 12.5px; color: var(--ink-3); margin: 10px 0 6px; }
.st-table td, .st-table th { padding: 8px 6px; vertical-align: top; }
.st-table tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.st-open td { color: var(--ink-2); font-style: italic; }
.st-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.st-total b { font-size: 22px; }

/* İşlem kaydı */
.log-row { align-items: flex-start; }
.log-time { font-size: 12.5px; color: var(--ink-3); font-weight: 700; padding-top: 2px; min-width: 62px; }
.log-text { font-size: 14px; line-height: 1.4; white-space: normal; }
.log-row .main .meta { white-space: normal; }
.log-debt { color: var(--ink); } .log-pay { color: var(--pay); } .log-warn { color: var(--warn); }

/* Karşılama ekranı */
.splash { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 24px; cursor: pointer;
  background: radial-gradient(circle at 50% 30%, #2a7a5d 0%, #123a2c 70%); animation: fade .3s ease; }
.splash.out { opacity: 0; transition: opacity .35s ease; }
.splash-card { text-align: center; color: #fff; max-width: 360px; }
.splash-photo { width: 168px; height: 168px; margin: 0 auto; border-radius: 50%; overflow: hidden; border: 5px solid #fff;
  box-shadow: 0 16px 40px rgba(0,0,0,.35); animation: wobble 1.6s ease-in-out infinite; background: #fff; display: grid; place-items: center; }
.splash-photo img { width: 100%; height: 100%; object-fit: cover; }
.splash-photo.emoji { font-size: 84px; }
.splash-badge { display: inline-block; margin-top: -14px; position: relative; padding: 6px 14px; border-radius: 999px; background: #f5c542; color: #3a2a00;
  font-weight: 800; font-size: 13px; transform: rotate(-4deg); box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.splash-line { font-size: 22px; font-weight: 800; line-height: 1.3; margin: 22px 0 14px; text-wrap: balance; animation: up .5s ease .15s both; }
.splash-foot { font-size: 12px; opacity: .7; }
@keyframes wobble { 0%,100% { transform: rotate(-4deg) scale(1); } 50% { transform: rotate(4deg) scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .splash-photo { animation: none; } }

@media print {
  .page { max-width: none; padding: 0; }
  .statement { border: 0; box-shadow: none; padding: 0; }
  .topbar { position: static; border: 0; }
  .alloc { background: none; padding: 0; }
}
.m-only, .m-only-block { display: none; }
@media (max-width: 640px) {
  .d-only { display: none; }
  .m-only { display: table-cell; }
  .m-only-block { display: block; }
  .st-table { font-size: 13.5px; }
  .st-table td:first-child { white-space: nowrap; }
  .st-sums { font-size: 13px; color: var(--ink-2); margin-top: 10px; }
}
@media print { .d-only { display: table-cell !important; } .m-only, .m-only-block { display: none !important; } }
.st-table td.num { white-space: nowrap; }

.splash-load { width: 180px; height: 6px; margin: 0 auto 12px; border-radius: 9px; background: rgba(255,255,255,.2); overflow: hidden; }
.splash-load span { display: block; height: 100%; width: 0; background: #f5c542; border-radius: 9px; animation: load 2.5s ease-out forwards; }
@keyframes load { to { width: 100%; } }

/* ================= TEMA v3: Lokanta premium görünüm ================= */
:root {
  --bg: #f5efe4; --surface: #fffdf9; --surface-2: #f3ece0; --line: #e8dfcf;
  --brand: #1d5a45; --brand-2: #2f8062; --brand-soft: #e2efe8; --gold: #e3a72f; --gold-soft: #fbf0d6;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(60, 45, 20, .05), 0 10px 30px -12px rgba(60, 45, 20, .18);
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='%231d5a45' stroke-opacity='.045' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M22 18v22M16 18v9a6 6 0 0 0 12 0v-9M22 40v22'/%3E%3Cpath d='M44 18v44M44 18c6 4 8 10 8 20h-8'/%3E%3Ccircle cx='118' cy='40' r='18'/%3E%3Ccircle cx='118' cy='40' r='11'/%3E%3Cpath d='M70 112c0-12 8-20 22-20s22 8 22 20z M66 112h52'/%3E%3Cpath d='M84 86c0-4 4-4 4-8M96 86c0-4 4-4 4-8'/%3E%3Cpath d='M20 120h28l-4 22H24z M48 126h6a5 5 0 0 1 0 10h-8'/%3E%3Cpath d='M140 100l8 24h-16z M140 124v12'/%3E%3C/g%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1412; --surface: #171e1b; --surface-2: #1f2824; --line: #2a3530;
    --brand: #4fb48c; --brand-2: #3d9c78; --brand-soft: #1b3128; --gold: #e8b65a; --gold-soft: #3a301b;
    --shadow: 0 10px 30px -14px rgba(0,0,0,.6);
    --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.035' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M22 18v22M16 18v9a6 6 0 0 0 12 0v-9M22 40v22'/%3E%3Cpath d='M44 18v44M44 18c6 4 8 10 8 20h-8'/%3E%3Ccircle cx='118' cy='40' r='18'/%3E%3Ccircle cx='118' cy='40' r='11'/%3E%3Cpath d='M70 112c0-12 8-20 22-20s22 8 22 20z M66 112h52'/%3E%3Cpath d='M84 86c0-4 4-4 4-8M96 86c0-4 4-4 4-8'/%3E%3Cpath d='M20 120h28l-4 22H24z M48 126h6a5 5 0 0 1 0 10h-8'/%3E%3Cpath d='M140 100l8 24h-16z M140 124v12'/%3E%3C/g%3E%3C/svg%3E");
  }
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 500px at -10% -10%, rgba(47,128,98,.16), transparent 60%),
    radial-gradient(700px 420px at 110% 0%, rgba(227,167,47,.16), transparent 60%),
    var(--pattern);
  background-attachment: fixed, fixed, fixed;
  letter-spacing: -.005em;
}
h1, h2, h3, .big, .val { letter-spacing: -.02em; }

/* Üst bar: buzlu cam */
.topbar { background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
.topbar h1 { font-weight: 800; }
.icon-btn { border-radius: 14px; background: color-mix(in srgb, var(--surface) 85%, transparent); box-shadow: var(--shadow); border-color: transparent; }

/* Mobil alt menü: yüzen kapsül */
@media (max-width: 899px) {
  .nav { left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); height: var(--nav-h); padding: 6px; border-radius: 22px; border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
    background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
    box-shadow: 0 12px 34px -10px rgba(30, 40, 30, .35); }
  .nav a { border-radius: 16px; transition: background .2s, color .2s; }
  .nav a.on { background: var(--brand-soft); color: var(--brand); }
  .shell { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 28px); }
  .savebar { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px); left: 10px; right: 10px; border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 12px 30px -12px rgba(0,0,0,.3); }
  .fab { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 22px); }
  #toast-root { top: calc(10px + env(safe-area-inset-top)); }
}

/* Masaüstü yan menü: koyu yeşil */
@media (min-width: 900px) {
  .nav { background: linear-gradient(180deg, #163f31 0%, #1d5a45 60%, #22684f 100%); border-right: 0; box-shadow: 8px 0 30px -18px rgba(0,0,0,.5); }
  .nav::after { content: ""; position: absolute; inset: 0; background: var(--pattern); opacity: .9; pointer-events: none; filter: invert(1); mix-blend-mode: soft-light; }
  .nav .brandline { display: grid; grid-template-columns: 36px 1fr; column-gap: 10px; align-items: center; color: #fff; font-size: 16px; font-weight: 800; line-height: 1.2; padding-top: 8px; position: relative; z-index: 1; }
  .nav .brandline::before { content: "V"; grid-row: span 2; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--gold); color: #3a2a00; font-weight: 900; }
  .nav .brandline small { color: rgba(255,255,255,.6); margin-top: 2px; }
  .nav a { color: rgba(255,255,255,.72); position: relative; z-index: 1; }
  .nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
  .nav a.on { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
}

/* Kartlar */
.card { border-radius: var(--radius); border-color: color-mix(in srgb, var(--line) 80%, transparent); background: color-mix(in srgb, var(--surface) 94%, transparent); }
.section-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); font-weight: 800; }
.section-head h2 .faint { text-transform: none; letter-spacing: 0; }

/* Ana kart (toplam alacak) */
.hero { position: relative; overflow: hidden; padding: 22px; border-radius: 22px;
  background: radial-gradient(120% 140% at 100% 0%, #2f8062 0%, #1d5a45 45%, #143f30 100%); color: #fff;
  box-shadow: 0 18px 40px -18px rgba(20, 63, 48, .7); }
.hero::before { content: ""; position: absolute; width: 220px; height: 220px; right: -60px; top: -80px; border-radius: 50%; background: radial-gradient(circle, rgba(227,167,47,.55), transparent 65%); }
.hero::after { content: ""; position: absolute; inset: 0; background: var(--pattern); filter: invert(1); opacity: .35; mix-blend-mode: soft-light; }
.hero > * { position: relative; z-index: 1; }
.hero .label { text-transform: uppercase; letter-spacing: .08em; font-size: 11.5px; font-weight: 800; opacity: .75; }
.hero .big { font-size: 40px; font-weight: 800; }
.hero .meta { display: inline-block; margin-top: 10px; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.12); opacity: 1; font-weight: 600; }

/* İstatistik kutuları */
.stat { position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--line); }
.stats .stat:nth-child(1)::before { background: var(--debt); }
.stats .stat:nth-child(2)::before { background: var(--pay); }
.stats .stat:nth-child(3)::before { background: var(--gold); }
.stats .stat:nth-child(4)::before { background: var(--brand-2); }
.stat .label { text-transform: uppercase; letter-spacing: .05em; font-size: 11px; font-weight: 800; color: var(--ink-3); }
.stat .val { font-weight: 800; }

/* Butonlar */
.btn { border-radius: 14px; transition: transform .12s ease, box-shadow .2s ease, filter .2s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(135deg, var(--brand-2), var(--brand)); box-shadow: 0 8px 20px -10px rgba(29, 90, 69, .8); }
.btn.debt { background: linear-gradient(135deg, #d4573c, #a9361f); border-color: transparent; box-shadow: 0 10px 22px -12px rgba(169, 54, 31, .9); }
.btn.pay { background: linear-gradient(135deg, #2aa065, #1a7346); border-color: transparent; box-shadow: 0 10px 22px -12px rgba(26, 115, 70, .9); }
.btn.warnbtn { background: linear-gradient(135deg, #e8ad3b, #c27f0e); border-color: transparent; }
.btn:not(.primary):not(.debt):not(.pay):not(.warnbtn):not(.ghost) { background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow); border-color: transparent; }
.btn:hover { filter: brightness(1.04); }
.quick .btn { padding: 18px 14px; font-size: 16px; border-radius: 18px; }
.fab { border-radius: 18px; background: linear-gradient(135deg, var(--brand-2), var(--brand)); box-shadow: 0 14px 30px -10px rgba(29, 90, 69, .7), 0 0 0 4px color-mix(in srgb, var(--gold) 35%, transparent); }

/* Listeler */
.row { transition: background .15s; }
.row:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.avatar { border-radius: 14px; background: linear-gradient(135deg, var(--brand-soft), color-mix(in srgb, var(--brand-soft) 50%, var(--surface))); color: var(--brand); font-weight: 800; }
.avatar.debt { background: linear-gradient(135deg, var(--debt-soft), color-mix(in srgb, var(--debt-soft) 50%, var(--surface))); }
.avatar.overdue { background: linear-gradient(135deg, var(--warn-soft), var(--gold-soft)); }
.badge { padding: 3px 8px; letter-spacing: .01em; }

/* Çipler ve arama */
.chip { border-color: transparent; background: color-mix(in srgb, var(--surface) 90%, transparent); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 6px 14px -8px rgba(29, 90, 69, .9); }
.search input { border-radius: 14px; box-shadow: var(--shadow); border-color: transparent; background: color-mix(in srgb, var(--surface) 95%, transparent); }
input, select, textarea { border-radius: 13px; }

/* Müşteri bakiye kartı */
.balance-card { position: relative; overflow: hidden; background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, transparent), var(--surface)); }
.balance-card::before { content: ""; position: absolute; left: 50%; top: -120px; width: 320px; height: 220px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--gold) 22%, transparent), transparent 70%); pointer-events: none; }
.balance-card > * { position: relative; }
.balance-card .big { font-size: 44px; font-weight: 800; }

/* Menü ızgarası */
.menu-btn { border-radius: 16px; border-color: transparent; background: color-mix(in srgb, var(--surface) 95%, transparent); box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .2s; }
.menu-btn:hover { transform: translateY(-2px); }
.menu-btn .n { font-weight: 700; }
.menu-btn .p { color: var(--brand); font-weight: 700; }
.menu-btn.in { background: linear-gradient(135deg, var(--brand-soft), color-mix(in srgb, var(--brand-soft) 40%, var(--surface))); box-shadow: 0 0 0 2px var(--brand), var(--shadow); }
.menu-btn .q { background: var(--gold); color: #3a2a00; box-shadow: 0 4px 10px -4px rgba(0,0,0,.35); }
.cart-total { border-top-color: var(--brand); }
.cart-total b { color: var(--brand); }

/* Giriş ekranı */
.auth-body { position: relative; overflow: hidden; background:
    radial-gradient(600px 400px at 85% 10%, rgba(227,167,47,.45), transparent 60%),
    radial-gradient(800px 600px at 0% 100%, rgba(47,128,98,.9), transparent 60%),
    linear-gradient(160deg, #143f30 0%, #1d5a45 55%, #123528 100%); }
.auth-body::before { content: ""; position: absolute; inset: 0; background: var(--pattern); filter: invert(1); opacity: .5; mix-blend-mode: soft-light; }
.auth-card { position: relative; z-index: 1; border: 1px solid rgba(255,255,255,.35); border-radius: 26px; padding: 34px 26px 28px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.55); }
.auth-card h1 { font-size: 26px; font-weight: 800; }
.brand-mark { width: 60px; height: 60px; border-radius: 18px; font-size: 28px; font-weight: 900;
  background: linear-gradient(135deg, var(--gold), #c98a14); color: #3a2a00; box-shadow: 0 10px 24px -10px rgba(201, 138, 20, .9); }
.auth-card .btn.lg { padding: 16px; font-size: 16px; margin-top: 6px; }
.auth-card::after { content: "Veresiye Defteri · Efe Baloğlu"; position: absolute; left: 0; right: 0; bottom: -34px; text-align: center; font-size: 12px; color: rgba(255,255,255,.65); }

/* Alt sayfa geçiş animasyonu */
.page { animation: pageIn .28s ease both; }
@keyframes pageIn { from { opacity: 0; } }
.page:has(.fab) { padding-bottom: 120px; }
@media (prefers-reduced-motion: reduce) { .page, .btn, .menu-btn { animation: none; transition: none; } }

@media print { body { background: #fff !important; } .hero::after, .hero::before, .balance-card::before { display: none; } }

/* Menü v3 */
.menu-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-n { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 2px; border-radius: 999px; font-size: 11px; background: color-mix(in srgb, currentColor 14%, transparent); }
.tpl-cat { margin-bottom: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.tpl-head { margin: 0 0 6px; font-weight: 800; }
.tpl-item { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.tpl-item input { width: 18px; height: 18px; }
.tpl-item .num { color: var(--brand); font-weight: 700; }
.tpl-item.ex { opacity: .5; }
.tpl-item.ex .num { color: var(--ink-3); font-weight: 500; font-size: 12px; }

/* Lokanta (şube) seçimi */
.branchbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding: 5px; margin: 0 0 16px; border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 80%, transparent); box-shadow: var(--shadow); }
.bpill { border: 0; padding: 11px 8px; border-radius: 12px; background: transparent; font-weight: 800; font-size: 14px; color: var(--ink-2); cursor: pointer; line-height: 1.2; }
.bpill.on { color: #fff; box-shadow: 0 8px 18px -10px rgba(0,0,0,.6); }
.bpill.b0.on, .bav.b0 { background: linear-gradient(135deg, #2f8062, #1d5a45); }
.bpill.b1.on, .bav.b1 { background: linear-gradient(135deg, #a83a3a, #7a2323); }
.bpill.b2.on, .bav.b2 { background: linear-gradient(135deg, #2f5d9a, #1f3f6b); }
.bpill.b3.on, .bav.b3 { background: linear-gradient(135deg, #a8702c, #7a4b1c); }
.bav { color: #fff !important; }
.bover { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.bcard { text-align: left; padding: 14px; cursor: pointer; display: grid; gap: 2px; border: 2px solid transparent; font: inherit; color: inherit; }
.bcard.on { border-color: var(--brand); }
.bcard .bname { font-weight: 800; font-size: 13px; }
.bcard .bval { font-size: 20px; font-weight: 800; }
.bcard .bmeta { font-size: 12px; color: var(--ink-3); }
.bcard.b1 .bval { color: #9a3232; } .bcard.b0 .bval { color: #1d5a45; }

/* Et lokantası defteri açıkken uygulama bordo tona geçer (yanlış deftere yazmayı önler) */
body[data-bi="1"] { --brand: #8a2b2b; --brand-2: #b04545; --brand-soft: #f6e3e1; }
body[data-bi="2"] { --brand: #1f3f6b; --brand-2: #2f5d9a; --brand-soft: #e2eaf5; }
body[data-bi="3"] { --brand: #7a4b1c; --brand-2: #a8702c; --brand-soft: #f5eadb; }
body[data-bi="1"] .hero { background: radial-gradient(120% 140% at 100% 0%, #b04545 0%, #8a2b2b 45%, #5a1818 100%); box-shadow: 0 18px 40px -18px rgba(90, 24, 24, .7); }
body[data-bi="2"] .hero { background: radial-gradient(120% 140% at 100% 0%, #2f5d9a 0%, #1f3f6b 45%, #142a48 100%); }
body[data-bi="3"] .hero { background: radial-gradient(120% 140% at 100% 0%, #a8702c 0%, #7a4b1c 45%, #4f3010 100%); }
@media (min-width: 900px) {
  body[data-bi="1"] .nav { background: linear-gradient(180deg, #4f1515 0%, #7a2323 60%, #8a2b2b 100%); }
  body[data-bi="2"] .nav { background: linear-gradient(180deg, #132a48 0%, #1f3f6b 60%, #2a4f82 100%); }
  body[data-bi="3"] .nav { background: linear-gradient(180deg, #4a2d0e 0%, #7a4b1c 60%, #8c5a26 100%); }
}
@media (prefers-color-scheme: dark) {
  body[data-bi="1"] { --brand: #e08a7e; --brand-2: #c76a5e; --brand-soft: #3a1f1d; }
  body[data-bi="2"] { --brand: #8fb3e6; --brand-2: #6b95cf; --brand-soft: #1b2a3e; }
  body[data-bi="3"] { --brand: #e0b07a; --brand-2: #c4924f; --brand-soft: #3a2b18; }
}
.pos > * { min-width: 0; }
