/* ==========================================================================
   ASCETA — Agricultural Extension Service Information System
   Institutional design system
   --------------------------------------------------------------------------
   Palette extracted from the official ASCETA website
   (www.asceta.edu.ng  ->  assets/index-*.css) and from the college crest:
     navy   #0B2545 / #0F294A / #0B2240 / #122049
     gold   #C29B38 / #AA8018 / #8A6610
     blue   #1E40AF / #1D4ED8 (interactive)
     crest  #FC4D4D (red), #067DBF (blue)
   Neutral surfaces follow the site's slate/slate-50 usage.
   ========================================================================== */

/* --------------------------------------------------------------- 1. Tokens */
:root {
  /* Brand */
  --navy-900: #0B2545;
  --navy-850: #0D294D;
  --navy-800: #0F2A4D;
  --navy-700: #16365F;
  --navy-600: #1E4470;

  --gold-700: #8A6610;
  --gold-600: #AA8018;
  --gold-500: #C29B38;
  --gold-300: #DFC583;
  --gold-100: #F6EBD2;
  --gold-50:  #FBF6EA;

  --blue-700: #1E40AF;
  --blue-600: #1D4ED8;
  --blue-100: #DCE6FA;
  --blue-50:  #EEF3FC;

  --red-700: #A3242A;
  --red-600: #B93036;
  --red-50:  #FBEDEE;

  --green-700: #14684A;
  --green-600: #1B7A57;
  --green-50:  #E9F5EF;

  /* Ink & surfaces */
  --ink: #0F172A;
  --ink-2: #2C3E55;
  --muted: #5A6B80;
  --muted-2: #7A8899;
  --line: #DDE4EC;
  --line-2: #EDF1F6;
  --line-strong: #C6D1DE;
  --surface: #FFFFFF;
  --surface-2: #F6F8FB;
  --page: #F1F4F8;

  /* Shape & depth */
  --r-xs: 5px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --shadow-xs: 0 1px 2px rgba(11, 37, 69, .06);
  --shadow-sm: 0 1px 2px rgba(11, 37, 69, .05), 0 2px 6px rgba(11, 37, 69, .05);
  --shadow-md: 0 6px 18px -6px rgba(11, 37, 69, .16), 0 2px 6px rgba(11, 37, 69, .05);
  --shadow-lg: 0 24px 48px -28px rgba(11, 37, 69, .45);

  /* Type */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* Metrics */
  --header-h: 74px;
  --gutter: 24px;
  --maxw: 1200px;
  --focus: 0 0 0 3px rgba(30, 64, 175, .28);
}

/* ---------------------------------------------------------------- 2. Base */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.has-app { background: var(--surface-2); }

img, svg, video { max-width: 100%; }
img { height: auto; }
svg { flex: 0 0 auto; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .5em;
  color: var(--navy-900);
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -.01em;
}

h1 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }
h3 { font-size: 1.16rem; }
h4 { font-size: 1.02rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

small { font-size: .8125rem; }

strong { font-weight: 650; }

hr {
  height: 0;
  margin: 28px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

::selection { background: var(--gold-300); color: var(--navy-900); }

:focus-visible {
  outline: 2px solid var(--blue-700);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Links ---------------------------------------------------------------- */
a { color: var(--blue-700); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue-600); }

/* Lists ---------------------------------------------------------------- */
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
li { margin-bottom: .35em; }

/* ------------------------------------------------------------- 3. Layout */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: 56px; }
.section--tight { padding-block: 36px; }
.section--flush { padding-top: 0; }
.section--alt { background: var(--surface); border-block: 1px solid var(--line); }
.section--navy {
  background:
    radial-gradient(1000px 420px at 88% -10%, rgba(194, 155, 56, .16), transparent 62%),
    var(--navy-900);
  color: rgba(255, 255, 255, .82);
}
.section--navy h2, .section--navy h3 { color: #fff; }

.stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 22px; }
.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)); }
.split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 34px; align-items: start; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--gold-500);
  color: var(--navy-900);
  font-weight: 700;
  font-size: .875rem;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  transition: top .15s ease;
}
.skip-link:focus { top: 0; color: var(--navy-900); }

/* --------------------------------------------------------- 4. Top strip */
.topbar {
  background: var(--navy-900);
  color: rgba(255, 255, 255, .72);
  font-size: .78rem;
  letter-spacing: .015em;
}
.topbar__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 34px;
  padding-block: 6px;
}
.topbar__item { display: inline-flex; align-items: center; gap: 7px; }
.topbar__item svg { color: var(--gold-500); }
.topbar__sep { width: 1px; height: 12px; background: rgba(255, 255, 255, .22); }
.topbar__right { margin-left: auto; display: inline-flex; align-items: center; gap: 14px; }

/* ---------------------------------------------------------- 5. Masthead */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(11, 37, 69, .02);
  transition: box-shadow .2s ease;
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-500) 0%, var(--gold-500) 34%, var(--navy-700) 34%, var(--navy-700) 100%);
  opacity: .9;
}
.site-header.is-scrolled { box-shadow: 0 8px 24px -18px rgba(11, 37, 69, .45); }

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand__crest {
  width: 46px;
  height: 46px;
  object-fit: contain;
  padding: 3px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: var(--shadow-xs);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--navy-900);
}
.brand__sub {
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold-700);
  margin-top: 3px;
}

/* Navigation ------------------------------------------------------------ */
.primary-nav { margin-left: auto; }
.primary-nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.primary-nav__list > li { margin: 0; position: relative; }

