:root {
  --bg: #0e0e10;
  --bg2: #141417;
  --card: #1a1a1e;
  --card2: #222227;
  --line: #2c2c33;
  --text: #ececf0;
  --muted: #9a9aa6;
  --gold: #e0b049;
  --gold2: #f5d27a;
  --gold-dim: rgba(224, 176, 73, .14);
  --green: #4cc38a;
  --green-dim: rgba(76, 195, 138, .14);
  --red: #f0605d;
  --red-dim: rgba(240, 96, 93, .14);
  --radius: 14px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.45; min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot img { width: min(280px, 70vw); opacity: .9; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* ---------- Giriş ---------- */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(ellipse at top, #24221c 0%, var(--bg) 60%);
}
.login-box { width: 100%; max-width: 380px; }
.login-box img { display: block; width: 100%; max-width: 320px; margin: 0 auto 28px; filter: drop-shadow(0 8px 24px rgba(0,0,0,.6)); }
.login-box .card { padding: 22px; }
.login-box h2 { margin: 0 0 4px; font-size: 18px; }
.login-box p.sub { margin: 0 0 18px; color: var(--muted); font-size: 13px; }

/* ---------- Yerleşim ---------- */
.shell { display: flex; min-height: 100vh; }
.side { display: none; }
.main { flex: 1; min-width: 0; padding: 0 16px calc(var(--nav-h) + var(--safe-b) + 24px); }
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(14,14,16,.92); backdrop-filter: blur(10px);
  display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top, 0px)) 0 10px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.topbar img { height: 34px; }
.topbar h1 { font-size: 17px; margin: 0; flex: 1; font-weight: 650; }
.topbar .who { font-size: 12px; color: var(--muted); text-align: right; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b); background: rgba(20,20,23,.97); border-top: 1px solid var(--line);
  display: flex;
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 500;
}
.bottomnav a svg { width: 22px; height: 22px; }
.bottomnav a.on { color: var(--gold); }

@media (min-width: 900px) {
  .bottomnav { display: none; }
  .side {
    display: flex; flex-direction: column; width: 240px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
    background: var(--bg2); border-right: 1px solid var(--line); padding: 20px 14px;
  }
  .side img { width: 100%; margin-bottom: 24px; }
  .side a {
    display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px;
    color: var(--muted); text-decoration: none; font-weight: 500; margin-bottom: 2px;
  }
  .side a svg { width: 20px; height: 20px; }
  .side a:hover { background: var(--card); color: var(--text); }
  .side a.on { background: var(--gold-dim); color: var(--gold2); }
  .side .foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 0 8px; }
  .main { padding: 0 32px 40px; }
  .topbar img { display: none; }
}
.wrap { max-width: 1100px; margin: 0 auto; }

/* ---------- Kartlar / grid ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card, .section + .section { margin-top: 14px; }
.card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card h3 .right { margin-left: auto; font-weight: 500; font-size: 13px; color: var(--muted); }
.grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .g3 { grid-template-columns: 1fr; } }
@media (min-width: 900px) { .g2-lg { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mt { margin-top: 14px; }
.grid > .card + .card { margin-top: 0; }
.kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis > .kpi:first-child { grid-column: 1 / -1; }
  .kpis .kpi:not(:first-child) .val { font-size: 18px; }
}

.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-width: 0; }
.kpi .lbl { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.kpi .val { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.gold { background: linear-gradient(140deg, #2b2416, #1a1a1e 70%); border-color: #4a3d1f; }
.kpi.gold .val { color: var(--gold2); }
.pos { color: var(--green); }
.neg { color: var(--red); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

.period { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0; }
.period > div { padding: 2px 0; min-width: 0; }
.period > div + div { border-left: 1px solid var(--line); padding-left: 12px; }
.period .lbl { font-size: 11.5px; color: var(--muted); }
.period .val { font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Butonlar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line);
  background: var(--card2); color: var(--text); padding: 10px 16px; border-radius: 11px; cursor: pointer;
  font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; min-height: 42px;
}
.btn:hover { border-color: #3d3d46; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #1b1505; border-color: transparent; }
.btn.green { background: var(--green-dim); color: var(--green); border-color: rgba(76,195,138,.3); }
.btn.red { background: var(--red-dim); color: var(--red); border-color: rgba(240,96,93,.3); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 11px; min-height: 34px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 14px; }
.quick .btn { min-height: 58px; font-size: 16px; border-radius: var(--radius); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

/* ---------- Form ---------- */
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.inp {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; outline: none; min-height: 44px; font-size: 16px;
}
.inp:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
select.inp { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.inp.amount { font-size: 26px; font-weight: 700; text-align: right; color: var(--gold2); font-variant-numeric: tabular-nums; }
textarea.inp { min-height: 70px; resize: vertical; }
.err { background: var(--red-dim); color: var(--red); padding: 10px 12px; border-radius: 10px; font-size: 13.5px; margin-bottom: 12px; }
.chk { display: flex; gap: 10px; align-items: center; cursor: pointer; user-select: none; }
.chk input { width: 20px; height: 20px; accent-color: var(--gold); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--bg2); border-radius: 999px; padding: 9px 14px; cursor: pointer;
  font-size: 14px; font-weight: 500; min-height: 40px;
}
.chip.on { background: var(--gold-dim); border-color: var(--gold); color: var(--gold2); }
.seg { display: flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 6px; border-radius: 8px; cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--muted); min-height: 38px; }
.seg button.on { background: var(--card2); color: var(--gold2); box-shadow: 0 1px 3px rgba(0,0,0,.4); }
details.more summary { cursor: pointer; color: var(--muted); font-size: 13.5px; padding: 6px 0 12px; list-style: none; }
details.more summary::before { content: '+ '; color: var(--gold); }
details.more[open] summary::before { content: '− '; }

