/* ---------------------------------------------------------------------------
   Design tokens.
   Every colour the app paints with is a variable, so [data-theme="dark"]
   below can restyle the whole product without any per-page work.
   --------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* brand identity - the same in both themes */
  --navy: #0a1f44;
  --navy-2: #102b59;
  --gold: #d4af37;
  --gold-soft: #f2d77d;
  --gold-deep: #c19d2b;

  /* semantic surfaces */
  --bg: #f7f8fa;
  --surface: #fff;
  --surface-2: #fafbfd;
  --surface-3: #fbfcfe;
  --sidebar-bg: var(--navy);
  --sidebar-link: #bac8df;
  --sidebar-label: #6f83a8;
  --sidebar-footer: #8ea0c0;
  --brand-bg: #fff;
  --brand-sub: #8e7a2a;

  /* text */
  --ink: #17243a;
  --muted: #718096;
  --text-soft: #34445c;
  --text-faint: #7a8799;
  --label: #53627a;

  /* lines and inputs */
  --line: #e5e9f0;
  --line-2: #eef1f5;
  --input-bg: #fff;
  --input-border: #dce3ed;
  --input-placeholder: #98a4b6;
  --chevron: #8a97ab;
  --hover-bg: #f1f5fb;
  --outline-border: #c9d4e3;
  --outline-hover: #eef3fa;

  /* status */
  --success: #198754;
  --warning: #c58a12;
  --danger: #c9363e;
  --info: #2878c8;

  /* badge palettes */
  --badge-green-bg: #e5f5ec;
  --badge-green-fg: #14733e;
  --badge-amber-bg: #fff4d7;
  --badge-amber-fg: #9b710e;
  --badge-red-bg: #fde7e8;
  --badge-red-fg: #b2242e;
  --badge-blue-bg: #e5f1fc;
  --badge-blue-fg: #1d65aa;
  --badge-violet-bg: #ece7fb;
  --badge-violet-fg: #5640b8;
  --badge-teal-bg: #dff3f0;
  --badge-teal-fg: #0f6f68;
  --badge-orange-bg: #fdeadf;
  --badge-orange-fg: #a5511d;

  /* misc */
  --avatar-bg: #dce7f6;
  --avatar-fg: #204a83;
  --timeline-line: #dbe3ee;
  --timeline-icon-bg: #e7eef8;
  --timeline-icon-fg: #2b6db0;
  --dropzone-border: #b9c6d9;
  --dropzone-fg: #7889a1;
  --alert-bg: #fff5db;
  --alert-border: #f1d582;
  --alert-fg: #795d11;
  --alert-hover: #fffaf0;
  --icon-btn: #61708a;
  --action-btn: #6d7c91;
  --chart-grid: #eef1f5;
  --login-grad-1: #e7edf7;
  --login-grad-2: #f7f8fa;
  --login-grad-3: #eef2f7;
  --shadow: 0 8px 24px rgba(20, 38, 70, 0.07);
  --shadow-strong: 0 12px 45px rgba(10, 31, 68, 0.2);
}

