/* Quytech Theme — ported from previous/Stylesheet.html, trimmed to the
   screens Phase 14 actually implements (no assessment/settings/admin-CRUD/
   dashboard UI, since no corresponding Node.js API exists yet). */
:root {
  --red: #C8102E;
  --red-dark: #8F0F24;
  --red-tint: #FBEAEC;
  --ink: #1C2128;
  --slate: #5B6472;
  --line: #E3E6EA;
  --surface: #FFFFFF;
  --canvas: #F5F6F8;
  --success: #1C8A55;
  --success-tint: #E7F5EE;
  --error: #B3261E;
  --error-tint: #FCEBEA;
  --locked-text: #9AA3AF;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(28,33,40,0.05);
  --shadow-md: 0 6px 20px rgba(28,33,40,0.08);
  --shadow-lg: 0 20px 60px rgba(28,33,40,0.22);
  /* Quytech Theme enhancement — brand-tinted shadow variants layered on top
     of the existing neutral shadows above (added, not replacing them) so
     red-accented elements (brand mark, primary actions, hover states) get
     a glow that matches the theme instead of a generic gray shadow. */
  --shadow-red-sm: 0 2px 8px rgba(200,16,46,0.18);
  --shadow-red-md: 0 8px 22px rgba(200,16,46,0.22);
}

/* Quytech Theme enhancement — themed text selection and scrollbar so the
   browser's own chrome matches the palette instead of defaulting to the
   OS/browser blue-gray. Purely cosmetic; no markup or layout is affected. */
::selection { background: var(--red-tint); color: var(--red-dark); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--canvas); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 20px; border: 2px solid var(--canvas); }
::-webkit-scrollbar-thumb:hover { background: var(--red); }
html { scrollbar-color: var(--line) var(--canvas); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--canvas);
  color: var(--slate);
  font: 14px/1.55 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .display {
  font-family: 'Manrope', 'IBM Plex Sans', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}
a { color: inherit; }
button { font: inherit; }
input, textarea, select { font: inherit; }

.eyebrow {
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--red);
  font-weight: 700;
}

#app { min-height: 100vh; }

#loadingBar {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 1100;
  background: transparent; pointer-events: none;
}
#loadingBar::before {
  content: ''; display: block; height: 100%; width: 40%; border-radius: 0 4px 4px 0;
  background: linear-gradient(90deg, var(--red), var(--red-dark)); opacity: 0; transform: translateX(-100%);
}
#loadingBar.active::before {
  opacity: 1; animation: loading-bar-sweep 1.1s ease-in-out infinite;
}
@keyframes loading-bar-sweep {
  0% { transform: translateX(-100%); }
  55% { transform: translateX(150%); }
  100% { transform: translateX(150%); }
}
@media (prefers-reduced-motion: reduce) {
  #loadingBar.active::before { animation: none; opacity: 1; transform: translateX(0); width: 100%; }
}

.shell-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-badge {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 14px;
  box-shadow: var(--shadow-red-sm);
}
.brand-title { font-family: 'Manrope', sans-serif; font-size: 16px; font-weight: 700; color: var(--ink); }
.brand-title .sep { color: var(--line); margin: 0 6px; font-weight: 400; }

.header-right { display: flex; align-items: center; gap: 28px; }
.header-user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--red-tint); color: var(--red-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.user-meta .name { font-weight: 600; color: var(--ink); font-size: 13px; }
.user-meta .role { font-size: 12px; color: var(--slate); }
.link-btn {
  background: none; border: none; color: var(--ink); font-weight: 600; font-size: 13px;
  cursor: pointer; padding: 6px 4px;
}
.link-btn:hover { color: var(--red); }
.logout-btn {
  width: 38px; height: 38px; border: none; border-radius: 10px; padding: 0; flex-shrink: 0;
  background: var(--red-tint); color: var(--red-dark); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, transform .1s;
}
.logout-btn svg { width: 18px; height: 18px; }
.logout-btn:hover { background: var(--red); color: #fff; }
.logout-btn:active { transform: scale(0.94); }

.badge-pill {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700;
  background: var(--red-tint); color: var(--red-dark);
  padding: 3px 7px; border-radius: 20px;
}
.badge-pill.badge-success { background: var(--success-tint); color: var(--success); }
.badge-pill.badge-muted { background: var(--canvas); color: var(--locked-text); }

/* Courses column on Department & Designations — one chip per assigned course. */
.course-tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.course-tag {
  font-size: 12px; font-weight: 600; color: var(--ink);
  background: var(--red-tint); border: 1px solid var(--line);
  padding: 3px 10px; border-radius: 20px; white-space: nowrap;
}

.filter-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; align-items: flex-start; }
.filter-row input {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink);
  background: var(--surface); font-size: 13px;
}
.filter-row input { flex: 1 1 200px; min-width: 660px; }
.filter-row input:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint);
}
.filter-row .qt-select { flex: 0 0 auto; width: 200px; }

