:root {
    --sidebar-width: 305px;
    --border-color: #e5e7eb;
    --text-muted: #64748b;
    --background: #f8fafc;
    --primary: #2563eb;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--background);
    color: #0f172a;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-layout {
    min-height: 100vh;
}

/* =====================================================
   BARRA LATERAL
   ===================================================== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    padding: 28px 20px 24px;
    display: flex;
    flex-direction: column;
    color: #ffffff;
    background: radial-gradient( circle at 20% 90%, rgba(19, 101, 211, 0.32), transparent 34% ), linear-gradient( 180deg, #062e63 0%, #042653 52%, #031f45 100% );
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 10px 0 30px rgba(15, 23, 42, 0.12);
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 2px 4px 30px;
}

.brand-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 52px;
    font-size: 25px;
    color: #ffffff;
    background: linear-gradient( 145deg, rgba(20, 115, 230, 0.95), rgba(25, 83, 177, 0.7) );
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 15px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.17), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.brand-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.3px;
}

.brand-subtitle {
    margin-top: 5px;
    font-size: 14px;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.65);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sidebar-link {
    min-height: 50px;
    padding: 0 15px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 12px;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

    .sidebar-link i {
        width: 23px;
        flex: 0 0 23px;
        font-size: 20px;
        text-align: center;
        color: rgba(255, 255, 255, 0.68);
    }

    .sidebar-link:hover {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.08);
        transform: translateX(2px);
    }

        .sidebar-link:hover i {
            color: #ffffff;
        }

    .sidebar-link.active {
        color: #ffffff;
        font-weight: 600;
        background: linear-gradient(135deg, #1676df 0%, #0b5ed7 100%);
        border-color: rgba(255, 255, 255, 0.14);
        box-shadow: 0 10px 22px rgba(0, 63, 145, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.16);
    }

        .sidebar-link.active i {
            color: #ffffff;
        }

.sidebar-footer {
    margin-top: auto;
    padding: 22px 4px 2px;
    display: flex;
    align-items: center;
    gap: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.footer-icon {
    width: 43px;
    height: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 43px;
    color: #ffffff;
    font-size: 19px;
    background: rgba(30, 121, 226, 0.34);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
}

.footer-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    color: rgba(255, 255, 255, 0.92);
}

.footer-subtitle {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.25;
    color: rgba(255, 255, 255, 0.52);
}

/* =====================================================
   CONTENIDO PRINCIPAL
   ===================================================== */

.main-content {
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    padding: 32px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 28px;
}

.page-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 750;
}

.page-subtitle {
    margin-top: 8px;
    color: var(--text-muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-wrapper {
    width: 100%;
}

/* =====================================================
   TARJETAS Y PANELES
   ===================================================== */

.metric-card {
    min-height: 132px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.metric-label {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
}

.metric-value {
    margin-top: 7px;
    font-size: 1.75rem;
    line-height: 1;
    font-weight: 750;
}

.metric-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: #eff6ff;
    color: var(--primary);
    font-size: 1.25rem;
}

    .metric-icon.warning {
        background: #fff7ed;
        color: #ea580c;
    }

    .metric-icon.danger {
        background: #fef2f2;
        color: #dc2626;
    }

.scenario-panel {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 8px 26px rgba(15, 23, 42, 0.05);
}

.scenario-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

    .scenario-header h2 {
        margin: 0;
        font-size: 1.2rem;
        font-weight: 700;
    }

    .scenario-header p {
        margin: 7px 0 0;
        color: var(--text-muted);
    }

.course-column {
    height: 100%;
    min-height: 340px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 14px;
}

.course-column-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.course-number {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    margin-right: 7px;
    border-radius: 9px;
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 700;
}

.course-title {
    font-weight: 700;
}

.course-credits {
    color: var(--text-muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.subject-list {
    min-height: 260px;
}

.subject-card {
    margin-bottom: 10px;
    padding: 13px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    cursor: grab;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
}

    .subject-card:active {
        cursor: grabbing;
    }

.subject-name {
    margin-bottom: 5px;
    font-weight: 650;
}

.subject-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.empty-state {
    display: grid;
    min-height: 140px;
    place-items: center;
    padding: 20px;
    border: 1px dashed #cbd5e1;
    border-radius: 11px;
    color: #94a3b8;
    text-align: center;
}

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

@media (max-width: 991.98px) {
    .sidebar {
        position: relative;
        width: 100%;
        min-height: auto;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 20px;
    }

    .sidebar-footer {
        margin-top: 28px;
    }

    .topbar {
        flex-direction: column;
    }
}

.logo-fcs {
    width: 48px;
    height: auto;
    margin-right: 12px;
}

.logo-lab {
    width: 140px;
    height: auto;
    margin-top: 10px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-footer {
    text-align: center;
}

.footer-title {
    font-size: .8rem;
    color: #9aa5b1;
    margin-bottom: 8px;
}