/*
  Sts.WebAdmin tasarım sistemi — tema/şablon lisansı yok, tamamen bize ait.
  Yön: paslanmaz çelik tonlu nötrler + steril ambalaj mavisi tek vurgu rengi. İmza öğesi: sterilizasyon indikatör
  bandından esinlenen çizgili "gösterge şeridi" (lisans süresi, paket ilerlemesi, marka işareti).
  Yazı: Instrument Sans (arayüz) + Atkinson Hyperlegible Mono (OFL) — MAC, IP, sürüm kodu gibi karıştırılmaya açık
  tanımlayıcılar mono ve çizgili sıfırla; düz metindeki tarih/sayılar Instrument'ın sade rakamlarıyla.
  CSP satır içi stile izin vermez: değişken genişlikler data-level gibi özniteliklerle verilir.
*/

/* ------------------------------------------------------------------ fontlar */
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/instrument-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/instrument-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Mono";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/atkinson-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Mono";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/atkinson-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ------------------------------------------------------------------ jetonlar */
:root {
  color-scheme: light;
  --font-ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Atkinson Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --paper: #f2f4f6;          /* çelik beyazı — kenar çubuğu, uygulama zemini */
  --surface: #ffffff;        /* içerik tuvali */
  --surface-2: #f6f8fa;      /* tablo başlığı, üzerine gelinen satır */
  --ink: #17212c;            /* metin */
  --ink-2: #4c5968;          /* ikincil metin */
  --ink-3: #7b8796;          /* üçüncül metin, ipuçları */
  --line: #dee3e9;
  --line-strong: #c7cfd8;

  --accent: #2b5ca8;         /* steril ambalaj mavisi */
  --accent-strong: #224a88;
  --accent-ink: #ffffff;
  --accent-soft: #e8eef8;

  --ok: #28755a;  --ok-soft: #e3f1ea;
  --warn: #965f00; --warn-soft: #fbf0d8;
  --bad: #b03a2e;  --bad-soft: #fbe6e3;
  --info: #2b5ca8; --info-soft: #e8eef8;

  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
  --radius: 10px;
  --radius-sm: 7px;
  --radius-xs: 5px;
  --shadow-pop: 0 12px 32px rgb(20 32 48 / 0.16), 0 2px 6px rgb(20 32 48 / 0.08);
  --shadow-raised: 0 1px 2px rgb(20 32 48 / 0.06);

  /* grafik serileri (dataviz doğrulayıcısından geçti: açıkta L 0.43–0.77, koyuda 0.48–0.67) */
  --chart-ok: #2b5ca8;
  --chart-bad: #b03a2e;

  --sidebar-w: 248px;
  --topbar-h: 56px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0f151c;
  --surface: #151d26;
  --surface-2: #1b2531;
  --ink: #e4e9ef;
  --ink-2: #a3afbd;
  --ink-3: #7c8998;
  --line: #26313d;
  --line-strong: #344251;

  --accent: #7ea5ea;
  --accent-strong: #9cbbf1;
  --accent-ink: #0f151c;
  --accent-soft: #1c2a40;

  --ok: #5cba90;  --ok-soft: #16301f;
  --warn: #e2aa45; --warn-soft: #33260e;
  --bad: #ee7a6d;  --bad-soft: #3a1a17;
  --info: #7ea5ea; --info-soft: #1c2a40;

  --shadow-pop: 0 14px 36px rgb(0 0 0 / 0.5), 0 2px 8px rgb(0 0 0 / 0.35);
  --shadow-raised: 0 1px 2px rgb(0 0 0 / 0.35);

  --chart-ok: #6b93dc;
  --chart-bad: #e0675b;
}