/* Quytech Theme — custom dropdown (see Quytech-Theme.md's .qt-select):
   every <select> in the app is rendered as this instead of a native one,
   since a native <option> list's own styling can't be reliably overridden.
   Used in the filter bar, modals, and every plain Settings/admin picker. */
.qt-select { position: relative; width: 100%; }
.qt-select-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; cursor: pointer; transition: border-color .12s, box-shadow .12s;
}
.filter-row .qt-select-trigger { padding: 8px 12px; font-size: 13px; }
.qt-select-trigger:focus,
.qt-select-trigger.is-open { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }
.qt-select-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qt-select-label.is-placeholder { color: var(--locked-text); }
.qt-select-chevron { width: 14px; height: 14px; color: var(--slate); flex-shrink: 0; transition: transform .12s; }
.qt-select-trigger.is-open .qt-select-chevron { transform: rotate(180deg); color: var(--red); }
/* A disabled dropdown (e.g. Add User's Designation field before a
   Department is chosen) stays just as flat/clean as a disabled textarea
   (.field textarea:disabled) — plain markup here, so no browser native-
   control quirks to fight, unlike the old <select>. */
.qt-select-trigger:disabled { background: var(--canvas); color: var(--locked-text); cursor: not-allowed; }
.qt-select-trigger:disabled .qt-select-chevron { color: var(--locked-text); }
.qt-select-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); max-height: 260px; overflow-y: auto; padding: 4px;
}
.qt-select-option {
  display: block; width: 100%; text-align: left; font-family: inherit; font-size: 14px;
  color: var(--ink); background: transparent; border: none; border-radius: 6px;
  padding: 9px 10px; cursor: pointer; transition: background .1s; overflow-wrap: anywhere;
}
.qt-select-option:hover { background: var(--red-tint); }
.qt-select-option.is-selected { background: var(--red); color: #FFFFFF; font-weight: 500; }
.qt-select-empty { padding: 9px 10px; font-size: 13px; color: var(--locked-text); }

/* Quytech Theme — dashed dropzone-style file input with a red
   file-selector-button (used by the Materials upload modal). */
.field input[type="file"] {
  width: 100%; padding: 20px 14px; border: 1.5px dashed var(--line); border-radius: 10px;
  background: var(--canvas); color: var(--slate); font-size: 13px; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.field input[type="file"]:hover { border-color: var(--red); background: var(--red-tint); }
.field input[type="file"]::file-selector-button {
  padding: 8px 16px; margin-right: 12px; border: none; border-radius: 8px;
  background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff;
  font-weight: 700; font-size: 12px; cursor: pointer; transition: filter .12s;
}
.field input[type="file"]::file-selector-button:hover { filter: brightness(1.06); }

/* Quytech Theme — red spinner accent for inline loading states inside
   buttons (Save/Upload while a request is in flight). */
.spinner {
  display: inline-block; width: 13px; height: 13px; margin-right: 2px;
  border: 2px solid rgba(255,255,255,0.45); border-top-color: #fff; border-radius: 50%;
  animation: spinner-spin .6s linear infinite; vertical-align: -2px;
}
.btn-ghost .spinner { border-color: var(--red-tint); border-top-color: var(--red); }
@keyframes spinner-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}


/* Left sidebar nav (Dashboard / Self Training / Administration) — replaces
   the old top nav-tabs bar. .app-body is the flex row below the header
   (sidebar + main-content); Administration expands in place into its own
   sections (see sidebarHtml/SETTINGS_SECTIONS) instead of a separate
   in-page sub-tab bar. */
.app-body { display: flex; align-items: flex-start; min-height: calc(100vh - 67px); }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line);
  padding: 16px 12px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 67px; align-self: flex-start; height: calc(100vh - 67px); overflow-y: auto;
}
/* Quytech Theme — sidebar links reuse the theme's two red treatments:
   an active top-level item gets the same red gradient + white text as
   .qt-btn-primary (the theme's "primary action" look), and an active
   sub-item gets the same solid-red + white-text "selected" look as
   .qt-select-option.is-selected. border-left is the active-state indicator;
   padding-left is 3px narrower everywhere so the border doesn't shift text. */
