:root {
            /* Davlat / kiber-xavfsizlik: chuqur ko‘k, teal, oltin trim, 3D soyalar */
            --bg-app: #e8eef6;
            --bg-gradient-mid: #d7e6f3;
            --surface: #ffffff;
            --surface-elevated: #f3f6fb;
            --text-primary: #0f172a;
            --text-secondary: #334155;
            --text-muted: #64748b;
            --border: #c7d2e0;
            --accent: #0d9488;
            --accent-hover: #0f766e;
            --accent-soft: rgba(13, 148, 136, 0.14);
            --accent-bright: #0891b2;
            --accent-gold: #c9a227;
            --accent-gold-soft: rgba(201, 162, 39, 0.22);
            --success: #059669;
            --danger: #dc2626;
            --warning: #d97706;
            --header-gradient: linear-gradient(135deg, #0c1e36 0%, #134e4a 46%, #155e75 100%);
            --header-fg: #f8fafc;
            --shadow:
                0 1px 2px rgba(15, 39, 68, 0.05),
                0 8px 24px rgba(15, 39, 68, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.85);
            --shadow-lg:
                0 4px 8px rgba(15, 39, 68, 0.06),
                0 20px 48px rgba(15, 39, 68, 0.14),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
            --shadow-press: inset 0 2px 8px rgba(15, 39, 68, 0.08);
            --radius: 16px;
            --radius-sm: 11px;
            --radius-xs: 8px;
            --font: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
            --font-display: 'Outfit', 'IBM Plex Sans', system-ui, sans-serif;
            --leading-body: 1.58;
            --leading-tight: 1.28;
        }

        [data-theme="dark"] {
            --bg-app: #070f1a;
            --bg-gradient-mid: #0f1b2e;
            --surface: #101b2d;
            --surface-elevated: #1a2a42;
            --text-primary: #f1f5f9;
            --text-secondary: #cbd5e1;
            --text-muted: #94a3b8;
            --border: #334155;
            --accent: #2dd4bf;
            --accent-hover: #5eead4;
            --accent-soft: rgba(45, 212, 191, 0.16);
            --accent-bright: #22d3ee;
            --accent-gold: #fbbf24;
            --accent-gold-soft: rgba(251, 191, 36, 0.14);
            --success: #34d399;
            --danger: #f87171;
            --warning: #fbbf24;
            --header-gradient: linear-gradient(135deg, #020617 0%, #0c4a6e 42%, #134e4a 100%);
            --header-fg: #f8fafc;
            --shadow:
                0 4px 16px rgba(0, 0, 0, 0.45),
                inset 0 1px 0 rgba(255, 255, 255, 0.06);
            --shadow-lg:
                0 12px 40px rgba(0, 0, 0, 0.55),
                inset 0 1px 0 rgba(255, 255, 255, 0.08);
            --shadow-press: inset 0 2px 12px rgba(0, 0, 0, 0.35);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: var(--font);
        }

        html, body {
            min-height: 100vh;
        }

        body {
            background:
                radial-gradient(ellipse 90% 70% at 12% -8%, rgba(13, 148, 136, 0.11), transparent 52%),
                radial-gradient(ellipse 70% 55% at 88% 12%, rgba(8, 145, 178, 0.09), transparent 48%),
                radial-gradient(ellipse 120% 80% at 50% -20%, var(--bg-gradient-mid), var(--bg-app));
            color: var(--text-primary);
            line-height: var(--leading-body, 1.58);
            transition: background 0.35s ease, color 0.2s ease;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        [data-theme="dark"] body {
            background:
                radial-gradient(ellipse 80% 60% at 15% 0%, rgba(34, 211, 238, 0.07), transparent 50%),
                radial-gradient(ellipse 70% 50% at 85% 30%, rgba(45, 212, 191, 0.05), transparent 45%),
                linear-gradient(168deg, var(--bg-gradient-mid) 0%, var(--bg-app) 55%, #050a12 100%);
        }

        /* LOGIN */
        .login-topbar {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 28px;
        }

        .lang-switch {
            display: flex;
            gap: 4px;
            background: var(--surface-elevated);
            padding: 4px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border);
        }

        .lang-switch button {
            border: none;
            background: transparent;
            color: var(--text-secondary);
            padding: 8px 12px;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 600;
            letter-spacing: 0.04em;
            cursor: pointer;
            transition: background 0.2s, color 0.2s;
        }

        .lang-switch button:hover {
            color: var(--text-primary);
        }

        .lang-switch button.active {
            background: linear-gradient(145deg, var(--accent-bright), var(--accent));
            color: #fff;
            box-shadow: 0 2px 8px rgba(13, 148, 136, 0.35);
        }

        [data-theme="dark"] .lang-switch button.active {
            color: #0f172a;
        }

        .theme-toggle {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 8px 14px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border);
            background: var(--surface-elevated);
            color: var(--text-secondary);
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: border-color 0.2s, background 0.2s;
        }

        .theme-toggle:hover {
            border-color: var(--accent);
            color: var(--text-primary);
        }

        .login-container {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            padding: 24px;
        }

        .login-box {
            background: var(--surface);
            padding: 40px;
            border-radius: var(--radius);
            box-shadow: var(--shadow-lg);
            border: 1px solid var(--border);
            width: 100%;
            max-width: 440px;
        }

        .login-badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--accent);
            margin-bottom: 12px;
        }

        .login-box h1 {
            color: var(--text-primary);
            text-align: center;
            margin-bottom: 10px;
            font-size: 1.35rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
        }

        .login-box .login-subtitle {
            color: var(--text-muted);
            text-align: center;
            margin-bottom: 28px;
            font-size: 14px;
            line-height: 1.5;
        }

        .login-tabs {
            display: flex;
            margin-bottom: 25px;
            border-radius: var(--radius-sm);
            overflow: hidden;
            background: var(--surface-elevated);
            border: 1px solid var(--border);
        }

        .login-tab {
            flex: 1;
            padding: 14px;
            border: none;
            background: none;
            cursor: pointer;
            font-weight: 600;
            font-size: 14px;
            color: var(--text-secondary);
            transition: all 0.25s;
        }

        .login-tab.active {
            background: linear-gradient(145deg, var(--accent-bright), var(--accent));
            color: var(--header-fg);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
        }

        [data-theme="dark"] .login-tab.active {
            color: #0f172a;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 600;
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .form-group input,
        .form-group select {
            width: 100%;
            min-height: 46px;
            padding: 12px 16px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 15px;
            transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
            background: var(--surface);
            color: var(--text-primary);
        }

        .form-group select {
            cursor: pointer;
        }

        .form-group input:focus,
        .form-group select:focus {
            border-color: var(--accent);
            outline: none;
            box-shadow: 0 0 0 3px var(--accent-soft);
            background: var(--surface-elevated);
        }

        .login-btn {
            background: var(--header-gradient);
            color: var(--header-fg);
            border: none;
            padding: 15px 28px;
            border-radius: var(--radius-sm);
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            transition: transform 0.2s, box-shadow 0.2s;
            margin-top: 10px;
        }

        .login-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 8px 24px var(--accent-soft);
        }

        .login-error {
            color: var(--text-primary);
            font-weight: 700;
            margin-top: 15px;
            font-size: 14px;
            display: none;
        }

        /* MAIN APP */
        .container {
            max-width: min(1680px, 100%);
            margin: 0 auto;
            padding: clamp(16px, 2.2vw, 28px);
            display: none;
        }

        .user-info-bar {
            position: relative;
            overflow: hidden;
            background: linear-gradient(168deg, var(--surface) 0%, var(--surface-elevated) 100%);
            border-radius: var(--radius);
            padding: 16px 22px 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 14px;
            margin-bottom: 22px;
            box-shadow: var(--shadow-lg);
            border: 1px solid color-mix(in srgb, var(--border) 82%, var(--accent) 18%);
        }

        .user-info-bar::before {
            content: "";
            position: absolute;
            left: 0;
            right: 0;
            top: 0;
            height: 3px;
            background: linear-gradient(
                90deg,
                var(--accent-gold) 0%,
                var(--accent-bright) 38%,
                var(--accent) 72%,
                var(--accent-gold) 100%
            );
            opacity: 0.92;
        }

        .user-info-bar .bar-controls {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 10px;
        }

        .user-welcome {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .user-avatar {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            background: var(--header-gradient);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--header-fg);
            font-weight: 700;
            font-size: 17px;
            box-shadow:
                0 4px 14px rgba(13, 148, 136, 0.35),
                inset 0 2px 0 rgba(255, 255, 255, 0.2);
        }

        .user-role {
            background: linear-gradient(135deg, var(--accent-soft), var(--accent-gold-soft));
            color: var(--accent);
            padding: 4px 11px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
        }

        .logout-btn {
            background: transparent;
            color: var(--danger);
            border: 1px solid color-mix(in srgb, var(--danger) 65%, var(--border));
            padding: 9px 18px;
            border-radius: var(--radius-sm);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
        }

        .logout-btn:hover {
            background: linear-gradient(145deg, #dc2626, #b91c1c);
            color: #fff;
            border-color: #b91c1c;
            box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
            transform: translateY(-1px);
        }

        [data-theme="dark"] .logout-btn:hover {
            color: #fff;
        }

        /* HEADER */
        .header {
            background: var(--header-gradient);
            color: var(--header-fg);
            padding: 24px 28px;
            border-radius: var(--radius);
            margin-bottom: 26px;
            box-shadow:
                var(--shadow-lg),
                inset 0 1px 0 rgba(255, 255, 255, 0.12);
            position: relative;
            overflow: hidden;
            border: 1px solid color-mix(in srgb, var(--accent-bright) 35%, transparent);
        }

        .header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 5px;
            background: linear-gradient(
                90deg,
                var(--accent-gold) 0%,
                var(--accent-bright) 28%,
                var(--accent) 55%,
                var(--accent-bright) 78%,
                var(--accent-gold) 100%
            );
        }

        .header::after {
            content: '';
            position: absolute;
            inset: 0;
            background: radial-gradient(ellipse 70% 120% at 100% -20%, rgba(255, 255, 255, 0.09), transparent 55%);
            pointer-events: none;
        }

        .header__brand {
            display: flex;
            align-items: center;
            gap: clamp(16px, 2.5vw, 24px);
            position: relative;
            z-index: 1;
        }

        .header__emblem {
            flex-shrink: 0;
            width: clamp(56px, 12vw, 80px);
            height: auto;
            object-fit: contain;
            filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.25));
            border-radius: 0;
            background: transparent;
            padding: 0;
        }

        .header__titles {
            min-width: 0;
        }

        .header h1 {
            font-family: var(--font-display);
            font-size: 28px;
            margin: 0 0 10px;
            display: block;
            position: relative;
            z-index: 1;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
            line-height: 1.25;
        }

        .header .subtitle {
            font-size: 16px;
            opacity: 0.92;
            font-weight: 400;
            position: relative;
            z-index: 1;
            margin: 0;
        }

        /* MAIN LAYOUT */
        .main-layout {
            display: grid;
            grid-template-columns: 380px 1fr;
            gap: 30px;
            margin-bottom: 30px;
        }

        .main-layout--admin {
            grid-template-columns: 1fr;
            gap: clamp(16px, 2.2vw, 28px);
        }

        .main-content--admin {
            min-width: 0;
        }

        /* SIDEBAR */
        .sidebar {
            background: linear-gradient(188deg, var(--surface) 0%, color-mix(in srgb, var(--surface-elevated) 96%, var(--accent) 4%) 100%);
            border-radius: var(--radius);
            padding: clamp(20px, 2.4vw, 26px);
            box-shadow: var(--shadow-lg);
            border: 1px solid color-mix(in srgb, var(--border) 85%, var(--accent-bright) 15%);
            position: sticky;
            top: 20px;
            height: fit-content;
        }

        .form-section h2 {
            font-family: var(--font-display);
            color: var(--text-primary);
            margin-bottom: 25px;
            padding-bottom: 15px;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 20px;
        }

        .form-group select, 
        .form-group input[type="text"], 
        .form-group input[type="number"], 
        .form-group input[type="date"] {
            width: 100%;
            min-height: 46px;
            padding: 12px 16px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 15px;
            transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
            background: var(--surface);
            color: var(--text-primary);
        }

        .form-group select {
            cursor: pointer;
            appearance: auto;
            -webkit-appearance: menulist;
        }

        .form-group select:focus, 
        .form-group input:focus {
            border-color: var(--accent);
            outline: none;
            box-shadow: 0 0 0 3px var(--accent-soft);
            background: var(--surface-elevated);
        }

        .radio-group {
            display: flex;
            gap: 25px;
            margin-top: 10px;
            padding: 14px;
            background: var(--surface-elevated);
            border-radius: var(--radius-sm);
            border: 1px solid var(--border);
        }

        .radio-group label {
            display: flex;
            align-items: center;
            gap: 10px;
            font-weight: normal;
            cursor: pointer;
            padding: 8px 15px;
            border-radius: 8px;
            transition: background 0.3s;
            margin-bottom: 0;
        }

        .radio-group label:hover {
            background: rgba(0, 0, 0, 0.06);
        }

        [data-theme="dark"] .radio-group label:hover {
            background: rgba(255, 255, 255, 0.06);
        }

        .btn-submit {
            background: var(--header-gradient);
            color: var(--header-fg);
            border: none;
            padding: 16px 28px;
            border-radius: var(--radius-sm);
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            transition: transform 0.2s, box-shadow 0.2s;
            margin-top: 20px;
        }

        .btn-submit:hover {
            transform: translateY(-1px);
            box-shadow: 0 10px 28px var(--accent-soft);
        }

        /* STATS */
        .stats-section {
            margin-top: 35px;
            padding-top: 25px;
            border-top: 2px solid var(--border);
        }

        .stats-section h3 {
            font-family: var(--font-display);
            color: var(--text-primary);
            margin-bottom: 25px;
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 18px;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
        }

        .stat-card {
            background: linear-gradient(165deg, var(--surface) 0%, var(--surface-elevated) 100%);
            border-radius: var(--radius-sm);
            padding: 18px 16px;
            text-align: center;
            border: 1px solid color-mix(in srgb, var(--border) 82%, var(--accent-bright) 18%);
            transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.2s ease;
            box-shadow:
                0 2px 8px rgba(15, 39, 68, 0.06),
                inset 0 1px 0 rgba(255, 255, 255, 0.88);
        }

        .stat-card:hover {
            transform: translateY(-2px);
            border-color: color-mix(in srgb, var(--border) 65%, var(--accent) 35%);
            box-shadow:
                0 12px 32px rgba(13, 148, 136, 0.14),
                inset 0 1px 0 rgba(255, 255, 255, 0.95);
        }

        [data-theme="dark"] .stat-card:hover {
            box-shadow:
                0 12px 32px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.08);
        }

        .stat-value {
            font-family: var(--font-display);
            font-size: 28px;
            font-weight: 700;
            background: linear-gradient(135deg, var(--accent-bright), var(--accent));
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            margin-bottom: 5px;
        }

        [data-theme="dark"] .stat-value {
            background: linear-gradient(135deg, #5eead4, #22d3ee);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
        }

        .stat-label {
            font-size: 12px;
            color: var(--text-muted);
            font-weight: 500;
        }

        /* MAP SECTION */
        .map-section {
            background: linear-gradient(188deg, var(--surface) 0%, color-mix(in srgb, var(--surface-elevated) 94%, var(--accent) 6%) 100%);
            border-radius: var(--radius);
            padding: clamp(20px, 2.5vw, 28px);
            box-shadow: var(--shadow-lg);
            border: 1px solid color-mix(in srgb, var(--border) 84%, var(--accent-bright) 16%);
            margin-bottom: 26px;
        }

        .map-section h2 {
            font-family: var(--font-display);
            color: var(--text-primary);
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 15px;
            font-size: 24px;
        }

        .legend {
            display: flex;
            justify-content: center;
            gap: 24px;
            margin: 22px 0;
            padding: 18px;
            background: var(--surface-elevated);
            border-radius: var(--radius-sm);
            border: 1px solid var(--border);
            flex-wrap: wrap;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .legend-color {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            border: 2px solid rgba(0,0,0,0.1);
        }

        .legend-green {
            background: linear-gradient(145deg, #bbf7d0, #86efac);
            border: 2px solid #15803d;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
        }
        .legend-yellow {
            background: linear-gradient(145deg, #fef08a, #fde047);
            border: 2px solid #ca8a04;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
        }
        .legend-red {
            background: linear-gradient(145deg, #fecaca, #fca5a5);
            border: 2px solid #b91c1c;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
        }

        [data-theme="dark"] .legend-green {
            background: linear-gradient(145deg, #14532d, #166534);
            border-color: #4ade80;
        }
        [data-theme="dark"] .legend-yellow {
            background: linear-gradient(145deg, #713f12, #a16207);
            border-color: #fde047;
        }
        [data-theme="dark"] .legend-red {
            background: linear-gradient(145deg, #7f1d1d, #991b1b);
            border-color: #fca5a5;
        }

        .legend-text {
            font-weight: 500;
            color: var(--text-secondary);
        }

        /* MAP CONTAINER */
        .map-container {
            position: relative;
            background: linear-gradient(180deg, #f0f9ff 0%, var(--surface) 40%);
            border-radius: var(--radius-sm);
            overflow: hidden;
            box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.8);
            min-height: 600px;
            border: 1px solid color-mix(in srgb, var(--accent-bright) 22%, var(--border));
        }

        [data-theme="dark"] .map-container {
            background: linear-gradient(180deg, #0c1929 0%, var(--surface) 45%);
        }

        /* Viloyat xaritasi (Leaflet yoki SVG) */
        #sirdaryoMap.leaflet-map-root,
        #sirdaryoMap.svg-district-map-root {
            width: 100%;
            position: relative;
            min-height: 400px;
        }

        /* MODAL */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            z-index: 999;
        }

        .district-modal {
            display: none;
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: var(--surface);
            border-radius: var(--radius);
            padding: 0;
            box-shadow: var(--shadow-lg);
            border: 1px solid var(--border);
            z-index: 1000;
            width: 90%;
            max-width: 1200px;
            max-height: 90vh;
            overflow: hidden;
        }

        .modal-header {
            background: var(--header-gradient);
            color: var(--header-fg);
            padding: 25px 30px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .modal-header h3 {
            font-size: 24px;
            margin: 0;
        }

        .close-modal {
            background: none;
            border: none;
            color: var(--header-fg);
            font-size: 28px;
            cursor: pointer;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.3s;
        }

        .close-modal:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .modal-content {
            padding: 30px;
            overflow-y: auto;
            max-height: calc(90vh - 100px);
        }

        .modal-stats {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 20px;
            margin-bottom: 30px;
        }

        .modal-stat-card {
            background: linear-gradient(145deg, var(--surface) 0%, var(--surface-elevated) 100%);
            border-radius: var(--radius-sm);
            padding: 22px;
            text-align: center;
            border-left: 4px solid var(--accent-bright);
            box-shadow: var(--shadow-press);
        }

        .modal-stat-value {
            font-size: 32px;
            font-weight: 700;
            font-family: var(--font-display);
            color: var(--accent-bright);
            margin-bottom: 8px;
        }

        .modal-stat-label {
            font-size: 13px;
            color: var(--text-muted);
            font-weight: 500;
        }

        .modal-charts {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 30px;
            margin-bottom: 30px;
        }

        .chart-container {
            background: linear-gradient(165deg, var(--surface) 0%, var(--surface-elevated) 100%);
            border-radius: var(--radius-sm);
            padding: 22px;
            box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.75);
            border: 1px solid color-mix(in srgb, var(--border) 90%, var(--accent-bright) 10%);
        }

        [data-theme="dark"] .chart-container {
            box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
        }

        .chart-container h4 {
            color: var(--text-primary);
            margin-bottom: 20px;
            font-size: 18px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        /* TABLE */
        .recent-section {
            background: linear-gradient(180deg, var(--surface) 0%, var(--surface-elevated) 100%);
            border-radius: var(--radius);
            padding: 26px;
            box-shadow: var(--shadow);
            border: 1px solid color-mix(in srgb, var(--border) 90%, var(--accent) 10%);
        }

        .recent-section h3 {
            font-family: var(--font-display);
            color: var(--text-primary);
            margin-bottom: 25px;
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 22px;
        }

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

        .complaint-search-form {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 10px 12px;
            margin-bottom: 16px;
        }

        .complaint-search-form input[type="search"] {
            flex: 1 1 200px;
            min-width: 180px;
            max-width: 420px;
            padding: 10px 14px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border);
            background: var(--surface);
            color: var(--text-primary);
            font-size: 14px;
        }

        .complaint-search-form__btn {
            padding: 10px 16px;
            border-radius: var(--radius-sm);
            border: none;
            background: var(--accent);
            color: #fff;
            font-weight: 600;
            cursor: pointer;
            font-size: 14px;
        }

        .complaint-search-form__btn:hover {
            background: var(--accent-hover);
        }

        .complaint-search-form__clear {
            font-size: 14px;
            color: var(--accent-bright);
            text-decoration: underline;
        }

        .table-wrapper {
            overflow-x: auto;
            border-radius: var(--radius-sm);
            box-shadow: var(--shadow);
            border: 1px solid var(--border);
        }

        table {
            width: 100%;
            border-collapse: collapse;
            min-width: 1180px;
        }

        table thead {
            background: var(--header-gradient);
        }

        table th {
            color: var(--header-fg);
            padding: 20px;
            text-align: left;
            font-weight: 600;
            font-size: 15px;
        }

        table td {
            padding: 18px 20px;
            font-size: 14px;
        }

        table tbody tr {
            border-bottom: 1px solid var(--border);
            transition: background 0.2s;
        }

        table tbody tr:hover {
            background: var(--accent-soft);
        }

        table tbody tr:nth-child(even) {
            background: var(--surface-elevated);
        }

        /* NOTIFICATION */
        .notification {
            position: fixed;
            top: 30px;
            right: 30px;
            padding: 20px 25px;
            background: linear-gradient(145deg, #0d9488, #0f766e);
            color: #f8fafc;
            border: 1px solid rgba(255, 255, 255, 0.25);
            border-radius: 12px;
            box-shadow: 0 12px 40px rgba(13, 148, 136, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
            z-index: 10000;
            display: none;
            animation: slideIn 0.3s ease;
            max-width: 400px;
        }

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

        .notification.error {
            background: linear-gradient(145deg, #ef4444, #dc2626);
            color: #fff;
            border-color: rgba(255, 255, 255, 0.3);
        }

        .notification.warning {
            background: linear-gradient(145deg, #f59e0b, #d97706);
            color: #fff;
            border-color: rgba(255, 255, 255, 0.25);
        }

        [data-theme="dark"] .notification {
            background: linear-gradient(145deg, #14b8a6, #0d9488);
            color: #f8fafc;
            border-color: rgba(255, 255, 255, 0.2);
        }

        [data-theme="dark"] .notification.error {
            background: linear-gradient(145deg, #f87171, #ef4444);
            color: #0f172a;
        }

        [data-theme="dark"] .notification.warning {
            background: linear-gradient(145deg, #fbbf24, #f59e0b);
            color: #0f172a;
        }

        /* LOADING */
        .loading {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: color-mix(in srgb, var(--surface) 92%, transparent);
            z-index: 9999;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            color: var(--text-primary);
        }

        .spinner {
            width: 56px;
            height: 56px;
            border: 4px solid var(--border);
            border-top: 4px solid var(--accent);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 20px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* DATA MANAGEMENT */
        .data-management {
            margin-top: 30px;
            padding-top: 25px;
            border-top: 2px solid var(--border);
        }

        .data-management h4 {
            color: var(--text-primary);
            margin-bottom: 20px;
            font-size: 16px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .data-buttons {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }

        .data-btn {
            padding: 14px;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            font-weight: 500;
        }

        .export-btn {
            background: linear-gradient(145deg, #0d9488, #0f766e);
            color: #fff;
            border: none;
            box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
        }
        .import-btn {
            background: linear-gradient(145deg, #0284c7, #0369a1);
            color: #fff;
            border: none;
            box-shadow: 0 4px 14px rgba(3, 105, 161, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
        }
        .reset-btn {
            background: linear-gradient(145deg, #f8fafc, #e2e8f0);
            color: #0f172a;
            border: 1px solid #cbd5e1;
            box-shadow: inset 0 1px 0 #fff;
        }
        .sample-btn {
            background: linear-gradient(145deg, #64748b, #475569);
            color: #fff;
            border: none;
            box-shadow: 0 4px 12px rgba(71, 85, 105, 0.3);
        }

        [data-theme="dark"] .export-btn {
            background: linear-gradient(145deg, #2dd4bf, #14b8a6);
            color: #0f172a;
        }
        [data-theme="dark"] .import-btn {
            background: linear-gradient(145deg, #38bdf8, #0ea5e9);
            color: #0f172a;
        }
        [data-theme="dark"] .reset-btn {
            background: linear-gradient(145deg, #1e293b, #334155);
            color: #f1f5f9;
            border-color: #475569;
        }
        [data-theme="dark"] .sample-btn {
            background: linear-gradient(145deg, #475569, #334155);
            color: #f1f5f9;
        }

        .data-btn:hover {
            transform: translateY(-2px);
            filter: brightness(1.06);
            box-shadow: 0 10px 28px rgba(15, 39, 68, 0.18);
        }

        /* FOOTER */
        .footer {
            text-align: center;
            padding: 22px;
            color: var(--text-muted);
            background: linear-gradient(180deg, var(--surface) 0%, var(--surface-elevated) 100%);
            border-radius: var(--radius);
            margin-top: 26px;
            box-shadow: var(--shadow);
            border: 1px solid color-mix(in srgb, var(--border) 92%, var(--accent) 8%);
        }

        .footer p {
            margin-bottom: 8px;
            font-size: 14px;
        }

        @media (max-width: 1400px) {
            .main-layout {
                grid-template-columns: 1fr;
            }
            
            .sidebar {
                position: static;
            }
            
            .modal-charts {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 768px) {
            .container {
                padding: 15px;
            }
            
            .header {
                padding: 20px;
            }
            
            .header__brand {
                flex-direction: column;
                align-items: flex-start;
                text-align: left;
            }

            .header h1 {
                font-size: 22px;
            }
            
            .map-section, .sidebar, .recent-section {
                padding: 20px;
            }
            
            .modal-stats {
                grid-template-columns: repeat(2, 1fr);
            }
            
            .legend {
                flex-direction: column;
                align-items: flex-start;
                gap: 15px;
            }
            
            .data-buttons {
                grid-template-columns: 1fr;
            }
            
            .login-box {
                padding: 30px 20px;
            }
        }

        /* === Xarita paneli (Leaflet) === */
        .map-section {
            position: relative;
        }

        .map-toolbar {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 12px;
            margin-bottom: 16px;
            padding: 12px 14px;
            background: var(--surface-elevated);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
        }

        .map-toolbar label {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-secondary);
        }

        .map-toolbar select {
            min-width: 220px;
            padding: 10px 12px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border);
            background: var(--surface);
            color: var(--text-primary);
            font-size: 14px;
        }

        .map-toolbar .map-btn-reset {
            padding: 9px 14px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border);
            background: var(--surface);
            color: var(--text-primary);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
        }

        .map-toolbar .map-btn-reset:hover {
            border-color: var(--accent);
            color: var(--accent);
        }

        .map-hint {
            font-size: 12px;
            color: var(--text-muted);
            margin-bottom: 10px;
        }

        .map-container {
            position: relative;
            touch-action: none;
        }

        .map-floating-stats {
            display: none;
            position: absolute;
            top: 12px;
            right: 12px;
            z-index: 5;
            width: min(280px, calc(100% - 24px));
            padding: 14px 16px;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            box-shadow: var(--shadow-lg);
        }

        .map-floating-stats.is-visible {
            display: block;
        }

        .map-floating-stats h4 {
            margin: 0 0 10px;
            font-size: 15px;
            color: var(--text-primary);
        }

        .map-floating-stats .mf-row {
            display: flex;
            justify-content: space-between;
            font-size: 13px;
            padding: 6px 0;
            border-bottom: 1px solid var(--border);
            color: var(--text-secondary);
        }

        .map-floating-stats .mf-row:last-child {
            border-bottom: none;
        }

        .map-floating-stats .mf-val {
            font-weight: 700;
            color: var(--accent);
        }

        .map-floating-stats .mf-btn {
            margin-top: 12px;
            width: 100%;
            padding: 10px;
            border: none;
            border-radius: var(--radius-sm);
            background: var(--header-gradient);
            color: var(--header-fg);
            font-weight: 600;
            font-size: 13px;
            cursor: pointer;
        }

        @media (max-width: 768px) {
            .map-floating-stats {
                position: relative;
                top: auto;
                right: auto;
                width: 100%;
                margin-bottom: 12px;
            }
        }
