/* ==========================================================================
   iyi avm — Uygulama Tasarım Sistemi v2
   Dosya 1/3: Değişkenler, temel stiller, uygulama kabuğu (kenar çubuğu,
   üst çubuk, mobil sekme çubuğu), sayfa geçişleri ve hareket.
   Bileşenler: components.css — Finans modülü: finance.css
   ========================================================================== */

/* ---------- Yazı tipleri (sunucuda barınır, dış istek yok — KVKK dostu) ---------- */
@font-face {
    font-family: 'Figtree';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('../fonts/figtree-latin-ext-wght-normal.woff2') format('woff2-variations'),
         url('../fonts/figtree-latin-ext-wght-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Figtree';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('../fonts/figtree-latin-wght-normal.woff2') format('woff2-variations'),
         url('../fonts/figtree-latin-wght-normal.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: 'Barlow Semi Condensed';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/barlow-semi-condensed-latin-ext-600-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Barlow Semi Condensed';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/barlow-semi-condensed-latin-600-normal.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: 'Barlow Semi Condensed';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/barlow-semi-condensed-latin-ext-700-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Barlow Semi Condensed';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/barlow-semi-condensed-latin-700-normal.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;
}

/* ---------- Tasarım değişkenleri ---------- */
:root {
    /* Marka — logodaki lacivert/kraliyet mavisinden türetildi */
    --brand-50:  #f0f4ff;
    --brand-100: #e0e8fd;
    --brand-200: #c3d3fb;
    --brand-300: #97b2f5;
    --brand-400: #6489eb;
    --brand-500: #3b66dc;
    --brand-600: #2752c4;
    --brand-700: #1e43a3;
    --brand-800: #183784;
    --brand-900: #0f2560;
    --violet-500: #7454e8;
    --aqua-500:   #13b3bf;

    /* Eski değişken adları korunur: görünümlerdeki satır içi stiller bunları kullanıyor */
    --color-primary:      #2752c4;
    --color-primary-dark: #1e43a3;
    --color-success:      #12875a;
    --color-warning:      #b86200;
    --color-danger:       #d33b3b;
    --color-neutral:      #64748b;
    --color-info:         #2563eb;
    --color-bg:           #f3f5fa;
    --color-surface:      #ffffff;
    --color-border:       #e3e8f1;
    --color-text:         #101828;
    --color-text-soft:    #5b6679;

    --success-bg: #e9f8f0;  --success-bd: #c3ead5;  --success-fg: #0d7349;
    --warning-bg: #fff5e6;  --warning-bd: #fbd8a4;  --warning-fg: #9a5200;
    --danger-bg:  #fdeeee;  --danger-bd:  #f5c4c4;  --danger-fg:  #b42828;
    --info-bg:    #ebf2ff;  --info-bd:    #c4d6fd;  --info-fg:    #1d4fc4;
    --neutral-bg: #f1f4f9;  --neutral-fg: #566275;

    /* Departman (bölge) renkleri — AVM yön levhası mantığı */
    --z-dashboard: #2752c4;
    --z-teknik:    #e67700;
    --z-isletme:   #0c9696;
    --z-pazarlama: #db3d82;
    --z-kiralama:  #7454e8;
    --z-finans:    #0e9a67;
    --z-muhasebe:  #2a8a4a;
    --z-hukuk:     #52627c;
    --z-satinalma: #0a82cc;
    --z-genel:     #4f46e5;
    --z-yonetim:   #5b6679;
    --z-master:    #24324a;
    --z-portal:    #7454e8;
    --zone:        var(--z-dashboard);

    --font-ui:      'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Barlow Semi Condensed', 'Figtree', system-ui, sans-serif;
    --font-mono:    ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px -2px rgba(16, 24, 40, .06);
    --shadow:    0 1px 2px rgba(16, 24, 40, .04), 0 8px 22px -8px rgba(16, 24, 40, .14);
    --shadow-lg: 0 12px 32px -10px rgba(16, 24, 40, .22), 0 2px 6px rgba(16, 24, 40, .05);
    --shadow-xl: 0 28px 64px -16px rgba(16, 24, 40, .34), 0 4px 12px rgba(16, 24, 40, .06);
    --ring:      0 0 0 4px rgba(59, 102, 220, .16);

    --glass:        rgba(255, 255, 255, .78);
    --glass-strong: rgba(255, 255, 255, .9);
    --glass-blur:   saturate(170%) blur(18px);

    --ease:        cubic-bezier(.2, .8, .2, 1);
    --ease-in-out: cubic-bezier(.65, 0, .35, 1);
    --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

    --sidebar-width: 272px;
    --rail-width:    78px;
    --topbar-height: 64px;
}

[data-zone="dashboard"] { --zone: var(--z-dashboard); }
[data-zone="teknik"]    { --zone: var(--z-teknik); }
[data-zone="isletme"]   { --zone: var(--z-isletme); }
[data-zone="pazarlama"] { --zone: var(--z-pazarlama); }
[data-zone="kiralama"]  { --zone: var(--z-kiralama); }
[data-zone="finans"]    { --zone: var(--z-finans); }
[data-zone="muhasebe"]  { --zone: var(--z-muhasebe); }
[data-zone="hukuk"]     { --zone: var(--z-hukuk); }
[data-zone="satinalma"] { --zone: var(--z-satinalma); }
[data-zone="genel"]     { --zone: var(--z-genel); }
[data-zone="yonetim"]   { --zone: var(--z-yonetim); }
[data-zone="master"]    { --zone: var(--z-master); }
[data-zone="portal"]    { --zone: var(--z-portal); }

/* ---------- Temel ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.55;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
}

/* Arka plan: sabit, hafif renk bulutları (görsel dosyası yok, saf CSS) */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(900px 520px at 105% -8%, rgba(59, 102, 220, .11), transparent 62%),
        radial-gradient(760px 480px at 30% 115%, rgba(19, 179, 191, .07), transparent 60%),
        radial-gradient(620px 420px at -6% 18%, rgba(116, 84, 232, .06), transparent 62%),
        var(--color-bg);
}

a { color: var(--brand-600); text-decoration-thickness: from-font; }
a:hover { color: var(--brand-700); }

h1, h2, h3, h4, h5 { line-height: 1.25; letter-spacing: -.01em; }

img, video { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--brand-200); color: var(--brand-900); }

:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
    border-radius: 6px;
}

hr { border: 0; border-top: 1px solid var(--color-border); margin: 18px 0; }

/* İnce kaydırma çubukları */
* { scrollbar-width: thin; scrollbar-color: rgba(16, 24, 40, .18) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: rgba(16, 24, 40, .16); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background-color: rgba(16, 24, 40, .28); }
*::-webkit-scrollbar-track { background: transparent; }

/* SVG ikon (public/img/icons.svg) */
.i {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: middle;
}
.i-sm { width: 15px; height: 15px; }
.i-lg { width: 22px; height: 22px; }
.i-xl { width: 28px; height: 28px; }

/* ---------- Yerleşim ---------- */
.app-layout,
.master-layout,
.portal-layout {
    display: block;
    min-height: 100vh;
}

.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .38s var(--ease);
}

/* ==========================================================================
   KENAR ÇUBUĞU (cam efekti)
   ========================================================================== */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    z-index: 60;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(255, 255, 255, .86), rgba(248, 250, 255, .78));
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid rgba(16, 24, 40, .07);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, .7);
    transition: width .38s var(--ease), transform .38s var(--ease), box-shadow .38s;
    view-transition-name: app-sidebar;
}

.sb-head {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 12px 0 20px;
    flex: none;
}

.sb-brand {
    display: flex;
    align-items: center;
    min-width: 0;
    text-decoration: none;
}
.sb-logo { height: 30px; width: auto; display: block; }
.sb-mark { width: 34px; height: 34px; display: none; }

.sb-icon-btn {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #7b8699;
    cursor: pointer;
    transition: background .2s, color .2s, transform .2s var(--ease);
}
.sb-icon-btn:hover { background: rgba(16, 24, 40, .06); color: var(--color-text); }
.sb-icon-btn:active { transform: scale(.92); }

