/* Diseño minimalista limpio basado en la plantilla de referencia */
:root {
    --bg-canvas: #f5f7fa;
    --bg-surface: #ffffff;
    --border-soft: #e6ebf2;
    --border-row: #eef2f7;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --accent-blue: #0d8bf2;
    --accent-blue-hover: #0a74cc;
    --accent-teal: #10b981;
    --accent-teal-btn: #0fa99c;
    --accent-orange: #f97316;
    --accent-yellow: #facc15;
}

body {
    background-color: var(--bg-canvas);
    color: var(--text-main);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.9rem;
    margin: 0;
}

/* Shell principal: sidebar angosto izquierdo + área derecha */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 68px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.9rem 0;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 1030;
    flex-shrink: 0;
}

.sidebar-brand-toggle {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-brand-toggle:hover {
    background-color: #f1f5f9;
    color: var(--text-main);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
}

.sidebar-link {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 1.05rem;
    text-decoration: none;
    transition: all 0.15s ease;
    position: relative;
}

.sidebar-link:hover {
    background-color: #f1f5f9;
    color: var(--accent-blue);
}

.sidebar-link.active {
    background-color: var(--accent-blue);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(13, 139, 242, 0.3);
}

.app-main-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Barra superior minimalista blanca */
.app-topbar {
    height: 62px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1rem;
}

.topbar-brand-badge {
    background-color: #eff6ff;
    color: var(--accent-blue);
    border: 1px solid #dbeafe;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
}

.topbar-search {
    position: relative;
    max-width: 300px;
    width: 100%;
}

.topbar-search input {
    background-color: #f8fafc;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    padding: 0.42rem 0.75rem 0.42rem 2.1rem;
    font-size: 0.85rem;
    width: 100%;
    color: var(--text-main);
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background-color: #ffffff;
}

.topbar-search i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.85rem;
}

.topbar-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border-soft);
    background-color: #ffffff;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.15s ease;
}

.topbar-icon-btn:hover {
    background-color: #f8fafc;
    color: var(--accent-blue);
    border-color: #cbd5e1;
}

.app-content {
    padding: 1.5rem 1.75rem 2.5rem;
    max-width: 1380px;
    width: 100%;
    margin: 0 auto;
}

/* Tarjetas limpias */
.card-clean {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.03);
}

/* Píldoras de contexto junto al saludo */
.pill-contexto {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    padding: 0.42rem 0.85rem;
    font-size: 0.84rem;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Iconos circulares pastel para KPIs */
.kpi-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    margin-bottom: 0.65rem;
}

.kpi-circle-blue {
    background-color: #e0f2fe;
    color: #0284c7;
}

.kpi-circle-yellow {
    background-color: #fef3c7;
    color: #d97706;
}

.kpi-circle-green {
    background-color: #d1fae5;
    color: #059669;
}

/* Tabs con subrayado azul minimalista */
.nav-tabs-clean {
    border-bottom: 1px solid var(--border-soft);
    gap: 1.4rem;
}

.nav-tabs-clean .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.65rem 0.15rem;
    font-size: 0.9rem;
    border-radius: 0;
    transition: all 0.15s ease;
}

.nav-tabs-clean .nav-link:hover {
    color: var(--text-main);
}

.nav-tabs-clean .nav-link.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
    font-weight: 600;
}

/* Botones de acción estilo referencia */
.btn-ref-blue {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #ffffff;
    border-radius: 6px;
    font-weight: 500;
}

.btn-ref-blue:hover {
    background-color: var(--accent-blue-hover);
    border-color: var(--accent-blue-hover);
    color: #ffffff;
}

.btn-ref-teal {
    background-color: var(--accent-teal-btn);
    border-color: var(--accent-teal-btn);
    color: #ffffff;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.8rem;
}

.btn-ref-teal:hover {
    background-color: #0d9488;
    border-color: #0d9488;
    color: #ffffff;
}

.btn-ref-orange {
    background-color: var(--accent-orange);
    border-color: var(--accent-orange);
    color: #ffffff;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.8rem;
}

.btn-ref-orange:hover {
    background-color: #ea580c;
    border-color: #ea580c;
    color: #ffffff;
}

/* Badges con borde tipo outline pastel */
.status-pill {
    display: inline-block;
    padding: 0.22rem 0.65rem;
    font-size: 0.76rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.status-pill-success {
    background-color: #ecfdf5;
    border-color: #a7f3d0;
    color: #059669;
}

.status-pill-warning {
    background-color: #fff7ed;
    border-color: #fed7aa;
    color: #ea580c;
}

.status-pill-info {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #0284c7;
}

.status-pill-neutral {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: #64748b;
}

.status-pill-danger {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

/* Tablas aireadas sin líneas verticales pesadas */
.tabla-clean {
    width: 100%;
    margin-bottom: 0;
    font-size: 0.87rem;
    border-collapse: collapse;
}

.tabla-clean thead th {
    background-color: #f8fafc;
    color: #64748b;
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0.75rem 0.9rem;
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
    border-left: 0;
    border-right: 0;
    white-space: nowrap;
}

.tabla-clean tbody td {
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid var(--border-row);
    border-left: 0;
    border-right: 0;
    vertical-align: middle;
}

.tabla-clean tbody tr:hover td {
    background-color: #fafcff;
}

/* Fila de feriado en rosado #f2dede según guía */
tr.fila-feriado,
tr.fila-feriado>td {
    background-color: #f2dede !important;
    color: #842029;
}

/* Barras de progreso (amarilla = programación, verde = dictado) */
.progress-academica {
    height: 8px;
    border-radius: 999px;
    background-color: #e2e8f0;
    overflow: hidden;
}

.progress-bar-programacion {
    background-color: #facc15;
}

.progress-bar-dictado {
    background-color: #10b981;
}

/* Notas */
.col-nota-activa {
    background-color: #eff6ff !important;
}

.nota-input {
    width: 78px;
    text-align: center;
    font-weight: 600;
    border-radius: 6px;
}

.nota-aprobada {
    color: #059669;
}

.nota-desaprobada {
    color: #dc2626;
}

/* Login minimalista */
.login-fondo {
    background-color: var(--bg-canvas);
}

.login-card {
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

/* Badges de rol */
.badge-rol {
    font-size: 0.68rem;
    font-weight: 600;
}

.badge-rol-docente {
    background-color: var(--accent-blue);
}

.badge-rol-secretario {
    background-color: #7c3aed;
}

.badge-rol-estudiante {
    background-color: var(--accent-teal);
}

.form-switch .form-check-input {
    cursor: pointer;
    width: 2.3em;
    height: 1.2em;
}

/* Móvil: sidebar arriba como barra compacta */
@media (max-width: 767.98px) {
    .app-shell {
        flex-direction: column;
    }
    .app-sidebar {
        width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        justify-content: space-between;
        padding: 0.5rem 1rem;
        border-right: 0;
        border-bottom: 1px solid var(--border-soft);
    }
    .sidebar-brand-toggle {
        margin-bottom: 0;
    }
    .sidebar-nav {
        flex-direction: row;
        width: auto;
    }
    .app-topbar {
        padding: 0.6rem 1rem;
        height: auto;
        flex-wrap: wrap;
    }
    .app-content {
        padding: 1rem;
    }
}

@media print {
    .app-sidebar,
    .app-topbar,
    .no-print {
        display: none !important;
    }
    body {
        background-color: #ffffff !important;
    }

    .app-content {
        padding: 0 !important;
        max-width: 100% !important;
    }
}