/* ============================================================
   FIBRAOPS v2.0 - GUÍA DE ESTILOS GLOBAL
   ============================================================
   Versión: 2.0
   Fecha: 2026-06-18
   ============================================================ */

/* =============================================================
   1. IMPORTS
   ============================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0,1');

/* =============================================================
   2. CSS CUSTOM PROPERTIES (VARIABLES)
   ============================================================= */
:root {
    /* === Colores primarios === */
    --color-primary: #4F46E5;
    --color-primary-hover: #4338CA;
    --color-primary-light: #EEF2FF;
    --color-primary-dark: #3730A3;

    /* === Colores de estado === */
    --color-success: #059669;
    --color-success-hover: #047857;
    --color-success-light: #D1FAE5;
    --color-danger: #DC2626;
    --color-danger-hover: #B91C1C;
    --color-danger-light: #FEE2E2;
    --color-warning: #D97706;
    --color-warning-hover: #B45309;
    --color-warning-light: #FEF3C7;
    --color-info: #2563EB;
    --color-info-light: #DBEAFE;

    /* === Fondo y superficie === */
    --color-background: #F8FAFC;
    --color-surface: #FFFFFF;
    --color-surface-hover: #F1F5F9;

    /* === Bordes === */
    --color-border: #E2E8F0;
    --color-border-light: #F1F5F9;
    --color-border-dark: #CBD5E1;

    /* === Texto === */
    --color-text: #1E293B;
    --color-text-secondary: #475569;
    --color-text-muted: #64748B;
    --color-text-light: #94A3B8;

    /* === Sombras === */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* === Tipografía === */
    --font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-size-xs: 11px;
    --font-size-sm: 13px;
    --font-size-base: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-2xl: 24px;
    --font-size-3xl: 30px;

    /* === Radios === */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* === Espaciado === */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;

    /* === Transiciones === */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* === Layout === */
    --sidebar-width: 288px;
    --header-height: 64px;
}

/* =============================================================
   3. RESET Y BASE
   ============================================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-background);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

input, select, textarea, button {
    font-family: inherit;
    font-size: 16px; /* Previene zoom en iOS */
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-hover);
}

/* =============================================================
   4. CLASES DE TARJETAS (Card)
   ============================================================= */
.classic-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-base);
}

.classic-card:hover {
    box-shadow: var(--shadow-md);
}

.classic-card-header {
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-hover);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.classic-card-body {
    padding: var(--space-6);
}

.classic-card-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-border);
    background: var(--color-surface-hover);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* =============================================================
   5. ENCABEZADOS (Header)
   ============================================================= */
.classic-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: var(--space-6) var(--space-8);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
}

.classic-header h1,
.classic-header h2,
.classic-header h3 {
    margin: 0;
    color: white;
}

.classic-header p {
    margin: var(--space-1) 0 0 0;
    opacity: 0.85;
    font-size: var(--font-size-sm);
}

/* =============================================================
   6. TABLAS
   ============================================================= */
.classic-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.classic-table thead th {
    background: var(--color-surface-hover);
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: var(--font-size-xs);
    letter-spacing: 0.05em;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.classic-table thead th.text-right {
    text-align: right;
}

.classic-table thead th.text-center {
    text-align: center;
}

.classic-table tbody td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-text);
}

.classic-table tbody tr:hover {
    background: var(--color-surface-hover);
}

.classic-table tbody tr:last-child td {
    border-bottom: none;
}

.classic-table .text-right {
    text-align: right;
}

.classic-table .text-center {
    text-align: center;
}

.classic-table .text-muted {
    color: var(--color-text-light);
    font-size: var(--font-size-xs);
}

/* Tabla compacta (alta densidad) */
.classic-table-density {
    font-size: var(--font-size-xs);
}

.classic-table-density thead th {
    padding: 6px 8px;
}

.classic-table-density tbody td {
    padding: 5px 8px;
}

/* Tabla con scroll horizontal */
.classic-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

/* =============================================================
   7. FORMULARIOS / INPUTS
   ============================================================= */
