/**
 * Estilos globales del Sistema CMGP v2.0
 * Diseño moderno, responsive y profesional
 */

/* ========================================
   RESET Y VARIABLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* ========================================
       DESIGN SYSTEM TOKENS - Nivel 1: Paleta
       Valores crudos de color (no usar directamente en componentes)
       ======================================== */

    /* Azules */
    --ds-blue-50: #eff6ff;
    --ds-blue-100: #dbeafe;
    --ds-blue-500: #3b82f6;
    --ds-blue-600: #2563eb;
    --ds-blue-700: #1d4ed8;
    --ds-blue-800: #1e40af;
    --ds-blue-900: #0F4C81;

    /* Grises */
    --ds-gray-50: #f9fafb;
    --ds-gray-100: #f3f4f6;
    --ds-gray-200: #e5e7eb;
    --ds-gray-300: #d1d5db;
    --ds-gray-400: #9ca3af;
    --ds-gray-500: #6b7280;
    --ds-gray-600: #4b5563;
    --ds-gray-700: #374151;
    --ds-gray-800: #1f2937;
    --ds-gray-900: #111827;

    /* Estados */
    --ds-green-500: #10b981;
    --ds-green-600: #059669;
    --ds-red-500: #ef4444;
    --ds-red-600: #dc2626;
    --ds-yellow-500: #f59e0b;
    --ds-yellow-600: #d97706;
    --ds-cyan-500: #06b6d4;

    /* ========================================
       DESIGN SYSTEM TOKENS - Nivel 2: Semanticos
       Proposito (usar estos en componentes)
       ======================================== */

    /* Colores principales */
    --ds-primary: var(--ds-blue-900);
    --ds-primary-hover: var(--ds-blue-800);
    --ds-primary-light: var(--ds-blue-100);
    --ds-secondary: var(--ds-gray-600);
    --ds-accent: var(--ds-blue-500);

    /* Colores de estado */
    --ds-success: var(--ds-green-500);
    --ds-success-hover: var(--ds-green-600);
    --ds-danger: var(--ds-red-500);
    --ds-danger-hover: var(--ds-red-600);
    --ds-warning: var(--ds-yellow-500);
    --ds-warning-hover: var(--ds-yellow-600);
    --ds-info: var(--ds-cyan-500);

    /* Fondos */
    --ds-bg-page: var(--ds-gray-50);
    --ds-bg-card: #ffffff;
    --ds-bg-sidebar: linear-gradient(180deg, var(--ds-primary) 0%, var(--ds-blue-800) 100%);
    --ds-bg-header: rgba(255, 255, 255, 0.95);

    /* Texto */
    --ds-text-primary: var(--ds-gray-900);
    --ds-text-secondary: var(--ds-gray-600);
    --ds-text-muted: var(--ds-gray-400);
    --ds-text-on-primary: #ffffff;

    /* Bordes */
    --ds-border: var(--ds-gray-200);
    --ds-border-focus: var(--ds-accent);

    /* ========================================
       DESIGN SYSTEM TOKENS - Espaciado (escala base-4)
       ======================================== */
    --ds-space-1: 4px;
    --ds-space-2: 8px;
    --ds-space-3: 12px;
    --ds-space-4: 16px;
    --ds-space-5: 20px;
    --ds-space-6: 24px;
    --ds-space-8: 32px;
    --ds-space-10: 40px;
    --ds-space-12: 48px;
    --ds-space-16: 64px;

    /* ========================================
       DESIGN SYSTEM TOKENS - Tipografia
       ======================================== */
    --ds-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ds-font-xs: 0.75rem;
    --ds-font-sm: 0.875rem;
    --ds-font-base: 1rem;
    --ds-font-lg: 1.125rem;
    --ds-font-xl: 1.25rem;
    --ds-font-2xl: 1.5rem;
    --ds-font-3xl: 1.875rem;

    --ds-weight-regular: 400;
    --ds-weight-medium: 500;
    --ds-weight-semibold: 600;
    --ds-weight-bold: 700;

    /* ========================================
       DESIGN SYSTEM TOKENS - Sombras
       ======================================== */
    --ds-shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.05);
    --ds-shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --ds-shadow-strong: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --ds-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* ========================================
       DESIGN SYSTEM TOKENS - Border Radius
       ======================================== */
    --ds-radius-sm: 4px;
    --ds-radius-base: 8px;
    --ds-radius-lg: 12px;
    --ds-radius-xl: 16px;

    /* ========================================
       DESIGN SYSTEM TOKENS - Transiciones
       ======================================== */
    --ds-transition-fast: all 0.15s ease;
    --ds-transition-base: all 0.3s ease;
    --ds-transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* ========================================
       DESIGN SYSTEM TOKENS - Breakpoints (referencia)
       Usados en media queries, no como variables CSS
       --ds-bp-mobile: 480px
       --ds-bp-tablet: 768px
       --ds-bp-tablet-landscape: 1024px
       --ds-bp-desktop: >1024px
       ======================================== */

    /* ========================================
       ALIASES TEMPORALES - Tokens antiguos
       Mantener para compatibilidad con modulos existentes
       ======================================== */

    /* Colores principales */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #93c5fd;
    
    --success: #10b981;
    --success-light: #6ee7b7;
    
    --danger: #ef4444;
    --danger-light: #fca5a5;
    
    --warning: #f59e0b;
    --warning-light: #fcd34d;
    
    --info: #06b6d4;
    --info-light: #67e8f9;
    
    /* Grises */
    --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;
    
    /* Tipografia */
    --font-family: -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 */
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Transiciones */
    --transition: all 0.3s ease;
}

/* ========================================
   BASE
   ======================================== */
body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--gray-900);
    background-color: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   BOTONES
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1.25;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Proteccion contra multiples disparos */
.btn-loading {
    opacity: 0.6;
    cursor: wait;
    pointer-events: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background-color: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-success:hover:not(:disabled) {
    background-color: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--gray-100);
    color: var(--gray-900);
    border-color: var(--gray-300);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--gray-200);
    border-color: var(--gray-400);
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: var(--font-size-lg);
}

/* Boton Limpiar Filtros - Uniforme (naranja) */
.btn-clear-filter,
.btn-modern.btn-clear-filter {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1.5px solid #f59e0b;
}

.btn-clear-filter:hover:not(:disabled),
.btn-modern.btn-clear-filter:hover:not(:disabled) {
    background: rgba(245, 158, 11, 0.2);
    color: #b45309;
    border-color: #d97706;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
    transform: translateY(-1px);
}

/* ========================================
   FORMULARIOS
   ======================================== */
.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--gray-700);
}