.sidebar-link {
  background: none; border: none; border-left: 3px solid transparent; border-radius: 8px;
  color: var(--slate); font-weight: 600; font-size: 13px; font-family: inherit;
  padding: 11px 12px 11px 9px; cursor: pointer; text-align: left; width: 100%;
  display: flex; align-items: center; gap: 10px; transition: background .12s, color .12s;
}
.sidebar-icon { font-size: 15px; }
.sidebar-link:hover { color: var(--red-dark); background: var(--red-tint); }
.sidebar-link.active {
  color: #FFFFFF; background: linear-gradient(135deg, var(--red), var(--red-dark));
  border-left-color: var(--red-dark); box-shadow: var(--shadow-red-sm);
}
.sidebar-subnav { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 8px 14px; padding-left: 21px; border-left: 1px solid var(--line); }
.sidebar-sublink {
  background: none; border: none; border-left: 3px solid transparent; border-radius: 8px;
  color: var(--slate); font-weight: 600; font-size: 13px; font-family: inherit;
  padding: 9px 12px 9px 9px; cursor: pointer; text-align: left; width: 100%; transition: background .12s, color .12s;
}
.sidebar-sublink:hover { color: var(--red-dark); background: var(--red-tint); }
.sidebar-sublink.active {
  color: #FFFFFF; background: var(--red); font-weight: 700; border-left-color: var(--red-dark);
}
.main-content { flex: 1; min-width: 0; }
@media (max-width: 900px) {
  .app-body { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap;
    border-right: none; border-bottom: 1px solid var(--line);
  }
  .sidebar-subnav { flex-direction: row; flex-wrap: wrap; margin: 2px 0 8px; padding-left: 12px; border-left: none; }
}

.stepper-row {
  padding: 20px 32px 0; display: flex; align-items: center; gap: 10px;
  background: var(--canvas);
}
.step { display: flex; align-items: center; gap: 8px; }
.step-num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--line); color: var(--slate);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.step.active .step-num { background: var(--red); color: #fff; }
.step-label { font-size: 13px; font-weight: 600; color: var(--locked-text); }
.step.active .step-label { color: var(--ink); }
.step-line { width: 32px; height: 1px; background: var(--line); }

/* Every screen (Departments, Designations, Courses, Journey, Watch,
   Material, Completion, Admin/Settings, etc. — anything rendered through
   shell()) uses the full viewport width instead of a centered, capped
   column. Horizontal padding is unchanged (32px) to match the existing
   design system. */
.page {
  max-width: none; margin: 0; padding: 24px 32px 64px;
}
.page-anim { animation: view-fade-in .2s ease-out; }
@keyframes view-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .page-anim { animation: none; }
}
.page-title { font-size: 30px; font-weight: 800; margin: 6px 0 8px; }
.page-sub { color: var(--slate); max-width: 60ch; margin-bottom: 28px; }

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

