:root {
  --app-sidebar-w: 272px;
  --app-sidebar-collapsed: 80px;
  --app-top-h: 64px;
  --app-primary: #714B67;
  --app-primary-hover: #5c3d54;
  --app-primary-soft: #f4eef2;
  --app-accent: #017E84;
  --app-navy: #2c1e29;
  --app-navy-mid: #3d2a39;
  --app-bg: #f4f1f3;
  --app-card: #ffffff;
  --app-text: #1f1520;
  --app-muted: #6b5d68;
  --app-border: #e0d6dc;
  --app-radius: 12px;
  --app-radius-sm: 8px;
  --app-shadow: 0 1px 0 rgba(44, 30, 41, 0.04), 0 8px 24px rgba(44, 30, 41, 0.07);
  --app-font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --app-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--app-font);
  color: var(--app-text);
  background: var(--app-bg);
  -webkit-font-smoothing: antialiased;
}

body.app-body {
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--app-bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 100% -10%, rgba(113, 75, 103, 0.08), transparent 55%),
    linear-gradient(rgba(44, 30, 41, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(44, 30, 41, 0.035) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
}

body.guest-body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 70% 55% at 10% 0%, rgba(113, 75, 103, 0.28), transparent 50%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(1, 126, 132, 0.14), transparent 45%),
    linear-gradient(165deg, #2c1e29 0%, #3d2a39 42%, #714B67 160%);
  color: #fff;
}

a {
  text-decoration: none;
  color: inherit;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes softIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== Sidebar ===== */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44, 30, 41, 0.5);
  z-index: 1040;
  animation: softIn 0.2s ease;
}

.sidebar-backdrop.show {
  display: block;
}

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--app-sidebar-w);
  height: 100vh;
  z-index: 1050;
  background: linear-gradient(180deg, var(--app-navy) 0%, var(--app-navy-mid) 100%);
  color: #e4d8df;
  display: flex;
  flex-direction: column;
  transition: width 0.28s var(--app-ease), transform 0.28s var(--app-ease);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar.collapsed {
  width: var(--app-sidebar-collapsed);
}

.sidebar.collapsed .side-brand .brand-text,
.sidebar.collapsed .side-user-info,
.sidebar.collapsed .side-section,
.sidebar.collapsed .side-link span.label {
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar.collapsed .side-link {
  justify-content: center;
  padding-inline: 0.75rem;
}

.side-brand {
  min-height: var(--app-top-h);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.side-brand a {
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.side-brand .brand-ico {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  flex-shrink: 0;
  font-size: 1.15rem;
  overflow: hidden;
  padding: 0;
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}

.brand-logo-side {
  width: 100%;
  height: 100%;
  border-radius: 0;
}

.brand-logo-top {
  width: 32px;
  height: 32px;
}

.brand-logo-guest,
.brand-logo-kicker,
.brand-logo-hero {
  width: 36px;
  height: 36px;
}

.content-top-brand {
  align-items: center;
  margin-inline-end: 0.35rem;
}

.dash-hero-eyebrow .brand-logo {
  width: 28px;
  height: 28px;
}

.brand-kicker .brand-logo {
  width: 28px;
  height: 28px;
}

.guest-topbar .brand a {
  gap: 0.7rem;
}

.add-trainee-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.panel-lite {
  border: 1px solid var(--app-border);
  border-radius: 12px;
  padding: 1rem;
  background: #f9f5f7;
}

.emp-bulk-form textarea {
  min-height: 140px;
  font-family: ui-monospace, Consolas, monospace;
  direction: ltr;
  text-align: left;
}

.bulk-search-wrap {
  position: relative;
}

.bulk-search-wrap .emp-suggest {
  z-index: 1080;
  position: absolute;
  right: 0;
  left: 0;
  top: calc(100% + 4px);
  max-height: 220px;
  overflow: auto;
  box-shadow: var(--app-shadow);
}

.add-trainees-modal .modal-header {
  border-bottom-color: var(--app-border);
  background: #f8f2f6;
}

.add-trainees-modal .modal-footer {
  border-top-color: var(--app-border);
}

.bulk-selected-list {
  min-height: 120px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: #fff;
  padding: 0.55rem;
  display: grid;
  gap: 0.45rem;
}

.bulk-empty {
  padding: 1.25rem 0.75rem;
  text-align: center;
}

.bulk-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: #f8f2f6;
  border: 1px solid #c5ddd8;
}

.bulk-chip-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.bulk-chip-text strong {
  font-size: 0.92rem;
}

.bulk-chip-text span {
  font-size: 0.78rem;
  color: var(--app-muted);
}

.bulk-chip-remove {
  border: 0;
  background: transparent;
  color: #9a3412;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.bulk-chip-remove:hover {
  background: #ffedd5;
}

.day-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.day-upload-item {
  border: 1px solid var(--app-border);
  border-radius: 12px;
  padding: 0.75rem;
  background: #f9f5f7;
}

.day-upload-item label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.excel-rows {
  display: grid;
  gap: 0.75rem;
}

.excel-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.excel-row-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 0.65rem;
}

@media (max-width: 767.98px) {
  .excel-row-fields {
    grid-template-columns: 1fr;
  }
}

.merge-matrix-wrap {
  overflow-x: auto;
}

.merge-matrix th,
.merge-matrix td {
  white-space: nowrap;
}

.merge-matrix thead th {
  vertical-align: bottom;
}

.att-mark {
  display: inline-block;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1;
  min-width: 1.15em;
  text-align: center;
}

.att-mark.present {
  color: #15803d;
}

.att-mark.absent {
  color: #dc2626;
}

.att-cell {
  text-align: center;
  vertical-align: middle;
}

.att-days-cell {
  white-space: normal;
  min-width: 10rem;
}

.att-day-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0.1rem 0.15rem;
  padding: 0.1rem 0.35rem;
  background: #f1f5f9;
  border-radius: 0.35rem;
  font-size: 0.82rem;
}


@media (max-width: 767.98px) {
  .add-trainee-grid {
    grid-template-columns: 1fr;
  }
}

.side-brand .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  transition: opacity 0.2s;
}

.side-brand .brand-text strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.side-brand .brand-text small {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(215, 226, 232, 0.7);
}

.side-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem;
  margin: 0.85rem 0.75rem 0.35rem;
  border-radius: var(--app-radius);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.side-avatar {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--app-primary);
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}

.side-user-info strong {
  color: #fff;
  font-size: 0.9rem;
}

.side-user .muted {
  color: rgba(215, 226, 232, 0.65) !important;
}

.side-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.35rem 0.65rem 1rem;
}

.side-section {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 174, 0.95);
  padding: 0.95rem 0.75rem 0.4rem;
  transition: opacity 0.2s;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.68rem 0.85rem;
  margin-bottom: 0.2rem;
  border-radius: 10px;
  color: #ddd0d8;
  transition: background 0.18s, color 0.18s;
}

