@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ============================================
   MALDONADO & ASOCIADOS - SISTEMA LEGAL
   CSS Moderno y Responsivo v2.0
   Enero 2026
   ============================================ */

/* ============================================
   1. VARIABLES CSS (Design Tokens)
   ============================================ */
:root {
    /* Colores principales */
    --primary: #1a1a2e;
    --primary-light: #2d2d44;
    --primary-dark: #12121f;
    --secondary: #d4a853;
    --secondary-light: #e8c87a;
    --secondary-dark: #b8912e;
    
    /* Colores de estado */
    --success: #10b981;
    --success-light: #34d399;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --danger: #ef4444;
    --danger-light: #f87171;
    --info: #06b6d4;
    
    /* Grises (invertidos para dark theme) */
    --gray-50: #2a2a3d;
    --gray-100: #232336;
    --gray-200: #3d3d56;
    --gray-300: #4a4a65;
    --gray-400: #6b6b85;
    --gray-500: #8888a0;
    --gray-600: #a0a0b8;
    --gray-700: #c0c0d0;
    --gray-800: #e0e0ec;
    --gray-900: #f0f0f5;

    /* Dark theme surfaces */
    --bg-card: #2a2a3d;
    --bg-surface: #232336;
    --bg-input: #1e1e30;
    --border-gold: rgba(212, 168, 83, 0.3);
    --text-gold: #d4a853;
    --glow-gold: rgba(212, 168, 83, 0.15);
    --overlay-light: rgba(255, 255, 255, 0.15);
    --text-on-primary: #f0f0f5;

    /* Tipografía */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    
    /* Espaciado */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    
    /* Bordes */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.2);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.2);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.2);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.2);
    
    /* Transiciones */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Sidebar */
    --sidebar-width: 280px;
    --sidebar-collapsed: 70px;
    --header-height: 60px;
    
    /* Z-index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal: 300;
    --z-tooltip: 400;
    --z-toast: 500;

    /* Gradient surfaces (login, sidebar — se sobreescriben por tema) */
    --gradient-start:     #1a1a2e;
    --gradient-mid:       #2d2d44;
    --gradient-end:       #12121f;

    /* Accent con opacidades (dorado — se sobreescriben en tema claro) */
    --accent-08:          rgba(212, 168, 83, 0.08);
    --accent-10:          rgba(212, 168, 83, 0.10);
    --accent-15:          rgba(212, 168, 83, 0.15);
    --accent-20:          rgba(212, 168, 83, 0.20);
    --accent-30:          rgba(212, 168, 83, 0.30);
    --accent-40:          rgba(212, 168, 83, 0.40);

    /* Hover surface */
    --bg-hover:           rgba(212, 168, 83, 0.05);

    /* Overlays */
    --overlay-dark:       rgba(0, 0, 0, 0.6);
    --overlay-card:       rgba(0, 0, 0, 0.2);

    /* Easing curves premium */
    --ease-spring:        cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-decelerate:    cubic-bezier(0, 0, 0.2, 1);
    --ease-accelerate:    cubic-bezier(0.4, 0, 1, 1);
    --ease-standard:      cubic-bezier(0.4, 0, 0.2, 1);

    /* Sistema de sombras premium */
    --shadow-card:        0 1px 3px rgba(0,0,0,0.25), 0 4px 12px rgba(0,0,0,0.15);
    --shadow-card-hover:  0 8px 28px rgba(0,0,0,0.40), 0 2px 8px rgba(0,0,0,0.20);
    --shadow-gold:        0 4px 20px rgba(212,168,83,0.25);
    --shadow-modal:       0 25px 50px rgba(0,0,0,0.55), 0 10px 20px rgba(0,0,0,0.30);

    /* Tipografía tokens */
    --font-weight-normal:   400;
    --font-weight-medium:   500;
    --font-weight-semibold: 600;
    --font-weight-bold:     700;
    --tracking-tight:   -0.025em;
    --tracking-wide:     0.025em;
    --tracking-wider:    0.05em;
    --tracking-widest:   0.1em;

    /* Texto semántico — se adaptan a ambos temas */
    --text-heading:   #f0f0f5;
    --text-body:      #e0e0ec;
    --text-muted:     #8888a0;
    --text-on-accent: #1a1a2e;
}

/* ============================================
   2. RESET Y BASE
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-100);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'kern' 1;
}

/* Scrollbar premium */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--accent-20);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-40);
}

/* Text selection */
::selection {
    background: var(--accent-30);
    color: var(--gray-900);
}
::-moz-selection {
    background: var(--accent-30);
    color: var(--gray-900);
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

img {
    max-width: 100%;
    display: block;
}

ul, ol {
    list-style: none;
}

/* ============================================
   3. UTILIDADES
   ============================================ */
.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--gray-500); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }

/* ============================================
   4. LOGIN SCREEN
   ============================================ */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    background: linear-gradient(135deg, var(--gradient-end) 0%, var(--gradient-start) 50%, var(--gradient-mid) 100%);
    position: relative;
    overflow: hidden;
}

.login-screen::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--accent-08) 0%, transparent 60%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

.login-container {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-10);
    box-shadow: var(--shadow-modal);
    border: 1px solid var(--accent-20);
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    animation: modalContentIn 400ms var(--ease-spring) both;
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.login-header i {
    font-size: 3.5rem;
    color: var(--secondary);
    margin-bottom: var(--space-4);
    display: block;
}

.login-header h1 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-2);
}

.login-header p {
    color: var(--gray-500);
    font-size: var(--font-size-sm);
}

.login-form .form-group {
    margin-bottom: var(--space-5);
}

.login-form label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-2);
    font-size: var(--font-size-sm);
}

.login-form label i {
    color: var(--gray-400);
    font-size: var(--font-size-sm);
}

