/* ==========================================================================
   Soketix Yönetim Paneli — tasarım sistemi (2.4 yeniden tasarım)

   Kaynak: onaylı prototip (Main / Sidebar / Musteriler / Musteri / Ayarlar).
   Kırık beyaz zemin, ince kenarlıklı beyaz kartlar, koyu lacivert marka,
   turkuaz vurgu. Renk YALNIZCA anlam taşıdığında kullanılır; anlam hiçbir
   zaman yalnız renge bırakılmaz (pill'lerde simge + metin, sayılarda etiket).

   Bölümler
     1. Yazı tipleri            6. Yeni bileşenler (kpi, şerit, tablo, menü…)
     2. Tasarım belirteçleri    7. Eski sınıflar (geriye uyum, yeni dille)
     3. Koyu tema               8. Alan sayfaları (kova, yükleme, combobox…)
     4. Taban                   9. Duyarlı kırılımlar
     5. Kabuk (menü, üst çubuk) 10. Yazdırma / hareket azaltma

   Sayfaya özel stil BU DOSYAYA yazılmaz: assets/css/pages/<sayfa>.css
   ========================================================================== */

/* ==========================================================================
   1. Yazı tipleri — yerel (CDN yok; CSP font-src 'self')
   Değişken yazı tipi: tek dosya 400–700 aralığının tamamını taşır.
   Latin + Latin Ext: Türkçe karakterlerin tamamı (ğ ş İ ı ç ö ü).
   ========================================================================== */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/Inter-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: "Inter";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/Inter-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Fira Code";
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url("../fonts/FiraCode-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: "Fira Code";
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url("../fonts/FiraCode-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ==========================================================================
   2. Tasarım belirteçleri (açık tema)
   ========================================================================== */
:root {
    color-scheme: light;

    /* Marka — lacivert ölçeği + turkuaz vurgu */
    --navy-900: #0A2540;
    --navy-800: #10375C;
    --navy-700: #1B4B75;
    --navy-600: #2C6491;
    --navy-100: #EEF3F8;
    --navy-50:  #F2F6FA;
    --teal:     #12B5A6;
    --rose:     #F2627A;   /* logodaki "TIX" */

    /* Yüzeyler */
    --bg:             #F4F6F9;
    --surface:        #FFFFFF;
    --surface-2:      #FAFBFC;   /* tablo başlığı, kart altı */
    --surface-3:      #F2F4F7;   /* segment zemini, sayaç */
    --surface-sunken: #F7F9FC;   /* içe gömülü not kutusu */
    --surface-hover:  #F7F9FC;
    --surface-input:  #FFFFFF;

    /* Kenarlıklar */
    --border:        #E8ECF1;    /* kart */
    --border-2:      #E3E8EF;    /* hafif kontrol (ikon düğme, menü) */
    --border-strong: #CDD5DF;    /* giriş alanı, ikincil düğme */
    --divider:       #EEF1F5;    /* kart içi bölücü */
    --divider-2:     #F2F4F7;    /* tablo satırı */

    /* Metin */
    --text:        #101828;
    --text-2:      #344054;
    --text-3:      #475467;
    --muted:       #475467;      /* ikincil metin (4.5:1 üstü) */
    --faint:       #667085;      /* simge, eksen etiketi */
    --placeholder: #98A2B3;
    --heading:     #0A2540;
    --link:        #1B4B75;
    --link-hover:  #0A2540;

    /* Etkileşim */
    --primary:        #0A2540;
    --primary-hover:  #10375C;
    --primary-active: #1B4B75;
    --on-primary:     #FFFFFF;
    --accent-soft:    #EEF3F8;   /* simge çipi zemini */
    --accent-soft-fg: #1B4B75;
    --accent-softer:  #F2F6FA;   /* seçili satır / seçenek */
    --focus:          #2C6491;
    --focus-ring:     rgba(44, 100, 145, .18);

    /* Anlamsal renkler: metin · zemin · kenar · vurgu (şerit/nokta) */
    --success:        #067647;
    --success-bg:     #ECFDF3;
    --success-bd:     #ABEFC6;
    --success-accent: #17B26A;
    --warning:        #B54708;
    --warning-bg:     #FFFAEB;
    --warning-bd:     #FEDF89;
    --warning-accent: #F79009;
    --warning-strong: #7A2E0E;
    --danger:         #B42318;
    --danger-bg:      #FEF3F2;
    --danger-bd:      #FECDCA;
    --danger-accent:  #F04438;
    --danger-solid:   #B42318;
    --danger-solid-hover: #912018;
    --info:           #175CD3;
    --info-bg:        #EFF8FF;
    --info-bd:        #B2DDFF;
    --info-accent:    #2E90FA;
    --mute-fg:        #344054;
    --mute-bg:        #F2F4F7;
    --mute-accent:    #98A2B3;

    /* Grafik paleti (charts.js ve SVG bileşenleri bunları okur) */
    --c-navy:    #0A2540;
    --c-blue:    #2C6491;
    --c-teal:    #12B5A6;
    --c-slate:   #475467;
    --c-gray:    #667085;
    --c-violet:  #7A5AF8;
    --c-info:    #2E90FA;
    --c-warn:    #F79009;
    --c-orange:  #DC6803;
    --c-danger:  #F04438;
    --c-red:     #D92D20;
    --c-success: #17B26A;
    --c-grid:    #EEF1F5;
    --c-axis:    #CDD5DF;
    --c-tick:    #667085;
    --c-track:   #F2F4F7;

    /* Yan menü */
    --sb-bg: linear-gradient(180deg, #0B2A4A 0%, #0A2540 45%, #071C33 100%);
    --sb-text: #B9C7D6;
    --sb-muted: #8FA3B8;
    --sb-line: rgba(185, 199, 214, .14);
    --sb-hover: rgba(185, 199, 214, .08);
    --sb-active: #1B4B75;
    --mbar-bg: #0A2540;

    /* Ölçek */
    --radius-xs:   6px;
    --radius-sm:   8px;
    --radius:      10px;
    --radius-lg:   14px;
    --radius-pill: 999px;

    --shadow-sm:     0 1px 2px rgba(16, 24, 40, .04);
    --shadow:        0 1px 3px rgba(16, 24, 40, .08);
    --shadow-md:     0 4px 12px rgba(16, 24, 40, .08);
    --shadow-menu:   0 12px 28px rgba(16, 24, 40, .14);
    --shadow-lg:     0 12px 32px rgba(16, 24, 40, .16);
    --shadow-drawer: -8px 0 24px rgba(16, 24, 40, .14);
    --overlay:       rgba(16, 24, 40, .45);

    --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
    --sp-5: 20px; --sp-6: 24px; --sp-7: 28px; --sp-8: 32px;

    --sidebar-w: 248px;
    --sidebar-w-collapsed: 76px;
    --header-h:  70px;
    --content-max: 1400px;

    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: "Fira Code", ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

    /* Eski adlar (sayfalardaki satır içi stiller bunları kullanıyor) */
    --text-muted:  var(--muted);
    --brand-600:   var(--navy-600);
    --brand-900:   var(--navy-900);
    --on-navy:     #FFFFFF;
    --on-navy-2:   #B9C7D6;

    /* z-index katmanları */
    --z-sidebar: 40;
    --z-header:  50;
    --z-menu:    70;
    --z-drawer:  90;
    --z-modal:   100;
    --z-toast:   1000;
}

/* ==========================================================================
   3. Koyu tema — <html data-theme="dark"> (header.php'deki ön-boyama betiği
   localStorage'dan okur; admin.js düğmesi değiştirir)
   ========================================================================== */
[data-theme="dark"] {
    color-scheme: dark;

    --navy-100: rgba(140, 192, 240, .14);
    --navy-50:  rgba(140, 192, 240, .08);
    --navy-600: #4C8DCB;
    --navy-700: #8CC0F0;
    --navy-800: #B5D6F5;

    --bg:             #0B1424;
    --surface:        #111C2E;
    --surface-2:      #15223A;
    --surface-3:      #1B2A43;
    --surface-sunken: #0F192A;
    --surface-hover:  #172640;
    --surface-input:  #0E1829;

    --border:        #22324A;
    --border-2:      #283A55;
    --border-strong: #3A4F6E;
    --divider:       #1D2C43;
    --divider-2:     #1A283E;

    --text:        #E6EDF5;
    --text-2:      #CBD5E1;
    --text-3:      #A9B7C9;
    --muted:       #A9B7C9;
    --faint:       #8394AB;
    --placeholder: #6B7D95;
    --heading:     #F1F5FA;
    --link:        #8CC0F0;
    --link-hover:  #B5D6F5;

    --primary:        #2C6491;
    --primary-hover:  #3672A3;
    --primary-active: #3E7DB0;
    --accent-soft:    rgba(140, 192, 240, .13);
    --accent-soft-fg: #9CC9F2;
    --accent-softer:  rgba(140, 192, 240, .08);
    --focus:          #6BA6DD;
    --focus-ring:     rgba(107, 166, 221, .28);

    --success:        #47CD89;
    --success-bg:     rgba(23, 178, 106, .14);
    --success-bd:     rgba(71, 205, 137, .32);
    --warning:        #FDB022;
    --warning-bg:     rgba(247, 144, 9, .14);
    --warning-bd:     rgba(253, 176, 34, .34);
    --warning-strong: #FEC84B;
    --danger:         #F97066;
    --danger-bg:      rgba(240, 68, 56, .14);
    --danger-bd:      rgba(249, 112, 102, .36);
    --danger-solid:   #D92D20;
    --danger-solid-hover: #B42318;
    --info:           #53B1FD;
    --info-bg:        rgba(46, 144, 250, .14);
    --info-bd:        rgba(83, 177, 253, .34);
    --mute-fg:        #CBD5E1;
    --mute-bg:        #1F2E46;
    --mute-accent:    #667085;

    --c-navy:  #8CC0F0;
    --c-blue:  #4C8DCB;
    --c-slate: #A9B7C9;
    --c-gray:  #8394AB;
    --c-grid:  #1D2C43;
    --c-axis:  #3A4F6E;
    --c-tick:  #A9B7C9;
    --c-track: #1B2A43;

    --sb-bg: linear-gradient(180deg, #0A1E36 0%, #081A2F 45%, #061325 100%);
    --mbar-bg: #081A2F;

    --shadow-sm:   0 1px 2px rgba(0, 0, 0, .3);
    --shadow:      0 1px 3px rgba(0, 0, 0, .35);
    --shadow-md:   0 4px 12px rgba(0, 0, 0, .35);
    --shadow-menu: 0 12px 28px rgba(0, 0, 0, .5);
    --shadow-lg:   0 12px 32px rgba(0, 0, 0, .55);
    --shadow-drawer: -8px 0 24px rgba(0, 0, 0, .5);
    --overlay:     rgba(2, 6, 14, .62);
}

/* ==========================================================================
   4. Taban
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "cv11", "ss01";
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.3; color: var(--text); }
h1 { font-size: 24px; font-weight: 700; color: var(--heading); }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p  { margin: 0; }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

code, kbd, samp, pre { font-family: var(--mono); }

/* Erişilebilirlik: görünür odak halkası — asla kaldırılmaz */
:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

.visually-hidden, .sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Satır içi simgeler — TABAN BOYUT. icon() SVG'yi boyutsuz üretir; hiçbir
   kural eşleşmezse tarayıcı 300×150 çizerdi. Kapsayıcı kuralları bunu ezer. */
svg { width: 16px; height: 16px; flex: 0 0 auto; }
.icon-sm { width: 14px; height: 14px; }

.skip-link {
    position: absolute; left: 8px; top: -48px; z-index: var(--z-toast);
    background: var(--navy-900); color: #fff; padding: 10px 16px;
    border-radius: var(--radius); transition: top .15s ease-out;
}
.skip-link:focus { top: 8px; text-decoration: none; color: #fff; }

/* ==========================================================================
   5. Kabuk
   ========================================================================== */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }

.app-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* --- Yan menü ------------------------------------------------------------ */
.sidebar {
    flex: 0 0 var(--sidebar-w);
    width: var(--sidebar-w);
    position: sticky; top: 0;
    height: 100vh; height: 100dvh;
    overflow-y: auto; overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(185, 199, 214, .25) transparent;
    background: var(--sb-bg);
    color: var(--sb-text);
    display: flex; flex-direction: column;
    padding: 18px 14px 14px;
    z-index: var(--z-sidebar);
    transition: flex-basis .18s ease, width .18s ease;
}

.sb-head {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    padding: 4px 4px 20px 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--sb-line);
}
.sb-brand {
    display: flex; align-items: baseline; gap: 8px;
    color: #fff; min-width: 0; white-space: nowrap;
}
.sb-brand:hover { color: #fff; text-decoration: none; }
.sb-logo { font-size: 21px; font-weight: 700; letter-spacing: .06em; line-height: 1; }
.sb-logo span, .mbar-logo span, .sb-logo-mini span { color: var(--rose); }
.content:focus { outline: none; }
.sb-brand-sub { font-size: 12px; color: var(--sb-muted); font-weight: 500; }
.sb-logo-mini { display: none; font-size: 19px; font-weight: 700; letter-spacing: .04em; }

.sb-iconbtn {
    width: 32px; height: 32px; flex: 0 0 32px;
    border-radius: var(--radius-sm); border: 0;
    background: transparent; color: var(--sb-muted);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.sb-iconbtn:hover { background: var(--sb-hover); color: #fff; }
.sb-iconbtn svg { width: 16px; height: 16px; transition: transform .18s ease; }
.sb-iconbtn:focus-visible, .nav-item:focus-visible, .sb-foot a:focus-visible, .sb-theme:focus-visible {
    outline: 2px solid rgba(255, 255, 255, .7); outline-offset: 1px;
}
.sb-close { display: none; }

.nav { display: flex; flex-direction: column; }
.nav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.nav-group-label {
    font-size: 11px; font-weight: 600; letter-spacing: .08em;
    color: var(--sb-muted); padding: 6px 10px 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nav-item {
    position: relative;
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; min-height: 40px;
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500;
    color: var(--sb-text);
    white-space: nowrap;
    transition: background .12s ease-out, color .12s ease-out;
}
.nav-item:hover { background: var(--sb-hover); color: #fff; text-decoration: none; }
.nav-item.is-active { background: var(--sb-active); color: #fff; font-weight: 600; }
.nav-item svg { width: 18px; height: 18px; stroke-width: 1.8; }
.nav-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
    font-size: 11px; font-weight: 600; line-height: 1.4;
    padding: 2px 7px; border-radius: var(--radius-pill);
    background: var(--navy-600); color: #fff;
}
[data-theme="dark"] .nav-badge { background: #2C6491; }
.nav-badge.is-warn { background: #FEDF89; color: #7A2E0E; }

.sb-spacer { flex: 1 1 auto; }

.sb-foot {
    border-top: 1px solid var(--sb-line);
    padding: 12px 6px 0 10px;
    display: flex; align-items: center; gap: 10px;
}
.sb-foot a {
    flex: 1 1 auto; display: flex; align-items: center; gap: 10px;
    color: var(--sb-text); font-size: 14px; font-weight: 500; min-height: 40px;
    border-radius: var(--radius-sm); white-space: nowrap;
}
.sb-foot a:hover { color: #fff; text-decoration: none; }
.sb-foot a svg { width: 18px; height: 18px; stroke-width: 1.8; }
.sb-theme {
    width: 36px; height: 36px; flex: 0 0 36px;
    border-radius: var(--radius-sm); border: 0;
    background: rgba(185, 199, 214, .1); color: var(--sb-text);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.sb-theme:hover { background: rgba(185, 199, 214, .18); color: #fff; }
.sb-theme svg { width: 16px; height: 16px; }
.sb-theme .i-sun { display: none; }
[data-theme="dark"] .sb-theme .i-sun { display: block; }
[data-theme="dark"] .sb-theme .i-moon { display: none; }

.sb-version { font-size: 11px; color: var(--sb-muted); padding: 8px 10px 0; white-space: nowrap; }

/* Daraltılmış menü (yalnız masaüstü) */
@media (min-width: 960px) {
    [data-nav="collapsed"] .sidebar { flex-basis: var(--sidebar-w-collapsed); width: var(--sidebar-w-collapsed); padding-left: 12px; padding-right: 12px; }
    [data-nav="collapsed"] .sb-head { flex-direction: column; padding: 4px 0 14px; gap: 10px; }
    [data-nav="collapsed"] .sb-brand { display: none; }
    [data-nav="collapsed"] .sb-logo-mini { display: block; color: #fff; }
    [data-nav="collapsed"] .sb-collapse svg { transform: rotate(180deg); }
    [data-nav="collapsed"] .nav-group-label { height: 1px; padding: 0; margin: 4px 8px 6px; background: var(--sb-line); color: transparent; }
    [data-nav="collapsed"] .nav-item { justify-content: center; padding: 9px 0; }
    [data-nav="collapsed"] .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    [data-nav="collapsed"] .nav-badge {
        position: absolute; top: 6px; right: 8px;
        min-width: 8px; height: 8px; padding: 0; font-size: 0; line-height: 0;
        box-shadow: 0 0 0 2px #0A2540;
    }
    [data-nav="collapsed"] .sb-foot { flex-direction: column; padding: 12px 0 0; }
    [data-nav="collapsed"] .sb-foot a { justify-content: center; flex: 0 0 auto; width: 40px; }
    [data-nav="collapsed"] .sb-foot-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    [data-nav="collapsed"] .sb-version { display: none; }
}

/* --- Mobil üst şerit (yalnız <960px) -------------------------------------- */
.mbar {
    display: none;
    align-items: center; gap: 10px;
    padding: 10px 14px;
    background: var(--mbar-bg); color: #fff;
    position: sticky; top: 0; z-index: var(--z-header);
}
.mbar-btn {
    width: 44px; height: 44px; flex: 0 0 44px;
    border-radius: var(--radius); border: 0;
    background: rgba(255, 255, 255, .08); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    position: relative;
}
.mbar-btn svg { width: 20px; height: 20px; }
a.mbar-btn { background: transparent; color: #fff; }
.mbar-btn:focus-visible { outline: 2px solid rgba(255, 255, 255, .8); outline-offset: 1px; }
.mbar-logo { flex: 1 1 auto; color: #fff; font-size: 19px; font-weight: 700; letter-spacing: .06em; }
.mbar-logo:hover { color: #fff; text-decoration: none; }
.dot-alert {
    position: absolute; top: 8px; right: 9px;
    width: 7px; height: 7px; border-radius: 50%;
    background: #D92D20;
}
.mbar-btn .dot-alert { top: 10px; right: 11px; background: #F04438; }

.sb-backdrop {
    position: fixed; inset: 0; z-index: calc(var(--z-sidebar) - 1);
    background: var(--overlay);
    border: 0; padding: 0; margin: 0; cursor: pointer;
}
.sb-backdrop[hidden] { display: none; }

/* --- Üst çubuk -------------------------------------------------------------- */
.topbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    padding: 14px 28px;
    min-height: var(--header-h);
}
.topsearch {
    flex: 1 1 260px; max-width: 420px;
    display: flex; align-items: center; gap: 8px;
    height: 42px; padding: 0 4px 0 16px; margin: 0;
    border-radius: var(--radius-pill);
    background: var(--surface); border: 1px solid var(--border-2);
    color: var(--faint);
    box-shadow: var(--shadow-sm);
    transition: border-color .12s ease, box-shadow .12s ease;
}
.topsearch:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); }
.topsearch input {
    flex: 1 1 auto; min-width: 0;
    border: 0; background: transparent; outline: none;
    font: inherit; color: var(--text);
}
.topsearch input::placeholder { color: var(--faint); }
.topsearch input::-webkit-search-cancel-button { cursor: pointer; }
.topsearch kbd {
    font-family: var(--font); font-size: 11px; font-weight: 600;
    color: var(--text-2); background: var(--surface-2);
    border: 1px solid var(--border-2); border-radius: var(--radius-xs);
    padding: 2px 6px; white-space: nowrap;
}
.topsearch button {
    width: 34px; height: 34px; flex: 0 0 34px;
    border: 0; border-radius: 50%; background: transparent; color: var(--faint);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.topsearch button:hover { background: var(--surface-3); color: var(--text); }
.topbar-spacer { flex: 1 1 auto; }

.iconbar {
    display: flex; align-items: center; gap: 2px;
    padding: 4px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--border-2);
}
.iconbar-btn {
    position: relative;
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); border: 0; background: transparent;
    color: var(--text-3); cursor: pointer; list-style: none;
}
.iconbar-btn::-webkit-details-marker { display: none; }
.iconbar-btn:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.iconbar-btn svg { width: 18px; height: 18px; stroke-width: 1.8; }

.topuser > summary {
    display: flex; align-items: center; gap: 10px;
    list-style: none; cursor: pointer;
    color: var(--text); border-radius: var(--radius-pill);
    padding: 2px;
}
.topuser > summary::-webkit-details-marker { display: none; }
.topuser-text { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.topuser-text strong { font-size: 14px; font-weight: 600; }
.topuser-role { font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: .04em; text-transform: uppercase; }
.avatar {
    width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%;
    background: var(--navy-900); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
    border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-2);
}
[data-theme="dark"] .avatar { background: #2C6491; }
.avatar-lg { width: 56px; height: 56px; flex-basis: 56px; border-radius: 14px; font-size: 19px; border: 0; box-shadow: none; }

/* --- Açılır menü (details[data-menu]) — üst çubuk + satır menüsü ------------ */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop {
    position: absolute; right: 0; top: calc(100% + 6px);
    z-index: var(--z-menu);
    min-width: 220px; max-width: min(320px, calc(100vw - 24px));
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border-2); border-radius: 12px;
    box-shadow: var(--shadow-menu);
    padding: 6px;
    display: flex; flex-direction: column;
    text-align: left;
}
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--divider); margin-bottom: 6px; }
.menu-head strong { display: block; font-size: 14px; }
.menu-head span { font-size: 12px; color: var(--muted); }
.menu-item, .menu-pop form > button {
    display: flex; align-items: center; gap: 10px;
    width: 100%; min-height: 40px; padding: 0 10px;
    border: 0; border-radius: var(--radius-sm); background: transparent;
    font: inherit; font-size: 14px; font-weight: 500; color: var(--text);
    text-align: left; cursor: pointer; white-space: nowrap;
}
.menu-item:hover, .menu-pop form > button:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.menu-item svg, .menu-pop form > button svg { width: 16px; height: 16px; color: var(--text-3); stroke-width: 1.9; }
.menu-item.is-danger, .menu-pop form > button.is-danger { color: var(--danger); }
.menu-item.is-danger svg, .menu-pop form > button.is-danger svg { color: var(--danger); }
.menu-item:hover.is-danger, .menu-pop form > button.is-danger:hover { background: var(--danger-bg); }
.menu-pop form { margin: 0; }
.menu-sep { height: 1px; background: var(--divider); margin: 6px 4px; }
.menu-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--muted); padding: 6px 10px 4px; text-transform: uppercase; }

/* --- İçerik ----------------------------------------------------------------- */
.content {
    flex: 1 1 auto;
    width: 100%; max-width: var(--content-max);
    padding: 8px 28px 32px;
}
.page-foot {
    padding: 14px 28px 20px; color: var(--muted); font-size: 12px;
    max-width: var(--content-max);
}

/* --- Sayfa başlığı ----------------------------------------------------------- */
.page-head {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 12px 16px; margin-bottom: 18px;
}
.page-head-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 320px; }
.page-head-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 700; color: var(--heading); line-height: 1.25; }
.page-head .sub, .page-sub { color: var(--muted); font-size: 13px; line-height: 1.45; }
.page-head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex: 0 1 auto; min-width: 0; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.page-head-actions form { margin: 0; }

.crumbs, .breadcrumb {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    font-size: 13px; color: var(--muted);
}
.crumbs a, .breadcrumb a { color: var(--link); }
.crumbs [aria-current="page"], .crumbs .is-current { color: var(--text); font-weight: 600; }
.crumbs .sep, .breadcrumb span[aria-hidden] { color: var(--placeholder); }

.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font-weight: 600; }
.back-link svg { width: 16px; height: 16px; }

/* Bilgi hapı (başlık yanında) */
.info-pill {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 26px; padding: 2px 10px;
    border-radius: var(--radius-pill);
    background: var(--accent-soft); color: var(--accent-soft-fg);
    font-size: 12px; font-weight: 600; line-height: 1.35;
}
.info-pill svg { width: 13px; height: 13px; stroke-width: 2; }
.info-pill.is-outline { background: var(--surface); border: 1px solid var(--border-2); color: var(--text-2); }

/* ==========================================================================
   6. Yeni bileşenler
   ========================================================================== */

/* --- Izgara yardımcıları ------------------------------------------------------ */
.grid-auto-170, .grid-auto-200, .grid-auto-240, .grid-auto-320, .grid-auto-440, .grid-auto-460 {
    display: grid; gap: 16px;
}
.grid-auto-170 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.grid-auto-200 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.grid-auto-240 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.grid-auto-320 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-auto-440 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.grid-auto-460 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }
[class*="grid-auto-"] > * { min-width: 0; }
.align-start { align-items: start; }
.gap-18 { gap: 18px; }

/* Dikey yığın: sayfa gövdesinin önerilen kapsayıcısı (bölümler arası 18px) */
.stack  { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.stack-xs { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }

/* --- Kart ------------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    min-width: 0;
}
.card + .card { margin-top: 18px; }
.grid + .card, .card + .grid, .grid + .grid,
.disclose + .card, .card + .disclose, .disclose + .grid, .grid + .disclose,
.disclose + .disclose { margin-top: 18px; }
/* Yığın/ızgara içinde aralığı `gap` verir; eski kenar boşlukları sıfırlanır. */
.stack > .card, .stack > .grid, .stack > .disclose, .stack > .alert,
[class*="grid-auto-"] > .card, .grid > .card, .stack-sm > .card { margin-top: 0; margin-bottom: 0; }

.card-head {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--divider);
}
.card-head.no-border { border-bottom: 0; }
.card-titles { flex: 1 1 200px; min-width: 0; }
.card-head h2 { font-size: 16px; font-weight: 600; margin: 0; color: var(--text); }
.card-head h3 { font-size: 14px; font-weight: 600; margin: 0; }
.card-head .sub { font-size: 12px; color: var(--muted); margin-top: 1px; line-height: 1.45; }
.card-head-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card-head-actions form { margin: 0; }
.card-head-actions .select { width: auto; min-width: 180px; min-height: 34px; height: 34px; padding: 0 32px 0 10px; font-size: 13px; }
.card-head-actions .filter-label { font-size: 12.5px; color: var(--muted); }
.card-head-actions .filter-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.card-link { font-size: 13px; font-weight: 600; white-space: nowrap; }

/* 34px simge çipi */
.chip-icon-box, .card-chip {
    flex: 0 0 34px; width: 34px; height: 34px;
    border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent-soft-fg);
}
.card-chip svg, .chip-icon-box svg { width: 18px; height: 18px; stroke-width: 1.8; }
.tone-ok   { background: var(--success-bg); color: var(--success); }
.tone-warn { background: var(--warning-bg); color: var(--warning); }
.tone-bad  { background: var(--danger-bg);  color: var(--danger); }
.tone-info { background: var(--info-bg);    color: var(--info); }
.tone-mute { background: var(--mute-bg);    color: var(--mute-fg); }
.tone-navy { background: var(--accent-soft); color: var(--accent-soft-fg); }

.card-body { padding: 16px 18px; }
.card-body.tight, .card-body.flush { padding: 0; }
.card-body.pad-x { padding: 0 18px; }
.card-foot {
    padding: 12px 18px; border-top: 1px solid var(--divider);
    background: var(--surface-2);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px;
}
.card-foot.is-start { justify-content: flex-start; }
.card-h3 { margin: 20px 0 10px; font-size: 14px; font-weight: 600; }
.card-h3:first-child { margin-top: 0; }
.card-body > * + .disclose { margin-top: 18px; }
.card-body > .alert:last-child, .disclose-body > .alert:last-child { margin-bottom: 0; }

.card-danger { border-color: var(--danger-bd); }
.card-danger > .card-head h2 { color: var(--text); }
.card-tinted { background: var(--surface-sunken); }

/* Bölüm listesi satırı (kart içinde simge + metin + eylem) */
.list-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 18px; border-bottom: 1px solid var(--divider-2);
    color: var(--text);
}
a.list-row:hover { background: var(--surface-hover); text-decoration: none; color: var(--text); }
.list-row:last-child { border-bottom: 0; }
.list-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list-row-title { font-weight: 600; }
.list-row-sub { font-size: 13px; color: var(--muted); }
.list-row-cta { font-size: 13px; font-weight: 600; color: var(--link); white-space: nowrap; }
.dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: var(--mute-accent); }
/* Çevrimiçi hapı (online_pill) — yeşil nokta + metin; renk tek başına anlam taşımaz */
.online-pill { gap: 6px; }
.online-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--success-accent, currentColor); box-shadow: 0 0 0 2px var(--success-bg); }
.dot.is-ok { background: var(--success-accent); }
.dot.is-warn { background: var(--warning-accent); }
.dot.is-bad { background: var(--danger-accent); }
.dot.is-info { background: var(--info-accent); }

/* Tehlikeli işlem satırı */
.danger-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
    padding: 14px 0; border-top: 1px solid var(--divider-2);
}
.danger-row:first-child { border-top: 0; }
.danger-row-text { flex: 1 1 260px; min-width: 0; }

