/* =========================================================
   Lojistik Takip — tasarım tokenları
   ========================================================= */
:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);

  --bg: #f2f5f3;
  --surface: #ffffff;
  --surface-2: #eef3f0;
  --surface-3: #e3ebe7;
  --ink: #12211b;
  --ink-2: #33443d;
  --muted: #5f716a;
  --line: #dbe4df;

  --rail: #0b3f31;
  --rail-2: #0f5241;
  --rail-ink: #e9f5ef;
  --lane: #f3b63f;              /* yol şeridi sarısı */

  --green: #0f8a60;
  --green-strong: #0a6b4a;
  --green-soft: #daf1e6;
  --amber: #d98e04;
  --amber-soft: #fcefd2;
  --red: #cc3b30;
  --red-soft: #fbe2df;
  --blue: #2c6fbb;
  --blue-soft: #e0ecf9;

  --heat-lo: #e3f3eb;
  --heat-hi: #0b6b4a;

  /* kategorik palet (firma, tip vb.) */
  --c1: #0f8a60; --c2: #2c6fbb; --c3: #d98e04; --c4: #8b52a8; --c5: #178f9c; --c6: #d2643f;

  --shadow: 0 1px 2px rgba(18, 33, 27, .05), 0 4px 14px rgba(18, 33, 27, .05);
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --font: 'Barlow', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-c: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', system-ui, sans-serif;
  --gap: 24px;
  --pad: 28px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1311; --surface: #141d1a; --surface-2: #1a2521; --surface-3: #22302b; --ink: #e7efeb; --ink-2: #c6d3cd;
    --muted: #93a69e; --line: #26342f; --rail: #081f19; --rail-2: #0e2e25; --rail-ink: #e2efe9;
    --green: #3cc592; --green-strong: #5fd6a6; --green-soft: #173a2e; --amber: #f2b53a; --amber-soft: #3a2f14;
    --red: #f07167; --red-soft: #3d1e1b; --blue: #71a9ee; --blue-soft: #182c44;
    --heat-lo: #16302a; --heat-hi: #2fb383;
    --c1: #3cc592; --c2: #71a9ee; --c3: #f2b53a; --c4: #c08ae0; --c5: #4fc3cf; --c6: #f08a64;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1311; --surface: #141d1a; --surface-2: #1a2521; --surface-3: #22302b; --ink: #e7efeb; --ink-2: #c6d3cd;
  --muted: #93a69e; --line: #26342f; --rail: #081f19; --rail-2: #0e2e25; --rail-ink: #e2efe9;
  --green: #3cc592; --green-strong: #5fd6a6; --green-soft: #173a2e; --amber: #f2b53a; --amber-soft: #3a2f14;
  --red: #f07167; --red-soft: #3d1e1b; --blue: #71a9ee; --blue-soft: #182c44;
  --heat-lo: #16302a; --heat-hi: #2fb383;
  --c1: #3cc592; --c2: #71a9ee; --c3: #f2b53a; --c4: #c08ae0; --c5: #4fc3cf; --c6: #f08a64;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 80px); height: 100%; -webkit-text-size-adjust: 100%; }
