:root {
  --bg: #f4f6f9;
  --bg-raised: #f8fafc;
  --bg-card: #ffffff;
  --ember: #2563eb;
  --ember-dim: #bfdbfe;
  --gold: #0f2747;
  --garnet: #b42318;
  --ok: #16805b;
  --warning: #b54708;
  --ink: #172033;
  --ink-dim: #526079;
  --ink-faint: #667085;
  --line: #e2e7ef;
  --line-strong: #ccd4e0;
  --navy: #0f2747;
  --navy-soft: #17395f;
  --surface-muted: #f8fafc;
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 39, 71, .04);
  --shadow-md: 0 12px 30px rgba(15, 39, 71, .08);
  --sidebar-width: 252px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  background-image: none;
  color: var(--ink);
  font-family: Inter, "Work Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#environmentBanner {
  position: fixed;
  z-index: 80;
  right: 12px;
  bottom: 12px;
  width: auto;
  padding: 4px 9px !important;
  border: 1px solid #ead28d;
  border-radius: 999px;
  background: #fff9e8 !important;
  color: #7a5a08 !important;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .07em;
  line-height: 1.3;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(15,39,71,.07);
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

h1, h2, h3, h4 {
  color: var(--ink);
  font-family: Manrope, Inter, "Work Sans", sans-serif;
  font-weight: 700;
  letter-spacing: -.025em;
}

.app {
  width: min(100%, 1480px);
  max-width: none;
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 28px 72px;
}

.topbar {
  min-height: 62px;
  margin-bottom: 28px;
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.admin-topbar { margin-left: calc(var(--sidebar-width) + 28px); }
.topbar-leading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mobile-menu-toggle, .sidebar-close { display: none; }
.mobile-admin-brand { display: none; }

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { width: 42px; height: 42px; border-radius: 11px; object-fit: cover; box-shadow: var(--shadow-sm); }
.brand-text { color: var(--navy); font-family: Manrope, sans-serif; font-size: 17px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-text b { color: var(--ember); }

.who { display: flex; align-items: center; justify-content: flex-end; gap: 10px; color: var(--ink-dim); font-size: 13px; }
.switch { display: flex; gap: 3px; padding: 3px; background: #e9eef5; border: 0; border-radius: 9px; }
.switch button { min-height: 34px; padding: 7px 13px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-dim); font-size: 12px; font-weight: 650; cursor: pointer; }
.switch button.active { background: #fff; color: var(--navy); box-shadow: var(--shadow-sm); }
.student-home { min-height: 38px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink-dim); font-size: 12px; font-weight: 650; cursor: pointer; }
.student-home:hover { border-color: var(--navy); color: var(--navy); }
.logout { min-height: 36px; padding: 7px 8px; border: 0; background: transparent; color: var(--ink-faint); font-size: 12px; cursor: pointer; }
.logout:hover { color: var(--garnet); }

.admin-user-menu { position: relative; }
.admin-user-trigger { min-height: 42px; padding: 5px 9px 5px 6px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); cursor: pointer; }
.admin-user-trigger:hover { border-color: var(--line-strong); }
.admin-user-trigger > .ui-icon { width: 14px; height: 14px; transform: rotate(90deg); color: var(--ink-faint); }
.header-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--navy); color: #fff; font-size: 10px; font-weight: 750; }
.header-user-copy { min-width: 0; text-align: left; }
.header-user-copy strong, .header-user-copy small { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-user-copy strong { font-size: 11px; }
.header-user-copy small { color: var(--ink-faint); font-size: 9px; }
.admin-user-popover { position: absolute; z-index: 45; top: calc(100% + 7px); right: 0; width: 190px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-md); }
.admin-user-popover button { width: 100%; padding: 10px; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-dim); font-size: 12px; font-weight: 650; cursor: pointer; }
.admin-user-popover button:hover { background: var(--surface-muted); color: var(--ink); }

.admin-shell { display: block; }
.admin-sidebar {
  position: fixed;
  z-index: 30;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  padding: 18px 14px 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 0;
  background: var(--navy);
  box-shadow: 8px 0 28px rgba(15,39,71,.1);
}