.primary-nav a,
.primary-nav summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 13px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: .895rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .16s ease, color .16s ease;
}
.primary-nav a:hover,
.primary-nav summary:hover { background: var(--surface-2); color: var(--navy-900); }
.primary-nav a[aria-current="page"] { color: var(--navy-900); background: var(--gold-50); }
.primary-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 13px; right: 13px; bottom: 2px;
  height: 2px;
  background: var(--gold-500);
  border-radius: 2px;
}
.primary-nav__list > li > a { position: relative; }

.nav-dropdown > details { position: relative; }
.nav-dropdown summary { list-style: none; }
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary svg { transition: transform .18s ease; color: var(--muted-2); }
.nav-dropdown details[open] summary { background: var(--surface-2); color: var(--navy-900); }
.nav-dropdown details[open] summary svg { transform: rotate(180deg); }

.nav-dropdown__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 90;
  min-width: 252px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
}
.nav-dropdown__menu li { margin: 0; }
.nav-dropdown__menu a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-xs);
  font-size: .875rem;
  white-space: normal;
}
.nav-dropdown__menu a::after { display: none; }
.nav-dropdown__menu a:hover { background: var(--blue-50); color: var(--navy-900); }
.nav-dropdown__menu .menu-ico {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  flex: 0 0 30px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--navy-700);
}
.nav-dropdown__menu small { display: block; color: var(--muted); font-weight: 400; font-size: .74rem; margin-top: 1px; }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--navy-900);
  cursor: pointer;
  place-items: center;
}
.nav-toggle:hover { background: var(--surface-2); }

/* Mobile masthead ------------------------------------------------------- */
@media (max-width: 980px) {
  :root { --header-h: 64px; }
  .site-header__inner { flex-wrap: wrap; min-height: 0; padding-block: 10px; gap: 0; }
  .brand { order: 1; }
  .brand__crest { width: 40px; height: 40px; }
  .brand__name { font-size: 1.1rem; }
  .brand__sub { font-size: .6rem; letter-spacing: .1em; }
  .nav-toggle { order: 2; display: grid; }
  .primary-nav {
    order: 3;
    display: none;
    width: calc(100% + 2 * var(--gutter));
    margin: 10px calc(-1 * var(--gutter)) -10px;
    padding: 8px var(--gutter) 14px;
    background: #fff;
    border-top: 1px solid var(--line);
    max-height: calc(100dvh - var(--header-h) - 60px);
    overflow-y: auto;
  }
  .site-header.is-open .primary-nav { display: block; }
  .primary-nav__list { flex-direction: column; align-items: stretch; gap: 1px; }
  .primary-nav a,
  .primary-nav summary { padding: 12px 10px; font-size: .95rem; border-radius: var(--r-xs); }
  .primary-nav a[aria-current="page"] { background: var(--gold-50); }
  .primary-nav a[aria-current="page"]::after { display: none; }
  .nav-dropdown__menu {
    position: static;
    min-width: 0;
    margin: 2px 0 6px;
    padding: 4px 0 4px 10px;
    border: 0;
    border-left: 2px solid var(--gold-300);
    border-radius: 0;
    box-shadow: none;
  }
  .topbar__right { display: none; }
  .topbar__inner { justify-content: center; text-align: center; font-size: .72rem; }
  .topbar__sep { display: none; }
}

@media (max-width: 560px) {
  .brand__sub { display: none; }
  .brand__name { font-size: 1.02rem; letter-spacing: .04em; }
  .topbar__item span { display: inline; }
  .topbar__item { line-height: 1.35; }
}

/* ------------------------------------------------------------- 6. Hero */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--navy-900);
  color: #fff;
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url("../../img/mechanize_bg.png");
  background-size: cover;
  background-position: center 38%;
  transform: scale(1.02);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(100deg, rgba(11, 37, 69, .96) 0%, rgba(11, 37, 69, .88) 42%, rgba(11, 37, 69, .55) 72%, rgba(11, 37, 69, .42) 100%),
    linear-gradient(to top, rgba(11, 37, 69, .75), transparent 45%);
}
.hero__inner { padding-block: clamp(56px, 8vw, 104px); max-width: 720px; }
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: var(--gold-300);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.hero h1 {
  color: #fff;
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  line-height: 1.14;
  letter-spacing: -.015em;
  margin-bottom: 18px;
  text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--gold-300); }
.hero__lead {
  max-width: 58ch;
  margin-bottom: 30px;
  color: rgba(255, 255, 255, .82);
  font-size: clamp(1rem, 1.35vw, 1.08rem);
  line-height: 1.7;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__rule { width: 64px; height: 3px; background: var(--gold-500); margin-bottom: 22px; border-radius: 2px; }

.hero--compact .hero__inner { padding-block: 52px; }
.hero--compact h1 { font-size: clamp(1.65rem, 3vw, 2.2rem); }

/* Breadcrumb ------------------------------------------------------------ */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .8rem; color: rgba(255, 255, 255, .62); margin-bottom: 18px; }
.crumbs a { color: rgba(255, 255, 255, .82); text-decoration: none; }
.crumbs a:hover { color: #fff; text-decoration: underline; }
.crumbs span[aria-hidden] { opacity: .45; }
.page-head .crumbs { color: var(--muted); }
.page-head .crumbs a { color: var(--muted); }
.page-head .crumbs a:hover { color: var(--navy-900); }

/* --------------------------------------------------------- 7. Page head */
.page-head {
  padding-block: 40px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.page-head__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--gold-700);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.page-head h1 { margin-bottom: 10px; }
.page-head__lead { max-width: 68ch; margin: 0; color: var(--muted); font-size: 1.02rem; }
.page-head__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ------------------------------------------------------------- 8. Buttons */
.btn {
  --btn-bg: var(--navy-900);
  --btn-fg: #fff;
  --btn-bd: var(--navy-900);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-sans);
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
  -webkit-appearance: none;
  appearance: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; }

