/* Ocultar flechas de inputs numéricos */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* Reset y estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar con colores del colegio */
.navbar {
    background: linear-gradient(135deg, #1a2e6b 0%, #2563eb 55%, #0891b2 100%);
    color: white;
    padding: 0.75rem 0;
    box-shadow: 0 4px 14px rgba(0,0,0,0.22);
    border-bottom: 3px solid rgba(251, 191, 36, 0.75);
}

.nav-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: background 0.25s, transform 0.15s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.22);
    transform: translateY(-1px);
}

.nav-separator {
    width: 1px;
    height: 1.5rem;
    background: rgba(255,255,255,0.4);
    margin: 0 0.25rem;
    padding: 0;
    align-self: center;
}

/* Main content - ancho completo */
.main-content {
    max-width: 100%;
    margin: 0;
    padding: 1.5rem 2rem;
    flex: 1;
}

.container {
    width: 100%;
    max-width: 100%;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.page-header h2 {
    font-size: 1.75rem;
    color: #2d3748;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #1e3a8a;
    color: white;
}

.btn-primary:hover {
    background: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(30, 58, 138, 0.3);
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover {
    background: #5a6676;
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.2);
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: white;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.stat-card.success {
    border-left: 4px solid #48bb78;
}

.stat-card.warning {
    border-left: 4px solid #ed8936;
}

.stat-card.danger {
    border-left: 4px solid #f56565;
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-content h3 {
    font-size: 1.75rem;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: #718096;
    font-size: 0.875rem;
}

/* Dashboard grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.chart-card, .list-card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-card h3, .list-card h3 {
    margin-bottom: 0.75rem;
    color: #2d3748;
    font-size: 1rem;
}

#recaudoChart {
    width: 100%;
    height: 200px;
}

/* Morosos list */
.morosos-list {
    max-height: 280px;
    overflow-y: auto;
}

.moroso-item {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.moroso-item:last-child {
    border-bottom: none;
}

.moroso-info strong {
    display: block;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.moroso-deuda {
    text-align: right;
}

.debt-amount {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: #f56565;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-info {
    background: #bee3f8;
    color: #2c5282;
}

.badge-warning {
    background: #feebc8;
    color: #7c2d12;
}

.badge-success {
    background: #c6f6d5;
    color: #22543d;
}

.badge-danger {
    background: #fed7d7;
    color: #742a2a;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filters select, .filters input {
    padding: 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 1rem;
}

.filters input {
    flex: 1;
}

/* Table */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f7fafc;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.data-table tbody tr:hover {
    background: #f7fafc;
}

.empty-state, .loading {
    text-align: center;
    padding: 2rem;
    color: #718096;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal-content {
    background: white;
    margin: 2rem auto;
    padding: 0;
    border-radius: 8px;
    max-width: 600px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #2d3748;
}

.close {
    font-size: 2rem;
    font-weight: 300;
    color: #718096;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #2d3748;
}

.modal-content form {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #4a5568;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #718096;
    font-size: 0.875rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Year selector */
.year-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.year-selector select {
    padding: 0.5rem 1rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 1rem;
}

/* Info card */
.info-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.info-card h3 {
    margin-bottom: 1rem;
    color: #2d3748;
}

.info-row {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.info-row span {
    color: #4a5568;
}

/* Estado cuenta */
.estado-cuenta {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.estado-cuenta h3 {
    margin-bottom: 1.5rem;
    color: #2d3748;
}

.concepto-card {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.concepto-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.concepto-header h4 {
    color: #2d3748;
    margin: 0;
}

.concepto-amounts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.amount-item {
    display: flex;
    flex-direction: column;
}

.amount-item .label {
    font-size: 0.875rem;
    color: #718096;
    margin-bottom: 0.25rem;
}

.amount-item .value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2d3748;
}

.amount-item .value.success {
    color: #48bb78;
}

.amount-item .value.danger {
    color: #f56565;
}

.concepto-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pago-info {
    background: #edf2f7;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.pago-info p {
    margin-bottom: 0.5rem;
}

.saldo-amount {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
}

/* Historial */
.historial-list {
    max-height: 400px;
    overflow-y: auto;
}

.historial-item {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
}

.historial-fecha {
    font-weight: 600;
    color: #4a5568;
}

.historial-valor {
    font-size: 1.25rem;
    font-weight: 700;
    color: #48bb78;
}

.historial-forma {
    text-transform: capitalize;
    color: #718096;
}

.historial-obs {
    grid-column: 1 / -1;
    font-size: 0.875rem;
    color: #718096;
    font-style: italic;
}

.historial-actions {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
}

/* Search section */
.search-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

/* Config */
.config-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.config-card {
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.config-card h3 {
    margin-bottom: 1rem;
    color: #2d3748;
}

.form-actions {
    margin-top: 2rem;
    text-align: center;
}

.config-history {
    margin-top: 2rem;
}

.config-history h3 {
    margin-bottom: 1rem;
    color: #2d3748;
}

/* Reports */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.report-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.report-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.report-card h3 {
    margin-bottom: 1rem;
    color: #2d3748;
}

.report-card p {
    color: #718096;
    margin-bottom: 1.5rem;
}

.report-output {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.alert-info {
    background: #bee3f8;
    color: #2c5282;
    border-left: 4px solid #4299e1;
}

/* Footer */
.footer {
    background: #1e3a8a;
    color: white;
    padding: 1rem 2rem;
    margin-top: auto;
    border-top: 3px solid #60a5fa;
}

.footer p {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Hamburger button — siempre visible */
/* Hamburger — oculto en desktop, visible en móvil */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    flex-shrink: 0;
}
.nav-hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background: white;
    border-radius: 3px;
    transition: all 0.3s;
}
.nav-hamburger-open span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
.nav-hamburger-open span:nth-child(2) { opacity: 0; }
.nav-hamburger-open span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

/* Desktop: navbar horizontal */
.navbar { position: relative; }
.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.4rem;
    align-items: center;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
}
.nav-menu .nav-link {
    white-space: nowrap;
    font-size: 0.88rem;
    padding: 0.4rem 0.65rem;
}
.nav-icons-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

/* Pantallas medianas: reducir un poco más */
@media (max-width: 1400px) and (min-width: 1025px) {
    .nav-menu { gap: 0.25rem; }
    .nav-menu .nav-link { font-size: 0.82rem; padding: 0.35rem 0.5rem; }
    .nav-brand h1 { font-size: 1rem; }
    .nav-container { padding: 0 1rem; }
}

/* Móvil/tablet: hamburger + dropdown */
@media (max-width: 1024px) {
    .nav-hamburger { display: flex; }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: #1a3580;
        padding: 0.5rem;
        gap: 0.2rem;
        z-index: 1000;
        box-shadow: 0 8px 24px rgba(0,0,0,0.4);
        border-radius: 0 0 10px 10px;
        border-top: 2px solid rgba(251,191,36,0.7);
    }
    .nav-menu.nav-menu-open { display: flex; }

    .nav-menu .nav-link {
        padding: 0.6rem 1rem;
        border-radius: 6px;
        width: 100%;
        box-sizing: border-box;
        font-size: 1rem;
        white-space: normal;
    }
    .nav-menu .nav-separator {
        height: 1px;
        background: rgba(255,255,255,0.15);
        margin: 0.25rem 0;
    }
    .nav-menu .nav-username {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
        opacity: 0.75;
    }
    .nav-icons-row {
        padding: 0.25rem 0.5rem;
    }

    .dashboard-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; gap: 1rem; align-items: flex-start; }
    .filters { flex-direction: column; }
}

/* Print styles */
@media print {
    .navbar, .footer, .btn, .filters {
        display: none !important;
    }

    .main-content {
        margin: 0;
        padding: 0;
    }
}

/* ===========================
   MODO OSCURO (DARK MODE)
   =========================== */

/* Transiciones suaves para todos los elementos */
body, .navbar, .stat-card, .chart-card, .list-card, .modal-content, 
.data-table, .btn, .alert, .quick-link, input, select, textarea,
.table-container, .page-header, .filters select, .filters input {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Body en modo oscuro */
body.dark-mode {
    background-color: #0f172a;
    color: #e2e8f0;
}

/* Username en navbar */
.nav-username {
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(255,255,255,0.95);
    letter-spacing: 0.02em;
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Navbar oscuro */
body.dark-mode .navbar {
    background: linear-gradient(135deg, #0c1e3a 0%, #0f2d5e 55%, #0a3d52 100%);
}

body.dark-mode .nav-username {
    color: rgba(255,255,255,0.85);
    background: transparent;
}

/* Contenido principal */
body.dark-mode .main-content {
    background-color: #0f172a;
}

/* Headers */
body.dark-mode h1, 
body.dark-mode h2, 
body.dark-mode h3, 
body.dark-mode h4,
body.dark-mode .page-header h2 {
    color: #f1f5f9;
}

body.dark-mode .page-header {
    border-bottom-color: #334155;
}

/* Stat Cards */
body.dark-mode .stat-card {
    background: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
}

body.dark-mode .stat-card.success {
    background: #064e3b;
    border-color: #10b981;
}

body.dark-mode .stat-card.warning {
    background: #1e293b;
    border-left: 4px solid #f59e0b;
}

body.dark-mode .stat-card.danger {
    background: #7f1d1d;
    border-color: #ef4444;
}

body.dark-mode .stat-card.info {
    background: #1e3a8a;
    border-color: #3b82f6;
}

body.dark-mode .stat-icon {
    color: #94a3b8;
}

/* Chart cards y list cards */
body.dark-mode .chart-card,
body.dark-mode .list-card {
    background: #1e293b;
    border: 1px solid #334155;
}

/* Tablas */
body.dark-mode .table-container {
    background: #1e293b;
    border: 1px solid #334155;
}

body.dark-mode .data-table {
    background: #1e293b;
    color: #e2e8f0;
}

body.dark-mode .data-table thead {
    background: #0f172a;
    color: #f1f5f9;
}

body.dark-mode .data-table tbody tr {
    border-bottom-color: #334155;
}

body.dark-mode .data-table tbody tr:hover {
    background: #334155;
}

body.dark-mode .data-table td,
body.dark-mode .data-table th {
    color: #e2e8f0;
}

/* Modales */
body.dark-mode .modal {
    background-color: rgba(0, 0, 0, 0.8);
}

body.dark-mode .modal-content {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
}

body.dark-mode .modal-header {
    border-bottom-color: #334155;
}

body.dark-mode .modal-footer {
    border-top-color: #334155;
}

/* Formularios */
body.dark-mode .form-group label {
    color: #cbd5e1;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
    background: #0f172a;
    color: #e2e8f0;
    border-color: #334155;
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group select:focus,
body.dark-mode .form-group textarea:focus {
    border-color: #3b82f6;
    background: #1e293b;
}

body.dark-mode .form-group input::placeholder {
    color: #64748b;
}

/* Botones */
body.dark-mode .btn-primary {
    background: #3b82f6;
}

body.dark-mode .btn-primary:hover {
    background: #2563eb;
}

body.dark-mode .btn-secondary {
    background: #334155;
    color: #e2e8f0;
}

body.dark-mode .btn-secondary:hover {
    background: #475569;
}

body.dark-mode .btn-danger {
    background: #dc2626;
}

body.dark-mode .btn-danger:hover {
    background: #b91c1c;
}

.btn-confirm-ok {
    background: var(--confirm-btn-bg, #f59e0b);
    color: white;
}

body.dark-mode .btn-confirm-ok {
    background: var(--confirm-btn-bg, #f59e0b) !important;
    color: white !important;
}

/* Alertas */
body.dark-mode .alert {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .alert-info {
    background: #1e3a8a;
    border-color: #3b82f6;
    color: #dbeafe;
}

body.dark-mode .alert-success {
    background: #064e3b;
    border-color: #10b981;
    color: #d1fae5;
}

body.dark-mode .alert-warning {
    background: #713f12;
    border-color: #f59e0b;
    color: #fef3c7;
}

body.dark-mode .alert-danger {
    background: #7f1d1d;
    border-color: #ef4444;
    color: #fecaca;
}

/* Quick links */
body.dark-mode .quick-link {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .quick-link:hover {
    background: #334155;
    border-color: #3b82f6;
}

body.dark-mode .quick-icon {
    background: #0f172a;
}

/* Badges */
body.dark-mode .badge {
    border: 1px solid #334155;
}

body.dark-mode .badge-success {
    background: #065f46;
    color: #d1fae5;
}

body.dark-mode .badge-warning {
    background: #92400e;
    color: #fef3c7;
}

body.dark-mode .badge-danger {
    background: #991b1b;
    color: #fecaca;
}

body.dark-mode .badge-info {
    background: #1e40af;
    color: #dbeafe;
}

body.dark-mode .badge-secondary {
    background: #475569;
    color: #e2e8f0;
}

/* Filtros */
body.dark-mode .filters select,
body.dark-mode .filters input,
body.dark-mode .year-selector select {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
}

/* Empty state y loading */
body.dark-mode .empty-state,
body.dark-mode .loading {
    color: #64748b;
}

/* Asignaciones y morosos */
body.dark-mode .asignacion-item,
body.dark-mode .moroso-item {
    border-bottom-color: #334155;
}

body.dark-mode .asignacion-item:hover,
body.dark-mode .moroso-item:hover {
    background: #334155;
}

/* Footer */
body.dark-mode .footer {
    background: #0f172a;
    border-top-color: #334155;
    color: #94a3b8;
}

/* Botón toggle de dark mode */
.dark-mode-toggle {
    background: rgba(255,255,255,0.2);
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.dark-mode-toggle:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

body.dark-mode .dark-mode-toggle {
    background: rgba(59, 130, 246, 0.2);
}

body.dark-mode .dark-mode-toggle:hover {
    background: rgba(59, 130, 246, 0.3);
}

/* Scrollbar oscuro */
body.dark-mode ::-webkit-scrollbar {
    width: 12px;
}

body.dark-mode ::-webkit-scrollbar-track {
    background: #0f172a;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 6px;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Login page */
body.dark-mode .login-box {
    background: #1e293b;
    border: 1px solid #334155;
}

body.dark-mode .login-box h2 {
    color: #f1f5f9;
}

/* Estado de cuenta */
body.dark-mode .estado-cuenta {
    background: #1e293b;
    border: 1px solid #334155;
}

body.dark-mode .estado-cuenta h3 {
    color: #f1f5f9;
}

body.dark-mode .concepto-card {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .concepto-header h4 {
    color: #f1f5f9;
}

body.dark-mode .amount-item .label {
    color: #94a3b8;
}

body.dark-mode .amount-item .value {
    color: #f1f5f9;
}

body.dark-mode .amount-item .value.success {
    color: #4ade80;
}

body.dark-mode .amount-item .value.danger {
    color: #f87171;
}

body.dark-mode .pago-info {
    background: #334155;
    color: #e2e8f0;
}

body.dark-mode .pago-info p,
body.dark-mode .pago-info strong {
    color: #e2e8f0;
}

/* Info card */
body.dark-mode .info-card {
    background: #1e293b;
    border: 1px solid #334155;
}

body.dark-mode .info-card h3 {
    color: #f1f5f9;
}

body.dark-mode .info-row span {
    color: #cbd5e1;
}

body.dark-mode .info-row strong {
    color: #f1f5f9;
}

/* Config section */
body.dark-mode .config-section {
    background: #1e293b;
    border: 1px solid #334155;
}

body.dark-mode .config-card {
    background: #0f172a;
    border: 1px solid #334155;
}

body.dark-mode .config-card h3 {
    color: #f1f5f9;
}

body.dark-mode .config-history h3 {
    color: #f1f5f9;
}

/* Report cards */
body.dark-mode .report-card {
    background: #1e293b;
    border: 1px solid #334155;
}

body.dark-mode .report-card h3 {
    color: #f1f5f9;
}

body.dark-mode .report-card p {
    color: #94a3b8;
}

body.dark-mode .report-output {
    background: #1e293b;
    border: 1px solid #334155;
}

/* Search section */
body.dark-mode .search-section {
    background: #1e293b;
    border: 1px solid #334155;
}

/* Historial */
body.dark-mode .historial-item {
    border-bottom-color: #334155;
}

body.dark-mode .historial-fecha {
    color: #cbd5e1;
}

body.dark-mode .historial-valor {
    color: #4ade80;
}

body.dark-mode .historial-forma {
    color: #94a3b8;
}

body.dark-mode .historial-obs {
    color: #94a3b8;
}

/* Morosos */
body.dark-mode .moroso-info strong {
    color: #f1f5f9;
}

body.dark-mode .moroso-info small {
    color: #94a3b8;
}

body.dark-mode .debt-amount {
    color: #f87171;
}

body.dark-mode .moroso-deuda {
    color: #94a3b8;
}

body.dark-mode .moroso-deuda small {
    color: #64748b;
}

/* Stat content */
body.dark-mode .stat-content h3 {
    color: #f1f5f9;
}

body.dark-mode .stat-content p {
    color: #94a3b8;
}

/* Data table - stronger text */
body.dark-mode .data-table td strong {
    color: #f1f5f9;
}

body.dark-mode .data-table td small {
    color: #94a3b8;
}

/* Form group small text */
body.dark-mode .form-group small {
    color: #94a3b8;
}

/* Select options */
body.dark-mode select option {
    background: #1e293b;
    color: #e2e8f0;
}

/* Concepto actions buttons text */
body.dark-mode .concepto-actions .btn {
    color: white;
}

/* Close button in modals */
body.dark-mode .close {
    color: #94a3b8;
}

body.dark-mode .close:hover {
    color: #f1f5f9;
}

/* Modal header h3 */
body.dark-mode .modal-header h3 {
    color: #f1f5f9;
}

/* Chart card and list card titles */
body.dark-mode .chart-card h3,
body.dark-mode .list-card h3 {
    color: #f1f5f9;
}

/* Asignacion item text */
body.dark-mode .asignacion-item strong {
    color: #f1f5f9;
}

body.dark-mode .asignacion-item small {
    color: #94a3b8;
}

/* Quick link text */
body.dark-mode .quick-link h4 {
    color: #f1f5f9;
}

body.dark-mode .quick-link p {
    color: #94a3b8;
}

/* Inline styles overrides for common patterns */
body.dark-mode [style*="background: #f"] {
    background: #1e293b !important;
}

body.dark-mode [style*="background: white"],
body.dark-mode [style*="background:white"] {
    background: #1e293b !important;
}

body.dark-mode [style*="color: #2d3748"],
body.dark-mode [style*="color: #1f2937"],
body.dark-mode [style*="color: #4a5568"],
body.dark-mode [style*="color: #4b5563"] {
    color: #f1f5f9 !important;
}

body.dark-mode [style*="color: #718096"],
body.dark-mode [style*="color: #6b7280"] {
    color: #94a3b8 !important;
}

body.dark-mode [style*="border-bottom: 1px solid #e"] {
    border-bottom-color: #334155 !important;
}

/* Specific inline backgrounds commonly used */
body.dark-mode [style*="background: #f0fdf4"],
body.dark-mode [style*="background: #fef3c7"],
body.dark-mode [style*="background: #fee2e2"],
body.dark-mode [style*="background: #f7fafc"],
body.dark-mode [style*="background: #edf2f7"] {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

/* Success/warning/danger backgrounds in dark mode */
body.dark-mode [style*="background: #dcfce7"],
body.dark-mode [style*="background: #d1fae5"] {
    background: #064e3b !important;
    color: #d1fae5 !important;
}

body.dark-mode [style*="background: #fef9c3"],
body.dark-mode [style*="background: #fef3c7"] {
    background: #713f12 !important;
    color: #fef3c7 !important;
}

body.dark-mode [style*="background: #fecaca"],
body.dark-mode [style*="background: #fee2e2"] {
    background: #7f1d1d !important;
    color: #fecaca !important;
}

/* More comprehensive inline style overrides */
body.dark-mode [style*="background-color: #f0fdf4"] {
    background-color: #064e3b !important;
}

body.dark-mode [style*="color: #166534"] {
    color: #4ade80 !important;
}

body.dark-mode [style*="color: #92400e"],
body.dark-mode [style*="color: #b45309"] {
    color: #fbbf24 !important;
}

body.dark-mode [style*="border-bottom: 1px solid #e5e7eb"] {
    border-bottom-color: #334155 !important;
}

body.dark-mode [style*="border: 1px solid #86efac"] {
    border-color: #22c55e !important;
}

body.dark-mode [style*="border: 1px solid #f3f4f6"],
body.dark-mode [style*="border-bottom: 1px solid #f3f4f6"] {
    border-color: #334155 !important;
}

/* Fix for all remaining white/light backgrounds */
body.dark-mode [style*="background: #f0f9ff"] {
    background: #1e3a5a !important;
}

body.dark-mode [style*="background: linear-gradient"] {
    background: #1e293b !important;
}

/* Fix text colors in generated content */
body.dark-mode div[style*="color: #1f2937"] strong,
body.dark-mode [style*="color: #1f2937"] {
    color: #f1f5f9 !important;
}

/* Fix logros page resumen boxes */
body.dark-mode [style*="box-shadow: 0 1px 3px"] {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

/* Profesores page checkboxes */
body.dark-mode label[style*="border-bottom: 1px solid #f3f4f6"] {
    border-bottom-color: #334155 !important;
}

/* Fix password display box */
body.dark-mode [style*="background: #1e293b; color: #22c55e"] {
    background: #0f172a !important;
}

/* Generic divs with padding and background */
body.dark-mode div[style*="padding"][style*="background: #f"] {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}

/* Fix small text in dark mode */
body.dark-mode small {
    color: #94a3b8;
}

body.dark-mode strong {
    color: #f1f5f9;
}

/* Fix paragraph text */
body.dark-mode p {
    color: #cbd5e1;
}

/* Fix label text */
body.dark-mode label {
    color: #cbd5e1;
}

/* Ranking page specific */
body.dark-mode [style*="background: #fef2f2"] {
    background: #7f1d1d !important;
}

body.dark-mode [style*="background: #fed7aa"] {
    background: #78350f !important;
}

/* Tables with inline hover styles */
body.dark-mode tr[style*="background-color: #f0fdf4"] {
    background-color: #064e3b !important;
}

body.dark-mode tr[style*="background: linear-gradient(90deg, #fef3c7"] {
    background: linear-gradient(90deg, #713f12 0%, transparent 100%) !important;
}

body.dark-mode tr[style*="background: linear-gradient(90deg, #fed7aa"] {
    background: linear-gradient(90deg, #78350f 0%, transparent 100%) !important;
}

/* Textareas with inline styles */
body.dark-mode textarea[style*="border: 1px solid #e5e7eb"],
body.dark-mode textarea[style*="border: 1px solid #e"] {
    background: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

body.dark-mode textarea::placeholder {
    color: #64748b !important;
}

/* Div containers with inline styles */
body.dark-mode div[style*="border-bottom: 1px solid #e5e7eb"],
body.dark-mode div[style*="border-bottom: 1px solid #e"] {
    border-bottom-color: #334155 !important;
}

/* Labels in generated content */
body.dark-mode label[style*="display: block"] {
    color: #e2e8f0 !important;
}

/* Span elements with color styles */
body.dark-mode span[style*="color: #22c55e"] {
    color: #4ade80 !important;
}

/* All input elements */
body.dark-mode input {
    background: #0f172a;
    color: #e2e8f0;
    border-color: #334155;
}

body.dark-mode input::placeholder {
    color: #64748b;
}

/* Make sure all text in dark mode is readable */
body.dark-mode .modal-content p,
body.dark-mode .modal-content span,
body.dark-mode .modal-content label {
    color: #cbd5e1;
}

body.dark-mode .modal-content strong {
    color: #f1f5f9;
}

/* Saldo amount in pago modal */
body.dark-mode .saldo-amount {
    color: #f87171 !important;
}

/* Fix checkbox labels */
body.dark-mode input[type="checkbox"] + label,
body.dark-mode label input[type="checkbox"] {
    color: #e2e8f0;
}

/* Date inputs in dark mode */
body.dark-mode input[type="date"] {
    color: #e2e8f0;
    background: #0f172a;
    color-scheme: dark;
}

/* Year selector */
body.dark-mode .year-selector label {
    color: #e2e8f0;
}

/* Info card spans */
body.dark-mode .info-card span {
    color: #cbd5e1;
}

/* All divs with explicit padding and rounded corners typically used for info boxes */
body.dark-mode div[style*="padding: 1rem"][style*="border-radius"] {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

/* Dark mode: override light-colored row backgrounds in tables */
body.dark-mode tr[style*="background-color: #f0fdf4"] {
    background-color: #0f2a1e !important;
}

/* Dark mode: ensure small/span text in tables is readable */
body.dark-mode .data-table small {
    color: #94a3b8 !important;
}

body.dark-mode .data-table td {
    color: #e2e8f0;
}


/* ===== Seguimiento de notas - tarjetas de profesores ===== */
.seg-resumen {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.25rem;
    color: #374151;
}
.seg-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}
.seg-card-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
    background: #ffffff;
    color: #2d3748;
}
.seg-card-row:hover {
    background: #f1f5f9;
}
.seg-card-detail {
    display: none;
    padding: 0.25rem 1rem 0.75rem 2.5rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    color: #374151;
}
.seg-detail-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #e9ecef;
    color: #374151;
}
.seg-detail-row:last-child {
    border-bottom: none;
}

/* Dark mode */
body.dark-mode .seg-resumen {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}
body.dark-mode .seg-card {
    border-color: #334155;
}
body.dark-mode .seg-card-row {
    background: #1e293b;
    color: #e2e8f0;
}
body.dark-mode .seg-card-row:hover {
    background: #263548;
}
body.dark-mode .seg-card-detail {
    background: #0f172a;
    border-top-color: #334155;
    color: #cbd5e1;
}
body.dark-mode .seg-detail-row {
    border-bottom-color: #334155;
    color: #cbd5e1;
}

/* Email split: dos campos en fila (prefijo | @dominio) */
.email-split {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
}
.email-split-input {
    flex: 1 !important;
    width: auto !important;
    min-width: 0;
}
.email-split-domain {
    width: 16ch !important;
    flex-shrink: 0;
}
.email-prefix-count {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 2px;
}
body.dark-mode .email-prefix-count {
    color: #64748b;
}

/* ── Escala de calificaciones (nota-*) ── */
/* Reprobado: 1.0–2.9 | Bueno: 3.0–3.9 | Sobresaliente: 4.0–4.5 | Excelente: 4.6–5.0 */
.nota-verde    { background: #dcfce7; color: #15803d; }
.nota-amarilla { background: #fef9c3; color: #a16207; }
.nota-naranja  { background: #ffedd5; color: #c2410c; }
.nota-roja     { background: #fee2e2; color: #b91c1c; }
.nota-vacia    { color: #9ca3af; background: transparent; }

body.dark-mode .nota-verde    { background: rgba(22,163,74,0.18)  !important; color: #86efac !important; }
body.dark-mode .nota-amarilla { background: rgba(202,138,4,0.18)  !important; color: #fde047 !important; }
body.dark-mode .nota-naranja  { background: rgba(234,88,12,0.18)  !important; color: #fb923c !important; }
body.dark-mode .nota-roja     { background: rgba(220,38,38,0.18)  !important; color: #fca5a5 !important; }
body.dark-mode .nota-vacia    { color: #475569 !important; background: transparent !important; }