.side-link .side-ico {
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
  font-size: 1.05rem;
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.side-link.active {
  background: rgba(113, 75, 103, 0.48);
  color: #fff;
  box-shadow: inset 3px 0 0 #d7c2d0;
}

.side-link.danger:hover {
  background: rgba(220, 38, 38, 0.18);
  color: #fecaca;
}

.sidebar-toggle-btn {
  margin: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #e4d8df;
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.18s;
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar.collapsed .sidebar-toggle-btn .toggle-label {
  display: none;
}

/* ===== Main content ===== */
.app-content {
  min-height: 100vh;
  margin-right: var(--app-sidebar-w);
  transition: margin-right 0.28s var(--app-ease);
}

body.sidebar-collapsed .app-content {
  margin-right: var(--app-sidebar-collapsed);
}

.content-top {
  position: sticky;
  top: 0;
  z-index: 1030;
  min-height: var(--app-top-h);
  padding: 0.75rem 1.35rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--app-border);
  color: var(--app-text);
}

.content-top-title {
  font-weight: 700;
  font-size: 1.08rem;
  flex: 1;
  color: var(--app-text);
  letter-spacing: -0.01em;
}

.content-top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.content-top .nav-toggle {
  border-color: var(--app-border);
  background: #fff;
  color: var(--app-text);
}

.content-top .notif-btn,
.content-top .user-menu-btn {
  background: #fff !important;
  border-color: var(--app-border) !important;
  color: var(--app-text) !important;
}

.content-top .user-menu-meta strong {
  color: var(--app-text);
}

.content-top .user-menu-caret {
  color: var(--app-muted);
}

.role-pill {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-weight: 600;
}

.role-pill.admin { background: #efe6ec; color: #5c3d54; }
.role-pill.trainer { background: #e8f4f4; color: #017E84; }
.role-pill.trainee { background: var(--app-primary-soft); color: var(--app-primary); }

/* ===== Dashboard hero ===== */
.dash-hero {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  min-height: 248px;
  margin-bottom: 1.2rem;
  display: grid;
  align-items: end;
  box-shadow: var(--app-shadow);
  animation: fadeUp 0.45s var(--app-ease) both;
}

.dash-hero-media {
  position: absolute;
  inset: 0;
}

.dash-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dash-hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(44, 30, 41, 0.92) 0%, rgba(113, 75, 103, 0.72) 52%, rgba(113, 75, 103, 0.28) 100%),
    linear-gradient(0deg, rgba(44, 30, 41, 0.4), transparent 55%);
}

.dash-hero-body {
  position: relative;
  z-index: 1;
  padding: 1.7rem 1.6rem;
  color: #fff;
  max-width: 640px;
}

.dash-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.55rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: 0.02em;
}

.dash-hero-body h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dash-hero-text {
  margin: 0 0 1rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.7;
}

.dash-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.dash-hero-actions .btn-outline-light {
  border-width: 1.5px;
}

@media (max-width: 767.98px) {
  .dash-hero {
    min-height: 210px;
  }
}

main.container {
  max-width: 1280px;
  padding: 1.35rem 1.25rem 2rem;
}

main.container > .page-head,
main.container > .card,
main.container > .grid,
main.container > .ct-page,
main.container > .create-page,
main.container > .notif-list,
main.container > .alert-app {
  animation: fadeUp 0.4s var(--app-ease) both;
}

main.container > .card:nth-child(2),
main.container > .grid + .card {
  animation-delay: 0.05s;
}

/* ===== Cards & layout ===== */
.card {
  background: var(--app-card);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  padding: 1.2rem 1.25rem;
  margin-bottom: 1rem;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.page-head h1 {
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  margin: 0 0 0.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--app-navy);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.1rem;
}

.grid .card {
  text-align: center;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--app-ease), border-color 0.2s;
}

.grid .card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--app-primary), #8d6284);
}

.grid .card:hover {
  transform: translateY(-2px);
  border-color: #d4c2cd;
}

.stat {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--app-primary);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.muted, .text-muted {
  color: var(--app-muted) !important;
}

.tiny {
  font-size: 0.78rem;
}

/* ===== Buttons ===== */
.btn-primary {
  --bs-btn-bg: var(--app-primary);
  --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-primary-hover);
  --bs-btn-hover-border-color: var(--app-primary-hover);
  --bs-btn-active-bg: var(--app-primary-hover);
  --bs-btn-active-border-color: var(--app-primary-hover);
}

.btn, a.btn {
  border-radius: var(--app-radius-sm);
  font-weight: 600;
  transition: background 0.18s, border-color 0.18s, transform 0.15s;
}

.btn:active, a.btn:active {
  transform: translateY(1px);
}

.btn.secondary, a.btn.secondary {
  background: #fff;
  border: 1px solid var(--app-border);
  color: var(--app-text);
}

.btn.secondary:hover {
  background: #f4f7f6;
  border-color: #c5d0d5;
}

.btn.success {
  background: #15803d;
  color: #fff;
  border: none;
}

.btn.danger {
  background: #c2410c;
  color: #fff;
  border: none;
}

.btn.small, .btn-sm {
  padding: 0.28rem 0.7rem;
  font-size: 0.85rem;
}

.btn.google {
  background: #fff;
  border: 1px solid var(--app-border);
  color: var(--app-text);
}

/* ===== Badges ===== */
.badge:not(.rounded-pill) {
  display: inline-block;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  font-size: 0.76rem;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-weight: 600;
}

.badge.closed, .badge.warn {
  background: #f8ebe0;
  color: #b45309;
}

.badge.live {
  background: #e7f6ed;
  color: #15803d;
}

.badge.ended {
  background: #eef1f4;
  color: #475569;
  border: 1px solid #d5dee8;
}