/* Dark theme: same navy/gold identity, dark charcoal content area.
   Badge backgrounds become translucent tints of their own hue so the
   existing status colours stay recognisable and legible on dark. */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #12161d;
  --surface: #1a1f28;
  --surface-2: #20262f;
  --surface-3: #171c24;
  --sidebar-bg: #0c1420;
  --sidebar-link: #9fb0c9;
  --sidebar-label: #6b7d99;
  --sidebar-footer: #7f91ad;
  --brand-bg: #0c1420;
  --brand-sub: var(--gold);

  --ink: #e6ebf3;
  --muted: #94a2b8;
  --text-soft: #cdd7e6;
  --text-faint: #8c9bb1;
  --label: #a7b4c8;

  --line: #2b3340;
  --line-2: #252c38;
  --input-bg: #20262f;
  --input-border: #333c4b;
  --input-placeholder: #76839a;
  --chevron: #94a2b8;
  --hover-bg: #262e3a;
  --outline-border: #3a4454;
  --outline-hover: #262e3a;

  --success: #4ac07f;
  --warning: #e0a63a;
  --danger: #ef6b73;
  --info: #5ba3e8;

  --badge-green-bg: rgba(74, 192, 127, 0.16);
  --badge-green-fg: #6fd69b;
  --badge-amber-bg: rgba(224, 166, 58, 0.18);
  --badge-amber-fg: #e7b860;
  --badge-red-bg: rgba(239, 107, 115, 0.18);
  --badge-red-fg: #f28f95;
  --badge-blue-bg: rgba(91, 163, 232, 0.18);
  --badge-blue-fg: #7fbcf2;
  --badge-violet-bg: rgba(146, 122, 240, 0.2);
  --badge-violet-fg: #b0a1f7;
  --badge-teal-bg: rgba(45, 184, 172, 0.18);
  --badge-teal-fg: #5fd3c8;
  --badge-orange-bg: rgba(226, 132, 78, 0.18);
  --badge-orange-fg: #eda071;

  --avatar-bg: #2a3646;
  --avatar-fg: #9ec3f0;
  --timeline-line: #2f3847;
  --timeline-icon-bg: #26303d;
  --timeline-icon-fg: #7fbcf2;
  --dropzone-border: #3a4454;
  --dropzone-fg: #94a2b8;
  --alert-bg: rgba(212, 175, 55, 0.12);
  --alert-border: rgba(212, 175, 55, 0.35);
  --alert-fg: #e2c76b;
  --alert-hover: rgba(212, 175, 55, 0.18);
  --icon-btn: #9fb0c9;
  --action-btn: #94a2b8;
  --chart-grid: #2b3340;
  --login-grad-1: #172130;
  --login-grad-2: #12161d;
  --login-grad-3: #171f2b;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-strong: 0 12px 45px rgba(0, 0, 0, 0.6);
  --brand-fg: #f3f6fb;
  --sidebar-divider: rgba(255, 255, 255, 0.08);
}

/* Bootstrap keeps its own colour variables (headings, body text, buttons).
   Left alone they stay dark-on-dark, so point them at our tokens as well. */
:root[data-theme="dark"] {
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-heading-color: var(--ink);
  --bs-emphasis-color: var(--ink);
  --bs-secondary-color: var(--muted);
  --bs-border-color: var(--line);
}
/* Headings inherit the ink token in both themes (same colour in light). */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--ink);
}
/* Bare .btn wrappers (the user menu) default to Bootstrap's dark text. */
:root[data-theme="dark"] .user-menu .btn,
:root[data-theme="dark"] .btn-close {
  color: var(--ink);
}

/* Bootstrap paints its own light surfaces; point them at our tokens so
   dropdowns, modals, tables, tabs and pagination follow the theme too. */
