/* ===================================================
   EK ÖDEME HESAPLAMAGISistemi v9.0 - Stabilized Premium
   Mobile-first, Glassmorphism, Animated
   =================================================== */

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

/* ─── CSS Variables ─────────────────────────────── */
:root {
    /* Core palette */
    --primary: #7C3AED;
    --primary-2: #6D28D9;
    --accent: #06B6D4;
    --danger: #F43F5E;
    --success: #10B981;
    --warn: #F59E0B;

    /* Backgrounds */
    --bg: #0F172A;
    --bg-2: #1E293B;
    --bg-glass: rgba(30, 41, 59, 0.6);
    --bg-card: rgba(30, 41, 59, 0.8);

    /* Text */
    --text: #F1F5F9;
    --text-muted: #94A3B8;
    --text-dim: #64748B;

    /* Borders */
    --border: rgba(148, 163, 184, 0.12);
    --border-h: rgba(124, 58, 237, 0.4);

    /* Gradients */
    --grad-primary: linear-gradient(135deg, #7C3AED 0%, #06B6D4 100%);
    --grad-warm: linear-gradient(135deg, #F43F5E 0%, #F59E0B 100%);
    --grad-cool: linear-gradient(135deg, #10B981 0%, #06B6D4 100%);
    --grad-purple: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    --grad-bg-body: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 58, 237, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 50% 30% at 80% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
    --grad-bg: linear-gradient(135deg, #0F172A 0%, #1E1B4B 50%, #0F172A 100%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.35);
    --shadow-accent: 0 0 20px rgba(6, 182, 212, 0.25);

    /* Backgrounds for specific components */
    --bg-progress: #1e293b;
    --bg-icon-muted: rgba(255, 255, 255, 0.05);

    /* Icon Variable Defaults (Dark) */
    --icon-purple-bg: rgba(124, 58, 237, 0.2);
    --icon-purple-txt: #A78BFA;
    --icon-cyan-bg: rgba(6, 182, 212, 0.2);
    --icon-cyan-txt: #67E8F9;
    --icon-green-bg: rgba(16, 185, 129, 0.2);
    --icon-green-txt: #6EE7B7;
    --icon-amber-bg: rgba(245, 158, 11, 0.2);
    --icon-amber-txt: #FCD34D;
    --icon-rose-bg: rgba(244, 63, 94, 0.2);
    --icon-rose-txt: #FDA4AF;


    /* Transitions */
    --t-fast: 0.15s ease;
    --t-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --t-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Radii */
    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 28px;
    --r-full: 9999px;

    /* Header height */
    --header-h: 68px;
    --nav-h: 72px;
}

/* ─── Light Theme Variables ─────────────────────── */
[data-theme="light"] {
    --bg: #F8FAFC;
    --bg-2: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-card: rgba(255, 255, 255, 1);

    --text: #0F172A;
    --text-muted: #1e293b; /* Darker for accessibility per user request */
    --text-dim: #475569;   /* Darker for accessibility */

    --border: rgba(15, 23, 42, 0.08);
    --border-h: rgba(124, 58, 237, 0.4);

    --grad-bg-body: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 58, 237, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse 50% 30% at 80% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
    --grad-bg: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);

    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
}

/* ─── Global Animations ────────────────────────── */
.animate-in {
    animation: fadeUp 0.4s ease both;
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

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

/* ─── Layout Fixes ─────────────────────────────── */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block !important;
}

/* ─── Barkovizyon Theme Variables (Barkovizyon Modu - Yeni Nesil Neon) ── */
[data-theme="barkovizyon"] {
    --bg: #0F172A;
    --bg-2: #1E293B;
    --bg-glass: rgba(15, 23, 42, 0.9);
    --bg-card: #1E293B;

    --text: #FFFFFF;
    --text-muted: #CBD5E1; 
    --text-dim: #94A3B8;

    --primary: #CCFF00; /* Neon Sarı */
    --primary-2: #A3CC00;
    --accent: #00FFFF;  /* Parlak Siyan */
    
    --border: rgba(204, 255, 0, 0.4);
    --border-h: #CCFF00;

    --grad-bg-body: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(204, 255, 0, 0.15) 0%, transparent 60%);
    --grad-bg: linear-gradient(135deg, #0F172A 0%, #1E1B4B 50%, #0F172A 100%);

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 15px rgba(204, 255, 0, 0.3);
    --shadow-accent: 0 0 15px rgba(0, 255, 255, 0.3);

    --bg-progress: #334155;
    --bg-icon-muted: rgba(255, 255, 255, 0.1);

    /* Icon Variable Overrides (Neon Contrast) */
    --icon-purple-bg: rgba(204, 255, 0, 0.2);
    --icon-purple-txt: #CCFF00;
    --icon-cyan-bg: rgba(0, 255, 255, 0.2);
    --icon-cyan-txt: #00FFFF;
    --icon-green-bg: rgba(16, 185, 129, 0.2);
    --icon-green-txt: #10B981;
    --icon-amber-bg: rgba(245, 158, 11, 0.2);
    --icon-amber-txt: #F59E0B;
    --icon-rose-bg: rgba(244, 63, 94, 0.2);
    --icon-rose-txt: #F43F5E;
}

[data-theme="barkovizyon"] .card, 
[data-theme="barkovizyon"] .metric-card {
    border: 1px solid rgba(204, 255, 0, 0.3) !important;
    background: var(--bg-card) !important;
    box-shadow: var(--shadow-md) !important;
}

[data-theme="barkovizyon"] .card:hover,
[data-theme="barkovizyon"] .metric-card:hover {
    border-color: #CCFF00 !important;
    box-shadow: var(--shadow-glow) !important;
}

[data-theme="barkovizyon"] .btn-primary {
    background: #CCFF00 !important;
    color: #000000 !important;
    border: none !important;
    box-shadow: 0 0 15px rgba(204, 255, 0, 0.4) !important;
}

[data-theme="barkovizyon"] .btn-ghost,
[data-theme="barkovizyon"] .btn-outline {
    border: 1.5px solid #CCFF00 !important;
    color: #CCFF00 !important;
    background: transparent !important;
}

[data-theme="barkovizyon"] .nav-link.active {
    background: #CCFF00 !important;
    color: #000000 !important;
    box-shadow: 0 0 15px rgba(204, 255, 0, 0.4);
}

[data-theme="barkovizyon"] .gradient-text {
    background: none !important;
    -webkit-text-fill-color: #CCFF00 !important;
    color: #CCFF00 !important;
    font-weight: 900;
}

[data-theme="barkovizyon"] table th {
    background: #CCFF00 !important;
    color: #000000 !important;
}

[data-theme="barkovizyon"] .metric-value {
    color: #CCFF00 !important;
    text-shadow: 0 0 10px rgba(204, 255, 0, 0.3);
}

[data-theme="barkovizyon"] .header {
    border-bottom: 2px solid #CCFF00 !important;
}

[data-theme="light"] .btn-ghost {
    background: rgba(15, 23, 42, 0.05);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="light"] .btn-ghost:hover {
    background: rgba(15, 23, 42, 0.1);
}

/* ─── Reset & Base ───────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: var(--grad-bg-body);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* ─── Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-2);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

/* ─── Typography ─────────────────────────────────── */
h1 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.25rem;
}

h2 {
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
}

h3 {
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.gradient-text {
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Header ─────────────────────────────────────── */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    height: var(--header-h);
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    padding: 0 2rem;
    transition: var(--t-base);
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .header {
        padding: 0 1rem;
    }

    .logo span {
        font-size: 0.95rem;
    }

    .logo-icon {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
}

.header.scrolled {
    height: 58px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.logo {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: auto;
}

.logo-icon {
    width: 34px;
    height: 34px;
    background: var(--grad-primary);
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 0.9rem;
}

/* ─── Navigation ─────────────────────────────────── */
.nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    padding: 0.35rem;
    flex-shrink: 0;
    margin-right: 1.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--r-full);
    transition: var(--t-base);
    white-space: nowrap;
}

.nav-link i {
    font-size: 0.8rem;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.07);
}

.nav-link.active {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 0 14px rgba(124, 58, 237, 0.45);
}

/* User zone */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--grad-primary);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}