.form-control {
    display: block;
    width: 100%;
    padding: var(--space-3);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--gray-900);
    background-color: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control:disabled {
    background-color: var(--gray-100);
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========================================
   TARJETAS
   ======================================== */
.card {
    background-color: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: var(--space-6);
    background-color: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-6);
    background-color: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

/* ========================================
   TABLAS
   ======================================== */
.table-container {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: var(--space-6);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: var(--font-size-sm);
}

.table th {
    background: var(--gray-50);
    color: var(--gray-700);
    font-weight: 600;
    text-align: left;
    padding: var(--space-4);
    border-bottom: 2px solid var(--gray-200);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: var(--gray-50);
}

/* ========================================
   BADGES
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
    font-weight: 500;
    line-height: 1.25;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background-color: #ecfdf5;
    color: #047857;
}

.badge-danger {
    background-color: #fef2f2;
    color: #b91c1c;
}

.badge-warning {
    background-color: #fffbeb;
    color: #b45309;
}

.badge-info {
    background-color: #eff6ff;
    color: #1d4ed8;
}

.badge-gray {
    background-color: var(--gray-100);
    color: var(--gray-700);
}

/* ========================================
   MODALES
   ======================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: 1050;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: none;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    color: var(--gray-500);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.modal-close:hover {
    background-color: var(--gray-100);
    color: var(--gray-700);
}

.modal-body {
    padding: var(--space-6);
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
}

/* ========================================
   NOTIFICACIONES
   ======================================== */
.notification {
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    max-width: 400px;
    padding: var(--space-4);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1060;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    animation: slideInRight 0.3s ease;
}

.notification-success {
    background-color: #ecfdf5;
    color: #047857;
    border-left: 4px solid var(--success);
}

.notification-error {
    background-color: #fef2f2;
    color: #b91c1c;
    border-left: 4px solid var(--danger);
}

.notification-warning {
    background-color: #fffbeb;
    color: #b45309;
    border-left: 4px solid var(--warning);
}

.notification-info {
    background-color: #eff6ff;
    color: #1d4ed8;
    border-left: 4px solid var(--info);
}

.notification-close {
    background: none;
    border: none;
    font-size: var(--font-size-lg);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.notification-close:hover {
    opacity: 1;
}

/* ========================================
   UTILIDADES
   ======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-700 { color: var(--gray-700); }
.text-gray-900 { color: var(--gray-900); }

.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.hidden { display: none; }
.block { display: block; }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .modal {
        max-width: 95vw;
        max-height: 95vh;
        margin: var(--space-4);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: var(--space-4);
    }
    
    .table th,
    .table td {
        padding: var(--space-3);
        font-size: var(--font-size-xs);
    }
    
    .notification {
        max-width: calc(100vw - 2rem);
        margin: 0 var(--space-4);
    }
}

/* ========================================
   ANIMACIONES
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* ========================================
   SPINNER
   ======================================== */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   VARIABLES CORPORATIVAS COMPARTIDAS
   Consolidado desde [modulo]-modern.css
   ======================================== */
:root {
    /* Colores corporativos */
    --corp-primary: #0F4C81;
    --corp-primary-dark: #0A3A61;
    --corp-primary-light: #1E6BA8;
    --corp-secondary: #2C7BB6;
    --corp-accent: #00A8E8;
    --corp-success: #00C48C;
    --corp-warning: #FFA726;
    --corp-danger: #FF5252;
    --corp-info: #29B6F6;
    --corp-gray-50: #F8FAFC;
    --corp-gray-100: #F1F5F9;
    --corp-gray-200: #E2E8F0;
    --corp-gray-300: #CBD5E1;
    --corp-gray-400: #94A3B8;
    --corp-gray-500: #64748B;
    --corp-gray-600: #475569;
    --corp-gray-700: #334155;
    --corp-gray-800: #1E293B;
    --corp-gray-900: #0F172A;

    /* Aliases consumos (co- prefix) */
    --co-primary: #0F4C81;
    --co-primary-dark: #0A3A61;
    --co-primary-light: #1E6BA8;
    --co-secondary: #2C7BB6;
    --co-accent: #00A8E8;
    --co-success: #00C48C;
    --co-warning: #FFA726;
    --co-danger: #FF5252;
    --co-info: #29B6F6;
    --co-gray-50: #F8FAFC;
    --co-gray-100: #F1F5F9;
    --co-gray-200: #E2E8F0;
    --co-gray-300: #CBD5E1;
    --co-gray-400: #94A3B8;
    --co-gray-500: #64748B;
    --co-gray-600: #475569;
    --co-gray-700: #334155;
    --co-gray-800: #1E293B;
    --co-gray-900: #0F172A;

    /* Tipografia corporativa */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Sombras corporativas */
    --shadow-soft: 0 2px 8px rgba(15, 76, 129, 0.08);
    --shadow-medium: 0 4px 16px rgba(15, 76, 129, 0.12);
    --shadow-strong: 0 8px 32px rgba(15, 76, 129, 0.16);
    --shadow-hover: 0 12px 40px rgba(15, 76, 129, 0.20);

    /* Transiciones */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   DESIGN SYSTEM - Tema Oscuro
   Sobreescribe tokens semanticos para modo dark
   ======================================== */
[data-theme="dark"] {
    /* Backgrounds */
    --ds-bg-page: #0f172a;
    --ds-bg-card: #1e293b;
    --ds-bg-header: rgba(30, 41, 59, 0.95);
    --ds-bg-sidebar: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    --ds-bg-input: #1e293b;
    --ds-bg-hover: rgba(255, 255, 255, 0.05);

    /* Text */
    --ds-text-primary: #f1f5f9;
    --ds-text-secondary: #94a3b8;
    --ds-text-muted: #64748b;
    --ds-text-on-primary: #ffffff;

    /* Borders */
    --ds-border: #334155;
    --ds-border-focus: var(--ds-accent);

    /* Shadows */
    --ds-shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.3);
    --ds-shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.4);
    --ds-shadow-strong: 0 10px 15px rgba(0, 0, 0, 0.5);

    /* Gray scale inverted */
    --ds-gray-50: #1e293b;
    --ds-gray-100: #334155;
    --ds-gray-200: #475569;
    --ds-gray-300: #64748b;
    --ds-gray-400: #94a3b8;
    --ds-gray-500: #cbd5e1;
    --ds-gray-600: #e2e8f0;
    --ds-gray-700: #f1f5f9;
    --ds-gray-800: #f8fafc;
    --ds-gray-900: #ffffff;

    /* States - keep readable on dark bg */
    --ds-success: #34d399;
    --ds-success-hover: #10b981;
    --ds-danger: #f87171;
    --ds-danger-hover: #ef4444;
    --ds-warning: #fbbf24;
    --ds-warning-hover: #f59e0b;
    --ds-info: #38bdf8;
    --ds-info-hover: #0ea5e9;

    /* Legacy aliases */
    --primary: var(--ds-primary);
    --gray-50: var(--ds-gray-50);
    --gray-100: var(--ds-gray-100);
    --gray-200: var(--ds-gray-200);
    --gray-300: var(--ds-gray-300);
    --gray-400: var(--ds-gray-400);
    --gray-500: var(--ds-gray-500);
    --gray-600: var(--ds-gray-600);
    --gray-700: var(--ds-gray-700);
    --gray-800: var(--ds-gray-800);
    --gray-900: var(--ds-gray-900);
}

/* Dark theme component overrides */
[data-theme="dark"] body {
    background: var(--ds-bg-page);
    color: var(--ds-text-primary);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .filter-input,
[data-theme="dark"] .filter-select {
    background: var(--ds-bg-input);
    color: var(--ds-text-primary);
    border-color: var(--ds-border);
}

[data-theme="dark"] .table-modern tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .table-modern tbody tr:hover {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .modal-content {
    background: var(--ds-bg-card);
    color: var(--ds-text-primary);
}

[data-theme="dark"] .modal-alert {
    background: var(--ds-bg-card);
    color: var(--ds-text-primary);
}

[data-theme="dark"] .stat-card-modern {
    background: var(--ds-bg-card);
}

[data-theme="dark"] .toast {
    background: var(--ds-bg-card);
    color: var(--ds-text-primary);
    border-color: var(--ds-border);
}

/* ========================================
   CONTENT WRAPPER COMPARTIDO
   ======================================== */
.content-wrapper {
    padding: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 1rem;
    }
}

/* ========================================
   TOOLBAR MODERNO COMPARTIDO
   ======================================== */
.page-toolbar {
    margin-bottom: 1.5rem;
}

.toolbar-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ========================================
   BOTONES MODERNOS COMPARTIDOS
   Three sizes: sm (32px), base (40px), lg (48px)
   Variants: primary, secondary, outline, danger, success, clear-filter
   States: loading, disabled
   ======================================== */
.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ds-space-2);
    height: 40px;
    padding: 0 var(--ds-space-5);
    border: 1px solid transparent;
    border-radius: var(--ds-radius-base);
    font-family: var(--ds-font-family);
    font-size: var(--ds-font-sm);
    font-weight: var(--ds-weight-semibold);
    cursor: pointer;
    transition: var(--ds-transition-smooth);
    white-space: nowrap;
    position: relative;
    line-height: 1;
}

.btn-modern:hover {
    transform: translateY(-1px);
    box-shadow: var(--ds-shadow-medium);
}

.btn-modern:active {
    transform: translateY(0);
}

