/* ============================================================
   ROQUE DASHBOARD — DESIGN SYSTEM
   ============================================================ */

/* ------------------------------------------------------------
   1. VARIABLES
   ------------------------------------------------------------ */
:root {
    /* Palette */
    --color-primary: #FF6B35;
    --color-primary-light: #FF8C42;
    --color-secondary: #FF8C42;
    --color-success: #34d399;
    --color-success-dark: #22C55E;
    --color-danger: #ff6b6b;
    --color-danger-dark: #EF4444;
    --color-warning: #fbbf24;
    --color-warning-dark: #FBBF24;
    --color-info: #60a5fa;
    --color-info-dark: #3B82F6;
    --color-purple: #9b59b6;

    /* Neutrals */
    --color-bg: #0A0A0A;
    --color-surface: rgba(255, 255, 255, 0.05);
    --color-surface-hover: rgba(255, 255, 255, 0.08);
    --color-border: rgba(255, 255, 255, 0.1);
    --color-border-strong: rgba(255, 255, 255, 0.15);
    --color-text: #ffffff;
    --color-text-secondary: rgba(255, 255, 255, 0.85);
    --color-text-muted: rgba(255, 255, 255, 0.6);
    --color-text-dim: rgba(255, 255, 255, 0.4);

    /* Spacing (8px base) */
    --space-1: 0.25rem;  /* 4px */
    --space-2: 0.5rem;   /* 8px */
    --space-3: 0.75rem;  /* 12px */
    --space-4: 1rem;     /* 16px */
    --space-5: 1.25rem;  /* 20px */
    --space-6: 1.5rem;   /* 24px */
    --space-8: 2rem;     /* 32px */

    /* Typography */
    --text-xs: 0.7rem;
    --text-sm: 0.8rem;
    --text-base: 0.95rem;
    --text-lg: 1.1rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 999px;

    /* Layout */
    --sidebar-width: 260px;
    --bottom-tabs-height: 64px;
}

/* ------------------------------------------------------------
   2. RESET & BASE
   ------------------------------------------------------------ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0A0A0A 0%, #1a1a1a 100%);
    color: var(--color-text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

button, input, textarea, select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Number inputs without spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* ------------------------------------------------------------
   3. LAYOUT
   ------------------------------------------------------------ */
.main-content {
    margin-left: var(--sidebar-width);
    padding: var(--space-6);
    padding-bottom: calc(var(--space-6) + var(--bottom-tabs-height));
    min-height: 100vh;
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: var(--space-4);
        padding-bottom: calc(var(--space-4) + var(--bottom-tabs-height) + var(--space-4));
    }
}

/* Mobile header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: rgba(10, 10, 10, 0.95);
    border-bottom: 1px solid var(--color-border);
    z-index: 90;
    padding: 0 var(--space-4);
    align-items: center;
    justify-content: space-between;
}

.mobile-header-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 700;
    color: var(--color-primary);
}

.mobile-header-logo i {
    font-size: 1.25rem;
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    body.has-mobile-header .main-content {
        padding-top: 72px;
    }
}

/* Bottom tabs */
.bottom-tabs {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-tabs-height);
    background: rgba(10, 10, 10, 0.98);
    border-top: 1px solid var(--color-border);
    z-index: 100;
    justify-content: space-around;
    align-items: center;
    padding: var(--space-2) 0;
}

.bottom-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    height: 100%;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
}

.bottom-tab i {
    font-size: 1.1rem;
    transition: transform 0.2s;
}

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

.bottom-tab.active i {
    transform: translateY(-2px);
}

.bottom-tab-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 18px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--color-danger);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .bottom-tabs {
        display: flex;
    }
}

/* ------------------------------------------------------------
   4. TYPOGRAPHY
   ------------------------------------------------------------ */
.page-header {
    margin-bottom: var(--space-5);
}

