/* ============================================================
   style.css — how the page LOOKS
   ============================================================
   CSS works like this:   selector { property: value; }
   The "selector" picks which HTML elements to style.
   ============================================================ */


/* ------------------------------------------------------------
   CSS VARIABLES
   ------------------------------------------------------------
   These are reusable values. Define a colour once here, use it
   everywhere with var(--name). Change it once = changes the
   whole site. ":root" just means "the whole document".
   ------------------------------------------------------------ */
:root {
  --navy-900: #0b1f3a;   /* darkest navy — header bar */
  --navy-700: #14294d;   /* button hover */
  --navy-600: #1b3a6b;   /* primary navy — buttons, headings */
  --navy-100: #e8edf5;   /* very light navy tint — borders */

  /* The logo is now a real image file (logo.png), so its colours
     live in the artwork rather than here. */

  --white: #ffffff;
  --page-bg: #f4f6fa;    /* soft grey-blue page background */

  --text-dark: #1a2233;
  --text-muted: #5b6779;

  --error: #b3261e;
  --error-bg: #fdecea;
  --success: #1e6f4c;
  --success-bg: #eaf6f0;

  --radius: 6px;         /* corner rounding — small = formal */
}


/* ------------------------------------------------------------
   GLOBAL RESET
   ------------------------------------------------------------
   "*" means every element. box-sizing: border-box makes width
   include padding + border, which makes layouts much easier.
   ------------------------------------------------------------ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  /* Professional sans-serif stack; falls back down the list if a
     font isn't installed on the visitor's computer. */
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--page-bg);
  color: var(--text-dark);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}


/* ------------------------------------------------------------
   TOP HEADER BAR
   ------------------------------------------------------------
   The header is WHITE (not navy) because the TVETMARA logo is
   navy-coloured — navy artwork on a navy bar would be invisible.
   A navy stripe along the bottom keeps the corporate feel.
   ------------------------------------------------------------ */
.site-header {
  background-color: var(--white);
  padding: 16px 28px;
  border-bottom: 3px solid var(--navy-600);
}

/* Header variant that holds a logo AND a menu, side by side */
.site-header-nav .header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* The logo becomes a link back to the home page */
.header-logo-link {
  display: block;
  line-height: 0;   /* removes the extra space under an inline image */
}

/* ---------- THE DROP-DOWN MENU ---------- */

/* position: relative makes this the anchor point that the drop-down
   panel positions itself against. */
.main-nav {
  position: relative;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--navy-900);
  background-color: var(--white);
  border: 1px solid #c8d0dd;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.menu-toggle:hover {
  background-color: var(--navy-100);
  border-color: var(--navy-600);
}

.menu-toggle:focus-visible {
  outline: none;
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(27, 58, 107, 0.15);
}

.menu-caret {
  font-size: 10px;
}

/* The panel that drops down.
   position: absolute lifts it out of the normal flow so it floats
   over the page instead of pushing content down.
   right: 0 lines its right edge up with the button. */
.menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);   /* just below the button */
  min-width: 220px;
  margin: 0;
  padding: 6px;
  list-style: none;         /* no bullet points */
  background-color: var(--white);
  border: 1px solid var(--navy-100);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(11, 31, 58, 0.13);
  /* z-index decides what sits on top when things overlap.
     A high number keeps the menu above the page content. */
  z-index: 50;
}

.menu-dropdown a {
  display: block;
  padding: 10px 13px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--navy-900);
  text-decoration: none;
  border-radius: 4px;
}

.menu-dropdown a:hover,
.menu-dropdown a:focus-visible {
  background-color: var(--navy-100);
  outline: none;
}

/* ============================================================
   THE TAB BAR
   ============================================================
   A row of always-visible links under the header. On a narrow
   phone it scrolls sideways rather than wrapping, which keeps the
   tabs on one tidy line.
   ============================================================ */

.tab-bar {
  background-color: var(--white);
  border-bottom: 1px solid var(--navy-100);
  /* Let the tabs slide sideways if they don't all fit */
  overflow-x: auto;
  /* Hide the scrollbar on Firefox; it looks untidy for four links */
  scrollbar-width: none;
}