:root[data-theme="dark"] .dropdown-menu {
  background-color: var(--surface-2);
  border: 1px solid var(--line);
}
:root[data-theme="dark"] .dropdown-item {
  color: var(--text-soft);
}
:root[data-theme="dark"] .dropdown-item:hover,
:root[data-theme="dark"] .dropdown-item:focus {
  background-color: var(--hover-bg);
  color: var(--ink);
}
:root[data-theme="dark"] .modal-content {
  background-color: var(--surface);
  color: var(--ink);
}
:root[data-theme="dark"] .modal-header,
:root[data-theme="dark"] .modal-footer {
  border-color: var(--line);
}
:root[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}
:root[data-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text-soft);
  color: var(--text-soft);
}
:root[data-theme="dark"] .nav-tabs .nav-link {
  color: var(--muted);
}
:root[data-theme="dark"] .nav-tabs .nav-link.active {
  color: var(--ink);
  background: transparent;
}
:root[data-theme="dark"] .pagination .page-link {
  background-color: transparent;
  color: var(--text-soft);
}
:root[data-theme="dark"] .pagination .active .page-link {
  background-color: var(--gold);
  color: #17243a;
}
:root[data-theme="dark"] .pagination .disabled .page-link {
  color: var(--muted);
}
:root[data-theme="dark"] .form-control::placeholder {
  color: var(--input-placeholder);
}
:root[data-theme="dark"] .form-check-input {
  background-color: var(--input-bg);
  border-color: var(--input-border);
}
:root[data-theme="dark"] .form-check-input:checked {
  background-color: var(--gold);
  border-color: var(--gold);
}
:root[data-theme="dark"] .form-select {
  /* Bootstrap's chevron is a dark SVG; lighten it for dark surfaces */
  filter: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a2b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
:root[data-theme="dark"] .text-muted {
  color: var(--muted) !important;
}
:root[data-theme="dark"] .text-dark {
  color: var(--ink) !important;
}
:root[data-theme="dark"] .btn-outline-navy {
  color: var(--ink);
  border-color: var(--outline-border);
}
:root[data-theme="dark"] .btn-outline-navy:hover {
  background: var(--outline-hover);
  color: var(--gold);
}
:root[data-theme="dark"] .input-group-text {
  background-color: var(--surface-2);
  border-color: var(--input-border);
  color: var(--muted);
}
:root[data-theme="dark"] .badge.text-bg-light {
  background-color: var(--surface-2) !important;
  color: var(--text-soft) !important;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
}
.app-shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 260px;
  flex: 0 0 260px;
  background: var(--sidebar-bg);
  color: var(--on-dark, #fff);
  display: flex;
  flex-direction: column;
  transition: 0.25s;
  z-index: 1035;
  /* Pinned to the viewport so every nav item - Settings included, it being the
     last one - stays on screen however far the page scrolls.
     `align-self: flex-start` matters: a flex item is stretched to the row's
     full height by default, which leaves sticky nothing to travel within. */
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
}
.brand {
  height: 82px;
  flex: 0 0 auto;
  background: var(--brand-bg);
  color: var(--brand-fg, var(--navy));
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 24px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.2px;
  /* Nothing in the lockup may escape the sidebar into the page heading, no
     matter what artwork is dropped in later. */
  overflow: hidden;
}
/* Real brand logo. Capped on BOTH axes so the raw 240px file can never lay
   itself over the wordmark; object-fit keeps it undistorted inside the cap. */
.brand-logo {
  width: 40px;
  height: 40px;
  max-width: 40px;
  max-height: 40px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 10px;
}
/* The text half of the lockup: allowed to shrink and clip, never to push the
   logo out of the sidebar. */
.brand > span {
  min-width: 0;
  overflow: hidden;
}
/* The logo file is a white-background JPEG-turned-PNG: it sits invisibly on the
   white brand strip in light mode, so it only needs a plate in dark mode. */
:root[data-theme="dark"] .brand-logo {
  background: #fff;
  padding: 3px;
}
.brand small {
  display: block;
  font-size: 10px;
  color: var(--brand-sub);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-top: 2px;
}
.nav-wrap {
  padding: 24px 14px;
  /* Takes the leftover height and scrolls inside itself, so on a short window
     or at high browser zoom the lower links stay reachable instead of being
     cut off. min-height:0 is required or a flex child refuses to shrink. */
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.nav-wrap::-webkit-scrollbar {
  width: 6px;
}
.nav-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 3px;
}
.nav-label {
  color: var(--sidebar-label);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  padding: 0 14px 10px;
}
.sidebar .nav-link {
  color: var(--sidebar-link);
  padding: 11px 14px;
  border-radius: 10px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: 0.2s;
}
.sidebar .nav-link i {
  width: 18px;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  color: var(--on-dark, #fff);
  background: rgba(212, 175, 55, 0.16);
}
.sidebar .nav-link.active {
  box-shadow: inset 3px 0 var(--gold);
}
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--sidebar-divider, rgba(255, 255, 255, 0.1));
  color: var(--sidebar-footer);
  font-size: 12px;
  flex: 0 0 auto;
}
.main {
  min-width: 0;
  flex: 1;
}
.topbar {
  /* Locked on all three so no child can ever grow the bar. NOTE: deliberately
     no `overflow: hidden` here - the bell and user menus are Bootstrap
     dropdowns rendered inside this bar, and clipping would cut them off.
     Containment is enforced on the banner itself instead. */
  height: 82px;
  min-height: 82px;
  max-height: 82px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 16px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.topbar > .d-flex,
.topbar-actions {
  flex: 0 0 auto;
}
.topbar h1 {
  font-size: 21px;
  margin: 0;
  font-weight: 750;
}
/* Banner lockup in the empty middle of the header. It is height-capped so it can
   never push the 82px header taller, and it shrinks before the title or the
   bell/avatar do. */
.topbar-banner {
  /* Shrinks first, never grows, never wider than a third of the bar, and clips
     its own contents - so the banner cannot reach the title or the bell. */
  flex: 0 1 auto;
  min-width: 0;
  max-width: 34%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
}
.topbar-banner img {
  display: block;
  /* auto + max-* means the 1200x387 source scales DOWN to fit; it is never
     laid out at its native pixel size. */
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 44px;
  object-fit: contain;
}
:root[data-theme="dark"] .topbar-banner img {
  background: #fff;
  padding: 3px 10px;
  border-radius: 10px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.icon-btn {
  border: 0;
  background: transparent;
  color: var(--icon-btn);
  font-size: 17px;
  position: relative;
  padding: 7px;
}
.count {
  position: absolute;
  right: 0;
  top: 0;
  background: var(--danger);
  color: var(--on-dark, #fff);
  border-radius: 20px;
  font-size: 9px;
  padding: 2px 5px;
}
.user-menu {
  display: flex;
  gap: 10px;
  align-items: center;
  border-left: 1px solid var(--line);
  padding-left: 20px;
}
.avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: var(--avatar-bg);
  color: var(--avatar-fg);
  display: grid;
  place-items: center;
  font-weight: 700;
}
.content {
  padding: 28px 32px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.page-head h2 {
  font-size: 22px;
  margin: 0;
  font-weight: 750;
}
.page-head p {
  color: var(--muted);
  margin: 5px 0 0;
}
.card {
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.summary-card {
  padding: 19px 20px;
  position: relative;
  overflow: hidden;
}
.summary-card:after {
  content: "";
  position: absolute;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  right: -28px;
  top: -25px;
  background: rgba(212, 175, 55, 0.11);
}
.summary-card .label {
  color: var(--muted);
  font-size: 12px;
}
.summary-card h3 {
  margin: 7px 0 0;
  font-size: 27px;
}
.summary-icon {
  position: absolute;
  right: 18px;
  bottom: 18px;
  color: var(--gold);
  font-size: 20px;
}
.panel {
  padding: 22px;
}
.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.panel-title h3 {
  font-size: 15px;
  margin: 0;
}
.table {
  margin-bottom: 0;
  vertical-align: middle;
}
.table thead th {
  border-top: 0;
  color: var(--text-faint);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.7px;
  padding: 14px 12px;
  font-weight: 700;
  white-space: nowrap;
}
.table tbody td {
  padding: 14px 12px;
  border-color: var(--line-2);
  color: var(--text-soft);
}
.table tbody tr {
  transition: 0.18s;
}
.table tbody tr:hover {
  background: var(--surface-2);
  transform: translateY(-1px);
}
.badge-status {
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-enrolled,
.badge-completed {
  background: var(--badge-green-bg);
  color: var(--badge-green-fg);
}
.badge-pending {
  background: var(--badge-amber-bg);
  color: var(--badge-amber-fg);
}
.badge-overdue {
  background: var(--badge-red-bg);
  color: var(--badge-red-fg);
}
.badge-upcoming,
.badge-new {
  background: var(--badge-blue-bg);
  color: var(--badge-blue-fg);
}
.pill {
  border-radius: 20px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 650;
}
.pill.red {
  background: var(--badge-red-bg);
  color: var(--badge-red-fg);
}
.pill.blue {
  background: var(--badge-blue-bg);
  color: var(--badge-blue-fg);
}
.btn {
  border-radius: 8px;
  font-weight: 650;
  font-size: 13px;
  padding: 9px 15px;
  transition: 0.2s;
}
.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #142747;
}
.btn-gold:hover {
  background: var(--gold-deep);
  border-color: var(--gold-deep);
  color: var(--on-dark, #fff);
  transform: translateY(-1px);
}
.btn-outline-navy {
  border: 1px solid var(--outline-border);
  color: var(--navy);
}
.btn-outline-navy:hover {
  background: var(--outline-hover);
}
.action-btn {
  border: 0;
  background: transparent;
  color: var(--action-btn);
  padding: 5px;
}
.action-btn:hover {
  color: var(--navy);
}
.form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--label);
  margin-bottom: 6px;
}
.form-control,
.form-select {
  background-color: var(--input-bg);
  color: var(--ink);
  border-color: var(--input-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.14);
}
.filter-bar {
  padding: 17px;
}
.filter-bar .form-control,
.filter-bar .form-select {
  min-width: 120px;
}
.chart-wrap {
  height: 290px;
}
.chart-wrap.small {
  height: 220px;
}
.alert-duplicate {
  background: var(--alert-bg);
  border: 1px solid var(--alert-border);
  border-radius: 10px;
  padding: 12px 15px;
  color: var(--alert-fg);
}
.alert-duplicate .btn-close {
  font-size: 9px;
}
.profile-card {
  padding: 20px;
}
.nav-tabs {
  border-bottom: 1px solid var(--line);
  gap: 10px;
}
.nav-tabs .nav-link {
  border: 0;
  color: var(--muted);
  padding: 12px 14px;
}
.nav-tabs .nav-link.active {
  color: var(--navy);
  font-weight: 750;
  border-bottom: 2px solid var(--gold);
}
.note-card,
.file-card,
.follow-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}
.note-card + .note-card,
.follow-card + .follow-card {
  margin-top: 11px;
}
.dropzone {
  border: 1px dashed var(--dropzone-border);
  border-radius: 11px;
  padding: 28px;
  text-align: center;
  color: var(--dropzone-fg);
  background: var(--surface-3);
}
.timeline {
  position: relative;
  padding-left: 26px;
}
.timeline:before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--timeline-line);
}
.timeline-item {
  position: relative;
  padding: 0 0 22px 16px;
}
.timeline-icon {
  position: absolute;
  left: -26px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--timeline-icon-bg);
  color: var(--timeline-icon-fg);
  display: grid;
  place-items: center;
  font-size: 9px;
  border: 3px solid var(--bg);
}
.timeline-item h6 {
  margin: 0 0 4px;
  font-size: 13px;
}
.timeline-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 10% 20%, var(--login-grad-1), transparent 35%),
    linear-gradient(135deg, var(--bg), var(--login-grad-3));
}
.login-card {
  width: min(430px, calc(100% - 32px));
  padding: 35px;
}
.login-card .brand {
  padding: 0;
  background: transparent;
  height: auto;
  margin-bottom: 28px;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 12px;
}
/* Login is the one screen with no sidebar, so the logo carries the branding. */
.login-card .brand-logo {
  width: 112px;
  height: 112px;
  margin: 0;
  border-radius: 14px;
}
.login-card h1 {
  font-size: 23px;
}
.offcanvas-toggle {
  display: none;
}
.dropdown-menu {
  border: 0;
  box-shadow: var(--shadow);
  border-radius: 10px;
  font-size: 13px;
}
.notification-list {
  width: 290px;
}
.notification-list .dropdown-item {
  white-space: normal;
  padding: 10px 14px;
}
.modal-content {
  border: 0;
  border-radius: 14px;
  box-shadow: 0 12px 45px rgba(10, 31, 68, 0.2);
}
.modal-header {
  border-bottom: 1px solid var(--line);
}
.pagination .page-link {
  border: 0;
  color: var(--navy);
  margin: 0 3px;
  border-radius: 7px;
}
.pagination .active .page-link {
  background: var(--navy);
  color: var(--on-dark, #fff);
}
.stat-positive {
  color: var(--success);
  font-size: 12px;
}
.stat-negative {
  color: var(--danger);
  font-size: 12px;
}
.badge-notpaid {
  background: var(--badge-red-bg);
  color: var(--badge-red-fg);
}
.badge-partial {
  background: var(--badge-amber-bg);
  color: var(--badge-amber-fg);
}
.badge-paid {
  background: var(--badge-green-bg);
  color: var(--badge-green-fg);
}
.badge-registration {
  background: var(--badge-blue-bg);
  color: var(--badge-blue-fg);
}
.badge-application {
  background: var(--badge-violet-bg);
  color: var(--badge-violet-fg);
}
.badge-postoffer {
  background: var(--badge-teal-bg);
  color: var(--badge-teal-fg);
}
.badge-visa {
  background: var(--badge-orange-bg);
  color: var(--badge-orange-fg);
}
.ss {
  position: relative;
}
.ss-toggle {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 10px 32px 10px 12px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  position: relative;
}
.ss-toggle:after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--chevron);
  border-bottom: 2px solid var(--chevron);
  transform: translateY(-70%) rotate(45deg);
}
.ss-toggle.placeholder {
  color: var(--input-placeholder);
}
.ss.open .ss-toggle,
.ss-toggle:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.14);
  outline: 0;
}
.ss-menu {
  display: none;
  position: absolute;
  z-index: 1050;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 210px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 8px;
}
.ss.open .ss-menu {
  display: block;
}
.ss-search {
  width: 100%;
  border: 1px solid var(--input-border);
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 13px;
  margin-bottom: 6px;
}
.ss-search:focus {
  border-color: var(--gold);
  outline: 0;
}
.ss-options {
  max-height: 210px;
  overflow-y: auto;
}
.ss-option {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--text-soft);
}
.ss-option:hover,
.ss-option.active {
  background: var(--hover-bg);
  color: var(--navy);
}
.ss-option[aria-selected="true"] {
  font-weight: 700;
  color: var(--navy);
}
.ss-empty {
  display: none;
  padding: 10px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.ss.no-results .ss-empty {
  display: block;
}
/* Multi-select (lead forms): chosen countries as chips, ticks in the list. */
.ss-multi .ss-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 40px;
  padding-top: 7px;
  padding-bottom: 7px;
  line-height: 1.9;
}
.ss-multi .ss-toggle.placeholder {
  line-height: 1.9;
}
.ss-chip {
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--hover-bg);
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  line-height: 22px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ss-multi-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px 6px;
  font-size: 12px;
  color: var(--muted);
}
.ss-clear,
.ss-done {
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}
.ss-clear:hover,
.ss-done:hover {
  text-decoration: underline;
}
.ss-done {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 8px;
  border-top: 1px solid var(--line);
}
.ss-multi .ss-option {
  position: relative;
  padding-left: 32px;
}
.ss-multi .ss-option:before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 1.5px solid var(--input-border);
  border-radius: 4px;
  background: var(--surface);
}
.ss-multi .ss-option[aria-selected="true"]:before {
  background: var(--gold);
  border-color: var(--gold);
}
.ss-multi .ss-option[aria-selected="true"]:after {
  content: "";
  position: absolute;
  left: 15px;
  top: 50%;
  width: 4px;
  height: 8px;
  margin-top: -6px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}