.login-form input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    transition: all var(--transition-fast);
    background: var(--bg-input);
    color: var(--gray-800);
}

.login-form input:focus {
    outline: none;
    border-color: var(--secondary);
    background: var(--bg-input);
    box-shadow: 0 0 0 3px var(--glow-gold);
}

.login-form input::placeholder {
    color: var(--gray-400);
}

.error-message {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.3);
    color: #f87171;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.btn-primary {
    width: 100%;
    padding: var(--space-3) var(--space-6);
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    color: white;
    font-weight: 600;
    font-size: var(--font-size-base);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 48px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.login-footer {
    margin-top: var(--space-8);
    text-align: center;
}

.login-footer p {
    font-size: var(--font-size-xs);
    color: var(--gray-400);
}

/* ============================================
   5. LAYOUT PRINCIPAL
   ============================================ */
.main-system {
    display: block;
    min-height: 100vh;
}

/* ============================================
   6. SIDEBAR
   ============================================ */
.sidebar {
    background: linear-gradient(180deg, var(--gradient-end) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    z-index: var(--z-sticky);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    border-bottom: 1px solid var(--accent-15);
    min-height: 80px;
}

.sidebar-header i {
    font-size: 1.5rem;
    color: var(--secondary);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-10);
    border-radius: var(--radius-md);
    border: 1px solid var(--accent-20);
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    white-space: nowrap;
    opacity: 1;
    transition: opacity var(--transition-fast);
}

.sidebar-collapsed .sidebar-header h2 {
    opacity: 0;
    width: 0;
}

/* Toggle button for sidebar */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: var(--space-4);
    left: var(--space-4);
    z-index: calc(var(--z-sticky) + 10);
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--primary-light);
}

/* Sidebar overlay — hidden by default, JS shows it on mobile when sidebar opens */
.sidebar-overlay {
    display: none;
}

/* Navigation Menu */
.nav-menu {
    flex: 1;
    padding: var(--space-4) 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-menu::-webkit-scrollbar {
    width: 4px;
}

.nav-menu::-webkit-scrollbar-track {
    background: transparent;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: var(--accent-30);
    border-radius: var(--radius-full);
}

.nav-item {
    margin: var(--space-1) var(--space-3);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    color: rgba(255,255,255,0.65);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    transition: all 200ms var(--ease-standard);
    white-space: nowrap;
    position: relative;
}

/* Left-border indicator — the premium active accent */
.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: 65%;
    background: var(--secondary);
    border-radius: 0 2px 2px 0;
    transform: translateY(-50%) scaleY(0);
    transform-origin: center;
    transition: transform 280ms var(--ease-spring);
}

.nav-link.active::before {
    transform: translateY(-50%) scaleY(1);
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: var(--font-size-base);
    flex-shrink: 0;
    transition: color 200ms var(--ease-standard);
}

.nav-link span {
    opacity: 1;
    transition: opacity var(--transition-fast);
}

.sidebar-collapsed .nav-link span {
    opacity: 0;
    width: 0;
}

.nav-link:hover {
    background: var(--accent-10);
    color: rgba(255,255,255,0.90);
    transform: translateX(2px);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--accent-15) 0%, var(--accent-08) 100%);
    color: var(--secondary);
    box-shadow: none;
    font-weight: var(--font-weight-semibold);
}

.nav-link.active i {
    color: var(--secondary);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--space-4);
    border-top: 1px solid var(--accent-15);
    background: var(--overlay-card);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    margin-bottom: var(--space-3);
}

.user-info > i {
    font-size: 2rem;
    color: var(--secondary-light);
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    font-size: var(--font-size-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: var(--font-size-xs);
    color: rgba(255,255,255,0.5);
}

.sidebar-collapsed .user-details {
    display: none;
}

.btn-logout {
    width: 100%;
    padding: var(--space-3);
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    transition: all var(--transition-fast);
}

.btn-logout:hover {
    background: var(--danger);
    color: white;
}

.sidebar-collapsed .btn-logout span {
    display: none;
}

/* ============================================
   7. MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    padding: var(--space-6);
    min-height: 100vh;
    transition: margin-left var(--transition-normal);
    max-width: calc(100vw - var(--sidebar-width));
}

.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed);
    max-width: calc(100vw - var(--sidebar-collapsed));
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modules */
.module {
    display: none;
}

.module.active {
    display: block;
    animation: fadeIn 300ms var(--ease-decelerate) both;
}

.module-header {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--gray-200);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
}

/* Gold accent line over the border */
.module-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary), transparent);
    border-radius: 2px;
}

.module-header h2 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    letter-spacing: var(--tracking-tight);
}