/* Kurum (AVM) kartı */
.sb-tenant {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 2px 14px 12px;
    padding: 11px 12px;
    border-radius: 16px;
    color: #fff;
    background:
        radial-gradient(120px 80px at 100% 0%, rgba(255, 255, 255, .22), transparent 70%),
        linear-gradient(135deg, var(--brand-600) 0%, var(--brand-800) 100%);
    box-shadow: 0 10px 24px -12px rgba(30, 67, 163, .8), inset 0 1px 0 rgba(255, 255, 255, .2);
    flex: none;
    isolation: isolate;
}
.sb-tenant::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .22) 45%, transparent 60%);
    transform: translateX(-120%);
    animation: sheen 7s var(--ease-in-out) 1.2s infinite;
}
.sb-tenant-ic {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
    flex: none;
}
.sb-tenant-ic .i { width: 18px; height: 18px; }
.sb-tenant-text { min-width: 0; line-height: 1.25; }
.sb-tenant-text strong {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sb-tenant-text small { font-size: 11.5px; opacity: .78; font-weight: 500; }

/* Arama düğmesi */
.sb-search {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 38px;
    margin: 0 14px 10px;
    padding: 0 9px 0 12px;
    border: 1px solid rgba(16, 24, 40, .09);
    border-radius: 12px;
    background: rgba(255, 255, 255, .75);
    color: #6b7486;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    flex: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.sb-search:hover { border-color: var(--brand-200); background: #fff; box-shadow: 0 0 0 4px rgba(59, 102, 220, .08); }
.sb-search .i { width: 16px; height: 16px; color: #8a94a6; }
.sb-search span { flex: 1; text-align: left; }

kbd {
    font: 600 10.5px/1 var(--font-ui);
    padding: 3px 6px;
    border-radius: 6px;
    background: #fff;
    color: #6b7486;
    border: 1px solid #e1e6ee;
    box-shadow: 0 1px 0 #dde3ec;
    white-space: nowrap;
}

/* Menü */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 12px 18px;
    overscroll-behavior: contain;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 11px;
    color: #3a4558;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: background .18s, color .18s, box-shadow .2s;
    -webkit-tap-highlight-color: transparent;
}
.nav-link .i { width: 18px; height: 18px; color: #7d889b; transition: color .2s, transform .25s var(--ease-spring); }
.nav-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-link:hover { background: rgba(16, 24, 40, .045); color: var(--color-text); }
.nav-link:hover .i { color: var(--zone); transform: scale(1.08); }
.nav-link.active {
    background: #fff;
    color: var(--color-text);
    font-weight: 650;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 14px -6px rgba(16, 24, 40, .16), inset 0 0 0 1px rgba(16, 24, 40, .04);
}
.nav-link.active .i { color: var(--zone); }
.nav-link.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 9px;
    bottom: 9px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--zone);
    animation: indicator-in .45s var(--ease-spring) both;
}
.nav-link .nav-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--color-danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-grid;
    place-items: center;
}

.nav-single { margin-bottom: 6px; }

.nav-group { position: relative; margin-top: 2px; }

.nav-group-head {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 10px 0 7px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #2b3547;
    font: 650 13px var(--font-ui);
    text-align: left;
    cursor: pointer;
    transition: background .18s;
    -webkit-tap-highlight-color: transparent;
}
.nav-group-head:hover { background: rgba(16, 24, 40, .04); }

