:root {
  color-scheme: light;

  --palette-prussian: #0a2239;
  --palette-prussian-rgb: 10, 34, 57;
  --palette-pacific: #53a2be;
  --palette-pacific-rgb: 83, 162, 190;
  --palette-ocean: #1d84b5;
  --palette-ocean-rgb: 29, 132, 181;
  --palette-aqua: #a8d5c2;
  --palette-aqua-rgb: 168, 213, 194;
  --palette-ghost: #ecebf3;
  --palette-ghost-rgb: 236, 235, 243;
  --palette-gold: #d9a441;
  --palette-gold-rgb: 217, 164, 65;

  --color-ink: #0a2239;
  --color-muted: #597083;
  --color-canvas: #f5f8fb;
  --color-canvas-rgb: 245, 248, 251;
  --color-panel: rgba(255, 255, 255, 0.78);
  --color-panel-strong: rgba(255, 255, 255, 0.94);
  --color-panel-subtle: rgba(236, 235, 243, 0.7);
  --color-line: rgba(var(--palette-prussian-rgb), 0.12);
  --color-line-strong: rgba(var(--palette-prussian-rgb), 0.2);
  --color-brand: var(--palette-ocean);
  --color-brand-dark: #156b94;
  --color-brand-soft: rgba(var(--palette-pacific-rgb), 0.18);
  --color-info: var(--palette-pacific);
  --color-success: #23875a;
  --color-warning: #b7791f;
  --color-danger: #c2414b;
  --color-soft-blue: rgba(var(--palette-pacific-rgb), 0.14);
  --color-soft-cyan: rgba(var(--palette-aqua-rgb), 0.32);
  --glass-bg: rgba(255, 255, 255, 0.68);
  --glass-bg-strong: rgba(255, 255, 255, 0.84);
  --glass-border: rgba(255, 255, 255, 0.72);
  --glass-highlight: rgba(255, 255, 255, 0.95);
  --sidebar-bg: linear-gradient(180deg, rgba(10, 34, 57, 0.98), rgba(10, 34, 57, 0.92));
  --sidebar-link: rgba(255, 255, 255, 0.76);
  --sidebar-link-hover: rgba(var(--palette-pacific-rgb), 0.2);
  --sidebar-link-active: linear-gradient(135deg, rgba(var(--palette-ocean-rgb), 0.34), rgba(var(--palette-aqua-rgb), 0.18));
  --app-radius: 8px;
  --app-radius-sm: 6px;
  --app-radius-lg: 12px;
  --app-shadow: 0 18px 48px rgba(var(--palette-prussian-rgb), 0.13);
  --app-shadow-soft: 0 10px 28px rgba(var(--palette-prussian-rgb), 0.08);
  --app-backdrop-blur: blur(22px) saturate(145%);
  --surface-raised: var(--color-panel-strong);
  --shadow-soft: var(--app-shadow-soft);
  --text-main: var(--color-ink);
  --text-muted: var(--color-muted);
  --premium-teal-dark: #147875;

  --bs-primary: var(--color-brand);
  --bs-primary-rgb: var(--palette-ocean-rgb);
  --bs-secondary: var(--color-muted);
  --bs-secondary-rgb: 89, 112, 131;
  --bs-font-sans-serif: "Inter", sans-serif;
  --bs-body-color: var(--color-ink);
  --bs-body-bg: var(--color-canvas);
  --bs-link-color: var(--color-brand);
  --bs-link-hover-color: var(--color-brand-dark);
  --bs-border-color: var(--color-line);
}

.temporal-picker-field {
  position: relative;
  width: 100%;
}

.temporal-picker-input {
  cursor: pointer;
  padding-right: 3rem !important;
  text-overflow: ellipsis;
}

.temporal-picker-input::placeholder {
  color: var(--color-muted);
  opacity: 0.85;
}

.temporal-picker-field__button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0.55rem;
  color: var(--color-brand);
  display: inline-flex;
  font-size: 1.05rem;
  height: 2.25rem;
  justify-content: center;
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
}

.temporal-picker-field__button:hover,
.temporal-picker-field__button:focus-visible {
  background: var(--color-brand-soft);
}

.temporal-picker {
  background: var(--color-panel-strong);
  border: 1px solid var(--color-line-strong);
  border-radius: 0.8rem;
  box-shadow: 0 1.25rem 3rem rgba(var(--palette-prussian-rgb), 0.28);
  display: grid;
  grid-template-columns: minmax(17rem, 1fr) minmax(12rem, auto);
  max-height: calc(100vh - 1rem);
  max-width: calc(100vw - 1rem);
  overflow: auto;
  position: fixed;
  width: max-content;
  z-index: 1300;
}

.temporal-picker[hidden],
.temporal-picker [hidden] {
  display: none !important;
}

.temporal-picker--date,
.temporal-picker--time {
  grid-template-columns: minmax(17rem, auto);
}

.temporal-picker--time {
  min-width: min(25rem, calc(100vw - 1rem));
}

.temporal-picker__calendar {
  border-right: 1px solid var(--color-line-strong);
  padding: 0.8rem;
}

.temporal-picker__header {
  align-items: center;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: auto 1fr auto;
  margin-bottom: 0.65rem;
  text-align: center;
}

.temporal-picker__nav {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0.5rem;
  color: var(--color-ink);
  display: inline-flex;
  height: 2.25rem;
  justify-content: center;
  width: 2.25rem;
}

.temporal-picker__nav:hover,
.temporal-picker__nav:focus-visible {
  background: var(--color-brand-soft);
}

.temporal-picker__weekdays,
.temporal-picker__days {
  display: grid;
  grid-template-columns: repeat(7, 2.25rem);
  justify-content: center;
}

.temporal-picker__weekdays span {
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0;
  text-align: center;
}

.temporal-picker__day {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  color: var(--color-ink);
  height: 2.25rem;
  padding: 0;
  width: 2.25rem;
}

.temporal-picker__day:hover,
.temporal-picker__day:focus-visible {
  background: var(--color-brand-soft);
}

.temporal-picker__day.is-outside {
  color: var(--color-muted);
  opacity: 0.55;
}

.temporal-picker__day.is-today {
  border-color: var(--color-brand);
}

.temporal-picker__day.is-selected {
  background: var(--color-brand);
  color: #fff;
  font-weight: 800;
}

.temporal-picker__time {
  align-content: start;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(4rem, 1fr));
  padding: 1rem 0.8rem;
}

.temporal-picker__time-field {
  min-width: 0;
  position: relative;
}

.temporal-picker__time-field > span {
  color: var(--color-muted);
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}

.temporal-picker__select {
  align-items: center;
  background: var(--color-canvas);
  border: 1px solid var(--color-line-strong);
  border-radius: 0.75rem;
  color: var(--color-ink);
  display: flex;
  font-size: 1rem;
  justify-content: space-between;
  min-height: 2.75rem;
  padding: 0.5rem 0.65rem;
  width: 100%;
}

.temporal-picker__select:hover,
.temporal-picker__select:focus-visible,
.temporal-picker__select[aria-expanded="true"] {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 0.2rem var(--color-brand-soft);
}

.temporal-picker__select i {
  color: var(--color-muted);
  font-size: 0.72rem;
}

.temporal-picker__options {
  background: var(--color-panel-strong);
  border: 1px solid var(--color-line-strong);
  border-radius: 0.65rem;
  box-shadow: 0 0.75rem 1.5rem rgba(var(--palette-prussian-rgb), 0.22);
  left: 0;
  max-height: 12rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.3rem;
  position: absolute;
  right: 0;
  scrollbar-width: thin;
  top: calc(100% + 0.35rem);
  z-index: 3;
}

.temporal-picker__option {
  background: transparent;
  border: 0;
  border-radius: 0.4rem;
  color: var(--color-ink);
  display: block;
  padding: 0.45rem 0.55rem;
  text-align: left;
  width: 100%;
}

.temporal-picker__option:hover,
.temporal-picker__option:focus-visible {
  background: var(--color-brand-soft);
}

.temporal-picker__option.is-selected {
  background: var(--color-brand);
  color: #fff;
  font-weight: 800;
}

.temporal-picker__footer {
  align-items: center;
  border-top: 1px solid var(--color-line-strong);
  display: grid;
  gap: 0.5rem;
  grid-column: 1 / -1;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 0.65rem 0.8rem;
}

.temporal-picker__footer .btn {
  min-height: 2.35rem;
}

@media (max-width: 620px) {
  .temporal-picker {
    bottom: 0.5rem !important;
    display: block;
    left: 0.5rem !important;
    right: 0.5rem;
    top: auto !important;
    width: auto;
  }

  .temporal-picker__calendar {
    border-bottom: 1px solid var(--color-line-strong);
    border-right: 0;
  }

  .temporal-picker__weekdays,
  .temporal-picker__days {
    grid-template-columns: repeat(7, minmax(2rem, 1fr));
  }

  .temporal-picker__day {
    width: 100%;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --color-ink: #eef7fb;
  --color-muted: #a9bdc9;
  --color-canvas: #071827;
  --color-canvas-rgb: 7, 24, 39;
  --color-panel: rgba(12, 38, 62, 0.74);
  --color-panel-strong: rgba(14, 45, 70, 0.94);
  --color-panel-subtle: rgba(83, 162, 190, 0.12);
  --color-line: rgba(236, 235, 243, 0.13);
  --color-line-strong: rgba(236, 235, 243, 0.24);
  --color-brand: #53a2be;
  --color-brand-dark: #a8d5c2;
  --color-brand-soft: rgba(var(--palette-pacific-rgb), 0.2);
  --color-info: #8fd2e5;
  --color-success: #77d5a6;
  --color-warning: #e5b35c;
  --color-danger: #ff8790;
  --color-soft-blue: rgba(var(--palette-ocean-rgb), 0.22);
  --color-soft-cyan: rgba(var(--palette-aqua-rgb), 0.16);
  --glass-bg: rgba(12, 38, 62, 0.58);
  --glass-bg-strong: rgba(13, 43, 68, 0.82);
  --glass-border: rgba(236, 235, 243, 0.16);
  --glass-highlight: rgba(236, 235, 243, 0.08);
  --sidebar-bg: linear-gradient(180deg, rgba(5, 20, 33, 0.98), rgba(8, 29, 47, 0.94));
  --sidebar-link: rgba(236, 235, 243, 0.76);
  --sidebar-link-hover: rgba(var(--palette-pacific-rgb), 0.18);
  --sidebar-link-active: linear-gradient(135deg, rgba(var(--palette-pacific-rgb), 0.28), rgba(var(--palette-aqua-rgb), 0.14));
  --app-shadow: 0 20px 52px rgba(0, 0, 0, 0.34);
  --app-shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.24);
  --surface-raised: var(--color-panel-strong);
  --shadow-soft: var(--app-shadow-soft);
  --text-main: var(--color-ink);
  --text-muted: var(--color-muted);
  --premium-teal-dark: #8ce8dc;

  --bs-body-color: var(--color-ink);
  --bs-body-bg: var(--color-canvas);
  --bs-link-color: var(--color-brand);
  --bs-link-hover-color: var(--color-brand-dark);
  --bs-border-color: var(--color-line);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;

    --color-ink: #eef7fb;
    --color-muted: #a9bdc9;
    --color-canvas: #071827;
    --color-canvas-rgb: 7, 24, 39;
    --color-panel: rgba(12, 38, 62, 0.74);
    --color-panel-strong: rgba(14, 45, 70, 0.94);
    --color-panel-subtle: rgba(83, 162, 190, 0.12);
    --color-line: rgba(236, 235, 243, 0.13);
    --color-line-strong: rgba(236, 235, 243, 0.24);
    --color-brand: #53a2be;
    --color-brand-dark: #a8d5c2;
    --color-brand-soft: rgba(var(--palette-pacific-rgb), 0.2);
    --color-info: #8fd2e5;
    --color-success: #77d5a6;
    --color-warning: #e5b35c;
    --color-danger: #ff8790;
    --color-soft-blue: rgba(var(--palette-ocean-rgb), 0.22);
    --color-soft-cyan: rgba(var(--palette-aqua-rgb), 0.16);
    --glass-bg: rgba(12, 38, 62, 0.58);
    --glass-bg-strong: rgba(13, 43, 68, 0.82);
    --glass-border: rgba(236, 235, 243, 0.16);
    --glass-highlight: rgba(236, 235, 243, 0.08);
    --sidebar-bg: linear-gradient(180deg, rgba(5, 20, 33, 0.98), rgba(8, 29, 47, 0.94));
    --sidebar-link: rgba(236, 235, 243, 0.76);
    --sidebar-link-hover: rgba(var(--palette-pacific-rgb), 0.18);
    --sidebar-link-active: linear-gradient(135deg, rgba(var(--palette-pacific-rgb), 0.28), rgba(var(--palette-aqua-rgb), 0.14));
    --app-shadow: 0 20px 52px rgba(0, 0, 0, 0.34);
    --app-shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.24);
  }
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background:
    linear-gradient(135deg, rgba(var(--palette-aqua-rgb), 0.34), transparent 34%),
    linear-gradient(225deg, rgba(var(--palette-pacific-rgb), 0.22), transparent 30%),
    linear-gradient(180deg, rgba(var(--palette-ghost-rgb), 0.62), rgba(var(--color-canvas-rgb), 0) 21rem),
    var(--color-canvas);
  color: var(--color-ink);
  font-family: "Inter", sans-serif;
  min-height: 100dvh;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

:root[data-theme="dark"] body {
  background:
    linear-gradient(135deg, rgba(var(--palette-ocean-rgb), 0.24), transparent 36%),
    linear-gradient(225deg, rgba(var(--palette-aqua-rgb), 0.1), transparent 32%),
    linear-gradient(180deg, rgba(var(--palette-prussian-rgb), 0.74), rgba(var(--color-canvas-rgb), 0) 24rem),
    var(--color-canvas);
}

.navbar,
.app-header {
  background-color: var(--palette-prussian);
  color: #fff;
}

.app-main {
  max-width: 1320px;
}

body:has(.main-content) .app-main {
  max-width: none;
  padding: 0 !important;
}

.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  bottom: 0;
  box-shadow: 18px 0 44px rgba(var(--palette-prussian-rgb), 0.24);
  color: #fff;
  display: flex;
  flex-direction: column;
  left: 0;
  padding: 1rem;
  position: fixed;
  top: 0;
  width: 17rem;
  z-index: 1040;
}

.sidebar-brand {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  min-height: 3rem;
}