/* ===== Trainee dashboard courses ===== */
.trainee-stats .card.tone-live::before {
  background: linear-gradient(90deg, #16a34a, #4ade80);
}

.trainee-stats .card.tone-ended::before {
  background: linear-gradient(90deg, #64748b, #94a3b8);
}

.trainee-courses-list {
  display: grid;
  gap: 0.85rem;
}

.trainee-course-card {
  border: 1px solid var(--app-border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  background: #fff;
  border-inline-start: 5px solid #cbd5e1;
  transition: box-shadow .15s ease, transform .15s ease;
}

.trainee-course-card:hover {
  box-shadow: 0 8px 22px rgba(15, 40, 60, .07);
}

.trainee-course-card.is-active {
  border-inline-start-color: #16a34a;
  background: linear-gradient(180deg, #f3fbf6 0%, #fff 42%);
}

.trainee-course-card.is-ended {
  border-inline-start-color: #64748b;
  background: linear-gradient(180deg, #f5f7fa 0%, #fff 50%);
  opacity: .96;
}

.trainee-course-card.is-upcoming {
  border-inline-start-color: #d97706;
  background: linear-gradient(180deg, #fff8ef 0%, #fff 45%);
}

.trainee-course-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.trainee-course-card-title h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #1e293b;
}

.trainee-course-card.is-ended .trainee-course-card-title h3 {
  color: #334155;
}

.trainee-course-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.trainee-course-meta .label {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.15rem;
}

.trainee-course-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.trainee-course-page.is-ended .course-tabs-nav {
  border-color: #d5dee8;
}

.empty-state {
  padding: 1.5rem 1rem;
  text-align: center;
  border: 1px dashed #d5dee8;
  border-radius: 12px;
  background: #f8fafc;
}

/* ===== Forms ===== */
label {
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
  color: #334155;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.form-grid .full {
  grid-column: 1 / -1;
}

input, select, textarea,
.form-control, .form-select {
  width: 100%;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  padding: 0.58rem 0.8rem;
  background: #fff;
  color: var(--app-text);
  font-family: inherit;
  transition: border-color 0.18s, box-shadow 0.18s;
}

input:focus, select:focus, textarea:focus,
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--app-primary);
  box-shadow: 0 0 0 3px rgba(113, 75, 103, 0.14);
}

/* ===== Flash ===== */
.flash, .alert-app {
  padding: 0.8rem 1.05rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  background: #f4eef2;
  border: 1px solid #e0d0da;
  color: #5c3d54;
  animation: fadeUp 0.35s var(--app-ease) both;
}

.flash.error, .alert-app.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

/* ===== Tables ===== */
.table-responsive {
  border-radius: var(--app-radius-sm);
}

.table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
}

.table > thead > tr > th {
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--app-muted);
  background: #f5f8f7;
  border-bottom-color: var(--app-border);
  padding: 0.75rem 0.85rem;
}

.table > tbody > tr > td {
  padding: 0.8rem 0.85rem;
  vertical-align: middle;
  border-color: #e8eef0;
}

.table > tbody > tr:hover {
  background: #f8f4f6;
}

.table-pagination .page-link {
  border-radius: 7px;
  margin: 0 2px;
  color: var(--app-text);
  border-color: var(--app-border);
}

.table-pagination .page-item.active .page-link {
  background: var(--app-primary);
  border-color: var(--app-primary);
}

/* ===== Notifications ===== */
.notif-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px !important;
  display: grid;
  place-items: center;
  padding: 0 !important;
  position: relative;
}

.user-menu-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
  border-radius: 10px !important;
  padding: 0.25rem 0.55rem !important;
  border: 1px solid var(--app-border) !important;
  background: #fff !important;
}

.user-menu-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--app-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.user-menu-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e4d4de;
  display: block;
  flex-shrink: 0;
}

.settings-page {
  display: flex;
  justify-content: center;
  padding: 1rem 0 2rem;
}

.settings-card {
  width: min(520px, 100%);
  margin: 0 auto;
  padding: 1.5rem 1.35rem 1.75rem;
}

.settings-head {
  margin-bottom: 1.25rem;
}

.settings-head h1 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  color: var(--app-navy);
}

.settings-block h2 {
  font-size: 1.05rem;
  margin: 0 0 0.85rem;
}

.settings-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  text-align: center;
}

.settings-avatar {
  width: 112px !important;
  height: 112px !important;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #e4d4de;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.settings-pass-form .create-actions {
  justify-content: center;
}

.user-menu-meta {
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  gap: 2px;
}

.user-menu-meta strong {
  font-size: 0.82rem;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-meta .role-pill {
  font-size: 0.68rem;
  padding: 0.1rem 0.4rem;
}

.user-menu-caret {
  font-size: 0.75rem;
  color: var(--app-muted);
}

.user-menu {
  min-width: 220px;
  border-radius: 12px !important;
  border-color: var(--app-border) !important;
  box-shadow: var(--app-shadow) !important;
}

.user-menu .dropdown-item {
  display: flex;
  align-items: center;
  border-radius: 8px;
  margin: 0 0.35rem;
  width: calc(100% - 0.7rem);
}

.notif-menu {
  width: min(360px, 92vw);
  max-height: 420px;
  overflow-y: auto;
  border-radius: 12px !important;
  border-color: var(--app-border) !important;
  box-shadow: var(--app-shadow) !important;
}

.notif-item {
  position: relative;
  padding-inline-start: 1.35rem !important;
  white-space: normal;
}

.notif-item.unread {
  background: #fff5f5;
}

.notif-item.is-read {
  background: transparent;
  opacity: 0.88;
}

.notif-dot {
  position: absolute;
  top: 0.85rem;
  inset-inline-start: 0.65rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #dc2626;
  box-shadow: 0 0 0 2px #fff;
}

.notif-item.is-read .notif-dot {
  display: none;
}

.notif-ico {
  color: var(--app-primary);
  margin-top: 2px;
}

.notif-list .notif-card {
  border: 1px solid var(--app-border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.65rem;
  background: #fff;
  transition: border-color 0.18s, transform 0.18s;
}

.notif-list .notif-card:hover {
  border-color: #d4c2cd;
}

.notif-list .notif-card.unread {
  border-color: #d4c2cd;
  background: #f8f2f6;
}

/* ===== Create course ===== */
.create-page .create-hero {
  margin-bottom: 1rem;
}

.create-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1rem;
}

.panel {
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  padding: 1.05rem;
  margin-bottom: 1rem;
  box-shadow: var(--app-shadow);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.panel-head .step {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-weight: 700;
  flex-shrink: 0;
}

.field-card {
  border: 1px solid var(--app-border);
  border-radius: 12px;
  padding: 0.85rem;
  margin-bottom: 0.65rem;
  background: #faf7f9;
}

.field-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.field-index {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--app-primary);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
}

.back-link, .eyebrow {
  color: var(--app-muted);
  font-size: 0.85rem;
}

.back-link:hover {
  color: var(--app-primary);
}

.create-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sticky-panel {
  position: sticky;
  top: calc(var(--app-top-h) + 12px);
}

/* Create course redesign */
.cc-page {
  padding-bottom: 5.5rem;
}

.cc-top {
  margin-bottom: 1rem;
}

.cc-top .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.cc-top h1 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  color: var(--app-navy);
}

.cc-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1rem;
  align-items: start;
}

.cc-main .course-tabs-nav {
  margin-bottom: 0.85rem;
  background: #f4eef2;
  border-color: #e4d4de;
}

.cc-page .course-tab-card {
  border-radius: 16px;
  box-shadow: var(--app-shadow);
}

.cc-page .course-section.tone-info,
.cc-page .course-section.tone-trainees,
.cc-page .course-section.tone-materials {
  background: #fff;
}

