/* =============================================================
   KAYA SAHA CRM — DESIGN SYSTEM v6.0 "Quiet Confidence"
   Iris primary · Warm graphite ink · Geist · Lucide
   Hairline borders · Calm · No green-orange legacy
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700;800&family=Geist+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* === IRIS — Primary (modern blue-violet) === */
    --iris-50:  #F5F4FB;
    --iris-100: #EAE9F8;
    --iris-200: #D4D1F0;
    --iris-300: #B5B0E5;
    --iris-400: #8C84D8;
    --iris-500: #5B53D1;     /* BRAND */
    --iris-600: #4F47B8;
    --iris-700: #3F3A93;
    --iris-800: #312D72;
    --iris-900: #232055;

    /* Backwards-compat — old Azure aliases now point to Iris ramp */
    --brand-50:  var(--iris-50);
    --brand-100: var(--iris-100);
    --brand-200: var(--iris-200);
    --brand-300: var(--iris-300);
    --brand-400: var(--iris-400);
    --brand-500: var(--iris-500);
    --brand-600: var(--iris-500);
    --brand-700: var(--iris-700);
    --brand-800: var(--iris-800);
    --brand-900: var(--iris-900);

    --brand:        var(--iris-500);
    --brand-hover:  var(--iris-600);
    --brand-tint:   var(--iris-50);
    --brand-strong: var(--iris-700);
    --brand-on:     #FFFFFF;
    --focus-ring:   rgba(91, 83, 209, 0.30);

    /* === TEAL — Secondary === */
    --teal-50:  #F0FDFA;
    --teal-100: #CCFBF1;
    --teal-300: #5EEAD4;
    --teal-500: #14B8A6;
    --teal-600: #0D9488;
    --teal-700: #0F766E;

    --accent-50:  var(--teal-50);
    --accent-100: var(--teal-100);
    --accent-300: var(--teal-300);
    --accent-500: var(--teal-500);
    --accent-600: var(--teal-600);
    --accent-700: var(--teal-700);
    --accent:     var(--teal-600);
    --accent-tint: var(--teal-50);

    /* === VIOLET — Tertiary === */
    --violet-50:  #F5F3FF;
    --violet-100: #EDE9FE;
    --violet-500: #8B5CF6;
    --violet-600: #7C3AED;
    --violet-700: #6D28D9;

    /* === AMBER — Warning only === */
    --amber-50:  #FFFBEB;
    --amber-100: #FEF3C7;
    --amber-500: #F59E0B;
    --amber-600: #D97706;
    --amber-700: #B45309;

    /* === STATUS === */
    --success-50:  #F0FDF4;
    --success-100: #DCFCE7;
    --success-500: #22C55E;
    --success-600: #16A34A;
    --success-700: #15803D;

    --danger-50:   #FEF2F2;
    --danger-100:  #FEE2E2;
    --danger-500:  #EF4444;
    --danger-600:  #DC2626;
    --danger-700:  #B91C1C;

    --warning-50:  var(--amber-50);
    --warning-500: var(--amber-500);
    --warning-600: var(--amber-600);
    --warning-700: var(--amber-700);

    --info-50:   #EFF6FF;
    --info-100:  #DBEAFE;
    --info-500:  #3B82F6;
    --info-600:  #2563EB;
    --info-700:  #1D4ED8;

    /* === INK — Warm graphite (sıcak gri, hue 80) === */
    --ink-0:   #FFFFFF;
    --ink-25:  #FBFBFA;
    --ink-50:  #F8F8F6;
    --ink-100: #F2F2EF;
    --ink-150: #ECECE9;
    --ink-200: #E5E4E2;
    --ink-300: #D6D5D2;
    --ink-400: #A8A6A1;
    --ink-500: #7E7C76;
    --ink-600: #61605B;
    --ink-700: #4D4B47;
    --ink-800: #2F2D2A;
    --ink-900: #1A1916;

    /* Slate fallbacks (eski referanslar için) */
    --slate-50:  var(--ink-50);
    --slate-100: var(--ink-100);
    --slate-200: var(--ink-200);
    --slate-300: var(--ink-300);
    --slate-400: var(--ink-400);
    --slate-500: var(--ink-500);
    --slate-600: var(--ink-600);
    --slate-700: var(--ink-700);
    --slate-800: var(--ink-800);
    --slate-900: var(--ink-900);

    /* === SEMANTIC SURFACE === */
    --bg:           var(--ink-25);
    --surface:      var(--ink-0);
    --surface-2:    var(--ink-50);
    --surface-mute: var(--ink-50);
    --surface-sunk: var(--ink-100);
    --hairline:     var(--ink-200);
    --hairline-soft: var(--ink-150);
    --border:       var(--ink-200);
    --border-soft:  var(--ink-150);
    --text:         var(--ink-800);
    --text-1:       var(--ink-800);
    --text-2:       var(--ink-600);
    --text-3:       var(--ink-500);
    --text-mute:    var(--ink-400);
    --text-muted:   var(--ink-500);
    --text-subtle:  var(--ink-400);

    /* === SCALE === */
    --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
    --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
    --space-12: 48px; --space-16: 64px;

    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
    --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;

    --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 10px; --r-xl: 14px; --r-2xl: 18px; --r-full: 9999px;

    /* === SHADOW — hairlines instead of blur === */
    --sh-1: 0 1px 0 0 var(--hairline-soft);
    --sh-2: 0 1px 2px -1px rgba(15, 23, 42, 0.06), 0 1px 0 0 var(--hairline-soft);
    --sh-3: 0 4px 12px -4px rgba(15, 23, 42, 0.08), 0 1px 0 0 var(--hairline-soft);
    --sh-pop: 0 12px 32px -12px rgba(15, 23, 42, 0.18), 0 0 0 1px var(--hairline);

    --shadow-1: var(--sh-1);
    --shadow-2: var(--sh-2);
    --shadow-3: var(--sh-3);
    --shadow-4: var(--sh-pop);
    --shadow-focus: 0 0 0 3px var(--focus-ring);

    /* === MOTION === */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --t-1: 120ms var(--ease);
    --t-2: 180ms var(--ease);
    --t-3: 240ms var(--ease);
    --easing: var(--ease);
    --t-fast: var(--t-1);
    --t-base: var(--t-2);
    --t-slow: var(--t-3);

    /* === TYPE === */
    --font-sans: 'Geist', 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
    --font-family: var(--font-sans);
    --tracking-tight: -0.02em;
    --tracking-normal: -0.005em;
    --tracking-wide: 0.04em;

    --content-max: 1600px;
    --content-max-width: 1600px;
}

