/* ============================================================
   LearnFlow LMS v2 — Clean Light Palette
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --white:       #ffffff;
  --gray-50:     #f9fafb;
  --gray-100:    #f3f4f6;
  --gray-200:    #e5e7eb;
  --gray-300:    #d1d5db;
  --gray-400:    #9ca3af;
  --gray-500:    #6b7280;
  --gray-600:    #4b5563;
  --gray-700:    #374151;
  --gray-800:    #1f2937;
  --gray-900:    #111827;

  --indigo-50:   #eef2ff;
  --indigo-100:  #e0e7ff;
  --indigo-200:  #c7d2fe;
  --indigo-400:  #818cf8;
  --indigo-500:  #6366f1;
  --indigo-600:  #4f46e5;
  --indigo-700:  #4338ca;

  --green-50:    #f0fdf4;
  --green-100:   #dcfce7;
  --green-500:   #22c55e;
  --green-600:   #16a34a;
  --green-700:   #15803d;

  --amber-50:    #fffbeb;
  --amber-100:   #fef3c7;
  --amber-400:   #fbbf24;
  --amber-500:   #f59e0b;
  --amber-600:   #d97706;

  --red-50:      #fef2f2;
  --red-100:     #fee2e2;
  --red-400:     #f87171;
  --red-500:     #ef4444;
  --red-600:     #dc2626;

  --blue-50:     #eff6ff;
  --blue-500:    #3b82f6;

  --shadow-sm:  0 1px 2px rgba(0,0,0,.06);
  --shadow:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:  0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.04);

  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ======================== TOP NAV ======================== */
.topnav {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 56px;
  background: var(--white); border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; color: var(--indigo-600); text-decoration: none; }
.brand i { font-size: 20px; }
.topnav-links { display: flex; align-items: center; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--gray-500); font-size: 13px; font-weight: 500;
  transition: all .15s;
}
.nav-link:hover { background: var(--gray-100); color: var(--gray-800); }
.nav-link.active { background: var(--indigo-50); color: var(--indigo-600); font-weight: 600; }
.topnav-user { display: flex; align-items: center; gap: 8px; }
.user-name-sm { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.nav-logout { color: var(--gray-400); text-decoration: none; padding: 6px; border-radius: var(--radius-sm); transition: all .15s; }
.nav-logout:hover { color: var(--red-500); background: var(--red-50); }

/* ======================== AUTH ======================== */
.auth-body { background: linear-gradient(135deg, var(--indigo-50) 0%, var(--white) 60%); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-wrap { width: 100%; max-width: 420px; padding: 20px; }
.auth-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-xl); padding: 36px; box-shadow: var(--shadow-lg); }
.auth-logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; color: var(--indigo-600); margin-bottom: 24px; }
.auth-logo i { font-size: 28px; }
.auth-title { font-size: 24px; font-weight: 800; color: var(--gray-900); margin-bottom: 4px; }
.auth-sub { font-size: 14px; color: var(--gray-500); margin-bottom: 24px; }
.input-icon-wrap { position: relative; }
.input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-400); font-size: 14px; pointer-events: none; }
.input-with-icon { padding-left: 36px !important; }
.btn-block { width: 100%; justify-content: center; padding: 11px !important; font-size: 14px !important; }
.auth-demo-creds { margin-top: 24px; padding: 14px; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius); }
.demo-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-400); margin-bottom: 8px; }
.demo-row { font-size: 12px; color: var(--gray-600); margin-bottom: 4px; }
.demo-row span { font-weight: 600; color: var(--gray-700); }