/* Hide the scrollbar on Chrome, Edge and Safari */
.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab-bar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
}

.tab {
  padding: 13px 16px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text-muted);
  text-decoration: none;
  /* A transparent underline that turns navy on the active tab, so
     nothing shifts position when the highlight appears */
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tab:hover {
  color: var(--navy-900);
  border-bottom-color: var(--navy-100);
}

/* The page you are currently on */
.tab-active {
  color: var(--navy-900);
  border-bottom-color: var(--navy-600);
}

.tab:focus-visible {
  outline: none;
  color: var(--navy-900);
  box-shadow: inset 0 0 0 2px rgba(27, 58, 107, 0.25);
  border-radius: 3px;
}


/* ---------- The logo image ---------- */
.brand-logo {
  /* "display: block" + "margin: 0 auto" is the classic way to centre
     an image. A plain <img> sits inline like a letter of text, and
     inline elements ignore auto margins — block makes it obey them. */
  display: block;
  margin: 0 auto;

  /* Set the HEIGHT and let the width follow automatically, so the
     logo keeps its proportions and never looks squashed. */
  height: 46px;
  width: auto;

  /* Safety net: on a very narrow phone, shrink rather than overflow
     the screen. */
  max-width: 100%;
}


/* ============================================================
   PROFILE PAGES
   ============================================================
   Used by index.html, composite-repair.html and coordination.html.
   The form and admin pages ignore all of this.
   ============================================================ */

/* ---------- HERO (the dark navy banner) ---------- */
.hero {
  background-color: var(--navy-900);
  /* A subtle diagonal gradient stops the block looking flat */
  background-image: linear-gradient(135deg, #0b1f3a 0%, #17335c 100%);
  padding: 62px 24px 58px;
  text-align: center;
}

.hero-compact {
  padding: 46px 24px 42px;
}

.hero-inner {
  max-width: 800px;
  margin: 0 auto;
}

.hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #8fa5c8;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: 38px;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.3px;
  color: var(--white);
}

.hero-role {
  margin-top: 14px;
  font-size: 17px;
  line-height: 1.5;
  color: #cdd8ea;
}

.hero-credentials {
  margin-top: 12px;
  font-size: 13.5px;
  color: #8fa5c8;
}

.hero-actions {
  margin-top: 26px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-hero-primary,
.btn-hero-secondary {
  display: inline-block;
  padding: 12px 26px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-hero-primary {
  color: var(--navy-900);
  background-color: var(--white);
  border: 1px solid var(--white);
}

.btn-hero-primary:hover {
  background-color: #e3eaf6;
}

.btn-hero-secondary {
  color: var(--white);
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.btn-hero-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* ---------- PAGE BODY ---------- */
.content-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 20px;
}

.section {
  padding: 40px 0;
  border-bottom: 1px solid var(--navy-100);
}

/* :last-child = the final section on the page. No line under it. */
.section:last-child {
  border-bottom: none;
}

.section h2 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--navy-600);
  margin-bottom: 18px;
  /* A short navy rule under each heading */
  padding-bottom: 10px;
  border-bottom: 2px solid var(--navy-100);
}

.section p {
  margin-bottom: 12px;
  color: var(--text-dark);
  line-height: 1.68;
}

.lead {
  font-size: 16.5px;
  color: var(--navy-900) !important;
}

.sub-head {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--navy-900);
  margin-bottom: 10px;
}

/* ---------- The four numbers under the profile summary ---------- */
.stat-strip {
  margin-top: 26px;
  display: grid;
  /* auto-fit + minmax makes the columns reflow by themselves:
     four across on a desktop, two on a phone, no media query. */
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.strip-item {
  padding: 16px 14px;
  background-color: var(--page-bg);
  border-left: 3px solid var(--navy-600);
  border-radius: var(--radius);
}

.strip-num {
  display: block;
  font-size: 25px;
  font-weight: 700;
  color: var(--navy-900);
  line-height: 1.1;
}

.strip-label {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- Card grids ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.info-card {
  padding: 18px 19px;
  background-color: var(--white);
  border: 1px solid var(--navy-100);
  border-top: 3px solid var(--navy-600);
  border-radius: var(--radius);
}

.info-card h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--navy-900);
  margin-bottom: 7px;
}

