/* ========================================
   SODIBO Dashboard - Design System
   Aesthetic: Clean Professional Light Theme
   ======================================== */

/* CSS Variables - Light Mode */
:root {
    /* Background Colors */
    --color-bg: #F8F9FA;
    --color-surface: #FFFFFF;
    --color-surface-elevated: #FFFFFF;
    --color-surface-hover: #F1F3F5;
    --color-border: #DEE2E6;
    --color-border-subtle: #E9ECEF;

    /* Text */
    --color-text: #212529;
    --color-text-secondary: #6C757D;
    --color-text-muted: #ADB5BD;

    /* Accent Colors */
    --color-primary: #D35400;
    --color-primary-light: #E67E22;
    --color-primary-dark: #A04000;

    --color-gold: #B8860B;
    --color-gold-light: #DAA520;

    --color-terra: #8B4513;
    --color-terra-light: #A0522D;

    --color-green: #2E7D32;
    --color-green-light: #43A047;

    /* Classification Colors */
    --color-diamant: #1976D2;
    --color-or: #F9A825;
    --color-argent: #78909C;
    --color-bronze: #D84315;

    /* Functional */
    --color-success: #2E7D32;
    --color-warning: #F57C00;
    --color-error: #C62828;

    /* Typography */
    --font-display: 'Archivo Black', sans-serif;
    --font-body: 'DM Sans', sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.125rem; }

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

.login-screen {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(135deg, #FFF8F0 0%, #FFF 50%, #F8F9FA 100%);
}

.login-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-2xl);
    max-width: 480px;
    margin: 0 auto;
}

.login-brand {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.brand-mark {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-icon {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: white;
}

.brand-name {
    font-size: 2rem;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.brand-tagline {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.login-form {
    background: var(--color-surface);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

.form-group input {
    width: 100%;
    padding: var(--space-md);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(211, 84, 0, 0.15);
}

.btn-login {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-terra) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-login:active {
    transform: translateY(0);
}

.login-error {
    color: var(--color-error);
    font-size: 0.875rem;
    text-align: center;
    margin-top: var(--space-md);
    min-height: 1.5em;
}

.login-footer {
    text-align: center;
    margin-top: var(--space-xl);
    color: var(--color-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.login-visual {
    flex: 1;
    background: linear-gradient(135deg, #FFF8F0 0%, #FFE8D6 100%);
    position: relative;
    overflow: hidden;
    display: none;
}

@media (min-width: 1024px) {
    .login-visual {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.visual-pattern {
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 40px,
            rgba(211, 84, 0, 0.05) 40px,
            rgba(211, 84, 0, 0.05) 80px
        );
}

.visual-stats {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.stat-highlight {
    text-align: center;
    padding: var(--space-lg);
}

.stat-number {
    display: block;
    font-family: var(--font-display);
    font-size: 4rem;
    color: var(--color-primary);
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-text-secondary);
    margin-top: var(--space-sm);
}

/* ========================================
   DASHBOARD LAYOUT
   ======================================== */

.dashboard {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.logo-mark {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-terra) 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: white;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--color-text);
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: var(--space-xs);
    background: var(--color-bg);
    padding: var(--space-xs);
    border-radius: var(--radius-lg);
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-tab:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.nav-tab.active {
    background: var(--color-surface);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.nav-tab svg {
    opacity: 0.6;
}

.nav-tab.active svg {
    opacity: 1;
}

/* User Menu */
.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-btn:hover {
    border-color: var(--color-primary);
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: white;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + var(--space-sm));
    right: 0;
    min-width: 200px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 200;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.dropdown-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--space-xs) 0;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    min-width: 200px;
}

.filter-group label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
}

/* Multi-select dropdown */
.multiselect-wrapper {
    position: relative;
}

.multiselect-btn {
    width: 100%;
    min-width: 200px;
    padding: var(--space-sm) var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    transition: all var(--transition-fast);
}

.multiselect-btn:hover {
    border-color: var(--color-primary);
}

.multiselect-btn.active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(211, 84, 0, 0.1);
}

.multiselect-btn .placeholder {
    color: var(--color-text-muted);
}

.multiselect-btn .selected-count {
    background: var(--color-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.multiselect-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 150;
    display: none;
}

.multiselect-dropdown.show {
    display: block;
}

.multiselect-search {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-border);
}

.multiselect-search input {
    width: 100%;
    padding: var(--space-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: var(--font-body);
}

.multiselect-search input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.multiselect-options {
    padding: var(--space-xs) 0;
}

.multiselect-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.multiselect-option:hover {
    background: var(--color-surface-hover);
}

.multiselect-option.selected {
    background: rgba(211, 84, 0, 0.08);
}

.multiselect-option input[type="checkbox"] {
    accent-color: var(--color-primary);
    width: 16px;
    height: 16px;
}

.multiselect-option label {
    flex: 1;
    cursor: pointer;
    font-size: 0.875rem;
}

.multiselect-actions {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}

.multiselect-actions button {
    padding: var(--space-xs) var(--space-sm);
    background: transparent;
    border: none;
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.multiselect-actions button:hover {
    text-decoration: underline;
}

.filter-actions {
    margin-left: auto;
}

.btn-filter-clear {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-family: var(--font-body);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-filter-clear:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
    border-color: var(--color-text-muted);
}

.active-filters {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-primary);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
}

.filter-chip button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    display: flex;
    font-size: 1rem;
    line-height: 1;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.main-content {
    flex: 1;
    padding: var(--space-lg);
    background: var(--color-bg);
}

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

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

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

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    gap: var(--space-lg);
}

.overview-grid {
    grid-template-columns: repeat(4, 1fr);
}

.geography-grid {
    grid-template-columns: repeat(3, 1fr);
}

.classification-grid {
    grid-template-columns: repeat(3, 1fr);
}

.products-grid {
    grid-template-columns: repeat(3, 1fr);
}

.infrastructure-grid {
    grid-template-columns: repeat(3, 1fr);
}

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

/* KPI Cards Row */
.kpi-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.kpi-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    background: rgba(211, 84, 0, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.kpi-icon.accent-gold {
    background: rgba(184, 134, 11, 0.1);
    color: var(--color-gold);
}

.kpi-icon.accent-terra {
    background: rgba(139, 69, 19, 0.1);
    color: var(--color-terra);
}

.kpi-icon.accent-green {
    background: rgba(46, 125, 50, 0.1);
    color: var(--color-green);
}

.kpi-content {
    display: flex;
    flex-direction: column;
}

.kpi-value {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--color-text);
    line-height: 1.2;
}

.kpi-label {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Chart Cards */
.chart-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.chart-card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border-subtle);
    background: var(--color-bg);
}

.card-header h3 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-text);
}

.card-badge {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    background: var(--color-surface);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

.card-actions {
    display: flex;
    gap: var(--space-sm);
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.chart-container {
    height: 280px;
    padding: var(--space-md);
}

.chart-container.large {
    height: 400px;
}

.map-container {
    height: 300px;
}

.map-container.large {
    height: 500px;
}

/* Map Legend */
.map-legend {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: var(--space-xs);
}

.legend-dot.bronze { background: var(--color-bronze); }
.legend-dot.silver { background: var(--color-argent); }
.legend-dot.gold { background: var(--color-or); }
.legend-dot.diamond { background: var(--color-diamant); }

/* Table Styles */
.table-container {
    padding: var(--space-md);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--color-border-subtle);
}

.data-table th {
    font-weight: 600;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--color-bg);
}

.data-table tbody tr:hover {
    background: var(--color-surface-hover);
}

/* ========================================
   MODALS
   ======================================== */

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-lg);
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-content.small {
    max-width: 400px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}

.modal-header h2 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.125rem;
}

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

.btn-close:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
    max-height: calc(85vh - 80px);
}

