/* =====================================================================
   Cadence Training â€” design system
   Palette: slate #1A202C / #2D3748 + lime #C2D500 (matched to the Cadence sales portal)
   ===================================================================== */

:root {
  /* Palette matched to the Cadence sales portal: Tailwind "gray" slate scale + lime #C2D500. */
  --navy: #2D3748;
  --navy-700: #4A5568;
  --navy-800: #1A202C;
  --navy-900: #1A202C;
  --navy-50: #EDF2F7;
  --navy-100: #E2E8F0;

  --green: #C2D500;
  --green-600: #A7B800;
  --green-700: #7A8700;
  --green-100: #F4F8CC;
  --green-50: #FAFCE5;

  --ink: #1A202C;
  --ink-2: #4A5568;
  --ink-3: #718096;
  --ink-4: #A0AEC0;

  --bg: #F7FAFC;
  --surface: #FFFFFF;
  --surface-2: #F7FAFC;
  --line: #E2E8F0;
  --line-2: #CBD5E0;

  --ok: #2E9E5B;
  --ok-100: #DDF3E5;
  --warn: #D98E0B;
  --warn-100: #FBEFD5;
  --danger: #D1453B;
  --danger-100: #FBE2DF;
  --info: #2F7FBF;
  --info-100: #DFEDF8;

  --radius-sm: 0;
  --radius: 0;
  --radius-lg: 0;
  --radius-xl: 0;

  --shadow-sm: 0 1px 2px rgba(26, 32, 44, .06), 0 1px 1px rgba(26, 32, 44, .04);
  --shadow: 0 4px 14px rgba(26, 32, 44, .08), 0 1px 3px rgba(26, 32, 44, .06);
  --shadow-lg: 0 16px 40px rgba(26, 32, 44, .16);

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --topbar-h: 64px;
  --sidebar-w: 264px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Reset & base ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; }