/* ============================================================
   GLOBAL
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text-1);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'cv11', 'ss01', 'ss03';
    letter-spacing: var(--tracking-normal);
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); }

::selection { background: var(--iris-100); color: var(--iris-700); }

.lucide {
    width: 18px; height: 18px;
    stroke-width: 1.75;
    vertical-align: middle;
    color: currentColor;
}
.lucide-sm { width: 14px; height: 14px; }
.lucide-lg { width: 22px; height: 22px; }
.lucide-xl { width: 28px; height: 28px; }

/* ============================================================
   TYPE UTILITIES
   ============================================================ */

.t-display { font-size: 36px; font-weight: 700; line-height: 1.1; letter-spacing: var(--tracking-tight); }
.t-h1 { font-size: 28px; font-weight: 600; line-height: 1.2; letter-spacing: var(--tracking-tight); }
.t-h2 { font-size: 22px; font-weight: 600; line-height: 1.25; letter-spacing: var(--tracking-tight); }
.t-h3 { font-size: 16px; font-weight: 600; line-height: 1.35; }
.t-body { font-size: 14px; line-height: 1.5; }
.t-sm { font-size: 13px; line-height: 1.5; }
.t-xs { font-size: 12px; line-height: 1.45; }
.t-mono { font-family: var(--font-mono); font-feature-settings: 'tnum'; }
.t-num { font-feature-settings: 'tnum', 'lnum'; font-variant-numeric: tabular-nums; }
.t-muted { color: var(--text-muted); }
.t-subtle { color: var(--text-subtle); }
.t-eyebrow {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: var(--tracking-wide); color: var(--text-muted);
}
.t-eyebrow.brand { color: var(--iris-700); }

/* ============================================================
   APP SHELL — onboarding pattern: sidebar + main(topbar+page)
   ============================================================ */

.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    background: var(--bg);
}
.app-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.app-page {
    flex: 1;
    padding: 24px 28px 48px;
    max-width: var(--content-max);
    width: 100%;
    margin: 0 auto;
}

/* Backdrop: drawer kapaliyken gizli, masaustunde de gizli */
.drawer-backdrop { display: none; }
.sidebar-close { display: none; }

@media (max-width: 960px) {
    .app-shell { grid-template-columns: 1fr; }
    .app-shell .sidebar { display: none !important; }
    .app-shell.drawer-open .sidebar {
        display: flex !important;
        position: fixed;
        z-index: 1200;
        top: 0; left: 0; bottom: 0;
        width: min(84vw, 300px);
        height: 100dvh;
        box-shadow: var(--sh-pop);
        animation: drawerSlideIn 0.18s ease-out;
    }
    /* Drawer aciksa yari saydam siyah backdrop — disarisina tikla = kapat */
    .app-shell.drawer-open .drawer-backdrop {
        display: block;
        position: fixed;
        z-index: 1199;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0, 0, 0, 0.45);
        animation: backdropFade 0.15s ease-out;
        cursor: pointer;
    }
    .app-shell.drawer-open .app-main { pointer-events: none; }
    .app-shell.drawer-open .drawer-backdrop { pointer-events: auto; }
    .sidebar-close {
        margin-left: auto;
        width: 34px;
        height: 34px;
        border: 1px solid var(--hairline);
        border-radius: var(--r-md);
        background: var(--surface);
        color: var(--text-2);
        display: grid;
        place-items: center;
        cursor: pointer;
    }
    .app-page { padding: 16px; }
}

@keyframes drawerSlideIn {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
}
@keyframes backdropFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ============================================================
   TOPBAR — onboarding pattern (.topbar)
   ============================================================ */

.topbar {
    height: 56px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--hairline);
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar .crumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-3);
}
.topbar .crumbs > svg { color: var(--text-mute); }
.topbar .crumbs .here { color: var(--text-1); font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 12px;
    border-radius: var(--r-md);
    border: 1px solid var(--hairline);
    background: var(--surface-mute);
    color: var(--text-3);
    font-size: 13px;
    cursor: pointer;
    min-width: 260px;
    transition: border-color var(--t-1);
}
.topbar .search-box:hover { border-color: var(--ink-300); }
.topbar .search-box .kbd {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 1px 5px;
    border: 1px solid var(--hairline);
    border-radius: 4px;
    color: var(--text-mute);
    background: var(--surface);
}

/* ===== Aktif arama: input + popover ===== */
.search-wrap { position: relative; }
.topbar .search-box.search-box-active {
    background: var(--surface);
    border-color: var(--iris-500);
    box-shadow: 0 0 0 3px var(--focus-ring);
    cursor: text;
}
.topbar .search-input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 13px;
    color: var(--text-1);
    font-family: inherit;
    min-width: 200px;
}
.topbar .search-input::placeholder { color: var(--text-3); }
.topbar .ico-btn-mini {
    width: 22px; height: 22px;
    border-radius: 5px;
    border: 0; background: transparent;
    display: grid; place-items: center;
    cursor: pointer;
    color: var(--text-3);
    margin-left: auto;
}
.topbar .ico-btn-mini:hover { background: var(--surface-sunk); color: var(--ink-700); }

.search-popover {
    position: absolute;
    top: 42px; left: 0; right: 0;
    min-width: 320px;
    max-height: 380px; overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    box-shadow: var(--sh-pop);
    padding: 4px;
    z-index: 300;
}
.search-popover-empty {
    padding: 18px;
    text-align: center;
    color: var(--text-3);
    font-size: 13px;
}
.search-result {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    cursor: pointer;
    align-items: center;
}
.search-result:hover { background: var(--surface-sunk); }
.search-result .avatar { width: 28px; height: 28px; font-size: 11px; }
.search-result-body { min-width: 0; }
.search-result-name { font-size: 13.5px; font-weight: 600; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-meta { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.search-result-more {
    margin-top: 4px;
    padding: 8px 10px;
    border-top: 1px solid var(--hairline-soft);
    text-align: center;
    font-size: 12px;
    color: var(--iris-600);
    font-weight: 600;
    cursor: pointer;
    border-radius: 0 0 var(--r-sm) var(--r-sm);
}
.search-result-more:hover { background: var(--iris-50); }
.topbar .ico-btn {
    width: 34px; height: 34px;
    border-radius: var(--r-md);
    border: 1px solid var(--hairline);
    background: var(--surface);
    color: var(--text-2);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    position: relative;
    transition: background var(--t-1), border-color var(--t-1), color var(--t-1);
}
.topbar .ico-btn:hover {
    background: var(--surface-sunk);
    border-color: var(--ink-300);
    color: var(--text-1);
}
.topbar .ico-btn .dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--danger-500);
    border: 1.5px solid var(--surface);
}
.topbar .topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 10px 0 6px;
    border-radius: var(--r-md);
    border: 1px solid var(--hairline);
    background: var(--surface);
    color: var(--text-1);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.topbar .topbar-user:hover { background: var(--surface-sunk); }
