/*--------------------------------------------------------------
# Font & Color Variables
--------------------------------------------------------------*/
:root {
  --default-font: "Inter", sans-serif;
  --heading-font: "Inter", sans-serif;

  --background-color: #f4f7f9; /* Page background */
  --surface-color: #ffffff; /* Cards, panels and tables */
  --border-color: #dfe6ea;
  --default-color: #2f3a40; /* Body text */
  --heading-color: #1f2b31;
  --muted-color: #68767e; /* Secondary text */
  --accent-color: #2b7891; /* Brand color : buttons, links, progress */
  --accent-dark: #205e72;
  --accent-soft: #e6f1f5;

  /* Training statuses. Always shown with an icon and a label, never color alone. */
  --status-good: #1e8a57;
  --status-good-soft: #e4f4ec;
  --status-active: #2b7891;
  --status-active-soft: #e6f1f5;
  --status-idle: #7d8a92;
  --status-idle-soft: #eef1f3;
  --status-critical: #c2392f;
  --status-critical-soft: #fbe9e7;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(31, 43, 49, 0.06), 0 2px 8px rgba(31, 43, 49, 0.04);
}

/*--------------------------------------------------------------
# General
--------------------------------------------------------------*/
body {
  background: var(--background-color);
  color: var(--default-color);
  font-family: var(--default-font);
  font-size: 0.9rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 {
  color: var(--heading-color);
  font-family: var(--heading-font);
  font-weight: 700;
}

a {
  color: var(--accent-color);
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
  text-decoration: none;
}

/* Buttons and menu items never underline, whatever their state */
.btn,
.btn:hover,
.btn:focus,
.btn:active,
.nav-link:hover,
.nav-link:focus,
.dropdown-item:hover,
.dropdown-item:focus {
  text-decoration: none;
}

.num {
  font-variant-numeric: tabular-nums;
}

.app-main {
  flex: 1;
  padding: 28px 0 48px;
}

/* Bootstrap overrides */
.btn {
  --bs-btn-font-size: 0.875rem;
  --bs-btn-font-weight: 600;
  --bs-btn-border-radius: 8px;
}

.btn-primary {
  --bs-btn-bg: var(--accent-color);
  --bs-btn-border-color: var(--accent-color);
  --bs-btn-hover-bg: var(--accent-dark);
  --bs-btn-hover-border-color: var(--accent-dark);
  --bs-btn-active-bg: var(--accent-dark);
  --bs-btn-active-border-color: var(--accent-dark);
  --bs-btn-disabled-bg: var(--accent-color);
  --bs-btn-disabled-border-color: var(--accent-color);
}

.btn-outline-primary {
  --bs-btn-color: var(--accent-color);
  --bs-btn-border-color: var(--accent-color);
  --bs-btn-hover-bg: var(--accent-color);
  --bs-btn-hover-border-color: var(--accent-color);
  --bs-btn-active-bg: var(--accent-dark);
  --bs-btn-active-border-color: var(--accent-dark);
  --bs-btn-disabled-color: var(--accent-color);
  --bs-btn-disabled-border-color: var(--accent-color);
}

.btn-link {
  --bs-btn-color: var(--accent-color);
  --bs-btn-hover-color: var(--accent-dark);
  text-decoration: none;
}

.btn-icon {
  --bs-btn-color: var(--muted-color);
  --bs-btn-hover-color: var(--heading-color);
  --bs-btn-hover-bg: var(--status-idle-soft);
  --bs-btn-disabled-color: #c3ccd1;
  --bs-btn-disabled-border-color: transparent;
  --bs-btn-padding-x: 0.45rem;
  border-color: transparent;
}

.btn-icon-danger {
  --bs-btn-hover-color: var(--status-critical);
  --bs-btn-hover-bg: var(--status-critical-soft);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 0.2rem rgba(43, 120, 145, 0.2);
}

/* Show or hide button beside a password field (added by assets/js/app.js) */
.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 2.6rem;
}