/* ======================== BUTTONS ======================== */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; background: var(--indigo-500); color: var(--white);
  border: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: all .2s; white-space: nowrap;
}
.btn-primary:hover { background: var(--indigo-600); box-shadow: 0 2px 8px rgba(99,102,241,.3); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; background: var(--white); color: var(--gray-600);
  border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; transition: all .2s;
}
.btn-ghost:hover { border-color: var(--gray-300); color: var(--gray-800); background: var(--gray-50); }
.btn-sm { padding: 5px 10px !important; font-size: 12px !important; }
.btn-lg { padding: 12px 28px !important; font-size: 15px !important; }
.btn-del { color: var(--red-500) !important; }
.btn-del:hover { background: var(--red-50) !important; border-color: var(--red-200,#fecaca) !important; }

/* ======================== ALERTS ======================== */
.alert-success {
  display: flex; align-items: center; gap: 8px;
  background: var(--green-50); color: var(--green-700);
  border: 1px solid var(--green-100); border-radius: var(--radius-sm);
  padding: 10px 14px; margin-bottom: 16px; font-size: 13px;
}
.alert-error {
  display: flex; align-items: center; gap: 8px;
  background: var(--red-50); color: var(--red-600);
  border: 1px solid var(--red-100); border-radius: var(--radius-sm);
  padding: 10px 14px; margin-bottom: 16px; font-size: 13px;
}

/* ======================== CARDS ======================== */
.card {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.card-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--gray-400); margin-bottom: 14px;
}
.card-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

/* ======================== FORMS ======================== */
label { font-size: 12px; font-weight: 600; color: var(--gray-600); display: block; margin-bottom: 5px; }
.form-group { display: flex; flex-direction: column; margin-bottom: 12px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .half { flex: 1; min-width: 140px; }
.t-input, .t-textarea, select.t-input {
  width: 100%; padding: 9px 12px;
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--gray-900);
  outline: none; transition: border .2s, box-shadow .2s; font-family: inherit;
}
.t-input:focus, .t-textarea:focus, select.t-input:focus {
  border-color: var(--indigo-400); box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}
.t-textarea { resize: vertical; min-height: 80px; }

/* ======================== AVATARS ======================== */
.user-avatar-sm {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--indigo-500); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.user-avatar-lg {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--indigo-500); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0;
}

/* ======================== BADGES / TAGS ======================== */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.status-done    { background: var(--green-50);  color: var(--green-700);  border: 1px solid var(--green-100); }
.status-progress{ background: var(--indigo-50); color: var(--indigo-600); border: 1px solid var(--indigo-100); }
.status-todo    { background: var(--gray-100);  color: var(--gray-500);   border: 1px solid var(--gray-200); }
.status-fail    { background: var(--red-50);    color: var(--red-600);    border: 1px solid var(--red-100); }
.xp-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--amber-600); }
.xp-badge i { color: var(--amber-400); }
.role-tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.role-admin   { background: var(--amber-50);  color: var(--amber-600); }
.role-learner { background: var(--indigo-50); color: var(--indigo-600); }
.pass-tag  { background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-100); padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.fail-tag  { background: var(--red-50);   color: var(--red-600);   border: 1px solid var(--red-100);   padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.final-tag { background: var(--amber-50); color: var(--amber-600); border: 1px solid var(--amber-100); padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 700; margin-left: 4px; }
.tab-badge { background: var(--indigo-500); color: var(--white); border-radius: 10px; padding: 1px 6px; font-size: 10px; font-weight: 700; margin-left: 4px; }

/* ======================== PROGRESS BARS ======================== */
.mini-prog-track { height: 6px; background: var(--gray-100); border-radius: 3px; overflow: hidden; min-width: 60px; }
.mini-prog-fill  { height: 100%; background: linear-gradient(90deg, var(--indigo-500), var(--green-500)); border-radius: 3px; transition: width .4s ease; }
.prog-bar-track  { height: 10px; background: var(--gray-100); border-radius: 5px; overflow: hidden; }
.prog-bar-fill   { height: 100%; background: linear-gradient(90deg, var(--indigo-500), var(--green-400)); border-radius: 5px; transition: width .5s ease; }
.prog-bar-wrap   { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; }
.prog-bar-pct    { font-size: 13px; font-weight: 700; color: var(--indigo-600); white-space: nowrap; }
.prog-bar-sub    { font-size: 12px; color: var(--gray-400); }

/* ======================== TABLES ======================== */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { padding: 9px 12px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-400); border-bottom: 1px solid var(--gray-200); background: var(--gray-50); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-50); }
.row-inactive td { opacity: .55; }
.td-user { display: flex; align-items: center; gap: 8px; font-weight: 600; }

/* ======================== LEARNER LAYOUT ======================== */
.learner-layout { display: flex; height: calc(100vh - 56px); overflow: hidden; }

