@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

/* =========================================================
   FAARAVAR ACADEMICS
   MASTER RESPONSIVE STYLESHEET
   Existing design preserved
   ========================================================= */

:root{
    --navy:#071f41;
    --navy2:#0d2c54;
    --gold:#c9962e;
    --purple:#6940d7;
    --bg:#f6f4fb;
    --ink:#17223b;
    --muted:#778198;
    --line:#e7e3ee;
    --white:#fff;
    --green:#238a61;
    --red:#b64343;
}

/* =========================================================
   GLOBAL RESET
   ========================================================= */

*,
*::before,
*::after{
    box-sizing:border-box;
}

html{
    width:100%;
    min-height:100%;
    overflow-x:hidden;
}

body{
    margin:0;
    width:100%;
    min-height:100vh;
    background:var(--bg);
    color:var(--ink);
    font:14px "DM Sans",Arial,sans-serif;
    overflow-x:hidden;
}

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

button,
input,
select,
textarea{
    font-family:"DM Sans",Arial,sans-serif;
}

button{
    cursor:pointer;
}

a{
    color:var(--purple);
}

/* =========================================================
   MAIN APP SHELL
   ========================================================= */

.shell{
    display:flex;
    width:100%;
    min-height:100vh;
}

/* =========================================================
   SIDEBAR - DESKTOP
   ========================================================= */

.sidebar{
    width:250px;
    min-width:250px;
    height:100vh;

    background:var(--navy);
    color:#fff;

    padding:28px 18px;

    position:fixed;
    top:0;
    left:0;
    bottom:0;

    z-index:100;

    display:flex;
    flex-direction:column;

    overflow-y:auto;
    overflow-x:hidden;

    scrollbar-width:thin;
    scrollbar-color:#ffffff25 transparent;
}

.sidebar::-webkit-scrollbar{
    width:5px;
}

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

.sidebar::-webkit-scrollbar-thumb{
    background:#ffffff25;
    border-radius:20px;
}

/* =========================================================
   BRAND
   ========================================================= */

.brand{
    display:flex;
    align-items:center;
    gap:10px;

    padding:0 8px 28px;

    border-bottom:1px solid #ffffff1a;

    flex-shrink:0;
}

.brand img{
    width:54px;
    height:54px;
    object-fit:contain;
    flex-shrink:0;
}

.brand strong{
    display:block;
    font:700 23px "Playfair Display",serif;
    letter-spacing:.5px;
    white-space:nowrap;
}

.brand span{
    display:block;
    color:#e2b64d;
    letter-spacing:3px;
    font-size:9px;
    margin-top:2px;
    white-space:nowrap;
}

/* =========================================================
   SIDEBAR NAVIGATION
   ========================================================= */
/* =========================================================
   SIDEBAR - FINAL DESKTOP FIX
   ========================================================= */

.sidebar{
    width:250px;
    min-width:250px;
    height:100vh;

    background:var(--navy);
    color:#fff;

    padding:28px 18px;

    position:fixed;
    top:0;
    left:0;
    bottom:0;

    z-index:100;

    display:flex;
    flex-direction:column;

    overflow:hidden;
}

/* BRAND */
.brand{
    flex-shrink:0;
}

/* NAVIGATION AREA */
.sidebar nav{
    display:grid;
    gap:7px;

    margin-top:28px;

    /*
       The navigation itself gets its own scroll area.
       It can NEVER enter the Logout area.
    */
    flex:1;

    min-height:0;

    overflow-y:auto;
    overflow-x:hidden;

    padding-bottom:15px;

    scrollbar-width:thin;
    scrollbar-color:#ffffff25 transparent;
}

.sidebar nav::-webkit-scrollbar{
    width:4px;
}

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

.sidebar nav::-webkit-scrollbar-thumb{
    background:#ffffff25;
    border-radius:20px;
}

/* NAVIGATION LINKS */
.sidebar nav a{
    color:#dce5f2;
    text-decoration:none;

    padding:12px 14px;

    border-radius:10px;

    display:block;

    flex-shrink:0;

    transition:
        background .2s ease,
        color .2s ease;
}

.sidebar nav a:hover{
    background:#ffffff12;
    color:#fff;
}

/* =========================================================
   LOGOUT - COMPLETELY SEPARATE FROM NAVIGATION
   ========================================================= */