.btn--primary { --btn-bg: var(--navy-900); --btn-bd: var(--navy-900); }
.btn--primary:hover { --btn-bg: var(--navy-700); --btn-bd: var(--navy-700); color: #fff; }

.btn--gold { --btn-bg: var(--gold-500); --btn-bd: var(--gold-500); --btn-fg: #1A1408; }
.btn--gold:hover { --btn-bg: var(--gold-300); --btn-bd: var(--gold-300); color: #1A1408; }

.btn--outline { --btn-bg: #fff; --btn-bd: var(--line-strong); --btn-fg: var(--navy-900); }
.btn--outline:hover { --btn-bg: var(--surface-2); --btn-bd: var(--navy-700); color: var(--navy-900); }

.btn--light { --btn-bg: rgba(255, 255, 255, .1); --btn-bd: rgba(255, 255, 255, .34); --btn-fg: #fff; }
.btn--light:hover { --btn-bg: rgba(255, 255, 255, .18); --btn-bd: rgba(255, 255, 255, .6); color: #fff; }

.btn--ghost { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--navy-800); }
.btn--ghost:hover { --btn-bg: var(--surface-2); color: var(--navy-900); }

.btn--danger { --btn-bg: #fff; --btn-bd: #E4C9CB; --btn-fg: var(--red-700); }
.btn--danger:hover { --btn-bg: var(--red-50); --btn-bd: var(--red-600); color: var(--red-700); }

.btn--sm { min-height: 34px; padding: 0 12px; font-size: .8rem; gap: 6px; border-radius: var(--r-xs); }
.btn--sm svg { width: 15px; height: 15px; }
.btn--lg { min-height: 52px; padding: 0 26px; font-size: 1rem; }
.btn--block { display: flex; width: 100%; }

/* ----------------------------------------------------------- 9. Typography */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-700);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--gold-500); }
.section-head { max-width: 62ch; margin-bottom: 32px; }
.section-head h2 { margin: 10px 0 10px; }
.section-head p { color: var(--muted); margin: 0; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }
.lead { font-size: 1.06rem; color: var(--muted); line-height: 1.7; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: var(--font-mono); font-size: .84rem; }
.prose p { color: var(--ink-2); line-height: 1.78; margin-bottom: 1.15em; }
.prose h3 { margin-top: 1.6em; }

/* -------------------------------------------------------------- 10. Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card--flush { overflow: visible; }
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-2);
  background: #fff;
}
.card__title { margin: 0; font-size: 1.12rem; }
.card__sub { margin: 3px 0 0; color: var(--muted); font-size: .82rem; }
.card__body { padding: 22px; }
.card__body--flush { padding: 0; }
.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 22px;
  border-top: 1px solid var(--line-2);
  background: var(--surface-2);
}

/* Link card ------------------------------------------------------------- */
.link-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.link-card:hover,
.link-card:focus-visible {
  border-color: var(--gold-500);
  box-shadow: var(--shadow-md);
  color: inherit;
  text-decoration: none;
  transform: translateY(-2px);
}
.link-card__icon {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 10px;
  background: var(--blue-50);
  color: var(--navy-800);
  border: 1px solid #DCE6F5;
}
.link-card__icon svg { width: 22px; height: 22px; }
.link-card h3 { margin: 0; font-size: 1.08rem; }
.link-card p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.link-card__more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding-top: 6px;
  color: var(--blue-700);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.link-card__more svg { width: 15px; height: 15px; transition: transform .18s ease; }
.link-card:hover .link-card__more svg { transform: translateX(3px); }
.link-card--gold .link-card__icon { background: var(--gold-50); border-color: #EFE0BC; color: var(--gold-700); }

/* Feature tile ---------------------------------------------------------- */
.feature {
  display: flex;
  gap: 16px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.feature__icon {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  flex: 0 0 40px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--navy-700);
}
.feature h3 { margin: 0 0 5px; font-size: 1rem; font-family: var(--font-sans); font-weight: 700; }
.feature p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.6; }

/* ------------------------------------------------------------- 11. Stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; }
.stat {
  position: relative;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--gold-500);
}
.stat__label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.stat__value { margin: 8px 0 2px; font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; color: var(--navy-900); line-height: 1.05; }
.stat__note { margin: 0; color: var(--muted); font-size: .8rem; }

/* ------------------------------------------------------------- 12. Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid > .field--full, .form-grid > .form-actions { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: .82rem;
  font-weight: 650;
  letter-spacing: .005em;
}
.field__label .req { color: var(--red-600); font-weight: 700; }
.field__hint { color: var(--muted); font-size: .78rem; line-height: 1.45; }
.field__error { display: flex; align-items: center; gap: 6px; color: var(--red-700); font-size: .79rem; font-weight: 600; }

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
input[type="file"],
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: .94rem;
  line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
  -webkit-appearance: none;
  appearance: none;
}
textarea { min-height: 118px; resize: vertical; padding: 12px 13px; }
select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235A6B80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 16px;
  cursor: pointer;
}
input[type="file"] { padding: 8px 10px; font-size: .86rem; color: var(--muted); cursor: pointer; }
input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  background: var(--surface-2);
  color: var(--navy-900);
  font-family: var(--font-sans);
  font-size: .82rem;
  font-weight: 650;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--blue-50); border-color: var(--blue-700); }

input::placeholder, textarea::placeholder { color: #9AA7B6; }
input:hover, select:hover, textarea:hover { border-color: #AFBCCB; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue-700);
  box-shadow: var(--focus);
}
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }

input[type="checkbox"], input[type="radio"] { accent-color: var(--navy-700); width: 16px; height: 16px; min-height: 0; }

.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: var(--red-600); box-shadow: 0 0 0 3px rgba(163, 36, 42, .1); }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 4px; }
.form-actions--end { justify-content: flex-end; }
.form-actions .btn { min-width: 132px; }
.form-note { color: var(--muted); font-size: .8rem; }

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }

/* ------------------------------------------------------------ 13. Alerts */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: .88rem;
  line-height: 1.55;
}
.alert svg { width: 18px; height: 18px; margin-top: 1px; }
.alert strong { font-weight: 700; }
.alert--success { background: var(--green-50); border-color: #C3E3D3; color: #10543B; }
.alert--error { background: var(--red-50); border-color: #EFCBCE; color: var(--red-700); }
.alert--info { background: var(--blue-50); border-color: #CFDCF6; color: #16367F; }
.alert--warning { background: var(--gold-50); border-color: #EAD7A8; color: var(--gold-700); }
.alert--flush { margin-bottom: 0; }
.alert a { color: inherit; font-weight: 700; }

.form-msg { margin-bottom: 16px; }
.form-msg:empty { display: none; }

/* ------------------------------------------------------------- 14. Tables */
.table-wrap {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table { width: 100%; border-collapse: collapse; font-size: .89rem; }
.table caption { padding: 14px 18px; color: var(--muted); font-size: .8rem; text-align: left; caption-side: top; }
.table th {
  padding: 11px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}
.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-2);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .12s ease; }
.table tbody tr:hover { background: #FAFCFE; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .cell-title { color: var(--navy-900); font-weight: 650; }
.table .cell-sub { display: block; margin-top: 2px; color: var(--muted); font-size: .78rem; }
.table__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.table__actions form { margin: 0; display: inline-flex; }

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-2);
  background: #fff;
}
.table-toolbar__count { color: var(--muted); font-size: .82rem; }

/* Stacked tables on phones */
@media (max-width: 760px) {
  .table-wrap--stack { border: 0; background: transparent; overflow: visible; border-radius: 0; }
  .table--stack { display: block; font-size: .88rem; }
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .table--stack tbody { display: block; }
  .table--stack tr {
    display: block;
    margin-bottom: 12px;
    padding: 6px 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-xs);
  }
  .table--stack tr:hover { background: #fff; }
  .table--stack td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--line-2);
    text-align: right;
  }
  .table--stack td:last-child { border-bottom: 0; }
  .table--stack td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    text-align: left;
    padding-top: 2px;
  }
  .table--stack td:not([data-label])::before { content: none; }
  .table--stack td.empty-cell { display: block; text-align: center; padding: 22px 0; }
  .table--stack .table__actions { justify-content: flex-end; flex-wrap: wrap; }
}

/* -------------------------------------------------------- 15. Empty state */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 48px 24px;
  text-align: center;
}
.empty__icon {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--gold-50);
  border: 1px solid #EDE0C2;
  color: var(--gold-700);
}
.empty h3 { margin: 0; font-family: var(--font-sans); font-size: .98rem; font-weight: 700; color: var(--navy-900); }
.empty p { margin: 0; max-width: 44ch; color: var(--muted); font-size: .86rem; }
.empty .btn { margin-top: 10px; }