/* ---------- Listeler ---------- */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.item:last-child { border-bottom: 0; }
.item .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-weight: 700; font-size: 13px; }
.item .ic.in { background: var(--green-dim); color: var(--green); }
.item .ic.out { background: var(--red-dim); color: var(--red); }
.item .mid { flex: 1; min-width: 0; }
.item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dayhead { display: flex; justify-content: space-between; padding: 14px 2px 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; font-size: 14px; }
.plate { display: inline-block; border: 1px solid #555; border-radius: 4px; padding: 0 5px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: var(--text); background: #0b0b0d; margin-right: 6px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.tbl td.r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tfoot td { font-weight: 700; border-bottom: 0; }
.scroll-x { overflow-x: auto; }

/* Yatay çubuklar */
.bars .b { margin-bottom: 11px; }
.bars .b .top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 5px; }
.bars .b .top span:last-child { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bars .track { height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.bars .fill { height: 100%; border-radius: 99px; background: var(--gold); }
.bars .fill.red { background: var(--red); }

/* Günlük grafik */
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* Ortak dağılımı */
.partner { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.partner:last-child { border-bottom: 0; }
.partner .av { width: 40px; height: 40px; border-radius: 50%; background: var(--gold-dim); color: var(--gold2); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.partner .nm { flex: 1; min-width: 0; font-weight: 600; }
.partner .nm small { display: block; color: var(--muted); font-weight: 400; }
.partner .am { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.tabs a.on { background: var(--gold-dim); border-color: var(--gold); color: var(--gold2); }
.pager { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.pager .lbl { flex: 1; text-align: center; font-weight: 650; }
.pager .lbl small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.badge.ok { background: var(--green-dim); color: var(--green); }
.badge.wait { background: var(--gold-dim); color: var(--gold2); }
.note { background: var(--gold-dim); border: 1px solid #4a3d1f; color: #e9d7a8; border-radius: 10px; padding: 10px 12px; font-size: 13px; }

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.65); display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s ease;
}
.modal {
  width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line);
  border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + var(--safe-b)); animation: up .2s ease;
}
.modal .mh { display: flex; align-items: center; margin-bottom: 14px; }
.modal .mh h2 { margin: 0; font-size: 18px; flex: 1; }
.modal .x { background: var(--card2); border: 0; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 18px; color: var(--muted); }
@media (min-width: 600px) {
  .modal-bg { align-items: center; }
  .modal { border-radius: 20px; padding-bottom: 18px; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); transform: translateX(-50%) translateY(20px);
  background: #2a2a30; color: var(--text); padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 60; box-shadow: 0 8px 24px rgba(0,0,0,.5); max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.err { background: #4a1f1f; }

.item .ic svg { width: 20px; height: 20px; }

/* ---------- Fiyat listesi ---------- */
.phead, .prow { display: grid; grid-template-columns: minmax(150px, 1.5fr) repeat(var(--n), minmax(0, 1fr)); gap: 10px; align-items: center; }
.phead { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.phead .r { text-align: right; }
.phead a, .pname a { color: inherit; text-decoration: none; border-bottom: 1px dashed #4a4a55; }
.prow { padding: 10px 0; border-bottom: 1px solid var(--line); }
.pname { font-weight: 600; }
.pcell span { display: none; }
.pcell .inp { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; min-height: 40px; padding: 8px 10px; }
.pcell .inp.chg { border-color: var(--gold); background: #221d12; color: var(--gold2); }
@media (max-width: 640px) {
  .phead { display: none; }
  .prow { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 8px; }
  .pname { grid-column: 1 / -1; }
  .pcell span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.savebar {
  position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + 10px); z-index: 15; margin-top: 14px;
  display: flex; align-items: center; gap: 8px; background: #241f14; border: 1px solid var(--gold); border-radius: var(--radius);
  padding: 10px 12px 10px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.6); font-weight: 600; color: var(--gold2);
}
.savebar[hidden] { display: none; }
@media (min-width: 900px) { .savebar { bottom: 16px; } }

.searchbox { position: relative; }
.searchbox svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.searchbox .inp { padding-left: 40px; }

/* ---------- Randevular ---------- */
:root { --blue: #6aa8ff; --blue-dim: rgba(106, 168, 255, .14); }
.card h3 svg { width: 18px; height: 18px; color: var(--gold); }
.flbl { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
div.f { margin-bottom: 12px; }
.badge.st-bekliyor { background: var(--gold-dim); color: var(--gold2); }
.badge.st-onaylandi, .badge.st-geldi { background: var(--blue-dim); color: var(--blue); }
.badge.st-tamamlandi { background: var(--green-dim); color: var(--green); }
.badge.st-gelmedi { background: var(--red-dim); color: var(--red); }
.badge.st-iptal { background: #2a2a30; color: var(--muted); text-decoration: line-through; }
.item .ic.cal { background: var(--blue-dim); color: var(--blue); }
.item .badge { flex-shrink: 0; }

.daystrip { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.daystrip .days { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; min-width: 0; }
.dchip {
  border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 6px 0 5px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; position: relative;
}
.dchip small { font-size: 10.5px; color: var(--muted); }
.dchip b { font-size: 16px; font-variant-numeric: tabular-nums; }
.dchip i { font-style: normal; font-size: 10px; font-weight: 700; color: var(--blue); min-height: 13px; }
.dchip.today small { color: var(--gold); }
.dchip.on { background: var(--gold-dim); border-color: var(--gold); }
.dchip.on b { color: var(--gold2); }

.slots { display: flex; flex-direction: column; }
.slot { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); min-height: 52px; }
.slot:last-child { border-bottom: 0; }
.slot.past { opacity: .5; }
.stime { width: 48px; flex-shrink: 0; font-weight: 700; font-variant-numeric: tabular-nums; padding-top: 6px; }
.stime small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 500; }
.scells { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.apt {
  text-align: left; border: 1px solid var(--line); border-left: 3px solid var(--blue); background: var(--card2); border-radius: 10px;
  padding: 7px 10px; cursor: pointer; display: block; width: 100%; position: relative; min-width: 0;
}
.apt b { font-weight: 650; }
.apt span { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.apt small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apt em { position: absolute; top: 7px; right: 8px; font-style: normal; font-size: 10px; font-weight: 800; color: var(--gold2); background: var(--gold-dim); padding: 1px 6px; border-radius: 99px; }
.apt.st-bekliyor { border-left-color: var(--gold); }
.apt.st-tamamlandi { border-left-color: var(--green); }
.apt.st-gelmedi { border-left-color: var(--red); }
.apt.cont { border-left-color: #3d3d46; background: transparent; border-style: dashed; border-left-style: solid; padding: 5px 10px; font-size: 13px; color: var(--muted); }
.apt.free { border: 1px dashed #3d3d46; background: transparent; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; padding: 9px 10px; }
.apt.free svg { width: 16px; height: 16px; }
.apt.free:hover { border-color: var(--gold); color: var(--gold2); }
.full { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--red); padding: 4px 0; }

.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 6px; }
.tbtn { border: 1px solid var(--line); background: var(--bg2); border-radius: 9px; padding: 9px 0; font-weight: 650; cursor: pointer; font-variant-numeric: tabular-nums; }
.tbtn.on { background: var(--gold-dim); border-color: var(--gold); color: var(--gold2); }
.tbtn:disabled { opacity: .3; cursor: not-allowed; text-decoration: line-through; }

.kv { display: flex; flex-direction: column; gap: 9px; }
.kv > div { display: flex; gap: 12px; }
.kv span { width: 96px; flex-shrink: 0; color: var(--muted); font-size: 13px; padding-top: 1px; }
.kv b { flex: 1; min-width: 0; font-weight: 600; }

.hrow { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; margin-bottom: 6px; }
.hrow .inp { min-height: 38px; padding: 6px 26px 6px 10px; font-size: 14px; background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; }

/* ---------- Dış işçilik (taşeron) ---------- */
:root { --violet: #b48cff; --violet-dim: rgba(180, 140, 255, .13); }
.outbox { border: 1px dashed #3d3d46; border-radius: 12px; padding: 11px 12px; margin-bottom: 14px; }
.outbox.on { border: 1px solid rgba(180,140,255,.45); background: var(--violet-dim); }
.outbox .chk { align-items: flex-start; }
.outbox .chk span b { display: block; }
.outbox .chk small { display: block; color: var(--muted); font-size: 12.5px; }
.outbox .chk input { accent-color: var(--violet); margin-top: 2px; }
.outfields { display: none; margin-top: 12px; }
.outbox.on .outfields { display: block; }
.marg { font-size: 14px; padding: 9px 11px; background: var(--bg2); border-radius: 9px; }
.fullnote { grid-column: 1 / -1; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.apt.out { border-left-color: var(--violet); background: var(--violet-dim); border-style: dashed; border-left-style: solid; }
.apt em.dis { color: var(--violet); background: rgba(180,140,255,.18); }
.dis-tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .04em; color: var(--violet); background: var(--violet-dim); padding: 1px 6px; border-radius: 99px; vertical-align: 1px; }
.outinfo { border: 1px solid rgba(180,140,255,.35); background: var(--violet-dim); border-radius: 12px; padding: 11px 12px; }

/* ---------- Alacak / borç (alınmamış ücret, ödenecek gider) ---------- */
.badge.unpaid, .badge.late { background: var(--red-dim); color: var(--red); }
.badge.due { background: var(--gold-dim); color: var(--gold2); }
.item .ic.unp { background: var(--red-dim); color: var(--red); }
.item .act { flex-shrink: 0; margin-left: 2px; }
.seg button.unp.on { background: var(--red-dim); color: var(--red); }
.unpnote { margin-top: 8px; font-size: 12.5px; color: #f2a9a7; background: var(--red-dim); border-radius: 9px; padding: 8px 10px; line-height: 1.4; }
.unpnote[hidden] { display: none; }
.unpnote a { color: var(--gold2); }
.pendbar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 10px 12px; border-radius: 11px; text-decoration: none; color: var(--text);
  background: var(--gold-dim); border: 1px solid #4a3d1f; font-size: 13.5px;
}
.pendbar.late { background: var(--red-dim); border-color: rgba(240,96,93,.35); }
.pendbar svg { width: 18px; height: 18px; color: var(--gold); flex-shrink: 0; }
.pendbar.late svg { color: var(--red); }
.pendbar > span:nth-child(2) { flex: 1; min-width: 0; }
.pendcard { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.pendcard .lbl { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.pendcard .lbl small { text-transform: none; letter-spacing: 0; }
.pendcard .val { font-size: 20px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pendcard .sub { font-size: 12px; color: var(--muted); }
.pendcard > div + div { border-left: 1px solid var(--line); padding-left: 12px; }
.pendcard:hover { border-color: var(--gold); }
.pendcard.three { grid-template-columns: 1fr 1fr 1fr auto; }
@media (max-width: 560px) { .pendcard.three { grid-template-columns: 1fr 1fr; } .pendcard.three > div:nth-child(3) { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 8px; } .pendcard.three > span { display: none; } }

/* ---------- Ekler (fotoğraf / dekont) ---------- */
.attbox { border: 1px dashed #3d3d46; border-radius: 12px; padding: 10px 12px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; }
.thumbs:empty { margin: 0; }
.thumb { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; background: var(--bg2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); text-decoration: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb svg { width: 26px; height: 26px; }
.thumb small { font-size: 10px; font-weight: 700; }
.thumb.pdf { grid-template-rows: auto auto; gap: 2px; }
.thumb.new { border-color: var(--gold); }
.thumb .x { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; }
.addatt { cursor: pointer; }
.chip.ghost { background: transparent; border-style: dashed; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.chip.ghost svg { width: 14px; height: 14px; }
.chip small.neg { font-weight: 600; }

/* ---------- İşlem geçmişi ---------- */
.item.noclick { cursor: default; }
.diff { margin-top: 6px; display: grid; gap: 3px; font-size: 12.5px; }
.diff > div { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.diff span { color: var(--muted); min-width: 90px; }
.diff s { color: var(--red); opacity: .8; }
.diff b { color: var(--green); font-weight: 600; }
.tbl.audit td:last-child { white-space: normal; }
.logpre { margin: 0; max-height: 60vh; overflow: auto; font-size: 11.5px; line-height: 1.5; color: var(--muted); white-space: pre-wrap; word-break: break-word; }
code { font-size: 12px; background: var(--bg2); padding: 1px 6px; border-radius: 6px; word-break: break-all; }

/* ---------- Anahtarlık plaka ---------- */
.p3d { display: block; width: 100%; height: 1100px; border: 0; background: transparent; }
@media (min-width: 900px) { .p3d { height: 760px; } }
.kchip { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; flex-shrink: 0; }
@media (max-width: 700px) {
  /* Telefonda araçlar tek satırda yana kayar, oluşturucu hemen altta görünür */
  #kc { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  #kc::-webkit-scrollbar { display: none; }
}
.kchip .plate { margin-right: 6px; }

/* ---------- Türkçe tarih seçici ---------- */
.dpick { display: block; min-width: 0; }
.dbtn { display: flex; align-items: center; gap: 9px; text-align: left; cursor: pointer; font-size: 15px; }
.dbtn svg { width: 18px; height: 18px; color: var(--gold); flex-shrink: 0; }
.dbtn span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-bg {
  position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center;
  animation: fade .12s ease; padding: 0 0 var(--safe-b);
}
.dp {
  width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 20px 20px 0 0;
  padding: 14px 14px 16px; box-shadow: 0 -10px 40px rgba(0,0,0,.5); animation: up .18s ease;
}
@media (min-width: 600px) { .dp-bg { align-items: center; } .dp { border-radius: 18px; } }
.dp-head { display: grid; grid-template-columns: auto minmax(0, 1fr) 92px auto; gap: 6px; align-items: center; margin-bottom: 10px; }
.dp-head .inp { min-height: 40px; padding: 7px 28px 7px 10px; font-size: 15px; font-weight: 600; }
.dp-nav { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card2); cursor: pointer; display: grid; place-items: center; }
.dp-nav svg { width: 18px; height: 18px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; text-align: center; }
.dp-grid b { font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 4px 0 6px; }
.dp-d {
  height: 42px; border: 1px solid transparent; background: transparent; border-radius: 10px; cursor: pointer;
  font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.dp-d:hover:not(:disabled) { background: var(--card2); }
.dp-d.out { color: var(--muted); opacity: .45; }
.dp-d.today { border-color: var(--gold); color: var(--gold2); }
.dp-d.on { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #1b1505; border-color: transparent; }
.dp-d:disabled { opacity: .2; cursor: not-allowed; }
.dp-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

.print-only { display: none; }
@media print {
  body { background: #fff; color: #000; font-size: 12px; }
  .side, .bottomnav, .topbar, .no-print, #toast { display: none !important; }
  .main { padding: 0; }
  .print-only { display: block; }
  .card, .kpi { background: #fff !important; border: 1px solid #ccc; break-inside: avoid; }
  .kpi .val, .kpi.gold .val, .partner .am, .muted, .kpi .lbl { color: #000 !important; }
  .pos { color: #0a7a3f; } .neg { color: #b42318; }
  .bars .track { background: #eee; } .bars .fill { background: #b8892a; }
  .tbl th, .tbl td { border-color: #ddd; }
  .print-head { display: flex !important; align-items: center; gap: 16px; border-bottom: 2px solid #000; padding-bottom: 10px; margin-bottom: 14px; }
  .print-head img { height: 54px; filter: invert(1) hue-rotate(180deg); }
}
.print-head { display: none; }