.btn-modern svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* Size: sm (32px) */
.btn-modern.btn-sm {
    height: 32px;
    padding: 0 var(--ds-space-3);
    font-size: var(--ds-font-xs);
    border-radius: var(--ds-radius-sm);
}

.btn-modern.btn-sm svg {
    width: 14px;
    height: 14px;
}

/* Size: lg (48px) */
.btn-modern.btn-lg {
    height: 48px;
    padding: 0 var(--ds-space-6);
    font-size: var(--ds-font-base);
    border-radius: var(--ds-radius-base);
}

.btn-modern.btn-lg svg {
    width: 20px;
    height: 20px;
}

/* Variant: primary */
.btn-modern.btn-primary {
    background: var(--ds-primary);
    color: var(--ds-text-on-primary);
    border-color: var(--ds-primary);
}

.btn-modern.btn-primary:hover {
    background: var(--ds-primary-hover);
    border-color: var(--ds-primary-hover);
}

/* Variant: secondary */
.btn-modern.btn-secondary {
    background: var(--ds-gray-200);
    color: var(--ds-gray-700);
    border-color: var(--ds-gray-200);
}

.btn-modern.btn-secondary:hover {
    background: var(--ds-gray-300);
    border-color: var(--ds-gray-300);
}

/* Variant: outline */
.btn-modern.btn-outline {
    background: var(--ds-bg-card);
    color: var(--ds-gray-700);
    border: 1px solid var(--ds-border);
}

.btn-modern.btn-outline:hover {
    border-color: var(--ds-gray-400);
    background: var(--ds-gray-50);
}

/* Variant: danger */
.btn-modern.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--ds-danger);
    border-color: transparent;
}

.btn-modern.btn-danger:hover {
    background: var(--ds-danger);
    color: var(--ds-text-on-primary);
}

/* Variant: success */
.btn-modern.btn-success {
    background: var(--ds-success);
    color: var(--ds-text-on-primary);
    border-color: var(--ds-success);
}

.btn-modern.btn-success:hover {
    background: var(--ds-success-hover);
    border-color: var(--ds-success-hover);
}

/* Loading state: spinner CSS, pointer-events none, opacity reduced */
.btn-modern.btn-loading {
    color: transparent !important;
    pointer-events: none;
    opacity: 0.6;
}

.btn-modern.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* For non-primary variants, spinner uses dark color */
.btn-modern.btn-outline.btn-loading::after,
.btn-modern.btn-secondary.btn-loading::after {
    border-color: rgba(0, 0, 0, 0.15);
    border-top-color: var(--ds-gray-600);
}

/* Legacy .loading class support */
.btn-modern.loading {
    color: transparent !important;
    pointer-events: none;
    opacity: 0.6;
}

.btn-modern.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Disabled state */
.btn-modern.btn-disabled,
.btn-modern:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-modern.btn-disabled:hover,
.btn-modern:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Tablet: flex-wrap toolbar */
@media (max-width: 768px) {
    .toolbar-actions {
        gap: var(--ds-space-2);
        width: 100%;
    }

    .btn-modern {
        flex: 1;
        padding: 0 var(--ds-space-4);
        font-size: var(--ds-font-xs);
    }
}

/* Mobile: hide text span, show only icon */
@media (max-width: 480px) {
    .btn-modern span {
        display: none;
    }

    .btn-modern {
        padding: 0;
        min-width: 44px;
        height: 44px;
    }

    .btn-modern svg {
        margin: 0;
    }

    .btn-modern.btn-sm {
        min-width: 40px;
        height: 40px;
    }

    .btn-modern.btn-lg {
        min-width: 48px;
        height: 48px;
    }
}

/* ========================================
   FILTROS MODERNOS COMPARTIDOS
   Responsive: auto-fill desktop, 2 cols tablet, 1 col mobile
   Collapsible support for tablet/mobile
   ======================================== */
.filters-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--ds-space-3);
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-lg);
    padding: var(--ds-space-4) var(--ds-space-5);
    margin-bottom: var(--ds-space-3);
    box-shadow: var(--ds-shadow-soft);
    border: 1px solid var(--ds-border);
    align-items: end;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: var(--ds-space-1);
}

.filter-item.filter-search {
    position: relative;
}

.filter-icon {
    position: absolute;
    left: var(--ds-space-3);
    bottom: 10px;
    color: var(--ds-text-muted);
    pointer-events: none;
    width: 18px;
    height: 18px;
}

.filter-label {
    font-size: var(--ds-font-xs);
    font-weight: var(--ds-weight-semibold);
    color: var(--ds-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-input,
.filter-select {
    padding: 10px var(--ds-space-3);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-sm);
    font-family: var(--ds-font-family);
    font-size: var(--ds-font-sm);
    color: var(--ds-text-primary);
    background: var(--ds-bg-card);
    transition: var(--ds-transition-fast);
}

.filter-input {
    padding-left: 2.5rem;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--ds-border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-input::placeholder {
    color: var(--ds-text-muted);
}

/* Date inputs styling */
input[type="date"].filter-select {
    cursor: pointer;
}

input[type="date"].filter-select::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

input[type="date"].filter-select::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Collapsible filters toggle button */
.filter-toggle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    gap: var(--ds-space-2);
    padding: var(--ds-space-2) var(--ds-space-4);
    background: var(--ds-bg-card);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-base);
    font-size: var(--ds-font-sm);
    font-weight: var(--ds-weight-medium);
    color: var(--ds-text-secondary);
    cursor: pointer;
    transition: var(--ds-transition-fast);
    grid-column: 1 / -1;
}

.filter-toggle-btn:hover {
    background: var(--ds-gray-50);
    color: var(--ds-text-primary);
}

.filter-toggle-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.filters-expanded .filter-toggle-btn svg {
    transform: rotate(180deg);
}

/* Tablet: 2 columns, search full-width, collapsible */
@media (max-width: 1024px) {
    .filters-modern {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-item.filter-search {
        grid-column: 1 / -1;
    }

    .filter-toggle-btn {
        display: flex;
    }

    .filter-secondary {
        display: none;
    }

    .filters-expanded .filter-secondary {
        display: flex;
    }
}

/* Mobile: 1 column */
@media (max-width: 480px) {
    .filters-modern {
        grid-template-columns: 1fr;
        padding: var(--ds-space-3);
    }
}

/* ========================================
   LOADING MODERNO COMPARTIDO
   Spinner animado con texto de carga centrado
   ======================================== */
.loading-modern {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--ds-space-16) var(--ds-space-8);
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-soft);
}

.spinner-modern {
    width: 48px;
    height: 48px;
    border: 4px solid var(--ds-gray-200);
    border-top-color: var(--ds-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    margin-top: var(--ds-space-4);
    color: var(--ds-text-secondary);
    font-size: var(--ds-font-sm);
    font-weight: var(--ds-weight-medium);
}

/* ========================================
   TABLA MODERNA COMPARTIDA
   Uniform padding/font-size with tokens, horizontal scroll on tablet/mobile
   ======================================== */
.table-modern-container {
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-base);
    border: 1px solid var(--ds-border);
    overflow: hidden;
    box-shadow: var(--ds-shadow-soft);
}

.table-modern {
    width: 100%;
    border-collapse: collapse;
}

/* Header con fondo primario */
.table-modern thead {
    background: var(--ds-primary);
}

.table-modern thead th {
    padding: 8px var(--ds-space-3);
    text-align: left;
    font-size: var(--ds-font-xs);
    font-weight: var(--ds-weight-semibold);
    color: rgba(255, 255, 255, 0.92);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.table-modern thead th.th-actions {
    text-align: center;
    width: 100px;
}

/* Filas compactas */
.table-modern tbody tr {
    border-bottom: 1px solid var(--ds-border);
    transition: background-color var(--ds-transition-fast);
}

.table-modern tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.018);
}

.table-modern tbody tr:hover {
    background: color-mix(in srgb, var(--ds-primary) 5%, transparent);
}

.table-modern tbody tr:last-child {
    border-bottom: none;
}

