* {
    box-sizing: border-box;
}


:root {

    --bg: #f1f5f9;

    --card: #ffffff;

    --text: #0f172a;

    --muted: #64748b;

    --border: #e2e8f0;

    --primary: #2563eb;

    --green: #16a34a;

    --red: #dc2626;

}


body {

    margin: 0;

    background: var(--bg);

    color: var(--text);

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

}


/* HEADER */

.topbar {

    background: #0f172a;

    color: white;

    padding:
        22px
        max(18px, calc((100% - 1100px) / 2));

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

}


.eyebrow {

    font-size: 11px;

    letter-spacing: 1.4px;

    color: #93c5fd;

    font-weight: 800;

}


h1 {

    margin: 3px 0;

    font-size: 27px;

}


.topbar p {

    margin: 0;

    color: #cbd5e1;

    font-size: 13px;

}


/* MAIN */

.container {

    max-width: 1100px;

    margin: auto;

    padding: 18px;

}


/* STATS */

.stats-grid {

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 12px;

}


.stat-card {

    background: var(--card);

    border: 1px solid var(--border);

    border-radius: 16px;

    padding: 17px;

    box-shadow:
        0 3px 12px rgba(15, 23, 42, 0.05);

}


.stat-card span {

    display: block;

    color: var(--muted);

    font-size: 12px;

    font-weight: 700;

}


.stat-card strong {

    display: block;

    font-size: 27px;

    margin: 7px 0 2px;

}


.stat-card small {

    color: var(--muted);

    font-size: 11px;

}


.stat-card.primary {

    background: #eff6ff;

    border-color: #bfdbfe;

}


/* WARNING */

.warning-card {

    margin: 14px 0;

    background: white;

    border: 1px solid var(--border);

    border-radius: 16px;

    padding: 15px 17px;

    display: flex;

    justify-content: space-between;

    align-items: center;

}


.warning-card strong {

    font-size: 14px;

}


.warning-card p {

    margin: 3px 0 0;

    color: var(--muted);

    font-size: 12px;

}


.warning-icon {

    width: 36px;

    height: 36px;

    border-radius: 50%;

    display: grid;

    place-items: center;

    background: #dcfce7;

    color: #15803d;

    font-weight: 900;

}


/* TABS */

.tabs {

    display: flex;

    gap: 6px;

    background: #e2e8f0;

    padding: 5px;

    border-radius: 13px;

    margin: 15px 0;

}


.tab {

    border: 0;

    background: transparent;

    padding: 10px 15px;

    border-radius: 9px;

    font-weight: 800;

    color: #475569;

    cursor: pointer;

    flex: 1;

}


.tab.active {

    background: white;

    color: #1d4ed8;

    box-shadow:
        0 2px 8px rgba(15, 23, 42, 0.08);

}


/* PANELS */

.tab-panel {

    display: none;

}


.tab-panel.active {

    display: block;

}


/* SECTION */

.section-head {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin: 16px 0 12px;

}


.section-head h2 {

    margin: 0;

    font-size: 19px;

}


.section-head p {

    margin: 4px 0 0;

    color: var(--muted);

    font-size: 12px;

}


/* LECTURES */

.lecture-list {

    display: grid;

    gap: 10px;

}


.lecture {

    background: white;

    border: 1px solid var(--border);

    border-radius: 15px;

    padding: 14px;

    display: grid;

    grid-template-columns:
        90px
        1fr
        auto;

    align-items: center;

    gap: 14px;

}


.time {

    font-weight: 900;

    font-size: 13px;

    color: #334155;

}


.time small {

    display: block;

    color: var(--muted);

    font-weight: 600;

    margin-top: 3px;

}


.lecture h3 {

    font-size: 14px;

    margin: 0 0 4px;

}


.lecture .meta {

    font-size: 11px;

    color: var(--muted);

}


/* STATUS BUTTONS */

.status-buttons {

    display: flex;

    gap: 6px;

}


.status-btn {

    border: 1px solid var(--border);

    background: white;

    border-radius: 9px;

    padding: 8px 11px;

    font-size: 11px;

    font-weight: 800;

    cursor: pointer;

}


.status-btn.present.active {

    background: #dcfce7;

    border-color: #86efac;

    color: #166534;

}


.status-btn.absent.active {

    background: #fee2e2;

    border-color: #fca5a5;

    color: #991b1b;

}


.status-btn.cancelled.active {

    background: #e2e8f0;

    border-color: #cbd5e1;

    color: #475569;

}


/* WEEK */

.week-controls {

    display: grid;

    grid-template-columns:
        44px
        1fr
        44px;

    align-items: center;

    text-align: center;

}


.icon-btn {

    border: 1px solid var(--border);

    background: white;

    border-radius: 10px;

    font-size: 25px;

    height: 42px;

    cursor: pointer;

}


.week-actions {

    display: flex;

    gap: 8px;

    margin-bottom: 12px;

}


.secondary-btn,
.ghost-btn,
.danger-outline {

    border-radius: 9px;

    padding: 9px 12px;

    font-size: 11px;

    font-weight: 800;

    cursor: pointer;

}


.secondary-btn {

    border: 0;

    background: #dbeafe;

    color: #1d4ed8;

}


.ghost-btn,
.danger-outline {

    background: transparent;

    border: 1px solid var(--border);

    color: #475569;

}


.danger-outline {

    color: #fecaca;

    border-color: #7f1d1d;

}


/* SUBJECTS */

.subject-list {

    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 11px;

}


.subject-card {

    background: white;

    border: 1px solid var(--border);

    border-radius: 15px;

    padding: 15px;

}


.subject-top {

    display: flex;

    justify-content: space-between;

}