.l-sidebar {
  width: 230px; flex-shrink: 0; background: var(--white);
  border-right: 1px solid var(--gray-200); padding: 16px;
  overflow-y: auto; display: flex; flex-direction: column; gap: 3px;
}
.l-user-card { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--gray-50); border-radius: var(--radius); margin-bottom: 8px; }
.l-user-name { font-size: 13px; font-weight: 700; color: var(--gray-900); }
.l-user-role { font-size: 11px; color: var(--gray-400); }
.l-xp-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--amber-50); border: 1px solid var(--amber-100); border-radius: var(--radius); margin-bottom: 10px; }
.l-xp-card i { color: var(--amber-400); font-size: 18px; }
.l-xp-num   { font-size: 16px; font-weight: 800; color: var(--amber-600); }
.l-xp-label { font-size: 10px; color: var(--amber-500); font-weight: 600; text-transform: uppercase; }
.sidebar-nav-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--gray-300); padding: 4px 4px 2px; margin-top: 4px; }
.sidebar-week-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--indigo-400); padding: 8px 4px 2px; }

.l-mod-link {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--gray-600); font-size: 12px; font-weight: 500;
  border: 1px solid transparent; transition: all .15s;
}
.l-mod-link:hover { background: var(--gray-50); color: var(--gray-900); }
.l-mod-link.active { background: var(--indigo-50); border-color: var(--indigo-200); color: var(--indigo-700); font-weight: 600; }
.l-mod-icon {
  width: 22px; height: 22px; border-radius: 5px; border: 1.5px solid var(--gray-300);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--gray-400); flex-shrink: 0;
}
.l-mod-icon.done { background: var(--green-500); border-color: var(--green-500); color: var(--white); }
.l-mod-icon.passed { background: var(--indigo-500); border-color: var(--indigo-500); color: var(--white); }
.l-mod-name { flex: 1; }

.l-main { flex: 1; overflow-y: auto; padding: 24px; background: var(--gray-50); }

/* PROGRESS HERO */
.progress-hero {
  background: linear-gradient(135deg, var(--indigo-600) 0%, var(--indigo-500) 100%);
  color: var(--white); border-radius: var(--radius-lg); padding: 24px 28px;
  margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px; box-shadow: var(--shadow-md);
}
.progress-hero h1 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.progress-hero p  { font-size: 13px; opacity: .8; margin-bottom: 12px; }
.progress-hero-left { flex: 1; min-width: 220px; }
.progress-hero .prog-bar-track { background: rgba(255,255,255,.2); }
.progress-hero .prog-bar-fill  { background: var(--white); }
.progress-hero .prog-bar-pct   { color: var(--white); }
.progress-hero .prog-bar-sub   { color: rgba(255,255,255,.7); }

/* CERTIFICATE BADGE CARD */
.cert-badge-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--white); color: var(--gray-800);
  padding: 14px 18px; border-radius: var(--radius); text-decoration: none;
  box-shadow: var(--shadow-md); transition: transform .2s;
}
.cert-badge-card:hover { transform: translateY(-2px); }
.cert-badge-card i { font-size: 28px; color: var(--amber-400); }
.cert-badge-title { font-weight: 700; font-size: 13px; }
.cert-badge-sub   { font-size: 11px; color: var(--gray-400); }

/* PHASE SECTIONS */
.phase-section { margin-bottom: 28px; }
.phase-section-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 12px; }
.phase-week-tag { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--indigo-500); background: var(--indigo-50); border: 1px solid var(--indigo-100); padding: 2px 10px; border-radius: 20px; margin-bottom: 6px; }
.phase-section-header h2 { font-size: 18px; font-weight: 800; color: var(--gray-900); margin-bottom: 4px; }
.phase-section-header p  { font-size: 13px; color: var(--gray-500); max-width: 480px; }

/* SVG RING */
.phase-prog-ring { position: relative; width: 58px; height: 58px; flex-shrink: 0; }
.phase-prog-ring svg { width: 100%; height: 100%; }
.phase-prog-ring span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--indigo-600); }

/* MODULE GRID */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.module-card {
  background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
  padding: 18px; text-decoration: none; color: inherit; display: flex; flex-direction: column;
  gap: 8px; transition: all .2s; box-shadow: var(--shadow-sm);
}
.module-card:hover { border-color: var(--indigo-200); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.module-card.done { border-color: var(--green-200,#bbf7d0); }
.module-card-top { display: flex; align-items: center; justify-content: space-between; }
.module-num-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--indigo-500); background: var(--indigo-50); padding: 2px 8px; border-radius: 4px; }
.module-card h3 { font-size: 14px; font-weight: 700; color: var(--gray-900); line-height: 1.3; }
.module-card p  { font-size: 12px; color: var(--gray-500); line-height: 1.4; flex: 1; }
.module-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.module-card-footer span { font-size: 11px; color: var(--gray-400); white-space: nowrap; }
.module-score-row { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gray-500); border-top: 1px solid var(--gray-100); padding-top: 8px; }