.table-modern tbody td {
    padding: 7px var(--ds-space-3);
    font-size: var(--ds-font-sm);
    color: var(--ds-text-primary);
    vertical-align: middle;
    line-height: 1.4;
}

.table-modern tbody td strong {
    color: var(--ds-text-primary);
    font-weight: var(--ds-weight-semibold);
}

/* Utility classes for hiding columns by breakpoint */
@media (max-width: 480px) {
    .hide-mobile { display: none !important; }
}

@media (max-width: 768px) {
    .hide-tablet { display: none !important; }
}

/* Horizontal scroll on tablet */
@media (max-width: 1024px) {
    .table-modern-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-modern { min-width: 900px; }
}

/* Reduced padding on mobile */
@media (max-width: 768px) {
    .table-modern { min-width: 800px; }
    .table-modern thead th,
    .table-modern tbody td {
        padding: 5px var(--ds-space-2);
        font-size: var(--ds-font-xs);
    }
}

/* ========================================
   PAGINATION - Barra compacta integrada bajo la tabla
   ======================================== */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ds-space-3);
    padding: 10px var(--ds-space-4);
    background: var(--ds-primary);
    border-radius: 0;
    flex-wrap: nowrap;
    width: 100%;
    box-sizing: border-box;
}

/* Info de registros */
.pagination-info {
    font-size: var(--ds-font-xs);
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    flex-shrink: 0;
}

.pagination-info strong {
    color: #ffffff;
    font-weight: var(--ds-weight-semibold);
}

/* Wrapper de controles */
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    margin-left: auto;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Botones de navegacion (« < > ») */
.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--ds-radius-sm);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: background var(--ds-transition-fast), border-color var(--ds-transition-fast);
    line-height: 1;
    user-select: none;
    padding: 0;
    flex-shrink: 0;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

.pagination-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

/* Botones de numero de pagina */
.pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--ds-radius-sm);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--ds-font-xs);
    font-weight: var(--ds-weight-medium);
    cursor: pointer;
    transition: background var(--ds-transition-fast), border-color var(--ds-transition-fast);
    line-height: 1;
    user-select: none;
}

.pagination-page:hover:not(:disabled):not(.active) {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

/* Pagina activa — blanco solido con texto primario */
.pagination-page.active,
.pagination-page:disabled.active {
    background: #ffffff;
    color: var(--ds-primary);
    border-color: #ffffff;
    font-weight: var(--ds-weight-bold);
    cursor: default;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.pagination-page:disabled:not(.active) {
    opacity: 0.2;
    cursor: not-allowed;
}

/* Ellipsis */
.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 30px;
    color: rgba(255, 255, 255, 0.4);
    font-size: var(--ds-font-xs);
    user-select: none;
}

/* Tema oscuro */
[data-theme="dark"] .pagination-container {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 768px) {
    .pagination-container {
        height: auto;
        padding: var(--ds-space-2) var(--ds-space-3);
        justify-content: center;
        border-radius: 0;
    }
    .pagination-info {
        width: 100%;
        text-align: center;
        order: -1;
    }
    .pagination-controls { margin-left: 0; }
}

@media (max-width: 480px) {
    .pagination-btn,
    .pagination-page {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }
}

/* ========================================
   TOAST CONTAINER + TOAST
   Variants: success, error, warning, info
   Position: top-right. Auto-dismiss. Fullwidth on mobile.
   ======================================== */
.toast-container {
    position: fixed;
    top: var(--ds-space-6);
    right: var(--ds-space-6);
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: var(--ds-space-3);
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    padding: var(--ds-space-4) var(--ds-space-5);
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-strong);
    border-left: 4px solid var(--ds-info);
    animation: toastSlideIn 0.3s ease-out;
    min-width: 300px;
}

.toast.toast-exit {
    animation: toastSlideOut 0.3s ease-in forwards;
}

.toast-success {
    border-left-color: var(--ds-success);
}

.toast-error {
    border-left-color: var(--ds-danger);
}

.toast-warning {
    border-left-color: var(--ds-warning);
}

.toast-info {
    border-left-color: var(--ds-info);
}

.toast-icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--ds-font-lg);
    font-weight: var(--ds-weight-bold);
}

.toast-success .toast-icon { color: var(--ds-success); }
.toast-error .toast-icon { color: var(--ds-danger); }
.toast-warning .toast-icon { color: var(--ds-warning); }
.toast-info .toast-icon { color: var(--ds-info); }

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: var(--ds-font-sm);
    font-weight: var(--ds-weight-semibold);
    color: var(--ds-text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: var(--ds-font-xs);
    color: var(--ds-text-secondary);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--ds-text-muted);
    cursor: pointer;
    padding: var(--ds-space-1);
    border-radius: var(--ds-radius-sm);
    transition: var(--ds-transition-fast);
    font-size: var(--ds-font-lg);
    line-height: 1;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    background: var(--ds-gray-100);
    color: var(--ds-text-primary);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Mobile: fullwidth with 16px margins */
@media (max-width: 480px) {
    .toast-container {
        top: var(--ds-space-4);
        left: var(--ds-space-4);
        right: var(--ds-space-4);
        max-width: none;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* ========================================
   STATUS BADGES COMPARTIDOS
   Variants: active, inactive, pending
   ======================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--ds-space-1) var(--ds-space-3);
    border-radius: var(--ds-radius-sm);
    font-weight: var(--ds-weight-medium);
    font-size: var(--ds-font-xs);
}

.status-badge.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: #00875A;
}

.status-badge.status-inactive {
    background: rgba(100, 116, 139, 0.1);
    color: var(--ds-text-secondary);
}

.status-badge.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
}

/* ========================================
   BOTONES DE ACCION COMPARTIDOS
   32x32 desktop, 44x44 mobile touch targets
   ======================================== */
.action-buttons,
.actions {
    display: flex;
    gap: var(--ds-space-1);
    justify-content: center;
}

.btn-action {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--ds-radius-sm);
    cursor: pointer;
    transition: var(--ds-transition-fast);
    background: transparent;
}

.btn-action:hover {
    background: var(--ds-gray-100);
}

.btn-action.btn-edit {
    color: var(--ds-info);
}

.btn-action.btn-edit:hover {
    background: rgba(6, 182, 212, 0.1);
}

.btn-action.btn-evidencia {
    color: #6366f1;
}

.btn-action.btn-evidencia:hover {
    background: rgba(99, 102, 241, 0.1);
}

.btn-action.btn-audit {
    color: var(--ds-warning);
}

.btn-action.btn-audit:hover {
    background: rgba(245, 158, 11, 0.1);
}

.btn-action.btn-delete {
    color: var(--ds-danger);
}

.btn-action.btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-action svg {
    width: 16px;
    height: 16px;
}

/* Mobile: 44x44 touch targets */
@media (max-width: 480px) {
    .btn-action {
        width: 44px;
        height: 44px;
    }
}

/* ========================================
   EMPTY STATE MODERNO COMPARTIDO
   Icon, title, text centered, responsive
   ======================================== */
.empty-state-modern {
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-lg);
    padding: var(--ds-space-16) var(--ds-space-8);
    text-align: center;
    box-shadow: var(--ds-shadow-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.empty-state-icon {
    margin: 0 auto var(--ds-space-6);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ds-gray-100) 0%, var(--ds-gray-200) 100%);
    border-radius: 50%;
}

.empty-state-icon svg {
    color: var(--ds-text-muted);
}

.empty-state-title {
    font-size: var(--ds-font-2xl);
    font-weight: var(--ds-weight-bold);
    color: var(--ds-text-primary);
    margin-bottom: var(--ds-space-2);
    display: block;
}