.sidebar-brand span {
  color: rgba(255, 255, 255, 0.64);
  display: block;
  font-size: 0.8rem;
}

.brand-mark,
.avatar {
  align-items: center;
  background: linear-gradient(135deg, var(--palette-pacific), var(--palette-ocean));
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 8px 20px rgba(var(--palette-prussian-rgb), 0.18);
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 700;
  height: 2.5rem;
  justify-content: center;
  width: 2.5rem;
}

.avatar-lg {
  font-size: 1.35rem;
  height: 3.25rem;
  width: 3.25rem;
}

.sidebar-menu {
  display: grid;
  gap: 0.35rem;
}

.sidebar-menu a,
.profile-menu a {
  align-items: center;
  color: inherit;
  display: flex;
  gap: 0.75rem;
  text-decoration: none;
}

.sidebar-menu a {
  border: 1px solid transparent;
  border-radius: var(--app-radius);
  color: var(--sidebar-link);
  padding: 0.75rem 0.85rem;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
  background: var(--sidebar-link-active);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-group {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--app-radius);
  overflow: hidden;
}

.sidebar-group[open] {
  background: rgba(255, 255, 255, 0.035);
}

.sidebar-group-toggle {
  align-items: center;
  color: var(--sidebar-link);
  cursor: pointer;
  display: flex;
  gap: 0.75rem;
  list-style: none;
  min-height: 2.85rem;
  padding: 0.75rem 0.85rem;
}

.sidebar-group-toggle::-webkit-details-marker {
  display: none;
}

.sidebar-group-toggle i:first-child {
  color: rgba(129, 217, 223, 0.92);
}

.sidebar-group-toggle span {
  flex: 1 1 auto;
  min-width: 0;
}

.group-chevron {
  font-size: 0.82rem;
  opacity: 0.75;
  transition: transform 0.16s ease;
}

.sidebar-group[open] .group-chevron {
  transform: rotate(180deg);
}

.sidebar-submenu {
  display: grid;
  gap: 0.25rem;
  padding: 0 0.45rem 0.45rem;
}

.sidebar-submenu a {
  border-radius: calc(var(--app-radius) - 4px);
  font-size: 0.9rem;
  min-height: 2.35rem;
  padding: 0.55rem 0.65rem 0.55rem 1rem;
}

.sidebar-submenu a i {
  font-size: 0.95rem;
}

.sidebar-close-btn {
  display: none;
}

.main-content {
  margin-left: 17rem;
  min-height: 100dvh;
  padding: 1rem;
}

.top-navbar {
  align-items: center;
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  min-height: 4.25rem;
  overflow: visible;
  padding: 0.75rem 1rem;
  position: relative;
  z-index: 1200;
}

.glass-card,
.page-content,
.app-panel,
.table-responsive,
form:not(.unstyled-form),
.react-table-tools,
.notification-panel,
.profile-menu {
  -webkit-backdrop-filter: var(--app-backdrop-blur);
  backdrop-filter: var(--app-backdrop-blur);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--app-shadow);
}

.glass-card,
.page-content {
  border-radius: var(--app-radius);
  position: relative;
}

.glass-card::before,
.page-content::before {
  background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
  content: "";
  height: 1px;
  left: 1rem;
  opacity: 0.75;
  position: absolute;
  right: 1rem;
  top: 0;
}

.page-content {
  padding: 1rem;
}

.tenant-page-header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.tenant-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.tenant-eyebrow {
  color: var(--color-brand-dark);
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.info-panel {
  background: var(--surface-raised);
  border: 1px solid var(--color-line);
  border-radius: var(--app-radius-sm);
  box-shadow: var(--shadow-soft);
  padding: 1rem;
}

.tenant-section-title {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.metric-card,
.empty-state {
  -webkit-backdrop-filter: var(--app-backdrop-blur);
  backdrop-filter: var(--app-backdrop-blur);
  background: linear-gradient(135deg, var(--glass-bg-strong), var(--glass-bg));
  border: 1px solid var(--glass-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-soft);
}

.metric-card {
  align-items: center;
  display: flex;
  gap: 0.9rem;
  padding: 1rem;
}

.plan-card {
  align-items: stretch;
  flex-direction: column;
}

.plan-price {
  line-height: 1.2;
}

.plan-feature-list {
  color: var(--color-muted);
  display: grid;
  gap: 0.45rem;
  list-style: none;
  padding-left: 0;
}

.plan-feature-list li {
  align-items: flex-start;
  display: flex;
  gap: 0.5rem;
}

.plan-feature-list li::before {
  color: var(--color-success);
  content: "\F26E";
  flex: 0 0 auto;
  font-family: "bootstrap-icons";
  font-size: 0.95rem;
  line-height: 1.35;
}

.metric-icon {
  align-items: center;
  background: var(--color-brand-soft);
  border: 1px solid var(--color-line);
  border-radius: var(--app-radius);
  color: var(--color-brand-dark);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1.15rem;
  height: 2.75rem;
  justify-content: center;
  width: 2.75rem;
}

.tenant-list-group {
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-soft);
  overflow: hidden;
}

.entity-title {
  color: var(--color-ink);
  font-weight: 700;
}

.status-badge {
  align-items: center;
  background: var(--color-panel-subtle);
  border: 1px solid var(--color-line);
  border-radius: 999px;
  color: var(--color-ink);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 700;
  min-height: 1.75rem;
  padding: 0.25rem 0.65rem;
  white-space: nowrap;
}

.status-published,
.status-active,
.status-completed,
.status-paid,
.status-captured,
.status-present,
.status-sent,
.status-issued,
.status-graded,
.status-success,
.status-resolved,
.status-role-admin,
.status-role-teacher {
  background: rgba(35, 135, 90, 0.14);
  border-color: rgba(35, 135, 90, 0.24);
  color: var(--color-success);
}

.status-draft,
.status-sent,
.status-trialing,
.status-pending,
.status-authorized,
.status-late,
.status-excused,
.status-queued,
.status-open,
.status-submitted,
.status-returned,
.status-in_progress,
.status-suspended,
.status-paused,
.status-role-student {
  background: rgba(183, 121, 31, 0.14);
  border-color: rgba(183, 121, 31, 0.24);
  color: var(--color-warning);
}

.status-archived,
.status-inactive,
.status-past_due,
.status-overdue,
.status-cancelled,
.status-expired,
.status-failed,
.status-absent,
.status-revoked,
.status-refunded,
.status-closed,
.status-urgent,
.status-void {
  background: rgba(194, 65, 75, 0.14);
  border-color: rgba(194, 65, 75, 0.24);
  color: var(--color-danger);
}

.status-info,
.status-role-admin {
  background: var(--color-brand-soft);
  border-color: rgba(var(--palette-pacific-rgb), 0.28);
  color: var(--color-brand-dark);
}

.copy-chip {
  align-items: center;
  background: var(--color-panel-subtle);
  border: 1px solid var(--color-line);
  border-radius: 999px;
  color: var(--color-ink);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  gap: 0.4rem;
  min-height: 2rem;
  padding: 0.25rem 0.65rem;
  text-align: left;
}

.copy-chip:hover,
.copy-chip.copied,
[data-copy-value].copied {
  background: var(--color-brand-soft);
  border-color: rgba(var(--palette-pacific-rgb), 0.36);
}

.progress-cell {
  align-items: center;
  display: flex;
  gap: 0.65rem;
  min-width: 9rem;
}

.progress-track {
  background: var(--color-panel-subtle);
  border: 1px solid var(--color-line);
  border-radius: 999px;
  flex: 1 1 auto;
  height: 0.65rem;
  overflow: hidden;
}

.progress-fill {
  background: linear-gradient(90deg, var(--palette-pacific), var(--palette-aqua));
  display: block;
  height: 100%;
  width: 0;
}

.progress-label {
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 700;
  min-width: 2.6rem;
  text-align: right;
}

.min-w-0 {
  min-width: 0;
}

.advanced-form-section {
  background: var(--color-panel-subtle);
  border: 1px solid var(--color-line);
  border-radius: var(--app-radius);
  padding: 0.8rem 0.9rem;
}

.advanced-form-section summary {
  align-items: center;
  color: var(--color-ink);
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  font-weight: 800;
  gap: 0.5rem 0.75rem;
  justify-content: space-between;
  list-style: none;
}

.advanced-form-section summary::-webkit-details-marker {
  display: none;
}

.advanced-form-section summary span {
  align-items: center;
  display: inline-flex;
  gap: 0.45rem;
}

.advanced-form-section summary small {
  color: var(--color-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.learning-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}

.learning-card,
.learning-row,
.progress-overview {
  -webkit-backdrop-filter: var(--app-backdrop-blur);
  backdrop-filter: var(--app-backdrop-blur);
  background:
    linear-gradient(150deg, var(--glass-bg-strong), var(--glass-bg)),
    var(--color-panel);
  border: 1px solid var(--glass-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-soft);
  overflow: hidden;
  position: relative;
}

.learning-card::before,
.learning-row::before,
.progress-overview::before {
  background: linear-gradient(90deg, var(--premium-teal, var(--color-brand)), var(--premium-mint, var(--palette-aqua)));
  content: "";
  height: 2px;
  left: 0;
  opacity: 0.74;
  position: absolute;
  right: 0;
  top: 0;
}

.learning-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 100%;
  padding: 1rem;
}

.learning-card-main,
.learning-row {
  align-items: flex-start;
  display: flex;
  gap: 0.9rem;
}

.learning-card-icon,
.learning-row-icon {
  align-items: center;
  background: linear-gradient(135deg, rgba(var(--palette-pacific-rgb), 0.18), rgba(var(--palette-aqua-rgb), 0.18));
  border: 1px solid var(--color-line);
  border-radius: var(--app-radius);
  color: var(--color-brand-dark);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1.2rem;
  height: 2.75rem;
  justify-content: center;
  width: 2.75rem;
}

.learning-card-title {
  color: var(--color-ink);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}

.learning-meta {
  color: var(--color-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
  font-size: 0.82rem;
  line-height: 1.4;
}

.learning-meta span {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
  min-width: 0;
}

.learning-description {
  color: var(--color-muted);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0.75rem 0 0;
}

.learning-stats {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
}

.learning-stats span,
.certificate-number,
.category-course-list a,
.filter-chip {
  background: var(--color-panel-subtle);
  border: 1px solid var(--color-line);
  border-radius: var(--app-radius);
}

.learning-stats span {
  color: var(--color-muted);
  font-size: 0.82rem;
  padding: 0.55rem 0.65rem;
}

.learning-stats strong {
  color: var(--color-ink);
}

.learning-progress-block {
  display: grid;
  gap: 0.45rem;
}

.learning-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.learning-list {
  display: grid;
  gap: 0.85rem;
}

.learning-row {
  padding: 1rem;
}

.learning-row-body {
  flex: 1 1 auto;
  min-width: 0;
}

.learning-row-action {
  align-self: center;
  flex: 0 0 auto;
}

.learning-filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-chip {
  align-items: center;
  color: var(--color-ink);
  display: inline-flex;
  gap: 0.5rem;
  min-height: 2.35rem;
  padding: 0.45rem 0.7rem;
  text-decoration: none;
}

.filter-chip:hover,
.filter-chip.active {
  background: var(--color-brand-soft);
  border-color: rgba(var(--palette-pacific-rgb), 0.36);
  color: var(--color-brand-dark);
}

.filter-chip small {
  align-items: center;
  background: var(--color-panel-strong);
  border-radius: 999px;
  display: inline-flex;
  font-weight: 800;
  min-width: 1.45rem;
  padding: 0.1rem 0.4rem;
  justify-content: center;
}

.assessment-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
}

.student-focus-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.5fr) minmax(16rem, 0.75fr);
}

.student-action-list,
.student-quick-links {
  display: grid;
  gap: 0.65rem;
}

.student-action-item,
.student-quick-links a {
  align-items: center;
  background: var(--color-panel-subtle);
  border: 1px solid var(--color-line);
  border-radius: var(--app-radius);
  color: var(--color-ink);
  display: flex;
  gap: 0.75rem;
  min-height: 3.6rem;
  padding: 0.75rem;
  text-decoration: none;
}

.student-action-item:hover,
.student-action-item:focus,
.student-quick-links a:hover,
.student-quick-links a:focus {
  background: var(--color-brand-soft);
  border-color: rgba(var(--palette-pacific-rgb), 0.36);
  color: var(--color-ink);
}

.student-action-item .status-badge {
  flex: 0 0 auto;
  margin-left: auto;
}