.cc-lead {
  margin: 0 0 1rem;
}

.cc-block {
  margin-top: 0.25rem;
}

.req {
  color: #b91c1c;
}

.cc-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.cc-seg-item {
  margin: 0;
  cursor: pointer;
}

.cc-seg-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cc-seg-item span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: #fff;
  color: var(--app-text);
  font-weight: 600;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.cc-seg-item input:checked + span {
  border-color: var(--app-primary);
  background: var(--app-primary-soft);
  color: var(--app-primary);
  box-shadow: 0 0 0 3px rgba(113, 75, 103, 0.12);
}

.cc-selected-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.cc-fields-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.cc-summary {
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 16px;
  padding: 1.05rem 1.1rem;
  box-shadow: var(--app-shadow);
}

.cc-summary h2 {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  color: var(--app-navy);
}

.cc-summary-list {
  margin: 0;
  display: grid;
  gap: 0.7rem;
}

.cc-summary-list > div {
  display: grid;
  gap: 0.15rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #efe8ec;
}

.cc-summary-list > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.cc-summary-list dt {
  font-size: 0.78rem;
  color: var(--app-muted);
  margin: 0;
}

.cc-summary-list dd {
  margin: 0;
  font-weight: 700;
  color: var(--app-navy);
  word-break: break-word;
}

.cc-hints {
  margin: 1rem 0 0;
  padding: 0.75rem 0.85rem 0.75rem 1.1rem;
  border-radius: 12px;
  background: var(--app-primary-soft);
  color: #5c3d54;
  font-size: 0.84rem;
  line-height: 1.55;
}

.cc-hints li + li {
  margin-top: 0.3rem;
}

.cc-side-actions {
  margin-top: 1rem;
  flex-direction: column;
}

.cc-side-actions .btn {
  width: 100%;
  justify-content: center;
}

.cc-footer-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.1rem;
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--app-border);
  backdrop-filter: blur(8px);
  margin-right: var(--app-sidebar-w);
  transition: margin-right 0.28s var(--app-ease);
}

body.sidebar-collapsed .cc-footer-bar {
  margin-right: var(--app-sidebar-collapsed);
}

.cc-title-input {
  font-size: 1.05rem;
  font-weight: 600;
}

@media (max-width: 991.98px) {
  .cc-shell {
    grid-template-columns: 1fr;
  }

  .cc-side {
    order: -1;
  }

  .cc-summary {
    position: static;
  }

  .cc-side-actions {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .cc-footer-bar {
    margin-right: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .cc-footer-meta {
    text-align: center;
  }

  .cc-seg {
    grid-template-columns: 1fr;
  }
}


/* ===== Materials ===== */
.materials-list {
  display: grid;
  gap: 0.75rem;
}

.material-card {
  border: 1px solid var(--app-border);
  border-radius: 11px;
  padding: 0.9rem;
  background: #f9f5f7;
}

.material-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.material-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.65rem;
}

.inline-form {
  display: inline;
}

.trainer-actions .inline-form {
  display: inline-flex;
  margin: 0;
}

/* ===== Employee search ===== */
.emp-suggest {
  display: none;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: #fff;
  margin-top: 0.35rem;
  overflow: hidden;
  box-shadow: var(--app-shadow);
}

.emp-suggest.open {
  display: block;
}

.emp-suggest button {
  display: block;
  width: 100%;
  text-align: right;
  border: 0;
  background: #fff;
  padding: 0.55rem 0.75rem;
  font-family: inherit;
}

.emp-suggest button:hover {
  background: #f4f7f6;
}

/* ===== Guest / login / home ===== */
.guest-shell {
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
  padding: 1.5rem 1rem 2.5rem;
}

.guest-topbar {
  background: transparent;
  color: #fff;
  padding: 1rem 1.5rem;
}

.guest-topbar .brand a {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
}

.guest-topbar .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.guest-panel {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  animation: fadeUp 0.5s var(--app-ease) both;
}

.guest-brand {
  padding: 2.4rem 2rem;
  background:
    linear-gradient(160deg, rgba(113, 75, 103, 0.35), transparent 55%),
    rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.guest-brand .brand-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.guest-brand h1 {
  margin: 0;
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: #fff;
}

.guest-brand p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.75;
  max-width: 36ch;
}

.guest-brand-stats {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.guest-brand-stats div {
  min-width: 90px;
}

.guest-brand-stats strong {
  display: block;
  font-size: 1.35rem;
  color: #fff;
}

.guest-brand-stats span {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.guest-form-wrap {
  padding: 2rem 1.75rem;
  background: #ffffff;
  color: var(--app-text);
}

.guest-form-wrap h2,
.guest-form-wrap .muted,
.guest-form-wrap label {
  color: inherit;
}

.guest-form-wrap h2 {
  color: var(--app-navy);
}

.guest-form-wrap .muted {
  color: var(--app-muted) !important;
}

.guest-form-wrap h2 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  color: var(--app-navy);
}

.local-login-form {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.1rem;
}

.local-login-form .btn,
.login .btn {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--app-primary);
  border: none;
  color: #fff;
  font-weight: 700;
}

.local-login-form .btn:hover,
.login .btn:hover {
  background: var(--app-primary-hover);
  color: #fff;
}

.demo-accounts {
  margin-top: 1.15rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  background: #f5f8f7;
  border: 1px solid var(--app-border);
  font-size: 0.86rem;
}

.demo-accounts p {
  margin: 0.35rem 0;
}

.demo-accounts code {
  background: #e8eef0;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.account-pick-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(44, 30, 41, 0.62);
  backdrop-filter: blur(4px);
}

.account-pick-dialog {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  padding: 1.25rem;
}

.account-pick-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  color: var(--app-navy);
}

.account-pick-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 1rem 0;
}

.account-pick-card {
  margin: 0;
}

.account-pick-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: start;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  padding: 0.75rem 0.85rem;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}

.account-pick-btn:hover {
  border-color: var(--app-primary);
  background: #f8f2f6;
  transform: translateY(-1px);
}

.account-pick-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.account-pick-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.account-pick-meta strong {
  color: var(--app-navy);
}

.account-pick-role {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--app-primary);
  font-weight: 600;
  font-size: 0.92rem;
}

.account-pick-go {
  color: #64748b;
  font-size: 1.1rem;
}

.account-pick-foot {
  display: flex;
  justify-content: center;
}

.login-sep {
  margin: 1.15rem 0;
  border: 0;
  border-top: 1px solid var(--app-border);
}

.hero {
  text-align: center;
  padding: 3rem 1rem;
  color: #fff;
}

.hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  color: #fff;
}

.login-card,
.card.login {
  max-width: none;
  margin: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.perm-group {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--app-border);
}

