:root {
    /* Identidad académica y cercana */
    --primary-color: #0c706d;
    --primary-light: #54a6a0;
    --primary-dark: #075754;
    --primary-gradient: linear-gradient(135deg, #0c706d 0%, #075754 100%);

    --accent-color: #0c706d;
    --accent-hover: #075754;
    --accent-light: rgba(12, 112, 109, 0.11);
    --accent-gradient: linear-gradient(135deg, #0c706d 0%, #075754 100%);

    /* Brand legacy (unified for tables, borders, secondary accents) */
    --brand-dark: #193552;
    --accent-secondary: #dd6542;
    --accent-secondary-light: rgba(221, 101, 66, 0.12);

    /* Background - Soft Lavender (lighter tones) */
    --bg-body: #f7f5ef;
    --bg-body-solid: #f7f5ef;
    --bg-card: #fffefa;
    --bg-card-hover: #f4f2ea;
    --bg-sidebar: #064f50;

    --text-primary: #17324d;
    --text-secondary: #617083;
    --text-muted: #8a96a4;
    --text-light: #ffffff;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --field-bg: #ffffff;
    --field-text: #000000;
    --field-placeholder: #64748b;

    --danger-color: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --success-color: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --warning-color: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --info-color: #3b82f6;

    /* Spacing & Layout */
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 72px;
    --header-height: 70px;
    --border-radius: 16px;
    --border-radius-sm: 10px;
    --border-radius-lg: 20px;
    --border-radius-xl: 28px;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-blur: blur(10px);

    /* Shadows - Soft & Subtle */
    --shadow-xs: 0 1px 2px rgba(23, 50, 77, 0.05);
    --shadow-sm: 0 3px 10px rgba(23, 50, 77, 0.08);
    --shadow-md: 0 8px 22px rgba(23, 50, 77, 0.10);
    --shadow-lg: 0 16px 35px rgba(23, 50, 77, 0.12);
    --shadow-xl: 0 24px 52px rgba(23, 50, 77, 0.14);
    --shadow-elevated: 0 10px 28px rgba(23, 50, 77, 0.10);
    --shadow-accent: 0 8px 18px rgba(12, 112, 109, 0.24);

    /* Transitions */
    --transition-fast: 0.15s;
    --transition-speed: 0.25s;
    --transition-slow: 0.4s;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-index layers */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1200;
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    background: var(--u5-teal-deep);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-150%);
    transition: transform 160ms ease;
}

.skip-link:focus { transform: translateY(0); }

/* Teacher Details Modal Styles */
.teacher-details-modal {
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
}

.teacher-details-modal .modal-header {
    background: var(--primary-gradient);
    color: var(--text-light);
    padding: 1.5rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.teacher-details-modal .modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.teacher-details-modal .modal-header .close {
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.teacher-details-modal .modal-header .close:hover {
    opacity: 1;
}

.teacher-details-modal .modal-body {
    padding: 2rem;
}

.teacher-info h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Tabs Styles */
.tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
    transition: all 0.2s;
    position: relative;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: var(--accent-light);
}

.tab-btn.active {
    color: var(--primary-color);
    background: var(--accent-light);
    border-bottom: 2px solid var(--primary-color);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

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

/* Documentation Section */
.documentation-section {
    display: grid;
    gap: 2rem;
}

.doc-group {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid #e5e7eb;
}

.doc-group h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.doc-list {
    margin-bottom: 1rem;
}

.doc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-card-hover);
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.5rem;
}

.doc-item span {
    color: var(--text-primary);
    font-weight: 500;
}

.doc-item small {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* History Sections */
.subjects-history,
.grades-history,
.payments-history,
.expediente-section,
.invoices-section {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid #e5e7eb;
}

.subjects-history h4,
.grades-history h4,
.payments-history h4,
.expediente-section h4,
.invoices-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.history-list,
.grades-list,
.payments-list,
.files-list {
    margin-bottom: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.history-item,
.grade-item,
.payment-item,
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-card-hover);
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.5rem;
}

.doc-item,
.history-item,
.grade-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.doc-actions,
.history-actions,
.grade-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.doc-actions .btn,
.history-actions .btn,
.grade-actions .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.history-item span,
.grade-item span,
.file-item span {
    color: var(--text-primary);
    font-weight: 500;
}

.history-item small,
.grade-item small,
.file-item small {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Payment History Specific Styles */
.payment-summary {
    background: var(--accent-light);
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1.5rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.summary-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.summary-value {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.payment-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.payment-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 1rem;
}

.payment-amount {
    color: var(--success-color);
    font-weight: 600;
    font-size: 1rem;
}

.payment-concept {
    color: var(--text-primary);
    font-weight: 500;
    flex: 1;
}

.payment-date {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.payment-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 1rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.completed {
    background: var(--success-light);
    color: var(--success-color);
}

.status-badge.pending {
    background: var(--warning-light);
    color: var(--warning-color);
}

.status-badge.cancelled {
    background: var(--danger-light);
    color: var(--danger-color);
}

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

.payment-item.completed {
    border-left: 3px solid var(--success-color);
}

.payment-item.pending {
    border-left: 3px solid var(--warning-color);
}

.payment-item.cancelled {
    border-left: 3px solid var(--danger-color);
}

/* Form Styles in Modals */
.modal .form-group {
    margin-bottom: 1rem;
}

.modal .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.modal .form-group input,
.modal .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    transition: border-color 0.2s;
    background-color: var(--field-bg);
    color: var(--field-text);
}

.modal .form-group input:focus,
.modal .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.modal .form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Button Styles */
.btn-info {
    background: var(--info-color);
    color: var(--text-light);
}

.btn-info:hover {
    background: #2563eb;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: var(--border-radius-sm);
}

/* Responsive Design */
@media (max-width: 768px) {
    .teacher-details-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        border-radius: var(--border-radius-sm);
        text-align: center;
    }
    
    .tab-btn.active {
        border-bottom: none;
        border-right: 3px solid var(--primary-color);
    }
    
    .history-item,
    .grade-item,
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .modal .form-actions {
        flex-direction: column;
    }
}

/* Theme system */
.theme-light {
    --bg-body: #eef2f7;
    --bg-body-solid: #eef2f7;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-sidebar: #161d33;
    --sidebar-text: #d7def1;
    --sidebar-text-muted: #8a96b8;
    --sidebar-text-soft: #7e8ab0;
    --sidebar-hover-bg: rgba(100, 23, 242, 0.16);
    --sidebar-active-text: #ffffff;

    --text-primary: #111827;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-light: #ffffff;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --field-bg: #ffffff;
    --field-text: #000000;
    --field-placeholder: #64748b;

    --glass-bg: rgba(255, 255, 255, 0.92);
    --glass-border: rgba(15, 23, 42, 0.12);

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.12);
    --shadow-xl: 0 16px 40px rgba(15, 23, 42, 0.15);
}

.theme-dark,
.dark-mode {
    --bg-body: #161d33;
    --bg-body-solid: #161d33;
    --bg-card: #1b2440;
    --bg-card-hover: #202a4a;
    --bg-sidebar: #0f1528;
    --sidebar-text: #d7def1;
    --sidebar-text-muted: #8a96b8;
    --sidebar-text-soft: #7e8ab0;
    --sidebar-hover-bg: rgba(100, 23, 242, 0.2);
    --sidebar-active-text: #ffffff;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --bg-primary: #1e293b;
    --bg-secondary: #0f172a;
    --field-bg: #0f172a;
    --field-text: #ffffff;
    --field-placeholder: #94a3b8;

    --primary-color: #8b5cf6;
    --primary-light: #a78bfa;
    --primary-dark: #6417f2;
    --primary-gradient: linear-gradient(135deg, #6417f2 0%, #9333ea 100%);

    --glass-bg: rgba(27, 36, 64, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.3);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]):not([type="color"]),
select,
textarea {
    background-color: var(--field-bg);
    color: var(--field-text);
    caret-color: var(--field-text);
}

input:not([type="checkbox"]):not([type="radio"])::placeholder,
textarea::placeholder {
    color: var(--field-placeholder);
    opacity: 1;
}

select option {
    background-color: var(--field-bg);
    color: var(--field-text);
}

body[data-theme-accent="blue"] {
    --primary-color: #2563eb;
    --primary-light: #60a5fa;
    --primary-dark: #1e40af;
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: rgba(37, 99, 235, 0.12);
    --accent-gradient: linear-gradient(135deg, #2563eb 0%, #0f766e 100%);
    --shadow-accent: 0 4px 14px rgba(37, 99, 235, 0.3);
}

body[data-theme-accent="green"] {
    --primary-color: #047857;
    --primary-light: #34d399;
    --primary-dark: #064e3b;
    --primary-gradient: linear-gradient(135deg, #047857 0%, #0f766e 100%);
    --accent-color: #047857;
    --accent-hover: #065f46;
    --accent-light: rgba(4, 120, 87, 0.12);
    --accent-gradient: linear-gradient(135deg, #047857 0%, #2563eb 100%);
    --shadow-accent: 0 4px 14px rgba(4, 120, 87, 0.3);
}

body[data-theme-accent="amber"] {
    --primary-color: #b45309;
    --primary-light: #f59e0b;
    --primary-dark: #78350f;
    --primary-gradient: linear-gradient(135deg, #b45309 0%, #92400e 100%);
    --accent-color: #b45309;
    --accent-hover: #92400e;
    --accent-light: rgba(180, 83, 9, 0.13);
    --accent-gradient: linear-gradient(135deg, #b45309 0%, #7c2d12 100%);
    --shadow-accent: 0 4px 14px rgba(180, 83, 9, 0.28);
}

body[data-theme-accent="rose"] {
    --primary-color: #be123c;
    --primary-light: #fb7185;
    --primary-dark: #881337;
    --primary-gradient: linear-gradient(135deg, #be123c 0%, #9f1239 100%);
    --accent-color: #be123c;
    --accent-hover: #9f1239;
    --accent-light: rgba(190, 18, 60, 0.12);
    --accent-gradient: linear-gradient(135deg, #be123c 0%, #7f1d1d 100%);
    --shadow-accent: 0 4px 14px rgba(190, 18, 60, 0.28);
}

/* Acento institucional — identidad del landing (morado + cyan) */
body[data-theme-accent="violet"] {
    --primary-color: #6417f2;
    --primary-light: #8b5cf6;
    --primary-dark: #4c0fb8;
    --primary-gradient: linear-gradient(135deg, #6417f2 0%, #9333ea 100%);
    --accent-color: #6417f2;
    --accent-hover: #5512d6;
    --accent-light: rgba(100, 23, 242, 0.12);
    --accent-gradient: linear-gradient(135deg, #6417f2 0%, #22d3ee 100%);
    --shadow-accent: 0 10px 26px rgba(100, 23, 242, 0.32);
}

/* Collapsible Sidebar Styles */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
    padding: 1.25rem 0.75rem;
}

.sidebar.collapsed .sidebar-logo {
    width: 40px;
    margin: 0 auto 0.75rem;
}

.sidebar.collapsed .section-title {
    opacity: 0;
    height: 0;
    margin: 0;
    overflow: hidden;
}

.sidebar.collapsed nav ul li button {
    padding: 11px;
    justify-content: center;
}

.sidebar.collapsed nav ul li button span:not(.nav-icon) {
    display: none;
}

.sidebar.collapsed .sidebar-bottom {
    padding: 0.5rem;
}

.sidebar.collapsed .btn-logout {
    padding: 10px;
    font-size: 0;
}

.sidebar.collapsed .btn-logout::before {
    content: '→';
    font-size: 1rem;
}

/* Toggle button for sidebar collapse */
.sidebar-toggle {
    position: absolute;
    top: 1rem;
    right: -12px;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    border: 2px solid var(--bg-sidebar);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-speed) var(--ease-out), background var(--transition-speed);
    z-index: 10;
    color: white;
}

.sidebar-toggle:hover {
    transform: scale(1.1);
}

.sidebar.collapsed .sidebar-toggle {
    transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-toggle:hover {
    transform: rotate(180deg) scale(1.1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    padding: 0;
    background: var(--bg-body);
    background-attachment: fixed;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    background: var(--bg-sidebar);
    color: var(--sidebar-text);
    width: var(--sidebar-width);
    padding: 1.25rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: var(--z-fixed);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-speed) var(--ease-out);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 58, 237, 0.3);
}

.sidebar-logo {
    width: 55%;
    margin-bottom: 0.75rem;
    transition: transform var(--transition-speed) var(--ease-out);
}

.sidebar-logo:hover {
    transform: scale(1.02);
}

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

.sidebar nav ul li {
    margin: 0.25rem 0;
}

.sidebar nav ul li button {
    border: none;
    color: var(--sidebar-text);
    padding: 10px 14px;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    background-color: transparent;
    transition: all var(--transition-speed) var(--ease-out);
    font-size: 0.875rem;
    font-weight: 500;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.sidebar nav ul li button::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform var(--transition-speed) var(--ease-out);
}

.sidebar nav ul li button:hover {
    color: var(--sidebar-text);
    background-color: var(--sidebar-hover-bg);
}

.sidebar nav ul li button:hover::before {
    transform: scaleY(1);
}

.sidebar nav ul li button:active {
    transform: scale(0.98);
}

.sidebar nav ul li button.active {
    background: var(--primary-color) !important;
    background-image: none !important;
    color: var(--sidebar-active-text);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.sidebar nav ul li button.active .nav-icon {
    stroke: var(--sidebar-active-text);
}

.sidebar nav ul li button.active::before {
    transform: scaleY(0);
}

/* Override .btn gradient for sidebar navigation buttons */
.sidebar nav ul li button.btn {
    background: transparent !important;
    background-image: none !important;
    box-shadow: none;
    color: var(--sidebar-text);
}

.sidebar nav ul li button.btn:hover {
    background: var(--sidebar-hover-bg) !important;
    background-image: none !important;
    color: var(--sidebar-text);
    transform: none;
    box-shadow: none;
}

.sidebar nav ul li button.btn.active {
    background: var(--primary-color) !important;
    background-image: none !important;
    color: var(--sidebar-active-text);
    box-shadow: var(--shadow-sm);
}

/* ── Pulido institucional (identidad del landing) dentro de la app ── */
.sidebar nav ul li button.active,
.sidebar nav ul li button.btn.active {
    background: var(--primary-gradient) !important;
    box-shadow: 0 12px 26px rgba(100, 23, 242, 0.3);
}

.sidebar nav ul li button::before {
    background: #22d3ee;
    width: 3px;
    border-radius: 0 3px 3px 0;
}

.section-title {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--sidebar-text-muted);
    margin: 1.25rem 0 0.5rem;
    padding-left: 14px;
    font-weight: 700;
}

.main-content {
    flex: 1;
    padding: 1.5rem 2rem;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-speed) var(--ease-out);
    min-height: 100vh;
}

/* Support for collapsible sidebar */
.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.content-section {
    display: none;
    padding: 0;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity var(--transition-speed) var(--ease-out),
        transform var(--transition-speed) var(--ease-out);
}

.content-section.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.hidden {
    display: none !important;
}

/* Enhanced Notifications */
.notification {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    color: white;
    animation: slideInNotification 0.4s var(--ease-out);
    z-index: var(--z-tooltip);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-xl);
    backdrop-filter: var(--glass-blur);
    max-width: 380px;
    font-weight: 500;
}

.notification.success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: #ffffff;
}

.notification.error {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: #ffffff;
}

.notification.warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    color: #ffffff;
}

.notification.info {
    background: linear-gradient(135deg, var(--info-color) 0%, #2563eb 100%);
    color: #ffffff;
}

@keyframes slideInNotification {
    from {
        transform: translateX(100%) translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }
}

h1,
h2,
h3,
h4 {
    color: var(--primary-color);
    font-weight: 700;
    margin-top: 0;
}

h1 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

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

.form-group label,
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: var(--field-bg);
    color: var(--field-text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(28, 30, 82, 0.1);
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

.btn {
    border: none;
    color: var(--text-light);
    padding: 10px 20px;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    background: var(--primary-gradient);
    transition: all var(--transition-speed) var(--ease-out);
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.2);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:hover::after {
    opacity: 1;
}

.btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: var(--shadow-sm);
}

/* Button Variants */
.btn-primary {
    background: var(--primary-gradient);
}

.btn-accent {
    background: var(--accent-gradient);
    color: #ffffff;
    text-shadow: 0 1px 1px rgba(15, 23, 42, 0.22);
}

.btn-accent:hover {
    box-shadow: var(--shadow-accent);
}

.btn-accent svg,
.btn-primary svg,
.btn-delete svg,
.btn-danger svg,
.btn-edit svg,
.btn-success svg {
    stroke: currentColor;
}

.btn-delete,
.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: #ffffff;
}

.btn-delete:hover,
.btn-danger:hover {
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.btn-edit,
.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: #ffffff;
}

.btn-edit:hover,
.btn-success:hover {
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

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

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    box-shadow: none;
}

.btn-ghost:hover {
    background: var(--accent-light);
    color: var(--primary-color);
    box-shadow: none;
}

/* Button Sizes */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

/* =============================================
   Dashboard Styles
   ============================================= */
.dashboard-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
}

.dashboard-header h1 {
    margin-bottom: 0.35rem;
    font-size: 1.85rem;
}

.dashboard-header h1::after {
    display: none;
}

.dashboard-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all var(--transition-speed) var(--ease-out);
    border: 1px solid transparent;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-color);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.dashboard-section {
    margin-bottom: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(124, 58, 237, 0.08);
}

.dashboard-section h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Nav Icon styling */
.nav-icon {
    flex-shrink: 0;
    opacity: 0.85;
}

.sidebar nav ul li button:hover .nav-icon {
    opacity: 1;
}

.sidebar nav ul li button.active .nav-icon {
    opacity: 1;
}

.career-item {
    background: #feffff;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border: 1px solid var(--brand-dark);
}

.grade-item {
    background: #ffffff;
    padding: 1rem;
    margin: 0.5rem 0;
    border-left: 3px solid var(--accent-secondary);
    overflow: hidden;
}

.subject-item {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 2fr auto;
    /* Ajustar las columnas */
    align-items: center;
    padding: 0.5rem;
    margin: 0.25rem 0;
    background: #feffff;
    border: 1px solid var(--brand-dark);
    gap: 0.5rem;
    /* Añadir espacio entre los elementos */
    cursor: move;
    /* Cambiar el cursor para indicar que es draggable */
}

.subject-item div {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.subject-item label {
    font-size: 0.9rem;
    color: var(--brand-dark);
}

.subject-item input[type="time"],
.subject-item select {
    width: auto;
    /* Ajustar el ancho para que quepa en una línea */
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: #f5f5f5;
    color: var(--brand-dark);
}

.subject-item input[type="time"]:focus,
.subject-item select:focus {
    border-color: var(--accent-secondary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(243, 175, 29, 0.2);
}

.subject-item .btn-delete {
    margin-left: auto;
    /* Empujar el botón de eliminar al final */
}

.form-inline {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.form-inline input {
    flex: 1;
    font-size: 16px;
    padding: 12px 16px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.teacher-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background-color: #feffff;
    border-radius: 4px;
    border: 1px solid var(--brand-dark);
}

#teacherList {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

/* Asegurar que los formularios tengan el espacio adecuado */
form {
    margin-bottom: 20px;
}

form input {
    margin-right: 10px;
    padding: 12px 16px;
    border: 1px solid var(--brand-dark);
    border-radius: 4px;
    width: 200px;
    background-color: var(--field-bg);
    color: var(--field-text);
    font-size: 16px;
}

form input:focus {
    outline: 2px solid var(--accent-secondary);
    border-color: var(--brand-dark);
}

h1,
h2,
h3,
h4 {
    color: var(--brand-dark);
}

/* Estilos para el modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background-color: rgba(28, 30, 82, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: clamp(0.75rem, 2vw, 1.5rem);
    overflow: hidden;
    box-sizing: border-box;
    /* Asegurar que está por encima de todo */
}

.modal {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(28, 30, 82, 0.2);
    width: 90vw;
    max-width: 1200px;
    max-height: calc(100dvh - 2rem);
    overflow: auto;
    z-index: 1001;
    position: relative;
    box-sizing: border-box;
    min-width: 0;
}

#editBeneficiaryModal {
    z-index: 10000;
}

#editBeneficiaryModal .modal {
    width: min(980px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

#editBeneficiaryModal .modal h2 {
    text-align: left;
}

#createScheduleModal .modal,
#editScheduleModal .modal {
    width: 95vw;
    max-width: 1400px;
}

.modal h2 {
    color: var(--brand-dark);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    text-align: center;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.modal-buttons .btn {
    min-width: 120px;
    padding: 12px 24px;
}

.modal input {
    width: 100%;
    padding: 12px 16px;
    margin: 1rem 0;
    border: 2px solid var(--brand-dark);
    border-radius: 4px;
    font-size: 16px;
    background-color: var(--field-bg);
    color: var(--field-text);
    box-sizing: border-box;
}

.modal select {
    width: 100%;
    padding: 12px 16px;
    margin: 1rem 0;
    border: 2px solid var(--brand-dark);
    border-radius: 4px;
    font-size: 16px;
    background-color: var(--field-bg);
    color: var(--field-text);
    transition: background-color 0.3s ease, color 0.3s ease;
    cursor: pointer;
    font-size: 1.1rem;
    /* Aumentado de 16px */
    padding: 14px 18px;
    /* Aumentado de 12px 16px */
}

.modal select:hover {
    background-color: rgba(243, 175, 29, 0.1);
}

.modal select:focus {
    background-color: var(--accent-secondary);
    color: var(--brand-dark);
    outline: none;
}

.modal-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
    min-width: 0;
}

#createScheduleModal .modal-content,
#editScheduleModal .modal-content {
    grid-template-columns: 380px 1fr;
    gap: 2.5rem;
}

.modal-left,
.modal-right {
    flex: 1;
}

.modal-left {
    flex: 0 0 40%;
    /* Fijo al 40% del ancho */
}

.modal-right {
    flex: 0 0 60%;
    /* Fijo al 60% del ancho */
}

.subjects-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    background-color: #f9f9f9;
}

.subjects-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.subjects-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ddd;
}

.subjects-list li:last-child {
    border-bottom: none;
}

.subjects-list label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
}

.subjects-list input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    cursor: pointer;
}

.teacher-subjects-panel {
    min-width: 0;
}

.teacher-subjects-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.teacher-subjects-header h3 {
    margin: 0;
    font-size: 1rem;
}

.teacher-subjects-header .btn {
    flex: 0 0 auto;
    min-width: 0;
    padding: 10px 14px;
    white-space: nowrap;
}

.teacher-subjects-meta,
.teacher-subjects-modal-subtitle {
    margin: 0.35rem 0 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.teacher-subjects-summary {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.85rem;
    background: #ffffff;
}

.teacher-subject-career {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.teacher-subject-career + .teacher-subject-career {
    margin-top: 0.75rem;
}

.teacher-subject-career h4 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0;
    padding: 0.75rem 0.9rem;
    background: #f8fafc;
    color: var(--brand-dark);
    font-size: 0.95rem;
}

.teacher-subject-career h4 small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    background: var(--accent-light);
    color: var(--primary-dark);
    font-size: 0.8rem;
}

.teacher-subject-grade {
    padding: 0.75rem 0.9rem;
}

.teacher-subject-grade + .teacher-subject-grade {
    border-top: 1px solid #edf2f7;
}

.teacher-subject-grade h5,
.teacher-subject-select-grade h5 {
    margin: 0 0 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 700;
}

.teacher-subject-grade ul,
.teacher-subject-select-grade ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.teacher-subject-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border: 0;
    color: var(--text-primary);
    line-height: 1.35;
}

.subject-status-list {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.subject-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.subject-status.assigned {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.subject-status.competent {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
}

.teacher-subjects-empty {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

#teacherSubjectsModal {
    z-index: 1010;
}

#teacherSubjectsModal .modal {
    z-index: 1011;
}

.teacher-subjects-modal {
    width: min(980px, calc(100vw - 2rem));
    max-width: 980px;
}

.teacher-subjects-modal h2 {
    margin-bottom: 0.35rem;
}

.subject-assignment-list {
    max-height: min(56vh, 560px);
    margin-top: 1.25rem;
    background: #ffffff;
}

.teacher-subject-select-career {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

.teacher-subject-select-career + .teacher-subject-select-career {
    margin-top: 0.85rem;
}

.teacher-subject-select-career h4 {
    margin: 0;
    padding: 0.8rem 0.95rem;
    background: #f8fafc;
    color: var(--brand-dark);
    font-size: 0.95rem;
}

.teacher-subject-select-grade {
    padding: 0.85rem 0.95rem;
}

.teacher-subject-select-grade + .teacher-subject-select-grade {
    border-top: 1px solid #edf2f7;
}

.teacher-subject-select-grade li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.45rem 0;
    border: 0;
}

.teacher-subject-select-grade input[type="checkbox"] {
    margin-top: 0.15rem;
}

.teacher-subject-select-grade label {
    color: var(--text-primary);
    line-height: 1.35;
}

#modulesList,
#editModulesList {
    max-height: 50vh;
    /* Reducido de 60vh */
    overflow-y: auto;
    padding-right: 1rem;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 0.5rem;
}

