/**
 * Estilos Globales del Sistema
 * Sistema de Calificaciones — Liceo República Dominicana
 *
 * Incluir en todas las páginas después de Bootstrap:
 * <link rel="stylesheet" href="css/global-styles.css">
 */

/* ========================================
   VARIABLES CSS
   ======================================== */

:root {
    /* Colores Principales */
    --primary: #2B5C8A;
    --primary-dark: #1a365d;
    --primary-light: #3B7EA1;

    /* Colores Secundarios */
    --secondary: #059669;
    --secondary-light: #10b981;
    --accent: #f59e0b;

    /* Colores de Acento */
    --success: #28A745;
    --success-light: #20c997;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #2b5c8a;

    /* Básicos */
    --dark: #1f2937;
    --light: #f8fafc;
    --white: #ffffff;

    /* Grises */
    --gray-50: #f7fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e0;
    --gray-400: #a0aec0;
    --gray-500: #718096;
    --gray-600: #4a5568;
    --gray-700: #2d3748;
    --gray-800: #1a202c;
    --gray-900: #171923;

    /* Espaciado */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 20px;
    --spacing-lg: 30px;
    --spacing-xl: 40px;

    /* Bordes */
    --border-radius-sm: 6px;
    --border-radius-md: 10px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;

    /* Sombras */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);

    /* Tamaños */
    --header-height: 70px;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 70px;
}

/* ========================================
   RESET Y BASE
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Escala única de la interfaz en pantallas grandes. Para cambiar el tamaño de todo el sistema
   edite SOLO --ui-zoom y --ui-zoom-inv en css/accesibilidad.css (0.8 = compacto, 0.9 = cómodo, 1 = sin escala). */
@media (min-width: 992px) {
    body { zoom: var(--ui-zoom, 0.9); }

    /* Contrarrestar el zoom del body para que el backdrop y el modal
       cubran el 100% del viewport real (zoom × inverso = 1.0) */
    .modal-backdrop,
    .modal {
        zoom: var(--ui-zoom-inv, 1.1111);
    }
}

/* ========================================
   LAYOUT PRINCIPAL
   ======================================== */

.main-wrapper {
    display: flex;
    min-height: 100vh;
    padding-top: var(--header-height);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--spacing-lg);
    transition: margin-left 0.3s ease;
    min-height: calc(100vh - var(--header-height));
    min-width: 0;
}

.main-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

/* ========================================
   CONTENEDOR DE PÁGINA
   ======================================== */

.page-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ========================================
   HEADERS DE PÁGINA
   ======================================== */

.page-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--gray-200);
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-subtitle {
    font-size: 15px;
    color: var(--gray-500);
    margin-bottom: var(--spacing-md);
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--gray-500);
}

.page-breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.page-breadcrumb a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.page-breadcrumb i {
    font-size: 10px;
    color: var(--gray-400);
}

/* ========================================
   CARDS
   ======================================== */

.card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    margin-bottom: var(--spacing-md);
    overflow: visible;
    transition: all 0.3s ease;
}

.card > :first-child {
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
}
.card > :last-child {
    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
}

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

.card-header {
    padding: var(--spacing-md) 25px;
    border-bottom: 1px solid var(--gray-200);
    background: white;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 25px;
}

.card-footer {
    padding: var(--spacing-md) 25px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* ========================================
   STATS CARDS
   ======================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: var(--spacing-lg);
}

.stat-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 16px 18px;
    border: 1px solid var(--gray-200);
    transition: all 0.3s;
    cursor: pointer;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

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

.stat-icon.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.stat-icon.success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
    color: white;
}

.stat-icon.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: white;
}

.stat-icon.danger {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: white;
}

.stat-icon.info {
    background: linear-gradient(135deg, #2b5c8a 0%, #60a5fa 100%);
    color: white;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--gray-500);
    font-weight: 500;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 10px;
}

.stat-change.positive {
    background: #d1f4e0;
    color: #059669;
}

.stat-change.negative {
    background: #fee;
    color: #dc2626;
}

/* ========================================
   BOTONES
   ======================================== */

