﻿/* =============================================
   SCHEDULE DASHBOARD — Bright unified style
   ============================================= */

.schedule-dashboard {
    --blue: #2563eb;
    --blue-dk: #1d4ed8;
    --blue-lt: #eff6ff;
    --blue-mid: #dbeafe;
    --blue-ring: rgba(37,99,235,.18);
    --green: #16a34a;
    --green-lt: #f0fdf4;
    --text: #0f172a;
    --text-body: #1e293b;
    --text-muted: #475569;
    --text-hint: #94a3b8;
    --border: #e2e8f0;
    --border-md: #cbd5e1;
    --bg: #f8fafc;
    --white: #ffffff;
    --stripe: #f8fafc;
    --radius-sm: 5px;
    --radius-md: 7px;
    --shadow: 0 1px 3px rgba(0,0,0,.07);
}

    /* ===== PANEL HEADER ===== */

    .schedule-dashboard .panel-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        flex-wrap: wrap;
    }

    .schedule-dashboard .panel-kicker {
        display: inline-block;
        margin-bottom: 3px;
        color: var(--text-hint);
        font-size: 10px;
        font-weight: 700;
        letter-spacing: .07em;
        text-transform: uppercase;
    }

    .schedule-dashboard .panel-header h3 {
        margin: 0;
        color: var(--text);
        font-size: 13px;
        font-weight: 700;
        line-height: 1.3;
    }

    /* ===== VIEW PANEL ===== */

    .schedule-dashboard .view-panel {
        padding: 12px;
        display: grid;
        gap: 10px;
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background: var(--white);
        box-shadow: var(--shadow);
    }

    /* ===== PANEL BADGE ===== */

    .schedule-dashboard .panel-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 26px;
        padding: 3px 10px;
        border-radius: 999px;
        background: var(--blue-lt);
        border: 1px solid var(--blue-mid);
        white-space: nowrap;
        color: var(--blue-dk);
        font-size: 11px;
        font-weight: 700;
    }

    /* ===== TABLE SHELL ===== */

    .schedule-dashboard .table-shell {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background: var(--white);
    }

    /* ===== SCHEDULE TABLE ===== */

    .schedule-dashboard .schedule-table {
        width: max-content;
        min-width: 100%;
        border-collapse: separate;
        border-spacing: 0;
        color: var(--text-body);
        background: var(--white);
        table-layout: auto;
    }

        .schedule-dashboard .schedule-table th,
        .schedule-dashboard .schedule-table td {
            min-width: 84px;
            padding: 6px 7px;
            border-right: 1px solid var(--border);
            border-bottom: 1px solid var(--border);
            text-align: center;
            vertical-align: middle;
            background: var(--white);
            font-size: 11.5px;
        }

        /* ── THEAD ── */

        .schedule-dashboard .schedule-table th {
            position: sticky;
            top: 0;
            z-index: 1;
            background: var(--blue);
            color: #fff;
            font-weight: 600;
            font-size: 11.5px;
            border-right: 1px solid var(--blue-dk);
            border-bottom: 1px solid var(--blue-dk);
        }

        /* ── ZEBRA + HOVER ── */

        .schedule-dashboard .schedule-table tbody tr:nth-child(even) td:not(.row-label) {
            background: var(--stripe);
        }

        .schedule-dashboard .schedule-table tbody tr:hover td:not(.row-label) {
            background: var(--blue-lt);
        }

        /* ── FIRST COLUMN ── */

        .schedule-dashboard .schedule-table th:first-child,
        .schedule-dashboard .schedule-table td:first-child {
            width: 68px;
            min-width: 68px;
            max-width: 68px;
        }

        .schedule-dashboard .schedule-table th:not(:first-child),
        .schedule-dashboard .schedule-table td:not(:first-child) {
            min-width: 92px;
        }

        /* ── CORNER RADIUS ── */

        .schedule-dashboard .schedule-table th:first-child {
            border-top-left-radius: var(--radius-md);
        }

        .schedule-dashboard .schedule-table th:last-child {
            border-top-right-radius: var(--radius-md);
        }

        .schedule-dashboard .schedule-table tr:last-child td:first-child {
            border-bottom-left-radius: var(--radius-md);
        }

        .schedule-dashboard .schedule-table tr:last-child td:last-child {
            border-bottom-right-radius: var(--radius-md);
        }

    /* ===== ROW LABEL ===== */

    .schedule-dashboard .row-label {
        font-weight: 600;
        color: var(--blue-dk);
        background: var(--blue-lt) !important;
        border-right: 1px solid var(--border-md) !important;
    }

    .schedule-dashboard .row-label-day,
    .schedule-dashboard .row-label-period {
        color: var(--blue-dk);
    }

    /* ===== LESSON CARD ===== */

    .schedule-dashboard .lesson-card {
        display: grid;
        gap: 2px;
        padding: 4px 6px;
        border-radius: var(--radius-sm);
        background: var(--blue-lt);
        border: 1px solid var(--blue-mid);
    }

    .schedule-dashboard .lesson-subject {
        color: var(--blue-dk);
        font-size: 11px;
        font-weight: 700;
        line-height: 1.2;
    }

    .schedule-dashboard .lesson-meta {
        color: var(--text-muted);
        font-size: 10.5px;
        font-weight: 400;
        line-height: 1.2;
    }

    .schedule-dashboard .cell-empty {
        color: var(--text-hint);
        font-size: 11px;
    }

    /* ===== DIVIDERS ===== */

    .schedule-dashboard .session-divider td {
        border-top: 2px solid var(--blue);
    }

    .schedule-dashboard .day-divider td {
        border-top: 2px solid #0f172a;
    }

    /* ===== SESSION BG ===== */

    .schedule-dashboard .session-morning td:not(.row-label) {
        background: var(--white);
    }

    .schedule-dashboard .session-afternoon td:not(.row-label) {
        background: #fafdf6;
    }

    /* ===== PERIOD CELL ===== */

    .schedule-dashboard .period-cell {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
    }

    .schedule-dashboard .period-number {
        font-weight: 700;
        font-size: 13px;
        color: var(--blue-dk);
    }

    .schedule-dashboard .period-tag {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 1px 6px;
        border-radius: 999px;
        font-size: 9.5px;
        font-weight: 700;
        line-height: 1;
        letter-spacing: .02em;
        white-space: nowrap;
    }

    .schedule-dashboard .morning-tag {
        background: var(--blue-mid);
        color: var(--blue-dk);
        border: 1px solid #93c5fd;
    }

    .schedule-dashboard .afternoon-tag {
        background: #dcfce7;
        color: #15803d;
        border: 1px solid #86efac;
    }