/* ======================== MODULE PAGE ======================== */
.module-layout { max-width: 860px; margin: 0 auto; padding: 24px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gray-400); margin-bottom: 18px; flex-wrap: wrap; }
.breadcrumb a { color: var(--gray-500); text-decoration: none; }
.breadcrumb a:hover { color: var(--indigo-500); }
.breadcrumb i.fa-chevron-right { font-size: 10px; color: var(--gray-300); }
.module-page-header { margin-bottom: 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.module-page-header h1 { font-size: 24px; font-weight: 800; color: var(--gray-900); margin-bottom: 6px; }
.module-page-header p  { font-size: 14px; color: var(--gray-500); line-height: 1.6; max-width: 580px; }
.phase-badge-sm {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--indigo-50); color: var(--indigo-600);
  border: 1px solid var(--indigo-100); padding: 3px 12px;
  border-radius: 20px; font-size: 12px; font-weight: 700; margin-bottom: 8px;
}

/* CONTENT TABS */
.content-tabs { display: flex; border-bottom: 1.5px solid var(--gray-200); margin-bottom: 22px; overflow-x: auto; }
.ctab {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 16px; text-decoration: none; color: var(--gray-500); font-size: 13px; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1.5px; white-space: nowrap; transition: all .2s;
}
.ctab:hover { color: var(--gray-800); }
.ctab.active { color: var(--indigo-600); border-bottom-color: var(--indigo-500); font-weight: 600; }

/* STEPS VIEW */
.steps-view { display: flex; flex-direction: column; }
.step-view-row { display: flex; gap: 14px; padding-bottom: 20px; position: relative; align-items: flex-start; }
.step-vline { position: absolute; left: 13px; top: 32px; bottom: 0; width: 2px; background: var(--gray-200); }
.step-view-row:last-child .step-vline { display: none; }
.step-vline.done { background: var(--green-400,#4ade80); }
.step-circle {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--gray-300);
  background: var(--white); display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--gray-400); flex-shrink: 0; z-index: 1; transition: all .3s;
}
.step-circle.done   { background: var(--green-500); border-color: var(--green-500); color: var(--white); }
.step-circle.active { background: var(--indigo-500); border-color: var(--indigo-500); color: var(--white); }
.step-body { flex: 1; padding-top: 3px; }
.step-title { font-size: 14px; font-weight: 600; color: var(--gray-800); margin-bottom: 6px; }
.step-title.done-text { color: var(--gray-400); text-decoration: line-through; }
.step-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  background: var(--indigo-500); color: var(--white); border: none;
  border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .2s;
}
.step-btn:hover { background: var(--indigo-600); transform: translateY(-1px); }
.step-done-tag { font-size: 12px; color: var(--green-600); display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }

.complete-module-card {
  margin-top: 22px; background: var(--white); border: 1.5px solid var(--indigo-200);
  border-radius: var(--radius-lg); padding: 28px; text-align: center; box-shadow: var(--shadow-md);
}
.complete-module-icon { font-size: 36px; color: var(--amber-400); margin-bottom: 10px; }
.complete-module-card h3 { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.complete-module-card p  { font-size: 13px; color: var(--gray-500); margin-bottom: 18px; }
.btn-complete-module {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 28px;
  background: var(--indigo-500); color: var(--white); border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700; cursor: pointer; transition: all .2s;
}
.btn-complete-module:hover { background: var(--indigo-600); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,.3); }
.done-banner { margin-top: 20px; background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-100); border-radius: var(--radius-sm); padding: 12px 16px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }

/* VIDEO */
.video-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.video-wrap { position: relative; padding-top: 56.25%; background: #000; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.video-meta { padding: 14px 16px; display: flex; align-items: flex-start; gap: 10px; }
.video-meta h4 { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.video-meta p  { font-size: 13px; color: var(--gray-500); }

/* SCREENSHOTS */
.ss-view-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.ss-view-item { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; cursor: zoom-in; transition: all .2s; box-shadow: var(--shadow-sm); }
.ss-view-item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.ss-view-item img { width: 100%; height: 130px; object-fit: cover; display: block; }
.ss-view-cap { padding: 8px 10px; font-size: 12px; color: var(--gray-500); font-weight: 500; }
.lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.85); align-items: center; justify-content: center; z-index: 999; cursor: zoom-out; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: var(--radius); box-shadow: var(--shadow-lg); }

