/* =====================================================================
   Shule Manager — theme
   Deep forest green + warm savanna gold, soft neutral surfaces.
   ===================================================================== */
:root {
    --primary: #15803d;
    --primary-dark: #0f5f2e;
    --primary-50: #ecfdf3;
    --primary-100: #d3f5e0;
    --forest: #0b2e22;          /* sidebar */
    --forest-2: #123d2e;
    --gold: #e8a317;
    --gold-50: #fff7e6;

    --bg: #f3f6f4;
    --card-bg: #ffffff;
    --text: #13231c;
    --text-2: #3d4f46;
    --muted: #6f8078;
    --border: #e3e9e6;
    --border-strong: #cfd9d4;

    --danger: #d23f31;
    --danger-bg: #fdeeec;
    --info: #1f6fb2;
    --info-bg: #eaf3fc;
    --warn: #9a6a00;
    --warn-bg: #fff6df;

    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(16, 40, 30, .05), 0 6px 20px rgba(16, 40, 30, .06);
    --shadow-lg: 0 12px 40px rgba(11, 46, 34, .14);
    --ring: 0 0 0 3px rgba(21, 128, 61, .18);
    --font: 'Plus Jakarta Sans', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
    --sidebar-w: 256px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-dark); }
h1, h2, h3, h4 { letter-spacing: -.01em; }
code { font-family: var(--mono); background: #eef3f0; padding: 1px 6px; border-radius: 5px; font-size: .92em; }
.ico { flex-shrink: 0; display: inline-block; vertical-align: middle; }

/* ---------------------------------------------------------------------
   Login / registration — split screen
   --------------------------------------------------------------------- */
.auth-wrapper {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    background: var(--card-bg);
}
.auth-hero {
    position: relative;
    overflow: hidden;
    padding: 56px 60px;
    color: #eaf6ef;
    display: flex; flex-direction: column; justify-content: space-between;
    background:
        radial-gradient(900px 500px at 110% -10%, rgba(232, 163, 23, .28), transparent 60%),
        radial-gradient(700px 500px at -20% 110%, rgba(34, 197, 94, .25), transparent 60%),
        linear-gradient(160deg, #0b2e22 0%, #0f4a33 55%, #136b45 100%);
}
.auth-hero::after {                     /* subtle dotted texture */
    content: ''; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
}
.auth-hero > * { position: relative; z-index: 1; }
.hero-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 18px; }
.hero-brand .logo-dot { background: var(--gold); color: #1b1300; }
.auth-hero h2 { font-size: 36px; line-height: 1.15; margin: 0 0 14px; color: #fff; max-width: 460px; }
.auth-hero h2 em { font-style: normal; color: #ffd166; }
.auth-hero p.lead { font-size: 16px; color: #c5e3d2; max-width: 440px; margin: 0 0 28px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.hero-points li { display: flex; gap: 12px; align-items: center; font-size: 14px; color: #dff1e7; }
.hero-points li span {
    width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); flex-shrink: 0;
}
.hero-foot { font-size: 12px; color: #9cc7b0; }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-card {
    background: var(--card-bg);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 420px;
    padding: 36px 34px;
}
.auth-card.wide { max-width: 580px; }
.auth-brand { margin-bottom: 24px; }
.auth-brand .logo-dot { width: 46px; height: 46px; border-radius: 13px; font-size: 17px; margin-bottom: 14px; }
.auth-brand h1 { font-size: 23px; margin: 0; }
.auth-brand p { color: var(--muted); font-size: 14px; margin: 5px 0 0; }
.auth-links { text-align: center; font-size: 13px; margin-top: 18px; color: var(--muted); }
.auth-links a { color: var(--primary-dark); font-weight: 700; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

.logo-dot {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, #1fa055, var(--primary-dark));
    color: #fff; font-weight: 800; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(21, 128, 61, .3);
    flex-shrink: 0;
}

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-2); }
.field input, .field select, .field textarea, .form-inline input[type=date] {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: #9aa9a2; }
.field input:focus, .field select:focus, .field textarea:focus, .form-inline input:focus,
table.data input:focus, table.data select:focus {
    outline: none; border-color: var(--primary); box-shadow: var(--ring);
}
.field input[type=file] { padding: 8px; background: #fafcfb; }
.field input[type=checkbox], .field input[type=radio] { width: auto; }
.field small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
#school_code::placeholder { text-transform: none; letter-spacing: normal; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-inline { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.form-inline .field { margin-bottom: 0; min-width: 170px; }
.form-inline label.small { display: inline-flex; gap: 6px; align-items: center; padding-bottom: 10px; }
.form-section {
    grid-column: 1 / -1;
    font-size: 11px; font-weight: 800; color: var(--primary-dark);
    text-transform: uppercase; letter-spacing: .08em;
    margin: 8px 0 14px; padding-top: 16px; border-top: 1px dashed var(--border-strong);
}
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn, button.btn, .btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    background: linear-gradient(180deg, #18923f, var(--primary));
    color: #fff;
    border: 1px solid var(--primary-dark);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 700; font-family: inherit; line-height: 1.2;
    cursor: pointer; text-decoration: none;
    box-shadow: 0 1px 2px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.15);
    transition: transform .08s, box-shadow .15s, background .15s;
}
.btn:hover, .btn-primary:hover { background: linear-gradient(180deg, #16873a, var(--primary-dark)); box-shadow: 0 4px 12px rgba(21,128,61,.25); color: #fff; }
.btn:active, .btn-primary:active { transform: translateY(1px); }
.btn:focus-visible, .btn-primary:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { width: 100%; padding: 12px; font-size: 15px; }
.btn.btn-outline, .btn-outline { background: #fff; color: var(--text-2); border: 1px solid var(--border-strong); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.btn.btn-outline:hover, .btn-outline:hover { background: var(--primary-50); color: var(--primary-dark); border-color: #a9dcbd; box-shadow: none; }
.btn.btn-danger, .btn-danger { background: linear-gradient(180deg, #df5144, var(--danger)); border-color: #a92e22; }
.btn.btn-danger:hover, .btn-danger:hover { background: #b8352a; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-link {
    background: none; border: none; padding: 0; cursor: pointer; font-family: inherit;
    color: var(--primary-dark); font-size: 13px; font-weight: 600; text-decoration: none;
}
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--danger); }
.inline { display: inline; }

/* ---------------------------------------------------------------------
   App shell — dark sidebar + content column
   --------------------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w); flex-shrink: 0;
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column;
    overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
    background: linear-gradient(180deg, var(--forest) 0%, #0d3627 100%);
    color: #b9d3c6;
    z-index: 40;
}
.side-brand {
    display: flex; align-items: center; gap: 11px;
    padding: 20px 18px 18px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.side-brand .logo-dot { background: linear-gradient(135deg, #f2b632, #d68f09); color: #1f1600; box-shadow: 0 4px 14px rgba(232,163,23,.35); }
.side-brand-text { min-width: 0; display: flex; flex-direction: column; }
.side-brand-text strong { color: #fff; font-size: 15px; font-weight: 800; }
.side-brand-text span { font-size: 12px; color: #8fb3a2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.side-nav { flex: 1 0 auto; padding: 10px 12px 16px; }
.nav-section {
    font-size: 10.5px; font-weight: 800; color: #6f978a;
    text-transform: uppercase; letter-spacing: .1em;
    padding: 14px 10px 5px;
}
.nav-link {
    display: flex; align-items: center; gap: 11px;
    padding: 8px 11px; margin-bottom: 1px;
    border-radius: 10px;
    color: #c3dacf; text-decoration: none; font-size: 13.5px; font-weight: 500;
    transition: background .15s, color .15s;
    position: relative;
}
.nav-link .ico { opacity: .85; }
.nav-link > span:not(.lock) { flex: 1; }
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-link.active {
    background: linear-gradient(90deg, rgba(34,197,94,.22), rgba(34,197,94,.08));
    color: #fff; font-weight: 700;
}
.nav-link.active::before {
    content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px;
    border-radius: 0 4px 4px 0; background: var(--gold);
}
.nav-link.active .ico { color: #6ee7a0; opacity: 1; }
.nav-link.locked { color: #6f8f83; }
.nav-link .lock { color: var(--gold); opacity: .9; display: inline-flex; }

.side-plan {
    flex-shrink: 0;
    margin: 0 14px 16px; padding: 14px;
    border-radius: 12px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    font-size: 12.5px;
}
.side-plan-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; color: #fff; font-weight: 700; }
.side-plan-sub { color: #8fb3a2; margin-top: 3px; }
.side-plan-btn {
    display: block; text-align: center; margin-top: 10px; padding: 7px;
    border-radius: 8px; background: var(--gold); color: #1f1600;
    font-weight: 800; text-decoration: none; font-size: 12.5px;
}
.side-plan-btn:hover { background: #f2b632; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 14px;
    padding: 12px 28px;
    background: rgba(255,255,255,.86);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 700; font-size: 15px; color: var(--text-2); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: none; background: none; border: 1px solid var(--border); border-radius: 9px; padding: 7px; cursor: pointer; color: var(--text-2); }
.user-box { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.user-chip { display: flex; align-items: center; gap: 9px; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary-100), #b7ebcb);
    color: var(--primary-dark); font-weight: 800; font-size: 12.5px;
    border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta strong { font-size: 13px; }
.user-meta small { color: var(--muted); font-size: 11.5px; }
.logout-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-2); text-decoration: none; font-size: 13px; font-weight: 600;
    border: 1px solid var(--border); background: #fff;
    padding: 7px 12px; border-radius: 9px; white-space: nowrap;
}
.logout-link:hover { background: var(--danger-bg); color: var(--danger); border-color: #f5c3bd; }

.code-chip {
    font-family: var(--mono); font-size: 12px; font-weight: 700;
    background: var(--gold-50); color: #7a5200;
    border: 1px dashed #e6c068;
    padding: 3px 9px; border-radius: 7px; letter-spacing: .08em;
    white-space: nowrap;
}

.main { padding: 28px; width: 100%; max-width: 1240px; }
.scrim { display: none; }

/* ---------------------------------------------------------------------
   Page header, panels, dashboard hero
   --------------------------------------------------------------------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h2 { margin: 0 0 4px; font-size: 25px; font-weight: 800; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.welcome h2 { margin: 0 0 4px; font-size: 22px; }
.welcome p { color: var(--muted); margin: 0 0 28px; font-size: 14px; }

.hero {
    position: relative; overflow: hidden;
    border-radius: 18px; padding: 28px 30px; margin-bottom: 24px;
    color: #eaf6ef;
    background:
        radial-gradient(600px 260px at 100% 0%, rgba(232,163,23,.35), transparent 60%),
        linear-gradient(135deg, #0b2e22 0%, #115236 60%, #178049 100%);
    box-shadow: var(--shadow-lg);
    display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
}
.hero::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
    background-size: 20px 20px;
}
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #ffd166; }
.hero h2 { margin: 6px 0 6px; font-size: 27px; color: #fff; font-weight: 800; }
.hero p { margin: 0; color: #c5e3d2; }
.hero .code-chip { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.35); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .btn { background: var(--gold); color: #1f1600; border-color: #c98a0a; }
.hero .btn:hover { background: #f2b632; color: #1f1600; }
.hero .btn.btn-outline { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.3); }
.hero .btn.btn-outline:hover, .btn-outline:hover { background: rgba(255,255,255,.2); color: #fff; }

.panel {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 22px 24px;
    margin-bottom: 22px;
}
.panel h3 { margin: 0 0 14px; font-size: 16px; font-weight: 800; }
.panel .panel-sub { color: var(--muted); font-size: 13px; margin: -8px 0 16px; }

/* ---------------------------------------------------------------------
   Stat cards (colour rotates per card)
   --------------------------------------------------------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    --tone: var(--primary); --tone-bg: var(--primary-50);
    position: relative; overflow: hidden;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(16,40,30,.1); }
.stat-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tone); }
.stat-card:nth-child(6n+2) { --tone: #d18a06; --tone-bg: #fff4dc; }
.stat-card:nth-child(6n+3) { --tone: #2563eb; --tone-bg: #e9f0fe; }
.stat-card:nth-child(6n+4) { --tone: #7c3aed; --tone-bg: #f1ebfe; }
.stat-card:nth-child(6n+5) { --tone: #0d9488; --tone-bg: #e2f6f4; }
.stat-card:nth-child(6n+6) { --tone: #db2777; --tone-bg: #fdebf3; }
.stat-card .stat-ico {
    float: right; width: 40px; height: 40px; border-radius: 11px;
    display: grid; place-items: center;
    background: var(--tone-bg); color: var(--tone);
}
.stat-card .label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-bottom: 8px; }
.stat-card .value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1.15; letter-spacing: -.02em; }
.stat-card .small { margin-top: 4px; }

.notice-card { background: var(--warn-bg); border: 1px solid #f1dca0; border-radius: var(--radius); padding: 18px 20px; font-size: 13px; color: var(--warn); }

/* ---------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.data th, table.data td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data thead th {
    background: #f6f9f7; color: var(--muted);
    font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .06em;
    white-space: nowrap; border-bottom: 1px solid var(--border-strong);
}
table.data thead th:first-child { border-top-left-radius: 10px; }
table.data thead th:last-child { border-top-right-radius: 10px; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover td { background: #f7fbf8; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td a { font-weight: 600; text-decoration: none; }
table.data td a:hover { text-decoration: underline; }
table.data input[type=number], table.data input[type=text], table.data select {
    padding: 7px 9px; border: 1px solid var(--border-strong); border-radius: 8px;
    font-size: 13px; font-family: inherit; width: 100%; min-width: 70px; background: #fff;
}
table.data tfoot td { font-weight: 800; border-top: 2px solid var(--border-strong); border-bottom: none; background: #fafcfb; }
tr.muted td { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 36px 12px !important; }

/* ---------------------------------------------------------------------
   Badges, alerts, banners
   --------------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; letter-spacing: .01em; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-ok    { background: #e3f7ea; color: #117a3a; }
.badge-info  { background: var(--info-bg); color: var(--info); }
.badge-warn  { background: #fff1cc; color: #8a5d00; }
.badge-bad   { background: var(--danger-bg); color: #b83226; }
.badge-muted { background: #eef2f0; color: #5d6b63; }
.sidebar .badge-muted { background: rgba(255,255,255,.1); color: #c3dacf; }

.alert {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 12px 16px; border-radius: 11px; font-size: 13.5px; margin-bottom: 18px;
    border: 1px solid transparent; border-left-width: 4px;
}
.alert-danger  { background: var(--danger-bg); color: #a02c21; border-color: #f6c9c3; border-left-color: var(--danger); }
.alert-info    { background: var(--info-bg); color: #1a5a90; border-color: #c7def4; border-left-color: var(--info); }
.alert-success { background: #e8f8ee; color: #10652f; border-color: #bfe8cf; border-left-color: var(--primary); }
.alert-warn    { background: var(--warn-bg); color: var(--warn); border-color: #f1dca0; border-left-color: var(--gold); }

.banner { padding: 12px 16px; border-radius: 11px; font-size: 13.5px; margin-bottom: 20px; border: 1px solid transparent; }
.banner a { font-weight: 800; color: inherit; }
.banner-info { background: linear-gradient(90deg, #e7f1fc, #f2f8fe); color: #1a5a90; border-color: #c7def4; }
.banner-warn { background: linear-gradient(90deg, #fff3d6, #fffaf0); color: var(--warn); border-color: #f1dca0; }
.banner-bad  { background: linear-gradient(90deg, #fde6e3, #fff5f4); color: #a02c21; border-color: #f6c9c3; }

.demo-hint { margin-top: 20px; padding: 12px; background: var(--primary-50); border-radius: 10px; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ---------------------------------------------------------------------
   Utilities & misc components
   --------------------------------------------------------------------- */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt0 { margin-top: 0; }
.right { text-align: right; }
.lvl { font-weight: 800; font-family: var(--mono); font-size: .95em; color: var(--primary-dark); }

.locked-panel {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
    padding: 52px 32px; text-align: center; max-width: 560px; margin: 36px auto;
}
.locked-panel .locked-icon { color: #b07800;
    width: 68px; height: 68px; margin: 0 auto 6px; border-radius: 20px;
    display: grid; place-items: center; font-size: 30px;
    background: var(--gold-50); border: 1px solid #f3dca4;
}
.locked-panel h2 { font-size: 21px; margin: 14px 0 8px; }
.locked-panel p { color: var(--muted); }

/* Subscription plan cards */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.plan {
    border: 1px solid var(--border); border-radius: 16px; padding: 22px; background: #fff;
    display: flex; flex-direction: column; position: relative;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.plan:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(16,40,30,.1); border-color: #bfe3cc; }
.plan.current { border: 2px solid var(--primary); background: linear-gradient(180deg, var(--primary-50), #fff 45%); }
.plan h4 { margin: 0 0 4px; font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.plan .price { font-size: 24px; font-weight: 800; color: var(--primary-dark); margin: 12px 0 2px; letter-spacing: -.02em; }
.plan .price small { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.plan ul { padding: 0; margin: 14px 0; list-style: none; font-size: 13px; flex: 1; }
.plan li { padding: 4px 0; }
.plan li.no { color: #a8b3ad; text-decoration: line-through; }
.plan .btn { align-self: flex-start; }

.code-hero {
    text-align: center; padding: 22px; margin: 14px 0 20px;
    background: linear-gradient(135deg, var(--gold-50), #fffdf6);
    border: 2px dashed #e6c068; border-radius: 16px;
}
.code-hero .code { font-family: var(--mono); font-size: 36px; font-weight: 800; letter-spacing: .14em; color: #6b4700; }

/* Attendance pills */
.att-opts { display: flex; gap: 5px; flex-wrap: wrap; }
.att-opts label { cursor: pointer; }
.att-opts input { display: none; }
.att-opts span {
    display: inline-block; padding: 5px 12px; border-radius: 999px;
    border: 1px solid var(--border-strong); font-size: 12px; font-weight: 700; color: var(--muted);
    background: #fff; transition: all .12s;
}
.att-opts span:hover { border-color: var(--primary); color: var(--primary-dark); }
.att-opts input:checked + span.present { background: var(--primary); color: #fff; border-color: var(--primary); }
.att-opts input:checked + span.absent  { background: var(--danger); color: #fff; border-color: var(--danger); }
.att-opts input:checked + span.late    { background: #d68910; color: #fff; border-color: #d68910; }
.att-opts input:checked + span.excused { background: var(--info); color: #fff; border-color: var(--info); }

.bar { height: 8px; background: #e6eeea; border-radius: 99px; overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #22c55e, var(--primary)); }

details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* Report card / receipt */
.report-card {
    background: #fff; padding: 32px; border-radius: 16px; border: 1px solid var(--border);
    box-shadow: var(--shadow); margin-bottom: 26px; page-break-after: always;
    border-top: 6px solid var(--primary);
}
.rc-head { text-align: center; border-bottom: 2px solid var(--text); padding-bottom: 12px; margin-bottom: 16px; }
.rc-head h2 { margin: 0; font-size: 21px; text-transform: uppercase; letter-spacing: .04em; }
.rc-head p { margin: 3px 0; font-size: 12px; color: var(--muted); }
/* Letterhead with logo: logo | centred text | spacer of the same width */
.letterhead { display: flex; align-items: center; gap: 16px; }
.letterhead .lh-text { flex: 1; min-width: 0; }
.letterhead .lh-logo, .letterhead .lh-balance { width: 84px; height: 84px; object-fit: contain; flex-shrink: 0; }
.letterhead .lh-title { font-weight: 700; color: var(--text) !important; margin-top: 8px !important; letter-spacing: .04em; text-transform: uppercase; }
.print-only { display: none !important; }
.side-logo { width: 38px; height: 38px; object-fit: contain; border-radius: 9px; background: #fff; padding: 3px; flex-shrink: 0; }

/* Passport photos */
.passport { width: 105px; height: 140px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: #f4f7f5; display: inline-block; flex-shrink: 0; }
.passport-empty { display: inline-grid; place-items: center; font-size: 28px; font-weight: 800; color: #9aa7a0; }
.passport-sm { width: 34px; height: 44px; font-size: 13px; border-radius: 6px; }
.rc-learner { display: flex; gap: 18px; align-items: flex-start; }
.rc-learner .rc-meta { flex: 1; }
.rc-learner .passport { width: 90px; height: 120px; }
.profile-top { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; margin-bottom: 24px; }
.profile-top > .stat-grid { flex: 1 1 320px; margin: 0; }
.photo-field { display: flex; gap: 16px; align-items: center; }
.photo-field .passport { width: 90px; height: 120px; }
.logo-preview { width: 120px; height: 120px; object-fit: contain; border: 1px dashed var(--border); border-radius: 12px; background: #fff; padding: 6px; }
td.actions-cell { white-space: nowrap; text-align: right; }
.rc-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 18px; font-size: 13px; margin-bottom: 16px; }
.rc-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 30px; font-size: 13px; }
.rc-sign div { border-top: 1px solid #9aa7a0; padding-top: 7px; color: var(--text-2); }

/* ---------------------------------------------------------------------
   Responsive — sidebar becomes a slide-in drawer
   --------------------------------------------------------------------- */
@media (max-width: 980px) {
    .auth-wrapper { grid-template-columns: 1fr; }
    .auth-hero { padding: 32px 26px; }
    .auth-hero h2 { font-size: 26px; }
    .hero-points, .hero-foot { display: none; }
    .auth-hero p.lead { margin-bottom: 0; }
}
@media (max-width: 900px) {
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0;
        transform: translateX(-100%); transition: transform .22s ease;
        box-shadow: var(--shadow-lg);
    }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(8, 25, 18, .45); z-index: 35; }
    .menu-btn { display: inline-flex; }
    .topbar { padding: 10px 16px; }
    .main { padding: 20px 16px; }
    .hide-sm { display: none !important; }
    .topbar .code-chip { display: none; }
    .page-head h2 { font-size: 22px; }
    .hero { padding: 22px; }
    .hero h2 { font-size: 22px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .stat-card { padding: 14px 14px 14px 16px; }
    .stat-card .value { font-size: 21px; }
    .stat-card .stat-ico { width: 32px; height: 32px; border-radius: 9px; }
    .stat-card .stat-ico .ico { width: 16px; height: 16px; }
}

/* ---------------------------------------------------------------------
   Print
   --------------------------------------------------------------------- */
@media print {
    .topbar, .sidebar, .scrim, .no-print, .banner, .alert, #idle-warning, .hero-actions { display: none !important; }
    body { background: #fff; }
    .shell, .content { display: block; }
    .main { padding: 0; max-width: none; }
    .panel, .report-card { box-shadow: none; border: none; padding: 0; }
    .print-only { display: flex !important; }
    .page-head .actions { display: none !important; }
    .main:has(.report-card) > .page-head { display: none; }   /* report cards & receipts carry their own heading */
    .letterhead .lh-logo { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .report-card { border-top: none; }
    table.data thead th { background: #f2f2f2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Feature checklist (dashboard subscription card) */
.check-list { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; gap: 7px; font-size: 13px; }
.check-list li { display: flex; align-items: center; gap: 9px; }
.check-list li .tick { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: #e3f7ea; color: #117a3a; flex-shrink: 0; }
.check-list li.off { color: var(--muted); }
.check-list li.off .tick { background: #f1f3f2; color: #9aa7a0; }