.module-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin: 1.5rem 0;
    padding: 1.25rem;
    position: relative;
    background-color: #f8fafc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.module-item::before {
    content: attr(data-index);
    position: absolute;
    top: -12px;
    left: -12px;
    background-color: var(--brand-dark);
    color: #feffff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    /* Reducido de 1rem */
}

.module-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--brand-dark);
    font-weight: 700;
}

.module-dates {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.schedules-list {
    margin-top: 20px;
}

.schedule-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
}

/* Primera oleada: superficie académica de horarios. */
.schedule-page-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem;
    align-items: end;
    padding: 1.5rem 1.65rem;
    border: 1px solid rgba(12, 112, 109, 0.18);
    border-radius: 18px;
    background: linear-gradient(110deg, rgba(255, 254, 250, 0.98), rgba(234, 244, 241, 0.86));
    box-shadow: var(--shadow-xs);
}

.schedule-page-kicker {
    display: block;
    margin-bottom: .5rem;
    color: var(--primary-color);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.schedule-page-hero h2,
.schedule-empty-state h2 {
    margin: 0;
    color: var(--text-primary);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.8rem, 3vw, 2.55rem);
    letter-spacing: -.035em;
    line-height: 1.08;
}

.schedule-page-hero p {
    max-width: 62ch;
    margin: .7rem 0 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.schedule-page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .7rem;
}

.schedule-page-actions .btn {
    min-height: 44px;
    border-radius: 10px;
    padding-inline: 1rem;
}

.schedule-page-actions .btn-secondary {
    background: transparent;
    border: 1px solid rgba(12, 112, 109, 0.42);
    color: var(--primary-dark);
}

.schedule-empty-state {
    display: grid;
    justify-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: clamp(2rem, 6vw, 4.5rem) 1.5rem;
    border: 1px solid rgba(12, 112, 109, 0.16);
    border-radius: 18px;
    background: var(--bg-card);
    text-align: center;
}

.schedule-empty-state p {
    max-width: 56ch;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.65;
}

.schedule-load-error {
    border-color: rgba(181, 66, 61, 0.28);
}

.schedule-load-error h2 {
    color: #983a38;
}

.schedule-guidance {
    display: grid;
    width: min(100%, 880px);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin-top: 1.25rem;
    border-top: 1px solid rgba(12, 112, 109, 0.14);
}

.schedule-guidance > div {
    padding: 1.15rem 1.25rem;
    text-align: left;
}

.schedule-guidance > div + div {
    border-left: 1px solid rgba(12, 112, 109, 0.14);
}

.schedule-guidance strong,
.schedule-guidance span {
    display: block;
}

.schedule-guidance strong { color: var(--text-primary); font-size: .9rem; }
.schedule-guidance span { margin-top: .35rem; color: var(--text-secondary); font-size: .84rem; line-height: 1.45; }

.classroom-modal {
    max-width: 980px;
}

.classroom-manager {
    display: grid;
    gap: 0.85rem;
    margin: 1rem 0 0;
    padding: 1rem;
    border: 1px solid rgba(30, 41, 59, 0.12);
    border-radius: 8px;
    background: var(--bg-card);
}

.classroom-manager-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.classroom-manager-header h2 {
    margin: 0.15rem 0 0;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.classroom-manager-header > span {
    flex: 0 0 auto;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 800;
}

.classroom-form {
    display: grid;
    grid-template-columns: 120px minmax(140px, 1fr) 80px minmax(120px, 0.8fr) auto;
    gap: 0.55rem;
    align-items: end;
}

.classroom-form label {
    display: none;
}

.classroom-form input {
    min-height: 38px;
    margin: 0;
    border: 1px solid rgba(30, 41, 59, 0.16);
    border-radius: 7px;
    background: var(--bg-card);
    color: var(--text-primary);
}

.classroom-form-actions,
.classroom-row-actions {
    display: flex;
    gap: 0.45rem;
    align-items: center;
}

.classroom-list {
    display: grid;
    gap: 0.45rem;
}

.classroom-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.7rem;
    border: 1px solid rgba(30, 41, 59, 0.1);
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.025);
}

.classroom-row div:first-child {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.classroom-row strong,
.classroom-row span,
.classroom-row small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.classroom-row strong {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.classroom-row span,
.classroom-row small,
.classroom-row em {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.classroom-row em {
    font-style: normal;
    font-weight: 800;
    white-space: nowrap;
}

.classroom-empty {
    padding: 0.75rem;
    border: 1px dashed rgba(30, 41, 59, 0.16);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.schedule-item {
    border: 1px solid rgba(12, 112, 109, 0.18);
    border-radius: 16px;
    margin-bottom: 0.85rem;
    padding: 1.15rem 1.25rem;
    background: var(--bg-card);
    box-shadow: var(--shadow-xs);
}

.schedule-item.collapsed .modules-container {
    display: none;
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    cursor: pointer;
}

.schedule-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    /* Asegurar que el cursor cambie al pasar sobre el texto */
}

.schedule-header .collapse-indicator {
    font-size: 0.8rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
    margin-right: 10px;
}

.schedule-item.collapsed .collapse-indicator {
    transform: rotate(-90deg);
}

.modules-container {
    margin-top: 1.25rem;
    padding-top: 1.15rem;
    border-top: 1px solid rgba(12, 112, 109, 0.14);
}

.button-group {
    display: flex;
    gap: 0.5rem;
}

.schedule-title-block {
    min-width: 0;
}

.schedule-item-kicker,
.schedule-item-meta {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.schedule-item-kicker {
    margin-bottom: 0.35rem;
    color: var(--primary-color);
    font-weight: 750;
}

.schedule-item-meta {
    margin-top: 0.4rem;
}

.section-intro,
.modal-helper-text {
    max-width: 68ch;
    color: var(--text-secondary);
    line-height: 1.55;
}

#groups > .btn {
    margin: 0.4rem 0 1.25rem;
}

#crearGrupoModal .modal {
    width: min(560px, calc(100vw - 2rem));
}

#crearGrupoModal .form-group + .form-group {
    margin-top: 0.9rem;
}

.weekdays-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.weekday-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.weekday-item input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.weekday-item label {
    margin: 0;
    cursor: pointer;
}

#createScheduleModal .schedule-builder-modal {
    width: min(1180px, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem);
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.schedule-builder-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid rgba(30, 41, 59, 0.12);
    background: var(--bg-card);
}

.schedule-builder-header h2 {
    margin: 0.15rem 0 0.25rem;
    text-align: left;
    font-size: 1.35rem;
    color: var(--text-primary);
}

.schedule-builder-header p,
.schedule-builder-step p,
.schedule-builder-modules-header p,
.schedule-empty-state span {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.45;
}

.schedule-builder-kicker,
.module-eyebrow {
    display: inline-block;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.schedule-builder-summary {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 150px;
}

.schedule-builder-summary span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 0.65rem;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.07);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
}

#createScheduleModal .schedule-builder-layout {
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem 1rem 5rem;
    min-height: 0;
    overflow: auto;
    scroll-padding-bottom: 5rem;
}

.schedule-builder-panel {
    min-width: 0;
}

.schedule-builder-card,
.schedule-builder-modules {
    border: 1px solid rgba(30, 41, 59, 0.12);
    border-radius: 8px;
    background: var(--bg-card);
}

.schedule-builder-card {
    padding: 0.9rem;
    margin-bottom: 0.75rem;
}

.schedule-builder-step {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 0.65rem;
    align-items: start;
    margin-bottom: 0.75rem;
}

.schedule-builder-step span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--accent-light);
    color: var(--accent-color);
    font-weight: 800;
}

.schedule-builder-step h3,
.schedule-builder-modules-header h3 {
    margin: 0 0 0.15rem;
    color: var(--text-primary);
    font-size: 1rem;
}

.schedule-builder-fields {
    display: grid;
    gap: 0.5rem;
}

#createScheduleModal .schedule-builder-fields label {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 800;
}

#createScheduleModal .schedule-builder-fields select,
#createScheduleModal .schedule-builder-fields input[type="date"],
#createScheduleModal .schedule-builder-fields input[type="number"],
#createScheduleModal .module-date-range,
#createScheduleModal .subject-row-item select {
    margin: 0 !important;
    border: 1px solid rgba(30, 41, 59, 0.16) !important;
    border-radius: 7px !important;
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

.schedule-period-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
}

.schedule-period-grid label {
    margin-top: 0.15rem;
}

.schedule-ai-card {
    border-color: rgba(243, 175, 29, 0.35);
    background: linear-gradient(180deg, rgba(243, 175, 29, 0.08), rgba(255, 255, 255, 0));
}

.schedule-ai-button {
    width: 100%;
    justify-content: center;
}

.schedule-ai-hours-panel {
    display: grid;
    gap: 0.55rem;
    margin: 0.8rem 0;
}

.schedule-ai-hours-panel label {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 800;
}

.schedule-ai-hours-panel > select,
.schedule-ai-subject-hours-select {
    width: 100%;
    min-height: 36px;
    border: 1px solid rgba(30, 41, 59, 0.16);
    border-radius: 7px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.86rem;
}

.schedule-ai-subject-hours {
    display: grid;
    gap: 0.4rem;
    max-height: 220px;
    overflow: auto;
    padding-right: 0.15rem;
}

.schedule-ai-subject-hours-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 74px;
    gap: 0.5rem;
    align-items: center;
    padding: 0.45rem;
    border: 1px solid rgba(30, 41, 59, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
}

.schedule-ai-subject-hours-row span {
    min-width: 0;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-ai-hours-empty {
    padding: 0.55rem;
    border: 1px dashed rgba(30, 41, 59, 0.16);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.35;
}

.schedule-ai-feedback {
    min-height: 1.2rem;
    margin-top: 0.55rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.35;
}

.schedule-ai-proposals {
    display: grid;
    gap: 0.75rem;
    padding: 0.95rem 0.95rem 0;
}

.schedule-ai-proposals[hidden] {
    display: none;
}

.schedule-ai-proposals-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem;
    border: 1px solid rgba(30, 41, 59, 0.12);
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.03);
}

.schedule-ai-proposals-header h4 {
    margin: 0.1rem 0 0;
    color: var(--text-primary);
    font-size: 0.98rem;
}

.schedule-ai-proposals-header > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: var(--brand-dark);
    color: #ffffff;
    font-weight: 800;
}

.schedule-ai-proposal-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.schedule-ai-proposal-card {
    display: grid;
    grid-template-columns: minmax(180px, 0.72fr) minmax(300px, 1.25fr) minmax(112px, 0.32fr);
    gap: 0.8rem;
    align-items: stretch;
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid rgba(30, 41, 59, 0.14);
    border-radius: 8px;
    background: var(--bg-card);
}

.schedule-ai-proposal-card.valid {
    border-color: rgba(22, 163, 74, 0.35);
}

.schedule-ai-proposal-card.pending {
    border-color: rgba(217, 119, 6, 0.35);
}

.schedule-ai-proposal-summary,
.schedule-ai-timeline,
.schedule-ai-proposal-actions {
    min-width: 0;
}

.schedule-ai-proposal-summary {
    display: grid;
    align-content: start;
    gap: 0.55rem;
}

.schedule-ai-proposal-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.schedule-ai-proposal-heading span {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.schedule-ai-proposal-heading h5 {
    margin: 0.1rem 0 0;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.schedule-ai-proposal-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.4;
}

.schedule-ai-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.schedule-ai-metrics span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 0.5rem;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.07);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
}

.schedule-ai-timeline {
    display: grid;
    gap: 0.45rem;
    padding: 0.65rem;
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.035);
}

.schedule-ai-timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.1rem;
}

.schedule-ai-timeline-header span {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.schedule-ai-timeline-header strong {
    flex: 0 0 auto;
    color: var(--brand-dark);
    font-size: 0.95rem;
}

.schedule-ai-proposal-actions {
    display: grid;
    align-content: space-between;
    gap: 0.7rem;
}

.schedule-ai-proposal-actions .btn {
    width: 100%;
    justify-content: center;
    align-self: end;
    white-space: nowrap;
}

.schedule-ai-warnings {
    min-width: 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.schedule-ai-warnings summary {
    cursor: pointer;
    color: var(--brand-dark);
    font-weight: 800;
}

.schedule-ai-warnings ul {
    margin: 0.45rem 0 0;
    padding-left: 1rem;
}

.schedule-ai-warning-chip {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
}

.schedule-ai-subject-line {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    grid-template-areas:
        "time name hours"
        "time teacher teacher";
    column-gap: 0.65rem;
    row-gap: 0.15rem;
    align-items: center;
    padding: 0.5rem 0;
    border-top: 1px solid rgba(30, 41, 59, 0.08);
}

.schedule-ai-subject-line strong,
.schedule-ai-subject-line small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.schedule-ai-subject-line strong {
    grid-area: name;
    color: var(--text-primary);
    font-size: 0.84rem;
    line-height: 1.25;
}

.schedule-ai-subject-line small {
    grid-area: teacher;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.schedule-ai-subject-line small b {
    display: block;
    margin-top: 0.12rem;
    color: var(--text-primary);
    font-size: 0.76rem;
    font-weight: 700;
}

.schedule-ai-subject-line span {
    grid-area: time;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 0.45rem;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.1);
    white-space: nowrap;
    color: var(--brand-dark);
    font-size: 0.78rem;
    font-weight: 800;
}

.schedule-ai-subject-line em {
    grid-area: hours;
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 800;
}

.schedule-ai-empty {
    display: grid;
    gap: 0.35rem;
    padding: 0.9rem;
    border: 1px dashed rgba(217, 119, 6, 0.35);
    border-radius: 8px;
    background: rgba(217, 119, 6, 0.06);
}

.schedule-ai-empty strong {
    color: var(--text-primary);
}

.schedule-ai-empty span {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

#createScheduleModal .schedule-weekdays {
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    gap: 0.5rem;
    margin: 0;
}

#createScheduleModal .weekday-item {
    position: relative;
}

#createScheduleModal .weekday-item input[type="checkbox"] {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

#createScheduleModal .weekday-item label {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.55rem;
    border: 1px solid rgba(30, 41, 59, 0.14);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 700;
    transition: background-color var(--transition-speed) var(--ease-out),
        color var(--transition-speed) var(--ease-out),
        border-color var(--transition-speed) var(--ease-out);
}

#createScheduleModal .weekday-item input[type="checkbox"]:checked + label {
    border-color: var(--accent-color);
    background: var(--accent-color);
    color: #ffffff;
}

.schedule-exception-list {
    display: grid;
    gap: 0.5rem;
    max-height: 140px;
    overflow: auto;
    margin-bottom: 0.65rem;
}

.schedule-calendar-button {
    width: 100%;
    justify-content: center;
}

.schedule-builder-modules {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 0;
}

.schedule-builder-modules-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem;
    border-bottom: 1px solid rgba(30, 41, 59, 0.1);
}

#createScheduleModal #modulesList {
    max-height: none;
    overflow: visible;
    border: 0;
    border-radius: 0;
    padding: 0.95rem;
}

.schedule-empty-state {
    display: grid;
    gap: 0.5rem;
    place-items: center;
    min-height: 220px;
    padding: 1.25rem;
    text-align: center;
    border: 1px dashed rgba(30, 41, 59, 0.2);
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.03);
}

.schedule-empty-state[hidden] {
    display: none;
}

.schedule-empty-state strong {
    color: var(--text-primary);
}

#createScheduleModal .module-item {
    margin: 0 0 0.9rem;
    border-color: rgba(30, 41, 59, 0.12);
    border-radius: 8px;
    background: var(--bg-card);
    box-shadow: none;
}

#createScheduleModal .module-item::before {
    display: none;
}

#createScheduleModal .module-header {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(30, 41, 59, 0.1);
}

#createScheduleModal .module-dates {
    display: grid;
    gap: 0.45rem;
    margin: 0.85rem 0;
}

#createScheduleModal .module-subjects h4 {
    margin: 0 0 0.65rem;
    font-size: 0.95rem;
    color: var(--text-primary);
}

#createScheduleModal .module-subjects li.subject-row-item {
    grid-template-columns: minmax(160px, 1.35fr) minmax(82px, 0.62fr) minmax(82px, 0.62fr) minmax(160px, 1.15fr) minmax(150px, 1fr) auto;
    border: 1px solid rgba(30, 41, 59, 0.1);
    border-radius: 8px;
    margin-bottom: 0.55rem;
}

#createScheduleModal .btn-add-subject {
    margin-top: 0.4rem;
}

#createScheduleModal .schedule-builder-actions {
    margin: 0;
    padding: 0.9rem 1rem;
    border-top: 1px solid rgba(30, 41, 59, 0.12);
    background: var(--bg-card);
}

.module-date-range {
    width: 100% !important;
    padding: 10px 16px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    font-weight: 600 !important;
    margin: 10px 0 !important;
}