/* MATERIALS */
.materials-view { display: flex; flex-direction: column; gap: 10px; }
.mat-view-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: all .2s; }
.mat-view-row:hover { box-shadow: var(--shadow-md); }
.mat-view-info { flex: 1; }
.mat-view-info h5 { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.mat-view-info p  { font-size: 12px; color: var(--gray-400); }

/* ASSESSMENTS LIST (learner) */
.assessments-list { display: flex; flex-direction: column; gap: 14px; }
.assessment-card {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm);
}
.assessment-card.passed   { border-color: var(--green-200,#bbf7d0); }
.assessment-card.is-final { border-color: var(--amber-200,#fde68a); background: var(--amber-50); }
.assessment-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.assessment-type-badge { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--indigo-600); text-transform: uppercase; letter-spacing: .05em; }
.assessment-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.assessment-instructions { font-size: 13px; color: var(--gray-500); margin-bottom: 12px; line-height: 1.5; }
.assessment-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--gray-500); }
.assessment-meta span { display: flex; align-items: center; gap: 5px; }

/* QUIZ */
.quiz-meta-box { display: flex; flex-direction: column; gap: 6px; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 14px; font-size: 13px; color: var(--gray-600); flex-shrink: 0; }
.quiz-meta-box div { display: flex; align-items: center; gap: 7px; }
.quiz-question-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.quiz-q-header { display: flex; justify-content: space-between; margin-bottom: 10px; }
.quiz-q-num { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--indigo-400); }
.quiz-q-pts { font-size: 11px; color: var(--gray-400); background: var(--gray-100); padding: 2px 8px; border-radius: 4px; }
.quiz-q-text { font-size: 15px; font-weight: 600; color: var(--gray-900); margin-bottom: 14px; line-height: 1.4; }
.quiz-choices { display: flex; flex-direction: column; gap: 8px; }
.quiz-choice-label {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  cursor: pointer; transition: all .15s;
}
.quiz-choice-label:hover { border-color: var(--indigo-300); background: var(--indigo-50); }
.quiz-choice-label:has(.quiz-radio:checked) { border-color: var(--indigo-500); background: var(--indigo-50); }
.quiz-radio { accent-color: var(--indigo-500); width: 16px; height: 16px; flex-shrink: 0; }
.quiz-choice-text { font-size: 14px; color: var(--gray-800); }
.quiz-submit-bar { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); margin-top: 8px; box-shadow: var(--shadow-sm); }
.quiz-progress-text { font-size: 13px; color: var(--gray-500); font-weight: 500; }

