:root {
  --bg: #f4f6f5;
  --card: #ffffff;
  --ink: #15201d;
  --muted: #63706c;
  --line: #e2e7e5;
  --brand: #0f3d33;
  --brand-2: #1b5e4f;
  --gold: #c99a2e;
  --ozge: #b04a7a;
  --sertac: #2f62a8;
  --plus: #13834f;
  --minus: #c0392b;
  --move: #7a6a2b;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1412; --card: #16201d; --ink: #e8efec; --muted: #94a39e; --line: #26332f;
    --brand: #133f35; --brand-2: #2c8571; --ozge: #e07aa8; --sertac: #6c9ee6; --plus: #3cc184; --minus: #ef6b5d; --move: #d1bb63;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.loading { padding: 40vh 0; text-align: center; color: var(--muted); }
.hidden { display: none !important; }

header.top { background: var(--brand); color: #fff; padding: calc(14px + env(safe-area-inset-top)) 16px 18px; }
header.top .row { display: flex; justify-content: space-between; align-items: center; }
header.top h1 { font-size: 17px; margin: 0; font-weight: 650; letter-spacing: .2px; }
header.top .who { font-size: 13px; opacity: .85; }
.total-label { margin-top: 14px; font-size: 12px; opacity: .8; text-transform: uppercase; letter-spacing: .8px; }
.total { font-size: 32px; font-weight: 750; margin-top: 2px; }
.total-sub { font-size: 12.5px; opacity: .85; margin-top: 2px; }

main { padding: 14px 14px 24px; max-width: 720px; margin: 0 auto; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: -4px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.pcard .name { font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.ozge { background: var(--ozge); } .dot.sertac { background: var(--sertac); }
.pcard .bal { font-size: 19px; font-weight: 720; margin-top: 4px; }
.pcard .share { font-size: 12px; color: var(--muted); }
.bar { height: 6px; border-radius: 4px; overflow: hidden; display: flex; margin-top: 10px; background: var(--line); }
.bar span:first-child { background: var(--ozge); } .bar span:last-child { background: var(--sertac); }

h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 22px 4px 8px; font-weight: 650; }
.months { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.months::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 13px; white-space: nowrap; cursor: pointer; }
.chip.on { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.chip .lock { font-size: 11px; }

.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 11px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.item:first-child { border-top: 0; }
.item:active { background: var(--bg); }
.item .t { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 6px; }
.item .d { color: var(--muted); font-size: 12.5px; grid-column: 1 / 2; }
.item .a { font-weight: 700; text-align: right; align-self: center; grid-row: 1 / 3; grid-column: 2; }
.plus { color: var(--plus); } .minus { color: var(--minus); } .move { color: var(--move); }
.empty { padding: 26px 14px; text-align: center; color: var(--muted); font-size: 14px; }

.fab { position: fixed; right: 18px; bottom: calc(84px + env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--gold); color: #1d1606; font-size: 30px; line-height: 1; box-shadow: 0 6px 18px rgba(0,0,0,.25); cursor: pointer; }

nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
nav.tabs button { background: none; border: 0; padding: 9px 0 10px; font-size: 11.5px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
nav.tabs button .ic { font-size: 19px; line-height: 1.1; }
nav.tabs button.on { color: var(--brand-2); font-weight: 650; }

/* Rapor */
table.rep { width: 100%; border-collapse: collapse; font-size: 14px; }
table.rep th, table.rep td { padding: 8px 6px; border-top: 1px solid var(--line); text-align: right; }
table.rep th:first-child, table.rep td:first-child { text-align: left; color: var(--muted); font-weight: 500; }
table.rep thead th { border-top: 0; font-size: 12.5px; color: var(--muted); font-weight: 650; }
table.rep tr.strong td { font-weight: 750; color: var(--ink); }
table.rep tr.strong td:first-child { color: var(--ink); }
.note { font-size: 12.5px; color: var(--muted); margin: 8px 2px 0; }
.status { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 650; padding: 4px 10px; border-radius: 999px; }
.status.open { background: #fff3d6; color: #7a5600; } .status.closed { background: #dff3e8; color: #0d6a3e; }
@media (prefers-color-scheme: dark) { .status.open { background: #3a2f12; color: #f0c860; } .status.closed { background: #133a28; color: #6fdca2; } }

.btn { border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 650; cursor: pointer; background: var(--brand-2); color: #fff; width: 100%; font-size: 15px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--minus); border: 1px solid var(--minus); }
.btn.gold { background: var(--gold); color: #1d1606; }
.btn:disabled { opacity: .5; }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }

label.f { display: block; font-size: 12.5px; color: var(--muted); margin: 12px 0 5px; font-weight: 600; }
.inp { width: 100%; padding: 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg); font-size: 16px; }
.inp:focus { outline: 2px solid var(--brand-2); outline-offset: -1px; }
.amt { font-size: 22px; font-weight: 700; }
.preview { font-size: 12.5px; color: var(--muted); margin-top: 4px; min-height: 18px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.seg button { border: 1px solid var(--line); background: var(--bg); border-radius: 11px; padding: 10px 4px; font-size: 14px; cursor: pointer; }
.seg button.on { background: var(--brand-2); color: #fff; border-color: var(--brand-2); font-weight: 650; }
.hint { font-size: 12.5px; color: var(--muted); background: var(--bg); border-radius: 10px; padding: 9px 11px; margin-top: 12px; }

.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet .panel { background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.sheet .panel h3 { margin: 0 0 4px; font-size: 18px; }
.err { color: var(--minus); font-size: 13.5px; margin-top: 10px; min-height: 18px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(150px + env(safe-area-inset-bottom)); background: #15201d; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 30; max-width: 90vw; }

/* Giriş */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px; max-width: 420px; margin: 0 auto; }
.login .logo { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 14px; }
.login h1 { margin: 0; font-size: 24px; }
.login p { color: var(--muted); margin: 6px 0 18px; }
.pin { letter-spacing: 8px; text-align: center; font-size: 24px; }

/* Log */
.logitem { padding: 11px 14px; border-top: 1px solid var(--line); font-size: 13.5px; }
.logitem:first-child { border-top: 0; }
.logitem .h { display: flex; justify-content: space-between; gap: 8px; font-weight: 650; }
.logitem .h span:last-child { color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; }
.logitem .b { color: var(--muted); margin-top: 3px; }
.logitem del { color: var(--minus); } .logitem ins { color: var(--plus); text-decoration: none; }

@media print {
  nav.tabs, .fab, .noprint, .months { display: none !important; }
  body { padding: 0; background: #fff; color: #000; }
  header.top { background: #fff; color: #000; padding: 0 0 8px; border-bottom: 2px solid #000; }
  .card, .list { border-color: #999; }
}
.tablewrap { overflow-x: auto; margin: 0 -4px; }
@media (max-width: 420px) {
  table.rep { font-size: 12.5px; }
  table.rep th, table.rep td { padding: 7px 3px; }
}