.subject-name {

    font-weight: 900;

    font-size: 14px;

}


.subject-pct {

    font-weight: 900;

}


.bar {

    height: 7px;

    background: #e2e8f0;

    border-radius: 99px;

    overflow: hidden;

    margin: 12px 0 8px;

}


.bar span {

    display: block;

    height: 100%;

    background: var(--primary);

    border-radius: 99px;

}


.subject-foot {

    display: flex;

    justify-content: space-between;

    color: var(--muted);

    font-size: 11px;

}


/* HISTORY */

.history-list {

    display: grid;

    gap: 9px;

}


.history-card {

    background: white;

    border: 1px solid var(--border);

    border-radius: 14px;

    padding: 13px 15px;

    display: flex;

    justify-content: space-between;

    align-items: center;

}


.history-card strong {

    font-size: 13px;

}


.history-card small {

    display: block;

    color: var(--muted);

    margin-top: 3px;

}


.history-pct {

    font-size: 17px;

    font-weight: 900;

}


/* EMPTY */

.empty {

    background: white;

    border: 1px dashed #cbd5e1;

    border-radius: 14px;

    padding: 25px;

    text-align: center;

    color: var(--muted);

    font-size: 13px;

}


/* FOOTER */

footer {

    max-width: 1100px;

    margin: 20px auto;

    padding: 15px 18px;

    color: #94a3b8;

    font-size: 10px;

    display: flex;

    justify-content: space-between;

}


/* MOBILE */

@media (max-width: 750px) {

    .stats-grid {

        grid-template-columns:
            repeat(2, 1fr);

    }


    .lecture {

        grid-template-columns:
            72px
            1fr;

    }


    .status-buttons {

        grid-column: 1 / -1;

    }


    .status-btn {

        flex: 1;

    }


    .subject-list {

        grid-template-columns: 1fr;

    }


    .topbar {

        padding: 18px;

    }


    .container {

        padding: 13px;

    }


    .tab {

        padding: 9px 5px;

        font-size: 11px;

    }


    footer {

        display: block;

    }


    footer span {

        display: block;

        margin: 4px 0;

    }

}
/* ============================================
   CLINICAL PICKER
============================================ */

.clinical-lecture {
    border-color: #c7d2fe;
    background: #f5f7ff;
}


.clinical-picker {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}


.clinical-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}


.subject-chip {
    border: 1px solid #cbd5e1;
    background: white;
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    color: #475569;
    transition: all 0.15s;
}


.subject-chip:hover {
    border-color: #94a3b8;
}


.subject-chip.active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: white;
}


.clinical-default-btn {
    border: 1px dashed #cbd5e1;
    background: transparent;
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    color: #6366f1;
    text-align: left;
    align-self: flex-start;
}


.clinical-default-btn.active {
    background: #eef2ff;
    border-style: solid;
    border-color: #c7d2fe;
    color: #4338ca;
    cursor: default;
}


.clinical-default-btn:not(.active):hover {
    background: #eef2ff;
}


/* ============================================
   DAY HEADING (Week tab)
============================================ */

.day-heading {
    font-size: 12px;
    font-weight: 900;
    color: #475569;
    margin: 12px 2px 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* ============================================
   SUBJECT SPLIT (Theory/Practical)
============================================ */

.subject-split {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 8px 0 6px;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 9px;
    font-size: 11px;
}


.split-row {
    display: flex;
    justify-content: space-between;
    color: #475569;
    font-weight: 700;
}


.split-row span:first-child {
    color: #64748b;
}


/* Mobile: stack clinical picker nicer */
@media (max-width: 750px) {

    .clinical-picker {
        margin-top: 8px;
    }

    .subject-chip {
        flex: 1;
        text-align: center;
    }

}
/* ============================================
   HIDDEN UTILITY
============================================ */

.hidden {
    display: none !important;
}


/* ============================================
   AUTH SCREEN
============================================ */

.auth-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        linear-gradient(
            135deg,
            #0f172a 0%,
            #1e293b 100%
        );
}


.auth-card {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: 20px;
    padding: 28px;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.4);
}


.auth-brand {
    text-align: center;
    margin-bottom: 22px;
}


.auth-brand .eyebrow {
    color: #2563eb;
    letter-spacing: 1.4px;
    font-size: 11px;
    font-weight: 800;
}


.auth-brand h1 {
    margin: 6px 0 4px;
    font-size: 24px;
    color: #0f172a;
}


.auth-brand p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}


.auth-tabs {
    display: flex;
    gap: 6px;
    background: #e2e8f0;
    padding: 5px;
    border-radius: 13px;
    margin-bottom: 20px;
}


.auth-tab {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 10px;
    border-radius: 9px;
    font-weight: 800;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
}


.auth-tab.active {
    background: white;
    color: #1d4ed8;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}


.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}


.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    color: #475569;
}


.auth-form input {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    border-radius: 10px;
    padding: 11px 13px;
    font-size: 14px;
    font-family: inherit;
    color: #0f172a;
    transition: all 0.15s;
}


.auth-form input:focus {
    outline: none;
    border-color: #2563eb;
    background: white;
    box-shadow: 0 0 0 3px #dbeafe;
}


.primary-btn {
    border: 0;
    background: #2563eb;
    color: white;
    border-radius: 11px;
    padding: 12px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 4px;
}


.primary-btn:hover {
    background: #1d4ed8;
}


.primary-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


.auth-error {
    margin: 0;
    font-size: 12px;
    color: #dc2626;
    font-weight: 700;
    min-height: 16px;
    text-align: center;
}


.auth-success {
    color: #16a34a !important;
}