.password-toggle {
  --bs-btn-color: var(--muted-color);
  --bs-btn-hover-color: var(--heading-color);
  --bs-btn-active-color: var(--heading-color);
  --bs-btn-padding-x: 0.75rem;
  border: 0;
  bottom: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.form-check-input:checked {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

.form-label {
  color: var(--heading-color);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.modal-title {
  font-size: 1rem;
  margin: 0;
}

/* Message inside a form */
.form-message {
  font-size: 0.875rem;
  padding: 10px 14px;
}

/* Message and question window */
.app-popup {
  --popup-color: var(--status-active);
  --popup-soft: var(--status-active-soft);
}

.app-popup[data-type="success"] {
  --popup-color: var(--status-good);
  --popup-soft: var(--status-good-soft);
}

.app-popup[data-type="error"] {
  --popup-color: var(--status-critical);
  --popup-soft: var(--status-critical-soft);
}

.app-popup[data-type="warning"] {
  --popup-color: #a86a12;
  --popup-soft: #fcf1dc;
}

.app-popup .modal-dialog {
  margin-left: auto;
  margin-right: auto;
  max-width: 420px;
  width: calc(100% - 32px);
}

.app-popup .modal-body {
  padding: 28px 24px 4px;
  text-align: center;
}

.popup-icon {
  align-items: center;
  background: var(--popup-soft);
  border-radius: 50%;
  color: var(--popup-color);
  display: inline-flex;
  font-size: 1.6rem;
  height: 56px;
  justify-content: center;
  margin-bottom: 14px;
  width: 56px;
}

.app-popup .modal-title {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.popup-message {
  color: var(--muted-color);
  font-size: 0.9rem;
  margin: 0;
  overflow-wrap: anywhere;
}

.app-popup .modal-footer {
  border-top: 0;
  justify-content: center;
  padding: 16px 24px 24px;
}

.app-popup .modal-footer .btn {
  min-width: 110px;
}

.dropdown-menu {
  font-size: 0.875rem;
}

.dropdown-item {
  font-size: 0.875rem;
  font-weight: 500;
}

.dropdown-item i {
  margin-right: 6px;
}

/*--------------------------------------------------------------
# Header
--------------------------------------------------------------*/
.app-header {
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  z-index: 1030;
}

.app-header .navbar {
  padding-top: 8px;
  padding-bottom: 8px;
}

.navbar-brand,
.login-brand {
  align-items: center;
  display: flex;
  gap: 10px;
}

.navbar-brand:hover {
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--accent-color);
  border-radius: 9px;
  color: #fff;
  display: inline-flex;
  font-size: 1.25rem;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.brand-name {
  color: var(--heading-color);
  font-family: var(--heading-font);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.navbar-toggler {
  border: 0;
  color: var(--heading-color);
  font-size: 1.6rem;
  padding: 0 4px;
}

.navbar-toggler:focus {
  box-shadow: none;
}

.app-header .navbar-nav {
  gap: 2px;
  margin-left: 20px;
}

.app-header .nav-link {
  border-radius: 8px;
  color: var(--muted-color);
  font-weight: 500;
  padding: 8px 12px;
}

.app-header .nav-link i {
  margin-right: 4px;
}

.app-header .nav-link:hover {
  background: var(--status-idle-soft);
  color: var(--heading-color);
  text-decoration: none;
}

.app-header .nav-link.active {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.user-menu {
  align-items: center;
  color: var(--default-color);
  display: flex;
  gap: 10px;
  padding: 4px 0;
}

.user-menu:hover {
  color: var(--default-color);
  text-decoration: none;
}

.user-menu-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-menu-name {
  color: var(--heading-color);
  font-weight: 600;
}

.user-menu-role {
  color: var(--muted-color);
  font-size: 0.78rem;
}

.avatar {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 50%;
  color: var(--accent-dark);
  display: inline-flex;
  flex: none;
  font-size: 0.8rem;
  font-weight: 700;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.avatar-lg {
  font-size: 1.1rem;
  height: 54px;
  width: 54px;
}

/*--------------------------------------------------------------
# Footer
--------------------------------------------------------------*/
.app-footer {
  border-top: 1px solid var(--border-color);
  color: var(--muted-color);
  font-size: 0.82rem;
  padding: 16px 0;
  text-align: center;
}

/*--------------------------------------------------------------
# Page head
--------------------------------------------------------------*/
.page-head {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.page-head h1 {
  font-size: 1.65rem;
  margin: 0;
}

.page-sub {
  color: var(--muted-color);
  margin: 4px 0 0;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.back-link {
  color: var(--muted-color);
  display: inline-block;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

/*--------------------------------------------------------------
# Stat tiles
--------------------------------------------------------------*/
.stat-tile {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  height: 100%;
  padding: 16px 18px;
}

/* Clickable tiles of the dashboards, each in its own pastel */
.stat-tile-link.is-active {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--accent-color);
}

.stat-tile-link {
  color: var(--default-color);
  display: block;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.stat-tile-link:hover,
.stat-tile-link:focus-visible {
  box-shadow: 0 4px 14px rgba(31, 43, 49, 0.12);
  color: var(--default-color);
  transform: translateY(-2px);
}

.stat-tile-link .stat-label,
.stat-tile-link .stat-note {
  color: #55636b;
}

.tile-good {
  background: #e3f4ea;
  border-color: #c5e6d3;
}

.tile-critical {
  background: #fde8e6;
  border-color: #f6cdc9;
}

.tile-info {
  background: #e4f0f8;
  border-color: #c6dded;
}

.tile-warm {
  background: #fdf3dc;
  border-color: #f3e0b0;
}

.stat-label {
  color: var(--muted-color);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat-value {
  color: var(--heading-color);
  font-family: var(--heading-font);
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.2;
  margin: 2px 0;
}

.stat-note {
  color: var(--muted-color);
  font-size: 0.82rem;
}

/*--------------------------------------------------------------
# Panels
--------------------------------------------------------------*/
.panel {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
  padding: 14px 18px;
}

.panel-head h2 {
  font-size: 1.05rem;
  margin: 0;
}

.panel-body {
  padding: 18px;
}

.panel-foot {
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  padding: 10px 18px;
}

.panel-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.panel-tools .status-chip,
.panel-tools .btn-outline-primary {
  margin-left: 6px;
}

.panel > .table-responsive > .table,
.panel > .collapse .table {
  margin-bottom: 0;
}

.empty-state {
  background: var(--surface-color);
  border: 1px dashed #c9d3d9;
  border-radius: var(--radius);
  color: var(--muted-color);
  margin-bottom: 24px;
  padding: 44px 20px;
  text-align: center;
}

.empty-state i {
  color: #a9b6bd;
  font-size: 2.4rem;
}

.empty-state h2 {
  font-size: 1.15rem;
  margin: 10px 0 4px;
}

.empty-state p {
  margin: 0;
}

/*--------------------------------------------------------------
# Tables
--------------------------------------------------------------*/
.data-table {
  --bs-table-bg: transparent;
  color: var(--default-color);
  font-size: 0.9rem;
}

.data-table > :not(caption) > * > * {
  border-bottom-color: #edf1f3;
  padding: 11px 18px;
}

.data-table thead th {
  background: #f8fafb;
  border-bottom: 1px solid var(--border-color);
  color: var(--muted-color);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table tbody td {
  font-weight: 500;
}

.data-table tbody tr:last-child > * {
  border-bottom: 0;
}

.data-table tbody tr:hover > * {
  background: #fafcfd;
}

.row-link {
  color: var(--heading-color);
  font-weight: 600;
}

.cell-sub {
  color: var(--muted-color);
  font-size: 0.8rem;
  font-weight: 400;
}

.group-row > td {
  background: #f8fafb !important;
  color: var(--heading-color);
  font-size: 0.8rem;
  font-weight: 700;
}

.tag {
  background: var(--status-idle-soft);
  border-radius: 4px;
  color: var(--default-color);
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 6px;
}

/* Record cards : table rows stacked as cards on small screens */
.record-card {
  border-bottom: 1px solid #edf1f3;
  color: var(--default-color);
  display: block;
  font-size: 0.9rem;
  padding: 14px 18px;
}

.record-card:last-child {
  border-bottom: 0;
}

/* Stronger separator for lists whose cards are tall and carry their own actions */
.record-list-divided .record-card {
  border-bottom: 2px solid #c5d1d7;
  padding-bottom: 16px;
  padding-top: 16px;
}

.record-list-divided .record-card:last-child {
  border-bottom: 0;
}

.record-card:hover,
.record-card:focus {
  background: #fafcfd;
  color: var(--default-color);
}

.record-top {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.record-course {
  font-weight: 500;
  margin: 8px 0 6px;
}

.record-meta {
  display: grid;
  gap: 4px 12px;
  grid-template-columns: repeat(3, auto);
  justify-content: space-between;
  margin: 10px 0 0;
}

.record-meta dt {
  color: var(--muted-color);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.record-meta dd {
  font-size: 0.82rem;
  font-weight: 500;
  margin: 0;
}

.record-figure {
  display: flex;
  flex: none;
  flex-direction: column;
  font-weight: 700;
  line-height: 1.2;
  text-align: right;
}

.record-figure .cell-sub {
  font-weight: 400;
}

.record-figure .is-overdue {
  color: var(--status-critical);
}

.record-bar {
  margin-top: 10px;
}

.record-bar .stack-bar {
  margin: 0;
}

.record-meta-4 {
  grid-template-columns: repeat(4, auto);
}

.record-meta-2 {
  gap: 8px 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.record-meta-2 dd {
  overflow-wrap: anywhere;
}

.record-actions {
  border-top: 1px solid #edf1f3;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 12px;
}

/*--------------------------------------------------------------
# Status chips, meters and status bars
--------------------------------------------------------------*/
.status-chip {
  align-items: center;
  background: var(--status-idle-soft);
  border-radius: 999px;
  color: var(--default-color);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 600;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  white-space: nowrap;
}

.status-chip i,
.status-text i {
  color: var(--status-idle);
}

.status-chip.status-good { background: var(--status-good-soft); }
.status-chip.status-active { background: var(--status-active-soft); }
.status-chip.status-critical { background: var(--status-critical-soft); }

.status-good i { color: var(--status-good); }
.status-active i { color: var(--status-active); }
.status-critical i { color: var(--status-critical); }

.meter {
  background: #e7ecef;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  width: 100%;
}

.meter-fill {
  background: var(--accent-color);
  border-radius: 999px;
  height: 100%;
  transition: width 0.3s ease;
}

.meter-fill.is-full {
  background: var(--status-good);
}

.meter-row {
  align-items: baseline;
  color: var(--muted-color);
  display: flex;
  font-size: 0.82rem;
  justify-content: space-between;
  margin-bottom: 6px;
}

.meter-row strong {
  color: var(--heading-color);
  font-variant-numeric: tabular-nums;
}

.meter-cell {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 120px;
}

.meter-cell .num {
  flex: none;
  font-size: 0.82rem;
  text-align: right;
  width: 38px;
}

/* Stacked bar : share of each status, segments separated by a 2px gap */
.stack-bar {
  display: flex;
  gap: 2px;
  height: 10px;
  min-width: 140px;
}

.stack-seg {
  border-radius: 3px;
  flex-basis: 0;
  min-width: 4px;
}

.stack-seg.status-good, .legend-swatch.status-good { background: var(--status-good); }
.stack-seg.status-active, .legend-swatch.status-active { background: var(--status-active); }
.stack-seg.status-idle, .legend-swatch.status-idle { background: #b9c3c9; }
.stack-seg.status-critical, .legend-swatch.status-critical { background: var(--status-critical); }

.legend {
  color: var(--muted-color);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.8rem;
  gap: 4px 16px;
}

.legend-item {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.legend-swatch {
  border-radius: 3px;
  display: inline-block;
  height: 10px;
  width: 10px;
}

/*--------------------------------------------------------------
# Filters, tabs and toolbars
--------------------------------------------------------------*/
.filter-bar {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.filter-field {
  min-width: 180px;
}

.filter-grow {
  flex: 1 1 240px;
}

.filter-actions {
  display: flex;
  gap: 4px;
}

.app-tabs {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 18px;
}

.app-tabs .nav-link {
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted-color);
  font-weight: 600;
  padding: 10px 16px;
}

.app-tabs .nav-link:hover {
  color: var(--heading-color);
}

.app-tabs .nav-link.active {
  background: transparent;
  border-bottom-color: var(--accent-color);
  color: var(--accent-dark);
}

.tab-count {
  background: var(--status-idle-soft);
  border-radius: 999px;
  color: var(--default-color);
  font-size: 0.75rem;
  margin-left: 4px;
  padding: 1px 8px;
}

.tab-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}

/*--------------------------------------------------------------
# Course cards (My Trainings)
--------------------------------------------------------------*/
.course-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 18px;
}

.course-card-top {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.course-due {
  color: var(--muted-color);
  font-size: 0.8rem;
}

.course-card-title {
  font-size: 1.15rem;
  margin: 0;
}

.course-card-author {
  color: var(--muted-color);
  font-size: 0.85rem;
  margin-top: 2px;
}

.course-card-desc {
  color: var(--muted-color);
  display: -webkit-box;
  font-size: 0.88rem;
  margin: 10px 0 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.course-card-progress {
  margin: auto 0 16px;
  padding-top: 18px;
}

/*--------------------------------------------------------------
# Course player
--------------------------------------------------------------*/
.player-card,
.outline-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.video-player {
  background: #000;
}

.video-player video {
  aspect-ratio: 16 / 9;
  display: block;
  width: 100%;
}

.video-player .plyr {
  --plyr-color-main: var(--accent-color);
}

/* Name of the viewer over the video */
.player-watermark {
  color: rgba(255, 255, 255, 0.38);
  font-size: clamp(0.75rem, 1.6vw, 1.1rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  pointer-events: none;
  position: absolute;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.55);
  user-select: none;
  white-space: nowrap;
  z-index: 2;
}

.player-watermark.wm-top-left {
  left: 4%;
  top: 6%;
}

.player-watermark.wm-top-right {
  right: 4%;
  top: 6%;
}

.player-watermark.wm-bottom-left {
  bottom: 16%;
  left: 4%;
}

.player-watermark.wm-bottom-right {
  bottom: 16%;
  right: 4%;
}

.player-watermark.wm-center {
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
}

.player-card {
  -webkit-user-select: none;
  user-select: none;
}

.player-missing {
  align-items: center;
  aspect-ratio: 16 / 9;
  background: #1f2b31;
  color: #c9d3d9;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.player-missing i {
  font-size: 2.6rem;
}

.player-missing p {
  margin: 8px 0 0;
}

.player-info {
  padding: 18px 20px 20px;
}

.player-crumb {
  color: var(--muted-color);
  font-size: 0.82rem;
}

.player-info h2 {
  font-size: 1.25rem;
  margin: 4px 0 14px;
}

.player-status {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.player-watch {
  flex: 1 1 200px;
}

.player-hint {
  color: var(--muted-color);
  font-size: 0.8rem;
  margin: 12px 0 0;
}

.player-nav {
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
}

.outline-head {
  border-bottom: 1px solid var(--border-color);
  padding: 16px 18px;
}

.outline-note {
  color: var(--muted-color);
  font-size: 0.8rem;
  margin: 10px 0 0;
}

.outline-body {
  max-height: 640px;
  overflow-y: auto;
}

.outline-section + .outline-section {
  border-top: 1px solid var(--border-color);
}

.outline-section-head {
  align-items: center;
  background: #f8fafb;
  border: 0;
  color: var(--heading-color);
  display: flex;
  font-size: 0.88rem;
  font-weight: 700;
  justify-content: space-between;
  padding: 12px 18px;
  text-align: left;
  width: 100%;
}

.outline-section-head i {
  transition: transform 0.2s ease;
}

.outline-section-head.collapsed i {
  transform: rotate(-90deg);
}

.outline-lesson {
  color: var(--muted-color);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 12px 18px 4px;
}

.outline-video {
  align-items: flex-start;
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  color: var(--default-color);
  display: flex;
  font-size: 0.88rem;
  gap: 10px;
  padding: 8px 18px 8px 15px;
  text-align: left;
  width: 100%;
}

.outline-video:hover {
  background: #f4f7f9;
}

.outline-video.is-current {
  background: var(--accent-soft);
  border-left-color: var(--accent-color);
  color: var(--heading-color);
  font-weight: 600;
}

.outline-icon {
  color: #a9b6bd;
  flex: none;
}

.outline-video.is-done .outline-icon { color: var(--status-good); }
.outline-video.is-started .outline-icon { color: var(--accent-color); }
.outline-video.is-locked { color: var(--muted-color); }

.outline-title {
  flex: 1;
}

.outline-time {
  color: var(--muted-color);
  flex: none;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

/*--------------------------------------------------------------
# Course maintenance
--------------------------------------------------------------*/
.lesson + .lesson,
.panel-head + .lesson {
  border-top: 1px solid var(--border-color);
}

.chapter > .panel-head {
  background: #f8fafb;
}

.lesson-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
  padding: 12px 18px;
}

.lesson-title {
  color: var(--heading-color);
  font-weight: 600;
}

.lesson-title .cell-sub {
  margin-left: 8px;
}

.lesson-code {
  color: var(--muted-color);
  font-variant-numeric: tabular-nums;
  margin-right: 6px;
}

.video-table > tbody > tr > td {
  border-top: 1px solid #edf1f3;
  padding-bottom: 8px;
  padding-top: 8px;
}

/* Same column widths in every lesson, so status, length and size line up down the page */
.video-table {
  min-width: 760px;
  table-layout: fixed;
}

.video-table > tbody > tr > td:nth-child(3) {
  width: 150px;
}

.video-table > tbody > tr > td:nth-child(4),
.video-table > tbody > tr > td:nth-child(5) {
  width: 90px;
}

.video-table > tbody > tr > td:nth-child(6) {
  width: 200px;
}

.video-table .video-code {
  color: var(--muted-color);
  padding-left: 34px;
  width: 70px;
}

.upload-progress {
  margin-top: 14px;
}

/*--------------------------------------------------------------
# Profile
--------------------------------------------------------------*/
.profile-top {
  align-items: center;
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
}

.profile-name {
  color: var(--heading-color);
  font-size: 1.1rem;
  font-weight: 700;
}

.detail-list {
  display: grid;
  gap: 8px 16px;
  grid-template-columns: 130px 1fr;
  margin-bottom: 14px;
}

.detail-list dt {
  color: var(--muted-color);
  font-weight: 500;
}

.detail-list dd {
  margin: 0;
}

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

.activity-list li {
  display: flex;
  gap: 12px;
  padding: 12px 18px;
}

.activity-list li + li {
  border-top: 1px solid #edf1f3;
}

.activity-text {
  font-size: 0.88rem;
}

.activity-meta {
  color: var(--muted-color);
  font-size: 0.78rem;
  margin-top: 2px;
}

/*--------------------------------------------------------------
# Login
--------------------------------------------------------------*/
.login-page .app-main {
  align-items: center;
  display: flex;
  justify-content: center;
  padding: 24px 16px;
}

.login-wrap {
  max-width: 400px;
  width: 100%;
}

.login-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 32px 30px;
}

.login-brand {
  margin-bottom: 22px;
}

.login-card h1 {
  font-size: 1.35rem;
  margin: 0;
}

.login-sub {
  color: var(--muted-color);
  margin: 4px 0 22px;
}

.login-help {
  color: var(--muted-color);
  font-size: 0.82rem;
  margin: 18px 0 0;
  text-align: center;
}

/*--------------------------------------------------------------
# Small screens
--------------------------------------------------------------*/
@media (max-width: 991.98px) {
  .app-header .navbar-nav {
    margin: 10px 0;
  }

  .outline-body {
    max-height: none;
  }

  .filter-field {
    flex: 1 1 180px;
  }
}

@media (max-width: 575.98px) {
  .filter-field,
  .filter-grow {
    flex: 1 1 100%;
    min-width: 0;
  }

  .filter-actions {
    width: 100%;
  }

  .filter-actions .btn-primary {
    flex: 1 1 auto;
  }

  .app-main {
    padding-top: 20px;
  }

  .page-head h1 {
    font-size: 1.4rem;
  }

  .stat-value {
    font-size: 1.6rem;
  }
}