/* Bootstrap display utilities carry !important, so hidden needs to outrank
   them — the duplicate banner is .d-flex and must stay hidden until it fires. */
[hidden] {
  display: none !important;
}
/* theme toggle in the header */
.theme-toggle {
  border: 1px solid var(--outline-border);
  background: transparent;
  color: var(--icon-btn);
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 14px;
  transition: 0.2s;
}
.theme-toggle:hover {
  background: var(--outline-hover);
  color: var(--navy);
}
:root[data-theme="dark"] .theme-toggle:hover {
  color: var(--gold);
}
/* the icon swaps with the theme */
.theme-toggle .fa-moon {
  display: inline-block;
}
.theme-toggle .fa-sun {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .fa-moon {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .fa-sun {
  display: inline-block;
}

/* settings page */
.settings-section + .settings-section {
  margin-top: 18px;
}
.settings-section .panel-title {
  margin-bottom: 14px;
}
.setting-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.setting-row:first-of-type {
  border-top: 0;
}
.setting-row .setting-label {
  min-width: 0;
  flex: 1 1 260px;
}
.setting-row .setting-label strong {
  display: block;
  font-size: 13px;
}
.setting-row .setting-label small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.setting-row .setting-control {
  flex: 0 0 auto;
  min-width: 170px;
}
.setting-note {
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 12px;
}
.form-switch .form-check-input:checked {
  background-color: var(--gold);
  border-color: var(--gold);
}

.ql-toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 36px));
}
.ql-toast {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--on-dark, #fff);
  box-shadow: 0 12px 30px rgba(10, 31, 68, 0.18);
  opacity: 0;
  transform: translateY(8px);
  transition: 0.25s;
}
.ql-toast.show {
  opacity: 1;
  transform: translateY(0);
}
.ql-toast-danger {
  background: var(--danger);
}
.ql-toast-success {
  background: var(--success);
}
.dropzone.is-dragover {
  border-color: var(--gold);
  background: var(--alert-hover);
}
.followup-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.followup-row + .followup-row {
  margin-top: 10px;
}
.followup-row .meta strong {
  display: block;
}
.followup-row .meta small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.followup-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
/* Below this the header no longer has spare middle space, so the banner steps
   down and then steps out entirely rather than crowding the bell or avatar. */