.dark-mode .module-date-range {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

.dark-mode .module-date-range::placeholder {
    color: #64748b !important;
}

.sortable-placeholder {
    height: 80px;
    background: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Estilos específicos para la gestión de carreras */
.career-item {
    background: #feffff;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border: 1px solid var(--brand-dark);
}

.grade-item {
    background: #ffffff;
    padding: 1rem;
    margin: 0.5rem 0;
    border-left: 3px solid var(--accent-secondary);
    overflow: hidden;
}

.subject-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    margin: 0.25rem 0;
    background: #feffff;
    border: 1px solid var(--brand-dark);
}

/* Estilos para la sección de asignaciones */
.section-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.assignments-list {
    margin-top: 1rem;
}

.assignments-toolbar {
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.assignments-toolbar input {
    min-width: min(280px, 100%);
}

.assignments-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 0.75rem;
    margin: 0 0 1rem;
}

.assignment-summary-card {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
    padding: 0.85rem 0.95rem;
    border: 1px solid rgba(30, 41, 59, 0.12);
    border-radius: 8px;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.assignment-summary-card span {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.assignment-summary-card strong {
    min-width: 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    overflow-wrap: anywhere;
}

.assignment-summary-range {
    grid-column: span 1;
}

.assignments-filters {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 1rem;
    padding: 0.85rem;
    border: 1px solid rgba(30, 41, 59, 0.12);
    border-radius: 8px;
    background: var(--bg-card);
}

.assignments-filters label {
    display: grid;
    gap: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
}

.assignments-filters input[type="search"],
.assignments-filters select {
    width: 100%;
    min-height: 38px;
    margin: 0;
    border: 1px solid rgba(30, 41, 59, 0.14);
    border-radius: 7px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.assignment-checkbox-filter {
    grid-template-columns: auto 1fr;
    align-items: center;
    min-height: 38px;
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(30, 41, 59, 0.12);
    border-radius: 7px;
    background: rgba(30, 41, 59, 0.03);
}

.assignment-checkbox-filter input {
    margin: 0;
}

.assignments-state {
    display: grid;
    place-items: center;
    min-height: 180px;
    padding: 1.25rem;
    border: 1px dashed rgba(30, 41, 59, 0.2);
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.03);
    color: var(--text-secondary);
    text-align: center;
}

.assignments-state-error {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
    color: var(--error-color);
}

.assignment-card-list {
    display: grid;
    gap: 1rem;
}

.assignment-teacher-card {
    display: grid;
    gap: 0.85rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid rgba(30, 41, 59, 0.12);
    border-radius: 8px;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.assignment-teacher-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.assignment-kicker {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.assignment-teacher-header h2 {
    margin: 0.15rem 0 0;
    color: var(--text-primary);
    font-size: 1.05rem;
    overflow-wrap: anywhere;
}

.assignment-teacher-metrics {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.assignment-teacher-metrics strong {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 0.65rem;
    border-radius: 999px;
    background: var(--accent-light);
    color: var(--accent-color);
}

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

.assignment-career-list {
    display: grid;
    gap: 0.75rem;
}

.assignment-career-block {
    min-width: 0;
    border: 1px solid rgba(30, 41, 59, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.assignment-career-block summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0.85rem;
    cursor: pointer;
    background: rgba(30, 41, 59, 0.04);
    color: var(--text-primary);
    font-weight: 800;
}

.assignment-career-block summary span {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
}

.assignment-subject-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.assignment-subject-table {
    min-width: 760px;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
}

.assignment-subject-table td strong,
.assignment-subject-table td small {
    display: block;
}

.assignment-subject-table td small {
    margin-top: 0.2rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.assignment-date-list {
    display: block;
    max-width: 360px;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.45;
}

.assignment-item {
    background: #feffff;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--brand-dark);
    display: flex;
    justify-content: space-between;
    gap: 2rem;
}

.assignment-info {
    flex: 1;
}

.assignment-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(28, 30, 82, 0.1);
}

.assignment-header h3 {
    margin: 0 0 0.5rem 0;
    color: var(--brand-dark);
}

.assignment-date {
    color: #666;
    font-size: 0.9rem;
}

.assignment-details {
    padding-top: 0.5rem;
}

.module-summary {
    background: rgba(243, 175, 29, 0.05);
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 4px;
}

.module-summary h4 {
    margin: 0 0 0.5rem 0;
    color: var(--brand-dark);
}

.module-time {
    color: #666;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.assignments-list-detail {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}

assignments-list-detail li {
    padding: 0.25rem 0;
    color: #333;
    font-size: 0.95rem;
    border-left: 3px solid var(--accent-secondary);
    padding-left: 0.5rem;
    margin: 0.25rem 0;
}

.assignment-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: flex-start;
}

.assignment-actions .btn {
    min-width: 120px;
}

.assignment-grid {
    display: grid;
    gap: 1rem;
    margin: 1rem 0;
    border: 1px solid #ddd;
}

.grid-header {
    background: var(--brand-dark);
    color: #ffffff;
    padding: 0.75rem;
    text-align: center;
    font-weight: bold;
}

.grid-cell {
    padding: 0.5rem;
    border: 1px solid #ddd;
    text-align: center;
}

/* Estilos para los selectores dentro del grid */
.grid-cell select {
    width: 100%;
    padding: 0.5rem;
    margin: 0.25rem 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.time-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: #f5f5f5;
    color: var(--brand-dark);
    margin-bottom: 0.25rem;
}

.time-select:focus {
    border-color: var(--accent-secondary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(243, 175, 29, 0.2);
}

.time-select option {
    padding: 4px;
    font-size: 0.9rem;
}

.assignment-row {
    border-bottom: 1px solid #eee;
    padding: 0.5rem 0;
}

.assignment-row .grid-cell {
    padding: 0.5rem;
}

.subject-name {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.25rem;
}

.time-select {
    margin-bottom: 0.25rem;
}

/* Ajustar estilos para el input de texto de horas */
.grid-cell input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    color: var(--brand-dark);
    background-color: #ffffff;
}

.grid-cell input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 2px rgba(243, 175, 29, 0.2);
}

.grid-cell input[type="text"]::placeholder {
    color: #666;
    font-size: 0.9rem;
}

/* Modern Table Styles */
.assignments-table,
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.5rem 0;
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.assignments-table th,
.assignments-table th,
.schedule-plus-table th,
.subjects-table th,
#communityTable th,
#scholarPaymentsTable th {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
    text-align: left;
    padding: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.assignments-table td,
table td {
    padding: 1rem;
    border-bottom: 1px solid #eef2f6;
    color: var(--text-primary);
    font-size: 0.95rem;
    vertical-align: middle;
}

.assignments-table tr:last-child td,
table tr:last-child td {
    border-bottom: none;
}

.assignments-table tr:hover td {
    background-color: #f8fafc;
}

/* Specific adjustments for action columns */
.assignments-table td button {
    margin-right: 0.5rem;
    padding: 6px 12px;
    font-size: 0.8rem;
}

.assignments-table thead tr th {
    color: #fff !important;
}

.assignments-table tbody tr:hover {
    background-color: rgba(243, 175, 29, 0.05);
    /* Slight accent on hover */
}

.modal-large {
    width: 90vw;
    max-width: 1400px;
}

.modal-large select {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 2px solid var(--brand-dark);
    border-radius: 4px;
    font-size: 16px;
    background-color: var(--field-bg);
    color: var(--field-text);
    font-size: 1.1rem;
    /* Aumentado de 16px */
    padding: 14px 18px;
    /* Aumentado de 12px */
}

.modal-large select:hover {
    border-color: var(--accent-secondary);
}

.modal-large select:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 2px rgba(243, 175, 29, 0.2);
}

.modal table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.modal table th,
.modal table td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    text-align: center;
}

.modal table th {
    background-color: var(--brand-dark);
    color: #ffffff;
}

.modal table {
    max-width: 100%;
}

.modal .assignments-table,
.modal .ops-table {
    min-width: min(680px, 100%);
}

.modal img,
.modal canvas,
.modal iframe,
.modal video {
    max-width: 100%;
}

.modal pre,
.modal code {
    white-space: pre-wrap;
    word-break: break-word;
}

.module-container {
    margin-bottom: 2rem;
    padding: 1rem;
    border: 1px solid var(--brand-dark);
    border-radius: 4px;
}

.module-container h3 {
    margin-bottom: 1rem;
    color: var(--brand-dark);
}

.career-item,
.grade-item {
    transition: max-height 0.3s ease-in-out;
    overflow: hidden;
}

.career-item.collapsed .career-content,
.grade-item.collapsed .grade-content {
    display: none;
}

.career-header,
.grade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.collapse-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--brand-dark);
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.collapsed .collapse-btn {
    transform: rotate(-90deg);
}

/* Actualizar estilos de colapso para carreras y grados */
.career-item .career-content,
.grade-item .grade-content {
    transition: all 0.3s ease-in-out;
    overflow: hidden;
    max-height: 1000px;
    /* Altura máxima cuando está expandido */
}

.career-item.collapsed .career-content,
.grade-item.collapsed .grade-content {
    max-height: 0;
    padding: 0;
    margin: 0;
    opacity: 0;
}

.career-header,
.grade-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.career-header:hover,
.grade-header:hover {
    background-color: rgba(243, 175, 29, 0.1);
}

/* Estilos para las secciones del sidebar */
.nav-section {
    margin-bottom: 1.5rem;
}

.section-title {
    display: block;
    color: var(--sidebar-text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0rem 1rem;
    margin: 1.25rem 0 0.5rem;
    border-bottom: none;
}

.nav-section ul {
    padding-left: 1rem;
}

.nav-section .btn {
    padding: 10px 20px;
    font-size: 0.95rem;
}

/* Estilos para la sección de gestión de formatos */
.formats-list {
    margin-top: 2rem;
}

.formats-list .format-item {
    background: #feffff;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border: 1px solid var(--brand-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.formats-list .format-item .format-info {
    flex: 1;
}

.formats-list .format-item .format-actions {
    display: flex;
    gap: 0.5rem;
}

.formats-list .format-item .format-actions .btn {
    min-width: 100px;
}

/* Estilos para la sección de cálculo de horas */
.calculation-result {
    margin-top: 2rem;
}

.calculation-result .result-item {
    background: #feffff;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border: 1px solid var(--brand-dark);
}

.calculation-result .result-item h3 {
    margin: 0 0 0.5rem 0;
    color: var(--brand-dark);
}

.calculation-result .result-item p {
    margin: 0;
    color: #666;
}

/* Estilos para la lista de materias en los módulos */
.module-subjects {
    margin-top: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
}

.module-subjects h4 {
    margin: 0 0 1rem 0;
    color: var(--brand-dark);
}

.module-subjects ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.module-subjects li.subject-row-item {
    display: grid;
    grid-template-columns: 1.5fr 90px 90px 1.3fr 1fr auto;
    gap: 1rem;
    align-items: end;
    padding: 1rem;
    border-bottom: 1px solid #eef2f6;
    background: #ffffff;
    transition: background-color 0.2s;
}

.module-subjects li.subject-row-item:hover {
    background-color: #f8fafc;
}

.subject-row-item div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.subject-row-item label {
    font-size: 0.7rem !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b !important;
    font-weight: 700 !important;
    margin: 0 !important;
}

.subject-display-name {
    font-weight: 600;
    color: var(--brand-dark);
    font-size: 0.95rem;
    line-height: 1.4;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.subject-row-item select {
    padding: 8px 12px !important;
    font-size: 0.9rem !important;
    height: 40px !important;
    margin: 0 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
}

.subject-row-item select:focus {
    border-color: var(--accent-secondary) !important;
    box-shadow: 0 0 0 2px rgba(243, 175, 29, 0.1) !important;
}

.subject-col-actions {
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding-bottom: 2px;
}

.btn-sm {
    padding: 8px 16px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
}

.module-subjects .btn-delete {
    background-color: #e53e3e;
    color: #ffffff;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.module-subjects .btn-delete:hover {
    background-color: #c53030;
}

.btn-print {
    background-color: #3498db;
    /* Azul más oscuro como base */
    color: #feffff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-print:hover {
    background-color: #5dade2;
    /* Azul más claro en hover */
    color: #feffff;
}

/* Estilos para la lista de carreras */
.career-list {
    margin-top: 2rem;
    position: relative;
}

.scrollable {
    height: calc(100vh - 250px);
    /* Altura ajustada para dejar espacio al header y form */
    overflow-y: auto;
    padding-right: 1rem;
    margin-right: -1rem;
    /* Compensar el padding-right */
}

.scrollable::-webkit-scrollbar {
    width: 8px;
    position: absolute;
    right: 0;
}

.scrollable::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.scrollable::-webkit-scrollbar-thumb {
    background: var(--brand-dark);
    border-radius: 4px;
}

.scrollable::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* Asegurar que los elementos dentro del scroll sean visibles */
.career-item {
    background: #feffff;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border: 1px solid var(--brand-dark);
    position: relative;
    /* Asegurar que los elementos estén en el flujo correcto */
}

/* Actualizar estilos para el scroll dentro de las carreras */
.grades-list {
    max-height: 400px;
    /* Altura máxima para la lista de grados */
    overflow-y: auto;
    padding-right: 0.5rem;
    margin: 1rem 0;
}

.grades-list::-webkit-scrollbar {
    width: 6px;
}

.grades-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.grades-list::-webkit-scrollbar-thumb {
    background: var(--brand-dark);
    border-radius: 4px;
}

.grades-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* Ajustar el estilo de las carreras para el nuevo scroll */
.career-item .career-content {
    padding: 1rem;
    background: rgba(243, 175, 29, 0.05);
    border-radius: 4px;
    margin-top: 1rem;
}

.grade-item {
    margin: 0.5rem 0;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#importDate {
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    margin-right: 1rem;
    min-width: 260px;
    /* Ensure enough width for DD/MM/YYYY - DD/MM/YYYY */
}

.assignment-item {
    background: #feffff;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--brand-dark);
}

.assignment-item h3 {
    margin: 0 0 1rem 0;
    color: var(--brand-dark);
}

.assignment-item .module {
    margin-bottom: 1rem;
}

.assignment-item .module h4 {
    margin: 0 0 0.5rem 0;
    color: #666;
}

.assignment-item .module ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.assignment-item .module ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #ddd;
}

.assignment-item .module ul li:last-child {
    border-bottom: none;
}

.assignment-item .module ul li strong {
    display: block;
    color: var(--brand-dark);
}

.assignment-item .module ul li p {
    margin: 0.25rem 0;
    color: #666;
    font-size: 0.9rem;
}

.assignments-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.assignments-table th,
.assignments-table td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    text-align: left;
}

assignments-table th {
    background-color: var(--brand-dark);
    color: #ffffff;
}

.non-working-days-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.non-working-day-chip {
    display: flex;
    align-items: center;
    background: #e2e8f0;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.9rem;
    color: #1e293b;
    border: 1px solid #cbd5e1;
}

.non-working-day-chip span {
    margin-right: 0.5rem;
}

.btn-remove-chip {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
}

.btn-remove-chip:hover {
    color: #ef4444;
}

/* Custom Highlight for Multi-Date Selection */
.ui-state-highlight-custom .ui-state-default {
    background: #dc3545 !important;
    color: #ffffff !important;
    border-color: #dc3545 !important;
}

#multiDatePicker .ui-datepicker {
    width: 100% !important;
    /* Force full width of container */
    padding: 0;
    display: flex;
    /* Use flexbox for better control than floats */
    justify-content: center;
    border: none !important;
    /* Remove outer border if any conflicts */
}

/* Ensure groups (months) split space evenly */
#multiDatePicker .ui-datepicker-group {
    float: none !important;
    /* Disable default float */
    width: 50% !important;
    padding: 0 10px;
    /* Add breathing room */
    box-sizing: border-box;
}

#multiDatePicker .ui-datepicker-group-first {
    border-right: 1px solid #ddd;
    /* Separator between months */
}

/* Fix header alignment */
#multiDatePicker .ui-datepicker-header {
    background: #f1f5f9;
    border: none;
    font-weight: bold;
    color: var(--brand-dark);
}

/* Fix calendar table width */
#multiDatePicker .ui-datepicker-calendar {
    width: 100%;
    margin: 0;
}

/* Contraste: fechas del calendario siempre legibles */
#multiDatePicker .ui-datepicker table {
    background: #ffffff;
}

#multiDatePicker .ui-datepicker td {
    background: #ffffff !important;
    border-color: #e2e8f0;
}

#multiDatePicker .ui-datepicker td a,
#multiDatePicker .ui-datepicker .ui-state-default {
    color: #1e293b !important;
    background: #f8fafc !important;
    font-weight: 600;
}

#multiDatePicker .ui-datepicker td a:hover,
#multiDatePicker .ui-datepicker .ui-state-default:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

#multiDatePicker .ui-datepicker .ui-state-active,
#multiDatePicker .ui-datepicker td.ui-datepicker-current-day a {
    background: var(--primary-color) !important;
    color: #ffffff !important;
}

/* Flechas de navegación del calendario más visibles */
#multiDatePicker .ui-datepicker-prev,
#multiDatePicker .ui-datepicker-next {
    cursor: pointer;
}

#multiDatePicker .ui-datepicker-prev span,
#multiDatePicker .ui-datepicker-next span {
    border-color: #475569;
    border-width: 2px;
}

#multiDatePicker .ui-datepicker-prev:hover span,
#multiDatePicker .ui-datepicker-next:hover span {
    border-color: #1e293b;
}

/* New class for the calendar modal */
.modal-calendar {
    width: 800px;
    /* Increased to ensure comfortable fit */
    max-width: 95vw;
    padding: 2rem;
}

.modal-calendar h2 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.modal-calendar p {
    text-align: center;
    color: #64748b;
    margin-bottom: 1.5rem;
}

.dark-mode .modal-calendar p {
    color: #cbd5e1;
}

/* Improved spacing for buttons in calendar modal */
.modal-buttons-centered {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* Ensure inline datepicker fits */
.ui-datepicker-inline {
    margin: 0 auto;
    /* Center the calendar */
}

.btn-export {
    background-color: #3498db;
    /* Azul más oscuro como base */
    color: #feffff;
}

.btn-export:hover {
    background-color: #5dade2;
    /* Azul más claro en hover */
    color: #feffff;
}

.btn-pdf {
    background-color: #27ae60;
    /* Verde más oscuro como base */
    color: #feffff;
}

.btn-pdf:hover {
    background-color: #2ecc71;
    /* Verde más claro en hover */
    color: #feffff;
}

#viewAssignmentsData {
    margin-top: 2rem;
}

#viewAssignmentsData table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

#viewAssignmentsData th,
#viewAssignmentsData td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    text-align: left;
}

#viewAssignmentsData th {
    background-color: var(--brand-dark);
    color: #ffffff;
}

#viewAssignmentsData .btn-delete {
    background-color: #c0392b;
    /* Rojo más oscuro como base */
    color: #feffff;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 4px;
}

#viewAssignmentsData .btn-delete:hover {
    background-color: #e74c3c;
    /* Rojo más claro en hover */
}

.btn-calculate {
    background-color: #3498db;
    /* Azul más oscuro como base */
    color: #feffff;
}

.btn-calculate:hover {
    background-color: #5dade2;
    /* Azul más claro en hover */
    color: #feffff;
}

.modal-small {
    width: 30vw;
    max-width: 400px;
}

.modal-buttons .btn-cancel {
    background-color: #c0392b;
    /* Rojo */
    color: #feffff;
}

.modal-buttons .btn-cancel:hover {
    background-color: #e74c3c;
    /* Rojo más claro en hover */
}

.modal-buttons .btn-paid {
    background-color: #27ae60;
    /* Verde */
    color: #feffff;
}

.modal-buttons .btn-paid:hover {
    background-color: #2ecc71;
    /* Verde más claro en hover */
}

.modal-buttons .btn-save {
    background-color: #27ae60;
    /* Verde */
    color: #feffff;
}

.modal-buttons .btn-save:hover {
    background-color: #2ecc71;
    /* Verde más claro en hover */
}

#notesContent {
    width: 100%;
    height: 150px;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
    resize: none;
}

.btn-view {
    background-color: #5dade2;
    /* Azul claro */
    color: #feffff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

.btn-view:hover {
    background-color: #3498db;
    color: #feffff;
}

.toggled td {
    text-decoration: line-through;
    color: red;
}

#scholarPaymentsTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

#scholarPaymentsTable th,
#scholarPaymentsTable td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    text-align: left;
}

#scholarPaymentsTable th {
    background-color: var(--brand-dark);
    color: #ffffff;
}


#initialBalance,
#totalAmount,
#finalBalance,
.payment-amount,
#scholarPaymentsTable select,
#paymentTable select,
input[placeholder="Concepto de pago"] {
    height: 45px;
    /* Aumentada la altura */
    width: 100%;
    /* Ocupar todo el ancho disponible */
    box-sizing: border-box;
    /* Asegurar que el padding no afecte el ancho total */
}



.beneficiary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background-color: #feffff;
    border-radius: 4px;
    border: 1px solid var(--brand-dark);
    color: var(--text-primary) !important;
}

.beneficiary-item > *:first-child {
    color: var(--text-primary) !important;
    font-weight: 500;
}

#beneficiaryList .beneficiary-item {
    color: var(--text-primary) !important;
}

#beneficiaryList {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}



select {
    height: auto;
    /* Permitir que la altura aumente automáticamente */
    max-height: 50vh;
    /* Altura máxima del 50% de la altura de la ventana */
    overflow-y: auto;
    /* Permitir desplazamiento si el contenido es demasiado largo */
}



.schedule-plus-container {
    margin-top: 2rem;
}

.schedule-plus-header {
    margin-bottom: 1rem;
}

.schedule-plus-header h2 {
    color: var(--brand-dark);
}

.schedule-plus-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.schedule-plus-form .form-group {
    display: flex;
    flex-direction: column;
}

.schedule-plus-form .form-group label {
    margin-bottom: 0.5rem;
    color: var(--brand-dark);
}

.schedule-plus-form .form-group select,
.schedule-plus-form .form-group input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.schedule-plus-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.schedule-plus-table th,
.schedule-plus-table td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    text-align: left;
}

.schedule-plus-table th {
    background-color: var(--brand-dark);
    color: #ffffff;
}

.schedule-plus-table td select,
.schedule-plus-table td input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.schedule-plus-table td .datepicker {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: #f5f5f5;
    color: var(--brand-dark);
}

.modal-large {
    width: 90vw;
    max-width: 1400px;
}

.modal-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.modal-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-section .form-group {
    width: 100%;
    /* Asegurar que los campos ocupen todo el ancho */
}

.modal-section.full-width {
    grid-column: span 2;
    /* Hacer que ocupe todo el ancho del modal */
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.modal-buttons .btn {
    min-width: 120px;
    padding: 12px 24px;
}


.student-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background-color: #feffff;
    border-radius: 4px;
    border: 1px solid var(--brand-dark);
}

.student-item span {
    flex: 1;
    text-align: center;
}

.student-item button {
    margin-left: 10px;
}


.vertical-align {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}



.centered {
    justify-content: center;
    align-items: center;
}


/* Actualizar estilos para la tabla de comunidad */
#communityTable {
    width: 100%;
    margin-top: 2rem;
}

#communityTable td {
    vertical-align: middle;
    /* Centrar verticalmente el contenido */
}

#communityTable td button {
    margin: 0 5px;
    /* Espaciado entre botones */
}

/* Estilos para la lista de estudiantes */
.student-list {
    margin: 2rem 0;
}

.student-item {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--brand-dark);
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.student-item span {
    flex: 1;
    padding: 0 1rem;
}



.schedule-actions {
    margin: 2rem 0;
    display: flex;
    justify-content: flex-end;
}

.module-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: rgba(243, 175, 29, 0.05);
    border-radius: 4px;
}

.schedule-info {
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: #f5f5f5;
    border-radius: 4px;
}





/* Estilos para SchedulePlus */
.schedule-plus-container {
    padding: 2rem;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.schedule-plus-header {
    margin-bottom: 2rem;
}

.schedule-actions {
    margin: 2rem 0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.schedule-plus-preview {
    margin-top: 2rem;
    border-top: 2px solid var(--accent-secondary);
    padding-top: 2rem;
}

/* Ajustes para la tabla de SchedulePlus */
.schedule-plus-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.schedule-plus-table th {
    background-color: var(--brand-dark);
    color: #ffffff;
    padding: 1rem;
    text-align: left;
}

.schedule-plus-table td {
    padding: 1rem;
    border: 1px solid #ddd;
    vertical-align: top;
}

/* Ajustes para los módulos en la vista previa */
.module-item {
    background-color: #ffffff;
    border: 1px solid var(--brand-dark);
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.module-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: rgba(243, 175, 29, 0.05);
    border-radius: 4px;
}

.module-header h4 {
    margin: 0;
    color: var(--brand-dark);
    font-size: 1.1rem;
}

.schedule-info {
    background-color: #f5f5f5;
    padding: 0.5rem;
    border-radius: 4px;
}


.btn-print {
    background-color: #ADD8E6;
    /* Azul claro */
    color: #000;
    /* Color del texto */
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-print:hover {
    background-color: #87CEEB;
    /* Otro azul claro para el hover */
}

.btn-cancel {
    background-color: #c0392b;
    /* Rojo */
    color: #feffff;
    padding: 14px 28px;
    cursor: pointer;
    border-radius: 5px;
    transition: transform 0.3s ease-in-out, background-color 0.3s ease-in-out;
    font-size: 14px;
}

.btn-cancel:hover {
    background-color: #e74c3c;
    /* Rojo más claro en hover */
}

.btn-cancel:active {
    transform: scale(0.90);
}



.uppercase {
    text-transform: uppercase;
}



.collapse-indicator {
    font-size: 1.2rem;
    color: var(--brand-dark);
    transition: transform 0.3s ease;
    margin-left: 0.5rem;
}



#searchSchoolCommunity {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}



.groups-list {
    margin-top: 2rem;
}

.group-empty {
    display: grid;
    gap: 0.3rem;
    max-width: 48rem;
    padding: 1.1rem 1.2rem;
    border-left: 3px solid var(--u5-coral);
    background: color-mix(in srgb, var(--u5-coral), transparent 93%);
    color: var(--u5-ink);
}

.group-empty span {
    color: var(--text-secondary);
    line-height: 1.5;
}

.group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #feffff;
    border: 1px solid var(--brand-dark);
    border-radius: 4px;
}

.group-info h3 {
    margin: 0;
    color: var(--brand-dark);
}

.group-info p {
    margin: 0.5rem 0 0 0;
    color: #666;
    font-size: 0.9rem;
}

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



.subjects-table {
    width: 100%;
    margin-top: 1rem;
    border-collapse: collapse;
}

.subjects-table th,
.subjects-table td {
    padding: 0.75rem;
    border: 1px solid #ddd;
    text-align: left;
}

.subjects-table th {
    background-color: var(--brand-dark);
    color: #ffffff;
}

.subjects-table tbody tr:hover {
    background-color: rgba(243, 175, 29, 0.1);
}



.group-subjects {
    margin-top: 1rem;
    padding: 1rem;
    background-color: rgba(243, 175, 29, 0.05);
    border-radius: 4px;
}

.group-subjects h4 {
    margin: 0 0 0.5rem 0;
    color: var(--brand-dark);
    font-size: 0.9rem;
}

.group-subjects ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.group-subjects li {
    padding: 0.5rem;
    border-bottom: 1px solid #ddd;
    font-size: 0.9rem;
}

.group-subjects li:last-child {
    border-bottom: none;
}



.students-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    background-color: #f9f9f9;
}

.student-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background-color: #feffff;
    border-radius: 4px;
    border: 1px solid var(--brand-dark);
}

.student-item span {
    flex: 1;
    text-align: center;
}

.student-item button {
    margin-left: 10px;
}


.group-students {
    margin-top: 1rem;
}

.group-students h4 {
    margin-bottom: 0.5rem;
}

.group-students ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.group-students li {
    padding: 0.25rem 0;
    border-bottom: 1px solid #ddd;
}

.group-students li:last-child {
    border-bottom: none;
}



/* Ensure inputs are wide enough for dates */
.module-date-range {
    min-width: 260px;
}

/* Login Overlay Styles */
.login-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    min-height: 100%;
    background: #161d33;
    display: flex;
    justify-content: center;
    align-items: stretch;
    z-index: 10000;
    padding: clamp(1rem, 3vw, 2.25rem);
    overflow-y: auto;
}

.landing-page {
    width: min(1240px, 100%);
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: clamp(4rem, 9vw, 8rem);
}

.landing-shell {
    width: 100%;
    min-height: calc(100vh - clamp(2rem, 6vw, 4rem));
    display: grid;
    grid-template-columns: minmax(380px, 0.82fr) minmax(560px, 1.18fr);
    gap: clamp(1rem, 2.6vw, 2.5rem);
    align-items: center;
    margin: 0;
}

.landing-content {
    color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: clamp(3rem, 7vw, 6.5rem);
    min-width: 0;
    position: relative;
    z-index: 2;
}

.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.landing-brand,
.landing-login-link,
.login-card-footer a {
    display: inline-flex;
    align-items: center;
}

.landing-nav-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
}

.landing-brand {
    gap: 0.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-size: 1.08rem;
}

.landing-brand div {
    display: grid;
    gap: 0.1rem;
}

.landing-brand strong {
    color: #ffffff;
    font-size: 1.25rem;
    line-height: 1;
}

.landing-brand small {
    color: #22d3ee;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.landing-brand-logo {
    width: 54px;
    height: 54px;
    object-fit: cover;
    object-position: left center;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    padding: 0.5rem;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
}

.landing-login-link {
    min-height: 40px;
    padding: 0 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: #d7def1;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    background: transparent;
    white-space: nowrap;
}

.landing-demo-button {
    min-height: 40px;
    padding: 0 1.1rem;
    min-width: 126px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: #6417f2;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 32px rgba(100, 23, 242, 0.26);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    white-space: nowrap;
}

.landing-demo-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 38px rgba(100, 23, 242, 0.34);
}

.landing-hero {
    display: grid;
    gap: clamp(1.5rem, 4vw, 2.5rem);
}

.landing-copy {
    max-width: 540px;
}

.landing-kicker {
    display: inline-flex;
    align-items: center;
    margin-bottom: 1rem;
    color: #20aefc;
    font-size: clamp(1.08rem, 1.7vw, 1.55rem);
    font-weight: 800;
    letter-spacing: 0;
}

.landing-copy h1 {
    color: #ffffff;
    font-size: clamp(2.7rem, 5.2vw, 4.75rem);
    line-height: 1.05;
    letter-spacing: 0;
    margin-bottom: 1.35rem;
    text-wrap: balance;
}

.landing-copy p {
    max-width: 500px;
    color: #d7def1;
    font-size: clamp(1rem, 1.6vw, 1.18rem);
    line-height: 1.68;
}

.landing-copy-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 1.8rem;
}

.landing-primary-cta,
.landing-secondary-cta {
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    padding: 0 1.75rem;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
}

.landing-primary-cta {
    border: 0;
    color: #ffffff;
    background: #6417f2;
    cursor: pointer;
    box-shadow: 0 20px 40px rgba(100, 23, 242, 0.28);
}

.landing-secondary-cta {
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #d7def1;
    background: rgba(255, 255, 255, 0.04);
}

.landing-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    max-width: 520px;
}

.landing-highlights span {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.85rem;
    border: 1px solid rgba(72, 219, 251, 0.24);
    border-radius: 999px;
    color: #b8f7ff;
    background: rgba(72, 219, 251, 0.08);
    font-size: 0.8rem;
    font-weight: 800;
}

.landing-access {
    width: 100%;
    min-height: 690px;
    position: relative;
    display: grid;
    align-items: center;
    justify-items: center;
}

.landing-product-visual {
    position: absolute;
    inset: 50% auto auto 50%;
    width: min(760px, 58vw);
    margin: 0;
    transform: translate(-48%, -52%);
}