.module-header h2 i {
    color: var(--secondary);
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-10);
    border-radius: var(--radius-md);
    border: 1px solid var(--accent-20);
    font-size: var(--font-size-lg);
    flex-shrink: 0;
}
/* ============================================
   8. DASHBOARD & STATS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--gray-200);
    transition: all 300ms var(--ease-decelerate);
    position: relative;
    overflow: hidden;
}

/* Gold top-border reveal on hover */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--secondary), var(--secondary-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 350ms var(--ease-spring);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--accent-20);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-card:nth-child(1) .stat-icon { background: rgba(37,99,235,0.15); color: #60a5fa; }
.stat-card:nth-child(2) .stat-icon { background: rgba(217,119,6,0.15); color: #fbbf24; }
.stat-card:nth-child(3) .stat-icon { background: rgba(5,150,105,0.15); color: #34d399; }
.stat-card:nth-child(4) .stat-icon { background: rgba(124,58,237,0.15); color: #a78bfa; }

.stat-info h3 {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--gray-800);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    letter-spacing: var(--tracking-tight);
}

.stat-info p {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin-top: var(--space-1);
}

/* ============================================
   9. CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: box-shadow 300ms var(--ease-standard);
}

.card-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--primary-light);
}

.card-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.card-header h3 i {
    color: var(--secondary);
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--gray-200);
    background: var(--primary-light);
}

/* ============================================
   10. BOTONES
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-md);
    transition: all 200ms var(--ease-standard);
    min-height: 40px;
    white-space: nowrap;
    letter-spacing: var(--tracking-wide);
}

.btn:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 3px;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
    min-height: 32px;
}

.btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--font-size-base);
    min-height: 48px;
}

.btn-primary {
    background: var(--secondary);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
    transition: all 250ms var(--ease-spring);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--secondary);
    color: var(--secondary);
}

.btn-outline:hover {
    background: var(--secondary);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
}

.btn-ghost:hover {
    background: var(--gray-100);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

.btn-group {
    display: flex;
    gap: var(--space-2);
}

/* ============================================
   11. FORMULARIOS
   ============================================ */
.form-group {
    margin-bottom: var(--space-5);
}

.form-group label {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-600);
    margin-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
}

.form-group label .required {
    color: var(--danger);
    margin-left: var(--space-1);
}

.form-control {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-base);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--gray-800);
    transition: border-color 200ms var(--ease-standard), box-shadow 200ms var(--ease-standard);
    min-height: 44px;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px var(--glow-gold);
}

.form-control:focus-visible {
    outline: none;
}

.form-control:disabled,
.form-control[readonly] {
    background: var(--primary-dark);
    color: var(--gray-400);
    cursor: not-allowed;
}

.form-control::placeholder {
    color: var(--gray-400);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238888a0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}

.form-actions {
    display: flex;
    gap: var(--space-4);
    justify-content: flex-end;
    padding-top: var(--space-6);
    margin-top: var(--space-6);
    border-top: 1px solid var(--gray-200);
}

/* Form Section */
.form-section {
    background: var(--bg-card);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.form-section h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--secondary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.form-section h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--gray-600);
    margin: var(--space-6) 0 var(--space-4) 0;
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--secondary);
    cursor: pointer;
}

.form-check label {
    margin: 0;
    cursor: pointer;
}

/* ============================================
   12. TABLAS
   ============================================ */
.table-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.data-table thead {
    background: var(--primary-light);
    border-bottom: 2px solid var(--gray-300);
}

.data-table th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-weight: var(--font-weight-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    font-size: var(--font-size-xs);
    letter-spacing: var(--tracking-widest);
    white-space: nowrap;
}

.data-table td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background 150ms var(--ease-standard), box-shadow 150ms var(--ease-standard);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
    box-shadow: inset 3px 0 0 var(--secondary);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: var(--space-2);
    justify-content: flex-end;
}

/* Table Header with Actions */
.table-header {
    padding: var(--space-4) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-4);
    border-bottom: 1px solid var(--gray-100);
}

.table-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-800);
}

/* Table Footer / Pagination */
.table-footer {
    padding: var(--space-4) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-4);
    background: var(--primary-light);
    border-top: 1px solid var(--gray-100);
}

.table-info {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

.pagination {
    display: flex;
    gap: var(--space-1);
}

.pagination button {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    background: var(--bg-card);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-fast);
}

.pagination button:hover:not(:disabled) {
    background: var(--primary-light);
    border-color: var(--gray-300);
}

.pagination button.active {
    background: var(--secondary);
    color: var(--gradient-end);
    border-color: var(--secondary);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/* ============================================
   13. MODALES
   ============================================ */
@keyframes modalBackdropIn {
    from { background: rgba(0, 0, 0, 0); backdrop-filter: blur(0px); }
    to   { background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); }
}

@keyframes modalContentIn {
    from { opacity: 0; transform: translateY(32px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    z-index: var(--z-modal);
    animation: modalBackdropIn 220ms var(--ease-decelerate) both;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-modal);
    border: 1px solid var(--gray-200);
    animation: modalContentIn 320ms var(--ease-spring) 50ms both;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-lg .modal-content { max-width: 900px; }
.modal-xl .modal-content { max-width: 1200px; }
.modal-sm .modal-content { max-width: 400px; }

.modal-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.modal-header h3 i {
    color: var(--secondary);
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xl);
    color: var(--gray-400);
    transition: all 250ms var(--ease-spring);
}

.modal-close:hover {
    background: var(--primary-light);
    color: var(--gray-700);
    transform: rotate(90deg);
}

.modal-body {
    padding: var(--space-6);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    background: var(--primary-light);
}

/* ============================================
   14. BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-full);
    white-space: nowrap;
    border: 1px solid transparent;
    letter-spacing: var(--tracking-wide);
}

.badge-primary {
    background: rgba(37,99,235,0.15);
    color: #60a5fa;
    border-color: rgba(37,99,235,0.30);
}

.badge-secondary {
    background: var(--gray-100);
    color: var(--gray-600);
    border-color: var(--gray-300);
}

.badge-success {
    background: rgba(16,185,129,0.12);
    color: #34d399;
    border-color: rgba(16,185,129,0.28);
}

.badge-warning {
    background: rgba(245,158,11,0.12);
    color: #fbbf24;
    border-color: rgba(245,158,11,0.28);
}

.badge-danger {
    background: rgba(239,68,68,0.12);
    color: #f87171;
    border-color: rgba(239,68,68,0.28);
}

.badge-info {
    background: rgba(6,182,212,0.12);
    color: #22d3ee;
    border-color: rgba(6,182,212,0.28);
}

.badge-purple {
    background: rgba(109,40,217,0.12);
    color: #a78bfa;
    border-color: rgba(109,40,217,0.28);
}

.badge-lg {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
}

/* ============================================
   15. BÚSQUEDA Y FILTROS
   ============================================ */
.search-section {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.search-box input {
    width: 100%;
    padding: var(--space-3) var(--space-4) var(--space-3) 44px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    background: var(--bg-input);
    color: var(--gray-800);
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px var(--glow-gold);
}

.filters {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.filter-select {
    min-width: 150px;
}

/* Advanced Filters Panel */
.filters-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-4);
}

.filters-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--gray-200);
}