.btn-logout {
    background: rgba(244, 63, 94, 0.15);
    color: var(--danger);
    border: 1px solid rgba(244, 63, 94, 0.25);
    padding: 0.45rem 0.9rem;
    border-radius: var(--r-full);
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.8rem;
    transition: var(--t-base);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-logout:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 0 16px rgba(244, 63, 94, 0.4);
}

/* ─── Bottom Navigation (Mobile) ─────────────────── */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(24px);
    border-top: 1px solid var(--border);
    padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom));
    justify-content: space-around;
    align-items: center;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.5rem 1rem;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 500;
    border-radius: var(--r-md);
    transition: var(--t-base);
    min-width: 52px;
}

.bottom-nav-item i {
    font-size: 1.1rem;
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item.active i {
    filter: drop-shadow(0 0 6px var(--primary));
}

/* ─── Main Layout ────────────────────────────────── */
main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 991px) {
    main {
        padding: 1.25rem;
    }
}

@media (max-width: 576px) {
    main {
        padding: 0.75rem;
    }
}

/* ─── Glass Card ─────────────────────────────────── */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--t-base);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--r-lg);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 60%);
    pointer-events: none;
}

.card:hover {
    border-color: var(--border-h);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.card.clickable {
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.card.clickable:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 12px 40px -10px rgba(0, 0, 0, 0.5);
    border-color: var(--primary);
}

.card.clickable:active {
    transform: translateY(-2px) scale(1);
}

/* ─── Priority Dashboard Grid ────────────────────── */
/* P1 — Full width action (highest importance) */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.25rem;
}