a { color: var(--navy-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--navy-900); margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 2.5vw, 2.1rem); font-weight: 800; }
h2 { font-size: clamp(1.25rem, 2vw, 1.5rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-3); }
/* A quiet, clearly-a-link blue for links inside body copy. */
.link-soft { color: #3F6FB0; font-weight: 600; text-decoration: none; }
.link-soft:hover { color: #2C5590; text-decoration: underline; text-underline-offset: 3px; }
.small { font-size: .875rem; }
.tiny { font-size: .8rem; }
.strong { font-weight: 600; }
.inline { display: inline; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 0; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid rgba(194, 213, 0, .9); outline-offset: 2px; border-radius: 0; }

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }

/* ---------- Admin preview bar (shown above the employee UI while an admin is viewing as someone) ---- */
.preview-bar { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 8px 16px; background: var(--navy-800); color: #E2E8F0; font-size: .9rem; }
.preview-bar .icon { color: var(--green); }
.preview-bar strong { color: #fff; }

/* ---------- Layout: employee ---------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(26, 32, 44, .02);
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; height: var(--topbar-h);
  padding: 0 16px; display: flex; align-items: center; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-logo { height: var(--brand-h, 34px); width: auto; }
/* Logo lockup: the wordmark with "Training Portal" set under the word Cadence (not under the gear).
   --brand-h is the logo height; the tagline's size and indent scale from it. */
.brand-lockup { --brand-h: 34px; display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0; }
/* Same proportions as .auth-tagline on the sign-in pages so the lockup looks identical everywhere. */
.brand-tagline { margin-left: calc(var(--brand-h) * 1.117); margin-top: calc(var(--brand-h) * -.27); font-size: calc(var(--brand-h) * .2); line-height: 1; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--navy); white-space: nowrap; font-family: var(--font-display); }
.brand-divider { width: 1px; height: 26px; background: var(--line-2); }
.brand-text { font-family: var(--font-display); font-weight: 700; color: var(--navy); font-size: 1.05rem; letter-spacing: .02em; text-transform: uppercase; }
.topbar-nav { display: flex; gap: 4px; margin-left: 8px; }
.topbar-link {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 0;
  color: var(--ink-2); font-weight: 500; font-size: .95rem;
}
.topbar-link:hover { background: var(--navy-50); text-decoration: none; color: var(--navy); }
.topbar-link.is-active { background: var(--navy-50); color: var(--navy); font-weight: 600; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-name { font-weight: 600; font-size: .95rem; color: var(--ink); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; letter-spacing: .02em; flex-shrink: 0;
}
.avatar-green { background: var(--green); color: var(--navy-900); }
.avatar-sm { width: 30px; height: 30px; font-size: .75rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }

.page { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px 16px 48px; }
.page-narrow { max-width: 720px; }
.footer {
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); text-align: center; color: var(--ink-4); font-size: .8rem;
  display: flex; gap: 8px; justify-content: center; align-items: center;
}
.footer-link { color: var(--ink-4); }
.footer-link:hover { color: var(--navy); }

@media (min-width: 640px) {
  .page { padding: 32px 24px 64px; }
  .topbar-inner { padding: 0 24px; }
  .brand-lockup { --brand-h: 38px; }
}
@media (max-width: 639px) {
  .topbar-name, .hide-sm, .brand-divider, .brand-text { display: none; }
  .topbar-link span { display: none; }
}

/* ---------- Employee-facing scale-up (everything except the admin console) --------------------- */
html:not(:has(.admin-body)) { font-size: 17.5px; }
body:not(.admin-body) { --topbar-h: 76px; }
body:not(.admin-body) .brand-lockup { --brand-h: 42px; }
body:not(.admin-body) .brand-divider { height: 32px; }
body:not(.admin-body) .brand-text { font-size: 1.15rem; }
body:not(.admin-body) .topbar-link { padding: 10px 14px; }
body:not(.admin-body) .avatar { width: 42px; height: 42px; font-size: .95rem; }
body:not(.admin-body) .btn { min-height: 48px; padding: 12px 20px; font-size: 1rem; }
body:not(.admin-body) .btn-sm { min-height: 42px; padding: 9px 14px; font-size: .925rem; }
body:not(.admin-body) .btn-lg { min-height: 58px; font-size: 1.1rem; }
body:not(.admin-body) .btn-icon { min-width: 46px; min-height: 46px; }
body:not(.admin-body) .input, body:not(.admin-body) .select, body:not(.admin-body) .textarea { min-height: 52px; font-size: 1.05rem; }
body:not(.admin-body) .input-lg { min-height: 60px; font-size: 1.25rem; }
body:not(.admin-body) .code-input { font-size: 2.4rem; min-height: 78px; }
body:not(.admin-body) .icon { width: 22px; height: 22px; }
body:not(.admin-body) .icon-sm { width: 18px; height: 18px; }
body:not(.admin-body) .auth-card { padding: 32px 28px; }
body:not(.admin-body) .hero { padding: 32px 28px; }
body:not(.admin-body) .hero-stat b { font-size: 1.9rem; }
body:not(.admin-body) .course-card { padding: 24px; gap: 16px; }
body:not(.admin-body) .course-card h3 { font-size: 1.2rem; }
body:not(.admin-body) .course-card .desc { font-size: 1rem; }
body:not(.admin-body) .ring { width: 64px; height: 64px; }
body:not(.admin-body) .ring-lg { width: 96px; height: 96px; }
body:not(.admin-body) .module-num { width: 32px; height: 32px; font-size: .9rem; }
body:not(.admin-body) .lesson { padding: 16px 18px; gap: 16px; }
body:not(.admin-body) .lesson-thumb { width: 104px; height: 64px; }
body:not(.admin-body) .lesson-title { font-size: 1.05rem; }
body:not(.admin-body) .status-dot { width: 32px; height: 32px; }
body:not(.admin-body) .playlist-item { padding: 12px 18px; font-size: .975rem; }
body:not(.admin-body) .footer { font-size: .875rem; }
@media (min-width: 640px) {
  body:not(.admin-body) .brand-lockup { --brand-h: 46px; }
  body:not(.admin-body) .auth-card { padding: 40px; }
  body:not(.admin-body) .hero { padding: 40px; }
}
@media (max-width: 639px) {
  body:not(.admin-body) .lesson-thumb { width: 84px; height: 52px; }
  body:not(.admin-body) .lesson { padding: 14px; gap: 12px; }
}

/* Tablet-only: the signed-in employee header matches the sign-in page band exactly
   (dark slate, white-on-dark logo at the same size, same padding). Phones and desktop are unchanged. */
.brand-logo-dark { display: none; }
@media (min-width: 640px) and (max-width: 1023px) {
  body:not(.admin-body) .topbar { background: var(--navy-900); border-bottom: 0; box-shadow: none; }
  body:not(.admin-body) .topbar-inner { height: auto; max-width: none; padding: 29px 28px; gap: 24px; }
  body:not(.admin-body) .brand-lockup { --brand-h: 64px; }
  body:not(.admin-body) .topbar .brand-logo-light { display: none; }
  body:not(.admin-body) .topbar .brand-logo-dark { display: block; }
  body:not(.admin-body) .topbar .brand-tagline { color: #fff; }
  body:not(.admin-body) .topbar-name { color: #fff; }
  body:not(.admin-body) .topbar-user .avatar { background: var(--green); color: var(--navy-900); }
  body:not(.admin-body) .topbar-user .btn-ghost { color: #CBD5E0; }
  body:not(.admin-body) .topbar-user .btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }
  body:not(.admin-body) .preview-bar { border-bottom: 1px solid rgba(255, 255, 255, .1); }
}

/* ---------- Layout: admin ------------------------------------------------- */
.admin-body { background: var(--bg); }
.admin { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100dvh; }
.admin-topbar { display: none; }
.sidebar {
  background: var(--navy-900);
  color: #CBD5E0;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100dvh;
  padding: 20px 14px calc(16px + env(safe-area-inset-bottom));
}
/* White brand plate so the navy gear in the logo reads clearly against the dark sidebar. */
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -20px -14px 18px; padding: 16px 12px 16px 18px; background: #fff; border-bottom: 3px solid var(--green); }
.sidebar .brand-lockup { --brand-h: 50px; }
.sidebar .brand-mark { display: none; width: 46px; height: 46px; }
.sidebar-toggle.btn { color: var(--ink-3); flex-shrink: 0; }
.sidebar-toggle.btn:hover { color: var(--navy); background: var(--navy-50); }
.sidebar-toggle .icon-close { display: none; }

/* Portrait tablets (768–1023px): the rail is docked; the chevron slides the full sidebar out OVER the content
   instead of pushing it, so the page keeps its landscape layout. Everything is also scaled up for touch. */
@media (min-width: 768px) and (max-width: 1023px) {
  html:has(.admin-body) { font-size: 17.5px; }
  .admin { grid-template-columns: 76px 1fr; }
  .admin-main { padding: 28px 28px 56px; }
  /* Expanded: the sidebar stays in its 76px grid column (so the page doesn't move) and simply overflows wider on top of it. */
  html:not(.sidebar-collapsed) .sidebar { width: 300px; z-index: 50; box-shadow: var(--shadow-lg); }
  .admin-body .btn { min-height: 48px; padding: 12px 20px; font-size: 1rem; }
  .admin-body .btn-sm { min-height: 42px; padding: 9px 14px; font-size: .925rem; }
  .admin-body .btn-lg { min-height: 56px; }
  .admin-body .btn-icon { min-width: 46px; min-height: 46px; padding: 10px; }
  .admin-body .input, .admin-body .select, .admin-body .textarea { min-height: 52px; font-size: 1.05rem; }
  .admin-body .icon { width: 22px; height: 22px; }
  .admin-body .icon-sm { width: 18px; height: 18px; }
  .admin-body .card-body { padding: 28px; }
  .admin-body .card-header { padding: 18px 24px; }
  .admin-body .table th, .admin-body .table td { padding: 15px 16px; }
  .admin-body .table { font-size: .975rem; }
  .admin-body .stat { padding: 22px 24px; }
  .admin-body .stat-value { font-size: 2.2rem; }
  .admin-body .page-head { margin-bottom: 28px; }
  .admin-body .sidebar-link { padding: 14px 12px; }
  .admin-body .avatar-sm { width: 36px; height: 36px; font-size: .85rem; }
  .admin-body .video-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}
@media (min-width: 768px) {
  html.sidebar-collapsed .admin { grid-template-columns: 76px 1fr; }
  html.sidebar-collapsed .sidebar { padding-left: 10px; padding-right: 10px; }
  html.sidebar-collapsed .sidebar-head { flex-direction: column; gap: 6px; margin: -20px -10px 14px; padding: 14px 8px 10px; }
  html.sidebar-collapsed .sidebar .brand-logo, html.sidebar-collapsed .sidebar .brand-tagline { display: none; }
  html.sidebar-collapsed .sidebar .brand-mark { display: block; }
  html.sidebar-collapsed .sidebar-toggle .icon-collapse { transform: rotate(180deg); }
  html.sidebar-collapsed .sidebar-label, html.sidebar-collapsed .sidebar-link span, html.sidebar-collapsed .sidebar-user-text { display: none; }
  html.sidebar-collapsed .sidebar-link { justify-content: center; padding: 12px 0; }
  html.sidebar-collapsed .sidebar-user { flex-direction: column; gap: 6px; padding: 6px 0; }
}
.sidebar-label { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: #718096; padding: 0 12px 10px; font-weight: 600; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 0;
  color: #E2E8F0; font-weight: 600; font-size: .95rem; transition: background .15s var(--ease), color .15s var(--ease);
}
.sidebar-link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.sidebar-link.is-active { background: #353F50; color: var(--green); font-weight: 600; }
.sidebar-link.is-active .icon { stroke: var(--green); }
.sidebar-link-muted { color: #A0AEC0; font-size: .9rem; }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; flex-direction: column; gap: 8px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.sidebar-user-text { min-width: 0; flex: 1; }
.sidebar-user-name { color: #fff; font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { color: #718096; font-size: .75rem; }
.sidebar-user .btn-ghost { color: #A0AEC0; }
.sidebar-user .btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.admin-main { padding: 28px 32px 64px; min-width: 0; }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(26, 32, 44, .35); z-index: 45; }

/* Phones only: top bar + slide-out drawer. Tablets (768px+) keep the sidebar docked as an icon rail. */
@media (max-width: 767px) {
  .admin { grid-template-columns: 1fr; }
  .admin-topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 40;
    background: var(--surface); border-bottom: 1px solid var(--line); height: 60px; padding: 0 12px;
  }
  .admin-topbar .brand-lockup { --brand-h: 30px; }
  .admin-topbar .brand-tagline { display: none; }
  .admin-topbar-title { margin-left: auto; font-family: var(--font-display); font-weight: 700; color: var(--navy); font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); z-index: 50; height: 100dvh;
    transform: translateX(-104%); transition: transform .25s var(--ease); box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-toggle .icon-close { display: block; }
  .sidebar-toggle .icon-collapse { display: none; }
  .admin-main { padding: 20px 16px 48px; }
}

/* ---------- Page headers ------------------------------------------------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head-text { min-width: 0; }
.page-head .eyebrow { margin-bottom: 4px; }
.page-head p { color: var(--ink-3); margin: 6px 0 0; max-width: 60ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.eyebrow { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--green-700); font-weight: 700; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: .9rem; margin-bottom: 12px; font-weight: 500; }
.back-link:hover { color: var(--navy); text-decoration: none; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.section-title h2 { font-size: 1.15rem; }

/* ---------- Buttons ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 0; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2; cursor: pointer;
  background: var(--navy-50); color: var(--navy); white-space: nowrap;
  transition: background .15s var(--ease), transform .08s var(--ease), box-shadow .15s var(--ease), border-color .15s var(--ease);
  text-decoration: none; min-height: 42px;
}
.btn:hover { background: var(--navy-100); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 1px 2px rgba(26, 32, 44, .2); }
.btn-primary:hover { background: var(--navy-700); }
.btn-accent { background: var(--green); color: var(--navy-900); box-shadow: 0 1px 2px rgba(26, 32, 44, .12); }
.btn-accent:hover { background: #C6DB45; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--navy-50); color: var(--navy); }
.btn-outline { background: var(--surface); border-color: var(--line-2); color: var(--navy); }
.btn-outline:hover { background: var(--navy-50); border-color: var(--navy-100); }
.btn-danger { background: var(--danger-100); color: #9E2B23; }
.btn-danger:hover { background: #F6CFCB; }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #B8392F; }
.btn-sm { padding: 7px 12px; font-size: .875rem; min-height: 36px; border-radius: 0; }
.btn-sm .icon { width: 17px; height: 17px; }
.btn-lg { padding: 14px 22px; font-size: 1.05rem; min-height: 52px; border-radius: 0; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; min-height: 40px; min-width: 40px; }
.btn-icon.btn-sm { min-height: 34px; min-width: 34px; padding: 6px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-xs { padding: 4px 9px; font-size: .8rem; min-height: 28px; border-radius: 0; }

/* ---------- Forms -------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } .form-row-3 { grid-template-columns: 1fr 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.label .opt { font-weight: 400; color: var(--ink-4); }
.input, .select, .textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 0; padding: 11px 14px; min-height: 46px; width: 100%;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(45, 55, 72, .12); }
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid, .input-validation-error { border-color: var(--danger); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236F8791' 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 12px center; padding-right: 40px; }
.input-lg { font-size: 1.15rem; min-height: 54px; padding: 13px 16px; border-radius: 0; }
.hint { font-size: .825rem; color: var(--ink-3); }
.field-validation-error, .error-text { font-size: .85rem; color: var(--danger); font-weight: 500; }
.field-validation-valid { display: none; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .95rem; }
.check input { width: 20px; height: 20px; accent-color: var(--navy); margin: 2px 0 0; flex-shrink: 0; }
.check-text small { display: block; color: var(--ink-3); font-size: .825rem; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-4); pointer-events: none; }
.input-icon .input { padding-left: 42px; }
.code-input {
  font-family: var(--font-display); font-size: 2rem; letter-spacing: .5em; text-align: center; font-weight: 700;
  padding: 12px 0 12px .5em; min-height: 68px; border-radius: 0; color: var(--navy-900);
}
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding-top: 4px; }
.form-actions .spacer { flex: 1; }
.toggle { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track { width: 44px; height: 26px; border-radius: 13px; background: var(--line-2); position: relative; transition: background .2s; flex-shrink: 0; }
.toggle-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease); }
.toggle input:checked + .toggle-track { background: var(--ok); }
.toggle input:checked + .toggle-track::after { transform: translateX(18px); }
.toggle input:focus-visible + .toggle-track { outline: 3px solid rgba(194, 213, 0, .9); outline-offset: 2px; }

/* ---------- Cards & surfaces --------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-body { padding: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-header h2, .card-header h3 { font-size: 1.05rem; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@media (min-width: 640px) { .card-body { padding: 24px; } }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* ---------- Badges, pills, alerts ---------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 0; font-size: .75rem; font-weight: 600; line-height: 1.4; background: var(--navy-50); color: var(--navy); white-space: nowrap; }
.badge .icon { width: 13px; height: 13px; }
.badge-ok { background: var(--ok-100); color: #1E6B3C; }
.badge-warn { background: var(--warn-100); color: #8A5A05; }
.badge-danger { background: var(--danger-100); color: #9E2B23; }
.badge-info { background: var(--info-100); color: #1F5C8C; }
.badge-green { background: var(--green-100); color: var(--green-700); }
.badge-muted { background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); }
.badge-navy { background: var(--navy); color: #fff; }
.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: 0; border: 1px solid; font-size: .95rem; }
.alert .icon { flex-shrink: 0; margin-top: 1px; }
.alert-info { background: var(--info-100); border-color: #C4DCEF; color: #1F4E73; }
.alert-ok { background: var(--ok-100); border-color: #BCE4CB; color: #1E6B3C; }
.alert-warn { background: var(--warn-100); border-color: #F2DEAE; color: #7A4F05; }
.alert-danger { background: var(--danger-100); border-color: #F2C3BE; color: #8E261F; }
.alert p { margin: 0; }

/* ---------- Progress ----------------------------------------------------- */
.progress { height: 8px; border-radius: 0; background: var(--navy-50); overflow: hidden; }
.progress-bar { height: 100%; border-radius: 0; background: var(--green); transition: width .4s var(--ease); }
.progress-bar.is-done { background: var(--ok); }
.progress-sm { height: 6px; }
.ring { width: 56px; height: 56px; position: relative; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring .ring-bg { stroke: var(--navy-50); }
.ring .ring-fg { stroke: var(--green); stroke-linecap: round; transition: stroke-dashoffset .5s var(--ease); }
.ring.is-done .ring-fg { stroke: var(--ok); }
.ring-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.ring-lg { width: 84px; height: 84px; }
.ring-lg .ring-label { font-size: 1rem; }

/* ---------- Tables (collapse to cards on small screens) ----------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-lg); }
.table { width: 100%; border-collapse: collapse; font-size: .925rem; background: var(--surface); }
.table th, .table td { padding: 12px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table th { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #F7FAFC; }
.table .td-actions { text-align: right; white-space: nowrap; }
.table .td-num { text-align: right; font-variant-numeric: tabular-nums; }
.table a.row-link { color: var(--ink); font-weight: 600; }
.table a.row-link:hover { color: var(--navy); }
@media (max-width: 719px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { border-bottom: 1px solid var(--line); padding: 12px 14px; }
  .table-cards tr:last-child { border-bottom: 0; }
  .table-cards td { padding: 4px 0; border: 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
  .table-cards td[data-label]::before { content: attr(data-label); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); font-weight: 600; flex-shrink: 0; }
  .table-cards td.td-primary { font-size: 1rem; padding-bottom: 6px; }
  .table-cards td.td-actions { justify-content: flex-start; padding-top: 10px; }
  .table-cards td.td-num { text-align: left; }
}

/* ---------- Stats -------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: .8rem; color: var(--ink-3); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat-label .icon { width: 16px; height: 16px; color: var(--ink-4); }
.stat-value { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; color: var(--navy-900); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-foot { font-size: .8rem; color: var(--ink-3); }
.stat-accent { border-top: 3px solid var(--green); }

/* ---------- Admin dashboard: the four-step path ----------------------------
   Upload → Build → Assign → Track. The current step glows lime; done steps get a green check;
   later steps sit quietly. Each step has its own colour so the row reads as a sequence, not a grid. */
.path { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 24px; }
@media (min-width: 640px) { .path { grid-template-columns: 1fr 1fr; gap: 18px; } }
@media (min-width: 1200px) { .path { grid-template-columns: repeat(4, 1fr); gap: 22px; } }
.step {
  --step-accent: var(--navy); --step-tint: var(--navy-50);
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 16px;
  background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--step-accent); box-shadow: var(--shadow-sm);
  color: inherit; transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.step:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--navy-100); box-shadow: var(--shadow); }
.step-1 { --step-accent: #4F8A5B; --step-tint: #E3F0E6; --step-ink: #3B6E46; }
.step-2 { --step-accent: #4A6FA5; --step-tint: #E4EBF5; --step-ink: #3B5A88; }
.step-3 { --step-accent: #3B8A8A; --step-tint: #E0F1F1; --step-ink: #2F6F6F; }
.step-4 { --step-accent: #6B5CA5; --step-tint: #EAE6F5; --step-ink: #564A88; }
.step-4.has-overdue { --step-accent: var(--danger); --step-tint: var(--danger-100); --step-ink: #9E2B23; }

.step-num { position: absolute; top: 14px; right: 14px; width: 26px; height: 26px; border-radius: 50%; display: none; align-items: center; justify-content: center; }
.step-num .step-check { display: none; width: 14px; height: 14px; stroke-width: 3; }
.step-icon { width: 54px; height: 54px; border-radius: 50%; background: var(--step-tint); color: var(--step-ink); display: flex; align-items: center; justify-content: center; }
.step-icon .icon { width: 26px; height: 26px; }
.step-body { display: flex; flex-direction: column; gap: 2px; }
.step-label { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.step-value { font-family: var(--font-display); font-size: 2.1rem; font-weight: 800; line-height: 1.1; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.step-value small { font-size: .95rem; font-weight: 600; color: var(--ink-3); letter-spacing: 0; margin-left: 2px; }
.step-note { font-size: .85rem; color: var(--ink-3); }
.step-cta { margin-top: auto; padding-top: 10px; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem; color: var(--step-ink); }
.step:hover .step-cta .icon { transform: translateX(3px); }
.step-cta .icon { transition: transform .18s var(--ease); }

/* Done: green check in the number badge. */
.step.is-done .step-num { display: flex; background: var(--ok); color: #fff; }
.step.is-done .step-num .step-n { display: none; }
.step.is-done .step-num .step-check { display: block; }

/* Current: lime glow, "Start here" as a lime button. */




/* Later: slightly recessed until it's their turn. */






/* "This week": time-boxed numbers + the courses currently in flight. Bounded by design. */
.week { display: grid; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .week { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } .week-courses { border-left: 1px solid var(--line); } }
.week-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; padding: 22px 24px; align-content: center; }
@media (min-width: 1024px) { .week-stats { grid-template-columns: 1fr 1fr; } }
.week-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 0 10px 14px; border-left: 2px solid var(--line-2); position: relative; }
.week-dot { display: none; }
.week-stat.tone-danger { border-left-color: var(--danger); }
.week-stat.tone-warn { border-left-color: #B7791F; }
.week-stat.tone-ok { border-left-color: #4F8A5B; }
.week-stat.tone-info { border-left-color: #4A6FA5; }
.week-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.week-stat.tone-danger .week-value { color: var(--danger); }
.week-label { font-size: .78rem; font-weight: 500; color: var(--ink-3); }
.week-courses { display: flex; flex-direction: column; padding: 8px 0; }
.week-course { display: flex; flex-direction: column; gap: 8px; padding: 14px 24px; color: inherit; }
.week-course:hover { background: var(--surface-2); text-decoration: none; }
.week-course + .week-course { border-top: 1px solid var(--line); }
.week-course-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.week-course-head strong { flex: 1; min-width: 0; font-size: .95rem; }
.week-course .progress { display: block; height: 8px; }
.week-course .progress-bar { display: block; background: #4A6FA5; }
.week-empty { padding: 32px 24px; color: var(--ink-3); text-align: center; }
.week-more { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 24px; border-top: 1px solid var(--line); font-size: .875rem; font-weight: 600; color: var(--ink-3); }
.week-more:hover { background: var(--surface-2); color: var(--navy); text-decoration: none; }

/* Shortcuts: a row of small cards along the bottom, same hover language as the big cards. */
.shortcut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 720px) { .shortcut-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
@media (min-width: 1200px) { .shortcut-grid { grid-template-columns: repeat(5, 1fr); gap: 18px; } }
.shortcut { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--ink); font-weight: 600; font-size: .925rem; transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease); }
.shortcut:hover { text-decoration: none; color: var(--navy); transform: translateY(-3px); border-color: var(--navy-100); box-shadow: var(--shadow); }
.shortcut-icon { width: 38px; height: 38px; border-radius: 50%; background: var(--navy-50); color: var(--navy); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.shortcut-icon .icon { width: 18px; height: 18px; }

.attention-list { display: flex; flex-direction: column; }
.attention { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); color: inherit; }
.attention:last-child { border-bottom: 0; }
.attention:hover { background: var(--surface-2); text-decoration: none; }
.attention-icon { width: 36px; height: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.attention-icon .icon { width: 18px; height: 18px; }
.attention-icon.tone-danger { background: var(--danger-100); color: #9E2B23; }
.attention-icon.tone-warn { background: var(--warn-100); color: #8A5A05; }
.attention-icon.tone-info { background: var(--info-100); color: #1F5C8C; }
.attention-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.attention-text strong { font-size: .95rem; }
.attention-text span { font-size: .825rem; color: var(--ink-3); }
.attention-arrow { color: var(--ink-4); flex-shrink: 0; }

/* ---------- Empty states & toasts --------------------------------------- */
.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-page { padding: 72px 20px; }
.empty-icon { width: 64px; height: 64px; border-radius: 0; background: var(--navy-50); color: var(--navy); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.empty-icon .icon { width: 30px; height: 30px; }
.empty-title { font-size: 1.3rem; }
.empty-text { max-width: 44ch; margin: 0; }
.empty-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.toast-region { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; border-radius: 0; background: var(--navy-900); color: #fff; box-shadow: var(--shadow-lg); font-size: .95rem; font-weight: 500; animation: toast-in .3s var(--ease); }
.toast .icon { color: var(--green); }
.toast-error .icon { color: #FF9B93; }
.toast-info .icon { color: #8FC7F2; }
.toast span { flex: 1; }
.toast-close { background: none; border: 0; color: #A0AEC0; cursor: pointer; padding: 4px; border-radius: 0; display: inline-flex; }
.toast-close:hover { color: #fff; background: rgba(255, 255, 255, .1); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Dialogs ------------------------------------------------------ */
dialog.dialog { border: 0; border-radius: var(--radius-lg); padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); background: var(--surface); color: var(--ink); }
dialog.dialog::backdrop { background: rgba(26, 32, 44, .55); backdrop-filter: blur(2px); }
dialog.dialog-wide { width: min(760px, calc(100vw - 32px)); }
.dialog-head { padding: 20px 24px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-body { padding: 16px 24px 24px; }
.dialog-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ---------- Tabs & filters ---------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 10px 14px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--navy); text-decoration: none; }
.tab.is-active { color: var(--navy); border-color: var(--green); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters .input, .filters .select { min-height: 42px; padding-top: 8px; padding-bottom: 8px; }
.filters .input-icon { flex: 1 1 220px; }
.filters .select { width: auto; flex: 0 1 180px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 0; border: 1px solid var(--line-2); background: var(--surface); font-size: .85rem; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.chip.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip:hover { text-decoration: none; border-color: var(--navy); }

/* ---------- Employee: login --------------------------------------------- */
/* Split sign-in: dark slate brand panel on the left, uncluttered form on the right (stacks on phones). */
.auth-body { display: block; background: var(--surface); }
.auth-split { min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-panel { position: relative; overflow: hidden; display: flex; flex-direction: column; background: var(--navy-900); color: #E2E8F0; padding: 40px 48px calc(32px + env(safe-area-inset-bottom)); }
.auth-brand { --brand-h: 56px; display: inline-flex; flex-direction: column; align-items: flex-start; position: relative; z-index: 1; }
.auth-brand:hover { text-decoration: none; }
.auth-logo { height: var(--brand-h); width: auto; }
.auth-tagline { margin-left: calc(var(--brand-h) * 1.117); margin-top: calc(var(--brand-h) * -.27); font-size: calc(var(--brand-h) * .2); line-height: 1; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: #fff; white-space: nowrap; }
.auth-panel-copy { position: relative; z-index: 1; margin: auto 0; padding: 56px 0; max-width: 480px; }
.auth-kicker { color: var(--green); font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; margin: 0 0 16px; }
.auth-headline { color: #fff; font-size: clamp(2rem, 3.4vw, 2.9rem); font-weight: 800; line-height: 1.08; letter-spacing: -.02em; margin: 0 0 18px; }
.auth-lede { color: #A0AEC0; font-size: 1.05rem; line-height: 1.55; max-width: 40ch; margin: 0; }
.auth-lede-short { display: none; } /* swapped in below 900px */
.auth-watermark { position: absolute; right: -90px; bottom: -90px; width: 460px; height: 460px; opacity: .05; filter: brightness(0) invert(1); pointer-events: none; }
.auth-panel-foot { position: relative; z-index: 1; font-size: .8rem; color: #718096; }
.auth-main { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 56px 24px 88px; }
.auth-form { width: 100%; max-width: 440px; margin: 0 auto; }
.auth-main-foot { position: absolute; left: 0; right: 0; bottom: 28px; text-align: center; font-size: .9rem; }
.auth-title { font-size: 2rem; margin-bottom: 8px; letter-spacing: -.02em; }
.auth-sub { color: var(--ink-3); margin-bottom: 28px; font-size: 1.05rem; }
.auth-foot { margin-top: 22px; text-align: center; font-size: .9rem; color: var(--ink-3); }
@media (min-width: 640px) { .auth-main { padding: 64px 48px 96px; } }
/* Tablets and phones: the dark panel becomes a band with the logo on the left and the title on the right;
   the form is centered in the space below it. */
@media (max-width: 899px) {
  .auth-split { grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 100dvh; }
  .auth-panel { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 24px; padding: 29px 28px; min-height: 0; }
  .auth-brand { --brand-h: 64px; }
  .auth-panel-copy { padding: 0; margin: 0; max-width: none; justify-self: end; text-align: right; }
  .auth-headline { font-size: 1.45rem; margin-bottom: 4px; }
  .auth-lede { font-size: .9rem; margin-left: auto; }
  .auth-lede-full { display: none; }
  .auth-lede-short { display: inline; }
  .auth-watermark, .auth-panel-foot { display: none; }
  .auth-main { justify-content: center; align-items: center; padding: 32px 20px 72px; }
  .auth-form { margin: 0; }
}
@media (max-width: 479px) {
  .auth-panel { gap: 14px; padding: 18px 16px; }
  .auth-brand { --brand-h: 48px; }
  .auth-headline { font-size: 1.1rem; }
  .auth-lede { font-size: .8rem; }
}
/* Desktop sign-in pages: controls sized to match the sales portal (about 40px tall, regular weight).
   Tablet and phone keep the larger touch-friendly sizes from the employee scale-up. */
@media (min-width: 900px) {
  body.auth-body .btn-lg { min-height: 42px; padding: 9px 16px; font-size: .95rem; font-weight: 500; }
  body.auth-body .btn-sm { min-height: 36px; padding: 7px 12px; font-size: .875rem; }
  body.auth-body .input, body.auth-body .select { min-height: 42px; padding-top: 9px; padding-bottom: 9px; font-size: .95rem; }
  body.auth-body .code-input { min-height: 42px; padding-top: 4px; padding-bottom: 4px; font-size: 1.25rem; letter-spacing: .4em; }
  body.auth-body .form { gap: 16px; }
  body.auth-body .channel-btn { padding: 12px 14px; }
}
.dev-code { margin-top: 16px; padding: 12px 14px; border-radius: 0; background: var(--warn-100); border: 1px dashed #E4C57A; color: #6D4605; font-size: .9rem; }
.dev-code strong { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: .3em; margin-left: 6px; }
.channel-pick { display: grid; gap: 10px; }
.channel-btn { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 0; border: 1px solid var(--line-2); background: var(--surface); text-align: left; cursor: pointer; font: inherit; color: var(--ink); width: 100%; transition: border-color .15s, background .15s; }
.channel-btn:hover { border-color: var(--navy); background: var(--navy-50); }
.channel-btn .icon { color: var(--navy); width: 24px; height: 24px; }
.channel-btn strong { display: block; font-size: .95rem; }
.channel-btn span { font-size: .85rem; color: var(--ink-3); }

/* ---------- Employee: home ------------------------------------------------ */
/* Greeting card: light, with a lime accent edge and a faint lime wash — no dark block. */
.hero { background: linear-gradient(120deg, #EDF2F7 0%, #DCE4EC 100%); color: var(--ink); border: 1px solid #CBD5E0; border-left: 4px solid var(--navy); box-shadow: var(--shadow-sm); padding: 26px 24px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; position: relative; overflow: hidden; margin-bottom: 24px; }
.hero h1 { color: var(--navy-900); font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.hero p { color: var(--ink-3); margin: 4px 0 0; }
.hero-text { flex: 1; min-width: 220px; }
.hero-stats { display: flex; gap: 8px; }
.hero-stat { display: flex; flex-direction: column; align-items: center; min-width: 92px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); }
.hero-stat b { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: var(--navy-900); line-height: 1.1; }
.hero-stat span { font-size: .72rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
@media (min-width: 640px) { .hero { padding: 36px 36px; } }

.course-list { display: grid; gap: 14px; grid-template-columns: 1fr; }
/* Employee home: "Up next" and "Completed" sit side by side from tablet up, each stacking its own cards.
   When only one section has anything in it, it takes the full width. */
.home-columns { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 720px) { .home-columns:not(.single) { grid-template-columns: 1fr 1fr; gap: 24px; } }
.home-col { min-width: 0; }
.home-col .section-title { margin-top: 0; }
@media (min-width: 1024px) { .home-columns.single .course-list { grid-template-columns: 1fr 1fr; gap: 18px; } }
.course-card { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: inherit; transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s; }
.course-card:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--navy-100); }
.course-card-top { display: flex; gap: 14px; align-items: flex-start; }
.course-card h3 { font-size: 1.1rem; flex: 1; min-width: 0; }
.course-card .meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: .825rem; color: var(--ink-3); align-items: center; }
.course-card .meta .icon { width: 14px; height: 14px; }
.course-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.course-card .desc { color: var(--ink-2); font-size: .925rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.due { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 600; color: var(--ink-3); }
.due-soon { color: #8A5A05; }
.due-over { color: #9E2B23; }
.cta-text { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--navy); font-size: .9rem; }

/* ---------- Employee: course detail --------------------------------------- */
.course-hero { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 20px; }
.course-hero-text { flex: 1; min-width: 240px; }
.module { margin-bottom: 18px; }
.module-head { display: flex; align-items: center; gap: 12px; padding: 0 4px 10px; }
.module-num { width: 28px; height: 28px; border-radius: 0; background: var(--navy); color: #fff; font-size: .8rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.module-head h2 { font-size: 1.05rem; flex: 1; }
.module-head .muted { font-size: .825rem; }
.lesson-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.lesson { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: inherit; transition: background .15s; }
.lesson:last-child { border-bottom: 0; }
.lesson:hover { background: var(--surface-2); text-decoration: none; }
.lesson-thumb { width: 92px; height: 56px; border-radius: 0; background: var(--navy-50); flex-shrink: 0; overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; color: var(--navy); }
.lesson-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lesson-thumb .icon { width: 22px; height: 22px; }
.lesson-thumb-done::after { content: ""; position: absolute; inset: 0; background: rgba(46, 158, 91, .15); }
.lesson-text { flex: 1; min-width: 0; }
.lesson-title { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-sub { font-size: .825rem; color: var(--ink-3); display: flex; gap: 8px; align-items: center; }
.lesson-status { flex-shrink: 0; }
.status-dot { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.status-done { background: var(--ok-100); color: var(--ok); }
.status-progress { background: var(--green-100); color: var(--green-700); }
.status-todo { border: 2px solid var(--line-2); color: var(--ink-4); }
.status-dot .icon { width: 16px; height: 16px; }
.lesson-progress { margin-top: 6px; }
@media (max-width: 639px) { .lesson-thumb { width: 72px; height: 44px; } .lesson { padding: 12px; gap: 12px; } }

/* ---------- Employee: watch ---------------------------------------------- */
.watch-body .page { max-width: 1100px; }
.watch-layout { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .watch-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }
.player-wrap { background: #000; border-radius: var(--radius-lg); overflow: hidden; position: relative; aspect-ratio: 16 / 9; box-shadow: var(--shadow); }
.player-wrap video { width: 100%; height: 100%; object-fit: contain; background: #000; }
/* Interactive packages run in a frame. Same 16:9 box on desktop; taller on phones so the quiz panel has room. */
.player-wrap iframe { display: block; width: 100%; height: 100%; border: 0; background: #000; }
@media (max-width: 639px) { .player-wrap.is-package { aspect-ratio: auto; height: 72vh; min-height: 420px; } }
/* ---------- Quiz after a video (employee) and question editor (admin) ---------- */
.quiz-card { margin-top: 20px; }
.quiz-form { display: flex; flex-direction: column; gap: 24px; }
.quiz-q { border: 0; padding: 0; margin: 0; min-width: 0; }
.quiz-q-text { font-weight: 600; font-size: 1.05rem; line-height: 1.4; margin: 0 0 12px; padding: 0; display: flex; gap: 10px; align-items: flex-start; }
.quiz-q-num { flex-shrink: 0; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; background: var(--navy); color: #fff; font-size: .8rem; font-weight: 700; }
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-option { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-size: .975rem; line-height: 1.4; transition: border-color .15s, background .15s; }
.quiz-option:hover { border-color: var(--navy-100); background: var(--navy-50); }
.quiz-option input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--navy); flex-shrink: 0; }
.quiz-option:has(input:checked) { border-color: var(--navy); background: var(--navy-50); }
.quiz-option:has(input:disabled) { cursor: default; }
.quiz-q-mark { margin-top: 8px; font-size: .9rem; font-weight: 600; }
.quiz-q.is-correct .quiz-q-mark { color: #1E6B3C; }
.quiz-q.is-wrong .quiz-q-mark { color: #9E2B23; }
.quiz-q.is-correct .quiz-option:has(input:checked) { border-color: #9ED4B2; background: var(--ok-100); }
.quiz-option.is-eliminated { opacity: .5; text-decoration: line-through; cursor: default; }
.quiz-option.is-eliminated:hover { border-color: var(--line-2); background: var(--surface); }
.quiz-result { padding: 14px 16px; border: 1px solid; font-weight: 600; }
.quiz-result.is-pass { background: var(--ok-100); border-color: #BCE4CB; color: #1E6B3C; }
.quiz-result.is-fail { background: var(--warn-100); border-color: #F2DEAE; color: #7A4F05; }
@media (max-width: 1023px) { .opt-wrap { display: block; margin-top: 2px; } }
.quiz-summary { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: .95rem; }
.quiz-admin-q { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.quiz-admin-q:last-child { border-bottom: 0; }
.quiz-admin-q.is-editing { background: var(--navy-50); }
.quiz-admin-q .quiz-q-text { font-size: 1rem; margin-bottom: 8px; }
.quiz-admin-options { list-style: none; margin: 0; padding: 0 0 0 36px; display: flex; flex-direction: column; gap: 4px; font-size: .925rem; color: var(--ink-2); }
.quiz-admin-options li { display: flex; align-items: center; gap: 8px; }
.quiz-admin-options li.is-correct { color: #1E6B3C; font-weight: 600; }
.quiz-admin-dot { width: 14px; height: 14px; display: inline-block; border: 1px solid var(--line-2); flex-shrink: 0; }
.quiz-admin-option { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: center; }
.quiz-admin-option input[type="radio"] { width: 20px; height: 20px; accent-color: var(--navy); margin: 0; }

.video-kind { position: absolute; left: 10px; top: 10px; padding: 3px 8px; background: var(--green); color: #1A202C; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.uq-item.is-package .uq-thumb-icon { opacity: 1; }
.player-banner { position: absolute; left: 12px; right: 12px; bottom: 60px; padding: 10px 14px; border-radius: 0; background: rgba(26, 32, 44, .9); color: #fff; font-size: .9rem; display: flex; align-items: center; gap: 10px; opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; pointer-events: none; }
.player-banner.is-visible { opacity: 1; transform: none; }
.player-banner .icon { color: var(--green); }
.watch-meta { padding: 4px 2px 0; }
.watch-meta h1 { font-size: 1.35rem; margin-bottom: 4px; }
.watch-meta .desc { color: var(--ink-2); margin: 10px 0 0; white-space: pre-line; }
.watch-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .875rem; color: var(--ink-3); margin-top: 8px; }
.watch-nav { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.playlist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.playlist-head { padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.playlist-head h2 { font-size: .95rem; }
.playlist-head .muted { font-size: .8rem; }
.playlist-module { padding: 10px 16px 4px; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-4); font-weight: 700; }
.playlist-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: inherit; font-size: .9rem; border-left: 3px solid transparent; }
.playlist-item:hover { background: var(--surface-2); text-decoration: none; }
.playlist-item.is-current { background: var(--green-50); border-left-color: var(--green); font-weight: 600; }
.playlist-item .status-dot { width: 22px; height: 22px; }
.playlist-item .status-dot .icon { width: 13px; height: 13px; }
.playlist-item-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playlist-item-dur { font-size: .8rem; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.complete-card { background: linear-gradient(135deg, var(--green-50), #fff); border: 1px solid #DCE8A2; border-radius: var(--radius-lg); padding: 20px; display: flex; gap: 14px; align-items: center; }
.complete-card .icon { width: 36px; height: 36px; color: var(--ok); }
.complete-card h3 { margin-bottom: 2px; }

/* ---------- Admin: videos ------------------------------------------------ */
.video-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.video-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.video-thumb { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--navy-900), var(--navy-700)); position: relative; display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, .6); }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.video-thumb .icon { width: 36px; height: 36px; }
.video-dur { position: absolute; right: 8px; bottom: 8px; background: rgba(26, 32, 44, .85); color: #fff; font-size: .75rem; font-weight: 600; padding: 2px 7px; border-radius: 0; font-variant-numeric: tabular-nums; }
.video-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.video-card-body h3 { font-size: 1rem; }
.video-card-foot { padding: 10px 12px 12px; display: flex; gap: 6px; justify-content: flex-end; border-top: 1px solid var(--line); }
.video-usage { font-size: .8rem; color: var(--ink-3); }

.dropzone { border: 2px dashed var(--line-2); border-radius: var(--radius-lg); padding: 36px 20px; text-align: center; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink-3); }
.dropzone:hover, .dropzone.is-over { border-color: var(--navy); background: var(--navy-50); }
.dropzone .icon { width: 36px; height: 36px; color: var(--navy); }
.dropzone strong { color: var(--navy); font-size: 1rem; }
.dropzone input { display: none; }
.file-preview { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.file-preview-thumb { width: 160px; aspect-ratio: 16 / 9; background: #000; border-radius: 0; overflow: hidden; flex-shrink: 0; }
.file-preview-thumb img, .file-preview-thumb video { width: 100%; height: 100%; object-fit: cover; }
.file-preview-text { flex: 1; min-width: 200px; }
.file-preview-text strong { display: block; word-break: break-all; }
.upload-progress { display: none; gap: 10px; flex-direction: column; }
.upload-progress.is-active { display: flex; }
.upload-progress .progress { height: 10px; }

/* ---------- Admin: video uploader ------------------------------------------ */
.uploader { display: flex; flex-direction: column; gap: 16px; max-width: 900px; }
.uploader-drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center;
  padding: 56px 24px; cursor: pointer; background: var(--surface); border: 2px dashed var(--line-2);
  transition: border-color .2s var(--ease), background .2s var(--ease), padding .2s var(--ease);
}
.uploader-drop:hover { border-color: var(--navy); background: var(--surface-2); }
.uploader-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.uploader-drop-art { display: flex; align-items: center; justify-content: center; color: var(--navy); transition: transform .2s var(--ease), color .2s var(--ease); }
.uploader-drop-art .icon { width: 56px; height: 56px; stroke-width: 1.5; }
.uploader-drop:hover .uploader-drop-art { color: var(--navy-900); }
.uploader-drop:hover .uploader-drop-art { transform: translateY(-3px); }
.uploader-drop-text { display: flex; flex-direction: column; gap: 4px; }
.uploader-drop-text strong { font-size: 1.25rem; color: var(--ink); }
.uploader-drop-text span { color: var(--ink-3); }
.uploader-browse { color: var(--navy); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.uploader-drop-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.uploader-drop-overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; gap: 8px; background: rgba(194, 213, 0, .14); color: var(--navy-900); font-weight: 700; font-size: 1.2rem; border: 2px solid var(--green); }
.uploader-drop.is-over { border-color: var(--green); }
.uploader-drop.is-over .uploader-drop-overlay { display: flex; }
.uploader-drop.is-compact { flex-direction: row; padding: 16px 20px; gap: 14px; text-align: left; justify-content: flex-start; }
.uploader-drop.is-compact .uploader-drop-art { width: 44px; height: 44px; }
.uploader-drop.is-compact .uploader-drop-art .icon { width: 22px; height: 22px; }
.uploader-drop.is-compact .uploader-drop-text strong { font-size: 1rem; }
.uploader-drop.is-compact .uploader-drop-meta { margin-left: auto; }
.uploader-drop.is-compact .uploader-drop-meta .muted { display: none; }

.uploader-queue { display: flex; flex-direction: column; gap: 10px; }
.uq-item { display: grid; grid-template-columns: 168px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: border-color .2s; }
.uq-item[data-state="uploading"] { border-color: var(--green); }
.uq-item[data-state="done"] { border-color: #BCE4CB; background: #FBFEFC; }
.uq-item[data-state="error"] { border-color: #F2C3BE; }
.uq-thumb { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--navy-900), var(--navy)); display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, .55); overflow: hidden; }
.uq-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.uq-item.has-thumb .uq-thumb img { display: block; }
.uq-item.has-thumb .uq-thumb-icon { display: none; }
.uq-thumb-icon { width: 28px; height: 28px; }
.uq-dur { position: absolute; right: 6px; bottom: 6px; background: rgba(26, 32, 44, .9); color: #fff; font-size: .75rem; font-weight: 600; padding: 2px 6px; font-variant-numeric: tabular-nums; }
.uq-dur:empty { display: none; }
.uq-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.uq-title { font-weight: 600; }
.uq-desc { min-height: 70px; }
.uq-meta { display: flex; align-items: center; gap: 10px; font-size: .825rem; color: var(--ink-3); min-width: 0; }
.uq-name { max-width: 50%; }
.uq-desc-toggle { background: none; border: 0; padding: 0; color: var(--navy); font: inherit; font-size: .825rem; font-weight: 600; cursor: pointer; margin-left: auto; white-space: nowrap; }
.uq-desc-toggle:hover { text-decoration: underline; }
.uq-progress { display: flex; flex-direction: column; gap: 6px; }
.uq-progress .progress { height: 8px; }
.uq-progress-text { display: flex; justify-content: space-between; font-size: .8rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.uq-pct { font-weight: 700; color: var(--ink); }
.uq-error { font-size: .85rem; color: var(--danger); font-weight: 500; }
.uq-status { display: flex; align-items: center; min-height: 40px; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--navy-50); border-top-color: var(--green); border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.uploader-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); position: sticky; bottom: 12px; box-shadow: var(--shadow); z-index: 5; }
.uploader-summary { display: flex; flex-direction: column; line-height: 1.2; }
.uploader-overall { display: flex; align-items: center; gap: 10px; flex: 1 1 200px; }
.uploader-overall .progress { flex: 1; }
.uploader-foot .btn-group { margin-left: auto; }
.uploader-done { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 22px 24px; background: var(--surface); border: 1px solid #BCE4CB; border-left: 4px solid var(--ok); box-shadow: var(--shadow-sm); }
.uploader-done-icon { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: var(--ok-100); color: var(--ok); flex-shrink: 0; }
.uploader-done-icon .icon { width: 26px; height: 26px; }
.uploader-done h2 { font-size: 1.15rem; margin-bottom: 2px; }

@media (max-width: 719px) {
  .uq-item { grid-template-columns: 1fr; }
  .uq-thumb { max-width: 240px; }
  .uq-status { justify-content: flex-end; min-height: 0; }
  .uploader-drop { padding: 40px 16px; }
  .uploader-drop.is-compact .uploader-drop-meta { display: none; }
  .uploader-foot { position: static; }
  .uploader-foot .btn-group { margin-left: 0; width: 100%; }
  .uploader-foot .btn-group .btn-primary { flex: 1; }
}

/* Empty library: white card as backdrop, uploader centered inside it. */
.library-empty { min-height: 60vh; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.library-empty-inner { width: 100%; max-width: 720px; }
.library-empty .uploader { max-width: none; }
.library-empty .uploader-drop { background: var(--surface-2); }
@media (max-width: 639px) { .library-empty { padding: 24px 12px; min-height: 0; } }

/* ---------- Admin: course builder ----------------------------------------- */
.builder { display: grid; gap: 16px; }
.b-module { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.b-module.is-dragging, .b-lesson.is-dragging { opacity: .4; }
.b-module-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.b-module-head h3 { flex: 1; font-size: 1rem; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grip { cursor: grab; color: var(--ink-4); display: inline-flex; padding: 4px; border-radius: 0; touch-action: none; }
.grip:hover { background: var(--navy-50); color: var(--navy); }
.grip:active { cursor: grabbing; }
.b-lessons { min-height: 48px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.b-lessons.is-over { background: var(--green-50); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.b-lesson { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 0; background: var(--surface); border: 1px solid transparent; }
.b-lesson:hover { border-color: var(--line); background: var(--surface-2); }
.b-lesson-thumb { width: 64px; height: 38px; border-radius: 0; background: var(--navy-50); overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--navy); }
.b-lesson-thumb img { width: 100%; height: 100%; object-fit: cover; }
.b-lesson-thumb .icon { width: 16px; height: 16px; }
.b-lesson-text { flex: 1; min-width: 0; }
.b-lesson-title { font-weight: 600; font-size: .925rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.b-lesson-sub { font-size: .78rem; color: var(--ink-3); }
.b-lesson-actions { display: flex; gap: 2px; }
.b-empty { padding: 14px; text-align: center; color: var(--ink-4); font-size: .875rem; }
.b-module-foot { padding: 8px 10px 10px; display: flex; gap: 8px; }
.saving-indicator { font-size: .8rem; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; min-height: 20px; }
.saving-indicator.is-saved { color: var(--ok); }
.picker-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; margin: 0 -8px; padding: 0 8px; }
.picker-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 0; cursor: pointer; }
.picker-item:hover { background: var(--surface-2); }
.picker-item input { width: 20px; height: 20px; accent-color: var(--navy); }

/* ---------- Admin: employee detail / assignment --------------------------- */
.profile-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.profile-head h1 { font-size: 1.5rem; }
.kv { display: grid; grid-template-columns: 1fr; gap: 10px 20px; }
@media (min-width: 640px) { .kv { grid-template-columns: 1fr 1fr; } }
.kv-item { display: flex; flex-direction: column; gap: 2px; }
.kv-item dt { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); font-weight: 600; }
.kv-item dd { margin: 0; font-weight: 500; }
.code-reveal { font-family: var(--font-display); font-size: 2.2rem; letter-spacing: .4em; font-weight: 800; color: var(--navy-900); text-align: center; padding: 16px; background: var(--green-50); border: 1px dashed #CFDC8A; border-radius: 0; margin-left: .4em; }
.assign-list { max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 0; }
.assign-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.assign-item:last-child { border-bottom: 0; }
.assign-item:hover { background: var(--surface-2); }
.assign-item input { width: 20px; height: 20px; accent-color: var(--navy); flex-shrink: 0; }
.assign-item .avatar { width: 32px; height: 32px; font-size: .75rem; }
.assign-item-text { flex: 1; min-width: 0; }
.assign-item-name { font-weight: 600; font-size: .925rem; }
.assign-item-sub { font-size: .8rem; color: var(--ink-3); }

/* ---------- Admin: reports matrix ---------------------------------------- */
.pct { display: inline-flex; align-items: center; gap: 8px; min-width: 120px; }
.pct .progress { flex: 1; }
.pct b { font-variant-numeric: tabular-nums; font-size: .85rem; min-width: 36px; text-align: right; }

/* ---------- Utilities ----------------------------------------------------- */
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.text-right { text-align: right; } .text-center { text-align: center; }
.flex-1 { flex: 1; min-width: 0; }
.w-100 { width: 100%; }
.hidden { display: none !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.pagination .btn { min-width: 40px; }
.pagination .is-current { background: var(--navy); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
@media print {
  .topbar, .sidebar, .admin-topbar, .footer, .toast-region, .page-actions, .btn { display: none !important; }
  .admin { grid-template-columns: 1fr; }
  body { background: #fff; }
}