.page-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-1);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.page-subtitle {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.section-title {
    font-size: var(--text-lg);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.card-title {
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1.3;
}

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-small { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }

.text-muted { color: var(--color-text-muted); }
.text-dim { color: var(--color-text-dim); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-info { color: var(--color-info); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.caption {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    font-weight: 600;
}

/* ------------------------------------------------------------
   5. CARDS
   ------------------------------------------------------------ */
.card,
.glass,
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    transition: all 0.3s ease;
}

.card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 107, 53, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.15);
}

.card.compact,
.card-compact {
    padding: var(--space-3);
    border-radius: var(--radius-md);
}

.card.vencido {
    border-color: rgba(255, 68, 68, 0.5);
    background: rgba(255, 68, 68, 0.05);
}

.card.concluido {
    border-color: rgba(52, 211, 153, 0.3);
    background: rgba(52, 211, 153, 0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.card-body {
    color: var(--color-text-secondary);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-3);
}

.cards-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.dashboard-card .card-header {
    padding: var(--space-4);
    margin: 0;
    border-bottom: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.02);
}

.dashboard-card .card-body {
    padding: var(--space-4);
}

.dashboard-card.wide {
    grid-column: span 2;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    margin-top: var(--space-4);
    align-items: start;
}

.dashboard-grid.prazos-notificacoes {
    grid-template-columns: fit-content(360px) 1fr;
}

@media (max-width: 1100px) {
    .dashboard-grid,
    .dashboard-card.wide {
        grid-template-columns: 1fr;
        grid-column: span 1;
    }

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

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

@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------------------
   6. STATS
   ------------------------------------------------------------ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card.clickable {
    cursor: pointer;
}

.stat-card.clickable:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 107, 53, 0.3);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-info h3 {
    font-size: var(--text-xl);
    font-weight: 700;
    margin-bottom: var(--space-1);
}

.stat-info p {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.stat-edit {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    color: var(--color-text-dim);
    font-size: var(--text-sm);
    padding: var(--space-1);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.stat-card:hover .stat-edit {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.1);
}

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

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2);
    }

    .stat-card {
        padding: var(--space-3);
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .stat-info h3 {
        font-size: var(--text-lg);
    }
}

/* ------------------------------------------------------------
   7. BADGES
   ------------------------------------------------------------ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge.badge-primary {
    background: rgba(255, 107, 53, 0.15);
    color: var(--color-primary);
    border: 1px solid rgba(255, 107, 53, 0.3);
}

.badge.badge-success {
    background: rgba(52, 211, 153, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.badge.badge-danger {
    background: rgba(255, 107, 107, 0.15);
    color: var(--color-danger);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.badge.badge-warning {
    background: rgba(251, 191, 36, 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge.badge-info {
    background: rgba(96, 165, 250, 0.15);
    color: var(--color-info);
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.tipo-badge {
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 700;
    white-space: nowrap;
}

.tipo-badge.mensal {
    background: rgba(52, 211, 153, 0.15);
    color: var(--color-success);
}

.tipo-badge.pontual {
    background: rgba(96, 165, 250, 0.15);
    color: var(--color-info);
}

.badge-text-success {
    display: inline-block;
    color: var(--color-success);
    border: 1px solid rgba(52, 211, 153, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: var(--text-sm);
    font-weight: 500;
}

/* ------------------------------------------------------------
   8. BUTTONS
   ------------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--color-border-strong);
}

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

.btn-danger:hover {
    background: rgba(255, 107, 107, 0.25);
}

.btn-success {
    background: rgba(52, 211, 153, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.btn-success:hover {
    background: rgba(52, 211, 153, 0.25);
}

.btn-info {
    background: rgba(96, 165, 250, 0.15);
    color: var(--color-info);
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.btn-info:hover {
    background: rgba(96, 165, 250, 0.25);
}

.btn-sm {
    padding: 6px 10px;
    font-size: var(--text-xs);
    border-radius: var(--radius-sm);
}

.btn-icon {
    padding: var(--space-1) var(--space-2);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    transition: all 0.2s;
}

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

.actions-row {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.actions-row.center {
    justify-content: center;
}

/* ------------------------------------------------------------
   9. FORMS
   ------------------------------------------------------------ */
.form-input,
.form-select,
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: white;
    font-size: var(--text-sm);
    transition: all 0.2s;
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.08);
}

.form-input::placeholder,
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-text-dim);
}

.form-select {
    cursor: pointer;
    min-width: 160px;
}

.form-group label {
    display: block;
    margin-bottom: var(--space-1);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

.input-money,
.input-hours {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

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

/* ------------------------------------------------------------
   10. ALERTS & NOTIFICATIONS
   ------------------------------------------------------------ */
.alert-box {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
}

.alert-box i {
    font-size: 1rem;
    flex-shrink: 0;
}

.alert-box-warning {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.25);
    color: var(--color-warning);
}

.alert-box-success {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.25);
    color: var(--color-success);
}

.alert-box-danger {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.25);
    color: var(--color-danger);
}

.alerta-vencido {
    background: rgba(255, 68, 68, 0.15);
    color: var(--color-danger);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 600;
    text-align: center;
}