.btn {
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn i {
    font-size: 16px;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(43, 92, 138, 0.3);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   BADGES
   ======================================== */

.badge {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-primary {
    background: var(--primary);
    color: white;
}

.badge-success {
    background: #d1f4e0;
    color: #059669;
}

.badge-warning {
    background: #fef3c7;
    color: #d97706;
}

.badge-danger {
    background: #fee;
    color: #dc2626;
}

.badge-info {
    background: #dbeafe;
    color: #2b5c8a;
}

/* ========================================
   FORMS
   ======================================== */

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    font-size: 14px;
    transition: all 0.3s;
    background: var(--gray-50);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(43, 92, 138, 0.1);
}

.form-control::placeholder {
    color: var(--gray-400);
}

/* ========================================
   TABLES
   ======================================== */

.table {
    width: 100%;
    background: #ffffff;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
    --bs-table-bg: transparent;
    --bs-table-accent-bg: transparent;
    --bs-table-hover-bg: var(--gray-50);
    color: var(--gray-700);
}

.table thead {
    background-color: var(--gray-100);
}

.table th {
    padding: 15px 20px;
    text-align: left;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-700);
}

.table td {
    padding: 15px 20px;
    border-top: 1px solid var(--gray-200);
    font-size: 14px;
    color: var(--gray-700);
}

.table tbody tr:hover {
    background-color: var(--gray-50);
}

/* Inputs dentro de tablas: mantener fondo blanco y borde sutil al hacer hover */
.table tbody tr:hover .form-control,
.table tbody tr:hover .form-select {
    background-color: #fff !important;
    border: 1px solid var(--gray-300) !important;
    border-radius: 4px;
}

/* Scroll automático en tablas */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.card-body.p-0 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@supports selector(:has(table)) {
    .card-body:has(> table),
    .card-body:has(> div > table) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.table {
    overflow: visible;
}

/* ========================================
   ALERTS
   ======================================== */

.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert i {
    font-size: 20px;
}

.alert-success {
    background: #d1f4e0;
    color: #059669;
    border-left: 4px solid #059669;
}

.alert-warning {
    background: #fef3c7;
    color: #d97706;
    border-left: 4px solid #d97706;
}

.alert-danger {
    background: #fee;
    color: #dc2626;
    border-left: 4px solid #dc2626;
}

.alert-info {
    background: #dbeafe;
    color: #2b5c8a;
    border-left: 4px solid #2b5c8a;
}

/* ========================================
   WELCOME CARD (DASHBOARD)
   ======================================== */

.welcome-card {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    border-radius: var(--border-radius-xl);
    padding: 30px;
    color: white;
    margin-bottom: var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.welcome-card h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.welcome-card p {
    opacity: 0.9;
    font-size: 15px;
}

/* ========================================
   QUICK ACTIONS
   ======================================== */

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.quick-action-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 24px;
    border: 1px solid var(--gray-200);
    text-decoration: none;
    color: var(--gray-700);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.quick-action-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    color: var(--primary);
}

.quick-action-card i {
    font-size: 32px;
    color: var(--primary);
}

.quick-action-card span {
    font-weight: 600;
    font-size: 14px;
}

/* ========================================
   EMPTY STATE
   ======================================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 64px;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 24px;
}

/* ========================================
   TAB STYLES
   ======================================== */

.nav-tabs-custom {
    border-bottom: 2px solid var(--gray-200);
    gap: 0;
}

.nav-tabs-custom .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--gray-500);
    font-weight: 600;
    padding: 12px 20px;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.nav-tabs-custom .nav-link:hover {
    color: var(--primary);
    border-bottom-color: var(--gray-300);
}

.nav-tabs-custom .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

/* ========================================
   STATUS INDICATORS
   ======================================== */

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online  { background: var(--success); }
.status-dot.warning { background: var(--warning); }
.status-dot.offline { background: var(--danger); }

/* ========================================
   LOADING / WIRE TRANSITIONS
   ======================================== */

[wire\:loading] {
    display: inline-block;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

/* ========================================
   MODAL
   ======================================== */

.modal-content {
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--gray-200);
    padding: 20px 24px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--gray-200);
    padding: 16px 24px;
}

/* Modal scrollable — fix global Livewire */
.modal.d-block {
    display: flex !important;
    align-items: center;
    justify-content: center;
    overflow: hidden !important;
    padding: 0.5rem;
}

.modal.d-block .modal-dialog {
    margin: 0;
    max-height: 92vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal.d-block .modal-content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 100%;
}

.modal.d-block .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal.d-block .modal-header,
.modal.d-block .modal-footer {
    flex-shrink: 0;
}

/* ========================================
   UTILITIES
   ======================================== */

.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger  { color: var(--danger) !important; }
.text-muted   { color: var(--gray-500) !important; }

.bg-primary { background: var(--primary) !important; }
.bg-success { background: var(--success) !important; }
.bg-light   { background: var(--gray-50) !important; }

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

