@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --topbar-h: 57px;
  --primary: #ac1f25;
  --primary-dark: #7e1419;
  --primary-darker: #530a0e;
  --primary-light: #fdf2f4;
  --primary-subtle: #fae8eb;
  --primary-glow: rgba(172, 31, 37, 0.18);
  
  --bs-primary: #ac1f25;
  --bs-primary-rgb: 172, 31, 37;
  --bs-font-sans-serif: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --bg-app: #f4f6fa;
  --sidebar-course-bg: #fdf8f9;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
}

body {
  font-family: var(--bs-font-sans-serif);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Header & Navbar */
.app-navbar {
  background: linear-gradient(135deg, #530a0e 0%, #ac1f25 60%, #87161b 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(83, 10, 14, 0.15);
}

.brand-emblem {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

/* Mobile Offcanvas Drawer */
.mobile-offcanvas {
  background: linear-gradient(180deg, #530a0e 0%, #7e1419 40%, #ac1f25 100%);
  width: 310px !important;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.35);
}

.mobile-offcanvas .nav-link {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.mobile-offcanvas .nav-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transform: translateX(3px);
}

.mobile-offcanvas .nav-link.active {
  background: #ffffff;
  color: var(--primary-darker) !important;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* App Body & Sidebar Layout */
.app-body-wrapper {
  display: flex;
  min-height: calc(100vh - var(--topbar-h));
  position: relative;
  background-color: var(--bg-app);
}

/* Desktop Left Sidebar */
.app-sidebar {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
  z-index: 1000;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

/* Course workspace (Level 2): a soft brand tint so the mode switch is felt,
   and the context card flips to white so it lifts off the tinted panel. */
.app-sidebar[data-nav-mode="course"] {
  background: var(--sidebar-course-bg);
  border-right-color: var(--primary-subtle);
}
.app-sidebar[data-nav-mode="course"] .sidebar-course-context {
  background: #ffffff;
  border-color: var(--primary-subtle);
  box-shadow: 0 1px 3px rgba(172, 31, 37, 0.07);
}
.app-sidebar[data-nav-mode="course"] .sidebar-back-link {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--primary-subtle);
}
.app-sidebar[data-nav-mode="course"] .sidebar-back-link:hover {
  background: #ffffff;
}
/* The default hover (--primary-light) is almost the panel colour here, so the
   course-mode hover steps up to --primary-subtle to stay legible. */
.app-sidebar[data-nav-mode="course"] .sidebar-link:hover {
  background: var(--primary-subtle);
}

.app-sidebar::-webkit-scrollbar {
  width: 5px;
}
.app-sidebar::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 4px;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
}

.sidebar-category-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 8px 12px 4px;
}

.sidebar-nav-list {
  gap: 3px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-link {
  color: #475569;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.18s ease;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  text-decoration: none;
}

.sidebar-link i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  color: #64748b;
  transition: color 0.18s ease;
}

.sidebar-link:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.sidebar-link:hover i {
  color: var(--primary);
}

.sidebar-link.active {
  background: var(--primary) !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(172, 31, 37, 0.25);
}

.sidebar-link.active i {
  color: #ffffff !important;
}

/* Main Content Area */
.main-content-wrapper {
  min-width: 0; /* Prevents flex overflow issues with wide tables */
  max-width: 100%;
  flex: 1;
}

/* Only the active tab section is visible; the rest stay rendered (so their state and
   scroll position persist) but hidden, matching the single-active-tab behavior the
   sidebar and showTab() already assume. */
section.tab {
  display: none;
}
section.tab.active {
  display: block;
}

/* Premium Card Components */
.premium-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03), 0 1px 3px rgba(15, 23, 42, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 24px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .premium-card {
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 12px;
  }
}

.premium-card:hover {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.card-title-lg {
  font-size: 17.5px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.3px;
  margin-bottom: 2px;
}

.card-subtitle-custom {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

/* Stat & Metric Cards */
.stat-card-custom {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}
.stat-card-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(172, 31, 37, 0.08);
}
.stat-card-custom::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3.5px;
  background: var(--primary);
}
.stat-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* Custom Buttons */
.btn-primary-custom {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 13.5px;
  box-shadow: 0 2px 6px rgba(172, 31, 37, 0.25);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary-custom:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(172, 31, 37, 0.35);
  transform: translateY(-1px);
}

.btn-secondary-custom {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  color: #334155;
  font-weight: 600;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13.5px;
  transition: all 0.2s ease;
}
.btn-secondary-custom:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Form Controls */
.form-label-custom {
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 5px;
}

.form-control-custom, .form-select-custom {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--text-main);
  background-color: #ffffff;
  transition: all 0.15s ease;
}
.form-control-custom:focus, .form-select-custom:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}

