/* =====================================================================
   SCIT Result Portal — Design tokens
   Palette: institutional navy + brass/gold accent + warm paper for print
   Type: 'Fraunces' (display/report headers) + 'Inter' (UI)
   ===================================================================== */
:root {
    --navy-950: #0b1220;
    --navy-900: #0f1b30;
    --navy-800: #16294a;
    --navy-700: #1d3763;
    --navy-600: #2a4a86;
    --gold-500: #b8862b;
    --gold-400: #d4a444;
    --gold-100: #f6ecd6;
    --paper: #fbf9f4;
    --paper-line: #e7e1d3;
    --ink: #1c2333;
    --ink-soft: #4a5468;
    --green-ok: #1f7a4d;
    --red-bad: #b3372d;
    --amber: #b8862b;
    --radius: 10px;
    --shadow: 0 10px 30px rgba(11,18,32,0.08);
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin:0; padding:0; }
body {
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
    line-height: 1.5;
}
a { color: var(--navy-700); text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--navy-900); margin: 0 0 .5rem; font-weight: 600; }

/* ---------- Layout shells ---------- */
.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: var(--navy-950);
}
@media (max-width: 860px) { .auth-shell { grid-template-columns: 1fr; } }

.auth-visual {
    background: radial-gradient(circle at 20% 20%, var(--navy-700), var(--navy-950) 70%);
    color: var(--gold-100);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    position: relative;
    overflow: hidden;
}
.auth-visual::after {
    content: "";
    position: absolute; inset: 0;
    background-image: repeating-linear-gradient(45deg, rgba(212,164,68,0.04) 0 2px, transparent 2px 40px);
}
.auth-visual .crest {
    width: 64px; height: 64px; border: 2px solid var(--gold-400); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-size: 1.5rem; color: var(--gold-400); margin-bottom: 2rem;
}
.auth-visual h1 { color: #fff; font-size: 2.4rem; max-width: 420px; position: relative; z-index: 1; }
.auth-visual p { color: rgba(246,236,214,0.75); max-width: 400px; position: relative; z-index: 1; }

.auth-form-wrap {
    display: flex; align-items: center; justify-content: center; padding: 2rem;
    background: var(--paper);
}
.auth-form {
    width: 100%; max-width: 380px;
}
.auth-form h2 { font-size: 1.6rem; }
.auth-form .sub { color: var(--ink-soft); margin-bottom: 2rem; }

/* ---------- Form elements ---------- */
label { display: block; font-size: .82rem; font-weight: 600; color: var(--navy-800); margin-bottom: .35rem; }
input, select, textarea {
    width: 100%; padding: .65rem .85rem; border: 1.5px solid #d9d2bd; border-radius: 8px;
    font-family: var(--font-body); font-size: .95rem; background: #fff; color: var(--ink);
    transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-600); }