.student-quick-links {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.student-quick-links a {
  justify-content: flex-start;
}

.student-quick-links i {
  color: var(--color-brand-dark);
  font-size: 1.1rem;
}

.student-watch-hero {
  background:
    linear-gradient(90deg, rgba(7, 24, 39, 0.96), rgba(7, 24, 39, 0.72) 46%, rgba(47, 127, 145, 0.38)),
    var(--color-panel-strong);
  border: 1px solid rgba(var(--palette-pacific-rgb), 0.2);
  border-radius: var(--app-radius-lg);
  color: #fff;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.2fr);
  min-height: 22rem;
  overflow: hidden;
  position: relative;
}

.student-watch-hero-media {
  background: #071827;
  min-height: 18rem;
  position: relative;
}

.student-watch-hero-media img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.student-watch-poster,
.student-video-card-poster {
  align-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(var(--palette-gold-rgb), 0.26), transparent 34%),
    linear-gradient(135deg, #071827, #2f7f91);
  display: flex;
  height: 100%;
  justify-content: center;
  min-height: 100%;
  width: 100%;
}

.student-watch-poster i {
  color: #fff;
  font-size: clamp(3rem, 8vw, 6rem);
  opacity: 0.9;
}

.student-watch-hero-copy {
  align-content: center;
  display: grid;
  gap: 1rem;
  padding: clamp(1.25rem, 4vw, 3rem);
  position: relative;
  z-index: 1;
}

.student-watch-hero-copy h3,
.student-watch-empty h3 {
  font-size: clamp(1.8rem, 4vw, 3.8rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.03;
  margin: 0;
}

.student-watch-hero-copy p,
.student-watch-empty p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1rem;
  max-width: 48rem;
}

.student-watch-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.student-watch-meta span {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  display: inline-flex;
  gap: 0.4rem;
  max-width: 100%;
  padding: 0.35rem 0.65rem;
}

.student-watch-empty {
  align-items: center;
  display: flex;
  gap: 1rem;
  grid-column: 1 / -1;
  padding: clamp(1.25rem, 4vw, 3rem);
}

.student-watch-empty>i {
  color: var(--palette-gold);
  font-size: clamp(2.5rem, 7vw, 5rem);
}

.student-stream-stack {
  display: grid;
  gap: 1.2rem;
}

.student-stream-row-title {
  align-items: baseline;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.student-stream-row-title small {
  color: var(--color-muted);
}

.student-video-rail {
  display: grid;
  gap: 0.85rem;
  grid-auto-columns: minmax(13rem, 18rem);
  grid-auto-flow: column;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 0.1rem 0 0.75rem;
  scroll-snap-type: inline mandatory;
}

.student-video-card {
  background: var(--color-panel);
  border: 1px solid var(--color-line);
  border-radius: var(--app-radius);
  min-height: 15rem;
  overflow: hidden;
  position: relative;
  scroll-snap-align: start;
}

.student-video-card img,
.student-video-card-poster {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
}

.student-video-card-poster i {
  color: #fff;
  font-size: 2.4rem;
}

.student-video-card-body {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem;
  position: relative;
}

.student-video-card-body strong,
.student-video-card-body span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-video-card-body span {
  color: var(--color-muted);
  font-size: 0.86rem;
  padding-right: 2.4rem;
}

.student-video-card-body a {
  align-items: center;
  background: var(--color-brand);
  border-radius: 999px;
  bottom: 0.7rem;
  color: #fff;
  display: inline-flex;
  height: 2rem;
  justify-content: center;
  position: absolute;
  right: 0.75rem;
  text-decoration: none;
  width: 2rem;
}

.assignment-upload-box {
  background: var(--color-panel-subtle);
  border: 1px dashed rgba(var(--palette-pacific-rgb), 0.38);
  border-radius: var(--app-radius);
  padding: 0.85rem;
}

.assessment-list {
  display: grid;
  gap: 0.85rem;
}

.assessment-card,
.assessment-row,
.assessment-brief,
.assessment-question-card,
.assessment-submit-card,
.assessment-result-banner {
  -webkit-backdrop-filter: var(--app-backdrop-blur);
  backdrop-filter: var(--app-backdrop-blur);
  background:
    linear-gradient(150deg, var(--glass-bg-strong), var(--glass-bg)),
    var(--color-panel);
  border: 1px solid var(--glass-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-soft);
}

.assessment-card,
.assessment-row,
.assessment-question-card,
.assessment-submit-card {
  overflow: hidden;
  position: relative;
}

.assessment-card::before,
.assessment-row::before,
.assessment-question-card::before,
.assessment-submit-card::before {
  background: linear-gradient(90deg, var(--palette-aqua), var(--palette-pacific));
  content: "";
  height: 2px;
  inset: 0 0 auto;
  position: absolute;
}

.assessment-card-assignment::before {
  background: linear-gradient(90deg, #2c7a7b, #74d6c8);
}

.assessment-card-test::before {
  background: linear-gradient(90deg, #1f7a5c, #60d394);
}

.assessment-card-quiz::before {
  background: linear-gradient(90deg, #5266c7, #77b7ff);
}

.assessment-card-exam::before {
  background: linear-gradient(90deg, #9b5b2e, #f0b35a);
}

.assessment-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 100%;
  padding: 1rem;
}

.assessment-card-top,
.assessment-row,
.assessment-brief {
  align-items: flex-start;
  display: flex;
  gap: 0.9rem;
}

.assessment-row {
  padding: 1rem;
}

.assessment-row-body {
  flex: 1 1 auto;
  min-width: 0;
}

.assessment-row-actions {
  align-items: center;
  align-self: center;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.assessment-icon {
  align-items: center;
  background: linear-gradient(135deg, rgba(var(--palette-pacific-rgb), 0.16), rgba(var(--palette-aqua-rgb), 0.18));
  border: 1px solid var(--color-line);
  border-radius: var(--app-radius);
  color: var(--color-brand-dark);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1.18rem;
  height: 2.75rem;
  justify-content: center;
  width: 2.75rem;
}

.assessment-title {
  color: var(--color-ink);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}

.assessment-meta {
  color: var(--color-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
  font-size: 0.82rem;
  line-height: 1.4;
}

.assessment-meta span {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
  min-width: 0;
}

.assessment-window {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
}

.assessment-window div {
  background: var(--color-panel-subtle);
  border: 1px solid var(--color-line);
  border-radius: var(--app-radius);
  display: grid;
  gap: 0.2rem;
  padding: 0.65rem 0.75rem;
}

.assessment-window span {
  color: var(--color-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.assessment-window strong {
  color: var(--color-ink);
  font-size: 0.88rem;
  line-height: 1.35;
}

.assessment-card-bottom {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-top: auto;
}

.assessment-section-title {
  margin-top: 0.25rem;
}

.assessment-brief {
  padding: 1rem;
}

.assessment-result-banner {
  align-items: center;
  color: var(--color-ink);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.85rem 1rem;
}

.assessment-take-layout {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem);
}

.assessment-question-flow {
  display: grid;
  gap: 1rem;
}

.assessment-question-card {
  padding: 1rem;
}

.assessment-question-prompt {
  color: var(--color-ink);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.55;
  margin-bottom: 1rem;
}

.assessment-options {
  display: grid;
  gap: 0.65rem;
}

.assessment-option {
  align-items: flex-start;
  background: var(--color-panel-subtle);
  border: 1px solid var(--color-line);
  border-radius: var(--app-radius);
  cursor: pointer;
  display: flex;
  gap: 0.65rem;
  min-height: 3rem;
  padding: 0.75rem;
}

.assessment-option:hover,
.assessment-option:focus-within {
  background: var(--color-brand-soft);
  border-color: rgba(var(--palette-pacific-rgb), 0.36);
}

.assessment-option .form-check-input {
  flex: 0 0 auto;
  margin-top: 0.2rem;
}

.assessment-answer-preview {
  background: var(--color-panel-subtle);
  border: 1px solid var(--color-line);
  border-radius: var(--app-radius);
  color: var(--color-ink);
  line-height: 1.55;
  margin-top: 1rem;
  padding: 0.85rem;
}

.assessment-submit-panel {
  position: sticky;
  top: 1rem;
}

.assessment-submit-card {
  padding: 1rem;
}

.quiz-brief,
.quiz-question-card {
  border-color: rgba(82, 102, 199, 0.28);
}

.quiz-option {
  min-height: 3.25rem;
}

.exam-brief,
.exam-answer-card {
  border-color: rgba(155, 91, 46, 0.28);
}

.exam-answer-textarea {
  min-height: 22rem;
  resize: vertical;
}

.category-course-list {
  display: grid;
  gap: 0.45rem;
}

.category-course-list a {
  align-items: center;
  color: var(--color-ink);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  min-height: 2.35rem;
  padding: 0.55rem 0.65rem;
  text-decoration: none;
}

.category-course-list a:hover {
  background: var(--color-soft-cyan);
}

.category-course-list small {
  color: var(--color-muted);
  font-weight: 800;
}

.certificate-number {
  display: grid;
  gap: 0.15rem;
  padding: 0.65rem;
}

.certificate-number span {
  color: var(--color-muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.certificate-number code {
  overflow-wrap: anywhere;
}

.progress-overview {
  align-items: center;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(8rem, auto) minmax(10rem, 1fr) auto;
  padding: 1rem;
}

.progress-overview-value {
  color: var(--color-ink);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 850;
  line-height: 1;
}

.progress-overview-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.empty-state {
  align-items: center;
  color: var(--color-muted);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  justify-content: center;
  min-height: 10rem;
  padding: 1.5rem;
  text-align: center;
}

.empty-state i {
  color: var(--color-brand);
  font-size: 1.75rem;
}

.empty-state strong {
  color: var(--color-ink);
}

.empty-state.compact {
  border-radius: 0;
  box-shadow: none;
  min-height: 6rem;
}

.avatar-sm {
  font-size: 0.82rem;
  height: 2rem;
  width: 2rem;
}

.auth-shell {
  align-items: center;
  display: grid;
  min-height: calc(100dvh - 3rem);
  padding: 1rem 0;
  place-items: center;
}

.auth-card {
  -webkit-backdrop-filter: var(--app-backdrop-blur);
  backdrop-filter: var(--app-backdrop-blur);
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  max-width: 30rem;
  padding: 1.25rem;
  width: min(100%, 30rem);
}

.auth-brand {
  align-items: center;
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.mobile-menu-toggle,
.profile-btn,
.theme-toggle {
  align-items: center;
  background: var(--glass-bg-strong);
  border: 1px solid var(--color-line);
  border-radius: var(--app-radius);
  color: var(--color-ink);
  display: inline-flex;
  gap: 0.7rem;
  min-height: 2.5rem;
  padding: 0.45rem 0.7rem;
}

.theme-toggle {
  justify-content: center;
  min-width: 2.5rem;
  width: 2.5rem;
}

.theme-toggle:hover,
.mobile-menu-toggle:hover,
.profile-btn:hover {
  border-color: var(--color-line-strong);
  box-shadow: var(--app-shadow-soft);
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  width: 2.75rem;
}

.menu-line {
  background: var(--color-ink);
  border-radius: 1rem;
  display: block;
  height: 2px;
  width: 1.1rem;
}

.search-wrapper {
  min-width: 18rem;
  position: relative;
}

.page-search-input {
  padding-left: 2.5rem;
}

.search-icon {
  color: var(--color-muted);
  left: 0.9rem;
  pointer-events: none;
  top: 0.72rem;
}

.notification-panel,
.profile-menu {
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(235, 249, 249, 0.96)),
    var(--color-panel-strong);
  border-radius: var(--app-radius);
  color: var(--color-ink);
  min-width: 16rem;
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 1250;
}

.notification-panel {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.65rem;
  width: min(24rem, calc(100vw - 1.5rem));
}

.profile-menu {
  padding: 0.75rem;
}

:root[data-theme="dark"] .notification-panel,
:root[data-theme="dark"] .profile-menu {
  background:
    linear-gradient(150deg, rgba(14, 52, 76, 0.99), rgba(7, 28, 44, 0.98)),
    var(--color-panel-strong);
}

.notification-header {
  align-items: center;
  border-bottom: 1px solid var(--color-line);
  color: var(--color-ink);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.15rem 0.15rem 0.65rem;
}

.notification-title {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.notification-title strong {
  font-size: 0.95rem;
  line-height: 1.2;
}

.notification-title small {
  color: var(--color-muted);
  font-size: 0.76rem;
  line-height: 1.2;
}

.notification-actions {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.35rem;
}

.notification-icon-action {
  align-items: center;
  background: var(--color-panel-subtle);
  border: 1px solid var(--color-line);
  border-radius: 8px;
  color: var(--color-ink);
  cursor: pointer;
  display: inline-flex;
  height: 2rem;
  justify-content: center;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  width: 2rem;
}

.notification-icon-action:hover,
.notification-icon-action:focus-visible {
  background: var(--color-brand-soft);
  border-color: rgba(var(--palette-pacific-rgb), 0.4);
  color: var(--color-brand-dark);
}

.notification-icon-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.notification-empty {
  color: var(--color-muted);
  font-size: 0.9rem;
  padding: 1rem 0.5rem;
  text-align: center;
}

.profile-dropdown,
.notification-wrapper {
  position: relative;
}

.profile-menu {
  display: grid;
  gap: 0.35rem;
}

.profile-menu a {
  border-radius: var(--app-radius);
  color: var(--color-ink);
  padding: 0.65rem;
}

.profile-menu a:hover {
  background: var(--color-soft-blue);
}

.app-shell {
  align-items: flex-start;
}

.app-sidebar {
  position: sticky;
  top: 1rem;
}

.app-panel,
.table-responsive,
form:not(.unstyled-form) {
  background: var(--color-panel);
  border-radius: var(--app-radius);
}

form:not(.unstyled-form) {
  padding: 1rem;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.btn-outline-secondary {
  --bs-btn-color: var(--color-ink);
  --bs-btn-border-color: var(--color-line-strong);
  --bs-btn-hover-bg: var(--color-brand);
  --bs-btn-hover-border-color: var(--color-brand);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--color-brand-dark);
  --bs-btn-active-border-color: var(--color-brand-dark);
  --bs-btn-active-color: #fff;
}

.list-group {
  --bs-list-group-bg: var(--color-panel);
  --bs-list-group-border-color: var(--color-line);
  --bs-list-group-action-hover-bg: var(--color-soft-blue);
  --bs-list-group-action-active-bg: var(--color-brand);
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--color-ink);
  --bs-table-border-color: var(--color-line);
  margin-bottom: 0;
}

.table thead th {
  background-color: var(--color-soft-blue);
  color: var(--color-ink);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.table tbody tr:hover {
  --bs-table-hover-bg: var(--color-soft-cyan);
}

.card {
  --bs-card-bg: var(--color-panel);
  --bs-card-border-color: var(--color-line);
  box-shadow: var(--app-shadow-soft);
}

.alert {
  border-color: var(--color-line);
}

.app-toast-container {
  max-width: min(24rem, calc(100vw - 1rem));
  pointer-events: none;
  z-index: 1400;
}

.app-toast {
  -webkit-backdrop-filter: var(--app-backdrop-blur);
  backdrop-filter: var(--app-backdrop-blur);
  background: var(--color-panel-strong);
  border: 1px solid var(--color-line-strong);
  border-left: 4px solid var(--color-brand);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  color: var(--color-ink);
  overflow: hidden;
  pointer-events: auto;
}

.app-toast-danger {
  border-left-color: var(--color-danger);
}

.app-toast-success {
  border-left-color: var(--color-success);
}

.app-toast-warning {
  border-left-color: var(--color-warning);
}

.app-toast-info {
  border-left-color: var(--color-info);
}

.app-toast .toast-header {
  background: var(--color-panel-strong);
  border-bottom-color: var(--color-line);
  color: var(--color-ink);
  gap: 0.5rem;
}

.app-toast .toast-body {
  color: var(--color-ink);
  line-height: 1.45;
}

.toast-status-dot {
  border-radius: 999px;
  display: inline-flex;
  height: 0.65rem;
  width: 0.65rem;
}

.swal2-popup.app-swal-popup {
  -webkit-backdrop-filter: var(--app-backdrop-blur);
  backdrop-filter: var(--app-backdrop-blur);
  background: var(--color-panel-strong) !important;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--app-radius-lg);
  box-shadow: var(--app-shadow);
  color: var(--color-ink) !important;
  padding: 1.35rem;
}

.swal2-popup.app-swal-popup .swal2-title {
  color: var(--color-ink);
  font-size: 1.35rem;
  letter-spacing: 0;
}

.swal2-popup.app-swal-popup .swal2-html-container,
.swal2-popup.app-swal-popup .swal2-content {
  color: var(--color-muted);
  line-height: 1.5;
}

.swal2-popup.app-swal-popup .swal2-actions {
  gap: 0.55rem;
}

.swal2-popup.app-swal-popup .swal2-styled {
  border-radius: var(--app-radius) !important;
  box-shadow: none !important;
  font-weight: 700;
  letter-spacing: 0;
  min-width: 7.5rem;
}

.swal2-popup.app-swal-popup .app-swal-confirm {
  box-shadow: 0 0.6rem 1.4rem rgba(194, 65, 75, 0.2) !important;
}

.swal2-popup.app-swal-popup .app-swal-cancel {
  background: var(--color-panel-subtle) !important;
  color: var(--color-ink) !important;
}

.border,
.card,
.list-group-item,
.form-control,
.form-select {
  border-color: var(--color-line) !important;
}

.rounded,
.card,
.btn,
.form-control,
.form-select,
.list-group-item {
  border-radius: var(--app-radius) !important;
}

.form-control,
.form-select,
.btn {
  min-height: 2.5rem;
}

.btn {
  align-items: center;
  display: inline-flex;
  gap: 0.45rem;
  justify-content: center;
}

.form-control,
.form-select {
  background-color: var(--color-panel-strong);
  color: var(--color-ink);
}

.form-control::placeholder {
  color: rgba(89, 112, 131, 0.88);
}

.form-control:focus,
.form-select:focus {
  background-color: var(--color-panel-strong);
  border-color: rgba(var(--palette-pacific-rgb), 0.66) !important;
  box-shadow: 0 0 0 0.2rem rgba(var(--palette-pacific-rgb), 0.2);
  color: var(--color-ink);
}

.is-invalid {
  scroll-margin-top: 1rem;
}

.form-error-summary {
  border-left: 0.35rem solid var(--color-danger);
  margin-bottom: 1rem;
}

.form-error-summary a {
  color: inherit;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 0.16rem;
}

.upload-progress-panel {
  background:
    linear-gradient(135deg, rgba(65, 198, 196, 0.13), rgba(169, 216, 192, 0.1)),
    var(--color-panel-strong);
  border: 1px solid rgba(65, 198, 196, 0.28);
  border-radius: 0.85rem;
  box-shadow: var(--shadow-soft);
  margin: 0.4rem 0 0.6rem;
  padding: 0.85rem;
  width: 100%;
}

.upload-progress-panel[hidden] {
  display: none;
}

.upload-progress-head,
.upload-progress-meta {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.upload-progress-head span {
  align-items: center;
  display: inline-flex;
  font-weight: 850;
  gap: 0.45rem;
}

.upload-progress-head strong {
  color: var(--color-brand-dark);
}

.upload-progress-track {
  background: rgba(47, 127, 145, 0.13);
  border-radius: 999px;
  height: 0.6rem;
  margin: 0.65rem 0 0.45rem;
  overflow: hidden;
}

.upload-progress-track span {
  background: linear-gradient(90deg, var(--premium-teal, #41c6c4), var(--premium-mint, #a9d8c0));
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 0.18s ease;
}

.upload-progress-meta {
  color: var(--color-muted);
  font-size: 0.82rem;
}

.owner-copy-chip {
  align-items: center;
  background: rgba(65, 198, 196, 0.1);
  border: 1px solid rgba(65, 198, 196, 0.24);
  border-radius: 999px;
  color: inherit;
  display: inline-flex;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  gap: 0.35rem;
  max-width: 100%;
  padding: 0.24rem 0.5rem;
}

.owner-copy-chip:hover,
.owner-copy-chip.copied {
  background: rgba(65, 198, 196, 0.18);
  border-color: rgba(65, 198, 196, 0.42);
}

.bg-light {
  background-color: var(--color-panel-subtle) !important;
}

.bg-white {
  background-color: var(--color-panel-strong) !important;
}

.text-dark,
.text-body {
  color: var(--color-ink) !important;
}

.text-secondary {
  color: var(--color-muted) !important;
}

.border,
.border-top,
.border-end,
.border-bottom,
.border-start {
  border-color: var(--color-line) !important;
}

.form-control,
.form-select,
.form-check-input,
.input-group-text {
  background-color: var(--color-panel-strong);
  border-color: var(--color-line);
  color: var(--color-ink);
}

.form-control::placeholder {
  color: color-mix(in srgb, var(--color-muted), transparent 18%);
}

.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
  background-color: var(--color-panel-subtle);
  color: var(--color-muted);
  opacity: 1;
}

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

.form-text {
  color: var(--color-muted);
}

.invalid-feedback {
  color: var(--color-danger);
}

.valid-feedback {
  color: var(--color-success);
}

.dropdown-menu,
.modal-content,
.popover,
.toast,
.list-group-item,
.card {
  background-color: var(--color-panel-strong);
  border-color: var(--color-line);
  color: var(--color-ink);
}

.dropdown-item {
  color: var(--color-ink);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--color-panel-subtle);
  color: var(--color-brand-dark);
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--color-ink);
  --bs-table-border-color: var(--color-line);
  --bs-table-striped-bg: var(--color-panel-subtle);
  --bs-table-striped-color: var(--color-ink);
  --bs-table-hover-bg: var(--color-brand-soft);
  --bs-table-hover-color: var(--color-ink);
  color: var(--color-ink);
}

.table> :not(caption)>*>* {
  background-color: var(--bs-table-bg);
  border-bottom-color: var(--color-line);
  color: var(--color-ink);
}

code {
  color: var(--color-brand-dark);
}

.code-panel {
  background: var(--color-panel-subtle);
  border-color: var(--color-line) !important;
  color: var(--color-ink);
  font-size: 0.875rem;
  max-height: 320px;
  overflow: auto;
}

.code-panel code {
  color: inherit;
  word-break: break-all;
}

::selection {
  background: var(--color-soft-cyan);
  color: var(--color-ink);
}

.datepicker {
  background: var(--color-panel-strong);
  border-color: var(--color-line);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  color: var(--color-ink);
  width: 18rem;
  z-index: 1080;
}

.datepicker-picker {
  background: transparent;
  padding: 0.75rem;
  width: 100%;
}

.datepicker-header .datepicker-controls {
  align-items: center;
  display: grid;
  gap: 0.35rem;
  grid-template-columns: 2.25rem 1fr 2.25rem;
}

.datepicker-controls .btn {
  align-items: center;
  background: #fff;
  border-radius: 0.6rem;
  display: inline-flex;
  justify-content: center;
  min-height: 2rem;
  padding: 0.35rem 0.45rem;
  white-space: nowrap;
}

:root[data-theme="dark"] .datepicker-controls .btn {
  background: transparent;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .datepicker-controls .btn {
    background: transparent;
  }
}

.datepicker-controls .view-switch {
  font-weight: 800;
  min-width: 0;
}

.datepicker-main {
  padding-top: 0.4rem;
}

.datepicker-grid,
.days-of-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.datepicker-cell,
.dow {
  align-items: center;
  display: inline-flex;
  height: 2rem;
  justify-content: center;
  line-height: 1;
}

.datepicker-footer .datepicker-controls {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr 1fr;
  margin-top: 0.5rem;
}

.react-page-tool {
  align-items: center;
  box-shadow: var(--app-shadow);
  display: inline-flex;
  gap: 0.45rem;
  justify-content: center;
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: auto;
  z-index: 1100;
}

.react-page-tool[hidden] {
  display: none !important;
}

@media (max-width: 767.98px) {

  .react-page-tool,
  .react-page-tool.btn {
    border-radius: 50%;
    bottom: calc(0.85rem + env(safe-area-inset-bottom));
    height: 2.85rem;
    min-height: 2.85rem;
    padding: 0;
    right: calc(0.85rem + env(safe-area-inset-right));
    width: 2.85rem;
  }

  .react-page-tool i {
    font-size: 1.05rem;
    line-height: 1;
  }

  .react-page-tool-label {
    display: none;
  }

  body .secure-watermark {
    bottom: calc(4.25rem + env(safe-area-inset-bottom));
  }
}

.react-table-tools {
  background: var(--glass-bg);
  border-radius: var(--app-radius);
  margin-bottom: 0.75rem;
  padding: 0.75rem;
}

.react-table-search {
  max-width: 18rem;
}

.password-input-shell {
  position: relative;
}

.password-input-shell .form-control {
  padding-right: 3.25rem !important;
}

/* Edge adds its own reveal control to password inputs. The application
   supplies an accessible reveal button below, so keep only that control. */
.password-input-shell input[type="password"]::-ms-reveal,
.password-input-shell input[type="password"]::-ms-clear {
  display: none;
}

.password-toggle-wrap {
  align-items: center;
  display: inline-flex;
  margin: 0;
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
}

.password-toggle {
  align-items: center;
  aspect-ratio: 1;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--text-muted);
  display: inline-flex;
  font-size: 1rem;
  height: 2rem;
  justify-content: center;
  padding: 0;
  transition: background 0.2s ease, color 0.2s ease;
  width: 2rem;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: rgba(65, 198, 196, 0.14);
  color: var(--premium-teal-dark);
  outline: none;
}

.secure-content {
  position: relative;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  user-select: none;
}

.secure-content input,
.secure-content textarea,
.secure-content select,
.secure-content [contenteditable="true"] {
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  touch-action: auto;
  user-select: text;
}

html.secure-guard-boot body {
  visibility: hidden;
}

html.secure-guard-boot::after {
  background: #071827;
  color: #fff;
  content: "Checking protected session…";
  display: grid;
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  inset: 0;
  place-items: center;
  position: fixed;
  visibility: visible;
  z-index: 2147483647;
}

.secure-capture-shield {
  -webkit-backdrop-filter: blur(28px);
  backdrop-filter: blur(28px);
  background:
    linear-gradient(135deg, rgba(var(--palette-prussian-rgb), 0.92), rgba(7, 24, 39, 0.96)),
    var(--palette-prussian);
  color: #fff;
  display: grid;
  font-size: clamp(1rem, 2vw, 1.4rem);
  font-weight: 700;
  inset: 0;
  opacity: 0;
  place-items: center;
  pointer-events: none;
  position: fixed;
  text-align: center;
  transition: opacity 0.12s ease;
  z-index: 2147483647;
}

.secure-capture-shield::before {
  content: "Protected content\a Screenshot and screen recording are disabled";
  white-space: pre-line;
}

.secure-shield-active .secure-capture-shield,
.secure-page-hidden .secure-capture-shield,
.secure-window-inactive .secure-capture-shield {
  opacity: 1;
  pointer-events: auto;
}

.secure-shield-active .secure-content,
.secure-page-hidden .secure-content,
.secure-window-inactive .secure-content,
.secure-window-inactive #main-content {
  filter: blur(28px);
  opacity: 0.02;
  visibility: hidden !important;
}

.secure-shield-active [data-protected-media],
.secure-page-hidden [data-protected-media],
.secure-window-inactive [data-protected-media],
.secure-window-inactive video,
.secure-window-inactive iframe,
.secure-window-inactive canvas {
  filter: blur(32px);
  opacity: 0.01;
  visibility: hidden !important;
}

@media print {
  body[data-student-security="true"] *,
  body:has([data-student-security="true"]) *,
  body:has([data-protected-media]) * {
    visibility: hidden !important;
  }

  body[data-student-security="true"]::before,
  body:has([data-student-security="true"])::before,
  body:has([data-protected-media])::before {
    background: #071827;
    color: #fff;
    content: "Protected LMS content cannot be printed or captured.";
    display: grid;
    font: 700 18pt system-ui, sans-serif;
    inset: 0;
    place-items: center;
    position: fixed;
    visibility: visible !important;
    z-index: 2147483647;
  }
}

.secure-media-viewer {
  -webkit-backdrop-filter: blur(18px);
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(3, 15, 24, 0.78);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: clamp(0.75rem, 3vw, 2rem);
  position: fixed;
  z-index: 1600;
}

.secure-media-viewer[hidden] {
  display: none;
}

.secure-media-dialog {
  background: var(--color-panel-strong);
  border: 1px solid var(--color-line);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: min(92dvh, 900px);
  max-width: min(96vw, 1100px);
  overflow: hidden;
  width: 100%;
}

.secure-media-header {
  align-items: center;
  border-bottom: 1px solid var(--color-line);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
}

.secure-media-header strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secure-media-body {
  align-items: center;
  background: rgba(var(--palette-prussian-rgb), 0.22);
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  min-height: min(62dvh, 520px);
  overflow: auto;
  padding: clamp(0.75rem, 2vw, 1.25rem);
}

.secure-media-body img,
.secure-media-body video {
  border: 1px solid var(--color-line);
  border-radius: 8px;
  display: block;
  max-height: min(76dvh, 760px);
  max-width: 100%;
  object-fit: contain;
}

.secure-media-body audio {
  max-width: min(100%, 42rem);
  width: 100%;
}

.secure-media-body iframe {
  background: var(--color-panel);
  border: 1px solid var(--color-line);
  border-radius: 8px;
  height: min(76dvh, 760px);
  width: 100%;
}

[data-protected-video-stage] {
  position: relative;
}

[data-protected-video-watermark] {
  background: rgba(5, 24, 31, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.3rem;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.64rem;
  height: 30px;
  font-weight: 600;
  bottom: auto;
  left: auto;
  line-height: 1.1;
  max-width: min(34%, 10rem);
  overflow: hidden;
  padding: 0.18rem 0.32rem;
  pointer-events: none;
  position: absolute;
  right: 0.45rem;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
  top: 0.45rem;
  white-space: nowrap;
  z-index: 4;
}

[data-protected-video-stage]:fullscreen {
  background: #000;
  display: grid;
  place-items: center;
}

[data-protected-video-stage]:fullscreen video {
  height: 100%;
  max-height: 100vh;
  max-width: 100vw;
  width: 100%;
}

[data-protected-media] video::-webkit-media-controls-fullscreen-button,
video[data-protected-media]::-webkit-media-controls-fullscreen-button,
[data-protected-media] video::-webkit-media-controls-picture-in-picture-button {
  display: none !important;
}

.secure-media-note {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 0.75rem;
  max-width: 48rem;
  text-align: center;
}

.secure-media-external {
  align-items: center;
  color: var(--color-ink);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 30rem;
  text-align: center;
}

.secure-media-external>i {
  color: var(--color-brand);
  font-size: 2.5rem;
}

.secure-media-external span {
  color: var(--text-muted);
}

.secure-media-open {
  overflow: hidden;
}

.secure-media-trigger {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  margin: 0;
  padding: 0;
  text-align: left;
}

.chat-media-preview {
  border-radius: 0.7rem;
}

.chat-media-preview:focus-visible,
.secure-media-trigger:focus-visible {
  outline: 2px solid rgba(var(--palette-pacific-rgb), 0.68);
  outline-offset: 3px;
}

@media (pointer: coarse) {
  .secure-capture-shield {
    font-size: 1rem;
    padding: 2rem;
  }

  .secure-content {
    -webkit-touch-callout: none;
  }
}

/* Premium Leirbag identity layer */
:root {
  --premium-ink: #062033;
  --premium-sea: #2f7f91;
  --premium-teal: #41c6c4;
  --premium-mint: #a9d8c0;
  --premium-platinum: #f4f7f8;
  --premium-cream: #fffaf0;
  --premium-line: rgba(47, 127, 145, 0.18);
  --premium-sheen: linear-gradient(120deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.36) 45%, rgba(169, 216, 192, 0.18));
  --premium-control: rgba(255, 255, 255, 0.82);
  --premium-control-strong: rgba(255, 255, 255, 0.94);
  --premium-shadow: 0 22px 54px rgba(6, 32, 51, 0.14);
  --premium-shadow-soft: 0 12px 30px rgba(6, 32, 51, 0.1);
  --premium-sidebar: linear-gradient(180deg, #061b2a 0%, #082338 48%, #0a2f3c 100%);
  --premium-accent: linear-gradient(135deg, var(--premium-teal), var(--premium-sea) 58%, var(--premium-mint));
}

:root[data-theme="dark"] {
  --premium-line: rgba(169, 216, 192, 0.17);
  --premium-control: rgba(9, 35, 54, 0.76);
  --premium-control-strong: rgba(12, 45, 66, 0.94);
  --premium-sheen: linear-gradient(120deg, rgba(255, 255, 255, 0.1), rgba(65, 198, 196, 0.08) 48%, rgba(169, 216, 192, 0.08));
  --premium-shadow: 0 24px 64px rgba(0, 0, 0, 0.36);
  --premium-shadow-soft: 0 14px 36px rgba(0, 0, 0, 0.28);
  --premium-sidebar: linear-gradient(180deg, #04131f 0%, #071e31 46%, #092b36 100%);
}

body {
  background:
    linear-gradient(135deg, rgba(65, 198, 196, 0.16) 0%, transparent 32%),
    linear-gradient(225deg, rgba(169, 216, 192, 0.2) 0%, transparent 28%),
    linear-gradient(180deg, #f7fbfc 0%, var(--color-canvas) 42%, #eef5f7 100%);
}

:root[data-theme="dark"] body {
  background:
    linear-gradient(135deg, rgba(65, 198, 196, 0.12) 0%, transparent 34%),
    linear-gradient(225deg, rgba(169, 216, 192, 0.08) 0%, transparent 30%),
    linear-gradient(180deg, #061522 0%, #071827 48%, #08202b 100%);
}

.leirbag-mark {
  align-items: center;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.42), transparent 42%),
    var(--premium-accent);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48), 0 14px 34px rgba(47, 127, 145, 0.28);
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1.12rem;
  font-weight: 900;
  height: 2.55rem;
  justify-content: center;
  line-height: 1;
  position: relative;
  width: 2.55rem;
}

.leirbag-mark::after {
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  bottom: 0.45rem;
  content: "";
  height: 0.2rem;
  left: 0.55rem;
  position: absolute;
  width: 0.95rem;
}

.leirbag-mark-lg {
  font-size: 1.35rem;
  height: 3.15rem;
  width: 3.15rem;
}

.leirbag-wordmark {
  align-items: baseline;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  letter-spacing: 0;
  line-height: 1;
}

.leirbag-wordmark span {
  background: linear-gradient(90deg, #78d3df, var(--premium-mint));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  font-weight: 900;
  text-transform: uppercase;
}

.leirbag-wordmark em {
  color: #dceff1;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.leirbag-wordmark-lg {
  display: flex;
  font-size: 1.55rem;
  margin-bottom: 0.2rem;
}

:root:not([data-theme="dark"]) .auth-card .leirbag-wordmark em {
  color: var(--premium-sea);
}

.sidebar {
  background: var(--premium-sidebar);
  border-right: 1px solid rgba(169, 216, 192, 0.14);
  box-shadow: 20px 0 54px rgba(6, 32, 51, 0.3);
  padding: 1.15rem;
}

.sidebar::before {
  background: linear-gradient(180deg, rgba(65, 198, 196, 0.22), transparent 36%, rgba(169, 216, 192, 0.12));
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.sidebar>* {
  position: relative;
}

.sidebar-brand {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1.05rem;
  padding-bottom: 1rem;
}

.sidebar-brand strong {
  color: #fff;
  font-size: 1rem;
}

.sidebar-brand>div>span {
  color: rgba(226, 244, 246, 0.68);
}

.sidebar-menu {
  gap: 0.45rem;
}

.sidebar-menu a {
  border-color: rgba(255, 255, 255, 0.06);
  color: rgba(236, 248, 249, 0.78);
  font-weight: 650;
  min-height: 2.85rem;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.sidebar-menu a i {
  color: rgba(129, 217, 223, 0.92);
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
  background:
    linear-gradient(135deg, rgba(65, 198, 196, 0.24), rgba(169, 216, 192, 0.11)),
    rgba(255, 255, 255, 0.05);
  border-color: rgba(169, 216, 192, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 12px 26px rgba(0, 0, 0, 0.16);
  transform: translateX(2px);
}

.main-content {
  padding: 1.15rem 1.25rem 1.25rem;
}

.top-navbar,
.page-content,
.glass-card,
.app-panel,
.table-responsive,
form:not(.unstyled-form),
.react-table-tools,
.notification-panel,
.profile-menu,
.metric-card,
.empty-state,
.auth-card {
  background:
    var(--premium-sheen),
    var(--premium-control);
  border-color: var(--premium-line);
  box-shadow: var(--premium-shadow);
}

:root[data-theme="dark"] .top-navbar,
:root[data-theme="dark"] .page-content,
:root[data-theme="dark"] .glass-card,
:root[data-theme="dark"] .app-panel,
:root[data-theme="dark"] .table-responsive,
:root[data-theme="dark"] form:not(.unstyled-form),
:root[data-theme="dark"] .react-table-tools,
:root[data-theme="dark"] .notification-panel,
:root[data-theme="dark"] .profile-menu,
:root[data-theme="dark"] .metric-card,
:root[data-theme="dark"] .empty-state,
:root[data-theme="dark"] .auth-card {
  background:
    var(--premium-sheen),
    var(--premium-control);
}

.notification-panel,
.profile-menu {
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(235, 249, 249, 0.96)),
    var(--color-panel-strong);
  color: var(--color-ink);
  isolation: isolate;
}

:root[data-theme="dark"] .notification-panel,
:root[data-theme="dark"] .profile-menu {
  background:
    linear-gradient(150deg, rgba(14, 52, 76, 0.99), rgba(7, 28, 44, 0.98)),
    var(--color-panel-strong);
  color: var(--color-ink);
}

.page-content {
  padding: clamp(1rem, 2vw, 1.35rem);
}

.top-navbar {
  min-height: 4.55rem;
  padding: 0.8rem 1rem;
}

.tenant-page-header,
.page-content>.d-flex:first-child {
  border-bottom: 1px solid var(--premium-line);
  margin-bottom: 1.35rem;
  padding-bottom: 1.1rem;
}

.tenant-page-header h2,
.page-content h1,
.page-content h2,
.tenant-section-title h3 {
  font-weight: 800;
  letter-spacing: 0;
}

.tenant-eyebrow {
  color: var(--premium-teal);
}

.metric-card,
.page-content>.border.rounded,
.row .border.rounded {
  background:
    linear-gradient(150deg, var(--premium-control-strong), rgba(255, 255, 255, 0.58)),
    var(--color-panel);
  border-color: var(--premium-line) !important;
  box-shadow: var(--premium-shadow-soft);
  overflow: hidden;
  position: relative;
}

:root[data-theme="dark"] .metric-card,
:root[data-theme="dark"] .page-content>.border.rounded,
:root[data-theme="dark"] .row .border.rounded {
  background:
    linear-gradient(150deg, rgba(16, 55, 77, 0.96), rgba(10, 35, 54, 0.74)),
    var(--color-panel);
}

.metric-card::before,
.page-content>.border.rounded::before,
.row .border.rounded::before {
  background: linear-gradient(90deg, var(--premium-teal), var(--premium-mint));
  content: "";
  height: 2px;
  left: 0;
  opacity: 0.75;
  position: absolute;
  right: 0;
  top: 0;
}

.metric-icon {
  background: linear-gradient(135deg, rgba(65, 198, 196, 0.2), rgba(169, 216, 192, 0.22));
  border-color: rgba(65, 198, 196, 0.28);
  color: var(--premium-sea);
}

:root[data-theme="dark"] .metric-icon {
  color: #8ce1df;
}

.auth-shell {
  min-height: calc(100dvh - 2rem);
  padding: clamp(1rem, 4vw, 2.5rem) 0;
}

.auth-card {
  max-width: 31rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
}

.auth-card::after {
  background: linear-gradient(90deg, var(--premium-teal), var(--premium-mint), transparent);
  content: "";
  height: 3px;
  left: 1.25rem;
  position: absolute;
  right: 1.25rem;
  top: 0;
}

.auth-brand {
  margin-bottom: 1.4rem;
}

.form-label {
  color: var(--color-ink);
  font-size: 0.82rem;
  font-weight: 750;
}

.form-control,
.form-select,
.mobile-menu-toggle,
.profile-btn,
.theme-toggle {
  background: var(--premium-control-strong);
  border-color: var(--premium-line) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(65, 198, 196, 0.78) !important;
  box-shadow: 0 0 0 0.2rem rgba(65, 198, 196, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.btn-primary {
  --bs-btn-bg: #2f9eae;
  --bs-btn-border-color: #2f9eae;
  --bs-btn-hover-bg: #267f91;
  --bs-btn-hover-border-color: #267f91;
  --bs-btn-active-bg: #236f7f;
  --bs-btn-active-border-color: #236f7f;
  box-shadow: 0 12px 24px rgba(47, 158, 174, 0.22);
  font-weight: 750;
}

.btn-outline-primary,
.btn-outline-secondary {
  font-weight: 700;
}

.table-responsive {
  border-color: var(--premium-line);
}

.table thead th {
  background: linear-gradient(180deg, rgba(65, 198, 196, 0.16), rgba(169, 216, 192, 0.1));
  border-bottom-color: var(--premium-line);
  color: var(--color-muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.table tbody td {
  padding-bottom: 0.9rem;
  padding-top: 0.9rem;
}

.list-group-item {
  background: var(--premium-control);
  border-color: var(--premium-line);
}

:root[data-theme="dark"] .list-group-item {
  background: rgba(11, 38, 58, 0.72);
}

.profile-btn .avatar,
.avatar {
  background: var(--premium-accent);
  border-radius: 8px;
}

.secure-watermark {
  background: rgba(12, 44, 66, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  bottom: 0.75rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.25;
  max-width: min(20rem, calc(100vw - 1.5rem));
  padding: 0.35rem 0.5rem;
  pointer-events: none;
  position: fixed;
  right: 0.75rem;
  text-align: right;
  z-index: 1200;
}

.secure-viewer {
  background: var(--premium-control);
  border: 1px solid var(--premium-line);
  border-radius: 8px;
  min-height: 420px;
  overflow: hidden;
  position: relative;
  user-select: none;
}

.secure-viewer iframe,
.secure-viewer img {
  border: 0;
  display: block;
  height: min(72vh, 760px);
  width: 100%;
}

.secure-viewer-image {
  align-items: flex-start;
  display: flex;
  justify-content: center;
  max-height: min(82dvh, 920px);
  min-height: min(62dvh, 560px);
  overflow: auto;
  padding: clamp(0.75rem, 2vw, 1.25rem);
}

.secure-viewer img {
  height: auto;
  max-height: none;
  max-width: 100%;
  object-fit: contain;
  padding: 0;
  width: auto;
}

.secure-viewer:not(.secure-viewer-image) img {
  height: min(72vh, 760px);
  padding: 1rem;
  width: 100%;
}

.secure-viewer::after {
  background: rgba(12, 44, 66, 0.54);
  border-radius: 6px;
  bottom: 0.75rem;
  color: rgba(255, 255, 255, 0.82);
  content: "Protected inline view";
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.35rem 0.5rem;
  pointer-events: none;
  position: absolute;
  right: 0.75rem;
}

@media print {
  body[data-student-security="true"] *,
  body:has([data-student-security="true"]) *,
  body:has([data-protected-media]) * {
    visibility: hidden !important;
  }

  body[data-student-security="true"]::before,
  body:has([data-student-security="true"])::before,
  body:has([data-protected-media])::before {
    color: #000;
    content: "Protected content";
    display: grid;
    font: 700 18pt/1.4 "Inter", sans-serif;
    inset: 0;
    place-items: center;
    position: fixed;
    visibility: visible !important;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {

  .glass-card,
  .page-content,
  .app-panel,
  .table-responsive,
  form:not(.unstyled-form),
  .react-table-tools,
  .metric-card,
  .empty-state,
  .auth-card,
  .notification-panel,
  .profile-menu {
    background: var(--color-panel-strong);
  }
}

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .sidebar-close-btn {
    align-items: center;
    align-self: flex-end;
    background: transparent;
    border: 0;
    color: #fff;
    display: inline-flex;
    font-size: 1.25rem;
    justify-content: center;
    margin-bottom: 0.5rem;
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-menu-toggle {
    display: inline-flex;
  }

  .app-sidebar {
    position: static;
  }

  .app-sidebar .list-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assessment-take-layout {
    grid-template-columns: 1fr;
  }

  .student-focus-grid {
    grid-template-columns: 1fr;
  }

  .assessment-submit-panel {
    position: static;
  }
}

.app-timezone-badge {
  align-items: center;
  background: color-mix(in srgb, var(--color-brand) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-brand) 24%, transparent);
  border-radius: 999px;
  color: var(--color-muted);
  display: inline-flex;
  font-size: 0.75rem;
  gap: 0.35rem;
  max-width: 12rem;
  padding: 0.35rem 0.55rem;
}

.app-timezone-badge span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-row-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  justify-content: flex-end;
  white-space: nowrap;
}

.confirm-action-card {
  margin-inline: auto;
  max-width: 42rem;
  padding: clamp(1rem, 3vw, 1.5rem);
}

@media (max-width: 575.98px) {
  .app-main {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .app-sidebar .list-group {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }

  .assessment-card-top,
  .assessment-row,
  .assessment-brief {
    flex-direction: column;
  }

  .assessment-row-actions,
  .assessment-row-actions .btn,
  .assessment-card-bottom,
  .assessment-card-bottom .btn {
    width: 100%;
  }

  .assessment-row-actions {
    justify-content: stretch;
  }

  .assessment-window {
    grid-template-columns: 1fr;
  }

  .student-action-item {
    align-items: flex-start;
  }

  .student-action-item .status-badge {
    margin-left: 0;
  }

  .student-quick-links {
    grid-template-columns: 1fr;
  }

  .top-navbar .btn,
  .top-navbar .profile-btn,
  .top-navbar .theme-toggle {
    width: auto;
  }

  .theme-toggle,
  .mobile-menu-toggle {
    width: 2.75rem;
  }

  .top-navbar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-navbar>.d-flex {
    width: 100%;
  }

  .top-navbar>.d-flex:last-child {
    justify-content: space-between;
  }

  .profile-btn {
    min-width: 2.75rem;
  }

  .react-table-search {
    max-width: none;
  }

  .table-control-main,
  .report-chart-layout {
    grid-template-columns: 1fr;
  }

  .table-sort-direction {
    width: 100%;
  }

  .tenant-page-header,
  .tenant-section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .tenant-page-actions {
    justify-content: stretch;
  }

  .tenant-page-actions .btn,
  .tenant-page-header>.btn {
    width: 100%;
  }

  .learning-card-main,
  .learning-row,
  .progress-overview {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .learning-row {
    flex-direction: column;
  }

  .learning-row-action,
  .learning-row-action .btn,
  .learning-actions .btn {
    width: 100%;
  }

  .progress-overview-status {
    justify-content: flex-start;
  }

  .d-flex.gap-2 {
    flex-direction: column;
  }
}

.datepicker-controls {
  display: flex;
  background: #0c2c42 !important;
}

.sidebar {
  overflow: hidden;
}

.sidebar-menu {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.25rem;
  scrollbar-color: rgba(169, 216, 192, 0.42) transparent;
  scrollbar-width: thin;
}

.sidebar-menu::-webkit-scrollbar {
  width: 0.35rem;
}

.sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(169, 216, 192, 0.36);
  border-radius: 999px;
}

.leirbag-logo,
.navbar-logo {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(47, 127, 145, 0.22);
  display: inline-block;
  flex: 0 0 auto;
  object-fit: contain;
}

.leirbag-logo {
  height: 2.65rem;
  padding: 0.18rem;
  width: 2.65rem;
}

.leirbag-logo-lg {
  height: 3.25rem;
  width: 3.25rem;
}

.navbar-logo {
  height: 2.35rem;
  padding: 0.16rem;
  width: 2.35rem;
}

.btn,
.metric-card,
.list-group-item,
.profile-btn,
.theme-toggle,
.mobile-menu-toggle {
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

.btn:hover,
.metric-card:hover,
.list-group-item:hover,
.profile-btn:hover,
.theme-toggle:hover,
.mobile-menu-toggle:hover {
  transform: translateY(-1px);
}

.btn:active,
.profile-btn:active,
.theme-toggle:active,
.mobile-menu-toggle:active {
  transform: translateY(0) scale(0.98);
}

.table tbody tr {
  transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

.table tbody tr:hover {
  --bs-table-hover-bg: var(--color-soft-cyan);
  box-shadow: inset 3px 0 0 var(--color-brand);
}

.table-control-panel {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
  padding: 0.85rem;
}

.table-control-main {
  align-items: center;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: minmax(7rem, auto) minmax(12rem, 1fr) minmax(11rem, 0.55fr) auto;
}

.react-table-search,
.table-sort-select {
  min-width: 0;
}

.table-sort-direction {
  align-items: center;
  display: inline-flex;
  height: 2rem;
  justify-content: center;
  width: 2.25rem;
}

.table-filter-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
}

.sortable-table thead th.sortable-column {
  cursor: pointer;
  padding-right: 1.6rem;
  position: relative;
  user-select: none;
}

.sortable-table thead th.sortable-column::after {
  color: var(--color-muted);
  content: "\F283";
  font-family: "bootstrap-icons";
  font-size: 0.72rem;
  opacity: 0.38;
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
}

.sortable-table thead th.is-sorted {
  color: var(--color-brand-dark);
}

.sortable-table thead th.is-sorted::after {
  content: "\F145";
  opacity: 1;
}

.sortable-table thead th.is-sorted[data-sort-direction="down"]::after {
  content: "\F124";
}

.report-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
}

.report-chart-panel {
  -webkit-backdrop-filter: var(--app-backdrop-blur);
  backdrop-filter: var(--app-backdrop-blur);
  background:
    var(--premium-sheen),
    var(--premium-control);
  border: 1px solid var(--premium-line);
  border-radius: var(--app-radius);
  box-shadow: var(--premium-shadow-soft);
  min-height: 15.5rem;
  overflow: hidden;
  padding: 1rem;
  position: relative;
}

.report-chart-panel::before {
  background: linear-gradient(90deg, var(--premium-teal), var(--premium-mint));
  content: "";
  height: 2px;
  left: 0;
  opacity: 0.75;
  position: absolute;
  right: 0;
  top: 0;
}

.report-chart-layout {
  align-items: center;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(8.5rem, 0.9fr) minmax(10rem, 1fr);
}

.report-chart-graphic {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 10rem;
}

.report-pie-chart {
  height: min(12rem, 42vw);
  max-height: 12rem;
  max-width: 12rem;
  overflow: visible;
  width: 100%;
}

.report-pie-chart path,
.report-bar span {
  filter: drop-shadow(0 8px 14px rgba(var(--palette-prussian-rgb), 0.12));
  opacity: 0.9;
  transition: opacity 0.18s ease, transform 0.18s ease, filter 0.18s ease;
}

.report-pie-chart path:hover,
.report-pie-chart path.active,
.report-bar:hover span,
.report-bar.active span {
  filter: drop-shadow(0 10px 18px rgba(var(--palette-prussian-rgb), 0.2));
  opacity: 1;
  transform: scale(1.035);
  transform-origin: 60px 60px;
}

.report-pie-hole {
  fill: var(--color-panel-strong);
  stroke: var(--color-line);
}

.report-pie-total {
  fill: var(--color-ink);
  font-size: 0.95rem;
  font-weight: 850;
  text-anchor: middle;
}

.report-pie-label {
  fill: var(--color-muted);
  font-size: 0.45rem;
  font-weight: 700;
  text-anchor: middle;
  text-transform: uppercase;
}

.report-bar-chart {
  align-items: end;
  display: grid;
  gap: 0.55rem;
  grid-auto-flow: column;
  height: 10.5rem;
  width: 100%;
}

.report-bar {
  align-items: end;
  background: rgba(var(--palette-pacific-rgb), 0.1);
  border: 1px solid var(--color-line);
  border-radius: 7px;
  display: flex;
  height: 100%;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

.report-bar span {
  border-radius: 7px 7px 0 0;
  display: block;
  width: 100%;
}

.report-chart-legend {
  display: grid;
  gap: 0.45rem;
}

.report-chart-legend-item {
  align-items: center;
  background: rgba(var(--palette-pacific-rgb), 0.08);
  border: 1px solid var(--color-line);
  border-radius: var(--app-radius);
  color: var(--color-ink);
  display: grid;
  gap: 0.45rem;
  grid-template-columns: auto 1fr auto;
  min-height: 2.25rem;
  padding: 0.4rem 0.55rem;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.report-chart-legend-item:hover,
.report-chart-legend-item.active {
  border-color: rgba(var(--palette-ocean-rgb), 0.38);
  box-shadow: 0 10px 20px rgba(var(--palette-prussian-rgb), 0.1);
  transform: translateY(-1px);
}

.report-chart-swatch {
  border-radius: 999px;
  display: inline-block;
  height: 0.7rem;
  width: 0.7rem;
}

.report-chart-empty {
  align-items: center;
  color: var(--color-muted);
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  min-height: 9rem;
}

.notification-badge {
  align-items: center;
  background: var(--color-danger);
  border: 2px solid var(--color-panel-strong);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 850;
  height: 1.2rem;
  justify-content: center;
  min-width: 1.2rem;
  padding: 0 0.25rem;
  position: absolute;
  right: -0.35rem;
  top: -0.35rem;
}

.notification-badge.pulse {
  animation: notificationPulse 1.4s ease-in-out infinite;
}

.notification-list {
  display: grid;
  gap: 0.4rem;
  max-height: min(24rem, calc(100dvh - 11rem));
  overflow-y: auto;
  padding-right: 0.1rem;
}

.notification-item {
  align-items: flex-start;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  color: var(--color-ink);
  display: grid;
  gap: 0.6rem;
  grid-template-columns: auto 1fr;
  min-width: 0;
  padding: 0.65rem 0.7rem;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.notification-item:hover {
  background: var(--color-soft-cyan);
  border-color: var(--color-line-strong);
  color: var(--color-ink);
  transform: translateX(2px);
}

.notification-copy {
  min-width: 0;
}

.notification-item strong,
.notification-item small,
.notification-time {
  display: block;
}

.notification-item strong {
  font-size: 0.88rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.notification-item small {
  color: var(--color-muted);
  font-size: 0.78rem;
  line-height: 1.35;
  margin-top: 0.15rem;
  overflow-wrap: anywhere;
}

.notification-time {
  color: var(--color-muted);
  font-size: 0.72rem;
  margin-top: 0.25rem;
}

.notification-dot {
  background: var(--color-line-strong);
  border-radius: 999px;
  height: 0.55rem;
  margin-top: 0.4rem;
  width: 0.55rem;
}

.notification-item.unread {
  background: rgba(65, 198, 196, 0.12);
  border-color: rgba(65, 198, 196, 0.34);
}

.notification-item.unread .notification-dot {
  background: var(--premium-teal);
  box-shadow: 0 0 0 0.25rem rgba(65, 198, 196, 0.14);
}

.support-inbox-grid {
  display: grid;
  gap: 0.85rem;
}

.support-conversation-card {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(65, 198, 196, 0.1), rgba(169, 216, 192, 0.05)),
    var(--color-panel-strong);
  border: 1px solid var(--premium-line, var(--color-line));
  border-radius: 0.9rem;
  box-shadow: var(--premium-shadow-soft, var(--shadow-soft));
  color: var(--color-ink);
  display: grid;
  gap: 0.85rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 0.9rem;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

:root[data-theme="dark"] .support-conversation-card {
  background:
    linear-gradient(135deg, rgba(65, 198, 196, 0.12), rgba(255, 255, 255, 0.02)),
    var(--color-panel-strong);
  color: var(--color-ink);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .support-conversation-card {
    background:
      linear-gradient(135deg, rgba(65, 198, 196, 0.12), rgba(255, 255, 255, 0.02)),
      var(--color-panel-strong);
    color: var(--color-ink);
  }
}

.support-conversation-card:hover,
.support-conversation-card:focus-visible {
  border-color: rgba(65, 198, 196, 0.46);
  box-shadow: var(--premium-shadow, var(--shadow-card));
  color: inherit;
  outline: none;
  transform: translateY(-2px);
}

.support-conversation-icon {
  align-items: center;
  background: linear-gradient(135deg, rgba(65, 198, 196, 0.22), rgba(169, 216, 192, 0.2));
  border-radius: 0.75rem;
  color: var(--premium-teal-dark, var(--color-brand-dark));
  display: inline-flex;
  height: 2.75rem;
  justify-content: center;
  width: 2.75rem;
}

.support-conversation-main {
  min-width: 0;
}

.support-conversation-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
}

.support-conversation-title strong {
  color: var(--color-ink);
  font-size: 0.98rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-conversation-title span {
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.support-conversation-meta {
  color: var(--color-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.8rem;
  gap: 0.45rem 0.8rem;
  margin-top: 0.35rem;
}

.support-conversation-meta span {
  align-items: center;
  display: inline-flex;
  gap: 0.3rem;
}

.support-conversation-status {
  text-align: right;
}

.support-chat-shell {
  background: var(--surface-raised);
  border: 1px solid var(--color-line);
  border-radius: var(--app-radius);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 0;
  min-height: min(46rem, 78vh);
  overflow: hidden;
}

.chat-room-bar {
  align-items: center;
  background: linear-gradient(135deg, rgba(15, 92, 72, 0.92), rgba(26, 118, 95, 0.88));
  color: #fff;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.85rem 1rem;
}

.chat-room-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.chat-room-separator {
  color: rgba(255, 255, 255, 0.45) !important;
  display: inline !important;
  margin: 0 0.2rem;
}

.chat-room-bar strong,
.chat-room-bar span {
  display: block;
}

.chat-room-bar strong {
  font-size: 0.98rem;
  line-height: 1.2;
}

.chat-room-bar span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
}

.chat-room-status {
  align-items: center;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  display: inline-flex !important;
  font-weight: 800;
  gap: 0.35rem;
  padding: 0.32rem 0.6rem;
  white-space: nowrap;
}

.support-chat-log {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(0, 0, 0, 0.025) 1px, transparent 1px),
    #eef4ef;
  background-size: 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: none;
  min-height: min(32rem, 58vh);
  overflow-y: auto;
  padding: 1rem;
  scroll-behavior: smooth;
}

.support-chat-message {
  animation: softReveal 0.26s ease both;
  display: flex;
  width: 100%;
}

.support-chat-message.own {
  justify-content: flex-end;
}

.support-chat-message.other {
  justify-content: flex-start;
}

.chat-bubble {
  background: #fff;
  border: 1px solid rgba(20, 33, 28, 0.08);
  border-radius: 0.95rem 0.95rem 0.95rem 0.25rem;
  box-shadow: 0 0.35rem 1rem rgba(22, 43, 35, 0.08);
  max-width: min(78%, 42rem);
  min-width: 10rem;
  padding: 0.58rem 0.68rem 0.38rem;
}

.support-chat-message.own .chat-bubble {
  background: #d9fdd3;
  border-color: rgba(26, 118, 95, 0.14);
  border-radius: 0.95rem 0.95rem 0.25rem 0.95rem;
}

.chat-meta {
  align-items: center;
  color: var(--text-muted);
  display: flex;
  gap: 0.45rem;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.chat-meta strong {
  color: var(--text-main);
  font-size: 0.82rem;
}

.chat-meta span {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.chat-body {
  overflow-wrap: anywhere;
  white-space: normal;
}

.chat-time {
  align-items: center;
  color: var(--text-muted);
  display: flex;
  font-size: 0.72rem;
  gap: 0.25rem;
  justify-content: flex-end;
  margin-top: 0.35rem;
}

.chat-time .bi-check2-all {
  color: #2d8ecf;
  font-size: 0.95rem;
}

.chat-live::before {
  background: #24a36b;
  border-radius: 50%;
  content: "";
  display: inline-block;
  height: 0.5rem;
  margin: 0 0.35rem 0.15rem 0;
  width: 0.5rem;
}

.chat-mention {
  background: rgba(47, 127, 145, 0.16);
  border-radius: 0.35rem;
  color: var(--premium-teal-dark);
  font-weight: 850;
  padding: 0.03rem 0.22rem;
}

.chat-mention-menu {
  background: var(--surface-raised);
  border: 1px solid var(--color-line);
  border-radius: 0.8rem;
  bottom: calc(100% + 0.45rem);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 0.2rem;
  left: 0;
  max-height: 15rem;
  max-width: 24rem;
  min-width: min(20rem, 100%);
  overflow-y: auto;
  padding: 0.35rem;
  position: absolute;
  width: 100%;
  z-index: 20;
}

.chat-mention-menu[hidden] {
  display: none;
}

.chat-mention-option {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0.55rem;
  color: var(--text-main);
  display: grid;
  gap: 0.5rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 0.45rem 0.55rem;
  text-align: left;
}

.chat-mention-option:hover,
.chat-mention-option:focus-visible {
  background: rgba(65, 198, 196, 0.12);
  outline: none;
}

.chat-mention-option span {
  align-items: center;
  background: rgba(65, 198, 196, 0.18);
  border-radius: 50%;
  color: var(--premium-teal-dark);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 850;
  height: 1.8rem;
  justify-content: center;
  width: 1.8rem;
}

.chat-mention-option strong,
.chat-mention-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-mention-option small {
  color: var(--text-muted);
}

.chat-attachment img,
.chat-attachment video {
  border: 1px solid var(--color-line);
  border-radius: 0.7rem;
  display: block;
  max-height: 20rem;
  max-width: min(100%, 30rem);
  object-fit: contain;
}

.chat-attachment audio {
  display: block;
  max-width: 100%;
  min-width: min(22rem, 100%);
}

.chat-attachment {
  max-width: 100%;
  min-width: 0;
}

.chat-attachment .copy-chip {
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-attachment .copy-chip i {
  flex: 0 0 auto;
}

.chat-attachment-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-composer {
  align-items: flex-end;
  background: #f3f5f1;
  border-top: 1px solid rgba(20, 33, 28, 0.08);
  display: grid;
  gap: 0.45rem;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  padding: 0.7rem;
}

.chat-composer:has(select[name="status"]) {
  grid-template-columns: minmax(8rem, 12rem) auto auto minmax(0, 1fr) auto;
}

.chat-composer-field {
  min-width: 0;
  position: relative;
}

.chat-composer textarea {
  border: 0;
  border-radius: 1.35rem;
  box-shadow: inset 0 0 0 1px rgba(20, 33, 28, 0.1);
  min-height: 2.8rem;
  padding: 0.72rem 0.95rem;
  resize: none;
}

.chat-composer input[type="file"] {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.chat-icon-btn,
.chat-attach-btn,
.chat-send-btn {
  align-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  display: inline-flex;
  height: 2.8rem;
  justify-content: center;
  width: 2.8rem;
}

.chat-icon-btn,
.chat-attach-btn {
  background: #fff;
  border: 1px solid rgba(20, 33, 28, 0.08);
  color: #54645d;
  cursor: pointer;
}

.chat-icon-btn {
  padding: 0;
}

.chat-icon-btn:hover,
.chat-attach-btn:hover {
  background: #e9f5ef;
  color: #147455;
}

.chat-emoji-tray {
  background: #fff;
  border: 1px solid rgba(20, 33, 28, 0.1);
  border-radius: 999px;
  box-shadow: 0 0.8rem 2rem rgba(22, 43, 35, 0.16);
  display: flex;
  gap: 0.2rem;
  left: 0.25rem;
  padding: 0.35rem;
  position: absolute;
  bottom: calc(100% + 0.45rem);
  z-index: 25;
}

.chat-emoji-tray[hidden] {
  display: none;
}

.chat-emoji-tray button {
  background: transparent;
  border: 0;
  border-radius: 50%;
  font-size: 1.15rem;
  height: 2rem;
  line-height: 1;
  width: 2rem;
}

.chat-emoji-tray button:hover {
  background: #eef4ef;
}

.chat-attachment-preview {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(20, 33, 28, 0.1);
  border-radius: 0.8rem;
  color: #34423c;
  display: flex;
  font-size: 0.82rem;
  font-weight: 750;
  gap: 0.45rem;
  margin-top: 0.45rem;
  max-width: 100%;
  padding: 0.4rem 0.55rem;
}

.chat-attachment-preview[hidden] {
  display: none;
}

.chat-attachment-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-composer-spacer {
  pointer-events: none;
  visibility: hidden;
}

.chat-composer-hint {
  align-items: center;
  background: var(--color-panel-subtle);
  border-top: 1px solid var(--color-line);
  color: var(--color-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.76rem;
  gap: 0.35rem 1rem;
  justify-content: space-between;
  padding: 0.45rem 0.8rem 0.55rem;
}

@media (max-width: 640px) {
  .chat-bubble {
    max-width: 90%;
  }

  .support-chat-shell {
    border-radius: 0.85rem;
    min-height: 72vh;
  }

  .chat-composer {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    padding: 0.55rem;
  }

  .chat-composer:has(select[name="status"]) {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
  }

  .chat-composer:has(select[name="status"]) .chat-composer-field {
    grid-column: 1 / -2;
    grid-row: 2;
  }

  .chat-composer:has(select[name="status"]) .chat-send-btn {
    grid-column: -2 / -1;
    grid-row: 2;
  }
}

.success-pop {
  animation: successPop 0.65s ease both;
}

/* Individual two-step verification setup */
.security-setup-shell {
  display: grid;
  gap: 1rem;
  margin-inline: auto;
  max-width: 64rem;
}

.security-setup-head,
.security-current-card,
.security-enrollment-card,
.security-method-card,
.security-danger-zone {
  background: var(--surface-raised);
  border: 1px solid var(--color-line);
  border-radius: var(--app-radius);
  box-shadow: var(--shadow-soft);
}

.security-setup-head {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1.25rem;
}

.security-setup-head h1 {
  font-size: clamp(1.55rem, 2.5vw, 2.15rem);
  margin: 0.2rem 0 0.35rem;
}

.security-setup-head p,
.security-current-card p,
.security-method-card p,
.security-enrollment-card p,
.security-switch-note {
  color: var(--color-muted);
  margin: 0;
}

.security-current-card {
  align-items: center;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 1rem;
}

.security-current-card small,
.security-current-card h2,
.security-current-card p {
  display: block;
}

.security-current-card small {
  color: var(--color-muted);
}

.security-current-card h2,
.security-method-card h2,
.security-enrollment-card h2 {
  color: var(--color-ink);
  font-size: 1rem;
  margin: 0.15rem 0 0.2rem;
}

.security-switch-note {
  font-size: 0.82rem;
  padding-inline: 0.2rem;
}

.security-method-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.security-method-card {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 1.15rem;
  text-align: left;
}

.security-method-card > input[type="hidden"] {
  display: none !important;
}

.security-method-card > .security-method-icon {
  grid-column: 1;
  grid-row: 1;
}

.security-method-card > .security-method-copy {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.security-method-card .btn {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: start;
}

.security-method-icon,
.security-step-number {
  align-items: center;
  background: rgba(15, 118, 110, 0.12);
  border-radius: 0.85rem;
  color: #0f766e;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1.2rem;
  height: 3rem;
  justify-content: center;
  width: 3rem;
}

[data-bs-theme="dark"] .security-method-icon,
[data-bs-theme="dark"] .security-step-number {
  color: #5eead4;
}

.security-recommended {
  background: rgba(22, 163, 74, 0.12);
  border-radius: 999px;
  color: #15803d;
  display: inline-flex;
  font-size: 0.7rem;
  font-weight: 800;
  margin-top: 0.65rem;
  padding: 0.3rem 0.55rem;
  text-transform: uppercase;
}

.security-enrollment-card {
  display: grid;
  gap: 1rem;
  padding: 1.2rem;
}

.security-step-copy {
  align-items: flex-start;
  display: flex;
  gap: 0.8rem;
}

.security-authenticator-grid {
  align-items: center;
  background: color-mix(in srgb, var(--surface-raised) 76%, var(--page-bg) 24%);
  border: 1px solid var(--color-line);
  border-radius: 1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 1rem;
}

.security-qr {
  background: #fff;
  border: 0.65rem solid #fff;
  border-radius: 0.8rem;
  height: 12rem;
  width: 12rem;
}

.security-manual-key {
  display: grid;
  gap: 0.55rem;
}

.security-manual-key small,
.security-manual-key span {
  color: var(--color-muted);
  font-size: 0.78rem;
}

.security-manual-key code {
  background: var(--page-bg);
  border: 1px dashed var(--color-line);
  border-radius: 0.65rem;
  color: var(--color-ink);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  overflow-wrap: anywhere;
  padding: 0.7rem;
}

.security-code-form {
  align-items: end;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: minmax(12rem, 1fr) auto;
}

.security-code-form label,
.security-danger-zone label {
  color: var(--color-ink);
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.security-code-form input {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.28em;
}

.security-inline-actions {
  align-items: center;
  display: flex;
  gap: 0.8rem;
}

.security-danger-zone {
  padding: 0.85rem 1rem;
}

.security-danger-zone summary {
  color: var(--color-danger, #b91c1c);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 750;
}

.security-danger-zone form {
  border-top: 1px solid var(--color-line);
  margin-top: 0.8rem;
  padding-top: 0.8rem;
}

.security-danger-zone form>div {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: minmax(12rem, 1fr) auto;
}

@media (max-width: 767.98px) {
  .security-method-grid {
    grid-template-columns: 1fr;
  }

  .security-authenticator-grid {
    grid-template-columns: 1fr;
  }

  .security-qr {
    justify-self: center;
  }
}

@media (max-width: 575.98px) {
  .security-setup-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .security-current-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .security-current-card>.status-badge {
    grid-column: 2;
    justify-self: start;
  }

  .security-code-form,
  .security-danger-zone form>div {
    grid-template-columns: 1fr;
  }

  .security-code-form .btn,
  .security-danger-zone .btn {
    width: 100%;
  }

  .security-qr {
    height: min(12rem, 72vw);
    width: min(12rem, 72vw);
  }
}

.alert-success,
.status-success,
[data-theme] .swal2-success {
  animation: softReveal 0.28s ease both;
}

@keyframes notificationPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(194, 65, 75, 0.42);
  }

  50% {
    box-shadow: 0 0 0 0.35rem rgba(194, 65, 75, 0);
  }
}

@keyframes softReveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes successPop {
  0% {
    transform: scale(1);
  }

  35% {
    box-shadow: 0 0 0 0.28rem rgba(35, 135, 90, 0.18);
    transform: scale(1.035);
  }

  100% {
    transform: scale(1);
  }
}

@media (max-width: 575.98px) {
  body:has(.main-content) .app-main {
    overflow-x: hidden;
  }

  .main-content {
    overflow-x: hidden;
    padding: 0.65rem;
  }

  .top-navbar {
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.5rem;
    justify-content: space-between;
    margin-bottom: 0.65rem;
    min-height: 3.6rem;
    padding: 0.55rem;
  }

  .top-navbar>.d-flex {
    min-width: 0;
    width: auto;
  }

  .top-navbar>.d-flex:first-child {
    flex: 1 1 auto;
    gap: 0.5rem !important;
  }

  .top-navbar>.d-flex:first-child>div {
    min-width: 0;
  }

  .top-navbar>.d-flex:first-child .fw-semibold,
  .top-navbar>.d-flex:first-child small {
    display: block;
    max-width: min(34vw, 9rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-navbar>.d-flex:last-child {
    flex: 0 0 auto;
    gap: 0.35rem !important;
    justify-content: flex-end;
    margin-left: 0 !important;
  }

  .navbar-logo {
    height: 2rem;
    padding: 0.12rem;
    width: 2rem;
  }

  .mobile-menu-toggle,
  .theme-toggle,
  .top-navbar .notification-wrapper>.btn {
    height: 2.35rem;
    min-height: 2.35rem;
    min-width: 2.35rem;
    padding: 0.35rem;
    width: 2.35rem;
  }

  .profile-btn {
    gap: 0;
    height: 2.35rem;
    min-height: 2.35rem;
    min-width: 2.35rem;
    padding: 0.25rem;
    width: 2.35rem;
  }

  .profile-btn .avatar {
    font-size: 0.78rem;
    height: 1.85rem;
    width: 1.85rem;
  }

  .profile-btn>i {
    display: none;
  }

  .notification-panel,
  .profile-menu {
    left: 0.65rem;
    max-width: none;
    min-width: 0;
    position: fixed;
    right: 0.65rem;
    top: 4.35rem;
  }

  .sidebar {
    max-width: 100vw;
    padding: 0.85rem;
    width: 100vw;
  }

  .sidebar-brand {
    margin-bottom: 0.75rem;
    min-height: 2.75rem;
    padding-bottom: 0.75rem;
    padding-right: 2.5rem;
  }

  .sidebar-menu a {
    min-height: 2.6rem;
    padding: 0.62rem 0.75rem;
  }

  .sidebar-close-btn {
    position: absolute;
    right: 0.75rem;
    top: 0.75rem;
    z-index: 2;
  }

  .sidebar-menu {
    gap: 0.4rem;
  }

  .sidebar-group-toggle {
    min-height: 2.55rem;
    padding: 0.62rem 0.75rem;
  }

  .sidebar-submenu {
    gap: 0.2rem;
    padding: 0 0.35rem 0.4rem;
  }

  .sidebar-submenu a {
    min-height: 2.35rem;
    padding: 0.5rem 0.65rem 0.5rem 0.9rem;
  }
}

@media (max-width: 575.98px) {
  .top-navbar {
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
  }

  .top-navbar>.d-flex:first-child {
    min-width: 0;
  }

  .top-navbar>.d-flex:last-child {
    flex-shrink: 0;
    width: auto;
  }

  .search-wrapper {
    display: none !important;
  }

  .sidebar {
    border-radius: 0;
    max-width: 22rem;
    width: min(88vw, 22rem);
  }
}

/* Stable responsive shell overrides for every owner/tenant navbar. */
body:has(.main-content) {
  overflow-x: hidden;
}

.secure-content[data-secure-surface] {
  min-height: 100dvh;
}

.sidebar {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.sidebar-brand {
  flex: 0 0 auto;
  min-width: 0;
}

.sidebar-brand>div,
.sidebar-brand strong,
.sidebar-brand span,
.leirbag-wordmark {
  min-width: 0;
}

.sidebar-brand>div>span,
.sidebar-brand strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-menu {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.45rem;
  max-height: none;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  padding-right: 0.25rem;
  scrollbar-gutter: stable;
  scroll-padding-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
}

.sidebar-group,
.sidebar-submenu {
  flex: 0 0 auto;
  max-height: none;
}

.sidebar-submenu {
  overflow: visible;
}

.sidebar-menu a,
.sidebar-group-toggle,
.sidebar-submenu a {
  flex: 0 0 auto;
  min-width: 0;
}

.sidebar-menu a span,
.sidebar-group-toggle span,
.sidebar-submenu a span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-content {
  min-width: 0;
  width: calc(100% - 17rem);
}

.top-navbar {
  min-width: 0;
  position: sticky;
  top: 1rem;
}

.top-navbar>.d-flex:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.top-navbar>.d-flex:first-child>div {
  min-width: 0;
}

.top-navbar>.d-flex:first-child .fw-semibold,
.top-navbar>.d-flex:first-child small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-navbar>.d-flex:last-child {
  flex: 0 1 auto;
  min-width: 0;
}

.search-wrapper {
  width: clamp(12rem, 24vw, 22rem);
}

.notification-panel,
.profile-menu {
  max-height: min(32rem, calc(100dvh - 6rem));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.notification-panel {
  max-height: min(34rem, calc(100dvh - 6rem));
  overflow: hidden;
}

.notification-panel .notification-list {
  min-height: 0;
}

@media (max-width: 991.98px) {
  .sidebar {
    height: 100dvh;
    width: min(84vw, 22rem);
    z-index: 1300;
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .top-navbar {
    top: 0.75rem;
  }

}

@media (max-width: 575.98px) {
  .main-content {
    padding: 0.6rem;
  }

  .top-navbar {
    gap: 0.45rem;
    min-height: 3.45rem;
    overflow: visible;
    padding: 0.45rem;
    top: 0.6rem;
  }

  .top-navbar>.d-flex:first-child {
    gap: 0.45rem !important;
  }

  .top-navbar>.d-flex:first-child .fw-semibold,
  .top-navbar>.d-flex:first-child small {
    max-width: min(30vw, 8.5rem);
  }

  .top-navbar>.d-flex:last-child {
    gap: 0.3rem !important;
    flex: 0 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 0.15rem;
    scrollbar-width: none;
  }

  .top-navbar>.d-flex:last-child::-webkit-scrollbar {
    display: none;
  }

  .navbar-logo {
    height: 1.9rem;
    width: 1.9rem;
  }

  .mobile-menu-toggle,
  .theme-toggle,
  .app-timezone-badge,
  .top-navbar .notification-wrapper>.btn,
  .profile-btn {
    flex: 0 0 auto;
    height: 2.25rem;
    min-height: 2.25rem;
    min-width: 2.25rem;
    width: 2.25rem;
  }

  .sidebar {
    max-width: 100vw;
    padding: 0.75rem;
    width: min(92vw, 23rem);
  }

  .sidebar-brand {
    margin-bottom: 0.65rem;
    padding-bottom: 0.65rem;
    padding-right: 2.5rem;
  }

  .sidebar-menu {
    gap: 0.35rem;
  }

  .sidebar-menu a,
  .sidebar-group-toggle {
    min-height: 2.45rem;
    padding: 0.55rem 0.65rem;
  }

  .sidebar-submenu a {
    min-height: 2.25rem;
    padding: 0.45rem 0.6rem 0.45rem 0.85rem;
  }

  .notification-panel,
  .profile-menu {
    left: 0.6rem;
    max-height: calc(100dvh - 4.5rem);
    position: fixed;
    right: 0.6rem;
    top: 4.15rem;
  }

  .notification-panel {
    width: auto;
  }

  .notification-panel .notification-list {
    max-height: calc(100dvh - 12rem);
  }
}

@media (max-width: 360px) {

  .top-navbar>.d-flex:first-child .fw-semibold,
  .top-navbar>.d-flex:first-child small {
    max-width: 24vw;
  }

  .navbar-logo {
    display: none;
  }
}

/* Bootstrap offcanvas shell: keep the desktop rail, use native offcanvas below lg. */
.sidebar.offcanvas-lg {
  --bs-offcanvas-bg: transparent;
  --bs-offcanvas-border-width: 0;
  --bs-offcanvas-color: #fff;
  --bs-offcanvas-width: min(88vw, 22rem);
}

.top-navbar {
  align-items: center;
  flex-wrap: wrap;
  height: auto;
  min-height: auto;
  row-gap: 0.65rem;
}

.top-navbar>.d-flex {
  min-width: 0;
}

@media (min-width: 992px) {
  .sidebar.offcanvas-lg {
    transform: none;
    visibility: visible !important;
    width: 17rem;
  }
}

@media (max-width: 991.98px) {
  .offcanvas-backdrop {
    z-index: 1290;
  }

  .sidebar.offcanvas-lg {
    width: var(--bs-offcanvas-width);
  }
}

@media (max-width: 575.98px) {
  .top-navbar {
    flex-wrap: wrap;
    min-height: auto;
  }

  .top-navbar>.d-flex:last-child {
    flex-wrap: wrap;
    overflow-x: visible;
    width: 100%;
  }
}

/* Final mobile hardening pass for tenant and owner portals. */
.chat-bubble,
.chat-body,
.chat-bubble .chat-meta,
.chat-bubble .chat-meta strong,
.chat-bubble .chat-meta span,
.chat-bubble .chat-time,
.chat-attachment-preview,
.chat-composer textarea {
  color: #17231d;
}

.chat-bubble .chat-meta,
.chat-bubble .chat-time {
  color: #5b6a62;
}

.chat-composer textarea::placeholder {
  color: #68776f;
}

.chat-composer textarea {
  background: #fff;
}

@media (max-width: 991.98px) {

  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  img,
  video,
  iframe,
  canvas,
  svg {
    max-width: 100%;
  }

  .main-content,
  .page-content,
  #app,
  .app-panel,
  .glass-card,
  .metric-card,
  .empty-state,
  form:not(.unstyled-form),
  .tenant-list-group,
  .list-group,
  .list-group-item,
  .table-responsive,
  .support-chat-shell {
    min-width: 0;
  }

  .page-content {
    overflow-x: hidden;
  }

  .row {
    --bs-gutter-x: 0.85rem;
  }

  .row>*,
  [class*="col-"] {
    min-width: 0;
  }

  .tenant-page-header,
  .page-content>.d-flex:first-child,
  .tenant-section-title {
    gap: 0.75rem;
  }

  .tenant-page-header>*,
  .page-content>.d-flex:first-child>*,
  .tenant-section-title>* {
    min-width: 0;
  }

  .tenant-page-header h1,
  .tenant-page-header h2,
  .tenant-page-header h3,
  .page-content h1,
  .page-content h2,
  .page-content h3,
  .metric-card,
  .list-group-item,
  .status-badge,
  .copy-chip {
    overflow-wrap: anywhere;
  }

  .table-responsive {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
  }

  .table {
    min-width: max-content;
  }

  .table th,
  .table td {
    max-width: min(18rem, 62vw);
    overflow-wrap: anywhere;
    vertical-align: middle;
  }

  .table-control-main,
  .table-filter-grid,
  .report-chart-layout,
  .assessment-window,
  .learning-card-main,
  .progress-overview {
    grid-template-columns: 1fr;
  }

  .tenant-page-actions,
  .assessment-row-actions,
  .learning-actions,
  .d-flex.flex-wrap {
    min-width: 0;
  }

  .modal-dialog {
    margin-left: 0.75rem;
    margin-right: 0.75rem;
  }
}

@media (max-width: 767.98px) {
  .student-watch-hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .student-watch-hero-media {
    min-height: 12rem;
  }

  .student-watch-hero-copy,
  .student-watch-empty {
    padding: 1rem;
  }

  .student-watch-empty {
    align-items: flex-start;
    flex-direction: column;
  }

  .student-video-rail {
    grid-auto-columns: minmax(11.5rem, 78vw);
  }

  .main-content {
    padding: 0.75rem;
  }

  .page-content,
  .app-panel,
  form:not(.unstyled-form),
  .table-control-panel {
    padding: 0.8rem;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px;
    max-width: 100%;
  }

  input[type="date"],
  input[type="time"],
  input[type="datetime-local"] {
    min-height: 2.75rem;
    width: 100%;
  }

  .table-row-actions {
    display: flex;
    min-width: 10.5rem;
  }

  .tenant-page-header,
  .page-content>.d-flex:first-child,
  .tenant-section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .tenant-page-actions,
  .tenant-page-header>.btn,
  .page-content>.d-flex:first-child>.btn,
  .page-content>.d-flex:first-child>.tenant-page-actions {
    width: 100%;
  }

  .tenant-page-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .metric-card {
    align-items: flex-start;
    gap: 0.75rem;
  }

  .metric-icon {
    height: 2.45rem;
    width: 2.45rem;
  }

  .learning-grid,
  .assessment-grid,
  .student-focus-grid,
  .student-quick-links,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .support-chat-shell {
    border-radius: 8px;
    min-height: calc(100dvh - 10rem);
  }

  .chat-room-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.55rem;
  }

  .chat-room-status {
    white-space: normal;
  }

  .support-chat-log {
    min-height: min(28rem, 52dvh);
    padding: 0.75rem;
  }

  .chat-bubble {
    max-width: 96%;
    min-width: 0;
  }

  .chat-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.1rem;
  }

  .chat-composer {
    align-items: stretch;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    padding: 0.55rem;
  }

  .chat-composer textarea {
    font-size: 16px;
    width: 100%;
  }

  .chat-emoji-tray {
    border-radius: 0.8rem;
    flex-wrap: wrap;
    max-width: calc(100vw - 2rem);
  }
}

@media (max-width: 575.98px) {
  .app-main {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .main-content {
    padding: 0.55rem;
  }

  .page-content {
    padding: 0.65rem;
  }

  .top-navbar {
    margin-bottom: 0.65rem;
  }

  .top-navbar>.d-flex:first-child .fw-semibold,
  .top-navbar>.d-flex:first-child small {
    max-width: 42vw;
  }

  .top-navbar>.d-flex:last-child {
    justify-content: flex-end;
  }

  .app-timezone-badge span {
    display: none;
  }

  .app-timezone-badge {
    height: 2.2rem;
    justify-content: center;
    padding: 0;
    width: 2.2rem;
  }

  .profile-menu,
  .notification-panel {
    max-width: calc(100vw - 1.2rem);
  }

  .tenant-page-header,
  .page-content>.d-flex:first-child {
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
  }

  .tenant-page-actions .btn,
  .tenant-page-header>.btn,
  .page-content>.d-flex:first-child>.btn,
  form:not(.chat-composer) .btn {
    width: 100%;
  }

  .btn-group,
  .btn-toolbar {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .btn-group>.btn,
  .btn-toolbar .btn {
    border-radius: var(--app-radius) !important;
    width: 100%;
  }

  .table th,
  .table td {
    max-width: 72vw;
    padding: 0.6rem 0.65rem;
  }

  .list-group-item.d-flex,
  .learning-row,
  .assessment-row,
  .assessment-card-top,
  .assessment-card-bottom {
    align-items: stretch !important;
    flex-direction: column;
  }

  .list-group-item .btn,
  .learning-row-action .btn,
  .assessment-row-actions .btn {
    width: 100%;
  }

  .support-chat-shell {
    margin-left: -0.15rem;
    margin-right: -0.15rem;
    min-height: calc(100dvh - 8.5rem);
  }

  .support-chat-log {
    min-height: min(30rem, 54dvh);
    padding: 0.55rem;
  }

  .chat-bubble {
    max-width: 100%;
    padding: 0.55rem 0.62rem 0.36rem;
  }

  .chat-composer {
    grid-template-columns: auto auto 1fr auto;
    gap: 0.35rem;
  }

  .chat-icon-btn,
  .chat-attach-btn,
  .chat-send-btn {
    height: 2.45rem;
    width: 2.45rem;
  }

  .chat-composer:has(select[name="status"]) {
    grid-template-columns: 1fr auto auto auto;
  }
}

@media (max-width: 380px) {

  .top-navbar>.d-flex:first-child .fw-semibold,
  .top-navbar>.d-flex:first-child small {
    max-width: 34vw;
  }

  .mobile-menu-toggle,
  .theme-toggle,
  .top-navbar .notification-wrapper>.btn,
  .profile-btn {
    height: 2.1rem;
    min-height: 2.1rem;
    min-width: 2.1rem;
    width: 2.1rem;
  }
}

/* Consolidated UX fixes for shared tenant/owner shell controls. */
.page-search-status {
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 0.35rem;
}

.page-search-empty {
  margin-top: 1rem;
}

.top-navbar__actions {
  align-items: center;
}

@media (max-width: 575.98px) {
  .top-navbar {
    align-items: stretch;
  }

  .top-navbar>.d-flex:last-child,
  .top-navbar__actions {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(2.25rem, auto));
    justify-content: end;
    overflow-x: visible;
    width: 100%;
  }

  .app-timezone-badge {
    width: auto;
    min-width: 2.25rem;
    padding: 0 0.55rem;
  }

  .app-timezone-badge span {
    display: inline;
    max-width: 5.75rem;
  }
}