.info-card p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.card-year {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: var(--navy-600);
  margin-bottom: 5px;
}

/* ---------- Experience timeline ---------- */
.timeline-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px dashed var(--navy-100);
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-period {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-600);
  padding-top: 2px;
}

.timeline-body h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy-900);
}

.timeline-org {
  font-size: 13px;
  color: var(--text-muted) !important;
  margin: 2px 0 8px !important;
}

.timeline-body p {
  font-size: 14px;
}

/* ---------- Lists ---------- */
.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
}

.clean-list {
  list-style: none;
  padding: 0;
}

.clean-list li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dark);
}

/* ::before inserts a small navy square as a custom bullet */
.clean-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 5px;
  height: 5px;
  background-color: var(--navy-600);
}

.training-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
}

.training-list li {
  padding: 12px 14px;
  background-color: var(--page-bg);
  border-radius: var(--radius);
  font-size: 13.5px;
  line-height: 1.55;
}

.muted {
  color: var(--text-muted);
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.contact-item {
  padding: 16px 18px;
  background-color: var(--page-bg);
  border-radius: var(--radius);
  font-size: 14px;
}

/* Makes the address box span the full width of the grid */
.contact-item-wide {
  grid-column: 1 / -1;
}

.contact-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.contact-item a {
  color: var(--navy-600);
  font-weight: 600;
  text-decoration: none;
}

.contact-item a:hover {
  text-decoration: underline;
}

/* ---------- Call-to-action block ---------- */
.section-cta {
  text-align: center;
}

.section-cta h2 {
  border-bottom: none;
  font-size: 18px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--navy-900);
  padding-bottom: 0;
  margin-bottom: 8px;
}

.section-cta .btn-hero-primary {
  margin-top: 14px;
  color: var(--white);
  background-color: var(--navy-600);
  border-color: var(--navy-600);
}

.section-cta .btn-hero-primary:hover {
  background-color: var(--navy-700);
}

/* ---------- Page footer ---------- */
.site-footer {
  margin-top: 20px;
  padding: 26px 24px;
  background-color: var(--navy-900);
  text-align: center;
  font-size: 12.5px;
  color: #8fa5c8;
}

.footer-links {
  margin-top: 8px;
}

.footer-links a {
  color: #cdd8ea;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}


/* ------------------------------------------------------------
   PAGE LAYOUT
   ------------------------------------------------------------ */
.page {
  display: flex;
  justify-content: center;  /* centre the card horizontally */
  padding: 48px 20px 64px;
}


/* ------------------------------------------------------------
   THE CARD (white box)
   ------------------------------------------------------------ */
.card {
  background-color: var(--white);
  width: 100%;
  max-width: 520px;              /* never wider than this */
  border: 1px solid var(--navy-100);
  border-top: 4px solid var(--navy-600);  /* navy accent stripe on top */
  border-radius: var(--radius);
  padding: 36px 38px 30px;
  /* A soft shadow lifts the card off the background */
  box-shadow: 0 1px 2px rgba(11, 31, 58, 0.06),
              0 8px 24px rgba(11, 31, 58, 0.08);
}

.card-header {
  border-bottom: 1px solid var(--navy-100);
  padding-bottom: 18px;
  margin-bottom: 26px;
}

.card-header h1 {
  font-size: 23px;
  font-weight: 600;
  color: var(--navy-900);
  letter-spacing: 0.2px;
}

.card-subtitle {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-muted);
}

.card-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--navy-100);
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;

  /* Stack the credit line and the admin button, centred, with a
     small gap between them. */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* The row holding the Share and Admin Login buttons */
.footer-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  /* On a very narrow phone they drop onto two lines */
  flex-wrap: wrap;
}

/* The Share button — solid navy, so it reads as the one students
   are meant to use. Admin Login stays quiet beside it. */
.btn-share {
  padding: 7px 16px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--white);
  background-color: var(--navy-600);
  border: 1px solid var(--navy-600);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-share:hover {
  background-color: var(--navy-700);
}

