:root {
  --brand-primary: #F5B400;
  --brand-primary-dark: #d99d00;
  --brand-secondary: #1F1C17;
  --brand-secondary-soft: rgba(31, 28, 23, 0.85);
  --brand-accent: #FFCB42;
  --brand-accent-soft: rgba(255, 203, 66, 0.2);
  --brand-neutral: #FFF8E1;
  --brand-surface: #ffffff;
  --brand-surface-alt: #FFFBEE;
  --brand-border: rgba(31, 28, 23, 0.08);
  --brand-border-strong: rgba(31, 28, 23, 0.16);
  --brand-muted: rgba(31, 28, 23, 0.62);
  --brand-shadow: 0 24px 48px -28px rgba(31, 28, 23, 0.28);
  --brand-shadow-soft: 0 18px 36px -28px rgba(31, 28, 23, 0.22);
  --brand-radius-sm: 12px;
  --brand-radius-md: 18px;
  --brand-radius-lg: 28px;
  --brand-hero-overlay: linear-gradient(120deg, rgba(245, 180, 0, 0.92), rgba(31, 28, 23, 0.88));
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--brand-surface);
  color: var(--brand-secondary);
  line-height: 1.6;
  min-height: 100vh;
}

body.landing-body,
body.public-body {
  background: radial-gradient(circle at top right, rgba(255, 203, 66, 0.12), transparent 55%),
              radial-gradient(circle at bottom left, rgba(245, 180, 0, 0.16), transparent 45%),
              linear-gradient(180deg, #FFFEF5 0%, #FFF7DC 45%, #FFF2C6 100%);
}

body.brand-auth-body {
  background: linear-gradient(150deg, rgba(255, 248, 225, 0.9), rgba(255, 203, 66, 0.18));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}
h1, h2, h3, h4, h5, h6 {
  color: var(--brand-secondary);
  font-weight: 700;
}

a {
  color: var(--brand-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--brand-primary);
}

.btn {
  border-radius: 14px;
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
}

.btn:focus {
  box-shadow: 0 0 0 0.25rem rgba(245, 180, 0, 0.25);
}

.btn-primary,
.btn-success {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
  border: none;
  color: var(--brand-secondary);
}

.btn-primary:hover,
.btn-success:hover {
  background: linear-gradient(135deg, var(--brand-primary-dark) 0%, var(--brand-accent) 100%);
  box-shadow: var(--brand-shadow);
  color: var(--brand-secondary);
}

.btn-outline-primary,
.btn-outline-success {
  border: 2px solid rgba(245, 180, 0, 0.4);
  color: var(--brand-secondary);
  background-color: rgba(255, 248, 225, 0.55);
}

.btn-outline-primary:hover,
.btn-outline-success:hover {
  border-color: rgba(245, 180, 0, 0.9);
  background-color: rgba(255, 203, 66, 0.2);
  color: var(--brand-secondary);
  box-shadow: var(--brand-shadow-soft);
}

.btn-outline-light {
  border: 2px solid rgba(255, 255, 255, 0.65);
  color: #fff;
}

.btn-outline-light:hover {
  background: #fff;
  color: var(--brand-secondary);
}

.btn-outline-secondary {
  border: 2px solid rgba(31, 28, 23, 0.25);
  color: var(--brand-secondary);
  background-color: rgba(31, 28, 23, 0.04);
}

.btn-outline-secondary:hover {
  border-color: rgba(31, 28, 23, 0.55);
  background-color: rgba(31, 28, 23, 0.1);
}

.brand-navbar {
  background: linear-gradient(120deg, rgba(31, 28, 23, 0.95), rgba(31, 28, 23, 0.88));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px -28px rgba(0, 0, 0, 0.45);
  padding: 0.85rem 0;
  backdrop-filter: blur(12px);
}

.brand-navbar .navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  min-width: 0;
  flex-shrink: 1;
  max-width: 100%;
  text-decoration: none;
}

.brand-navbar .navbar-brand .brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba(255, 203, 66, 0.2);
  border: 1px solid rgba(255, 203, 66, 0.35);
  color: var(--brand-primary);
  font-size: 1.35rem;
}

.brand-navbar .navbar-brand img {
  height: 44px;
  width: auto;
  object-fit: contain;
}

.brand-navbar .navbar-brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
  overflow: hidden;
}

.brand-navbar .navbar-brand-title {
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-navbar .navbar-brand-tagline {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.8rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-navbar .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.8) !important;
  font-weight: 600;
  margin: 0 0.35rem;
  padding: 0.45rem 0.9rem !important;
  border-radius: 999px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.brand-navbar .navbar-nav .nav-link.active,
.brand-navbar .navbar-nav .nav-link:hover,
.brand-navbar .navbar-nav .nav-link:focus {
  color: var(--brand-secondary) !important;
  background-color: rgba(255, 203, 66, 0.9);
}

.brand-navbar .dropdown-menu {
  border: none;
  border-radius: var(--brand-radius-md);
  box-shadow: 0 18px 48px -24px rgba(0, 0, 0, 0.35);
  padding: 0.35rem;
}

.brand-navbar .dropdown-item {
  border-radius: 12px;
  font-weight: 500;
  padding: 0.6rem 1.1rem;
  color: var(--brand-secondary);
}

.brand-navbar .dropdown-item:hover {
  background: rgba(255, 203, 66, 0.18);
  color: var(--brand-secondary);
}

.brand-navbar .navbar-toggler {
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 12px;
  color: #fff;
  padding: 0.4rem 0.55rem;
  transition: transform 0.2s ease;
}

.brand-navbar .navbar-toggler:focus {
  box-shadow: 0 0 0 0.25rem rgba(255, 203, 66, 0.25);
}

.brand-navbar .navbar-toggler:hover {
  transform: translateY(-1px);
}

.brand-navbar .navbar-toggler-icon {
  background-image: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.82) 0%,
    rgba(255, 255, 255, 0.82) 35%,
    rgba(0, 0, 0, 0) 35%,
    rgba(0, 0, 0, 0) 40%,
    rgba(255, 255, 255, 0.82) 40%,
    rgba(255, 255, 255, 0.82) 70%,
    rgba(0, 0, 0, 0) 70%,
    rgba(0, 0, 0, 0) 75%,
    rgba(255, 255, 255, 0.82) 75%,
    rgba(255, 255, 255, 0.82) 100%
  );
}
.nav-left-group {
  min-width: 0;
}