.card {
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--red);
  border-radius: var(--radius);
  padding: 18px; transition: border-color .15s, box-shadow .15s, transform .15s;
  display: flex; flex-direction: column; gap: 6px; position: relative;
  box-shadow: var(--shadow-sm);
}
.card:hover { box-shadow: var(--shadow-md), var(--shadow-red-sm); transform: translateY(-1px); }
.card.locked { opacity: 0.6; border-top-color: var(--line); }
.card.locked:hover { box-shadow: var(--shadow-sm); transform: none; }
.card-icon { font-size: 22px; }
.card-name { font-weight: 700; color: var(--ink); font-size: 15px; }
.card-meta { font-size: 12px; color: var(--locked-text); }
.card-top-badge { position: absolute; top: 14px; right: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
  font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: filter .12s, box-shadow .12s, transform .05s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff;
  box-shadow: 0 2px 8px rgba(200,16,46,0.25);
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: var(--shadow-red-md); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { background: var(--line); color: var(--locked-text); cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: none; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--red); color: var(--red); }
.btn-locked { background: none; color: var(--locked-text); border-color: var(--line); cursor: not-allowed; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-block { width: 100%; }

.progress-bar { height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress-bar > div { height: 100%; background: linear-gradient(90deg, var(--red), var(--red-dark)); }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(28,33,40,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
}
.modal-card {
  background: var(--surface); border-radius: 16px; border-top: 3px solid var(--red);
  padding: 28px; width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg), var(--shadow-red-sm); text-align: left;
}
.modal-card.modal-wide { max-width: 560px; }
.modal-card.modal-course { width: 80vw; max-width: 1100px; }
.modal-card.modal-view-materials { width: 80vw; max-width: 1200px; }
/* 60% wider than the base .modal-wide (560px -> 896px). */
.modal-card.modal-desig-course { width: 65vw; max-width: 896px; }
@media (max-width: 720px) {
  .modal-card.modal-course, .modal-card.modal-view-materials,
  .modal-card.modal-desig-course {
    width: calc(100vw - 24px);
  }
}
.modal-card.modal-view-materials td,
.modal-card.modal-course td { overflow-wrap: anywhere; }

/* Fixed, identical column widths across the Video/PDF/PPT/Document tables so
   S. No. / Title / Description line up vertically with each other instead of
   each table auto-sizing to its own content. */
.modal-card.modal-view-materials table.data-table {
  table-layout: fixed; width: 100%;
}
.modal-card.modal-view-materials table.data-table th:nth-child(1),
.modal-card.modal-view-materials table.data-table td:nth-child(1) { width: 70px; }
.modal-card.modal-view-materials table.data-table th:nth-child(2),
.modal-card.modal-view-materials table.data-table td:nth-child(2) { width: 38%; }
.modal-card.modal-view-materials table.data-table th:nth-child(3),
.modal-card.modal-view-materials table.data-table td:nth-child(3) { width: auto; }

/* Edit/Add Course's "Selected Materials" tables (Video/PDF/PPT/Document) —
   exactly S. No. / Title / Description / Action, same widths across all
   four types. Title/Description wrap naturally in place (no ellipsis, no
   horizontal overflow); the Action cell centers vertically against however
   tall the wrapped text makes the row. */
table.selected-materials-table { table-layout: fixed; width: 100%; }
table.selected-materials-table th:nth-child(1),
table.selected-materials-table td:nth-child(1) { width: 8%; }
table.selected-materials-table th:nth-child(2),
table.selected-materials-table td:nth-child(2) { width: 25%; white-space: normal; overflow-wrap: anywhere; }
table.selected-materials-table th:nth-child(3),
table.selected-materials-table td:nth-child(3) { width: 57%; white-space: normal; overflow-wrap: anywhere; }
table.selected-materials-table th:nth-child(4),
table.selected-materials-table td:nth-child(4) { width: 10%; text-align: center; }

/* Courses admin table (Admin > Courses) — fixed Name/Description widths so
   long text wraps in place instead of stretching the row or the page. */
table.courses-admin-table { table-layout: fixed; width: 100%; }
table.courses-admin-table th:nth-child(1),
table.courses-admin-table td:nth-child(1) { width: 56px; }
table.courses-admin-table th:nth-child(2),
table.courses-admin-table td:nth-child(2) { width: 220px; white-space: normal; overflow-wrap: anywhere; }
table.courses-admin-table th:nth-child(3),
table.courses-admin-table td:nth-child(3) { width: 600px; white-space: normal; overflow-wrap: anywhere; }
table.courses-admin-table th:nth-child(6),
table.courses-admin-table td:nth-child(6) { width: 150px; white-space: nowrap; }

/* Checkbox-picker tables (Add/Edit Course's content picker, the Designation
   "+ Course" picker) — the row list scrolls on its own, with the header
   pinned, so the search box and Cancel/Done stay put instead of scrolling
   away with a long library. */
.picker-table-scroll { max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.picker-table-scroll table.data-table { margin: 0; }
.picker-table-scroll table.data-table thead th {
  position: sticky; top: 0; z-index: 1; background: var(--canvas);
}
.modal-card .field select, .modal-card .field input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink);
  /* background-color, not the `background` shorthand — this selector has
     the exact same specificity as, and comes after, the custom-chevron
     rule above (".modal-card .field select"), so a bare `background:`
     here was resetting background-image/repeat/position back to their
     initial values (none / repeat / 0% 0%) for every select in every
     modal, wiping the intended single chevron and leaving appearance:none
     with nothing drawn in its place — the actual source of the broken
     rendering reported on Add User's Designation field. */
  background-color: var(--surface);
}
.modal-card .field select:focus, .modal-card .field input:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint);
}
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.modal-grid .field { margin: 10px 0; }
/* Opt-in per field (e.g. Video's URL/Description) to break out of the two-
   column modal grid and take its own full-width row. */