.perm-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-weight: 500;
}

.share {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  word-break: break-all;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

.info-grid .label {
  display: block;
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.info-grid strong {
  font-weight: 700;
}

.emp-preview-card {
  background: #f8f2f6;
  border-color: #d4c2cd;
}

/* ===== Create trainer ===== */
.ct-page {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 2rem;
}

.ct-shell {
  width: min(720px, 100%);
}

.ct-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.ct-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--app-muted);
  font-size: 0.9rem;
  margin-bottom: 0.85rem;
}

.ct-back:hover {
  color: var(--app-primary);
}

.ct-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.85rem;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #8d6284, var(--app-primary));
  color: #fff;
  font-size: 1.6rem;
  box-shadow: 0 10px 24px rgba(113, 75, 103, 0.22);
}

.ct-header h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  color: var(--app-navy);
}

.ct-header .muted {
  margin: 0 auto;
  max-width: 420px;
}

.ct-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.ct-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.4rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--app-border);
  color: var(--app-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.ct-step span {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #ebe4e8;
  color: #475569;
  font-size: 0.75rem;
}

.ct-step.active {
  border-color: #b897ab;
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.ct-step.active span {
  background: var(--app-primary);
  color: #fff;
}

.ct-step.done {
  border-color: #86efac;
  background: #f0fdf4;
  color: #15803d;
}

.ct-step.done span {
  background: #15803d;
  color: #fff;
}

.ct-card {
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  box-shadow: var(--app-shadow);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
}

.ct-card.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.ct-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ct-card-head > i {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  flex-shrink: 0;
}

.ct-card-head strong {
  display: block;
}

.ct-card-head small {
  color: var(--app-muted);
}

.ct-search-row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.ct-search-row .form-control {
  flex: 1;
  min-width: 180px;
}

.ct-emp-card {
  background: linear-gradient(180deg, #f8f2f6 0%, #fff 100%);
  border: 1px solid #d4c2cd;
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
  box-shadow: var(--app-shadow);
}

.ct-emp-top {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.ct-emp-avatar {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--app-primary);
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.ct-emp-top h2 {
  margin: 0;
  font-size: 1.15rem;
}

.ct-emp-top .badge {
  margin-inline-start: auto;
}

.ct-alert {
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.ct-alert.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.ct-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--app-border);
}

@media (max-width: 575.98px) {
  .ct-steps {
    grid-template-columns: 1fr;
  }

  .ct-search-row {
    flex-direction: column;
  }

  .ct-search-row .btn {
    width: 100%;
  }

  .ct-actions {
    flex-direction: column;
  }

  .ct-actions .btn {
    width: 100%;
  }
}

.nav-toggle {
  display: none;
  border: 1px solid var(--app-border);
  background: #fff;
  border-radius: 10px;
  width: 38px;
  height: 38px;
}

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(100%);
    width: min(86vw, var(--app-sidebar-w));
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar.collapsed {
    width: min(86vw, var(--app-sidebar-w));
  }

  .app-content,
  body.sidebar-collapsed .app-content {
    margin-right: 0;
  }

  .nav-toggle {
    display: grid;
    place-items: center;
  }

  .create-layout {
    grid-template-columns: 1fr;
  }

  .sidebar-toggle-btn .toggle-label {
    display: inline !important;
  }

  .guest-panel {
    grid-template-columns: 1fr;
  }

  .guest-brand {
    padding: 1.75rem 1.4rem 1.25rem;
  }
}

.trainer-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.row-inactive td {
  opacity: 0.72;
}

.course-filters .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.course-filters {
  margin-bottom: 1rem;
}

/* ===== Permissions ===== */
.perm-role-nav {
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.perm-role-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  background: #fff;
  color: var(--app-text);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.perm-role-link i {
  color: var(--app-primary);
}

.perm-role-link:hover {
  border-color: #d4c2cd;
  background: #f8f2f6;
}

.perm-role-link.active {
  border-color: var(--app-primary);
  background: var(--app-primary-soft);
  color: var(--app-primary);
  box-shadow: 0 0 0 3px rgba(113, 75, 103, 0.12);
}

.perm-group-nav {
  margin: 0.35rem 0 1rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.perm-group-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--app-border);
  background: #fff;
  color: var(--app-text);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.perm-group-tab:hover {
  border-color: #d4c2cd;
  background: #f8f2f6;
}

.perm-group-tab.active {
  border-color: var(--app-primary);
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.perm-tab-count {
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(113, 75, 103, 0.12);
  color: var(--app-primary);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  min-width: 1.4rem;
  text-align: center;
}

.perm-group-pane[hidden] {
  display: none !important;
}

.perm-role-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.perm-role-tab {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--app-border);
  color: var(--app-text);
  transition: border-color 0.2s, background 0.2s;
}

.perm-role-tab i {
  font-size: 1.25rem;
  color: var(--app-primary);
  margin-top: 2px;
}

.perm-role-tab strong {
  display: block;
  font-size: 1rem;
}

.perm-role-tab small {
  display: block;
  color: var(--app-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.perm-role-tab:hover {
  border-color: #d4c2cd;
  background: #f8f2f6;
}

.perm-role-tab.active {
  border-color: var(--app-primary);
  background: var(--app-primary-soft);
  box-shadow: 0 0 0 3px rgba(113, 75, 103, 0.12);
}

.perm-card-head,
.perm-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.perm-card-head {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--app-border);
}

.perm-card-foot {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--app-border);
}

.perm-section {
  margin-bottom: 1.25rem;
}

.perm-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.perm-section-head h3 {
  margin: 0;
  font-size: 1rem;
}

.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.55rem;
}

.perm-switch {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--app-border);
  border-radius: 11px;
  background: #f9f5f7;
  cursor: pointer;
  margin: 0;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}

.perm-switch:hover {
  background: #eef6f4;
  border-color: #d4c2cd;
}

.perm-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.perm-switch-ui {
  width: 42px;
  height: 24px;
  border-radius: 12px;
  background: #cbd5e1;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}

.perm-switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s;
}

.perm-switch input:checked + .perm-switch-ui {
  background: var(--app-primary);
}

.perm-switch input:checked + .perm-switch-ui::after {
  transform: translateX(-18px);
}

.perm-switch-text {
  line-height: 1.35;
}

@media (max-width: 767.98px) {
  .perm-role-tabs {
    grid-template-columns: 1fr;
  }
}

/* Searchable select */
.ss-wrap {
  position: relative;
  width: 100%;
}

.ss-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.ss-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: start;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: #fff;
  color: var(--app-text);
  font: inherit;
  cursor: pointer;
  min-height: 42px;
}