.landing-product-image {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 34px 55px rgba(0, 0, 0, 0.28));
    mix-blend-mode: lighten;
    -webkit-mask-image: radial-gradient(ellipse 78% 72% at 52% 52%, #000 58%, rgba(0, 0, 0, 0.82) 75%, transparent 100%);
    mask-image: radial-gradient(ellipse 78% 72% at 52% 52%, #000 58%, rgba(0, 0, 0, 0.82) 75%, transparent 100%);
}

.landing-product-caption {
    position: absolute;
    right: 16%;
    top: 12%;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0 0.9rem;
    color: #1a2641;
    background: #ffffff;
    font-size: 0.78rem;
    font-weight: 900;
    box-shadow: 0 20px 38px rgba(0, 0, 0, 0.18);
}

.landing-floating-pill {
    position: absolute;
    min-height: 54px;
    display: inline-grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.85rem 0.45rem 0.45rem;
    border-radius: 999px;
    color: #17213a;
    background: #ffffff;
    box-shadow: 0 24px 44px rgba(0, 0, 0, 0.2);
}

.landing-floating-pill strong {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #6417f2;
    background: #eee7ff;
    font-size: 1rem;
}

.landing-floating-pill span {
    max-width: 98px;
    color: #27314e;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.15;
}

.landing-floating-pill-top {
    left: 12%;
    top: 19%;
}

.landing-floating-pill-right {
    right: 2%;
    top: 35%;
}

.landing-floating-pill-bottom {
    left: 23%;
    bottom: 9%;
}

.login-card {
    background: #ffffff;
    padding: clamp(1.2rem, 2.5vw, 1.65rem);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 8px;
    box-shadow: 0 28px 70px rgba(2, 6, 23, 0.36);
    width: 100%;
    max-width: 350px;
    text-align: center;
    position: absolute;
    right: 0;
    bottom: 2rem;
    z-index: 2;
}

.login-logo {
    width: 58px;
    height: 58px;
    object-fit: cover;
    object-position: left center;
    border-radius: 14px;
    margin-bottom: 1.1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.login-eyebrow {
    display: inline-flex;
    margin-bottom: 0.5rem;
    color: #0f766e;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.login-card h2 {
    color: #0f2742;
    margin-bottom: 0.4rem;
    font-weight: 800;
    font-size: 1.42rem;
    letter-spacing: 0;
}

.login-brand-name {
    color: #64748b;
    margin-bottom: 1.15rem;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.35;
}

.login-card .form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.login-card label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.login-card input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    color: #0f172a;
    background: #f8fafc;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.login-card input:focus {
    outline: none;
    border-color: #14b8a6;
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.14);
}

.btn-login {
    width: 100%;
    padding: 0.95rem 1rem;
    background: linear-gradient(135deg, #0f766e 0%, #0891b2 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    margin-top: 0.5rem;
    box-shadow: 0 16px 32px rgba(8, 145, 178, 0.26);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 38px rgba(8, 145, 178, 0.34);
}

.login-card-footer {
    margin-top: 1.25rem;
    padding-top: 1.1rem;
    border-top: 1px solid #e2e8f0;
}

.login-card-footer a {
    justify-content: center;
    min-height: 40px;
    width: 100%;
    color: #0f766e;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.9rem;
}

.error-text {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 15px;
}

/* ── Auth modal (login/selector se abren por botón) ── */
.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 10025;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-modal.is-open {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.auth-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.66);
    backdrop-filter: blur(8px);
}