.topbar .topbar-user .avatar { width: 24px; height: 24px; font-size: 10.5px; }

.topbar-menu {
    position: absolute;
    top: 50px; right: 18px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    box-shadow: var(--sh-pop);
    min-width: 200px;
    padding: 6px;
    z-index: 200;
}
.topbar-menu .menu-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    font-size: 13px;
    color: var(--text-1);
    cursor: pointer;
    background: none; border: 0; width: 100%; text-align: left;
}
.topbar-menu .menu-item:hover { background: var(--surface-sunk); }
.topbar-menu .menu-item.danger { color: var(--danger-700); }
.topbar-menu .menu-divider { height: 1px; background: var(--hairline-soft); margin: 4px 0; }

/* ============================================================
   SIDEBAR — onboarding pattern (.sidebar / .nav-link)
   ============================================================ */

.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--hairline);
    display: flex;
    flex-direction: column;
    width: 260px;
    position: relative;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
}
.sidebar::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--iris-500) 0%, var(--teal-500) 100%);
    opacity: 0.85;
}

.sidebar .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 18px 16px;
    border-bottom: 1px solid var(--hairline-soft);
}
.sidebar .sidebar-brand-mark {
    width: 38px; height: 38px;
    border-radius: var(--r-lg);
    background: linear-gradient(135deg, var(--iris-500) 0%, var(--iris-400) 60%, var(--teal-500) 100%);
    display: grid; place-items: center;
    color: #fff;
    box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 4px 14px rgba(91,83,209,0.30);
}
.sidebar .sidebar-brand-text { display: flex; flex-direction: column; }
.sidebar .sidebar-brand-text .name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-1);
    letter-spacing: -0.2px;
    line-height: 1.2;
}
.sidebar .sidebar-brand-text .sub {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 1px;
}

.sidebar .sidebar-section {
    padding: 14px 18px 4px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--text-mute);
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 1px 8px;
    padding: 7px 12px;
    border-radius: var(--r-md);
    color: var(--ink-700);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--t-1), color var(--t-1);
    position: relative;
}
.sidebar .nav-link > svg { color: var(--ink-500); flex-shrink: 0; }
.sidebar .nav-link:hover {
    background: var(--surface-sunk);
    color: var(--ink-900);
}
.sidebar .nav-link:hover > svg { color: var(--ink-700); }
.sidebar .nav-link.active {
    background: linear-gradient(90deg, var(--iris-50) 0%, rgba(245,244,251,0.5) 100%);
    color: var(--iris-700);
    font-weight: 600;
}
.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: -8px; top: 5px; bottom: 5px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--iris-500);
}
.sidebar .nav-link.active > svg { color: var(--iris-600); }
.sidebar .nav-trail {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: var(--r-full);
    background: var(--iris-50);
    color: var(--iris-700);
    font-variant-numeric: tabular-nums;
}
.sidebar .nav-link.active .nav-trail { background: var(--iris-500); color: #fff; }

.sidebar .sidebar-footer {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid var(--hairline-soft);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar .sidebar-footer .who { flex: 1; min-width: 0; }
.sidebar .sidebar-footer .who .name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-1);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar .sidebar-footer .who .role {
    font-size: 11px;
    color: var(--text-3);
}
.sidebar .sidebar-footer .ico-btn {
    width: 30px; height: 30px;
    border-radius: var(--r-sm);
    border: 1px solid var(--hairline);
    background: var(--surface);
    color: var(--text-3);
    display: grid; place-items: center;
    cursor: pointer;
}
.sidebar .sidebar-footer .ico-btn:hover {
    background: var(--surface-sunk);
    color: var(--danger-700);
    border-color: rgba(220,38,38,0.3);
}

/* dark mode adjustments for new shell */
.mud-theme-dark .topbar { background: var(--surface); border-color: var(--hairline); }
.mud-theme-dark .topbar .search-box { background: var(--surface-2); border-color: var(--hairline); }
.mud-theme-dark .topbar .ico-btn { background: var(--surface); border-color: var(--hairline); color: var(--text-2); }
.mud-theme-dark .topbar .ico-btn:hover { background: var(--surface-sunk); color: var(--text-1); }
.mud-theme-dark .sidebar { background: var(--surface); border-color: var(--hairline); }
.mud-theme-dark .sidebar .nav-link { color: var(--text-2); }
.mud-theme-dark .sidebar .nav-link:hover { background: var(--surface-sunk); color: var(--text-1); }
.mud-theme-dark .sidebar .nav-link.active {
    background: rgba(91,83,209,0.18);
    color: var(--iris-300);
}
.mud-theme-dark .sidebar .nav-link.active > svg { color: var(--iris-300); }
.mud-theme-dark .sidebar .nav-trail { background: rgba(91,83,209,0.18); color: var(--iris-300); }

/* ============================================================
   TOPBAR — legacy (MudAppBar fallback, geri uyum)
   ============================================================ */

.crm-topbar {
    background: var(--surface) !important;
    border-bottom: 1px solid var(--hairline) !important;
    color: var(--text-1) !important;
    height: 52px;
    z-index: 1100;
    box-shadow: var(--sh-1);
}

.logo-area { display: flex; align-items: center; gap: 10px; }
.logo-area .logo-icon {
    background: linear-gradient(135deg, var(--iris-500) 0%, var(--iris-400) 100%);
    border-radius: var(--r-md);
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 2px 6px rgba(91, 83, 209, 0.30);
}
.logo-area .logo-text {
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--text-1);
}

.user-avatar-btn {
    border-radius: var(--r-md) !important;
    text-transform: none !important;
    padding: 4px 12px !important;
}

.signalr-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: var(--s-2);
}
.signalr-dot.connected {
    background: var(--success-500);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
    animation: pulse-dot 2s var(--ease) infinite;
}
.signalr-dot.disconnected { background: var(--ink-300); }

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }
    50%      { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.05); }
}

/* ============================================================
   SIDEBAR — LIGHT (modern, hairline, calm)
   ============================================================ */