.modal-grid .field-full-width { grid-column: 1 / -1; }
@media (max-width: 480px) {
  .modal-grid { grid-template-columns: 1fr; }
}

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(circle at 20% 20%, rgba(200,16,46,0.06), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(200,16,46,0.04), transparent 40%), var(--canvas);
}
.login-card {
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--red); border-radius: 16px;
  padding: 40px; width: 100%; max-width: 400px; text-align: center;
  box-shadow: var(--shadow-md), var(--shadow-red-sm);
}
.field { text-align: left; margin: 20px 0 8px; }
.field label { display: block; font-family: 'Manrope', sans-serif; font-size: 12px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.field textarea, .field input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink);
  background: var(--surface); transition: border-color .12s, box-shadow .12s;
}
.field textarea:focus, .field input:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint);
}
.field textarea:disabled { background: var(--canvas); color: var(--locked-text); }
/* Checkbox fields (e.g. "Mark as New") share the same .field/.field input
   markup as text fields, whose width:100% would otherwise stretch the
   checkbox to fill the row and push its label text onto the next line.
   Reset it back to a normal inline checkbox that sits before its label. */
.field input[type="checkbox"],
.modal-card .field input[type="checkbox"] {
  width: auto; padding: 0; border: none; vertical-align: middle; margin: 0 8px 0 0;
}
.field label:has(input[type="checkbox"]) { display: flex; align-items: center; }
.field-error { color: var(--error); font-size: 12px; margin-top: 6px; min-height: 16px; }

/* Material upload modal — document source selection (Local Drive / Google
   Drive) and the selected-Google-Drive-file card. Reuses .settings-subtabs
   for the source toggle and .badge-pill for the source label, same as the
   rest of the admin UI's segmented controls and pills. */
.drive-picker-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.drive-file-card {
  display: flex; align-items: center; gap: 10px; margin-top: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas);
}
.drive-file-card .drive-file-icon { width: 20px; height: 20px; flex-shrink: 0; }
.drive-file-card .drive-file-info { flex: 1 1 auto; min-width: 0; }
.drive-file-card .drive-file-name { font-weight: 600; color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }

.breadcrumb-link { color: var(--slate); font-size: 13px; cursor: pointer; margin-bottom: 12px; display: inline-block; font-weight: 600; background: none; border: none; padding: 0; }
.breadcrumb-link:hover { color: var(--red); }

.watch-video {
  display: block; width: 100%; max-width: 100%; aspect-ratio: 16/9;
  background: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-md);
}

/* Application-controlled PDF viewer (PDF.js renders into #pdfCanvas — see
   app.js). Scoped to this component only; the shared .page/.grid containers
   it sits inside are untouched. Uses the material page's full available
   width; the document itself stays centered within that width via the flex
   centering on .pdf-viewer-body. */
.pdf-viewer {
  width: 100%; max-width: none;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); background: var(--surface);
}
.pdf-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 14px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.pdf-toolbar-filename {
  flex: 1 1 120px; min-width: 0; font-weight: 600; font-size: 13px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pdf-toolbar-group { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.pdf-toolbar-btn {
  width: 28px; height: 28px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink);
  font-size: 16px; line-height: 1; cursor: pointer;
}
.pdf-toolbar-btn:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.pdf-toolbar-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pdf-toolbar-pages, .pdf-toolbar-zoom { min-width: 46px; text-align: center; font-size: 12px; color: var(--slate); }
/* Fixed viewer height (matches the height the previous iframe-based viewer
   used) rather than a full viewport-minus-header calc — a single scrollable
   region for the document, so there's no nested/competing page scrolling. */
.pdf-viewer-body {
  height: 70vh; overflow: auto; display: flex; justify-content: center;
  padding: 20px; background: var(--canvas);
}
.pdf-viewer-body canvas { height: fit-content; box-shadow: var(--shadow-md); background: #fff; }
@media (max-width: 480px) {
  .pdf-toolbar { justify-content: space-between; }
  .pdf-toolbar-filename { flex-basis: 100%; order: -1; }
}

table.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.data-table th { text-align: left; font-family: 'Manrope', sans-serif; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--locked-text); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--canvas); }
table.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink); }
table.data-table tr:last-child td { border-bottom: none; }