.mobile-card {
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
}
.mobile-card:last-child { border-bottom: none; }

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.mobile-card-title    { font-weight: 600; font-size: 14px; min-width: 0; flex: 1; }
.mobile-card-subtitle { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.mobile-card-value    { font-size: 16px; font-weight: 700; text-align: right; flex-shrink: 0; }
.mobile-card-meta     { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--gray-500); margin-bottom: 8px; }
.mobile-card-actions  { display: flex; gap: 6px; margin-top: 10px; }
.mobile-card-actions .btn-grow { flex: 1; }

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

@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0;
        padding: var(--spacing-md);
    }

    .page-title { font-size: 22px; }
    .page-subtitle { font-size: 13px; }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .main-sidebar {
        box-shadow: var(--shadow-lg);
    }

    .table th, .table td {
        padding: 12px 14px;
        font-size: 13px;
    }

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

    .welcome-card { padding: 20px; }
    .welcome-card h2 { font-size: 20px; }
}

@media (max-width: 576px) {
    .main-content { padding: 12px; }

    .card-header, .card-body, .card-footer { padding: 14px; }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 14px;
        display: flex;
        align-items: center;
        gap: 14px;
    }

    .stat-icon { width: 42px; height: 42px; font-size: 20px; }
    .stat-value { font-size: 18px; }
    .stat-label { font-size: 12px; }

    .modal-footer .btn { flex: 1; }
    .page-header .btn  { width: auto; padding: 10px 16px; font-size: 13px; }

    .page-header  { margin-bottom: 16px; padding-bottom: 12px; }
    .page-title   { font-size: 20px; gap: 8px; }
    .page-breadcrumb { font-size: 12px; }

    .modal-dialog { max-width: 100%; margin: 8px; }
    .modal-dialog.modal-sm { max-width: calc(100% - 32px); margin: 16px auto; }
    .modal-header { padding: 14px 16px; }
    .modal-body   { padding: 16px; }
    .modal-footer { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
    .modal-title  { font-size: 16px; }

    .welcome-card { padding: 16px; }
    .welcome-card h2 { font-size: 18px; }
    .welcome-card p  { font-size: 13px; }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .quick-action-card { padding: 16px 12px; }
    .quick-action-card i { font-size: 24px; }
    .quick-action-card span { font-size: 12px; }

    .nav-tabs-custom {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .nav-tabs-custom .nav-link { white-space: nowrap; padding: 10px 14px; font-size: 13px; }

    .toast-container { right: 12px; left: 12px; }
    .toast-item { min-width: auto; font-size: 13px; }

    .empty-state { padding: 40px 16px; }
    .empty-state i { font-size: 48px; }
    .empty-state h3 { font-size: 17px; }

    .card-title { font-size: 16px; }
}

/* ========================================
   ANIMACIONES
   ======================================== */

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

.fade-in { animation: fadeIn 0.3s ease; }

/* ========================================
   DARK MODE
   ======================================== */

body.dark-mode {
    --gray-50:  #0f1117;
    --gray-100: #1a1d27;
    --gray-200: #252836;
    --gray-300: #363a4f;
    --gray-400: #6b7280;
    --gray-500: #9ca3af;
    --gray-600: #d1d5db;
    --gray-700: #e5e7eb;
    --gray-800: #f3f4f6;
    --gray-900: #f9fafb;
    --white:    #1a1d27;
    --light:    #0f1117;

    background: #0f1117;
    color: #e2e8f0;
}

body.dark-mode .main-wrapper        { background: #0f1117; }
body.dark-mode .page-container      { color: #e2e8f0; }

/* Header */
body.dark-mode .main-header {
    background: #1a1d27;
    border-color: #252836;
    box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
body.dark-mode .header-action-btn {
    background: #252836;
    color: #d1d5db;
}
body.dark-mode .header-action-btn:hover {
    background: #363a4f;
    color: var(--primary-light);
}
body.dark-mode .user-menu:hover { background: #252836; }
body.dark-mode .user-info .name { color: #f3f4f6; }
body.dark-mode .user-info .role { color: #9ca3af; }

/* Sidebar */
body.dark-mode .main-sidebar {
    background: #1a1d27;
    border-color: #252836;
}
body.dark-mode .sidebar-section-title { color: #6b7280; }
body.dark-mode .sidebar-nav li a { color: #9ca3af; }
body.dark-mode .sidebar-nav li a:hover {
    background: #252836;
    color: #f3f4f6;
}
body.dark-mode .sidebar-nav li a.active {
    background: rgba(59,126,161,.12);
    color: var(--primary-light);
    border-left-color: var(--primary-light);
}

/* Cards */
body.dark-mode .card {
    background: #1a1d27;
    border-color: #252836;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
body.dark-mode .card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.4); }
body.dark-mode .card-header { background: #1a1d27; border-color: #252836; color: #f3f4f6; }
body.dark-mode .card-title  { color: #f3f4f6; }
body.dark-mode .card-body   { color: #d1d5db; }

/* Tables */
body.dark-mode .table {
    --bs-table-bg: #1a1d27;
    --bs-table-color: #d1d5db;
    --bs-table-border-color: #252836;
    --bs-table-hover-bg: #252836;
    --bs-table-hover-color: #f3f4f6;
    color: #d1d5db;
    border-color: #252836;
}
body.dark-mode .table thead th { background: #252836; color: #9ca3af; border-color: #363a4f; }
body.dark-mode .table tbody tr { background: #1a1d27; color: #d1d5db; }
body.dark-mode .table td, body.dark-mode .table th { border-color: #252836; }
body.dark-mode .table-responsive { background: #1a1d27; }
body.dark-mode .table tbody tr:hover .form-control,
body.dark-mode .table tbody tr:hover .form-select {
    background-color: #2d3148 !important;
    border: 1px solid #4b5280 !important;
    border-radius: 4px;
    color: #e2e8f0 !important;
}

body.dark-mode .table-light,
body.dark-mode .table .table-light,
body.dark-mode thead.table-light th,
body.dark-mode .table thead.table-light > tr > th,
body.dark-mode .table .table-light td { background: #252836 !important; color: #9ca3af !important; border-color: #363a4f !important; }
body.dark-mode .table .fw-semibold { color: #e2e8f0; }
body.dark-mode .table .text-center.align-middle.table-light { background: #252836 !important; color: #d1d5db !important; }

/* Forms */
body.dark-mode .form-control,
body.dark-mode .form-select {
    background: #252836;
    border-color: #363a4f;
    color: #e2e8f0;
}
body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background: #252836;
    border-color: var(--primary);
    color: #e2e8f0;
    box-shadow: 0 0 0 3px rgba(43,92,138,.25);
}
body.dark-mode .form-control::placeholder { color: #6b7280; }
body.dark-mode .form-label  { color: #d1d5db; }
body.dark-mode .input-group-text { background: #363a4f; border-color: #363a4f; color: #d1d5db; }

/* Dropdowns */
body.dark-mode .dropdown-menu {
    background: #1a1d27;
    border-color: #252836;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
body.dark-mode .dropdown-item { color: #d1d5db; }
body.dark-mode .dropdown-item:hover { background: #252836; color: #f3f4f6; }
body.dark-mode .dropdown-divider { border-color: #252836; }

/* Modals */
body.dark-mode .modal-content { background: #1a1d27; border-color: #252836; color: #e2e8f0; }
body.dark-mode .modal-header  { border-color: #252836; }
body.dark-mode .modal-footer  { border-color: #252836; }
body.dark-mode .btn-close { filter: invert(1); }

/* Alerts */
body.dark-mode .alert-info    { background: #1e3a5f; border-color: #2b5c8a; color: #93c5fd; }
body.dark-mode .alert-success { background: #14532d; border-color: #16a34a; color: #86efac; }
body.dark-mode .alert-warning { background: #451a03; border-color: #d97706; color: #fcd34d; }
body.dark-mode .alert-danger  { background: #450a0a; border-color: #dc2626; color: #fca5a5; }

/* Badges */
body.dark-mode .badge-success  { background: #166534; color: #bbf7d0; }
body.dark-mode .badge-danger   { background: #7f1d1d; color: #fecaca; }
body.dark-mode .badge-warning  { background: #78350f; color: #fde68a; }
body.dark-mode .badge-info     { background: #1e3a5f; color: #bfdbfe; }
body.dark-mode .badge-primary  { background: var(--primary-dark); color: #bfdbfe; }

/* Bootstrap bg-* badges */
body.dark-mode .bg-warning, body.dark-mode .badge.bg-warning { background: #78350f !important; color: #fde68a !important; }
body.dark-mode .bg-success, body.dark-mode .badge.bg-success { background: #166534 !important; color: #bbf7d0 !important; }
body.dark-mode .bg-danger,  body.dark-mode .badge.bg-danger  { background: #7f1d1d !important; color: #fecaca !important; }
body.dark-mode .bg-info,    body.dark-mode .badge.bg-info    { background: #1e3a5f !important; color: #bfdbfe !important; }
body.dark-mode .bg-primary, body.dark-mode .badge.bg-primary { background: var(--primary-dark) !important; color: #bfdbfe !important; }
body.dark-mode .text-dark   { color: #f3f4f6 !important; }

/* Buttons outline */
body.dark-mode .btn-outline-primary   { color: var(--primary-light); border-color: var(--primary-light); }
body.dark-mode .btn-outline-primary:hover { background: var(--primary); color: #fff; }
body.dark-mode .btn-outline-secondary { color: #9ca3af; border-color: #363a4f; }
body.dark-mode .btn-outline-secondary:hover { background: #363a4f; color: #f3f4f6; }
body.dark-mode .btn-outline-danger    { color: #f87171; border-color: #f87171; }
body.dark-mode .btn-secondary { background: #374151; border-color: #374151; color: #e2e8f0; }

/* Nav tabs */
body.dark-mode .nav-tabs { border-color: #252836; }
body.dark-mode .nav-link { color: #9ca3af; }
body.dark-mode .nav-link:hover { color: #f3f4f6; }
body.dark-mode .nav-tabs .nav-link.active {
    background: #1a1d27;
    border-color: #252836 #252836 #1a1d27;
    color: var(--primary-light);
}

/* Page header */
body.dark-mode .page-header   { border-color: #252836; }
body.dark-mode .page-title    { color: #f3f4f6; }
body.dark-mode .page-subtitle { color: #9ca3af; }
body.dark-mode .page-breadcrumb { color: #6b7280; }

/* Misc */
body.dark-mode hr { border-color: #252836; }
body.dark-mode .text-muted { color: #6b7280 !important; }
body.dark-mode .status-indicator { color: #9ca3af; }
body.dark-mode .mobile-card { background: #1a1d27; border-color: #252836; }
body.dark-mode .mobile-card-title { color: #f3f4f6; }
body.dark-mode .mobile-card-meta  { color: #9ca3af; }

/* Stat cards */
body.dark-mode .stat-card       { background: #1a1d27 !important; border-color: #252836 !important; }
body.dark-mode .stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.4); }
body.dark-mode .stat-value      { color: #f3f4f6; }
body.dark-mode .stat-label      { color: #9ca3af; }
body.dark-mode .stat-change.positive { background: #14532d; color: #86efac; }
body.dark-mode .stat-change.negative { background: #450a0a; color: #fca5a5; }

/* Quick action cards */
body.dark-mode .quick-action-card { background: #1a1d27 !important; border-color: #252836; color: #d1d5db; }
body.dark-mode .quick-action-card:hover { background: #252836 !important; color: var(--primary-light); }

/* Paginación Bootstrap */
body.dark-mode .pagination .page-link { background: #252836; border-color: #363a4f; color: #d1d5db; }
body.dark-mode .pagination .page-link:hover { background: #363a4f; color: #f3f4f6; }
body.dark-mode .pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }
body.dark-mode .pagination .page-item.disabled .page-link { background: #1a1d27; border-color: #252836; color: #6b7280; }

/* ========================================
   DARK MODE — DASHBOARD CUSTOM
   ======================================== */

body.dark-mode .dash-stat-card {
    background: #1a1d27 !important;
    border-color: #252836 !important;
    border-top-color: #3b7ea1 !important;
}
body.dark-mode .dash-stat-card:hover { box-shadow: 0 8px 20px rgba(0,0,0,.4); }
body.dark-mode .dash-stat-card h5    { color: #9ca3af; }
body.dark-mode .dash-stat-card .stat-num { color: #60a5fa; }
body.dark-mode .dash-stat-card .stat-sub { color: #6b7280; }
body.dark-mode .dash-stat-card .health-dot { background: #4ade80; }
body.dark-mode .dash-stat-card i {
    background: linear-gradient(135deg,#3b7ea1,#60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.dark-mode .dash-action-btn {
    background: linear-gradient(135deg,#252836,#1a1d27);
    color: #d1d5db;
    box-shadow: 0 2px 5px rgba(0,0,0,.3);
}
body.dark-mode .dash-action-btn i { color: #60a5fa; }
body.dark-mode .dash-action-btn:hover {
    background: linear-gradient(135deg,#2b5c8a,#42a5f5);
    color: #fff;
    box-shadow: 0 5px 15px rgba(21,101,192,.4);
}
body.dark-mode .dash-action-btn:hover i { color: #fff; }
