/* ============================================================
   CYSP Training Platform — Stylesheet
   Identity: academic "ink & gold". Deep scholarly navy as the
   authority color, a warm scholarship gold as the single accent
   (used only for progress/achievement), generous whitespace,
   and a clear left-to-right training progression.
   ============================================================ */

:root {
  /* Palette — matched to the Concept Schools / Young Scholars logo */
  --ink:        #20307f;   /* brand royal blue — primary */
  --ink-2:      #2c3f9c;   /* lighter blue for gradients/hover */
  --ink-soft:   #3a4a86;   /* muted blue for secondary text */
  --paper:      #f6f7fb;   /* app background */
  --card:       #ffffff;
  --line:       #e3e6f0;   /* hairline borders */
  --gold:       #e6821e;   /* brand orange — accent / achievement */
  --gold-soft:  #fce6cf;   /* soft orange tint */
  --green:      #1f9d63;   /* completion check */
  --green-soft: #e4f4ec;
  --red:        #c23b3b;
  --red-soft:   #fbe8e8;
  --muted:      #737a90;   /* captions, meta (echoes the logo gray) */

  /* Type */
  --serif: 'Georgia', 'Times New Roman', serif;
  --sans:  -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(32,48,127,.08), 0 6px 20px rgba(32,48,127,.06);
  --shadow-sm: 0 1px 2px rgba(32,48,127,.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink-2); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; color: var(--ink); line-height: 1.2; }
h1 { font-size: 1.9rem; margin: 0 0 .5rem; }
h2 { font-size: 1.35rem; margin: 0 0 .75rem; }
h3 { font-size: 1.1rem; margin: 0 0 .5rem; }