.classic-input {
    width: 100%;
    border: 1px solid var(--color-border-dark);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: var(--font-size-base);
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.classic-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.classic-input::placeholder {
    color: var(--color-text-light);
}

.classic-input.error {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.classic-input.success {
    border-color: var(--color-success);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.classic-input:disabled {
    background: var(--color-surface-hover);
    color: var(--color-text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

.classic-label {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.classic-select {
    width: 100%;
    border: 1px solid var(--color-border-dark);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: var(--font-size-base);
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.classic-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.classic-textarea {
    width: 100%;
    border: 1px solid var(--color-border-dark);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: var(--font-size-base);
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
    resize: vertical;
    min-height: 80px;
    font-family: var(--font-family);
}

.classic-textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* =============================================================
   8. BOTONES
   ============================================================= */
.classic-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
    white-space: nowrap;
    line-height: 1.4;
    min-height: 42px;
}

.classic-button:active {
    transform: scale(0.97);
}

.classic-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Botón primario (índigo) */
.classic-button-primary {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.3);
}

.classic-button-primary:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.classic-button-primary:active {
    background: var(--color-primary-dark);
}

/* Botón éxito (verde) */
.classic-button-success {
    background: var(--color-success);
    color: white;
    border-color: var(--color-success);
    box-shadow: 0 1px 3px rgba(5, 150, 105, 0.3);
}

.classic-button-success:hover {
    background: var(--color-success-hover);
    border-color: var(--color-success-hover);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

/* Botón peligro (rojo) */
.classic-button-danger {
    background: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.3);
}

.classic-button-danger:hover {
    background: var(--color-danger-hover);
    border-color: var(--color-danger-hover);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
}

/* Botón outline (borde) */
.classic-button-outline {
    background: transparent;
    color: var(--color-text-secondary);
    border-color: var(--color-border-dark);
}

.classic-button-outline:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-border);
}

/* Botón ghost (sin borde) */
.classic-button-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border-color: transparent;
}

.classic-button-ghost:hover {
    background: var(--color-surface-hover);
}

/* Tamaños de botón */
.classic-button-sm {
    font-size: var(--font-size-sm);
    padding: 6px 12px;
    min-height: 32px;
}

.classic-button-lg {
    font-size: var(--font-size-lg);
    padding: 14px 28px;
    min-height: 52px;
}

.classic-button-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: var(--radius-md);
}

.classic-button-icon.classic-button-sm {
    width: 32px;
    height: 32px;
}

/* =============================================================
   9. MODALES
   ============================================================= */
.classic-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
    padding: var(--space-4);
}

.classic-modal {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideUp 0.25s ease-out;
    overflow: hidden;
}

.classic-modal-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.classic-modal-header h2,
.classic-modal-header h3 {
    margin: 0;
    font-size: var(--font-size-lg);
}

.classic-modal-body {
    padding: var(--space-6);
    overflow-y: auto;
    flex: 1;
}

.classic-modal-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-3);
    flex-shrink: 0;
}

.classic-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--color-text-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.classic-modal-close:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

/* Tamaños de modal */
.classic-modal-sm {
    max-width: 400px;
}

.classic-modal-lg {
    max-width: 800px;
}

.classic-modal-xl {
    max-width: 1000px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* =============================================================
   10. PESTAÑAS (Tabs)
   ============================================================= */
.classic-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.classic-tabs::-webkit-scrollbar {
    display: none;
}

.classic-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-muted);
    border: none;
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
}

.classic-tab:hover {
    color: var(--color-text-secondary);
    background: var(--color-surface-hover);
}

.classic-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

.classic-tab-content {
    display: none;
    padding: var(--space-6) 0;
}

.classic-tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

/* =============================================================
   11. BADGES / ETIQUETAS
   ============================================================= */
.classic-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    line-height: 1.5;
}

.classic-badge-primary {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
}

.classic-badge-success {
    background: var(--color-success-light);
    color: var(--color-success-hover);
}

.classic-badge-danger {
    background: var(--color-danger-light);
    color: var(--color-danger-hover);
}

.classic-badge-warning {
    background: var(--color-warning-light);
    color: var(--color-warning-hover);
}

.classic-badge-info {
    background: var(--color-info-light);
    color: var(--color-info);
}

.classic-badge-neutral {
    background: var(--color-surface-hover);
    color: var(--color-text-muted);
}

/* =============================================================
   12. CLASES DE UTILIDAD (COLORES)
   ============================================================= */
/* Primary */
.text-primary { color: var(--color-primary); }
.bg-primary { background-color: var(--color-primary); }
.border-primary { border-color: var(--color-primary); }

.bg-primary-light { background-color: var(--color-primary-light); }

/* Success */
.text-success { color: var(--color-success); }
.bg-success { background-color: var(--color-success); }
.border-success { border-color: var(--color-success); }