@media (min-width: 992px) {
  body:not(.sidebar-collapsed) .nav-left-group {
    margin-left: 260px;
  }
}


.nav-left-group .sidebar-toggle {
  flex-shrink: 0;
}

.sidebar-toggle {
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.sidebar-toggle .sidebar-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.sidebar-toggle .sidebar-toggle-icon-open {
  display: inline-flex;
}

.sidebar-toggle .sidebar-toggle-icon-close {
  display: none;
}

.sidebar-toggle.is-expanded .sidebar-toggle-icon-open {
  display: none;
}

.sidebar-toggle.is-expanded .sidebar-toggle-icon-close {
  display: inline-flex;
}


.sidebar-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 0.25rem rgba(255, 203, 66, 0.25);
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
  color: #fff;
}

@media (max-width: 991.98px) {
  .brand-navbar .navbar-text {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .brand-navbar {
    padding: 0.7rem 0;
  }

  .brand-navbar .navbar-brand {
    font-size: 1.2rem;
    gap: 0.65rem;
  }

  .brand-navbar .navbar-brand .brand-logo {
    width: 42px;
    height: 42px;
  }

  .sidebar-toggle {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 575.98px) {
  .nav-left-group {
    width: 100%;
  }

  .brand-navbar .navbar-brand {
    max-width: calc(100% - 72px);
  }

  .brand-navbar .navbar-brand-title {
    font-size: 1.05rem;
  }

  .brand-navbar .navbar-brand-tagline {
    display: none;
  }
}

.hero-section {
  position: relative;
  padding: 96px 0 110px;
  background: linear-gradient(135deg, rgba(31, 28, 23, 0.9), rgba(31, 28, 23, 0.8)),
              url('https://images.unsplash.com/photo-1523580846011-d3a5bc25702b?auto=format&fit=crop&w=1600&q=80') center/cover;
  color: #fff;
  overflow: hidden;
  border-bottom-left-radius: 32px;
  border-bottom-right-radius: 32px;
}

.hero-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 203, 66, 0.35), transparent 55%),
              radial-gradient(circle at bottom left, rgba(245, 180, 0, 0.45), transparent 50%);
  pointer-events: none;
}

.hero-section .container,
.hero-section .container-xl {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: 3.1rem;
  line-height: 1.15;
  margin-bottom: 1.2rem;
  text-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 2rem;
}

.hero-buttons .btn {
  margin-right: 0.85rem;
  margin-bottom: 0.75rem;
}

.hero-image img {
  border-radius: var(--brand-radius-lg);
  box-shadow: var(--brand-shadow);
}

.stats-section {
  padding: 64px 0 32px;
  margin-top: -70px;
}

.stat-box {
  background: var(--brand-surface);
  border-radius: var(--brand-radius-md);
  box-shadow: var(--brand-shadow-soft);
  padding: 2.1rem 1.8rem;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--brand-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-box::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 203, 66, 0.1), transparent 55%);
  pointer-events: none;
}

.stat-box:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 48px -32px rgba(0, 0, 0, 0.45);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 1.5rem;
  margin-bottom: 1.1rem;
  color: var(--brand-secondary);
  background: rgba(255, 203, 66, 0.3);
  border: 1px solid rgba(255, 203, 66, 0.35);
}

.stat-number {
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--brand-secondary);
  margin-bottom: 0.35rem;
}

.stat-label {
  color: var(--brand-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
}

.section-header {
  max-width: 760px;
  margin: 0 auto 3rem;
}

.section-title {
  font-size: 2.4rem;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 72px;
  height: 5px;
  border-radius: 999px;
  margin: 0.75rem auto 0;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
}

.section-subtitle {
  color: var(--brand-muted);
  font-size: 1.05rem;
}

.courses-section {
  padding: 72px 0;
}

.course-card {
  background: var(--brand-surface);
  border-radius: var(--brand-radius-lg);
  border: 1px solid var(--brand-border);
  box-shadow: var(--brand-shadow-soft);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.course-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--brand-shadow);
}

.course-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.course-card-body {
  padding: 2rem 1.85rem 1.5rem;
}

.course-category {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--brand-muted);
  margin-bottom: 0.85rem;
}

.course-title {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

.course-description {
  color: var(--brand-muted);
  min-height: 72px;
}

.course-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--brand-border);
  color: var(--brand-muted);
}

.course-card-footer {
  padding: 1.25rem 1.85rem 1.75rem;
}

.btn-course-detail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 100%;
  background: rgba(245, 180, 0, 0.16);
  color: var(--brand-secondary);
  border: 1px solid rgba(245, 180, 0, 0.35);
  font-weight: 600;
}