.auth-dialog {
    position: relative;
    width: min(380px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    animation: authPop 0.28s cubic-bezier(.22,.61,.36,1);
}

@keyframes authPop {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.auth-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 34px;
    height: 34px;
    z-index: 3;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #f8fafc;
    color: #334155;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.auth-close:hover { background: #eef2f7; }

/* La tarjeta ahora vive centrada dentro del modal, ya no flota sobre la imagen */
.auth-dialog .login-card {
    position: static;
    inset: auto;
    right: auto;
    bottom: auto;
    max-width: none;
    width: 100%;
    margin: 0;
}

.sales-demo-modal {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.sales-demo-modal.is-open {
    display: flex;
}

.sales-demo-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.62);
    backdrop-filter: blur(8px);
}

.sales-demo-dialog {
    position: relative;
    width: min(680px, 100%);
    max-height: 88vh;
    overflow-y: auto;
    padding: clamp(1.35rem, 3vw, 2rem);
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 28px 80px rgba(2, 6, 23, 0.42);
}

.sales-demo-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 36px;
    height: 36px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.sales-demo-eyebrow {
    display: inline-flex;
    margin-bottom: 0.45rem;
    color: #0f766e;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sales-demo-dialog h2 {
    margin: 0 2.5rem 0.5rem 0;
    color: #0f2742;
    font-size: clamp(1.65rem, 3vw, 2rem);
    line-height: 1.12;
}

.sales-demo-dialog p {
    max-width: 560px;
    color: #64748b;
    line-height: 1.55;
}

.sales-demo-form {
    display: grid;
    gap: 1rem;
    margin-top: 1.25rem;
}

.sales-demo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.sales-demo-form .form-group {
    margin: 0;
    text-align: left;
}

.sales-demo-form label {
    display: block;
    margin-bottom: 0.42rem;
    color: #475569;
    font-size: 0.88rem;
    font-weight: 700;
}

.sales-demo-form input,
.sales-demo-form textarea {
    width: 100%;
    padding: 0.82rem 0.95rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #0f172a;
    font: inherit;
    font-size: 0.96rem;
}

.sales-demo-form textarea {
    resize: vertical;
}

.sales-demo-form input:focus,
.sales-demo-form textarea:focus {
    outline: none;
    border-color: #f3af1d;
    box-shadow: 0 0 0 4px rgba(243, 175, 29, 0.16);
}

.sales-demo-submit {
    min-height: 48px;
    border: 0;
    border-radius: 8px;
    color: #1e293b;
    background: #f3af1d;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.sales-demo-status {
    min-height: 1.2rem;
    color: #0f766e;
    font-size: 0.9rem;
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════
   LANDING — SECCIONES INFERIORES (estilo Zenfi)
═══════════════════════════════════════════════════════════ */
.lp-section {
    width: 100%;
    color: #eaf0ff;
    scroll-margin-top: 2rem;
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(34px);
    transition: opacity 0.7s cubic-bezier(.22,.61,.36,1), transform 0.7s cubic-bezier(.22,.61,.36,1);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .lp-device, .lp-blob, .lp-chip { animation: none !important; }
}

.lp-eyebrow {
    display: inline-flex;
    margin-bottom: 1rem;
    color: #20aefc;
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.lp-eyebrow-violet { color: #a78bfa; }

.lp-grad {
    background: linear-gradient(90deg, #20aefc, #22d3ee);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lp-grad-violet {
    background: linear-gradient(90deg, #8b5cf6, #6417f2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ── Trust strip ── */
.lp-trust {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: clamp(1.6rem, 4vw, 2.4rem) 0;
}

.lp-trust-label {
    color: #8a96b8;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1.4rem;
}

.lp-trust-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(1.2rem, 4vw, 3rem);
}

.lp-trust-logos span {
    color: #b6c0dc;
    font-size: clamp(0.95rem, 1.6vw, 1.2rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    opacity: 0.65;
    transition: opacity var(--transition-fast);
}

.lp-trust-logos span:hover { opacity: 1; }

/* ── Feature rows ── */
.lp-feature {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: clamp(2rem, 6vw, 5rem);
}

.lp-feature-reverse .lp-feature-copy { order: 2; }
.lp-feature-reverse .lp-feature-visual { order: 1; }

.lp-feature-copy h2 {
    color: #ffffff;
    font-size: clamp(1.9rem, 3.6vw, 2.9rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin-bottom: 1.1rem;
    text-wrap: balance;
}

.lp-feature-copy > p {
    color: #c2cce6;
    font-size: clamp(1rem, 1.5vw, 1.12rem);
    line-height: 1.7;
    max-width: 480px;
    margin-bottom: 1.5rem;
}

.lp-checks {
    list-style: none;
    display: grid;
    gap: 0.85rem;
    margin: 0 0 1.8rem;
    padding: 0;
}

.lp-checks li {
    position: relative;
    padding-left: 2.1rem;
    color: #dbe3f7;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.lp-checks li::before {
    content: "";
    position: absolute;
    left: 0;
    top: -1px;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 0.9rem no-repeat;
}

.lp-checks-violet li::before {
    background: rgba(139, 92, 246, 0.18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a78bfa' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 0.9rem no-repeat;
}

.lp-text-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border: 0;
    background: transparent;
    padding: 0;
    color: #20aefc;
    font: inherit;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
}

.lp-text-cta-violet { color: #a78bfa; }

.lp-text-cta svg {
    width: 1.1rem;
    height: 1.1rem;
    transition: transform var(--transition-fast);
}

.lp-text-cta:hover svg { transform: translateX(4px); }

/* ── Visual / device mockups ── */
.lp-feature-visual {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 420px;
    isolation: isolate;
}

.lp-blob {
    position: absolute;
    width: 78%;
    aspect-ratio: 1;
    border-radius: 50%;
    z-index: -1;
    filter: blur(2px);
    animation: lpFloat 7s ease-in-out infinite;
}

.lp-blob-violet { background: radial-gradient(circle at 35% 30%, #6417f2, #3b0a91 70%); }
.lp-blob-cyan { background: radial-gradient(circle at 35% 30%, #0ea5e9, #155e9c 72%); }

.lp-device {
    position: relative;
    width: min(360px, 86%);
    background: linear-gradient(180deg, #1b2440, #141b30);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    padding: 1.05rem;
    box-shadow: 0 40px 80px rgba(2, 6, 23, 0.5);
    display: grid;
    gap: 0.9rem;
    animation: lpFloat 6s ease-in-out infinite;
}

.lp-tilt { transform: rotate(-2deg); }
.lp-tilt-rev { transform: rotate(2deg); }

.lp-device-bar {
    display: flex;
    gap: 0.4rem;
}

.lp-device-bar span {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
}

.lp-mock-head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.lp-mock-avatar {
    width: 40px;
    height: 40px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #6417f2, #9333ea);
    color: #fff;
    font-weight: 900;
    font-size: 0.85rem;
}

.lp-avatar-cyan { background: linear-gradient(135deg, #0891b2, #22d3ee); }

.lp-mock-head strong { display: block; color: #fff; font-size: 0.95rem; }
.lp-mock-head small { color: #94a3c8; font-size: 0.78rem; }

/* gauge */
.lp-gauge {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.lp-gauge-ring {
    width: 66px;
    height: 66px;
    flex: none;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:
        radial-gradient(closest-side, #1b2440 78%, transparent 79% 100%),
        conic-gradient(#22d3ee 0 var(--g, 94%), rgba(255,255,255,0.1) 0);
    --g: 94%;
}

.lp-gauge-num { color: #fff; font-weight: 900; font-size: 1.05rem; }
.lp-gauge-num i { font-style: normal; font-size: 0.7rem; color: #22d3ee; }
.lp-gauge-meta strong { display: block; color: #fff; font-size: 0.88rem; }
.lp-gauge-meta small { color: #94a3c8; font-size: 0.76rem; line-height: 1.3; }

.lp-mock-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.lp-mock-stats div {
    padding: 0.65rem 0.4rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    text-align: center;
}

.lp-mock-stats strong { display: block; color: #fff; font-size: 1.05rem; }
.lp-mock-stats span { color: #94a3c8; font-size: 0.66rem; font-weight: 700; }

.lp-mock-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
    height: 78px;
    padding: 0.6rem 0.2rem 0;
}

.lp-mock-bars i {
    flex: 1;
    height: var(--h);
    border-radius: 5px 5px 2px 2px;
    background: linear-gradient(180deg, #22d3ee, #6417f2);
    opacity: 0.85;
}

/* finance device */
.lp-balance {
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(100,23,242,0.28), rgba(34,211,238,0.14));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.lp-balance small { display: block; color: #c7d0ea; font-size: 0.74rem; font-weight: 700; }
.lp-balance strong { display: block; color: #fff; font-size: 1.55rem; letter-spacing: -0.01em; margin: 0.15rem 0; }
.lp-balance-up { color: #34d399; font-size: 0.78rem; font-weight: 800; }

.lp-pay-rows { display: grid; gap: 0.55rem; }

.lp-pay-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.7rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
}

.lp-pay-ic {
    width: 34px; height: 34px; flex: none;
    display: grid; place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #cdd6ee; font-size: 0.72rem; font-weight: 800;
}

.lp-pay-row div { flex: 1; min-width: 0; }
.lp-pay-row strong { display: block; color: #fff; font-size: 0.82rem; }
.lp-pay-row small { color: #94a3c8; font-size: 0.72rem; }
.lp-pay-row b { font-size: 0.7rem; font-weight: 800; padding: 0.2rem 0.55rem; border-radius: 999px; }
.lp-ok { color: #34d399; background: rgba(52,211,153,0.14); }
.lp-pend { color: #fbbf24; background: rgba(251,191,36,0.14); }

/* portal device */
.lp-course-list { display: grid; gap: 0.5rem; }

.lp-course {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
}

.lp-course-ic {
    width: 34px; height: 34px; flex: none;
    display: grid; place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    font-size: 1rem;
}

.lp-course div { flex: 1; min-width: 0; }
.lp-course strong { display: block; color: #fff; font-size: 0.82rem; }
.lp-course small { color: #94a3c8; font-size: 0.72rem; }

.lp-course-bar {
    width: 46px; height: 6px; flex: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
    display: block;
}

.lp-course-bar b { display: block; height: 100%; width: var(--p); background: linear-gradient(90deg, #22d3ee, #6417f2); border-radius: 999px; }

.lp-portal-cta {
    text-align: center;
    padding: 0.7rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #6417f2, #9333ea);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
}

/* floating chips */
.lp-chip {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: #ffffff;
    color: #17213a;
    font-size: 0.78rem;
    font-weight: 800;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
    z-index: 2;
    animation: lpFloat 5.5s ease-in-out infinite;
}

.lp-chip strong { color: #6417f2; }
.lp-chip-a { top: 8%; left: -2%; animation-delay: -1.5s; }
.lp-chip-b { bottom: 10%; right: -2%; animation-delay: -3s; }

.lp-chip-dot {
    width: 8px; height: 8px; border-radius: 999px;
    background: #f43f5e;
    box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.18);
}

.lp-dot-cyan { background: #22d3ee; box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.18); }

@keyframes lpFloat {
    0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
    50% { transform: translateY(-12px) rotate(var(--rot, 0deg)); }
}

.lp-tilt { --rot: -2deg; }
.lp-tilt-rev { --rot: 2deg; }

/* ── Stats band ── */
.lp-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: clamp(1.8rem, 4vw, 2.8rem) clamp(1.5rem, 4vw, 3rem);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(100,23,242,0.18), rgba(34,211,238,0.08));
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.lp-stat strong {
    display: block;
    color: #fff;
    font-size: clamp(2rem, 4vw, 3.1rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1;
    background: linear-gradient(90deg, #ffffff, #b8e6ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lp-stat span { color: #aeb9d8; font-size: 0.85rem; font-weight: 700; }

/* ── Modules grid ── */
.lp-modules-head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto clamp(2rem, 5vw, 3.2rem);
}

.lp-modules-head h2 {
    color: #fff;
    font-size: clamp(1.9rem, 3.6vw, 2.8rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin-bottom: 0.9rem;
}

.lp-modules-head p { color: #c2cce6; font-size: 1.05rem; line-height: 1.6; }

.lp-modules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1rem, 2vw, 1.4rem);
}

.lp-module {
    padding: clamp(1.4rem, 2.4vw, 1.9rem);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

.lp-module:hover {
    transform: translateY(-6px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(100, 23, 242, 0.5);
}

.lp-module-ic {
    width: 52px; height: 52px;
    display: grid; place-items: center;
    border-radius: 14px;
    margin-bottom: 1.1rem;
    background: linear-gradient(135deg, rgba(100,23,242,0.85), rgba(147,51,234,0.85));
    color: #fff;
}

.lp-module-ic svg { width: 26px; height: 26px; }
.lp-module h3 { color: #fff; font-size: 1.18rem; margin-bottom: 0.45rem; }
.lp-module p { color: #aab4d4; font-size: 0.92rem; line-height: 1.55; }

/* ── Security ── */
.lp-security {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    align-items: center;
    gap: clamp(2rem, 6vw, 5rem);
    padding: clamp(2rem, 5vw, 3.5rem);
    border-radius: 28px;
    background: linear-gradient(135deg, #1a2240, #131a2e);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.lp-security-visual { display: grid; place-items: center; }

.lp-shield {
    width: clamp(120px, 18vw, 180px);
    height: clamp(120px, 18vw, 180px);
    display: grid; place-items: center;
    border-radius: 50%;
    color: #22d3ee;
    background: radial-gradient(circle at 40% 35%, rgba(34,211,238,0.25), rgba(100,23,242,0.12));
    border: 1px solid rgba(34, 211, 238, 0.25);
    animation: lpFloat 6s ease-in-out infinite;
}

.lp-shield svg { width: 52%; height: 52%; }

.lp-security-copy h2 {
    color: #fff;
    font-size: clamp(1.7rem, 3.2vw, 2.5rem);
    line-height: 1.14;
    letter-spacing: -0.02em;
    margin-bottom: 0.9rem;
}

.lp-security-copy > p { color: #c2cce6; font-size: 1.05rem; line-height: 1.65; margin-bottom: 1.4rem; max-width: 540px; }

.lp-sec-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0;
    margin: 0;
}

.lp-sec-tags li {
    padding: 0.5rem 0.95rem;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.22);
    color: #b8f7ff;
    font-size: 0.82rem;
    font-weight: 800;
}

/* ── Final CTA ── */
.lp-cta-inner {
    text-align: center;
    padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 5vw, 3rem);
    border-radius: 28px;
    background:
        radial-gradient(120% 140% at 50% 0%, rgba(100,23,242,0.45), transparent 60%),
        linear-gradient(135deg, #221a52, #141b30);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lp-cta-inner h2 {
    color: #fff;
    font-size: clamp(2rem, 4.2vw, 3.2rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    text-wrap: balance;
}

.lp-cta-inner p { color: #cdd6ee; font-size: 1.1rem; line-height: 1.6; max-width: 560px; margin: 0 auto 2rem; }

.lp-cta-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
}

/* ── Footer ── */
.lp-footer {
    padding-top: clamp(2rem, 5vw, 3rem);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.lp-footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: clamp(1.5rem, 4vw, 3rem);
    padding-bottom: 2.5rem;
}

.lp-footer-brand p {
    color: #97a2c2;
    font-size: 0.92rem;
    line-height: 1.6;
    max-width: 320px;
    margin-top: 1rem;
}

.lp-footer-col h4 {
    color: #fff;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.lp-footer-col a {
    display: block;
    color: #9aa5c4;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 0.32rem 0;
    transition: color var(--transition-fast);
}

.lp-footer-col a:hover { color: #22d3ee; }

.lp-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.4rem 0 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #7e8ab0;
    font-size: 0.85rem;
}

.lp-footer-legal { display: flex; gap: 1.5rem; }
.lp-footer-legal a { color: #7e8ab0; text-decoration: none; }
.lp-footer-legal a:hover { color: #c2cce6; }

/* ═══════════════════════════════════════════════════════════
   TABLE GROUP HEADERS & INLINE MODALS — tema consciente
═══════════════════════════════════════════════════════════ */

/* Fila de encabezado de grupo en tablas (teacher name, etc.) */
.table-group-header {
    background: rgba(124, 58, 237, 0.08);
    color: var(--text-primary);
    font-weight: 700;
    padding: 8px 12px;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(124, 58, 237, 0.15);
}

.dark-mode .table-group-header {
    background: rgba(100, 23, 242, 0.18);
    color: #c4b5fd;
    border-bottom-color: rgba(100, 23, 242, 0.35);
}

/* Filas especiales de community (ajuste, total, main) */
.table-row-adjustment { background: rgba(245, 158, 11, 0.07); }
.table-row-total { background: rgba(37, 99, 235, 0.07); }
.table-row-main { background: var(--bg-card); }

.dark-mode .table-row-adjustment { background: rgba(251, 191, 36, 0.1); }
.dark-mode .table-row-total { background: rgba(100, 23, 242, 0.12); }
.dark-mode .table-row-main { background: var(--bg-card); }

.dark-mode .table-total-label,
.dark-mode .table-total-value { color: #a78bfa; }

/* Modales creados inline por JS (reenrollment, student-payments) */
.inline-modal-dialog {
    background: var(--bg-card, #ffffff);
    color: var(--text-primary, #1e293b);
}

.dark-mode .inline-modal-dialog {
    background: #1b2440;
    color: #eaf0ff;
    border: 1px solid rgba(255, 255, 255, 0.09);
}

.dark-mode .inline-modal-dialog h3,
.dark-mode .inline-modal-dialog h4 {
    color: #ffffff;
}

.dark-mode .inline-modal-dialog label,
.dark-mode .inline-modal-dialog p {
    color: #c2cce6;
}

/* ═══════════════════════════════════════════════════════════
   DARK MODE — FIX FONDOS BLANCOS HARDCODEADOS
   Cubre todos los list-items y contenedores que tienen
   background: #fff / #feffff sin override de tema.
═══════════════════════════════════════════════════════════ */
.dark-mode .beneficiary-item,
.dark-mode .student-item,
.dark-mode .teacher-item,
.dark-mode .career-item,
.dark-mode .grade-item,
.dark-mode .subject-item,
.dark-mode .group-item,
.dark-mode .assignment-item,
.dark-mode .format-item,
.dark-mode .formats-list .format-item,
.dark-mode .calculation-result .result-item,
.dark-mode .module-item,
.dark-mode .module-subjects li.subject-row-item,
.dark-mode .teacher-subjects-summary,
.dark-mode .teacher-subject-career,
.dark-mode .teacher-subject-select-career,
.dark-mode .subject-assignment-list,
.dark-mode .schedule-plus-container {
    background: var(--bg-card) !important;
    border-color: rgba(255, 255, 255, 0.09) !important;
    color: var(--text-primary) !important;
}

.dark-mode .beneficiary-item:hover,
.dark-mode .student-item:hover,
.dark-mode .teacher-item:hover,
.dark-mode .career-item:hover,
.dark-mode .group-item:hover,
.dark-mode .assignment-item:hover,
.dark-mode .format-item:hover,
.dark-mode .module-subjects li.subject-row-item:hover {
    background: var(--bg-card-hover) !important;
    border-color: rgba(100, 23, 242, 0.4) !important;
}

/* Texto anidado en items */
.dark-mode .beneficiary-item *,
.dark-mode .student-item *,
.dark-mode .teacher-item *,
.dark-mode .career-item *,
.dark-mode .grade-item *,
.dark-mode .subject-item *,
.dark-mode .group-item *,
.dark-mode .assignment-item *,
.dark-mode .format-item * {
    color: inherit;
}

/* Títulos h4 dentro de contenedores que también tenían #feffff */
.dark-mode .teacher-subject-career h4,
.dark-mode .teacher-subject-select-career h4 {
    background: transparent !important;
    color: #d7def1 !important;
}

/* ═══════════════════════════════════════════════════════════
   APP INTERIOR — REFINAMIENTO DARK MODE (identidad landing)
═══════════════════════════════════════════════════════════ */

/* Gradiente institucional en el underline de todos los h1/h2 de sección */
.dark-mode h1::after {
    background: linear-gradient(90deg, #6417f2, #22d3ee);
    width: 3rem;
    height: 3px;
}

/* Títulos de página en dark */
.dark-mode h1 {
    color: #ffffff;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.dark-mode h2 {
    color: #eaf0ff;
    font-weight: 700;
}

/* Dashboard header */
.dark-mode .dashboard-header h1 {
    font-size: clamp(1.7rem, 3vw, 2.3rem);
}

.dark-mode .dashboard-subtitle {
    color: #8a96b8;
    font-size: 0.92rem;
    font-weight: 600;
}

/* Stat cards con borde visible en dark */
.dark-mode .stat-card {
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-top: 2px solid rgba(100, 23, 242, 0.6);
    transition: all 0.22s cubic-bezier(.22,.61,.36,1);
}

.dark-mode .stat-card:hover {
    border-color: rgba(100, 23, 242, 0.65);
    border-top-color: #6417f2;
    box-shadow: 0 0 0 1px rgba(100, 23, 242, 0.2), 0 16px 36px rgba(0, 0, 0, 0.35);
    transform: translateY(-4px);
}

/* Íconos de stat con tinte institucional */
.dark-mode .stat-icon {
    background: rgba(100, 23, 242, 0.18) !important;
}

.dark-mode .stat-icon svg {
    stroke: #a78bfa !important;
}

.dark-mode .stat-value {
    color: #ffffff;
    font-weight: 900;
}

.dark-mode .stat-label {
    color: #8a96b8;
}

/* Separadores y sub-secciones del dashboard */
.dark-mode .dashboard-section {
    border-top-color: rgba(100, 23, 242, 0.15);
}

.dark-mode .dashboard-section h2 {
    color: #d7def1;
}

/* Badges y pills */
.dark-mode .badge,
.dark-mode [class*="badge-"],
.dark-mode .status-badge {
    font-weight: 700;
}

/* Main content: fondo coincide exactamente con landing bg */
.dark-mode .main-content {
    background: var(--bg-body);
}

/* Cards genericas en dark — borde perceptible sobre el fondo navy */
.dark-mode .card {
    border: 1px solid rgba(255, 255, 255, 0.07);
}

/* Input placeholder más legible en dark */
.dark-mode input::placeholder,
.dark-mode textarea::placeholder,
.dark-mode select {
    color: #8a96b8;
}

/* ── Responsive landing sections ── */
@media (max-width: 1060px) {
    .lp-feature,
    .lp-security {
        grid-template-columns: 1fr;
    }

    .lp-feature-reverse .lp-feature-copy,
    .lp-feature-reverse .lp-feature-visual { order: 0; }

    .lp-modules-grid { grid-template-columns: repeat(2, 1fr); }
    .lp-stats { grid-template-columns: repeat(2, 1fr); gap: 1.8rem 1rem; }
    .lp-footer-grid { grid-template-columns: 1fr 1fr; }
    .lp-security-visual { max-width: 220px; margin: 0 auto; }
}

@media (max-width: 640px) {
    .lp-modules-grid { grid-template-columns: 1fr; }
    .lp-stats { grid-template-columns: repeat(2, 1fr); }
    .lp-footer-grid { grid-template-columns: 1fr 1fr; }
    .lp-footer-brand { grid-column: 1 / -1; }
    .lp-chip { display: none; }
    .lp-feature-visual { min-height: 340px; }
}

/* Expedientes: las acciones describen su efecto y el vacío explica el siguiente paso. */
.student-records-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    margin-top: 1.35rem;
}

.student-records-heading h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    letter-spacing: -0.015em;
}

.student-records-heading p {
    max-width: 48rem;
    margin: 0.35rem 0 0;
    color: var(--text-secondary);
}

.student-records-search {
    max-width: 48rem;
    margin: 0.85rem 0 1rem;
}

.student-records-search label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
}

.student-records-empty {
    min-height: 7.5rem;
    padding: 1.25rem !important;
    text-align: left;
    vertical-align: middle;
}

.student-records-empty strong,
.student-records-empty span {
    display: block;
}

.student-records-empty span {
    margin-top: 0.28rem;
    color: var(--text-secondary);
}

#schoolCommunityTable .btn-action {
    min-height: 2rem;
    margin: 0.12rem;
    padding: 0.35rem 0.48rem;
    border: 1px solid color-mix(in srgb, var(--primary-color) 24%, var(--border-color));
    border-radius: 7px;
    background: var(--bg-card);
    color: var(--primary-dark);
    font-size: 0.75rem;
    font-weight: 700;
}

#schoolCommunityTable .btn-action.btn-pay {
    background: var(--primary-color);
    color: #fffefa;
}

#schoolCommunityTable .btn-action.btn-delete {
    border-color: color-mix(in srgb, #b91c1c 38%, var(--border-color));
    color: #a42828;
}

#schoolCommunityTable .student-record-actions {
    min-width: 20rem;
}

#schoolCommunityTable .student-record-actions .btn-action {
    white-space: nowrap;
}

@media (max-width: 640px) {
    .student-records-heading { align-items: stretch; }

    #schoolCommunityTable { min-width: 0; }
    #schoolCommunityTable thead { display: none; }
    #schoolCommunityTable,
    #schoolCommunityTable tbody,
    #schoolCommunityTable tr,
    #schoolCommunityTable td { display: block; width: 100%; }
    #schoolCommunityTable tr {
        margin-bottom: 0.75rem;
        padding: 0.85rem;
        border: 1px solid var(--u5-line);
        border-radius: 12px;
        background: var(--u5-paper);
    }
    #schoolCommunityTable td {
        display: grid;
        grid-template-columns: minmax(7rem, 0.75fr) 1fr;
        gap: 0.6rem;
        padding: 0.36rem 0;
        border: 0;
        text-align: left;
    }
    #schoolCommunityTable td::before {
        content: attr(data-label);
        color: var(--text-secondary);
        font-size: 0.74rem;
        font-weight: 700;
    }
    #schoolCommunityTable .student-record-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.38rem;
        min-width: 0;
        margin-top: 0.3rem;
        padding-top: 0.7rem;
        border-top: 1px solid var(--u5-line);
    }
    #schoolCommunityTable .student-record-actions::before { flex-basis: 100%; }
    #schoolCommunityTable .student-record-actions .btn-action { margin: 0; }
}
}

/* LMS: misma identidad académica, sin la paleta aislada de la vista heredada. */
#lms .lms-stat-icon {
    background: color-mix(in srgb, var(--primary-color) 11%, var(--bg-card));
    color: var(--primary-color);
}

#lms .lms-stats .stat-card:nth-child(2) .lms-stat-icon {
    background: color-mix(in srgb, var(--accent-color) 13%, var(--bg-card));
    color: var(--accent-dark, #b94f35);
}

#lms .dashboard-section {
    border-top-color: color-mix(in srgb, var(--primary-color) 13%, transparent);
}

.lms-dashboard-empty {
    display: grid;
    gap: 0.3rem;
    max-width: 43rem;
    margin-top: 1.2rem;
    padding: 1rem;
    border-left: 3px solid var(--accent-color);
    border-radius: 0 10px 10px 0;
    background: color-mix(in srgb, var(--accent-color) 7%, var(--bg-card));
}

.lms-dashboard-empty span {
    color: var(--text-secondary);
}

/* Oferta educativa: estructura académica progresiva, no una pila de acciones destructivas. */
#careers #careerForm {
    max-width: 70rem;
    margin: 1.3rem 0 1rem;
}

#careers .form-inline {
    display: flex;
    gap: 0.7rem;
    align-items: center;
}

#careers .form-inline input {
    flex: 1 1 auto;
    min-width: 0;
}

#careerList {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.2rem;
}

#careers .career-item {
    margin: 0;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--primary-color) 12%, var(--border-color));
    border-radius: 13px;
    background: var(--bg-card);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--primary-color) 6%, transparent);
    overflow: hidden;
}

.career-row,
.grade-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
}

.career-header,
.grade-header {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    align-items: center;
    gap: 0.8rem;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
}

.career-header small,
.career-header strong {
    display: block;
}

.career-header small {
    margin-bottom: 0.12rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.career-header strong {
    font-size: 1.05rem;
    letter-spacing: -0.015em;
}

#careers .collapse-btn {
    display: inline-grid;
    place-items: center;
    inline-size: 1.55rem;
    block-size: 1.55rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: color-mix(in srgb, var(--primary-color) 10%, var(--bg-card));
    color: var(--primary-dark);
    font-size: 1.1rem;
    font-weight: 700;
}

.career-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

#careers .career-actions .btn-delete,
#careers .grade-row .btn-delete {
    border-color: color-mix(in srgb, #b91c1c 35%, var(--border-color));
    background: transparent;
    box-shadow: none;
    color: #a42828;
}

#careers .career-content,
#careers .grade-content {
    border-top: 1px solid color-mix(in srgb, var(--primary-color) 10%, var(--border-color));
}

#careers .career-content {
    padding: 1rem 1.1rem 1.2rem;
    background: color-mix(in srgb, var(--primary-color) 2%, var(--bg-card));
}

.career-add-row,
.grade-add-row {
    display: grid;
    grid-template-columns: minmax(7rem, auto) minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: center;
}

.career-add-row label,
.grade-add-row label {
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 600;
}

.career-add-row input,
.grade-add-row input {
    min-width: 0;
    border: 1px solid color-mix(in srgb, var(--primary-color) 18%, var(--border-color));
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.65rem 0.72rem;
}

#careers .grades-list {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.9rem;
}

#careers .grade-item {
    border: 1px solid color-mix(in srgb, var(--primary-color) 10%, var(--border-color));
    border-radius: 10px;
    background: var(--bg-card);
}

.grade-row {
    padding: 0.75rem 0.85rem;
}

#careers .grade-content {
    padding: 0.75rem 0.85rem;
}

#careers .subject-list {
    display: grid;
    gap: 0.35rem;
    margin: 0.7rem 0 0;
    padding: 0;
    list-style: none;
}

#careers .subject-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.62rem 0.72rem;
    border-radius: 7px;
    background: color-mix(in srgb, var(--primary-color) 5%, var(--bg-card));
}

.career-empty {
    display: grid;
    gap: 0.3rem;
    min-height: 7rem;
    align-content: center;
    padding: 1.1rem;
    border: 1px solid color-mix(in srgb, var(--primary-color) 12%, var(--border-color));
    border-radius: 12px;
    background: var(--bg-card);
}

.career-empty span { color: var(--text-secondary); }

@media (max-width: 700px) {
    .career-row,
    .grade-row {
        align-items: stretch;
        flex-direction: column;
    }

    .career-actions { justify-content: flex-start; }

    .career-add-row,
    .grade-add-row {
        grid-template-columns: 1fr;
    }

    #careers .career-actions .btn,
    .career-add-row .btn,
    .grade-add-row .btn { width: 100%; }
}

/* Asignaciones: una consulta académica, no una acción de pago. */
.assignment-intro {
    margin-bottom: 0.85rem;
}

.assignment-intro p {
    max-width: 52rem;
}

#assignments .assignments-toolbar {
    align-items: end;
    justify-content: flex-start;
    gap: 0.65rem;
}

#assignments .assignments-toolbar > label {
    display: grid;
    gap: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
}

#assignments .assignments-toolbar > input {
    max-width: 17rem;
}

#assignments .assignments-state {
    display: grid;
    min-height: 10rem;
    place-items: center;
    text-align: center;
    padding: 1.25rem;
    color: var(--text-secondary);
}

@media (max-width: 640px) {
    #assignments .assignments-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    #assignments .assignments-toolbar > input,
    #assignments .assignments-toolbar .btn {
        max-width: none;
        width: 100%;
    }
}

/* Finanzas: jerarquía de operación, sin cambiar la trazabilidad contable. */
.ops-kpi {
    border-color: color-mix(in srgb, var(--primary-color) 14%, var(--border-color));
    background:
        linear-gradient(120deg, color-mix(in srgb, var(--primary-color) 4%, var(--bg-card)), var(--bg-card) 56%);
}

.ops-kpi strong,
.ops-table td:nth-child(4),
.ops-table td:nth-child(5),
.ops-table td:nth-child(6) {
    font-variant-numeric: tabular-nums;
}

.ops-cashbox-tools {
    gap: 0.55rem;
    padding: 0.8rem 0;
    border-block: 1px solid color-mix(in srgb, var(--primary-color) 14%, transparent);
}

.ops-toolbar-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    margin-right: 0.3rem;
}

.ops-status-pending,
.ops-status-requested,
.ops-status-draft {
    background: color-mix(in srgb, #d97706 13%, var(--bg-card));
    color: #9a5b00;
}

.ops-status-paid,
.ops-status-issued,
.ops-status-reconciled {
    background: color-mix(in srgb, var(--primary-color) 12%, var(--bg-card));
    color: var(--primary-dark);
}

.ops-status-failed,
.ops-status-cancelled,
.ops-status-expired {
    background: color-mix(in srgb, #b91c1c 10%, var(--bg-card));
    color: #9f1d1d;
}

.ops-list-card h2 {
    letter-spacing: -0.012em;
}

@media (max-width: 700px) {
    .ops-cashbox-tools {
        align-items: flex-start;
    }

    .ops-toolbar-label {
        flex-basis: 100%;
    }
}

/* ========================================================================== */
/* Sistema visual compartido — identidad académica y cercana                  */
/* ========================================================================== */
:root {
    --u5-ink: #17324d;
    --u5-teal: #0c706d;
    --u5-teal-deep: #064f50;
    --u5-paper: #fffefa;
    --u5-canvas: #f7f5ef;
    --u5-line: rgba(23, 50, 77, 0.13);
    --u5-coral: #dd6542;
}

body {
    background: var(--u5-canvas);
    color: var(--u5-ink);
}

.main-content {
    max-width: 1680px;
    padding: clamp(1.25rem, 3vw, 2.5rem);
}

.content-section.visible {
    animation: u5-section-enter 260ms var(--ease-out) both;
}

.sidebar nav ul li button.active,
.sidebar nav ul li button.btn.active {
    background: var(--u5-teal) !important;
    box-shadow: 0 8px 18px rgba(6, 79, 80, 0.24) !important;
}

.sidebar nav ul li button::before {
    background: var(--u5-coral);
}

@keyframes u5-section-enter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.content-section > h1,
.section-header h1,
.dashboard-header h1 {
    color: var(--u5-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.08;
    text-wrap: balance;
}

.content-section > h1::after {
    width: 42px;
    height: 3px;
    border-radius: 99px;
    background: var(--u5-coral);
}

.section-header {
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.btn {
    min-height: 40px;
    border-radius: 9px;
    background: var(--u5-teal);
    box-shadow: 0 4px 12px rgba(6, 79, 80, 0.17);
    font-weight: 700;
}

.btn:hover {
    background: var(--u5-teal-deep);
    box-shadow: 0 8px 18px rgba(6, 79, 80, 0.2);
}

.btn-accent,
.btn-calculate,
.btn-login,
.landing-primary-cta,
.landing-demo-button {
    background: var(--u5-coral);
    box-shadow: 0 6px 16px rgba(221, 101, 66, 0.21);
}

.btn-accent:hover,
.btn-calculate:hover,
.btn-login:hover,
.landing-primary-cta:hover,
.landing-demo-button:hover {
    background: #bd4f32;
    box-shadow: 0 10px 22px rgba(189, 79, 50, 0.25);
}

.btn-outline,
.btn-secondary,
.btn-ghost {
    border: 1px solid rgba(12, 112, 109, 0.32);
    background: transparent;
    color: var(--u5-teal-deep);
    box-shadow: none;
}

.btn-outline:hover,
.btn-secondary:hover,
.btn-ghost:hover {
    background: rgba(12, 112, 109, 0.09);
    color: var(--u5-teal-deep);
}

.btn-edit,
.btn-success { background: var(--u5-teal); }
.btn-delete,
.btn-danger { background: #b5423d; }

.form-group label,
.form-label {
    color: var(--u5-ink);
    font-weight: 650;
}

.form-group input,
.form-group select,
.form-group textarea,
.modal input,
.modal select,
.modal textarea {
    min-height: 44px;
    border: 1px solid var(--u5-line);
    border-radius: 9px;
    box-shadow: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.modal input:focus,
.modal select:focus,
.modal textarea:focus {
    border-color: var(--u5-teal);
    box-shadow: 0 0 0 3px rgba(12, 112, 109, 0.14);
    background: var(--u5-paper);
    color: var(--u5-ink);
}

.stat-card,
.assignment-summary-card,
.assignment-teacher-card,
.assignments-filters,
.group-item,
.teacher-item,
.career-item,
.grade-item {
    border-color: var(--u5-line);
    border-radius: 14px;
    box-shadow: 0 3px 12px rgba(23, 50, 77, 0.06);
}

.stat-card:hover,
.assignment-teacher-card:hover {
    border-color: rgba(12, 112, 109, 0.38);
    box-shadow: 0 10px 24px rgba(23, 50, 77, 0.10);
}

.stat-value,
.assignment-summary-card strong {
    font-variant-numeric: tabular-nums;
}

table,
.assignments-table {
    border: 1px solid var(--u5-line);
    border-radius: 14px;
    box-shadow: 0 3px 12px rgba(23, 50, 77, 0.05);
}

table th,
.assignments-table th,
.schedule-plus-table th,
.subjects-table th,
#communityTable th,
#scholarPaymentsTable th {
    background: var(--u5-teal-deep);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
}

table td,
.assignments-table td {
    border-bottom-color: rgba(23, 50, 77, 0.09);
}

table tbody tr:hover td,
.assignments-table tbody tr:hover td {
    background: rgba(12, 112, 109, 0.055);
}

.modal-overlay {
    background: rgba(23, 50, 77, 0.52);
    backdrop-filter: blur(3px);
}

.modal,
.modal-large,
.modal-small {
    background: var(--u5-paper);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(23, 50, 77, 0.26);
}

.modal h2 {
    color: var(--u5-ink);
    font-family: Georgia, "Times New Roman", serif;
    text-align: left;
    letter-spacing: -0.025em;
}

/* Landing: la misma paleta, jerarquía y tono de la plataforma autenticada. */
#loginOverlay {
    background: var(--u5-canvas);
}

.landing-page {
    width: min(1320px, 100%);
    gap: clamp(3rem, 7vw, 6rem);
}

.landing-shell {
    grid-template-columns: minmax(0, 0.88fr) minmax(440px, 1.12fr);
    min-height: min(780px, calc(100dvh - 2rem));
    padding: clamp(1rem, 3vw, 2.5rem);
    border-radius: 24px;
    background:
        radial-gradient(circle at 89% 14%, rgba(84, 166, 160, 0.22), transparent 32%),
        linear-gradient(120deg, #fffefa, #edf4f0);
    box-shadow: 0 18px 42px rgba(23, 50, 77, 0.10);
}

.landing-content { color: var(--u5-ink); }
.landing-brand strong,
.landing-copy h1 { color: var(--u5-ink); font-family: Georgia, "Times New Roman", serif; }
.landing-brand small,
.landing-kicker { color: var(--u5-teal); }
.landing-copy h1 { letter-spacing: -0.045em; }
.landing-copy p { color: #52697a; }
.landing-login-link,
.landing-secondary-cta { border-color: rgba(12, 112, 109, 0.28); color: var(--u5-teal-deep); background: rgba(255, 254, 250, 0.7); }
.landing-highlights span { border-color: rgba(12, 112, 109, 0.18); color: var(--u5-teal-deep); background: rgba(12, 112, 109, 0.07); }
.landing-product-image { filter: hue-rotate(96deg) saturate(0.72) drop-shadow(0 28px 46px rgba(23, 50, 77, 0.22)); mix-blend-mode: multiply; }
.landing-product-caption { color: var(--u5-ink); background: var(--u5-paper); }

@media (max-width: 900px) {
    .landing-shell { grid-template-columns: 1fr; }
    .landing-access { min-height: min(470px, 72vw); }
    .landing-product-visual { width: min(720px, 98vw); }
}

@media (max-width: 640px) {
    .main-content { padding: 1rem; }
    .landing-shell { min-height: auto; border-radius: 0; padding: 1.25rem; }
    .landing-content { gap: 2.5rem; }
    .landing-nav { align-items: flex-start; }
    .landing-nav-actions { flex-wrap: wrap; justify-content: flex-end; }
    .landing-access { min-height: 300px; }
}

@media (max-width: 768px) {
    .sidebar .theme-panel,
    .sidebar .portal-identity,
    .sidebar .sidebar-logo,
    .sidebar .active-tenant-bar,
    .sidebar .btn-logout span {
        display: none;
    }

    .sidebar-bottom {
        gap: 0.75rem;
        align-items: center;
    }

    .sidebar .btn-logout {
        width: 42px;
        min-width: 42px;
        min-height: 42px;
        padding: 0;
        border-radius: 10px;
    }
}

/* Vista expandida de un horario existente. */
.schedule-item .module-item {
    margin: 1rem 0 0;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(12, 112, 109, 0.2);
    border-radius: 12px;
    background: rgba(255, 254, 250, 0.82);
    box-shadow: none;
}

.schedule-item .module-item::before {
    top: -10px;
    left: -10px;
    width: 26px;
    height: 26px;
    background: var(--u5-teal-deep);
    box-shadow: 0 3px 8px rgba(6, 79, 80, 0.2);
}

.schedule-item .module-header {
    gap: 1rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(12, 112, 109, 0.14);
}

.schedule-item .module-header h4 {
    color: var(--u5-ink);
    font-size: 1rem;
}

.module-subjects-preview h5 {
    margin: 0 0 0.6rem;
    color: var(--u5-teal);
    font-size: 0.74rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.module-subjects-preview ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.65rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.module-subjects-preview li {
    display: grid;
    gap: 0.22rem;
    padding: 0.75rem 0.85rem;
    border-left: 3px solid var(--u5-coral);
    border-radius: 0 8px 8px 0;
    background: rgba(12, 112, 109, 0.055);
    color: var(--u5-ink);
    font-size: 0.86rem;
    line-height: 1.35;
}

@media (max-width: 640px) {
    .schedule-item .module-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .module-subjects-preview ul { grid-template-columns: 1fr; }
}

/* Grupos: oferta, matrícula y horario se leen como información separada. */
.groups-list {
    display: grid;
    gap: 0.85rem;
    margin-top: 1.25rem;
}

.groups-list .group-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    margin: 0;
    padding: 1rem 1.1rem;
    background: var(--u5-paper);
}

.group-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--u5-ink);
    cursor: pointer;
    text-align: left;
}

.group-title-copy {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.group-title-copy strong {
    overflow-wrap: anywhere;
    font-size: 1.03rem;
}

.group-title-copy span,
.group-summary-meta,
.group-students p {
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.45;
}

.group-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.8rem;
    margin-top: 0.55rem;
}

.group-summary-meta span + span::before {
    content: '·';
    margin-right: 0.8rem;
    color: var(--u5-coral);
}

.groups-list .group-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.groups-list .group-details {
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(12, 112, 109, 0.14);
}

.group-details-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    margin: 0;
}

.group-details-grid > div {
    padding: 0.7rem 0.75rem;
    border-radius: 9px;
    background: rgba(12, 112, 109, 0.055);
}

.group-details-grid dt {
    margin-bottom: 0.25rem;
    color: var(--u5-teal);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.group-details-grid dd {
    margin: 0;
    color: var(--u5-ink);
    font-size: 0.86rem;
    font-weight: 650;
}

.group-students {
    margin-top: 0.8rem;
}

.group-students h4 {
    margin-bottom: 0.25rem;
    color: var(--u5-ink);
    font-size: 0.9rem;
}

.group-students p { margin: 0; }

#crearGrupoModal .btn-cancel {
    border: 1px solid rgba(12, 112, 109, 0.34);
    background: transparent;
    color: var(--u5-teal-deep);
    box-shadow: none;
}

#crearGrupoModal .btn-cancel:hover {
    background: rgba(12, 112, 109, 0.08);
    color: var(--u5-teal-deep);
}

.teacher-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    background: var(--u5-paper);
}

.teacher-item-summary {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.teacher-item-summary strong {
    color: var(--u5-ink);
    overflow-wrap: anywhere;
}

.teacher-item-summary span {
    color: var(--text-secondary);
    font-size: 0.84rem;
}

@media (max-width: 640px) {
    .teacher-item { align-items: stretch; flex-direction: column; }
    .teacher-item .button-group { flex-wrap: wrap; }
    .teacher-item .button-group .btn { flex: 1 1 7rem; }
}

@media (max-width: 820px) {
    .groups-list .group-item { grid-template-columns: 1fr; }
    .groups-list .group-actions { justify-content: flex-start; }
}

@media (max-width: 640px) {
    .group-details-grid { grid-template-columns: 1fr; }
    .groups-list .group-actions .btn { flex: 1 1 7rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 1060px) {
    .landing-shell {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .landing-access {
        min-height: auto;
        display: grid;
        gap: 1.25rem;
    }

    .landing-product-visual,
    .login-card {
        position: relative;
        inset: auto;
        transform: none;
    }

    .landing-product-visual {
        width: min(760px, 100%);
    }

    .login-card {
        max-width: 520px;
        right: auto;
        bottom: auto;
        justify-self: center;
    }
}

@media (max-width: 760px) {
    .login-overlay {
        padding: 1rem;
    }

    .landing-shell,
    .landing-content {
        gap: 1.25rem;
    }

    .landing-nav,
    .landing-hero {
        grid-template-columns: 1fr;
    }

    .landing-nav {
        align-items: flex-start;
        flex-direction: column;
    }

    .landing-nav-actions {
        flex-wrap: wrap;
    }

    .landing-copy h1 {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .landing-copy p {
        font-size: 1rem;
        line-height: 1.65;
    }

    .landing-highlights {
        display: flex;
    }

    .login-card {
        padding: 1.5rem;
    }

    .landing-product-caption,
    .landing-floating-pill {
        display: none;
    }

    .sales-demo-grid {
        grid-template-columns: 1fr;
    }

    .sales-demo-dialog {
        padding: 1.25rem;
    }
}

.teacher-load-note {
    max-width: 58rem;
    margin: 0.5rem 0 1.25rem;
    padding: 0.85rem 1rem;
    border-left: 3px solid var(--accent-color);
    border-radius: 0 10px 10px 0;
    background: color-mix(in srgb, var(--accent-color) 8%, var(--bg-card));
    color: var(--text-secondary);
}

#teacherLoadCalculation .assignments-table td[colspan] {
    background: color-mix(in srgb, var(--primary-color) 7%, var(--bg-card));
    color: var(--primary-dark);
}

/* Cobros digitales: las pasarelas describen capacidad; las tablas, operación. */
.gateway-status-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin: 1.25rem 0;
}

.gateway-status-card {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    column-gap: 0.55rem;
    min-width: 10.8rem;
    padding: 0.78rem 0.9rem;
    border: 1px solid color-mix(in srgb, var(--primary-color) 14%, var(--border-color));
    border-radius: 10px;
    background: var(--bg-card);
    box-shadow: 0 6px 14px color-mix(in srgb, var(--primary-color) 6%, transparent);
}

.gateway-status-card small {
    grid-column: 2;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.gateway-dot {
    grid-row: span 2;
    inline-size: 0.52rem;
    block-size: 0.52rem;
    border-radius: 50%;
}

.online-payments-panel {
    margin-top: 1.25rem;
    padding: 1.2rem;
    border: 1px solid color-mix(in srgb, var(--primary-color) 12%, var(--border-color));
    border-radius: 14px;
    background: var(--bg-card);
    box-shadow: 0 9px 20px color-mix(in srgb, var(--primary-color) 6%, transparent);
}

.online-payments-panel-heading {
    margin-bottom: 0.9rem;
}

.online-payments-panel-heading h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.05rem;
    letter-spacing: -0.012em;
}

.online-payments-panel-heading p,
.online-payments-guidance {
    margin: 0.35rem 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.online-payments-guidance {
    max-width: 56rem;
    padding: 0.8rem 0 0.15rem;
}

.online-payments-panel .data-table th {
    color: #fffefa;
}

#studentOnlinePayments .data-table {
    min-width: 620px;
}

/* Acreedores: alta breve y expediente fiscal progresivo. */
#beneficiaries #beneficiaryForm {
    max-width: 64rem;
    margin: 1.45rem 0 1rem;
}

#beneficiaries .form-inline {
    display: flex;
    gap: 0.7rem;
    align-items: center;
}

#beneficiaries .form-inline input {
    min-width: 0;
    flex: 1 1 auto;
}

#beneficiaryList {
    display: grid;
    gap: 0.75rem;
    max-width: 64rem;
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;
}

.beneficiary-item,
.beneficiary-empty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid color-mix(in srgb, var(--primary-color) 12%, var(--border-color));
    border-radius: 12px;
    background: var(--bg-card);
    box-shadow: 0 7px 16px color-mix(in srgb, var(--primary-color) 6%, transparent);
}

.beneficiary-item strong,
.beneficiary-item small {
    display: block;
}

.beneficiary-item small,
.beneficiary-empty span {
    margin-top: 0.22rem;
    color: var(--text-secondary);
}

.beneficiary-item > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.beneficiary-empty {
    display: grid;
    justify-content: start;
    min-height: 6.7rem;
    align-content: center;
}

@media (max-width: 640px) {
    #beneficiaries .form-inline,
    .beneficiary-item {
        align-items: stretch;
        flex-direction: column;
    }

    #beneficiaries .form-inline .btn,
    .beneficiary-item > div .btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .gateway-status-card {
        flex: 1 1 100%;
    }

    .online-payments-panel {
        padding: 1rem;
    }
}

.sidebar-bottom {
    margin-top: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.btn-logout {
    background-color: #e74c3c;
    color: white;
    width: 100%;
}

.btn-logout:hover {
    background-color: #c0392b;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Modal-style Datepickers */
.datepicker-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(28, 30, 82, 0.6);
    z-index: 9999;
    display: none;
    backdrop-filter: blur(2px);
}

.daterangepicker,
#ui-datepicker-div {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    z-index: 10000 !important;
    border: none !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3) !important;
    padding: 10px !important;
}

/* Remove Arrows */
.daterangepicker:before,
.daterangepicker:after {
    display: none !important;
}

/* Adjustments for jQuery UI Datepicker in modal mode */
#ui-datepicker-div {
    background: #fff;
    border-radius: 8px;
    padding: 15px !important;
}

/* Sync Animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.btn-drive.syncing::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

/* =============================================
   Theme Controls
   ============================================= */
.theme-panel {
    width: 100%;
    display: grid;
    gap: 0.5rem;
    padding: 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background: rgba(248, 250, 252, 0.07);
}

.theme-mode-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem;
}

.theme-mode-toggle button,
.theme-accent-swatches button {
    min-height: 30px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--sidebar-text-muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
}

.theme-mode-toggle button.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #ffffff;
}

.theme-accent-swatches {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
}

.theme-accent-swatches button {
    position: relative;
    padding: 0;
}

.theme-accent-swatches button[data-theme-accent="violet"] {
    background: linear-gradient(135deg, #6417f2 0%, #22d3ee 100%);
}

.theme-accent-swatches button[data-theme-accent="blue"] {
    background: #2563eb;
}

.theme-accent-swatches button[data-theme-accent="green"] {
    background: #047857;
}

.theme-accent-swatches button[data-theme-accent="amber"] {
    background: #b45309;
}

.theme-accent-swatches button[data-theme-accent="rose"] {
    background: #be123c;
}

.theme-accent-swatches button.active {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-bottom .btn-ghost {
    color: rgba(255, 255, 255, 0.75);
    justify-content: flex-start;
    padding: 10px 16px;
}

.sidebar-bottom .btn-ghost:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.btn-logout {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #fca5a5 !important;
    justify-content: flex-start;
    gap: 10px;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #fca5a5 !important;
    transform: translateY(0) !important;
}

.portal-identity {
    display: grid;
    gap: 2px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(203, 213, 225, 0.18);
    border-radius: var(--border-radius-sm);
    background: rgba(248, 250, 252, 0.07);
}

.portal-identity span {
    font-size: 11px;
    color: var(--sidebar-text-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.portal-identity strong {
    color: var(--sidebar-text);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-identity small {
    color: var(--sidebar-text-muted);
}

.sidebar.collapsed .portal-identity {
    display: none;
}

.portal-panel {
    margin-bottom: 24px;
    padding: 20px;
    border: 1px solid rgba(124, 58, 237, 0.16);
    border-radius: var(--border-radius-sm);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.portal-panel:empty {
    display: none;
}

.portal-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.portal-panel-header h2 {
    margin: 2px 0 0;
    font-size: 20px;
}

.portal-eyebrow {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.portal-role-pill {
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--accent-light);
    color: var(--accent-color);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.portal-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.portal-action {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(124, 58, 237, 0.16);
    border-radius: var(--border-radius-sm);
    background: #ffffff;
    color: var(--text-primary);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.portal-action:hover {
    border-color: var(--accent-color);
    background: var(--accent-light);
}

.dark-mode .portal-panel {
    background: rgba(30, 41, 59, 0.72);
    border-color: rgba(148, 163, 184, 0.18);
}

.dark-mode .portal-identity {
    background: rgba(248, 250, 252, 0.07);
    border-color: rgba(203, 213, 225, 0.18);
}

.dark-mode .portal-action {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.22);
    color: #f8fafc;
}

.dark-mode .portal-action:hover {
    background: rgba(124, 58, 237, 0.22);
    border-color: rgba(167, 139, 250, 0.75);
}

/* =============================================
   Comprehensive Dark Mode Styles
   ============================================= */

/* Dark Mode - Cards and Surfaces */
.dark-mode .career-item,
.dark-mode .grade-item,
.dark-mode .subject-item,
.dark-mode .teacher-item {
    background: var(--bg-card);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.dark-mode .subjects-list {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .stat-card {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.07);
}

.dark-mode .stat-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(100, 23, 242, 0.55);
    box-shadow: 0 0 0 1px rgba(100, 23, 242, 0.3), 0 20px 40px rgba(0, 0, 0, 0.3);
}

.dark-mode .stat-value {
    color: #ffffff;
}

/* Dark Mode - Forms */
.dark-mode input,
.dark-mode select,
.dark-mode textarea,
.dark-mode .form-group input,
.dark-mode .form-group select,
.dark-mode .form-group textarea {
    background-color: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.dark-mode input:focus,
.dark-mode select:focus,
.dark-mode textarea:focus,
.dark-mode .form-group input:focus,
.dark-mode .form-group select:focus,
.dark-mode .form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(100, 23, 242, 0.22);
}

.dark-mode input::placeholder,
.dark-mode textarea::placeholder {
    color: var(--text-muted);
}

.dark-mode .form-group label,
.dark-mode .form-label {
    color: var(--text-secondary);
}

/* Dark Mode - Tables (contraste mejorado) */
.dark-mode table,
.dark-mode .assignments-table {
    background: var(--bg-card);
}

.dark-mode table th,
.dark-mode .assignments-table th,
.dark-mode #scholarPaymentsTable th {
    background: rgba(100, 23, 242, 0.22);
    color: #c4b5fd;
    font-weight: 700;
    border-bottom: 1px solid rgba(100, 23, 242, 0.35);
}

.dark-mode table td,
.dark-mode .assignments-table td,
.dark-mode #scholarPaymentsTable td {
    border-color: rgba(255, 255, 255, 0.06);
    color: #dbe3f7;
}

.dark-mode table tbody tr:hover td,
.dark-mode .assignments-table tbody tr:hover td,
.dark-mode #scholarPaymentsTable tbody tr:hover td {
    background: rgba(100, 23, 242, 0.14);
    color: #ffffff;
}

.dark-mode table tbody tr:hover,
.dark-mode .assignments-table tbody tr:hover {
    background: transparent;
}

.dark-mode table tbody tr:nth-child(even) td,
.dark-mode .assignments-table tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.025);
}

.dark-mode table tbody tr:nth-child(even):hover td,
.dark-mode .assignments-table tbody tr:nth-child(even):hover td {
    background: rgba(100, 23, 242, 0.14);
    color: #ffffff;
}

/* Dark Mode - Modal */
.dark-mode .modal-overlay {
    background-color: rgba(0, 0, 0, 0.7);
}

.dark-mode .modal {
    background: var(--bg-card);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.dark-mode .modal h2,
.dark-mode .modal h3 {
    color: var(--text-primary);
}

.dark-mode .modal input,
.dark-mode .modal select,
.dark-mode .modal textarea {
    background-color: var(--bg-body);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.dark-mode .modal input:focus,
.dark-mode .modal select:focus {
    border-color: var(--primary-color);
    background-color: var(--bg-body);
}

.dark-mode .teacher-subjects-summary,
.dark-mode .teacher-subject-career,
.dark-mode .teacher-subject-select-career,
.dark-mode .subject-assignment-list {
    background: var(--bg-body);
    border-color: rgba(255, 255, 255, 0.12);
}

.dark-mode .teacher-subject-career h4,
.dark-mode .teacher-subject-select-career h4 {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.dark-mode .teacher-subject-grade + .teacher-subject-grade,
.dark-mode .teacher-subject-select-grade + .teacher-subject-select-grade {
    border-color: rgba(255, 255, 255, 0.08);
}

.dark-mode .teacher-subject-row,
.dark-mode .teacher-subject-select-grade label {
    color: var(--text-primary);
}

.dark-mode .teacher-subjects-meta,
.dark-mode .teacher-subjects-modal-subtitle,
.dark-mode .teacher-subjects-empty,
.dark-mode .teacher-subject-grade h5,
.dark-mode .teacher-subject-select-grade h5 {
    color: var(--text-secondary);
}

/* Dark Mode - Headings */
.dark-mode h1,
.dark-mode h2,
.dark-mode h3,
.dark-mode h4 {
    color: var(--text-primary);
}

/* Dark Mode - Buttons */
.dark-mode .btn-outline {
    border-color: var(--primary-color);
    color: var(--primary-light);
}

.dark-mode .btn-outline:hover {
    background: var(--primary-color);
    color: var(--text-light);
}

.dark-mode .btn-ghost {
    color: var(--text-secondary);
}

.dark-mode .btn-ghost:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
}

/* Dark Mode - Datepicker */
.dark-mode #ui-datepicker-div,
.dark-mode .daterangepicker {
    background: var(--bg-card);
    color: var(--text-primary);
}

.dark-mode .daterangepicker td,
.dark-mode .ui-datepicker td {
    color: var(--text-primary);
}

.dark-mode .daterangepicker td.active,
.dark-mode .ui-datepicker .ui-state-active {
    background: var(--primary-color) !important;
    color: var(--text-light) !important;
}

/* Calendario "Días no laborales": siempre fondo claro y texto oscuro para legibilidad */
.dark-mode #multiDatePicker .ui-datepicker,
.dark-mode #multiDatePicker .ui-datepicker-group {
    background: #ffffff !important;
}

.dark-mode #multiDatePicker .ui-datepicker-header {
    background: #f1f5f9 !important;
    color: #1e293b !important;
}

.dark-mode #multiDatePicker .ui-datepicker-title {
    color: #0f172a !important;
}

.dark-mode #multiDatePicker .ui-datepicker th {
    background: #1e40af !important;
    color: #ffffff !important;
}

.dark-mode #multiDatePicker .ui-datepicker td a,
.dark-mode #multiDatePicker .ui-datepicker .ui-state-default {
    color: #1e293b !important;
    background: #f8fafc !important;
}

.dark-mode #multiDatePicker .ui-datepicker .ui-state-active,
.dark-mode #multiDatePicker .ui-datepicker td.ui-datepicker-current-day a {
    background: var(--primary-color) !important;
    color: #ffffff !important;
}

/* Dark Mode - Sidebar (already dark, minimal changes needed) */
.dark-mode .sidebar {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.dark-mode .sidebar .section-title {
    color: #cbd5e1;
    font-weight: 700;
}

/* Dark Mode - Login Overlay */
.dark-mode .login-overlay {
    background: #161d33;
}

.dark-mode .login-card {
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(2, 6, 23, 0.34);
}

.dark-mode .login-card h2 {
    color: #0f2742;
}

/* Dark Mode - Scrollbars */
.dark-mode ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.dark-mode ::-webkit-scrollbar-track {
    background: var(--bg-body);
}

.dark-mode ::-webkit-scrollbar-thumb {
    background: var(--bg-card-hover);
    border-radius: 5px;
}

.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Dark Mode - Selection */
.dark-mode ::selection {
    background: var(--primary-color);
    color: var(--text-light);
}

/* Dark Mode - Collapse Indicator */
.dark-mode .collapse-indicator {
    color: var(--text-secondary);
}

/* Dark Mode - Groups, Schedule Plus, and White Background Elements */
.dark-mode .group-item {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.15);
}

.dark-mode .group-info h3 {
    color: var(--text-primary);
}

.dark-mode .group-info p {
    color: var(--text-secondary);
}

.dark-mode .schedule-plus-container {
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
}

.dark-mode .schedule-plus-header h2 {
    color: var(--text-primary);
}

.dark-mode .schedule-plus-form .form-group label {
    color: var(--text-secondary);
}

.dark-mode .schedule-plus-table th {
    background: var(--primary-gradient);
    color: var(--text-light);
}

.dark-mode .schedule-plus-table td {
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.dark-mode .module-item {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.15);
}

.dark-mode .module-header h4 {
    color: var(--text-primary);
}

.dark-mode .module-details {
    background-color: rgba(59, 130, 246, 0.1);
}

.dark-mode .schedule-info {
    background-color: var(--bg-card-hover);
    color: var(--text-primary);
}

/* Dark Mode - Student Items */
.dark-mode .student-item {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.dark-mode .students-list {
    background-color: var(--bg-body);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Dark Mode - Group Subjects */
.dark-mode .group-subjects {
    background-color: rgba(59, 130, 246, 0.1);
}

.dark-mode .group-subjects h4 {
    color: var(--text-primary);
}

.dark-mode .group-subjects li {
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

/* Dark Mode - Assignment Items */
.dark-mode .assignment-item {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.15);
}

.dark-mode .assignment-header {
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .assignment-header h3 {
    color: var(--text-primary);
}

/* Dark Mode - Subjects Table */
.dark-mode .subjects-table th {
    background: var(--primary-gradient);
    color: var(--text-light);
}

.dark-mode .subjects-table td {
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.dark-mode .subjects-table tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

/* Transition for smooth theme switching */
body,
.main-content,
.modal,
input,
select,
textarea,
table,
.career-item,
.grade-item,
.subject-item,
.teacher-item,
.stat-card,
.subjects-list {
    transition: background-color var(--transition-speed) var(--ease-out),
        color var(--transition-speed) var(--ease-out),
        border-color var(--transition-speed) var(--ease-out);
}

/* =============================================
   Accesibilidad: focus visible
   ============================================= */
.btn:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.sidebar nav ul li button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* =============================================
   Responsividad
   ============================================= */
@media (max-width: 1024px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
        padding: 1rem 0.5rem;
    }

    .sidebar:not(.collapsed) {
        width: var(--sidebar-width);
    }

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

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

    .app-container {
        flex-wrap: nowrap;
    }

    .modal,
    .modal-large,
    .modal-small {
        width: calc(100vw - 2rem) !important;
        max-width: calc(100vw - 2rem) !important;
        max-height: calc(100dvh - 2rem);
        margin: 0;
        padding: 1.5rem;
    }

    .modal-content {
        grid-template-columns: 1fr;
    }

    .teacher-subjects-header {
        align-items: stretch;
        flex-direction: column;
    }

    .teacher-subjects-header .btn {
        width: 100%;
    }

    #createScheduleModal .modal-content,
    #editScheduleModal .modal-content {
        grid-template-columns: 1fr;
    }

    #createScheduleModal .schedule-builder-header,
    #createScheduleModal .schedule-builder-modules-header {
        flex-direction: column;
    }

    #createScheduleModal .schedule-builder-summary {
        justify-content: flex-start;
    }

    .classroom-form,
    .classroom-row {
        grid-template-columns: 1fr;
    }

    .classroom-form-actions,
    .classroom-row-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    #createScheduleModal .module-subjects li.subject-row-item {
        grid-template-columns: 1fr 1fr;
    }

    #createScheduleModal .schedule-period-grid,
    #createScheduleModal .schedule-ai-subject-hours-row,
    #createScheduleModal .schedule-ai-subject-line {
        grid-template-columns: 1fr;
    }

    #createScheduleModal .schedule-ai-proposal-card {
        grid-template-columns: 1fr;
    }

    #createScheduleModal .schedule-ai-subject-line {
        grid-template-areas:
            "time"
            "name"
            "hours"
            "teacher";
    }

    #createScheduleModal .subject-col-name,
    #createScheduleModal .subject-col-teacher,
    #createScheduleModal .subject-col-classroom,
    #createScheduleModal .subject-col-actions {
        grid-column: 1 / -1;
    }

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

    .quick-actions {
        flex-direction: column;
    }

.quick-actions .btn {
        width: 100%;
    }

    .schedule-page-hero {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .schedule-page-actions {
        justify-content: flex-start;
    }
}

/* Dashboard: a calm, academic work surface rather than a generic metric wall. */
.dashboard-header {
    max-width: 780px;
    margin-bottom: 1.65rem;
    padding: clamp(1.3rem, 2.5vw, 2rem);
    border: 1px solid rgba(12, 112, 109, 0.16);
    border-radius: 18px;
    background:
        radial-gradient(circle at 92% 8%, rgba(221, 101, 66, 0.11), transparent 30%),
        linear-gradient(125deg, rgba(12, 112, 109, 0.10), rgba(255, 253, 247, 0.72));
}

.dashboard-eyebrow {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--u5-teal-deep);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.dashboard-header h1 {
    max-width: 18ch;
    margin-bottom: 0.55rem;
    font-size: clamp(1.85rem, 3.3vw, 2.7rem);
}

.dashboard-subtitle {
    max-width: 66ch;
    line-height: 1.55;
}

.dashboard-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.85rem;
}

.dashboard-stat-link {
    width: 100%;
    min-height: 116px;
    padding: 1.05rem;
    border: 1px solid var(--u5-line);
    color: inherit;
    font: inherit;
    text-align: left;
}

.dashboard-stat-link .stat-icon {
    width: 42px;
    height: 42px;
    color: var(--u5-teal-deep);
    background: rgba(12, 112, 109, 0.10);
}

.dashboard-stat-teachers .stat-icon { background: rgba(75, 116, 85, 0.13); color: #3f7652; }
.dashboard-stat-payments .stat-icon { background: rgba(221, 101, 66, 0.12); color: #a94931; }
.dashboard-stat-groups .stat-icon { background: rgba(154, 119, 55, 0.13); color: #7e5d1d; }

.dashboard-stat-link:hover,
.dashboard-stat-link:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(12, 112, 109, 0.40);
}

.dashboard-stat-link:focus-visible {
    outline: 3px solid rgba(12, 112, 109, 0.22);
    outline-offset: 2px;
}

.dashboard-section {
    max-width: 780px;
    margin-bottom: 0;
    padding: 1.35rem 0 0;
    border-top-color: var(--u5-line);
}

.dashboard-section h2 {
    margin-bottom: 1rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.28rem, 2vw, 1.55rem);
    letter-spacing: -0.02em;
}

@media (max-width: 1050px) {
    .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .dashboard-header { padding: 1.2rem; border-radius: 14px; }
    .dashboard-stats { grid-template-columns: 1fr; }
    .dashboard-stat-link { min-height: 96px; }
}

/* Teachers: profile administration stays distinct from scheduling authorization. */
.section-eyebrow {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--u5-teal-deep);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.teachers-section-header {
    max-width: 860px;
}

.teachers-workspace {
    display: grid;
    gap: 1.25rem;
    max-width: 980px;
}

.teacher-create-card {
    display: grid;
    grid-template-columns: minmax(13rem, 0.7fr) minmax(18rem, 1fr);
    align-items: end;
    gap: 1.25rem;
    margin: 0;
    padding: 1.2rem;
    border: 1px solid var(--u5-line);
    border-radius: 14px;
    background: linear-gradient(125deg, rgba(12, 112, 109, 0.08), var(--u5-paper) 52%);
    box-shadow: 0 3px 12px rgba(23, 50, 77, 0.05);
}

.teacher-create-card h2,
.teachers-list-header h2 {
    margin: 0;
    color: var(--u5-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.teacher-create-card p,
.teachers-list-header p {
    max-width: 56ch;
    margin: 0.3rem 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.teacher-create-card .form-inline {
    align-items: stretch;
    margin: 0;
}

.teacher-create-card .form-inline input {
    width: auto;
    min-width: 0;
    margin: 0;
}

.teachers-list-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.25rem;
}

.teachers-list {
    display: grid;
    gap: 0.65rem;
    margin: 0 !important;
}

.teacher-item {
    min-height: 76px;
    margin: 0;
    border-left: 3px solid rgba(12, 112, 109, 0.34);
}

.teacher-item .button-group {
    align-items: center;
}

.teacher-item .btn-delete {
    border: 1px solid rgba(181, 66, 61, 0.36);
    background: transparent;
    color: #a33d39;
    box-shadow: none;
}

.teacher-item .btn-delete:hover {
    background: rgba(181, 66, 61, 0.08);
}

.teachers-empty-state {
    display: grid;
    gap: 0.35rem;
    padding: 1.4rem;
    border: 1px dashed rgba(12, 112, 109, 0.34);
    border-radius: 14px;
    background: rgba(255, 253, 247, 0.72);
    color: var(--text-secondary);
    line-height: 1.5;
}

.teachers-empty-state strong { color: var(--u5-ink); }

@media (max-width: 760px) {
    .teacher-create-card { grid-template-columns: 1fr; }
}

/* Teacher record: a contained, mobile-safe legacy modal surface. */
.teacher-details-overlay {
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.teacher-details-overlay .teacher-details-shell {
    width: min(1040px, 100%);
    max-width: 1040px;
    max-height: min(88dvh, 920px);
    margin: 0;
    overflow: auto;
    border-radius: 16px;
    background: var(--u5-paper);
    box-shadow: 0 22px 52px rgba(23, 50, 77, 0.28);
}

.teacher-details-shell .teacher-details-modal {
    display: block;
    width: 100%;
    max-width: none;
    max-height: none;
    overflow: visible;
}

.teacher-details-shell .modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem clamp(1rem, 2.5vw, 1.8rem);
    border-bottom: 1px solid var(--u5-line);
    border-radius: 0;
    background: linear-gradient(120deg, var(--u5-teal-deep), var(--u5-teal));
}

.teacher-details-shell .modal-header h2 { margin: 0.2rem 0 0; font-family: Georgia, "Times New Roman", serif; }
.teacher-details-shell .modal-header .close-btn { flex: 0 0 auto; min-height: 36px; padding: 0.45rem 0.7rem; border: 1px solid rgba(255,255,255,0.4); border-radius: 8px; background: transparent; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.teacher-details-shell .modal-body { padding: clamp(1rem, 2.5vw, 1.8rem); }

.teacher-details-context {
    display: grid;
    gap: 0.22rem;
    margin-bottom: 1rem;
    padding: 0.85rem 0.95rem;
    border-left: 3px solid var(--u5-coral);
    background: rgba(221, 101, 66, 0.07);
}

.teacher-details-context strong { color: var(--u5-ink); }
.teacher-details-context span { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.45; }

.teacher-details-shell .tabs {
    flex-direction: row !important;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--u5-line);
    overflow-x: auto;
}

.teacher-details-shell .tab-btn {
    flex: 0 0 auto;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 650;
}

.teacher-details-shell .tab-btn:hover,
.teacher-details-shell .tab-btn.active {
    border-color: rgba(12, 112, 109, 0.22);
    border-bottom-width: 1px;
    color: var(--u5-teal-deep);
    background: rgba(12, 112, 109, 0.09);
}

.teacher-details-shell .documentation-section,
.teacher-details-shell .subjects-history,
.teacher-details-shell .grades-history,
.teacher-details-shell .payments-history,
.teacher-details-shell .expediente-section,
.teacher-details-shell .invoices-section {
    color: var(--u5-ink);
    background: var(--u5-paper);
    border-color: var(--u5-line);
}

.teacher-details-shell .payments-history h4,
.teacher-details-shell .payment-summary,
.teacher-details-shell .summary-label,
.teacher-details-shell .summary-value {
    color: var(--u5-ink);
}

.teacher-details-shell .payment-summary { background: rgba(12, 112, 109, 0.08); }

@media (max-width: 640px) {
    .teacher-details-overlay { align-items: stretch; padding: 0.55rem; }
    .teacher-details-overlay .teacher-details-shell { max-height: calc(100dvh - 1.1rem); border-radius: 14px; }
}

@media (max-width: 768px) {
    .sidebar,
    .sidebar:not(.collapsed) {
        width: var(--sidebar-collapsed-width);
        padding: 0.75rem 0.5rem;
    }

    .sidebar .section-title,
    .sidebar nav ul li button span:not(.nav-icon),
    .sidebar .sidebar-logo,
    .sidebar .portal-identity,
    .sidebar .active-tenant-bar {
        display: none;
    }

    .sidebar nav ul li button {
        justify-content: center;
        padding: 11px;
    }

    .main-content,
    .sidebar:not(.collapsed) ~ .main-content {
        margin-left: var(--sidebar-collapsed-width);
        padding: 0.75rem 1rem;
    }

    .modal,
    .modal-large,
    .modal-small {
        width: calc(100vw - 1rem) !important;
        max-width: calc(100vw - 1rem) !important;
        max-height: calc(100dvh - 1rem);
        overflow: auto;
        margin: 0;
        padding: 1.25rem;
    }

    #createScheduleModal .schedule-builder-modal {
        width: calc(100vw - 1rem) !important;
    }

    #createScheduleModal .schedule-builder-layout,
    #createScheduleModal .schedule-builder-header,
    #createScheduleModal .schedule-builder-modules-header,
    #createScheduleModal #modulesList,
    #createScheduleModal .schedule-builder-actions {
        padding: 0.75rem;
    }

    #createScheduleModal .schedule-builder-layout {
        padding-bottom: 5rem;
    }

    #createScheduleModal .module-subjects li.subject-row-item {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    #createScheduleModal .schedule-ai-proposal-list,
    #createScheduleModal .schedule-period-grid,
    #createScheduleModal .schedule-ai-subject-hours-row,
    #createScheduleModal .schedule-ai-subject-line {
        grid-template-columns: 1fr;
    }

    #createScheduleModal .schedule-ai-proposal-card {
        grid-template-columns: 1fr;
    }

    #createScheduleModal .schedule-ai-subject-line {
        grid-template-areas:
            "time"
            "name"
            "hours"
            "teacher";
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .form-inline {
        flex-direction: column;
    }

    .form-inline input {
        width: 100%;
    }

    .login-card {
        padding: 1.5rem 1.25rem;
    }

    .schedule-page-hero,
    .schedule-empty-state {
        border-radius: 14px;
        padding: 1.25rem;
    }

    .schedule-page-actions,
    .schedule-page-actions .btn,
    .schedule-header,
    .button-group {
        width: 100%;
    }

    .schedule-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 1rem;
    }

    .button-group {
        flex-wrap: wrap;
    }

    .button-group .btn {
        flex: 1 1 8.5rem;
    }

    .schedule-guidance {
        grid-template-columns: 1fr;
    }

    .schedule-guidance > div + div {
        border-top: 1px solid rgba(12, 112, 109, 0.14);
        border-left: 0;
    }
}