.ss-trigger:hover,
.ss-wrap.open .ss-trigger,
.ss-trigger:focus {
  border-color: var(--app-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(113, 75, 103, 0.12);
}

.ss-trigger-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ss-trigger-label.is-placeholder {
  color: var(--app-muted);
}

.ss-trigger-icon {
  color: var(--app-muted);
  flex-shrink: 0;
}

.ss-panel {
  position: absolute;
  z-index: 40;
  inset-inline: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  padding: 0.55rem;
  max-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ss-panel[hidden] {
  display: none !important;
}

.ss-search {
  width: 100%;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font: inherit;
}

.ss-search:focus {
  outline: none;
  border-color: var(--app-primary);
  box-shadow: 0 0 0 3px rgba(113, 75, 103, 0.12);
}

.ss-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  max-height: 210px;
}

.ss-option {
  width: 100%;
  display: block;
  text-align: start;
  border: 0;
  background: transparent;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  font: inherit;
  color: var(--app-text);
  cursor: pointer;
}

.ss-option:hover,
.ss-option.is-active {
  background: #f8f2f6;
}

.ss-option.is-selected {
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-weight: 600;
}

.ss-empty {
  padding: 0.65rem;
  color: var(--app-muted);
  font-size: 0.9rem;
  text-align: center;
}

.ss-wrap.is-disabled .ss-trigger {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f1f5f9;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* â€”â€” Interactive exams â€”â€” */
.exams-panel .exam-create-form {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.exams-list {
  display: grid;
  gap: 0.85rem;
}

.exam-card {
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: #f8fafc;
}

.exam-card-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.exam-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.exam-q-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  background: #fff;
}

.exam-q-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.exam-q-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.4rem;
}

.exam-q-prompt {
  margin-bottom: 0.55rem;
  font-weight: 600;
}

.exam-options-preview {
  margin: 0;
  padding-inline-start: 1.2rem;
}

.exam-options-preview li.correct {
  color: #15803d;
  font-weight: 700;
}

.mcq-options {
  display: grid;
  gap: 0.45rem;
}

.mcq-opt {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem;
  align-items: center;
}

.tf-choices {
  display: flex;
  gap: 1rem;
  margin-top: 0.35rem;
}

.tf-choice {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.45rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.exam-type-panel {
  margin-top: 0.85rem;
  padding: 0.85rem;
  border-radius: 10px;
  background: #f1f5f9;
}

.exam-take-q {
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  padding: 0.9rem 1rem 1rem;
  margin: 0 0 1rem;
  background: #f8fafc;
}

.exam-take-q legend {
  font-weight: 700;
  padding: 0 0.35rem;
}

.exam-choice {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  padding: 0.45rem 0.55rem;
  margin: 0.25rem 0;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  cursor: pointer;
}

.exam-choice:hover {
  border-color: var(--app-primary);
}

.exam-score-pill {
  text-align: center;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.exam-score-pill .stat {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--app-primary);
}

.exam-result-q {
  border-radius: 10px;
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  border: 1px solid #e2e8f0;
}

.exam-result-q.ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.exam-result-q.bad {
  background: #fef2f2;
  border-color: #fecaca;
}

/* â€”â€” Course page section distinction â€”â€” */
.course-page {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.course-page > .course-jump {
  position: sticky;
  top: 0.5rem;
  z-index: 20;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(8px);
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  border: 1px solid var(--app-border);
  margin-bottom: 0.75rem !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.course-section {
  position: relative;
  overflow: hidden;
  margin-bottom: 1.15rem;
  border-width: 1px;
  border-style: solid;
  scroll-margin-top: 4.5rem;
}

.course-section::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 5px;
  background: var(--section-accent, var(--app-primary));
}

.course-section-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: -0.15rem 0 0.95rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed color-mix(in srgb, var(--section-accent, var(--app-primary)) 35%, transparent);
}

.course-section-head h2 {
  margin: 0;
  font-size: 1.12rem;
  color: var(--app-navy);
}

.course-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  flex-shrink: 0;
  font-size: 1.15rem;
  color: var(--section-accent, var(--app-primary));
  background: color-mix(in srgb, var(--section-accent, var(--app-primary)) 14%, #fff);
}

.course-section.tone-info {
  --section-accent: var(--app-primary);
  background: linear-gradient(180deg, #f8f2f6 0%, #ffffff 42%);
  border-color: #e4d4de;
}

.course-section.tone-manage {
  --section-accent: #1e3a5f;
  background: linear-gradient(180deg, #f1f5f9 0%, #ffffff 45%);
  border-color: #cbd5e1;
}

.course-section.tone-trainees {
  --section-accent: #0369a1;
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 45%);
  border-color: #bae6fd;
}

.course-section.tone-materials {
  --section-accent: #b45309;
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 45%);
  border-color: #fde68a;
}

.course-section.tone-exams {
  --section-accent: #15803d;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 45%);
  border-color: #bbf7d0;
}

.course-section.tone-roster {
  --section-accent: #5b21b6;
  background: linear-gradient(180deg, #f5f3ff 0%, #ffffff 45%);
  border-color: #ddd6fe;
}

.course-section.tone-whiteboard {
  --section-accent: #714B67;
  background: linear-gradient(180deg, #f4eef2 0%, #ffffff 45%);
  border-color: #e4d4de;
}

.course-section.tone-plan {
  --section-accent: #a16207;
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 45%);
  border-color: #fde68a;
}

.course-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0.55rem;
  border-radius: 14px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  position: sticky;
  top: 0.35rem;
  z-index: 15;
}

.course-tab-link {
  border: 1px solid transparent;
  background: transparent;
  color: #334155;
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.course-tab-link:hover {
  background: #fff;
  border-color: #cbd5e1;
}

.course-tab-link.active {
  background: var(--app-primary);
  color: #fff;
  border-color: var(--app-primary);
  box-shadow: 0 4px 12px rgba(113, 75, 103, 0.28);
}

.course-tab-pane {
  display: none;
}

.course-tab-pane.active,
.course-tab-pane.show {
  display: block;
}

.course-tab-card {
  margin-bottom: 0;
}

.course-page > .course-jump {
  position: static;
}

.whiteboard-app {
  margin-bottom: 1.25rem;
}

.wb-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.wb-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  margin: 0;
}

.wb-tool-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-inline-end: 0.25rem;
}

.wb-colors {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.4rem;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.wb-swatch {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #94a3b8;
  background: var(--sw);
  padding: 0;
  cursor: pointer;
}

.wb-swatch.active {
  box-shadow: 0 0 0 2px var(--app-primary);
  transform: scale(1.08);
}

.wb-color-custom input[type="color"] {
  width: 2rem;
  height: 1.7rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.wb-title {
  min-width: 12rem;
  max-width: 18rem;
}

.wb-canvas-wrap {
  position: relative;
  border: 1px solid #94a3b8;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px #e2e8f0;
  min-height: min(72vh, 820px);
  height: min(72vh, 820px);
}

#wb-canvas,
#wb-overlay {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#wb-canvas {
  cursor: none;
  background: #f8fafc;
}

#wb-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.wb-canvas-wrap.mode-select #wb-canvas {
  cursor: crosshair;
}

.wb-tool-btn.active {
  background: var(--app-primary) !important;
  border-color: var(--app-primary) !important;
  color: #fff !important;
}

.wb-page-body {
  margin: 0;
  background: var(--app-navy);
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.wb-page-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.45rem 0.75rem;
  background: var(--app-navy-mid);
  color: #f8f0f5;
  flex: 0 0 auto;
}

.wb-page-bar .muted {
  color: #d7c2d0;
}

.wb-fullpage-app {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 0;
  height: auto;
  background: #1a1218;
  padding: 0;
  gap: 0;
}

.wb-fullpage-app .wb-toolbar {
  background: #2a1d27;
  border-radius: 0;
  padding: 0.45rem 0.55rem;
  margin: 0;
  color: #f1e6ed;
  flex: 0 0 auto;
}

.wb-fullpage-app .wb-canvas-wrap {
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.wb-fullpage-app #wb-status {
  display: none;
}

/* Browser fullscreen: edge-to-edge canvas, tools stay visible on top */
.whiteboard-app:fullscreen,
.whiteboard-app:-webkit-full-screen,
.whiteboard-app.is-fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  background: #1a1218;
  box-sizing: border-box;
  overflow: hidden;
}