.btn-course-detail:hover {
  background: rgba(245, 180, 0, 0.26);
  border-color: rgba(245, 180, 0, 0.5);
}

.features-section {
  padding: 72px 0 110px;
  background: linear-gradient(180deg, rgba(255, 248, 225, 0.88) 0%, rgba(255, 236, 185, 0.72) 45%, rgba(255, 248, 225, 0.92) 100%);
  border-top: 1px solid rgba(31, 28, 23, 0.06);
}

.feature-box {
  background: var(--brand-surface);
  border-radius: var(--brand-radius-md);
  padding: 2rem 1.6rem;
  text-align: center;
  box-shadow: var(--brand-shadow-soft);
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Modern Flowchart Styles */
.flowchart-card {
  position: relative;
  overflow: hidden;
}

.flowchart-card::before {
  content: '';
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 60%;
  background: radial-gradient(circle at 20% 40%, rgba(255,203,66,0.18), transparent 60%),
              radial-gradient(circle at 80% 0%, rgba(245,180,0,0.12), transparent 55%);
  pointer-events: none;
}

.flowchart-card .mermaid {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .6s ease, transform .6s ease;
}

.flowchart-card .mermaid.in-view {
  opacity: 1;
  transform: none;
}

/* Subtle animated edges */
.flowchart-card .mermaid svg .edgePath path {
  stroke-dasharray: 6 6;
  animation: flow-edge-dash 18s linear infinite;
  stroke-opacity: 0.7;
}

/* First-render draw-in effect (overrides dash loop) */
.flowchart-card .mermaid svg .edgePath path.edge-draw-in {
  animation: flow-edge-draw 0.9s ease-out forwards !important;
}
@keyframes flow-edge-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes flow-edge-dash {
  to { stroke-dashoffset: -1000; }
}

/* Node polish and hover */
.flowchart-card .mermaid svg .node rect,
.flowchart-card .mermaid svg .node path {
  filter: drop-shadow(0 8px 18px rgba(31,28,23,0.08));
  transition: filter .2s ease, transform .2s ease;
}

.flowchart-card .mermaid svg .node.is-clickable { cursor: pointer; }

.flowchart-card .mermaid svg .node:hover rect,
.flowchart-card .mermaid svg .node:hover path {
  filter: drop-shadow(0 14px 26px rgba(31,28,23,0.18));
  transform: translateY(-2px) scale(1.01);
}

/* Node entrance animation (staggered) */
.flowchart-card .mermaid svg .node.anim-in rect,
.flowchart-card .mermaid svg .node.anim-in path {
  opacity: 0;
  animation: flow-node-in .55s cubic-bezier(.22,.7,.26,1) both;
}
@keyframes flow-node-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* Highlight pulse when matched by search */
.flowchart-card .mermaid svg .node.is-highlighted rect,
.flowchart-card .mermaid svg .node.is-highlighted path {
  animation: flow-highlight-pulse 1.1s ease-out 1;
}
@keyframes flow-highlight-pulse {
  0% { stroke-width: 2px; filter: drop-shadow(0 8px 18px rgba(31,28,23,0.10)); }
  50% { stroke-width: 5px; filter: drop-shadow(0 14px 28px rgba(31,28,23,0.22)); }
  100% { stroke-width: 3px; filter: drop-shadow(0 10px 20px rgba(31,28,23,0.12)); }
}

/* Responsive overflow */
.flowchart-card .card-body {
  overflow-x: auto;
}

/* Toolbar for diagrams */
.flowchart-card .flow-toolbar {
  position: absolute;
  top: 10px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  z-index: 3;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(6px);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--brand-border);
  box-shadow: var(--brand-shadow-soft);
}

.flowchart-card .flow-toolbar .btn {
  padding: 0.25rem 0.55rem;
  border-radius: 10px;
}

.flowchart-card .flow-toolbar .form-control {
  height: 30px;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
}

.flowchart-card .flow-toolbar .btn.active {
  background-color: rgba(245, 180, 0, 0.18);
  border-color: rgba(245, 180, 0, 0.6);
}

.flowchart-card .flow-svg-wrap svg {
  max-width: none; /* allow scaling */
}

/* Node/edge highlight system */
.flowchart-card .mermaid svg .node.is-highlighted rect,
.flowchart-card .mermaid svg .node.is-highlighted path {
  stroke: var(--brand-primary);
  stroke-width: 3px;
}
.flowchart-card .mermaid svg .edgePath.is-highlighted path {
  stroke: var(--brand-primary);
  stroke-opacity: 1;
}
.flowchart-card .mermaid svg .node.is-dimmed rect,
.flowchart-card .mermaid svg .node.is-dimmed path,
.flowchart-card .mermaid svg .edgePath.is-dimmed path {
  opacity: 0.35;
}

/* Popover for rich tooltips */
.flow-popover {
  position: fixed;
  z-index: 9999;
  max-width: 260px;
  background: #fff;
  color: var(--brand-secondary);
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--brand-shadow-soft);
  pointer-events: none;
  font-size: 0.9rem;
}
.flow-popover .flow-popover-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.flow-popover .flow-popover-text {
  color: var(--brand-muted);
}

