:root {
  --primary: #8c2f39; --primary-d: #6e232c; --gold: #c9973a; --bg: #faf6f1; --card: #fff;
  --text: #2b2220; --muted: #7a6d68; --line: #eadfd6; --green: #2e7d4f; --red: #c0392b; --blue: #2c6a9a;
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: env(safe-area-inset-bottom); }
h1, h2, h3 { margin: 0 0 .5rem; }
button, input, select, textarea { font: inherit; }
a { color: var(--primary); text-decoration: none; }

/* Düzen */
.topbar { position: sticky; top: 0; z-index: 5; background: var(--primary); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; display: flex; align-items: center; gap: 10px; }
.topbar .logo { font-weight: 800; letter-spacing: .08em; font-size: 1.15rem; }
.topbar .logo small { color: var(--gold); font-weight: 600; margin-left: 6px; }
.topbar .sp { flex: 1; }
.topbar button { background: transparent; border: 1px solid rgba(255,255,255,.5); color: #fff; border-radius: 8px; padding: 4px 10px; }
main { padding: 14px 14px 92px; max-width: 1100px; margin: 0 auto; }
.nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 6; }
.nav a { flex: 1; text-align: center; padding: 8px 2px 7px; color: var(--muted); font-size: .72rem; }
.nav a b { display: block; font-size: 1.35rem; line-height: 1.2; }
.nav a.on { color: var(--primary); font-weight: 700; }
@media (min-width: 900px) {
  .nav { top: 52px; bottom: 0; right: auto; width: 190px; flex-direction: column; border-top: 0; border-right: 1px solid var(--line); padding: 12px 0; }
  .nav a { text-align: left; padding: 12px 22px; font-size: 1rem; }
  .nav a b { display: inline; margin-right: 10px; font-size: 1.15rem; }
  main { margin-left: 210px; margin-right: 20px; max-width: none; padding-bottom: 40px; }
}

/* Bileşenler */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.stat { border-radius: var(--radius); padding: 14px; color: #fff; min-height: 96px; }
.stat .l { font-size: .85rem; opacity: .92; }
.stat .v { font-size: 1.55rem; font-weight: 800; margin-top: 6px; word-break: break-word; }
.stat .s { font-size: .78rem; opacity: .9; margin-top: 2px; }
.c1 { background: linear-gradient(135deg, #8c2f39, #b5434f); } .c2 { background: linear-gradient(135deg, #a8742a, #d9a441); }
.c3 { background: linear-gradient(135deg, #2e7d4f, #43a56b); } .c4 { background: linear-gradient(135deg, #c0392b, #e0604f); }
.c5 { background: linear-gradient(135deg, #2c6a9a, #4a90c2); } .c6 { background: linear-gradient(135deg, #5b4b8a, #7f6bb5); }
.btn { display: inline-block; border: 0; border-radius: 12px; padding: 12px 18px; background: var(--primary); color: #fff; font-weight: 700; cursor: pointer; }
.btn.green { background: var(--green); } .btn.gray { background: #efe7df; color: var(--text); } .btn.red { background: var(--red); }
.btn.sm { padding: 6px 12px; font-size: .85rem; border-radius: 9px; } .btn.block { display: block; width: 100%; }
.btn:disabled { opacity: .5; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; } .row > .grow { flex: 1; min-width: 140px; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.quick .btn { padding: 16px; font-size: 1.05rem; text-align: center; }
label { display: block; font-size: .82rem; color: var(--muted); margin: 8px 0 3px; }
.inp, select.inp, textarea.inp { width: 100%; padding: 11px 12px; border: 1px solid #d9cbbf; border-radius: 10px; background: #fff; color: var(--text); }
.inp:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.muted { color: var(--muted); } .small { font-size: .82rem; }
.pos { color: var(--red); font-weight: 700; } .neg { color: var(--green); font-weight: 700; }
.list .it { display: flex; justify-content: space-between; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: center; }
.list .it:last-child { border-bottom: 0; }
.list .it .r { text-align: right; white-space: nowrap; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 10px 0; padding-bottom: 2px; }
.tabs button { border: 1px solid var(--line); background: #fff; padding: 8px 14px; border-radius: 20px; white-space: nowrap; color: var(--muted); }
.tabs button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .78rem; }
td.n, th.n { text-align: right; white-space: nowrap; }
.tablewrap { overflow-x: auto; }
.badge { display: inline-block; font-size: .72rem; padding: 2px 8px; border-radius: 10px; background: #efe7df; color: var(--muted); }
.badge.iptal { background: #f9dcd8; color: var(--red); }
.cancelled { opacity: .55; text-decoration: line-through; }
.item { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 10px; background: #fffdfb; }
.item .hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-weight: 700; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.itot { display: flex; justify-content: space-between; margin-top: 8px; font-weight: 700; }
.sum { position: sticky; bottom: 70px; background: #fff; border: 2px solid var(--gold); border-radius: var(--radius); padding: 12px; box-shadow: 0 -4px 14px rgba(0,0,0,.08); }
@media (min-width: 900px) { .sum { bottom: 10px; } }
.sum .line { display: flex; justify-content: space-between; padding: 2px 0; } .sum .big { font-size: 1.3rem; font-weight: 800; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.photos img, .thumb { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; }
.thumb { width: 64px; height: 64px; display: block; margin-top: 6px; }
.plist .it { padding: 10px 6px; } .chosen { display: flex; justify-content: space-between; align-items: center; background: #f6efe7; border-radius: 10px; padding: 10px 12px; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--bg); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .overlay { align-items: center; } .modal { border-radius: 18px; } }
.overlay.img img { max-width: 94vw; max-height: 90vh; border-radius: 10px; }
.overlay.img { align-items: center; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 90px; background: #2b2220; color: #fff; padding: 10px 18px; border-radius: 22px; z-index: 30; opacity: 0; transition: opacity .25s; pointer-events: none; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; } #toast.err { background: var(--red); }
.login { max-width: 360px; margin: 14vh auto 0; padding: 0 20px; text-align: center; }
.login .logo { font-size: 2rem; font-weight: 800; letter-spacing: .1em; color: var(--primary); margin-bottom: 4px; }
.err { color: var(--red); min-height: 1.3em; margin-top: 8px; }

/* Kasa / gider */
.in { color: var(--green); font-weight: 700; } .out { color: var(--red); font-weight: 700; }
.bar { height: 8px; background: #efe7df; border-radius: 6px; overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
.acc:hover { border-color: var(--gold); }

/* Taksit */
.badge.st-bekliyor, .badge.st-devam { background: #e3edf6; color: var(--blue); }
.badge.st-kismen { background: #fbefd2; color: #9a6a1c; }
.badge.st-odendi, .badge.st-tamamlandi { background: #dcf1e4; color: var(--green); }
.badge.st-gecikti, .badge.st-gecikmis { background: #f9dcd8; color: var(--red); }
.badge.st-iptal { background: #efe7df; color: var(--muted); }
.plan-iptal { opacity: .72; } .info-row td { color: var(--muted); font-style: italic; }
@media (max-width: 460px) { .nav a { font-size: .62rem; padding-left: 0; padding-right: 0; } .nav a b { font-size: 1.2rem; } }
.ixg .stat { min-height: 0; padding: 12px; } .ixg .stat .v { font-size: 1.25rem; white-space: nowrap; } .ixg .stat .l { font-size: .8rem; }
#np_cnt { flex-wrap: wrap; overflow: visible; }
td .btn.sm { white-space: nowrap; }