.bg-success-light { background-color: var(--color-success-light); }

/* Danger */
.text-danger { color: var(--color-danger); }
.bg-danger { background-color: var(--color-danger); }
.border-danger { border-color: var(--color-danger); }

.bg-danger-light { background-color: var(--color-danger-light); }

/* Warning */
.text-warning { color: var(--color-warning); }
.bg-warning { background-color: var(--color-warning); }
.border-warning { border-color: var(--color-warning); }

.bg-warning-light { background-color: var(--color-warning-light); }

/* Texto */
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }

/* =============================================================
   13. CLASES DE UTILIDAD (LAYOUT)
   ============================================================= */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }

/* Espaciado */
.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

.m-0 { margin: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }

/* Ancho */
.w-full { width: 100%; }
.w-auto { width: auto; }

/* Ocultar/Mostrar */
.hidden { display: none; }

/* Texto */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.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); }
.text-2xl { font-size: var(--font-size-2xl); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Bordes */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Sombras */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* =============================================================
   14. SIDEBAR (Barra lateral)
   ============================================================= */
.classic-sidebar,
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    transition: transform var(--transition-base);
}

.classic-sidebar-header,
.sidebar-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

.classic-sidebar-header h1,
.sidebar-header h1 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin: 0;
    color: var(--color-text);
}

.classic-sidebar-header span,
.sidebar-header span {
    color: var(--color-primary);
}

.classic-sidebar-nav,
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-3);
}

.classic-sidebar-item,
.sidebar-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    margin-bottom: 2px;
}

.classic-sidebar-item:hover,
.sidebar-item:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.classic-sidebar-item.active,
.classic-sidebar-item-active,
.sidebar-item.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 600;
}

.classic-sidebar-item .material-symbols-outlined,
.sidebar-item .material-symbols-outlined {
    font-size: 20px;
}

/* Icono en hover/active */
.classic-sidebar-item:hover .material-symbols-outlined:first-child,
.classic-sidebar-item-active .material-symbols-outlined:first-child,
.sidebar-item:hover .material-symbols-outlined:first-child,
.sidebar-item.active .material-symbols-outlined:first-child {
    color: var(--color-primary);
}

/* Submenu items */
.classic-sidebar-submenu a,
.classic-sidebar-submenu .classic-sidebar-item {
    padding-left: 32px;
    font-size: var(--font-size-sm);
}

.classic-sidebar-footer,
.sidebar-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-border);
    font-size: var(--font-size-xs);
    color: var(--color-text-light);
    flex-shrink: 0;
}

/* Sidebar responsive */
.classic-sidebar-overlay,
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 40;
    display: none;
}

/* =============================================================
   15. LOADING / SPINNER
   ============================================================= */
.classic-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.classic-spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.classic-spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =============================================================
   16. NOTIFICACIONES / ALERTAS
   ============================================================= */