.empty-state-text {
    font-size: var(--ds-font-base);
    color: var(--ds-text-secondary);
    margin-bottom: var(--ds-space-8);
    display: block;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

@media (max-width: 480px) {
    .empty-state-modern {
        padding: var(--ds-space-6) var(--ds-space-3);
    }

    .empty-state-title {
        font-size: var(--ds-font-lg);
    }

    .empty-state-text {
        font-size: var(--ds-font-sm);
    }

    .empty-state-icon {
        width: 64px;
        height: 64px;
    }
}

/* ========================================
   MODAL MODERNO COMPARTIDO
   Backdrop with blur, scale+fade animation
   Desktop: max-width 700px. Tablet: 95%. Mobile: fullscreen.
   Close button 44x44px min touch target
   ======================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    display: none;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-xl);
    box-shadow: var(--ds-shadow-strong);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: var(--ds-transition-smooth);
}

.modal.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.modal-content {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-header {
    padding: var(--ds-space-6) var(--ds-space-8);
    border-bottom: 2px solid var(--ds-gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--ds-gray-50) 0%, var(--ds-bg-card) 100%);
    border-radius: var(--ds-radius-xl) var(--ds-radius-xl) 0 0;
}

.modal-header h3 {
    font-size: var(--ds-font-2xl);
    font-weight: var(--ds-weight-bold);
    color: var(--ds-text-primary);
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    margin: 0;
}

.modal-close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--ds-gray-100);
    color: var(--ds-text-secondary);
    border-radius: var(--ds-radius-base);
    cursor: pointer;
    font-size: var(--ds-font-xl);
    transition: var(--ds-transition-smooth);
}

.modal-close:hover {
    background: var(--ds-danger);
    color: var(--ds-text-on-primary);
    transform: rotate(90deg);
}

.modal-body {
    padding: var(--ds-space-8);
    overflow-y: auto;
    flex: 1;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--ds-gray-100);
    border-radius: var(--ds-radius-sm);
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--ds-gray-300);
    border-radius: var(--ds-radius-sm);
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--ds-gray-400);
}

.modal-footer {
    padding: var(--ds-space-6) var(--ds-space-8);
    border-top: 2px solid var(--ds-gray-100);
    display: flex;
    gap: var(--ds-space-4);
    justify-content: flex-end;
    background: var(--ds-gray-50);
    border-radius: 0 0 var(--ds-radius-xl) var(--ds-radius-xl);
}

.modal-footer .btn-modern {
    min-width: 120px;
    padding: 0 var(--ds-space-6);
    height: 40px;
    border-radius: var(--ds-radius-base);
    border: none;
    font-weight: var(--ds-weight-semibold);
    cursor: pointer;
    transition: var(--ds-transition-smooth);
    font-size: var(--ds-font-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ds-space-2);
}

.modal-footer .btn-modern.btn-primary {
    background: var(--ds-primary);
    color: var(--ds-text-on-primary);
}

.modal-footer .btn-modern.btn-primary:hover {
    background: var(--ds-primary-hover);
}

.modal-footer .btn-modern.btn-secondary {
    background: var(--ds-bg-card);
    color: var(--ds-gray-700);
    border: 2px solid var(--ds-border);
}

.modal-footer .btn-modern.btn-secondary:hover {
    background: var(--ds-gray-100);
    border-color: var(--ds-gray-400);
}

.modal-footer .btn {
    padding: var(--ds-space-3) var(--ds-space-6);
    border-radius: var(--ds-radius-base);
    border: none;
    font-weight: var(--ds-weight-semibold);
    cursor: pointer;
    transition: var(--ds-transition-smooth);
    font-size: var(--ds-font-sm);
}

.modal-footer .btn-primary {
    background: var(--ds-primary);
    color: var(--ds-text-on-primary);
}

.modal-footer .btn-primary:hover {
    background: var(--ds-primary-hover);
}

.modal-footer .btn-secondary {
    background: var(--ds-gray-200);
    color: var(--ds-gray-700);
}

.modal-footer .btn-secondary:hover {
    background: var(--ds-gray-300);
}

/* Tablet: 95% width */
@media (max-width: 768px) {
    .modal {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: var(--ds-space-4) var(--ds-space-6);
    }

    .modal-header h3 {
        font-size: var(--ds-font-xl);
    }

    .modal-body {
        padding: var(--ds-space-6);
    }

    .modal-footer {
        padding: var(--ds-space-4) var(--ds-space-6);
    }

    .modal-content {
        max-height: 95vh;
    }
}

/* Mobile: fullscreen */
@media (max-width: 480px) {
    .modal {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: scale(0.95);
    }

    .modal.show {
        transform: scale(1);
    }

    .modal-header {
        border-radius: 0;
        padding: var(--ds-space-4);
    }

    .modal-body {
        padding: var(--ds-space-4);
        flex: 1;
    }

    .modal-footer {
        border-radius: 0;
        padding: var(--ds-space-4);
        flex-direction: column;
    }

    .modal-footer .btn-modern,
    .modal-footer .btn {
        width: 100%;
    }

    .modal-content {
        max-height: 100vh;
        height: 100vh;
    }
}

/* ========================================
   FORMULARIOS MODERNOS COMPARTIDOS
   ======================================== */

/* ========================================
   MODAL ALERT - Alertas/Confirmaciones
   Variants: success (green), error (red), warning (orange), info (blue)
   Confirmation mode with 2 buttons. Requires manual close.
   ======================================== */
.modal-alert-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
}

.modal-alert-backdrop.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 480px;
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-xl);
    box-shadow: var(--ds-shadow-strong);
    z-index: 10001;
    display: none;
    opacity: 0;
    transition: var(--ds-transition-smooth);
    overflow: hidden;
    border-left: 4px solid var(--ds-info);
}

.modal-alert.show {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Variant colors - border left */
.modal-alert.modal-alert-success {
    border-left-color: var(--ds-success);
}

.modal-alert.modal-alert-error {
    border-left-color: var(--ds-danger);
}

.modal-alert.modal-alert-warning {
    border-left-color: var(--ds-warning);
}

.modal-alert.modal-alert-info {
    border-left-color: var(--ds-info);
}

.modal-alert-header {
    padding: var(--ds-space-6) var(--ds-space-6) var(--ds-space-3);
    display: flex;
    align-items: center;
    gap: var(--ds-space-4);
}

.modal-alert-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--ds-font-2xl);
    font-weight: var(--ds-weight-bold);
}

/* Icon backgrounds per variant */
.modal-alert-success .modal-alert-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--ds-success);
}

.modal-alert-error .modal-alert-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--ds-danger);
}

.modal-alert-warning .modal-alert-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--ds-warning);
}

.modal-alert-info .modal-alert-icon {
    background: rgba(6, 182, 212, 0.1);
    color: var(--ds-info);
}

.modal-alert-title {
    font-size: var(--ds-font-xl);
    font-weight: var(--ds-weight-bold);
    color: var(--ds-text-primary);
    margin: 0;
}

.modal-alert-body {
    padding: var(--ds-space-3) var(--ds-space-6) var(--ds-space-6);
}

.modal-alert-message {
    font-size: var(--ds-font-sm);
    color: var(--ds-text-secondary);
    line-height: 1.6;
}

.modal-alert-footer {
    padding: var(--ds-space-4) var(--ds-space-6);
    border-top: 1px solid var(--ds-border);
    display: flex;
    gap: var(--ds-space-3);
    justify-content: flex-end;
    background: var(--ds-gray-50);
}

/* Confirmation mode: 2 buttons */
.modal-alert-footer .btn-confirm {
    padding: var(--ds-space-3) var(--ds-space-6);
    border-radius: var(--ds-radius-base);
    font-weight: var(--ds-weight-semibold);
    font-size: var(--ds-font-sm);
    cursor: pointer;
    transition: var(--ds-transition-fast);
    border: none;
    min-height: 44px;
}

.modal-alert-footer .btn-confirm-primary {
    background: var(--ds-primary);
    color: var(--ds-text-on-primary);
}

.modal-alert-footer .btn-confirm-primary:hover {
    background: var(--ds-primary-hover);
}

.modal-alert-footer .btn-confirm-danger {
    background: var(--ds-danger);
    color: var(--ds-text-on-primary);
}

.modal-alert-footer .btn-confirm-danger:hover {
    background: var(--ds-danger-hover);
}