/* --- KPI kartı (eğilim çizgili) ---------------------------------------------- */
.kpi {
    display: flex; flex-direction: column; gap: 4px;
    padding: 16px 18px 0;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden; min-width: 0;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.kpi.no-spark { padding-bottom: 16px; }
a.kpi:hover { color: var(--text); text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.kpi-top, .state-top {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.kpi-label, .state-label, .ov-label, .eyebrow {
    font-size: 12px; font-weight: 600; letter-spacing: .05em;
    color: var(--muted); text-transform: uppercase;
}
.kpi-top svg, .state-top svg { width: 18px; height: 18px; color: var(--faint); stroke-width: 1.7; }
.kpi-value-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.kpi-value {
    font-size: 28px; font-weight: 700; line-height: 1.15; color: var(--heading);
    font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.kpi-delta { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.kpi-delta.is-up { color: var(--success); }
.kpi-delta.is-down { color: var(--danger); }
.kpi-delta.is-warn { color: var(--warning); }
.kpi-line { font-size: 13px; color: var(--muted); line-height: 1.45; }
.kpi-spark {
    display: block; width: calc(100% + 36px); height: 44px;
    margin: 6px -18px 0;
}

/* --- Durum kartı (sol kenarı renkli) ------------------------------------------ */
.state {
    display: flex; flex-direction: column; gap: 6px;
    padding: 16px 18px;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-left: 4px solid var(--info-accent);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
    min-width: 0;
    transition: box-shadow .15s ease;
}
a.state:hover { color: var(--text); text-decoration: none; box-shadow: var(--shadow-md); }
.state-value { font-size: 26px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--info); overflow-wrap: anywhere; }
.state-line { font-size: 13px; color: var(--muted); }
.state.is-info    { border-left-color: var(--info-accent); }
.state.is-info .state-value { color: var(--info); }
.state.is-warning { border-left-color: var(--warning-accent); }
.state.is-warning .state-value { color: var(--warning); }
.state.is-danger  { border-left-color: var(--danger-accent); }
.state.is-danger .state-value { color: var(--danger); }
.state.is-success { border-left-color: var(--success-accent); }
.state.is-success .state-value { color: var(--success); }
.state.is-neutral { border-left-color: var(--mute-accent); }
.state.is-neutral .state-value { color: var(--heading); }

/* --- Özet şeridi (overview strip) ------------------------------------------------ */
.ov-body {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    padding: 16px 18px;
}
.ov-seg {
    display: flex; flex-direction: column; gap: 4px;
    padding: 2px 0 2px 14px;
    border-left: 3px solid var(--seg-color, var(--mute-accent));
    color: var(--text); min-width: 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
a.ov-seg:hover { text-decoration: none; color: var(--text); background: var(--surface-hover); }
.ov-seg.is-active { background: var(--accent-softer); box-shadow: inset 0 0 0 1px var(--border-2); }
.ov-value { font-size: 28px; font-weight: 700; line-height: 1.15; color: var(--heading); font-variant-numeric: tabular-nums; }
.ov-value.is-ok { color: var(--success); }
.ov-value.is-warn { color: var(--warning); }
.ov-value.is-bad { color: var(--danger); }
.ov-value.is-info { color: var(--info); }
.ov-line { font-size: 12px; color: var(--muted); }
/* Alt satır üstteki bölümlerle AYNI ızgara tanımında (sütun ölçüsü, aralık, iç boşluk):
   öğe sayısı bölüm sayısına eşitse sütunlar her genişlikte birebir hizalanır; öğe metni
   bölüm metniyle aynı yerden başlar (bölüm: 3px çizgi + 14px iç boşluk). */
.ov-foot {
    display: grid; gap: 4px 16px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    padding: 8px 18px 10px; border-top: 1px solid var(--divider);
}
/* Geniş ekranda 4 bölüm her zaman 4 sütundur: alt satır öğe sayısı farklı olsa da
   (3 ya da 5) aynı 4 sütuna oturur, fazlası alt satıra geçer. */
@media (min-width: 1200px) {
    .ov-body:has(> :nth-child(4):last-child) + .ov-foot { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.ov-foot-item {
    display: flex; align-items: center; justify-content: flex-start; gap: 8px;
    min-width: 0; min-height: 36px; padding: 0 4px 0 17px;
    font-size: 13px; color: var(--text-2);
    border-radius: var(--radius-sm);
}
.ov-foot-item svg { flex: 0 0 auto; }
/* Etiket + değer tek metin: değer etiketin hemen yanında kalır (uzun etikette birlikte sarar). */
.ov-foot-text { min-width: 0; overflow-wrap: anywhere; }
a.ov-foot-item:hover { color: var(--text); background: var(--surface-hover); text-decoration: none; }
.ov-foot-item.is-active { background: var(--accent-softer); }
.ov-foot-item svg { width: 15px; height: 15px; stroke-width: 1.9; color: var(--faint); }
.ov-foot-item.is-ok svg { color: var(--success); }
.ov-foot-item.is-warn svg { color: var(--warning); }
.ov-foot-item.is-bad svg { color: var(--danger); }
.ov-foot-item.is-info svg { color: var(--info); }
.ov-foot-item strong { color: var(--text); font-weight: 600; }

/* Renk anahtarları (segment şeridi, gösterge karesi) */
.c-navy    { --seg-color: var(--c-navy);    --sw: var(--c-navy); }
.c-blue    { --seg-color: var(--c-blue);    --sw: var(--c-blue); }
.c-teal    { --seg-color: var(--c-teal);    --sw: var(--c-teal); }
.c-slate   { --seg-color: var(--c-slate);   --sw: var(--c-slate); }
.c-gray    { --seg-color: var(--mute-accent); --sw: var(--c-gray); }
.c-violet  { --seg-color: var(--c-violet);  --sw: var(--c-violet); }
.c-info    { --seg-color: var(--c-info);    --sw: var(--c-info); }
.c-warn    { --seg-color: var(--c-warn);    --sw: var(--c-warn); }
.c-orange  { --seg-color: var(--c-orange);  --sw: var(--c-orange); }
.c-danger  { --seg-color: var(--c-danger);  --sw: var(--c-danger); }
.c-red     { --seg-color: var(--c-red);     --sw: var(--c-red); }
.c-success { --seg-color: var(--c-success); --sw: var(--c-success); }
.swatch { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 3px; background: var(--sw, var(--c-gray)); display: inline-block; }
.swatch-line { width: 14px; height: 3px; border-radius: 2px; background: var(--sw, var(--c-gray)); display: inline-block; }
.swatch-dash { width: 14px; height: 0; border-top: 2px dashed var(--sw, var(--c-gray)); display: inline-block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }

/* İstatistik çipi (grafik üstü) */
.stat-chip {
    display: flex; flex-direction: column; gap: 2px;
    padding: 8px 12px; border: 1px solid var(--border-2); border-radius: var(--radius);
    min-width: 104px;
}
.stat-chip-top { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.stat-chip-top em { margin-left: auto; font-style: normal; color: var(--faint); }
.stat-chip-value { font-size: 16px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-chip-value small { font-size: 11px; font-weight: 500; color: var(--muted); }
.big-number { font-size: 30px; font-weight: 700; color: var(--heading); line-height: 1.2; font-variant-numeric: tabular-nums; }

/* --- Segment (2–4 seçenek) -------------------------------------------------- */
.seg {
    display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px;
    border-radius: 9px; background: var(--surface-3);
    border: 0; margin: 0; min-width: 0;
}
.seg-item {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 30px; padding: 0 12px;
    border: 0; border-radius: 7px; background: transparent;
    font: inherit; font-size: 13px; font-weight: 600; color: var(--text-3);
    cursor: pointer; white-space: nowrap;
}
.seg-item:hover { color: var(--text); text-decoration: none; }
.seg-item svg { width: 13px; height: 13px; stroke-width: 2.4; }
.seg-item.is-on, .seg-item[aria-current="true"], .seg-item[aria-pressed="true"], .seg-item:has(> input:checked) {
    background: var(--surface); color: var(--heading);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .1);
}
[data-theme="dark"] .seg-item.is-on, [data-theme="dark"] .seg-item[aria-current="true"], [data-theme="dark"] .seg-item:has(> input:checked) { background: var(--surface-hover); }
.seg-item > input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-item:has(> input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }
.seg-lg .seg-item { height: 34px; border-radius: var(--radius-sm); }
.seg-lg { border-radius: var(--radius); }
.seg-item.is-danger.is-on, .seg-item.is-danger:has(> input:checked) { color: var(--danger); }

/* --- Filtre çipleri ----------------------------------------------------------- */
.fchips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fchips-label { font-size: 12px; font-weight: 600; letter-spacing: .05em; color: var(--muted); min-width: 64px; text-transform: uppercase; }
.fchips-select { display: none; }
.fchip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 36px; padding: 0 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-strong); background: var(--surface);
    font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2);
    white-space: nowrap; cursor: pointer;
}
.fchip:hover { border-color: var(--text-3); color: var(--text); text-decoration: none; }
.fchip-count {
    font-size: 12px; padding: 0 7px; border-radius: var(--radius-pill);
    background: var(--surface-3); color: var(--text-2); font-variant-numeric: tabular-nums;
}
.fchip.is-on, .fchip[aria-current="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.fchip.is-on .fchip-count, .fchip[aria-current="true"] .fchip-count { background: rgba(255, 255, 255, .16); color: #fff; }

/* --- Araç çubuğu (arama + filtreler) ------------------------------------------- */
.tools {
    display: flex; flex-direction: column; gap: 12px;
    padding: 14px 18px;
}
.tools-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tools-row form { margin: 0; }
.searchbox {
    flex: 1 1 320px; min-width: 0;
    display: flex; align-items: center; gap: 8px;
    height: 42px; padding: 0 6px 0 12px;
    border: 1px solid var(--border-strong); border-radius: var(--radius);
    background: var(--surface-input); color: var(--faint);
    transition: border-color .12s ease, box-shadow .12s ease;
}
.searchbox:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); }
.searchbox input { flex: 1 1 auto; min-width: 0; border: 0; outline: none; font: inherit; color: var(--text); background: transparent; }
.searchbox input::placeholder { color: var(--placeholder); }
/* Kutu içi "Ara" düğmesi (search_box(..., ['submit' => true])) — sağ uçta, rozetten sonra */
.searchbox.has-submit { padding-right: 4px; }
.searchbox-submit {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border: 0; border-radius: var(--radius-sm);
    background: var(--accent-soft); color: var(--accent-soft-fg); cursor: pointer;
    transition: background-color .12s ease, color .12s ease;
}
.searchbox-submit:hover { background: var(--primary); color: var(--on-primary); }
.searchbox-submit:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.searchbox-submit svg { width: 17px; height: 17px; }
.searchbox-count {
    flex: 0 0 auto; font-size: 12px; font-weight: 600;
    color: var(--accent-soft-fg); background: var(--accent-soft);
    padding: 4px 9px; border-radius: 7px; white-space: nowrap;
}
.tools-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.tools-label .select { width: auto; height: 42px; min-height: 42px; }
.tools-help { font-size: 12px; color: var(--muted); }

/* --- Tablo (yeni) ------------------------------------------------------------ */
/* position: relative — içindeki mutlak konumlu öğeler (visually-hidden, menü)
   kaydırma alanına bağlansın; yoksa sayfayı yatayda taşırırlar. */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead tr { background: var(--surface-2); }
.tbl th {
    text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .05em;
    text-transform: uppercase; color: var(--muted);
    padding: 10px 12px; white-space: nowrap;
}
.tbl td { padding: 12px; border-top: 1px solid var(--divider-2); vertical-align: middle; color: var(--text-2); }
.tbl th:first-child, .tbl td:first-child { padding-left: 18px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 18px; }
.tbl tbody tr:hover { background: var(--surface-hover); }
.tbl tbody tr.is-selected { background: var(--accent-softer); }
.tbl.v-top td { vertical-align: top; }
.tbl.compact td { padding-top: 10px; padding-bottom: 10px; }
.tbl .num, .tbl .text-right { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .nowrap { white-space: nowrap; }
.tbl .mono, .mono-sm { font-family: var(--mono); font-size: 12px; }
.tbl .col-check { width: 28px; padding-right: 8px; }
.tbl .col-check input, .tbl-check { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; vertical-align: middle; }
.tbl .col-menu { width: 56px; text-align: right; }
.tbl-sort {
    display: inline-flex; align-items: center; gap: 4px;
    height: 30px; padding: 0 6px; margin: -6px 0 -6px -6px;
    border: 0; border-radius: var(--radius-xs); background: transparent;
    font: inherit; font-weight: 600; letter-spacing: .05em; color: var(--muted);
    text-transform: uppercase; cursor: pointer;
}
a.tbl-sort:hover { text-decoration: none; color: var(--text); }
.tbl-sort.is-on { background: var(--accent-soft); color: var(--heading); font-weight: 700; }
.cell-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; color: var(--text); }
a.cell-main:hover { text-decoration: none; }
a.cell-main:hover .cell-title { text-decoration: underline; }
.cell-title { font-weight: 700; color: var(--heading); font-size: 14px; }
.cell-sub { color: var(--text-2); }
.cell-meta { font-size: 12px; color: var(--muted); }
.cell-mono { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.tbl-foot-note { padding: 10px 18px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--divider); }

/* Mini çubuk (cihaz kullanımı vb.) */
.minibar { width: 64px; height: 5px; border-radius: 3px; background: var(--c-track); overflow: hidden; margin-top: 6px; }
.minibar > span { display: block; height: 100%; background: var(--c-teal); }
.minibar.is-full > span { background: var(--c-warn); }

/* --- Hap / rozet ---------------------------------------------------------------- */
.pill {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; font-weight: 600; line-height: 1.35;
    padding: 3px 9px; border-radius: var(--radius-pill);
    white-space: nowrap;
    background: var(--mute-bg); color: var(--mute-fg);
}
.pill svg { width: 12px; height: 12px; stroke-width: 2.6; }
.pill.has-icon { padding-left: 7px; }
.pill-sm { font-size: 11px; padding: 1px 7px; }
.pill-sm svg { width: 11px; height: 11px; }
.pill-ok, .pill-success { background: var(--success-bg); color: var(--success); }
.pill-warn, .pill-warning { background: var(--warning-bg); color: var(--warning); }
.pill-bad, .pill-danger { background: var(--danger-bg); color: var(--danger); }
.pill-info { background: var(--info-bg); color: var(--info); }
.pill-mute, .pill-muted { background: var(--mute-bg); color: var(--mute-fg); }
.pill-navy { background: var(--accent-soft); color: var(--accent-soft-fg); }
.pill-solid { background: var(--navy-900); color: #fff; }
[data-theme="dark"] .pill-solid { background: #2C6491; }
.pill-outline { background: var(--surface); border: 1px solid var(--border-2); color: var(--text-2); }

.tag-new {
    display: inline-block;
    font-size: 10px; font-weight: 700; letter-spacing: .04em; line-height: 1.4;
    color: var(--info); background: var(--info-bg);
    padding: 2px 6px; border-radius: 5px; vertical-align: 1px;
}
.mod-tag {
    font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: var(--radius-xs);
    background: var(--accent-soft); color: var(--accent-soft-fg); white-space: nowrap;
}
.req { color: var(--danger); margin-left: 2px; }

/* --- Satır menüsü (⋮) ---------------------------------------------------------- */
.rowmenu { display: inline-block; position: relative; }
.rowmenu > summary {
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-2); border-radius: 9px;
    background: var(--surface); color: var(--text-2);
    cursor: pointer; list-style: none;
}
.rowmenu > summary:hover { background: var(--surface-hover); color: var(--text); }
.rowmenu > summary svg { width: 16px; height: 16px; }
.rowmenu[open] > summary { background: var(--surface-3); }
.rowmenu .menu-pop { width: 230px; }
.rowmenu.is-fixed .menu-pop { position: fixed; right: auto; top: auto; }

/* --- Sayfalama altlığı ----------------------------------------------------------- */
.pager {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 12px; padding: 12px 18px;
    border-top: 1px solid var(--divider);
    font-size: 13px; color: var(--muted);
}
.pager form { margin: 0; display: flex; align-items: center; gap: 8px; }
.pager select {
    appearance: none;
    background: var(--surface-input) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 7px center;
    height: 36px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    padding: 0 26px 0 10px; font: inherit; color: var(--text);
}
.pager-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.pager-nav a, .pager-nav span {
    min-width: 36px; height: 36px; padding: 0 8px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-2); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text);
    font-variant-numeric: tabular-nums;
}
.pager-nav a:hover { background: var(--surface-hover); text-decoration: none; color: var(--text); }
.pager-nav .is-current { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.pager-nav .is-disabled { opacity: .45; }
.pager-nav .is-gap { border-color: transparent; background: transparent; min-width: 24px; padding: 0; }

/* --- Sekmeler (bağlantı) ---------------------------------------------------------- */
.tabnav {
    display: flex; flex-wrap: wrap; gap: 2px 4px;
    border-bottom: 1px solid var(--border-2);
}
.tabnav a {
    display: inline-flex; align-items: center; gap: 6px;
    height: 46px; padding: 0 12px; margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    font-weight: 600; color: var(--text-3); white-space: nowrap;
}
.tabnav a:hover { color: var(--text); text-decoration: none; }
.tabnav a[aria-current="page"] { color: var(--heading); border-bottom-color: var(--heading); }
.tabnav-count {
    font-size: 12px; padding: 1px 7px; border-radius: var(--radius-pill);
    background: var(--divider); color: var(--text-2); font-variant-numeric: tabular-nums;
}
.tabnav a[aria-current="page"] .tabnav-count { background: var(--primary); color: var(--on-primary); }
.card > .tabnav { padding: 0 12px; }

/* --- Bölüm menüsü (Ayarlar) ---------------------------------------------------------- */
.split { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.split-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.secnav {
    flex: 0 0 240px; max-width: 240px;
    position: sticky; top: 16px;
    display: flex; flex-direction: column; gap: 4px; padding: 8px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.secnav a {
    display: flex; flex-direction: column; justify-content: center; gap: 2px;
    min-height: 40px; padding: 9px 12px; border-radius: var(--radius);
    font-size: 14px; font-weight: 600; color: var(--text-2);
}
.secnav a:hover { background: var(--surface-hover); text-decoration: none; color: var(--text); }
.secnav a[aria-current="true"], .secnav a[aria-current="page"] { background: var(--accent-softer); color: var(--heading); box-shadow: inset 3px 0 0 var(--heading); }
.secnav-title { display: flex; align-items: center; gap: 8px; }
.secnav-title svg { width: 16px; height: 16px; stroke-width: 1.8; }
.secnav-sub { font-size: 12px; font-weight: 400; color: var(--muted); padding-left: 24px; }

/* --- Seçenek kartları (radyo) ------------------------------------------------------ */
.choices { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); border: 0; padding: 0; margin: 0; min-width: 0; }
.choices.cols-wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.choice {
    position: relative;
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px; min-height: 44px;
    border: 1px solid var(--border-2); border-radius: 12px;
    background: var(--surface); color: var(--text);
    cursor: pointer;
    transition: border-color .12s ease, background-color .12s ease;
}
.choice:hover { border-color: var(--border-strong); }
.choice > input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.choice-chip {
    flex: 0 0 30px; width: 30px; height: 30px; border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent-soft-fg);
}
.choice-chip svg { width: 15px; height: 15px; stroke-width: 1.9; }
.choice-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.choice-title { font-weight: 600; color: var(--text); }
.choice-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }
.choice.is-on, .choice:has(> input:checked) {
    border-color: var(--heading); background: var(--accent-softer);
    box-shadow: inset 0 0 0 1px var(--heading);
}
.choice.is-on .choice-chip, .choice:has(> input:checked) .choice-chip { background: var(--primary); color: var(--on-primary); }
.choice:has(> input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice:has(> input:disabled) { opacity: .55; cursor: not-allowed; }
.choice-vertical { flex-direction: column; gap: 6px; }

/* Onay kutulu modül satırı */
.check-card {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px;
    padding: 12px; border: 1px solid var(--border-2); border-radius: 12px;
    background: var(--surface);
}
.check-card:has(input[type="checkbox"]:checked) { border-color: var(--success-bd); background: var(--success-bg); }
.check-card input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--success); margin: 0; }

/* --- Form satırı (etiket+yardım solda 260px, kontrol sağda) ------------------------- */
.form-rows { padding: 0 20px; }
.form-row {
    display: flex; flex-wrap: wrap; align-items: flex-start;
    gap: 8px 28px;
    padding: 16px 0;
    border-top: 1px solid var(--divider);
}
.form-rows > .form-row:first-child, .form-row.is-first { border-top: 0; }
.form-row-label { flex: 0 0 260px; max-width: 260px; min-width: 0; }
.form-row-label label, .form-row-label .label { font-weight: 600; font-size: 14px; color: var(--text); }
.form-row-help { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.form-row-control { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.form-row-control > .seg, .form-row-control > .switch, .form-row-control > .btn, .form-row-control > .input-narrow { align-self: flex-start; }
.form-row-control.is-inline { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.form-row-note { flex: 1 1 100%; font-size: 12px; color: var(--muted); line-height: 1.5; }
.form-row.is-compact .form-row-label { flex-basis: 200px; max-width: 200px; }
.form-row.has-error .input, .form-row.has-error .select, .form-row.has-error .textarea { border-color: var(--danger); }
.form-row.is-center { align-items: center; }

/* Adımlı çekmece başlığı */
.step-title { display: flex; align-items: center; gap: 8px; margin: 18px 0 4px; font-size: 14px; font-weight: 600; color: var(--heading); }
.step-num {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--primary); color: var(--on-primary);
    font-size: 12px; display: inline-flex; align-items: center; justify-content: center;
}

/* --- Anahtar (switch) ---------------------------------------------------------------- */
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; position: relative; }
.switch > input { position: absolute; opacity: 0; width: 44px; height: 24px; margin: 0; cursor: pointer; }
.switch-track {
    position: relative; flex: 0 0 44px; width: 44px; height: 24px; border-radius: 12px;
    background: #7C8799; transition: background-color .15s ease;
}
.switch-knob {
    position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .2);
    transition: left .15s ease;
}
.switch > input:checked + .switch-track { background: #067647; }
.switch > input:checked + .switch-track .switch-knob { left: 23px; }
.switch > input:focus-visible + .switch-track { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch > input:disabled + .switch-track { opacity: .5; }
.switch-text { font-weight: 600; color: var(--muted); }
.switch-text::after { content: attr(data-off); }
.switch > input:checked ~ .switch-text { color: var(--success); }
.switch > input:checked ~ .switch-text::after { content: attr(data-on); }
.switch-text:not([data-off]):not([data-on])::after { content: none; }

/* --- Çekmece (dialog) ------------------------------------------------------------------ */
dialog.drawer {
    padding: 0; border: 0; color: var(--text); background: var(--surface);
}
/* JS'li tarayıcıda: sağdan açılan modal panel */
.js-dialog dialog.drawer[data-inline] { display: none; }
.js-dialog dialog.drawer[open]:not([data-inline]) {
    position: fixed; inset: 0 0 0 auto;
    width: min(560px, 100vw); max-width: 100vw;
    height: 100vh; height: 100dvh; max-height: none;
    margin: 0;
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-drawer);
    animation: drawer-in .2s ease-out;
    z-index: var(--z-drawer);
}
.js-dialog dialog.drawer.is-wide[open]:not([data-inline]) { width: min(720px, 100vw); }
/* ::backdrop eski Chromium sürümlerinde :root değişkenlerini miras almaz — sabit renk */
dialog.drawer::backdrop { background: rgba(16, 24, 40, .45); }
[data-theme="dark"] dialog.drawer::backdrop { background: rgba(2, 6, 14, .62); }
@keyframes drawer-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
/* JS'siz / dialog desteksiz: sayfada normal bölüm olarak görünür */
dialog.drawer[data-inline] {
    position: static; display: block; width: auto; max-width: none; margin: 18px 0 0;
    border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.drawer-head {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 24px; border-bottom: 1px solid var(--divider);
}
.drawer-head h2 { font-size: 18px; font-weight: 700; color: var(--heading); margin: 0; }
.drawer-head .sub { font-size: 12px; color: var(--muted); }
.drawer-close {
    width: 40px; height: 40px; flex: 0 0 40px;
    border: 1px solid var(--border-2); border-radius: var(--radius); background: var(--surface);
    color: var(--text-3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.drawer-close:hover { background: var(--surface-hover); color: var(--text); }
dialog.drawer[data-inline] .drawer-close { display: none; }
.drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 4px 24px 20px; }
.drawer-body > .form-row:first-child { border-top: 0; }
.drawer-foot {
    display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px;
    padding: 14px 24px; border-top: 1px solid var(--divider); background: var(--surface-2);
}
.drawer-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; margin: 0; }
.drawer .form-row-label { flex-basis: 170px; max-width: 170px; }
.drawer .form-row-control { flex-basis: 240px; }
.drawer .form-row { padding: 12px 0; gap: 8px 18px; }
body.has-drawer { overflow: hidden; }

/* --- Boş durum --------------------------------------------------------------------- */
.empty-state {
    padding: 36px 18px;
    text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    color: var(--muted);
}
.empty-state svg { width: 40px; height: 40px; stroke-width: 1.5; color: var(--faint); opacity: .7; margin-bottom: 2px; }
.empty-state h3 { color: var(--text); font-size: 15px; font-weight: 600; margin: 0; }
.empty-state p { font-size: 13px; margin: 0 0 6px; max-width: 460px; }

/* --- Uyarı kutusu -------------------------------------------------------------------- */
.alert {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    background: var(--surface-2);
    font-size: 13.5px; color: var(--text-2);
    margin-bottom: 18px;
}
.alert > svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; stroke-width: 2; }
.alert strong { font-weight: 600; }
.alert > div > strong:first-child { display: block; margin-bottom: 2px; }
.alert-body { flex: 1 1 auto; min-width: 0; }
.alert-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }
.alert-success { background: var(--success-bg); border-color: var(--success-bd); color: var(--text); }
.alert-danger  { background: var(--danger-bg);  border-color: var(--danger-bd);  color: var(--text); }
.alert-warning { background: var(--warning-bg); border-color: var(--warning-bd); color: var(--text); }
.alert-info    { background: var(--info-bg);    border-color: var(--info-bd);    color: var(--text); }
.alert-success > svg { color: var(--success); }
.alert-danger  > svg { color: var(--danger); }
.alert-warning > svg { color: var(--warning); }
.alert-info    > svg { color: var(--info); }
.alert.is-flat { margin-bottom: 0; }
.alert.is-banner { border-radius: var(--radius-lg); padding: 14px 18px; align-items: center; flex-wrap: wrap; }
.note {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 10px 12px; border-radius: var(--radius);
    background: var(--surface-sunken); color: var(--text-2); font-size: 13px;
}
.note > svg { width: 16px; height: 16px; margin-top: 2px; color: var(--faint); }
.note.is-warn { background: var(--warning-bg); color: var(--text); }
.note.is-warn > svg { color: var(--warning); }

/* --- Anahtar/değer ızgarası ----------------------------------------------------------- */
.kvg {
    display: grid; gap: 0 16px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
}
.kvg-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--divider-2); min-width: 0; }
.kvg-k { font-size: 12px; color: var(--muted); }
.kvg-v { font-weight: 600; color: var(--text); word-break: break-word; }
.kvg-v.is-mono { font-family: var(--mono); font-size: 13px; font-weight: 500; word-break: break-all; }
.kvg-v.is-ok { color: var(--success); }
.kvg-v.is-warn { color: var(--warning); }
.kvg-v.is-bad { color: var(--danger); }
.kvg-sub { font-size: 12px; color: var(--muted); }