/* ------------------------------------------------------------- 16. Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge--gold { background: var(--gold-50); border-color: #E9D8B1; color: var(--gold-700); }
.badge--navy { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.badge--blue { background: var(--blue-50); border-color: #CFDCF6; color: #16367F; }
.badge--green { background: var(--green-50); border-color: #C3E3D3; color: var(--green-700); }
.badge--red { background: var(--red-50); border-color: #EFCBCE; color: var(--red-700); }

/* ----------------------------------------------------------- 17. Auth */
.auth {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  min-height: calc(100vh - var(--header-h) - 35px);
  background: #fff;
}
.auth__aside {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  padding: clamp(32px, 5vw, 64px);
  background: var(--navy-900);
  color: rgba(255, 255, 255, .8);
}
.auth__aside::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(160deg, rgba(11, 37, 69, .93) 0%, rgba(15, 42, 77, .82) 46%, rgba(11, 37, 69, .9) 100%),
    url("../../img/mechanize_bg.png") center / cover no-repeat;
}
.auth__badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: var(--gold-300);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.auth__title {
  margin: 0;
  color: #fff;
  font-size: clamp(1.7rem, 2.8vw, 2.3rem);
  line-height: 1.2;
  text-wrap: balance;
}
.auth__lead { margin: 0; max-width: 46ch; font-size: .98rem; line-height: 1.7; color: rgba(255, 255, 255, .78); }
.auth__points { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.auth__points li { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-size: .9rem; color: rgba(255, 255, 255, .82); }
.auth__points svg { width: 17px; height: 17px; margin-top: 2px; color: var(--gold-300); }
.auth__meta { display: flex; align-items: center; gap: 10px; padding-top: 4px; border-top: 1px solid rgba(255, 255, 255, .16); font-size: .76rem; color: rgba(255, 255, 255, .62); }
.auth__meta img { width: 30px; height: 30px; object-fit: contain; background: #fff; border-radius: 50%; padding: 2px; }

.auth__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 5vw, 64px) var(--gutter);
  background: var(--surface-2);
}
.auth__card {
  width: 100%;
  max-width: 430px;
  padding: clamp(24px, 3.4vw, 38px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}
.auth__role {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--blue-50);
  color: #16367F;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.auth__card h1 { font-size: 1.55rem; margin-bottom: 6px; }
.auth__card .auth__intro { margin: 0 0 22px; color: var(--muted); font-size: .88rem; line-height: 1.6; }
.auth__form { display: grid; gap: 16px; }
.auth__form .btn--block { min-height: 48px; margin-top: 4px; }
.auth__alt { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--line-2); text-align: center; color: var(--muted); font-size: .82rem; }
.auth__alt a { font-weight: 650; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; min-height: 0; }
  .auth__aside { gap: 16px; padding: 30px var(--gutter) 32px; }
  .auth__title { font-size: 1.5rem; }
  .auth__lead { font-size: .9rem; }
  .auth__points { display: none; }
  .auth__badge { font-size: .62rem; }
  .auth__panel { padding: 26px var(--gutter) 40px; align-items: flex-start; }
  .auth__card { max-width: 520px; margin-inline: auto; }
}