/* ===== RESPONSIVE 1600px ===== */

@@media (min-width: 1600px) {
    .schedule-dashboard .view-panel {
        padding: 14px;
    }

    .schedule-dashboard .schedule-table {
        width: 100%;
    }

        .schedule-dashboard .schedule-table th,
        .schedule-dashboard .schedule-table td {
            min-width: 80px;
            padding: 6px 8px;
            font-size: 11.5px;
        }

    .schedule-dashboard .lesson-card {
        padding: 4px 6px;
    }
}

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

@@media (max-width: 768px) {

    .schedule-dashboard .view-panel {
        padding: 9px;
    }

    .schedule-dashboard .table-shell:not(:has(.schedule-table-wide)) {
        overflow-x: hidden !important;
    }

    .schedule-dashboard .schedule-table:not(.schedule-table-wide) {
        min-width: 100% !important;
        width: 100%;
        table-layout: fixed;
    }

        .schedule-dashboard .schedule-table:not(.schedule-table-wide) th,
        .schedule-dashboard .schedule-table:not(.schedule-table-wide) td {
            min-width: unset !important;
            padding: 4px 3px;
            font-size: 11px;
            word-break: break-word;
            white-space: normal;
        }

            .schedule-dashboard .schedule-table:not(.schedule-table-wide) th:first-child,
            .schedule-dashboard .schedule-table:not(.schedule-table-wide) td:first-child {
                width: 50px;
                min-width: 50px;
            }

    .schedule-dashboard .table-shell:has(.schedule-table-wide) {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .schedule-dashboard .schedule-table.schedule-table-wide {
        min-width: max-content !important;
        width: max-content !important;
        table-layout: auto !important;
    }

    .schedule-dashboard .schedule-table-wide th,
    .schedule-dashboard .schedule-table-wide td {
        min-width: 80px !important;
        padding: 4px 5px;
        font-size: 11px;
    }

    .schedule-dashboard .lesson-card {
        padding: 3px 5px;
        gap: 1px;
    }

    .schedule-dashboard .lesson-subject {
        font-size: 10.5px;
    }

    .schedule-dashboard .lesson-meta {
        font-size: 10px;
    }

    .schedule-dashboard .cell-empty {
        font-size: 10.5px;
    }

    .schedule-dashboard .schedule-table-wide th:nth-child(1),
    .schedule-dashboard .schedule-table-wide td:nth-child(1) {
        min-width: 46px !important;
        width: 46px;
        max-width: 50px;
        font-size: 11px;
        padding: 4px 3px;
    }

    .schedule-dashboard .schedule-table-wide th:nth-child(2),
    .schedule-dashboard .schedule-table-wide td:nth-child(2) {
        min-width: 56px !important;
        width: 56px;
        max-width: 60px;
        padding: 4px 3px;
    }
}