/* Horizontal notification box */
.notification-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: rgba(255, 107, 53, 0.08);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    font-size: var(--text-sm);
    animation: slideIn 0.3s ease;
}

.notification-banner.urgent {
    background: rgba(255, 68, 68, 0.08);
    border-color: rgba(255, 68, 68, 0.2);
}

.notification-banner.warning {
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.2);
}

.notification-banner-main {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    min-width: 0;
}

.notification-banner-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(255, 107, 53, 0.15);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.notification-banner.urgent .notification-banner-icon {
    background: rgba(255, 68, 68, 0.15);
    color: var(--color-danger);
}

.notification-banner.warning .notification-banner-icon {
    background: rgba(251, 191, 36, 0.15);
    color: var(--color-warning);
}

.notification-banner-content {
    flex: 1;
    min-width: 0;
}

.notification-banner-title {
    font-weight: 600;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.notification-banner-badge {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
}

.notification-banner-badge.urgent {
    background: rgba(255, 68, 68, 0.2);
    color: var(--color-danger);
}

.notification-banner-badge.warning {
    background: rgba(251, 191, 36, 0.2);
    color: var(--color-warning);
}

.notification-banner-date {
    color: var(--color-text-dim);
    font-weight: 400;
}

.notification-banner-text {
    color: var(--color-text-muted);
    line-height: 1.4;
}

.notification-banner-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.notification-count-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    font-weight: 700;
}

.notification-count-badge i {
    font-size: 0.75rem;
    color: var(--color-primary);
}

@media (max-width: 768px) {
    .notification-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }

    .notification-banner-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ------------------------------------------------------------
   11. DATA DISPLAY
   ------------------------------------------------------------ */
.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--text-sm);
}

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

.info-rows {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    transition: background 0.2s;
}

.info-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.info-row.active {
    background: rgba(155, 89, 182, 0.1);
}

.info-label {
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.info-value {
    font-weight: 600;
    text-align: right;
}

.info-value.urgente {
    color: var(--color-danger);
}

.info-value.atencao {
    color: var(--color-warning);
}

.summary-box {
    padding: var(--space-3);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
}

/* ------------------------------------------------------------
   12. TABLES
   ------------------------------------------------------------ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
    min-width: 600px;
}

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

.data-table th {
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.02);
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.data-table td {
    color: var(--color-text-secondary);
}

/* ------------------------------------------------------------
   13. EMPTY STATE
   ------------------------------------------------------------ */
.empty-state {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    color: var(--color-text-muted);
}

.empty-state .empty-icon,
.empty-state i {
    font-size: 3rem;
    margin-bottom: var(--space-3);
    opacity: 0.3;
}

.empty-state p {
    font-size: var(--text-base);
    margin-bottom: var(--space-1);
}

/* ------------------------------------------------------------
   14. MODALS
   ------------------------------------------------------------ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-4);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.2s ease;
}

.modal-content.modal-sm {
    max-width: 420px;
}

.modal-content.modal-lg {
    max-width: 900px;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-header h2 {
    font-size: var(--text-lg);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

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

.modal-body {
    padding: var(--space-4);
}

.modal-footer {
    display: flex;
    gap: var(--space-2);
    justify-content: flex-end;
    padding: var(--space-4);
    border-top: 1px solid var(--color-border);
    flex-wrap: wrap;
}

/* ------------------------------------------------------------
   15. UTILITIES
   ------------------------------------------------------------ */
.hidden { display: none !important; }
.w-full { width: 100%; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.mt-3 { margin-top: var(--space-3); }
.mb-3 { margin-bottom: var(--space-3); }
.rounded { border-radius: var(--radius-md); }

/* ------------------------------------------------------------
   16. RESPONSIVE UTILITIES
   ------------------------------------------------------------ */
@media (max-width: 768px) {
    .page-title {
        font-size: var(--text-xl);
    }

    .section-title {
        font-size: var(--text-base);
    }

    .card {
        padding: var(--space-3);
    }

    .actions-row {
        gap: var(--space-2);
    }

    .btn {
        padding: 8px 12px;
        font-size: var(--text-xs);
    }
}

/* ------------------------------------------------------------
   17. LEGACY COMPATIBILITY
   ------------------------------------------------------------ */
.glass-dark {
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid var(--color-border);
}

.status-success { color: var(--color-success); }
.status-warning { color: var(--color-warning); }
.status-danger { color: var(--color-danger); }

/* Pulse animation for stat cards */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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