/* User Management */
.user-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.user-list-header h3 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--color-surface-hover);
}

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

.user-table th,
.user-table td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--color-border-subtle);
}

.user-table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    background: var(--color-bg);
}

.user-table tbody tr:hover {
    background: var(--color-surface-hover);
}

.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.role-badge.admin {
    background: rgba(211, 84, 0, 0.1);
    color: var(--color-primary);
}

.role-badge.viewer {
    background: var(--color-bg);
    color: var(--color-text-secondary);
}

.user-actions {
    display: flex;
    gap: var(--space-sm);
}

.btn-edit,
.btn-delete {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-edit:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.btn-delete:hover {
    background: var(--color-error);
    border-color: var(--color-error);
    color: white;
}

/* Form Styles */
.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

.radio-group {
    display: flex;
    gap: var(--space-lg);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 0.875rem;
}

.radio-label input {
    accent-color: var(--color-primary);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
}

/* ========================================
   LOADING
   ======================================== */

.loading-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner span {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

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

@media (max-width: 1280px) {
    .overview-grid,
    .infrastructure-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .span-2 { grid-column: span 2; }
}

@media (max-width: 1024px) {
    .nav-tabs {
        overflow-x: auto;
        max-width: 50vw;
    }

    .nav-tab span {
        display: none;
    }

    .geography-grid,
    .classification-grid,
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        gap: var(--space-md);
    }

    .nav-tabs {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
    }

    .filter-actions {
        margin-left: 0;
    }

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

    .span-2,
    .span-3 {
        grid-column: span 1;
    }

    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .kpi-row {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   LEAFLET OVERRIDES - Light Mode
   ======================================== */

.leaflet-container {
    background: #F8F9FA;
    font-family: var(--font-body);
}

.leaflet-popup-content-wrapper {
    background: var(--color-surface);
    color: var(--color-text);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.leaflet-popup-tip {
    background: var(--color-surface);
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large,
.marker-cluster-xlarge {
    background-color: rgba(211, 84, 0, 0.2);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div,
.marker-cluster-xlarge div {
    background-color: var(--color-primary);
    color: white;
    font-family: var(--font-body);
    font-weight: 600;
}

.marker-cluster-xlarge {
    background-color: rgba(211, 84, 0, 0.35);
}

.marker-cluster-xlarge div {
    width: 50px;
    height: 50px;
    line-height: 50px;
    font-size: 14px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}