/* QUIZ RESULTS */
.quiz-result-card { text-align: center; padding: 36px; background: var(--white); border: 1.5px solid var(--gray-200); border-radius: var(--radius-xl); margin-bottom: 28px; box-shadow: var(--shadow-md); }
.quiz-result-card.passed { border-color: var(--green-200,#bbf7d0); }
.quiz-result-card.failed { border-color: var(--red-200,#fecaca); }
.quiz-result-icon { font-size: 48px; margin-bottom: 12px; }
.quiz-result-card.passed .quiz-result-icon { color: var(--amber-400); }
.quiz-result-card.failed .quiz-result-icon { color: var(--red-400); }
.quiz-result-card h2 { font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.quiz-score-big  { font-size: 52px; font-weight: 900; color: var(--indigo-600); line-height: 1; }
.quiz-score-sub  { font-size: 14px; color: var(--gray-500); margin-top: 6px; }
.xp-earned-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; background: var(--amber-50); color: var(--amber-600); border: 1px solid var(--amber-200,#fde68a); padding: 6px 16px; border-radius: 20px; font-size: 14px; font-weight: 700; }

/* REVIEW */
.review-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 12px; }
.review-card.review-correct { border-color: var(--green-200,#bbf7d0); }
.review-card.review-wrong   { border-color: var(--red-200,#fecaca); }
.review-q-num { font-size: 12px; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.review-card.review-correct .review-q-num { color: var(--green-600); }
.review-card.review-wrong   .review-q-num { color: var(--red-500); }
.review-q-text { font-size: 14px; font-weight: 600; color: var(--gray-900); margin-bottom: 10px; }
.review-choices { display: flex; flex-direction: column; gap: 6px; }
.review-choice { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: var(--radius-sm); font-size: 13px; color: var(--gray-600); border: 1px solid var(--gray-100); }
.review-correct-choice { background: var(--green-50); color: var(--green-700); border-color: var(--green-100); font-weight: 600; }
.review-wrong-choice   { background: var(--red-50);   color: var(--red-600);   border-color: var(--red-100);   }
.review-explanation { margin-top: 10px; padding: 8px 12px; background: var(--amber-50); border: 1px solid var(--amber-100); border-radius: var(--radius-sm); font-size: 12px; color: var(--amber-700); display: flex; gap: 6px; align-items: flex-start; }

/* ======================== TEACHER / ADMIN LAYOUTS ======================== */
.teacher-layout, .admin-layout { display: flex; height: calc(100vh - 56px); overflow: hidden; }

.t-sidebar, .admin-sidebar {
  width: 220px; flex-shrink: 0; background: var(--white);
  border-right: 1px solid var(--gray-200); padding: 16px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.sidebar-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--gray-300); margin-bottom: 8px; }
.sidebar-week-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--indigo-400); padding: 8px 4px 2px; }

.phase-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: var(--radius-sm); text-decoration: none;
  color: var(--gray-600); font-size: 12px; font-weight: 500; border: 1px solid transparent; transition: all .15s;
}
.phase-item:hover { background: var(--gray-50); color: var(--gray-900); }
.phase-item.active { background: var(--indigo-50); color: var(--indigo-700); border-color: var(--indigo-100); }
.phase-item-left { display: flex; align-items: center; gap: 7px; }
.phase-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gray-300); flex-shrink: 0; }
.phase-item.active .phase-dot { background: var(--indigo-500); }
.phase-steps-count { font-size: 10px; color: var(--gray-400); background: var(--gray-100); padding: 1px 6px; border-radius: 10px; }
.phase-item-name { font-size: 12px; }

.admin-nav-link {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--gray-600); font-size: 13px; font-weight: 500; transition: all .15s;
}
.admin-nav-link:hover  { background: var(--gray-50); color: var(--gray-900); }
.admin-nav-link.active { background: var(--indigo-50); color: var(--indigo-700); font-weight: 600; }

.t-main, .admin-main { flex: 1; overflow-y: auto; padding: 24px; background: var(--gray-50); }
.page-header { margin-bottom: 22px; }
.page-header h1 { font-size: 22px; font-weight: 800; }
.page-header p  { font-size: 13px; color: var(--gray-500); margin-top: 2px; }

/* EDITOR */
.editor-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.editor-eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--indigo-500); margin-bottom: 2px; }
.editor-title { font-size: 22px; font-weight: 800; }

/* YT PREVIEW */
.yt-preview { margin-top: 12px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--gray-200); max-width: 420px; }
.yt-thumb-link { display: block; position: relative; }
.yt-thumb-img  { width: 100%; height: 170px; object-fit: cover; display: block; }
.yt-play-btn   { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 46px; height: 46px; background: rgba(0,0,0,.65); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--white); font-size: 15px; padding-left: 3px; }
.yt-info { padding: 9px 12px; font-size: 12px; color: var(--gray-500); display: flex; align-items: center; gap: 7px; }

/* STEPS EDITOR */
.step-editor-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.step-num { width: 24px; height: 24px; border-radius: 50%; background: var(--indigo-500); color: var(--white); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.step-del-btn { background: none; border: none; color: var(--gray-300); cursor: pointer; padding: 5px; font-size: 13px; border-radius: 4px; transition: all .2s; }
.step-del-btn:hover { color: var(--red-500); background: var(--red-50); }

/* SCREENSHOTS (admin/teacher) */
.ss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ss-card { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--gray-200); background: var(--white); box-shadow: var(--shadow-sm); }
.ss-card img { width: 100%; height: 100px; object-fit: cover; display: block; }
.ss-cap { font-size: 11px; color: var(--gray-500); padding: 6px 8px; }
.ss-del-form { position: absolute; top: 5px; right: 5px; }
.ss-del-btn { background: rgba(255,255,255,.9); border: 1px solid var(--gray-200); border-radius: 4px; padding: 3px 5px; cursor: pointer; color: var(--red-500); font-size: 11px; }
.ss-upload-card { border: 2px dashed var(--gray-200); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; }
.ss-upload-label { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; color: var(--gray-400); font-size: 12px; text-align: center; }
.ss-upload-label i { font-size: 22px; color: var(--gray-300); }
.ss-upload-hint { font-size: 10px; color: var(--gray-300); }