/* Checkboxes, radios and switches ship Bootstrap blue by default, which reads as
   a foreign accent in an otherwise fully branded UI. One rule rebrands every one
   of them (role checkboxes, notification switches, approval switches, ...). */
.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}
.form-check-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
/* Bootstrap draws the unchecked switch knob via this custom property, and its
   default focus variant is blue — retint it rather than restating the rule. */
.form-switch .form-check-input:focus {
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23d4959a'/%3e%3c/svg%3e");
}

/* Marks Spreadsheet Grid (Frozen Header & Sticky Columns) */
.marks-grid-wrapper {
  max-height: 68vh;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  position: relative;
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
}

.marks-table-custom {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 13.5px;
  margin-bottom: 0;
}

.marks-table-custom th, .marks-table-custom td {
  border-width: 0 1px 1px 0;
  border-color: var(--border-color);
  padding: 8px 10px;
  vertical-align: middle;
}

.marks-table-custom thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--primary-light);
  color: var(--primary-darker);
  font-weight: 700;
  font-size: 12.5px;
}
.marks-table-custom thead tr:nth-child(2) th {
  top: 36px;
  z-index: 10;
}

.marks-table-custom .sticky-col-1,
.marks-table-custom .sticky-col-2,
.marks-table-custom .sticky-col-3 {
  position: sticky;
  background: #ffffff;
}

.marks-table-custom td.sticky-col-1,
.marks-table-custom td.sticky-col-2,
.marks-table-custom td.sticky-col-3 {
  z-index: 5;
}

.marks-table-custom th.sticky-col-1,
.marks-table-custom th.sticky-col-2,
.marks-table-custom th.sticky-col-3 {
  z-index: 15;
  background: var(--primary-subtle);
}

.marks-table-custom .sticky-col-1 { left: 0; width: 44px; min-width: 44px; text-align: center; }
.marks-table-custom .sticky-col-2 { left: 44px; width: 130px; min-width: 130px; }
.marks-table-custom .sticky-col-3 { left: 174px; min-width: 160px; }

.marks-table-custom tbody tr:nth-child(even) td.sticky-col-1,
.marks-table-custom tbody tr:nth-child(even) td.sticky-col-2,
.marks-table-custom tbody tr:nth-child(even) td.sticky-col-3 {
  background: #fafbfc;
}

.marks-input-field {
  width: 65px;
  padding: 4px 6px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
  font-weight: 600;
  transition: all 0.15s ease;
}
.marks-input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
  outline: none;
}