.crm-sidebar {
    background: var(--surface);
    border-right: 1px solid var(--hairline);
    height: 100%;
    display: flex; flex-direction: column;
    position: relative;
}
.crm-sidebar::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--iris-500) 0%, var(--teal-500) 100%);
    opacity: 0.85;
}

.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 22px 20px 18px;
    border-bottom: 1px solid var(--hairline-soft);
    margin-bottom: 8px;
}
.sidebar-brand-icon {
    width: 40px; height: 40px;
    border-radius: var(--r-lg);
    background: linear-gradient(135deg, var(--iris-500) 0%, var(--iris-400) 60%, var(--teal-500) 100%);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.20) inset,
        0 6px 16px rgba(91, 83, 209, 0.35);
}
.sidebar-brand-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-1);
    letter-spacing: -0.2px;
}
.sidebar-brand-sub {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 2px;
}

.sidebar-section-header {
    padding: 16px 20px 6px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--text-mute);
}

.sidebar-nav .mud-nav-link {
    border-radius: var(--r-md);
    margin: 1px 10px;
    transition: background var(--t-1), color var(--t-1);
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--ink-700) !important;
    position: relative;
}
.sidebar-nav .mud-nav-link .mud-nav-link-icon {
    color: var(--ink-500) !important;
}
.sidebar-nav .mud-nav-link:hover {
    background: var(--surface-sunk) !important;
    color: var(--ink-900) !important;
}
.sidebar-nav .mud-nav-link:hover .mud-nav-link-icon {
    color: var(--ink-700) !important;
}
.sidebar-nav .mud-nav-link.active {
    background: linear-gradient(90deg, var(--iris-50) 0%, rgba(245, 244, 251, 0.5) 100%) !important;
    color: var(--iris-700) !important;
    font-weight: 600;
}
.sidebar-nav .mud-nav-link.active::before {
    content: '';
    position: absolute;
    left: -10px; top: 6px; bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--iris-500);
}
.sidebar-nav .mud-nav-link.active .mud-nav-link-icon {
    color: var(--iris-600) !important;
}

.sidebar-footer {
    margin-top: auto;
    padding: 14px;
    border-top: 1px solid var(--hairline-soft);
}
.sidebar-footer-user {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: var(--r-md);
    background: var(--surface-sunk);
}

/* ============================================================
   PAGE HEADER
   ============================================================ */

.page-header {
    margin-bottom: var(--s-6);
    padding: var(--s-2) 0 var(--s-5) var(--s-4);
    position: relative;
    border-bottom: 1px solid var(--hairline-soft);
}
.page-header::before {
    content: "";
    position: absolute;
    left: 0; top: 6px; bottom: 18px;
    width: 3px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--iris-500) 0%, var(--teal-500) 100%);
}

.page-header .page-title,
.page-header .ph-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-1);
    letter-spacing: -0.02em;
}

.page-header .page-desc,
.page-header .ph-desc {
    font-size: 0.875rem;
    color: var(--text-3);
    margin-top: 4px;
}

.page-header .page-actions,
.page-header .ph-actions {
    display: flex; align-items: center; gap: var(--s-3);
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn-primary-action,
.btn.btn-primary {
    background: linear-gradient(180deg, var(--iris-500) 0%, var(--iris-600) 100%) !important;
    color: #fff !important;
    border: none;
    border-radius: var(--r-md);
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: all var(--t-2);
    white-space: nowrap;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.22) inset,
        0 1px 2px rgba(63, 58, 147, 0.25),
        0 4px 10px -4px rgba(63, 58, 147, 0.35);
}
.btn-primary-action:hover,
.btn.btn-primary:hover {
    background: linear-gradient(180deg, var(--iris-400) 0%, var(--iris-500) 100%) !important;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.25) inset,
        0 2px 4px rgba(63, 58, 147, 0.30),
        0 6px 14px -4px rgba(63, 58, 147, 0.45);
    transform: translateY(-1px);
}
.btn-primary-action:active,
.btn.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost,
.btn.btn-ghost {
    background: transparent;
    color: var(--ink-700);
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: all var(--t-1);
}
.btn-ghost:hover,
.btn.btn-ghost:hover {
    background: var(--surface-sunk);
    color: var(--ink-900);
    border-color: var(--ink-300);
}

.btn.btn-secondary {
    background: var(--surface);
    color: var(--ink-800);
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: all var(--t-1);
}
.btn.btn-secondary:hover {
    background: var(--surface-sunk);
    border-color: var(--ink-300);
}

.btn.btn-danger {
    background: var(--surface);
    color: var(--danger-700);
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
}
.btn.btn-danger:hover { background: var(--danger-50); border-color: rgba(220,38,38,0.4); }

.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; gap: 5px; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 14px; }
.btn-icon { width: 34px; padding: 0; }

/* ============================================================
   COUNT BADGE
   ============================================================ */

.count-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-full);
    padding: 6px 14px;
    box-shadow: var(--sh-1);
}
.count-badge .count-num {
    color: var(--iris-700);
    font-weight: 800;
}

/* ============================================================
   FILTER TOOLBAR
   ============================================================ */

.filter-toolbar,
.filter-bar {
    display: flex; align-items: center; gap: var(--s-3);
    padding: var(--s-3) var(--s-5);
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    margin-bottom: var(--s-6);
    flex-wrap: wrap;
    box-shadow: var(--sh-1);
}

.filter-toolbar .mud-input-control { margin-bottom: 0 !important; }
.filter-toolbar .mud-select { margin-bottom: 0 !important; }
.filter-toolbar .mud-input-control-input-container { height: 40px; }
.filter-toolbar .mud-select .mud-input-slot { padding-top: 0; padding-bottom: 0; }
.filter-bar .filter-divider { width: 1px; height: 20px; background: var(--hairline); }

/* ============================================================
   CARDS
   ============================================================ */

.crm-card,
.card {
    border-radius: var(--r-xl) !important;
    border: 1px solid var(--hairline);
    background: var(--surface);
    box-shadow: var(--sh-1) !important;
    transition: border-color var(--t-2), box-shadow var(--t-2);
}
.crm-card:hover,
.card:hover {
    border-color: var(--ink-300);
    box-shadow: var(--sh-2) !important;
}

.card-header,
.section-card-header {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--hairline-soft);
}
.card-header .ch-title,
.section-card-header .section-title {
    font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
    color: var(--text-1);
    display: flex; align-items: center; gap: var(--s-2);
}
.card-header .ch-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }
.card-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--hairline-soft);
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    background: var(--surface-2);
}

