/* ============================================================
   EduMOOC — Complete CSS Design System
   กลุ่มโครงการพิเศษ สำนักพัฒนานวัตกรรมการจัดการศึกษา
   สำนักงานคณะกรรมการการศึกษาขั้นพื้นฐาน กระทรวงศึกษาธิการ
   Version 1.0 | 2568
============================================================ */

/* ============================================================
   1. CSS VARIABLES & RESET
============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&family=Prompt:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,700;1,600&display=swap');

:root {
  /* Green Palette */
  --g50:  #f0faf5;
  --g100: #d6f2e5;
  --g200: #a8e3c8;
  --g300: #6dcba3;
  --g400: #3db882;
  --g500: #1fa369;
  --g600: #158a58;
  --g700: #0d6e46;
  --g800: #095535;
  --g900: #063d26;

  /* Semantic Colors */
  --gold:   #c9a84c;
  --gold2:  #e8c96a;
  --gold3:  #f5e6b3;
  --err:    #f43f5e;
  --err-bg: #fff1f2;
  --err-bd: #fecdd3;
  --warn:   #f59e0b;
  --blue:   #3b82f6;
  --amber:  #f59e0b;

  /* Typography */
  --font:       'Sarabun', sans-serif;
  --font-head:  'Prompt', sans-serif;
  --font-serif: 'Playfair Display', serif;
  --font-mono:  monospace;

  /* Layout */
  --sidebar-w: 240px;
  --topbar-h:  52px;
  --r:         12px;
  --r-sm:      8px;
  --r-lg:      16px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(29,158,117,.08);
  --shadow:    0 4px 20px rgba(29,158,117,.12);
  --shadow-lg: 0 8px 32px rgba(29,158,117,.16);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; font-family: var(--font); background: var(--g50); color: #1a1a1a; }
a { text-decoration: none; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* ============================================================
   2. SCREEN SYSTEM (SPA)
============================================================ */
.screen         { display: none; width: 100%; height: 100%; }
.screen.active  { display: flex; }
.content-page         { display: none; flex: 1; overflow-y: auto; flex-direction: column; }
.content-page.active  { display: flex; }
.hidden { display: none !important; }

/* ============================================================
   3. LOGIN / REGISTER PAGE
============================================================ */

/* — Left Branding Panel — */
.login-left {
  width: 42%; background: transparent;
  display: flex; flex-direction: column; justify-content: center;
  padding: 52px 48px; position: relative; overflow: hidden;
}
.login-left::before {
  content: ''; position: absolute; top: -80px; right: -80px;
  width: 320px; height: 320px; border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.login-left::after {
  content: ''; position: absolute; bottom: -60px; left: -40px;
  width: 240px; height: 240px; border-radius: 50%;
  background: rgba(255,255,255,.04);
}
.ll-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 36px 36px; pointer-events: none;
}
.ll-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 48px; position: relative; z-index: 1; }
.ll-logo-ico {
  width: 48px; height: 48px;
  background: rgba(255,255,255,.15); border: 1.5px solid rgba(255,255,255,.25);
  border-radius: 13px; display: flex; align-items: center; justify-content: center;
}
.ll-logo-ico svg { width: 24px; height: 24px; stroke: white; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.ll-logo-name { font-family: var(--font-head); font-size: 20px; font-weight: 700; color: white; letter-spacing: -.3px; }
.ll-logo-sub  { font-size: 9.5px; color: rgba(255,255,255,.55); letter-spacing: .8px; text-transform: uppercase; margin-top: 1px; }

.ll-hero { position: relative; z-index: 1; margin-bottom: 40px; }
.ll-tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.9); font-size: 10.5px; font-weight: 700;
  padding: 4px 12px; border-radius: 20px; letter-spacing: .5px; margin-bottom: 16px;
}
.ll-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--g300); }
.ll-hero h1 { font-family: var(--font-head); font-size: 30px; font-weight: 700; color: white; line-height: 1.3; margin-bottom: 14px; }
.ll-hero p  { font-size: 14px; color: rgba(255,255,255,.7); line-height: 1.8; }