.col-12 {
    grid-column: span 12;
}

.col-8 {
    grid-column: span 8;
}

.col-4 {
    grid-column: span 4;
}

.col-6 {
    grid-column: span 6;
}

.col-3 {
    grid-column: span 3;
}

/* ─── Responsive Grid ───────────────────────────── */
.grid-res {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.25rem;
}

@media (max-width: 1024px) {
    .grid-res {
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .grid-res>[class*="col-"] {
        grid-column: span 12 !important;
    }

    .grid-res {
        gap: 0.85rem;
    }
}

.chart-container {
    position: relative;
    width: 100%;
    height: 480px;
}

@media (max-width: 768px) {
    .chart-container {
        height: 320px;
    }
}

/* ─── Metric Cards ───────────────────────────────── */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.4rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    transition: var(--t-base);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-grad, var(--grad-primary));
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--t-slow);
}

.metric-card:hover::after {
    transform: scaleX(1);
}

.metric-card:hover {
    border-color: var(--border-h);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.metric-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--r-md);
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.metric-body {
    flex: 1;
}

.metric-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.metric-value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    margin-bottom: 0.35rem;
    word-break: break-all;
}

@media (max-width: 480px) {
    .metric-value {
        font-size: 1.4rem;
    }

    .metric-card {
        padding: 1.1rem;
    }
}

.metric-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: var(--r-full);
}

