/* HBBOX — depo takip · HBOX'un tasarım dili (kartlar, ferah, büyük dokunmatik düğmeler), lacivert vurgu.
 * HBOX turuncu, HBBOX lacivert: iki program yan yana açıkken karışmasın.
 * Tema: açık tema varsayılan; Profil → Görünüm'den "Koyu" ya da "Cihaz ayarı" seçilir (<html data-theme>).
 * Renk rolleri: --primary eylem/bağlantı, --in giriş (yeşil), --out çıkış (kırmızımsı turuncu),
 * --good / --warn / --bad durum renkleri, --info bilgi. */
:root {
  color-scheme: light;
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #eef0f6;
  --border: #e1e4ee;
  --text: #1d2230;
  --text-2: #475063;
  --muted: #6a7285;
  --primary: #3b45b8;
  --primary-ink: #ffffff;
  --primary-soft: #eceefc;
  --accent: #4f5bd5;
  --series-1: #4f5bd5;
  --info: #35577a;
  --info-soft: #eaf1f8;
  --good: #15803d;
  --good-soft: #e8f5ec;
  --warn: #a16207;
  --warn-soft: #fdf3dc;
  --bad: #b91c1c;
  --bad-soft: #fdecea;
  --in: #15803d;
  --out: #b4471c;
  --shadow: 0 1px 2px rgba(29, 34, 48, .04), 0 6px 18px rgba(29, 34, 48, .05);
  --radius: 16px;
  --radius-sm: 12px;
  --nav-h: 68px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14161d;
  --surface: #1d2029;
  --surface-2: #252935;
  --border: #343947;
  --text: #f2f3f7;
  --text-2: #cdd1dc;
  --muted: #98a0b3;
  --primary: #a3acf7;
  --primary-ink: #14161d;
  --primary-soft: #272b4a;
  --accent: #a3acf7;
  --series-1: #8b95f0;
  --info: #9cbbdb;
  --info-soft: #222d3a;
  --good: #4ade80;
  --good-soft: #14301d;
  --warn: #fbbf24;
  --warn-soft: #3a2d0c;
  --bad: #f87171;
  --bad-soft: #3d1a1a;
  --in: #4ade80;
  --out: #fb9a6c;
  --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --bg: #14161d;
    --surface: #1d2029;
    --surface-2: #252935;
    --border: #343947;
    --text: #f2f3f7;
    --text-2: #cdd1dc;
    --muted: #98a0b3;
    --primary: #a3acf7;
    --primary-ink: #14161d;
    --primary-soft: #272b4a;
    --accent: #a3acf7;
    --series-1: #8b95f0;
    --info: #9cbbdb;
    --info-soft: #222d3a;
    --good: #4ade80;
    --good-soft: #14301d;
    --warn: #fbbf24;
    --warn-soft: #3a2d0c;
    --bad: #f87171;
    --bad-soft: #3d1a1a;
    --in: #4ade80;
    --out: #fb9a6c;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--primary); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
.num { font-variant-numeric: tabular-nums; }

/* --- Yerleşim ------------------------------------------------------------ */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
  background: var(--surface); color: var(--text);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { font-weight: 800; letter-spacing: .4px; font-size: 18px; color: var(--text); display: inline-flex; align-items: center; gap: 8px; }
.topbar .brand::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.topbar .page-title { font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .back { color: var(--primary); font-size: 24px; padding: 0 6px 0 0; line-height: 1; background: none; border: 0; cursor: pointer; }
.topbar .who { font-size: 13px; color: var(--text-2); white-space: nowrap; background: var(--surface-2); border: 1px solid var(--border); padding: 4px 10px; border-radius: 999px; }

.content { flex: 1; width: 100%; min-width: 0; max-width: 1100px; margin: 0 auto; padding: 16px 16px calc(var(--nav-h) + 24px); }

.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--nav-h); color: var(--muted); font-size: 11.5px; font-weight: 600; position: relative;
}
.bottomnav a svg { width: 24px; height: 24px; }
.bottomnav a.active { color: var(--primary); }
.bottomnav a.active::before { content: ""; position: absolute; top: 8px; left: 50%; width: 56px; height: 32px; transform: translateX(-50%); border-radius: 999px; background: var(--primary-soft); z-index: -1; }
.bottomnav a { isolation: isolate; }
.navbadge {
  position: absolute; top: 8px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--bad); color: #fff; font-size: 11px; line-height: 18px; text-align: center;
}