*, *::before, *::after { box-sizing: inherit; }
body {
  margin: 0; min-height: 100%; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.lock { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
svg { flex: none; }
.pos { color: var(--green); } .neg { color: var(--red); } .fuel { color: var(--amber); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* =========================================================
   İskelet
   ========================================================= */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }

.rail {
  background: var(--rail); color: var(--rail-ink); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 18px; padding: 20px 14px 18px; overflow-y: auto; z-index: 40;
}
/* yol şeridi motifi */
.rail::after {
  content: ''; position: absolute; top: 0; right: 0; width: 3px; height: 100%;
  background: repeating-linear-gradient(to bottom, var(--lane) 0 18px, transparent 18px 34px); opacity: .9;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 2px 6px 16px; border-bottom: 1px solid rgba(255,255,255,.14); }
.brand b { font: 700 23px/1 var(--font-c); display: block; color: #fff; }
.brand small { font-size: 12px; opacity: .72; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav button {
  all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--r-sm); font: 600 16.5px/1.2 var(--font-c); color: rgba(233,245,239,.8); min-height: 44px;
}
.nav button svg { width: 20px; height: 20px; opacity: .85; }
.nav button .t { flex: 1; }
.nav button .ts { display: none; }
.nav button:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav button[aria-current="page"] { background: var(--rail-2); color: #fff; box-shadow: inset 3px 0 0 var(--lane); }
.nav button[aria-current="page"] svg { opacity: 1; color: var(--lane); }
.nav .badge { font: 700 12px/1 var(--font); background: var(--lane); color: #231800; padding: 3px 7px; border-radius: 10px; }
.rail-foot { margin-top: auto; font-size: 12px; opacity: .72; line-height: 1.5; padding: 0 6px; }
.rail-foot button { all: unset; cursor: pointer; text-decoration: underline; }
.scrim { display: none; }

main { padding: 0 var(--pad) 56px; min-width: 0; }

/* ---------- üst bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: calc(14px + env(safe-area-inset-top, 0px)) 0 12px; margin: 0 calc(var(--pad) * -1) 22px; padding-left: var(--pad); padding-right: var(--pad);
  border-bottom: 1px solid var(--line);
}
.topbar-row { display: flex; gap: 10px; align-items: center; min-width: 0; }
.topbar h1 { font: 700 30px/1.05 var(--font-c); margin: 0 auto 0 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; gap: 8px; align-items: center; flex: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; position: relative; box-shadow: var(--shadow);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { border-color: var(--muted); }
.icon-btn .count { position: absolute; top: -6px; right: -6px; background: var(--green); color: #fff; font: 700 11px/1 var(--font); padding: 3px 6px; border-radius: 10px; }
.icon-btn .count:empty { display: none; }
.menu-btn, .filter-btn { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--r-sm); padding: 8px 14px; cursor: pointer; min-height: 42px; font-weight: 600; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--green-strong); color: #fff; border-color: var(--green-strong); box-shadow: var(--shadow); }
:root[data-theme="dark"] .btn.primary { color: #062117; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #062117; } }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- filtreler ---------- */
.filters-panel { margin-top: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; min-width: 0; }
.fld input, .fld select {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 10px;
  min-height: 42px; color: var(--ink); width: 100%; min-width: 0; font-weight: 400; font-size: 15px;
}
.filters .fld { width: 150px; }
.filters .fld.date { width: 158px; }
.filters .btn { align-self: end; }
.filters-done { display: none; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip-row:empty { display: none; }
.chip { font-size: 13px; background: var(--green-soft); color: var(--ink); border-radius: 16px; padding: 4px 4px 4px 12px; display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.chip button { all: unset; cursor: pointer; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.chip button:hover { background: rgba(0,0,0,.08); }

/* =========================================================
   KPI
   ========================================================= */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
@media (min-width: 1680px) { .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.kpis:not(:has(.lead)) .kpi:last-child:nth-child(3n+1) { grid-column: span 3; }
.kpis:not(:has(.lead)) .kpi:last-child:nth-child(3n+2) { grid-column: span 2; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 13px; box-shadow: var(--shadow); min-width: 0; position: relative; overflow: hidden; }
.kpi span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi b { display: block; font: 700 clamp(24px, 2.2vw, 31px)/1.1 var(--font-c); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi small { color: var(--muted); font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi.lead { background: linear-gradient(160deg, var(--rail-2), var(--rail)); border-color: transparent; color: #fff; }
.kpi.lead span, .kpi.lead small { color: rgba(233,245,239,.78); }
.kpi .spark { display: block; width: 100%; height: 30px; margin-top: 6px; }
.kpi .accent { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }

/* =========================================================
   Bölümler
   ========================================================= */
.sec { margin: 0 0 30px; min-width: 0; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin: 0 0 12px; flex-wrap: wrap; }
.sec-h h2 { font: 700 22px/1.2 var(--font-c); margin: 0; }
.sec-h p { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 72ch; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--gap); }
.grid2 > * { min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.panel h4 { margin: 18px 0 8px; font-size: 14px; }
.note { font-size: 13.5px; color: var(--muted); }
.note.warn { background: var(--amber-soft); color: var(--ink); padding: 11px 14px; border-radius: var(--r-sm); border-left: 4px solid var(--amber); }
.note a { color: var(--green-strong); font-weight: 600; }

/* =========================================================
   Takvim
   ========================================================= */
.cal-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); }
.cal-head, .cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head { margin-bottom: 6px; font-size: 12px; color: var(--muted); font-weight: 600; padding-left: 2px; }
.day {
  all: unset; box-sizing: border-box; cursor: pointer; border-radius: 8px; padding: 8px 9px 7px; min-height: 80px; min-width: 0;
  display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
  background: color-mix(in oklab, var(--heat-hi) calc(var(--i, 0) * 100%), var(--heat-lo)); color: var(--ink);
  border: 1px solid transparent;
}
.day.hot { color: #fff; }
:root[data-theme="dark"] .day.hot { color: #04160f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .day.hot { color: #04160f; } }
.day:hover { border-color: var(--ink); }
.day.sel { outline: 3px solid var(--lane); outline-offset: 1px; }
.day .d { font: 700 17px/1 var(--font-c); display: flex; justify-content: space-between; gap: 4px; }
.day .d em { font: 600 11px/1 var(--font); font-style: normal; opacity: .8; }
.day .v { font: 700 17px/1.1 var(--font-c); white-space: nowrap; }
.day .v .vs { display: none; }
.day .s { font-size: 11px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day .fuelbar { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--amber); }
.day.empty { background: transparent; cursor: default; border: 1px dashed var(--line); color: var(--muted); }
.day.pad { visibility: hidden; }
.legend { display: flex; gap: 16px; align-items: center; font-size: 12.5px; color: var(--muted); margin-top: 12px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 42px; height: 10px; border-radius: 3px; background: linear-gradient(90deg, var(--heat-lo), var(--heat-hi)); vertical-align: middle; margin-right: 6px; }
.legend i.f { width: 20px; height: 4px; background: var(--amber); }

/* =========================================================
   Bar listeleri
   ========================================================= */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row {
  display: grid; grid-template-columns: minmax(84px, 150px) minmax(0, 1fr) minmax(96px, max-content);
  grid-template-areas: "lbl bar val"; gap: 12px; align-items: center; font-size: 14px;
}
@media (min-width: 768px) {
  .bar-row { grid-template-columns: minmax(84px, 150px) minmax(0, 1fr) 11.5em; }
  .bars.wide .bar-row { grid-template-columns: minmax(140px, 340px) minmax(0, 1fr) 4.5em; }
}
.bar-row .lbl { grid-area: lbl; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bar-track { grid-area: bar; height: 12px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--bc, var(--green)); border-radius: 6px; }
.bar-row .val { grid-area: val; font: 700 16px/1 var(--font-c); text-align: right; white-space: nowrap; }
.bar-row .val small { font: 400 12px var(--font); color: var(--muted); margin-left: 5px; }

/* =========================================================
   Grafikler
   ========================================================= */
.chart { position: relative; width: 100%; min-height: 120px; }
.chart svg { display: block; }
.chart text { fill: var(--muted); font: 11.5px var(--font); }
.chart .gl { stroke: var(--line); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover, .chart .hit.on { fill: color-mix(in srgb, var(--ink) 6%, transparent); }
.ctip {
  position: absolute; z-index: 5; pointer-events: none; background: var(--ink); color: var(--bg); border-radius: var(--r-sm);
  padding: 8px 11px; font-size: 12.5px; line-height: 1.45; box-shadow: 0 8px 24px rgba(0,0,0,.2); white-space: nowrap; transform: translate(-50%, -100%);
}
.ctip b { font: 700 14px var(--font-c); display: block; }
.ctip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.legend-inline { display: flex; gap: 8px 16px; font-size: 12.5px; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }
.legend-inline span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }

/* =========================================================
   Tablolar
   ========================================================= */
.table-wrap {
  overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  box-shadow: var(--shadow); -webkit-overflow-scrolling: touch;
  /* Taşma kalırsa kaydırma çubuğu görünür olsun; sürpriz kesilme olmasın */
  scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent;
}
.table-wrap::-webkit-scrollbar { height: 10px; }
.table-wrap::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 0 0 var(--r) var(--r); }
.table-wrap::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; border: 2px solid var(--surface-2); }
.table-wrap::-webkit-scrollbar-thumb:hover { background: var(--muted); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
/* Metin sütunları sarar, sayı ve tarih sütunları sarmaz: tablo ekrana sığar,
   yatay kaydırma son çare olur. */
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: normal; overflow-wrap: break-word; }
td { max-width: 26ch; }
td.n, th.n, td.nw, th.nw, td .tag, td .st { white-space: nowrap; }
td.n, td.nw { max-width: none; }
th { font: 600 12.5px/1.2 var(--font); color: var(--muted); background: var(--surface-2); cursor: pointer; user-select: none; white-space: nowrap; }
th:hover { color: var(--ink); }
th[aria-sort="ascending"]::after { content: ' ▲'; font-size: 10px; color: var(--green); }
th[aria-sort="descending"]::after { content: ' ▼'; font-size: 10px; color: var(--green); }
td.n, th.n { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
/* Geniş satırlarda göz kaymasın diye çok hafif şeritleme */
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
tbody tr:hover td { background: var(--surface-2); }
tbody tr.click { cursor: pointer; }
tbody tr.click:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
tfoot td { font-weight: 700; background: var(--surface-2); border-top: 2px solid var(--line); border-bottom: 0; }
td select { min-height: 36px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); padding: 4px 8px; }
.more { display: flex; justify-content: center; margin-top: 10px; }
.msort { display: none; margin-bottom: 10px; }
@media (max-width: 1023px) { .msort { display: flex; } }
.msort .fld { flex-direction: row; align-items: center; gap: 8px; }
.msort select { flex: 1; }

.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 12px; background: var(--surface-2); white-space: nowrap; }
.tag.sefer { background: var(--green-soft); color: var(--green-strong); }
.tag.adblue { background: var(--blue-soft); color: var(--blue); }
.tag.arac { background: var(--amber-soft); color: color-mix(in srgb, var(--amber) 70%, var(--ink)); }
.tag.hata { background: var(--red-soft); color: var(--red); }
.tag.uyari { background: var(--amber-soft); color: color-mix(in srgb, var(--amber) 70%, var(--ink)); }
.tag.bilgi { background: var(--blue-soft); color: var(--blue); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--amber); }
.dot.hata { background: var(--red); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.pager span { margin-right: auto; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 12px; }
.toolbar .fld.search { width: 260px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--green); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow-x: auto; background: var(--surface); max-width: 100%; }
.seg button { all: unset; cursor: pointer; padding: 0 14px; min-height: 40px; display: flex; align-items: center; font-size: 14px; font-weight: 600; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--green-strong); color: #fff; }

/* =========================================================
   İçe aktarma
   ========================================================= */
.drop {
  display: block; border: 2px dashed color-mix(in srgb, var(--green) 45%, var(--line)); border-radius: var(--r-lg); padding: 36px 20px; text-align: center;
  background: var(--surface); cursor: pointer;
}
.drop svg { width: 34px; height: 34px; color: var(--green); margin-bottom: 6px; }
.drop.over { border-color: var(--green); background: var(--green-soft); }
.drop b { font: 700 23px/1.2 var(--font-c); display: block; margin-bottom: 4px; }
.maprow { display: flex; flex-wrap: wrap; gap: 6px; }
.map { font-size: 13px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 5px 9px; background: var(--surface-2); }
.map em { font-style: normal; color: var(--green-strong); font-weight: 600; }
.map.miss { border-style: dashed; color: var(--muted); background: transparent; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; }
.stat { background: var(--surface-2); border-radius: var(--r-sm); padding: 11px 13px; min-width: 0; }
.stat b { font: 700 25px/1.1 var(--font-c); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat span { font-size: 12.5px; color: var(--muted); }
.stat.good b { color: var(--green); } .stat.warn b { color: var(--amber); } .stat.bad b { color: var(--red); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* =========================================================
   Çekmece, bildirim, boş durum
   ========================================================= */
.drawer-bg { position: fixed; inset: 0; background: rgba(6, 16, 12, .5); z-index: 60; display: flex; justify-content: flex-end; }
.drawer {
  width: min(480px, 100%); height: 100%; background: var(--surface); overflow-y: auto; box-shadow: -10px 0 40px rgba(0,0,0,.25);
  padding: calc(20px + env(safe-area-inset-top, 0px)) 22px calc(20px + env(safe-area-inset-bottom, 0px));
}
.drawer h3 { font: 700 26px/1.1 var(--font-c); margin: 0 0 4px; }
.drawer .grab { display: none; }
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 8px 14px; font-size: 14px; margin: 18px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: var(--r); z-index: 70; font-size: 14px; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.empty-state { text-align: center; padding: 48px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.empty-state b { font: 700 25px/1.2 var(--font-c); display: block; margin-bottom: 6px; }
.loading { color: var(--muted); padding: 30px 0; }

/* =========================================================
   Geniş masaüstü
   ========================================================= */
@media (min-width: 1600px) {
  main { max-width: 1680px; }
}

/* =========================================================
   Küçük masaüstü / yatay tablet (1200–1400): KPI 3'lü
   ========================================================= */


/* =========================================================
   Tablet (768–1199): ikonlu dar menü
   ========================================================= */
@media (max-width: 1199px) {
  :root { --pad: 22px; --gap: 20px; }
  .shell { grid-template-columns: 92px minmax(0, 1fr); }
  .rail { padding: 16px 8px; align-items: stretch; }
  .brand { justify-content: center; padding: 0 0 14px; }
  .brand > div { display: none; }
  .nav button { flex-direction: column; gap: 5px; padding: 9px 4px; font: 600 12.5px/1.1 var(--font); text-align: center; position: relative; }
  .nav button .t { display: none; }
  .nav button .ts { display: block; }
  .nav button[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--lane); }
  .nav .badge { position: absolute; top: 3px; right: 8px; font-size: 10.5px; padding: 2px 5px; }
  .rail-foot { display: none; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .filter-btn { display: inline-grid; }
  .filters-panel { display: none; }
  .filters-panel.open { display: block; }
  .filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .filters .fld, .filters .fld.date { width: auto; }
}

/* =========================================================
   Telefon (<768): çekmece menü, kart tablolar
   ========================================================= */
@media (max-width: 767px) {
  :root { --pad: 14px; --gap: 16px; }
  body { font-size: 15px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 84vw); height: 100%; transform: translateX(-102%);
    transition: transform .22s ease; padding: calc(18px + env(safe-area-inset-top, 0px)) 14px calc(18px + env(safe-area-inset-bottom, 0px));
    box-shadow: 10px 0 40px rgba(0,0,0,.3); z-index: 80;
  }
  .rail.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(6,16,12,.5); z-index: 79; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .scrim.open { opacity: 1; pointer-events: auto; }
  .brand { justify-content: flex-start; padding: 2px 6px 16px; }
  .brand > div { display: block; }
  .nav button { flex-direction: row; gap: 12px; padding: 12px; font: 600 17px/1.2 var(--font-c); text-align: left; }
  .nav button .t { display: block; }
  .nav button .ts { display: none; }
  .nav button[aria-current="page"] { box-shadow: inset 3px 0 0 var(--lane); }
  .nav .badge { position: static; }
  .rail-foot { display: block; }
  .menu-btn { display: inline-grid; }

  .topbar { padding-top: calc(10px + env(safe-area-inset-top, 0px)); padding-bottom: 10px; margin-bottom: 16px; }
  .topbar h1 { font-size: 23px; }
  .actions { gap: 6px; }
  #exportBtn { width: 42px; padding: 0; }
  #exportBtn .lbl { display: none; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-done { display: flex; grid-column: 1 / -1; }
  .filters #clearF { grid-column: 1 / -1; }

  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; }
  .kpi { padding: 12px 13px; }
  .kpi.lead { grid-column: 1 / -1; }
  .kpis .kpi:last-child { grid-column: auto; }
  .kpis:has(.lead) .kpi:last-child:nth-child(even), .kpis:not(:has(.lead)) .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi b { font-size: 25px; }
  .kpi.lead b { font-size: 32px; }

  .sec-h h2 { font-size: 20px; }
  .panel { padding: 14px; }
  .cal-wrap { padding: 12px 10px; border-radius: var(--r); }
  .cal, .cal-head { gap: 4px; }
  .day { min-height: 54px; padding: 5px 5px 6px; border-radius: 6px; }
  .day .d { font-size: 14px; }
  .day .d em, .day .s { display: none; }
  .day .v { font-size: 13.5px; }
  .day .v .vl { display: none; }
  .day .v .vs { display: inline; }

  .bar-row, .bars.wide .bar-row {
    grid-template-columns: minmax(0, 1fr) max-content; grid-template-areas: "lbl val" "bar bar"; gap: 5px 10px;
  }
  .bar-track { height: 10px; }

  .toolbar .fld.search { width: 100%; }
  .toolbar .seg { width: 100%; }
  .toolbar .seg button { flex: 1; justify-content: center; }
  .pager span { width: 100%; }
  .pager .btn { flex: 1; }

  .drawer-bg { align-items: flex-end; }
  .drawer {
    width: 100%; height: auto; max-height: 90vh; border-radius: 18px 18px 0 0;
    padding: 10px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .drawer .grab { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
  .kv { grid-template-columns: minmax(96px, 40%) 1fr; }
  .drop { padding: 26px 14px; }
  .drop b { font-size: 20px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btn-row .btn { flex: 1; }
}


/* =========================================================
   Tablo → kart (tablet dikey ve telefon)
   ========================================================= */
@media (max-width: 1023px) {
  /* tablolar → kartlar */
  .table-wrap.cards { border: 0; background: transparent; box-shadow: none; overflow: visible; }
  .cards table, .cards tbody, .cards tfoot { display: block; }
  .cards thead { display: none; }
  .cards tr {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px; margin-bottom: 10px; box-shadow: var(--shadow);
  }
  .cards tbody tr td { background: transparent; }
  .cards tbody tr:hover td { background: transparent; }
  .cards tbody tr.click:hover, .cards tbody tr.click:focus-visible { border-color: var(--green); }
  .cards td {
    display: flex; flex-direction: column; gap: 2px; padding: 0; border: 0; white-space: normal;
    text-align: left !important; min-width: 0; max-width: none; overflow-wrap: anywhere;
    font-size: 14.5px; font-weight: 600; line-height: 1.3;
  }
  .cards td::before { content: attr(data-label); font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: .01em; }
  .cards td .tag { align-self: flex-start; }
  /* Kart başlığı: kaydın kimliği + durumu, altında ince ayraç */
  .cards td.c-title {
    order: -1; grid-column: 1 / -1; font: 700 20px/1.15 var(--font-c);
    flex-direction: row; justify-content: space-between; align-items: center; gap: 10px;
    margin: 0 -15px 2px; padding: 0 15px 10px; border-bottom: 1px solid var(--line);
  }
  .cards td.c-title::before { display: none; }
  .cards td.c-wide { grid-column: 1 / -1; }
  .cards td.c-empty { display: none; }
  .cards td[data-label=""]::before { display: none; }
  .cards tfoot tr { background: var(--green-soft); border-color: transparent; }
  .cards tfoot td { background: transparent; }
  .cards tfoot td.c-title { border-bottom-color: color-mix(in srgb, var(--green) 25%, transparent); }
  .cards tfoot td:not(:first-child):empty { display: none; }
  .cards td[colspan] { grid-column: 1 / -1; }

  .cards tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
  .cards tbody tr { margin-bottom: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; }
  .cards tfoot tr { margin-top: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Kart görünümünde sütun önceliği geçersizdir: kartta yer bol, hepsi görünür */
  .cards td.lo, .cards td.lo2 { display: flex; }
  .cards td.lo.c-empty, .cards td.lo2.c-empty { display: none; }
}
@media (max-width: 767px) {
  .cards tbody { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .cards tbody tr, .cards tfoot tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* =========================================================
   Dizüstü (1024–1439): ikincil sütunları gizle, ilk sütunu sabitle
   ========================================================= */
/* Sütun önceliği: tablonun kendi genişliğine göre. Ekran genişliği yanıltıcıdır —
   1280 ve 1440 piksel ekranda içerik alanı aynı genişliktedir (menü 92 → 240 px
   büyür), bu yüzden ölçü tablonun kabından alınır. */
.liste { container-type: inline-size; }
@container (max-width: 1500px) {
  th.lo, td.lo { display: none; }
  th, td { padding: 9px 10px; }
  table { font-size: 13.5px; }
}
@container (max-width: 1060px) {
  th.lo2, td.lo2 { display: none; }
}
@container (max-width: 940px) {
  th, td { padding: 8px 8px; }
  table { font-size: 13px; }
}
/* Kap sorgusu desteklenmeyen tarayıcılarda eski ekran kırılımlarına düş */
@supports not (container-type: inline-size) {
  @media (max-width: 1599px) {
    th.lo, td.lo { display: none; }
    th, td { padding: 9px 10px; }
    table { font-size: 13.5px; }
  }
  @media (max-width: 1279px) {
    th.lo2, td.lo2 { display: none; }
  }
}
@media (min-width: 1024px) {
  .table-wrap th:first-child, .table-wrap td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
  .table-wrap th:first-child { background: var(--surface-2); }
  .table-wrap tbody tr:nth-child(even) td:first-child { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
  .table-wrap tbody tr:hover td:first-child { background: var(--surface-2); }
  .table-wrap tfoot td:first-child { background: var(--surface-2); }
  th.wrap, td.wrap { min-width: 150px; max-width: 30ch; }
}

@media (prefers-reduced-motion: reduce) {
  .rail, .scrim { transition: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .day, .btn, .nav button, .icon-btn { transition: background-color .15s, border-color .15s, color .15s; }
}

/* =========================================================
   Kimlik doğrulama ekranları
   ========================================================= */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: calc(24px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
  background:
    repeating-linear-gradient(to bottom, var(--lane) 0 26px, transparent 26px 52px) center / 4px 100% no-repeat,
    radial-gradient(1200px 600px at 50% -10%, var(--rail-2), var(--rail));
}
.auth[hidden], .shell[hidden] { display: none; }
.auth-card {
  width: min(440px, 100%); background: var(--surface); border-radius: var(--r-lg); padding: 30px 30px 26px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35); position: relative;
}
.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.auth-brand b { font: 700 24px/1 var(--font-c); display: block; }
.auth-brand span { font-size: 13px; color: var(--muted); }
.auth-card h1 { font: 700 30px/1.1 var(--font-c); margin: 0 0 14px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card .fld { font-size: 13px; }
.auth-msg { background: var(--amber-soft); border-left: 4px solid var(--amber); padding: 10px 12px; border-radius: var(--r-sm); font-size: 14px; margin: 0 0 14px; }
.auth-foot { text-align: center; margin: 16px 0 0; }
.form-err { background: var(--red-soft); color: var(--red); padding: 10px 12px; border-radius: var(--r-sm); font-size: 14px; margin: 0; font-weight: 600; }
.form-err[hidden] { display: none; }
.btn.block { width: 100%; min-height: 46px; font-size: 16px; }
.btn.ghost { background: transparent; box-shadow: none; }
.pw { position: relative; display: block; }
.pw input { padding-right: 76px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: var(--surface-2); color: var(--ink-2); border-radius: 5px; font-size: 13px; font-weight: 600; padding: 7px 10px; cursor: pointer; }
.pw-rules { list-style: none; padding: 0; margin: -4px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.pw-rules li.ok { color: var(--green); font-weight: 600; }
.demo-box { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line); }
.demo-box > b { display: block; font-size: 14px; }
.demo-box code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.demo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-top: 10px; }
.demo-acc { all: unset; box-sizing: border-box; cursor: pointer; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-sm); display: flex; flex-direction: column; gap: 1px; min-height: 44px; }
.demo-acc:hover, .demo-acc:focus-visible { border-color: var(--green); background: var(--green-soft); }
.demo-acc b { font-size: 13.5px; } .demo-acc span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }

/* ---------- kullanıcı menüsü ---------- */
.user-wrap { position: relative; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--surface); background: var(--rail-2); color: #fff; cursor: pointer;
  font: 700 15px/1 var(--font); box-shadow: 0 0 0 1px var(--line), var(--shadow);
}
.avatar:hover { box-shadow: 0 0 0 2px var(--green); }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 270px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 16px 40px rgba(0,0,0,.18); padding: 6px; z-index: 50;
}
.user-menu[hidden] { display: none; }
.um-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.um-head b { width: 100%; font-size: 15px; }
.um-head > span:not(.role-tag) { width: 100%; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.user-menu button[role="menuitem"] { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; padding: 11px 10px; border-radius: var(--r-sm); font-size: 14.5px; font-weight: 600; }
.user-menu button[role="menuitem"]:hover, .user-menu button[role="menuitem"]:focus-visible { background: var(--surface-2); }
.user-menu .danger { color: var(--red); }

/* ---------- rol ve durum etiketleri ---------- */
.role-tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 12px; white-space: nowrap; }
.role-tag.r-admin { background: color-mix(in srgb, var(--c4) 18%, transparent); color: var(--c4); }
.role-tag.r-operasyon { background: var(--blue-soft); color: var(--blue); }
.role-tag.r-muhasebe { background: var(--amber-soft); color: color-mix(in srgb, var(--amber) 70%, var(--ink)); }
.role-tag.r-izleyici { background: var(--surface-3); color: var(--ink-2); }
.role-tag.scope, .chip.scope { background: color-mix(in srgb, var(--c5) 18%, transparent); color: color-mix(in srgb, var(--c5) 75%, var(--ink)); }
.chip.scope { padding-right: 12px; }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.st::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st-ok { color: var(--green); } .st-warn { color: var(--amber); } .st-bad { color: var(--red); } .st-off { color: var(--muted); }
.you { font-size: 11px; font-weight: 700; background: var(--green-soft); color: var(--green-strong); padding: 1px 7px; border-radius: 10px; vertical-align: 2px; font-family: var(--font); }
.perm-list { list-style: none; padding: 0; margin: 16px 0; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; color: var(--muted); }
.perm-list li.ok { color: var(--ink); font-weight: 600; }
.perm-list li.ok::first-letter { color: var(--green); }
table.matrix td.c, table.matrix th.c { text-align: center; }
table.matrix .yes { color: var(--green); font-weight: 700; font-size: 16px; }
table.matrix .no { color: var(--muted); }

/* ---------- kullanıcı formu ---------- */
.drawer form { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.drawer .fld { font-size: 13px; }
.hint { font-weight: 400; font-size: 12.5px; color: var(--muted); }
fieldset.roles { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
fieldset.roles legend { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 4px; padding: 0; }
.role-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; }
.role-opt:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.role-opt input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--green); }
.role-opt b { display: block; font-size: 14.5px; } .role-opt small { color: var(--muted); font-size: 12.5px; }
fieldset:disabled .role-opt { opacity: .6; cursor: not-allowed; }
.danger-zone { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.danger-zone h4 { margin: 0 0 4px; font-size: 14px; }
.temp-pw { display: flex; gap: 8px; align-items: center; margin: 18px 0; flex-wrap: wrap; }
.temp-pw code { flex: 1; min-width: 0; font: 700 22px/1.2 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; background: var(--surface-2); padding: 12px 14px; border-radius: var(--r-sm); letter-spacing: .04em; user-select: all; overflow-wrap: anywhere; }
select:disabled { opacity: .6; cursor: not-allowed; }

@media (max-width: 767px) {
  .auth { place-items: start center; padding-top: calc(28px + env(safe-area-inset-top, 0px)); }
  .auth-card { padding: 24px 20px 20px; }
  .auth-card h1 { font-size: 26px; }
  .user-menu { position: fixed; right: 10px; left: 10px; width: auto; top: calc(62px + env(safe-area-inset-top, 0px)); }
  .avatar { width: 40px; height: 40px; }
}

.no-filters #fpanel, .no-filters #filterBtn, .no-filters #chips, .no-filters #exportBtn { display: none !important; }
.cards td .role-tag, .cards td .st { align-self: flex-start; }
.topbar h1 .tsm { display: none; }
@media (max-width: 767px) { .topbar h1 .tl { display: none; } .topbar h1 .tsm { display: inline; } }

/* =========================================================
   Kural seti, mutabakat ve kurallı içe aktarma
   ========================================================= */
.say { font: 600 13px/1 var(--font); background: var(--surface-3); color: var(--muted); padding: 3px 8px; border-radius: 10px; vertical-align: 3px; }
.btn-link { all: unset; cursor: pointer; color: var(--green-strong); font-weight: 600; text-decoration: underline;
  display: inline-flex; align-items: center; min-height: 34px; padding: 0 4px; }

.kural-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.kural {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: var(--r);
  padding: 13px 15px; box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: 7px; min-width: 0;
}
.kural:hover, .kural:focus-visible { border-color: var(--muted); border-left-color: var(--green); }
.kural.pasif { border-left-color: var(--muted); opacity: .62; }
.kural-bas { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kural-bas b { font-size: 15.5px; margin-right: auto; }
.oncelik { font: 700 12px/1 var(--font); background: var(--green-soft); color: var(--green-strong); padding: 4px 8px; border-radius: 10px; }
.kural.pasif .oncelik { background: var(--surface-3); color: var(--muted); }
.kural-govde { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; }
.kural-govde .eylem { font-weight: 600; }
.kosul { display: inline-block; background: var(--surface-2); border-radius: 4px; padding: 2px 7px; font-size: 12.5px; margin: 1px 0; }
.kosul em { font-style: normal; color: var(--muted); }
.kural .note { margin: 0; font-size: 12.5px; }

.kosul-set { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; margin: 0; }
.kosul-set legend { font-size: 13px; font-weight: 700; padding: 0 6px; }
.kosul-satir { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 6px; margin-bottom: 8px; align-items: center; }
.kosul-satir select, .kosul-satir input { min-height: 40px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); padding: 6px 8px; min-width: 0; font-size: 14px; }
.kosul-satir .btn { min-height: 40px; padding: 0 12px; }
.eylem-kutu { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.ikili { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.dene { margin-top: 14px; background: var(--surface-2); border-radius: var(--r-sm); padding: 12px 14px; }
.dene h4 { margin: 0 0 8px; font-size: 14px; }
.dene-t { width: 100%; font-size: 13.5px; }
.dene-t th, .dene-t td { padding: 5px 6px; border-bottom: 1px solid var(--line); }
.dene-t th { background: transparent; color: var(--muted); font-size: 12px; }

.oneri { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 10px; }
.oneri b { display: inline-block; margin-right: 6px; }
.oneri .note { margin: 6px 0 10px; }
.oneri-list { display: flex; flex-direction: column; gap: 8px; }
.oneri-sec { display: flex; gap: 11px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 13px; cursor: pointer; }
.oneri-sec.secili { border-color: var(--green); background: var(--green-soft); }
.oneri-sec input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green); flex: none; }
.oneri-sec b { font-size: 14.5px; }
.oneri-sec small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }

.sayfa-list { display: flex; flex-wrap: wrap; gap: 8px; }
.sayfa { font-size: 13px; padding: 6px 11px; border-radius: 14px; background: var(--surface-2); }
.sayfa.ok { background: var(--green-soft); color: var(--green-strong); }
.sayfa.ref { background: var(--blue-soft); color: var(--blue); }
.sayfa.yok { background: var(--surface-3); color: var(--muted); }

.hesap-karsi { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.hesap-karsi.bekliyor { opacity: .5; }
.hesap-kart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.hesap-kart.vurgu { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), var(--shadow); }
.hesap-kart h4 { margin: 0 0 10px; font-size: 14px; }
.hesap-kart dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; margin: 0; font-size: 14px; }
.hesap-kart dt { color: var(--muted); }
.hesap-kart dd { margin: 0; font-weight: 700; text-align: right; font-family: var(--font-c); font-size: 16px; }

.uyum-satir { display: grid; grid-template-columns: minmax(120px, 170px) minmax(0, 1fr) 62px auto; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13.5px; }
.uyum-bar { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.uyum-bar span { display: block; height: 100%; background: var(--green); border-radius: 5px; }
.uyum-satir b { font: 700 15px/1 var(--font-c); text-align: right; }
.uyum-satir small { color: var(--muted); }

@media (max-width: 767px) {
  .kural-list { grid-template-columns: 1fr; }
  .kosul-satir { grid-template-columns: 1fr 1fr; }
  .kosul-satir .btn { grid-column: 2; justify-self: end; }
  .ikili { grid-template-columns: 1fr; }
  .uyum-satir { grid-template-columns: 1fr auto; }
  .uyum-bar { grid-column: 1 / -1; }
}

/* =========================================================
   Yardım (kullanım kılavuzu)
   ========================================================= */
.y-ust { display: flex; gap: 20px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 20px; }
.y-ust h2 { font: 700 26px/1.15 var(--font-c); margin: 0 0 4px; }
.y-ust .note { max-width: 62ch; margin: 0; }
.y-ust .fld.search { width: 260px; }

.y-govde { display: grid; grid-template-columns: 226px minmax(0, 1fr); gap: 28px; align-items: start; }
.y-icindekiler { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 2px; }
.y-icindekiler button {
  all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--r-sm); font-size: 14.5px; font-weight: 600; color: var(--ink-2); min-height: 42px;
}
.y-icindekiler button svg { width: 18px; height: 18px; flex: none; opacity: .7; }
.y-icindekiler button:hover, .y-icindekiler button:focus-visible { background: var(--surface-2); color: var(--ink); }

.y-metin { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.y-bolum {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 26px;
  box-shadow: var(--shadow); scroll-margin-top: 88px;
}
.y-bolum.vurgu { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft), var(--shadow); }
.y-bolum h3 { display: flex; align-items: center; gap: 10px; font: 700 22px/1.2 var(--font-c); margin: 0 0 4px; }
.y-bolum h3 svg { width: 22px; height: 22px; color: var(--green); }
.y-bolum h4 { font-size: 15px; margin: 22px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.y-bolum h4:first-of-type { border-top: 0; padding-top: 0; margin-top: 16px; }
.y-ozet { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.y-bolum p { margin: 0 0 11px; max-width: 74ch; line-height: 1.62; }
.y-bolum ul, .y-bolum ol { margin: 0 0 12px; padding-left: 20px; max-width: 74ch; }
.y-bolum li { margin-bottom: 7px; line-height: 1.6; }
.y-bolum code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.yb { background: var(--green-soft); color: var(--green-strong); padding: 1px 7px; border-radius: 4px; font-weight: 600; font-size: 13.5px; white-space: nowrap; }

.y-adim { counter-reset: y; list-style: none; padding: 0; }
.y-adim li { counter-increment: y; position: relative; padding-left: 38px; margin-bottom: 12px; }
.y-adim li::before {
  content: counter(y); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--green-strong); color: #fff; display: grid; place-items: center; font: 700 14px/1 var(--font); }
:root[data-theme="dark"] .y-adim li::before { color: #062117; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .y-adim li::before { color: #062117; } }

.y-ipucu { background: var(--green-soft); border-left: 4px solid var(--green); padding: 11px 14px; border-radius: var(--r-sm); font-size: 14px; }
.y-t { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0 0 14px; }
.y-t th, .y-t td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: normal; }
.y-t th { background: var(--surface-2); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.y-t th.c, .y-t td.c { text-align: center; }
.y-t .yes { color: var(--green); font-weight: 700; }
.y-t .no { color: var(--muted); }

.y-sutun { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.y-sutun span { background: var(--surface-2); border-radius: var(--r-sm); padding: 6px 10px; font-size: 13px; }
.y-sutun small { display: block; color: var(--muted); font-size: 11.5px; }
.y-sayfa { background: var(--surface-2); padding: 11px 14px; border-radius: var(--r-sm); font-size: 13.5px; line-height: 1.9; }

.y-kural { border-left: 3px solid var(--green); padding: 2px 0 2px 14px; margin-bottom: 14px; }
.y-kural b { font-size: 15px; }
.y-kural p { margin: 3px 0 4px; }
.y-kural small { color: var(--muted); font-size: 13px; display: block; line-height: 1.55; }

.y-ekran { display: grid; gap: 14px; }
.y-ekran > div { border-left: 3px solid var(--line); padding-left: 14px; }
.y-ekran b { font-size: 15px; }
.y-ekran p { margin: 3px 0 0; }

.y-sss { display: flex; flex-direction: column; gap: 16px; }
.y-sss > div b { display: block; font-size: 15px; margin-bottom: 3px; }
.y-sss > div p { margin: 0; }

.y-sozluk { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 9px 18px; margin: 0; font-size: 14.5px; }
.y-sozluk dt { font-weight: 700; }
.y-sozluk dd { margin: 0; color: var(--ink-2); }

@media (max-width: 1023px) {
  .y-govde { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .y-icindekiler { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .y-icindekiler button { background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; padding: 8px 12px; }
}
@media (max-width: 767px) {
  .y-ust { flex-direction: column; align-items: stretch; gap: 12px; }
  .y-ust .fld.search { width: 100%; }
  .y-bolum { padding: 18px 16px; }
  .y-bolum h3 { font-size: 20px; }
  .y-sozluk { grid-template-columns: 1fr; gap: 2px 0; }
  .y-sozluk dd { margin-bottom: 10px; }
  .y-icindekiler button svg { display: none; }
}

/* ===== Aktarım günlüğü: künye çekmecesi ve geri alma ===== */
.link-btn {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 600;
  color: var(--green-strong); text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 3px; cursor: pointer; text-align: left;
}
.link-btn:hover { text-decoration-color: currentColor; }
.etiket {
  display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11px;
  font-weight: 700; letter-spacing: .02em; vertical-align: middle; white-space: nowrap;
}
.etiket.geri { background: var(--amber-soft); color: color-mix(in srgb, var(--amber) 70%, var(--ink)); }
.drawer h4 { font: 700 15px/1.3 var(--font); margin: 20px 0 6px; }
ul.ince { margin: 6px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.6; }
ul.ince .note { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.drawer .uyari {
  background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent);
  border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.5; margin: 12px 0 0;
}
.geral {
  margin-top: 22px; padding: 14px; border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--red) 28%, transparent);
  background: var(--red-soft);
}
.geral.acik { box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 16%, transparent); }
.geral h4 { margin-top: 0; }
.geral p:last-child { margin-bottom: 0; }
.onay { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; line-height: 1.45; margin: 10px 0 2px; cursor: pointer; }
.onay input { margin: 2px 0 0; flex: 0 0 auto; }
.etiket.sahip { background: color-mix(in srgb, var(--c4) 20%, transparent); color: var(--c4); }
.role-tag.r-superadmin { background: color-mix(in srgb, var(--c4) 20%, transparent); color: var(--c4); }

/* ===== Rol matrisi: dar ekranda kısa rol adları, sıkı hücreler ===== */
table.matrix th .kisa { display: none; }
.matrix td, .matrix th { max-width: none; }
@container (max-width: 760px) {
  table.matrix { font-size: 12.5px; }
  table.matrix th, table.matrix td { padding: 7px 5px; }
  table.matrix th:first-child, table.matrix td:first-child { white-space: normal; max-width: 15ch; }
  table.matrix th.c { white-space: normal; }
  table.matrix th .tam { display: none; }
  table.matrix th .kisa { display: inline; }
}
@container (max-width: 420px) {
  table.matrix { font-size: 11.5px; }
  table.matrix th, table.matrix td { padding: 6px 2px; }
  table.matrix th:first-child, table.matrix td:first-child { max-width: 11ch; }
  table.matrix .yes, table.matrix .no { font-size: 13px; }
}
/* Kart görünümünde durum rozetleri satıra sığmazsa sarsın */
.cards td .st { display: flex; align-items: flex-start; white-space: normal; }