/* Map Cells */
.map-cell {
  width: 48px;
  text-align: center !important;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  transition: background 0.15s;
  border-radius: 6px;
}
.map-cell.m3 { background: var(--primary) !important; color: #ffffff !important; }
.map-cell.m2 { background: #df585e !important; color: #ffffff !important; }
.map-cell.m1 { background: #fbebee !important; color: var(--primary-dark) !important; }
.map-cell.m0 { color: #94a3b8; }
.map-cell:hover { opacity: 0.88; transform: scale(0.96); }

/* T&L Plan */
.tla-guide {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
  counter-reset: tla;
  padding: 0;
  margin: 0 0 16px;
}
.tla-guide li {
  counter-increment: tla;
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--primary-light);
  border-radius: 8px;
  padding: 8px 10px 8px 36px;
  position: relative;
}
.tla-guide li::before {
  content: counter(tla);
  position: absolute;
  left: 10px;
  top: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tla-guide b { color: #0f172a; }
.tla-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 768px) {
  .tla-guide, .tla-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.tla-stat {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  background: #f8fafc;
}
.tla-stat-num { font-size: 22px; font-weight: 700; color: #0f172a; line-height: 1.1; }
.tla-stat-num span { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-left: 2px; }
.tla-stat-lbl { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.tla-stat-bar { height: 4px; border-radius: 4px; background: var(--border-color); margin-top: 8px; overflow: hidden; }
.tla-stat-bar div { height: 100%; background: var(--primary); border-radius: 4px; transition: width 0.3s; }

.tla-cov { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-color); }
.tla-cov-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.tla-cov-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.tla-cov-count { font-size: 12.5px; font-weight: 700; color: #16a34a; }
.tla-cov-count.is-missing { color: var(--primary); }
.tla-cov-hint { font-size: 11.5px; color: #94a3b8; }
.tla-cov-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tla-cov-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px 3px 8px;
  border: 1px solid;
  background: #ffffff;
  cursor: pointer;
  transition: background 0.15s;
}
.tla-cov-chip.ok { color: #166534; border-color: #bbf7d0; background: #f0fdf4; }
.tla-cov-chip.ok:hover { background: #dcfce7; }
.tla-cov-chip.missing { color: var(--primary); border-color: #fecaca; border-style: dashed; background: #fef2f2; }
.tla-cov-chip.missing:hover { background: #fee2e2; }
.tla-cov-wk { font-weight: 600; color: #15803d; opacity: 0.85; }
.tla-cov-empty { font-size: 12.5px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 12px; }

.tla-weeks { display: flex; flex-direction: column; gap: 12px; }
.tla-weeks.hide-done .tla-week-card[data-status="done"],
.tla-weeks.hide-done .tla-week-card[data-status="off"] { display: none; }
.tla-week-card {
  border: 1px solid var(--border-color);
  border-left: 4px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px 16px 14px;
  transition: box-shadow 0.3s, border-color 0.2s;
}
.tla-week-card[data-status="done"] { border-left-color: #16a34a; }
.tla-week-card[data-status="partial"] { border-left-color: #f59e0b; }
.tla-week-card[data-status="off"] { border-left-color: #94a3b8; background: #f8fafc; }
.tla-week-card.flash { box-shadow: 0 0 0 3px var(--primary-glow); }
.tla-week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.tla-week-num { font-weight: 700; font-size: 14px; color: #0f172a; }
.tla-status { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.tla-status.done { color: #16a34a; }
.tla-status.partial { color: #b45309; }
.tla-status.empty { color: #94a3b8; }
.tla-status.off { color: #64748b; }
.tla-kind-select { width: auto; font-size: 12px; padding-top: 2px; padding-bottom: 2px; }
.tla-kind-note { margin-top: 10px; font-size: 12.5px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tla-kind-note.is-short { color: #b45309; font-weight: 600; }
.tla-week-body {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 16px;
}
@media (max-width: 768px) {
  .tla-week-body { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
.tla-field-lbl {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}
.tla-tlo-code {
  text-transform: none;
  font-size: 11px;
  color: var(--primary-dark);
  background: var(--primary-light);
  border-radius: 4px;
  padding: 0 5px;
  margin-left: 4px;
}
.tla-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 31px; align-items: center; }
.tla-co-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px dashed #cbd5e1;
  background: #ffffff;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px 3px 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tla-co-chip:hover { border-color: var(--primary); color: var(--primary); }
.tla-co-chip.on { background: var(--primary); border: 1px solid var(--primary); color: #ffffff; }

/* CO Exit Survey */
.svy-guide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 768px) { .svy-guide { grid-template-columns: minmax(0, 1fr); } }
.svy-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 24px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  font-size: 13px;
}
.svy-settings .bi { color: var(--text-muted); margin-right: 2px; }
.svy-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--text-muted); }
.svy-legend span { display: inline-flex; align-items: center; gap: 5px; }
.svy-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.svy-dot.r5, .svy-seg.r5 { background: #15803d; }
.svy-dot.r4, .svy-seg.r4 { background: #4ade80; }
.svy-dot.r3, .svy-seg.r3 { background: #cbd5e1; }
.svy-dot.r2, .svy-seg.r2 { background: #fb923c; }
.svy-dot.r1, .svy-seg.r1 { background: #dc2626; }
.svy-table thead th {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  vertical-align: bottom;
  white-space: nowrap;
}
.svy-rate-th { width: 78px; font-size: 14px !important; color: #0f172a !important; }
.svy-rate-th div { font-size: 10.5px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.svy-table tbody td { border-bottom: 1px solid var(--border-color); padding-top: 10px; padding-bottom: 10px; }
.svy-table tbody tr:hover td { background: #fcfcfd; }
.svy-table tfoot td { background: #f8fafc; border-top: 2px solid var(--border-color); border-bottom: 0; }
.svy-co { min-width: 260px; max-width: 420px; }
.svy-statement {
  font-size: 12.5px;
  color: #334155;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.svy-note { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.svy-note.is-warn { color: #b45309; font-weight: 600; }
.svy-in-cell { padding-left: 3px !important; padding-right: 3px !important; }
.svy-input { min-width: 56px; font-weight: 600; }
.svy-input:placeholder-shown { color: #94a3b8; }
.svy-input::-webkit-outer-spin-button, .svy-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.svy-input[type=number] { -moz-appearance: textfield; }
.svy-bar-cell { min-width: 130px; }
.svy-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--border-color); }
.svy-bar.is-empty { background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 4px, #e2e8f0 4px, #e2e8f0 8px); }
.svy-seg { height: 100%; }
.svy-seg + .svy-seg { box-shadow: -1px 0 0 #ffffff; }
.svy-pct { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; white-space: nowrap; }
.svy-pct.is-met { color: #15803d; }
.svy-pct.is-below { color: var(--primary); }
.svy-pct .bi { font-size: 12px; }
.svy-tip { margin-top: 12px; font-size: 12px; color: var(--text-muted); }
.svy-tip .bi { color: #d97706; }
.svy-tip kbd { font-size: 11px; padding: 1px 5px; background: #f1f5f9; color: #0f172a; border: 1px solid var(--border-color); border-radius: 4px; }

/* Document & Reports Container */
.report-sheet-view {
  background: #ffffff;
  padding: 44px 50px;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  font-size: 13.5px;
  max-width: 960px;
  margin: 0 auto;
  border: 1px solid var(--border-color);
}
@media (max-width: 768px) {
  .report-sheet-view {
    padding: 20px 16px;
  }
}

.doc-brand-header {
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 3px double var(--primary);
  padding-bottom: 14px;
  margin-bottom: 18px;
}
.doc-brand-logo {
  width: 58px;
  height: 58px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--primary);
  font-size: 15px;
  flex-shrink: 0;
}

/* Toast Notifications */
.toast-container-custom {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1080;
}

/* Print Styles */
@media print {
  .app-navbar, .app-sidebar, .no-print, footer, .toast-container, .btn, .mobile-offcanvas, .app-breadcrumb {
    display: none !important;
  }
  body { background: #ffffff !important; }
  .app-body-wrapper { display: block !important; }
  .main-content-wrapper, main { max-width: 100% !important; padding: 0 !important; width: 100% !important; }
  section.tab { display: none !important; }
  section#tab-docs { display: block !important; }
  .report-sheet-view { box-shadow: none !important; padding: 0 !important; border: none !important; }
  .premium-card { box-shadow: none !important; border: none !important; }
  input, textarea, select { border: none !important; }
}

/* Sidebar Back Link (Level 2 Navigation) */
.sidebar-back-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-color);
  transition: all 0.15s ease;
}
.sidebar-back-link:hover {
  color: var(--primary);
  background: var(--primary-light);
  border-color: rgba(172, 31, 37, 0.2);
}
.sidebar-back-link i {
  font-size: 14px;
  transition: transform 0.15s ease;
}
.sidebar-back-link:hover i {
  transform: translateX(-3px);
}

/* Sidebar Course Context Card */
.sidebar-course-context {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.sidebar-course-context .scc-code {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.3px;
}
.sidebar-course-context .scc-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sidebar-course-context .scc-term {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 4px;
}
.readiness-meter {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.readiness-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  border-radius: 3px;
  transition: width 0.35s ease-in-out;
}
.sidebar-course-context .scc-meter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Link State Pips & Statuses */
.sidebar-link {
  position: relative;
}
.sidebar-link-state {
  margin-left: auto;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s ease;
}
.sidebar-link.is-complete .sidebar-link-state {
  color: #16a34a;
}
.sidebar-link.is-pending .sidebar-link-state {
  color: #cbd5e1;
}
.sidebar-link.active .sidebar-link-state {
  color: #ffffff !important;
}
/* Count badge (e.g. pending approvals) pinned to the right of a nav item. */
.nav-count-badge {
  display: inline-block;
  min-width: 19px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--primary);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}
/* On the active (solid red) row a red badge would disappear, so invert it. */
.sidebar-link.active .nav-count-badge {
  background: #ffffff;
  color: var(--primary);
}
.mobile-offcanvas .nav-link .nav-count-badge {
  background: #ffffff;
  color: var(--primary-darker);
}
.mobile-offcanvas .nav-link.active .nav-count-badge {
  background: var(--primary);
  color: #ffffff;
}

.sidebar-link.is-restricted {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.sidebar-link.is-restricted .sidebar-link-state {
  color: #94a3b8;
}

/* App Breadcrumb Trail */
.app-breadcrumb {
  margin-bottom: 1.25rem;
}
.app-breadcrumb .breadcrumb {
  margin-bottom: 0;
  padding: 0.45rem 0.85rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
.app-breadcrumb .breadcrumb-item a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.app-breadcrumb .breadcrumb-item a:hover {
  text-decoration: underline;
}
.app-breadcrumb .breadcrumb-item.active {
  color: var(--text-muted);
}

/* Accessibility Focus-Visible */
.sidebar-link:focus-visible,
.sidebar-back-link:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Course Catalog Card Styles */
.course-catalog-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  transition: all 0.2s ease-in-out;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}
.course-catalog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}
.course-catalog-card.is-joined {
  border-top: 3.5px solid var(--primary);
}
.course-catalog-card.is-active-course {
  border-top: 3.5px solid #16a34a;
  background: #fbfdfc;
}
.course-catalog-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.filter-pill-btn {
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-muted);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.filter-pill-btn:hover {
  background: #f8fafc;
  color: var(--text-main);
  border-color: #cbd5e1;
}
.filter-pill-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}
.filter-pill-btn.active .badge {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}
.view-toggle-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-muted);
  font-size: 14px;
  transition: all 0.15s ease;
}
.view-toggle-btn:hover {
  color: var(--text-main);
  background: #f8fafc;
}
.view-toggle-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: rgba(172, 31, 37, 0.3);
}

/* Mobile-compact Course Catalog & Controls */
@media (max-width: 767.98px) {
  .course-catalog-header-card {
    padding: 12px 14px !important;
    margin-bottom: 12px !important;
    border-radius: 12px !important;
  }
  .course-catalog-card {
    border-radius: 12px !important;
    margin-bottom: 0;
  }
  .course-catalog-card .card-inner {
    padding: 12px 14px !important;
  }
  .course-catalog-card .course-title-text {
    font-size: 13.5px !important;
    line-height: 1.3 !important;
  }
  .course-catalog-card .course-meta-text {
    font-size: 11px !important;
    margin-bottom: 8px !important;
  }
  .course-catalog-card .course-team-box {
    padding: 6px 8px !important;
    margin-bottom: 8px !important;
  }
  .course-catalog-avatar {
    width: 26px !important;
    height: 26px !important;
    font-size: 11px !important;
  }
  .filter-pill-btn {
    font-size: 11px !important;
    padding: 4px 10px !important;
    gap: 4px !important;
    white-space: nowrap;
  }
  .filter-pills-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .filter-pills-scroll::-webkit-scrollbar {
    display: none;
  }
  .view-toggle-btn {
    width: 30px !important;
    height: 30px !important;
    font-size: 12px !important;
  }
}

/* Topbar Course Search & Select */
.topbar-course-selector {
  position: relative;
}
.topbar-course-btn {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  color: #ffffff;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.18s ease;
  min-width: 170px;
  max-width: 320px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.topbar-course-btn:hover,
.topbar-course-btn:focus-visible,
.topbar-course-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.45);
  color: #ffffff;
  outline: none;
}
.topbar-course-label {
  font-size: 12.5px;
  line-height: 1.2;
}
.topbar-course-menu {
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2);
  border: 1px solid #e2e8f0;
  z-index: 1060;
  min-width: 330px;
  max-width: 420px;
  margin-top: 6px !important;
}
.topbar-course-item {
  transition: all 0.12s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.topbar-course-item:hover {
  background: #f1f5f9 !important;
}
.topbar-course-item.active-course-item {
  background: rgba(172, 31, 37, 0.05);
  border-left: 3px solid var(--primary);
}
@media (max-width: 767.98px) {
  .topbar-course-btn {
    min-width: 95px;
    max-width: 140px;
    padding: 4px 7px;
    font-size: 11px;
  }
  .topbar-course-menu {
    min-width: 280px !important;
    max-width: calc(100vw - 20px) !important;
    right: 0 !important;
    left: auto !important;
  }
}




/* Course Completion */
.completion-steps { display: flex; flex-direction: column; gap: 8px; }
.completion-step {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 14px;
}
.completion-step.done { background: #f8fafc; }
.completion-step-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  border: 2px solid #cbd5e1;
}
.completion-step.done .completion-step-icon { background: #16a34a; border-color: #16a34a; color: #ffffff; font-size: 15px; }
.completion-step-title { font-weight: 600; font-size: 13.5px; color: #0f172a; }
.completion-step-detail { font-size: 12px; color: var(--text-muted); }
.completion-advice {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 10px 14px;
  color: #78350f;
}
.completion-advice a { color: #92400e; font-weight: 600; }
.completion-done { border-left: 4px solid #16a34a; }
.completion-seal { font-size: 40px; line-height: 1; color: #16a34a; }
.completion-note {
  font-size: 13px;
  color: #334155;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
}
.completion-reopen {
  border: 1px solid #fecaca;
  background: #fef2f2;
  border-radius: 10px;
  padding: 12px 14px;
}

/* Read-only lock for completed courses */
.course-lock-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 600;
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.course-lock-banner a { color: #166534; text-decoration: underline; margin-left: auto; }
.course-locked section.tab:not(#tab-complete) .map-cell { pointer-events: none; }
.sidebar-course-context .scc-locked {
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #16a34a;
}

/* Workflow reminders bell */
.topbar-bell-btn {
  position: relative;
  width: 36px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  color: #ffffff;
  font-size: 16px;
  transition: all 0.18s ease;
}
.topbar-bell-btn:hover,
.topbar-bell-btn:focus-visible,
.topbar-bell-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.45);
  outline: none;
}
.topbar-bell-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #f59e0b;
  color: #1e293b;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px #7e1419;
}
.topbar-bell-badge.is-overdue { background: #ffffff; color: var(--primary); }
.bell-menu { width: 380px; max-width: calc(100vw - 24px); overflow: hidden; }
.bell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}
.bell-list { max-height: 360px; overflow-y: auto; }
.bell-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none;
  color: inherit;
}
.bell-item:hover { background: var(--primary-light); }
.bell-item-icon { color: #f59e0b; font-size: 15px; padding-top: 1px; }
.bell-item.is-overdue .bell-item-icon { color: var(--primary); }
.bell-item-body { min-width: 0; }
.bell-item-title { font-weight: 700; font-size: 13px; color: #0f172a; }
.bell-item-msg { font-size: 12.5px; color: #334155; margin-top: 2px; }
.bell-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}
.bell-empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 28px 16px; }
.bell-empty i { font-size: 26px; color: #16a34a; display: block; margin-bottom: 6px; }
.bell-prefs { background: #f8fafc; border-top: 1px solid var(--border-color); padding: 10px 16px 12px; }
.bell-prefs-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 6px; }
.bell-pref { padding: 4px 0; }
.bell-pref .form-check-label { font-size: 13px; font-weight: 600; }
.bell-pref-hint { font-size: 11.5px; color: var(--text-muted); padding-left: 2.5em; }

.reminder-days.is-late { color: var(--primary); font-weight: 700; }

/* Notifications page */
.bell-view-all {
  display: block;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 16px;
  color: var(--primary);
  text-decoration: none;
  border-top: 1px solid var(--border-color);
}
.bell-view-all:hover { background: var(--primary-light); }
.ntf-headline { font-size: 13.5px; color: #334155; }
.ntf-list { display: flex; flex-direction: column; }
.ntf-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 4px;
  border-top: 1px solid var(--border-color);
}
.ntf-row:first-child { border-top: 0; padding-top: 4px; }
.ntf-row-main { flex: 1; min-width: 0; }
.ntf-row-course { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ntf-code { font-weight: 700; font-size: 14.5px; color: var(--primary); }
.ntf-title { font-weight: 600; font-size: 14px; color: #0f172a; }
.ntf-flag {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary-subtle);
  border-radius: 999px;
  padding: 0 8px;
}
.ntf-row-next { display: flex; gap: 8px; align-items: baseline; margin-top: 6px; font-size: 13px; color: #334155; }
.ntf-next-tag {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #92400e;
  background: #fef3c7;
  border-radius: 4px;
  padding: 1px 6px;
}
.ntf-row.is-overdue .ntf-next-tag { color: #ffffff; background: var(--primary); }
.ntf-row-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.ntf-segs { display: inline-flex; gap: 3px; }
.ntf-seg { width: 16px; height: 6px; border-radius: 3px; background: #e2e8f0; }
.ntf-seg.done { background: #16a34a; }
.ntf-seg.current { background: #f59e0b; }
.ntf-row.is-overdue .ntf-seg.current { background: var(--primary); }
.ntf-details { margin-top: 6px; }
.ntf-details summary { font-size: 12px; font-weight: 600; color: var(--primary); cursor: pointer; width: fit-content; }
.ntf-checklist {
  list-style: none;
  padding: 8px 0 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 4px 16px;
  font-size: 12.5px;
}
.ntf-checklist li { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.ntf-checklist li a { color: inherit; text-decoration: none; }
.ntf-checklist li a:hover { text-decoration: underline; }
.ntf-checklist li.done { color: #16a34a; }
.ntf-checklist li.current { color: #0f172a; font-weight: 700; }
.ntf-checklist li.current i { color: #f59e0b; }
.ntf-go { flex-shrink: 0; margin-top: 2px; }
@media (max-width: 576px) {
  .ntf-row { flex-direction: column; gap: 10px; }
  .ntf-go { align-self: flex-start; }
}
.ntf-help {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  font-size: 12.5px;
  color: #475569;
}
.ntf-help li { margin-bottom: 4px; }
.ntf-prefs .bell-prefs { background: transparent; border-top: 0; padding: 0; }
.ntf-prefs .bell-pref { padding: 6px 0; }
.min-w-0 { min-width: 0; }

/* Administration tabs */
.admin-tabbar {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 16px;
}
.admin-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 8px;
  padding: 8px 14px;
  transition: background 0.15s, color 0.15s;
}
.admin-tab:hover { background: var(--primary-light); color: var(--primary); }
.admin-tab.active { background: var(--primary); color: #ffffff; box-shadow: 0 3px 10px rgba(172, 31, 37, 0.25); }
.admin-tab-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}
.admin-tab.active .admin-tab-count { background: #ffffff; color: var(--primary); }
.admin-pane { display: none; }
.admin-pane.active { display: block; }
.admin-subbox {
  border: 1px solid var(--border-color);
  background: #f8fafc;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

/* Admin: Reminder Rules */
.rr-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 22px;
  margin-bottom: 16px;
}
.rr-status-main { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1 1 420px; }
.rr-master { padding-left: 0; }
.rr-master .form-check-input { width: 3em; height: 1.6em; cursor: pointer; margin: 0; float: none; }
.rr-status-title { font-weight: 700; font-size: 16px; color: #0f172a; display: flex; align-items: center; gap: 8px; }
.rr-status-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.rr-status-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rr-pill { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 9px; }
.rr-pill.on { background: #dcfce7; color: #166534; }
.rr-pill.off { background: #f1f5f9; color: #64748b; }
.rr-preview {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-left: 4px solid #0ea5e9;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 16px;
}

.rr-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 16px;
  transition: opacity 0.2s;
}
.rr-grid.is-off { opacity: 0.55; }
@media (max-width: 1100px) {
  .rr-grid { grid-template-columns: minmax(0, 1fr); }
}
.rr-grid > .premium-card { margin-bottom: 0; padding: 20px; }
.rr-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.rr-card-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 17px;
}
.rr-card-title { font-weight: 700; font-size: 15px; color: #0f172a; }
.rr-card-sub { font-size: 12px; color: var(--text-muted); }

.rr-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 480px) {
  .rr-fields { grid-template-columns: minmax(0, 1fr); }
}
.rr-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0;
}
.rr-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.rr-field-label { font-size: 12px; font-weight: 600; color: #475569; display: flex; align-items: center; gap: 6px; }
.rr-field-label i { color: var(--primary); }
.rr-field .input-group-text { font-size: 12px; color: var(--text-muted); background: #ffffff; }

.rr-timeline-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin: 18px 0 8px; }
.rr-timeline { display: flex; flex-direction: column; }
.rr-event {
  display: grid;
  grid-template-columns: 58px 14px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 30px;
  position: relative;
}
.rr-event-day { font-size: 11px; font-weight: 700; color: var(--primary); text-transform: uppercase; text-align: right; }
.rr-event-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--primary);
  justify-self: center;
  position: relative;
  z-index: 1;
}
/* The rail joining the dots: drawn behind each dot except after the last event. */
.rr-event:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(58px + 8px + 6px);
  top: 50%;
  height: 100%;
  width: 2px;
  background: var(--primary-subtle);
}
.rr-event-text { font-size: 12.5px; font-weight: 600; color: #0f172a; display: inline-flex; align-items: center; gap: 6px; }
.rr-event-text i { color: var(--text-muted); }
.rr-timeline-note { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

.rr-rows { display: flex; flex-direction: column; }
.rr-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid #f1f5f9;
}
.rr-row:first-child { border-top: 0; padding-top: 0; }
.rr-row .form-switch .form-check-input { width: 2.4em; height: 1.3em; cursor: pointer; margin-top: 2px; }
.rr-row-stack { flex-direction: column; align-items: stretch; gap: 8px; }
.rr-row-text { min-width: 0; }
.rr-row-title { font-weight: 600; font-size: 13.5px; color: #0f172a; margin: 0; }
.rr-row-hint { font-size: 12px; color: var(--text-muted); }
.rr-tz { font-size: 11px; font-weight: 600; color: var(--text-muted); background: #f1f5f9; border-radius: 4px; padding: 0 5px; margin-left: 4px; }
.rr-inline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: #475569; margin-top: 6px; }
.rr-mini { width: 118px; flex-wrap: nowrap; }
.rr-mini .input-group-text { font-size: 12px; color: var(--text-muted); background: #ffffff; }
.rr-seg { display: inline-flex; background: #f1f5f9; border-radius: 9px; padding: 3px; width: fit-content; max-width: 100%; }
.rr-seg .btn { border: 0; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: #475569; padding: 5px 12px; }
.rr-seg .btn-check:checked + .btn { background: #ffffff; color: var(--primary); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
.rr-cron-cmd {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0f172a;
  border-radius: 8px;
  padding: 6px 6px 6px 12px;
}
.rr-cron-cmd code { color: #e2e8f0; font-size: 12px; word-break: break-all; flex: 1; }
.rr-copy { color: #cbd5e1; border: 1px solid #334155; }
.rr-copy:hover { color: #ffffff; background: #1e293b; }

.rr-savebar {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 16px 0 24px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.rr-savebar.is-dirty { border-color: #f59e0b; box-shadow: 0 6px 24px rgba(245, 158, 11, 0.18); }
.rr-save-state { font-size: 13px; color: #16a34a; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.rr-savebar.is-dirty .rr-save-state { color: #b45309; }

/* Marks import */
.mi-steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; flex-wrap: wrap; }
.mi-steps li { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: #475569; }
.mi-steps li span {
  width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #ffffff; font-size: 11px;
}
.mi-steps li + li::before { content: "\203A"; color: #cbd5e1; margin-right: 2px; }
.mi-box { border: 1px solid var(--border-color); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.mi-box-title { font-weight: 700; font-size: 14px; color: #0f172a; }
.mi-box-sub { font-size: 12.5px; color: var(--text-muted); margin: 2px 0 10px; }
.mi-drop {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 2px dashed #cbd5e1; border-radius: 10px; padding: 22px 12px; margin-top: 10px;
  text-align: center; cursor: pointer; font-size: 13px; color: #334155;
  transition: border-color 0.15s, background 0.15s;
}
.mi-drop i { font-size: 26px; color: var(--primary); }
.mi-drop:hover, .mi-drop.is-over { border-color: var(--primary); background: var(--primary-light); }
.mi-drop-hint { font-size: 11.5px; color: var(--text-muted); }
.mi-paste { margin-top: 10px; }
.mi-paste summary { font-size: 12.5px; font-weight: 600; color: var(--primary); cursor: pointer; width: fit-content; }
.mi-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
@media (max-width: 576px) { .mi-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mi-summary > div { border: 1px solid var(--border-color); border-radius: 10px; padding: 8px 12px; background: #f8fafc; }
.mi-summary b { display: block; font-size: 20px; color: #0f172a; line-height: 1.2; }
.mi-summary span { font-size: 11.5px; color: var(--text-muted); }
.mi-summary .is-warn { border-color: #fecaca; background: #fef2f2; }
.mi-summary .is-warn b { color: var(--primary); }
.mi-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin: 14px 0 6px; }
.mi-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mi-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 2px 9px; border: 1px solid; }
.mi-chip.ok { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.mi-chip.warn { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.mi-problems { max-height: 220px; overflow-y: auto; border: 1px solid var(--border-color); border-radius: 8px; }
.mi-problems table { font-size: 12px; }

/* A stored mark above the question maximum (entered before limits were enforced). */
.marks-input-field.is-over { border-color: #dc2626; background: #fef2f2; color: #b91c1c; font-weight: 700; }

/* Modal: Center horizontally and vertically on any screen */
.modal-dialog {
  display: flex;
  align-items: center;
  min-height: calc(100% - (var(--bs-modal-margin, 1.75rem) * 2));
}

.modal-dialog-centered {
  min-height: calc(100% - (var(--bs-modal-margin, 1.75rem) * 2));
}