/* ============================================
   16. TABS
   ============================================ */
.tabs {
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: var(--space-6);
}

.tabs-nav {
    display: flex;
    gap: var(--space-1);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tabs-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: var(--space-3) var(--space-5);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color 200ms var(--ease-standard);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    position: relative;
}

/* Spring underline indicator */
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--secondary);
    border-radius: 2px 2px 0 0;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 280ms var(--ease-spring);
}

.tab-btn:hover {
    color: var(--gray-700);
}

.tab-btn.active {
    color: var(--secondary);
    border-bottom-color: transparent;
    font-weight: var(--font-weight-semibold);
}

.tab-btn.active::after {
    transform: scaleX(1);
}

.tab-btn .count {
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
}

.tab-btn.active .count {
    background: var(--accent-20);
    color: var(--secondary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 280ms var(--ease-decelerate) both;
}

/* Vertical Tabs */
.tabs-vertical {
    display: flex;
    gap: var(--space-6);
    border: none;
}

.tabs-vertical .tabs-nav {
    flex-direction: column;
    border-right: 2px solid var(--gray-200);
    border-bottom: none;
    padding-right: var(--space-4);
    min-width: 200px;
}

.tabs-vertical .tab-btn {
    border-bottom: none;
    border-right: 2px solid transparent;
    margin-bottom: 0;
    margin-right: -2px;
    text-align: left;
    justify-content: flex-start;
}

.tabs-vertical .tab-btn.active {
    border-right-color: var(--secondary);
}

.tabs-vertical .tab-content-wrapper {
    flex: 1;
}

/* ============================================
   17. ALERTAS Y NOTIFICACIONES
   ============================================ */
.alert {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.alert i {
    font-size: var(--font-size-lg);
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.alert-message {
    font-size: var(--font-size-sm);
}

.alert-success {
    background: rgba(16,185,129,0.15);
    border: 1px solid rgba(16,185,129,0.3);
    color: #34d399;
}

.alert-warning {
    background: rgba(245,158,11,0.15);
    border: 1px solid rgba(245,158,11,0.3);
    color: #fbbf24;
}

.alert-danger {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.3);
    color: #f87171;
}

.alert-info {
    background: rgba(37,99,235,0.15);
    border: 1px solid rgba(37,99,235,0.3);
    color: #60a5fa;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.toast {
    background: var(--bg-card);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 300px;
    max-width: 450px;
    animation: slideInRight 350ms var(--ease-spring) both;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(60px) scale(0.96); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ============================================
   18. LOADING STATES
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(18, 18, 31, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    margin-top: var(--space-4);
    font-size: var(--font-size-base);
    color: var(--gray-600);
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-300) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: var(--space-2);
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: var(--space-3);
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
}

/* ============================================
   19. EMPTY STATES
   ============================================ */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--gray-500);
}

.empty-state i {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: var(--space-4);
}

.empty-state h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-2);
}

.empty-state p {
    font-size: var(--font-size-base);
    max-width: 400px;
    margin: 0 auto var(--space-6);
}

/* ============================================
   20. TOOLTIPS
   ============================================ */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-2) var(--space-3);
    background: var(--gray-800);
    color: white;
    font-size: var(--font-size-xs);
    border-radius: var(--radius-md);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: var(--z-tooltip);
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}
/* ============================================
   21. MÓDULO CIVIL - LISTA DE CASOS
   ============================================ */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-5);
}

.case-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.case-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.case-card-header {
    padding: var(--space-4) var(--space-5);
    background: var(--primary-light);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.case-card-header h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--space-1);
}

.case-card-header .case-number {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
}

.case-card-body {
    padding: var(--space-4) var(--space-5);
}

.case-detail {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: var(--font-size-sm);
}

.case-detail:last-child {
    border-bottom: none;
}

.case-detail-label {
    color: var(--gray-500);
}

.case-detail-value {
    color: var(--gray-800);
    font-weight: 500;
}

.case-card-footer {
    padding: var(--space-3) var(--space-5);
    background: var(--primary-light);
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: var(--space-2);
    justify-content: flex-end;
}

/* Case View Detail */
.case-view {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.case-view-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.case-view-title h2 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--space-1);
}

.case-view-title p {
    color: var(--gray-500);
    font-size: var(--font-size-sm);
}

/* ============================================
   22. CHECKLIST DE DOCUMENTOS
   ============================================ */
.checklist-container {
    background: var(--primary-light);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.checklist-section {
    margin-bottom: var(--space-6);
}

.checklist-section:last-child {
    margin-bottom: 0;
}

.checklist-section h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--secondary);
}

.checklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-3);
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-fast);
}

.checklist-item:hover {
    border-color: var(--secondary);
}

.checklist-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--success);
    cursor: pointer;
}

.checklist-item label {
    flex: 1;
    font-size: var(--font-size-sm);
    color: var(--gray-700);
    cursor: pointer;
}

.checklist-item.completed {
    background: rgba(16,185,129,0.15);
    border-color: var(--success);
}

.checklist-item.completed label {
    text-decoration: line-through;
    color: var(--gray-500);
}

.checklist-item .btn-solicitar {
    padding: var(--space-1) var(--space-2);
    font-size: var(--font-size-xs);
    background: var(--warning);
    color: white;
    border-radius: var(--radius-sm);
}