.whiteboard-app:fullscreen .wb-toolbar,
.whiteboard-app:-webkit-full-screen .wb-toolbar,
.whiteboard-app.is-fullscreen .wb-toolbar {
  flex: 0 0 auto;
  margin: 0;
  border-radius: 0;
  padding: 0.45rem 0.55rem;
  background: #2a1d27;
  color: #f1e6ed;
}

.whiteboard-app:fullscreen .wb-canvas-wrap,
.whiteboard-app:-webkit-full-screen .wb-canvas-wrap,
.whiteboard-app.is-fullscreen .wb-canvas-wrap {
  flex: 1 1 auto;
  min-height: 0 !important;
  height: auto !important;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.whiteboard-app:fullscreen #wb-status,
.whiteboard-app:-webkit-full-screen #wb-status,
.whiteboard-app.is-fullscreen #wb-status {
  display: none;
}

.wb-gallery-title {
  font-size: 1.05rem;
  margin: 1rem 0 0.75rem;
}

.wb-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
}

.wb-snap {
  margin: 0;
  padding: 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.wb-snap img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.plan-editor {
  font-family: inherit;
  line-height: 1.7;
}

.plan-view {
  white-space: pre-wrap;
  line-height: 1.8;
  padding: 0.75rem;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

@media (max-width: 767.98px) {
  .course-tab-link span {
    display: none;
  }
  .course-tab-link {
    padding: 0.55rem 0.65rem;
  }
}

.course-section-body > .muted:first-child {
  margin-top: 0;
}

/* Avatars & trainer ratings */
.side-avatar-img,
.trainer-list-avatar,
.trainer-hero-avatar,
.user-avatar {
  object-fit: cover;
  border-radius: 50%;
  background: #e2e8f0;
  flex-shrink: 0;
  display: block;
}

.side-avatar-img {
  width: 42px;
  height: 42px;
  border: 2px solid #e4d4de;
}

.trainer-list-avatar {
  width: 44px;
  height: 44px;
}

.trainer-hero-avatar {
  width: 96px;
  height: 96px;
  border: 3px solid #f0e6ec;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.trainer-cell,
.trainer-rate-head,
.trainer-profile-hero {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.trainer-rating-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin-top: 0.2rem;
}

.star-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.08rem;
  color: #ca8a04;
  font-size: 0.95rem;
}

.star-rating .star-num {
  margin-inline-start: 0.35rem;
  color: var(--app-navy);
  font-weight: 700;
  font-size: 0.85rem;
}

.picked-box {
  margin-top: 0.55rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: #f8f2f6;
  border: 1px solid #e4d4de;
}

.searchable-picker {
  position: relative;
}

.trainer-self-profile {
  margin-bottom: 1rem;
}

.ct-header .trainer-profile-hero {
  margin-top: 0.75rem;
  text-align: start;
}

.ct-header .trainer-profile-hero h1 {
  margin: 0 0 0.25rem;
}

/* Nomination panel */
.nom-panel {
  background: #fff;
  border: 1px solid #e4d4de;
  border-radius: 16px;
  padding: 1rem 1.05rem 1.1rem;
  box-shadow: var(--app-shadow);
}
.nom-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.nom-panel-title {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  color: var(--app-navy);
}
.nom-panel-stats {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.nom-stat {
  background: var(--app-primary-soft);
  color: var(--app-primary);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.nom-toolbar {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0.65rem;
}
.nom-toolbar-search {
  position: relative;
  flex: 1 1 220px;
  min-width: 180px;
}
.nom-toolbar-search i {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--app-muted);
  pointer-events: none;
}
.nom-toolbar-search .form-control {
  padding-right: 2.1rem;
}
.nom-toolbar-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.nom-bulk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.7rem;
  padding: 0.55rem 0.65rem;
  background: #faf7f9;
  border-radius: 12px;
  border: 1px dashed #e4d4de;
}
.nom-bulk-row .form-control {
  width: 5.5rem;
}
.nom-dept-list {
  max-height: 340px;
  overflow: auto;
  border: 1px solid #efe8ec;
  border-radius: 12px;
  background: #fff;
  padding: 0.3rem;
  display: grid;
  gap: 0.25rem;
}
.nom-dept-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.nom-dept-row:hover { background: #faf7f9; }
.nom-dept-row.is-on {
  background: var(--app-primary-soft);
  border-color: #e4d4de;
}
.nom-dept-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  cursor: pointer;
  min-width: 0;
}
.nom-dept-check input {
  accent-color: var(--app-primary);
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}
.nom-dept-name {
  font-weight: 600;
  color: var(--app-navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nom-quota-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.nom-quota-label {
  font-size: 0.75rem;
  color: var(--app-muted);
  white-space: nowrap;
}
.nom-quota {
  width: 4.5rem;
  text-align: center;
}
.nom-quota:disabled {
  opacity: 0.45;
}
.nom-selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.cc-template-box {
  background: #f4eef2;
  border: 1px solid #e4d4de;
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
}
@media (max-width: 575.98px) {
  .nom-dept-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .nom-quota-wrap { justify-content: space-between; }
}

/* Department portal */
.dept-portal { max-width: 980px; }
.dept-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.dept-hero > div {
  background: #fff;
  border: 1px solid #e4d4de;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  box-shadow: var(--app-shadow);
}
.dept-hero .label {
  display: block;
  font-size: 0.78rem;
  color: var(--app-muted);
  margin-bottom: 0.2rem;
}
.dept-course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
}
.dept-course-card {
  background: #fff;
  border: 1px solid #e4d4de;
  border-radius: 16px;
  padding: 1rem 1.05rem;
  box-shadow: var(--app-shadow);
}
.dept-course-card.is-done { opacity: 0.88; }
.dept-course-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 0.55rem;
}
.dept-course-top h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--app-navy);
}
.dept-course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  color: var(--app-muted);
  font-size: 0.84rem;
  margin-bottom: 0.75rem;
}
.dept-quota-bar {
  height: 8px;
  background: #f1e8ed;
  border-radius: 999px;
  overflow: hidden;
}
.dept-quota-bar > div {
  height: 100%;
  background: var(--app-primary);
  border-radius: 999px;
}
.dept-quota-text {
  margin-top: 0.45rem;
  font-size: 0.86rem;
  color: #5c3d54;
}
.dept-emp-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}
.dept-emp-toolbar .form-control { max-width: 360px; flex: 1 1 220px; }
.dept-emp-list {
  max-height: 420px;
  overflow: auto;
  border: 1px solid #efe8ec;
  border-radius: 14px;
  padding: 0.35rem;
  background: #fff;
  display: grid;
  gap: 0.25rem;
}
.dept-emp-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
}
.dept-emp-row:hover { background: #faf7f9; }
.dept-emp-row.is-done { opacity: 0.65; background: #f8f5f7; }
.dept-emp-row input { accent-color: var(--app-primary); width: 1.05rem; height: 1.05rem; }
.dept-emp-info { flex: 1; min-width: 0; display: grid; gap: 0.1rem; }
.dept-emp-info small { color: var(--app-muted); }

/* ===== Live lecture (WebRTC) ===== */
.live-pulse {
  animation: livePulse 1.4s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); }
  50% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
}
.live-panel-head { margin-bottom: 1rem; }
.live-active-box {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  border-radius: 14px;
}
.live-active-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.live-join-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .85rem;
  padding: .9rem 1rem;
  margin-bottom: 1rem;
  border-radius: 14px;
  border: 1px solid #86efac;
  background: linear-gradient(120deg, #ecfdf5, #fff);
}
.live-join-text {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.trainee-course-card .live-join-mini {
  margin-top: .65rem;
}
.trainee-course-card .btn-live {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}
.trainee-course-card .btn-live:hover {
  background: #15803d;
  color: #fff;
}

.live-room-body {
  margin: 0;
  background: #0b1220;
  color: #e2e8f0;
  min-height: 100vh;
  font-family: "IBM Plex Sans Arabic", Tahoma, sans-serif;
}
.live-room {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.live-room-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  padding: .85rem 1.1rem;
  background: #111827;
  border-bottom: 1px solid #1f2937;
}
.live-room-bar-main {
  display: flex;
  gap: .75rem;
  align-items: center;
  min-width: 0;
}
.live-room-bar h1 {
  margin: 0;
  font-size: 1.1rem;
  color: #f8fafc;
}
.live-room-kicker {
  font-size: .75rem;
  color: #94a3b8;
}
.live-room-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
}
.live-room-main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: .85rem;
  padding: .85rem;
  min-height: 0;
}
.live-stage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .75rem;
  align-content: start;
  min-height: 60vh;
}
.live-tile {
  position: relative;
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  min-height: 180px;
}
.live-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #020617;
}
.live-tile-label {
  position: absolute;
  inset-inline-start: .55rem;
  inset-block-end: .55rem;
  background: rgba(2, 6, 23, .72);
  color: #f8fafc;
  padding: .25rem .55rem;
  border-radius: 999px;
  font-size: .78rem;
}
.live-tile-local {
  border-color: #334155;
}
.live-tile-remote.is-host-view {
  grid-column: 1 / -1;
  min-height: 48vh;
}
.live-side {
  display: grid;
  gap: .75rem;
  align-content: start;
}
.live-side-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 14px;
  padding: .9rem;
}
.live-side-card h2 {
  margin: 0 0 .75rem;
  font-size: .95rem;
  color: #f1f5f9;
}
.live-controls {
  display: grid;
  gap: .45rem;
}
.live-controls .btn.is-off {
  opacity: .7;
  border-color: #b91c1c;
  color: #fecaca;
}
.live-controls .btn.is-on {
  border-color: #16a34a;
  color: #bbf7d0;
}
.live-participants {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .35rem;
  max-height: 40vh;
  overflow: auto;
}
.live-participants li {
  padding: .4rem .55rem;
  border-radius: 8px;
  background: #0b1220;
  border: 1px solid #1e293b;
  font-size: .85rem;
}
.live-participants li.is-me {
  border-color: #334155;
  color: #bbf7d0;
}
.live-error {
  position: fixed;
  inset-inline: 1rem;
  bottom: 1rem;
  background: #7f1d1d;
  color: #fee2e2;
  border: 1px solid #b91c1c;
  border-radius: 12px;
  padding: .75rem 1rem;
  z-index: 40;
}
@media (max-width: 900px) {
  .live-room-main {
    grid-template-columns: 1fr;
  }
  .live-tile-remote.is-host-view {
    min-height: 36vh;
  }
}