@media (max-width: 1399px) {
  .topbar-banner {
    max-width: 28%;
  }
  .topbar-banner img {
    max-height: 34px;
  }
}
/* Well above the 768px floor: below this the header has no spare middle space,
   so the banner steps out entirely rather than competing with the title,
   the bell or the avatar. */
@media (max-width: 1199px) {
  .topbar-banner {
    display: none;
  }
}
@media (max-width: 991px) {
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
  }
  .sidebar.show {
    left: 0;
  }
  .offcanvas-toggle {
    display: inline-block;
    border: 0;
    background: transparent;
    font-size: 20px;
    color: var(--navy);
    margin-right: 14px;
  }
  .topbar {
    padding: 0 18px;
  }
  .content {
    padding: 22px 18px;
  }
  .topbar h1 {
    font-size: 18px;
  }
  .user-menu .user-name {
    display: none;
  }
}
@media (max-width: 575px) {
  .content {
    padding: 18px 12px;
  }
  .page-head {
    align-items: flex-start;
    gap: 12px;
  }
  .page-head h2 {
    font-size: 19px;
  }
  .panel {
    padding: 15px;
  }
  .filter-bar .row > div {
    margin-bottom: 10px;
  }
  .topbar-actions {
    gap: 7px;
  }
  .topbar {
    /* all three, or the desktop min/max would fight the mobile height */
    height: 70px;
    min-height: 70px;
    max-height: 70px;
  }
  .summary-card h3 {
    font-size: 23px;
  }
  .table-responsive {
    border-radius: 10px;
  }
  .followup-row {
    align-items: flex-start;
  }
  .followup-actions {
    width: 100%;
  }
}