.logout{
    position:static;

    flex-shrink:0;

    display:block;

    width:100%;

    margin-top:15px;

    padding:12px 14px;

    border:1px solid #ffffff22;

    border-radius:10px;

    text-align:center;

    text-decoration:none;

    color:#dce5f2;

    /*
       IMPORTANT:
       Completely opaque background prevents anything
       underneath from showing through.
    */
    background:var(--navy);

    /*
       Logout must sit above the navigation.
    */
    position:relative;

    z-index:20;

    cursor:pointer;
}

.logout:hover{
    background:#ffffff12;
    color:#fff;
}

/* =========================================================
   MAIN CONTENT
   ========================================================= */

.main{
    margin-left:250px;

    width:calc(100% - 250px);

    min-width:0;

    padding:
        32px
        clamp(24px,3vw,42px)
        70px;
}

/* =========================================================
   TOP BAR
   ========================================================= */

.topbar{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;

    gap:20px;

    margin-bottom:28px;
}

.topbar > *{
    min-width:0;
}

.eyebrow{
    font-size:10px;
    letter-spacing:3px;
    color:var(--gold);
    font-weight:700;
}

.topbar h1{
    font:700 34px "Playfair Display",serif;
    margin:6px 0 0;
    line-height:1.2;
}

.user-chip{
    background:#fff;
    border:1px solid var(--line);

    border-radius:999px;

    padding:10px 14px;

    color:var(--muted);

    font-size:11px;
    font-weight:700;

    white-space:nowrap;
}

/* =========================================================
   HERO
   ========================================================= */