.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-brand img { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 10px; object-fit: cover; background: #fff; }
.sidebar-brand-copy { min-width: 0; }
.sidebar-brand-copy strong, .sidebar-brand-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-brand-copy strong { color: #fff; font: 700 13px/1.2 Manrope, sans-serif; }
.sidebar-brand-copy span { margin-top: 3px; color: #9db0c8; font-size: 11px; }

.admin-sidebar-title { padding: 20px 10px 8px; border: 0; margin: 0; color: #7990aa; font: 700 10px/1 Inter, sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.admin-nav { display: flex; flex: 1; flex-direction: column; gap: 5px; }
.admin-nav button { position: relative; width: 100%; min-height: 44px; padding: 10px 12px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 9px; background: transparent; color: #bdc9d8; font: 600 13px/1.2 Inter, sans-serif; text-align: left; cursor: pointer; }
.admin-nav button:hover { background: rgba(255,255,255,.07); color: #fff; }
.admin-nav button.active { background: #fff; color: var(--navy); box-shadow: 0 8px 20px rgba(2,12,27,.16); }
.admin-nav button.active::before { position: absolute; left: -7px; width: 3px; height: 22px; border-radius: 0 4px 4px 0; background: var(--ember); content: ""; }
.nav-icon { width: 19px; height: 19px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ui-icon { width: 18px; height: 18px; display: inline-block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

.sidebar-user { margin-top: 16px; padding: 13px 10px 8px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-user-main { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 9px; align-items: center; }
.sidebar-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.12); color: #fff; font-size: 11px; font-weight: 750; letter-spacing: .03em; }
.sidebar-user-copy { min-width: 0; }
.sidebar-user-copy strong, .sidebar-user-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-copy strong { color: #fff; font-size: 12px; }
.sidebar-user-copy span { margin-top: 2px; color: #879db7; font-size: 10px; }
.sidebar-logout { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #8ea3bc; cursor: pointer; }
.sidebar-logout:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-logout .ui-icon { width: 16px; height: 16px; }

.admin-page { min-width: 0; margin-left: calc(var(--sidebar-width) + 28px); }
.admin-page-header { margin-bottom: 24px; padding: 0 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.admin-page-header h1 { margin: 0; color: var(--navy); font-size: clamp(25px, 2.4vw, 34px); line-height: 1.1; }
.admin-page-header p { max-width: 660px; margin-top: 7px; color: var(--ink-dim); font-size: 13px; }
.admin-page-header .page-primary-action { width: auto; min-width: 126px; margin: 0; flex: 0 0 auto; }
.admin-page > .section-title:not(:first-child) { margin-top: 34px; }

.panel, .module, .lesson-list, .materials-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.panel { padding: 22px; }
.panel h3 { margin-bottom: 18px; color: var(--navy); font-size: 15px; }
.panel h3 .ui-icon { margin-right: 7px; color: var(--navy); }
.module { padding: 20px; }
.module:hover { border-color: var(--ember-dim); box-shadow: 0 8px 22px rgba(15,39,71,.07); transform: translateY(-1px); }
.module, .btn, .list-item, .course-chip { transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease, transform .16s ease; }

.section-title { margin: 0 0 13px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.section-title h2 { color: var(--navy); font-size: 18px; }
.section-title span, .admin-sidebar-title { color: var(--ink-faint); }

.grid2 { grid-template-columns: minmax(0,1fr) minmax(0,1.35fr); gap: 20px; }
.modules { gap: 12px; }
.modules button.module { width: 100%; color: inherit; font: inherit; text-align: left; }
.module-top { gap: 12px; }
.module-num { width: 32px; min-width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: #edf2f7; color: var(--navy); font: 700 11px/1 Inter, sans-serif; }
.module-title { color: var(--ink); font-weight: 700; }
.module-meta, .li-sub, .subtle-note, .audit-time { color: var(--ink-faint); }
.subtle-note { line-height: 1.6; }

.list-item { margin-bottom: 7px; padding: 12px 13px; border: 1px solid transparent; border-radius: 10px; background: var(--surface-muted); }
.list-item:hover { border-color: var(--line); background: #fff; }
.list-item.selected { border-color: var(--ember-dim); background: color-mix(in srgb, var(--ember) 5%, white); box-shadow: inset 3px 0 0 var(--ember); }
.li-main { min-width: 0; color: var(--ink); font-size: 13px; font-weight: 650; }
.li-sub { margin-top: 4px; font-size: 11px; font-weight: 450; line-height: 1.5; }
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; flex: 0 0 auto; padding: 0; border: 1px solid transparent; border-radius: 8px; color: var(--ink-faint); }
.icon-btn:hover { border-color: #f0c9c5; background: #fff5f4; color: var(--garnet); }
.icon-btn .ui-icon { width: 16px; height: 16px; }

.field { margin-bottom: 16px; }
.field label { margin-bottom: 7px; color: #55647b; font-size: 10px; font-weight: 750; letter-spacing: .09em; }
.field input, .field select, .field textarea, .toolbar input {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: 500 13px/1.4 Inter, sans-serif;
  box-shadow: 0 1px 1px rgba(15,39,71,.02);
}
.field input:hover, .field select:hover, .field textarea:hover, .toolbar input:hover { border-color: #aeb9c8; }
.field input:focus, .field select:focus, .field textarea:focus, .toolbar input:focus { outline: 3px solid color-mix(in srgb, var(--ember) 14%, transparent); border-color: var(--ember); }
.field input:disabled, .field select:disabled, .field textarea:disabled { background: #f2f4f7; color: #98a2b3; cursor: not-allowed; }
.field input::placeholder, .field textarea::placeholder, .toolbar input::placeholder { color: #8490a3; opacity: 1; }
.field textarea { min-height: 108px; }
.field input[type="file"] { padding: 7px; }
.field input[type="file"]::file-selector-button { margin-right: 10px; padding: 7px 10px; border: 0; border-radius: 7px; background: #edf2f7; color: var(--navy); font-size: 11px; font-weight: 700; cursor: pointer; }
.field input[type="color"] { padding: 5px; }

.btn { width: 100%; min-height: 42px; margin-top: 10px; padding: 10px 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--navy); border-radius: 9px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 700; line-height: 1.2; box-shadow: 0 2px 4px rgba(15,39,71,.18); }
.btn:hover { filter: none; background: var(--navy-soft); transform: translateY(-1px); }
.btn:focus-visible, .admin-nav button:focus-visible, .icon-btn:focus-visible, .course-chip:focus-visible { outline: 3px solid color-mix(in srgb, var(--ember) 20%, transparent); outline-offset: 2px; }
.btn:disabled { opacity: .64; color: #5f6878; transform: none; box-shadow: none; }
.btn.secondary { border-color: var(--line-strong); background: #fff; color: var(--ink-dim); box-shadow: none; }
.btn.secondary:hover { border-color: var(--navy); color: var(--navy); }
.btn.ghost { border: 1px solid var(--line-strong); background: var(--surface-muted); color: var(--navy); box-shadow: none; }
.btn.ghost:hover { background: color-mix(in srgb, var(--ember) 10%, white); }
.danger-btn { border-color: #f1c0bb !important; background: #fff !important; color: var(--garnet) !important; }
.course-actions { gap: 8px; }
.course-actions .btn { margin-top: 0; }
.list-item .btn { width: auto; min-height: 36px; padding: 8px 12px; margin: 7px 6px 0 0; font-size: 11px; box-shadow: none; }

.toolbar { padding: 4px; gap: 8px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-muted); }
.toolbar input { min-width: 0; border: 0; background: transparent; box-shadow: none; }
.toolbar input:focus { outline: none; }
.toolbar .btn { min-height: 36px; border-radius: 8px; }

.pager { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-faint); }
.pager button { min-height: 34px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink-dim); font-size: 11px; font-weight: 650; }
.pager button:hover:not(:disabled) { border-color: var(--navy); color: var(--navy); }

.stat-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
.dashboard-kpis { margin-bottom: 30px; }
.progress-panel .student-progress:first-child { margin-top: 0; }
.stat { position: relative; overflow: hidden; min-height: 118px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.stat::after { position: absolute; right: -15px; bottom: -25px; width: 80px; height: 80px; border-radius: 50%; background: color-mix(in srgb, var(--ember) 7%, white); content: ""; }
.stat strong { position: relative; z-index: 1; margin: 5px 0 6px; color: var(--navy); font: 750 29px/1 Manrope, sans-serif; }
.stat span { position: relative; z-index: 1; color: var(--ink-dim); font-size: 11px; }
.stat-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; background: #edf2f7; color: var(--navy); }
.stat-icon .ui-icon { width: 15px; height: 15px; }

.student-progress { margin-top: 9px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-muted); }
.student-progress h4 { color: var(--ink); font-size: 13px; }
.course-progress-row { border-color: var(--line); }
.progress-track { height: 6px; border-radius: 999px; background: #e8edf3; }
.progress-fill { border-radius: 999px; background: var(--navy); }

.audit-item { padding: 13px 2px; border-color: var(--line); }
.audit-item strong { color: var(--ink); font-size: 13px; }
.audit-time { font-size: 10px; }
.divider { margin: 22px 0; border-color: var(--line); }

.course-picker { grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 9px; }
.course-chip { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.course-chip:hover { border-color: var(--ember-dim); }
.course-chip.selected { border-color: var(--navy); background: #f8fafc; box-shadow: inset 0 0 0 1px var(--navy); }
.course-chip strong { font-size: 12px; }
.course-manager-list { margin-bottom: 28px; display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); }
.course-manager-list .course-chip { min-height: 82px; display: grid; grid-template-columns: 38px minmax(0,1fr) 18px; align-items: center; gap: 11px; }
.course-manager-list .course-chip > .ui-icon { width: 16px; height: 16px; color: var(--ink-faint); transform: rotate(90deg); }
.course-chip-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-muted); color: var(--navy); }
.course-chip-icon .ui-icon { width: 18px; height: 18px; }
.course-chip-copy { min-width: 0; }
.course-chip-copy strong, .course-chip-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-manager-list .course-chip.selected .course-chip-icon { background: color-mix(in srgb, var(--ember) 12%, white); }
.new-course-panel { margin-bottom: 28px; border-color: var(--ember-dim); }
.panel-heading { margin-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-heading h3 { margin-bottom: 2px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; }
.form-actions .btn { width: auto; min-width: 130px; margin: 0; }
.course-editor-title { margin-top: 8px; }
.course-editor-title > div { min-width: 0; }
.section-eyebrow { display: block; margin-bottom: 4px; color: var(--navy) !important; font-size: 9px !important; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.course-editor-panel { margin-bottom: 28px; }
.course-editor-actions { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.availability-note { width: fit-content; margin-bottom: 17px; padding: 6px 9px; display: flex; align-items: center; gap: 6px; border-radius: 999px; background: #ecfdf3; color: #067647; font-size: 10px; font-weight: 700; }
.availability-note .ui-icon { width: 13px; height: 13px; }

.status-badge { width: fit-content; margin-top: 7px; padding: 4px 8px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid; border-radius: 999px; font-size: 10px; font-weight: 750; line-height: 1; }
.status-badge .ui-icon { width: 12px; height: 12px; }
.status-pending { border-color: #d6dbe4; background: #f4f6f9; color: #667085; }
.status-uploading { border-color: #b9d7ff; background: #eff6ff; color: #175cd3; }
.status-processing { border-color: #fedf89; background: #fffaeb; color: #b54708; }
.status-ready { border-color: #abefc6; background: #ecfdf3; color: #067647; }
.status-failed { border-color: #fecdca; background: #fef3f2; color: #b42318; }
.status-note { border-color: #fedf89; background: #fffaeb; color: #8a4b0f; }

.access-row { margin: 5px 0; border: 1px solid transparent; border-radius: 9px; }
.access-row:hover { border-color: var(--line); background: var(--surface-muted); }
.access-label { min-height: 40px; padding: 8px 10px; color: var(--ink); font-size: 12px; }
.checkbox, .access-label input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--ember); }
fieldset { border-color: var(--line) !important; border-radius: 12px !important; background: #fff; }
fieldset legend { padding: 0 7px; color: var(--navy); font-size: 11px; font-weight: 700; }

.identity-preview { padding: 14px; border-color: var(--line); border-radius: 11px; background: var(--surface-muted); }
.identity-preview img { width: 62px; height: 62px; border: 1px solid var(--line); border-radius: 12px; }
.signature-pad { border-color: var(--line-strong); border-radius: 10px; }

.login-wrap { min-height: 100vh; padding: 24px; background: linear-gradient(145deg,#edf3f9 0%,#f8fafc 48%,#eef2f7 100%); }
.login-card { position: relative; max-width: 410px; padding: 38px 36px 32px; border-color: var(--line); border-radius: 18px; background: #fff; box-shadow: 0 24px 70px rgba(15,39,71,.13); }
.login-card::before { position: absolute; inset: 0 0 auto; height: 5px; border-radius: 18px 18px 0 0; background: var(--ember); content: ""; }
.login-card img { width: 64px; height: 64px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.login-card h1 { color: var(--navy); font-size: 25px; }
.login-card p { color: var(--ink-dim); line-height: 1.6; }
.error-msg { color: var(--garnet); }

.student-page { max-width: 1180px; margin: 0 auto; }
.student-page .section-title h2 { font-size: 22px; }
.student-page .module.course-card { padding: 23px; }
.student-page .module.course-card .module-title { color: var(--navy); font-size: 16px; }
.student-page .course-actions .btn { width: auto; min-width: 150px; }
.student-page .course-actions { display: flex; flex-wrap: wrap; }
.student-page .course-actions .btn:first-child { margin-right: auto; }
.student-course-card { padding: 20px 22px !important; }
.course-card-content { display: flex; align-items: flex-start; gap: 15px; }
.course-symbol { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; background: #edf2f7; color: var(--navy); }
.course-symbol .ui-icon { width: 22px; height: 22px; }
.course-card-copy { min-width: 0; flex: 1; }
.student-course-card .module-title { font-size: 17px !important; }
.student-course-card .subtle-note { max-width: 760px; margin-top: 5px; }
.course-facts { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--ink-dim); font-size: 11px; }
.course-facts span { display: inline-flex; align-items: center; gap: 5px; }
.course-facts .ui-icon { width: 14px; height: 14px; color: var(--navy); }
.course-progress-summary { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; color: var(--ink-dim); font-size: 11px; }
.course-progress-summary strong { color: var(--navy); font-size: 12px; }
.student-course-card > .module-meta { margin-top: 6px; }
.back-link { margin-bottom: 18px; padding: 7px 0; color: var(--ink-dim); font-weight: 650; }
.back-link:hover { color: var(--navy); }
.lesson-context { margin-bottom: 16px; }
.lesson-context .back-link { margin-bottom: 8px; }
.lesson-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--ink-faint); font-size: 11px; }
.lesson-breadcrumb b { color: #aab2c0; }
.lesson-breadcrumb strong { color: var(--ink); }
.video-layout { grid-template-columns: minmax(0,760px) 300px; justify-content: center; gap: 20px; }
.lesson-player-column { min-width: 0; }
.player-wrap { border: 0; border-radius: 13px; box-shadow: var(--shadow-md); }
.lesson-list { padding: 10px; }
.lesson { border-radius: 9px; }
.lesson-list button.lesson { width: 100%; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; }
.lesson:hover { background: var(--surface-muted); }
.lesson.playing { background: #edf2f7; color: var(--navy); box-shadow: inset 3px 0 0 var(--navy); }
.lesson-copy { min-width: 0; }
.lesson-copy strong, .lesson-copy small { display: block; }
.lesson-copy strong { overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.lesson-copy small { margin-top: 2px; color: var(--ink-faint); font-size: 9px; }
.lesson.playing .lesson-copy strong { color: var(--navy); }
.materials-box { padding: 15px; background: var(--surface-muted); }
.material-link { color: var(--navy); font-weight: 650; }

.certificate-sheet { border-color: var(--navy); background: #fff; color: var(--ink); box-shadow: var(--shadow-md); }
.certificate-sheet h2 { color: var(--ember); }
.empty { color: var(--ink-faint); }

.modal-backdrop { position: fixed; z-index: 90; inset: 0; padding: 20px; display: grid; place-items: center; background: rgba(15,23,42,.48); }
.modal-card { width: min(100%,680px); max-height: calc(100vh - 40px); overflow: auto; box-shadow: 0 24px 70px rgba(15,39,71,.22); }

.mobile-nav-overlay { display: none; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 900px) {
  body.mobile-menu-open { overflow: hidden; }
  .app { padding: 18px 18px 60px; }
  .admin-topbar { margin-left: 0; }
  .mobile-menu-toggle, .sidebar-close { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--navy); cursor: pointer; }
  .mobile-admin-brand { display: block; min-width: 0; }
  .mobile-admin-brand strong, .mobile-admin-brand span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-admin-brand strong { color: var(--navy); font-size: 13px; }
  .mobile-admin-brand span { color: var(--ink-faint); font-size: 10px; }
  .admin-sidebar { top: 0; bottom: 0; left: 0; width: min(84vw,290px); border-radius: 0 16px 16px 0; transform: translateX(-105%); transition: transform .2s ease; }
  .admin-sidebar.open { transform: translateX(0); }
  .sidebar-close { position: absolute; top: 17px; right: 12px; width: 34px; height: 34px; border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.07); color: #fff; }
  .sidebar-brand { padding-right: 42px; }
  .mobile-nav-overlay { position: fixed; z-index: 25; inset: 0; display: block; border: 0; background: rgba(15,23,42,.44); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .mobile-nav-overlay.open { opacity: 1; pointer-events: auto; }
  .admin-page { margin-left: 0; }
  .admin-page-header { align-items: start; }
  .topbar { margin-bottom: 22px; }
}

@media (max-width: 760px) {
  .grid2, .video-layout { grid-template-columns: 1fr; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1 1 150px; }
  .who { gap: 7px; }
  .who > span { display: none; }
  .switch button { padding: 7px 10px; }
  .student-page .course-actions { display: grid; grid-template-columns: 1fr; }
  .student-page .course-actions .btn { width: 100%; min-width: 0; }
  .video-layout .lesson-list { order: 2; }
}

@media (max-width: 560px) {
  .app { padding: 12px 12px 48px; }
  .topbar { min-height: 54px; margin-bottom: 16px; }
  .admin-topbar .student-home { padding: 7px 9px; font-size: 10px; }
  .admin-user-trigger .header-user-copy { display: none; }
  .admin-user-trigger { padding-right: 7px; }
  .switch { max-width: 196px; }
  .switch button { font-size: 10px; }
  .panel { padding: 16px; }
  .admin-page-header { padding-bottom: 15px; }
  .admin-page-header h1 { font-size: 24px; }
  .admin-page-header p { font-size: 12px; }
  .section-title { align-items: flex-start; }
  .section-title h2 { font-size: 17px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { min-height: 105px; padding: 13px; }
  .stat strong { font-size: 24px; }
  .course-picker { grid-template-columns: 1fr; }
  .list-item { align-items: flex-start; }
  .pager { display: grid; grid-template-columns: 1fr 1fr; }
  .pager span { grid-column: 1 / -1; grid-row: 1; text-align: center; }
  .toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto; }
  .login-wrap { padding: 14px; }
  .login-card { padding: 32px 22px 25px; }
  .certificate-sheet { padding: 44px 20px; }
}

@media print {
  body { background: #fff; color: #111; }
  .notice, .topbar, .admin-sidebar, .mobile-nav-overlay, .no-print { display: none !important; }
  .app, .admin-page { width: auto; max-width: none; margin: 0; padding: 0; }
  .certificate-sheet { box-shadow: none; }
}
