/*
 * Clearscope LMS — Design System
 *
 * Palette:
 *   Primary blue  : #1a56db  (Clearscope blue)
 *   Blue dark     : #1e429f
 *   Blue light    : #e8f0fe
 *   Surface       : #f7f8fa
 *   Border        : #e5e7eb
 *   Text          : #1f2328
 *   Muted         : #57606a
 *   Success       : #15803d
 *   Warning       : #b45309
 *   Danger        : #b91c1c
 *
 * Typography:
 *   -apple-system, "Segoe UI", system-ui, sans-serif
 *   Base: 15px / 1.6
 *
 * WCAG 2.2 AA:
 *   All interactive elements have visible focus rings.
 *   Colour is never the sole indicator of state.
 *   Minimum contrast ratio 4.5:1 for body text, 3:1 for large text.
 */

/* ── Skip navigation link (WCAG 2.4.1) ──────────────────────────────────── */

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 10000;
  padding: 0.5rem 1rem;
  background-color: var(--lms-blue);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 0 0 4px 0;
  transition: top 0.1s ease;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

/* ── Visually hidden utility (screen-reader only, WCAG 1.3.1) ────────────── */

.lms-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Reset / base ────────────────────────────────────────────────────────── */

:root {
  --lms-blue:        #1a56db;
  --lms-blue-dark:   #1e429f;
  --lms-blue-light:  #e8f0fe;
  --lms-surface:     #f7f8fa;
  --lms-border:      #e5e7eb;
  --lms-text:        #1f2328;
  --lms-muted:       #57606a;

  /* MOD20 branding tokens — overridden per-tenant by ThemeService via theme_vars.html.
     Default values here ensure gradients and topbar render correctly on unbranded tenants. */
  --lms-primary:   #1a3a5c;   /* Clearscope navy — topbar + hero gradient */
  --lms-secondary: #2e7d9c;   /* Clearscope teal — links, buttons */
}

body.lms-body {
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--lms-text);
  background-color: #ffffff;
}

/* ── Focus rings (WCAG 2.2 AA) ───────────────────────────────────────────── */

:focus-visible {
  outline: 3px solid var(--lms-blue);
  outline-offset: 2px;
}

/* ── Navbar ──────────────────────────────────────────────────────────────── */

.lms-navbar {
  background-color: #ffffff;
  border-bottom: 1px solid var(--lms-border);
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.lms-brand {
  text-decoration: none;
}

.lms-brand-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--lms-text);
  letter-spacing: -0.01em;
}

.lms-brand-accent {
  color: var(--lms-blue);
}