/* --- İlerleme çubuğu ------------------------------------------------------------------ */
.progress {
    height: 6px; border-radius: var(--radius-pill); background: var(--c-track); overflow: hidden;
}
.progress > span { display: block; height: 100%; background: var(--c-teal); border-radius: var(--radius-pill); }
.progress.is-navy > span { background: var(--c-blue); }
.progress.is-warn > span { background: var(--c-warn); }
.progress.is-bad > span { background: var(--c-danger); }
.progress.is-lg { height: 10px; }
.progress-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.progress-row .progress { flex: 1 1 auto; }
.progress-row b { font-variant-numeric: tabular-nums; }

/* --- Halka grafik (SVG) --------------------------------------------------------------- */
.donut-wrap { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.donut { position: relative; flex: 0 0 auto; }
.donut svg { display: block; transform: rotate(-90deg); width: 100%; height: 100%; }
.donut-center {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    pointer-events: none;
}
.donut-center strong { font-size: 22px; font-weight: 700; color: var(--heading); line-height: 1.1; font-variant-numeric: tabular-nums; }
.donut-center span { font-size: 11px; color: var(--muted); }
.donut-legend { flex: 1 1 200px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.donut-legend-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.donut-legend-row .lbl { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend-row .lbl.mono { font-family: var(--mono); }
.donut-legend-row strong { font-variant-numeric: tabular-nums; }
.donut-legend-row .pct { width: 40px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* --- Kopyala düğmesi ----------------------------------------------------------------- */
.copybtn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 28px; padding: 0 8px; max-width: 100%;
    border: 1px solid var(--border-2); border-radius: 7px; background: var(--surface-2);
    font-family: var(--mono); font-size: 12px; color: var(--text-2); cursor: pointer;
}
.copybtn:hover { border-color: var(--border-strong); color: var(--text); }
.copybtn svg { width: 12px; height: 12px; }
.copybtn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Grafik kutusu ---------------------------------------------------------------- */
.chart-box { position: relative; height: 260px; min-width: 0; }
.chart-box.tall { height: 320px; }
.chart-box.h-44 { height: 44px; }
.chart-box.h-160 { height: 160px; }
.chart-box.h-200 { height: 200px; }
.chart-box canvas { display: block; max-width: 100%; }
.chart-fallback { font-size: 12px; color: var(--muted); padding: 8px 0; }
.chart-title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.chart-title-row h3 { margin: 0; font-size: 14px; font-weight: 600; }
.chart-title-row span { font-size: 12px; color: var(--muted); }

/* --- Düğmeler -------------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 40px; padding: 0 14px;
    border-radius: var(--radius); border: 1px solid var(--border-strong);
    background: var(--surface); color: var(--text);
    font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2;
    cursor: pointer; white-space: nowrap; text-decoration: none;
    transition: background .12s ease-out, border-color .12s ease-out, box-shadow .12s ease-out, color .12s ease-out;
}
.btn:hover { background: var(--surface-hover); border-color: var(--text-3); color: var(--text); text-decoration: none; }
.btn:active { background: var(--surface-3); }
.btn svg { width: 16px; height: 16px; stroke-width: 2; }

.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn-primary:active { background: var(--primary-active); }

.btn-danger { background: var(--danger-solid); border-color: var(--danger-solid); color: #fff; }
.btn-danger:hover { background: var(--danger-solid-hover); border-color: var(--danger-solid-hover); color: #fff; }
.btn-danger-outline { background: var(--surface); border-color: var(--danger-bd); color: var(--danger); }
.btn-danger-outline:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.btn-warn-outline { background: var(--surface); border-color: var(--warning); color: var(--warning); }
.btn-warn-outline:hover { background: var(--warning-bg); color: var(--warning); border-color: var(--warning); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--link); }
.btn-ghost:hover { background: var(--accent-softer); border-color: transparent; color: var(--link-hover); }

.btn-lg { min-height: 42px; padding: 0 16px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 9px; gap: 6px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-xs { min-height: 30px; padding: 0 9px; font-size: 12px; border-radius: var(--radius-sm); gap: 5px; }
.btn-xs svg { width: 13px; height: 13px; }

.btn-icon { min-height: 40px; width: 40px; padding: 0; border-color: var(--border-2); color: var(--text-3); }
.btn-icon.btn-sm { min-height: 36px; width: 36px; }
.btn-block { width: 100%; }
.btn-link {
    background: none; border: 0; padding: 0; min-height: 0;
    color: var(--link); text-decoration: underline; cursor: pointer;
    font: inherit; font-size: inherit; text-underline-offset: 2px;
}
.btn-link:hover { color: var(--link-hover); }

.btn:disabled, .btn.is-loading, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn.is-loading::after {
    content: ""; width: 13px; height: 13px; border-radius: 50%;
    border: 2px solid currentColor; border-right-color: transparent;
    animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-group { display: inline-flex; gap: 0; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); margin-left: 0; }
.btn-group .btn:last-child  { border-radius: 0 var(--radius) var(--radius) 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-row form { margin: 0; }

/* ==========================================================================
   7. Eski sınıflar — yeni dille yeniden stillendi (sayfalar taşınana dek)
   ========================================================================== */

/* İstatistik kartları */
.stats {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    margin-bottom: 18px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    min-width: 0;
}
.stat-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.stat-icon {
    width: 34px; height: 34px; border-radius: 9px;
    display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent-soft-fg);
    flex: 0 0 auto;
}
.stat-icon svg { width: 18px; height: 18px; stroke-width: 1.8; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.stat-value {
    font-size: 28px; font-weight: 700; color: var(--heading); line-height: 1.15;
    font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.stat-value.is-text { font-size: 20px; font-weight: 600; }
.stat-meta { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
a.stat { display: block; text-decoration: none; color: inherit; transition: border-color .15s ease, box-shadow .15s ease; }
a.stat:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
a.stat.is-active { border-color: var(--navy-600); box-shadow: 0 0 0 1px var(--navy-600); }
.stat-success .stat-icon { background: var(--success-bg); color: var(--success); }
.stat-warning .stat-icon { background: var(--warning-bg); color: var(--warning); }
.stat-danger  .stat-icon { background: var(--danger-bg);  color: var(--danger); }
.stat-info    .stat-icon { background: var(--info-bg);    color: var(--info); }
.stat-meta .up   { color: var(--success); font-weight: 600; }
.stat-meta .down { color: var(--danger);  font-weight: 600; }

/* Izgara */
.grid { display: grid; gap: 18px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-60-40 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
@media (max-width: 1100px) { .grid-60-40 { grid-template-columns: 1fr; } }
.grid-top { align-items: start; }
.stack-sm .btn-block + .btn-block { margin-top: 0; }

/* Eski tablo */
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
    text-align: left; font-weight: 600; font-size: 11px;
    text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted);
    padding: 10px 14px;
    border-bottom: 1px solid var(--divider);
    background: var(--surface-2);
    white-space: nowrap;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--divider-2); vertical-align: middle; color: var(--text-2); }
table.data th:first-child, table.data td:first-child { padding-left: 18px; }
table.data th:last-child, table.data td:last-child { padding-right: 18px; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-hover); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .mono { font-family: var(--mono); font-size: 12px; }
table.data .nowrap { white-space: nowrap; }
table.data .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.card-body table.data th:first-child, .card-body table.data td:first-child { padding-left: 0; }
.card-body table.data th:last-child, .card-body table.data td:last-child { padding-right: 0; }
.card-body table.data th { background: transparent; }

/* Rozet (eski) — yeni hap diline yaklaştırıldı */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    font-size: 12px; font-weight: 600; line-height: 1.45;
    border: 0;
    background: var(--mute-bg);
    color: var(--mute-fg);
    white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-muted   { background: var(--mute-bg);    color: var(--mute-fg); }
.badge-lg { font-size: 12.5px; padding: 4px 11px; }

/* Kopyalanabilir kimlik etiketi (uid_chip) */
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 28px; padding: 0 8px; max-width: 100%;
    background: var(--surface-2); border: 1px solid var(--border-2);
    border-radius: 7px;
    font-size: 12px; color: var(--text-2); cursor: pointer;
    font-family: var(--mono);
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip-icon { width: 12px; height: 12px; flex: 0 0 auto; opacity: .7; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tag {
    display: inline-block; padding: 1px 7px; border-radius: var(--radius-xs);
    background: var(--accent-soft); color: var(--accent-soft-fg);
    font-family: var(--mono); font-size: 11.5px;
}

/* Formlar (eski alan düzeni) */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.hint { font-size: 12px; color: var(--muted); line-height: 1.5; }

.input, .select, .textarea {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: var(--surface-input);
    font: inherit; font-size: 14px; color: var(--text);
    transition: border-color .12s ease-out, box-shadow .12s ease-out;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--focus);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.input::placeholder, .textarea::placeholder { color: var(--placeholder); }
.input.mono, .input-mono { font-family: var(--mono); font-size: 13px; }
.input-narrow { width: 120px; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.textarea.mono, .textarea-code { font-family: var(--mono); font-size: 13px; }
.select { appearance: none; padding-right: 34px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
}
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.input[readonly] { background: var(--surface-2); }

.field.has-error .input, .field.has-error .select, .field.has-error .textarea, .input.is-invalid { border-color: var(--danger); }
.field.has-error .input:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, .14); }
.field-error { font-size: 12.5px; color: var(--danger); display: flex; align-items: flex-start; gap: 5px; }
.field-error:empty { display: none; }
.input-group { display: flex; gap: 8px; align-items: stretch; }
.input-group .input { flex: 1 1 auto; min-width: 0; }

.check {
    display: flex; align-items: flex-start; gap: 9px;
    font-size: 13.5px; color: var(--text-2); cursor: pointer;
    min-height: 32px;
}
.check input[type="checkbox"], .check input[type="radio"] {
    width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--primary);
    flex: 0 0 auto; cursor: pointer;
}
.check-box {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px; border-radius: var(--radius);
    background: var(--surface-sunken); font-size: 13px; cursor: pointer;
}
.check-box input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--primary); }