/* --------------------------------------------------------- 18. App shell */
.app {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  align-items: start;
  background: var(--surface-2);
}
.sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background:
    radial-gradient(520px 260px at 50% -10%, rgba(194, 155, 56, .14), transparent 70%),
    var(--navy-900);
  color: rgba(255, 255, 255, .76);
  border-right: 1px solid rgba(255, 255, 255, .06);
  z-index: 40;
}
.sidebar__head { display: flex; align-items: center; gap: 11px; padding: 22px 20px 18px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.sidebar__head img { width: 38px; height: 38px; object-fit: contain; background: #fff; border-radius: 50%; padding: 3px; }
.sidebar__role { font-size: .64rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--gold-300); }
.sidebar__title { font-family: var(--font-display); font-size: 1rem; color: #fff; line-height: 1.2; }
.sidebar__body { flex: 1; padding: 16px 12px 20px; }
.sidebar__label {
  display: block;
  margin: 18px 10px 8px;
  color: rgba(255, 255, 255, .45);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.sidebar__label:first-child { margin-top: 4px; }
.sidebar__nav { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.sidebar__nav li { margin: 0; }
.sidebar__nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: rgba(255, 255, 255, .76);
  font-size: .86rem;
  font-weight: 550;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.sidebar__nav a svg { width: 17px; height: 17px; opacity: .8; }
.sidebar__nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar__nav a[aria-current="page"] { background: rgba(255, 255, 255, .12); color: #fff; }
.sidebar__nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0; top: 9px; bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gold-500);
}
.sidebar__foot { padding: 14px 12px 18px; border-top: 1px solid rgba(255, 255, 255, .1); }
.sidebar__user { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; }
.sidebar__avatar {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}
.sidebar__user-name { font-size: .82rem; font-weight: 600; color: #fff; line-height: 1.25; word-break: break-word; }
.sidebar__user-sub { font-size: .68rem; color: rgba(255, 255, 255, .55); }
.sidebar__signout {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 36px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: var(--r-sm);
  background: transparent;
  color: rgba(255, 255, 255, .8);
  font-family: inherit; font-size: .78rem; font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.sidebar__signout:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.sidebar__signout svg { width: 15px; height: 15px; }

.app__main { min-width: 0; display: flex; flex-direction: column; min-height: calc(100vh - var(--header-h)); }
.app-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 30px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
}
.app-topbar__menu {
  display: none;
  width: 40px; height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--navy-900);
  cursor: pointer;
}
.app-topbar__titles { min-width: 0; }
.app-topbar__crumb { display: block; color: var(--muted-2); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.app-topbar__title { margin: 2px 0 0; font-family: var(--font-sans); font-size: 1.02rem; font-weight: 700; color: var(--navy-900); }
.app-topbar__spacer { margin-left: auto; }
.app-topbar__user { display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.app-topbar__user .sidebar__avatar { width: 28px; height: 28px; flex-basis: 28px; background: var(--navy-900); border-color: var(--navy-900); font-size: .68rem; }
.app-topbar__user span { font-size: .78rem; font-weight: 650; color: var(--ink-2); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.app-body { flex: 1; padding: 28px 30px 36px; }
.app-body > * + * { margin-top: 22px; }
.app-footer { padding: 18px 30px 26px; color: var(--muted-2); font-size: .75rem; border-top: 1px solid var(--line); background: transparent; }

.app-scrim {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(11, 37, 69, .48);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
body.sidebar-open .app-scrim { opacity: 1; visibility: visible; }

@media (max-width: 1080px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 282px;
    height: 100dvh;
    top: 0;
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 90;
    box-shadow: var(--shadow-lg);
  }
  body.sidebar-open .sidebar { transform: none; }
  .app-topbar { padding: 10px 18px; }
  .app-topbar__menu { display: grid; }
  .app-body { padding: 20px 18px 32px; }
  .app-footer { padding: 16px 18px 24px; }
}

@media (max-width: 560px) {
  .app-topbar__user span { display: none; }
  .app-topbar__user { padding: 4px; }
  .app-body { padding: 16px 14px 28px; }
}

/* ------------------------------------------------------------- 19. Hero cards */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }

.panel-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.panel-band__item { padding: 20px 22px; background: #fff; }
.panel-band__label { display: block; color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.panel-band__value { display: block; margin-top: 6px; font-family: var(--font-display); font-size: 1.28rem; color: var(--navy-900); }
.panel-band__note { display: block; margin-top: 2px; color: var(--muted-2); font-size: .78rem; }

/* --------------------------------------------------------- 20. About page */
.article { max-width: 74ch; }
.article p { color: var(--ink-2); font-size: 1.01rem; line-height: 1.8; margin-bottom: 1.2em; }
.article p:first-of-type::first-letter {
  float: left;
  margin: 6px 10px 0 0;
  font-family: var(--font-display);
  font-size: 3.1rem;
  line-height: .82;
  color: var(--gold-600);
}
.article h2 { margin-top: 1.4em; }

.aside-card { position: sticky; top: calc(var(--header-h) + 20px); }
.fact-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; }
.fact-list li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); margin: 0; }
.fact-list li:last-child { border-bottom: 0; }
.fact-list svg { width: 17px; height: 17px; margin-top: 3px; color: var(--gold-700); }
.fact-list strong { display: block; font-size: .86rem; color: var(--navy-900); }
.fact-list span { font-size: .82rem; color: var(--muted); }

.pull-quote {
  margin: 0;
  padding: 22px 24px;
  border-left: 3px solid var(--gold-500);
  background: var(--gold-50);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--navy-800);
  font-family: var(--font-display);
  font-size: 1.08rem;
  line-height: 1.65;
}

/* -------------------------------------------------------- 21. Portal menu */
.portal-card { display: flex; align-items: flex-start; gap: 18px; padding: 26px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); text-decoration: none; color: inherit; height: 100%; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.portal-card:hover { border-color: var(--navy-700); box-shadow: var(--shadow-md); transform: translateY(-2px); color: inherit; text-decoration: none; }
.portal-card__icon { display: grid; place-items: center; width: 54px; height: 54px; flex: 0 0 54px; border-radius: 12px; background: var(--navy-900); color: var(--gold-300); }
.portal-card__icon svg { width: 24px; height: 24px; }
.portal-card h3 { margin: 0 0 6px; font-size: 1.06rem; }
.portal-card p { margin: 0 0 10px; color: var(--muted); font-size: .88rem; line-height: 1.6; }
.portal-card .link-card__more { padding-top: 0; }
.portal-card:nth-child(2) .portal-card__icon { background: var(--gold-600); color: #fff; }
.portal-card:nth-child(3) .portal-card__icon { background: var(--green-700); color: #fff; }
.portal-card:nth-child(4) .portal-card__icon { background: var(--navy-700); color: #fff; }

/* ----------------------------------------------------------- 22. Lesson */
.lesson-shell { border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-sm); overflow: hidden; }
.lesson-layout { display: grid; grid-template-columns: 296px minmax(0, 1fr); min-height: 560px; }
.lesson-topics {
  background: var(--navy-900);
  color: rgba(255, 255, 255, .78);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.lesson-topics__head { padding: 0 8px 14px; border-bottom: 1px solid rgba(255, 255, 255, .12); margin-bottom: 12px; }
.lesson-topics__title { margin: 0; font-family: var(--font-sans); font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-300); }
.lesson-topics__sub { margin: 4px 0 0; font-size: .78rem; color: rgba(255, 255, 255, .55); }
.lesson-topics__list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; max-height: 640px; padding-right: 2px; }
.topic-item {
  padding: 10px 12px;
  border-radius: var(--r-xs);
  border-left: 3px solid transparent;
  color: rgba(255, 255, 255, .76);
  font-size: .83rem;
  line-height: 1.45;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.topic-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.topic-item.active { background: rgba(255, 255, 255, .12); border-left-color: var(--gold-500); color: #fff; }

.lesson-main { min-width: 0; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.lesson-content-container { padding: 22px 24px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.lesson-title { margin: 0 0 12px; font-family: var(--font-display); font-size: 1.3rem; color: var(--navy-900); }
.lesson-body { color: var(--ink-2); font-size: .93rem; line-height: 1.75; max-height: 340px; overflow-y: auto; padding-right: 4px; }
.lesson-body p { margin-bottom: .8em; }
.lesson-body ul, .lesson-body ol { margin: 0 0 .8em; }

.videos-section { border-top: 1px solid var(--line-2); padding-top: 18px; }
.videos-section__title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-family: var(--font-sans); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.videos-slider { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.video-card {
  flex: 0 0 268px;
  scroll-snap-align: start;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}
.video-card video { width: 100%; height: 150px; border-radius: var(--r-xs); background: #0E1B2C; display: block; object-fit: cover; }
.video-title { margin-bottom: 8px; font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.video-controls { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.video-controls button {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--surface-2);
  color: var(--navy-800);
  font-size: .8rem;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.video-controls button:hover { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.read-more-btn { align-self: flex-start; }

@media (max-width: 980px) {
  .lesson-layout { grid-template-columns: 1fr; min-height: 0; }
  .lesson-topics { padding: 14px; }
  .lesson-topics__list { flex-direction: row; overflow-x: auto; overflow-y: hidden; max-height: none; gap: 8px; padding-bottom: 4px; }
  .topic-item { flex: 0 0 auto; white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; padding: 8px 12px; }
  .topic-item.active { border-left-color: transparent; border-bottom-color: var(--gold-500); }
  .lesson-main { padding: 16px; }
  .lesson-body { max-height: none; }
}

/* ------------------------------------------------------- 23. Evaluation */
.eval-card { max-width: 560px; margin-inline: auto; }
.question-container { display: none; }
.question-container.is-visible { display: block; }
.questions-list { display: grid; gap: 16px; margin-bottom: 22px; }
.question-block { padding: 18px 20px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.question-block .question-text { margin-bottom: 12px; color: var(--navy-900); font-size: .95rem; font-weight: 650; line-height: 1.5; }
.options-list { display: grid; gap: 6px; }
.options-list label { display: flex; align-items: flex-start; gap: 9px; margin: 0; padding: 7px 10px; border: 1px solid transparent; border-radius: var(--r-xs); color: var(--ink-2); font-size: .89rem; line-height: 1.45; cursor: pointer; transition: background-color .12s ease, border-color .12s ease; }
.options-list label:hover { background: #fff; border-color: var(--line); }
.options-list input[type="radio"] { margin-top: 2px; flex: 0 0 auto; }

.fixed-timer-container {
  position: fixed;
  top: calc(var(--header-h) + 14px);
  right: 18px;
  z-index: 70;
  display: none;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
}
.timer-wrapper { position: relative; width: 84px; height: 84px; }
.progress-ring { transform: rotate(-90deg); }
.timer-text { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-mono); font-size: .95rem; font-weight: 700; color: var(--navy-900); letter-spacing: .02em; }
.countdown-section { display: flex; justify-content: center; margin-bottom: 22px; }
.score-remark { display: none; }

@media (max-width: 560px) {
  .fixed-timer-container { top: calc(var(--header-h) + 8px); right: 8px; padding: 5px; }
  .timer-wrapper { width: 64px; height: 64px; }
  .timer-text { font-size: .8rem; }
}

/* ----------------------------------------------------------- 24. Results */
.result-container { display: none; }
.result-container.is-visible { display: block; }
.slip { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.slip__head { padding: 18px 20px; background: var(--navy-900); color: #fff; border-bottom: 3px solid var(--gold-500); }
.slip__head h2 { margin: 0; color: #fff; font-size: 1.1rem; }
.slip__head p { margin: 3px 0 0; color: rgba(255, 255, 255, .66); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; }
.slip table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.slip th, .slip td { padding: 12px 20px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.slip th { width: 42%; color: var(--muted); font-family: var(--font-sans); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: var(--surface-2); }
.slip td { color: var(--ink); font-weight: 600; }
.slip tr:last-child th, .slip tr:last-child td { border-bottom: 0; }
.slip__score { font-family: var(--font-display); font-size: 1.2rem; }
.slip__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 20px; background: var(--surface-2); border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }

/* ----------------------------------------------------------- 25. Footer */
.site-footer { margin-top: auto; background: var(--navy-900); color: rgba(255, 255, 255, .68); border-top: 3px solid var(--gold-500); }
.site-footer__main { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr)); gap: 40px; padding-block: 46px; }
.footer-brand { display: flex; gap: 14px; align-items: flex-start; }
.footer-brand img { width: 52px; height: 52px; object-fit: contain; background: #fff; border-radius: 50%; padding: 5px; flex: 0 0 52px; }
.footer-brand__name { margin: 0; color: #fff; font-family: var(--font-display); font-size: 1.02rem; line-height: 1.35; }
.footer-brand__sub { margin: 6px 0 0; font-size: .78rem; color: var(--gold-300); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.footer-brand__text { margin: 12px 0 0; font-size: .82rem; line-height: 1.65; color: rgba(255, 255, 255, .6); max-width: 40ch; }
.site-footer h2 { margin: 0 0 14px; color: #fff; font-family: var(--font-sans); font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.footer-links { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.footer-links li { margin: 0; }
.footer-links a { color: rgba(255, 255, 255, .7); font-size: .84rem; text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.site-footer__bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 16px; border-top: 1px solid rgba(255, 255, 255, .13); font-size: .74rem; color: rgba(255, 255, 255, .52); }
.site-footer__bottom p { margin: 0; }
.site-footer__bottom strong { color: rgba(255, 255, 255, .74); font-weight: 600; }

@media (max-width: 820px) {
  .site-footer__main { grid-template-columns: 1fr 1fr; gap: 28px; padding-block: 34px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .site-footer__main { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------- 26. Utilities */
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.items-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.w-full { width: 100%; }
.hide { display: none !important; }
.nowrap { white-space: nowrap; }

/* ------------------------------- 26b. Lesson documents, crumbs + legacy shims */
.page-lead { max-width: 78ch; margin: 0 0 20px; color: var(--muted); font-size: .96rem; line-height: 1.7; }
.files-list { border-top: 1px solid var(--line-2); padding-top: 18px; }
.files-list__title { margin: 0 0 12px; font-family: var(--font-sans); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.table__empty { padding: 22px 16px; text-align: center; color: var(--muted); }

.breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--muted); font-size: .78rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--navy-800); text-decoration: underline; }
.breadcrumb span[aria-current="page"] { color: var(--navy-800); font-weight: 600; }

/* legacy inputs still carrying the phptutorial class name */
.form-control { width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; color: var(--ink); font: inherit; font-size: .92rem; }
.form-control:focus { outline: none; border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(30, 64, 175, .14); }

/* inline status paragraphs emitted by the original CRUD pages */
p[style*="color: red"], p[style*="color:red"] { max-width: 720px; margin: 0 0 16px; padding: 12px 16px; border: 1px solid #EFCBCE; border-radius: var(--r-sm); background: var(--red-50); color: var(--red-700) !important; font-size: .88rem; font-weight: 600; text-align: left !important; }

/* collapsible panels keep a clear current-state marker */
summary[aria-current="true"] { color: var(--navy-800); font-weight: 700; }
details[open] > summary[aria-current="true"] { color: var(--gold-700); }

/* ------------------------------------------------------------- 27. Print */
@media print {
  body { background: #fff; }
  .topbar, .site-header, .site-footer, .app-topbar, .sidebar, .btn, .hero, .crumbs, .page-head__actions, .app-footer, .nav-toggle { display: none !important; }
  .wrap, .app-body { max-width: none; padding: 0; }
  .card, .slip { border: 1px solid #999; box-shadow: none; }
  .result-container { display: block !important; }
  a[href]::after { content: ""; }
}

/* --------------------------------------------------------- 28. Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .link-card:hover, .portal-card:hover, .btn:active { transform: none; }
}

/* --------------------------------------------------------- 29. Responsive layout tweaks */
@media (max-width: 1000px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; gap: 26px; }
  .aside-card { position: static; }
}
@media (max-width: 720px) {
  :root { --gutter: 18px; }
  .section { padding-block: 40px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .page-head { padding-block: 28px 24px; }
  .card__head, .card__body { padding-inline: 16px; }
  .card__foot { padding-inline: 16px; }
  .hero__inner { padding-block: 48px; }
  .hero__actions .btn { width: 100%; }
  .table-toolbar { padding: 12px 14px; }
  .table th, .table td { padding-inline: 12px; }
  .article p:first-of-type::first-letter { font-size: 2.4rem; }
  .portal-card { padding: 20px; gap: 14px; }
  .portal-card__icon { width: 44px; height: 44px; flex-basis: 44px; }
}
@media (max-width: 420px) {
  .section { padding-block: 32px; }
  .btn { padding-inline: 16px; }
  .stat { padding: 16px 18px; }
  .stat__value { font-size: 1.6rem; }
}

/* Print helper used by the result page */
.print-only { display: none; }
@media print { .print-only { display: block; } }

/* ------------------------------------------------- 30. CRUD workspace */
.crud-layout {
  display: grid;
  grid-template-columns: minmax(0, 390px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.crud-layout__form { position: sticky; top: calc(var(--header-h) + 16px); }
@media (max-width: 1180px) {
  .crud-layout { grid-template-columns: minmax(0, 1fr); }
  .crud-layout__form { position: static; }
}
.crud-form { display: grid; gap: 16px; }
.crud-form .form-actions { justify-content: space-between; }
.cell-muted { color: var(--muted); font-variant-numeric: tabular-nums; }

/* =========================================================
   ASCETA DASHBOARD REFINEMENT
   FUTO-inspired layout, preserving ASCETA identity
   ========================================================= */

.app {
    grid-template-columns: 250px minmax(0, 1fr);
    background: #F5F7FB;
}

.sidebar {
    background: #FFFFFF;
    color: #334155;
    border-right: 1px solid #E3E6EB;
    box-shadow: none;
}

.sidebar__head {
    border-bottom: 1px solid #E3E6EB;
}

.sidebar__role {
    color: #1E40AF;
}

.sidebar__title {
    color: #0B2545;
}

.sidebar__label {
    color: #94A3B8;
}

.sidebar__nav a {
    color: #475569;
    border-radius: 8px;
    transition: background .2s ease, color .2s ease;
}

.sidebar__nav a:hover {
    background: #F1F5F9;
    color: #0B2545;
}

.sidebar__nav a[aria-current="page"] {
    background: #EEF4FF;
    color: #1E40AF;
    font-weight: 600;
}

.sidebar__foot {
    border-top: 1px solid #E3E6EB;
}

.sidebar__user-name {
    color: #0B2545;
}

.sidebar__user-sub {
    color: #64748B;
}

.sidebar__signout {
    color: #64748B;
}

.sidebar__signout:hover {
    color: #B91C1C;
    background: #FEF2F2;
}

.app__main {
    background: #F5F7FB;
}

.app-topbar {
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid #E3E6EB;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .025);
}

.app-body {
    background: #F5F7FB;
}

.app-footer {
    background: #FFFFFF;
    border-top: 1px solid #E3E6EB;
}

/* Dashboard layout on smaller screens */
@media (max-width: 1080px) {
    .app {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        background: #FFFFFF;
    }
}




/* ASCETA PUBLIC LESSON PAGE REFINEMENT */
#main-content.section > .wrap {
  width: min(96%, 1600px);
  max-width: 1600px;
  margin-inline: auto;
}

#main-content .page-head {
  margin-bottom: 28px;
}

#main-content .lesson-shell {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 32px;
}

#main-content .lesson-layout {
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  min-height: 650px;
}

#main-content .lesson-main {
  padding: clamp(18px, 3vw, 36px);
  gap: 30px;
}

#main-content .lesson-content-container {
  padding: clamp(20px, 3vw, 36px);
}

#main-content .lesson-body {
  max-height: none;
  overflow: visible;
  font-size: 1rem;
  line-height: 1.85;
}

#main-content .videos-section {
  padding-top: 28px;
  margin-top: 4px;
}

#main-content .videos-section__title {
  font-size: .85rem;
  margin-bottom: 20px;
}

#main-content .videos-slider {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 22px;
  overflow: visible;
  padding: 0 0 12px;
}

#main-content .video-card {
  min-width: 0;
  width: 100%;
  padding: 16px;
  border-radius: 14px;
}

#main-content .video-card video {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #080d16;
  border-radius: 10px;
}

#main-content .video-title {
  font-size: .85rem;
  margin-bottom: 12px;
}

#main-content .video-controls {
  gap: 12px;
  margin-top: 14px;
}

#main-content .video-controls button {
  width: 42px;
  height: 42px;
  border-radius: 9px;
}

#main-content .read-more-btn {
  margin-top: 12px;
}

#main-content #fileListContainer {
  margin-top: 20px;
}

#main-content .app-footer {
  margin-top: 48px;
  padding: 28px 16px;
  text-align: center;
  line-height: 1.7;
}

@media (max-width: 980px) {
  #main-content .lesson-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  #main-content .lesson-topics {
    padding: 18px;
  }

  #main-content .lesson-topics__list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    gap: 10px;
    padding-bottom: 8px;
  }

  #main-content .topic-item {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  #main-content .lesson-main {
    padding: 16px;
  }

  #main-content .videos-slider {
    grid-template-columns: 1fr;
  }

  #main-content .video-card {
    max-width: 100%;
  }
}

@media (min-width: 981px) {
  #main-content .lesson-topics__list {
    max-height: 760px;
  }
}


/* Lesson video See More */
#main-content #videosToggle {
    display: block;
    margin: 22px auto 10px;
    min-width: 180px;
}

#main-content #videosToggle[hidden],
#main-content .video-card[hidden] {
    display: none !important;
}