.empty-state { text-align: center; padding: 48px 16px; color: var(--locked-text); }

/* Department & Designations hierarchical table — Department rows are
   clickable to expand/collapse; Designation rows render only while their
   parent is expanded (S.admin.orgExpanded), indented to read as children. */
.org-dept-row { cursor: pointer; }
.org-dept-row:hover td { background: var(--canvas); }
.org-toggle { display: inline-block; width: 14px; color: var(--slate); font-size: 11px; }
.org-desig-row td { color: var(--slate); }
/* table.data-table td's own padding shorthand outranks a plain .org-desig-name
   class on specificity alone (element+class beats class-only) — qualifying
   with the table class here is what actually wins the cascade. */
table.data-table td.org-desig-name { padding-left: 40px; position: relative; }
.org-desig-name::before { content: '└─'; position: absolute; left: 16px; color: var(--slate); }
table.data-table td.org-desig-empty { padding-left: 40px; font-style: italic; color: var(--locked-text); }

/* Multiple-designation inputs inside the Add/Edit Department modal. */
.org-desig-input-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.org-desig-input-row { display: flex; gap: 8px; align-items: center; }
.org-desig-input-row input { flex: 1 1 auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); }
.org-desig-input-row input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }

.toast {
  position: fixed; top: 16px; right: 16px; background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 8px; font-size: 13px; z-index: 999; max-width: 320px;
  box-shadow: var(--shadow-lg), var(--shadow-red-sm); animation: toast-in .18s ease-out;
  border-left: 3px solid var(--red);
}
.toast.error { background: var(--error); border-left-color: #fff; box-shadow: var(--shadow-lg); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.faq-item { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq-q { font-weight: 700; color: var(--ink); cursor: pointer; display: flex; justify-content: space-between; background: none; border: none; width: 100%; text-align: left; padding: 0; }
.faq-q:hover { color: var(--red); }
.faq-a { color: var(--slate); margin-top: 8px; display: none; }
.faq-item.open .faq-a { display: block; }

.settings-subtabs { display: flex; gap: 8px; margin: 16px 0 24px; flex-wrap: wrap; }
.settings-subtab {
  background: var(--canvas); border: 1px solid var(--line); border-radius: 20px;
  padding: 6px 16px; font-size: 13px; font-weight: 600; color: var(--slate); cursor: pointer;
}
.settings-subtab:hover { color: var(--ink); }
.settings-subtab.active { background: var(--red-tint); color: var(--red-dark); border-color: var(--red-tint); }

.reorder-list { display: flex; flex-direction: column; gap: 8px; max-width: 560px; margin-top: 16px; }
.reorder-row {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
}
.reorder-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.reorder-seq {
  width: 24px; height: 24px; border-radius: 50%; background: var(--canvas); color: var(--slate);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.reorder-name { font-weight: 600; color: var(--ink); font-size: 14px; }
.reorder-controls { display: flex; gap: 4px; flex-shrink: 0; }

/* Course Sequence's per-course "Manage Materials" panel (courseSeqExpandedPanelHtml)
   — indented and left-bordered so it visually nests under its course row. */
.course-seq-expanded {
  margin: 4px 0 12px 36px; padding: 12px 16px 4px;
  border-left: 3px solid var(--line); background: var(--canvas); border-radius: 0 10px 10px 0;
}
.course-seq-expanded .settings-subtabs { margin: 0 0 12px; }
.course-seq-expanded .reorder-list { max-width: 520px; margin-top: 0; }
@media (max-width: 600px) {
  .course-seq-expanded { margin-left: 12px; }
}