.btn-share:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(27, 58, 107, 0.25);
}

/* The "Link copied" confirmation line */
.share-status {
  margin-top: 4px;
  font-size: 12px;
  color: var(--success);
  font-weight: 600;
  /* A long URL must wrap rather than stretch the card */
  overflow-wrap: anywhere;
}


/* The small outlined "Admin Login" button.
   ------------------------------------------------------------
   It is an <a> link, not a <button>, because it navigates to
   another page. We just style it to look like a button.
   ------------------------------------------------------------ */
.btn-admin-link {
  display: inline-block;
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--navy-600);
  background-color: var(--white);
  border: 1px solid #c8d0dd;
  border-radius: var(--radius);
  /* Links are underlined by default; we don't want that here. */
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-admin-link:hover {
  background-color: var(--navy-100);
  border-color: var(--navy-600);
}

/* Show a clear focus ring for people navigating by keyboard */
.btn-admin-link:focus-visible {
  outline: none;
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(27, 58, 107, 0.15);
}


/* ------------------------------------------------------------
   FORM FIELDS
   ------------------------------------------------------------ */
.field {
  margin-bottom: 20px;
}

/* Labels sit ABOVE the input because they are display:block */
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-900);
  margin-bottom: 7px;
  letter-spacing: 0.2px;
  text-transform: uppercase;   /* formal, corporate feel */
}

input {
  width: 100%;
  padding: 11px 13px;
  font-size: 15px;
  font-family: inherit;         /* use the same font as the body */
  color: var(--text-dark);
  background-color: var(--white);
  border: 1px solid #c8d0dd;
  border-radius: var(--radius);
  /* Animate the border/shadow change so focus feels smooth */
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder {
  color: #9aa5b5;
}

/* ":focus" = the input the user is currently typing in */
input:focus {
  outline: none;                          /* remove default outline... */
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(27, 58, 107, 0.15);  /* ...replace with a navy glow */
}

/* JavaScript adds the "input-error" class when validation fails */
input.input-error {
  border-color: var(--error);
  background-color: #fffafa;
}

input.input-error:focus {
  box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.15);
}

/* Small grey helper text under a field */
.hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

/* The red error text. It's empty and hidden until JS fills it in. */
.error-text {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--error);
  min-height: 0;
  display: none;
}

/* Class added by JS to reveal the error line */
.error-text.is-visible {
  display: block;
}


/* ------------------------------------------------------------
   SPM RESULTS SECTION
   ------------------------------------------------------------ */

/* A <fieldset> has a default border and padding we don't want. */
.spm-fieldset {
  border: none;
  padding: 0;
  margin: 0;
  /* min-width:0 stops fieldsets from refusing to shrink on mobile —
     a long-standing browser quirk. */
  min-width: 0;
}

/* The "SPM Results" heading — styled to match the other labels */
.spm-fieldset legend {
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-900);
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

/* The explanatory line sits under the legend, above the rows */
.hint-top {
  margin: 7px 0 12px;
}

/* One subject row: [ subject ] [ grade ] [ × ] */
.spm-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

/* Dropdowns share the look of the text inputs */
.spm-row select {
  padding: 10px 11px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--text-dark);
  background-color: var(--white);
  border: 1px solid #c8d0dd;
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  /* Stops a long subject name from stretching the row */
  min-width: 0;
}

.spm-row select:focus {
  outline: none;
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(27, 58, 107, 0.15);
}

/* flex: 1 makes the subject box take all the leftover space, so the
   grade box and × button stay their natural size. */
.spm-subject {
  flex: 1;
}

.spm-grade {
  flex: 0 0 88px;   /* don't grow, don't shrink, stay 88px wide */
}

/* The small "×" remove button */
.btn-remove {
  flex: 0 0 38px;
  font-size: 19px;
  line-height: 1;
  color: var(--text-muted);
  background-color: var(--white);
  border: 1px solid #c8d0dd;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease,
              border-color 0.15s ease;
}

.btn-remove:hover {
  color: var(--error);
  border-color: var(--error);
  background-color: var(--error-bg);
}

/* The "+ Add Subject" button — outlined, so it reads as a secondary
   action next to the solid navy Submit button. */