/* Legend */
.flow-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}
.flow-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.flow-legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--brand-border-strong);
}
.flow-legend-swatch.access { background: #FFF7DC; }
.flow-legend-swatch.struct { background: #FFFBEE; }
.flow-legend-swatch.content { background: #FFF8E1; }
.flow-legend-swatch.assess { background: #FFF2C6; }
.flow-legend-swatch.track { background: #FFF7DC; }
.flow-legend-swatch.ops { background: #FFF2C6; }

.feature-box:hover {
  transform: translateY(-8px);
  box-shadow: var(--brand-shadow);
  border-color: rgba(245, 180, 0, 0.35);
}

.feature-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 1.5rem;
  margin-bottom: 1.1rem;
  color: var(--brand-secondary);
  background: rgba(255, 203, 66, 0.3);
  border: 1px solid rgba(255, 203, 66, 0.4);
}

.feature-title {
  margin-bottom: 0.5rem;
}

.feature-text {
  color: var(--brand-muted);
}

.card {
  border-radius: var(--brand-radius-md);
  border: 1px solid var(--brand-border);
  box-shadow: var(--brand-shadow-soft);
  background: var(--brand-surface);
}

.card-header {
  border-bottom: 1px solid rgba(31, 28, 23, 0.08);
  background: rgba(255, 248, 225, 0.68);
  color: var(--brand-secondary);
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

.card-header.card-header-accent {
  background: linear-gradient(135deg, rgba(245, 180, 0, 0.95), rgba(255, 203, 66, 0.82));
  color: var(--brand-secondary);
}

.card-body {
  color: var(--brand-secondary);
}

.list-group-item {
  border: none;
  border-bottom: 1px solid rgba(31, 28, 23, 0.06);
  padding: 1.1rem 0.2rem;
}

.list-group-item:last-child {
  border-bottom: none;
}

.alert {
  border-radius: 18px;
  border: none;
  padding: 1.1rem 1.4rem;
  box-shadow: 0 12px 32px -24px rgba(31, 28, 23, 0.45);
}

.alert-info {
  background: rgba(79, 166, 255, 0.16);
  color: rgba(31, 58, 104, 0.95);
}

.alert-warning {
  background: rgba(255, 203, 66, 0.25);
  color: var(--brand-secondary);
}

.alert-success {
  background: rgba(245, 180, 0, 0.18);
  color: var(--brand-secondary);
}

.table {
  border-radius: var(--brand-radius-sm);
  overflow: hidden;
  background: var(--brand-surface);
}

.table thead {
  background: rgba(255, 203, 66, 0.25);
}

.table thead th {
  border-bottom: none;
  color: var(--brand-secondary);
}

.table tbody tr {
  transition: background-color 0.2s ease;
}

.table tbody tr:hover {
  background-color: rgba(255, 203, 66, 0.16);
}

.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: rgba(31, 28, 23, 0.025);
}

.badge {
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.45rem 0.9rem;
}

.badge.bg-success,
.badge.bg-primary {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: var(--brand-secondary);
}

.badge.bg-secondary {
  background: rgba(31, 28, 23, 0.1);
  color: var(--brand-secondary);
}

.breadcrumb {
  background-color: rgba(255, 248, 225, 0.9);
  border-radius: 14px;
  padding: 0.75rem 1.2rem;
  border: 1px solid rgba(245, 180, 0, 0.25);
}

.breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  color: rgba(31, 28, 23, 0.4);
}

.form-control {
  border-radius: 12px;
  border: 1px solid rgba(31, 28, 23, 0.16);
  padding: 0.75rem 1rem;
}

.form-control:focus {
  border-color: rgba(245, 180, 0, 0.85);
  box-shadow: 0 0 0 0.25rem rgba(245, 180, 0, 0.25);
}

.dropdown-menu {
  border-radius: var(--brand-radius-md);
  border: 1px solid rgba(31, 28, 23, 0.06);
  box-shadow: 0 28px 56px -34px rgba(0, 0, 0, 0.45);
}

.dropdown-item:focus,
.dropdown-item:hover {
  background: rgba(255, 203, 66, 0.18);
  color: var(--brand-secondary);
}

.brand-footer {
  position: relative;
  background: linear-gradient(160deg, rgba(31, 28, 23, 0.96), rgba(31, 28, 23, 0.92));
  padding: 72px 0 32px;
  color: rgba(255, 255, 255, 0.88);
  border-top-left-radius: 32px;
  border-top-right-radius: 32px;
  margin-top: 96px;
}

.brand-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 203, 66, 0.18), transparent 45%),
              radial-gradient(circle at bottom left, rgba(245, 180, 0, 0.22), transparent 50%);
  pointer-events: none;
}

.brand-footer .container,
.brand-footer .container-xl {
  position: relative;
  z-index: 2;
}

.brand-footer h5,
.brand-footer h6 {
  color: #fff;
  font-weight: 700;
}

.brand-footer a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.brand-footer a:hover {
  color: var(--brand-primary);
  transform: translateX(4px);
}

.brand-footer .footer-divider {
  height: 1px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  margin: 2.5rem 0;
}

.brand-footer .social-links a {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  justify-content: center;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.08);
  margin-right: 0.6rem;
}

.brand-footer .social-links a:hover {
  background: rgba(255, 203, 66, 0.25);
}

.brand-footer-bottom {
  text-align: center;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
}

.stat-card {
  border: 1px solid rgba(245, 180, 0, 0.25);
  border-left: 4px solid var(--brand-primary);
  border-radius: var(--brand-radius-md);
  box-shadow: var(--brand-shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--brand-shadow);
}

.stat-card .stat-icon,
.stat-card .portal-stat-icon {
  background: rgba(255, 203, 66, 0.24);
  border: 1px solid rgba(255, 203, 66, 0.35);
  color: var(--brand-secondary);
}