.sidenav { display: none; }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 252px 1fr; grid-template-rows: auto 1fr; }
  .topbar { grid-column: 1 / -1; }
  .bottomnav { display: none; }
  .sidenav {
    display: flex; flex-direction: column; gap: 4px; padding: 16px 12px 24px;
    background: var(--surface); border-right: 1px solid var(--border); position: sticky; top: 57px; height: calc(100vh - 57px); overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: var(--border) transparent;
  }
  .sidenav a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; color: var(--text-2); font-weight: 600; position: relative; }
  .sidenav a svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
  .sidenav a:hover { background: var(--surface-2); color: var(--text); }
  .sidenav a.active { background: var(--primary-soft); color: var(--primary); }
  .sidenav a.active svg { color: var(--primary); }
  .sidenav .navbadge { position: static; margin-left: auto; }
  .content { padding: 28px 32px 48px; }
}

/* --- Bileşenler -------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px;
}
.card > h2, .card > h3 { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.section-title { font-size: 15px; color: var(--text-2); font-weight: 650; margin: 24px 4px 10px; }

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) {
  .grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid.md-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 699px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
a.stat:hover { border-color: var(--primary); }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 28px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; color: var(--text); letter-spacing: -.3px; }
.stat .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.stat.danger { border-color: var(--bad); background: var(--bad-soft); }
.stat a { color: inherit; }

.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 6px; border-bottom: 1px solid var(--border); color: inherit; border-radius: 0;
}
.list-item:last-child { border-bottom: 0; }
.list-item .main { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .meta { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.list-item .side { text-align: right; font-size: 13px; color: var(--text-2); white-space: nowrap; }
a.list-item:hover { background: var(--surface-2); }
a.list-item:hover .title { color: var(--primary); }
.chev { color: var(--muted); font-size: 18px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 650; cursor: pointer; text-align: center;
}
.btn:hover { background: var(--surface-2); }
.btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.list-item > svg { width: 22px; height: 22px; flex: 0 0 auto; color: var(--text-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 3px 10px rgba(59, 69, 184, .22); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 140px; }
.btn.big { min-height: 58px; font-size: 16px; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.field label { font-size: 13px; font-weight: 650; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px; /* iOS yakınlaştırmasını önler */
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .field { flex: 1 1 150px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.toolbar .field { margin: 0; flex: 1 1 140px; }
.toolbar .btn { flex: 0 0 auto; }

.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; scrollbar-width: none; }
.tabs a {
  padding: 9px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); font-weight: 600; font-size: 14px; white-space: nowrap;
}
.tabs a.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

/* Parçalı seçim (ör. Görünüm: Açık / Koyu / Cihaz ayarı) */
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--text-2); font: inherit; font-weight: 650; font-size: 14px; padding: 8px 14px; border-radius: 9px; cursor: pointer; min-height: 38px; }
.seg button.on { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(29, 34, 48, .12); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 700; border-bottom: 0; }

.alert { padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 14px; display: flex; gap: 8px; align-items: flex-start; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.good { background: var(--good-soft); color: var(--good); }
.alert.info { background: var(--info-soft); color: var(--info); }
.alert .icon { flex: 0 0 auto; font-weight: 800; }

.empty { text-align: center; color: var(--muted); padding: 28px 10px; font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt { margin-top: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.spacer { flex: 1; }

/* Piyasa bilgisi kaydı */
.list-item.market-item { align-items: flex-start; }
.market-item .title { white-space: normal; }
.market-item .meta { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.market-note { white-space: pre-wrap; margin-top: 4px; font-size: 14px; }

/* Sipariş satırları */
.line-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 12px; background: var(--surface-2); }
.line-card .line-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 700; font-size: 13px; color: var(--text-2); }
.line-card .line-total { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.totals { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--primary-soft); font-weight: 700; flex-wrap: wrap; }
/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(29, 34, 48, .35); z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.modal {
  background: var(--surface); width: 100%; max-width: 540px; border-radius: 22px 22px 0 0; padding: 20px 18px;
  padding-bottom: max(18px, env(safe-area-inset-bottom)); max-height: 90vh; overflow: auto;
}
@media (min-width: 600px) { .modal-back { align-items: center; } .modal { border-radius: 22px; } }
.modal h2 { margin-bottom: 12px; }

/* Bildirim */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 18px); z-index: 200;
  background: #1d2230; color: #fff; padding: 13px 18px; border-radius: 999px; font-size: 14px; max-width: calc(100% - 32px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.toast.bad { background: var(--bad); }
.toast.good { background: var(--good); }

/* Giriş ekranı */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(1100px 600px at 10% -10%, var(--primary-soft) 0%, transparent 60%), var(--bg);
}
.login-card { width: 100%; max-width: 390px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 32px 26px; box-shadow: 0 14px 44px rgba(29, 34, 48, .08); }
.login-card .logo { font-size: 30px; font-weight: 800; color: var(--text); letter-spacing: .6px; display: flex; align-items: center; gap: 10px; }
.login-card .logo::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); }
.login-card .tag { color: var(--muted); font-size: 14px; margin: 2px 0 22px; }