.btn-add {
  margin-top: 4px;
  padding: 9px 15px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy-600);
  background-color: var(--white);
  border: 1px solid var(--navy-600);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-add:hover {
  background-color: var(--navy-100);
}


/* ------------------------------------------------------------
   SUBMIT BUTTON
   ------------------------------------------------------------ */
.btn-submit {
  width: 100%;
  padding: 13px;
  margin-top: 6px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--white);
  background-color: var(--navy-600);   /* solid navy */
  border: none;
  border-radius: var(--radius);
  cursor: pointer;                     /* hand cursor on hover */
  transition: background-color 0.15s ease;
}

.btn-submit:hover {
  background-color: var(--navy-700);
}

.btn-submit:active {
  background-color: var(--navy-900);
}

/* ":disabled" applies while we're saving, so nobody double-submits */
.btn-submit:disabled {
  background-color: #8d9bb2;
  cursor: not-allowed;
}


/* ------------------------------------------------------------
   ALERT BOXES (success / error banners)
   ------------------------------------------------------------ */
.alert {
  padding: 13px 15px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 22px;
  border-left: 4px solid transparent;   /* coloured stripe on the left */
}

.alert-success {
  background-color: var(--success-bg);
  color: var(--success);
  border-left-color: var(--success);
}

.alert-error {
  background-color: var(--error-bg);
  color: var(--error);
  border-left-color: var(--error);
}

/* A general-purpose "hide this" class used by JavaScript */
.is-hidden {
  display: none;
}


/* ------------------------------------------------------------
   ADMIN PAGE
   ------------------------------------------------------------
   Everything below is used only by admin.html. The form page
   ignores it.
   ------------------------------------------------------------ */

/* The admin page needs a wider column than the form */
.page-wide .card-wide {
  max-width: 940px;
}

/* Heading row with the title on the left, Sign Out on the right */
.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

/* A quieter button style: outlined instead of solid navy.
   Used for Sign Out, Sort and Refresh. */
.btn-plain {
  padding: 9px 14px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;      /* keep the label on one line */
  color: var(--navy-600);
  background-color: var(--white);
  border: 1px solid var(--navy-600);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-plain:hover {
  background-color: var(--navy-100);
}

/* ------------------------------------------------------------
   ANALYTICS SECTION
   ------------------------------------------------------------ */

.analytics {
  margin-bottom: 26px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--navy-100);
}

.analytics-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy-900);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

/* The sentence explaining the rule, under the heading */
.analytics-note {
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Bold words inside that sentence pick up the navy colour */
.analytics-note strong {
  color: var(--navy-900);
  font-weight: 600;
}

/* ---------- The three summary boxes ---------- */
.stat-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;      /* stack on a narrow screen */
}

.stat-box {
  flex: 1;
  min-width: 130px;
  padding: 14px 16px;
  background-color: var(--navy-900);
  border-radius: var(--radius);
  /* Stack the big number above its caption */
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* The "Qualified" tile gets a green left edge so the good number
   stands out from the other two at a glance. */
.stat-box-pass {
  border-left: 4px solid var(--success);
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--white);
}

.stat-label {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #a9b6cc;       /* muted blue-grey against the navy */
}

/* ---------- The two chart panels ---------- */
.analytics-grid {
  display: grid;
  /* Two equal columns on a wide screen. "1fr" means one equal
     share of the space. */
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.panel {
  padding: 16px 18px;
  border: 1px solid var(--navy-100);
  border-radius: var(--radius);
  background-color: var(--white);
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-900);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.panel-note {
  margin: 4px 0 14px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- The bar chart ---------- */

/* One row = label, bar, number */
.chart-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}

.chart-label {
  /* Fixed width keeps every bar starting at the same place */
  flex: 0 0 42px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dark);
  /* Cut off a very long subject name with "..." rather than
     letting it push the bar out of line */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The grey groove the bar sits in */
.chart-track {
  flex: 1;
  height: 16px;
  background-color: #eef1f7;
  border-radius: 3px;
  overflow: hidden;
}

/* The navy bar itself */
.chart-fill {
  height: 100%;
  background-color: var(--navy-600);
  border-radius: 3px;
  /* Animate the width so the bars grow into place when the
     numbers change */
  transition: width 0.3s ease;
}

/* Subject names are much longer than grade names like "A+", so the
   subject chart gets a wider label column. */
.chart-wide .chart-label {
  flex: 0 0 128px;
}

.chart-count {
  flex: 0 0 28px;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy-900);
}