/* Live permission gate */
.live-perm-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(2, 6, 23, .82);
  backdrop-filter: blur(6px);
}
.live-perm-gate[hidden],
.live-perm-gate.is-done {
  display: none !important;
}
.live-perm-card {
  width: min(440px, 100%);
  background: #111827;
  border: 1px solid #334155;
  border-radius: 18px;
  padding: 1.5rem 1.35rem;
  text-align: center;
  color: #e2e8f0;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.live-perm-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto .9rem;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #0f766e;
  color: #ecfdf5;
  font-size: 1.6rem;
}
.live-perm-card h2 {
  margin: 0 0 .55rem;
  font-size: 1.2rem;
  color: #f8fafc;
}
.live-perm-card p {
  margin: 0 0 1rem;
  color: #94a3b8;
  line-height: 1.7;
  font-size: .92rem;
}
.live-perm-list {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: .65rem;
  flex-wrap: wrap;
}
.live-perm-list li {
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 999px;
  padding: .35rem .8rem;
  font-size: .85rem;
}
.live-perm-note {
  margin: .9rem 0 0 !important;
  font-size: .8rem !important;
  color: #cbd5e1 !important;
}
.live-perm-card .btn-lg {
  min-width: 240px;
}
.live-perm-log {
  margin-top: .85rem;
  text-align: right;
  direction: ltr;
  white-space: pre-wrap;
  font-size: .72rem;
  color: #94a3b8;
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: .55rem .65rem;
  max-height: 140px;
  overflow: auto;
}