.badge-up {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge-down {
    background: rgba(244, 63, 94, 0.15);
    color: var(--danger);
}

.badge-neu {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
}

/* Icon color variants (Theme-aware) */
.icon-purple { background: var(--icon-purple-bg); color: var(--icon-purple-txt); }
.icon-cyan   { background: var(--icon-cyan-bg);   color: var(--icon-cyan-txt);   }
.icon-green, .icon-emerald { background: var(--icon-green-bg);  color: var(--icon-green-txt);  }
.icon-amber  { background: var(--icon-amber-bg);  color: var(--icon-amber-txt);  }
.icon-rose   { background: var(--icon-rose-bg);   color: var(--icon-rose-txt);   }

/* ─── Priority Action Banner ─────────────────────── */
.action-banner {
    background: var(--grad-primary);
    border-radius: var(--r-xl);
    padding: 2rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.action-banner::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 50%;
}

.action-banner::after {
    content: '';
    position: absolute;
    bottom: -60%;
    right: 15%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.action-banner-text h2 {
    font-size: 1.4rem;
    color: white;
    margin-bottom: 0.35rem;
}

.action-banner-text p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
}

.action-banner-cta {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
    z-index: 1;
}

/* ─── Buttons ────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.4rem;
    border-radius: var(--r-full);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--t-base);
    border: none;
    text-decoration: none;
    white-space: nowrap;
    min-height: 44px;
}

.btn-primary {
    background: var(--grad-primary);
    color: white;
    box-shadow: 0 0 0 rgba(124, 58, 237, 0);
}

.btn-primary:hover {
    transform: scale(1.04);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.5);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border-h);
}

.btn-outline:hover {
    background: rgba(124, 58, 237, 0.1);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.15);
    color: var(--danger);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 0 14px rgba(244, 63, 94, 0.4);
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    min-height: 36px;
}

.btn-lg {
    padding: 0.85rem 2rem;
    font-size: 1rem;
}

/* ─── Tabs ───────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 0.35rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    padding: 0.35rem;
    margin-bottom: 1.5rem;
    width: fit-content;
}

.tab-btn {
    padding: 0.5rem 1.1rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--r-full);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--t-base);
    white-space: nowrap;
    min-height: 40px;
}

.tab-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: var(--grad-primary);
    color: white;
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.4);
}

.tab-content {
    display: none;
    animation: fadeUp 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* ─── Forms ──────────────────────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: var(--t-base);
}

input::placeholder,
select::placeholder {
    color: var(--text-dim);
}

select option {
    background: var(--bg-2);
    color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
    background: rgba(124, 58, 237, 0.04);
}

/* ─── Tables ─────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead tr {
    background: rgba(124, 58, 237, 0.08);
    border-bottom: 1px solid var(--border);
}

th {
    padding: 0.85rem 1.2rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    white-space: nowrap;
}

td {
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.06);
    font-size: 0.875rem;
    color: var(--text);
    vertical-align: middle;
}

tbody tr {
    transition: var(--t-fast);
}

tbody tr:hover {
    background: rgba(124, 58, 237, 0.05);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ─── Section Heading ────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.section-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* ─── Status Badges ──────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.65rem;
    border-radius: var(--r-full);
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-primary {
    background: rgba(124, 58, 237, 0.2);
    color: #A78BFA;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.badge-warn {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warn);
}

.badge-danger {
    background: rgba(244, 63, 94, 0.2);
    color: var(--danger);
}

/* ─── Result Cards (Hesaplama) ───────────────────── */
.result-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: var(--t-base);
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--grad-primary);
}

.result-card:hover {
    border-color: var(--border-h);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.result-brut {
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 800;
    color: white;
    padding: 0.25rem 0.75rem;
    background: rgba(124, 58, 237, 0.3);
    border-radius: var(--r-full);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.result-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.06);
    font-size: 0.83rem;
}

.result-row:last-child {
    border-bottom: none;
}

.result-row-label {
    color: var(--text-muted);
}

.result-row-value {
    font-weight: 600;
    color: var(--text);
}

.result-hnkk {
    color: var(--warn) !important;
    font-size: 1.15rem !important;
}

.result-net-box {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(124, 58, 237, 0.06);
    border-radius: var(--r-md);
    border: 1px solid rgba(124, 58, 237, 0.12);
}

/* Empty / Loading State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.4;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-state p {
    font-size: 0.95rem;
}

/* ─── Login Page ─────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
}

.login-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 60% at 30% 50%, rgba(124, 58, 237, 0.2) 0%, transparent 60%),
        radial-gradient(ellipse 50% 50% at 80% 20%, rgba(6, 182, 212, 0.1) 0%, transparent 60%);
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(32px);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-md);
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.login-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
}

.login-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.error-box {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.25);
    color: #FDA4AF;
    padding: 0.9rem 1.1rem;
    border-radius: var(--r-md);
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.success-box {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #6EE7B7;
    padding: 0.9rem 1.1rem;
    border-radius: var(--r-md);
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* ─── Animations ─────────────────────────────────── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(124, 58, 237, 0.3);
    }

    50% {
        box-shadow: 0 0 24px rgba(124, 58, 237, 0.6);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

.animate-in {
    animation: fadeUp 0.4s ease both;
}

/* Stagger children */
.stagger-1 {
    animation-delay: 0.05s;
}