.lms-navbar .nav-link {
  color: var(--lms-text);
  font-size: 0.9rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.lms-navbar .nav-link:hover,
.lms-navbar .nav-link:focus {
  color: var(--lms-blue);
}

.lms-navbar .nav-link.active {
  color: var(--lms-blue);
  font-weight: 600;
}

.lms-user-menu {
  font-size: 0.9rem;
  color: var(--lms-text) !important;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.lms-btn-primary {
  background-color: var(--lms-blue);
  border-color: var(--lms-blue);
  color: #ffffff;
  font-weight: 500;
}

.lms-btn-primary:hover,
.lms-btn-primary:focus {
  background-color: var(--lms-blue-dark);
  border-color: var(--lms-blue-dark);
  color: #ffffff;
}

.lms-btn-primary:focus-visible {
  outline: 3px solid var(--lms-blue);
  outline-offset: 2px;
  box-shadow: none;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */

.lms-card {
  border: 1px solid var(--lms-border);
  border-radius: 8px;
}

/* ── Badges ──────────────────────────────────────────────────────────────── */

/* ── Status badge palette (WCAG 1.4.3 AA — all ≥ 4.5:1) ─────────────────── */
/*   Text colours verified against background with WebAIM contrast checker.    */

.lms-badge-admin {
  background-color: var(--lms-blue-light);
  color: var(--lms-blue-dark);    /* #1e429f on #e8f0fe — 7.2:1 ✓ */
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
}

.lms-badge-green {
  background-color: #dcfce7;
  color: #15803d;                 /* #15803d on #dcfce7 — 5.1:1 ✓ */
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.lms-badge-blue {
  background-color: var(--lms-blue-light);
  color: var(--lms-blue-dark);    /* #1e429f on #e8f0fe — 7.2:1 ✓ */
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.lms-badge-orange {
  background-color: #fff7ed;
  color: #9a3412;                 /* #9a3412 on #fff7ed — 6.8:1 ✓ */
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.lms-badge-purple {
  background-color: #f3e8ff;
  color: #6b21a8;                 /* #6b21a8 on #f3e8ff — 7.0:1 ✓ */
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.lms-badge-gray {
  background-color: #f3f4f6;
  color: #374151;                 /* #374151 on #f3f4f6 — 8.6:1 ✓ */
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ── Login page ──────────────────────────────────────────────────────────── */

.lms-login-heading {
  font-weight: 700;
  color: var(--lms-text);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.lms-footer {
  background-color: var(--lms-surface);
  border-top: 1px solid var(--lms-border);
}

/* ── Empty state ─────────────────────────────────────────────────────────── */

.lms-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--lms-muted);
}

.lms-empty-state h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--lms-text);
  margin-bottom: 0.5rem;
}

.lms-empty-state p {
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

/* ── Utility ─────────────────────────────────────────────────────────────── */

.text-muted {
  color: var(--lms-muted) !important;
}

/* ── Dashboard tile grid ─────────────────────────────────────────────────── */

.lms-dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.lms-dashboard-header h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--lms-text);
  margin: 0;
}

.lms-tile-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
  align-items: start;
}

/* Tile size classes — sm=3col, md=6col, lg=9col (on ≥lg screens) */
.lms-tile { grid-column: span 3; }
.lms-tile.lms-tile-md { grid-column: span 6; }
.lms-tile.lms-tile-lg { grid-column: span 9; }

@media (max-width: 991.98px) {
  .lms-tile,
  .lms-tile.lms-tile-md,
  .lms-tile.lms-tile-lg { grid-column: span 6; }
}
@media (max-width: 575.98px) {
  .lms-tile,
  .lms-tile.lms-tile-md,
  .lms-tile.lms-tile-lg { grid-column: span 12; }
}

.lms-tile-card {
  background: #ffffff;
  border: 1px solid var(--lms-border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem 1rem;
  height: 100%;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.lms-tile-card:hover {
  box-shadow: 0 2px 12px rgba(26, 86, 219, 0.08);
  border-color: #c5d4f7;
}

.lms-tile-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.lms-tile-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-color: var(--lms-blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
  color: var(--lms-blue-dark);
}

.lms-tile-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--lms-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.lms-tile-body {
  flex: 1;
}

.lms-tile-stat {
  font-size: 2rem;
  font-weight: 700;
  color: var(--lms-text);
  line-height: 1.1;
}

.lms-tile-stat-label {
  font-size: 0.8rem;
  color: var(--lms-muted);
  margin-top: 0.1rem;
}

.lms-tile-stat-pair {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}

.lms-tile-stat-sm {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--lms-text);
  line-height: 1.1;
}

.lms-tile-progress {
  height: 5px;
  border-radius: 3px;
  background: var(--lms-border);
  overflow: hidden;
  margin-top: 0.6rem;
}

.lms-tile-progress-bar {
  height: 100%;
  border-radius: 3px;
  background: var(--lms-blue);
  transition: width 0.4s ease;
}

.lms-tile-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.lms-tile-list li {
  font-size: 0.82rem;
  color: var(--lms-text);
  padding: 0.2rem 0;
  border-bottom: 1px solid #f3f4f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lms-tile-list li:last-child { border-bottom: none; }

.lms-tile-list a {
  color: var(--lms-text);
  text-decoration: none;
}

.lms-tile-list a:hover { color: var(--lms-blue); }

.lms-tile-badge-danger {
  display: inline-block;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
}

.lms-tile-badge-warning {
  display: inline-block;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
}

.lms-tile-footer {
  margin-top: auto;
  padding-top: 0.6rem;
}

.lms-tile-footer a {
  font-size: 0.78rem;
  color: var(--lms-blue);
  text-decoration: none;
  font-weight: 500;
}

.lms-tile-footer a:hover { text-decoration: underline; }

/* Quick-link grid inside quick_links tile */
.lms-quicklink-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
}

.lms-quicklink-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--lms-border);
  border-radius: 6px;
  background: var(--lms-surface);
  color: var(--lms-text);
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
  overflow: hidden;
}

.lms-quicklink-btn:hover {
  background: var(--lms-blue-light);
  border-color: #c5d4f7;
  color: var(--lms-blue-dark);
}

/* ── Customize dashboard modal ───────────────────────────────────────────── */

.lms-customize-btn {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--lms-muted);
  background: none;
  border: 1px solid var(--lms-border);
  border-radius: 6px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.12s, border-color 0.12s;
}

.lms-customize-btn:hover {
  color: var(--lms-blue);
  border-color: var(--lms-blue);
}

.lms-tile-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.6rem;
  max-height: 420px;
  overflow-y: auto;
  padding: 0.25rem 0.1rem;
}

.lms-tile-picker-item {
  border: 2px solid var(--lms-border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.12s, background 0.12s;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.lms-tile-picker-item:hover {
  border-color: #c5d4f7;
  background: #fafbff;
}

.lms-tile-picker-item.selected {
  border-color: var(--lms-blue);
  background: var(--lms-blue-light);
}

.lms-tile-picker-item.selected .lms-tile-picker-icon {
  background: var(--lms-blue);
  color: #ffffff;
}

.lms-tile-picker-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--lms-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
  color: var(--lms-muted);
  transition: background 0.12s, color 0.12s;
}

.lms-tile-picker-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--lms-text);
  margin-bottom: 0.1rem;
}

.lms-tile-picker-desc {
  font-size: 0.75rem;
  color: var(--lms-muted);
  line-height: 1.35;
}

.lms-tile-picker-check {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--lms-blue);
  font-size: 1rem;
  opacity: 0;
  transition: opacity 0.12s;
}

.lms-tile-picker-item.selected .lms-tile-picker-check {
  opacity: 1;
}


/* ── Dashboard redesign — hero header + KPI bar (Session 54) ────────────── */