.modal-alert-footer .btn-confirm-cancel {
    background: var(--ds-bg-card);
    color: var(--ds-text-secondary);
    border: 1px solid var(--ds-border);
}

.modal-alert-footer .btn-confirm-cancel:hover {
    background: var(--ds-gray-100);
}

/* Tablet: 90% width */
@media (max-width: 768px) {
    .modal-alert {
        max-width: 90%;
    }

    .modal-alert-header {
        padding: var(--ds-space-4) var(--ds-space-4) var(--ds-space-2);
    }

    .modal-alert-body {
        padding: var(--ds-space-2) var(--ds-space-4) var(--ds-space-4);
    }

    .modal-alert-footer {
        padding: var(--ds-space-3) var(--ds-space-4);
    }

    .modal-alert-footer .btn-confirm {
        width: 100%;
    }

    .modal-alert-footer {
        flex-direction: column;
    }
}

/* Mobile: centered vertical, min font-size 14px */
@media (max-width: 480px) {
    .modal-alert {
        width: calc(100% - var(--ds-space-8));
        max-width: calc(100% - var(--ds-space-8));
    }

    .modal-alert-message {
        font-size: var(--ds-font-sm);
    }

    .modal-alert-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: var(--ds-font-xl);
    }
}
.form-section-title {
    font-size: var(--ds-font-base);
    font-weight: var(--ds-weight-bold);
    color: var(--ds-text-primary);
    margin-bottom: var(--ds-space-3);
    margin-top: var(--ds-space-2);
    padding-bottom: var(--ds-space-2);
    border-bottom: 1px solid var(--ds-border);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--ds-space-6);
    margin-bottom: var(--ds-space-6);
}

.form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--ds-space-2);
}

.form-group label,
.form-label {
    font-size: var(--ds-font-sm);
    font-weight: var(--ds-weight-semibold);
    color: var(--ds-gray-700);
    display: flex;
    align-items: center;
    gap: var(--ds-space-1);
}

.form-control {
    padding: var(--ds-space-3) var(--ds-space-4);
    border: 2px solid var(--ds-gray-200);
    border-radius: var(--ds-radius-base);
    font-family: var(--ds-font-family);
    font-size: var(--ds-font-sm);
    color: var(--ds-text-primary);
    background: var(--ds-bg-card);
    transition: var(--ds-transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--ds-border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control:read-only {
    background: var(--ds-gray-50);
    color: var(--ds-text-secondary);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    font-size: var(--ds-font-xs);
    color: var(--ds-text-muted);
}

/* Forms responsive: 2 cols desktop, 1 col mobile */
@media (max-width: 768px) {
    .form-row,
    .form-row-3,
    .form-row.form-row-3 {
        grid-template-columns: 1fr;
        gap: var(--ds-space-4);
    }
}

@media (max-width: 480px) {
    .form-control {
        font-size: var(--ds-font-sm);
        padding: var(--ds-space-3);
    }
}

/* ========================================
   NOTIFICACIONES MODERNAS COMPARTIDAS
   ======================================== */
.notification-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.notification {
    min-width: 320px;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-strong);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-success { border-left-color: var(--corp-success); }
.notification-error { border-left-color: var(--corp-danger); }
.notification-info { border-left-color: var(--corp-info); }
.notification-warning { border-left-color: var(--corp-warning); }

.notification-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 700;
    flex-shrink: 0;
}

.notification-success .notification-icon { color: var(--corp-success); }
.notification-error .notification-icon { color: var(--corp-danger); }
.notification-info .notification-icon { color: var(--corp-info); }
.notification-warning .notification-icon { color: var(--corp-warning); }

.notification-message {
    flex: 1;
    font-size: 0.875rem;
    color: var(--corp-gray-800);
    font-weight: 500;
}

.notification-close {
    background: none;
    border: none;
    color: var(--corp-gray-400);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.notification-close:hover {
    background: var(--corp-gray-100);
    color: var(--corp-gray-700);
}

@media (max-width: 768px) {
    .notification-container {
        left: 1rem;
        right: 1rem;
    }

    .notification {
        min-width: auto;
    }
}

/* ========================================
   STAT CARD MODERN
   Flex layout with icon, content, color variants
   ======================================== */
.stats-grid-modern {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--ds-space-4);
    margin-bottom: var(--ds-space-6);
}

@media (max-width: 768px) {
    .stats-grid-modern {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid-modern {
        grid-template-columns: 1fr;
    }
}

.stat-card-modern {
    display: flex;
    align-items: center;
    gap: var(--ds-space-4);
    padding: var(--ds-space-5);
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-soft);
    border: 1px solid var(--ds-border);
    transition: var(--ds-transition-smooth);
}

.stat-card-modern:hover {
    box-shadow: var(--ds-shadow-medium);
    transform: translateY(-2px);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: var(--ds-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card-icon svg {
    width: 24px;
    height: 24px;
}

.stat-card-content {
    flex: 1;
    min-width: 0;
}

.stat-card-value {
    font-size: var(--ds-font-2xl);
    font-weight: var(--ds-weight-bold);
    color: var(--ds-text-primary);
    line-height: 1.2;
}

.stat-card-label {
    font-size: var(--ds-font-xs);
    color: var(--ds-text-secondary);
    font-weight: var(--ds-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Color variants */
.stat-card-modern.stat-primary .stat-card-icon {
    background: rgba(15, 76, 129, 0.1);
    color: var(--ds-primary);
}

.stat-card-modern.stat-success .stat-card-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--ds-success);
}

.stat-card-modern.stat-warning .stat-card-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--ds-warning);
}

.stat-card-modern.stat-info .stat-card-icon {
    background: rgba(6, 182, 212, 0.1);
    color: var(--ds-info);
}

.stat-card-modern.stat-danger .stat-card-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--ds-danger);
}

@media (max-width: 480px) {
    .stat-card-modern {
        padding: var(--ds-space-4);
    }

    .stat-card-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }

    .stat-card-value {
        font-size: var(--ds-font-xl);
    }
}

/* ========================================
   PROGRESS BAR
   Animated fill, centered percentage, descriptive text
   ======================================== */
.progress-bar-container {
    width: 100%;
    margin-bottom: var(--ds-space-2);
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: var(--ds-gray-200);
    border-radius: var(--ds-radius-xl);
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ds-primary) 0%, var(--ds-accent) 100%);
    border-radius: var(--ds-radius-xl);
    transition: width 0.3s ease;
    min-width: 0;
}

.progress-bar-fill.progress-success {
    background: linear-gradient(90deg, var(--ds-success) 0%, var(--ds-success-hover) 100%);
}

.progress-bar-fill.progress-danger {
    background: linear-gradient(90deg, var(--ds-danger) 0%, var(--ds-danger-hover) 100%);
}

.progress-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: var(--ds-font-xs);
    font-weight: var(--ds-weight-bold);
    color: var(--ds-text-on-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.progress-description {
    font-size: var(--ds-font-xs);
    color: var(--ds-text-secondary);
    text-align: center;
    margin-top: var(--ds-space-2);
}

@media (max-width: 480px) {
    .progress-bar {
        height: 20px;
    }

    .progress-bar-text {
        font-size: var(--ds-font-xs);
    }

    .progress-description {
        font-size: var(--ds-font-xs);
    }
}

/* ========================================
   PROGRESS OVERLAY
   Modal that blocks interaction during operation
   ======================================== */
.progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-overlay-content {
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-xl);
    padding: var(--ds-space-8);
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: var(--ds-shadow-strong);
}

.progress-overlay-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--ds-gray-200);
    border-top-color: var(--ds-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto var(--ds-space-6);
}

.progress-overlay-title {
    font-size: var(--ds-font-lg);
    font-weight: var(--ds-weight-bold);
    color: var(--ds-text-primary);
    margin-bottom: var(--ds-space-4);
}

.progress-overlay-bar {
    margin-bottom: var(--ds-space-4);
}

.progress-overlay-text {
    font-size: var(--ds-font-sm);
    color: var(--ds-text-secondary);
    margin-bottom: var(--ds-space-4);
}