.field { margin-bottom: 1.1rem; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .7rem 1.4rem; border-radius: 8px; border: none; font-weight: 600; font-size: .92rem;
    cursor: pointer; font-family: var(--font-body); transition: transform .1s, box-shadow .15s;
}
.btn-primary { background: var(--navy-800); color: #fff; }
.btn-primary:hover { background: var(--navy-700); }
.btn-gold { background: var(--gold-500); color: #fff; }
.btn-gold:hover { background: var(--gold-400); }
.btn-outline { background: transparent; border: 1.5px solid var(--navy-700); color: var(--navy-800); }
.btn-outline:hover { background: var(--navy-800); color: #fff; }
.btn-danger { background: var(--red-bad); color: #fff; }
.btn-sm { padding: .4rem .8rem; font-size: .8rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .88rem; }
.alert-error { background: #fdecea; color: var(--red-bad); border: 1px solid #f3c8c3; }
.alert-success { background: #e9f6ee; color: var(--green-ok); border: 1px solid #bfe3cd; }
.alert-info { background: #eaf1fc; color: var(--navy-700); border: 1px solid #c5d7f2; }

/* ---------- App shell (dashboard layout) ---------- */
:root { --sidebar-w: 240px; }

.app-shell { display: block; min-height: 100vh; }

.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
    background: var(--navy-950); color: var(--gold-100); padding: 1.5rem 1rem;
    display: flex; flex-direction: column; gap: .2rem;
    z-index: 200; overflow-y: auto;
    transition: transform .25s ease;
}
.sidebar .brand { display: flex; align-items: center; gap: .6rem; padding: .5rem .5rem 1.5rem; }
.sidebar .brand .mark { width: 34px; height: 34px; border-radius: 8px; background: var(--gold-500); display:flex; align-items:center; justify-content:center; font-family: var(--font-display); font-weight:700; color:#fff; }
.sidebar .brand strong { color: #fff; font-size: .95rem; display:block; }
.sidebar .brand span { color: rgba(246,236,214,0.55); font-size: .72rem; }
.sidebar a.nav-link {
    display: flex; align-items: center; gap: .6rem; padding: .75rem .8rem; border-radius: 8px;
    color: rgba(246,236,214,0.75); font-size: .88rem; font-weight: 500;
}
.sidebar a.nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar a.nav-link.active { background: var(--gold-500); color: #fff; }
.sidebar .nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(246,236,214,0.4); padding: 1rem .8rem .3rem; }
.sidebar .sidebar-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-close-btn { display: none; }

.menu-toggle-btn { display: none; background: none; border: none; font-size: 1.4rem; line-height: 1; cursor: pointer; padding: .4rem .6rem; color: var(--navy-900); margin-right: .4rem; }
.sidebar-backdrop { display: none; }

/* Main content is always offset by the fixed sidebar's width on desktop. */
.main-content { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        width: 260px; max-width: 82vw;
        box-shadow: 8px 0 24px rgba(0,0,0,0.25);
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .sidebar-close-btn {
        display: flex; align-items: center; justify-content: center;
        position: absolute; top: 1rem; right: 1rem; width: 32px; height: 32px;
        background: rgba(255,255,255,0.08); border: none; border-radius: 8px;
        color: #fff; font-size: 1.1rem; cursor: pointer;
    }
    .menu-toggle-btn { display: inline-flex; align-items: center; justify-content: center; }
    .sidebar-backdrop.open {
        display: block; position: fixed; inset: 0; background: rgba(11,18,32,0.55); z-index: 150;
    }
}

.topbar {
    display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.6rem;
    background: #fff; border-bottom: 1px solid var(--paper-line); position: sticky; top:0; z-index: 5;
    gap: .6rem;
}
.topbar .topbar-left { display: flex; align-items: center; min-width: 0; }
.topbar h1 { font-size: 1.25rem; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .user-chip { display:flex; align-items:center; gap:.6rem; font-size:.85rem; flex-shrink: 0; }
.topbar .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--navy-700); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:600; font-size:.8rem; }

.content { padding: 1.6rem; max-width: 1400px; }

@media (max-width: 600px) {
    .content { padding: 1rem; }
    .topbar { padding: .8rem 1rem; }
    .card { padding: 1rem; }
    .topbar .user-chip > div:first-child { display: none; } /* hide name text, keep avatar, saves space */
}

/* ---------- Cards / stats ---------- */
.card { background: #fff; border: 1px solid var(--paper-line); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1.2rem; }
.card-title { font-size: 1rem; font-weight: 700; color: var(--navy-900); margin-bottom: 1rem; display:flex; align-items:center; justify-content:space-between; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.stat-card { background: #fff; border: 1px solid var(--paper-line); border-radius: var(--radius); padding: 1.2rem; border-left: 4px solid var(--gold-500); }
.stat-card .num { font-family: var(--font-display); font-size: 1.9rem; color: var(--navy-900); font-weight: 700; }
.stat-card .label { font-size: .8rem; color: var(--ink-soft); margin-top: .2rem; }

/* ---------- Tables ---------- */
table.data-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
table.data-table th { background: var(--navy-950); color: var(--gold-100); text-align: left; padding: .65rem .8rem; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
table.data-table td { padding: .6rem .8rem; border-bottom: 1px solid var(--paper-line); }
table.data-table tbody tr:hover { background: #faf7ee; }
table.data-table tbody tr:nth-child(even) { background: #fdfcf8; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--paper-line); }

.badge { display: inline-block; padding: .2rem .55rem; border-radius: 20px; font-size: .72rem; font-weight: 700; }
.badge-a { background:#e9f6ee; color: var(--green-ok); }
.badge-b { background:#eaf1fc; color: var(--navy-700); }
.badge-c { background:#fff6e0; color: var(--amber); }
.badge-f { background:#fdecea; color: var(--red-bad); }
.badge-neutral { background:#f1efe6; color: var(--ink-soft); }

/* ---------- Report card (print-style) ---------- */
.report-card { background:#fff; padding: 0; max-width: 950px; margin: 0 auto; }
.report-border {
    border: 2.5px solid var(--navy-900);
    border-radius: 16px;
    padding: 1.3rem 1.6rem;
    background: #fff;
    box-shadow: 0 12px 32px rgba(11,18,32,0.10);
}
.report-border-inner {
    border: 1px solid var(--gold-500);
    border-radius: 10px;
    padding: 1.1rem 1.3rem;
}
.report-header { display: flex; align-items: center; justify-content: space-between; gap: .8rem; border-bottom: 2.5px double var(--navy-800); padding-bottom: .7rem; margin-bottom: .8rem; }
.report-header .header-logo-box { width: 72px; flex-shrink: 0; text-align: center; }
.report-header .header-logo-box img.logo { width: 60px; height: 60px; object-fit: contain; border-radius: 50%; }
.report-header .header-center { flex: 1; text-align: center; min-width: 0; }
.report-header h2 { font-size: 1.3rem; margin-bottom: .1rem; letter-spacing: .02em; color: var(--red-bad); }
.report-header .meta { font-size: .74rem; color: var(--ink-soft); }
.report-header .term-title { font-family: var(--font-display); font-size: 1rem; color: var(--gold-500); margin-top: .35rem; font-weight: 600; }

.passport-box {
    width: 72px; height: 88px;
    flex-shrink: 0;
    border: 2px solid var(--navy-800);
    border-radius: 10px;
    background: #f9f7f0;
    display: flex; align-items: center; justify-content: center;
    font-size: .6rem; color: var(--ink-soft); text-align: center; line-height: 1.2;
    overflow: hidden;
}
.passport-box img { width: 100%; height: 100%; object-fit: cover; }

.student-info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem 1.3rem; margin-bottom: .8rem; font-size: .78rem; background: #f9f7f0; border-radius: 10px; padding: .6rem .9rem; }
.student-info-grid div strong { color: var(--navy-900); }

.report-table-wrap { border: 1.5px solid var(--navy-900); border-radius: 10px; overflow-x: auto; margin-bottom: .8rem; -webkit-overflow-scrolling: touch; }
.report-table { width: 100%; border-collapse: collapse; font-size: .72rem; }
.report-table th { background: var(--navy-900); color: #fff; padding: .4rem .35rem; font-size: .62rem; text-transform: uppercase; text-align: center; }
.report-table th.subject-col { text-align: left; }
.report-table td { padding: .3rem .35rem; text-align: center; border-top: 1px solid var(--paper-line); }
.report-table td.subject-col { text-align: left; font-weight: 600; color: var(--navy-900); }
.report-table tfoot td { font-weight: 700; background: var(--gold-100); border-top: 1.5px solid var(--gold-500); }
.report-table .prior-col { background: #f4f1e8; color: var(--ink-soft); }
.report-table .cumulative-col { background: #eef3fb; font-weight: 700; color: var(--navy-800); }

.section-label { font-family: var(--font-display); font-size: .82rem; font-weight: 600; color: var(--navy-900); margin: .7rem 0 .4rem; border-bottom: 1px solid var(--paper-line); padding-bottom: .2rem; }

.psych-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: .7rem; }
.psych-title { font-family: var(--font-display); font-weight: 700; font-size: .76rem; margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .03em; }
.psych-table-wrap { border: 1px solid var(--paper-line); border-radius: 8px; overflow: hidden; }
table.psych-table { width: 100%; border-collapse: collapse; font-size: .72rem; }
.psych-table th { padding: .35rem .5rem; text-align: left; font-size: .66rem; text-transform: uppercase; }
.psych-table th:last-child, .psych-table td:last-child { text-align: center; width: 60px; }
.psych-table td { padding: .3rem .5rem; border-top: 1px solid var(--paper-line); }
.psych-table td:last-child { font-weight: 700; }
.psych-head-gold th { background: var(--gold-400); color: #3a2c05; }
.psych-head-navy th { background: var(--navy-900); color: #fff; }

/* ---------- Activity report: Academic Performance / Skills Development / Behavioural Assessment ---------- */
.assess-block { margin-bottom: .8rem; }
.assess-header {
    background: var(--navy-900); color: #fff; padding: .35rem .7rem;
    border-radius: 8px 8px 0 0; font-family: var(--font-display); font-weight: 700;
    font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
}
.assess-table { width: 100%; border-collapse: collapse; font-size: .72rem; border: 1px solid var(--paper-line); border-top: none; }
.assess-table th { background: var(--gold-400); color: #3a2c05; padding: .3rem .3rem; font-size: .68rem; text-align: center; width: 30px; }
.assess-table th.label-col { background: transparent; }
.assess-table td { padding: .28rem .4rem; text-align: center; border-top: 1px solid var(--paper-line); }
.assess-table td.label-col { text-align: left; font-weight: 600; color: var(--navy-900); }
.assess-box { display: inline-block; width: 14px; height: 14px; border: 1.3px solid var(--navy-700); border-radius: 3px; position: relative; }
.assess-box.checked { background: var(--gold-500); border-color: var(--gold-500); }
.assess-box.checked::after { content: "\2713"; color: #fff; font-size: 10px; font-weight: 700; position: absolute; top: -3px; left: 1px; }

.remark-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .7rem; }
.remark-grid-4 { grid-template-columns: 1fr 1fr; }
.remark-box { background: #f9f7f0; border: 1px solid var(--paper-line); border-radius: 10px; padding: .5rem .65rem; font-size: .74rem; }
.remark-box .label { font-size: .62rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gold-500); font-weight: 700; margin-bottom: .15rem; }

.trait-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; font-size: .72rem; margin-bottom: .7rem; }
.trait-row { display: flex; justify-content: space-between; align-items: center; padding: .18rem 0; border-bottom: 1px dashed var(--paper-line); }
.trait-dots { display: flex; gap: 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #e4dfd0; }
.dot.filled { background: var(--gold-500); }

.grading-key { font-size: .66rem; color: var(--ink-soft); display: flex; gap: .8rem; flex-wrap: wrap; margin-bottom: .7rem; background: #f9f7f0; border-radius: 8px; padding: .4rem .7rem; }

.promotion-banner {
    background: var(--gold-500); color: #fff; text-align: center;
    font-family: var(--font-display); font-weight: 700; font-size: .85rem;
    letter-spacing: .06em; text-transform: uppercase;
    border-radius: 8px; padding: .5rem .8rem; margin-bottom: .7rem;
}
.unassessed-box {
    background: #fdf6e3; border: 1px solid #eee2c0; border-radius: 8px;
    padding: .5rem .7rem; margin-bottom: .7rem; font-size: .74rem;
}
.unassessed-box .label { font-size: .64rem; text-transform: uppercase; letter-spacing: .04em; color: var(--amber); font-weight: 700; margin-bottom: .15rem; }
.unassessed-box p { margin: 0; color: var(--ink-soft); }
.sig-row { display: flex; justify-content: space-between; align-items: flex-end; margin-top: .9rem; font-size: .72rem; gap: .5rem; }
.sig-row .box { text-align: center; flex: 1; }
.sig-row .line { width: 140px; border-bottom: 1px solid var(--ink); margin: 0 auto .25rem; height: 22px; }
.sig-row .sig-img { max-width: 140px; max-height: 42px; object-fit: contain; display: block; margin: 0 auto .25rem; }
.sig-row .stamp-box { width: 70px; height: 70px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin-bottom: 1.4rem; }
.sig-row .stamp-box img { max-width: 100%; max-height: 100%; object-fit: contain; opacity: .88; }
.sig-row .stamp-placeholder { width: 60px; height: 60px; border: 1px dashed var(--paper-line); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .58rem; color: var(--ink-soft); text-align: center; line-height: 1.1; }

/* ---------- Emerald theme (green/gold/red) — scoped only to the standard result sheet ---------- */
.report-card-emerald {
    --report-green-dark: #14532d;
    --report-green: #1e6b3e;
    --report-gold: #c9a227;
    --report-red: #b3272d;
}
.report-card-emerald .report-border { border-color: var(--report-gold); }
.report-card-emerald .report-border-inner { border-color: var(--report-green); }
.report-card-emerald .report-header { border-bottom-color: var(--report-green-dark); }
.report-card-emerald .report-header h2 { color: var(--report-red); }
.report-card-emerald .report-header .term-title {
    background: var(--report-green-dark); color: #fff; border: 1px solid var(--report-gold);
    border-radius: 20px; padding: .3rem 1rem; display: inline-block; margin-top: .5rem;
}
.report-card-emerald .report-motto { color: var(--report-green-dark); }
.report-card-emerald .student-info-icons {
    border: 1.5px solid var(--report-green); background: #f6faf6; border-radius: 10px;
}
.report-card-emerald .info-icon { margin-right: .25rem; }
.report-card-emerald .passport-box { border-color: var(--report-green-dark); }
.report-card-emerald .report-table-wrap { border-color: var(--report-green-dark); }
.report-card-emerald .report-table th { background: var(--report-green-dark); }
.report-card-emerald .report-table th.group-head { background: var(--report-green); }
.report-card-emerald .report-table tfoot td { background: #fdf6e3; border-top-color: var(--report-gold); }
.report-card-emerald .prior-col { background: #f3f7f3 !important; color: var(--ink-soft); }
.report-card-emerald .cumulative-col { background: #fdf9ec !important; color: var(--report-green-dark); }
.report-card-emerald .report-table .badge {
    border-radius: 50%; width: 26px; height: 26px; display: inline-flex; align-items: center;
    justify-content: center; padding: 0; font-weight: 700;
}
.report-card-emerald .badge-a { background: #e3f5e6; color: var(--report-green); }
.report-card-emerald .badge-b { background: #e6f0fb; color: #1d4ed8; }
.report-card-emerald .badge-c { background: #fff6e0; color: var(--report-gold); }
.report-card-emerald .badge-f { background: #fdecea; color: var(--report-red); }
.report-card-emerald .promotion-banner { background: var(--report-green-dark); }
.report-card-emerald .grading-key { border: 1px solid #eee2c0; }
.report-card-emerald .psych-head-navy th { background: var(--report-green-dark); }

@page { size: A4; margin: 10mm; }
@media print {
    .no-print { display: none !important; }
    body { background: #fff; }
    .report-card { max-width: 100%; }
    .report-border { border: 2px solid var(--navy-900); padding: .9rem 1.1rem; box-shadow: none; }
    .report-border-inner { padding: .8rem 1rem; }
    .app-shell, .content { display: block; padding: 0; margin: 0; }
    .main-content { margin-left: 0 !important; }
    .report-table, .student-info-grid, .remark-grid, .trait-grid { page-break-inside: avoid; }
}

/* ---------- Utility ---------- */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.text-muted { color: var(--ink-soft); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
@media (max-width: 700px) {
    .grid-2, .grid-3, .student-info-grid, .remark-grid, .remark-grid-4, .trait-grid, .psych-tables { grid-template-columns: 1fr; }
    .btn { min-height: 42px; }
    table.data-table td, table.data-table th { padding: .55rem .6rem; }
    .flex.gap-1 { flex-wrap: wrap; }
    .report-border { padding: .8rem .9rem; }
    .report-border-inner { padding: .7rem .8rem; }
    .passport-box { width: 56px; height: 68px; }
    .header-logo-box { width: 52px; }
    .header-logo-box img.logo { width: 44px; height: 44px; }
}
@media (max-width: 480px) {
    .report-table { font-size: .6rem; }
    .report-table th, .report-table td { padding: .22rem .25rem; }
    .psych-table { font-size: .64rem; }
    .psych-table th, .psych-table td { padding: .25rem .35rem; }
    .assess-table { font-size: .64rem; }
    .assess-table th, .assess-table td { padding: .2rem .25rem; }
    .assess-box { width: 11px; height: 11px; }
    .assess-box.checked::after { font-size: 8px; top: -3px; left: 0; }
    .assess-header { font-size: .66rem; padding: .3rem .5rem; }
    .student-info-grid { font-size: .68rem; gap: .25rem .8rem; padding: .5rem .6rem; }
    .grading-key { font-size: .58rem; gap: .5rem; padding: .3rem .5rem; }
    .remark-box { font-size: .66rem; padding: .4rem .5rem; }
    .remark-box .label { font-size: .58rem; }
    .sig-row { font-size: .64rem; }
    .sig-row .line { width: 100px; height: 18px; }
    .sig-row .sig-img { max-width: 100px; max-height: 32px; }
    .sig-row .stamp-box { width: 48px; height: 48px; margin-bottom: 1.1rem; }
    .sig-row .stamp-placeholder { width: 42px; height: 42px; font-size: .5rem; }
    .report-header h2 { font-size: 1.05rem; }
    .promotion-banner { font-size: .7rem; padding: .4rem .6rem; }
    .report-header .meta { font-size: .66rem; }
    .report-header .term-title { font-size: .85rem; }
    .passport-box { width: 46px; height: 56px; font-size: .5rem; }
    .header-logo-box { width: 42px; }
    .header-logo-box img.logo { width: 36px; height: 36px; }
    .report-border { padding: .5rem .55rem; border-radius: 10px; }
    .report-border-inner { padding: .5rem .55rem; border-radius: 7px; }
    .section-label { font-size: .7rem; }
}
.pill { display:inline-block; padding:.15rem .6rem; border-radius:20px; font-size:.72rem; font-weight:600; background:var(--navy-800); color:#fff; }
.empty-state { text-align:center; padding: 3rem 1rem; color: var(--ink-soft); }

/* =====================================================================
   LEARNER'S REPORT  (Reception / Nursery / KG and Primary report cards)
   ===================================================================== */
.lr-card {
    --lr-red: #d63a2f; --lr-crimson: #a91f2b; --lr-maroon: #8e1b26; --lr-pink: #f1c3cc;
    --lr-line: #222; --lr-ink: #1a1a1a;
    position: relative; background: #fff; color: var(--lr-ink); max-width: 794px; margin: 0 auto;
    font-family: 'Times New Roman', Georgia, serif; font-size: 12px; line-height: 1.25;
    border: 1px solid #ddd; box-shadow: 0 8px 26px rgba(11,18,32,.10);
}
.lr-banner {
    position: absolute; left: 0; top: 0; bottom: 0; width: 34px;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    writing-mode: vertical-rl; transform: rotate(180deg);
    font: 800 25px/1 Arial, Helvetica, sans-serif; letter-spacing: .06em; color: var(--lr-pink); white-space: nowrap;
}
.lr-page { padding: 14px 18px 12px 46px; }

.lr-header { display: flex; align-items: center; gap: 16px; }
.lr-logo { width: 170px; flex-shrink: 0; text-align: center; }
.lr-logo img { max-width: 100%; max-height: 84px; object-fit: contain; }
.lr-school { flex: 1; text-align: center; font-family: Arial, Helvetica, sans-serif; font-size: 10.5px; color: #222; }
.lr-school h1 { margin: 0 0 3px; font: 700 25px/1.05 'Times New Roman', Georgia, serif; letter-spacing: .04em; color: var(--lr-crimson); text-transform: uppercase; }

.lr-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin: 4px 0 8px; }
.lr-top-left { flex: 1; min-width: 0; }
.lr-top-right { width: 236px; flex-shrink: 0; }
.lr-title-badge {
    display: inline-block; margin: 6px 0 12px; background: linear-gradient(#e9553f, #cf3328); color: #fff; font: 800 18px/1 Arial, Helvetica, sans-serif;
    letter-spacing: .02em; padding: 9px 20px; border-radius: 9px; border: 1.5px solid #b72a21; box-shadow: 0 2px 4px rgba(0,0,0,.25);
}
table.lr-attendance { border: 2px solid #111; border-radius: 6px; border-collapse: separate; border-spacing: 0; font-family: Arial, Helvetica, sans-serif; width: 100%; overflow: hidden; }
.lr-attendance th { font-size: 15px; font-weight: 800; padding: 4px 6px; text-align: center; letter-spacing: .02em; }
.lr-attendance td { border-top: 1.5px solid #111; padding: 2px 6px; font-size: 11px; font-weight: 700; }
.lr-attendance td:last-child { border-left: 1.5px solid #111; width: 36px; text-align: center; font-family: 'Times New Roman', serif; font-style: italic; font-size: 13px; }

.lr-info-left > div, .lr-info-right > div { margin-bottom: 3px; font-size: 11.5px; }
.lr-info-right { margin-top: 12px; }
.lr-top b { font-family: Arial, Helvetica, sans-serif; font-size: 10.5px; }
.lr-top i { font-size: 12.5px; }
.lr-name { font-size: 14px; font-weight: 700; } .lr-name b { font-size: 12px; }

.lr-table { width: 100%; border-collapse: collapse; font-family: Arial, Helvetica, sans-serif; font-size: 10.5px; margin-bottom: 8px; }
.lr-table th, .lr-table td { border: 1.3px solid var(--lr-line); padding: 2px 5px; text-align: center; }
.lr-table thead th { font-size: 10px; font-weight: 800; padding: 5px 4px; }
.lr-table td.lr-subject, .lr-table th.lr-subject { text-align: left; font-weight: 700; width: 30%; }
.lr-table tr.lr-subhead td { font-size: 10px; font-weight: 700; }
.lr-table tr.lr-subhead td:first-child { border-right: 1.3px solid var(--lr-line); }

table.lr-summary { width: 100%; border-collapse: collapse; margin: 6px 0 10px; font-family: Arial, Helvetica, sans-serif; border: 2px dashed #555; background: #fff; }
.lr-summary th { font-size: 10.5px; font-weight: 800; padding: 6px 4px 2px; text-align: center; }
.lr-summary td { font-size: 14px; font-weight: 700; padding: 2px 4px 7px; text-align: center; }
.lr-unassessed { font: italic 10.5px Arial, sans-serif; margin: -4px 0 8px; color: #444; }
.lr-empty { border: 1.3px dashed #999; padding: 18px; text-align: center; font: 13px Arial, sans-serif; color: #555; margin-bottom: 10px; }

.lr-skills { margin-bottom: 8px; }
.lr-skills-early { display: grid; grid-template-columns: 1fr 292px; gap: 14px; align-items: start; }
.lr-skills-primary { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.lr-dev-title { font: 800 11px Arial, sans-serif; margin-bottom: 2px; }
.lr-dev-group { font: 700 11px Arial, sans-serif; text-decoration: underline; margin-top: 3px; }
.lr-dev-row { display: flex; align-items: baseline; gap: 4px; font: 700 9.5px Arial, sans-serif; margin-top: 2px; }
.lr-dev-label { flex: 0 0 118px; white-space: nowrap; }
.lr-dev-text { flex: 1; min-height: 14px; border-bottom: 1.3px dotted #333; font: italic 12px 'Times New Roman', Georgia, serif; padding: 0 3px; }

table.lr-rating { width: 100%; border-collapse: collapse; font-family: Arial, Helvetica, sans-serif; border: 1.6px solid var(--lr-line); }
.lr-rating th { border: 1.3px solid var(--lr-line); font-size: 11px; font-weight: 800; padding: 2px 0; width: 26px; text-align: center; }
.lr-rating th.lr-rating-title { text-align: left; padding-left: 6px; width: auto; font-size: 11px; }
.lr-rating td { border: 1.3px solid var(--lr-line); font-size: 10px; font-weight: 700; padding: 2px 4px; height: 17px; text-align: center; }
.lr-rating td:first-child { text-align: left; font-style: italic; font-weight: 700; }
.lr-rating td.lr-muted { color: #777; font-weight: 400; }
.lr-key { font: 7.5px Arial, sans-serif; margin-top: 3px; text-align: left; color: #222; }
.lr-key-wide { margin: -4px 0 8px; }

.lr-comments { position: relative; border: 2px solid var(--lr-maroon); border-radius: 12px; padding: 14px 12px 6px; margin: 14px 0 8px; }
.lr-comments-title { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); background: #fff; padding: 0 8px; font: 800 13px Arial, sans-serif; color: var(--lr-maroon); letter-spacing: .02em; }
.lr-comment-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; font: 700 10.5px Arial, sans-serif; }
.lr-c-label { flex: 0 0 90px; }
.lr-c-text { flex: 1; min-height: 15px; border-bottom: 1.3px dotted #333; font: italic 12.5px 'Times New Roman', Georgia, serif; padding: 0 3px; }
.lr-stamp { position: absolute; right: 8px; bottom: -22px; width: 92px; height: 92px; object-fit: contain; opacity: .9; transform: rotate(-8deg); }

.lr-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 6px; }
.lr-sig { flex: 0 0 190px; text-align: center; font: 700 11px Arial, sans-serif; }
.lr-sig img { max-height: 38px; max-width: 160px; object-fit: contain; display: block; margin: 0 auto 2px; }
.lr-sig-space { display: block; height: 30px; }
.lr-sig-line { border-top: 2px solid #111; padding-top: 3px; }
.lr-footer-logo { flex: 1; text-align: center; }
.lr-footer-logo img { max-height: 54px; max-width: 120px; object-fit: contain; }

@media print {
    .lr-card { box-shadow: none; border: none; max-width: 100%; }
    .lr-card, .lr-card * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (max-width: 700px) {
    .lr-card { font-size: 10.5px; }
    .lr-logo { width: 90px; }
    .lr-school h1 { font-size: 16px; }
    .lr-title-badge { font-size: 12px; padding: 6px 10px; }
    .lr-top { flex-direction: column; } .lr-top-right { width: 100%; }
    .lr-skills-early, .lr-skills-primary { grid-template-columns: 1fr; }
    .lr-banner { width: 24px; font-size: 16px; }
    .lr-page { padding-left: 32px; padding-right: 10px; }
    .lr-table { font-size: 9px; }
}