.portal-dashboard .card h5,
.portal-dashboard .card h6 {
  font-weight: 600;
}

.portal-dashboard .quick-actions .btn {
  border-radius: 16px;
}

.modal-content {
  border-radius: var(--brand-radius-md);
  border: 1px solid rgba(31, 28, 23, 0.12);
}

.modal-header {
  border-bottom: 1px solid rgba(31, 28, 23, 0.08);
}

.modal-body pre {
  background: rgba(255, 248, 225, 0.55);
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid rgba(245, 180, 0, 0.2);
}

.navbar-nav .btn {
  padding: 0.5rem 1.15rem;
  border-radius: 999px;
}

.navbar-nav .btn + .btn {
  margin-left: 0.5rem;
}

footer .list-unstyled li {
  margin-bottom: 0.55rem;
}

footer .list-unstyled i {
  margin-right: 0.35rem;
}

.badge.bg-warning,
.btn-warning {
  background: rgba(255, 203, 66, 0.3);
  border: 1px solid rgba(255, 203, 66, 0.35);
  color: var(--brand-secondary);
}

@media (max-width: 1199.98px) {
  .hero-title {
    font-size: 2.65rem;
  }
}

@media (max-width: 991.98px) {
  .brand-navbar .navbar-nav .nav-link {
    margin: 0.2rem 0;
    padding: 0.65rem 0.85rem !important;
  }

  .brand-navbar .navbar-collapse {
    background: rgba(31, 28, 23, 0.92);
    border-radius: 20px;
    padding: 1.25rem;
    margin-top: 0.75rem;
    box-shadow: 0 18px 42px -26px rgba(0, 0, 0, 0.65);
  }

  .hero-section {
    text-align: center;
  }

  .hero-buttons .btn {
    width: 100%;
    margin-right: 0;
  }

  .stats-section {
    margin-top: -40px;
    padding-bottom: 16px;
  }
}

@media (max-width: 767.98px) {
  .hero-title {
    font-size: 2.35rem;
  }

  .stat-box,
  .course-card,
  .feature-box {
    padding: 1.6rem 1.4rem;
  }

  .brand-footer {
    padding: 56px 0 28px;
  }

  .course-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}

@media (max-width: 575.98px) {
  .hero-section {
    padding: 72px 0 90px;
  }

  .hero-title {
    font-size: 2.05rem;
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }
}

html {
  scroll-behavior: smooth;
}
.brand-navbar .navbar-brand .brand-logo-image {
  padding: 6px;
}

.brand-navbar .navbar-brand .brand-logo-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}
.brand-divider {
  width: 120px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  margin: 0 auto 1.5rem;
}

.pre-line {
  white-space: pre-line;
  line-height: 1.8;
}
.card-header-warning {
  background: rgba(255, 203, 66, 0.35);
  color: var(--brand-secondary);
}
.btn-outline-danger {
  border: 2px solid rgba(220, 53, 69, 0.35);
  color: #b83d3d;
  background-color: rgba(220, 53, 69, 0.08);
}

.btn-outline-danger:hover {
  border-color: rgba(220, 53, 69, 0.55);
  background-color: rgba(220, 53, 69, 0.18);
  color: #9b2f2f;
}
/* Dashboard Shell & Sidebar (Exam System core) */
.dashboard-shell {
  display: flex;
  min-height: 100vh;
  background: var(--brand-surface);
}

.dashboard-main {
  flex: 1 1 auto;
  width: 100%;
  padding: 2rem 2.5rem;
  margin-left: 0;
  transition: margin-left 0.3s ease;
}

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 260px;
  padding: 5.5rem 0 2rem;
  background: var(--brand-surface);
  border-right: 1px solid var(--brand-border);
  box-shadow: inset -1px 0 0 rgba(31, 28, 23, 0.04);
  transform: translateX(-100%);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 1040;
}

.sidebar .nav-link {
  font-weight: 600;
  color: var(--brand-secondary);
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  margin: 0.125rem 0.5rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar .nav-link:hover {
  color: var(--brand-primary);
  background-color: rgba(245, 180, 0, 0.16);
}

.sidebar .nav-link.active {
  color: var(--brand-primary);
  background-color: rgba(245, 180, 0, 0.16);
}

.sidebar .nav-link i {
  margin-right: 0.5rem;
  width: 16px;
}

.layout-sidebar {
  flex: 0 0 260px;
  width: 260px;
  display: flex;
  flex-direction: column;
  transition: flex-basis 0.3s ease, width 0.3s ease;
}

.layout-sidebar .position-sticky {
  height: 100%;
  overflow-y: auto;
  padding: 0 1rem 2.5rem;
}

.sidebar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 1.25rem;
  padding: 0 0.25rem;
}

.sidebar-toolbar-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--brand-muted);
}