/* ---------- Top bar ---------- */
.topbar {
  background: linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
  color: #fff;
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 24px; height: 62px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { height: 34px; width: auto; display: block; }
/* The logo's own navy/gold colors blend into the dark menu background,
   so it sits on a light plate for contrast regardless of theme. */
.brand-logo-plate {
  display: inline-flex; align-items: center; background: #fff;
  padding: 6px 12px; border-radius: var(--radius-sm); box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.topnav { display: flex; gap: 4px; margin-left: 8px; flex: 1; }
.topnav a {
  color: #cdd6e8; padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: .92rem; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
}
.topnav a:hover { color: #fff; background: rgba(255,255,255,.10); text-decoration: none; }
.nav-icon { font-size: 1rem; line-height: 1; opacity: .9; }

/* Topbar "Manage" dropdown — groups the busier admin links so the bar
   doesn't get crowded. Sidebar mode never uses this (plenty of room there). */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  background: none; border: none; color: #cdd6e8; padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: .92rem; font-weight: 500; cursor: pointer; font-family: var(--sans);
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-dropdown-toggle:hover { color: #fff; background: rgba(255,255,255,.10); }
.nav-dropdown.open .nav-dropdown-toggle { color: #fff; background: rgba(255,255,255,.14); }
.nav-caret { font-size: .65rem; opacity: .8; transition: transform .15s ease; }
.nav-dropdown.open .nav-caret { transform: rotate(180deg); }
.nav-dropdown-menu {
  position: absolute; top: 100%; left: 0; margin-top: 6px; min-width: 190px;
  background: #fff; border-radius: var(--radius); box-shadow: 0 12px 28px rgba(20,35,63,.22);
  padding: 6px; display: none; z-index: 60; border: 1px solid var(--line);
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  color: var(--ink); padding: 8px 12px; border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 500;
}
.nav-dropdown-menu a:hover { background: var(--paper); text-decoration: none; }
.nav-dropdown-menu .nav-icon { opacity: 1; }

/* User menu (topbar) — same dropdown mechanism, right-aligned since it
   sits at the far right of the bar. */
.user-dropdown-toggle { font-weight: 600; }
.user-dropdown-menu { left: auto; right: 0; min-width: 170px; }
.user-dropdown-role {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); padding: 6px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.topbar-user { display: flex; align-items: center; gap: 10px; }
.user-name { font-weight: 600; font-size: .9rem; }
.user-role {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .5px;
  background: rgba(255,255,255,.14); padding: 3px 8px; border-radius: 20px;
  color: #e6ecf7;
}
.logout-btn {
  color: #fff; border: 1px solid rgba(255,255,255,.3);
  padding: 6px 12px; border-radius: var(--radius-sm); font-size: .85rem;
}
.logout-btn:hover { background: rgba(255,255,255,.14); text-decoration: none; }

/* ---------- Layout ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 32px 24px 60px; }
.page-head { margin-bottom: 24px; }
.page-head .subtitle { color: var(--muted); font-size: 1rem; margin-top: -2px; }

/* ---------- Left-sidebar layout (alternative to the top bar) ---------- */
.app-shell { display: flex; align-items: flex-start; min-height: 100vh; }
.sidebar {
  width: 300px; flex-shrink: 0; min-height: 100vh; position: sticky; top: 0;
  background: linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
  color: #fff; display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
}
.sidebar .brand { padding: 24px 20px 18px; justify-content: center; }
.sidenav { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; flex: 1; }
.sidenav a {
  color: #cdd6e8; padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: .92rem; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
}
.sidenav a:hover { color: #fff; background: rgba(255,255,255,.10); text-decoration: none; }
.sidebar-user {
  padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.14);
  display: flex; flex-direction: column; gap: 6px;
}
.sidebar-user .user-name { color: #fff; text-decoration: none; }
.sidebar-user .user-role { align-self: flex-start; }
.sidebar-user-links { display: flex; gap: 12px; margin-top: 4px; }
.sidebar-user-links a { color: #cdd6e8; font-size: .82rem; }
.sidebar-user-links a:hover { color: #fff; }
.sidebar-main { flex: 1; min-width: 0; }
.sidebar-main .container { max-width: none; margin: 0 20px; padding: 32px 0 60px; }
@media (max-width: 820px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; min-height: 0; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .sidebar .brand { padding: 14px 16px; }
  .sidenav { flex-direction: row; flex-wrap: wrap; padding: 8px 12px; }
  .sidebar-user { flex-direction: row; align-items: center; border-top: none; border-left: 1px solid rgba(255,255,255,.14); margin-left: auto; }
}

.sitefooter { border-top: 1px solid var(--line); background: #fff; }
.sitefooter-inner {
  max-width: 1180px; margin: 0 auto; padding: 18px 24px;
  color: var(--muted); font-size: .85rem;
}

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px;
}
.card + .card { margin-top: 18px; }
.card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

/* ---------- Drag-to-reorder (module list) ---------- */
.module-card { cursor: grab; transition: box-shadow .15s, opacity .15s; }
.module-card.dragging { opacity: .4; box-shadow: none; }
.module-card .drag-handle {
  color: var(--muted); margin-right: 6px; cursor: grab; font-size: .9em;
}
.reorder-bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px;
  background: var(--gold); color: #2a2110; padding: 10px 16px; border-radius: var(--radius-sm);
  margin-bottom: 14px; font-size: .88rem; box-shadow: var(--shadow-sm);
}

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topnav { display: none; }
}

/* ---------- Stat tiles ---------- */
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.stat .stat-num { font-family: var(--serif); font-size: 2rem; font-weight: 700; color: var(--ink); }
.stat .stat-label { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .4px; }
.stat.accent { border-top: 3px solid var(--gold); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; cursor: pointer; font-family: var(--sans);
  font-size: .92rem; font-weight: 600; border-radius: var(--radius-sm);
  padding: 10px 18px; border: 1px solid transparent; transition: .15s;
  text-align: center;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-2); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #cc7016; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--paper); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #a83030; }
.btn-sm { padding: 6px 12px; font-size: .82rem; }
.btn-block { display: block; width: 100%; }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Forms ---------- */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 5px; color: var(--ink-soft); }
.input, select, textarea {
  width: 100%; padding: 10px 12px; font-size: .95rem; font-family: var(--sans);
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink);
}
.input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(30,51,87,.12);
}
.form-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.help { color: var(--muted); font-size: .82rem; margin-top: 4px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
table.data th {
  background: #f2f4f9; color: var(--ink-soft); font-weight: 600;
  text-transform: uppercase; font-size: .74rem; letter-spacing: .4px; white-space: nowrap;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #fafbfd; }

/* ---------- Badges / pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: .76rem; font-weight: 600; }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-gold  { background: var(--gold-soft); color: #9a5510; }
.pill-red   { background: var(--red-soft); color: var(--red); }
.pill-gray  { background: #eef0f5; color: var(--muted); }
.pill-blue  { background: #e6edf9; color: var(--ink-2); }

/* ---------- Progress bar ---------- */
.progress { background: #e9ecf3; border-radius: 20px; height: 9px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #f5a24a); border-radius: 20px; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: var(--green-soft); border-color: #bfe6d1; color: #14663f; }
.alert-error   { background: var(--red-soft); border-color: #f0c9c9; color: #8f2b2b; }
.alert-info    { background: #e9f0fb; border-color: #cddcf5; color: var(--ink-2); }
.alert-warn    { background: #fdf5e3; border-color: #f0dcae; color: #7d5b12; }

/* ============================================================
   Login page
   ============================================================ */
.login-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
}
@media (max-width: 820px) { .login-wrap { grid-template-columns: 1fr; } .login-aside { display: none; } }

.login-aside {
  background:
    radial-gradient(1200px 600px at -10% -20%, rgba(230,130,30,.20), transparent 55%),
    linear-gradient(160deg, var(--ink) 0%, #172058 100%);
  color: #fff; padding: 56px 52px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-aside .aside-logo { height: 52px; width: auto; margin-bottom: 40px; }
.login-aside h1 { color: #fff; font-size: 2.4rem; line-height: 1.1; }
.login-aside .lead { color: #c6d0e4; font-size: 1.05rem; max-width: 30ch; }
.login-aside .aside-foot { color: #8fa0c0; font-size: .82rem; }
.aside-seal {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px;
  border: 1px solid rgba(255,255,255,.2); padding: 8px 14px; border-radius: 30px;
  font-size: .8rem; color: #e6ecf7; align-self: flex-start;
}
.aside-seal .dot { width: 8px; height: 8px; background: var(--gold); border-radius: 50%; }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 1.6rem; margin-bottom: 4px; }
.login-card .muted { color: var(--muted); margin-bottom: 26px; font-size: .95rem; }
.login-mobile-logo { display: none; }
@media (max-width: 820px) {
  .login-mobile-logo { display: block; height: 46px; margin: 0 auto 20px; }
}

/* ============================================================
   Advisor training path
   ============================================================ */
.path { display: flex; flex-direction: column; gap: 16px; }
.module-card {
  display: flex; align-items: stretch; gap: 0; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: .15s;
}
.module-card.is-open:hover { box-shadow: var(--shadow); }
.module-rail {
  width: 78px; flex-shrink: 0; background: #f2f4f9;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; border-right: 1px solid var(--line);
}
.module-num { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; color: var(--ink-soft); }
.module-rail .state-icon { font-size: 1.4rem; line-height: 1; }
.module-body { flex: 1; padding: 18px 22px; }
.module-body h3 { margin-bottom: 3px; }
.module-body .module-desc { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
.module-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.module-card.locked { opacity: .72; background: #fbfbfc; }
.module-card.locked .module-rail { background: #eef0f5; }
.module-card.done .module-rail { background: var(--green-soft); border-right-color: #cdeadb; }
.module-card.done .module-num { color: var(--green); }

.check { color: var(--green); }
.lock  { color: var(--muted); }

/* Video modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10,18,32,.72);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius); max-width: 900px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.4); overflow: hidden;
}
.modal-video { max-width: 1240px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-body { padding: 0; background: #000; }
.modal-body video { width: 100%; display: block; max-height: 80vh; }
.modal-foot { padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-foot .muted { color: var(--muted); font-size: .85rem; }

/* Watch-progress readout under the video */
.video-progress { padding: 12px 20px 4px; }
.video-progress-labels { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.video-progress-labels strong { color: var(--ink); font-weight: 700; }
.video-progress .progress { height: 8px; }

/* Custom video controls (native <video controls> is hidden — no draggable
   scrubber is offered on purpose, since that's exactly what the skip-ahead
   protection guards against). */
.video-wrap { position: relative; background: #000; line-height: 0; }
.video-wrap video { cursor: pointer; }

.video-center-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(20, 35, 63, .55); border: 2px solid rgba(255,255,255,.85);
  color: #fff; font-size: 1.6rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding-left: 4px;
  opacity: 0; visibility: hidden; transition: opacity .2s ease, background .2s ease;
}
.video-center-play.show { opacity: 1; visibility: visible; }
.video-center-play:hover { background: rgba(230, 130, 30, .8); }

.video-controls-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; gap: 4px; padding: 6px 16px 10px;
  background: linear-gradient(0deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,0) 100%);
  opacity: 0; transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease; pointer-events: none;
}
.video-controls-bar.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.vc-row { display: flex; align-items: center; gap: 12px; }
.vc-btn {
  background: none; border: none; color: #fff; font-size: 1.15rem; cursor: pointer;
  line-height: 1; padding: 4px; opacity: .9;
}
.vc-btn:hover { opacity: 1; color: var(--gold); }
.vc-jump { font-size: .78rem; font-weight: 700; opacity: .85; }
.vc-jump:hover { opacity: 1; }
.vc-time { color: #e9ecf3; font-size: .82rem; font-variant-numeric: tabular-nums; }
.vc-spacer { flex: 1; }

/* Scrubber — forward drags past the watched point snap back (enforced in JS),
   so the track gradient shows watched (gold) vs. not-yet-watched (grey). */
.vc-seek {
  -webkit-appearance: none; appearance: none; width: 100%; height: 5px;
  border-radius: 4px; cursor: pointer; background: rgba(255,255,255,.25);
}
.vc-seek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 13px; height: 13px;
  border-radius: 50%; background: #fff; border: 2px solid var(--gold);
  margin-top: -4px; cursor: pointer;
}
.vc-seek::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%; background: #fff;
  border: 2px solid var(--gold); cursor: pointer;
}
.vc-seek::-webkit-slider-runnable-track { height: 5px; border-radius: 4px; background: transparent; }
.vc-seek::-moz-range-track { height: 5px; border-radius: 4px; background: transparent; }

/* ============================================================
   Quiz
   ============================================================ */
.quiz-progress { position: sticky; top: 62px; background: var(--paper); padding: 12px 0; z-index: 5; }
.quiz-q { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.quiz-q .qnum { font-family: var(--serif); color: var(--gold); font-weight: 700; font-size: .9rem; letter-spacing: .5px; }
.quiz-q .qtext { font-size: 1.08rem; font-weight: 600; margin: 4px 0 16px; color: var(--ink); }
.opt {
  display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px;
  cursor: pointer; transition: .12s; background: #fff;
}
.opt:hover { border-color: var(--ink-2); background: #fafbfd; }
.opt input { margin-top: 3px; accent-color: var(--ink); width: 17px; height: 17px; }
.opt.selected { border-color: var(--ink); background: #eef2fa; }
.opt .opt-label { font-weight: 700; color: var(--ink-soft); margin-right: 2px; }

/* Result review */
.result-hero { text-align: center; padding: 30px; border-radius: var(--radius); color: #fff; margin-bottom: 22px; }
.result-hero.pass { background: linear-gradient(160deg, var(--green) 0%, #147a4b 100%); }
.result-hero.fail { background: linear-gradient(160deg, #b34141 0%, #8f2b2b 100%); }
.result-hero .big-score { font-family: var(--serif); font-size: 3.4rem; font-weight: 700; line-height: 1; }
.result-hero .result-msg { font-size: 1.05rem; opacity: .95; margin-top: 6px; }

.review-q { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 12px; background: #fff; }
.review-q.ok { border-left: 4px solid var(--green); }
.review-q.bad { border-left: 4px solid var(--red); }
.review-q .rq-text { font-weight: 600; margin-bottom: 8px; }
.review-line { font-size: .9rem; margin: 3px 0; }
.review-line .lbl { color: var(--muted); display: inline-block; min-width: 90px; }
.review-expl { margin-top: 8px; padding: 10px 12px; background: var(--paper); border-radius: var(--radius-sm); font-size: .88rem; color: var(--ink-soft); }

/* ============================================================
   Certificate (screen + print)
   ============================================================ */
.cert-actions { text-align: center; margin: 24px 0; display: flex; gap: 12px; justify-content: center; }

.certificate {
  background: #fff; width: 1000px; max-width: 100%; margin: 0 auto;
  border: 2px solid var(--ink); position: relative; padding: 60px 70px;
  box-shadow: var(--shadow);
}
.certificate::before {
  content: ""; position: absolute; inset: 14px; border: 1px solid var(--gold); pointer-events: none;
}
.cert-inner { position: relative; text-align: center; }
.cert-logo { height: 64px; margin-bottom: 18px; }
.cert-kicker { text-transform: uppercase; letter-spacing: 4px; color: var(--gold); font-weight: 700; font-size: .82rem; }
.cert-title { font-family: var(--serif); font-size: 2.6rem; color: var(--ink); margin: 8px 0 26px; }
.cert-sub { color: var(--muted); font-size: 1rem; }
.cert-name { font-family: var(--serif); font-size: 2.4rem; color: var(--ink); margin: 12px 0; border-bottom: 2px solid var(--gold); display: inline-block; padding: 0 30px 8px; }
.cert-body { max-width: 560px; margin: 18px auto 30px; color: var(--ink-soft); font-size: 1.02rem; }
.cert-meta { display: flex; justify-content: space-between; margin-top: 44px; gap: 40px; }
.cert-meta .meta-block { flex: 1; text-align: center; }
.cert-meta .meta-line { border-top: 1.5px solid var(--ink); padding-top: 8px; font-size: .88rem; color: var(--ink-soft); }
.cert-seal {
  position: absolute; right: 40px; bottom: 30px; width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f5a24a, var(--gold));
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-family: var(--serif); font-weight: 700; font-size: .7rem; text-align: center; line-height: 1.2;
  box-shadow: 0 4px 12px rgba(230,130,30,.4);
}

/* Empty states */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .empty-icon { font-size: 2.5rem; margin-bottom: 10px; }

/* Credential print-out box (shown after creating advisors) */
.cred-box { background: var(--gold-soft); border: 1px dashed var(--gold); border-radius: var(--radius-sm); padding: 14px 16px; font-family: monospace; font-size: .9rem; }
.cred-box strong { font-family: var(--sans); }

/* Toast notifications (video skip-block, resume, reset confirmations) */
.toast-stack {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: .88rem; font-weight: 600; box-shadow: 0 8px 24px rgba(20,35,63,.28);
  opacity: 0; transform: translateY(12px) scale(.96);
  transition: opacity .25s ease, transform .25s ease;
  max-width: min(90vw, 420px); text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast-warn { background: var(--gold); animation: toast-shake .4s ease; }
.toast-success { background: var(--green); }
.toast-info { background: var(--ink-2); }
@keyframes toast-shake {
  0%, 100% { transform: translateY(0) scale(1); }
  20% { transform: translateX(-6px) translateY(0) scale(1); }
  40% { transform: translateX(6px) translateY(0) scale(1); }
  60% { transform: translateX(-4px) translateY(0) scale(1); }
  80% { transform: translateX(4px) translateY(0) scale(1); }
}

.reset-video-btn { color: var(--ink-soft); }

/* Messages */
.messages-layout { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
@media (max-width: 760px) { .messages-layout { grid-template-columns: 1fr; } }

.msg-contacts { padding: 16px; }
.msg-contact-row { display: flex; align-items: center; gap: 8px; }
.msg-contact-row .broadcast-check { flex-shrink: 0; width: 16px; height: 16px; accent-color: var(--gold); cursor: pointer; }
.msg-contact {
  display: block; position: relative; flex: 1; min-width: 0; padding: 10px 34px 10px 12px; border-radius: var(--radius-sm);
  color: var(--ink); text-decoration: none; margin-bottom: 4px;
}
.msg-contact:hover { background: var(--paper); }
.msg-contact.active { background: var(--gold-soft); }
.msg-contact-name { font-weight: 700; font-size: .92rem; }
.msg-contact-role { font-size: .76rem; color: var(--muted); }
.msg-unread-pill { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); padding: 1px 8px; }

.msg-broadcast-panel { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.msg-broadcast-panel textarea {
  width: 100%; resize: none; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 12px; font-family: var(--sans); font-size: .88rem;
}
.msg-broadcast-panel textarea:focus { outline: none; border-color: var(--ink-2); }

.msg-thread { display: flex; flex-direction: column; min-height: 480px; padding: 16px; }
.msg-scroll { flex: 1; overflow-y: auto; max-height: 50vh; padding-right: 4px; margin-bottom: 12px; }
.msg-bubble-row { display: flex; margin-bottom: 10px; }
.msg-bubble-row.mine { justify-content: flex-end; }
.msg-bubble {
  max-width: 72%; background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px 14px 14px 4px; padding: 8px 13px;
}
.msg-bubble.mine {
  background: var(--ink); color: #fff; border-color: var(--ink);
  border-radius: 14px 14px 4px 14px;
}
.msg-body { font-size: .92rem; white-space: pre-wrap; word-break: break-word; }
.msg-time { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.msg-bubble.mine .msg-time { color: rgba(255,255,255,.7); }

.msg-compose { display: flex; gap: 10px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 12px; }
.msg-compose textarea {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 12px; font-family: var(--sans); font-size: .92rem;
}
.msg-compose textarea:focus { outline: none; border-color: var(--ink-2); }

/* Utility */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.flex { display: flex; } .flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 16px; } .gap-1 { gap: 8px; }
.nowrap { white-space: nowrap; }
.small { font-size: .85rem; }

@media print {
  body { background: #fff; }
  .topbar, .sitefooter, .cert-actions, .no-print { display: none !important; }
  .container { padding: 0; max-width: none; }
  .certificate { border: 2px solid var(--ink); box-shadow: none; page-break-inside: avoid; }
  @page { size: landscape; margin: 12mm; }
}