/* ------------------------------------------------------------------ temel */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 15px/1.5 var(--font-ui);
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { line-height: 1.2; margin: 0; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
code, .mono { font-family: var(--font-mono); font-size: 0.92em; letter-spacing: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
[hidden] { display: none !important; }

.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 15px; height: 15px; }
.i-lg { width: 22px; height: 22px; }
.spin { animation: spin 1s linear infinite; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--surface); padding: 8px 12px; border-radius: 6px; z-index: 200; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.small { font-size: 13px; }

/* ------------------------------------------------------------------ yerleşim */
.app {
  --sb: var(--sidebar-w);
  display: grid; grid-template-columns: var(--sb) minmax(0, 1fr); min-height: 100vh;
  /* Kenar çubuğu yapışkan ve 100vh; uzun sayfada sütunun zemini ve çizgisi aşağı kadar sürsün */
  background: linear-gradient(to right, var(--paper) calc(var(--sb) - 1px), var(--line) calc(var(--sb) - 1px), var(--line) var(--sb), var(--surface) var(--sb));
}
html[data-sidebar="collapsed"] .app { --sb: 68px; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--paper); border-right: 1px solid var(--line);
  padding: 14px 12px 18px; display: flex; flex-direction: column; gap: 6px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 14px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
/* Marka işareti: indikatör bandı — çapraz çizgili küçük şerit */
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: repeating-linear-gradient(135deg, var(--accent) 0 4px, var(--accent-strong) 4px 8px);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.08);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 15.5px; letter-spacing: -0.005em; }
.brand-sub { font-size: 12.5px; color: var(--ink-3); }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-label { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 14px 10px 4px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 8px;
  color: var(--ink-2); font-weight: 500; text-decoration: none; font-size: 14.5px;
}
.nav a .i { color: var(--ink-3); }
.nav a:hover { background: var(--surface); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent), var(--shadow-raised); }
.nav a[aria-current="page"] .i { color: var(--accent); }
.sidebar-foot { margin-top: auto; padding: 12px 10px 0; font-size: 12px; color: var(--ink-3); }

html[data-sidebar="collapsed"] .sidebar { padding-inline: 10px; }
html[data-sidebar="collapsed"] .brand-text,
html[data-sidebar="collapsed"] .nav-label,
html[data-sidebar="collapsed"] .nav a span,
html[data-sidebar="collapsed"] .sidebar-foot { display: none; }
html[data-sidebar="collapsed"] .nav a { justify-content: center; padding: 9px; }
html[data-sidebar="collapsed"] .brand { justify-content: center; padding-inline: 0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px; padding: 0 24px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .crumbs { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 13.5px; min-width: 0; }
.topbar .crumbs a { color: var(--ink-2); text-decoration: none; }
.topbar .crumbs a:hover { color: var(--ink); }
.topbar .crumbs .current { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-trigger {
  margin-left: auto; display: inline-flex; align-items: center; gap: 10px; height: 36px; min-width: 240px;
  padding: 0 10px 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink-3); font: inherit; font-size: 14px; cursor: pointer;
}
.search-trigger:hover { border-color: var(--line-strong); color: var(--ink-2); }
.search-trigger kbd { margin-left: auto; }
kbd {
  font: 600 11.5px var(--font-ui); color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px;
}
.content { padding: 26px 28px 72px; width: 100%; }

/* kullanıcı menüsü (native details) */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; border: 1px solid var(--line);
}
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 6px;
}
.menu-head { padding: 10px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head strong { display: block; }
.menu-head span { font-size: 13px; color: var(--ink-3); }
.menu-panel a, .menu-panel button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border-radius: 7px;
  color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; font-size: 14px; cursor: pointer; text-align: left;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); }
.menu-panel .i { color: var(--ink-3); }
/* dil seçimi: menüde ve giriş sayfasında iki düğmelik seçici; etkin dil vurgulu */
.menu-lang { display: flex; align-items: center; gap: 4px; padding: 4px 12px; }
.menu-lang .i { margin-right: 6px; }
.menu-panel .menu-lang a { width: auto; padding: 4px 10px; font-size: 13.5px; }
.menu-lang a, .auth-lang a { border-radius: 999px; color: var(--ink-2); text-decoration: none; }
.menu-lang a[aria-current="true"], .auth-lang a[aria-current="true"] { background: var(--surface-2); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }

/* ------------------------------------------------------------------ sayfa başı */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 27px; letter-spacing: -0.015em; }
.page-sub { margin-top: 6px; color: var(--ink-2); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); text-decoration: none; margin-bottom: 10px; }
.back-link:hover { color: var(--ink); }