.sidebar-toggle-inline {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(245, 180, 0, 0.35);
  background: rgba(255, 248, 225, 0.55);
  color: var(--brand-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-toggle-inline:hover,
.sidebar-toggle-inline:focus {
  background: rgba(245, 180, 0, 0.18);
  box-shadow: 0 12px 24px -18px rgba(31, 28, 23, 0.6);
  color: var(--brand-secondary);
}

.sidebar-toggle-inline .sidebar-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 1rem;
  line-height: 1;
}

.sidebar-toggle-icon-open {
  display: none;
}

body.sidebar-collapsed .sidebar-toggle-icon-close {
  display: none;
}

body.sidebar-collapsed .sidebar-toggle-icon-open {
  display: inline-flex;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1030;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

body.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.sidebar-open .sidebar {
  transform: translateX(0);
  box-shadow: 0 24px 48px -28px rgba(31, 28, 23, 0.45);
}

@media (min-width: 992px) {
  .sidebar {
    transform: none;
  }

  .dashboard-main {
    margin-left: 260px;
  }

  body.sidebar-collapsed .layout-sidebar {
    flex: 0 0 0;
    width: 0;
  }

  body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
    pointer-events: none;
    box-shadow: none;
  }

  body.sidebar-collapsed .dashboard-main {
    margin-left: 0;
  }

  .sidebar-backdrop {
    display: none;
  }
}

@media (max-width: 991.98px) {
  .sidebar {
    padding-top: 4.5rem;
  }

  .dashboard-main {
    margin-left: 0;
    padding: 1.75rem 1.5rem 2.5rem;
  }
}

/* Landing layout & branding */
.landing-topbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(31, 28, 23, 0.08);
  padding: 0.9rem 0;
  position: sticky;
  top: 0;
  z-index: 1040;
  transition: box-shadow 0.2s ease;
}

.landing-brand {
  color: var(--brand-secondary);
  transition: transform 0.2s ease;
}

.landing-brand:hover {
  color: var(--brand-secondary);
  transform: translateY(-1px);
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 203, 66, 0.18);
  border: 1px solid rgba(255, 203, 66, 0.32);
  color: var(--brand-primary);
  font-size: 1.5rem;
}

.brand-logo {
  max-width: 48px;
  max-height: 48px;
  object-fit: contain;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.brand-tagline {
  color: rgba(31, 28, 23, 0.62);
  font-size: 0.82rem;
  font-weight: 500;
}

.landing-hero {
  position: relative;
  padding: 120px 0 110px;
  border-bottom-left-radius: 48px;
  border-bottom-right-radius: 48px;
  background: linear-gradient(135deg, rgba(31, 28, 23, 0.92), rgba(31, 28, 23, 0.86));
  color: #fff;
  overflow: hidden;
}

.landing-hero.has-banner {
  background-size: cover;
  background-position: center;
}

.landing-hero.has-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 203, 66, 0.26), transparent 55%),
              var(--brand-hero-overlay);
  opacity: 0.92;
}

.landing-hero > .container {
  position: relative;
  z-index: 2;
}

.highlight-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 203, 66, 0.18);
  border: 1px solid rgba(255, 203, 66, 0.4);
  color: #fff;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.text-gradient {
  background: linear-gradient(135deg, #fff, rgba(255, 203, 66, 0.92));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lede {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.78);
}

.hero-actions .btn {
  border-radius: 14px;
  font-weight: 600;
  padding: 0.7rem 1.6rem;
}

.btn-brand-primary {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  border: none;
  color: var(--brand-secondary);
  box-shadow: var(--brand-shadow-soft);
}

.btn-brand-primary:hover {
  background: linear-gradient(135deg, var(--brand-primary-dark), var(--brand-accent));
  box-shadow: var(--brand-shadow);
  color: var(--brand-secondary);
}

.btn-brand-outline {
  border: 2px solid rgba(245, 180, 0, 0.45);
  color: var(--brand-secondary);
  background: rgba(255, 248, 225, 0.55);
}

.btn-brand-outline:hover {
  background: rgba(255, 203, 66, 0.2);
  border-color: rgba(245, 180, 0, 0.8);
  box-shadow: var(--brand-shadow-soft);
}

.btn-brand-outline-light {
  border: 2px solid rgba(255, 255, 255, 0.65);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-brand-outline-light:hover {
  background: #fff;
  color: var(--brand-secondary);
}

.btn-brand-contrast {
  background: #fff;
  color: var(--brand-secondary);
  border: none;
  box-shadow: var(--brand-shadow);
}

.btn-brand-contrast:hover {
  transform: translateY(-2px);
  color: var(--brand-secondary);
}

.hero-pills {
  gap: 0.6rem;
}

.hero-card {
  border-radius: var(--brand-radius-lg);
  overflow: hidden;
}

.glass-card {
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
}

.hero-feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.hero-feature-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.hero-stats {
  margin-top: 1rem;
}

.stat-block {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--brand-radius-md);
  padding: 1rem 1.2rem;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.stat-value {
  display: block;
  font-size: 1.85rem;
  font-weight: 700;
}

.stat-label {
  display: block;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.72);
}

.hero-contact a {
  color: #fff;
  font-weight: 500;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-muted);
}

.text-brand {
  color: var(--brand-primary) !important;
}

.feature-card {
  background: var(--brand-surface);
  border-radius: var(--brand-radius-md);
  padding: 2rem 1.7rem;
  border: 1px solid var(--brand-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--brand-shadow);
  border-color: rgba(245, 180, 0, 0.45);
}

.process-row {
  counter-reset: process;
}

.process-step {
  background: var(--brand-surface);
  border-radius: var(--brand-radius-md);
  padding: 1.8rem 1.6rem;
  min-height: 100%;
  box-shadow: var(--brand-shadow-soft);
  border: 1px solid var(--brand-border);
}

.step-index {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: rgba(255, 203, 66, 0.2);
  color: var(--brand-secondary);
  margin-bottom: 1rem;
}

.spotlight-section {
  background: linear-gradient(135deg, rgba(255, 248, 225, 0.95), rgba(255, 236, 185, 0.65));
  border-radius: var(--brand-radius-lg);
  margin: 0 1.25rem;
}