.chart-empty {
  font-size: 12.5px;
  color: var(--text-muted);
}


/* ---------- The search / sort / refresh bar ---------- */
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  /* On a narrow screen the buttons drop onto a second line
     instead of squashing */
  flex-wrap: wrap;
}

.search-input {
  /* flex: 1 = "take all the leftover space" */
  flex: 1;
  min-width: 180px;
  padding: 10px 12px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--text-dark);
  border: 1px solid #c8d0dd;
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(27, 58, 107, 0.15);
}

/* ---------- The table ---------- */

/* Lets a wide table scroll sideways on its own, instead of
   stretching the whole page */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--navy-100);
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  /* Collapse removes the double lines between cells */
  border-collapse: collapse;
  font-size: 14px;
}

/* Column headings: navy bar, white text */
.data-table th {
  background-color: var(--navy-600);
  color: var(--white);
  text-align: left;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 11px 14px;
  white-space: nowrap;
}

.data-table td {
  padding: 11px 14px;
  border-top: 1px solid var(--navy-100);
  color: var(--text-dark);
}

/* Shade every second row so long lists stay readable.
   "nth-child(even)" means the 2nd, 4th, 6th row and so on. */
.data-table tbody tr:nth-child(even) {
  background-color: #f7f9fc;
}

.data-table tbody tr:hover {
  background-color: var(--navy-100);
}

/* ---------- SPM results inside the admin table ---------- */

/* The container holding one student's subject lines */
.spm-list {
  /* Stops a long subject name stretching the column */
  max-width: 260px;
}

/* One line: "Matematik (A+)" */
.spm-line {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-dark);
  /* Keep a subject and its grade together on one line */
  white-space: nowrap;
}

/* The dash shown when a row has no SPM data */
.spm-empty {
  color: var(--text-muted);
}


/* Message shown when a search matches nothing */
.empty-state {
  padding: 26px 0 6px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}


/* ------------------------------------------------------------
   MOBILE ADJUSTMENTS
   ------------------------------------------------------------
   A "media query" applies rules only on screens up to 560px wide.
   ------------------------------------------------------------ */
@media (max-width: 560px) {
  .page {
    padding: 28px 14px 48px;
  }

  .card {
    padding: 26px 20px 22px;
  }

  .card-header h1 {
    font-size: 20px;
  }

  /* Shrink the logo so it never overflows a narrow phone screen */
  .site-header {
    padding: 14px 16px;
  }

  .brand-logo {
    height: 34px;
  }

  /* Tabs on a phone: tighter, and they scroll sideways */
  .tab-bar-inner {
    padding: 0 12px;
  }

  .tab {
    padding: 12px 11px;
    font-size: 12.5px;
  }

  /* Profile pages on a phone */
  .hero {
    padding: 40px 18px 38px;
  }

  .hero h1 {
    font-size: 27px;
  }

  .hero-role {
    font-size: 15px;
  }

  .content-wrap {
    padding: 0 16px 16px;
  }

  .section {
    padding: 30px 0;
  }

  /* Timeline stacks: date above the description */
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  /* Admin page: stack the heading and Sign Out button */
  .admin-header {
    flex-direction: column;
    gap: 12px;
  }

  /* Charts go one above the other instead of side by side */
  .analytics-grid {
    grid-template-columns: 1fr;
  }

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

  .chart-label {
    flex: 0 0 54px;
  }

  .data-table {
    font-size: 13px;
  }

  .data-table th,
  .data-table td {
    padding: 9px 11px;
  }

  /* Give the subject dropdown more room on a narrow screen */
  .spm-grade {
    flex: 0 0 74px;
  }

  .spm-row select {
    font-size: 13.5px;
    padding: 10px 8px;
  }
}