.stagger-2 {
    animation-delay: 0.10s;
}

.stagger-3 {
    animation-delay: 0.15s;
}

.stagger-4 {
    animation-delay: 0.20s;
}

/* Skeleton loader */
.skeleton {
    background: linear-gradient(90deg, var(--bg-2) 25%, rgba(124, 58, 237, 0.08) 50%, var(--bg-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--r-md);
}

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 1024px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .col-8,
    .col-4 {
        grid-column: span 12;
    }

    .col-6 {
        grid-column: span 12;
    }

    .col-3 {
        grid-column: span 6;
    }
}

@media (max-width: 768px) {
    :root {
        --header-h: 60px;
    }

    .header {
        padding: 0 1rem;
    }

    /* Hide desktop nav, show bottom nav */
    .header .nav {
        display: none;
    }

    .bottom-nav {
        display: flex;
    }

    main { min-height: 70vh;
        padding: 1rem;
        padding-bottom: calc(var(--nav-h) + 1rem);
        padding-top: calc(var(--header-h) + 0.5rem);
    }

    .action-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem;
    }

    .action-banner-cta {
        width: 100%;
        flex-direction: column;
    }

    .action-banner-cta .btn {
        width: 100%;
        justify-content: center;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .col-3 {
        grid-column: span 12;
    }

    .dashboard-grid {
        gap: 0.85rem;
    }

    .tabs {
        overflow-x: auto;
        width: 100%;
        border-radius: var(--r-lg);
    }

    /* Cards to block layout */
    .table-card-view th {
        display: none;
    }

    .table-card-view td {
        display: flex;
        justify-content: space-between;
        border-bottom: 1px solid var(--border);
        padding: 0.6rem 1rem;
    }

    .table-card-view td::before {
        content: attr(data-label);
        font-size: 0.72rem;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
    }

    .table-card-view tr {
        display: block;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--r-md);
        margin-bottom: 0.75rem;
        overflow: hidden;
    }

    h1 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .user-name {
        display: none;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Modal (Popup) System ──────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none !important;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.2s ease;
}

.modal-backdrop.active {
    display: flex !important;
}

.modal-card {
    background: var(--bg-card);
    backdrop-filter: blur(32px);
    border: 1px solid var(--border-h);
    border-radius: var(--r-xl);
    width: 100%;
    max-width: 540px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), var(--shadow-glow);
    position: relative;
    animation: modalSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--t-fast);
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.modal-header {
    padding: 2.25rem 2.5rem 1rem;
}

.modal-body {
    padding: 0 2.5rem 2.5rem;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ─── View Switcher ─────────────────────────── */
.view-switcher {
    display: flex;
    gap: 0.4rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.35rem;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
}

.view-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
    color: var(--text-dim);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--t-fast);
}

.view-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.view-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* ─── Premium List Items (Gelişmiş) ─────── */
.premium-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.premium-list-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.15rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--t-base);
    animation: fadeIn 0.3s ease;
}

.premium-list-item:hover {
    border-color: var(--border-h);
    background: rgba(124, 58, 237, 0.08);
    transform: translateX(6px);
    box-shadow: var(--shadow-glow);
}

.pli-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex: 1;
}

.pli-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
    margin-bottom: 0.15rem;
}

.pli-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.pli-center {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.pli-metric {
    text-align: right;
}

.pli-m-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.pli-m-value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.pli-brut {
    font-size: 1.1rem;
    color: var(--icon-purple-txt);
    font-weight: 700;
}

.pli-net {
    font-size: 1.3rem;
    color: var(--success);
    font-weight: 800;
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

@media (max-width: 1024px) {
    .pli-center {
        gap: 1rem;
    }

    .pli-metric {
        min-width: auto !important;
    }
}

@media (max-width: 768px) {
    .premium-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }

    .pli-center {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 1.5rem 1rem;
    }

    .pli-left {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* ─── Global Utility ────────────────────────── */
.clickable {
    cursor: pointer !important;
}

.text-success {
    color: var(--success);
}

.text-primary {
    color: var(--primary);
}

.text-warn {
    color: var(--warn);
}

/* ─── Global Modal System (Floating Actions) ───── */
.k-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 10005;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.k-modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 28px;
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    max-height: 94vh;
    animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.k-modal-card > form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    position: relative;
}

@keyframes modalScale {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.k-modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.01);
    flex-shrink: 0;
}

.k-modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
}