.progress-overlay-cancel {
    padding: var(--ds-space-3) var(--ds-space-6);
    background: var(--ds-gray-200);
    color: var(--ds-text-secondary);
    border: none;
    border-radius: var(--ds-radius-base);
    font-size: var(--ds-font-sm);
    font-weight: var(--ds-weight-medium);
    cursor: pointer;
    transition: var(--ds-transition-fast);
}

.progress-overlay-cancel:hover {
    background: var(--ds-gray-300);
    color: var(--ds-text-primary);
}

@media (max-width: 480px) {
    .progress-overlay-content {
        padding: var(--ds-space-6);
        width: calc(100% - var(--ds-space-8));
    }
}

/* ========================================
   MENU DE USUARIO EN HEADER COMPARTIDO
   ======================================== */
.user-menu-container {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--corp-gray-200);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    min-width: 200px;
}

.user-menu-btn:hover {
    border-color: var(--corp-primary);
    box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.1);
}

.user-menu-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--corp-primary) 0%, var(--corp-primary-light) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.user-menu-info {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.user-menu-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--corp-gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-role {
    display: block;
    font-size: 0.75rem;
    color: var(--corp-gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-arrow {
    color: var(--corp-gray-400);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.user-menu-btn:hover .user-menu-arrow {
    color: var(--corp-primary);
}

/* Dropdown */
.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 280px;
    background: white;
    border: 1px solid var(--corp-gray-200);
    border-radius: 12px;
    box-shadow: var(--shadow-strong);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    pointer-events: auto;
}

.user-menu-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-dropdown-header {
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    border-bottom: 1px solid var(--corp-gray-200);
}

.user-menu-dropdown-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--corp-primary) 0%, var(--corp-primary-light) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.user-menu-dropdown-info {
    flex: 1;
    min-width: 0;
}

.user-menu-dropdown-name {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--corp-gray-900);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-dropdown-email {
    display: block;
    font-size: 0.8125rem;
    color: var(--corp-gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-dropdown-divider {
    height: 1px;
    background: var(--corp-gray-200);
    margin: 0;
}

.user-menu-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--corp-gray-700);
    text-decoration: none;
    transition: var(--transition-smooth);
    font-size: 0.875rem;
}

.user-menu-dropdown-item:hover {
    background: var(--corp-gray-50);
    color: var(--corp-primary);
}

.user-menu-dropdown-item svg {
    flex-shrink: 0;
    color: var(--corp-gray-400);
}

.user-menu-dropdown-item:hover svg {
    color: var(--corp-primary);
}

.user-menu-dropdown-item-danger {
    color: var(--corp-danger);
}

.user-menu-dropdown-item-danger:hover {
    background: rgba(255, 82, 82, 0.1);
    color: var(--corp-danger);
}

.user-menu-dropdown-item-danger svg {
    color: var(--corp-danger);
}

@media (max-width: 768px) {
    .user-menu-btn {
        min-width: auto;
        padding: 0.5rem;
    }

    .user-menu-info {
        display: none;
    }

    .user-menu-arrow {
        display: none;
    }

    .user-menu-dropdown {
        right: -1rem;
        width: 260px;
    }
}

@media (max-width: 480px) {
    .user-menu-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }

    .user-menu-dropdown.show {
        transform: translateY(0);
    }
}

/* ========================================
   AUDIT TIMELINE COMPARTIDO
   ======================================== */
.audit-timeline {
    max-height: 400px;
    overflow-y: auto;
}

.audit-item {
    padding: 1rem;
    border-left: 3px solid var(--corp-primary);
    margin-bottom: 1rem;
    background: var(--corp-gray-50);
    border-radius: 0 8px 8px 0;
}

.audit-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.audit-action {
    font-weight: 600;
    color: var(--corp-gray-900);
}

.audit-date {
    color: var(--corp-gray-500);
    font-size: 0.875rem;
}

.audit-user {
    color: var(--corp-primary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}


/* ========================================
   LAYOUT PRINCIPAL - Migrado de dashboard-modern.css
   Sidebar, Header, Main Content
   ======================================== */

/* --- Layout Container --- */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* --- Permisos dinamicos del sidebar --- */
#sidebar-container.sidebar-needs-permisos .nav-section-collapsible {
    display: none !important;
}

#sidebar-container.sidebar-permisos-ready .nav-section-collapsible {
    /* display controlado por JS inline style */
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--corp-primary) 0%, var(--corp-primary-dark) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-strong);
    overflow-y: auto;
}

/* Sidebar colapsado - solo aplica en tablet landscape (769-1024px) */
/* En desktop >1024px se ignora via media query abajo */
.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .user-info {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-collapse-btn svg {
    transform: rotate(180deg);
}

/* Sidebar Header */
.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    flex-shrink: 0;
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.125rem;
    letter-spacing: -0.02em;
    text-align: left;
}

.logo-text span {
    font-size: 0.75rem;
    opacity: 0.8;
    font-weight: 400;
}

/* Boton de colapso - solo visible en tablet landscape (769-1024px) */
.sidebar-collapse-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: none; /* Oculto por defecto en desktop */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-collapse-btn svg {
    transition: transform 0.3s;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 0.25rem;
}

.nav-section-title {
    display: block;
    padding: 0.5rem 1.5rem;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.95);
    transition: opacity 0.3s;
    text-align: left;
    flex: 1;
}

.nav-list {
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    position: relative;
    text-align: left;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: var(--corp-accent);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: white;
    font-weight: 500;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: white;
    border-radius: 4px 0 0 4px;
}

.nav-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.nav-text {
    flex: 1;
    font-size: 0.9375rem;
    transition: opacity 0.3s, width 0.3s;
    text-align: left;
}

/* Dashboard link - styled like group headers */
.nav-link-dashboard {
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.nav-link-dashboard .nav-text {
    font-size: 0.8125rem;
    font-weight: 700;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer-info {
    text-align: center;
}

.sidebar-version {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.sidebar-copyright {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.4);
}

.sidebar.collapsed .sidebar-footer-info {
    opacity: 0;
}

/* Sidebar highlight section */
.nav-section-highlight {
    background: rgba(255, 255, 255, 0.05);
    margin: 0.5rem 0;
    padding: 0.5rem 0;
    border-radius: 8px;
}

.nav-section-highlight .nav-section-title {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
}

.nav-link-featured {
    background: rgba(255, 255, 255, 0.08);
    border-left-color: var(--corp-accent) !important;
    font-weight: 500;
}

.nav-link-featured:hover {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: white !important;
}

.nav-link-featured .nav-icon {
    color: var(--corp-accent);
}

.nav-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF5252 100%);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: auto;
    animation: pulse-nav 2s ease-in-out infinite;
}

@keyframes pulse-nav {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.95);
    }
}

.sidebar.collapsed .nav-badge {
    display: none;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    flex: 1;
    margin-left: 280px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content.sidebar-collapsed {
    margin-left: 80px;
}

/* ========================================
   HEADER
   ======================================== */
.header-modern {
    background: white;
    padding: 1.25rem 2rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1001;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    pointer-events: auto;
}

.header-modern * {
    pointer-events: auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--corp-gray-700);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.mobile-menu-btn:hover {
    background: var(--corp-gray-100);
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--corp-gray-900);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.page-header p {
    font-size: 0.875rem;
    color: var(--corp-gray-500);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--corp-gray-400);
    pointer-events: none;
}

.search-input {
    width: 320px;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--corp-gray-200);
    border-radius: 12px;
    font-size: 0.875rem;
    background: var(--corp-gray-50);
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--corp-primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.1);
}

.notification-btn {
    position: relative;
    background: var(--corp-gray-100);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--corp-gray-600);
    transition: all 0.2s;
}

.notification-btn:hover {
    background: var(--corp-gray-200);
    color: var(--corp-primary);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--corp-danger);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* ========================================
   USER DROPDOWN (del header.html)
   ======================================== */