.hero{
    background:linear-gradient(120deg,#fff,#f2effa);

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

    border-radius:24px;

    padding:30px;

    display:flex;
    justify-content:space-between;
    align-items:center;

    gap:25px;

    margin-bottom:20px;

    min-width:0;
}

.hero > *{
    min-width:0;
}

.hero h2{
    font:700 31px "Playfair Display",serif;
    margin:10px 0;
    line-height:1.25;
}

.hero p{
    color:var(--muted);
    max-width:720px;
    line-height:1.7;
}

/* =========================================================
   BADGES
   ========================================================= */

.pill,
.badge,
.yt{
    display:inline-block;

    border-radius:999px;

    padding:6px 10px;

    background:#eee9fb;

    color:var(--purple);

    font-size:10px;
    font-weight:700;
}

/* =========================================================
   DASHBOARD STATS
   ========================================================= */

.stats{
    display:grid;

    grid-template-columns:
        repeat(6,minmax(0,1fr));

    gap:12px;

    margin-bottom:20px;

    min-width:0;
}

.stat{
    min-width:0;

    background:#fff;

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

    border-radius:16px;

    padding:18px;

    overflow:hidden;
}

.stat small{
    display:block;

    color:var(--muted);

    font-size:11px;

    overflow-wrap:anywhere;
}

.stat strong{
    display:block;

    font-size:25px;

    margin-top:7px;

    overflow-wrap:anywhere;
}

/* Seven-card statistics */

.stats:has(.stat:nth-child(7)){
    grid-template-columns:
        repeat(7,minmax(0,1fr));
}

.stats.dashboard-stats{
    grid-template-columns:
        repeat(5,minmax(150px,1fr));
}

.dashboard-stats .stat strong{
    white-space:nowrap;
}

/* =========================================================
   FEE STATISTICS
   ========================================================= */

.fee-stats{
    display:grid;

    grid-template-columns:
        repeat(5,minmax(0,1fr));

    gap:12px;
}

.fee-hero{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:24px;
    background:linear-gradient(120deg,#071f41,#123a64);
    color:#fff;
    border:0;
}

.fee-hero-copy h2{
    margin:10px 0 5px;
    font:700 28px "Playfair Display",serif;
}

.fee-hero-copy p,
.fee-hero-copy .pill{
    color:#d7e5f3;
}

.fee-hero-total{
    min-width:170px;
    padding-left:24px;
    border-left:1px solid #ffffff35;
}

.fee-hero-total small,
.fee-hero-total span{
    display:block;
    color:#c8d8e9;
}

.fee-hero-total strong{
    display:block;
    margin:4px 0;
    color:#fff;
    font-size:28px;
}

.fee-kpis{
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:12px;
    margin:0 0 20px;
}

.fee-kpi{
    min-width:0;
    padding:16px;
    background:#fff;
    border:1px solid var(--line);
    border-top:3px solid var(--navy2);
    border-radius:14px;
}

.fee-kpi.warning{border-top-color:var(--gold)}
.fee-kpi.danger-kpi{border-top-color:var(--red)}
.fee-kpi.credit{border-top-color:var(--green)}

.fee-kpi small,
.fee-kpi span{
    display:block;
    color:var(--muted);
    overflow-wrap:anywhere;
}

.fee-kpi strong{
    display:block;
    margin:6px 0 3px;
    font-size:21px;
    overflow-wrap:anywhere;
}

.fee-status{
    display:inline-block;
    min-width:76px;
    padding:5px 9px;
    border-radius:999px;
    font-size:10px;
    font-weight:700;
    text-align:center;
    text-transform:uppercase;
    letter-spacing:.4px;
}

.fee-status.paid{background:#e4f6ed;color:var(--green)}
.fee-status.overdue{background:#fbe5e5;color:var(--red)}
.fee-status.due{background:#fff2d6;color:#986b13}
.fee-status.upcoming{background:#edf1f6;color:#66758b}

.fee-row-overdue{background:#fffaf9}
.fee-row-upcoming{color:#66758b}

/* =========================================================
   TWO COLUMN CONTENT
   ========================================================= */

.grid2{
    display:grid;

    grid-template-columns:
        minmax(0,1.45fr)
        minmax(280px,1fr);

    gap:20px;

    min-width:0;
}

.grid2 > *{
    min-width:0;
}

/* =========================================================
   PANELS
   ========================================================= */

.panel{
    background:#fff;

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

    border-radius:18px;

    padding:22px;

    margin-bottom:20px;

    min-width:0;

    overflow:hidden;
}

.panel-head{
    display:flex;

    justify-content:space-between;
    align-items:center;

    gap:15px;

    margin-bottom:18px;

    min-width:0;
}

.panel-head > *{
    min-width:0;
}

.panel-head h2,
.panel h2{
    margin:0;

    font:700 20px "Playfair Display",serif;
}

.panel-head p{
    margin:5px 0;

    color:var(--muted);
}

.panel-head a{
    color:var(--white);

    text-decoration:none;

    font-weight:700;
}

/* =========================================================
   QUICK LINKS
   ========================================================= */

.quick{
    display:grid;
    gap:10px;
}

.quick a{
    background:#faf9fd;

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

    padding:14px;

    border-radius:12px;

    text-decoration:none;

    color:var(--ink);

    font-weight:600;

    transition:.2s ease;
}

.quick a:hover{
    border-color:#c9b9ee;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.primary,
.secondary,
.danger{
    border:0;

    border-radius:10px;

    padding:10px 15px;

    text-decoration:none;

    display:inline-block;

    font:600 13px "DM Sans",Arial,sans-serif;

    cursor:pointer;

    transition:.2s ease;
}

.primary{
    background:var(--purple);
    color:#fff;
}

.primary:hover{
    background:#5932c4;
}

.secondary{
    background:#f0edf7;
    color:var(--ink);
}

.secondary:hover{
    background:#e5e0ef;
}

.danger{
    background:#fff0f0;
    color:var(--red);
}

.danger:hover{
    background:#fbe1e1;
}

.wide{
    width:100%;
    margin-top:10px;
}

/* =========================================================
   TABLES
   ========================================================= */

.table-wrap{
    width:100%;
    max-width:100%;

    overflow-x:auto;

    -webkit-overflow-scrolling:touch;

    scrollbar-width:thin;
}

table{
    width:100%;
    border-collapse:collapse;
}

.table-wrap table{
    min-width:650px;
}

th,
td{
    padding:12px 9px;

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

    text-align:left;

    vertical-align:middle;
}

th{
    font-size:10px;

    color:var(--muted);

    text-transform:uppercase;

    letter-spacing:1px;
}

td small{
    display:block;

    color:var(--muted);

    margin-top:4px;
}

/* Old HTML compatibility */

.panel > table{
    width:100%;
}

/* =========================================================
   ACTIONS
   ========================================================= */

.actions{
    display:flex;

    gap:8px;

    align-items:center;

    flex-wrap:wrap;

    min-width:0;
}

.inline{
    display:inline;
}

/* =========================================================
   STATUS
   ========================================================= */

.status{
    font-size:10px;

    font-weight:700;

    border-radius:999px;

    padding:5px 9px;

    background:#f0f0f0;

    white-space:nowrap;
}

.status.on{
    background:#e4f6ed;
    color:var(--green);
}

.status.off{
    background:#f8e8e8;
    color:var(--red);
}

/* =========================================================
   FORMS
   ========================================================= */

.form label{
    display:grid;

    gap:7px;

    font-weight:600;

    margin-bottom:14px;

    min-width:0;
}

.form-grid{
    display:grid;

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

    gap:0 18px;
}

input,
select,
textarea{
    width:100%;

    min-width:0;

    font:14px "DM Sans",Arial,sans-serif;

    padding:12px;

    border:1px solid #dcd7e5;

    border-radius:10px;

    background:#fff;

    color:var(--ink);

    outline:none;
}

textarea{
    min-height:100px;

    resize:vertical;
}

input:focus,
select:focus,
textarea:focus{
    border-color:#9876df;

    box-shadow:
        0 0 0 3px #6d3ce815;
}

.check{
    display:flex!important;

    align-items:center;

    gap:9px!important;
}

.check input{
    width:auto;

    flex-shrink:0;
}

.form-actions{
    display:flex;

    justify-content:flex-end;

    gap:10px;

    margin-top:20px;
}

.hint{
    background:#faf8fd;

    border:1px dashed #d7cee9;

    padding:12px;

    border-radius:10px;

    color:var(--muted);

    font-size:12px;
}

label small{
    font-weight:400;

    color:var(--muted);

    line-height:1.5;
}

/* =========================================================
   LIST ROW
   ========================================================= */

.list-row{
    display:flex;

    align-items:center;

    gap:15px;

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

    padding:14px 0;

    min-width:0;
}

.list-row > div{
    flex:1;

    min-width:0;
}

.list-row small{
    display:block;

    color:var(--muted);

    margin-top:4px;
}

.list-row b,
.list-row small{
    overflow-wrap:anywhere;
}

/* =========================================================
   EMBED PREVIEW
   ========================================================= */

.embed-preview{
    margin:15px 0;

    background:#101522;

    border-radius:14px;

    overflow:hidden;

    min-height:100px;

    display:flex;

    align-items:center;

    justify-content:center;

    color:#aeb7c8;

    width:100%;

    max-width:100%;

    min-width:0;
}

.embed-preview iframe{
    width:100%;

    aspect-ratio:16/9;

    border:0;

    display:block;
}

/* =========================================================
   LOGIN PAGE
   ========================================================= */

.login-wrap{
    width:100%;

    min-height:100vh;

    display:grid;

    place-items:center;

    padding:30px 20px;
}

.login-card{
    width:min(440px,100%);

    max-width:440px;

    background:#fff;

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

    border-radius:24px;

    padding:35px;

    box-shadow:
        0 25px 80px #15213d12;

    margin:auto;
}

.login-logo{
    width:82px;
    height:82px;

    object-fit:contain;
}

.login-card h2{
    font:700 30px "Playfair Display",serif;

    margin:8px 0;
}

.login-card p{
    color:var(--muted);

    line-height:1.6;

    margin-bottom:25px;
}

.login-card label{
    display:block;

    font-weight:600;

    margin:12px 0 7px;
}

/* =========================================================
   NOTICES
   ========================================================= */

.notice{
    background:#edf7f3;

    border:1px solid #cde8dc;

    color:#1f6f52;

    border-radius:12px;

    padding:13px 16px;

    margin-bottom:18px;
}

/* =========================================================
   SUBJECT GRID
   ========================================================= */

.subject-grid{
    display:grid;

    grid-template-columns:
        repeat(5,minmax(0,1fr));

    gap:12px;

    min-width:0;
}

.subject-card{
    padding:18px;

    background:#faf9fd;

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

    border-radius:14px;

    text-decoration:none;

    color:var(--ink);

    min-width:0;

    transition:.2s ease;
}

.subject-card:hover{
    border-color:#c9b9ee;

    transform:translateY(-1px);
}

.subject-card span{
    display:grid;

    place-items:center;

    width:35px;
    height:35px;

    background:#eee9fb;

    color:var(--purple);

    border-radius:10px;

    font-weight:800;

    margin-bottom:15px;
}

.subject-card b,
.subject-card small{
    display:block;

    overflow-wrap:anywhere;
}

.subject-card small{
    color:var(--muted);

    margin-top:6px;
}

/* =========================================================
   LESSON GRID
   ========================================================= */

.lesson-grid{
    display:grid;

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

    gap:10px;

    min-width:0;
}

.lesson-card{
    display:flex;

    gap:13px;

    padding:15px;

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

    border-radius:13px;

    text-decoration:none;

    color:var(--ink);

    min-width:0;
}

.lesson-card > div:last-child{
    min-width:0;
}

.lesson-icon{
    width:40px;
    height:40px;

    min-width:40px;

    border-radius:12px;

    background:#eee9fb;

    color:var(--purple);

    display:grid;

    place-items:center;
}

.lesson-card b,
.lesson-card span{
    display:block;
}

.lesson-card b,
.lesson-card small{
    overflow-wrap:anywhere;
}

.lesson-card small{
    color:var(--muted);
}

.lesson-card span{
    font-size:11px;

    color:var(--purple);

    margin-top:6px;
}

/* =========================================================
   SUBJECT SECTION
   ========================================================= */

.subject-section{
    padding:0;

    overflow:hidden;
}

.subject-section .panel-head{
    padding:20px 22px;

    margin:0;

    background:#fbfaff;
}

.chapter-row{
    display:flex;

    align-items:center;

    gap:18px;

    padding:16px 22px;

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

    text-decoration:none;

    color:var(--ink);

    min-width:0;
}

.chapter-row:hover{
    background:#faf9fd;
}

.chapter-number{
    font-size:10px;

    font-weight:800;

    color:var(--purple);

    width:50px;

    flex-shrink:0;
}

.chapter-info{
    flex:1;

    min-width:0;
}

.chapter-info b{
    display:block;

    overflow-wrap:anywhere;
}

.chapter-info small{
    display:block;

    color:var(--muted);

    margin-top:4px;

    overflow-wrap:anywhere;
}

.chapter-status{
    font-size:11px;

    font-weight:700;

    color:var(--purple);

    flex-shrink:0;

    white-space:nowrap;
}

.empty{
    padding:20px;

    color:var(--muted);
}

/* =========================================================
   WATCH PAGE
   ========================================================= */

.watch-layout{
    max-width:1100px;

    width:100%;

    margin:auto;
}

.watch{
    padding:0;

    overflow:hidden;
}

.video-frame{
    background:#07101f;

    aspect-ratio:16/9;

    width:100%;

    min-width:0;

    overflow:hidden;
}

.video-frame iframe{
    width:100%;

    height:100%;

    border:0;

    display:block;
}

.video-frame video{
    width:100%;

    height:100%;

    object-fit:contain;

    background:#07101f;

    display:block;
}

.video-placeholder{
    height:100%;

    min-height:250px;

    display:grid;

    place-items:center;

    color:#b8c1d2;
}

.watch-copy{
    padding:26px;
}

.watch-copy h2{
    font-size:30px;

    margin:12px 0 8px;
}

.watch-copy p{
    color:var(--muted);

    line-height:1.7;
}

.big-money{
    font-size:42px;

    font-weight:800;

    margin:12px 0;
}

/* =========================================================
   VIDEO LIBRARY
   ========================================================= */

.video-library{
    display:grid;

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

    gap:20px;

    min-width:0;
}

.video-library .panel{
    margin:0;

    min-width:0;
}

.video-library .watch-copy h2{
    font-size:22px;
}

/* =========================================================
   FLASH MESSAGES
   ========================================================= */

.flash{
    padding:12px 16px;

    border-radius:10px;

    margin-bottom:15px;
}

.flash.success{
    background:#e8f7f0;

    color:#176c4c;
}

.flash.error{
    background:#fdeaea;

    color:#9c3434;
}

/* =========================================================
   MISC
   ========================================================= */

.pending{
    background:#fff8e7;

    border-color:#ead39b;

    color:#73571c;
}

.compact{
    margin-top:8px;
}

.compact button{
    padding:6px 9px;

    font-size:11px;
}


/* =========================================================
   TABLET / SMALL LAPTOP
   761px - 1100px
   ========================================================= */

@media (max-width:1100px){

    .main{
        padding-left:24px;
        padding-right:24px;
    }

    .stats{
        grid-template-columns:
            repeat(3,minmax(0,1fr));
    }

    .stats:has(.stat:nth-child(7)){
        grid-template-columns:
            repeat(4,minmax(0,1fr));
    }

    .stats.dashboard-stats{
        grid-template-columns:
            repeat(3,minmax(150px,1fr));
    }

    .fee-stats{
        grid-template-columns:
            repeat(2,minmax(0,1fr));
    }

    .grid2{
        grid-template-columns:1fr;
    }

    .subject-grid{
        grid-template-columns:
            repeat(3,minmax(0,1fr));
    }

    .video-library{
        grid-template-columns:1fr;
    }
}


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

@media (max-width:760px){

    html,
    body{
        width:100%;
        max-width:100%;
        overflow-x:hidden;
    }

    .fee-hero{
        align-items:flex-start;
        flex-direction:column;
        gap:18px;
    }

    .fee-hero-total{
        width:100%;
        padding:14px 0 0;
        border-left:0;
        border-top:1px solid #ffffff35;
    }

    .fee-kpis{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }

    /* -----------------------------------------------------
       SHELL
       ----------------------------------------------------- */

    .shell{
        display:block;

        width:100%;

        min-height:100vh;
    }

    /* -----------------------------------------------------
       MOBILE SIDEBAR
       ----------------------------------------------------- */

    .sidebar{
        position:static;

        width:100%;

        min-width:0;

        height:auto;

        padding:18px 15px;

        display:block;

        overflow:visible;
    }

    /* -----------------------------------------------------
       BRAND
       ----------------------------------------------------- */

    .brand{
        padding:0 5px 18px;
    }

    .brand img{
        width:46px;
        height:46px;
    }

    .brand strong{
        font-size:20px;
    }

    .brand span{
        font-size:8px;

        letter-spacing:2.5px;
    }

    /* -----------------------------------------------------
       MOBILE NAVIGATION
       ----------------------------------------------------- */

    .sidebar nav{
        display:flex;

        gap:7px;

        overflow-x:auto;

        overflow-y:hidden;

        margin-top:18px;

        padding-bottom:5px;

        /*
           Override desktop reserved logout space.
        */
        padding-right:0;

        -webkit-overflow-scrolling:touch;

        scrollbar-width:none;
    }

    .sidebar nav::-webkit-scrollbar{
        display:none;
    }

    .sidebar nav a{
        flex:0 0 auto;

        white-space:nowrap;

        padding:10px 13px;
    }

    /* -----------------------------------------------------
       MOBILE LOGOUT
       ----------------------------------------------------- */

    .logout{
        position:static;

        display:block;

        width:100%;

        margin-top:15px;

        background:transparent;
    }

    /* -----------------------------------------------------
       MAIN
       ----------------------------------------------------- */

    .main{
        margin:0;

        width:100%;

        max-width:100%;

        padding:18px 15px 50px;
    }

    /* -----------------------------------------------------
       TOPBAR
       ----------------------------------------------------- */

    .topbar{
        align-items:flex-start;

        flex-direction:column;

        gap:10px;

        margin-bottom:20px;
    }

    .topbar h1{
        font-size:28px;

        line-height:1.2;
    }

    .user-chip{
        white-space:normal;

        max-width:100%;
    }

    /* -----------------------------------------------------
       HERO
       ----------------------------------------------------- */

    .hero{
        flex-direction:column;

        align-items:flex-start;

        padding:22px;

        border-radius:18px;

        gap:15px;
    }

    .hero h2{
        font-size:25px;

        line-height:1.25;
    }

    .hero p{
        line-height:1.6;
    }

    /* -----------------------------------------------------
       STATS
       ----------------------------------------------------- */

    .stats,
    .stats:has(.stat:nth-child(7)),
    .fee-stats,
    .stats.dashboard-stats{
        grid-template-columns:
            repeat(2,minmax(0,1fr));
    }

    .stat{
        padding:15px;

        border-radius:14px;
    }

    .stat strong{
        font-size:22px;
    }

    /* -----------------------------------------------------
       PANELS
       ----------------------------------------------------- */

    .panel{
        padding:17px;

        border-radius:15px;

        margin-bottom:16px;
    }

    .panel-head{
        flex-direction:column;

        align-items:flex-start;

        gap:10px;
    }

    .panel-head h2,
    .panel h2{
        font-size:19px;
    }

    /* -----------------------------------------------------
       ACTIONS
       ----------------------------------------------------- */

    .actions{
        width:100%;
    }

    .actions .primary,
    .actions .secondary,
    .actions .danger{
        max-width:100%;
    }

    /* -----------------------------------------------------
       FORMS
       ----------------------------------------------------- */

    .form-grid{
        grid-template-columns:1fr;
    }

    .form-actions{
        flex-direction:column;

        width:100%;
    }

    .form-actions button,
    .form-actions a{
        width:100%;

        text-align:center;
    }

    /* -----------------------------------------------------
       TABLES
       ----------------------------------------------------- */

    .table-wrap{
        width:100%;

        max-width:100%;

        overflow-x:auto;

        -webkit-overflow-scrolling:touch;
    }

    .table-wrap table{
        min-width:650px;
    }

    /*
       Compatibility for pages where table is not wrapped.
    */

    .panel > table{
        display:block;

        width:100%;

        overflow-x:auto;

        white-space:nowrap;
    }

    /* -----------------------------------------------------
       SUBJECTS
       ----------------------------------------------------- */

    .subject-grid{
        grid-template-columns:
            repeat(2,minmax(0,1fr));

        gap:9px;
    }

    .subject-card{
        padding:14px;
    }

    .subject-card span{
        margin-bottom:10px;
    }

    /* -----------------------------------------------------
       LESSONS
       ----------------------------------------------------- */

    .lesson-grid{
        grid-template-columns:1fr;
    }

    .lesson-card{
        padding:14px;
    }

    /* -----------------------------------------------------
       LIST ROWS
       ----------------------------------------------------- */

    .list-row{
        gap:10px;

        padding:13px 0;
    }

    .list-row > div{
        min-width:0;
    }

    /* -----------------------------------------------------
       CHAPTERS
       ----------------------------------------------------- */

    .chapter-row{
        gap:10px;

        padding:14px 16px;
    }

    .chapter-number{
        width:35px;
    }

    .chapter-info{
        min-width:0;
    }

    .chapter-status{
        font-size:10px;
    }

    /* -----------------------------------------------------
       VIDEO
       ----------------------------------------------------- */

    .video-library{
        grid-template-columns:1fr;

        gap:15px;
    }

    .video-frame{
        width:100%;

        aspect-ratio:16/9;
    }

    .video-placeholder{
        min-height:200px;
    }

    .watch-copy{
        padding:20px;
    }

    .watch-copy h2{
        font-size:25px;
    }

    .embed-preview{
        width:100%;
    }

    /* -----------------------------------------------------
       LOGIN
       ----------------------------------------------------- */

    .login-wrap{
        width:100%;

        min-height:100vh;

        padding:20px 15px;

        display:flex;

        align-items:center;

        justify-content:center;
    }

    .login-card{
        width:100%;

        max-width:440px;

        padding:25px 20px;

        border-radius:18px;

        margin:0;
    }

    .login-card h2{
        font-size:27px;
    }

    .login-logo{
        width:70px;
        height:70px;
    }

    /* -----------------------------------------------------
       LARGE NUMBERS
       ----------------------------------------------------- */

    .big-money{
        font-size:34px;
    }
}


/* =========================================================
   VERY SMALL PHONES
   <=420px
   ========================================================= */

@media (max-width:420px){

    .main{
        padding-left:12px;

        padding-right:12px;
    }

    .sidebar{
        padding-left:12px;

        padding-right:12px;
    }

    .topbar h1{
        font-size:25px;
    }

    .hero{
        padding:18px;
    }

    .hero h2{
        font-size:23px;
    }

    .stats,
    .stats:has(.stat:nth-child(7)),
    .fee-stats{
        gap:8px;
    }

    .stat{
        padding:13px;
    }

    .stat small{
        font-size:10px;
    }

    .stat strong{
        font-size:20px;
    }

    .panel{
        padding:14px;
    }

    .subject-grid{
        gap:7px;
    }

    .subject-card{
        padding:12px;
    }

    .subject-card span{
        width:32px;

        height:32px;
    }

    .chapter-row{
        padding-left:12px;

        padding-right:12px;
    }

    /*
       Hide chapter status on very small phones
       to protect the chapter title from being squeezed.
    */

    .chapter-status{
        display:none;
    }

    .login-wrap{
        padding:15px 10px;
    }

    .login-card{
        padding:22px 17px;
    }
}


/* =========================================================
   TOUCH DEVICES
   ========================================================= */

@media (hover:none){

    .sidebar nav a:hover,
    .quick a:hover,
    .subject-card:hover,
    .primary:hover,
    .secondary:hover,
    .danger:hover{
        transform:none;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion:reduce){

    *,
    *::before,
    *::after{
        scroll-behavior:auto!important;

        transition:none!important;

        animation:none!important;
    }
}