/* --- Grafikler (tek seri, tek eksen) ------------------------------------ */
.chart { position: relative; }
.chart-bars { display: flex; align-items: flex-end; gap: 2px; height: 140px; border-bottom: 1px solid var(--border); padding-top: 18px; }
.chart-bars .bar-slot { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; cursor: default; min-width: 4px; }
.chart-bars .bar { width: 100%; background: var(--series-1); border-radius: 4px 4px 0 0; min-height: 0; }
.chart-bars .bar-slot:hover .bar, .chart-bars .bar-slot:focus .bar { filter: brightness(1.15); }
.chart-bars .bar-slot.zero .bar { background: transparent; }
.chart-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.chart-max { position: absolute; top: 0; left: 0; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, -100%);
  background: var(--text); color: var(--surface); padding: 6px 9px; border-radius: 6px; font-size: 12px; white-space: nowrap;
}
.chart-tip[hidden] { display: none; }

.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 6px; }
.hbar .track { height: 12px; }
.hbar .fill { height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hbar .val { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 650; }

details.table-view summary { cursor: pointer; font-size: 13px; color: var(--primary); margin-top: 10px; }

.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- HBBOX'a özel ------------------------------------------------------------ */
.modal.wide { max-width: 760px; }
.dir-in { color: var(--in); font-weight: 700; }
.dir-out { color: var(--out); font-weight: 700; }
.badge.in { background: var(--good-soft); color: var(--in); border-color: transparent; }
.badge.out { background: var(--bad-soft); color: var(--out); border-color: transparent; }
.badge.off { text-decoration: line-through; }
tr.cancelled td { color: var(--muted); text-decoration: line-through; }
tr.neg td { background: var(--bad-soft); }
td.neg, span.neg { color: var(--bad); font-weight: 700; }
tr.group-row td { background: var(--surface-2); font-weight: 700; color: var(--text-2); font-size: 13px; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
th.sticky, td.sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.depot-card .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.depot-card .big { font-size: 28px; font-weight: 750; letter-spacing: -.3px; font-variant-numeric: tabular-nums; margin: 6px 0 2px; }
.depot-card .flows { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 13px; color: var(--text-2); margin-top: 10px; }
.depot-card .flows b { font-variant-numeric: tabular-nums; color: var(--text); }
.depot-card .btn-row { margin-top: 12px; }
.depot-card .btn-row .btn { flex: 1 1 70px; padding: 6px 10px; }

/* Fiş satırları (tablo biçimli giriş) */
table.lines { font-size: 14px; }
table.lines th { white-space: nowrap; }
table.lines td { padding: 6px 4px; vertical-align: middle; }
table.lines input, table.lines select { min-height: 42px; padding: 7px 9px; font-size: 15px; }
table.lines input.r { text-align: right; }
table.lines .w-item { min-width: 210px; }
table.lines .w-lot { min-width: 160px; }
table.lines .w-num { min-width: 96px; }
table.lines .w-sm { min-width: 110px; }
table.lines td.del { width: 1%; }
table.lines td.avail { font-size: 12px; color: var(--muted); white-space: nowrap; }
.form-grid { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.sum-bar { display: flex; gap: 18px; flex-wrap: wrap; justify-content: flex-end; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--primary-soft); font-weight: 700; font-variant-numeric: tabular-nums; }
.dir-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dir-pick .btn { min-height: 64px; font-size: 17px; }
.dir-pick .btn.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.kpi-flow { display: grid; gap: 8px; }
.hbar .track, .hbar .fill { display: block; }
.hbar.util .track { background: var(--surface-2); border-radius: 4px; }
.hbar.util .fill { border-radius: 4px; }
.hbar .fill.alt { background: var(--muted); }
table.period td:first-child { white-space: nowrap; }
table.period th { white-space: normal; min-width: 70px; }
.print-only { display: none; }
@media print {
  .print-only { display: block; }
  body { background: #fff; color: #000; font-size: 12px; }
  .card { border: 0; padding: 0; }
  table { font-size: 11px; }
  th, td { padding: 4px 5px; }
}
/* Telefonda tek sütun, geniş ekranda üç sütun (depo kartları, işletme kalem tabloları) */
@media (min-width: 900px) { .grid.md-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
table.hide-lot .col-lot { display: none; }

/* --- Kenar menüsü grupları (Telef Depo, Elyaf Depo, Tüm depolar …) -------------------------
 * Başlık bir düğme: simge rozeti + ad + ok; tıklayınca grup açılır/kapanır (core.js bindSidenav, seçim tarayıcıda saklanır).
 * Açılıp kapanma grid-template-rows 0fr ↔ 1fr ile kayar; kapalı gövde inert (sekmeyle odaklanmaz). */
.sidenav .nav-group { display: flex; flex-direction: column; margin-top: 2px; }
.sidenav .nav-group:first-of-type { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.sidenav .nav-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 12px;
  background: none; color: var(--text-2); font: inherit; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer;
}
.sidenav .nav-toggle:hover { background: var(--surface-2); color: var(--text); }
.sidenav .nav-toggle:focus-visible, .sidenav a:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.sidenav .nav-chip {
  flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted); transition: background .2s, color .2s;
}
.sidenav .nav-chip svg { width: 17px; height: 17px; }
.sidenav .nav-group.open .nav-chip { color: var(--text-2); }
.sidenav .nav-group.has-active .nav-chip { background: var(--primary-soft); color: var(--primary); }
.sidenav .nav-group.has-active .nav-title { color: var(--text); }
.sidenav .nav-title { flex: 1; min-width: 0; }
.sidenav .nav-caret { flex: none; display: grid; place-items: center; color: var(--muted); transition: transform .2s ease; }
.sidenav .nav-caret svg { width: 16px; height: 16px; }
.sidenav .nav-group.open .nav-caret { transform: rotate(90deg); }
.sidenav .nav-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s ease; }
.sidenav .nav-group.open .nav-body { grid-template-rows: 1fr; }
.sidenav .nav-items {
  min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 1px;
  margin-left: 22px; padding-left: 8px; border-left: 1px solid var(--border);
}
.sidenav .nav-group.open .nav-items { padding-top: 2px; padding-bottom: 6px; }
@media (min-width: 900px) {
  .sidenav .nav-items a { gap: 10px; padding: 7px 10px; font-size: 13.5px; font-weight: 600; border-radius: 10px; }
  .sidenav .nav-items a svg { width: 17px; height: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .sidenav .nav-body, .sidenav .nav-caret, .sidenav .nav-chip { transition: none; }
}
/* Telefondaki Menü sayfasında grup başlığı simgesi */
.section-title.with-icon { display: flex; align-items: center; gap: 10px; }
.section-title .nav-chip {
  flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.section-title .nav-chip svg { width: 16px; height: 16px; }

/* --- XPPS birebir ekranları: ortak düzen ve tablolar (Elyaf Depo, Telef Depo) ----------------
 * Genişlik: rota seçeneği width: 'genis' (1800 px) | 'genis-orta' (1450 px) → main.content.w-…
 * Üst satır: <div class="page-head"><h2>Başlık</h2> …düğmeler</div>
 * Süzgeç:    <form class="fbar card"> .field … <label class="check"><input type="checkbox"> İptalleri gizle</label> <span class="note">…</span></form>
 * Tablo:     <div class="xt-wrap"><table class="xt"> … th/td.n sayı (sağa), td.zero soluk sıfır, tr.grp grup başlığı,
 *            tr.sub ara toplam, tr.tot genel toplam (lacivert), tr.iptalli üstü çizili, tr.ind girintili satır,
 *            .sticky-col sabit ilk sütun, td.stok mavi zemin, .c-in mavi (giriş) / .c-out kahverengi (çıkış), .c-warn turuncu kalın
 * Sayfalama: <div class="pager"><a>« Önceki</a><span>Sayfa N / M</span><a>Sonraki »</a></div>
 */
.content.w-genis { max-width: 1800px; }
.content.w-genis-orta { max-width: 1450px; }
.page-head { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h2 { flex: 1 1 auto; min-width: 0; }
.page-head .btn { min-height: 38px; padding: 6px 14px; font-size: 14px; }
.fbar { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; margin-bottom: 14px; padding: 12px 14px; }
.fbar .field { margin: 0; flex: 0 1 auto; min-width: 120px; gap: 3px; }
.fbar .field label { font-size: 12px; }
.fbar input, .fbar select { min-height: 38px; padding: 6px 10px; font-size: 14px; border-radius: 9px; }
.fbar .btn { min-height: 38px; padding: 6px 14px; font-size: 14px; flex: 0 0 auto; }
.fbar label.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; min-height: 38px; font-weight: 600; color: var(--text-2); }
.fbar label.check input { width: 18px; min-height: 0; height: 18px; padding: 0; }
.fbar .note { flex: 1 1 260px; font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.xt-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
table.xt { font-size: 13.5px; border-collapse: separate; border-spacing: 0; width: 100%; }
.xt th, .xt td { padding: 6px 8px; white-space: nowrap; border-bottom: 1px solid var(--border); vertical-align: middle; }
.xt thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--text-2); font-size: 12.5px; }
.xt thead tr + tr th { top: 31px; } /* iki satırlı başlıkta ikinci satır (ilk satır yüksekliği değişirse ekranda üzerine yazın) */
.xt thead th small, .xt thead th .unit { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.xt th.n, .xt td.n { text-align: right; font-variant-numeric: tabular-nums; }
/* Soluk sıfır: saydamlık (opacity) yerine yarı saydam renk — opacity hücrenin zeminini de soldurur, koyu toplam satırında gri kutu olurdu */
.xt td.zero, .xt .zero { color: color-mix(in srgb, var(--muted) 60%, transparent); font-weight: 400; }
.xt tr.grp td { background: var(--surface-2); font-weight: 700; }
.xt tr.sub td { background: var(--primary-soft); font-weight: 700; }
.xt tr.tot td { background: #1e3a5f; color: #fff; font-weight: 700; border-bottom: 0; }
.xt tr.tot td.zero, .xt tr.tot .zero { color: rgba(255, 255, 255, .6); } /* toplam satırında da soluk ama okunur; zemin lacivert kalır */
.xt tr.ind td:first-child { padding-left: 24px; }
.xt tr.iptalli td, .xt tr.cancelled td { color: var(--muted); text-decoration: line-through; }
.xt tbody tr:not(.grp):not(.sub):not(.tot):hover td { background: var(--warn-soft); }
.xt .sticky-col { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.xt thead .sticky-col { z-index: 3; background: var(--surface-2); }
.xt tr.grp .sticky-col { background: var(--surface-2); }
.xt tr.sub .sticky-col { background: var(--primary-soft); }
.xt tr.tot .sticky-col { background: #1e3a5f; }
.xt td.stok, .xt th.stok { background: var(--info-soft); font-weight: 700; }
.xt .c-in { color: var(--info); font-weight: 700; }
.xt .c-out { color: #8a4b1f; font-weight: 700; }
:root[data-theme="dark"] .xt .c-out { color: #e0a370; }
.xt .c-warn { color: var(--warn); font-weight: 700; }
.xt .c-good { color: var(--good); font-weight: 700; }
.xt .c-bad { color: var(--bad); font-weight: 700; }
.xt td a { font-weight: 650; }
.xt .acts { white-space: nowrap; font-size: 13px; }
.xt .acts a + a::before { content: "|"; color: var(--muted); margin: 0 6px; }
.pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin-top: 12px; font-size: 14px; }
.kv-row { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; }
.kv-row b { font-variant-numeric: tabular-nums; }
@media print {
  .xt-wrap { max-height: none; overflow: visible; border: 0; }
  .fbar, .page-head .btn, .pager { display: none; }
  .xt thead th { position: static; }
}
@media (prefers-color-scheme: dark) { :root[data-theme="system"] .xt .c-out { color: #e0a370; } }