.card.accent-iris   { border-top: 3px solid var(--iris-500); }
.card.accent-teal   { border-top: 3px solid var(--teal-500); }
.card.accent-violet { border-top: 3px solid var(--violet-500); }
.card.accent-amber  { border-top: 3px solid var(--amber-500); }

/* ============================================================
   STAT CARD / METRIC
   ============================================================ */

.stat-card,
.metric {
    border-radius: var(--r-xl) !important;
    border: 1px solid var(--hairline);
    padding: 18px;
    background: var(--surface);
    box-shadow: var(--sh-1) !important;
    transition: border-color var(--t-2), box-shadow var(--t-2);
    display: flex; flex-direction: column; gap: 10px;
}
.stat-card:hover,
.metric:hover {
    border-color: var(--ink-300);
    box-shadow: var(--sh-2) !important;
}
.metric:hover .m-value { color: var(--iris-700); transition: color var(--t-2); }

.stat-card .stat-icon,
.metric .m-icon {
    width: 28px; height: 28px;
    border-radius: 8px;
    display: grid; place-items: center;
    background: var(--iris-50);
    color: var(--iris-600);
    flex-shrink: 0;
}
.stat-card .stat-icon { width: 44px; height: 44px; border-radius: var(--r-lg); }
.metric .m-icon svg { width: 14px; height: 14px; }

.stat-card .stat-value,
.metric .m-value {
    font-weight: 600;
    font-size: 26px;
    line-height: 1.05;
    color: var(--text-1);
    letter-spacing: -0.025em;
    font-variant-numeric: tabular-nums;
}
.stat-card .stat-value { font-size: 1.6rem; line-height: 1; letter-spacing: -0.5px; }

.stat-card .stat-label,
.metric .m-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: -0.005em;
}
.stat-card .stat-label { font-size: 0.75rem; margin-top: 4px; }

.metric .m-top {
    display: flex; justify-content: space-between; align-items: center;
}
.metric .m-foot {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text-muted);
}
.metric .delta {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 12px; font-weight: 500;
    padding: 1px 6px; border-radius: var(--r-full);
}
.metric .delta.up { background: var(--success-50); color: var(--success-700); }
.metric .delta.down { background: var(--danger-50); color: var(--danger-700); }

.metric:nth-of-type(4n+2) .m-icon { background: var(--teal-50); color: var(--teal-600); }
.metric:nth-of-type(4n+3) .m-icon { background: var(--violet-50); color: var(--violet-600); }
.metric:nth-of-type(4n+4) .m-icon { background: var(--amber-50); color: var(--amber-700); }

.stat-card.accent-iris    { border-left: 3px solid var(--iris-500); }
.stat-card.accent-brand   { border-left: 3px solid var(--iris-500); }
.stat-card.accent-teal    { border-left: 3px solid var(--teal-500); }
.stat-card.accent-violet  { border-left: 3px solid var(--violet-500); }
.stat-card.accent-info    { border-left: 3px solid var(--info-600); }
.stat-card.accent-amber   { border-left: 3px solid var(--amber-500); }
.stat-card.accent-success { border-left: 3px solid var(--success-600); }
.stat-card.accent-danger  { border-left: 3px solid var(--danger-600); }
.stat-card.accent-green { border-left: 3px solid var(--iris-500); }
.stat-card.accent-blue  { border-left: 3px solid var(--info-600); }

/* ============================================================
   SECTION CARD
   ============================================================ */

.section-card {
    border-radius: var(--r-xl) !important;
    border: 1px solid var(--hairline);
    background: var(--surface);
    box-shadow: var(--sh-1) !important;
    overflow: hidden;
}

/* ============================================================
   TABLE
   ============================================================ */

.crm-table .mud-table-head .mud-table-cell,
.table thead th {
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: var(--surface-2);
    border-bottom: 1px solid var(--hairline);
    padding: 10px 16px;
}

.crm-table .mud-table-body .mud-table-cell,
.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--hairline-soft);
    color: var(--text-1);
    font-size: 13.5px;
}

.crm-table .mud-table-body tr:hover,
.table tbody tr:hover {
    background: var(--iris-50) !important;
    transition: background var(--t-1);
}

.mud-table-dense .mud-table-cell {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table .cell-strong { font-weight: 500; color: var(--text-1); }
.table .cell-muted { color: var(--text-muted); }
.table .cell-mono { font-family: var(--font-mono); font-size: 13px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ============================================================
   TABS
   ============================================================ */

.crm-tabs {
    border: 1px solid var(--hairline);
    border-radius: var(--r-xl) !important;
    overflow: hidden;
    background: var(--surface);
}
.crm-tabs .mud-tabs-toolbar {
    border-bottom: 1px solid var(--iris-700);
    background: linear-gradient(135deg, var(--iris-700) 0%, var(--iris-600) 100%) !important;
}
.crm-tabs .mud-tab {
    text-transform: none !important;
    font-weight: 600;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.72) !important;
    transition: color var(--t-1), background var(--t-1);
}
.crm-tabs .mud-tab:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08) !important;
}
.crm-tabs .mud-tab .mud-icon-default,
.crm-tabs .mud-tab .mud-icon-root {
    color: rgba(255, 255, 255, 0.72) !important;
}
.crm-tabs .mud-tab.mud-tab-active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.10) !important;
}
.crm-tabs .mud-tab.mud-tab-active .mud-icon-default,
.crm-tabs .mud-tab.mud-tab-active .mud-icon-root {
    color: #fff !important;
}
.crm-tabs .mud-tabs-toolbar .mud-tab-slider {
    background: #fff !important;
    height: 3px !important;
}

.tabs {
    display: flex; gap: 2px;
    border-bottom: 1px solid var(--hairline);
    margin-bottom: 20px;
}
.tab {
    padding: 10px 14px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color var(--t-1), border-color var(--t-1);
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--text-1); }
.tab.active { color: var(--iris-700); border-bottom-color: var(--iris-500); }
.tab .tab-count {
    font-size: 11px; padding: 1px 6px; border-radius: var(--r-full);
    background: var(--surface-sunk); color: var(--text-muted);
}

/* ============================================================
   STATUS PILLS
   ============================================================ */

.status-pill,
.pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 8px;
    border-radius: var(--r-full);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: -0.005em;
    white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill svg { width: 11px; height: 11px; stroke-width: 2.5; }