/* ============================================
   23. PETICIONES
   ============================================ */
.peticiones-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.peticiones-stats {
    display: flex;
    gap: var(--space-4);
}

.peticion-stat {
    text-align: center;
    padding: var(--space-3) var(--space-5);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.peticion-stat-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--gray-800);
}

.peticion-stat-label {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    text-transform: uppercase;
}

.peticiones-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.peticion-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.peticion-card-header {
    padding: var(--space-4) var(--space-5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-100);
    background: var(--primary-light);
}

.peticion-card-header h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.peticion-card-body {
    padding: var(--space-4) var(--space-5);
}

.peticion-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}

.peticion-info-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.peticion-info-label {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    text-transform: uppercase;
}

.peticion-info-value {
    font-size: var(--font-size-sm);
    color: var(--gray-800);
    font-weight: 500;
}

.peticion-description {
    margin-top: var(--space-4);
    padding: var(--space-4);
    background: var(--primary-light);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    color: var(--gray-700);
}

.peticion-card-footer {
    padding: var(--space-4) var(--space-5);
    background: var(--primary-light);
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.peticion-timeline {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--font-size-xs);
    color: var(--gray-500);
}

.peticion-timeline-step {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.peticion-timeline-step.completed {
    color: var(--success);
}

.peticion-timeline-step.current {
    color: var(--secondary);
    font-weight: 600;
}

/* ============================================
   24. AUDIENCIAS
   ============================================ */
.audiencias-calendar {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
}

.audiencias-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.audiencia-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--primary-light);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--secondary);
    transition: all var(--transition-fast);
}

.audiencia-item:hover {
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
}

.audiencia-item.urgente {
    border-left-color: var(--danger);
}

.audiencia-item.completada {
    border-left-color: var(--success);
    opacity: 0.7;
}

.audiencia-fecha {
    min-width: 70px;
    text-align: center;
    padding: var(--space-2);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.audiencia-fecha .dia {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.audiencia-fecha .mes {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    text-transform: uppercase;
}

.audiencia-content {
    flex: 1;
}

.audiencia-content h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--space-1);
}

.audiencia-content p {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin-bottom: var(--space-2);
}

.audiencia-meta {
    display: flex;
    gap: var(--space-4);
    font-size: var(--font-size-xs);
    color: var(--gray-500);
}

.audiencia-meta span {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

/* ============================================
   25. ADMIN MODULE
   ============================================ */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
}

.admin-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.admin-card h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.admin-card h3 i {
    color: var(--secondary);
}

/* User Management */
.users-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.user-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--primary-light);
    border-radius: var(--radius-md);
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--secondary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.user-info {
    flex: 1;
}

.user-info h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--gray-800);
}

.user-info p {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

.user-actions {
    display: flex;
    gap: var(--space-2);
}

/* ============================================
   26. REPORTES
   ============================================ */
.report-controls {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}

.report-chart {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-6);
}

.report-chart h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-4);
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.report-summary-item {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.report-summary-value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--primary);
}

.report-summary-label {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin-top: var(--space-1);
}

/* ============================================
   27. CALCULADORA MORA
   ============================================ */
.calculadora-container {
    max-width: 800px;
    margin: 0 auto;
}

.calculadora-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-6);
}

.calculadora-result {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--secondary-dark) 100%);
    color: white;
    padding: var(--space-8);
    border-radius: var(--radius-lg);
    text-align: center;
}

.calculadora-result h3 {
    font-size: var(--font-size-lg);
    opacity: 0.9;
    margin-bottom: var(--space-2);
}

.calculadora-result .amount {
    font-size: var(--font-size-3xl);
    font-weight: 700;
}

/* ============================================
   28. TIMELINE / ETAPAS
   ============================================ */
.timeline {
    position: relative;
    padding-left: var(--space-8);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-300);
}

.timeline-item {
    position: relative;
    padding-bottom: var(--space-6);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: calc(-1 * var(--space-8) + 7px);
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: var(--gray-300);
    border: 3px solid var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.timeline-item.completed .timeline-marker {
    background: var(--success);
}

.timeline-item.current .timeline-marker {
    background: var(--secondary);
    box-shadow: 0 0 0 4px var(--glow-gold);
}

.timeline-content {
    background: var(--bg-card);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
}

.timeline-content h4 {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--gray-800);
}

.timeline-content p {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    margin-top: var(--space-1);
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary) 0%, var(--success) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}
/* ============================================
   29. SELECT2 OVERRIDES
   ============================================ */
.select2-container--default .select2-selection--single {
    height: 44px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-input);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 28px;
    color: var(--gray-800);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px var(--glow-gold);
}

.select2-dropdown {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    background: var(--bg-card);
}

.select2-results__option--highlighted[aria-selected] {
    background-color: var(--secondary) !important;
    color: var(--gradient-end) !important;
}

/* (Select2 Multiple overrides movidos a styles-modules.css como panel personalizado) */

/* ============================================
   30. PRINT STYLES
   ============================================ */
@media print {
    .sidebar,
    .sidebar-toggle,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .module {
        box-shadow: none !important;
    }
    
    body {
        background: white !important;
    }
}

/* ============================================
   31. RESPONSIVE - DESKTOP GRANDE (1400px+)
   ============================================ */