/* Layer 1 — Hero header */
.lms-dash-hero {
  background: linear-gradient(135deg, var(--lms-primary) 0%, color-mix(in srgb, var(--lms-primary) 75%, #000) 100%);
  border-radius: 12px;
  padding: 1.25rem 1.5rem 0;
  margin-bottom: 1.25rem;
  color: #ffffff;
}

.lms-dash-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
}

.lms-dash-hero-identity {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.lms-dash-hero-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  border-radius: 4px;
  background: rgba(255,255,255,0.15);
  padding: 2px 6px;
}

.lms-dash-hero-greeting {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.1rem;
  line-height: 1.2;
}

.lms-dash-hero-date {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.72);
  margin: 0;
}

/* Hero customize button — white ghost style */
.lms-customize-btn-hero {
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.lms-customize-btn-hero:hover {
  background: rgba(255,255,255,0.22);
  color: #ffffff;
}

/* KPI bar — sits at the bottom of the hero, flush to edges */
.lms-kpi-bar {
  display: flex;
  gap: 0;
  border-top: 1px solid rgba(255,255,255,0.15);
  margin: 0 -1.5rem;
}

.lms-kpi-chip {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  border-right: 1px solid rgba(255,255,255,0.12);
  cursor: default;
}

.lms-kpi-chip:last-child {
  border-right: none;
}

.lms-kpi-icon {
  font-size: 1rem;
  opacity: 0.75;
  flex-shrink: 0;
}

.lms-kpi-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}