.ll-features { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 11px; }
.ll-feat { display: flex; align-items: center; gap: 10px; }
.ll-feat-ico {
  width: 32px; height: 32px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ll-feat-ico svg { width: 15px; height: 15px; stroke: rgba(255,255,255,.9); fill: none; stroke-width: 1.8; stroke-linecap: round; }
.ll-feat span { font-size: 13px; color: rgba(255,255,255,.75); }

.ll-gov {
  position: relative; z-index: 1; margin-top: auto;
  padding-top: 32px; border-top: 1px solid rgba(255,255,255,.12);
}
.ll-gov p    { font-size: 10.5px; color: rgba(255,255,255,.45); line-height: 1.8; }
.ll-gov strong { color: rgba(255,255,255,.65); }

/* — Right Form Panel — */
.login-right {
  flex: 1; background: white;
  display: flex; align-items: center; justify-content: center;
  padding: 40px; overflow-y: auto;
}
.login-form-wrap { width: 100%; max-width: 420px; }

/* Tab switcher */
.lf-tabs {
  display: flex; background: var(--g50);
  border: 1px solid var(--g100); border-radius: 11px; padding: 4px; margin-bottom: 28px;
}
.lf-tab {
  flex: 1; padding: 9px 0; text-align: center; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: #888; cursor: pointer; transition: all .2s;
  border: none; background: transparent;
}
.lf-tab.act { background: white; color: var(--g700); font-weight: 700; box-shadow: 0 1px 6px rgba(0,0,0,.08); }
.lf-tab:hover:not(.act) { color: var(--g600); }

.lf-header { margin-bottom: 24px; }
.lf-header h2 { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: #1a1a1a; margin-bottom: 4px; }
.lf-header p  { font-size: 13px; color: #999; }

/* Step indicator */
.step-bar { display: flex; align-items: center; gap: 0; margin-bottom: 22px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.step-circle {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; transition: all .25s;
}
.step.done .step-circle { background: var(--g500); color: white; }
.step.act  .step-circle { background: white; color: var(--g600); border: 2px solid var(--g400); box-shadow: 0 0 0 4px rgba(63,184,130,.15); }
.step.todo .step-circle { background: #f0f0f0; color: #bbb; border: 2px solid #e5e7eb; }
.step-name { font-size: 10px; font-weight: 600; color: #aaa; white-space: nowrap; }
.step.done .step-name { color: var(--g600); }
.step.act  .step-name { color: var(--g700); }
.step-line { flex: 1; height: 2px; background: #e5e7eb; margin-bottom: 16px; transition: background .3s; }
.step-line.done { background: var(--g400); }

/* Section divider label */
.fsection-div { display: flex; align-items: center; gap: 10px; margin: 4px 0 2px; }
.fsection-div-line  { flex: 1; height: 1px; background: var(--g100); }
.fsection-div-label {
  font-size: 10px; font-weight: 700; color: var(--g500);
  letter-spacing: .8px; text-transform: uppercase; white-space: nowrap;
}

/* Submit button */
.btn-submit {
  width: 100%; height: 46px; border-radius: 10px;
  background: linear-gradient(135deg, var(--g400), var(--g600));
  color: white; font-size: 14px; font-weight: 700; border: none;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 16px rgba(29,158,117,.3); margin-top: 20px;
  position: relative; overflow: hidden; transition: all .2s;
}
.btn-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(29,158,117,.4); }
.btn-submit:active { transform: translateY(0); }
.btn-submit svg  { width: 16px; height: 16px; stroke: white; fill: none; stroke-width: 2; stroke-linecap: round; }
.btn-submit.loading { opacity: .8; pointer-events: none; }
.btn-submit .btn-txt  { transition: opacity .2s; }
.btn-submit.loading .btn-txt  { opacity: 0; }
.btn-submit .spinner {
  display: none; position: absolute;
  width: 20px; height: 20px; border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite;
}
.btn-submit.loading .spinner { display: block; }

/* Or divider */
.or-div  { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.or-line { flex: 1; height: 1px; background: var(--g100); }
.or-txt  { font-size: 11.5px; color: #bbb; }

/* Alt login button */
.alt-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; border: 1.5px solid #e8e8e8;
  background: white; font-size: 13px; color: #444; font-weight: 500; width: 100%;
  transition: all .18s;
}
.alt-btn:hover { border-color: var(--g200); background: var(--g50); }

/* Footer link */
.lf-footer { text-align: center; font-size: 12.5px; color: #aaa; margin-top: 16px; }
.lf-footer a { color: var(--g600); font-weight: 700; cursor: pointer; }
.lf-footer a:hover { text-decoration: underline; }

/* Alert banner */
.alert-banner {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border-radius: 10px; margin-bottom: 16px;
  animation: alertIn .3s ease;
}
.alert-banner.err { background: var(--err-bg); border: 1px solid var(--err-bd); }
.alert-banner.suc { background: var(--g50);   border: 1px solid var(--g100); }
.alert-ico { width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.alert-banner.err .alert-ico { background: #ffe4e6; }
.alert-banner.suc .alert-ico { background: var(--g100); }
.alert-ico svg { width: 12px; height: 12px; fill: none; stroke-width: 2.5; stroke-linecap: round; }
.alert-banner.err .alert-ico svg { stroke: var(--err); }
.alert-banner.suc .alert-ico svg { stroke: var(--g600); }
.alert-title { font-size: 12.5px; font-weight: 700; }
.alert-banner.err .alert-title { color: #be123c; }
.alert-banner.suc .alert-title { color: var(--g700); }
.alert-desc { font-size: 11.5px; color: #666; margin-top: 1px; line-height: 1.5; }

/* ============================================================
   4. FORM FIELD COMPONENTS
============================================================ */
.field { display: flex; flex-direction: column; gap: 5px; }
.frow2    { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.frow3    { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.frow-full { display: grid; grid-template-columns: 1fr; }

/* Label */
.flbl { font-size: 11.5px; font-weight: 700; color: #444; display: flex; align-items: center; gap: 3px; }
.flbl .req { color: var(--err); font-size: 10px; }
.flbl .opt { color: #bbb; font-size: 10px; font-weight: 400; }

/* Input wrapper */
.finput-wrap { position: relative; display: flex; align-items: center; }
.finput-ico  { position: absolute; left: 11px; pointer-events: none; display: flex; align-items: center; }
.finput-ico svg { width: 15px; height: 15px; stroke: #bbb; fill: none; stroke-width: 1.8; stroke-linecap: round; transition: stroke .2s; }
.finput-wrap:focus-within .finput-ico svg { stroke: var(--g400); }

/* Base input */
.finput {
  width: 100%; height: 42px;
  border: 1.5px solid #e8e8e8; border-radius: 9px;
  background: white; font-size: 13px; color: #1a1a1a;
  padding: 0 38px 0 38px; outline: none; transition: all .2s;
}
.finput.no-ico     { padding-left: 13px; }
.finput::placeholder { color: #ccc; }
.finput:hover  { border-color: var(--g200); }
.finput:focus  { border-color: var(--g400); box-shadow: 0 0 0 3px rgba(63,184,130,.1); }

/* Input states */
.field.f-err .finput  { border-color: var(--err); background: var(--err-bg); }
.field.f-err .finput:focus { box-shadow: 0 0 0 3px rgba(244,63,94,.1); }
.field.f-err .finput-ico svg { stroke: var(--err); }
.field.f-ok  .finput  { border-color: var(--g400); background: var(--g50); }
.field.f-ok  .finput-ico svg { stroke: var(--g500); }

/* Field messages */
.field-err-msg {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--err); font-weight: 500; margin-top: 2px;
}
.field-err-msg svg { width: 12px; height: 12px; stroke: var(--err); fill: none; stroke-width: 2.5; stroke-linecap: round; flex-shrink: 0; }
.field-ok-msg {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--g600); font-weight: 500; margin-top: 2px;
}
.field-ok-msg svg { width: 12px; height: 12px; stroke: var(--g500); fill: none; stroke-width: 2.5; stroke-linecap: round; flex-shrink: 0; }
.field-hint { font-size: 11px; color: #aaa; margin-top: 2px; line-height: 1.5; }

/* Right icon (password toggle) */
.finput-right {
  position: absolute; right: 11px;
  cursor: pointer; opacity: .5; transition: opacity .15s;
  display: flex; align-items: center; justify-content: center;
}
.finput-right:hover { opacity: 1; }
.finput-right svg { width: 15px; height: 15px; stroke: #888; fill: none; stroke-width: 1.8; stroke-linecap: round; }

/* Select */
.fselect {
  width: 100%; height: 42px;
  border: 1.5px solid #e8e8e8; border-radius: 9px;
  background: white; font-size: 13px; color: #1a1a1a;
  padding: 0 36px 0 38px; outline: none; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='7' viewBox='0 0 10 7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 6L9 1' stroke='%23aaa' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  transition: all .2s;
}
.fselect:focus { border-color: var(--g400); box-shadow: 0 0 0 3px rgba(63,184,130,.1); }

/* Textarea */
.ftextarea {
  width: 100%; min-height: 72px;
  border: 1.5px solid #e8e8e8; border-radius: 9px;
  background: white; font-size: 13px; color: #1a1a1a;
  padding: 10px 13px 10px 38px; outline: none;
  resize: vertical; line-height: 1.6; transition: all .2s;
}
.ftextarea::placeholder { color: #ccc; }
.ftextarea:hover { border-color: var(--g200); }
.ftextarea:focus { border-color: var(--g400); box-shadow: 0 0 0 3px rgba(63,184,130,.1); }

/* Date input */
.fdate {
  width: 100%; height: 42px;
  border: 1.5px solid #e8e8e8; border-radius: 9px;
  background: white; font-size: 13px; color: #1a1a1a;
  padding: 0 12px; outline: none; cursor: pointer; transition: all .2s;
}
.fdate:focus { border-color: var(--g400); box-shadow: 0 0 0 3px rgba(63,184,130,.1); }

/* ID card special */
.finput-id { font-family: var(--font-mono); letter-spacing: 2px; font-size: 14px; }

/* Checkbox */
.check-wrap { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; padding: 2px 0; }
.custom-check {
  width: 17px; height: 17px; border: 1.5px solid var(--g200);
  border-radius: 4px; background: white;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px; transition: all .15s;
}
.custom-check.on { background: var(--g500); border-color: var(--g500); }
.custom-check svg { display: none; width: 10px; height: 10px; stroke: white; fill: none; stroke-width: 3; stroke-linecap: round; }
.custom-check.on svg { display: block; }
.check-label { font-size: 12.5px; color: #666; line-height: 1.6; }
.check-label a { color: var(--g600); font-weight: 600; }

/* Password strength */
.pwd-strength { margin-top: 6px; }
.pwd-bars { display: flex; gap: 3px; margin-bottom: 4px; }
.pwd-bar { flex: 1; height: 3px; border-radius: 20px; background: #eee; transition: background .3s; }
.pwd-bar.weak   { background: #f43f5e; }
.pwd-bar.fair   { background: #f59e0b; }
.pwd-bar.good   { background: var(--g400); }
.pwd-bar.strong { background: var(--g500); }
.pwd-label { font-size: 10.5px; color: #aaa; }
.pwd-label.weak   { color: #f43f5e; }
.pwd-label.fair   { color: #b45309; }
.pwd-label.good   { color: var(--g500); }
.pwd-label.strong { color: var(--g600); }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--g200); border-radius: 10px;
  padding: 20px 16px; text-align: center; cursor: pointer;
  transition: all .2s; background: var(--g50);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.upload-zone:hover { border-color: var(--g400); background: var(--g100); }
.upload-zone svg  { width: 28px; height: 28px; stroke: var(--g300); fill: none; stroke-width: 1.5; stroke-linecap: round; }
.upload-txt { font-size: 12.5px; color: var(--g500); font-weight: 600; }
.upload-sub { font-size: 11px; color: #aaa; }

/* Toggle switch */
.sw { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.sw input { opacity: 0; width: 0; height: 0; position: absolute; }
.sw-track {
  position: absolute; inset: 0; border-radius: 22px;
  background: #e5e7eb; cursor: pointer; transition: background .2s;
}
.sw input:checked + .sw-track { background: var(--g500); }
.sw-track::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  background: white; top: 3px; left: 3px;
  transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.sw input:checked + .sw-track::before { transform: translateX(16px); }

/* Toggle row */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.toggle-info .toggle-lbl { font-size: 12.5px; font-weight: 600; color: #333; }
.toggle-info .toggle-sub { font-size: 11px; color: #aaa; margin-top: 1px; }

/* ============================================================
   5. APP TOPBAR
============================================================ */
.app-topbar {
  height: var(--topbar-h); background: white;
  border-bottom: 1px solid var(--g100);
  display: flex; align-items: center; padding: 0 20px; gap: 14px;
  flex-shrink: 0; position: relative; z-index: 100;
  box-shadow: 0 1px 8px rgba(29,158,117,.06);
}
.app-topbar::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--g400), var(--g300), var(--g500));
}
.atb-logo      { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.atb-logo-ico  {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--g400), var(--g600));
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(29,158,117,.3);
}
.atb-logo-ico svg { width: 16px; height: 16px; stroke: white; fill: none; stroke-width: 2; stroke-linecap: round; }
.atb-logo-name { font-family: var(--font-head); font-size: 15px; font-weight: 700; color: var(--g800); }
.atb-logo-org  { font-size: 9.5px; color: var(--g500); font-weight: 500; }
.atb-divider   { width: 1px; height: 24px; background: var(--g100); }

.atb-breadcrumb { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #bbb; flex: 1; }
.atb-breadcrumb .bc-act { color: var(--g700); font-weight: 600; }
.atb-breadcrumb .sep    { font-size: 10px; color: #ddd; }

.atb-right { display: flex; align-items: center; gap: 8px; }
.atb-search {
  display: flex; align-items: center; gap: 7px;
  background: var(--g50); border: 1px solid var(--g100);
  border-radius: 8px; padding: 6px 12px; transition: all .2s;
}
.atb-search:focus-within { border-color: var(--g300); background: white; }
.atb-search svg { width: 13px; height: 13px; stroke: var(--g400); fill: none; stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }
.atb-search input { border: none; outline: none; background: transparent; font-size: 12.5px; width: 160px; color: #333; }
.atb-search input::placeholder { color: #bbb; }

.ibt {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--g50); border: 1px solid var(--g100);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s; position: relative;
}
.ibt:hover { background: var(--g100); }
.ibt svg { width: 14px; height: 14px; stroke: var(--g600); fill: none; stroke-width: 1.8; stroke-linecap: round; }
.ibt-dot {
  position: absolute; top: 4px; right: 4px;
  width: 6px; height: 6px; background: #ff6b6b;
  border-radius: 50%; border: 1.5px solid white;
}
.atb-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--g400), var(--g600));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white; cursor: pointer; flex-shrink: 0;
}

/* ============================================================
   6. SIDEBAR
============================================================ */
.sidebar {
  width: var(--sidebar-w); background: white;
  border-right: 1px solid var(--g100);
  display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden;
}

/* User card */
.sb-user {
  margin: 12px 14px 8px;
  background: linear-gradient(135deg, var(--g50), #f8fffe);
  border: 1px solid var(--g100); border-radius: var(--r);
  padding: 11px 12px; display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: all .2s;
}
.sb-user:hover { background: var(--g100); }
.sb-av { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--g400), var(--g600)); display: flex; align-items: center; justify-content: center; color: white; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.sb-uname { font-size: 12.5px; font-weight: 700; color: var(--g800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-urole { font-size: 10px; color: var(--g500); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Nav */
.sb-nav { padding: 6px 10px 2px; flex: 1; overflow-y: auto; }
.sb-nav::-webkit-scrollbar { width: 3px; }
.sb-nav::-webkit-scrollbar-thumb { background: var(--g100); border-radius: 4px; }
.sb-lbl { font-size: 9px; font-weight: 700; color: var(--g400); letter-spacing: 1.2px; text-transform: uppercase; padding: 7px 8px 5px; }

/* Menu item */
.mi { display: flex; align-items: center; gap: 9px; padding: 8px 8px; border-radius: 9px; cursor: pointer; transition: all .18s; position: relative; margin-bottom: 1px; }
.mi:hover { background: var(--g50); }
.mi:hover .mii { background: var(--g100); }
.mi:hover .mit { color: var(--g700); }
.mi.act {
  background: linear-gradient(135deg, var(--g50), #edfaf5);
  border: 1px solid var(--g100);
}
.mi.act::before {
  content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: var(--g500); border-radius: 0 3px 3px 0;
}
.mi.act .mii { background: linear-gradient(135deg, var(--g400), var(--g600)); box-shadow: 0 3px 8px rgba(29,158,117,.35); }
.mi.act .mii svg { stroke: white !important; }
.mi.act .mit { color: var(--g800); font-weight: 600; }

.mii { width: 28px; height: 28px; background: var(--g50); border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .18s; }
.mii svg { width: 13px; height: 13px; stroke: var(--g500); fill: none; stroke-width: 1.8; stroke-linecap: round; }
.mit { font-size: 12.5px; color: #555; flex: 1; }
.mb  { font-size: 9.5px; font-weight: 700; background: var(--g500); color: white; padding: 2px 6px; border-radius: 20px; }
.mb.red   { background: #ff6b6b; }
.mb.amber { background: var(--amber); }

.ndiv { height: 1px; background: var(--g50); margin: 6px 10px; }

/* Progress card */
.sb-prog-card {
  margin: 8px 14px 14px;
  background: linear-gradient(135deg, var(--g500), var(--g700));
  border-radius: var(--r); padding: 14px; color: white;
  position: relative; overflow: hidden; cursor: pointer;
}
.sb-prog-card::before { content: ''; position: absolute; top: -20px; right: -20px; width: 70px; height: 70px; background: rgba(255,255,255,.1); border-radius: 50%; }
.spc-lbl  { font-size: 10px; opacity: .8; margin-bottom: 3px; }
.spc-name { font-size: 12px; font-weight: 600; margin-bottom: 10px; line-height: 1.3; }
.spc-bar-wrap { background: rgba(255,255,255,.2); border-radius: 20px; height: 4px; margin-bottom: 5px; }
.spc-bar      { height: 100%; border-radius: 20px; background: rgba(255,255,255,.9); }
.spc-stats { display: flex; justify-content: space-between; font-size: 10px; opacity: .85; }

/* Footer */
.sb-footer { padding: 10px; border-top: 1px solid var(--g50); margin-top: auto; }
.sb-logout { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 9px; cursor: pointer; color: #bbb; transition: all .15s; font-size: 12.5px; }
.sb-logout:hover { background: #fff0f0; color: #e05555; }
.sb-lo-ico { width: 28px; height: 28px; background: #fdf0f0; border-radius: 7px; display: flex; align-items: center; justify-content: center; }
.sb-lo-ico svg { width: 13px; height: 13px; stroke: #e05555; fill: none; stroke-width: 1.8; stroke-linecap: round; }

/* ============================================================
   7. BUTTONS
============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 9px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all .18s; border: none;
}
.btn svg { width: 13px; height: 13px; fill: none; stroke-width: 2.5; stroke-linecap: round; }
.btn-prim   { background: var(--g500); color: white; }
.btn-prim:hover { background: var(--g600); }
.btn-prim svg { stroke: white; }
.btn-out    { background: white; color: var(--g600); border: 1.5px solid var(--g200); }
.btn-out:hover { background: var(--g50); border-color: var(--g300); }
.btn-out svg { stroke: var(--g600); }
.btn-ghost2 { background: transparent; color: #888; border: 1px solid #e5e7eb; }
.btn-ghost2:hover { background: #f5f5f5; }
.btn-ghost2 svg { stroke: #888; }
.btn-danger { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.btn-danger:hover { background: #ffe4e6; }
.btn-danger svg { stroke: #f43f5e; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }

/* ============================================================
   8. PAGE LAYOUT HELPERS
============================================================ */
.page-header {
  padding: 20px 24px 0;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.ph-title { font-family: var(--font-head); font-size: 20px; font-weight: 700; color: var(--g800); }
.ph-sub   { font-size: 12.5px; color: #999; margin-top: 3px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title { font-family: var(--font-head); font-size: 14px; font-weight: 700; color: var(--g800); }

/* ============================================================
   9. HERO BANNER
============================================================ */
.hero-banner {
  margin: 18px 24px 0; border-radius: 16px; overflow: hidden;
  background: linear-gradient(135deg, var(--g800) 0%, var(--g600) 55%, var(--g400) 100%);
  padding: 28px 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  position: relative;
}
.hero-banner::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 36px 36px;
}
.hero-banner::after { content: ''; position: absolute; right: -40px; top: -40px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.06); }

.hb-left { position: relative; z-index: 1; }
.hb-tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.9); font-size: 10px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px; margin-bottom: 10px; letter-spacing: .4px;
}
.hb-tag::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--g300); animation: pulseGreen 2s infinite; }
.hb-title { font-family: var(--font-head); font-size: 20px; font-weight: 700; color: white; line-height: 1.3; margin-bottom: 8px; }
.hb-sub   { font-size: 12.5px; color: rgba(255,255,255,.75); line-height: 1.7; max-width: 460px; }
.hb-actions { display: flex; gap: 9px; margin-top: 16px; }
.hb-btn-prim {
  display: flex; align-items: center; gap: 6px; padding: 9px 18px;
  border-radius: 9px; background: white; color: var(--g700);
  font-size: 13px; font-weight: 700; cursor: pointer; border: none; transition: all .18s;
}
.hb-btn-prim:hover { background: var(--g50); }
.hb-btn-out {
  display: flex; align-items: center; gap: 6px; padding: 9px 18px;
  border-radius: 9px; background: rgba(255,255,255,.12); color: white;
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1.5px solid rgba(255,255,255,.25); transition: all .18s;
}
.hb-btn-out:hover { background: rgba(255,255,255,.2); }

.hb-right { position: relative; z-index: 1; flex-shrink: 0; }
.hb-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hb-stat {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px; padding: 12px 14px; text-align: center;
}
.hb-stat-val { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: white; }
.hb-stat-lbl { font-size: 10px; color: rgba(255,255,255,.65); margin-top: 2px; }

/* ============================================================
   10. STAT CARDS
============================================================ */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 16px 24px 0; }
.stat-card {
  background: white; border: 1px solid var(--g100); border-radius: var(--r);
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  transition: all .2s; cursor: default;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-ico { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-ico svg { width: 18px; height: 18px; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.stat-ico.g { background: var(--g50);   } .stat-ico.g svg { stroke: var(--g500); }
.stat-ico.b { background: #eff6ff;      } .stat-ico.b svg { stroke: var(--blue); }
.stat-ico.a { background: #fffbeb;      } .stat-ico.a svg { stroke: var(--amber); }
.stat-ico.r { background: #fff1f2;      } .stat-ico.r svg { stroke: #f43f5e; }
.stat-val { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: var(--g800); line-height: 1; }
.stat-lbl { font-size: 11px; color: #999; margin-top: 3px; }
.stat-chg { font-size: 10.5px; margin-top: 4px; font-weight: 500; }
.stat-chg.up { color: var(--g500); }

/* ============================================================
   11. NEWS CARDS
============================================================ */
.news-section { padding: 16px 24px; }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.news-card {
  background: white; border: 1px solid var(--g100);
  border-radius: var(--r); overflow: hidden; cursor: pointer; transition: all .2s;
}
.news-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.nc-thumb {
  height: 110px; display: flex; align-items: center; justify-content: center; position: relative;
}
.nc-thumb::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 24px 24px;
}
.nc-thumb svg { width: 32px; height: 32px; stroke: rgba(255,255,255,.8); fill: none; stroke-width: 1.6; stroke-linecap: round; position: relative; z-index: 1; }
.nc-thumb.t1 { background: linear-gradient(135deg, var(--g700), var(--g400)); }
.nc-thumb.t2 { background: linear-gradient(135deg, #1e3a5f, #38bdf8); }
.nc-thumb.t3 { background: linear-gradient(135deg, #7c3a0f, #fbbf24); }
.nc-tag { position: absolute; top: 8px; left: 8px; font-size: 9.5px; font-weight: 700; padding: 3px 8px; border-radius: 20px; z-index: 1; }
.nc-tag.new { background: var(--g400); color: white; }
.nc-tag.imp { background: #f43f5e; color: white; }
.nc-body { padding: 12px 13px; }
.nc-title { font-size: 13px; font-weight: 600; color: #1a1a1a; line-height: 1.45; margin-bottom: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nc-meta  { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #aaa; }
.nc-meta svg { width: 11px; height: 11px; stroke: #ccc; fill: none; stroke-width: 1.8; stroke-linecap: round; }

/* ============================================================
   12. MOOC CARDS
============================================================ */
.mooc-filters {
  padding: 16px 24px 0;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.filter-tabs {
  display: flex; gap: 5px;
  background: var(--g50); padding: 3px; border-radius: 9px; border: 1px solid var(--g100);
}
.ftab {
  padding: 6px 13px; border-radius: 7px; font-size: 12px;
  cursor: pointer; color: #888; transition: all .15s; border: none; background: transparent; font-weight: 500;
}
.ftab.act { background: white; color: var(--g700); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.ftab:hover:not(.act) { color: var(--g600); }
.mooc-search {
  display: flex; align-items: center; gap: 7px;
  background: white; border: 1px solid var(--g100); border-radius: 8px; padding: 6px 12px; margin-left: auto;
}
.mooc-search svg   { width: 13px; height: 13px; stroke: var(--g400); fill: none; stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }
.mooc-search input { border: none; outline: none; background: transparent; font-size: 12.5px; width: 150px; }
.mooc-search input::placeholder { color: #bbb; }

.mooc-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  padding: 14px 24px 24px;
}
.mooc-card {
  background: white; border: 1px solid #eef5f1;
  border-radius: 14px; overflow: hidden;
  cursor: pointer; transition: all .22s; display: flex; flex-direction: column;
}
.mooc-card:hover { box-shadow: 0 6px 24px rgba(29,158,117,.14); transform: translateY(-2px); border-color: var(--g200); }

/* Card thumbnail */
.mc-thumb { height: 130px; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mc-thumb::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 28px 28px;
}
.mc-t1 { background: linear-gradient(135deg, #0d6e46, #3db882); }
.mc-t2 { background: linear-gradient(135deg, #1e3a5f, #38bdf8); }
.mc-t3 { background: linear-gradient(135deg, #7c3a0f, #fbbf24); }
.mc-t4 { background: linear-gradient(135deg, #7f1d3c, #f87171); }
.mc-t5 { background: linear-gradient(135deg, #3b1d7f, #a78bfa); }
.mc-t6 { background: linear-gradient(135deg, #1e1b6f, #818cf8); }
.mc-ico { position: relative; z-index: 1; width: 52px; height: 52px; border-radius: 14px; background: rgba(255,255,255,.15); border: 1.5px solid rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; }
.mc-ico svg { width: 26px; height: 26px; stroke: white; fill: none; stroke-width: 1.6; stroke-linecap: round; }
.mc-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 5px; z-index: 2; }
.mc-badge { font-size: 9.5px; font-weight: 700; padding: 3px 8px; border-radius: 20px; }
.mc-badge.new  { background: var(--g400); color: white; }
.mc-badge.hot  { background: #f43f5e;     color: white; }
.mc-badge.cert { background: rgba(255,255,255,.2); color: white; border: 1px solid rgba(255,255,255,.35); }
.mc-status { position: absolute; bottom: 10px; right: 10px; z-index: 2; }
.mc-enrolled {
  display: flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,.9); border-radius: 20px;
  padding: 3px 9px; font-size: 10px; font-weight: 700; color: var(--g600);
}
.mc-enrolled::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--g500); }
.mc-completed {
  display: flex; align-items: center; gap: 4px;
  background: var(--g500); border-radius: 20px;
  padding: 3px 9px; font-size: 10px; font-weight: 700; color: white;
}
.mc-completed svg { width: 10px; height: 10px; stroke: white; fill: none; stroke-width: 3; stroke-linecap: round; }

/* Card body */
.mc-body { padding: 13px 14px 12px; flex: 1; display: flex; flex-direction: column; }
.mc-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.mc-cat  { font-size: 10px; font-weight: 700; color: var(--g500); letter-spacing: .5px; text-transform: uppercase; }
.mc-lv   { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 20px; }
.mc-lv.basic { background: var(--g50);   color: var(--g600); }
.mc-lv.inter { background: #fffbeb;      color: #b45309; }
.mc-lv.adv   { background: #fff1f2;      color: #be123c; }
.mc-title { font-family: var(--font-head); font-size: 13.5px; font-weight: 600; color: #1a1a1a; line-height: 1.45; margin-bottom: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mc-inst  { font-size: 11.5px; color: #999; margin-bottom: 9px; display: flex; align-items: center; gap: 4px; }
.mc-inst svg { width: 11px; height: 11px; stroke: #bbb; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.mc-stats-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.mc-stat { display: flex; align-items: center; gap: 4px; font-size: 11px; color: #888; }
.mc-stat svg    { width: 11px; height: 11px; stroke: #bbb; fill: none; stroke-width: 1.8; stroke-linecap: round; flex-shrink: 0; }
.mc-stat strong { font-weight: 600; color: #555; }

/* Date badges */
.mc-dates { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.mc-date  { display: flex; align-items: center; gap: 4px; font-size: 10.5px; padding: 3px 9px; border-radius: 6px; font-weight: 500; }
.mc-date svg { width: 10px; height: 10px; fill: none; stroke-width: 2; stroke-linecap: round; }
.mc-date.open { background: var(--g50);   color: var(--g600); border: 1px solid var(--g100); }
.mc-date.open svg { stroke: var(--g500); }
.mc-date.close { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.mc-date.close svg { stroke: #f59e0b; }
.mc-date.soon  { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.mc-date.soon svg { stroke: #f43f5e; }
.mc-date.ended { background: #f5f5f5; color: #aaa;    border: 1px solid #e5e7eb; }
.mc-date.ended svg { stroke: #ccc; }

/* Progress in card */
.mc-prog { margin-bottom: 10px; }
.mc-prog-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.mc-prog-lbl  { font-size: 11px; color: #aaa; }
.mc-prog-pct  { font-size: 11px; font-weight: 700; color: var(--g600); }
.mc-prog-track { height: 5px; background: var(--g50); border-radius: 20px; overflow: hidden; }
.mc-prog-fill  { height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--g400), var(--g500)); }

/* Card footer */
.mc-footer { margin-top: auto; padding-top: 10px; border-top: 1px solid #f5faf7; }
.mc-footer-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mc-units { font-size: 11px; color: #aaa; display: flex; align-items: center; gap: 4px; }
.mc-units svg { width: 11px; height: 11px; stroke: #ccc; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.mc-enroll-btn { display: flex; align-items: center; gap: 5px; padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; transition: all .18s; border: none; }
.mc-enroll-btn svg { width: 12px; height: 12px; fill: none; stroke-width: 2.5; stroke-linecap: round; }
.mc-btn-open { background: var(--g500); color: white; }
.mc-btn-open:hover { background: var(--g600); }
.mc-btn-open svg { stroke: white; }
.mc-btn-cont { background: var(--g50); color: var(--g600); border: 1.5px solid var(--g200); }
.mc-btn-cont:hover { background: var(--g100); }
.mc-btn-cont svg { stroke: var(--g600); }
.mc-btn-done { background: white; color: var(--g700); border: 1.5px solid var(--g200); }
.mc-btn-done svg { stroke: var(--g500); }
.mc-btn-closed { background: #f5f5f5; color: #bbb; cursor: not-allowed; }
.mc-btn-closed svg { stroke: #ccc; }
.btn-bookmark { width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--g100); background: var(--g50); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .15s; }
.btn-bookmark:hover { background: var(--g100); }
.btn-bookmark svg { width: 13px; height: 13px; stroke: var(--g400); fill: none; stroke-width: 2; stroke-linecap: round; }
.btn-bookmark.saved svg { fill: var(--g400); }

/* ============================================================
   13. VIDEO LEARNING LAYOUT
============================================================ */
.video-learn-wrap { display: flex; flex: 1; overflow: hidden; }
.vl-left { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow-y: auto; }
.vl-left::-webkit-scrollbar { width: 4px; }
.vl-left::-webkit-scrollbar-thumb { background: var(--g100); border-radius: 4px; }

/* Player */
.player-box    { background: #0a0f0c; position: relative; width: 100%; }
.player-aspect { padding-bottom: 56.25%; position: relative; overflow: hidden; }
.fake-vid {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, #0f2319 0%, #0a1a10 50%, #051009 100%);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.fv-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
}
.fv-slide { width: 68%; max-width: 460px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); border-radius: 10px; padding: 22px 26px; position: relative; z-index: 1; }
.fv-slide-tag    { font-size: 9px; font-weight: 700; color: var(--g400); letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 10px; }
.fv-slide-title  { font-family: var(--font-head); font-size: 17px; font-weight: 600; color: rgba(255,255,255,.9); line-height: 1.4; margin-bottom: 12px; }
.fv-slide-bullets { display: flex; flex-direction: column; gap: 7px; }
.fv-slide-bullet  { display: flex; align-items: flex-start; gap: 7px; font-size: 12px; color: rgba(255,255,255,.6); line-height: 1.5; }
.fv-slide-bullet::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--g400); flex-shrink: 0; margin-top: 5px; }
.fv-overlabel { position: absolute; top: 12px; left: 14px; display: flex; align-items: center; gap: 8px; z-index: 2; }
.fv-live-badge { background: rgba(63,184,130,.25); border: 1px solid rgba(63,184,130,.4); color: #6dcba3; font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 20px; letter-spacing: .5px; }
.fv-pause {
  position: absolute; inset: 0; background: rgba(0,0,0,.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 10; opacity: 0; pointer-events: none; transition: opacity .3s;
}
.fv-pause.show { opacity: 1; }
.fv-pause-ico  { width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.12); border: 1.5px solid rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; }
.fv-pause-ico svg { width: 20px; height: 20px; fill: rgba(255,255,255,.6); }
.fv-chapter { position: absolute; bottom: 42px; left: 14px; color: rgba(255,255,255,.5); font-size: 12px; z-index: 2; }
.fv-chapter strong { color: rgba(255,255,255,.85); font-weight: 600; }
.fv-prog-wrap { position: absolute; bottom: 28px; left: 0; right: 0; padding: 0 12px; z-index: 2; cursor: pointer; }
.fv-prog-track { height: 4px; background: rgba(255,255,255,.2); border-radius: 20px; position: relative; }
.fv-prog-fill  { height: 100%; background: linear-gradient(90deg, var(--g400), var(--g300)); border-radius: 20px; position: relative; }
.fv-prog-fill::after { content: ''; position: absolute; right: -5px; top: -4px; width: 12px; height: 12px; background: white; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.fv-controls { position: absolute; bottom: 0; left: 0; right: 0; height: 30px; background: linear-gradient(0deg, rgba(0,0,0,.7), transparent); display: flex; align-items: center; padding: 0 12px; gap: 10px; z-index: 2; }
.fvc-btn  { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: .75; }
.fvc-btn:hover { opacity: 1; }
.fvc-btn svg { width: 13px; height: 13px; fill: white; }
.fvc-time  { font-size: 10px; color: rgba(255,255,255,.75); font-family: monospace; white-space: nowrap; }
.fvc-speed { font-size: 9.5px; font-weight: 700; color: rgba(255,255,255,.75); background: rgba(255,255,255,.12); padding: 2px 5px; border-radius: 3px; cursor: pointer; }

/* Video meta */
.vid-meta { padding: 14px 18px; background: white; border-bottom: 1px solid var(--g100); }
.vid-meta-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.vid-unit-tag { display: inline-flex; align-items: center; gap: 5px; background: var(--g50); border: 1px solid var(--g100); color: var(--g600); font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px; margin-bottom: 5px; }
.vid-unit-tag svg { width: 10px; height: 10px; stroke: var(--g500); fill: none; stroke-width: 2; stroke-linecap: round; }
.vid-title { font-family: var(--font-head); font-size: 15px; font-weight: 700; color: #1a1a1a; line-height: 1.3; }
.vid-sub   { font-size: 11.5px; color: #999; margin-top: 3px; }
.vid-actions { display: flex; gap: 6px; }
.vact { display: flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 8px; font-size: 11.5px; cursor: pointer; transition: all .15s; border: none; font-weight: 500; }
.vact svg { width: 12px; height: 12px; fill: none; stroke-width: 2; stroke-linecap: round; }
.vact-out { background: white; color: var(--g600); border: 1px solid var(--g200); }
.vact-out svg { stroke: var(--g600); }
.vact-g   { background: var(--g500); color: white; }
.vact-g svg { stroke: white; }

/* Video tabs */
.vid-tabs { display: flex; gap: 0; padding: 0 18px; background: white; }
.vtab { padding: 9px 14px; font-size: 12.5px; color: #aaa; cursor: pointer; border-bottom: 2px solid transparent; transition: all .18s; font-weight: 500; }
.vtab:hover { color: var(--g600); }
.vtab.act   { color: var(--g600); border-bottom-color: var(--g500); font-weight: 600; }
.vtab-content { padding: 14px 18px; background: white; flex: 1; }
.vdesc-head   { font-size: 11px; font-weight: 700; color: var(--g600); letter-spacing: .8px; text-transform: uppercase; margin-bottom: 7px; }
.vdesc-txt    { font-size: 13px; color: #444; line-height: 1.8; }
.vlearn-list  { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.vlearn-item  { display: flex; align-items: flex-start; gap: 7px; font-size: 13px; color: #444; line-height: 1.5; }
.vlearn-item::before { content: '✓'; color: var(--g500); font-size: 12px; margin-top: 2px; flex-shrink: 0; }
.res-list { display: flex; flex-direction: column; gap: 7px; }
.res-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--g100); border-radius: 9px; cursor: pointer; transition: all .15s; }
.res-item:hover { background: var(--g50); border-color: var(--g200); }
.res-ico { width: 32px; height: 32px; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.res-ico svg { width: 14px; height: 14px; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.res-ico.pdf { background: #fff1f2; } .res-ico.pdf svg { stroke: #f43f5e; }
.res-ico.url { background: #eff6ff; } .res-ico.url svg { stroke: var(--blue); }
.res-ico.doc { background: #fffbeb; } .res-ico.doc svg { stroke: var(--amber); }
.res-name { font-size: 12.5px; color: #333; font-weight: 500; flex: 1; }
.res-size { font-size: 10.5px; color: #bbb; }

/* Course tree panel */
.vl-right { width: 280px; flex-shrink: 0; background: white; border-left: 1px solid var(--g100); display: flex; flex-direction: column; overflow: hidden; }
.vr-head  { padding: 14px 14px 10px; border-bottom: 1px solid var(--g50); }
.vr-course-name { font-family: var(--font-head); font-size: 12.5px; font-weight: 700; color: var(--g800); margin-bottom: 2px; }
.vr-sub   { font-size: 10.5px; color: #aaa; }
.vr-prog-bar  { height: 3px; background: var(--g50); border-radius: 20px; margin-top: 8px; overflow: hidden; }
.vr-prog-fill { height: 100%; background: linear-gradient(90deg, var(--g400), var(--g500)); border-radius: 20px; }
.vr-prog-txt  { font-size: 10px; color: var(--g400); margin-top: 4px; }
.vr-now { margin: 8px 10px; background: rgba(63,184,130,.07); border: 1px solid rgba(63,184,130,.18); border-radius: 8px; padding: 8px 10px; display: flex; align-items: center; gap: 7px; }
.vr-now-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--g400); animation: pulseGreen 1.8s infinite; flex-shrink: 0; }
.vr-now-txt { font-size: 10.5px; color: var(--g700); font-weight: 600; line-height: 1.3; }
.vr-tree { flex: 1; overflow-y: auto; padding: 4px 0 12px; }
.vr-tree::-webkit-scrollbar { width: 3px; }
.vr-tree::-webkit-scrollbar-thumb { background: var(--g100); border-radius: 4px; }

/* Unit row */
.vru { margin-bottom: 1px; }
.vru-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; transition: background .15s; user-select: none; }
.vru-head:hover { background: var(--g50); }
.vru-check { width: 16px; height: 16px; border: 1.5px solid var(--g200); border-radius: 4px; background: white; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .18s; }
.vru-check.done { background: var(--g500); border-color: var(--g500); }
.vru-check svg  { display: none; width: 9px; height: 9px; stroke: white; fill: none; stroke-width: 3; stroke-linecap: round; }
.vru-check.done svg { display: block; }
.vru-info  { flex: 1; }
.vru-num   { font-size: 10px; font-weight: 700; color: var(--g400); letter-spacing: .4px; text-transform: uppercase; }
.vru-name  { font-size: 12px; color: #555; font-weight: 500; margin-top: 1px; }
.vru-head.curr .vru-name { color: var(--g700); font-weight: 700; }
.vru-cnt   { font-size: 10px; color: #bbb; white-space: nowrap; }
.vru-chevron { width: 14px; height: 14px; display: flex; align-items: center; justify-content: center; transition: transform .2s; }
.vru-chevron svg { width: 11px; height: 11px; stroke: #ccc; fill: none; stroke-width: 2; stroke-linecap: round; }
.vru-head.open .vru-chevron { transform: rotate(90deg); }
.vru-lessons { overflow: hidden; max-height: 0; transition: max-height .3s ease; }
.vru-lessons.open { max-height: 400px; }

/* Lesson row */
.vrl { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 36px; cursor: pointer; transition: background .15s; }
.vrl:hover { background: #fafffe; }
.vrl.curr  { background: linear-gradient(135deg, var(--g50), #f0fdf8); }
.vrl.curr .vrl-title { color: var(--g700); font-weight: 600; }
.vrl-ico   { width: 20px; height: 20px; border-radius: 5px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vrl-ico svg { width: 10px; height: 10px; fill: none; stroke-width: 2; stroke-linecap: round; }
.vrl-ico.done-v { background: rgba(63,184,130,.1); }  .vrl-ico.done-v svg { stroke: var(--g500); }
.vrl-ico.curr-v { background: rgba(63,184,130,.15); } .vrl-ico.curr-v svg { stroke: var(--g600); }
.vrl-ico.lock-v { background: #f5f5f5; }              .vrl-ico.lock-v svg { stroke: #ccc; }
.vrl-ico.norm-v { background: var(--g50); }           .vrl-ico.norm-v svg { stroke: var(--g400); }
.vrl-title { font-size: 11px; color: #666; flex: 1; }
.vrl-dur   { font-size: 10px; color: #ccc; }

/* Cert unlock strip */
.vr-cert { margin: 8px 12px 10px; background: linear-gradient(135deg, var(--g600), var(--g800)); border-radius: 9px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.vrc-ico  { width: 30px; height: 30px; border-radius: 7px; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vrc-ico svg { width: 15px; height: 15px; stroke: white; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.vrc-lbl  { font-size: 9px; color: rgba(255,255,255,.65); text-transform: uppercase; letter-spacing: .4px; }
.vrc-val  { font-size: 11px; color: white; font-weight: 600; margin-top: 1px; }

/* ============================================================
   14. QUIZ / EXAM PAGE
============================================================ */
.quiz-page-wrap { display: flex; flex-direction: column; gap: 0; padding: 20px 24px; max-width: 760px; margin: 0 auto; width: 100%; }

/* Quiz top bar */
.quiz-top-bar { background: white; border: 1px solid var(--g100); border-radius: 12px; padding: 14px 18px; display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.quiz-type-tag { display: inline-flex; align-items: center; gap: 5px; background: var(--g50); border: 1px solid var(--g100); color: var(--g600); font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; margin-bottom: 5px; }
.quiz-type-tag svg { width: 11px; height: 11px; stroke: var(--g500); fill: none; stroke-width: 2; stroke-linecap: round; }
.qtb-title { font-family: var(--font-head); font-size: 15px; font-weight: 700; color: var(--g800); }
.qtb-sub   { font-size: 11.5px; color: #999; margin-top: 2px; }

/* Timer ring */
.timer-ring { width: 54px; height: 54px; position: relative; flex-shrink: 0; }
.timer-ring svg { width: 54px; height: 54px; transform: rotate(-90deg); }
.tr-track { fill: none; stroke: var(--g100); stroke-width: 3.5; }
.tr-fill  { fill: none; stroke: var(--g400); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 138; transition: stroke-dashoffset .5s, stroke .5s; }
.tr-fill.warn   { stroke: var(--amber); }
.tr-fill.danger { stroke: #f43f5e; }
.timer-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 13px; font-weight: 700; color: var(--g700); }

/* Adaptive level bar */
.adaptive-bar { display: flex; align-items: center; gap: 8px; background: white; border: 1px solid var(--g100); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.adp-lbl    { font-size: 11px; color: #aaa; flex-shrink: 0; }
.adp-levels { display: flex; gap: 5px; flex: 1; }
.adp-lv-wrap { display: flex; flex-direction: column; flex: 1; }
.adp-lv  { flex: 1; height: 5px; border-radius: 20px; background: #f0f0f0; }
.adp-fill { height: 100%; border-radius: 20px; }
.adp-lv.done-lv .adp-fill { background: var(--g500); width: 100%; }
.adp-lv.act-lv  .adp-fill { background: var(--g400); width: 60%; }
.adp-lv.todo-lv .adp-fill { width: 0; }
.adp-lv-name { font-size: 9.5px; font-weight: 600; text-align: center; margin-top: 3px; }
.adp-lv.done-lv .adp-lv-name { color: var(--g600); }
.adp-lv.act-lv  .adp-lv-name { color: var(--g500); }
.adp-lv.todo-lv .adp-lv-name { color: #ccc; }
.adp-arrow { color: var(--g300); font-size: 13px; flex-shrink: 0; }
.adp-hint  { font-size: 11px; color: var(--g500); font-weight: 600; flex-shrink: 0; }

/* Question dots */
.q-dots-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.q-dots     { display: flex; gap: 5px; }
.qdot { width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; cursor: pointer; transition: all .15s; border: 1.5px solid transparent; }
.qdot.done { background: var(--g500); color: white; }
.qdot.curr { background: white; color: var(--g600); border-color: var(--g400); box-shadow: 0 0 0 3px rgba(63,184,130,.2); }
.qdot.skip { background: #fff8e1; color: #d97706; border-color: #fde68a; }
.qdot.todo { background: #f5f5f5; color: #bbb; border-color: #eee; }
.q-prog-info { margin-left: auto; text-align: right; }
.q-prog-frac { font-family: var(--font-head); font-size: 14px; font-weight: 700; color: var(--g700); }
.q-prog-lbl  { font-size: 10.5px; color: #aaa; }

/* Question card */
.q-card      { background: white; border: 1px solid var(--g100); border-radius: 12px; overflow: hidden; }
.q-card-head { background: linear-gradient(135deg, var(--g50), #f5fdf9); padding: 13px 18px; border-bottom: 1px solid var(--g100); display: flex; align-items: flex-start; gap: 12px; }
.q-num-badge { width: 30px; height: 30px; background: linear-gradient(135deg, var(--g400), var(--g600)); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; font-family: var(--font-head); font-size: 13px; font-weight: 700; flex-shrink: 0; }
.q-lv        { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; margin-top: 3px; }
.q-lv.lv1  { background: #eff6ff; color: #1d4ed8; }
.q-lv.lv2  { background: #fffbeb; color: #b45309; }
.q-lv.lv3  { background: #fff1f2; color: #be123c; }
.q-body  { padding: 18px 18px 14px; }
.q-text  { font-size: 14px; color: #1a1a1a; line-height: 1.7; margin-bottom: 14px; font-weight: 500; }
.q-image { border-radius: 10px; overflow: hidden; border: 1px solid var(--g100); margin-bottom: 12px; }

/* Text choices */
.choices { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.choice  {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; border: 1.5px solid var(--g100); border-radius: 10px;
  cursor: pointer; transition: all .18s; background: white; position: relative; overflow: hidden;
}
.choice::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; transition: background .18s; }
.choice:hover { border-color: var(--g300); background: var(--g50); }
.choice:hover::before { background: var(--g300); }
.choice:hover .ch-letter { background: var(--g100); color: var(--g700); }
.choice.sel    { border-color: var(--g400); background: linear-gradient(135deg, var(--g50), #f0fdf8); }
.choice.sel::before { background: var(--g500); }
.choice.sel .ch-letter { background: var(--g500); border-color: var(--g500); color: white; }
.choice.correct { border-color: #22c55e; background: #f0fdf4; }
.choice.correct::before { background: #22c55e; }
.choice.correct .ch-letter { background: #22c55e; border-color: #22c55e; color: white; }
.choice.wrong   { border-color: #f43f5e; background: #fff1f2; }
.choice.wrong::before { background: #f43f5e; }
.choice.wrong .ch-letter { background: #f43f5e; border-color: #f43f5e; color: white; }
.ch-letter { width: 28px; height: 28px; border-radius: 7px; background: var(--g50); border: 1.5px solid var(--g100); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--g600); flex-shrink: 0; transition: all .18s; }
.ch-txt    { font-size: 13px; color: #333; line-height: 1.45; flex: 1; }
.ch-ico    { flex-shrink: 0; opacity: 0; width: 16px; height: 16px; transition: opacity .18s; }
.choice.sel .ch-ico, .choice.correct .ch-ico, .choice.wrong .ch-ico { opacity: 1; }
.ch-ico svg { width: 16px; height: 16px; fill: none; stroke-width: 2.5; stroke-linecap: round; }
.choice.sel .ch-ico svg     { stroke: var(--g500); }
.choice.correct .ch-ico svg { stroke: #22c55e; }
.choice.wrong .ch-ico svg   { stroke: #f43f5e; }

/* Image choices 2x2 */
.choices-img { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.choice-img  {
  border: 2px solid var(--g100); border-radius: 10px;
  cursor: pointer; transition: all .2s; overflow: hidden; background: white;
}
.choice-img:hover    { border-color: var(--g300); box-shadow: 0 2px 8px rgba(29,158,117,.1); }
.choice-img.sel      { border-color: var(--g400); box-shadow: 0 0 0 3px rgba(63,184,130,.2); }
.choice-img.correct  { border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.choice-img.wrong    { border-color: #f43f5e; box-shadow: 0 0 0 3px rgba(244,63,94,.15); }
.ci-thumb  { height: 72px; display: flex; align-items: center; justify-content: center; position: relative; }
.ci-thumb svg { width: 26px; height: 26px; stroke: white; fill: none; stroke-width: 1.8; stroke-linecap: round; opacity: .85; }
.ci-thumb.a { background: linear-gradient(135deg, #a8e3c8, #6dcba3); }
.ci-thumb.b { background: linear-gradient(135deg, #bfdbfe, #93c5fd); }
.ci-thumb.c { background: linear-gradient(135deg, #fde68a, #fbbf24); }
.ci-thumb.d { background: linear-gradient(135deg, #fca5a5, #f87171); }
.ci-tick { position: absolute; top: 5px; right: 5px; width: 18px; height: 18px; border-radius: 50%; background: white; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.15); opacity: 0; transition: opacity .2s; }
.choice-img.sel .ci-tick, .choice-img.correct .ci-tick, .choice-img.wrong .ci-tick { opacity: 1; }
.choice-img.correct .ci-tick { background: #22c55e; color: white; }
.choice-img.wrong   .ci-tick { background: #f43f5e; color: white; }
.ci-label { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-top: 1px solid var(--g50); }
.ci-let   { width: 18px; height: 18px; border-radius: 4px; background: var(--g50); border: 1px solid var(--g100); display: flex; align-items: center; justify-content: center; font-size: 9.5px; font-weight: 700; color: var(--g600); flex-shrink: 0; transition: all .2s; }
.choice-img.sel .ci-let     { background: var(--g500); border-color: var(--g500); color: white; }
.choice-img.correct .ci-let { background: #22c55e;     border-color: #22c55e;     color: white; }
.choice-img.wrong   .ci-let { background: #f43f5e;     border-color: #f43f5e;     color: white; }
.ci-cap { font-size: 11px; color: #555; line-height: 1.3; }

/* Image choices row (4 in a row) */
.choices-img-row  { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.choice-img-sm    { border: 2px solid var(--g100); border-radius: 9px; cursor: pointer; transition: all .2s; overflow: hidden; background: white; }
.choice-img-sm:hover { border-color: var(--g300); }
.choice-img-sm.sel   { border-color: var(--g400); box-shadow: 0 0 0 2px rgba(63,184,130,.2); }
.ci-sm-thumb  { height: 72px; display: flex; align-items: center; justify-content: center; }
.ci-sm-label  { padding: 5px 8px; border-top: 1px solid var(--g50); font-size: 11px; color: #555; text-align: center; }
.ci-sm-letter { font-weight: 700; font-size: 10px; color: var(--g500); margin-right: 3px; }

/* Feedback */
.popup-feedback { border-radius: 9px; padding: 11px 14px; display: flex; align-items: flex-start; gap: 9px; margin-bottom: 4px; animation: alertIn .3s ease; }
.popup-feedback.correct { background: #f0fdf4; border: 1px solid #bbf7d0; }
.popup-feedback.wrong   { background: #fff1f2; border: 1px solid #fecdd3; }
.popup-feedback.hint    { background: #fffbeb; border: 1px solid #fde68a; }
.fb-ico-sm    { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.popup-feedback.correct .fb-ico-sm { background: #dcfce7; }
.popup-feedback.wrong   .fb-ico-sm { background: #ffe4e6; }
.popup-feedback.hint    .fb-ico-sm { background: #fef3c7; }
.fb-ico-sm svg { width: 13px; height: 13px; fill: none; stroke-width: 2.5; stroke-linecap: round; }
.popup-feedback.correct .fb-ico-sm svg { stroke: #22c55e; }
.popup-feedback.wrong   .fb-ico-sm svg { stroke: #f43f5e; }
.popup-feedback.hint    .fb-ico-sm svg { stroke: #f59e0b; }
.fb-t { font-size: 12.5px; font-weight: 700; margin-bottom: 2px; }
.popup-feedback.correct .fb-t { color: #15803d; }
.popup-feedback.wrong   .fb-t { color: #be123c; }
.popup-feedback.hint    .fb-t { color: #b45309; }
.fb-d { font-size: 12px; color: #555; line-height: 1.55; }

/* Question actions */
.q-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--g50); }
.btn-skip  { font-size: 12px; color: #bbb; cursor: pointer; display: flex; align-items: center; gap: 4px; background: none; border: none; }
.btn-skip:hover { color: #888; }
.btn-skip svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* ============================================================
   15. VIDEO POPUP QUIZ (5-minute check)
============================================================ */
.pre-popup-bar {
  position: fixed; top: var(--topbar-h); left: var(--sidebar-w); right: 0; z-index: 8000;
  background: linear-gradient(135deg, var(--g600), var(--g800));
  padding: 8px 16px; display: none; align-items: center; gap: 10px;
  animation: slideDown .4s cubic-bezier(.34,1.2,.64,1);
}
.pre-popup-bar.show { display: flex; }
.ppb-ico { width: 26px; height: 26px; border-radius: 6px; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ppb-ico svg { width: 13px; height: 13px; stroke: white; fill: none; stroke-width: 2; stroke-linecap: round; }
.ppb-txt  { flex: 1; font-size: 11.5px; color: white; font-weight: 500; }
.ppb-txt span { opacity: .7; }
.ppb-cnt  { font-family: var(--font-head); font-size: 13px; font-weight: 700; color: white; background: rgba(255,255,255,.15); padding: 3px 10px; border-radius: 20px; flex-shrink: 0; min-width: 36px; text-align: center; }

.quiz-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(5px);
  z-index: 9000; display: none; align-items: center; justify-content: center; padding: 20px;
}
.quiz-overlay.show { display: flex; }
.quiz-popup-card {
  width: 100%; max-width: 500px; background: white; border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.4);
  animation: popupBounce .4s cubic-bezier(.34,1.56,.64,1);
}
.qp-accent { height: 4px; background: linear-gradient(90deg, var(--g400), var(--g300), var(--g500)); }
.qp-head   { padding: 14px 18px; background: linear-gradient(135deg, var(--g50), #f5fdf9); border-bottom: 1px solid var(--g100); display: flex; align-items: center; gap: 12px; }
.qp-head-ico { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, var(--g400), var(--g600)); display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 4px 12px rgba(29,158,117,.3); }
.qp-head-ico svg { width: 18px; height: 18px; stroke: white; fill: none; stroke-width: 2; stroke-linecap: round; }
.qp-head-lbl   { font-size: 10px; font-weight: 700; color: var(--g500); letter-spacing: .8px; text-transform: uppercase; }
.qp-head-title { font-family: var(--font-head); font-size: 14px; font-weight: 700; color: var(--g800); margin-top: 1px; }
.qp-timer { display: flex; flex-direction: column; align-items: center; gap: 2px; flex-shrink: 0; }
.qp-ring  { width: 46px; height: 46px; position: relative; }
.qp-ring svg { width: 46px; height: 46px; transform: rotate(-90deg); }
.qpr-track { fill: none; stroke: var(--g100); stroke-width: 3.5; }
.qpr-fill  { fill: none; stroke: var(--g400); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 119; transition: stroke-dashoffset .5s, stroke .5s; }
.qp-body  { padding: 16px 18px; }
.qp-q-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.qp-q-pill { background: var(--g500); color: white; font-size: 10px; font-weight: 700; padding: 2px 9px; border-radius: 20px; }
.qp-lv-pill { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px; background: #fffbeb; color: #b45309; }
.qp-text  { font-size: 14px; color: #1a1a1a; line-height: 1.7; margin-bottom: 14px; font-weight: 500; }
.qp-actions { padding: 12px 18px 16px; border-top: 1px solid var(--g50); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qp-skip { font-size: 12px; color: #bbb; cursor: pointer; background: none; border: none; display: flex; align-items: center; gap: 4px; }

/* ============================================================
   16. DATA TABLE & REPORT
============================================================ */
.table-page-wrap { padding: 18px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.table-stats     { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.table-section   { background: white; border: 1px solid var(--g100); border-radius: 12px; overflow: hidden; }

.table-toolbar {
  padding: 13px 18px; border-bottom: 1px solid var(--g50);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.tt-left  { display: flex; align-items: center; gap: 10px; }
.tt-title { font-family: var(--font-head); font-size: 14px; font-weight: 700; color: var(--g800); }
.tt-count { font-size: 11px; background: var(--g50); color: var(--g600); padding: 2px 9px; border-radius: 20px; font-weight: 600; border: 1px solid var(--g100); }
.tt-right { display: flex; align-items: center; gap: 8px; }

.filter-tabs2 { display: flex; gap: 4px; background: var(--g50); padding: 3px; border-radius: 8px; }
.ftab2 { padding: 4px 11px; border-radius: 6px; font-size: 12px; cursor: pointer; color: #888; transition: all .15s; border: none; background: transparent; }
.ftab2.act { background: white; color: var(--g700); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tt-search { display: flex; align-items: center; gap: 6px; background: var(--g50); border: 1px solid var(--g100); border-radius: 7px; padding: 5px 10px; }
.tt-search svg { width: 13px; height: 13px; stroke: var(--g400); fill: none; stroke-width: 2; stroke-linecap: round; }
.tt-search input { border: none; outline: none; background: transparent; font-size: 12px; width: 130px; }
.tt-search input::placeholder { color: #bbb; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: var(--g50); }
.data-table thead th { padding: 10px 16px; font-size: 11px; font-weight: 700; color: var(--g600); letter-spacing: .6px; text-transform: uppercase; text-align: left; border-bottom: 1px solid var(--g100); white-space: nowrap; user-select: none; }
.data-table thead th:first-child { padding-left: 18px; }
.data-table thead th:last-child  { padding-right: 18px; text-align: center; }
.data-table thead th.sortable { cursor: pointer; }
.data-table thead th.sortable:hover { color: var(--g800); }
.data-table tbody tr { border-bottom: 1px solid #f5faf7; transition: background .15s; cursor: pointer; }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: #fafffe; }
.data-table tbody td { padding: 11px 16px; font-size: 13px; color: #444; vertical-align: middle; }
.data-table tbody td:first-child { padding-left: 18px; }
.data-table tbody td:last-child  { padding-right: 18px; text-align: center; }

/* User cell */
.user-cell    { display: flex; align-items: center; gap: 10px; }
.user-cell-av { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: white; flex-shrink: 0; }
.av-g { background: linear-gradient(135deg, var(--g400), var(--g600)); }
.av-b { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.av-t { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.av-a { background: linear-gradient(135deg, #fbbf24, #d97706); }
.av-r { background: linear-gradient(135deg, #fb7185, #e11d48); }
.av-p { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.uc-name { font-size: 13px; font-weight: 600; color: #333; }
.uc-id   { font-size: 11px; color: #aaa; }

/* Status badges */
.badge        { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.badge-suc  { background: var(--g50);   color: var(--g600); border: 1px solid var(--g100); }
.badge-suc::before  { background: var(--g500); }
.badge-warn { background: #fffbeb;      color: #b45309;     border: 1px solid #fde68a; }
.badge-warn::before { background: var(--amber); }
.badge-info { background: #eff6ff;      color: #1d4ed8;     border: 1px solid #bfdbfe; }
.badge-info::before { background: var(--blue); }
.badge-gray { background: #f8f8f8;      color: #777;        border: 1px solid #e5e7eb; }
.badge-gray::before { background: #9ca3af; }
.badge-danger { background: #fff1f2;    color: #be123c;     border: 1px solid #fecdd3; }
.badge-danger::before { background: #f43f5e; }

/* Progress bar in table */
.prog-bar-cell { display: flex; align-items: center; gap: 8px; }
.pb-track { flex: 1; height: 5px; background: #f0f0f0; border-radius: 20px; overflow: hidden; }
.pb-fill  { height: 100%; border-radius: 20px; }
.pb-full  { background: linear-gradient(90deg, var(--g400), var(--g500)); }
.pb-high  { background: linear-gradient(90deg, #60a5fa, var(--g400)); }
.pb-mid   { background: linear-gradient(90deg, #fbbf24, #f97316); }
.pb-low   { background: linear-gradient(90deg, #fca5a5, #f87171); }
.pb-pct   { font-size: 11.5px; font-weight: 600; min-width: 30px; text-align: right; }
.pb-pct.full { color: var(--g600); }
.pb-pct.high { color: #2563eb; }
.pb-pct.mid  { color: #d97706; }
.pb-pct.low  { color: #dc2626; }

/* Score cell */
.score-cell { text-align: center; }
.score-val  { font-family: var(--font-head); font-size: 14px; font-weight: 700; color: var(--g700); }
.score-max  { font-size: 10.5px; color: #bbb; }
.date-cell  { font-size: 12px; color: #888; }
.date-main  { color: #555; font-weight: 500; }

/* Row actions */
.row-actions { display: flex; align-items: center; justify-content: center; gap: 4px; }
.row-act  { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .15s; opacity: .4; border: none; background: transparent; }
.row-act:hover { opacity: 1; }
.row-act.view  { background: var(--g50); }  .row-act.view:hover  { background: var(--g100); }
.row-act.view svg { stroke: var(--g600); }
.row-act.edit  { background: #eff6ff; }     .row-act.edit:hover  { background: #dbeafe; }
.row-act.edit svg { stroke: #2563eb; }
.row-act.del   { background: #fff1f2; }     .row-act.del:hover   { background: #ffe4e6; }
.row-act.del svg { stroke: #e11d48; }
.row-act svg { width: 13px; height: 13px; fill: none; stroke-width: 2; stroke-linecap: round; }

/* Table footer / pagination */
.table-footer { padding: 12px 18px; border-top: 1px solid var(--g50); display: flex; align-items: center; justify-content: space-between; }
.tf-info      { font-size: 12px; color: #999; }
.tf-info strong { color: #555; font-weight: 600; }
.pagination   { display: flex; align-items: center; gap: 4px; }
.pg-btn       { width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--g100); background: white; display: flex; align-items: center; justify-content: center; font-size: 12px; cursor: pointer; transition: all .15s; color: #666; font-weight: 500; }
.pg-btn:hover  { background: var(--g50); border-color: var(--g200); color: var(--g700); }
.pg-btn.active { background: var(--g500); border-color: var(--g500); color: white; font-weight: 700; }
.pg-btn.nav svg { width: 12px; height: 12px; stroke: #888; fill: none; stroke-width: 2; stroke-linecap: round; }
.per-page-sel  { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #999; }
.per-page-sel select { border: 1px solid var(--g100); border-radius: 7px; background: white; font-size: 12px; color: #555; padding: 4px 8px; outline: none; cursor: pointer; }

/* ============================================================
   17. ADMIN PANEL
============================================================ */

/* Admin sidebar (dark) */
.admin-sidebar {
  width: 200px; background: #0d1f17; flex-shrink: 0;
  display: flex; flex-direction: column; overflow: hidden; position: relative;
}
.admin-sidebar::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--g400), var(--g300), var(--g500)); }
.asb-logo { padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.06); }
.asb-logo-row { display: flex; align-items: center; gap: 9px; }
.asb-logo-ico { width: 32px; height: 32px; background: linear-gradient(135deg, var(--g400), var(--g600)); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.asb-logo-ico svg { width: 16px; height: 16px; stroke: white; fill: none; stroke-width: 2; stroke-linecap: round; }
.asb-name { font-family: var(--font-head); font-size: 13px; font-weight: 700; color: white; }
.asb-sub  { font-size: 9px; color: var(--g400); letter-spacing: .6px; text-transform: uppercase; margin-top: 1px; }
.asb-nav  { padding: 8px 8px 4px; flex: 1; }
.asb-lbl  { font-size: 9px; font-weight: 700; color: rgba(255,255,255,.25); letter-spacing: 1px; text-transform: uppercase; padding: 6px 8px 4px; }

.ami { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; cursor: pointer; transition: all .15s; margin-bottom: 1px; }
.ami:hover { background: rgba(255,255,255,.06); }
.ami.act   { background: rgba(63,184,130,.15); border: 1px solid rgba(63,184,130,.2); }
.ami.act .ami-ico { background: linear-gradient(135deg, var(--g400), var(--g600)); box-shadow: 0 2px 6px rgba(63,184,130,.4); }
.ami.act .ami-ico svg { stroke: white !important; }
.ami.act .ami-txt  { color: var(--g300); font-weight: 600; }
.ami-ico { width: 26px; height: 26px; border-radius: 7px; background: rgba(255,255,255,.06); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .15s; }
.ami-ico svg { width: 13px; height: 13px; stroke: rgba(255,255,255,.35); fill: none; stroke-width: 1.8; stroke-linecap: round; }
.ami-txt  { font-size: 12px; color: rgba(255,255,255,.45); flex: 1; }
.ami-cnt  { font-size: 9px; font-weight: 700; background: var(--g600); color: white; padding: 1px 5px; border-radius: 20px; }
.asb-div  { height: 1px; background: rgba(255,255,255,.06); margin: 5px 8px; }
.asb-user { padding: 10px 12px 14px; border-top: 1px solid rgba(255,255,255,.06); display: flex; align-items: center; gap: 8px; }
.asb-av   { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--g400), var(--g600)); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: white; flex-shrink: 0; }
.asb-uname { font-size: 11px; color: rgba(255,255,255,.6); font-weight: 500; }
.asb-urole { font-size: 9.5px; color: rgba(255,255,255,.25); }

/* Admin form cards */
.form-card    { background: white; border: 1px solid var(--g100); border-radius: 12px; overflow: hidden; }
.fc-head      { padding: 12px 16px; border-bottom: 1px solid var(--g50); display: flex; align-items: center; gap: 9px; }
.fc-head-ico  { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fc-head-ico svg { width: 13px; height: 13px; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.fc-head-ico.g { background: var(--g50); }  .fc-head-ico.g svg { stroke: var(--g500); }
.fc-head-ico.b { background: #eff6ff; }     .fc-head-ico.b svg { stroke: var(--blue); }
.fc-head-ico.a { background: #fffbeb; }     .fc-head-ico.a svg { stroke: var(--amber); }
.fc-head-ico.r { background: #fff1f2; }     .fc-head-ico.r svg { stroke: #f43f5e; }
.fc-head-title { font-family: var(--font-head); font-size: 13px; font-weight: 700; color: #1a1a1a; flex: 1; }
.fc-body       { padding: 14px 16px; }

/* Unit builder */
.unit-list { display: flex; flex-direction: column; gap: 8px; }
.unit-row  { border: 1px solid var(--g100); border-radius: 10px; overflow: hidden; background: white; transition: box-shadow .15s; }
.unit-row:hover { box-shadow: 0 2px 10px rgba(29,158,117,.08); }
.unit-row.dragging { opacity: .5; box-shadow: 0 8px 24px rgba(29,158,117,.2); }
.unit-head { display: flex; align-items: center; gap: 9px; padding: 10px 12px; cursor: pointer; user-select: none; transition: background .15s; }
.unit-head:hover  { background: var(--g50); }
.unit-head.open   { background: var(--g50); }
.drag-handle { display: flex; flex-direction: column; gap: 2px; cursor: grab; padding: 2px; flex-shrink: 0; }
.drag-handle span { display: block; width: 14px; height: 2px; background: var(--g200); border-radius: 2px; }
.drag-handle:hover span { background: var(--g400); }
.unit-num { width: 24px; height: 24px; border-radius: 6px; background: linear-gradient(135deg, var(--g400), var(--g600)); color: white; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.unit-name-input { flex: 1; border: none; outline: none; font-family: var(--font-head); font-size: 13px; font-weight: 600; color: #1a1a1a; background: transparent; cursor: pointer; }
.unit-name-input:focus { background: white; border-bottom: 2px solid var(--g400); cursor: text; }
.unit-meta-row { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.umeta { font-size: 10px; color: #bbb; display: flex; align-items: center; gap: 3px; }
.umeta svg { width: 10px; height: 10px; stroke: #ccc; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.uchevron { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; transition: transform .2s; }
.uchevron svg { width: 12px; height: 12px; stroke: #ccc; fill: none; stroke-width: 2; stroke-linecap: round; }
.unit-head.open .uchevron { transform: rotate(90deg); }
.unit-content { overflow: hidden; max-height: 0; transition: max-height .3s ease; border-top: 0 solid var(--g100); }
.unit-content.open { max-height: 600px; border-top: 1px solid var(--g50); }
.unit-inner { padding: 10px 12px 12px; }

/* Media items */
.media-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.media-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; background: var(--g50); border: 1px solid var(--g100); border-radius: 8px; transition: all .15s; }
.media-item:hover { background: var(--g100); border-color: var(--g200); }
.mi-ico { width: 26px; height: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mi-ico svg { width: 12px; height: 12px; fill: none; stroke-width: 2; stroke-linecap: round; }
.mi-ico.vid  { background: #e8f5e9; } .mi-ico.vid  svg { stroke: var(--g500); }
.mi-ico.pdf  { background: #fff1f2; } .mi-ico.pdf  svg { stroke: #f43f5e; }
.mi-ico.url  { background: #eff6ff; } .mi-ico.url  svg { stroke: var(--blue); }
.mi-ico.quiz { background: #fffbeb; } .mi-ico.quiz svg { stroke: var(--amber); }
.mi-name     { flex: 1; font-size: 12px; color: #444; font-weight: 500; }
.mi-type-tag { font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.mi-type-tag.v { background: #e8f5e9; color: var(--g700); }
.mi-type-tag.p { background: #fff1f2; color: #be123c; }
.mi-type-tag.u { background: #eff6ff; color: #1d4ed8; }
.mi-type-tag.q { background: #fffbeb; color: #b45309; }
.mi-del { width: 22px; height: 22px; border-radius: 5px; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: .3; transition: opacity .15s; border: none; background: transparent; }
.mi-del:hover { opacity: 1; background: #fff1f2; }
.mi-del svg { width: 11px; height: 11px; stroke: #f43f5e; fill: none; stroke-width: 2.5; stroke-linecap: round; }

/* Add media buttons */
.add-media-row { display: flex; gap: 6px; flex-wrap: wrap; }
.add-media-btn { display: flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 7px; font-size: 11.5px; font-weight: 600; cursor: pointer; transition: all .15s; border: none; }
.add-media-btn svg { width: 11px; height: 11px; fill: none; stroke-width: 2.5; stroke-linecap: round; }
.amb-vid  { background: #e8f5e9; color: var(--g700); } .amb-vid:hover  { background: #c8e6c9; } .amb-vid  svg { stroke: var(--g600); }
.amb-pdf  { background: #fff1f2; color: #be123c;     } .amb-pdf:hover  { background: #ffe4e6; } .amb-pdf  svg { stroke: #f43f5e; }
.amb-url  { background: #eff6ff; color: #1d4ed8;     } .amb-url:hover  { background: #dbeafe; } .amb-url  svg { stroke: var(--blue); }
.amb-quiz { background: #fffbeb; color: #b45309;     } .amb-quiz:hover { background: #fef3c7; } .amb-quiz svg { stroke: var(--amber); }

/* Quiz toggle section */
.quiz-toggle-section { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 9px 12px; margin-top: 8px; }
.quiz-toggle-row  { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.quiz-toggle-lbl  { font-size: 11.5px; font-weight: 700; color: #92400e; }
.quiz-toggle-sub  { font-size: 10.5px; color: #b45309; margin-top: 1px; }

/* Add unit button */
.add-unit-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px; border: 2px dashed var(--g200); border-radius: 10px;
  cursor: pointer; transition: all .18s; color: var(--g500); font-size: 12.5px; font-weight: 600; background: var(--g50);
}
.add-unit-btn:hover { border-color: var(--g400); background: var(--g100); color: var(--g700); }
.add-unit-btn svg  { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; }

/* Status selector */
.status-opts { display: flex; gap: 6px; }
.sopt { flex: 1; padding: 7px 6px; border-radius: 8px; border: 1.5px solid #e8e8e8; text-align: center; cursor: pointer; transition: all .15s; font-size: 11px; font-weight: 600; color: #aaa; }
.sopt:hover            { border-color: var(--g200); color: var(--g600); }
.sopt.act-draft        { border-color: var(--amber); background: #fffbeb; color: #b45309; }
.sopt.act-pub          { border-color: var(--g400);  background: var(--g50); color: var(--g600); }
.sopt.act-arch         { border-color: #e5e7eb;      background: #f5f5f5; color: #888; }

/* Color swatches */
.color-row    { display: flex; gap: 7px; flex-wrap: wrap; }
.color-swatch { width: 28px; height: 28px; border-radius: 7px; cursor: pointer; transition: all .15s; border: 2px solid transparent; position: relative; }
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.act::after { content: ''; position: absolute; inset: -4px; border-radius: 9px; border: 2px solid var(--g400); }

/* Save bar */
.save-bar { background: white; border-top: 1px solid var(--g100); padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; }
.save-status { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #888; }
.save-dot    { width: 8px; height: 8px; border-radius: 50%; }
.save-dot.saved   { background: var(--g400); }
.save-dot.unsaved { background: var(--amber); animation: pulse 2s infinite; }
.save-actions { display: flex; gap: 8px; }

/* ============================================================
   18. CERTIFICATE
============================================================ */
.cert-doc {
  width: 100%; aspect-ratio: 1.414 / 1;
  position: relative; overflow: hidden; background: white;
  box-shadow: 0 16px 48px rgba(0,0,0,.22); border-radius: 3px;
}

/* Bands */
.cert-topband, .cert-botband { position: absolute; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--g700), var(--g500), var(--g400), var(--g500), var(--g700)); z-index: 5; }
.cert-topband { top: 0; } .cert-botband { bottom: 0; }

/* Background */
.cert-bg-doc { position: absolute; inset: 0; }
.cert-bg-doc::before { content: ''; position: absolute; inset: 0; background-image: repeating-linear-gradient(45deg, rgba(29,158,117,.02) 0px, rgba(29,158,117,.02) 1px, transparent 1px, transparent 28px); }
.cert-bg-doc::after  { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(255,255,255,.95) 0%, rgba(240,250,245,.6) 60%, transparent 100%); }

/* Frame */
.cert-frame-o { position: absolute; inset: 8px;  border: 1.5px solid var(--gold); border-radius: 1px; pointer-events: none; z-index: 10; }
.cert-frame-i { position: absolute; inset: 14px; border: 0.5px solid rgba(201,168,76,.3); pointer-events: none; z-index: 10; }

/* Side accents */
.cert-la { position: absolute; left: 0;  top: 0; bottom: 0; width: 38px; background: linear-gradient(180deg, var(--g800), var(--g600), var(--g800)); z-index: 4; }
.cert-ra { position: absolute; right: 0; top: 0; bottom: 0; width: 38px; background: linear-gradient(180deg, var(--g800), var(--g600), var(--g800)); z-index: 4; }

/* Corner ornaments */
.cert-corner { position: absolute; width: 30px; height: 30px; z-index: 11; }
.cert-corner.tl { top: 5px;    left: 5px;  }
.cert-corner.tr { top: 5px;    right: 5px; transform: scaleX(-1); }
.cert-corner.bl { bottom: 5px; left: 5px;  transform: scaleY(-1); }
.cert-corner.br { bottom: 5px; right: 5px; transform: scale(-1); }
.cert-corner svg { width: 30px; height: 30px; }

/* Content */
.cert-cnt {
  position: absolute; inset: 0; padding: 22px 54px 18px;
  display: flex; flex-direction: column; align-items: center; z-index: 6;
}
.cert-org-row { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.cert-logo-b  { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--g400), var(--g700)); display: flex; align-items: center; justify-content: center; }
.cert-logo-b svg { width: 16px; height: 16px; stroke: white; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.cert-org-nm  { font-family: var(--font-head); font-size: 11.5px; font-weight: 700; color: var(--g800); }
.cert-org-sub { font-size: 8.5px; color: var(--g500); letter-spacing: .5px; text-transform: uppercase; margin-top: 1px; }

/* Gold dividers */
.cert-div-gold { width: 100%; height: 1px; margin: 5px 0; background: linear-gradient(90deg, transparent, var(--gold), var(--gold2), var(--gold), transparent); }
.cert-div-sm   { width: 60%;  height: 1px; margin: 3px 0; background: linear-gradient(90deg, transparent, rgba(201,168,76,.35), transparent); }

/* Typography */
.cert-of-lbl   { font-size: 8.5px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: var(--g500); margin: 4px 0 2px; }
.cert-hdg      { font-family: var(--font-head); font-size: 24px; font-weight: 700; color: var(--g800); letter-spacing: .5px; text-align: center; margin-bottom: 3px; }
.cert-hdg-en   { font-size: 9px; color: var(--g500); letter-spacing: .4px; margin-bottom: 7px; }
.cert-presn    { font-size: 9px; color: #999; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 3px; }
.cert-name-doc { font-family: var(--font-serif); font-style: italic; font-size: 26px; font-weight: 600; color: var(--g700); text-align: center; line-height: 1.2; margin-bottom: 2px; }
.cert-name-line { width: 220px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); margin-bottom: 7px; }
.cert-comp-row { display: flex; align-items: center; gap: 8px; font-size: 9px; color: #999; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.cert-comp-row::before, .cert-comp-row::after { content: ''; flex: 1; height: .5px; background: var(--g100); }
.cert-course-doc { font-family: var(--font-head); font-size: 11.5px; font-weight: 700; color: #1a1a1a; text-align: center; line-height: 1.5; margin-bottom: 2px; }
.cert-course-en  { font-size: 8px; color: #aaa; letter-spacing: .4px; margin-bottom: 8px; text-align: center; }

/* Stats */
.cert-stats-doc { display: flex; align-items: center; gap: 0; margin-bottom: 10px; }
.csd { display: flex; flex-direction: column; align-items: center; padding: 0 14px; }
.csd + .csd { border-left: 1px solid var(--g100); }
.csd-val { font-family: var(--font-head); font-size: 14px; font-weight: 700; color: var(--g600); }
.csd-lbl { font-size: 8px; color: #aaa; letter-spacing: .5px; text-transform: uppercase; margin-top: 1px; }

/* Signatures */
.cert-sigs { display: flex; gap: 24px; width: 100%; justify-content: center; margin-top: auto; }
.cert-sig  { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sig-svg   { width: 72px; height: 18px; margin-bottom: 2px; }
.sig-line  { width: 72px; height: 1px; background: linear-gradient(90deg, transparent, var(--g300), transparent); margin-bottom: 3px; }
.sig-name  { font-size: 8.5px; font-weight: 700; color: #333; text-align: center; }
.sig-pos   { font-size: 7.5px; color: #aaa; }

/* Seal */
.cert-seal { position: absolute; bottom: 34px; right: 54px; width: 60px; height: 60px; z-index: 8; }
.seal-o    { width: 60px; height: 60px; border-radius: 50%; border: 1.5px solid var(--gold); display: flex; align-items: center; justify-content: center; background: white; }
.seal-in   { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--g700), var(--g500)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.seal-in svg { width: 16px; height: 16px; stroke: white; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.seal-in span { font-size: 5.5px; font-weight: 700; color: rgba(255,255,255,.8); letter-spacing: .4px; text-transform: uppercase; }

/* Bottom row */
.cert-bot-row { position: absolute; bottom: 12px; left: 50px; right: 50px; display: flex; align-items: center; justify-content: space-between; z-index: 8; }
.cert-id-b .cert-id-lbl { font-size: 7px; font-weight: 700; color: var(--g500); letter-spacing: .6px; text-transform: uppercase; }
.cert-id-b .cert-id-val { font-family: monospace; font-size: 8px; color: #666; letter-spacing: .4px; }
.cert-verify-b  { display: flex; align-items: center; gap: 4px; background: var(--g50); border: 1px solid var(--g100); border-radius: 20px; padding: 2px 7px; margin-top: 2px; }
.cert-verify-b svg  { width: 9px; height: 9px; stroke: var(--g500); fill: none; stroke-width: 2.5; stroke-linecap: round; }
.cert-verify-b span { font-size: 6.5px; font-weight: 700; color: var(--g600); }

/* QR Code */
.qr-box { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; overflow: hidden; border: 1px solid var(--g100); border-radius: 4px; padding: 4px; background: white; }
.qr-box .q     { width: 100%; aspect-ratio: 1; }
.qr-box .q.b   { background: #1a1a1a; }
.qr-box .q.w   { background: white; }

/* ============================================================
   19. TOAST NOTIFICATIONS
============================================================ */
.toast-wrap {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 11px; background: white;
  box-shadow: 0 8px 24px rgba(0,0,0,.15); border: 1px solid var(--g100);
  min-width: 260px; max-width: 340px; pointer-events: all;
  animation: toastIn .35s cubic-bezier(.34,1.2,.64,1);
}
.toast.out { animation: toastOut .25s ease forwards; }
.toast-ico { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.toast-ico svg { width: 13px; height: 13px; fill: none; stroke-width: 2.5; stroke-linecap: round; }
.toast.suc .toast-ico { background: #dcfce7; } .toast.suc .toast-ico svg { stroke: #22c55e; }
.toast.err .toast-ico { background: #ffe4e6; } .toast.err .toast-ico svg { stroke: #f43f5e; }
.toast.info .toast-ico { background: #eff6ff; } .toast.info .toast-ico svg { stroke: var(--blue); }
.toast-msg { font-size: 13px; font-weight: 600; color: #222; flex: 1; }
.toast-sub { font-size: 11px; color: #888; margin-top: 1px; }

/* ============================================================
   20. SIDE PANEL (detail slide-in)
============================================================ */
.detail-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); z-index: 50; display: flex; justify-content: flex-end; animation: bdIn .25s ease; }
.detail-panel    { width: 400px; height: 100%; background: white; overflow-y: auto; animation: panelIn .3s cubic-bezier(.34,1.1,.64,1); display: flex; flex-direction: column; }
.detail-panel::-webkit-scrollbar { width: 4px; }
.detail-panel::-webkit-scrollbar-thumb { background: var(--g100); border-radius: 4px; }

/* ============================================================
   21. SCROLLBARS
============================================================ */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--g100); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--g200); }

/* ============================================================
   22. ANIMATIONS & KEYFRAMES
============================================================ */
@keyframes spin         { to { transform: rotate(360deg); } }
@keyframes pulse        { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes pulseGreen   { 0%,100% { box-shadow: 0 0 0 0 rgba(29,158,117,.5); } 50% { box-shadow: 0 0 0 5px rgba(29,158,117,0); } }
@keyframes alertIn      { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown    { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes popupBounce  { from { opacity: 0; transform: scale(.88) translateY(24px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes toastIn      { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut     { to { opacity: 0; transform: translateX(40px); } }
@keyframes panelIn      { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes bdIn         { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn        { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes loadBar      { from { width: 0; } to { width: 100%; } }
@keyframes fadeIn       { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   23. RESPONSIVE UTILITIES
============================================================ */
.flex-center   { display: flex; align-items: center; justify-content: center; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.flex-col      { display: flex; flex-direction: column; }
.flex-1        { flex: 1; min-width: 0; }
.gap-4  { gap: 4px; }  .gap-6  { gap: 6px; }  .gap-8  { gap: 8px; }
.gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-4   { margin-top: 4px; }  .mt-8  { margin-top: 8px; }
.mt-12  { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mb-4   { margin-bottom: 4px; }  .mb-8  { margin-bottom: 8px; }
.mb-12  { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.p-12   { padding: 12px; }  .p-16  { padding: 16px; }  .p-20  { padding: 20px; }
.text-sm   { font-size: 11px; }  .text-base { font-size: 13px; }
.text-head { font-family: var(--font-head); }
.text-muted { color: #999; }
.text-green { color: var(--g600); }
.text-center { text-align: center; }
.w-full     { width: 100%; }
.rounded-full { border-radius: 9999px; }