@media (min-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .cases-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .form-row {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   32. RESPONSIVE - DESKTOP (1200px - 1399px)
   ============================================ */
@media (max-width: 1399px) {
    :root {
        --sidebar-width: 260px;
    }
}

/* ============================================
   33. RESPONSIVE - LAPTOP (992px - 1199px)
   ============================================ */
@media (max-width: 1199px) {
    :root {
        --sidebar-width: 240px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cases-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   34. RESPONSIVE - TABLET LANDSCAPE (768px - 991px)
   ============================================ */
@media (max-width: 991px) {
    :root {
        --sidebar-width: 70px;
    }
    
    /* Sidebar colapsado por defecto en tablet */
    .sidebar {
        width: var(--sidebar-width);
    }
    
    .sidebar-header h2,
    .nav-link span,
    .user-details,
    .btn-logout span {
        display: none;
    }
    
    .sidebar-header {
        justify-content: center;
        padding: var(--space-4);
    }
    
    .nav-link {
        justify-content: center;
        padding: var(--space-3);
    }

    .nav-link:hover {
        transform: none;
    }
    
    .nav-item {
        margin: var(--space-1) var(--space-2);
    }
    
    .user-info {
        justify-content: center;
    }
    
    .btn-logout {
        padding: var(--space-3);
    }
    
    .main-content {
        margin-left: var(--sidebar-width);
        padding: var(--space-5);
        max-width: calc(100vw - var(--sidebar-width));
    }

    /* Sidebar expandido en hover para tablet */
    .sidebar:hover {
        width: 260px;
    }
    
    .sidebar:hover .sidebar-header h2,
    .sidebar:hover .nav-link span,
    .sidebar:hover .user-details,
    .sidebar:hover .btn-logout span {
        display: block;
    }
    
    .sidebar:hover .sidebar-header {
        justify-content: flex-start;
        padding: var(--space-6);
    }
    
    .sidebar:hover .nav-link {
        justify-content: flex-start;
        padding: var(--space-3) var(--space-4);
    }
    
    .sidebar:hover .nav-item {
        margin: var(--space-1) var(--space-3);
    }
    
    .sidebar:hover .user-info {
        justify-content: flex-start;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }
    
    .stat-card {
        padding: var(--space-4);
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .stat-info h3 {
        font-size: var(--font-size-2xl);
    }
    
    /* Forms */
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-actions {
        flex-wrap: wrap;
    }
    
    /* Tables */
    .table-header,
    .table-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    /* Modals */
    .modal-content {
        max-width: 90%;
    }
    
    .modal-lg .modal-content {
        max-width: 95%;
    }
    
    /* Cards */
    .cases-grid {
        grid-template-columns: 1fr;
    }
    
    /* Peticiones */
    .peticiones-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .peticiones-stats {
        justify-content: space-around;
    }
    
    /* Tabs */
    .tabs-vertical {
        flex-direction: column;
    }
    
    .tabs-vertical .tabs-nav {
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 2px solid var(--gray-200);
        padding-right: 0;
        padding-bottom: var(--space-3);
        min-width: auto;
    }
    
    .tabs-vertical .tab-btn {
        border-right: none;
        border-bottom: 2px solid transparent;
        margin-right: 0;
        margin-bottom: -2px;
    }
    
    .tabs-vertical .tab-btn.active {
        border-bottom-color: var(--secondary);
    }
}

/* ============================================
   35. RESPONSIVE - TABLET PORTRAIT (576px - 767px)
   ============================================ */
@media (max-width: 767px) {
    /* Sidebar oculto, mostrar toggle */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar.open ~ .sidebar-overlay {
        display: block;
    }
    
    /* Restaurar textos del sidebar cuando está abierto */
    .sidebar.open .sidebar-header h2,
    .sidebar.open .nav-link span,
    .sidebar.open .user-details,
    .sidebar.open .btn-logout span {
        display: block;
    }
    
    .sidebar.open .sidebar-header {
        justify-content: flex-start;
        padding: var(--space-6);
    }
    
    .sidebar.open .nav-link {
        justify-content: flex-start;
        padding: var(--space-3) var(--space-4);
    }
    
    .sidebar.open .nav-item {
        margin: var(--space-1) var(--space-3);
    }
    
    .sidebar.open .user-info {
        justify-content: flex-start;
    }
    
    /* Quitar el hover effect que ya no necesitamos */
    .sidebar:hover {
        width: 280px;
    }
    
    .sidebar-toggle {
        display: flex;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: calc(var(--z-sticky) - 1);
    }
    
    .main-content {
        margin-left: 0;
        padding: var(--space-4);
        padding-top: calc(var(--space-4) + 60px);
    }
    
    .module-header h2 {
        font-size: var(--font-size-xl);
    }
    
    /* Stats en 2 columnas */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: var(--space-4);
    }
    
    .stat-icon {
        margin-bottom: var(--space-2);
    }
    
    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-section {
        padding: var(--space-4);
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    /* Search */
    .search-section {
        flex-direction: column;
    }
    
    .search-box {
        max-width: none;
        width: 100%;
    }
    
    .filters {
        width: 100%;
    }
    
    .filters select,
    .filter-select {
        flex: 1;
    }
    
    /* Tables responsive */
    .table-wrapper {
        margin: 0 calc(-1 * var(--space-4));
        padding: 0 var(--space-4);
    }
    
    .data-table {
        font-size: var(--font-size-xs);
    }
    
    .data-table th,
    .data-table td {
        padding: var(--space-3);
    }
    
    /* Modals */
    .modal {
        padding: var(--space-3);
        align-items: flex-end;
    }
    
    .modal-content {
        max-width: 100%;
        max-height: 85vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: var(--space-4);
    }
    
    /* Cards */
    .card-header,
    .card-body,
    .card-footer {
        padding: var(--space-4);
    }
    
    /* Peticiones */
    .peticiones-stats {
        flex-wrap: wrap;
    }
    
    .peticion-stat {
        flex: 1;
        min-width: 100px;
    }
    
    .peticion-info-grid {
        grid-template-columns: 1fr;
    }
    
    .peticion-card-footer {
        flex-direction: column;
        gap: var(--space-3);
    }
    
    /* Audiencias */
    .audiencia-item {
        flex-direction: column;
    }
    
    .audiencia-fecha {
        align-self: flex-start;
    }
    
    .audiencia-meta {
        flex-wrap: wrap;
    }
    
    /* Tabs */
    .tabs-nav {
        gap: 0;
    }
    
    .tab-btn {
        padding: var(--space-3);
        font-size: var(--font-size-xs);
    }
    
    /* Buttons */
    .btn-group {
        flex-wrap: wrap;
    }
    
    .btn-lg {
        padding: var(--space-3) var(--space-4);
    }
    
    /* Login */
    .login-container {
        padding: var(--space-6);
    }
    
    .login-header i {
        font-size: 2.5rem;
    }
    
    .login-header h1 {
        font-size: var(--font-size-xl);
    }
}

/* ============================================
   36. RESPONSIVE - MÓVIL (< 576px)
   ============================================ */
@media (max-width: 575px) {
    :root {
        --space-6: 1.25rem;
    }
    
    body {
        font-size: 14px;
    }
    
    .main-content {
        padding: var(--space-3);
        padding-top: calc(var(--space-3) + 60px);
    }
    
    .module-header {
        margin-bottom: var(--space-4);
    }
    
    .module-header h2 {
        font-size: var(--font-size-lg);
    }
    
    /* Stats en 1 columna */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }
    
    .stat-card {
        flex-direction: row;
        text-align: left;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
    
    .stat-info h3 {
        font-size: var(--font-size-xl);
    }
    
    /* Cards compactas */
    .case-card-header,
    .case-card-body,
    .case-card-footer {
        padding: var(--space-3);
    }
    
    .peticion-card-header,
    .peticion-card-body {
        padding: var(--space-3);
    }
    
    /* Ocultar columnas menos importantes en tablas */
    .data-table .hide-mobile {
        display: none;
    }
    
    /* Botones full width */
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .table-actions {
        flex-direction: column;
    }
    
    .table-actions .btn {
        width: 100%;
    }
    
    /* Filtros apilados */
    .filters {
        flex-direction: column;
    }
    
    .filters select,
    .filter-select {
        width: 100%;
    }
    
    /* Badges más pequeños */
    .badge {
        font-size: 10px;
        padding: 2px var(--space-2);
    }
    
    /* Checklist */
    .checklist-grid {
        grid-template-columns: 1fr;
    }
    
    /* Timeline compact */
    .timeline {
        padding-left: var(--space-6);
    }
    
    .timeline-marker {
        left: calc(-1 * var(--space-6) + 5px);
        width: 14px;
        height: 14px;
    }
    
    /* Peticiones stats */
    .peticiones-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .peticion-stat {
        padding: var(--space-3);
    }
    
    .peticion-stat-value {
        font-size: var(--font-size-xl);
    }
    
    /* Login mobile */
    .login-container {
        padding: var(--space-5);
        border-radius: var(--radius-lg);
    }
    
    .login-header {
        margin-bottom: var(--space-6);
    }
    
    .login-header i {
        font-size: 2rem;
    }
    
    .login-form .form-group {
        margin-bottom: var(--space-4);
    }
    
    /* Modals mobile */
    .modal-header h3 {
        font-size: var(--font-size-base);
    }
}

/* ============================================
   37. TOUCH OPTIMIZATIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Aumentar áreas táctiles */
    .btn {
        min-height: 48px;
    }
    
    .btn-sm {
        min-height: 40px;
    }
    
    .nav-link {
        padding: var(--space-4);
    }
    
    .form-control,
    .select2-container--default .select2-selection--single {
        min-height: 48px;
    }
    
    .checklist-item {
        padding: var(--space-4);
    }
    
    .checklist-item input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }
    
    .pagination button {
        min-width: 44px;
        height: 44px;
    }
    
    .tab-btn {
        padding: var(--space-4) var(--space-5);
    }
    
    /* Eliminar efectos hover que no aplican en touch */
    .case-card:hover,
    .stat-card:hover,
    .btn:hover {
        transform: none;
    }
}



/* ============================================
   38. DARK MODE (Now active by default)
   ============================================ */

/* ============================================
   39. REDUCE MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   40. HIGH CONTRAST
   ============================================ */
@media (prefers-contrast: high) {
    :root {
        --gray-200: #000;
        --gray-300: #000;
    }
    
    .btn,
    .form-control,
    .card {
        border-width: 2px;
    }
}

/* ============================================
   41. PREMIUM MICRO-ANIMATIONS
   ============================================ */

/* Gold hover glow on cards */
.card:hover,
.case-card:hover,
.stat-card:hover,
.peticion-card:hover,
.fecha-card:hover,
.solicitud-card:hover,
.proceso-card:hover,
.admin-card:hover,
.calculadora-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.3), 0 0 15px var(--glow-gold);
}

/* Sidebar shimmer effect on logo */
.sidebar-header i {
    position: relative;
    overflow: hidden;
}

@keyframes gold-shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.sidebar-header h2 {
    background: linear-gradient(90deg, #e8c87a 0%, #d4a853 40%, #fff5d4 50%, #d4a853 60%, #e8c87a 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gold-shimmer 6s linear infinite;
}

/* Gold focus glow on inputs */
.form-control:focus,
.login-form input:focus,
.search-box input:focus,
.filtro-input:focus,
.filtro-select:focus {
    box-shadow: 0 0 0 3px var(--glow-gold), 0 0 15px var(--accent-10);
}

/* Subtle border glow on active buttons */
.btn-primary:hover {
    box-shadow: 0 4px 15px var(--accent-40);
}

/* Progress bar gold gradient */
.progress-bar-fill {
    background: linear-gradient(90deg, var(--secondary-dark) 0%, var(--secondary) 50%, var(--secondary-light) 100%);
}

/* Smooth badge entrance */
.badge {
    transition: all var(--transition-fast);
}

.badge:hover {
    transform: scale(1.05);
}

/* Toast entrance with subtle gold border */
.toast {
    border-left: 3px solid var(--secondary);
}

/* Spinner uses gold */
.spinner {
    border-top-color: var(--secondary);
}

/* ============================================
   THEME DEFINITIONS
   ============================================ */

/* Theme: Light Professional (Blanco-Azul) */
[data-theme="light"] {
    /* Colores principales */
    --primary:        #1e3a5f;
    --primary-light:  #f0f4f8;
    --primary-dark:   #0d2137;
    --secondary:      #2563eb;
    --secondary-light: #60a5fa;
    --secondary-dark: #1d4ed8;

    /* Grises (escala normal para modo claro) */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Superficies */
    --bg-card:    #ffffff;
    --bg-surface: #f3f4f6;
    --bg-input:   #ffffff;

    /* Acento (azul en lugar de dorado) */
    --border-gold:    rgba(37, 99, 235, 0.20);
    --text-gold:      #1e3a5f;
    --glow-gold:      rgba(37, 99, 235, 0.10);
    --overlay-light:  rgba(0, 0, 0, 0.05);
    --text-on-primary: #ffffff;

    /* Sombras (más suaves en modo claro) */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.04);

    /* Gradientes (azul marino) */
    --gradient-start:  #1e3a5f;
    --gradient-mid:    #2d5a8e;
    --gradient-end:    #0d2137;

    /* Accent con opacidades (azul) */
    --accent-08:  rgba(37, 99, 235, 0.08);
    --accent-10:  rgba(37, 99, 235, 0.10);
    --accent-15:  rgba(37, 99, 235, 0.15);
    --accent-20:  rgba(37, 99, 235, 0.20);
    --accent-30:  rgba(37, 99, 235, 0.30);
    --accent-40:  rgba(37, 99, 235, 0.40);

    /* Hover / overlays */
    --bg-hover:     rgba(37, 99, 235, 0.05);
    --overlay-dark: rgba(0, 0, 0, 0.30);
    --overlay-card: rgba(0, 0, 0, 0.05);

    /* Sombras (suaves en modo claro) */
    --shadow-card:        0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-card-hover:  0 8px 28px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    --shadow-gold:        0 4px 20px rgba(37,99,235,0.20);
    --shadow-modal:       0 25px 50px rgba(0,0,0,0.18), 0 10px 20px rgba(0,0,0,0.08);

    /* Texto semántico — tema claro */
    --text-heading:   #111827;
    --text-body:      #1f2937;
    --text-muted:     #6b7280;
    --text-on-accent: #ffffff;
}

/* ============================================
   THEME SELECTOR UI
   ============================================ */
.theme-selector {
    position: relative;
    margin: var(--space-2) var(--space-3);
}

.btn-theme {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-2) var(--space-3);
    background: var(--overlay-light);
    color: var(--gray-700);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

.btn-theme:hover {
    background: var(--glow-gold);
    color: var(--secondary);
}

.btn-theme i {
    font-size: var(--font-size-base);
}

.theme-options {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-dropdown);
    overflow: hidden;
}