.status-pill.brand,    .pill.pill-iris    { background: rgba(91, 83, 209, 0.10); color: var(--iris-700); border: 1px solid rgba(91, 83, 209, 0.18); }
.status-pill.teal,     .pill.pill-teal    { background: rgba(13, 148, 136, 0.10); color: var(--teal-700); border: 1px solid rgba(13, 148, 136, 0.20); }
.status-pill.geciken,  .pill.pill-danger  { background: rgba(220, 38, 38, 0.10); color: var(--danger-700); border: 1px solid rgba(220, 38, 38, 0.20); }
.status-pill.bugun,    .pill.pill-warn    { background: rgba(245, 158, 11, 0.12); color: var(--amber-700); border: 1px solid rgba(245, 158, 11, 0.24); }
.status-pill.bekleyen                     { background: rgba(245, 158, 11, 0.10); color: var(--amber-600); border: 1px solid rgba(245, 158, 11, 0.18); }
.status-pill.tamam,    .pill.pill-success { background: rgba(34, 197, 94, 0.10); color: var(--success-700); border: 1px solid rgba(34, 197, 94, 0.22); }
.status-pill.bilgi,    .pill.pill-info    { background: rgba(59, 130, 246, 0.10); color: var(--info-700); border: 1px solid rgba(59, 130, 246, 0.20); }
.status-pill.notr,     .pill.pill-ghost   { background: var(--surface-sunk); color: var(--ink-700); border: 1px solid var(--hairline); }

/* ============================================================
   CHIP
   ============================================================ */

.chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: var(--r-full);
    background: var(--surface-sunk); color: var(--ink-700);
    font-size: 12px; font-weight: 500;
    border: 1px solid var(--hairline);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state,
.empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: var(--s-16) var(--s-5);
    text-align: center;
    color: var(--text-3);
}
.empty-state .empty-icon,
.empty .empty-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-mute);
    color: var(--text-mute);
    margin-bottom: var(--s-4);
}
.empty-state .empty-title,
.empty .em-title {
    font-size: 16px; font-weight: 700;
    color: var(--text-2); margin-bottom: 6px;
}
.empty-state .empty-desc {
    font-size: 13px;
    color: var(--text-3);
}

/* ============================================================
   INFO TABLE
   ============================================================ */

.info-table td.info-label {
    width: 160px;
    font-weight: 600;
    color: var(--text-3);
    font-size: 0.82rem;
}
.info-table td {
    border-bottom: 1px solid var(--hairline-soft) !important;
    padding: 10px 12px !important;
    color: var(--text-1);
}

/* ============================================================
   NOTIFICATIONS
   ============================================================ */

.notification-card {
    transition: box-shadow var(--t-2), background var(--t-1);
    border-radius: var(--r-lg);
}
.notification-card:hover { box-shadow: var(--sh-2) !important; }
.notification-unread {
    background: var(--iris-50);
    border-left: 3px solid var(--iris-500);
}
.notification-read { opacity: 0.78; }
.notification-read:hover { opacity: 1; }

/* ============================================================
   QUICK BUTTONS
   ============================================================ */

.quick-btn {
    border-radius: var(--r-lg) !important;
    padding: var(--s-4) !important;
    text-transform: none !important;
    font-weight: 600 !important;
}

/* ============================================================
   DIALOGS
   ============================================================ */

.mud-dialog {
    border-radius: var(--r-2xl) !important;
    box-shadow: var(--sh-pop) !important;
}
.mud-dialog .mud-dialog-title {
    padding: 18px 20px;
    border-bottom: 1px solid var(--hairline-soft);
    font-weight: 700;
}
.mud-dialog .mud-dialog-content { padding: 20px !important; }
.mud-dialog .mud-dialog-actions {
    padding: 14px 20px;
    border-top: 1px solid var(--hairline-soft);
    background: var(--surface-2);
}

/* ============================================================
   FORM
   ============================================================ */

.form-section { margin-bottom: var(--s-5); }
.form-section-title {
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-3);
    margin-bottom: var(--s-3);
    padding-bottom: var(--s-2);
    border-bottom: 1px solid var(--hairline-soft);
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12.5px; font-weight: 500; color: var(--ink-700); }
.field-hint { font-size: 12px; color: var(--text-muted); }
.input, .select, .textarea {
    height: 36px; padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--hairline);
    background: var(--surface);
    color: var(--text-1);
    font-size: 13.5px;
    transition: border-color var(--t-1), box-shadow var(--t-1);
    width: 100%;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; }
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-300); }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--iris-500);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.input-group { position: relative; display: flex; align-items: center; }
.input-group > svg {
    position: absolute; left: 11px;
    width: 15px; height: 15px;
    color: var(--text-subtle); pointer-events: none;
}
.input-group .input { padding-left: 34px; }

/* ============================================================
   SEGMENTED / SWITCH
   ============================================================ */

.segmented {
    display: inline-flex; padding: 3px; gap: 2px;
    background: var(--surface-sunk);
    border: 1px solid var(--hairline);
    border-radius: 8px;
}
.segmented .seg {
    padding: 4px 12px;
    font-size: 12.5px; font-weight: 500;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--t-1), color var(--t-1);
}
.segmented .seg:hover { color: var(--text-1); }
.segmented .seg.active { background: var(--iris-500); color: white; }

.switch {
    width: 32px; height: 18px;
    background: var(--ink-300);
    border-radius: var(--r-full);
    position: relative;
    cursor: pointer;
    transition: background var(--t-1);
    flex-shrink: 0;
}
.switch::after {
    content: '';
    position: absolute; top: 2px; left: 2px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: white;
    transition: left var(--t-2);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}
.switch.on { background: var(--iris-500); }
.switch.on::after { left: 16px; }

/* ============================================================
   MUD CHIP
   ============================================================ */

.mud-chip { font-weight: 600; letter-spacing: 0.01em; }
.mud-chip.mud-chip-size-small { height: 24px; font-size: 0.72rem; }

/* ============================================================
   CONVERSION
   ============================================================ */