/* Identidad institucional única: evita que preferencias antiguas restauren violeta. */
body[data-theme-accent] {
    --primary-color: #0c706d;
    --primary-light: #54a6a0;
    --primary-dark: #075754;
    --primary-gradient: linear-gradient(135deg, #0c706d 0%, #075754 100%);
    --accent-color: #0c706d;
    --accent-hover: #075754;
    --accent-light: rgba(12, 112, 109, 0.11);
    --accent-gradient: linear-gradient(135deg, #0c706d 0%, #075754 100%);
    --shadow-accent: 0 8px 18px rgba(12, 112, 109, 0.24);
}

.theme-light,
.theme-dark,
.dark-mode {
    --bg-sidebar: #064f50;
    --sidebar-text: #f7f5ef;
    --sidebar-text-muted: #b9d4d0;
    --sidebar-text-soft: #9abdb8;
    --sidebar-hover-bg: rgba(255, 254, 250, 0.11);
    --sidebar-active-text: #ffffff;
}

.theme-dark,
.dark-mode {
    --bg-body: #173a46;
    --bg-body-solid: #173a46;
    --bg-card: #1c4852;
    --bg-card-hover: #245761;
    --text-primary: #fffefa;
    --text-secondary: #d6e5e0;
    --text-muted: #adcac4;
    --bg-primary: #1c4852;
    --bg-secondary: #173a46;
    --field-bg: #153b44;
    --field-text: #fffefa;
    --field-placeholder: #b9d4d0;
}

/* Secciones de formulario (modal inscripción) */
.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(124, 58, 237, 0.12);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

/* ========== LMS ========== */
.lms-stats {
    margin-bottom: 2rem;
}

.lms-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.lms-filters select,
.lms-filters input {
    min-width: 180px;
}

.lms-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.lms-status-draft {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}

.lms-status-published {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.lms-status-archived {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.lms-editor-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.lms-tab.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.lms-editor-tab-content {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.lms-chapters-sidebar {
    min-width: 220px;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(124, 58, 237, 0.12);
}

.lms-chapters-sidebar h3 {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
}

.lms-chapters-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.lms-chapter-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 0.25rem;
}

.lms-chapter-item:hover,
.lms-chapter-item.selected {
    background: var(--accent-light);
    color: var(--primary-color);
}

.lms-lessons-area {
    flex: 1;
    min-width: 280px;
}

.lms-lessons-area ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.lms-lesson-item {
    padding: 0.6rem 1rem;
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    background: var(--bg-card);
    border: 1px solid rgba(124, 58, 237, 0.08);
}

.lms-lesson-item:hover {
    background: var(--accent-light);
    border-color: rgba(124, 58, 237, 0.2);
}

#lmsLessonEditor .form-group {
    margin-bottom: 1rem;
}

#lmsLessonEditor textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(124, 58, 237, 0.2);
}

/* LMS - Mis cursos y Catálogo */
.lms-course-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.lms-course-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid rgba(124, 58, 237, 0.12);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lms-course-card h3 {
    margin: 0;
    font-size: 1.1rem;
}

.lms-card-meta,
.lms-card-desc {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.lms-card-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lms-progress-bar-mini {
    flex: 1;
    height: 6px;
    background: rgba(124, 58, 237, 0.15);
    border-radius: 3px;
    overflow: hidden;
}

.lms-progress-bar-mini > div {
    height: 100%;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.lms-empty-msg {
    color: var(--text-secondary);
}

.lms-empty-msg a {
    color: var(--accent-color);
}

/* LMS - Vista de aprendizaje */
.lms-learn-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.lms-learn-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.lms-learn-header h2 {
    margin: 0;
    flex: 1;
}

.lms-progress-bar-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
}

.lms-learn-header .lms-progress-bar-container {
    flex: 1;
    max-width: 200px;
}

.lms-progress-track {
    flex: 1;
    height: 8px;
    background: rgba(124, 58, 237, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.lms-progress-bar-container .lms-progress-bar {
    height: 100%;
    background: var(--accent-color);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.lms-progress-bar-container span {
    font-size: 0.9rem;
    font-weight: 600;
}

.lms-learn-body {
    display: flex;
    gap: 1.5rem;
    flex: 1;
    min-height: 400px;
}

.lms-learn-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    border: 1px solid rgba(124, 58, 237, 0.12);
    max-height: 60vh;
    overflow-y: auto;
}

.lms-learn-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lms-learn-chapter {
    margin-bottom: 1rem;
}

.lms-learn-chapter-title {
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.5rem;
}

.lms-learn-chapter ul {
    padding-left: 0.75rem;
}

.lms-learn-lesson {
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.9rem;
}

.lms-learn-lesson:hover,
.lms-learn-lesson.active {
    background: var(--accent-light);
    color: var(--primary-color);
}

.lms-learn-lesson.done::before {
    content: "✓ ";
    color: var(--success-color);
}

.lms-learn-content {
    flex: 1;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    padding: 1.5rem;
    border: 1px solid rgba(124, 58, 237, 0.12);
    overflow-y: auto;
}

.lms-learn-empty {
    color: var(--text-muted);
    padding: 2rem;
    text-align: center;
}

.lms-learn-lesson-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

.lms-learn-video {
    margin-bottom: 1rem;
}

.lms-learn-video iframe,
.lms-learn-video video {
    border-radius: 8px;
}

.lms-learn-lesson-content {
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.lms-learn-activities {
    display: grid;
    gap: 0.75rem;
    margin: 0 0 1.5rem;
}

.lms-activity-card {
    padding: 1rem;
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: var(--border-radius-sm);
    background: rgba(124, 58, 237, 0.04);
}

.lms-activity-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.lms-activity-type {
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.lms-activity-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.lms-activity-card p {
    margin: 0;
    line-height: 1.5;
}

.lms-rubric {
    margin-top: 0.75rem;
}

.lms-rubric summary {
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 600;
}

.lms-rubric ul {
    display: grid;
    gap: 0.5rem;
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
}

.lms-rubric li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.15rem 0.75rem;
    padding: 0.65rem;
    border-radius: 6px;
    background: var(--bg-card);
}

.lms-rubric li p {
    grid-column: 1 / -1;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* PostgreSQL operation workspaces */
.ops-workspace {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ops-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

.ops-context {
    display: grid;
    gap: 0.25rem;
    max-width: 72ch;
    padding: 0.85rem 1rem;
    border-left: 3px solid var(--primary-color);
    background: color-mix(in srgb, var(--primary-color), transparent 94%);
    color: var(--text-primary);
}

.ops-context span {
    color: var(--text-secondary);
    line-height: 1.45;
}

.ops-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.6fr);
    gap: 1rem;
    align-items: start;
}

.ops-grid.two-columns {
    grid-template-columns: repeat(2, minmax(320px, 1fr));
}

.ops-grid.three-columns {
    grid-template-columns: repeat(3, minmax(260px, 1fr));
}

.ops-grid.single-column {
    grid-template-columns: 1fr;
}

.ops-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ops-kpi {
    display: grid;
    gap: 0.25rem;
    padding: 0.9rem;
    border-radius: 8px;
    border: 1px solid rgba(30, 41, 59, 0.12);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.ops-kpi span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.ops-kpi strong {
    color: var(--text-primary);
    font-size: 1.3rem;
}

.ops-card {
    background: var(--bg-card);
    border: 1px solid rgba(30, 41, 59, 0.12);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.ops-card h2 {
    font-size: 1rem;
    margin: 0 0 0.75rem;
    color: var(--text-primary);
}

.ops-filter-panel {
    box-shadow: none;
}

.ops-list-card {
    min-width: 0;
    overflow-x: auto;
}

.ops-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.ops-form-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
}

.ops-form-grid input,
.ops-form-grid select {
    width: 100%;
    min-height: 38px;
    border: 1px solid rgba(30, 41, 59, 0.14);
    border-radius: 6px;
    padding: 0.5rem 0.6rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.ops-table {
    min-width: 680px;
}

.ops-table th,
.ops-table td {
    vertical-align: middle;
}

.academic-governance-card .ops-table {
    width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
}

.academic-governance-card .ops-table th,
.academic-governance-card .ops-table td {
    min-width: 0;
    padding: 0.65rem;
    overflow-wrap: anywhere;
}

.ops-row-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ops-row-actions select {
    min-height: 34px;
    border-radius: 6px;
    border: 1px solid rgba(30, 41, 59, 0.14);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.ops-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 0.5rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
    font-size: 0.78rem;
    font-weight: 700;
}

.ops-status-muted {
    background: rgba(100, 116, 139, 0.12);
    color: var(--text-secondary);
}

.ops-empty,
.ops-error {
    margin: 0;
    padding: 1rem;
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-secondary);
}

.ops-error {
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.18);
}

.ops-modal {
    width: min(980px, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ops-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.ops-modal .modal-header h2 {
    margin: 0;
    min-width: 0;
    text-align: left;
    overflow-wrap: anywhere;
}

.ops-modal .modal-body {
    min-height: 0;
    overflow: auto;
    padding-right: 0.15rem;
}

.ops-modal .close {
    border: none;
    background: transparent;
    color: inherit;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
}

.ops-modal-form {
    display: grid;
    gap: 1rem;
}

.ops-dropzone {
    display: grid;
    gap: 0.25rem;
    padding: 1rem;
    border: 1px dashed color-mix(in srgb, var(--accent-color), transparent 35%);
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent-color), transparent 92%);
    color: var(--text-primary);
    cursor: pointer;
}

.ops-dropzone span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.ops-dropzone.is-active {
    border-style: solid;
    background: color-mix(in srgb, var(--accent-color), transparent 84%);
}

.ops-alert {
    padding: 0.75rem 0.9rem;
    border-radius: 8px;
    border: 1px solid rgba(30, 41, 59, 0.12);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.92rem;
}

.ops-alert-success {
    border-color: color-mix(in srgb, var(--success-color), transparent 62%);
    background: color-mix(in srgb, var(--success-color), transparent 90%);
}

.ops-alert-warning {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.12);
}

.ops-alert-danger {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.12);
}

.ops-workqueue-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid rgba(30, 41, 59, 0.12);
    box-shadow: var(--shadow-sm);
}

.ops-workqueue-summary h2 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.ops-workqueue-summary p {
    margin: 0;
    color: var(--text-secondary);
}

.ops-workqueue-totals {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ops-workqueue-totals span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 30px;
    padding: 0 0.65rem;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.06);
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.ops-workqueue-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    gap: 1rem;
}

.ops-workqueue-card {
    display: grid;
    gap: 0.75rem;
}

.ops-workqueue-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.ops-workqueue-card-header h2 {
    margin: 0 0 0.15rem;
    font-size: 0.98rem;
}

.ops-workqueue-card-header span,
.ops-workqueue-item small {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.ops-workqueue-card-header strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 28px;
    border-radius: 999px;
    background: var(--accent-light);
    color: var(--accent-color);
}

.ops-workqueue-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 0;
    border-top: 1px solid rgba(30, 41, 59, 0.1);
}

.ops-workqueue-item strong,
.ops-workqueue-item small {
    display: block;
    margin-top: 0.2rem;
}

.ops-workqueue-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.ops-severity {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.ops-severity-high {
    background: rgba(239, 68, 68, 0.12);
    color: var(--error-color);
}

.ops-severity-medium {
    background: rgba(245, 158, 11, 0.14);
    color: #a16207;
}

.ops-workqueue-empty {
    display: block;
    padding: 0.6rem 0;
}

.ops-event-detail {
    display: grid;
    gap: 1rem;
}

.ops-json {
    margin: 0;
    max-height: 220px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 0.75rem;
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.06);
    color: var(--text-primary);
    font-size: 0.78rem;
    line-height: 1.45;
}

.document-checklist {
    display: grid;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.document-check-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(30, 41, 59, 0.12);
    border-radius: 8px;
    background: var(--bg-card);
}

.document-check-item small {
    display: block;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.document-check-item.uploaded {
    border-left: 4px solid var(--success-color);
}

.document-check-item.missing {
    border-left: 4px solid rgba(245, 158, 11, 0.75);
}

.document-upload-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) auto;
    gap: 0.75rem;
    align-items: center;
}