.lms-kpi-label {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* KPI accent overrides — danger turns the value red-tinted */
.lms-kpi-danger .lms-kpi-value { color: #fca5a5; }
.lms-kpi-success .lms-kpi-value { color: #86efac; }

@media (max-width: 575.98px) {
  .lms-kpi-bar { flex-wrap: wrap; }
  .lms-kpi-chip { flex: 0 0 50%; border-bottom: 1px solid rgba(255,255,255,0.12); }
  .lms-kpi-chip:nth-child(even) { border-right: none; }
}

/* Layer 2 — Tile accent bars + icon colouring */

/* 4px left accent bar per tile category */
.lms-tile-accent-bar-blue   { border-left: 3px solid #3b82f6; }
.lms-tile-accent-bar-amber  { border-left: 3px solid #f59e0b; }
.lms-tile-accent-bar-green  { border-left: 3px solid #22c55e; }
.lms-tile-accent-bar-purple { border-left: 3px solid #a855f7; }
.lms-tile-accent-bar-slate  { border-left: 3px solid #94a3b8; }

/* Tile icon background tints per accent */
.lms-tile-icon-blue   { background-color: #eff6ff; color: #2563eb; }
.lms-tile-icon-amber  { background-color: #fffbeb; color: #d97706; }
.lms-tile-icon-green  { background-color: #f0fdf4; color: #16a34a; }
.lms-tile-icon-purple { background-color: #faf5ff; color: #9333ea; }
.lms-tile-icon-slate  { background-color: #f1f5f9; color: #64748b; }

/* Stat chips — replace the plain lms-tile-stat numbers */
.lms-tile-stat-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
  min-width: 2.2rem;
}

.lms-tile-stat-chip.lms-chip-lg {
  font-size: 1.6rem;
  padding: 0.25rem 0.75rem;
  border-radius: 10px;
}

.lms-chip-blue   { background: #eff6ff; color: #1d4ed8; }
.lms-chip-green  { background: #f0fdf4; color: #15803d; }
.lms-chip-amber  { background: #fffbeb; color: #b45309; }
.lms-chip-red    { background: #fef2f2; color: #b91c1c; }
.lms-chip-purple { background: #faf5ff; color: #7c3aed; }
.lms-chip-slate  { background: #f1f5f9; color: #475569; }

/* stat-pair vertical layout for donut row */
.lms-tile-stat-pair-vert {
  flex-direction: column;
  gap: 0.5rem;
}

/* Layer 3 — Donut arc (my_courses completion %) */
.lms-donut-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.lms-donut {
  --pct: 0;
  --size: 62px;
  --stroke: 7px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: conic-gradient(
    #3b82f6 calc(var(--pct) * 1%),
    #e2e8f0 calc(var(--pct) * 1%)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

/* Inner white circle to create donut hole */
.lms-donut::after {
  content: '';
  position: absolute;
  inset: var(--stroke);
  border-radius: 50%;
  background: #ffffff;
}

.lms-donut-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--lms-text);
  z-index: 1;
  position: relative;
}

/* Layer 3 — Traffic light (compliance_due) */
.lms-traffic-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.lms-traffic-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

.lms-traffic-red    { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.45); }
.lms-traffic-amber  { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.45); }
.lms-traffic-green  { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.45); }

/* Layer 4 — Empty / zero-state per-tile */
.lms-empty-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.5rem 0.25rem 0;
  gap: 0.3rem;
}

.lms-empty-tile p {
  font-size: 0.78rem;
  color: var(--lms-muted);
  margin: 0;
  line-height: 1.35;
}

/* CTA variant — slightly more padding for tiles like AI assistant */
.lms-empty-tile-cta {
  padding: 0.75rem 0.25rem;
}

.lms-empty-tile-icon {
  font-size: 1.75rem;
  display: block;
  opacity: 0.55;
}

.lms-empty-icon-blue   { color: #3b82f6; }
.lms-empty-icon-green  { color: #22c55e; }
.lms-empty-icon-amber  { color: #f59e0b; }
.lms-empty-icon-purple { color: #a855f7; }
.lms-empty-icon-slate  { color: #94a3b8; }

/* Full-page empty state (no tiles at all) */
.lms-empty-state-icon {
  font-size: 2.25rem;
  color: var(--lms-muted);
  display: block;
  margin-bottom: 0.75rem;
}


/* ═══════════════════════════════════════════════════════════════════════════
   LEFT SIDEBAR NAVIGATION  (Session 24)
   ─────────────────────────────────────────────────────────────────────────
   Layout tokens
   --lms-sidebar-w          220px   expanded width
   --lms-sidebar-w-collapsed 56px   icon-rail width
   --lms-topbar-h            52px   slim top bar height
═══════════════════════════════════════════════════════════════════════════ */

:root {
  --lms-sidebar-w:          220px;
  --lms-sidebar-w-collapsed: 56px;
  --lms-topbar-h:            52px;
  --lms-sidebar-bg:          #1a1f2e;
  --lms-sidebar-text:        #c9d1de;
  --lms-sidebar-text-active: #ffffff;
  --lms-sidebar-accent:      #1a56db;
  --lms-sidebar-hover-bg:    rgba(255,255,255,0.07);
  --lms-sidebar-active-bg:   rgba(26,86,219,0.25);
  --lms-sidebar-border:      rgba(255,255,255,0.08);
  --lms-sidebar-group-label: rgba(255,255,255,0.38);
  --lms-sidebar-transition:  width 0.22s ease, transform 0.22s ease;
}

/* ── Top bar ────────────────────────────────────────────────────────────── */

.lms-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--lms-topbar-h);
  background: var(--lms-primary);
  border-bottom: 1px solid rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  z-index: 1040;
  gap: 0.75rem;
}

.lms-topbar-brand {
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.lms-topbar-brand .lms-brand-accent { color: rgba(255,255,255,0.72); }

.lms-topbar-toggle {
  background: none;
  border: none;
  color: rgba(255,255,255,0.75);
  padding: 0.35rem;
  cursor: pointer;
  border-radius: 6px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.12s, background 0.12s;
}

.lms-topbar-toggle:hover { color: #ffffff; background: rgba(255,255,255,0.12); }

.lms-topbar-spacer { flex: 1; }

.lms-topbar-user {
  position: relative;
}

/* Buttons inside the topbar always render as white-ghost regardless of Bootstrap theme */
.lms-topbar .btn-outline-secondary,
.lms-topbar .btn-outline-primary,
.lms-topbar .lms-user-menu {
  color: rgba(255,255,255,0.88) !important;
  border-color: rgba(255,255,255,0.35) !important;
  background: transparent !important;
}

.lms-topbar .btn-outline-secondary:hover,
.lms-topbar .btn-outline-primary:hover,
.lms-topbar .lms-user-menu:hover {
  color: #ffffff !important;
  border-color: rgba(255,255,255,0.65) !important;
  background: rgba(255,255,255,0.12) !important;
}

.lms-topbar .lms-badge-admin {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
}

/* ── Sidebar shell ──────────────────────────────────────────────────────── */

.lms-sidebar {
  position: fixed;
  top: var(--lms-topbar-h);
  left: 0;
  bottom: 0;
  width: var(--lms-sidebar-w);
  background: var(--lms-sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1030;
  transition: var(--lms-sidebar-transition);
}

/* Hidden state — fully off-screen on desktop */
.lms-sidebar.sidebar-hidden {
  transform: translateX(-100%);
}

/* ── Sidebar scroll region ──────────────────────────────────────────────── */

.lms-sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.lms-sidebar-scroll::-webkit-scrollbar { width: 4px; }
.lms-sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

/* ── Group label ─────────────────────────────────────────────────────────── */

.lms-sidebar-group {
  margin-top: 0.6rem;
}

.lms-sidebar-group-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lms-sidebar-group-label);
  padding: 0.55rem 1rem 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.15s;
}


/* ── Nav items ───────────────────────────────────────────────────────────── */

.lms-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.52rem 0.9rem 0.52rem 1rem;
  color: var(--lms-sidebar-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  border-radius: 0;
  transition: background 0.1s, color 0.1s;
  position: relative;
}

.lms-sidebar-link:hover {
  background: var(--lms-sidebar-hover-bg);
  color: var(--lms-sidebar-text-active);
  text-decoration: none;
}

.lms-sidebar-link.active {
  background: var(--lms-sidebar-active-bg);
  color: var(--lms-sidebar-text-active);
  font-weight: 600;
}

/* Active left accent bar */
.lms-sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--lms-sidebar-accent);
  border-radius: 0 2px 2px 0;
}

.lms-sidebar-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.lms-sidebar-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.15s;
}


/* ── Divider ─────────────────────────────────────────────────────────────── */

.lms-sidebar-divider {
  border: none;
  border-top: 1px solid var(--lms-sidebar-border);
  margin: 0.4rem 0;
}

/* ── Pin/unpin footer ───────────────────────────────────────────────────── */

.lms-sidebar-footer {
  border-top: 1px solid var(--lms-sidebar-border);
  padding: 0.5rem 0;
  flex-shrink: 0;
}

.lms-sidebar-pin-btn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.5rem 0.9rem 0.5rem 1rem;
  background: none;
  border: none;
  color: var(--lms-sidebar-group-label);
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  transition: color 0.12s;
  text-align: left;
}

.lms-sidebar-pin-btn:hover { color: var(--lms-sidebar-text-active); }

.lms-sidebar-pin-btn .lms-sidebar-label {
  font-size: 0.8rem;
}

/* ── Page layout wrapper ────────────────────────────────────────────────── */

.lms-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.lms-content-wrap {
  margin-top: var(--lms-topbar-h);
  margin-left: var(--lms-sidebar-w);
  flex: 1;
  transition: margin-left 0.22s ease;
  min-width: 0;
}

/* No sidebar — content fills full width */
.lms-content-wrap.sidebar-hidden {
  margin-left: 0;
}

/* ── Mobile (≤ 991px) ───────────────────────────────────────────────────── */

@media (max-width: 991.98px) {
  .lms-sidebar {
    transform: translateX(-100%);
    width: var(--lms-sidebar-w) !important;  /* always full width on mobile */
    box-shadow: none;
  }

  .lms-sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.28);
  }

  .lms-content-wrap,
  .lms-content-wrap.sidebar-collapsed {
    margin-left: 0 !important;
  }

  /* Mobile overlay backdrop */
  .lms-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1029;
  }

  .lms-sidebar-backdrop.visible { display: block; }
}

@media (min-width: 992px) {
  .lms-sidebar-backdrop { display: none !important; }
  /* Hide hamburger expand hint on desktop */
  .lms-topbar-mobile-only { display: none !important; }
}

/* ── Flash messages inside content wrap ─────────────────────────────────── */
.lms-content-wrap .lms-flash-region {
  padding: 0.75rem 1.5rem 0;
}

/* ── CDS-0: Content Design Studio — capability tile + picker card ─────────── */

/* Studio capability tile — card with hover lift, used in studio/index.html */
.lms-cds-tile {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--lms-border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem 1rem;
  height: 100%;
  min-height: 120px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
  color: inherit;
}

.lms-cds-tile:hover {
  box-shadow: 0 2px 12px rgba(26, 86, 219, 0.09);
  border-color: #c5d4f7;
  text-decoration: none;
  color: inherit;
}

/* Disabled / coming-soon variant — muted appearance, no hover lift */
.lms-cds-tile-disabled {
  cursor: default;
  opacity: 0.72;
}

.lms-cds-tile-disabled:hover {
  box-shadow: none;
  border-color: var(--lms-border);
}

/* Studio "Create New" picker card — horizontal row layout */
.lms-cds-picker {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: #ffffff;
  border: 1px solid var(--lms-border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
  color: inherit;
}

.lms-cds-picker:hover {
  box-shadow: 0 2px 12px rgba(26, 86, 219, 0.09);
  border-color: #c5d4f7;
  text-decoration: none;
  color: inherit;
}

/* Disabled picker — coming-soon items */
.lms-cds-picker-disabled {
  cursor: default;
  opacity: 0.65;
}

.lms-cds-picker-disabled:hover {
  box-shadow: none;
  border-color: var(--lms-border);
}

/* ── CDS Studio home — workspace layout (two-column redesign) ─────────────── */

/* Section heading — replaces the old text-uppercase muted h6 */
.lms-cds-section-heading {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--lms-muted);
}

/* "All drafts →" link alongside each section heading */
.lms-cds-section-link {
  font-size: 0.78rem;
  color: var(--lms-blue);
  text-decoration: none;
  white-space: nowrap;
}

.lms-cds-section-link:hover { text-decoration: underline; }

/* Compact tool card — 2-up grid in the right column */
.lms-cds-tool-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--lms-border);
  border-radius: 10px;
  padding: 0.85rem 0.9rem 0.8rem;
  height: 100%;
  min-height: 90px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
  color: inherit;
}

.lms-cds-tool-card:hover {
  box-shadow: 0 2px 10px rgba(26, 86, 219, 0.09);
  border-color: #c5d4f7;
  text-decoration: none;
  color: inherit;
}

.lms-cds-tool-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--lms-text);
  line-height: 1.25;
  margin-bottom: 0.2rem;
}

.lms-cds-tool-desc {
  font-size: 0.72rem;
  color: var(--lms-muted);
  line-height: 1.35;
}

/* "Jump Back In" table — no header, compact rows */
.lms-cds-table td {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  border-color: #f3f4f6;
}

.lms-cds-table tr:last-child td { border-bottom: none; }

/* "Needs Attention" banner card */
.lms-cds-attention-card {
  background: #fffbeb;
  border: 1px solid #fde68a !important;
}

/* Inline status chips inside the attention card */
.lms-cds-attention-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
}

.lms-cds-chip-draft {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.lms-cds-chip-draft:hover {
  background: #e2e8f0;
  color: var(--lms-text);
}

.lms-cds-chip-review {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.lms-cds-chip-review:hover {
  background: #dbeafe;
  color: #1e40af;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTENT DESIGN STUDIO — Option C three-panel editorial shell
   ─────────────────────────────────────────────────────────────────────────
   Layout:
     lms-studio-shell   — full-height flex column, fills lms-content-wrap
     lms-studio-header  — branded top bar with actions (sits below lms-topbar)
     lms-studio-body    — three-column grid: rail | centre | aside
     lms-studio-rail    — left tool nav (192px)
     lms-studio-centre  — pipeline ribbon + scrollable content list (flex 1)
     lms-studio-aside   — health panel (240px)
   ─────────────────────────────────────────────────────────────────────────
   Design language: dark rail on left (echoes the global sidebar), light centre
   (airy editorial workspace), muted aside (data at a glance).
   The header bar uses a glass-morphism gradient that picks up --lms-primary
   at 90% opacity — brand-aware, slightly "cool".
═══════════════════════════════════════════════════════════════════════════ */

/* ── Shell container ─────────────────────────────────────────────────────── */

.lms-studio-shell {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--lms-topbar-h));
  background: #f4f6fb;
}

/* ── Studio header bar ───────────────────────────────────────────────────── */

.lms-studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--lms-primary) 92%, #000) 0%,
    color-mix(in srgb, var(--lms-primary) 72%, #0d2040) 100%
  );
  border-bottom: 1px solid rgba(0,0,0,0.18);
  flex-shrink: 0;
}

.lms-studio-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.lms-studio-logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: rgba(255,255,255,0.9);
  flex-shrink: 0;
}

.lms-studio-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.lms-studio-subtitle {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.55);
  margin-top: 1px;
  letter-spacing: 0.01em;
}

.lms-studio-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Ghost action buttons */
.lms-studio-action-btn {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255,255,255,0.82);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 6px;
  padding: 0.3rem 0.75rem;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}

.lms-studio-action-btn:hover {
  background: rgba(255,255,255,0.18);
  color: #ffffff;
  text-decoration: none;
}

/* Primary create button — solid white */
.lms-studio-create-btn {
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--lms-primary);
  background: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 0.35rem 1rem;
  text-decoration: none;
  transition: background 0.12s, box-shadow 0.12s;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

.lms-studio-create-btn:hover {
  background: #f0f4ff;
  color: var(--lms-primary);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.22);
}

/* ── Body — three-column grid ────────────────────────────────────────────── */

.lms-studio-body {
  display: grid;
  grid-template-columns: 192px 1fr 240px;
  grid-template-rows: 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Left rail ───────────────────────────────────────────────────────────── */

.lms-studio-rail {
  background: #1a1f2e;   /* same dark as global sidebar */
  border-right: 1px solid rgba(255,255,255,0.06);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 0 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.lms-studio-rail::-webkit-scrollbar { width: 4px; }
.lms-studio-rail::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

.lms-studio-rail-group {
  margin-top: 0.4rem;
  padding-bottom: 0.2rem;
}

.lms-studio-rail-group + .lms-studio-rail-group {
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-top: 0.5rem;
  padding-top: 0.4rem;
}

.lms-studio-rail-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.32);
  padding: 0.5rem 1rem 0.2rem;
  white-space: nowrap;
}

.lms-studio-rail-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.9rem 0.45rem 1rem;
  color: rgba(255,255,255,0.62);
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 400;
  border-radius: 0;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.lms-studio-rail-link:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.92);
  text-decoration: none;
}