.ng-icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: var(--zone);
    background: color-mix(in srgb, var(--zone) 13%, #fff);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--zone) 16%, transparent);
    flex: none;
    transition: transform .35s var(--ease-spring), background .25s, color .25s;
}
.ng-icon .i { width: 16px; height: 16px; stroke-width: 2.1; }
.nav-group-head:hover .ng-icon { transform: scale(1.07) rotate(-5deg); }
.nav-group.has-active .ng-icon {
    color: #fff;
    background: linear-gradient(135deg, color-mix(in srgb, var(--zone) 78%, #fff), var(--zone));
    box-shadow: 0 6px 14px -6px var(--zone);
}

.ng-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ng-count {
    font-size: 11px;
    font-weight: 650;
    color: #8a94a6;
    background: rgba(16, 24, 40, .05);
    border-radius: 99px;
    padding: 1px 7px;
    transition: opacity .2s;
}
.nav-group.open .ng-count { opacity: 0; }
.ng-chev { width: 16px; height: 16px; color: #9aa3b2; transition: transform .35s var(--ease); }
.nav-group.open .ng-chev { transform: rotate(180deg); }

.nav-group-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .36s var(--ease);
}
.nav-group.open .nav-group-body { grid-template-rows: 1fr; }
.ngb-inner {
    overflow: hidden;
    min-height: 0;
    position: relative;
    padding-left: 18px;
}
.ngb-inner::before {
    content: '';
    position: absolute;
    left: 22px;
    top: 6px;
    bottom: 10px;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--zone) 45%, transparent), transparent);
    opacity: .5;
}
.ngb-inner .nav-link { min-height: 35px; font-size: 13.2px; padding-left: 14px; }
.ngb-inner .nav-link:first-child { margin-top: 2px; }
.ngb-inner .nav-link:last-child { margin-bottom: 6px; }
.nav-group.anim .ngb-inner .nav-link {
    animation: nav-item-in .4s var(--ease) both;
    animation-delay: calc(var(--n, 0) * 24ms);
}

/* Kenar çubuğu alt kısmı: kullanıcı */
.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px 14px;
    border-top: 1px solid rgba(16, 24, 40, .06);
    flex: none;
}
.sb-user {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 13px;
    color: inherit;
    text-decoration: none;
    transition: background .2s;
}
.sb-user:hover { background: rgba(16, 24, 40, .05); color: inherit; }
.sb-user-text { min-width: 0; line-height: 1.25; }
.sb-user-text strong { display: block; font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-text small { display: block; font-size: 11.5px; color: var(--color-text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-logout:hover { background: var(--danger-bg); color: var(--color-danger); }

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    flex: none;
    font: 700 13px/1 var(--font-ui);
    letter-spacing: .02em;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-500) 0%, var(--violet-500) 100%);
    box-shadow: 0 0 0 2px #fff, 0 4px 12px -3px rgba(39, 82, 196, .55);
}

/* ---------- Daraltılmış kenar çubuğu (ikon rayı) ---------- */
@media (min-width: 1025px) {
    html.sb-rail .sidebar { width: var(--rail-width); }
    html.sb-rail .main-wrapper { margin-left: var(--rail-width); }
    html.sb-rail .sb-head { padding: 0; justify-content: center; flex-direction: column; height: auto; gap: 6px; padding-top: 14px; margin-bottom: 8px; }
    html.sb-rail .sb-logo { display: none; }
    html.sb-rail .sb-mark { display: block; }
    html.sb-rail .sb-collapse .i { transform: rotate(180deg); }
    html.sb-rail .sb-tenant { margin: 0 auto 10px; padding: 8px; width: 50px; justify-content: center; }
    html.sb-rail .sb-tenant-text,
    html.sb-rail .sb-search span,
    html.sb-rail .sb-search kbd,
    html.sb-rail .ng-label,
    html.sb-rail .ng-count,
    html.sb-rail .ng-chev,
    html.sb-rail .nav-single .nav-link span,
    html.sb-rail .sb-user-text { display: none; }
    html.sb-rail .sb-search { width: 46px; margin: 0 auto 10px; padding: 0; justify-content: center; }
    html.sb-rail .sidebar-nav { overflow: visible; padding: 4px 10px 18px; }
    html.sb-rail .nav-single .nav-link { justify-content: center; padding: 0; }
    html.sb-rail .nav-group-head { justify-content: center; padding: 0; }
    html.sb-rail .nav-group-body {
        display: none;
        position: absolute;
        left: calc(100% + 8px);
        top: -6px;
        min-width: 240px;
        padding: 8px;
        border-radius: 16px;
        background: var(--glass-strong);
        -webkit-backdrop-filter: var(--glass-blur);
        backdrop-filter: var(--glass-blur);
        border: 1px solid rgba(16, 24, 40, .07);
        box-shadow: var(--shadow-xl);
        z-index: 80;
    }
    html.sb-rail .nav-group-body::before {
        content: attr(data-label);
        display: block;
        padding: 6px 10px 8px;
        font-size: 11px;
        font-weight: 750;
        letter-spacing: .08em;
        text-transform: uppercase;
        color: var(--zone);
    }
    html.sb-rail .nav-group-body::after {
        content: '';
        position: absolute;
        left: -10px;
        top: 0;
        bottom: 0;
        width: 12px;
    }
    html.sb-rail .nav-group:hover .nav-group-body,
    html.sb-rail .nav-group:focus-within .nav-group-body {
        display: block;
        animation: flyout-in .28s var(--ease) both;
    }
    html.sb-rail .ngb-inner { padding-left: 0; overflow: visible; }
    html.sb-rail .ngb-inner::before { display: none; }
    html.sb-rail .ngb-inner .nav-link { padding-left: 10px; }
    html.sb-rail .nav-link.active::before { display: none; }
    html.sb-rail .sidebar-footer { flex-direction: column; padding: 10px 8px 14px; }
    html.sb-rail .sb-user { justify-content: center; padding: 4px; }
}