.k-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    transition: 0.2s;
    z-index: 10010;
}

.k-modal-close:hover {
    background: var(--danger);
    color: white;
}

.k-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    scrollbar-width: thin;
}

/* Modal Body Padding when Island Footer is present */
.k-modal-body-has-island {
    padding-bottom: 7rem !important;
}

/* Floating Footer (Sticky/Default) */
.k-modal-footer {
    padding: 1.25rem 2rem;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    z-index: 10;
}

/* Premium Floating Island Footer */
.k-modal-footer-island {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    white-space: nowrap;
    pointer-events: auto;
}

[data-theme="light"] .k-modal-footer-island {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.k-modal-footer-island .btn-save-pill {
    background: var(--grad-primary);
    color: white !important;
    padding: 0.6rem 2rem;
    border-radius: 100px;
    font-weight: 800;
    border: none;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

/* ─── Modal Specific Improvements ────────────────── */
.modal-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.modal-metric-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: var(--t-base);
}

.modal-metric-card .metric-label {
    font-size: 0.65rem;
    margin: 0;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.modal-metric-card .metric-value {
    font-size: 1.25rem;
    margin: 0;
    word-break: break-all;
    font-weight: 800;
}

.tax-accordion {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.tax-header {
    background: rgba(124, 58, 237, 0.1);
    padding: 0.85rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--t-fast);
}

.tax-header:hover {
    background: rgba(124, 58, 237, 0.15);
}

.tax-header-label {
    font-weight: 700;
    font-size: 0.85rem;
}

.tax-header-value {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--success);
}

.tax-details {
    display: none;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border);
}

.tax-details.active {
    display: block;
}

.tax-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1.2rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.06);
    font-size: 0.85rem;
}

.tax-row:last-child {
    border-bottom: none;
}

.tax-row-label {
    color: var(--text-muted);
}

.tax-row-value {
    font-weight: 600;
    color: var(--text);
}

/* ─── Page Level Floating Bar ────────────────── */
.page-floating-bar {
    position: fixed;
    bottom: 0;
    left: 280px; /* Sidebar width adjustment if needed, but usually we cover full width of content */
    right: 0;
    z-index: 500;
    padding: 1rem 2.5rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.3);
    animation: barSlideIn 0.5s cubic-bezier(0, 0, 0, 1);
}