.form-actions { display: flex; gap: 10px; align-items: center; padding-top: 4px; flex-wrap: wrap; }
.form-actions .spacer { margin-left: auto; }
.form-inline { margin: 0; display: inline; }

/* Arama/filtre çubuğu (eski) */
.toolbar {
    display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
    padding: 14px 18px;
    border-bottom: 1px solid var(--divider);
    background: var(--surface);
    margin: 0;
}
.toolbar .field { min-width: 150px; }
.toolbar .field.grow { flex: 1 1 220px; }
.toolbar .btn { min-height: 40px; }

/* Sekmeler (eski) */
.tabs {
    display: flex; gap: 2px 4px; border-bottom: 1px solid var(--border-2);
    overflow-x: auto; scrollbar-width: thin;
}
.tab {
    padding: 0 12px; height: 46px; margin-bottom: -1px;
    font-size: 14px; font-weight: 600; color: var(--text-3);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-active { color: var(--heading); border-bottom-color: var(--heading); }
.tab .count {
    font-size: 12px; background: var(--divider); color: var(--text-2);
    padding: 1px 7px; border-radius: var(--radius-pill); font-variant-numeric: tabular-nums;
}
.tab.is-active .count { background: var(--primary); color: var(--on-primary); }
.tabs-inset { padding: 0 18px; }
.tabs-inset .tabs { margin-bottom: -1px; }

/* Sayfalama (eski pagination()) */
.pagination {
    display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
    padding: 12px 18px; border-top: 1px solid var(--divider);
}
.pagination .info { font-size: 13px; color: var(--muted); margin-right: auto; }
.pagination a, .pagination span.page {
    min-width: 36px; height: 36px; padding: 0 9px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-2); border-radius: var(--radius-sm);
    font-size: 13px; color: var(--text); background: var(--surface);
    font-variant-numeric: tabular-nums;
}
.pagination a:hover { background: var(--surface-hover); text-decoration: none; }
.pagination .is-current { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.pagination .is-disabled { opacity: .45; pointer-events: none; }

/* JSON görüntüleyici */
.json-view {
    font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
    background: #0A2540; color: #D6E2EC;
    padding: 15px 17px; border-radius: var(--radius);
    overflow: auto; max-height: 460px; margin: 0;
    white-space: pre; tab-size: 2;
}
[data-theme="dark"] .json-view { background: #07111F; border: 1px solid var(--border); }
.json-view .j-key  { color: #7FB2E5; }
.json-view .j-str  { color: #9FD8A0; }
.json-view .j-num  { color: #E8C07D; }
.json-view .j-bool { color: #D3A0E8; }
.json-view .j-null { color: #8B9AAB; }

.code-inline, code.inline {
    font-family: var(--mono); font-size: 12.5px;
    background: var(--surface-3); border: 1px solid var(--border-2);
    padding: 1px 6px; border-radius: var(--radius-xs); color: var(--text);
}

/* Katlanır bölüm */
.disclose { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.disclose > summary {
    list-style: none; cursor: pointer;
    display: flex; align-items: center; gap: 9px;
    padding: 11px 13px; min-height: 44px;
    font-size: 13.5px; font-weight: 600; color: var(--text-2);
    border-radius: var(--radius);
    transition: color .15s ease-out, background-color .15s ease-out;
}
.disclose > summary::-webkit-details-marker { display: none; }
.disclose > summary svg { width: 15px; height: 15px; flex: 0 0 auto; opacity: .8; }
.disclose > summary::before {
    content: ""; flex: 0 0 auto; width: 0; height: 0;
    border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent;
    opacity: .55; transition: transform .15s ease-out;
}
.disclose[open] > summary::before { transform: rotate(90deg); }
.disclose > summary:hover { color: var(--text); background: var(--surface-hover); }
.disclose[open] > summary { border-bottom: 1px solid var(--divider); border-radius: var(--radius) var(--radius) 0 0; background: transparent; }
.disclose-body { padding: 13px; }
.disclose-date { margin-left: auto; font-weight: 500; color: var(--muted); font-size: 12.5px; }

.changelog-row { display: flex; gap: 8px; align-items: flex-start; padding: 7px 0; font-size: 13.5px; }
.changelog-row + .changelog-row { border-top: 1px dashed var(--border); }
.changelog-row > .badge { flex: 0 0 auto; }
.changelog-plain { white-space: pre-line; font-size: 13.5px; }

/* Tanım listesi */
.dl { display: grid; grid-template-columns: auto 1fr; gap: 9px 18px; font-size: 13.5px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; word-break: break-word; }
.flow-list { margin: 0; padding-left: 20px; line-height: 1.9; }

/* Modal */
.modal-backdrop {
    position: fixed; inset: 0; z-index: var(--z-modal);
    background: var(--overlay);
    display: none; align-items: center; justify-content: center;
    padding: 20px;
}
.modal-backdrop.is-open { display: flex; }
.modal {
    background: var(--surface); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); color: var(--text);
    width: 100%; max-width: 520px; max-height: 90vh;
    display: flex; flex-direction: column;
    animation: modal-in .16s ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--divider); display: flex; align-items: center; gap: 12px; }
.modal-head h2 { font-size: 16px; }
.modal-body { padding: 20px; overflow-y: auto; font-size: 14px; color: var(--text-2); }
.modal-foot {
    padding: 14px 20px; border-top: 1px solid var(--divider);
    display: flex; gap: 10px; justify-content: flex-end;
    background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.modal-close {
    margin-left: auto; background: none; border: 0; cursor: pointer;
    color: var(--muted); padding: 6px; border-radius: var(--radius-sm);
    min-width: 36px; min-height: 36px;
}
.modal-close:hover { background: var(--surface-3); color: var(--text); }
.modal-sm { max-width: 440px; }
.modal-body p { margin: 0; }
.modal-body p + p { margin-top: 10px; }
.modal-lg { max-width: 1060px; }
.modal-lg .modal-body { padding: 0; overflow: hidden; }
.modal-frame { width: 100%; height: min(78vh, 900px); border: 0; display: block; background: var(--surface); }
.modal-foot-flush { padding: 0; border: 0; background: none; }
.frame-page { padding: 18px; background: var(--surface); min-height: 100vh; }
.frame-page .page-head { padding: 0 0 16px; }
.frame-ok {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 14px; margin-bottom: 16px;
    background: var(--success-bg); color: var(--success);
    border: 1px solid var(--success-bd); border-radius: var(--radius);
    font-size: 13.5px; font-weight: 600;
}

/* Bildirimler (toast) */
.toasts {
    position: fixed; right: 20px; bottom: 20px; z-index: var(--z-toast);
    display: flex; flex-direction: column; gap: 10px;
    max-width: min(380px, calc(100vw - 40px));
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    background: #0A2540; color: #fff;
    border-radius: var(--radius); padding: 12px 15px;
    box-shadow: var(--shadow-lg); font-size: 13.5px;
    display: flex; gap: 10px; align-items: flex-start;
    animation: toast-in .18s ease-out;
}
.toast svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }
.toast-success { background: #05603A; }
.toast-error   { background: #912018; }
.toast-warning { background: #93370D; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Yardımcılar */
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.xsmall { font-size: 12px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.flex { display: flex; } .flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-center { display: flex; align-items: center; gap: 8px; }
.min-form { display: flex; align-items: center; gap: 8px; }
.min-form .input { width: 118px; min-height: 34px; padding: 5px 9px; font-size: 13px; }
.min-form .btn { flex: 0 0 auto; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.text-right { text-align: right; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-heading { color: var(--heading); }
.hidden { display: none !important; }

.kv-grid { display: grid; gap: 14px 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.kv-grid > div { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.kv-k { font-size: 12px; color: var(--muted); }
.kv-v { font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; }
.divider { margin: 16px 0; border: 0; border-top: 1px solid var(--divider); }

.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.plain-list > li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--divider-2); }
.plain-list > li:last-child { border-bottom: 0; }
.plain-list > li > svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--navy-600); stroke-width: 1.9; }
.plain-list > li > div { flex: 1 1 auto; min-width: 0; }
.plain-list > li strong { font-size: 13.5px; font-weight: 600; display: block; }

/* Giriş ekranı */
.auth-page {
    min-height: 100vh; display: grid; place-items: center;
    background: linear-gradient(160deg, #0B2A4A 0%, #0A2540 55%, #071C33 100%);
    padding: 24px;
}
.auth-card {
    width: 100%; max-width: 400px;
    background: var(--surface); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); padding: 32px;
}
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.brand-mark {
    width: 38px; height: 38px; border-radius: 10px;
    background: #0A2540; display: grid; place-items: center;
    color: #fff; font-weight: 700; font-size: 18px; flex: 0 0 auto;
}
.auth-brand h1 { font-size: 19px; }
.brand-sub { font-size: 11px; display: block; font-weight: 400; letter-spacing: .04em; color: var(--muted); }
.auth-card .alert { margin-bottom: 16px; }
.auth-foot { margin-top: 22px; text-align: center; font-size: 12px; color: var(--muted); }

/* ==========================================================================
   8. Alan sayfaları (eski gösterge paneli, sürüm yükleme, duyuru seçici …)
   ========================================================================== */
.bucket-swatch { display: inline-block; flex: 0 0 auto; width: 10px; height: 10px; border-radius: 3px; }
.bucket-list { list-style: none; margin: 6px 0 2px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 14px; }
.bucket-list li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bucket-list-label { color: var(--text-2); }
.bucket-list b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.bucket-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.bucket-card {
    min-width: 0; padding: 12px 14px;
    border: 1px solid var(--border-2); border-radius: var(--radius);
    background: var(--surface);
    border-left: 3px solid var(--bucket-color, var(--border-strong));
}
.bucket-card.is-noise { background: var(--surface-2); }
.bucket-card-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bucket-card-label { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.bucket-card-share { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.bucket-card-value { margin: 6px 0 2px; font-size: 24px; font-weight: 700; line-height: 1.15; color: var(--heading); font-variant-numeric: tabular-nums; }
.bucket-card.is-noise .bucket-card-value { color: var(--text-2); }
.bucket-card-unit { margin: 0 0 7px; font-size: 11px; line-height: 1; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.bucket-card.is-noise .bucket-card-unit { color: var(--muted); }
.bucket-card-desc { margin: 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.split-bar { display: flex; height: 10px; margin: 14px 0 8px; border-radius: var(--radius-pill); overflow: hidden; background: var(--border); gap: 1px; }
.split-seg { flex-basis: 0; min-width: 0; }
.split-caption { margin: 0; font-size: 12.5px; color: var(--text-2); }
.split-caption b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.split-note { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.split-note b { color: var(--text-2); font-weight: 600; }
.chart-panel { min-width: 0; padding: 12px 14px 6px; border: 1px solid var(--border-2); border-radius: var(--radius); background: var(--surface); }
.chart-panel.is-noise { background: var(--surface-2); }
.chart-panel-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.chart-panel-head h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--text); }
.chart-panel-fig { margin-left: auto; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-panel .chart-box { height: 170px; }

/* Sürükle-bırak yükleme alanı */
.drop {
    display: flex; flex-direction: column; align-items: center;
    gap: 8px; padding: 28px 20px; text-align: center;
    border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
    background: var(--surface-2); cursor: pointer;
    transition: border-color .15s ease-out, background-color .15s ease-out;
}
.drop:hover { border-color: var(--focus); background: var(--accent-softer); }
.drop svg { width: 30px; height: 30px; color: var(--navy-600); }
.drop-title { font-size: 14px; font-weight: 600; color: var(--text); }
.drop-hint { font-size: 12.5px; color: var(--muted); }
.drop.is-over { border-color: var(--navy-700); border-style: solid; background: var(--accent-soft); }
.drop:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.drop.is-disabled { opacity: .5; pointer-events: none; }
.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.file-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 13px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--surface); }
.file-item svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--muted); }
.file-item .file-name { min-width: 0; flex: 1 1 auto; }
.file-item .file-name strong { display: block; font-weight: 600; }
.file-item .file-role { flex: 0 0 auto; }
.file-item.is-bad { border-color: var(--danger-bd); background: var(--danger-bg); }
.file-item.is-bad svg { color: var(--danger); }
.field-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; padding: 8px 10px; font-size: 12.5px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--surface); }
.field-note svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; color: var(--muted); }
.field-note .field-note-icon { display: flex; flex: 0 0 auto; }
.field-note .field-note-title { font-weight: 600; color: var(--text); }
.field-note.is-ok { border-color: var(--success-bd); background: var(--success-bg); }
.field-note.is-ok svg { color: var(--success); }
.field-note.is-bad { border-color: var(--danger-bd); background: var(--danger-bg); }
.field-note.is-bad svg { color: var(--danger); }
.check-list { display: flex; flex-direction: column; gap: 0; }
.check-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--divider-2); font-size: 13px; }
.check-row:last-child { border-bottom: 0; }
.check-row svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }
.check-row.is-ok svg { color: var(--success); }
.check-row.is-bad svg { color: var(--danger); }
.check-row .check-label { font-weight: 600; color: var(--text); }
.check-row .check-detail { color: var(--muted); font-size: 12.5px; word-break: break-word; }
.check-row.is-bad .check-detail { color: var(--text-2); }

/* Kullanıcı seçimi (duyuru hedefi) */
.combobox { display: flex; flex-direction: column; }
.combobox-list {
    list-style: none; margin: 6px 0 0; padding: 4px;
    max-height: 240px; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: var(--radius); box-shadow: var(--shadow-md);
}
.combobox-list[hidden] { display: none; }
.combobox-item {
    padding: 8px 10px; border-radius: var(--radius-xs);
    font-size: 13px; color: var(--text); cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.combobox-item:hover, .combobox-item.is-active { background: var(--accent-softer); color: var(--heading); }
.user-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 8px 7px 10px;
    background: var(--success-bg); border: 1px solid var(--success-bd);
    border-radius: var(--radius); font-size: 13px; color: var(--text);
}
.user-chip[hidden] { display: none; }
.user-chip > svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--success); }
.user-chip-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-clear {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border: 0; border-radius: var(--radius-xs);
    background: transparent; color: var(--text-2); cursor: pointer;
}
.user-chip-clear:hover { background: var(--danger-bg); color: var(--danger); }
.user-chip-clear svg { width: 15px; height: 15px; }

/* Müşteri seçici öneri listesi (user-picker.js) — ad (+ firma) ve e-posta */
.up-wrap { position: relative; }
.up-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; margin: 0; }
.up-list .combobox-item { display: flex; flex-direction: column; gap: 1px; white-space: normal; }
.up-name { font-weight: 600; color: var(--heading); overflow-wrap: anywhere; }
.up-sub { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.up-none { color: var(--muted); cursor: default; }

.announce-stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.announce-stack > .card { margin-top: 0; }
.announce-stack > #duyuru-formu { order: -1; }

/* ==========================================================================
   9. Duyarlı kırılımlar
   ========================================================================== */
@media (max-width: 1100px) {
    .bucket-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 959.98px) {
    html { scroll-padding-top: 72px; }
    .app { display: block; }
    .mbar { display: flex; }
    .sidebar {
        position: fixed; inset: 0 auto 0 0;
        width: min(280px, 86vw); height: 100%;
        transform: translateX(-105%);
        visibility: hidden;
        transition: transform .2s ease-out, visibility 0s linear .2s;
        box-shadow: var(--shadow-lg);
        z-index: calc(var(--z-header) + 10);
    }
    .sidebar.is-open { transform: none; visibility: visible; transition: transform .2s ease-out; }
    .sb-backdrop { z-index: calc(var(--z-header) + 9); }
    .sb-collapse { display: none; }
    .sb-close { display: inline-flex; }
    .topbar { padding: 10px 14px; min-height: 0; }
    .topsearch { max-width: none; }
    .hide-m { display: none !important; }
    .topuser-text { display: none; }
    .content { padding: 12px 14px 24px; }
    .page-foot { padding: 12px 14px 20px; }
    .page-head-side { align-items: flex-start; width: 100%; }
    .page-head-actions { justify-content: flex-start; }
    .secnav {
        flex: 1 1 100%; max-width: none; position: static;
        flex-direction: row; overflow-x: auto; gap: 6px; padding: 6px;
    }
    .secnav a { flex: 0 0 auto; white-space: nowrap; }
    .secnav-sub { display: none; }
    .tabnav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; position: relative; }
}

@media (max-width: 640px) {
    h1, .page-head h1 { font-size: 21px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .stat { padding: 13px 14px; }
    .stat-value { font-size: 22px; }
    .kpi-value, .ov-value { font-size: 24px; }
    .page-head-actions { width: 100%; }
    .page-head-actions > .btn, .page-head-actions > a.btn { flex: 1 1 auto; }
    .card-body { padding: 14px; }
    .card-head { padding: 12px 14px; }
    .form-rows { padding: 0 14px; }
    .form-row-label, .form-row.is-compact .form-row-label, .drawer .form-row-label { flex-basis: 100%; max-width: none; }
    .drawer-head, .drawer-foot { padding-left: 16px; padding-right: 16px; }
    .drawer-body { padding: 4px 16px 16px; }
    .toasts { right: 12px; left: 12px; bottom: 12px; max-width: none; }
    table.data th, table.data td { padding: 10px 11px; }
    .tools { padding: 12px 14px; }
    .pager { padding: 12px 14px; justify-content: center; }
    .bucket-cards { grid-template-columns: 1fr; gap: 8px; }
    .bucket-card-value { font-size: 22px; }
    .chart-panel .chart-box { height: 150px; }
    .fchips-label { flex: 1 1 100%; }

    /* Özet şeridi: 4'lü grup 2×2, alt satır da 2'li */
    .ov-body { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; padding: 14px; }
    .ov-seg { padding-left: 10px; }
    .ov-value { font-size: 22px; }
    .ov-label { font-size: 11px; }
    .ov-foot { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; padding: 8px 14px 10px; }
    .ov-foot-item { align-items: flex-start; gap: 6px; min-height: 32px; padding: 6px 0 6px 13px; font-size: 12.5px; line-height: 1.35; }
    .ov-foot-item svg { margin-top: 1px; }
    .ov-foot-item strong { margin-left: 0; }

    /* Filtre düğmeleri yerine açılır menü; filtreler yan yana */
    .fchips { display: block; }
    .fchips > .fchip, .fchips > .fchips-label { display: none; }
    .fchips-select { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; letter-spacing: .05em; color: var(--muted); text-transform: uppercase; }
    .fchips-select .select { width: 100%; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text); }
    .tools-row:has(.fchips) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .tools-row > .searchbox, .tools-row > .grow { grid-column: 1 / -1; }
    .tools-label { flex: 1 1 calc(50% - 5px); flex-direction: column; align-items: stretch; gap: 4px; font-size: 12px; min-width: 0; }
    .tools-label .select { width: 100%; }
    .tools-row > .btn { flex: 1 1 100%; justify-content: center; }
    /* Birden çok filtre menüsü varsa (Hesap + Lisans) yan yana */
    .tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .tools > * { grid-column: 1 / -1; min-width: 0; }
    .tools > .fchips:has(+ .fchips), .tools > .fchips + .fchips { grid-column: auto; }
}

/* ==========================================================================
   10. Yazdırma / hareket azaltma
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

@media print {
    .sidebar, .mbar, .topbar, .page-head-actions, .toolbar, .tools, .pagination, .pager, .toasts, .rowmenu, .sb-backdrop { display: none !important; }
    .app { display: block; }
    .card, .kpi, .state { box-shadow: none; break-inside: avoid; }
    body { background: #fff; }
}

/* 2FA gerektiren işlem etiketi (sürüm, kanal) */
.tfa-tag {
    display: inline-flex; align-items: center;
    margin-left: 4px; padding: 1px 6px; border-radius: var(--radius-pill);
    background: var(--accent-soft); color: var(--accent-soft-fg);
    font-size: 10.5px; font-weight: 700; letter-spacing: .03em;
}
.btn-primary .tfa-tag { background: rgba(255, 255, 255, .18); color: #fff; }