/* ---------------------------------------------------------------------------
   Lead import (lead-import.php): the four-step indicator and preview table.
   --------------------------------------------------------------------------- */
.import-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
}
.import-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 8px;
  border-radius: 999px;
  border: 1px solid var(--bs-border-color);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.import-steps li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 12px;
}
.import-steps li.active {
  border-color: var(--gold);
  color: var(--bs-body-color);
}
.import-steps li.active span,
.import-steps li.done span {
  background: var(--gold);
  color: #0a1f44;
}
.import-preview-table td,
.import-preview-table th {
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   All Leads: row selection and the Export to Excel window (admin only).
   --------------------------------------------------------------------------- */
.select-col {
  width: 36px;
}
.table tr.is-selected > td {
  background-color: var(--alert-hover, rgba(212, 175, 55, 0.1));
}
.selection-bar {
  display: inline-flex;
  align-items: center;
  padding: 2px 4px 2px 12px;
  border: 1px solid var(--gold);
  border-radius: 999px;
}
.export-scope .form-check {
  display: block;
  padding: 8px 12px 8px 36px;
  margin-bottom: 6px;
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  cursor: pointer;
}
.export-scope .form-check:has(input:checked) {
  border-color: var(--gold);
}
.export-scope .form-check:has(input:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------------------------------------------------------------------------
   Reports: number columns line up on the right, nothing wraps mid-number,
   and a quiet totals row. The table scrolls sideways on a phone rather than
   squeezing its columns.
   --------------------------------------------------------------------------- */
.report-table th,
.report-table td {
  white-space: nowrap;
  vertical-align: middle;
}
/* Names wrap inside a sensible width, so one long name cannot push the
   number columns out of view; figures never wrap. */
.report-table td:first-child {
  white-space: normal;
  overflow-wrap: anywhere;
  min-width: 120px;
  max-width: 240px;
}
.report-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.report-table tfoot td {
  font-weight: 700;
  border-top: 2px solid var(--bs-border-color);
  border-bottom: 0;
}
.export-menu .dropdown-item {
  padding: 9px 16px;
}
/* Page headings wrap onto two lines on narrow screens instead of squeezing
   the action buttons. */
.page-head {
  flex-wrap: wrap;
  gap: 12px;
}
@media (max-width: 575px) {
  .chart-wrap {
    height: 240px;
  }
  /* Phones: each counsellor becomes a compact card — name on top, the five
     figures in a labelled row beneath — so nothing scrolls sideways or hides. */
  .report-table thead {
    display: none;
  }
  .report-table,
  .report-table tbody,
  .report-table tfoot {
    display: block;
    width: 100%;
  }
  .report-table tr {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px 4px;
    padding: 10px 0;
    border-bottom: 1px solid var(--bs-border-color);
  }
  .report-table td,
  .report-table tfoot td {
    display: block;
    padding: 0;
    border: 0;
    text-align: center;
    font-size: 14px;
  }
  .report-table td:first-child {
    grid-column: 1 / -1;
    max-width: none;
    min-width: 0;
    text-align: left;
    margin-bottom: 6px;
  }
  .report-table td.num {
    text-align: center;
  }
  .report-table td.num::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--muted);
  }
  .report-table tfoot tr {
    border-bottom: 0;
    border-top: 2px solid var(--bs-border-color);
  }
  .page-head > .dropdown,
  .page-head > .btn {
    flex-shrink: 0;
  }
}
/* The smallest phones (320px): figures in two rows of three and two, so
   the labels never touch. */
@media (max-width: 359px) {
  .report-table tr {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 8px;
  }
}