.lms-studio-rail-link.active {
  background: rgba(26,86,219,0.28);
  color: #ffffff;
  font-weight: 600;
}

.lms-studio-rail-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--lms-blue);
  border-radius: 0 2px 2px 0;
}

/* Rail icon chips — small coloured squares */
.lms-studio-rail-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.78rem;
}

/* Colour variants — tinted glass on dark bg */
.lms-sri-blue   { background: rgba(59,130,246,0.22); color: #93c5fd; }
.lms-sri-purple { background: rgba(168,85,247,0.22); color: #d8b4fe; }
.lms-sri-amber  { background: rgba(245,158,11,0.22); color: #fcd34d; }
.lms-sri-green  { background: rgba(34,197,94,0.22);  color: #86efac; }
.lms-sri-slate  { background: rgba(148,163,184,0.18);color: #94a3b8; }
.lms-sri-red    { background: rgba(239,68,68,0.22);  color: #fca5a5; }

/* ── Centre panel — pipeline ─────────────────────────────────────────────── */

.lms-studio-centre {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  border-right: 1px solid #e9ecf0;
}

/* Ribbon tab strip */
.lms-studio-ribbon {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid #e9ecf0;
  background: #f8f9fb;
  padding: 0 1.25rem;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.lms-studio-ribbon::-webkit-scrollbar { display: none; }

.lms-ribbon-spacer { flex: 1; }

.lms-ribbon-all-link {
  font-size: 0.75rem;
  color: var(--lms-blue);
  text-decoration: none;
  white-space: nowrap;
  padding: 0.75rem 0;
}

.lms-ribbon-all-link:hover { text-decoration: underline; }

/* Individual ribbon tabs */
.lms-ribbon-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.7rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--lms-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
}

.lms-ribbon-tab:hover { color: var(--lms-text); }

.lms-ribbon-tab.active {
  color: var(--lms-blue);
  border-bottom-color: var(--lms-blue);
  font-weight: 600;
}

/* Count badge inside tab */
.lms-ribbon-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 0.68rem;
  font-weight: 700;
  background: #e9ecf0;
  color: var(--lms-muted);
}

.lms-ribbon-tab.active .lms-ribbon-count {
  background: #dbeafe;
  color: #1d4ed8;
}

/* Per-tab accent colours when active */
.lms-ribbon-tab.lms-ribbon-draft.active       { color: #64748b; border-bottom-color: #64748b; }
.lms-ribbon-tab.lms-ribbon-draft.active .lms-ribbon-count { background: #f1f5f9; color: #475569; }

.lms-ribbon-tab.lms-ribbon-review.active      { color: #d97706; border-bottom-color: #d97706; }
.lms-ribbon-tab.lms-ribbon-review.active .lms-ribbon-count { background: #fef3c7; color: #92400e; }

.lms-ribbon-tab.lms-ribbon-approved.active    { color: #16a34a; border-bottom-color: #16a34a; }
.lms-ribbon-tab.lms-ribbon-approved.active .lms-ribbon-count { background: #dcfce7; color: #15803d; }

.lms-ribbon-tab.lms-ribbon-rejected.active    { color: #dc2626; border-bottom-color: #dc2626; }
.lms-ribbon-tab.lms-ribbon-rejected.active .lms-ribbon-count { background: #fee2e2; color: #b91c1c; }

/* Pipeline scrollable list */
.lms-studio-pipeline-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0;
  scrollbar-width: thin;
  scrollbar-color: #e5e7eb transparent;
}

.lms-studio-pipeline-list::-webkit-scrollbar { width: 6px; }
.lms-studio-pipeline-list::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }

/* Pipeline row */
.lms-pipeline-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.1s;
}

.lms-pipeline-row:last-child { border-bottom: none; }

.lms-pipeline-row:hover { background: #fafbff; }

/* Status dot */
.lms-pipeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lms-pdot-draft    { background: #94a3b8; }
.lms-pdot-review   { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.2); }
.lms-pdot-approved { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.2); }
.lms-pdot-rejected { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.18); }

/* Row icon — same chip, but light bg on white */
.lms-pipeline-icon {
  background: #eff6ff !important;
  color: #2563eb !important;
  flex-shrink: 0;
}

/* Title + meta block */
.lms-pipeline-meta { flex: 1; min-width: 0; }

.lms-pipeline-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--lms-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lms-pipeline-sub {
  font-size: 0.72rem;
  color: var(--lms-muted);
  margin-top: 1px;
}

/* Status badge */
.lms-pipeline-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.lms-pbadge-draft    { background: #f1f5f9; color: #475569; }
.lms-pbadge-review   { background: #fef3c7; color: #92400e; }
.lms-pbadge-approved { background: #dcfce7; color: #15803d; }
.lms-pbadge-rejected { background: #fee2e2; color: #b91c1c; }

/* Edit action */
.lms-pipeline-action {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--lms-blue);
  text-decoration: none;
  padding: 0.2rem 0.6rem;
  border: 1px solid #dbeafe;
  border-radius: 5px;
  background: #f0f7ff;
  flex-shrink: 0;
  transition: background 0.1s, border-color 0.1s;
}

.lms-pipeline-action:hover {
  background: #dbeafe;
  border-color: #bfdbfe;
  color: #1d4ed8;
  text-decoration: none;
}

/* Pipeline empty state */
.lms-studio-empty-pipeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3.5rem 2rem;
}

.lms-studio-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #eff6ff;
  color: #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.lms-studio-empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--lms-text);
  margin: 0 0 0.35rem;
}

.lms-studio-empty-sub {
  font-size: 0.82rem;
  color: var(--lms-muted);
  margin: 0 0 1.25rem;
}

/* ── Right aside — health panel ──────────────────────────────────────────── */

.lms-studio-aside {
  background: #f8f9fb;
  border-left: 1px solid #e9ecf0;
  overflow-y: auto;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: #e5e7eb transparent;
}

.lms-studio-aside::-webkit-scrollbar { width: 4px; }
.lms-studio-aside::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }

.lms-studio-aside-section {
  padding: 1rem 1.1rem 0.75rem;
}

.lms-studio-aside-heading {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--lms-muted);
  margin-bottom: 0.75rem;
}

.lms-studio-aside-divider {
  height: 1px;
  background: #e9ecf0;
  margin: 0;
}

/* Health rows */
.lms-health-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0;
}

.lms-health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lms-hdot-blue   { background: #3b82f6; }
.lms-hdot-amber  { background: #f59e0b; }
.lms-hdot-green  { background: #22c55e; }
.lms-hdot-red    { background: #ef4444; }
.lms-hdot-purple { background: #a855f7; }
.lms-hdot-slate  { background: #94a3b8; }

.lms-health-label {
  flex: 1;
  font-size: 0.78rem;
  color: var(--lms-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lms-health-value {
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}

.lms-hval-blue   { color: #2563eb; }
.lms-hval-amber  { color: #d97706; }
.lms-hval-green  { color: #16a34a; }
.lms-hval-red    { color: #dc2626; }
.lms-hval-purple { color: #9333ea; }
.lms-hval-slate  { color: #64748b; }

/* Recently published rows */
.lms-published-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.32rem 0;
  border-radius: 4px;
  transition: background 0.1s;
  color: inherit;
}

.lms-published-row:hover { background: #f0f4ff; color: inherit; }

.lms-published-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.lms-published-title {
  flex: 1;
  font-size: 0.78rem;
  color: var(--lms-text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lms-published-age {
  font-size: 0.7rem;
  color: var(--lms-muted);
  flex-shrink: 0;
}

/* Quick action 2×2 grid */
.lms-studio-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.lms-studio-qa-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.7rem 0.4rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--lms-muted);
  text-decoration: none;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
  text-align: center;
}

.lms-studio-qa-btn i {
  font-size: 1.1rem;
  color: var(--lms-blue);
}

.lms-studio-qa-btn:hover {
  border-color: #c5d4f7;
  background: #f0f7ff;
  color: var(--lms-blue);
  text-decoration: none;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

/* Tablet: hide aside, rail collapses to icon-only strip */
@media (max-width: 1199.98px) {
  .lms-studio-body {
    grid-template-columns: 56px 1fr 0;
  }
  .lms-studio-aside { display: none; }
  .lms-studio-rail-label,
  .lms-studio-rail-link span:not(.lms-studio-rail-icon) {
    display: none;
  }
  .lms-studio-rail-link {
    justify-content: center;
    padding: 0.55rem;
  }
  .lms-studio-rail-group + .lms-studio-rail-group { border-top: none; }
}

/* Mobile (≤ 767px): full-width single column, rail becomes top tab strip */
@media (max-width: 767.98px) {
  .lms-studio-shell { min-height: unset; }

  .lms-studio-header {
    padding: 0.6rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .lms-studio-header-actions .lms-studio-action-btn { display: none; }

  .lms-studio-body {
    display: flex;
    flex-direction: column;
  }

  .lms-studio-rail {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.35rem 0.75rem;
    background: #1a1f2e;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    gap: 0.25rem;
  }

  .lms-studio-rail-group {
    display: contents;
  }

  .lms-studio-rail-group + .lms-studio-rail-group { border-top: none; }

  .lms-studio-rail-label { display: none; }

  .lms-studio-rail-link {
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    white-space: nowrap;
    flex-direction: row;
  }

  .lms-studio-rail-link span:not(.lms-studio-rail-icon) { display: inline; font-size: 0.78rem; }

  .lms-studio-rail-link.active::before { display: none; }
  .lms-studio-rail-link.active { border-radius: 6px; }

  .lms-studio-centre { min-height: 60vh; }
}

/* ── Media Library — thumbnail cards (MOD05) ─────────────────────────────── */

/* Base thumbnail container — taller than the old 140px hard-code */
.lms-media-thumb {
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem 0.375rem 0 0; /* match Bootstrap card top radius */
}

/* Colour-coded fallback backgrounds per asset type */
.lms-media-thumb--video    { background-color: #e8edf5; }
.lms-media-thumb--audio    { background-color: #e8f5ed; }
.lms-media-thumb--document { background-color: #fef8e7; }
.lms-media-thumb--image    { background-color: #f0eafa; }

/* Fallback icon — larger and type-coloured */
.lms-media-thumb__icon {
  font-size: 3.5rem;
  line-height: 1;
}
.lms-media-thumb__icon--video    { color: #1a56db; }   /* Clearscope blue */
.lms-media-thumb__icon--audio    { color: #15803d; }   /* green */
.lms-media-thumb__icon--document { color: #b45309; }   /* amber */
.lms-media-thumb__icon--image    { color: #6b21a8; }   /* purple */

/* Duration pill — bottom-left overlay on video thumbnails */
.lms-media-thumb__duration {
  position: absolute;
  bottom: 6px;
  left: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  pointer-events: none;
}

/* Type badge — bottom-right overlay */
.lms-media-thumb__type-badge {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 8px;
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lms-media-thumb__type-badge--video    { background: #dbeafe; color: #1e429f; }
.lms-media-thumb__type-badge--audio    { background: #dcfce7; color: #15803d; }
.lms-media-thumb__type-badge--document { background: #fff7ed; color: #9a3412; }
.lms-media-thumb__type-badge--image    { background: #f3e8ff; color: #6b21a8; }

/* Card hover lift */
.lms-media-thumb + .card-body { }
.card:has(.lms-media-thumb) {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.card:has(.lms-media-thumb):hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12) !important;
  transform: translateY(-2px);
}

/* ── Assessment take — form-check visibility & unanswered highlight ────────── */

/* Empty radio/checkbox: stronger border so the boxes are visible on-screen
   and in screen recordings. Bootstrap default is 1px #adb5bd which disappears
   on video. We use a 2px solid border and a slightly off-white fill. */
.assessment-form .form-check-input[type="radio"],
.assessment-form .form-check-input[type="checkbox"] {
  width: 1.15em;
  height: 1.15em;
  border: 2px solid #6b7280;   /* mid-grey — visible on white + in video */
  background-color: #f9fafb;
}

/* Hover: darken border so the target is obvious */
.assessment-form .form-check-input[type="radio"]:hover,
.assessment-form .form-check-input[type="checkbox"]:hover {
  border-color: var(--lms-blue-dark);
  cursor: pointer;
}

/* Checked state: Clearscope blue fill — unchanged from Bootstrap default,
   but explicit here so it stays even if Bootstrap resets. */
.assessment-form .form-check-input:checked {
  background-color: var(--lms-blue);
  border-color: var(--lms-blue);
}

/* Unanswered highlight — applied by JS on failed submission attempt.
   Amber left-border + pale amber background on the question card.
   WCAG: colour alone is not the sole indicator — we also add a text badge. */
.assessment-question--unanswered {
  border-left: 4px solid #f59e0b !important;
  background-color: #fffbeb !important;
  animation: unansweredPulse 0.6s ease-out;
}

@keyframes unansweredPulse {
  0%   { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Badge shown inside the card header when unanswered */
.assessment-question--unanswered .unanswered-badge {
  display: inline-flex !important;
}
