/* ==========================================================================
   AFASSS — Abba Father Arts and Science Secondary School
   Portal stylesheet
   ========================================================================== */
:root {
  --navy-900: #061a2e;
  --navy-800: #0b2545;
  --navy-700: #123562;
  --navy-600: #1b4a80;
  --navy-100: #e8eef7;
  --navy-50: #f4f7fc;
  --gold-600: #a67c1f;
  --gold-500: #c8a04a;
  --gold-400: #e0bf72;
  --gold-100: #f8f0dc;
  --ink: #16202c;
  --muted: #5f6b7a;
  --line: #d8e0ea;
  --line-soft: #e8eef5;
  --bg: #f2f5f9;
  --white: #ffffff;
  --green: #16794b;
  --green-bg: #e6f5ec;
  --amber: #9a6206;
  --amber-bg: #fdf3df;
  --red: #a3282c;
  --red-bg: #fbeaea;
  --blue: #17497f;
  --blue-bg: #e7f0fa;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(9, 30, 54, .06), 0 1px 3px rgba(9, 30, 54, .08);
  --shadow: 0 4px 10px rgba(9, 30, 54, .07), 0 12px 28px rgba(9, 30, 54, .08);
  --shadow-lg: 0 18px 50px rgba(9, 30, 54, .18);
  --serif: "Georgia", "Times New Roman", "Nimbus Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--navy-800); margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .9rem; }
small { font-size: .8rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }

/* ------------------------------- site chrome ---------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.site-header__inner {
  max-width: 1180px; margin: 0 auto; padding: .55rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none !important; }
.brand img { width: 50px; height: 50px; object-fit: contain; }
.brand__text { line-height: 1.15; }
.brand__name {
  font-family: var(--serif); font-weight: 700; color: var(--navy-800);
  font-size: .98rem; letter-spacing: .01em;
}
.brand__sub { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-600); font-weight: 700; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.site-nav a {
  padding: .5rem .7rem; border-radius: var(--radius-sm); color: var(--navy-800);
  font-size: .88rem; font-weight: 600; text-decoration: none;
}
.site-nav a:hover { background: var(--navy-50); text-decoration: none; }
.site-nav a.btn:not(.btn--ghost) { color: #fff; }
.site-nav a.btn:not(.btn--ghost):hover { background: var(--navy-700); color: #fff; }
.site-nav a.active { color: var(--gold-600); }
.site-nav .btn { margin-left: .4rem; }

.site-footer { background: var(--navy-900); color: #c9d4e2; margin-top: 4rem; padding: 3rem 1.25rem 1.5rem; }
.site-footer__inner { max-width: 1180px; margin: 0 auto; display: grid; gap: 2rem; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; }
.site-footer h4 { color: #fff; font-size: .95rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: .8rem; }
.site-footer a { color: #c9d4e2; }
.site-footer a:hover { color: var(--gold-400); }
.site-footer ul { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.site-footer li { margin-bottom: .4rem; }
.site-footer__bottom {
  max-width: 1180px; margin: 2rem auto 0; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,.12);
  display: flex; justify-content: space-between; gap: 1rem; font-size: .8rem; color: #9fb0c6; flex-wrap: wrap;
}
.footer-brand { display: flex; gap: .8rem; align-items: flex-start; }
.footer-brand img { width: 62px; height: 62px; background: #fff; border-radius: 8px; padding: 4px; object-fit: contain; }
.footer-brand strong { color: #fff; font-family: var(--serif); display: block; margin-bottom: .35rem; }

/* ---------------------------------- hero -------------------------------- */
.hero {
  position: relative; color: #fff;
  background:
    linear-gradient(115deg, rgba(6, 26, 46, .96) 0%, rgba(11, 37, 69, .9) 45%, rgba(27, 74, 128, .78) 100%),
    radial-gradient(circle at 80% 20%, rgba(200, 160, 74, .35), transparent 55%),
    var(--navy-800);
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .5; pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 4.5rem 1.25rem 5rem; display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(1.9rem, 3.6vw, 3rem); margin-bottom: 1rem; }
.hero p.lead { font-size: 1.05rem; color: #d6e2f0; max-width: 46ch; }
.hero__eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-400); font-weight: 700; margin-bottom: 1rem; }
.hero__eyebrow::before { content: ""; width: 34px; height: 2px; background: var(--gold-500); }
.hero__actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.6rem; }
.hero__card {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16);
  border-radius: 18px; padding: 1.5rem; backdrop-filter: blur(6px);
}
.hero__card h3 { color: var(--gold-400); font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; }
.hero__stat { display: flex; justify-content: space-between; padding: .6rem 0; border-bottom: 1px dashed rgba(255,255,255,.16); font-size: .88rem; }
.hero__stat:last-child { border-bottom: 0; }
.hero__stat span:first-child { color: #b8c9dc; }
.hero__stat span:last-child { font-weight: 700; color: #fff; }

/* -------------------------------- sections ------------------------------ */
.section { max-width: 1180px; margin: 0 auto; padding: 3.5rem 1.25rem; }
.section--tight { padding-top: 2rem; padding-bottom: 2rem; }
.section__head { max-width: 62ch; margin-bottom: 2rem; }
.section__head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section__eyebrow { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-600); font-weight: 800; margin-bottom: .5rem; }
.section__lead { color: var(--muted); font-size: 1rem; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: grid; gap: 1rem; }

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow-sm);
}
.card--pad { padding: 1.75rem; }
.card h3 { margin-bottom: .4rem; }
.card p:last-child { margin-bottom: 0; }
.card--feature { border-top: 3px solid var(--gold-500); }
.card__icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--navy-50); color: var(--navy-700); font-size: 1.2rem; margin-bottom: .9rem;
  border: 1px solid var(--line-soft);
}
.muted { color: var(--muted); }
.tiny { font-size: .78rem; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* --------------------------------- buttons ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .62rem 1.05rem; border-radius: 9px; border: 1px solid transparent;
  background: var(--navy-800); color: #fff; font-weight: 650; font-size: .88rem;
  cursor: pointer; text-decoration: none !important; font-family: var(--sans);
  transition: transform .06s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--navy-700); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn--gold { background: var(--gold-500); color: #2a1c00; }
.btn--gold:hover { background: var(--gold-400); }
.btn--ghost { background: transparent; color: var(--navy-800); border-color: var(--line); }
.btn--ghost:hover { background: var(--navy-50); }
.btn--light { background: #fff; color: var(--navy-800); border-color: rgba(255,255,255,.4); }
.btn--light:hover { background: #eef3fa; }
.btn--danger { background: var(--red); }
.btn--danger:hover { background: #8d2024; }
.btn--success { background: var(--green); }
.btn--success:hover { background: #116039; }
.btn--sm { padding: .38rem .7rem; font-size: .8rem; border-radius: 7px; }
.btn--block { width: 100%; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* --------------------------------- forms -------------------------------- */
.field { margin-bottom: 1rem; }
.field > label, .label {
  display: block; font-size: .78rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--navy-700); margin-bottom: .35rem;
}
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], input[type="tel"], select, textarea {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: .9rem; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(27, 74, 128, .13);
}
textarea { min-height: 110px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%235f6b7a' stroke-width='2' fill='none' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right .7rem center; padding-right: 2rem; }
.field-hint { font-size: .78rem; color: var(--muted); margin-top: .3rem; }
.field-error { font-size: .78rem; color: var(--red); margin-top: .3rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.checkline { display: flex; gap: .5rem; align-items: flex-start; font-size: .88rem; }
.checkline input { margin-top: .25rem; }

/* --------------------------------- tables ------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: .87rem; }
table.data th {
  background: var(--navy-50); text-align: left; padding: .7rem .85rem; font-size: .72rem;
  letter-spacing: .07em; text-transform: uppercase; color: var(--navy-700);
  border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 800;
}
table.data td { padding: .7rem .85rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fafcff; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .actions { display: flex; gap: .35rem; flex-wrap: wrap; }

/* --------------------------------- badges ------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .55rem;
  border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  background: var(--navy-50); color: var(--navy-700); border: 1px solid var(--line);
  white-space: nowrap;
}
.badge--ok { background: var(--green-bg); color: var(--green); border-color: #bfe3cd; }
.badge--warn { background: var(--amber-bg); color: var(--amber); border-color: #f0dcb0; }
.badge--info { background: var(--blue-bg); color: var(--blue); border-color: #c3d9ef; }
.badge--danger { background: var(--red-bg); color: var(--red); border-color: #efc9c9; }
.badge--neutral { background: #eef1f5; color: #4b5765; border-color: #d9e0e8; }
.badge--gold { background: var(--gold-100); color: var(--gold-600); border-color: #ecd9a8; }

/* --------------------------------- alerts ------------------------------- */
.alert {
  border: 1px solid var(--line); border-left: 4px solid var(--navy-600);
  background: var(--navy-50); padding: .85rem 1rem; border-radius: var(--radius-sm);
  font-size: .88rem; margin-bottom: 1rem;
}
.alert--ok { background: var(--green-bg); border-color: #bfe3cd; border-left-color: var(--green); color: #0f4f31; }
.alert--warn { background: var(--amber-bg); border-color: #f0dcb0; border-left-color: var(--gold-500); color: #6f4703; }
.alert--danger { background: var(--red-bg); border-color: #efc9c9; border-left-color: var(--red); color: #7d1f22; }
.alert--info { background: var(--blue-bg); border-color: #c3d9ef; border-left-color: var(--blue); color: #123a63; }
.alert strong { display: block; margin-bottom: .15rem; }
.alert ul { margin: .4rem 0 0; padding-left: 1.1rem; }

/* -------------------------------- app shell ----------------------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 254px; flex: 0 0 254px; background: var(--navy-900); color: #c3d0e0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 50;
}
.sidebar__brand { display: flex; gap: .7rem; align-items: center; padding: 1.1rem 1.15rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar__brand img { width: 42px; height: 42px; background: #fff; border-radius: 7px; padding: 3px; object-fit: contain; }
.sidebar__brand strong { display: block; color: #fff; font-family: var(--serif); font-size: .9rem; line-height: 1.2; }
.sidebar__brand span { font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-400); font-weight: 700; }
.sidebar__nav { padding: .9rem .7rem; overflow-y: auto; flex: 1; }
.sidebar__section { font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: #7890a8; font-weight: 800; padding: .9rem .6rem .4rem; }
.sidebar__nav a {
  display: flex; align-items: center; gap: .6rem; padding: .55rem .65rem; border-radius: 8px;
  color: #c3d0e0; font-size: .86rem; font-weight: 600; text-decoration: none; margin-bottom: 2px;
}
.sidebar__nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.sidebar__nav a.active { background: var(--navy-700); color: #fff; box-shadow: inset 3px 0 0 var(--gold-500); }
.sidebar__nav .ico { width: 18px; display: inline-grid; place-items: center; opacity: .9; font-size: .95rem; }
.sidebar__foot { padding: .9rem; border-top: 1px solid rgba(255,255,255,.1); font-size: .78rem; }
.sidebar__foot .who { color: #fff; font-weight: 700; }
.sidebar__term-card { background: rgba(200,160,74,.14); border: 1px solid rgba(200,160,74,.32); border-radius: 9px; padding: .6rem .7rem; margin: .2rem .1rem .8rem; }
.sidebar__term-card b { display: block; color: #fff; font-size: .8rem; }
.sidebar__term-card em { font-style: normal; color: var(--gold-400); font-size: .72rem; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--line); padding: .7rem 1.5rem;
  display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 40;
}
.topbar h1 { font-size: 1.12rem; margin: 0; }
.topbar__sub { font-size: .78rem; color: var(--muted); }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--navy-800); color: #fff;
  display: grid; place-items: center; font-size: .8rem; font-weight: 700;
}
.content { padding: 1.5rem; flex: 1; }
.content > *:first-child { margin-top: 0; }
.page-head { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h2 { margin: 0; font-size: 1.5rem; }
.page-head p { margin: .2rem 0 0; color: var(--muted); font-size: .88rem; }
.page-head .btn-row { margin-left: auto; }

/* --------------------------------- stats -------------------------------- */
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 1.5rem; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat__label { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.stat__value { font-family: var(--serif); font-size: 1.7rem; font-weight: 700; color: var(--navy-800); line-height: 1.1; margin-top: .25rem; }
.stat__meta { font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.stat--gold { border-top: 3px solid var(--gold-500); }
.stat--navy { border-top: 3px solid var(--navy-700); }
.stat--green { border-top: 3px solid var(--green); }
.stat--amber { border-top: 3px solid var(--amber); }

/* ------------------------------- timeline ------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1.1rem 1.6rem; border-left: 2px solid var(--line); margin-left: .4rem; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: .35rem; width: 12px; height: 12px;
  border-radius: 50%; background: #fff; border: 2px solid var(--navy-600);
}
.timeline li.done::before { background: var(--green); border-color: var(--green); }
.timeline li.current::before { background: var(--gold-500); border-color: var(--gold-500); box-shadow: 0 0 0 4px rgba(200,160,74,.22); }
.timeline b { display: block; font-size: .9rem; color: var(--navy-800); }
.timeline span { font-size: .8rem; color: var(--muted); }

/* --------------------------------- tabs --------------------------------- */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; flex-wrap: wrap; }
.tabs a {
  padding: .55rem .9rem; font-size: .86rem; font-weight: 700; color: var(--muted);
  border-bottom: 2px solid transparent; text-decoration: none;
}
.tabs a.active { color: var(--navy-800); border-bottom-color: var(--gold-500); }

/* -------------------------------- progress ------------------------------ */
.progress { height: 8px; border-radius: 99px; background: #e7ecf2; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--navy-700); border-radius: 99px; }
.progress--gold > span { background: var(--gold-500); }
.progress--green > span { background: var(--green); }

/* --------------------------------- misc --------------------------------- */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: .35rem 1rem; font-size: .88rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 600; color: var(--navy-800); }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty h3 { color: var(--navy-700); }
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.35rem; align-items: start; }
.pill-list { display: flex; gap: .4rem; flex-wrap: wrap; }

.login-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #fff;
}
.login-aside {
  background: linear-gradient(150deg, var(--navy-900), var(--navy-700) 55%, #2a5b95);
  color: #dbe6f3; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.login-aside::after {
  content: ""; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px;
  border-radius: 50%; border: 30px solid rgba(200,160,74,.16);
}
.login-aside img { width: 82px; background: #fff; border-radius: 12px; padding: 6px; }
.login-aside h1 { color: #fff; font-size: 1.75rem; margin-top: 2rem; max-width: 22ch; }
.login-aside p { color: #b9cbe0; font-size: .92rem; }
.login-aside ul { list-style: none; padding: 0; font-size: .88rem; }
.login-aside li { display: flex; gap: .55rem; align-items: flex-start; margin-bottom: .55rem; color: #cfe0f0; }
.login-aside li::before { content: "✓"; color: var(--gold-400); font-weight: 800; }
.login-main { display: grid; place-items: center; padding: 2.5rem 1.5rem; }
.login-form { width: min(420px, 100%); }
.login-form h2 { font-size: 1.6rem; }
.demo-creds { background: var(--navy-50); border: 1px dashed var(--line); border-radius: 9px; padding: .8rem .9rem; font-size: .78rem; margin-top: 1.2rem; }
.demo-creds b { color: var(--navy-800); }
.demo-creds table { width: 100%; border-collapse: collapse; }
.demo-creds td { padding: .15rem .3rem; }
.demo-creds td:first-child { font-weight: 700; color: var(--navy-700); }

/* ==========================================================================
   OFFICIAL RESULT SHEET (A4 portrait)
   ========================================================================== */
.sheet-scroll { overflow-x: auto; padding: 1.25rem 0; }
.result-sheet {
  width: 210mm;
  min-height: 296mm;
  margin: 0 auto;
  background: #fff;
  color: #111;
  padding: 11mm 12mm 9mm;
  box-shadow: var(--shadow-lg);
  border: 1px solid #cfd8e3;
  font-family: var(--serif);
  font-size: 10.4pt;
  line-height: 1.35;
  position: relative;
  display: flex;
  flex-direction: column;
}
.result-sheet * { box-sizing: border-box; }

.rs-frame { border: 1.6pt solid var(--navy-800); padding: 3mm; flex: 1; display: flex; flex-direction: column; }
.rs-frame-inner { border: .6pt solid var(--gold-600); padding: 5mm 5mm 4mm; flex: 1; display: flex; flex-direction: column; }

.rs-header { display: grid; grid-template-columns: 26mm 1fr 26mm; gap: 4mm; align-items: center; }
.rs-logo { width: 26mm; height: 26mm; object-fit: contain; }
.rs-logo--right { visibility: visible; }
.rs-heading { text-align: center; }
.rs-school {
  font-family: var(--serif); font-size: 15.5pt; font-weight: 700; letter-spacing: .02em;
  color: var(--navy-800); text-transform: uppercase; margin: 0; line-height: 1.15;
}
.rs-address { font-size: 8.6pt; color: #333; margin: 1.4mm 0 0; }
.rs-contact { font-size: 8.4pt; color: #333; margin: .4mm 0 0; }
.rs-motto {
  font-size: 7.6pt; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-600);
  font-weight: 700; margin-top: 1.2mm; font-family: var(--sans);
}
.rs-rule { border: 0; border-top: .8pt solid var(--navy-800); margin: 2.6mm 0 .8mm; position: relative; }
.rs-rule::after { content: ""; display: block; border-top: .6pt solid var(--gold-500); margin-top: .7mm; }
.rs-title {
  text-align: center; font-family: var(--sans); font-size: 9.6pt; font-weight: 800;
  letter-spacing: .22em; text-transform: uppercase; color: var(--navy-800);
  margin: 1.6mm 0 2.6mm;
}
.rs-title span { display: block; font-size: 7.4pt; letter-spacing: .1em; color: var(--gold-600); margin-top: .6mm; font-weight: 700; }

.rs-student {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 1.2mm 6mm;
  border: .7pt solid #a9b7c8; border-radius: 1.5mm; padding: 3mm 3.5mm; background: #f6f8fc;
  margin-bottom: 3mm;
}
.rs-student__row { display: flex; gap: 1.5mm; align-items: baseline; font-size: 9pt; }
.rs-student__label { font-family: var(--sans); font-size: 7.6pt; text-transform: uppercase; letter-spacing: .07em; color: #4a5b70; font-weight: 700; min-width: 26mm; }
.rs-student__value { font-weight: 700; color: #101c2b; border-bottom: .4pt dotted #8fa2b8; flex: 1; padding-bottom: .4mm; }

.rs-table { width: 100%; border-collapse: collapse; font-size: 8.8pt; }
.rs-table th {
  background: var(--navy-800); color: #fff; font-family: var(--sans); font-size: 7.3pt;
  text-transform: uppercase; letter-spacing: .06em; padding: 1.8mm 1.2mm; border: .5pt solid var(--navy-800);
  font-weight: 700;
}
.rs-table th.num, .rs-table td.num { text-align: right; }
.rs-table td { border: .5pt solid #9fb0c4; padding: 1.35mm 1.4mm; vertical-align: middle; }
.rs-table tbody tr:nth-child(even) td { background: #f2f6fb; }
.rs-table .subject { font-weight: 600; }
.rs-table tfoot td {
  background: #eaf0f8; font-weight: 700; border: .5pt solid var(--navy-800);
  font-family: var(--sans); font-size: 8.4pt;
}
.rs-table .grade-cell { text-align: center; font-weight: 700; }
.rs-table .remark-cell { font-family: var(--sans); font-size: 7.8pt; }
.rs-table .f9 { color: var(--red); }
.rs-table .a1 { color: var(--green); }
.rs-table .empty-row td { text-align: center; color: #6b7787; font-style: italic; padding: 6mm 0; }

.rs-summary { display: grid; grid-template-columns: 1.15fr 1fr; gap: 3mm; margin-top: 3mm; }
.rs-box { border: .7pt solid #a9b7c8; border-radius: 1.5mm; overflow: hidden; }
.rs-box__head {
  background: var(--navy-800); color: #fff; font-family: var(--sans); font-size: 7.3pt;
  text-transform: uppercase; letter-spacing: .1em; padding: 1.3mm 2.4mm; font-weight: 700;
}
.rs-box__body { padding: 1.8mm 2.4mm; }
.rs-kv { display: grid; grid-template-columns: 1fr auto; gap: .9mm 3mm; font-size: 8.7pt; }
.rs-kv dt { color: #33445a; font-family: var(--sans); font-size: 7.9pt; }
.rs-kv dd { margin: 0; font-weight: 700; text-align: right; }
.rs-kv .highlight dd { color: var(--navy-800); font-size: 9.6pt; }

.rs-legend { border: .7pt solid #a9b7c8; border-radius: 1.5mm; margin-top: 2.6mm; overflow: hidden; }
.rs-legend__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
}
.rs-legend__item {
  display: flex; gap: 1.6mm; align-items: baseline; padding: 1mm 2.4mm; font-size: 8pt;
  border-bottom: .4pt dotted #c2cedd;
}
.rs-legend__item:nth-child(3n) { border-right: 0; }
.rs-legend__item b { font-family: var(--sans); color: var(--navy-800); min-width: 6mm; }
.rs-legend__item span { color: #33445a; }

.rs-remark {
  border: .7pt solid #a9b7c8; border-left: 2.4pt solid var(--gold-500); border-radius: 1.5mm;
  padding: 2mm 3mm; margin-top: 2.6mm; background: #fffdf6;
}
.rs-remark__label { font-family: var(--sans); font-size: 7.3pt; text-transform: uppercase; letter-spacing: .1em; color: var(--gold-600); font-weight: 800; }
.rs-remark__text { font-size: 9pt; font-style: italic; margin-top: .8mm; color: #1a2637; }

.rs-signatures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3mm; margin-top: 0; padding-top: 4mm; }
.rs-sign { text-align: center; }
.rs-sign__line { border-bottom: .7pt solid #33445a; height: 9mm; margin-bottom: 1mm; position: relative; }
.rs-sign__line img { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); height: 12mm; }
.rs-sign__name { font-size: 8.6pt; font-weight: 700; font-family: var(--sans); }
.rs-sign__role { font-size: 7.2pt; color: #4a5b70; text-transform: uppercase; letter-spacing: .08em; font-family: var(--sans); }

.rs-notes {
  margin-top: auto; border: .7pt solid #c2cedd; border-radius: 1.5mm; padding: 2mm 3mm;
  font-family: var(--sans);
}
.rs-notes__label { font-size: 7pt; letter-spacing: .12em; text-transform: uppercase; color: #4a5b70; font-weight: 800; margin-bottom: .8mm; }
.rs-notes ul { margin: 0; padding-left: 4mm; font-size: 7.1pt; color: #4a5b70; line-height: 1.35; }
.rs-notes li { margin-bottom: .3mm; }

.rs-foot {
  margin-top: 3mm; border-top: .5pt solid #a9b7c8; padding-top: 1.6mm;
  display: flex; justify-content: space-between; gap: 3mm;
  font-family: var(--sans); font-size: 6.9pt; color: #55647a;
}
.rs-foot b { color: var(--navy-800); }
.rs-stamp {
  font-family: var(--sans); font-size: 6.6pt; letter-spacing: .06em; text-transform: uppercase;
  color: var(--red); border: 1pt solid var(--red); padding: .6mm 1.6mm; border-radius: 1mm;
  transform: rotate(-2deg); font-weight: 800; white-space: nowrap;
}

/* --------------------------------- toolbar ------------------------------ */
.sheet-toolbar {
  display: flex; gap: .5rem; flex-wrap: wrap; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: .7rem .9rem; margin-bottom: 1rem;
}
.sheet-toolbar .grow { flex: 1; }
.sheet-toolbar small { color: var(--muted); }

/* pin gate */
.pin-card { max-width: 520px; margin: 1.5rem auto; text-align: center; }
.pin-card .pin-input {
  font-family: var(--sans); font-size: 1.4rem; letter-spacing: .22em; text-align: center;
  font-weight: 700; padding: .8rem; text-transform: uppercase;
}
.pin-card .lock { font-size: 2rem; margin-bottom: .4rem; }

/* ==========================================================================
   PRINT — A4 portrait, only the official sheet is printed
   ========================================================================== */
@media print {
  @page { size: A4 portrait; margin: 0; }
  html, body {
    background: #fff !important; margin: 0 !important; padding: 0 !important;
    font-size: 10pt;
  }
  .sidebar, .topbar, .site-header, .site-footer, .no-print,
  .sheet-toolbar, .flash, .page-head, .tabs, nav, .btn { display: none !important; }
  .app { display: block; }
  .main { display: block; }
  .content { padding: 0 !important; }
  .sheet-scroll { overflow: visible !important; padding: 0 !important; }
  .result-sheet {
    width: 210mm; min-height: auto; margin: 0; padding: 9mm 10mm;
    box-shadow: none !important; border: 0 !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .rs-table, .rs-summary, .rs-legend, .rs-remark, .rs-signatures { page-break-inside: avoid; }
  .rs-table thead { display: table-header-group; }
  .rs-table tr { page-break-inside: avoid; }
  a[href]::after { content: ""; }
}

/* ------------------------------- responsive ----------------------------- */
@media (max-width: 1100px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
  .hero__inner { grid-template-columns: 1fr; padding: 3rem 1.25rem; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: relative; }
  .sidebar__nav { display: flex; gap: .3rem; overflow-x: auto; padding: .5rem; }
  .sidebar__nav a { white-space: nowrap; margin: 0; }
  .sidebar__section, .sidebar__term-card, .sidebar__foot { display: none; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .grid-3, .grid-2, .form-grid { grid-template-columns: 1fr; }
  .content { padding: 1rem; }
  .topbar { padding: .6rem 1rem; }
}
@media (max-width: 640px) {
  .site-nav { display: none; }
  .site-header__inner { justify-content: space-between; }
  .grid-4 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv dd { margin-bottom: .4rem; }
  .topbar__website { display: none; }
}

/* ==========================================================================
   Official school crest watermark
   ========================================================================== */
.school-watermark {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.school-watermark--fixed {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.school-watermark__tile {
  display: block;
  position: absolute;
  inset: -30%;
  width: 160%;
  height: 160%;
  transform: rotate(-24deg);
  background-image: url("/assets/Sec-Sch-logo.jpg");
  background-repeat: repeat;
  background-size: 230px auto;
  background-position: center center;
  opacity: .045;
  filter: grayscale(.25);
}
/* keep page content above the watermark layer */
.site-header, .hero, .section, .site-footer,
.login-wrap, .app, .flash { position: relative; }
.site-header, .login-wrap, .app, .flash { z-index: 1; }
.site-footer { z-index: 2; }

/* ------------------------- hero imagery (real photos) ------------------- */
.hero {
  background: var(--navy-800);
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  gap: 0;
  overflow: hidden;
}
.hero__media img {
  flex: 1 1 0;
  width: 33.333%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  display: block;
}
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(6, 26, 46, .96) 0%, rgba(8, 30, 56, .9) 42%, rgba(11, 37, 69, .72) 70%, rgba(11, 37, 69, .58) 100%),
    linear-gradient(to top, rgba(6, 26, 46, .85), rgba(6, 26, 46, .15) 45%);
}
.hero::after { display: none; }          /* photo hero replaces the dot pattern */
.hero__inner { z-index: 2; }

/* photo strip used on inner public pages */
.photo-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0;
}
.photo-strip figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.photo-strip img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}
.photo-strip figcaption {
  padding: .55rem .8rem;
  font-size: .78rem;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
}
.page-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: var(--navy-800);
}
.page-hero__media { position: absolute; inset: 0; z-index: 0; }
.page-hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; opacity: .38; }
.page-hero__media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(6,26,46,.95), rgba(11,37,69,.75));
}
.page-hero__inner {
  position: relative; z-index: 1; max-width: 1180px; margin: 0 auto;
  padding: 2.75rem 1.25rem;
}
.page-hero h1 { color: #fff; margin-bottom: .4rem; }
.page-hero p { color: #d6e2f0; margin: 0; max-width: 70ch; }

/* logo badge in header / sidebar / login */
.brand img, .sidebar__brand img, .login-aside img {
  object-fit: contain;
  background: #fff;
}
.sidebar__brand img { border-radius: 8px; }

/* --------------------- watermark inside the result sheet --------------- */
.result-sheet { overflow: hidden; }
.sheet-watermark {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  pointer-events: none;
}
.sheet-watermark span {
  display: block;
  background-image: url("/assets/Sec-Sch-logo.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 46mm auto;
  opacity: .07;
  filter: grayscale(1);
}
.rs-frame, .rs-frame-inner { position: relative; z-index: 1; }

@media (max-width: 900px) {
  .hero__media img:last-child { display: none; }
  .hero__media img { width: 50%; }
  .photo-strip { grid-template-columns: 1fr 1fr; }
  .photo-strip figure:last-child { display: none; }
  .school-watermark__tile { background-size: 170px auto; }
}
@media (max-width: 640px) {
  .hero__media img { width: 100%; }
  .hero__media img:not(:first-child) { display: none; }
  .photo-strip { grid-template-columns: 1fr; }
  .photo-strip figure:not(:first-child) { display: none; }
}

/* print: the sheet carries its own watermark; hide the page-level one */
@media print {
  .school-watermark, .school-watermark--fixed { display: none !important; }
  .sheet-watermark span {
    opacity: .09;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .result-sheet { overflow: hidden; }
}

/* --------------------------- login aside photo -------------------------- */
.login-aside { isolation: isolate; }
.login-aside__photo { position: absolute; inset: 0; z-index: -1; }
.login-aside__photo img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 30%;
  opacity: .30; display: block;
}
.login-aside::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(150deg, rgba(6,26,46,.94), rgba(11,37,69,.86) 55%, rgba(27,74,128,.78));
}
.login-aside__content { position: relative; z-index: 1; }
.login-aside__session { font-size: .75rem; color: #b9cbe0; }