.conversion-big {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -1.2px;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   PROGRESS
   ============================================================ */

.progress {
    height: 6px; background: var(--surface-sunk);
    border-radius: var(--r-full); overflow: hidden;
}
.progress > .bar {
    height: 100%;
    background: linear-gradient(90deg, var(--iris-500) 0%, var(--teal-500) 100%);
    border-radius: var(--r-full);
    transition: width var(--t-3);
}
.progress.amber > .bar { background: linear-gradient(90deg, var(--amber-500) 0%, var(--danger-500) 100%); }
.progress.success > .bar { background: linear-gradient(90deg, var(--success-500) 0%, var(--teal-500) 100%); }
.progress.danger > .bar { background: var(--danger-500); }

/* ============================================================
   ALERT
   ============================================================ */

.mud-alert { border-radius: var(--r-md) !important; }

/* ============================================================
   BREADCRUMBS
   ============================================================ */

.mud-breadcrumbs { min-height: auto; }

/* ============================================================
   AVATAR (utility)
   ============================================================ */

.avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--iris-100);
    color: var(--iris-700);
    display: grid; place-items: center;
    font-size: 11.5px; font-weight: 600;
    flex-shrink: 0;
}
.avatar.lg { width: 36px; height: 36px; font-size: 13px; }
.avatar.xl { width: 48px; height: 48px; font-size: 16px; }
.avatar[data-tone="teal"]    { background: var(--teal-100);    color: var(--teal-700); }
.avatar[data-tone="violet"]  { background: var(--violet-100);  color: var(--violet-700); }
.avatar[data-tone="amber"]   { background: var(--amber-100);   color: var(--amber-700); }
.avatar[data-tone="success"] { background: var(--success-100); color: var(--success-700); }

/* ============================================================
   KBD
   ============================================================ */

kbd, .kbd {
    font-family: var(--font-mono); font-size: 11px;
    border: 1px solid var(--hairline); border-bottom-width: 2px;
    border-radius: 4px; padding: 1px 5px;
    background: var(--surface); color: var(--text-muted);
}

/* ============================================================
   LOGIN
   ============================================================ */

.login-container,
.login-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    background: var(--bg);
}

.login-brand-panel,
.login-panel.brand {
    flex: 1.1;
    background:
        radial-gradient(120% 80% at 0% 0%, rgba(91, 83, 209, 0.18) 0%, transparent 50%),
        radial-gradient(80% 60% at 100% 100%, rgba(13, 148, 136, 0.10) 0%, transparent 60%),
        var(--ink-50);
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    padding: 48px 64px;
    position: relative;
    overflow: hidden;
    color: var(--text-1);
}
.brand-content {
    position: relative; z-index: 1;
    text-align: center;
    max-width: 420px;
}
.brand-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(to right, rgba(47, 45, 42, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(47, 45, 42, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(60% 60% at 30% 40%, black, transparent 70%);
    -webkit-mask-image: radial-gradient(60% 60% at 30% 40%, black, transparent 70%);
    pointer-events: none;
}
.brand-logo-circle {
    width: 88px; height: 88px;
    border-radius: 50%;
    background: var(--iris-500);
    border: 2px solid var(--iris-300);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto var(--s-5);
    box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 8px 24px rgba(91, 83, 209, 0.40);
    color: #fff;
}
.brand-features {
    margin-top: var(--s-12);
    text-align: left;
}
.brand-feature-item {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 0;
    color: var(--ink-700);
    font-size: 14px;
}
.brand-feature-icon {
    width: 38px; height: 38px;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--hairline);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--iris-600);
}

.login-form-panel,
.login-panel:not(.brand) {
    flex: 0 0 480px;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    padding: 48px;
    background: var(--surface);
}
.login-form-wrapper,
.login-form {
    width: 100%;
    max-width: 380px;
}
.login-form-header { margin-bottom: 36px; }
.login-btn {
    height: 48px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: var(--r-md) !important;
    background: linear-gradient(180deg, var(--iris-500) 0%, var(--iris-600) 100%) !important;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.22) inset,
        0 1px 2px rgba(63, 58, 147, 0.30),
        0 4px 14px -4px rgba(63, 58, 147, 0.40) !important;
}
.login-btn:hover {
    box-shadow:
        0 1px 0 rgba(255,255,255,0.25) inset,
        0 2px 4px rgba(63, 58, 147, 0.35),
        0 6px 18px -4px rgba(63, 58, 147, 0.45) !important;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--hairline);
    border-radius: var(--r-full);
    border: 3px solid var(--surface);
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-300); }

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   UTILITIES
   ============================================================ */

.row { display: flex; align-items: center; }
.row.gap-1 { gap: 4px; } .row.gap-2 { gap: 8px; } .row.gap-3 { gap: 12px; } .row.gap-4 { gap: 16px; } .row.gap-6 { gap: 24px; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.center { align-items: center; justify-content: center; }
.start { align-items: flex-start; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) { .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr; } }

.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.hide { display: none !important; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 960px) {
    .login-container, .login-shell { flex-direction: column; }
    .login-brand-panel, .login-panel.brand {
        flex: none; padding: 32px 20px; min-height: auto;
    }
    .brand-features { display: none; }
    .login-form-panel, .login-panel:not(.brand) { flex: 1; padding: 32px 20px; }
    .brand-logo-circle { width: 64px; height: 64px; margin-bottom: var(--s-4); }
    .page-header .page-title { font-size: 1.25rem; }
    .filter-toolbar { padding: var(--s-3); }
}

/* ============================================================
   DARK MODE
   ============================================================ */

.mud-theme-dark {
    --bg:           #1A1916;
    --surface:      #232220;
    --surface-2:    #2C2B28;
    --surface-mute: #2C2B28;
    --surface-sunk: #2C2B28;
    --hairline:     #3A3936;
    --hairline-soft: #2F2E2C;
    --border:       #3A3936;
    --border-soft:  #2F2E2C;
    --text:         #F2F2EF;
    --text-1:       #F2F2EF;
    --text-2:       #B5B4B0;
    --text-3:       #8A8983;
    --text-mute:    #61605B;
    --text-muted:   #B5B4B0;
    --text-subtle:  #8A8983;
}