.academic-record-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}

.academic-record-summary span {
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid rgba(30, 41, 59, 0.12);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@media (max-width: 760px) {
    .document-upload-row,
    .academic-record-summary {
        grid-template-columns: 1fr;
    }

    .academic-governance-card .ops-table {
        min-width: 0 !important;
        table-layout: fixed;
    }

    .academic-governance-card .ops-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .academic-governance-card .ops-table tbody {
        display: grid;
        gap: 0.6rem;
    }

    .academic-governance-card .ops-table tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: hidden;
        border: 1px solid var(--u5-line);
        border-radius: 10px;
    }

    .academic-governance-card .ops-table tbody td {
        display: grid;
        gap: 0.16rem;
        min-width: 0;
        padding: 0.7rem;
        border: 0;
        border-bottom: 1px solid rgba(23, 50, 77, 0.08);
        color: var(--text-primary);
    }

    .academic-governance-card .ops-table tbody td:nth-child(odd) {
        border-right: 1px solid rgba(23, 50, 77, 0.08);
    }

    .academic-governance-card .ops-table tbody td:nth-last-child(-n + 2) {
        border-bottom: 0;
    }

    .academic-governance-card .ops-table tbody td::before {
        content: attr(data-label);
        color: var(--text-secondary);
        font-size: 0.69rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .institutional-events-card .ops-table {
        min-width: 0 !important;
        table-layout: fixed;
    }

    .institutional-events-card .ops-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .institutional-events-card .ops-table tbody {
        display: grid;
        gap: 0.65rem;
    }

    .institutional-events-card .ops-table tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: hidden;
        border: 1px solid var(--u5-line);
        border-radius: 10px;
    }

    .institutional-events-card .ops-table tbody td {
        display: grid;
        gap: 0.2rem;
        min-width: 0;
        padding: 0.7rem;
        border: 0;
        border-bottom: 1px solid rgba(23, 50, 77, 0.08);
        overflow-wrap: anywhere;
    }

    .institutional-events-card .ops-table tbody td:nth-child(odd) {
        border-right: 1px solid rgba(23, 50, 77, 0.08);
    }

    .institutional-events-card .ops-table tbody td:nth-last-child(-n + 2) {
        border-bottom: 0;
    }

    .institutional-events-card .ops-table tbody td::before {
        content: attr(data-label);
        color: var(--text-secondary);
        font-size: 0.69rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }
}

.ops-combobox {
    position: relative;
}

.ops-combobox input[type="text"] {
    width: 100%;
}

.ops-combobox-list {
    display: none;
    position: absolute;
    z-index: var(--z-popover);
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid rgba(30, 41, 59, 0.18);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 0.25rem;
}

.ops-combobox-list.visible {
    display: grid;
}

.ops-combobox-list button {
    border: none;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    padding: 0.55rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
}

.ops-combobox-list button:hover,
.ops-combobox-list button:focus {
    background: var(--accent-light);
    color: var(--accent-color);
    outline: none;
}

.dark-mode .ops-combobox-list {
    background: var(--bg-card);
    border-color: rgba(148, 163, 184, 0.22);
}

.teacher-candidate-list {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.6rem;
    max-height: 260px;
    overflow-y: auto;
}

.teacher-candidate-card {
    border: 1px solid rgba(30, 41, 59, 0.12);
    border-left-width: 4px;
    border-radius: 8px;
    padding: 0.55rem;
    background: var(--bg-card);
}

.teacher-candidate-card.available {
    border-left-color: var(--success-color);
}

.teacher-candidate-card.conflict {
    border-left-color: var(--warning-color);
}

.teacher-candidate-card.outside_availability {
    border-left-color: var(--text-muted);
}

.teacher-candidate-card button {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0;
    cursor: pointer;
    text-align: left;
    font: inherit;
}

.teacher-candidate-card button span {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.teacher-candidate-card small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-secondary);
}

.teacher-candidate-card details {
    margin-top: 0.45rem;
    color: var(--text-secondary);
}

.teacher-conflict-item {
    display: grid;
    gap: 0.15rem;
    padding: 0.45rem 0;
    border-top: 1px solid rgba(30, 41, 59, 0.1);
}

