/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&family=Open+Sans:wght@400;600&display=swap');

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f4f7fa;
  color: #444;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
}

a {
  color: #1a5a8a;
  text-decoration: none;
}

a:hover {
  color: #134468;
  text-decoration: underline;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
header {
  text-align: center;
  padding: 0 0 20px;
  margin-bottom: 30px;
  border-bottom: 3px solid #4db8e8;
}

header .logo {
  max-width: 320px;
  height: auto;
  margin: 10px 0 12px;
}

header h1 {
  font-family: 'Poppins', sans-serif;
  color: #1a5a8a;
  font-size: 1.8rem;
  font-weight: 700;
}

header .subtitle {
  color: #4db8e8;
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 4px;
}

/* Steps */
.step { display: none; }
.step.active { display: block; }

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  color: #1a5a8a;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 3px;
  font-size: 1rem;
  font-family: 'Open Sans', sans-serif;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #4db8e8;
  box-shadow: 0 0 0 2px rgba(77, 184, 232, 0.25);
}

/* Buttons */
.btn {
  display: inline-block;
  background: #1a5a8a;
  color: #fff;
  padding: 8px 18px;
  border: none;
  border-radius: 3px;
  font-size: 0.85rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
  transition: background 0.2s;
}

.btn:hover { background: #134468; }
.btn:disabled { background: #aaa; cursor: not-allowed; }

.btn-secondary {
  background: #1a5a8a;
  opacity: 0.8;
}

.btn-secondary:hover { opacity: 1; }

/* Org picker */
.org-picker-label {
  text-align: center;
  color: #1a5a8a;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 20px;
}

.org-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 600px;
  margin: 0 auto;
}

.org-card {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px 16px;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  min-height: 90px;
}

.org-card:hover {
  border-color: #4db8e8;
  box-shadow: 0 4px 12px rgba(26, 90, 138, 0.15);
  transform: translateY(-2px);
  text-decoration: none;
}

.org-card img {
  max-width: 140px;
  max-height: 50px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.org-card-dark {
  background: #062a30;
  border-color: #062a30;
}

.org-card-dark:hover {
  border-color: #009490;
  box-shadow: 0 4px 12px rgba(0, 148, 144, 0.25);
}

@media (max-width: 600px) {
  .org-picker {
    grid-template-columns: 1fr;
    max-width: 280px;
  }
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 6px;
  background: #ddd;
  border-radius: 3px;
  margin-bottom: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1a5a8a, #4db8e8);
  border-radius: 3px;
  width: 0%;
  transition: width 0.2s;
}

.progress-text {
  font-size: 0.85rem;
  color: #1a5a8a;
  font-weight: 600;
  margin-bottom: 20px;
}

/* Training content */
.training-content {
  padding: 20px 24px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.training-section {
  margin-bottom: 16px;
  padding-bottom: 16px;
}

.training-section:last-of-type {
  margin-bottom: 0;
  padding-bottom: 0;
}

.training-section h2 {
  color: #1a5a8a;
  font-size: 1.3rem;
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 3px solid #4db8e8;
}

.training-section h3 {
  color: #1a5a8a;
  font-size: 1.05rem;
  margin: 16px 0 8px;
}

.training-section ul, .training-section ol {
  margin: 8px 0 8px 24px;
}

.training-section li {
  margin-bottom: 6px;
}

.training-section li strong {
  color: #1a5a8a;
}

.callout {
  background: #eaf5fc;
  border-left: 4px solid #4db8e8;
  padding: 12px 16px;
  border-radius: 3px;
  margin: 16px 0;
  font-size: 0.95rem;
}

.callout strong {
  color: #1a5a8a;
}

.callout.warning {
  background: #fef5e7;
  border-left-color: #c0392b;
}

.callout.warning strong {
  color: #c0392b;
}

/* Quiz */
.quiz-question {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-left: 3px solid #4db8e8;
  border-radius: 4px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.quiz-question p {
  margin-bottom: 10px;
  color: #1a5a8a;
  font-weight: 600;
}

.quiz-question label {
  display: block;
  padding: 8px 12px;
  margin: 4px 0;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s;
  color: #444;
}

.quiz-question label:hover {
  background: #eaf5fc;
}

.quiz-question input[type="radio"] {
  margin-right: 8px;
  accent-color: #1a5a8a;
}

/* Results */
#result-content {
  text-align: center;
  padding: 40px 24px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.result-pass {
  color: #27ae60;
}

.result-fail {
  color: #c0392b;
}

.result-score {
  font-family: 'Poppins', sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  margin: 12px 0;
}

.result-message {
  font-size: 1rem;
  margin-bottom: 24px;
}

/* Admin page */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.admin-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.search-input {
  padding: 6px 10px;
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 3px;
  font-size: 0.85rem;
  font-family: 'Open Sans', sans-serif;
  width: 250px;
}

.search-input:focus {
  outline: none;
  border-color: #4db8e8;
  box-shadow: 0 0 0 2px rgba(77, 184, 232, 0.25);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

th, td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #eee;
  font-size: 0.85rem;
}

th {
  background: #1a5a8a;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 6px 10px;
}

tr:hover td {
  background: #f8f9fa;
}

.badge-pass, .badge-fail, .badge-progress, .badge-neutral, .badge-overdue {
  display: inline-block;
  min-width: 80px;
  text-align: center;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  box-sizing: border-box;
}

.badge-pass {
  background: #d4edda;
  color: #155724;
}

.badge-fail { background: #f8d7da; color: #721c24; }
.badge-progress { background: #fef3c7; color: #92400e; }
.badge-neutral { background: #f3f4f6; color: #6b7280; }
.badge-overdue { background: #c0392b; color: #fff; }

.row-overdue td {
  background: #fef2f2;
}

/* Settings panel */
.settings-panel {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-top: 3px solid #4db8e8;
  border-radius: 4px;
  padding: 20px;
  margin-top: 24px;
}

.settings-panel h3 {
  margin-bottom: 12px;
  color: #1a5a8a;
  font-family: 'Poppins', sans-serif;
}

.settings-panel textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 3px;
  font-size: 0.9rem;
  font-family: 'Open Sans', sans-serif;
  min-height: 60px;
  resize: vertical;
}

.settings-panel textarea:focus {
  outline: none;
  border-color: #4db8e8;
  box-shadow: 0 0 0 2px rgba(77, 184, 232, 0.25);
}

.status-message {
  padding: 10px 16px;
  border-radius: 3px;
  margin-top: 12px;
  font-size: 0.9rem;
}

.status-success {
  background: #d4edda;
  color: #155724;
}

.status-error {
  background: #f8d7da;
  color: #721c24;
}

/* Stats bar */
#stats {
  color: #1a5a8a;
  font-weight: 600;
}

/* Section progress */
.section-progress {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

/* Section quiz */
.section-quiz {
  margin-top: 24px;
}

.section-quiz h3 {
  font-family: 'Poppins', sans-serif;
  color: #1a5a8a;
  font-size: 1.1rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #4db8e8;
}

/* Review section on results page */
.review-section {
  text-align: left;
  max-width: 600px;
  margin: 32px auto 0;
}

.review-section h3 {
  font-family: 'Poppins', sans-serif;
  color: #1a5a8a;
  font-size: 1.1rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #4db8e8;
}

.review-question {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-left: 3px solid #c0392b;
  border-radius: 4px;
  padding: 14px 18px;
  margin-bottom: 12px;
}

.review-q-text {
  font-weight: 600;
  color: #1a5a8a;
  margin-bottom: 6px;
}

.review-your-answer {
  color: #c0392b;
  font-size: 0.9rem;
}

.review-correct-answer {
  color: #27ae60;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Admin tabs */
.admin-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid #e0e0e0;
}

.admin-tab {
  padding: 10px 24px;
  border: none;
  background: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: #888;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.admin-tab:hover {
  color: #1a5a8a;
}

.admin-tab.active {
  color: #1a5a8a;
  border-bottom-color: #4db8e8;
}

.admin-panel {
  min-height: 200px;
}

/* Role badges */
.badge-role {
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-role-owner { background: #f0e6ff; color: #5b21b6; }
.badge-role-admin { background: #dbeafe; color: #1e40af; }
.badge-role-manager { background: #fef3c7; color: #92400e; }
.badge-role-learner { background: #f3f4f6; color: #6b7280; }

/* Role select dropdown */
.role-select {
  padding: 4px 8px;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  font-size: 0.85rem;
  font-family: 'Open Sans', sans-serif;
}

/* ==========================================
   Dashboard & Sidebar Layout
   ========================================== */

.dashboard-body {
  display: flex;
  min-height: 100vh;
  background: #f4f7fa;
}

/* Sidebar */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: #1a2332;
  color: #c8d6e5;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 200;
  transition: width 0.25s ease;
  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar.collapsed {
  width: 64px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  min-height: 64px;
}


.sidebar-toggle {
  background: none;
  border: none;
  color: #c8d6e5;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: rgba(255,255,255,0.1);
}

/* Sidebar menu */
.sidebar-menu {
  list-style: none;
  padding: 12px 0;
  flex: 1;
}

.sidebar-menu li {
  margin: 2px 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: #c8d6e5;
  text-decoration: none;
  border-radius: 6px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  text-decoration: none;
}

.sidebar-link.active {
  background: rgba(77, 184, 232, 0.15);
  color: #4db8e8;
}

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

.sidebar-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.5;
}

.sidebar-label {
  transition: opacity 0.2s;
}

.sidebar.collapsed .sidebar-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

/* Sidebar footer */
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 12px 16px;
}

.sidebar-user {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.sidebar-user-name {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
  white-space: nowrap;
}

.sidebar-user-role {
  font-size: 0.75rem;
  color: #8899aa;
  white-space: nowrap;
}

.sidebar-logout {
  display: block;
  margin-top: 8px;
  font-size: 0.8rem;
  color: #8899aa;
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
}

.sidebar-logout:hover { color: #fff; text-decoration: none; }

.sidebar.collapsed .sidebar-logout { opacity: 0; overflow: hidden; }

.sidebar.collapsed .sidebar-user {
  opacity: 0;
}

/* Main content */
.dashboard-main {
  flex: 1;
  margin-left: 260px;
  padding: 32px;
  transition: margin-left 0.25s ease;
  min-height: 100vh;
}

.sidebar.collapsed ~ .dashboard-main {
  margin-left: 64px;
}

/* Dashboard panels */
.dashboard-panel {
  display: none;
}

.dashboard-panel.active {
  display: block;
}

.panel-header {
  margin-bottom: 16px;
}

.panel-header h2 {
  font-family: 'Poppins', sans-serif;
  color: #1a5a8a;
  font-size: 1.3rem;
  font-weight: 700;
}

.panel-subtitle {
  color: #4db8e8;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 4px;
}

/* Help FAB */
.help-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1a2332;
  color: #fff;
  border: none;
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 800;
  transition: background 0.2s, transform 0.15s;
}

.help-fab:hover {
  background: #2a3a4e;
  transform: scale(1.1);
}

/* Help Widget */
.help-modal {
  position: fixed;
  bottom: 76px;
  right: 24px;
  width: 380px;
  height: 480px;
  min-width: 300px;
  min-height: 300px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  z-index: 801;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.help-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #1a2332;
  color: #fff;
  cursor: move;
  user-select: none;
  flex-shrink: 0;
}

.help-modal-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
}

.help-modal-btn {
  background: none;
  border: none;
  color: #c8d6e5;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
}

.help-modal-btn:hover { color: #fff; }

.help-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.help-search {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: 'Open Sans', sans-serif;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.help-search:focus {
  outline: none;
  border-color: #4db8e8;
  box-shadow: 0 0 0 2px rgba(77, 184, 232, 0.25);
}

.help-section { margin-bottom: 4px; }

.help-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #1a5a8a;
  transition: background 0.15s;
}

.help-section-header:hover { background: #eaf5fc; }

.help-section-chevron {
  font-size: 0.8rem;
  transition: transform 0.2s;
  color: #888;
}

.help-section-content {
  padding: 4px 8px 12px 24px;
  font-size: 0.85rem;
  color: #444;
  line-height: 1.6;
}

.help-section-content p { margin-bottom: 8px; }
.help-section-content ul { margin: 4px 0 4px 16px; padding: 0; }
.help-section-content li { margin-bottom: 4px; }

.help-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: se-resize;
}

/* Floating org logo */
.org-logo {
  position: fixed;
  top: 16px;
  right: 24px;
  height: 70px;
  width: auto;
  z-index: 100;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.org-logo:hover { opacity: 1; }

/* Emulation banner */
.emulate-banner {
  background: #fef3c7;
  color: #92400e;
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  max-width: 90vw;
  z-index: 999;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  border: 1px solid #f59e0b;
}

.emulate-exit-btn {
  background: #92400e;
  color: #fff;
  padding: 5px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.8rem;
}

.emulate-exit-btn:hover { background: #78350f; color: #fff; text-decoration: none; }

body.emulating .dashboard-main { padding-bottom: 80px; }

/* Space group row in tables */
.space-group-row td {
  background: #f8f9fa;
  border-bottom: 2px solid #e0e0e0;
}

.space-group-row:hover td { background: #eaf5fc; }

.space-row-toggle { display: inline-flex; }

/* Course list table */
.course-list-table { width: 100%; }

/* Collapsible section */
.collapsible-section {
  margin-bottom: 24px;
}

.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 10px 0;
  border-bottom: 2px solid #4db8e8;
  margin-bottom: 12px;
}

.collapsible-header h3 {
  font-family: 'Poppins', sans-serif;
  color: #1a5a8a;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}

.collapsible-header .collapse-info {
  font-size: 0.8rem;
  color: #888;
  font-weight: 400;
  font-family: 'Open Sans', sans-serif;
}

.collapsible-header .collapse-toggle {
  font-size: 0.8rem;
  color: #888;
  transition: transform 0.2s;
}

.collapsible-header.collapsed .collapse-toggle { transform: rotate(-90deg); }

.collapsible-body { }
.collapsible-body.collapsed { display: none; }

.section-search {
  margin-bottom: 12px;
}

.section-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: 'Open Sans', sans-serif;
  box-sizing: border-box;
}

/* Learner stats bar */
.learner-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stat-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px 20px;
  flex: 1;
  min-width: 140px;
  text-align: center;
}

.stat-value {
  font-family: 'Poppins', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #1a5a8a;
  line-height: 1.2;
}

.stat-value.stat-warning { color: #c0392b; }
.stat-value.stat-success { color: #27ae60; }

.stat-label {
  font-size: 0.8rem;
  color: #888;
  margin-top: 4px;
}

.stat-next {
  font-size: 0.85rem;
  color: #1a5a8a;
  font-weight: 600;
}

.stat-next-date {
  font-size: 0.75rem;
  color: #888;
}

/* Card progress bar */
.card-progress {
  margin-top: 8px;
  margin-bottom: 4px;
}

.card-progress-bar {
  width: 100%;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
}

.card-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1a5a8a, #4db8e8);
  border-radius: 3px;
  transition: width 0.3s;
}

.card-progress-fill.complete { background: #27ae60; }

.card-progress-text {
  font-size: 0.75rem;
  color: #888;
  margin-top: 3px;
}

.section-heading {
  font-family: 'Poppins', sans-serif;
  color: #1a5a8a;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #4db8e8;
}

/* Path step items */
.path-step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.path-step-num {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: #1a5a8a;
  min-width: 24px;
  text-align: center;
}


.path-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 300;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.path-search-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.85rem;
}

.path-search-item:hover { background: #eaf5fc; }

.path-step-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.placeholder-text {
  color: #888;
  font-size: 1rem;
  padding: 40px 0;
  text-align: center;
}

/* Course grid (placeholder) */

.course-status {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
}

.course-status-assigned { background: #f3f4f6; color: #6b7280; }
.course-status-progress { background: #fef3c7; color: #92400e; }
.course-status-failed { background: #f8d7da; color: #721c24; }
.course-status-overdue { background: #c0392b; color: #fff; }
.course-status-completed { background: #d4edda; color: #155724; }
.course-status-open { background: #dbeafe; color: #1e40af; }
.course-status-library { background: #f3e8ff; color: #7c3aed; }

/* Space cards in library */

.course-status-expired { background: #fbbf24; color: #78350f; }

.course-due-date {
  font-size: 0.8rem;
  color: #888;
  font-weight: 500;
}

.course-due-date.overdue {
  color: #c0392b;
  font-weight: 600;
}

.assign-due-date {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 4px;
}

.assign-due-date label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #1a5a8a;
  font-family: 'Poppins', sans-serif;
  white-space: nowrap;
}

.btn-small {
  padding: 6px 0;
  font-size: 0.85rem;
  margin-top: 0;
  text-decoration: none;
  width: 80px;
  text-align: center;
  display: inline-block;
  box-sizing: border-box;
}

/* Config sections */
.config-section {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 14px;
}

.config-section h3 {
  font-family: 'Poppins', sans-serif;
  color: #1a5a8a;
  margin-bottom: 16px;
}

.config-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.config-section-header h3 {
  margin-bottom: 0;
}

/* Icon buttons */
.btn-icon {
  background: none;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 3px 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #1a5a8a;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover { background: #eaf5fc; }
.btn-icon-danger { color: #c0392b; }
.btn-icon-danger:hover { background: #fdecea; }

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.modal {
  background: #fff;
  border-radius: 8px;
  width: 560px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
  font-family: 'Poppins', sans-serif;
  color: #1a5a8a;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #888;
  cursor: pointer;
  padding: 4px;
}

.modal-close:hover { color: #444; }

.modal-body {
  padding: 16px;
}

.modal-body .form-group {
  margin-bottom: 10px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* Assignment modal */
.assign-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 2px solid #e0e0e0;
}

.assign-tab {
  padding: 8px 20px;
  border: none;
  background: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: #888;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.assign-tab:hover { color: #1a5a8a; }
.assign-tab.active { color: #1a5a8a; border-bottom-color: #4db8e8; }

.assign-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.crm-contact-meta {
  font-size: 0.75rem;
  color: #999;
}

.assign-section h4 {
  font-family: 'Poppins', sans-serif;
  color: #1a5a8a;
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.assign-search-row {
  margin-bottom: 10px;
}

.assign-user-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  margin-bottom: 12px;
}

.assign-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.1s;
}

.assign-user-item:last-child { border-bottom: none; }
.assign-user-item:hover { background: #eaf5fc; }

.assign-user-item input[type="checkbox"] {
  accent-color: #1a5a8a;
  flex-shrink: 0;
}

.assign-user-item.already-assigned {
  opacity: 0.5;
  cursor: default;
}

.assign-user-name {
  font-weight: 600;
  color: #333;
}

.assign-user-email {
  color: #888;
  font-size: 0.8rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #444;
  cursor: pointer;
  margin-top: 4px;
}

.checkbox-label input[type="checkbox"] {
  accent-color: #1a5a8a;
}

/* Results table filters */
.th-filter {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 3px;
  font-size: 0.8rem;
  font-family: 'Open Sans', sans-serif;
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.th-filter option { color: #333; background: #fff; }

.user-cell {
  cursor: default;
  border-bottom: 1px dotted #ccc;
}

.results-filter-row th {
  padding: 6px 8px;
}

.sortable {
  cursor: pointer;
  user-select: none;
}

.sortable:hover {
  color: #4db8e8;
}

.sortable::after {
  content: ' \2195';
  font-size: 0.7rem;
  opacity: 0.5;
}

.sortable.sort-asc::after { content: ' \2191'; opacity: 1; }
.sortable.sort-desc::after { content: ' \2193'; opacity: 1; }

.assign-current-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.assign-current-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.85rem;
}

.assign-current-item:last-child { border-bottom: none; }

.assign-current-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ==========================================
   Course Editor
   ========================================== */

.editor-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.editor-topbar-right > .btn {
  padding: 8px 18px;
  font-size: 0.9rem;
  margin-top: 0;
}

/* Save button group */
.save-btn-group {
  position: relative;
  display: flex;
}

.save-btn-group .btn {
  margin-top: 0;
  padding: 8px 18px;
  font-size: 0.9rem;
}

.save-btn-group #save-btn {
  border-radius: 3px 0 0 3px;
}

.save-dropdown-toggle {
  border-radius: 0 3px 3px 0;
  padding: 8px 8px;
  font-size: 0.65rem;
  border-left: 1px solid rgba(255,255,255,0.3);
  min-width: 28px;
}

.save-dropdown {
  position: absolute;
  bottom: 100%;
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
  min-width: 160px;
  z-index: 200;
  margin-bottom: 4px;
}

.save-dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  text-align: left;
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  color: #333;
  cursor: pointer;
}

.save-dropdown-item:hover {
  background: #eaf5fc;
  color: #1a5a8a;
}

/* Editor sidebar content (settings form inside the nav sidebar) */
.editor-sidebar-content {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.editor-sidebar-content h3 {
  font-family: 'Poppins', sans-serif;
  color: #fff;
  margin-bottom: 16px;
  font-size: 0.95rem;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.editor-sidebar-nav .form-group label {
  color: #c8d6e5;
  font-size: 0.8rem;
}

.editor-sidebar-nav .form-group input,
.editor-sidebar-nav .form-group select,
.editor-sidebar-nav .form-group textarea {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 3px;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.08);
  color: #fff;
  resize: vertical;
}

.editor-sidebar-nav .form-group input:focus,
.editor-sidebar-nav .form-group select:focus,
.editor-sidebar-nav .form-group textarea:focus {
  outline: none;
  border-color: #4db8e8;
  box-shadow: 0 0 0 2px rgba(77, 184, 232, 0.25);
}

.editor-sidebar-nav .form-group input::placeholder,
.editor-sidebar-nav .form-group textarea::placeholder {
  color: rgba(255,255,255,0.35);
}

.editor-sidebar-nav .form-group select option {
  background: #1a2332;
  color: #fff;
}

.editor-sidebar-nav .checkbox-label {
  color: #c8d6e5;
  font-size: 0.8rem;
}

.editor-sidebar-nav .checkbox-label input[type="checkbox"] {
  accent-color: #4db8e8;
}

.editor-stats {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: #8899aa;
  font-size: 0.8rem;
}

/* Sections */
.editor-section {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.editor-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
}

.editor-section-drag {
  color: #aaa;
  cursor: grab;
  font-size: 1.1rem;
}

.editor-section-num {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: #1a5a8a;
  white-space: nowrap;
}

.editor-section-title {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  font-size: 0.95rem;
  font-family: 'Open Sans', sans-serif;
}

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

.editor-section-body {
  padding: 16px;
}

.editor-label {
  display: block;
  font-weight: 600;
  color: #1a5a8a;
  font-size: 0.85rem;
  margin-bottom: 6px;
  font-family: 'Poppins', sans-serif;
}

/* Content editor tabs */
.editor-content-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
}

.editor-content-tab {
  padding: 6px 16px;
  border: 1px solid #e0e0e0;
  border-bottom: none;
  background: #f8f9fa;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  margin-right: -1px;
}

.editor-content-tab.active {
  background: #fff;
  color: #1a5a8a;
  border-bottom: 1px solid #fff;
  position: relative;
  z-index: 1;
}

/* Visual editor (contenteditable) */
.editor-visual {
  width: 100%;
  min-height: 150px;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 0 0 3px 3px;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.9rem;
  line-height: 1.6;
  outline: none;
  overflow-y: auto;
  max-height: 400px;
}

.editor-visual:focus {
  border-color: #4db8e8;
  box-shadow: 0 0 0 2px rgba(77, 184, 232, 0.15);
}

.editor-visual h2, .editor-visual h3, .editor-visual h4 {
  color: #1a5a8a;
  margin: 12px 0 6px;
}

.editor-visual ul, .editor-visual ol {
  margin: 8px 0 8px 24px;
}

.editor-visual li { margin-bottom: 4px; }

.editor-visual .callout {
  background: #eaf5fc;
  border-left: 4px solid #4db8e8;
  padding: 10px 14px;
  border-radius: 3px;
  margin: 12px 0;
}

/* Toolbar */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-bottom: none;
  border-radius: 0;
  flex-wrap: wrap;
}

.toolbar-btn {
  padding: 4px 8px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.8rem;
  color: #444;
  transition: background 0.1s;
}

.toolbar-btn:hover { background: #eaf5fc; }

.toolbar-sep {
  width: 1px;
  height: 20px;
  background: #ddd;
  margin: 0 4px;
}

.toolbar-heading {
  padding: 3px 6px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 0.8rem;
  font-family: 'Open Sans', sans-serif;
}

/* Color picker in toolbar */
.toolbar-color-label {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 6px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  color: #333;
  transition: background 0.1s;
}

.toolbar-color-label:hover { background: #eaf5fc; }

.toolbar-highlight { color: #f0c000; }

.toolbar-color {
  width: 0;
  height: 0;
  padding: 0;
  border: none;
  opacity: 0;
  position: absolute;
}

/* Editor images */
.editor-visual img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 8px 0;
}

.editor-html {
  width: 100%;
  padding: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 0 0 3px 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

/* Questions */
.editor-questions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  margin-bottom: 10px;
}

.editor-questions-header .editor-label {
  margin-bottom: 0;
}

.editor-question {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-left: 3px solid #4db8e8;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 10px;
}

.editor-question-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.editor-question-num {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  color: #4db8e8;
  white-space: nowrap;
}

.editor-question-id {
  padding: 4px 6px;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  font-size: 0.85rem;
  font-family: monospace;
}

.editor-question-text {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  font-size: 0.9rem;
  font-family: 'Open Sans', sans-serif;
}

/* Options */
.editor-options {
  margin-left: 28px;
}

.editor-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.editor-option input[type="radio"] {
  accent-color: #27ae60;
  flex-shrink: 0;
}

.editor-option input[type="text"] {
  padding: 4px 8px;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  font-size: 0.85rem;
  font-family: 'Open Sans', sans-serif;
}

.editor-option-label {
  flex: 1;
}

/* Video field */
.editor-video-field {
  margin-top: 16px;
  margin-bottom: 8px;
}

.info-tooltip {
  display: inline-block;
  cursor: help;
  color: #4db8e8;
  font-size: 1rem;
  position: relative;
}

.info-tooltip:hover::after {
  content: attr(title);
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  background: #1a2332;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 400;
  white-space: pre-line;
  width: 280px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  line-height: 1.5;
}

.editor-video-url {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  font-size: 0.85rem;
  font-family: 'Open Sans', sans-serif;
}

.editor-video-preview {
  margin-top: 10px;
}

.editor-add-option {
  margin-left: 28px;
  margin-top: 4px;
  font-size: 0.8rem;
}

/* ==========================================
   Course Viewer Layout
   ========================================== */

/* Course sidebar — section navigation */
.course-sidebar .sidebar-header {
  gap: 12px;
}

.sidebar-back {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c8d6e5;
  text-decoration: none;
  padding: 6px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.sidebar-back:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  text-decoration: none;
}

.sidebar-title {
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Section nav items */
.section-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #c8d6e5;
  text-decoration: none;
  border-radius: 6px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.section-nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  text-decoration: none;
}

.section-nav-item.active {
  background: rgba(77, 184, 232, 0.15);
  color: #4db8e8;
}

.section-nav-item.completed {
  color: #27ae60;
}

.section-nav-item.completed.active {
  color: #4db8e8;
}

.section-nav-num {
  font-weight: 700;
  min-width: 20px;
  text-align: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.section-nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-nav-check {
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.7;
}

/* Sidebar progress */
.course-sidebar-progress {
  margin-bottom: 8px;
}

.sidebar-progress-label {
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  color: #8899aa;
  margin-bottom: 6px;
}

/* Sticky bottom action bar */
.course-action-bar {
  position: fixed;
  bottom: 0;
  left: 260px;
  right: 0;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  padding: 12px 32px;
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  transition: left 0.25s ease;
}

.sidebar.collapsed ~ .dashboard-main ~ .course-action-bar,
.sidebar.collapsed ~ .course-action-bar {
  left: 64px;
}

.course-action-bar-inner {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  max-width: 900px;
}

.course-action-bar .btn {
  margin-top: 0;
  padding: 8px 20px;
}

/* Push content below the floating logo */
.dashboard-main {
  padding-top: 96px;
}

/* Tighter top padding for learner panels (no panel-header) */
#panel-assigned-learning,
#panel-my-library {
  margin-top: -20px;
}

/* Extra bottom padding for action bar */
.course-viewer-active #course-main,
#editor-main {
  padding-bottom: 80px;
}


/* Section quiz in course viewer */
.course-quiz-section {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 20px 24px;
  margin-top: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.course-quiz-section h3 {
  font-family: 'Poppins', sans-serif;
  color: #1a5a8a;
  font-size: 1rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #4db8e8;
}

/* Video in course viewer */
.section-video {
  margin-bottom: 16px;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
}

.section-video iframe {
  display: block;
}

/* Responsive — dashboard */
@media (max-width: 768px) {
  .sidebar {
    width: 64px;
  }

  .sidebar .sidebar-label,
  .sidebar .sidebar-title,
  .section-nav-label,
  .section-nav-check {
    opacity: 0;
    width: 0;
    overflow: hidden;
  }

  .sidebar .sidebar-user {
    opacity: 0;
  }

  .dashboard-main {
    margin-left: 64px;
    padding: 16px;
  }

  .course-action-bar {
    left: 64px;
    padding: 10px 16px;
  }

  .search-input { width: 100%; }
}
