/* Renkler logodan: siyah, mavi (#0A6CF0), turuncu (#FFA000), gümüş. Koyu tema varsayılan; açık tema [data-theme=light]
   --gold* adları eski: bugün vurgu rengi MAVİ. --warn: uyarı / bekleyen (turuncu). --red: yalnız eksi ve borç. */
:root {
  --bg: #0b0d12; --bg2: #11141b; --card: #171a22; --card2: #1f232d; --line: #2a2f3b; --line2: #3a4050;
  --text: #edf0f5; --muted: #9aa1b0;
  --gold: #0a6cf0; --gold2: #5aa2ff; --gold-dim: rgba(10, 108, 240, .16); --gold-line: rgba(10, 108, 240, .45);
  --accent-a: #2b86ff; --accent-b: #0656d6; --on-accent: #fff;
  --accent2: #ffa000; --warn: #ffb52e; --warn-dim: rgba(255, 160, 0, .15);
  --silver: #c9ccd2;
  --green: #4cc38a; --green-dim: rgba(76, 195, 138, .14);
  --red: #ff7b72; --red-dim: rgba(255, 123, 114, .14);
  --blue: #6aa8ff; --blue-dim: rgba(106, 168, 255, .14);
  --violet: #b48cff; --violet-dim: rgba(180, 140, 255, .13);
  --topbar: rgba(11,13,18,.92); --navbar: rgba(17,20,27,.97); --overlay: rgba(0,0,0,.65);
  --toast: #262b36; --toast-err: #5a1f22; --plate-bg: #07080b; --plate-line: #555; --note-text: #d7e6ff;
  --kpi-hi: linear-gradient(140deg, rgba(10,108,240,.22), var(--card) 70%); --shadow: rgba(0,0,0,.5);
  --login-glow: radial-gradient(ellipse at 30% 0%, rgba(10,108,240,.22) 0%, transparent 55%), radial-gradient(ellipse at 85% 10%, rgba(255,160,0,.12) 0%, transparent 45%), var(--bg);
  --radius: 14px; --nav-h: 64px; --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f5f9; --bg2: #ffffff; --card: #ffffff; --card2: #edf0f5; --line: #dde2ea; --line2: #c7cdd8;
  --text: #141821; --muted: #5a6273;
  --gold: #0759d1; --gold2: #0650bf; --gold-dim: rgba(7, 89, 209, .08); --gold-line: rgba(7, 89, 209, .35);
  --accent2: #e08a00; --warn: #a96500; --warn-dim: rgba(224, 138, 0, .12);
  --silver: #6b7079;
  --green: #12804a; --green-dim: rgba(18, 128, 74, .10);
  --red: #c62828; --red-dim: rgba(198, 40, 40, .09);
  --blue: #1f63d1; --blue-dim: rgba(31, 99, 209, .09);
  --violet: #6b3fd6; --violet-dim: rgba(107, 63, 214, .09);
  --topbar: rgba(243,245,249,.92); --navbar: rgba(255,255,255,.97); --overlay: rgba(20,24,33,.45);
  --toast: #232833; --toast-err: #a3191f; --plate-bg: #fff; --plate-line: #333; --note-text: #0b2a5c;
  --kpi-hi: linear-gradient(140deg, rgba(7,89,209,.09), var(--card) 70%); --shadow: rgba(20,24,33,.14);
  --login-glow: radial-gradient(ellipse at 30% 0%, rgba(7,89,209,.10) 0%, transparent 55%), radial-gradient(ellipse at 85% 10%, rgba(224,138,0,.08) 0%, transparent 45%), var(--bg);
  color-scheme: light;
}
[hidden] { display: none !important; }
* { 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: var(--login-glow);
}
.login-box { width: 100%; max-width: 380px; }
.login-box img { display: block; width: 100%; max-width: 340px; margin: 0 auto 24px; filter: drop-shadow(0 8px 24px var(--shadow)); }
.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: var(--topbar); 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: var(--navbar); 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: 16px 14px; overflow-y: auto; scrollbar-width: thin;
  }
  .side img { width: 100%; margin-bottom: 16px; flex-shrink: 0; }
  .side a {
    display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; flex-shrink: 0;
    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: var(--kpi-hi); border-color: var(--gold-line); }
.kpi.gold .val { color: var(--text); }
.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: var(--line2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: linear-gradient(180deg, var(--accent-a), var(--accent-b)); color: var(--on-accent); border-color: transparent; }
.btn.green { background: var(--green-dim); color: var(--green); border-color: var(--green-dim); }
.btn.red { background: var(--red-dim); color: var(--red); border-color: var(--red-dim); }
.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 var(--shadow); }
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 var(--plate-line); border-radius: 4px; padding: 0 5px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: var(--text); background: var(--plate-bg); 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(--warn-dim); color: var(--warn); }
.note { background: var(--gold-dim); border: 1px solid var(--gold-line); color: var(--note-text); border-radius: 10px; padding: 10px 12px; font-size: 13px; }

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0; z-index: 50; background: var(--overlay); 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: var(--toast); color: #fff; 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 var(--shadow); max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.err { background: var(--toast-err); }