.classic-alert {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.classic-alert-info {
    background: var(--color-info-light);
    color: var(--color-info);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.classic-alert-success {
    background: var(--color-success-light);
    color: var(--color-success-hover);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.classic-alert-danger {
    background: var(--color-danger-light);
    color: var(--color-danger-hover);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.classic-alert-warning {
    background: var(--color-warning-light);
    color: var(--color-warning-hover);
    border: 1px solid rgba(217, 119, 6, 0.2);
}

/* =============================================================
   17. TOOLTIP
   ============================================================= */
.classic-tooltip {
    position: relative;
}

.classic-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-text);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.classic-tooltip:hover::after {
    opacity: 1;
}

/* =============================================================
   18. PAGINACIÓN
   ============================================================= */
.classic-pagination {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    justify-content: center;
    padding: var(--space-4) 0;
}

.classic-pagination button {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
}

.classic-pagination button:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-border-dark);
}

.classic-pagination button.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.classic-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* =============================================================
   19. ESTADOS DE VACÍO / ERROR / CARGA
   ============================================================= */
.classic-empty {
    text-align: center;
    padding: var(--space-10) var(--space-6);
    color: var(--color-text-muted);
}

.classic-empty .material-symbols-outlined {
    font-size: 48px;
    color: var(--color-text-light);
    margin-bottom: var(--space-4);
}

.classic-empty h3 {
    margin: 0 0 var(--space-2) 0;
    color: var(--color-text);
}

.classic-empty p {
    margin: 0;
    font-size: var(--font-size-sm);
}

/* =============================================================
   20. RESPONSIVE
   ============================================================= */

/* Tablet (768px+) */
@media (min-width: 768px) {
    .sidebar {
        position: relative;
        transform: none !important;
    }

    .sidebar-overlay {
        display: none !important;
    }

    .md-flex { display: flex; }
    .md-hidden { display: none; }
    .md-w-1\/2 { width: 50%; }
    .md-w-2\/5 { width: 40%; }
    .md-w-3\/5 { width: 60%; }
    .md-p-8 { padding: var(--space-8); }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .lg-w-2\/5 { width: 40%; }
    .lg-w-3\/5 { width: 60%; }
    .lg-p-12 { padding: 48px; }
    .lg-p-16 { padding: 64px; }
}

/* Móvil (hasta 767px) */
@media (max-width: 767px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .classic-card {
        border-radius: var(--radius-md);
    }

    .classic-card-body {
        padding: var(--space-4);
    }

    .classic-modal {
        margin: var(--space-2);
        max-height: 90vh;
        border-radius: var(--radius-lg);
    }

    .classic-header {
        padding: var(--space-4) var(--space-5);
        border-radius: var(--radius-md);
    }

    .classic-tabs {
        gap: 0;
    }

    .classic-tab {
        padding: 10px 14px;
        font-size: var(--font-size-xs);
    }

    .sm-flex-col {
        flex-direction: column;
    }

    .sm-w-full {
        width: 100%;
    }

    .sm-hidden {
        display: none;
    }

    /* Tablas responsivas: convertir a cards en móvil */
    .classic-table-responsive thead {
        display: none;
    }

    .classic-table-responsive tbody tr {
        display: block;
        padding: var(--space-4);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        margin-bottom: var(--space-3);
        background: var(--color-surface);
    }

    .classic-table-responsive tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border-bottom: 1px solid var(--color-border-light);
        text-align: right;
    }

    .classic-table-responsive tbody td:last-child {
        border-bottom: none;
    }

    .classic-table-responsive tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: var(--font-size-xs);
        color: var(--color-text-muted);
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
}

/* =============================================================
   21. ESTILOS DE IMPRESIÓN
   ============================================================= */
@media print {
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
        padding: 0;
        margin: 0;
    }

    .sidebar,
    .sidebar-overlay,
    .no-print,
    .classic-button,
    .classic-modal-overlay,
    .classic-modal {
        display: none !important;
    }

    .classic-card {
        border: 1px solid #ccc !important;
        border-radius: 0 !important;
        page-break-inside: avoid;
    }

    .classic-table thead th {
        background: #f0f0f0 !important;
        color: #000 !important;
        border-bottom: 2px solid #000 !important;
    }

    .classic-table tbody td {
        border-bottom: 1px solid #ddd !important;
    }

    .classic-table tbody tr:hover {
        background: transparent !important;
    }

    .classic-badge {
        border: 1px solid #ccc !important;
    }

    .classic-badge-success {
        border-color: #059669 !important;
        color: #059669 !important;
    }

    .classic-badge-danger {
        border-color: #DC2626 !important;
        color: #DC2626 !important;
    }

    .classic-badge-warning {
        border-color: #D97706 !important;
        color: #D97706 !important;
    }

    a {
        text-decoration: underline !important;
    }

    @page {
        margin: 1.5cm;
    }

    h1, h2, h3, h4 {
        page-break-after: avoid;
    }

    table {
        page-break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
}

/* =============================================================
   22. DARK MODE (preferencia del sistema)
   ============================================================= */
@media (prefers-color-scheme: dark) {
    :root {
        --color-background: #0F172A;
        --color-surface: #1E293B;
        --color-surface-hover: #334155;
        --color-border: #334155;
        --color-border-light: #1E293B;
        --color-border-dark: #475569;
        --color-text: #F1F5F9;
        --color-text-secondary: #CBD5E1;
        --color-text-muted: #94A3B8;
        --color-text-light: #64748B;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
        --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    }

    .classic-card:hover {
        border-color: var(--color-border-dark);
    }

    .classic-input,
    .classic-select,
    .classic-textarea {
        background: var(--color-surface);
        color: var(--color-text);
    }

    .classic-modal-overlay {
        background: rgba(0, 0, 0, 0.7);
    }

    .classic-header {
        background: linear-gradient(135deg, #3730A3 0%, #312E81 100%);
    }

    .sidebar-item:hover {
        background: rgba(79, 70, 229, 0.15);
    }
}