@keyframes barSlideIn {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

[data-theme="light"] .page-floating-bar {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 -4px 30px rgba(0,0,0,0.05);
}

@media (max-width: 1024px) {
    .page-floating-bar { left: 0; }
}

/* ─── Mobile Adjustments & Fixes ─── */
@media (max-width: 768px) {
    main { min-height: 70vh; padding: 1rem; margin-bottom: 80px; } /* Bottom nav space */
    .card { padding: 1rem; border-radius: var(--r-md); }
    .section-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .action-banner { padding: 1.5rem; flex-direction: column; text-align: center; }
    .action-banner h2 { font-size: 1.2rem; }
    .nav { display: none; } /* Use bottom nav on mobile */
    .user-name { display: none; }
    .header { padding: 0 0.75rem; }
    
    /* Sticky bar improvement */
    .sticky-filter-bar { 
        top: 0 !important; 
        padding: 0.5rem 0 !important;
        background: var(--bg-glass) !important;
        backdrop-filter: blur(10px);
    }
    .sticky-filter-bar .card { 
        padding: 0.75rem !important; 
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        box-shadow: none !important;
    }
    .sticky-filter-bar-flex {
        gap: 0.5rem !important;
    }
    .sticky-filter-bar select {
        padding: 0.35rem 0.5rem !important;
        font-size: 0.75rem !important;
        min-width: 100px !important;
        flex: 1;
    }
    .sticky-filter-bar label {
        display: none !important; /* Hide labels to save space */
    }
}

/* ─── Responsive Utilities ─── */
@media (max-width: 768px) { .hide-mobile { display: none !important; } }
.show-mobile { display: none !important; }
@media (max-width: 768px) { .show-mobile { display: block !important; } }
td.show-mobile, th.show-mobile { display: none !important; }
@media (max-width: 768px) { td.show-mobile, th.show-mobile { display: table-cell !important; } }

/* --- Metric Card Hover Effect (Premium Interactive) --- */
.hover-metric-card {
    position: relative !important;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

.metric-brut {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    display: block;
}

.metric-net {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    background: inherit;
    padding: 0.5rem;
    transform: translateY(15px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.hover-metric-card:hover .metric-brut {
    opacity: 0;
    transform: translateY(-15px);
}

.hover-metric-card:hover .metric-net {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
@media (max-width: 768px) { .sticky-filter-bar-flex { flex-wrap: nowrap !important; overflow-x: auto !important; scrollbar-width: none; } .sticky-filter-bar-flex::-webkit-scrollbar { display: none; } .sticky-filter-bar select { min-width: 140px !important; } }

/* --- Settings Dashboard Layout (Private SaaS Style) --- */
.k-settings-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin-top: 1rem;
}

.k-settings-sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: sticky;
    top: 1rem;
    flex-shrink: 0;
}

.k-settings-nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    border: none;
    width: 100%;
    cursor: pointer !important;
    text-align: left;
    pointer-events: auto !important;
}

.k-settings-nav-item i {
    font-size: 1.1rem;
    width: 24px;
    display: flex;
    justify-content: center;
    opacity: 0.6;
}

.k-settings-nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.k-settings-nav-item.active {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.3);
}

.k-settings-nav-item.active i {
    opacity: 1;
}

.k-settings-content {
    flex: 1;
    min-width: 0;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Mobile Sidebar Adaptations */
@media (max-width: 992px) {
    .k-settings-layout {
        flex-direction: column;
    }
    .k-settings-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        padding: 0.5rem;
        position: relative;
        top: 0;
        scrollbar-width: none;
    }
    .k-settings-sidebar::-webkit-scrollbar { display: none; }
    .k-settings-nav-item {
        white-space: nowrap;
        padding: 0.75rem 1rem;
        width: auto;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .k-settings-section-header {
        flex-direction: column;
        gap: 1.5rem;
        align-items: flex-start;
    }

    .k-settings-section-header > div:last-child {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .k-settings-section-header .btn {
        width: 100%;
        justify-content: center;
    }

    .k-settings-card {
        padding: 1.25rem;
        border-radius: 20px;
    }
}

/* --- Settings Specific Visuals --- */
.k-settings-group-title {
    font-size: 0.68rem;
    font-weight: 900;
    color: var(--text-dim);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 1rem 1.25rem 0.25rem;
    opacity: 0.5;
}

.k-settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
}

@media (max-width: 768px) {
    .k-settings-section-header {
        flex-direction: column;
        gap: 1.25rem;
        align-items: stretch;
    }

    .k-settings-nav-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem !important;
    }

    .k-settings-card {
        padding: 1rem;
        margin-bottom: 1.25rem;
        border-radius: 20px;
    }

    .k-settings-section-title {
        font-size: 1.25rem;
    }
    
    .modern-table td, .modern-table th {
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* --- Settings Specific Visuals (Restored & Enhanced) --- */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.config-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 1.75rem;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.config-card:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.config-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
}

.config-card.purple .config-icon { color: #a78bfa; background: rgba(139, 92, 246, 0.1); }
.config-card.blue .config-icon { color: #60a5fa; background: rgba(59, 130, 246, 0.1); }
.config-card.amber .config-icon { color: #fbbf24; background: rgba(245, 158, 11, 0.1); }
.config-card.indigo .config-icon { color: #818cf8; background: rgba(79, 70, 229, 0.1); }

/* ─── Premium Iconography & Utilities ────────────────── */
.icon-glow {
    position: relative;
    transition: var(--t-base);
}

.icon-glow::after {
    content: '';
    position: absolute;
    inset: -4px;
    background: currentColor;
    border-radius: inherit;
    opacity: 0;
    filter: blur(8px);
    transition: var(--t-base);
    z-index: -1;
}

.icon-glow:hover::after {
    opacity: 0.35;
}

.icon-premium {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--bg-icon-muted);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255,255,255,0.05);
    border: 1px solid var(--border);
}

.icon-premium:hover {
    transform: translateY(-3px) scale(1.05);
    background: var(--bg-2);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    color: var(--primary);
}

.action-btn-pill {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all 0.25s ease;
    cursor: pointer;
}

.action-btn-pill:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-h);
    color: var(--text);
}

.action-btn-pill.primary:hover { border-color: var(--primary); color: var(--primary); background: rgba(124, 58, 237, 0.1); }
.action-btn-pill.accent:hover { border-color: var(--accent); color: var(--accent); background: rgba(6, 182, 212, 0.1); }
.action-btn-pill.danger:hover { border-color: var(--danger); color: var(--danger); background: rgba(244, 63, 94, 0.1); }


/* User Management Refinements */
.user-row-premium {
    transition: var(--t-base);
}

.user-row-premium:hover {
    background: rgba(var(--primary-rgb, 124, 58, 237), 0.05) !important;
}

.user-info-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-meta-info {
    display: flex;
    flex-direction: column;
}

.user-branch-badge {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-dim);
    background: rgba(255,255,255,0.03);
    padding: 0.15rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin-top: 0.25rem;
    display: inline-block;
    width: fit-content;
}

.action-btn-group {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* --- Responsive Helpers --- */
@media (max-width: 768px) {
    .user-info-cell { gap: 0.75rem; }
}

.config-body { flex: 1; }
.config-title { font-size: 1.1rem; font-weight: 800; color: var(--text); margin-bottom: 0.25rem; }
.config-desc { font-size: 0.8rem; color: var(--text-dim); line-height: 1.4; margin-bottom: 1.5rem; }

/* Segmented Control (Radio Based) */
.segmented-control {
    display: flex;
    background: var(--bg-2);
    padding: 4px;
    border-radius: 14px;
    border: 1px solid var(--border);
}

.seg-btn-label { flex: 1; margin: 0; }
.seg-btn {
    width: 100%;
    padding: 0.6rem;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-dim);
    text-align: center;
    border-radius: 10px;
    transition: 0.3s;
    cursor: pointer;
}

input[type="radio"]:checked + .seg-btn {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Tab Management */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: settingsFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Settings Save Island */
.settings-save-island {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.75rem 2rem;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    opacity: 0;
}

.settings-save-island.visible {
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
    opacity: 1;
}

/* ─── Responsive Table Wrapper ───────────────────── */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    margin-bottom: 1rem;
}

.table-wrapper::-webkit-scrollbar {
    height: 4px;
}

/* ─── Mobile Refinements ────────────────────────── */
@media (max-width: 576px) {
    .k-modal-card {
        border-radius: 20px;
        max-height: 96vh;
    }

    .k-modal-header {
        padding: 1.25rem 1.5rem;
    }

    .k-modal-body {
        padding: 1.25rem;
    }

    .k-modal-footer-island {
        bottom: 1rem;
        width: calc(100% - 2rem);
        border-radius: 16px;
        padding: 0.75rem 1rem;
        gap: 0.75rem;
        justify-content: center;
    }

    .btn-save-pill {
        padding: 0.6rem 1.25rem;
        font-size: 0.8rem;
    }

    .k-modal-body-has-island {
        padding-bottom: 6rem !important;
    }

    /* Small screen density fixes */
    .metrics-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 400px) {
    .k-modal-footer-island {
        gap: 0.5rem;
        padding: 0.6rem 0.8rem;
    }

    .btn-save-pill {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
}