.teacher-candidate-empty,
.teacher-candidate-error {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.teacher-candidate-error {
    color: var(--danger-color);
}

.dark-mode .ops-card,
.dark-mode .ops-empty,
.dark-mode .ops-error {
    background: var(--bg-card);
    border-color: rgba(148, 163, 184, 0.16);
}

.dark-mode .ops-form-grid input,
.dark-mode .ops-form-grid select,
.dark-mode .ops-row-actions select {
    background: var(--bg-secondary);
    border-color: rgba(148, 163, 184, 0.18);
    color: var(--text-primary);
}

@media (max-width: 1180px) {
    .ops-grid,
    .ops-grid.two-columns,
    .ops-grid.three-columns,
    .ops-kpi-grid,
    .ops-workqueue-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .assignments-summary,
    .assignments-filters {
        grid-template-columns: 1fr 1fr;
    }

    .assignment-checkbox-filter {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .assignments-summary,
    .assignments-filters {
        grid-template-columns: 1fr;
    }

    .assignment-teacher-header,
    .assignment-career-block summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .assignment-teacher-metrics {
        justify-content: flex-start;
    }

    .ops-form-grid {
        grid-template-columns: 1fr;
    }

    .ops-workqueue-summary,
    .ops-workqueue-item {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .ops-workqueue-totals,
    .ops-workqueue-meta {
        justify-content: flex-start;
    }
}

/* ── Pagos en línea — gateways ─────────────────────────────────────────── */

.gateway-status-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    font-size: .875rem;
}

.gateway-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #adb5bd;
    flex-shrink: 0;
}
.gateway-dot.ok   { background: #28a745; }
.gateway-dot.warn { background: #ffc107; }
.gateway-dot.off  { background: #dc3545; }

.badge-gateway, .badge-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-stripe  { background: #635bff22; color: #635bff; }
.badge-conekta { background: #00338422; color: #003384; }
.badge-digitalfemsa { background: #e6000022; color: #c00; }

.badge-paid    { background: #d4edda; color: #155724; }
.badge-pending { background: #fff3cd; color: #856404; }
.badge-failed  { background: #f8d7da; color: #721c24; }

.badge-unknown { background: rgba(23, 50, 77, 0.09); color: var(--u5-ink); }

.student-payment-dialog { width: min(620px, calc(100vw - 2rem)); max-width: 620px; }
.student-payment-content { display: grid; grid-template-columns: 1fr; gap: 0.85rem; }
.student-payment-content .form-group { margin: 0; }
.student-payment-student { margin: 0; padding: 0.75rem 0.9rem; border-left: 3px solid var(--u5-coral); background: rgba(221, 101, 66, 0.07); color: var(--text-secondary); }
.student-payment-student strong { color: var(--u5-ink); }
.student-payment-talonario { margin: 0; padding: 0.9rem; border: 1px solid var(--u5-line); border-radius: 10px; background: rgba(12, 112, 109, 0.04); }
.student-payment-talonario h3 { margin: 0 0 0.6rem; color: var(--u5-ink); font-size: 0.95rem; }
#spTalonarioList { max-height: 13rem; overflow-y: auto; padding: 0.15rem; }
.student-payment-dialog .modal-buttons { margin-top: 0.3rem; }

@media (max-width: 640px) {
    #studentOnlinePayments .data-table { min-width: 0; }
    #studentOnlinePayments .online-payments-panel .data-table thead { display: none; }
    #studentOnlinePayments .online-payments-panel .data-table,
    #studentOnlinePayments .online-payments-panel .data-table tbody,
    #studentOnlinePayments .online-payments-panel .data-table tr,
    #studentOnlinePayments .online-payments-panel .data-table td { display: block; width: 100%; }
    #studentOnlinePayments .online-payments-panel .data-table tr {
        margin-bottom: 0.75rem;
        padding: 0.75rem;
        border: 1px solid var(--u5-line);
        border-radius: 10px;
        background: var(--u5-paper);
    }
    #studentOnlinePayments .online-payments-panel .data-table td {
        display: grid;
        grid-template-columns: minmax(6.5rem, 0.7fr) 1fr;
        gap: 0.65rem;
        padding: 0.42rem 0;
        border: 0;
        text-align: left;
    }
    #studentOnlinePayments .online-payments-panel .data-table td::before {
        content: attr(data-label);
        color: var(--text-secondary);
        font-size: 0.76rem;
        font-weight: 700;
    }
    #studentOnlinePayments .online-payments-panel .data-table td[colspan] {
        display: block;
        text-align: center;
    }
    #studentOnlinePayments .online-payments-panel .data-table td[colspan]::before { content: none; }
}

/* ── Talonario de conceptos ────────────────────────────────────────────── */

.talonario-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 5px;
    margin-bottom: 4px;
    font-size: .85rem;
    cursor: pointer;
}

.talonario-pendiente {
    background: #fff8e1;
    border: 1px solid #ffe082;
}
.talonario-pendiente:hover { background: #fff3cd; }

.talonario-pagado {
    background: #f1f8f1;
    border: 1px solid #c3e6cb;
    cursor: default;
    opacity: .85;
}

.talonario-concept { flex: 1; font-weight: 500; }
.talonario-amount  { font-weight: 700; white-space: nowrap; }
.talonario-group   { font-size: .75rem; color: #666; white-space: nowrap; }
.talonario-due     { font-size: .75rem; color: #c0392b; white-space: nowrap; }
.talonario-badge-paid {
    font-size: .72rem;
    color: #155724;
    background: #d4edda;
    padding: 1px 6px;
    border-radius: 10px;
    white-space: nowrap;
}

/* ── Catálogo de conceptos de pago ─────────────────────────────────────── */

#paymentConceptsConfig {
    display: grid;
    gap: 1rem;
}

.pc-toolbar { margin-bottom: 16px; }

.pc-period-card {
    border: 1px solid var(--u5-line);
    border-radius: 14px;
    padding: 1rem;
    background: var(--u5-paper);
    box-shadow: 0 3px 12px rgba(23, 50, 77, 0.05);
}

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

.pc-period-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pc-period-title strong { color: var(--u5-ink); }

.pc-badge-active {
    background: color-mix(in srgb, var(--primary-color), transparent 88%);
    color: var(--primary-color);
    font-size: .72rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

.pc-concept-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: transparent;
    box-shadow: none;
    font-size: .86rem;
}
.pc-concept-table th {
    background: color-mix(in srgb, var(--primary-color), transparent 93%);
    color: var(--text-secondary);
    padding: 0.55rem 0.6rem;
    text-align: left;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--u5-line);
}
.pc-concept-table td {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid rgba(23, 50, 77, 0.08);
    vertical-align: middle;
}

.pc-concept-table input,
.pc-concept-table select {
    width: 100%;
    min-height: 2.25rem;
    border: 1px solid rgba(23, 50, 77, 0.16);
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font: inherit;
}

.pc-empty {
    display: grid;
    gap: 0.3rem;
    max-width: 48rem;
    padding: 1.05rem 1.15rem;
    border-left: 3px solid var(--u5-coral);
    background: color-mix(in srgb, var(--u5-coral), transparent 93%);
}

.pc-empty span { color: var(--text-secondary); line-height: 1.5; }

.pc-add-concept { margin-top: 0.75rem; }

.pc-delete-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.formats-workspace {
    display: grid;
    grid-template-columns: minmax(18rem, 0.9fr) minmax(22rem, 1.35fr);
    gap: 1rem;
    align-items: start;
}

.formats-editor,
.formats-list {
    display: grid;
    gap: 0.9rem;
}

.formats-editor {
    padding: 1rem;
    border: 1px solid var(--u5-line);
    border-radius: 14px;
    background: var(--u5-paper);
    box-shadow: 0 3px 12px rgba(23, 50, 77, 0.05);
}

.formats-editor textarea {
    min-height: 15rem;
    resize: vertical;
}

.formats-editor-actions,
.format-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.format-item,
.formats-empty {
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid var(--u5-line);
    border-radius: 14px;
    background: var(--u5-paper);
    box-shadow: 0 3px 12px rgba(23, 50, 77, 0.05);
}

.format-item {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.formats-list .format-item {
    display: grid;
    margin: 0;
    border-color: var(--u5-line);
    border-radius: 14px;
    background: var(--u5-paper);
}

.format-info h3 {
    margin: 0;
    color: var(--u5-ink);
    font-size: 1rem;
}

.format-info p {
    display: -webkit-box;
    margin: 0.45rem 0 0;
    overflow: hidden;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.formats-empty {
    border-left: 3px solid var(--u5-coral);
    background: color-mix(in srgb, var(--u5-coral), transparent 93%);
}

.formats-empty span { color: var(--text-secondary); line-height: 1.5; }

@media (max-width: 880px) {
    .formats-workspace { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .format-item { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .pc-period-card { padding: 0.85rem; }

    .pc-period-header { align-items: flex-start; }

    .pc-concept-table,
    .pc-concept-table tbody,
    .pc-concept-table tr,
    .pc-concept-table td { display: block; }

    .pc-concept-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .pc-concept-table tbody {
        display: grid;
        gap: 0.65rem;
    }

    .pc-concept-table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: hidden;
        border: 1px solid var(--u5-line);
        border-radius: 10px;
    }

    .pc-concept-table td {
        min-width: 0;
        padding: 0.65rem;
        border: 0;
        border-bottom: 1px solid rgba(23, 50, 77, 0.08);
    }

    .pc-concept-table td:nth-child(odd) {
        border-right: 1px solid rgba(23, 50, 77, 0.08);
    }

    .pc-concept-table td:nth-child(5) {
        grid-column: 1 / -1;
        border-bottom: 0;
    }

    .pc-concept-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.22rem;
        color: var(--text-secondary);
        font-size: 0.69rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .pc-concept-table td:nth-child(5) .btn-icon {
        position: static;
        display: inline-flex;
        align-items: center;
        gap: 0.3rem;
        padding: 0.35rem 0.45rem;
        border: 1px solid rgba(193, 65, 57, 0.28);
        color: var(--error-color);
    }

    .pc-concept-table td:nth-child(5) .pc-delete-label {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        overflow: visible;
        clip: auto;
        white-space: normal;
    }
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent, #0d6efd);
    cursor: pointer;
    font-size: .85rem;
    padding: 0;
    text-decoration: underline;
}
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: .85rem;
    padding: 2px 5px;
    border-radius: 4px;
}
.btn-icon:hover { color: #c0392b; background: #fdf0ee; }

.btn-concept-assign {
    padding: 4px 10px;
    border: 1px solid #0d6efd;
    border-radius: 14px;
    background: #e8f0fe;
    color: #0d6efd;
    font-size: .8rem;
    cursor: pointer;
    white-space: nowrap;
}
.btn-concept-assign:hover { background: #0d6efd; color: #fff; }

/* ── Ajustes del talonario ─────────────────────────────────────────────── */

.adj-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: .72rem;
    font-weight: 600;
    margin-right: 4px;
}
.adj-descuento { background: #fff3cd; color: #856404; }
.adj-beca      { background: #d1ecf1; color: #0c5460; }
.adj-promocion { background: #d4edda; color: #155724; }

/* ── Super Admin: tenant cards ─────────────────────────────────────────── */

.tenants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.tenant-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}

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

.tenant-card-header strong { font-size: 1rem; }

.tenant-status {
    font-size: .72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
}
.tenant-active    { background: #d4edda; color: #155724; }
.tenant-trial     { background: #fff3cd; color: #856404; }
.tenant-suspended { background: #f8d7da; color: #721c24; }

.tenant-plan {
    font-size: .72rem;
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.tenant-name   { font-size: .85rem; color: #555; margin: 0; }

.tenant-domains {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: .78rem;
    color: #666;
}

.tenant-stats {
    display: flex;
    gap: 12px;
    font-size: .8rem;
    color: #777;
    padding: 6px 0;
    border-top: 1px solid #f0f0f0;
}

.tenant-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.tenant-actions .btn-sm,
.tenant-actions a.btn-sm {
    padding: 4px 10px;
    font-size: .78rem;
    border-radius: 5px;
    text-decoration: none;
}

/* ── Multi-tenant: selector de escuela y barra de escuela activa ─────────── */
.tenant-selector-card { max-width: 520px; }
.tenant-selector-hint { color: #64748b; font-size: 0.9rem; margin: -0.25rem 0 1.25rem; text-align: center; }
.tenant-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.tenant-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: 3px solid var(--primary-color, #1a3c5e);
    border-radius: 10px;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
}
.tenant-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.1); }
.tenant-card-logo { width: 48px; height: 48px; object-fit: contain; }
.tenant-card-badge {
    width: 48px; height: 48px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 1rem;
}
.tenant-card-name { font-size: 0.85rem; font-weight: 600; color: #1e293b; text-align: center; }

.active-tenant-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0;
    background: rgba(255,255,255,0.08);
    border-radius: 8px;
    font-size: 0.8rem;
}
.active-tenant-label { opacity: 0.7; text-transform: uppercase; letter-spacing: .04em; font-size: 0.68rem; }
.active-tenant-name { font-weight: 700; }
.btn-change-school {
    margin-left: auto;
    background: transparent;
    border: 1px solid currentColor;
    color: inherit;
    border-radius: 6px;
    padding: 0.15rem 0.5rem;
    font-size: 0.72rem;
    cursor: pointer;
}
.btn-change-school:hover { background: rgba(255,255,255,0.15); }

/* Nombre de marca (plataforma o escuela) bajo el logo del login */
.login-brand-name {
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    opacity: 1;
    margin: 0 0 1.5rem;
}

/* ── Capa modal unificada: horarios y docentes ─────────────────────────── */
body.modal-is-open {
    overflow: hidden;
}

.modal-overlay {
    overscroll-behavior: contain;
}

.modal-rebuilt {
    --modal-surface: var(--bg-card, #ffffff);
    --modal-line: rgba(30, 41, 59, 0.14);
    width: min(980px, calc(100vw - 2rem));
    max-width: min(980px, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem);
    min-width: 0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--modal-line);
    border-radius: 16px;
    background: var(--modal-surface);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24);
}

.modal-rebuilt .modal-dialog-header,
.modal-rebuilt .schedule-builder-header {
    flex: 0 0 auto;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--modal-line);
    background: var(--modal-surface);
}

.modal-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.modal-dialog-kicker {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.modal-dialog-header h2,
.modal-rebuilt .schedule-builder-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: clamp(1.2rem, 2vw, 1.45rem);
    line-height: 1.2;
    text-align: left;
}

.modal-dialog-header p {
    max-width: 58rem;
    margin: 0.35rem 0 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.45;
}

.modal-close {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--modal-line);
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.modal-close:hover {
    background: rgba(30, 41, 59, 0.06);
}

.modal-rebuilt > .modal-content:not(.schedule-builder-layout) {
    flex: 1 1 auto;
    min-height: 0;
    padding: 1.25rem;
    overflow: auto;
}

.modal-rebuilt .modal-buttons {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin: 0;
    padding: 0.9rem 1.25rem;
    border-top: 1px solid var(--modal-line);
    background: var(--modal-surface);
}

.modal-rebuilt .modal-buttons .btn {
    min-width: 132px;
    min-height: 44px;
    margin: 0;
}

.modal-rebuilt :is(button, input, select, textarea):focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

.teacher-edit-modal {
    width: min(1060px, calc(100vw - 2rem));
    max-width: min(1060px, calc(100vw - 2rem));
}

.teacher-edit-layout {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: start;
    gap: 1rem;
}

.modal-section {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--modal-line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--modal-surface) 94%, var(--bg-body, #f8fafc));
}

.modal-section h3 {
    margin: 0 0 0.85rem;
    color: var(--text-primary);
    font-size: 0.98rem;
}

.modal-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.modal-field-grid .form-group {
    min-width: 0;
    margin: 0;
}

.modal-field-grid .form-group label {
    display: block;
    margin: 0 0 0.35rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
}

.modal-field-grid .form-group label span {
    color: var(--text-secondary);
    font-weight: 500;
}

.modal-field-grid .form-group input {
    min-height: 44px;
    margin: 0;
    border-width: 1px;
    border-color: var(--modal-line);
    border-radius: 8px;
}

.modal-field-wide {
    grid-column: 1 / -1;
}

.teacher-edit-layout .teacher-subjects-panel {
    margin: 0;
}

.teacher-edit-layout .teacher-subjects-header p:not(.teacher-subjects-meta) {
    margin: 0.3rem 0 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.4;
}

.teacher-edit-layout .teacher-subjects-summary {
    max-height: min(42dvh, 420px);
}

.teacher-edit-modal.is-create-teacher .modal-section-form .form-group:not(:first-child),
.teacher-edit-modal.is-create-teacher .teacher-subjects-panel {
    display: none;
}

.teacher-edit-modal.is-create-teacher .teacher-edit-layout {
    grid-template-columns: minmax(0, 1fr);
}

.teacher-edit-modal.is-create-teacher .modal-section-form {
    max-width: 620px;
}

.teacher-subjects-modal {
    width: min(980px, calc(100vw - 2rem));
    max-width: min(980px, calc(100vw - 2rem));
}

.teacher-subjects-modal .subject-assignment-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    margin: 0;
    padding: 1.1rem 1.25rem;
    overflow: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.schedule-builder-modal.modal-rebuilt {
    width: min(1180px, calc(100vw - 2rem));
    max-width: min(1180px, calc(100vw - 2rem));
}

.schedule-builder-header-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.75rem;
}

#createScheduleModal .schedule-builder-layout {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    padding: 1rem;
    overflow: auto;
    scroll-padding-bottom: 1rem;
}

#createScheduleModal .schedule-builder-actions {
    position: relative;
    z-index: 1;
}

#createScheduleModal .schedule-builder-actions .btn {
    min-width: 148px;
}

#createScheduleModal #modulesList {
    min-width: 0;
    padding: 0.95rem;
}

#createScheduleModal .module-subjects li.subject-row-item {
    min-width: 0;
}

.classroom-modal {
    width: min(1040px, calc(100vw - 2rem));
    max-width: min(1040px, calc(100vw - 2rem));
}

.classroom-modal #classroomsManager {
    flex: 1 1 auto;
    min-height: 0;
    padding: 1rem 1.25rem;
    overflow: auto;
}

.schedule-edit-modal {
    width: min(1180px, calc(100vw - 2rem));
    max-width: min(1180px, calc(100vw - 2rem));
}

.schedule-edit-layout {
    grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.4fr);
    align-items: start;
    gap: 1rem;
}

.schedule-edit-layout .modal-left,
.schedule-edit-layout .modal-right {
    min-width: 0;
    flex: auto;
}

.modal-calendar {
    width: min(720px, calc(100vw - 2rem));
    max-width: min(720px, calc(100vw - 2rem));
}

.modal-calendar #multiDatePicker {
    flex: 1 1 auto;
    min-height: 0;
    padding: 1rem 1.25rem;
    overflow: auto;
}

.dark-mode .modal-rebuilt {
    --modal-surface: var(--bg-card);
    --modal-line: rgba(255, 255, 255, 0.14);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.54);
}

.dark-mode .modal-rebuilt .modal-section,
.dark-mode .teacher-subjects-modal .subject-assignment-list {
    background: var(--bg-body);
}

.dark-mode .modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 960px) {
    #createScheduleModal .schedule-builder-layout,
    .schedule-edit-layout,
    .teacher-edit-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    #createScheduleModal .schedule-builder-panel {
        min-width: 0;
    }

    .teacher-edit-layout .teacher-subjects-summary {
        max-height: 320px;
    }
}

@media (max-width: 640px) {
    .modal-overlay {
        align-items: stretch;
        padding: 0.5rem;
    }

    .modal-rebuilt,
    .schedule-builder-modal.modal-rebuilt,
    .teacher-edit-modal,
    .teacher-subjects-modal,
    .classroom-modal,
    .schedule-edit-modal,
    .modal-calendar {
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 12px;
    }

    .modal-rebuilt .modal-dialog-header,
    .modal-rebuilt .schedule-builder-header {
        padding: 0.9rem 1rem;
    }

    .modal-dialog-header,
    .schedule-builder-header,
    .schedule-builder-header-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .schedule-builder-header-actions {
        gap: 0.6rem;
    }

    .schedule-builder-header-actions {
        align-items: center;
        flex-direction: row;
        justify-content: space-between;
    }

    .schedule-builder-header-actions .modal-close {
        align-self: auto;
    }

    .schedule-builder-summary {
        justify-content: flex-start;
        min-width: 0;
    }

    .modal-close {
        align-self: flex-start;
    }

    .modal-rebuilt > .modal-content:not(.schedule-builder-layout),
    .teacher-subjects-modal .subject-assignment-list,
    .classroom-modal #classroomsManager,
    .modal-calendar #multiDatePicker {
        padding: 1rem;
    }

    .modal-field-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .modal-field-wide {
        grid-column: auto;
    }

    #createScheduleModal .schedule-builder-layout {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 0.75rem;
        padding: 0.75rem;
        scroll-padding-bottom: 0.75rem;
    }

    #createScheduleModal .schedule-builder-card,
    #createScheduleModal .schedule-builder-modules {
        min-width: 0;
    }

    #createScheduleModal .schedule-period-grid,
    #createScheduleModal .module-subjects li.subject-row-item {
        grid-template-columns: minmax(0, 1fr);
    }

    #createScheduleModal .schedule-builder-actions,
    .modal-rebuilt .modal-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
        padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    }

    #createScheduleModal .schedule-builder-actions .btn,
    .modal-rebuilt .modal-buttons .btn {
        width: 100%;
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal-rebuilt,
    .modal-rebuilt * {
        scroll-behavior: auto;
        transition-duration: 0.01ms !important;
    }
}

/* Constructor de horarios: flujo guiado y revisión previa */
#createScheduleModal [data-builder-step][hidden] {
    display: none !important;
}

#createScheduleModal .schedule-builder-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.8rem 0 0;
    padding: 0;
    list-style: none;
}

#createScheduleModal .schedule-builder-progress li {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 30px;
    padding: 0.3rem 0.55rem 0.3rem 0.38rem;
    border: 1px solid var(--modal-line);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 0.74rem;
    line-height: 1;
}

#createScheduleModal .schedule-builder-progress li > span {
    display: inline-grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--text-secondary) 14%, transparent);
    color: var(--text-primary);
    font-size: 0.68rem;
    font-weight: 800;
}

#createScheduleModal .schedule-builder-progress li.is-active {
    border-color: color-mix(in srgb, var(--accent-color) 58%, var(--modal-line));
    background: color-mix(in srgb, var(--accent-color) 11%, transparent);
    color: var(--text-primary);
}

#createScheduleModal .schedule-builder-progress li.is-active > span,
#createScheduleModal .schedule-builder-progress li.is-complete > span {
    background: var(--accent-color);
    color: #fff;
}

#createScheduleModal .schedule-builder-progress li.is-complete {
    color: var(--text-primary);
}

#createScheduleModal .schedule-builder-layout[data-wizard-step="1"],
#createScheduleModal .schedule-builder-layout[data-wizard-step="2"],
#createScheduleModal .schedule-builder-layout[data-wizard-step="4"] {
    grid-template-columns: minmax(0, 700px);
    justify-content: center;
}

#createScheduleModal .schedule-builder-layout[data-wizard-step="4"] {
    align-content: start;
}

#createScheduleModal .schedule-builder-layout[data-wizard-step="1"] .schedule-builder-panel,
#createScheduleModal .schedule-builder-layout[data-wizard-step="2"] .schedule-builder-panel {
    width: 100%;
}

#createScheduleModal .schedule-builder-actions {
    justify-content: space-between;
}

#createScheduleModal .schedule-draft-status {
    max-width: min(48ch, 42%);
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.35;
}

#createScheduleModal .schedule-builder-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
}

#createScheduleModal .schedule-builder-footer-actions .btn[hidden] {
    display: none;
}

#createScheduleModal .schedule-builder-footer-actions .btn:disabled {
    opacity: 0.52;
    cursor: not-allowed;
    filter: saturate(0.45);
}

#createScheduleModal .schedule-review-panel {
    width: 100%;
    min-width: 0;
    padding: clamp(1rem, 3vw, 1.5rem);
    border: 1px solid var(--modal-line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--modal-surface) 94%, var(--bg-body, #f8fafc));
}

#createScheduleModal .schedule-review-heading h3 {
    margin: 0.2rem 0 0;
    color: var(--text-primary);
    font-size: 1.15rem;
}

#createScheduleModal .schedule-review-heading p {
    max-width: 68ch;
    margin: 0.4rem 0 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

#createScheduleModal .schedule-review-content {
    display: grid;
    gap: 1rem;
    margin-top: 1.2rem;
}

#createScheduleModal .schedule-review-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin: 0;
}

#createScheduleModal .schedule-review-summary > div {
    min-width: 0;
    padding: 0.75rem;
    border: 1px solid var(--modal-line);
    border-radius: 10px;
    background: var(--modal-surface);
}

#createScheduleModal .schedule-review-summary dt {
    margin-bottom: 0.2rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

#createScheduleModal .schedule-review-summary dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.4;
}

#createScheduleModal .schedule-review-result,
#createScheduleModal .schedule-review-loading {
    display: grid;
    gap: 0.18rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--modal-line);
    border-left-width: 4px;
    border-radius: 10px;
    background: var(--modal-surface);
}

#createScheduleModal .schedule-review-result strong,
#createScheduleModal .schedule-review-loading {
    color: var(--text-primary);
}

#createScheduleModal .schedule-review-result span {
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.45;
}

#createScheduleModal .schedule-review-result.is-valid {
    border-left-color: #15803d;
}

#createScheduleModal .schedule-review-result.is-error {
    border-left-color: #b91c1c;
}

#createScheduleModal .schedule-review-corrections {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--modal-line);
    border-radius: 10px;
    background: var(--modal-surface);
}

#createScheduleModal .schedule-review-corrections > span {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
}

#createScheduleModal .schedule-review-corrections > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

#createScheduleModal .schedule-review-correction {
    min-width: 0;
    min-height: 38px;
    padding: 0.45rem 0.7rem;
    font-size: 0.78rem;
}

#createScheduleModal .schedule-review-errors {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

#createScheduleModal .schedule-review-errors li {
    display: grid;
    grid-template-columns: minmax(7rem, 9rem) minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
    padding: 0.8rem 0.9rem;
    border: 1px solid color-mix(in srgb, #b91c1c 28%, var(--modal-line));
    border-radius: 10px;
    background: color-mix(in srgb, #b91c1c 5%, var(--modal-surface));
}

#createScheduleModal .schedule-review-errors strong {
    color: #fca5a5;
    font-size: 0.78rem;
}

#createScheduleModal .schedule-review-errors span {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--text-primary);
    font-size: 0.86rem;
    line-height: 1.45;
}

@media (max-width: 640px) {
    #createScheduleModal .schedule-builder-progress {
        gap: 0.35rem;
    }

    #createScheduleModal .schedule-builder-progress li {
        padding-right: 0.42rem;
    }

    #createScheduleModal .schedule-builder-progress b {
        font-size: 0.68rem;
    }

    #createScheduleModal .schedule-builder-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    #createScheduleModal .schedule-draft-status {
        max-width: none;
        min-height: 1.1rem;
    }

    #createScheduleModal .schedule-builder-footer-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #createScheduleModal .schedule-builder-footer-actions .btn {
        min-width: 0;
        width: 100%;
    }

    #createScheduleModal .schedule-review-summary,
    #createScheduleModal .schedule-review-errors li {
        grid-template-columns: minmax(0, 1fr);
    }

    #createScheduleModal .schedule-review-corrections {
        align-items: stretch;
    }

    #createScheduleModal .schedule-review-corrections > div,
    #createScheduleModal .schedule-review-correction {
        width: 100%;
    }

    #createScheduleModal .schedule-review-errors li {
        gap: 0.3rem;
    }
}

/* Programación de pagos: dos responsabilidades visibles, una misma autorización. */
#paymentSchedule .section-header {
    align-items: flex-start;
}

#paymentSchedule .section-header p {
    max-width: 45rem;
}

.payment-balance-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 1.5rem 0 1.9rem;
}

.payment-balance-summary .form-group {
    margin: 0;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid color-mix(in srgb, var(--primary-color) 12%, var(--border-color));
    border-radius: 12px;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--primary-color) 8%, transparent);
}

.payment-balance-summary input {
    margin-top: 0.5rem;
    border: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--primary-color) 22%, transparent);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--text-primary);
    font-size: 1.18rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding-inline: 0;
}

.payment-balance-summary input[readonly] {
    color: var(--primary-dark);
}

.payment-program-section {
    margin-top: 1.75rem;
    padding: 1.25rem;
    border: 1px solid color-mix(in srgb, var(--primary-color) 12%, var(--border-color));
    border-radius: 14px;
    background: var(--bg-card);
    box-shadow: 0 9px 20px color-mix(in srgb, var(--primary-color) 7%, transparent);
}

.teacher-payment-program {
    border-top: 3px solid color-mix(in srgb, var(--accent-color) 78%, var(--primary-color));
}

.payment-program-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.payment-program-heading h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.08rem;
    letter-spacing: -0.015em;
}

.payment-program-heading p {
    margin: 0.35rem 0 0;
    color: var(--text-secondary);
    max-width: 44rem;
}

#paymentSchedule .scholar-teacher-row .table-group-header {
    background: color-mix(in srgb, var(--primary-color) 8%, var(--bg-card));
    color: var(--primary-dark);
    font-weight: 700;
}

@media (max-width: 760px) {
    .payment-balance-summary {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }

    .payment-program-section {
        padding: 1rem;
    }

    .payment-program-heading {
        flex-direction: column;
    }
}