.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 var(--line2); }
.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: var(--gold-dim); 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: var(--card); border: 1px solid var(--gold); border-radius: var(--radius);
  padding: 10px 12px 10px 16px; box-shadow: 0 10px 30px var(--shadow); 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 ---------- */
.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(--warn-dim); color: var(--warn); }
.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: var(--card2); 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: var(--line2); background: transparent; border-style: dashed; border-left-style: solid; padding: 5px 10px; font-size: 13px; color: var(--muted); }
.apt.free { border: 1px dashed var(--line2); 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) ---------- */
.outbox { border: 1px dashed var(--line2); 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(--warn-dim); color: var(--warn); }
.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: var(--red); 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 var(--gold-line); font-size: 13.5px;
}
.pendbar.late { background: var(--red-dim); border-color: var(--red); }
.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 var(--line2); 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; }

/* ---------- 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: var(--overlay); 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 var(--shadow); 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(--accent-a), var(--accent-b)); color: var(--on-accent); 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: #0a6cf0; }
  .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; }

/* ---------- Ürünler, katalog, tedarikçiler ---------- */
.item .ic.low { background: var(--warn-dim); color: var(--warn); }
.item.noclick { cursor: default; }
.chip.off { opacity: .45; text-decoration: line-through; }
.szres:empty { display: none; }
.szres .chip { font-variant-numeric: tabular-nums; }
.item .t.wrap { white-space: normal; }

/* ---------- Satış, alış, alacak ---------- */
.quick.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 520px) { .quick.three { grid-template-columns: 1fr 1fr; } .quick.three .btn:first-child { grid-column: 1 / -1; } }
.linkcard { display: block; text-decoration: none; color: inherit; }
.linkcard .lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 500; }
.linkcard .val { font-size: 20px; font-weight: 700; margin-top: 2px; }
.linkcard .sub { font-size: 12.5px; color: var(--muted); }
.badge.due { background: var(--warn-dim); color: var(--warn); }
details.sect { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; }
details.sect > summary, details.card > summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; list-style: none; }
details.sect > summary svg { width: 18px; height: 18px; color: var(--gold); }
details.sect[open] > summary { margin-bottom: 10px; }
.card.sect { padding: 12px; margin-bottom: 14px; background: var(--bg2); }
.lres .lotlist { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 0 10px; margin-top: 8px; }
.lines { border: 1px solid var(--line); border-radius: 12px; padding: 4px 10px; margin-bottom: 10px; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto 28px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line .lt b { display: block; font-weight: 600; font-size: 14px; }
.line .lt small { display: block; font-size: 12px; }
.line .lq { display: flex; align-items: center; gap: 4px; }
.line .lq .inp { width: 46px; text-align: center; padding: 6px 4px; }
.line .lq .btn { min-width: 30px; padding: 4px 8px; }
.line .lp .inp { width: 96px; padding: 6px 8px; font-size: 15px; }
.line .ls { font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.line .x, .payrow .x { background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
@media (max-width: 560px) {
  .line { grid-template-columns: minmax(0, 1fr) auto 28px; }
  .line .lt { grid-column: 1 / -1; }
  .line .lp .inp { width: 84px; }
}
.saletot { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; }
.payrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.payrow select { flex: 1 1 150px; }
.payrow .amount { flex: 0 1 130px; font-size: 16px; }
.payrow .full { flex-basis: 100%; }
.seg.mini { display: inline-flex; padding: 2px; }
.seg.mini button { min-height: 26px; padding: 2px 8px; font-size: 12px; }
.recv { border-left: 4px solid var(--green); }
.recv.due { border-left-color: var(--warn); }
.recv.late { border-left-color: var(--red); }
.cinfo:empty { display: none; }
.cres:empty { display: none; }
textarea.inp { resize: vertical; min-height: 70px; font: inherit; }
.chip svg { width: 14px; height: 14px; vertical-align: -2px; }
.kpi .lbl svg, .note svg, .linkcard .lbl svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 2px; }
.tbl td[style*="white-space:normal"] { min-width: 180px; }

/* ---------- Tema düğmesi ---------- */
.themebtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 6px 9px; cursor: pointer; font: inherit; font-size: 13px; }
.themebtn svg { width: 17px; height: 17px; }
.themebtn:hover { border-color: var(--gold); }
.side .themebtn { margin: 6px 4px 10px; justify-content: flex-start; flex-shrink: 0; }
.topbar .themebtn { padding: 6px; }
.login .themebtn { position: fixed; top: 14px; right: 14px; z-index: 5; }
:root[data-theme="light"] .side img, :root[data-theme="light"] .topbar img { filter: drop-shadow(0 1px 2px rgba(0,0,0,.15)); }
.anpanel .f { margin-bottom: 10px; }
.anbar { height: 4px; background: var(--card2); border-radius: 3px; margin-top: 5px; overflow: hidden; max-width: 260px; }
.anbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--accent2)); border-radius: 3px; }
.antbl th.srt { cursor: pointer; user-select: none; }
.antbl th.srt:hover { color: var(--gold2); }
@media print { .anbar { display: none; } }
.anset > summary { cursor: pointer; font-weight: 600; display: flex; gap: 8px; align-items: center; list-style: none; margin: 4px 0 10px; flex-wrap: wrap; }
.anset > summary svg { width: 17px; height: 17px; color: var(--gold); }