.mud-theme-dark .crm-topbar {
    background: var(--surface) !important;
    border-color: var(--hairline) !important;
}
.mud-theme-dark .crm-sidebar {
    background: var(--surface);
    border-color: var(--hairline);
}
.mud-theme-dark .crm-sidebar::before { opacity: 0.95; }
.mud-theme-dark .sidebar-nav .mud-nav-link {
    color: var(--text-2) !important;
}
.mud-theme-dark .sidebar-nav .mud-nav-link:hover {
    background: var(--surface-sunk) !important;
    color: var(--text-1) !important;
}
.mud-theme-dark .sidebar-nav .mud-nav-link.active {
    background: rgba(91, 83, 209, 0.18) !important;
    color: var(--iris-300) !important;
}
.mud-theme-dark .sidebar-nav .mud-nav-link.active .mud-nav-link-icon {
    color: var(--iris-300) !important;
}
.mud-theme-dark .crm-card,
.mud-theme-dark .stat-card,
.mud-theme-dark .metric,
.mud-theme-dark .section-card,
.mud-theme-dark .filter-toolbar,
.mud-theme-dark .filter-bar,
.mud-theme-dark .card {
    background: var(--surface);
    border-color: var(--hairline);
}
.mud-theme-dark .crm-table .mud-table-head .mud-table-cell {
    background: var(--surface-2);
    border-color: var(--hairline);
}
.mud-theme-dark .crm-table .mud-table-body tr:hover {
    background: rgba(91, 83, 209, 0.10) !important;
}
.mud-theme-dark .status-pill.brand    { background: rgba(91, 83, 209, 0.18); color: #B5B0E5; }
.mud-theme-dark .status-pill.teal     { background: rgba(20, 184, 166, 0.18); color: var(--teal-300); }
.mud-theme-dark .status-pill.geciken  { background: rgba(239, 68, 68, 0.18); color: #FCA5A5; }
.mud-theme-dark .status-pill.bugun    { background: rgba(245, 158, 11, 0.18); color: #FCD34D; }
.mud-theme-dark .status-pill.bekleyen { background: rgba(245, 158, 11, 0.14); color: #FBBF24; }
.mud-theme-dark .status-pill.tamam    { background: rgba(34, 197, 94, 0.18); color: #86EFAC; }
.mud-theme-dark .status-pill.bilgi    { background: rgba(59, 130, 246, 0.18); color: #93C5FD; }
.mud-theme-dark .status-pill.notr     { background: rgba(255, 255, 255, 0.06); color: var(--text-2); }
.mud-theme-dark ::-webkit-scrollbar-thumb { background: var(--hairline); }

/* ============================================================
   SAHA AKTIVITE HARITASI (Bolgeler.razor)
   ============================================================ */

.saha-kpi-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}
@media (max-width: 1200px) { .saha-kpi-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .saha-kpi-row { grid-template-columns: repeat(2, 1fr); } }

.saha-kpi-card {
    padding: 18px 20px;
    border-radius: var(--r-xl);
    color: #fff;
    transition: transform var(--t-2), box-shadow var(--t-2);
    position: relative;
    overflow: hidden;
    box-shadow: var(--sh-2);
}
.saha-kpi-card::before {
    content: '';
    position: absolute;
    top: -24px; right: -24px;
    width: 96px; height: 96px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.10);
}
.saha-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sh-3);
}

.saha-kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}
.saha-kpi-top .mud-icon-root { opacity: 0.9; color: #fff !important; }

.saha-kpi-value {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
    font-variant-numeric: tabular-nums;
}
.saha-kpi-value-sm { font-size: 1rem; line-height: 1.2; }

.saha-kpi-label {
    font-size: 0.74rem;
    font-weight: 500;
    opacity: 0.88;
    letter-spacing: 0.4px;
    position: relative;
    z-index: 1;
    text-transform: uppercase;
}

/* Iris-aligned KPI variants */
.saha-kpi-green   { background: linear-gradient(135deg, var(--iris-500), var(--iris-600)); }
.saha-kpi-blue    { background: linear-gradient(135deg, var(--iris-400), var(--iris-700)); }
.saha-kpi-orange  { background: linear-gradient(135deg, var(--amber-500), var(--amber-700)); }
.saha-kpi-emerald { background: linear-gradient(135deg, var(--teal-500), var(--teal-700)); }
.saha-kpi-purple  { background: linear-gradient(135deg, var(--violet-500), var(--violet-700)); }
.saha-kpi-teal    { background: linear-gradient(135deg, var(--teal-300), var(--teal-600)); }

.saha-filter-bar {
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--hairline);
    background: var(--surface-mute);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.saha-filter-bar .mud-input-outlined .mud-input-outlined-border { border-radius: var(--r-md); }

.saha-detail-panel {
    width: 340px;
    min-width: 340px;
    max-height: 620px;
    overflow-y: auto;
    padding: 18px;
    border-left: 1px solid var(--hairline);
    background: var(--surface);
}

.detail-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.detail-stat {
    background: var(--surface-mute);
    border: 1px solid var(--hairline-soft);
    border-radius: var(--r-md);
    padding: 12px 8px;
    text-align: center;
    transition: border-color var(--t-1);
}
.detail-stat:hover { border-color: var(--iris-300); }
.detail-stat-icon { color: var(--text-3); margin-bottom: 4px; }
.detail-stat-value {
    font-size: 1.2rem; font-weight: 700;
    color: var(--text-1); line-height: 1.2;
    letter-spacing: -0.3px;
    font-variant-numeric: tabular-nums;
}
.detail-stat-label {
    font-size: 0.62rem; color: var(--text-3);
    margin-top: 2px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.4px;
}

.detail-section-title {
    font-size: 0.72rem; font-weight: 700;
    color: var(--text-3);
    margin-top: 16px; margin-bottom: 8px;
    text-transform: uppercase; letter-spacing: 0.5px;
}

.saha-map-loading {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(251, 251, 250, 0.92);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 1000;
    border-radius: 0 0 var(--r-xl) var(--r-xl);
    backdrop-filter: blur(2px);
}

.saha-drilldown-banner {
    position: absolute;
    top: 12px; left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    box-shadow: var(--sh-3);
    padding: 8px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 900;
    font-size: 0.85rem;
    color: var(--text-1);
}

.saha-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.4;
}
.saha-badge-green   { background: var(--iris-50);    color: var(--iris-700); }
.saha-badge-blue    { background: var(--info-50);    color: var(--info-700); }
.saha-badge-success { background: var(--success-50); color: var(--success-700); border: 1px solid rgba(22, 163, 74, 0.2); }

.ilce-label {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--text-1) !important;
    font-weight: 600;
}
.saha-legend { pointer-events: auto; }

.mud-theme-dark .saha-kpi-card { opacity: 0.95; }
.mud-theme-dark .saha-detail-panel { background: var(--surface); border-color: var(--hairline); }
.mud-theme-dark .detail-stat { background: rgba(255, 255, 255, 0.03); border-color: var(--hairline); }
.mud-theme-dark .saha-map-loading { background: rgba(26, 25, 22, 0.88); }
.mud-theme-dark .saha-drilldown-banner { background: var(--surface); color: var(--text-1); }
.mud-theme-dark .saha-filter-bar { background: var(--surface-mute); border-color: var(--hairline); }
.mud-theme-dark .saha-badge-green   { background: rgba(91, 83, 209, 0.20); color: #B5B0E5; }
.mud-theme-dark .saha-badge-blue    { background: rgba(59, 130, 246, 0.20); color: #93C5FD; }
.mud-theme-dark .saha-badge-success { background: rgba(34, 197, 94, 0.18); color: #86EFAC; border-color: rgba(34, 197, 94, 0.25); }