.theme-options.show {
    display: block;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-2) var(--space-3);
    background: transparent;
    color: var(--gray-700);
    border: none;
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: background var(--transition-fast);
    text-align: left;
}

.theme-option:hover {
    background: var(--overlay-light);
}

.theme-option.active {
    color: var(--secondary);
    font-weight: 600;
}

.theme-preview {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    border: 2px solid var(--gray-300);
    flex-shrink: 0;
}

.theme-preview.dark-gold {
    background: linear-gradient(135deg, #1a1a2e 50%, #d4a853 50%);
}

.theme-preview.light {
    background: linear-gradient(135deg, #f3f4f6 50%, #2563eb 50%);
}

/* Sidebar collapsed: only show icon */
.sidebar.collapsed .btn-theme span,
.sidebar.collapsed .theme-options {
    display: none;
}

.sidebar.collapsed .btn-theme {
    justify-content: center;
    padding: var(--space-2);
}

/* ============================================
   THEME-AWARE OVERRIDES
   ============================================ */

/* Light theme: sidebar usa azul marino oscuro */
[data-theme="light"] .sidebar {
    background: linear-gradient(180deg, var(--gradient-end) 0%, var(--primary-dark) 100%);
}

[data-theme="light"] .sidebar .nav-link,
[data-theme="light"] .sidebar .user-info,
[data-theme="light"] .sidebar .user-name,
[data-theme="light"] .sidebar .user-role,
[data-theme="light"] .btn-theme,
[data-theme="light"] .theme-option {
    color: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.90);
}

[data-theme="light"] .sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #93c5fd;
}

[data-theme="light"] .sidebar .nav-link.active::before {
    background: #60a5fa;
}

[data-theme="light"] .sidebar .nav-link.active i {
    color: #93c5fd;
}

[data-theme="light"] .theme-options {
    background: var(--primary);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="light"] .theme-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Light theme: login screen */
[data-theme="light"] .login-screen {
    background: linear-gradient(135deg, var(--gradient-end) 0%, var(--gradient-start) 50%, var(--gradient-mid) 100%);
}

[data-theme="light"] .login-container {
    background: var(--bg-card);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-20);
}

/* Light theme: sidebar header shimmer — azul */
[data-theme="light"] .sidebar-header h2 {
    background: linear-gradient(90deg, #60a5fa 0%, #2563eb 40%, #93c5fd 50%, #2563eb 60%, #60a5fa 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Light theme: body background */
[data-theme="light"] body {
    color: var(--gray-800);
    background-color: var(--bg-surface);
}