.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 280px;
    background: white;
    border: 1px solid var(--corp-gray-200);
    border-radius: 12px;
    box-shadow: var(--shadow-strong);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    pointer-events: auto;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 1.25rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.user-dropdown-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--corp-primary) 0%, var(--corp-primary-light) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.user-dropdown-info {
    flex: 1;
    min-width: 0;
}

.user-dropdown-info h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--corp-gray-900);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-info p {
    font-size: 0.8125rem;
    color: var(--corp-gray-500);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: var(--corp-primary);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--corp-gray-200);
    margin: 0;
}

.user-dropdown-menu {
    padding: 0.5rem;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--corp-gray-700);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.user-dropdown-item:hover {
    background: var(--corp-gray-50);
    color: var(--corp-primary);
}

.user-dropdown-item svg {
    flex-shrink: 0;
    color: var(--corp-gray-400);
}

.user-dropdown-item:hover svg {
    color: var(--corp-primary);
}

.user-dropdown-footer {
    padding: 0.75rem;
}

.logout-btn-dropdown {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--corp-danger) 0%, #E53935 100%);
    border: none;
    color: white;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn-dropdown:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 82, 82, 0.3);
}

.logout-btn-dropdown svg {
    flex-shrink: 0;
}

/* User info in header (legacy) */
.user-info-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--corp-gray-50);
    border-radius: 12px;
}

.user-avatar-header {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--corp-primary) 0%, var(--corp-primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
}

.user-details-header {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.user-name-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--corp-gray-900);
}

.user-role-header {
    font-size: 0.75rem;
    color: var(--corp-gray-500);
}

/* Logout button in header (legacy) */
.btn-logout-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--corp-danger);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout-header:hover {
    background: #c53030;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-logout-header svg {
    flex-shrink: 0;
}

/* ========================================
   SIDEBAR OVERLAY (mobile)
   ======================================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ========================================
   LAYOUT RESPONSIVE - Desktop (>1024px)
   Sidebar FIJO a 280px, sin colapso, sin minimizar
   ======================================== */
@media (min-width: 1025px) {
    .sidebar {
        width: 280px !important;
    }

    .sidebar.collapsed {
        width: 280px !important;
    }

    .sidebar.collapsed .logo-text,
    .sidebar.collapsed .nav-text,
    .sidebar.collapsed .nav-section-title,
    .sidebar.collapsed .user-info {
        opacity: 1;
        width: auto;
        overflow: visible;
    }

    .sidebar.collapsed .sidebar-footer-info {
        opacity: 1;
    }

    .sidebar.collapsed .nav-badge {
        display: inline-block;
    }

    .sidebar-collapse-btn {
        display: none !important;
    }

    .main-content,
    .main-content.sidebar-collapsed {
        margin-left: 280px !important;
    }
}

/* ========================================
   LAYOUT RESPONSIVE - Tablet Landscape (769-1024px)
   Sidebar colapsado por defecto (80px, solo iconos)
   Boton de colapso visible
   ======================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 80px;
    }

    .sidebar-collapse-btn {
        display: flex;
    }

    .sidebar .logo-text,
    .sidebar .nav-text,
    .sidebar .nav-section-title,
    .sidebar .user-info {
        opacity: 0;
        width: 0;
        overflow: hidden;
    }

    .sidebar .sidebar-collapse-btn svg {
        transform: rotate(180deg);
    }

    .sidebar .sidebar-footer-info {
        opacity: 0;
    }

    .sidebar .nav-badge {
        display: none;
    }

    .main-content {
        margin-left: 80px;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .search-container {
        display: none;
    }
}

/* ========================================
   LAYOUT RESPONSIVE - Movil (<=768px)
   Sidebar oculto off-screen con translateX, drawer con .mobile-open
   ======================================== */
@media (max-width: 768px) {
    /* Sidebar: drawer oculto por defecto */
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 3000;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.collapsed {
        width: 280px;
        transform: translateX(-100%);
    }

    .sidebar.mobile-open,
    .sidebar.collapsed.mobile-open {
        transform: translateX(0);
    }

    .sidebar.mobile-open.collapsed .logo-text,
    .sidebar.mobile-open.collapsed .nav-text,
    .sidebar.mobile-open.collapsed .nav-section-title,
    .sidebar.mobile-open.collapsed .user-info {
        opacity: 1;
        width: auto;
        overflow: visible;
    }

    .sidebar-collapse-btn {
        display: none;
    }

    .main-content,
    .main-content.sidebar-collapsed {
        margin-left: 0;
    }

    /* Header: UNA fila - hamburguesa | titulo | avatar */
    .header-modern {
        flex-direction: row;
        flex-wrap: nowrap;
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
        align-items: center;
        justify-content: space-between;
    }

    .header-left {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex: 1;
        min-width: 0;
    }

    /* Hamburguesa siempre visible a la izquierda */
    .mobile-menu-btn {
        display: flex;
        flex-shrink: 0;
        order: -1;
        width: 36px;
        height: 36px;
        padding: 0.375rem;
    }

    .page-header {
        text-align: center;
        flex: 1;
        min-width: 0;
    }

    .page-header h1 {
        font-size: 0.9375rem;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .page-header p {
        font-size: 0.625rem;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-right {
        flex-shrink: 0;
        gap: 0.375rem;
    }

    .search-container {
        display: none;
    }

    .notification-btn {
        width: 30px;
        height: 30px;
        padding: 0.25rem;
    }

    .user-menu-btn {
        min-width: auto;
        padding: 0.25rem;
        border: none;
        background: transparent;
    }

    .user-menu-info,
    .user-menu-arrow {
        display: none;
    }

    .user-menu-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }
}

/* ========================================
   LAYOUT RESPONSIVE - Movil pequeno (<=480px)
   Padding y font-size reducidos
   ======================================== */
@media (max-width: 480px) {
    .header-modern {
        padding: 0.375rem 0.5rem;
    }

    .page-header h1 {
        font-size: 0.8125rem;
    }

    .page-header p {
        display: none;
    }

    .mobile-menu-btn {
        width: 32px;
        height: 32px;
    }

    .notification-btn {
        width: 28px;
        height: 28px;
    }

    .user-menu-avatar {
        width: 28px;
        height: 28px;
    }
}

/* ========================================
   SPA ROUTER - Loading State
   Fade transition during SPA navigation
   ======================================== */
.content-wrapper.spa-loading {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.content-wrapper {
    transition: opacity 0.15s ease;
}

/* ========================================
   ACCESIBILIDAD - Focus Visible
   Outline de alto contraste solo con teclado
   ======================================== */
:focus-visible {
    outline: 2px solid var(--ds-primary);
    outline-offset: 2px;
}

/* Botones */
.btn-modern:focus-visible,
.btn:focus-visible,
.btn-action:focus-visible {
    outline: 2px solid var(--ds-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(15, 76, 129, 0.2);
}

/* Inputs y selects */
.form-control:focus-visible,
.filter-input:focus-visible,
.filter-select:focus-visible {
    outline: 2px solid var(--ds-primary);
    outline-offset: 0;
    border-color: var(--ds-primary);
}

/* Links de navegacion */
.nav-link:focus-visible {
    outline: 2px solid var(--ds-accent);
    outline-offset: -2px;
    border-radius: var(--ds-radius-base);
}

/* Pagination */
.pagination-btn:focus-visible {
    outline: 2px solid var(--ds-primary);
    outline-offset: 2px;
}

/* Touch targets minimos 44x44px en movil */
@media (max-width: 768px) {
    .btn-modern,
    .btn,
    .btn-action,
    .nav-link,
    .pagination-btn,
    .filter-select,
    .filter-input {
        min-height: 44px;
    }

    .btn-action {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Clase utilitaria para touch target */
.mobile-friendly {
    min-height: 44px;
    min-width: 44px;
    font-size: max(var(--ds-font-sm), 14px);
}

/* Navegacion por teclado en sidebar - secciones colapsables */
.nav-section-header[tabindex="0"]:focus-visible,
.nav-section-header[role="button"]:focus-visible {
    outline: 2px solid var(--ds-accent);
    outline-offset: -2px;
    border-radius: var(--ds-radius-base);
}