/* ==========================================================================
   ÜST ÇUBUK
   ========================================================================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 28px;
    background: rgba(243, 245, 250, .72);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid transparent;
    transition: background .3s, border-color .3s, box-shadow .3s;
    view-transition-name: app-topbar;
}
.topbar.scrolled {
    background: rgba(255, 255, 255, .82);
    border-bottom-color: rgba(16, 24, 40, .07);
    box-shadow: 0 6px 24px -14px rgba(16, 24, 40, .28);
}

.tb-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex: none;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #4a5568;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, color .2s, transform .2s var(--ease);
}
.tb-btn:hover { background: rgba(16, 24, 40, .06); color: var(--color-text); }
.tb-btn:active { transform: scale(.92); }
.tb-btn .i { width: 20px; height: 20px; }

.sidebar-toggle { display: none; }

.tb-crumb {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.tb-zone {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    flex: none;
    color: var(--zone);
    background: color-mix(in srgb, var(--zone) 13%, #fff);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--zone) 18%, transparent);
}
.tb-zone .i { width: 17px; height: 17px; stroke-width: 2.1; }
.tb-crumb-group { font-size: 13px; color: var(--color-text-soft); font-weight: 550; white-space: nowrap; }
.tb-sep { width: 14px; height: 14px; color: #a7afbd; }
.topbar-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-right { display: flex; align-items: center; gap: 6px; }

.tb-search {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 40px;
    min-width: 260px;
    padding: 0 9px 0 13px;
    border: 1px solid rgba(16, 24, 40, .08);
    border-radius: 12px;
    background: rgba(255, 255, 255, .8);
    color: #6b7486;
    font-size: 13px;
    cursor: pointer;
    margin-right: 6px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.tb-search:hover { border-color: var(--brand-200); background: #fff; box-shadow: 0 0 0 4px rgba(59, 102, 220, .08); }
.tb-search .i { width: 17px; height: 17px; color: #8a94a6; }
.tb-search span { flex: 1; text-align: left; }

.notif-btn { font-size: 0; }
.notif-badge {
    position: absolute;
    top: 3px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f05656, #d33b3b);
    color: #fff;
    font: 700 10.5px/1 var(--font-ui);
    box-shadow: 0 0 0 2px var(--color-bg);
    animation: badge-pop .6s var(--ease-spring) both;
}
.notif-badge::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    border: 2px solid #f05656;
    animation: pulse-ring 2.4s var(--ease) 1s infinite;
}

.tb-avatar { border: 0; cursor: pointer; padding: 0; }
.tb-avatar .avatar { width: 36px; height: 36px; transition: transform .25s var(--ease-spring), box-shadow .25s; }
.tb-avatar:hover .avatar { transform: scale(1.06); }

/* Açılır menü */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 240px;
    padding: 6px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(16, 24, 40, .07);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(.98);
    transform-origin: top right;
    transition: opacity .2s var(--ease), transform .28s var(--ease), visibility 0s linear .28s;
    z-index: 90;
}
.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .2s var(--ease), transform .28s var(--ease-spring), visibility 0s;
}
.dropdown-head { padding: 10px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid #eef1f6; display: flex; gap: 10px; align-items: center; }
.dropdown-head strong { display: block; font-size: 13.5px; }
.dropdown-head small { display: block; font-size: 12px; color: var(--color-text-soft); }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--color-text);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    text-align: left;
}
.dropdown-item .i { width: 17px; height: 17px; color: #7b8699; }
.dropdown-item:hover { background: #f3f6fc; color: var(--color-text); }
.dropdown-item.danger:hover { background: var(--danger-bg); color: var(--color-danger); }
.dropdown-item.danger:hover .i { color: var(--color-danger); }

/* ==========================================================================
   İÇERİK ALANI
   ========================================================================== */
.content {
    flex: 1;
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
    padding: 26px 30px 56px;
}

/* Sayfa açılış hareketi: bloklar sırayla yükselir */
.content > * { animation: rise .55s var(--ease) both; }
.content > *:nth-child(2) { animation-delay: .04s; }
.content > *:nth-child(3) { animation-delay: .08s; }
.content > *:nth-child(4) { animation-delay: .12s; }
.content > *:nth-child(5) { animation-delay: .16s; }
.content > *:nth-child(6) { animation-delay: .2s; }
.content > *:nth-child(7) { animation-delay: .24s; }
.content > *:nth-child(n+8) { animation-delay: .28s; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px 16px;
    margin-bottom: 24px;
}
.page-header h1 {
    font-size: 25px;
    font-weight: 750;
    letter-spacing: -.02em;
    line-height: 1.15;
    color: var(--color-text);
}
.ph-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ph-icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    flex: none;
    color: #fff;
    background: linear-gradient(135deg, color-mix(in srgb, var(--zone) 72%, #fff) 0%, var(--zone) 70%);
    box-shadow: 0 12px 24px -12px var(--zone), inset 0 1px 0 rgba(255, 255, 255, .35);
    animation: icon-pop .7s var(--ease-spring) both;
}
.ph-icon .i { width: 23px; height: 23px; stroke-width: 2; }
.ph-text { min-width: 0; }
.ph-eyebrow {
    display: block;
    margin-bottom: 3px;
    font-size: 11.5px;
    font-weight: 750;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--zone);
}

/* ==========================================================================
   MOBİL SEKME ÇUBUĞU + KAPLAMA
   ========================================================================== */
.tabbar { display: none; }

.sb-overlay {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(15, 23, 42, .36);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s var(--ease);
}
.sb-overlay.show { opacity: 1; pointer-events: auto; }

/* Üst ilerleme çizgisi (sayfa yüklenirken) */
.topline {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    z-index: 10000;
    background: linear-gradient(90deg, var(--brand-500), var(--violet-500), var(--aqua-500));
    box-shadow: 0 0 12px rgba(59, 102, 220, .55);
    border-radius: 0 3px 3px 0;
    opacity: 0;
    transition: width .45s var(--ease), opacity .3s;
    pointer-events: none;
}
.topline.run { opacity: 1; }

/* ==========================================================================
   DUYARLI (RESPONSIVE)
   ========================================================================== */
@media (max-width: 1280px) {
    .tb-search { min-width: 0; }
    .tb-search span, .tb-search kbd { display: none; }
}

@media (max-width: 1024px) {
    .sidebar {
        width: min(300px, 86vw);
        transform: translateX(-105%);
        box-shadow: none;
        background: rgba(255, 255, 255, .94);
    }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
    .sb-collapse { display: none; }
    .main-wrapper { margin-left: 0 !important; }
    .sidebar-toggle { display: grid; }
    .topbar { padding: 0 16px; gap: 8px; }
    .content { padding: 20px 18px 48px; }
}

@media (max-width: 768px) {
    .tb-crumb-group, .tb-sep { display: none; }
    .tb-search { display: none; }
    .tb-zone { width: 30px; height: 30px; }
    .content { padding: 16px 14px 112px; }
    .page-header { margin-bottom: 18px; }
    .page-header h1 { font-size: 21px; }
    .ph-icon { width: 42px; height: 42px; border-radius: 13px; }

    .tabbar {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        z-index: 50;
        height: 66px;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: center;
        background: var(--glass-strong);
        -webkit-backdrop-filter: var(--glass-blur);
        backdrop-filter: var(--glass-blur);
        border: 1px solid rgba(255, 255, 255, .8);
        border-radius: 22px;
        box-shadow: var(--shadow-lg);
        view-transition-name: app-tabbar;
    }
    .tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        height: 100%;
        border: 0;
        background: none;
        color: #6a7487;
        font: 650 10.5px/1 var(--font-ui);
        text-decoration: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: color .2s;
    }
    .tab .i { width: 22px; height: 22px; transition: transform .3s var(--ease-spring); }
    .tab.active { color: var(--brand-600); }
    .tab.active .i { transform: translateY(-2px); }
    .tab:active .i { transform: scale(.88); }
    .tab-main .tab-ic {
        width: 48px;
        height: 48px;
        margin-top: -26px;
        border-radius: 17px;
        display: grid;
        place-items: center;
        color: #fff;
        background: linear-gradient(135deg, var(--brand-500), var(--violet-500));
        box-shadow: 0 12px 24px -10px rgba(59, 102, 220, .9), 0 0 0 4px rgba(255, 255, 255, .9);
    }
    .tab-main .tab-ic .i { width: 22px; height: 22px; }
}

/* ==========================================================================
   HAREKET (animasyon tanımları)
   ========================================================================== */
@keyframes rise        { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade-in     { from { opacity: 0; } to { opacity: 1; } }
@keyframes icon-pop    { 0% { opacity: 0; transform: scale(.6) rotate(-12deg); } 100% { opacity: 1; transform: none; } }
@keyframes indicator-in{ from { transform: scaleY(0); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes nav-item-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes flyout-in   { from { opacity: 0; transform: translateX(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes badge-pop   { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes pulse-ring  { 0% { transform: scale(1); opacity: .55; } 60%, 100% { transform: scale(1.6); opacity: 0; } }
@keyframes sheen       { 0%, 70% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
@keyframes spin        { to { transform: rotate(360deg); } }

/* Sayfalar arası geçiş (destekleyen tarayıcılarda) — menü ve üst çubuk sabit kalır */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .14s ease both; }
::view-transition-new(root) { animation: none; }
::view-transition-old(app-sidebar),
::view-transition-old(app-topbar),
::view-transition-old(app-tabbar) { display: none; }
::view-transition-new(app-sidebar),
::view-transition-new(app-topbar),
::view-transition-new(app-tabbar) { animation: none; }
@keyframes vt-out { to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    @view-transition { navigation: none; }
}

/* ==========================================================================
   YAZDIRMA
   ========================================================================== */
@media print {
    body::before, .sidebar, .topbar, .tabbar, .table-tools, .sb-overlay, .topline,
    .toast-stack, .no-print, .page-header .btn, .form-actions { display: none !important; }
    .main-wrapper { margin: 0 !important; }
    .content { padding: 0; max-width: none; }
    .content > * { animation: none !important; }
    body { background: #fff; font-size: 12px; }
    .section, .table-wrapper, .detail-card, .stat-card, .form-card, .card { box-shadow: none !important; break-inside: avoid; }
    a { color: inherit; text-decoration: none; }
}

/* Erişilebilirlik: klavye ile "içeriğe geç" bağlantısı */
.sr-skip {
    position: fixed;
    left: 12px;
    top: -60px;
    z-index: 10001;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--brand-700);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    transition: top .2s var(--ease);
}
.sr-skip:focus { top: 12px; color: #fff; }