.cta-card {
  border-radius: var(--brand-radius-lg);
  border: 1px solid rgba(255, 203, 66, 0.25);
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  color: var(--brand-muted);
}

.insight-card {
  background: var(--brand-surface);
  border-radius: var(--brand-radius-lg);
  padding: 2.25rem;
  border: 1px solid var(--brand-border);
  box-shadow: var(--brand-shadow-soft);
}

.insight-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.badge-soft-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 203, 66, 0.2);
  color: var(--brand-secondary);
  font-weight: 600;
  font-size: 0.8rem;
}

.insight-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.metric-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--brand-secondary);
}

.metric-label {
  display: block;
  font-size: 0.9rem;
  color: var(--brand-muted);
}

.testimonial {
  position: relative;
  background: rgba(255, 248, 225, 0.75);
  border-radius: var(--brand-radius-md);
  padding: 1.5rem 1.75rem;
  color: var(--brand-secondary);
  border: 1px solid rgba(255, 203, 66, 0.35);
}

.cta-section {
  background: linear-gradient(135deg, rgba(31, 28, 23, 0.95), rgba(31, 28, 23, 0.85));
  border-radius: var(--brand-radius-lg);
  margin: 0 1.25rem 72px;
}

.landing-footer {
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid rgba(31, 28, 23, 0.06);
}

.footer-links a {
  color: var(--brand-muted);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--brand-secondary);
}

/* Auth shell */
.auth-shell {
  width: 100%;
  max-width: 1040px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 32px;
  box-shadow: 0 40px 90px -45px rgba(31, 28, 23, 0.45);
  overflow: hidden;
  position: relative;
}

.auth-shell[data-has-banner="true"] {
  background: linear-gradient(135deg, rgba(31, 28, 23, 0.8), rgba(31, 28, 23, 0.92)), var(--auth-banner);
  background-size: cover;
  background-position: center;
  color: #fff;
}

.auth-shell[data-has-banner="true"] .auth-intro,
.auth-shell[data-has-banner="true"] .auth-card {
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand-secondary);
}

.auth-content {
  padding: 2.75rem;
}

.auth-intro {
  color: var(--brand-secondary);
}

.auth-intro .brand-mark {
  background: rgba(255, 203, 66, 0.25);
}

.auth-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 203, 66, 0.2);
  border: 1px solid rgba(255, 203, 66, 0.3);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--brand-secondary);
}

.auth-card-wrapper {
  max-width: 460px;
  margin-left: auto;
}

.auth-card {
  border-radius: var(--brand-radius-lg);
  border: 1px solid var(--brand-border);
  box-shadow: var(--brand-shadow-soft);
}

.auth-meta {
  color: var(--brand-muted);
}

.auth-shell .form-control {
  border-radius: 12px;
  padding: 0.75rem 1rem;
}

.auth-shell .input-group-text {
  border-radius: 12px 0 0 12px;
  border: 1px solid var(--brand-border);
  background: rgba(255, 248, 225, 0.75);
  color: var(--brand-secondary);
}

@media (max-width: 991.98px) {
  .landing-topbar {
    position: relative;
  }

  .landing-hero {
    padding: 96px 0 90px;
  }

  .auth-content {
    padding: 2rem;
  }

  .auth-card-wrapper {
    margin: 0;
  }
}

@media (max-width: 767.98px) {
  body.brand-auth-body {
    padding: 2.2rem 1rem;
  }

  .auth-shell {
    border-radius: 24px;
  }

  .landing-hero {
    border-radius: 0;
    margin: 0 -1rem;
  }

  .insight-metrics {
    grid-template-columns: 1fr;
  }
}

/* Ensure modals are usable without zoom: cap height and scroll body */
.modal .modal-content {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2rem);
}
.modal .modal-header,
.modal .modal-footer {
  flex: 0 0 auto;
}
.modal .modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--brand-surface, #fff);
}
.modal .modal-body {
  flex: 1 1 auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-dialog-scrollable .modal-body {
  overflow-y: auto;
}
@media (max-height: 700px) {
  .modal .modal-dialog {
    margin: 0.75rem;
  }
  .modal .modal-content {
    max-height: calc(100vh - 1.5rem);
  }
  .modal .modal-header,
  .modal .modal-footer {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
}

/* Modern search panel styling */
.teacher-search-panel,
#course-search-panel,
#teacher-material-search-panel,
#teacher-question-search-panel,
#teacher-result-search-panel {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  box-shadow: var(--brand-shadow-soft);
}

.teacher-search-input-group,
#course-search-panel .input-group,
#teacher-material-search-panel .input-group,
#teacher-question-search-panel .input-group,
#teacher-result-search-panel .input-group {
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  background: rgba(255, 248, 225, 0.5);
  overflow: hidden;
}

.teacher-search-input-group .form-control,
#course-search-panel .input-group .form-control,
#teacher-material-search-panel .input-group .form-control,
#teacher-question-search-panel .input-group .form-control,
#teacher-result-search-panel .input-group .form-control {
  border: none;
  background: transparent;
  padding-left: 0.25rem;
}

.teacher-search-input-group .input-group-text,
#course-search-panel .input-group .input-group-text,
#teacher-material-search-panel .input-group .input-group-text,
#teacher-question-search-panel .input-group .input-group-text,
#teacher-result-search-panel .input-group .input-group-text {
  background: transparent;
  border: none;
  color: var(--brand-muted);
}