/* ------------------------------------------------------------------ düğmeler */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 600 14px/1 var(--font-ui); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn .i { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-ink); }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.btn-danger:hover { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--ink); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; gap: 6px; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn.htmx-request .i:not(.spin) { visibility: hidden; }
.btn.htmx-request { position: relative; }
.btn.htmx-request::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite;
}
.btn-sm.htmx-request::after { width: 12px; height: 12px; margin: -6px 0 0 -6px; }
.btn-primary.htmx-request { color: transparent; }
.btn-primary.htmx-request::after { border-color: var(--accent-ink); border-right-color: transparent; }

/* ------------------------------------------------------------------ rozetler */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); 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; }
.badge.outline { background: transparent; }
a.badge { text-decoration: none; }
a.badge:hover { border-color: currentColor; }
.badges { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ gösterge şeridi (imza öğesi) */
.strip { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-3); }
.strip-bar {
  position: relative; width: 68px; height: 9px; border-radius: 999px; overflow: hidden; flex: none;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--line-strong) 70%, transparent) 0 2px, transparent 2px 5px);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.strip-fill {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit;
  background: repeating-linear-gradient(135deg, currentColor 0 3px, color-mix(in srgb, currentColor 72%, #000) 3px 6px);
}
.strip-fill[data-level="1"] { width: 10%; } .strip-fill[data-level="2"] { width: 20%; }
.strip-fill[data-level="3"] { width: 30%; } .strip-fill[data-level="4"] { width: 40%; }
.strip-fill[data-level="5"] { width: 50%; } .strip-fill[data-level="6"] { width: 60%; }
.strip-fill[data-level="7"] { width: 70%; } .strip-fill[data-level="8"] { width: 80%; }
.strip-fill[data-level="9"] { width: 90%; } .strip-fill[data-level="10"] { width: 100%; }
.strip-label { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.strip.ok { color: var(--ok); }
.strip.warn { color: var(--warn); }
.strip.bad { color: var(--bad); }
.strip.bad .strip-bar { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 55%, var(--line)); }
.strip.bad .strip-label { color: var(--bad); }
.strip.lg .strip-bar { width: 140px; height: 12px; }

/* ------------------------------------------------------------------ filtreler */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.search { position: relative; flex: 1 1 260px; max-width: 440px; }
.search .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); pointer-events: none; }
.search .input { padding-left: 36px; }
.filters select.input { width: auto; min-width: 150px; padding-right: 30px; }
.filters input.input[type=date] { width: auto; }
.filters .reset { font-size: 13.5px; color: var(--ink-2); text-decoration: none; padding: 0 4px; }
.filters .reset:hover { color: var(--ink); text-decoration: underline; }
.filters .date-range { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); }
.filters .date-range-label { font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg a, .seg label { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); text-decoration: none; cursor: pointer; border-left: 1px solid var(--line); }
.seg a:first-child, .seg label:first-child { border-left: 0; }
.seg a[aria-current="true"], .seg input:checked + span { background: var(--accent-soft); color: var(--accent); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }

/* ------------------------------------------------------------------ tablo */
.grid-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; background: var(--surface); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th {
  position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; font-weight: 600; font-size: 12.5px;
  color: var(--ink-2); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tr[data-href] { cursor: pointer; }
.table tr.is-off td { color: var(--ink-3); }
.table tr.is-off .cell-title { color: var(--ink-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .mono { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0; white-space: nowrap; }
/* Uzun tek parça değerler (SQL örneği, UNC yolu): tabloyu taşırmasın, gerekirse satır içinde kırılsın. */
.table .break { white-space: normal; overflow-wrap: anywhere; }
.table .actions { width: 1%; white-space: nowrap; text-align: right; }
.table .actions .btn { opacity: .75; }
.table .actions .row { flex-wrap: nowrap; justify-content: flex-end; }
@media (max-width: 1280px) { .table .actions .stack-narrow { flex-direction: column; align-items: stretch; } }
.table a.quiet { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--line-strong); }
.table a.quiet:hover { color: var(--accent); border-bottom-color: currentColor; }
.table tr:hover .actions .btn:not([disabled]) { opacity: 1; }
.table .actions .btn[disabled] { opacity: .35; }
.cell-title { font-weight: 600; color: var(--ink); text-decoration: none; }
a.cell-title:hover { color: var(--accent); }
.cell-sub { color: var(--ink-3); font-size: 12.5px; margin-top: 1px; }
.cell-stack { display: flex; flex-direction: column; }
th .sort { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
th .sort .i { width: 13px; height: 13px; opacity: .45; }
th[aria-sort] .sort { color: var(--ink); }
th[aria-sort] .sort .i { opacity: 1; color: var(--accent); }
.table tfoot td { background: var(--surface-2); font-weight: 600; border-top: 1px solid var(--line); border-bottom: 0; }
#grid.htmx-request .table-wrap { opacity: .55; transition: opacity .15s .1s; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px 0; color: var(--ink-2); font-size: 13.5px; flex-wrap: wrap; }
.pager nav { display: flex; gap: 4px; align-items: center; }
.pager a, .pager .current, .pager .gap {
  min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px;
  border-radius: var(--radius-xs); text-decoration: none; color: var(--ink); border: 1px solid var(--line);
}
.pager a:hover { border-color: var(--line-strong); background: var(--surface-2); }
.pager .current { background: var(--ink); color: var(--surface); border-color: var(--ink); font-weight: 700; }
.pager .gap { border-color: transparent; }
.pager select.input { width: auto; height: 32px; }
.pager-size { display: inline-flex; align-items: center; gap: 8px; margin-left: 16px; }
/* Sürüm zip'i yükleme (#402) */
.upload { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.upload input[type=file].input { width: auto; flex: 1 1 260px; padding: 6px 8px; height: auto; }
.upload input[type=file]::file-selector-button {
  font: inherit; font-weight: 600; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: 6px; padding: 4px 10px; margin-right: 10px; cursor: pointer;
}
.upload input[type=file]::file-selector-button:hover { border-color: var(--ink-3); }
.upload-progress { width: 100%; height: 6px; margin-top: 8px; accent-color: var(--accent); }

/* ------------------------------------------------------------------ yenilik notu (#440): Sürümler → Yenilikler sayfası */
/* Okunurluk için belge genişliği sınırlı (yazdırılan/Word'e giden metin); formlar gibi tam genişlik değil, bilinçli. */
.notes-doc { max-width: 1000px; font-size: 15.5px; line-height: 1.6; }
.notes-doc h1 { font-size: 26px; letter-spacing: -0.015em; margin: 0 0 14px; }
.notes-doc h2 { font-size: 18px; margin: 30px 0 12px; padding: 6px 12px; border-radius: var(--radius-xs); background: var(--accent-soft); color: var(--accent); }
.notes-doc h3 { font-size: 15.5px; margin: 22px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.notes-doc h1:first-child, .notes-doc h2:first-child, .notes-doc h3:first-child { margin-top: 0; }
.notes-doc p { margin: 0 0 10px; }
.notes-doc ul { margin: 0 0 12px; padding-left: 22px; }
.notes-doc li { margin: 0 0 4px; }
.notes-doc strong { font-weight: 700; }
.notes-hint { display: block; margin-top: 18px; font-size: 12.5px; color: var(--ink-3); }
@media print {
  @page { size: A4; margin: 2cm; }
  :root, :root[data-theme="dark"] {
    color-scheme: light; --paper: #fff; --surface: #fff; --surface-2: #f3f4f6; --ink: #111; --ink-2: #444; --ink-3: #666;
    --line: #ccc; --line-strong: #aaa; --accent: #224a88; --accent-soft: #eef2f8;
  }
  .sidebar, .topbar, .backdrop, .toasts, .skip, dialog, .no-print { display: none !important; }
  .app, html[data-sidebar="collapsed"] .app { display: block; background: none; min-height: 0; }
  .content { padding: 0; }
  .page-head { margin-bottom: 14px; }
  .notes-doc { max-width: none; font-size: 11pt; }
  .notes-doc h2 { break-after: avoid; background: #f5941c; color: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .notes-doc h3 { break-after: avoid; border-bottom-color: #f5941c; }
  .notes-doc p, .notes-doc li { break-inside: avoid; }
}

.empty { text-align: center; padding: 56px 16px; color: var(--ink-2); }
.empty .i { width: 30px; height: 30px; color: var(--ink-3); }
.empty h3 { color: var(--ink); font-size: 16px; margin: 12px 0 4px; }
.empty p { max-width: 420px; margin: 0 auto 16px; }

/* ------------------------------------------------------------------ formlar */
.form-section { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px 32px; padding: 26px 0; border-top: 1px solid var(--line); }
.form-section:first-of-type { border-top: 0; padding-top: 6px; }
.form-section > header h2 { font-size: 15.5px; margin-bottom: 6px; }
.form-section > header p { color: var(--ink-2); font-size: 13.5px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; align-content: start; }
.form-grid .span-2 { grid-column: 1 / -1; }
/* Sayfa tam genişlikte; geniş ekranda form alanları yan yana çoğalır (dar ekranda 2 sütun okunaklı kalır). */
@media (min-width: 1600px) { .form .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 2200px) { .form .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.field .req { color: var(--bad); margin-left: 2px; }
.field .hint { font-size: 12.5px; color: var(--ink-3); }
.field .error { color: var(--bad); font-size: 13px; font-weight: 600; }
.field .warning { color: var(--warn); font-size: 13px; display: flex; gap: 6px; align-items: flex-start; }
.input {
  height: 38px; width: 100%; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: 400 14.5px var(--font-ui);
  transition: border-color .12s, box-shadow .12s;
}
select.input {
  appearance: none; padding-right: 32px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
textarea.input { height: auto; min-height: 104px; padding: 10px 12px; line-height: 1.55; resize: vertical; }
textarea.input.tall { min-height: 320px; font-family: var(--font-mono); font-size: 13.5px; }
.input::placeholder { color: var(--ink-3); }
.input:hover { border-color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.input.mono { font-family: var(--font-mono); font-size: 14px; letter-spacing: 0; }
.input[readonly] { background: var(--surface-2); }
.field.invalid .input { border-color: var(--bad); }
.field.invalid .input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 30%, transparent); }
.input-group { display: flex; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; height: 38px; }
.secret-value { font-family: var(--font-mono); background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--radius-xs); padding: 6px 10px; display: inline-block; user-select: all; }

/* anahtar (checkbox → switch) */
.switch { display: inline-flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { appearance: none; flex: none; width: 38px; height: 22px; margin: 1px 0 0; border-radius: 999px; background: var(--line-strong); position: relative; cursor: pointer; transition: background-color .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.switch-text { display: flex; flex-direction: column; }
.switch-text strong { font-weight: 600; font-size: 14px; }
.switch-text span { font-size: 12.5px; color: var(--ink-3); font-weight: 400; }
.field > label.switch, .field > label.check { font-weight: 400; }

/* onay kutusu listesi (roller, hastaneler) */
.checks { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: var(--radius-sm); max-height: 320px; overflow: auto; padding: 4px; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.check:hover { background: var(--surface-2); }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check strong { font-weight: 600; font-size: 14px; display: block; }
.check span { font-size: 12.5px; color: var(--ink-3); }
.checks-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.checks-tools .search { max-width: none; }

.actionbar {
  position: sticky; bottom: 0; z-index: 5; display: flex; gap: 10px; align-items: center;
  padding: 14px 0; margin-top: 4px; border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(6px);
}
.actionbar .meta { font-size: 12.5px; color: var(--ink-3); margin-right: auto; }
.actionbar .dirty { display: none; color: var(--warn); font-weight: 600; font-size: 13px; }
form.is-dirty .actionbar .dirty { display: inline; }

.callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); font-size: 14px; }
.callout .i { margin-top: 1px; }
.callout.warn { background: var(--warn-soft); border-color: transparent; color: color-mix(in srgb, var(--warn) 70%, var(--ink)); }
.callout.bad { background: var(--bad-soft); border-color: transparent; color: color-mix(in srgb, var(--bad) 75%, var(--ink)); }
.callout.info { background: var(--info-soft); border-color: transparent; color: color-mix(in srgb, var(--info) 70%, var(--ink)); }
.callout ul { margin: 6px 0 0; padding-left: 18px; }
.callout + .filters, .callout + .table-wrap, .callout + .form-grid, .callout + form, .callout + .callout { margin-top: 14px; }
.page-head + .callout { margin-bottom: 0; }
form > .callout:first-child { margin-bottom: 8px; }
.section-title { font-size: 16px; margin: 28px 0 12px; }
.panel + .section-title { margin-top: 28px; }

/* ------------------------------------------------------------------ detay başlığı ve sekmeler */
.entity-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 4px; }
.entity-head h1 { font-size: 27px; letter-spacing: -0.015em; }
.entity-meta { display: flex; gap: 8px 14px; align-items: center; flex-wrap: wrap; margin-top: 10px; color: var(--ink-2); font-size: 14px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); margin: 18px 0 6px; overflow: hidden; }
.fact { padding: 12px 16px; border-left: 1px solid var(--line); }
.fact:first-child { border-left: 0; }
.fact-label { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.fact-value { font-size: 15px; font-weight: 600; margin-top: 3px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 16px 0 20px; overflow-x: auto; scrollbar-width: thin; }
.tabs a {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 11px; margin-bottom: -1px; white-space: nowrap;
  color: var(--ink-2); font-weight: 600; font-size: 14px; text-decoration: none; border-bottom: 2px solid transparent;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .count { font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; line-height: 18px; }
.tab-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ pano */
.status-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.status-band > a, .status-band > div { padding: 14px 18px; border-left: 1px solid var(--line); color: var(--ink); text-decoration: none; display: block; }
.status-band > :first-child { border-left: 0; }
.status-band > a:hover { background: var(--surface-2); }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stat-label { font-size: 13.5px; color: var(--ink-2); margin-top: 4px; }
.stat-note { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.stat-value.bad { color: var(--bad); } .stat-value.warn { color: var(--warn); }
/* En fazla 3 sütun: tam genişlikte geniş panel (grafik) tüm sütunlara yayıldığından auto-fit boş sütunu daraltamıyor,
   3 panel geniş ekranın solunda kalıyordu. Sütun en az 360 px, en az içeriğin üçte biri. */
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(360px, calc((100% - 32px) / 3)), 1fr)); gap: 16px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.panel.wide { grid-column: 1 / -1; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.panel-head a { font-size: 13.5px; white-space: nowrap; }
.panel-body { padding: 4px 0; }
.panel-empty { padding: 18px 16px; color: var(--ink-3); font-size: 14px; display: flex; gap: 8px; align-items: center; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.list-row .cell-sub { margin-top: 0; }
.changes { margin: 4px 0 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--ink-2); }
.changes li { padding: 1px 0; overflow-wrap: anywhere; }
.history-row { align-items: flex-start; }
.chart { padding: 12px 16px 6px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
.chart svg { display: block; overflow: visible; }
.chart-y { position: relative; width: 34px; height: 150px; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chart-y span { position: absolute; right: 0; transform: translateY(-50%); }
.chart-y span:nth-child(1) { top: 10px; } .chart-y span:nth-child(2) { top: 69px; } .chart-y span:nth-child(3) { top: 128px; }
.chart .bar-ok { fill: var(--chart-ok); }
.chart .bar-bad { fill: var(--chart-bad); }
.chart .hit { fill: transparent; }
.chart .bar:hover .bar-ok, .chart .bar:hover .bar-bad { filter: brightness(1.12); }
.chart .axis { fill: var(--ink-3); font-size: 10.5px; font-family: var(--font-ui); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); padding: 0 16px 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.chart-legend .ok { background: var(--chart-ok); } .chart-legend .bad { background: var(--chart-bad); }
.chart-legend { align-items: center; flex-wrap: wrap; }
.chart-table { margin-left: auto; }
.chart-table summary { cursor: pointer; color: var(--ink-2); font-size: 12.5px; }
.chart-table[open] { flex-basis: 100%; margin-left: 0; }
.chart-table .table-wrap { margin-top: 10px; max-height: 280px; }
.tip {
  position: fixed; z-index: 400; pointer-events: none; padding: 7px 10px; border-radius: 7px; font-size: 13px;
  background: var(--ink); color: var(--surface); box-shadow: var(--shadow-pop); white-space: nowrap; transform: translate(-50%, calc(-100% - 10px));
}

/* ------------------------------------------------------------------ paketler */
.pkg-list .list-row { padding: 12px 16px; }
.job { display: flex; flex-direction: column; gap: 6px; min-width: 220px; }
.job-bar { position: relative; height: 10px; border-radius: 999px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line-strong);
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--line-strong) 70%, transparent) 0 2px, transparent 2px 5px); }
.job-fill { position: absolute; inset: 0 auto 0 0; width: 0; color: var(--accent); border-radius: inherit; transition: width .7s linear;
  background: repeating-linear-gradient(135deg, currentColor 0 4px, color-mix(in srgb, currentColor 72%, #000) 4px 8px); background-size: 11.3px 100%; }
.job.running .job-fill { animation: tape 1s linear infinite; }
.job.done .job-fill { color: var(--ok); }
.job.failed .job-fill { color: var(--bad); }
.job-text { font-size: 13px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 10px; }
.job-fill[data-p="0"] { width: 3%; }
/* %5'lik adımlar (CSP: satır içi stil yok) */
.job-fill[data-p="5"]{width:5%}.job-fill[data-p="10"]{width:10%}.job-fill[data-p="15"]{width:15%}.job-fill[data-p="20"]{width:20%}
.job-fill[data-p="25"]{width:25%}.job-fill[data-p="30"]{width:30%}.job-fill[data-p="35"]{width:35%}.job-fill[data-p="40"]{width:40%}
.job-fill[data-p="45"]{width:45%}.job-fill[data-p="50"]{width:50%}.job-fill[data-p="55"]{width:55%}.job-fill[data-p="60"]{width:60%}
.job-fill[data-p="65"]{width:65%}.job-fill[data-p="70"]{width:70%}.job-fill[data-p="75"]{width:75%}.job-fill[data-p="80"]{width:80%}
.job-fill[data-p="85"]{width:85%}.job-fill[data-p="90"]{width:90%}.job-fill[data-p="95"]{width:95%}.job-fill[data-p="100"]{width:100%}

/* ------------------------------------------------------------------ bildirimler ve diyaloglar */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; min-width: 280px; max-width: 440px;
  padding: 12px 14px 12px 12px; border-radius: var(--radius-sm); background: var(--ink); color: var(--surface);
  box-shadow: var(--shadow-pop); font-size: 14px; animation: toast-in .2s ease-out;
}
.toast .i { margin-top: 1px; }
.toast.success .i { color: color-mix(in srgb, var(--ok) 60%, #fff); }
.toast.error { background: var(--bad); color: #fff; }
.toast.leaving { animation: toast-out .2s ease-in forwards; }
.jobs { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.jobs .job {
  pointer-events: auto; width: 340px; max-width: calc(100vw - 40px); padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-pop);
}
/* Giriş animasyonu yalnız ilk görünüşte: kart yoklamada yeniden çizilmez, sonuç kartı da animasyonsuz yerine geçer. */
.jobs .job.running { animation: toast-in .2s ease-out; }
.jobs .job.leaving { animation: toast-out .2s ease-in forwards; }
.job-head { display: flex; align-items: flex-start; gap: 10px; }
.job-head strong { font-size: 13.5px; line-height: 1.35; }
.job-head button { margin-left: auto; background: none; border: 0; color: var(--ink-3); cursor: pointer; padding: 0; }
.job .job-error { color: var(--bad); font-size: 13px; }
.toast button { margin-left: auto; background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; padding: 0 0 0 6px; }

dialog.modal {
  border: 0; padding: 0; border-radius: 12px; width: min(480px, calc(100vw - 32px));
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop);
}
dialog.modal::backdrop, dialog.palette::backdrop { background: rgb(12 18 26 / .48); backdrop-filter: blur(2px); }
dialog[open] { animation: pop-in .16s ease-out; }
.modal-body { padding: 22px 22px 6px; display: flex; gap: 14px; }
.modal-body .i { width: 22px; height: 22px; color: var(--bad); flex: none; margin-top: 2px; }
.modal-body h2 { font-size: 17px; margin-bottom: 6px; }
.modal-body p { color: var(--ink-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 22px 20px; }

dialog.palette {
  border: 0; padding: 0; margin: 11vh auto auto; border-radius: 14px; width: min(660px, calc(100vw - 24px));
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); overflow: hidden;
}
.palette-input-wrap { position: relative; border-bottom: 1px solid var(--line); }
.palette-input-wrap .i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.palette-input { width: 100%; height: 56px; border: 0; background: transparent; color: var(--ink); font: 400 16.5px var(--font-ui); padding: 0 18px 0 50px; }
.palette-input:focus { outline: none; }
.palette-results { max-height: min(58vh, 520px); overflow-y: auto; padding: 6px; }
.palette-group { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 10px 12px 4px; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; }
.palette-item .i { color: var(--ink-3); }
.palette-item[aria-selected="true"] { background: var(--accent-soft); }
.palette-item[aria-selected="true"] .i { color: var(--accent); }
.palette-item small { display: block; color: var(--ink-3); font-size: 12.5px; }
.palette-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); background: var(--surface-2); }
.palette-empty { padding: 28px 16px; text-align: center; color: var(--ink-3); }

/* ------------------------------------------------------------------ giriş */
.auth { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 16px; padding: 24px 16px; background: var(--paper); }
.auth-lang { display: flex; gap: 4px; font-size: 13.5px; }
.auth-lang a { padding: 4px 12px; }
.auth-lang a:hover { color: var(--ink); }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-raised); overflow: hidden; }
.auth-tape { height: 8px; background: repeating-linear-gradient(135deg, var(--accent) 0 8px, var(--accent-strong) 8px 16px); }
.auth-body { padding: 28px 28px 30px; display: flex; flex-direction: column; gap: 18px; }
.auth-body .brand { padding: 0; }
.auth-body h1 { font-size: 22px; }
.auth-foot { text-align: center; font-size: 12.5px; color: var(--ink-3); margin-top: 16px; }

/* ------------------------------------------------------------------ hareket */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes tape { from { background-position: 0 0; } to { background-position: 11.3px 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* ------------------------------------------------------------------ dar ekran */
.only-mobile { display: none; }
.backdrop { display: none; }
@media (max-width: 900px) {
  .app, html[data-sidebar="collapsed"] .app { grid-template-columns: minmax(0, 1fr); background: var(--surface); }
  .status-band { grid-template-columns: 1fr 1fr; }
  .status-band > * { border-left: 0; border-top: 1px solid var(--line); }
  .status-band > :nth-child(-n+2) { border-top: 0; }
  .status-band > :nth-child(even) { border-left: 1px solid var(--line); }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-pop); }
  html[data-nav="open"] .sidebar { transform: none; }
  html[data-nav="open"] .backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgb(12 18 26 / .4); }
  html[data-sidebar="collapsed"] .brand-text, html[data-sidebar="collapsed"] .nav-label,
  html[data-sidebar="collapsed"] .nav a span, html[data-sidebar="collapsed"] .sidebar-foot { display: revert; }
  html[data-sidebar="collapsed"] .nav a { justify-content: flex-start; padding: 7px 10px; }
  .only-mobile { display: inline-flex; }
  .only-desktop { display: none !important; }
  .topbar { padding: 0 16px; }
  .search-trigger { min-width: 0; width: 40px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .content { padding: 20px 16px 72px; }
  .form-section { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 20px 0; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .page-head h1, .entity-head h1 { font-size: 23px; }
  .table .hide-sm { display: none; }
  .panels { grid-template-columns: minmax(0, 1fr); }
  .fact { border-left: 0; border-top: 1px solid var(--line); }
  .fact:first-child { border-top: 0; }
}
@media (max-width: 560px) {
  .search { max-width: none; flex-basis: 100%; }
  .filters select.input { flex: 1 1 auto; }
  .filters .date-range { flex: 1 1 100%; min-width: 0; }
  .filters .date-range input.input[type=date] { flex: 1 1 0; min-width: 0; }
  .actionbar { flex-wrap: wrap; }
  .actionbar .meta { width: 100%; }
}