/* MATERIALS (admin/teacher) */
.materials-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.mat-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-sm); }
.mat-icon { width: 34px; height: 34px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.mat-icon-pdf  { background: var(--red-50);   color: var(--red-500); }
.mat-icon-zip  { background: var(--amber-50); color: var(--amber-500); }
.mat-icon-docx,.mat-icon-doc { background: var(--blue-50); color: var(--blue-500); }
.mat-icon-pptx { background: #fff7ed; color: #ea580c; }
.mat-icon-xlsx { background: var(--green-50); color: var(--green-600); }
.mat-info { flex: 1; }
.mat-name { display: block; font-size: 13px; font-weight: 600; color: var(--gray-800); }
.mat-size { font-size: 11px; color: var(--gray-400); }
.upload-area { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px; border: 2px dashed var(--gray-200); border-radius: var(--radius); cursor: pointer; font-size: 13px; color: var(--gray-400); text-align: center; transition: all .2s; }
.upload-area:hover { border-color: var(--indigo-400); color: var(--indigo-500); background: var(--indigo-50); }
.upload-area i { font-size: 22px; }
.upload-hint { font-size: 11px; color: var(--gray-300); }
.upload-mat-form label { cursor: pointer; }

/* ASSESSMENT EDITOR (admin) */
.assessment-editor-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--white); gap: 10px; flex-wrap: wrap; }
.assessment-editor-row.selected { border-color: var(--indigo-300); background: var(--indigo-50); }
.assessment-editor-left { display: flex; align-items: center; gap: 10px; flex: 1; flex-wrap: wrap; }
.ass-type-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--indigo-500); background: var(--indigo-50); border: 1px solid var(--indigo-100); padding: 2px 7px; border-radius: 4px; white-space: nowrap; }
.ass-title-text { font-size: 13px; font-weight: 600; color: var(--gray-800); }

/* QUESTION EDITOR */
.question-editor-card { border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; background: var(--white); }
.q-header-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.q-num { font-size: 11px; font-weight: 700; color: var(--indigo-500); background: var(--indigo-50); padding: 2px 8px; border-radius: 4px; }
.q-type-tag { font-size: 10px; color: var(--gray-400); background: var(--gray-100); padding: 2px 7px; border-radius: 4px; text-transform: uppercase; }
.q-choices-preview { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.q-choice-preview { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--gray-500); padding: 5px 10px; border-radius: 5px; }
.q-correct { color: var(--green-700); background: var(--green-50); font-weight: 600; }
.q-explanation { margin-top: 8px; font-size: 12px; color: var(--amber-600); background: var(--amber-50); padding: 6px 10px; border-radius: 5px; display: flex; gap: 6px; }

/* STAT CARDS */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 16px 20px; box-shadow: var(--shadow-sm); }
.stat-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 16px; margin-bottom: 10px; }
.stat-blue   { background: var(--blue-50);   color: var(--blue-500); }
.stat-indigo { background: var(--indigo-50); color: var(--indigo-500); }
.stat-green  { background: var(--green-50);  color: var(--green-600); }
.stat-amber  { background: var(--amber-50);  color: var(--amber-500); }
.stat-val    { font-size: 28px; font-weight: 800; color: var(--gray-900); line-height: 1; }
.stat-label  { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

/* EMPTY STATE */
.empty-state { padding: 48px; text-align: center; color: var(--gray-300); }
.empty-state i { font-size: 40px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 14px; color: var(--gray-400); }

/* ======================== RESPONSIVE ======================== */
@media (max-width: 768px) {
  .l-sidebar, .t-sidebar, .admin-sidebar { width: 200px; }
  .form-row { flex-direction: column; }
  .stat-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 600px) {
  .l-sidebar, .t-sidebar, .admin-sidebar { display: none; }
  .learner-layout, .teacher-layout, .admin-layout { flex-direction: column; }
  .module-grid { grid-template-columns: 1fr; }
  .progress-hero { padding: 18px; }
}