.teacher-search-input-group .btn,
#course-search-panel .input-group .btn,
#teacher-material-search-panel .input-group .btn,
#teacher-question-search-panel .input-group .btn,
#teacher-result-search-panel .input-group .btn {
  border: none;
  background: transparent;
  color: var(--brand-secondary);
}

.teacher-search-panel:focus-within,
#course-search-panel:focus-within,
#teacher-material-search-panel:focus-within,
#teacher-question-search-panel:focus-within,
#teacher-result-search-panel:focus-within {
  box-shadow: 0 0 0 3px rgba(245, 180, 0, 0.18);
}

.teacher-search-results,
#course-search-results,
#teacher-material-search-results,
#teacher-question-search-results,
#teacher-result-search-results {
  display: none;
}

/* Remove suggestions from all filters/searches */
[id$="search-results"],
.teacher-search-results,
.course-search-results,
.user-search-results {
  display: none !important;
}

/* Modernize list filter bars in card headers */
.card-header .form-select.form-select-sm {
  border-radius: 999px;
  border: 1px solid var(--brand-border);
  background: rgba(255, 248, 225, 0.5);
}
.card-header .btn.btn-sm.btn-outline-secondary {
  border-radius: 999px;
}

/* Force visible scroll area on key create modals */
#teacher-assignment-modal .modal-content,
#teacher-quiz-modal .modal-content,
#admin-assignment-modal .modal-content,
#admin-quiz-modal .modal-content {
  max-height: 85vh;
}
#teacher-assignment-modal .modal-body,
#teacher-quiz-modal .modal-body,
#admin-assignment-modal .modal-body,
#admin-quiz-modal .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

/* Compact theme: smaller, denser UI for better information density */
/* Applied via body.theme-compact (set in header.ejs); also tune auth pages */
body.theme-compact,
body.brand-auth-body.theme-compact {
  font-size: 0.94rem; /* ~6% smaller */
}

/* Headings slightly reduced */
body.theme-compact h1 { font-size: 1.75rem; }
body.theme-compact h2 { font-size: 1.45rem; }
body.theme-compact h3 { font-size: 1.25rem; }
body.theme-compact h4 { font-size: 1.1rem; }
body.theme-compact h5 { font-size: 1rem; }
body.theme-compact h6 { font-size: 0.95rem; }

/* Labels and help text */
.form-label-sm { font-size: 0.85rem; letter-spacing: 0.01em; }
body.theme-compact .form-text { font-size: 0.82rem; }

/* Controls */
body.theme-compact .form-control,
body.theme-compact .form-select,
body.theme-compact .input-group-text {
  padding: 0.4rem 0.6rem;
  font-size: 0.94rem;
  border-radius: 10px;
}

/* Buttons */
body.theme-compact .btn {
  padding: 0.45rem 0.9rem;
  font-size: 0.94rem;
  border-radius: 12px;
}
body.theme-compact .btn-sm { padding: 0.3rem 0.6rem; font-size: 0.86rem; }
/* Extra-small button utility (optional) */
.btn-xs { padding: 0.15rem 0.4rem; font-size: 0.78rem; border-radius: 10px; }

/* Tables */
body.theme-compact table,
body.theme-compact .table { font-size: 0.94rem; }
body.theme-compact .table td,
body.theme-compact .table th { padding: 0.45rem 0.6rem; }

/* Navbar branding and nav links slightly smaller */
body.theme-compact .brand-navbar .navbar-brand { font-size: 1.1rem; }
body.theme-compact .brand-navbar .navbar-brand .brand-logo { width: 40px; height: 40px; font-size: 1.1rem; }
body.theme-compact .brand-navbar .navbar-brand img { height: 38px; }
body.theme-compact .brand-navbar .navbar-nav .nav-link { padding: 0.35rem 0.75rem !important; font-size: 0.94rem; }

/* Cards and search panels tighter */
body.theme-compact .card-header { padding: 0.6rem 0.9rem; }
body.theme-compact .card-body { padding: 0.9rem; }
body.theme-compact .teacher-search-panel { padding: 0.7rem 0.85rem; }
body.theme-compact .teacher-search-input-group .form-control { padding-left: 0.2rem; }

/* Badges and chips */
body.theme-compact .badge { font-size: 0.78rem; padding: 0.3em 0.5em; }

/* Auth pages slightly smaller as well */
body.brand-auth-body { font-size: 0.95rem; }

/* Admin Courses page: extra compact to fit wider tables */
body.theme-compact .page-admin-courses .h2,
body.theme-compact .page-admin-courses h1.h2 { font-size: 1.35rem; }
body.theme-compact .page-admin-courses .card-header { padding: 0.5rem 0.75rem; }
body.theme-compact .page-admin-courses .card-body { padding: 0.75rem; }
body.theme-compact .page-admin-courses .table { font-size: 0.88rem; }
body.theme-compact .page-admin-courses .table td,
body.theme-compact .page-admin-courses .table th { padding: 0.35rem 0.5rem; }
body.theme-compact .page-admin-courses .btn { padding: 0.3rem 0.55rem; font-size: 0.85rem; }
body.theme-compact .page-admin-courses .btn-group .btn { padding: 0.25rem 0.5rem; }
body.theme-compact .page-admin-courses .course-name-cell .btn { padding: 0.2rem 0.45rem; font-size: 0.8rem; }
body.theme-compact .page-admin-courses .course-description { font-size: 0.82rem; color: #6c757d; margin-top: 0.25rem; }
/* Clamp description to a single line to save vertical space */
body.theme-compact .page-admin-courses .course-description {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
