/* Afrikawired RMS — Design System Override (Azia Admin + Brand tokens) */

:root {
  --brand-primary:   #FF6B35;
  --brand-primary-hover: #E85A24;
  --brand-secondary: #1A3C5E;
  --brand-accent:    #F7C59F;
  --sidebar-width:   240px;
  --topbar-height:   60px;
  --topnav-height:   58px;

  /* Elevation scale — layered, soft, cool-biased toward the brand navy */
  --elevation-1: 0 1px 2px rgba(26,60,94,.04), 0 2px 6px rgba(26,60,94,.05);
  --elevation-2: 0 2px 6px rgba(26,60,94,.05), 0 8px 20px rgba(26,60,94,.08);
  --elevation-3: 0 6px 14px rgba(26,60,94,.07), 0 16px 40px rgba(26,60,94,.12);

  --card-shadow:     var(--elevation-1);
  --card-radius:     14px;
  --radius-sm:       9px;
  --radius-lg:       18px;
  --hairline:        rgba(26,60,94,.08);

  /* Motion */
  --duration-fast:   150ms;
  --duration-normal: 250ms;
  --ease-out:        cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & base ──────────────────────────────────────────────────────────── */
body {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #1C2B33;
  background: #F0F2F5;
  background-image: radial-gradient(1200px 400px at 80% -10%, rgba(26,60,94,.045), transparent 60%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand-primary); text-decoration: none; transition: color var(--duration-fast) var(--ease-out); }
a:hover { color: #d9551f; }

/* Visible keyboard focus everywhere, without rings for mouse users */
:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

/* ── Layout shell ──────────────────────────────────────────────────────────── */
.rms-shell { min-height: 100vh; }

/* ── Top navigation bar ────────────────────────────────────────────────────── */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topnav-height);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  border-bottom: 1px solid #E6E9EE;
  z-index: 300;
}
.topnav-inner {
  height: 100%;
  max-width: 1640px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.topnav-brand {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; margin-right: 12px; flex-shrink: 0;
}
.topnav-brand .brand-diamond { color: var(--brand-primary); font-size: 18px; line-height: 1; }
.topnav-brand .brand-name { font-weight: 800; font-size: 16px; color: var(--brand-secondary); letter-spacing: -.02em; }
.topnav-brand .brand-badge {
  font-size: 9px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  background: var(--brand-primary); color: #fff; border-radius: 4px; padding: 2px 5px;
}

/* horizontal menu */
.topnav-menu { display: flex; align-items: center; gap: 2px; }
.nav-group { position: relative; }
.topnav-link {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 0; cursor: pointer; font-family: inherit;
  font-size: 13.5px; font-weight: 600; color: #56626E;
  padding: 8px 12px; border-radius: 8px; line-height: 1.2;
  white-space: nowrap; text-decoration: none; position: relative;
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.topnav-link:hover { background: #F1F3F6; color: var(--brand-secondary); text-decoration: none; }
.topnav-link.dropdown-toggle::after { margin-left: 1px; opacity: .5; vertical-align: 1px; }
.topnav-link.active { color: var(--brand-secondary); }
.topnav-link.active::before {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  background: var(--brand-primary); border-radius: 2px;
}

/* dropdown panels */
.topnav .dropdown-menu {
  border: 1px solid #E6E9EE; border-radius: 12px; padding: 6px;
  box-shadow: var(--elevation-3); margin-top: 8px; min-width: 236px; font-size: 13.5px;
}
.topnav .dropdown-item.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; color: #3B4650; font-weight: 500; white-space: nowrap;
}
.topnav .dropdown-item.nav-item i { width: 16px; text-align: center; color: #8A97A4; font-size: 13px; }
.topnav .dropdown-item.nav-item:hover { background: #F1F3F6; color: var(--brand-secondary); }
.topnav .dropdown-item.nav-item:hover i { color: var(--brand-secondary); }
.topnav .dropdown-item.nav-item.active { background: rgba(255,107,53,.10); color: var(--brand-primary-hover); font-weight: 600; }
.topnav .dropdown-item.nav-item.active i { color: var(--brand-primary); }

/* right-aligned utilities */
.topnav-utils { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.util-btn {
  position: relative; width: 38px; height: 38px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer; color: #56626E; font-size: 16px; text-decoration: none;
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.util-btn:hover { background: #F1F3F6; color: var(--brand-secondary); }
.util-badge {
  position: absolute; top: 5px; right: 5px; min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: 999px; background: var(--brand-primary); color: #fff;
  font-size: 9px; font-weight: 700; line-height: 15px; text-align: center;
}

/* profile / avatar */
.user-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 0; cursor: pointer; padding: 3px 6px 3px 4px; border-radius: 999px;
  transition: background var(--duration-fast) var(--ease-out);
}
.user-badge:hover { background: #F1F3F6; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-primary), #ff8f5e);
  box-shadow: 0 2px 6px rgba(255,107,53,.35); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.user-meta { flex-direction: column; align-items: flex-start; line-height: 1.15; }
.user-name { font-size: 13px; font-weight: 600; color: #1C2B33; }
.user-role { font-size: 11px; color: #6c757d; text-transform: capitalize; }
.user-caret { font-size: 10px; color: #adb5bd; }

/* find-a-page search */
.search-menu { padding: 8px; min-width: 288px; }
.search-box { position: relative; }
.search-box > i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #8A97A4; font-size: 13px; }
.search-box input { padding-left: 32px; }
.search-results { list-style: none; margin: 8px 0 0; padding: 0; max-height: 320px; overflow-y: auto; }
.search-results li a { display: block; padding: 8px 10px; border-radius: 8px; color: #3B4650; font-size: 13.5px; text-decoration: none; }
.search-results li.active a, .search-results li a:hover { background: #F1F3F6; color: var(--brand-secondary); }
.search-results li.empty { padding: 10px; color: #8A97A4; font-size: 13px; }

/* mobile burger + scrim (hidden on desktop) */
.topnav-burger {
  display: none; background: none; border: 0; cursor: pointer;
  width: 40px; height: 40px; border-radius: 9px; color: #3B4650; font-size: 18px;
  align-items: center; justify-content: center; margin-right: 2px;
}
.topnav-burger:hover { background: #F1F3F6; }
.nav-scrim { position: fixed; inset: 0; top: var(--topnav-height); background: rgba(16,24,40,.42); z-index: 205; }

/* ── Main content ──────────────────────────────────────────────────────────── */
.main-content {
  margin-top: var(--topnav-height);
  padding: 24px;
  min-width: 0;
  animation: page-enter var(--duration-normal) var(--ease-out);
}
@keyframes page-enter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-secondary);
  margin: 0;
  letter-spacing: -.02em;
}
.breadcrumb { font-size: 12px; color: #6c757d; margin: 4px 0 0; }
.breadcrumb a { color: var(--brand-primary); }

/* ── Page toolbar: filter controls (grouped) + action buttons (grouped) ─────── */
.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: #f6f7f9;
  border: 1px solid #e7eaee;
  border-radius: 10px;
  padding: 6px 8px;
}
.toolbar-filters .form-select,
.toolbar-filters .form-control { border-color: #dfe3e8; }
.toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;   /* keep actions right-aligned / together when the row wraps */
}
/* Connected look when actions are wrapped in a Bootstrap .btn-group */
.toolbar-actions .btn { white-space: nowrap; }
@media (max-width: 575.98px) {
  .page-header { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-toolbar { width: 100%; }
  .toolbar-filters { width: 100%; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions .btn { flex: 1 1 0; }
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(16,24,40,.04);
  transition: box-shadow var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}
.card:hover { box-shadow: var(--elevation-2); }
.card-header {
  background: none;
  border-bottom: 1px solid #F0F2F5;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 14px;
  color: var(--brand-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body { padding: 20px; }

/* ── KPI Cards ──────────────────────────────────────────────────────────────── */
.kpi-card { overflow: hidden; position: relative; }
.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--brand-primary);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--elevation-3); }
.kpi-card:hover::before { opacity: 1; }
.kpi-card .card-body {
  display: flex;
  align-items: center;
  gap: 16px;
}
.kpi-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,107,53,.14), rgba(255,107,53,.06));
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: var(--brand-primary);
  flex-shrink: 0;
}
.kpi-icon.blue  { background: linear-gradient(135deg, rgba(26,60,94,.14),  rgba(26,60,94,.06));  color: var(--brand-secondary); }
.kpi-icon.green { background: linear-gradient(135deg, rgba(40,167,69,.14), rgba(40,167,69,.06)); color: #28A745; }
.kpi-icon.teal  { background: linear-gradient(135deg, rgba(23,162,184,.14),rgba(23,162,184,.06));color: #17A2B8; }
.kpi-label { font-size: 12px; color: #6c757d; margin: 0 0 4px; font-weight: 500; }
.kpi-value {
  font-size: 26px; font-weight: 700; color: var(--brand-secondary);
  margin: 0; line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.kpi-delta { font-size: 11px; margin-top: 4px; }
.kpi-delta.up   { color: #28A745; }
.kpi-delta.down { color: #DC3545; }

/* ── Tables ─────────────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: 0 0 var(--card-radius) var(--card-radius); }
.table { font-size: 13px; }
.table thead th {
  background: #F8F9FA;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #495057;
  border-bottom: 2px solid #E9ECEF;
  padding: 10px 12px;
  white-space: nowrap;
}
.table tbody td {
  padding: 10px 12px; vertical-align: middle; border-color: #F0F2F5;
  font-variant-numeric: tabular-nums;
}
.table tbody tr { transition: background var(--duration-fast) var(--ease-out); }
.table tbody tr:hover { background: rgba(26,60,94,.03); }

/* Rate cells */
.rate-cell { font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.rate-overridden { background: rgba(255,193,7,.12); border-left: 2px solid #FFC107; }
.rate-published  { background: rgba(40,167,69,.08); color: #28A745; }
.rate-blocked    { background: rgba(220,53,69,.08); color: #DC3545; }

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge-role {
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 4px;
  text-transform: capitalize;
}
.badge-role.system_admin    { background: rgba(220,53,69,.1);  color: #DC3545; }
.badge-role.revenue_manager { background: rgba(255,107,53,.1); color: var(--brand-primary); }
.badge-role.hotel_manager   { background: rgba(26,60,94,.1);   color: var(--brand-secondary); }
.badge-role.analyst         { background: rgba(23,162,184,.1); color: #17A2B8; }

/* ── Audit log feed ─────────────────────────────────────────────────────────── */
.audit-feed { list-style: none; padding: 0; margin: 0; }
.audit-feed li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid #F0F2F5;
  font-size: 12px;
}
.audit-feed li:last-child { border-bottom: none; }
.audit-dot {
  width: 8px; height: 8px; border-radius: 50%;
  margin-top: 4px; flex-shrink: 0;
  background: #CED4DA;
}
.audit-dot.success { background: #28A745; box-shadow: 0 0 0 3px rgba(40,167,69,.12); }
.audit-dot.failure { background: #DC3545; box-shadow: 0 0 0 3px rgba(220,53,69,.12); }
.audit-dot.warning { background: #FFC107; box-shadow: 0 0 0 3px rgba(255,193,7,.15); }
.audit-action { font-weight: 600; color: #1C2B33; }
.audit-meta   { color: #6c757d; margin-top: 2px; }

/* ── Upload dropzone ─────────────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed #CED4DA;
  border-radius: var(--card-radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--duration-normal) var(--ease-out),
              background var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--brand-primary);
  background: rgba(255,107,53,.03);
}
.drop-zone.drag-over { transform: scale(1.01); }
.drop-zone .drop-icon {
  font-size: 48px; color: #CED4DA; margin-bottom: 12px;
  transition: color var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}
.drop-zone:hover .drop-icon { transform: translateY(-3px); }
.drop-zone.drag-over .drop-icon { color: var(--brand-primary); }

/* ── Charts ──────────────────────────────────────────────────────────────────── */
.chart-container { position: relative; }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn { transition: background var(--duration-fast) var(--ease-out),
                   border-color var(--duration-fast) var(--ease-out),
                   box-shadow var(--duration-fast) var(--ease-out),
                   transform var(--duration-fast) var(--ease-out); }
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--brand-secondary);
  border-color: var(--brand-secondary);
  color: #fff;
}
.btn-primary:hover {
  background: #16334f;
  border-color: #16334f;
  color: #fff;
  box-shadow: 0 3px 10px rgba(26,60,94,.3);
}
.btn-brand {
  background: linear-gradient(180deg, var(--brand-primary), var(--brand-primary-hover));
  border-color: var(--brand-primary-hover);
  color: #fff;
  font-weight: 600;
}
.btn-brand:hover {
  background: linear-gradient(180deg, var(--brand-primary-hover), #d9551f);
  border-color: #d9551f;
  color: #fff;
  box-shadow: 0 3px 10px rgba(255,107,53,.35);
}
.btn-brand:focus, .btn-brand:active { color: #fff; }

/* ── Login page ─────────────────────────────────────────────────────────────── */
.login-shell {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--brand-secondary) 0%, #0f2438 100%);
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.login-shell::before,
.login-shell::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}
.login-shell::before {
  width: 480px; height: 480px;
  background: rgba(255,107,53,.16);
  top: -160px; right: -120px;
}
.login-shell::after {
  width: 420px; height: 420px;
  background: rgba(23,162,184,.10);
  bottom: -160px; left: -120px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25), 0 24px 64px rgba(0,0,0,.2);
  padding: 40px;
  position: relative;
  z-index: 1;
  animation: login-enter .45s var(--ease-out);
}
@keyframes login-enter {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .brand { font-size: 22px; font-weight: 700; color: var(--brand-secondary); letter-spacing: -.02em; }
.login-logo .sub   { font-size: 12px; color: #6c757d; margin-top: 4px; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */

/* Below xl (≤ 1199px): the horizontal menu collapses into a burger drawer.
   The full 8-group bar needs ~1150px to lay out without overflowing, so the
   drawer is kept until there is room for the horizontal nav. */
@media (max-width: 1199.98px) {
  .topnav-burger { display: inline-flex; }

  /* Menu becomes a left slide-in drawer below the header. Height is set
     explicitly (not bottom:0) because .topnav's backdrop-filter establishes a
     containing block, so a fixed child can't stretch to the viewport bottom. */
  .topnav-menu {
    position: fixed;
    top: var(--topnav-height); left: 0;
    height: calc(100vh - var(--topnav-height));
    width: 280px; max-width: 84vw;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: #fff;
    border-right: 1px solid #E6E9EE;
    box-shadow: 4px 0 24px rgba(16,24,40,.12);
    padding: 10px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform var(--duration-normal) var(--ease-out);
    z-index: 210;
  }
  body.nav-open .topnav-menu { transform: translateX(0); }

  /* Top-level links / group toggles become full-width rows. */
  .topnav-menu > .topnav-link { width: 100%; justify-content: flex-start; padding: 10px 12px; border-radius: 8px; }
  .topnav-link.active::before { display: none; }
  .topnav-menu > .topnav-link.active { background: rgba(255,107,53,.10); color: var(--brand-primary-hover); }
  .nav-group { width: 100%; }
  .nav-group .topnav-link { width: 100%; justify-content: space-between; }

  /* Expand every menu-group dropdown inline — no floating menus inside the
     drawer. Scoped to .topnav-menu so the utility dropdowns (search / profile)
     in .topnav-utils keep their normal click-to-open behaviour. */
  .topnav-menu .dropdown-menu {
    position: static !important;
    display: block !important;
    transform: none !important;
    border: 0; box-shadow: none; padding: 2px 0 6px 8px;
    margin: 0 0 2px; min-width: 0;
  }
  .topnav-menu .topnav-link.dropdown-toggle::after { display: none; }
  .topnav-menu .topnav-link.dropdown-toggle { pointer-events: none; color: #8A97A4; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; padding-bottom: 2px; }
}

/* Desktop (≥ xl): horizontal bar, no drawer scrim needed. */
@media (min-width: 1200px) {
  .nav-scrim { display: none !important; }
  body.nav-open { overflow: auto; }
}

/* ── Stat pill ────────────────────────────────────────────────────────────────  */
.stat-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px;
  font-variant-numeric: tabular-nums;
}
.stat-pill.up   { background: rgba(40,167,69,.1);  color: #28A745; }
.stat-pill.down { background: rgba(220,53,69,.1);  color: #DC3545; }
.stat-pill.flat { background: rgba(108,117,125,.1);color: #6c757d; }

/* ── Loading skeleton ──────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-load 1.4s infinite;
  border-radius: 4px;
  display: inline-block;
}
@keyframes skeleton-load {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Empty states ───────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #6c757d;
}
.empty-state i { font-size: 48px; margin-bottom: 12px; color: #CED4DA; display: block; }
.empty-state p { margin: 0; font-size: 13px; }

/* ── Reduced motion ─────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Modernization layer (v2) — contemporary typographic + surface refinements.
   Token-driven so it propagates app-wide without touching page templates.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Typography: calmer rhythm + Inter's refined figures/alternates */
body {
  font-size: 14.25px;
  line-height: 1.55;
  letter-spacing: -0.006em;
  font-feature-settings: "cv05" 1, "cv08" 1, "ss01" 1, "tnum" 1;
  background: #EEF1F5;
  background-image:
    radial-gradient(1100px 420px at 82% -12%, rgba(26,60,94,.05), transparent 60%),
    radial-gradient(900px 380px at -5% 0%, rgba(255,107,53,.035), transparent 55%);
}
h1, h2, h3, h4, .kpi-value { letter-spacing: -0.02em; }

/* Cards: crisper hairline, softer float, calmer headers */
.card { border: 1px solid var(--hairline); }
.card:hover { transform: translateY(-1px); }
.card-header {
  padding: 15px 20px;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  border-bottom-color: var(--hairline);
}
.kpi-icon { border-radius: 13px; }

/* Tables: quieter, more modern column heads */
.table thead th {
  background: #F6F8FA;
  font-size: 10.5px;
  letter-spacing: .4px;
  color: #667085;
  border-bottom: 1px solid var(--hairline);
}
.table tbody td { border-color: rgba(26,60,94,.05); }
.table tbody tr:hover { background: rgba(26,60,94,.035); }

/* Form controls: consistent radius + a soft brand focus ring */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: #dfe4ea;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(255,107,53,.14);
}
.toolbar-filters { border-radius: var(--radius-sm); border-color: var(--hairline); }

/* Buttons: unified radius, medium weight, gentle lift on hover */
.btn { border-radius: var(--radius-sm); font-weight: 500; }
.btn-sm { border-radius: 8px; }
.btn-primary:hover, .btn-brand:hover { transform: translateY(-1px); }

/* Badges: softer corners */
.badge { border-radius: 7px; letter-spacing: .1px; }

/* Modern, unobtrusive scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(26,60,94,.22) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: rgba(26,60,94,.20);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(26,60,94,.34); background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ═══════════════════════════════════════════════════════════════════════════
   Page hero + section rhythm — reusable across dashboards/report pages.
   ═══════════════════════════════════════════════════════════════════════════ */
.page-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #1F4568 0%, #16324c 55%, #0e253a 100%);
  border-radius: var(--radius-lg);
  padding: 22px 26px; margin-bottom: 24px; color: #fff;
  box-shadow: var(--elevation-2);
}
.page-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(620px 220px at 92% -30%, rgba(255,107,53,.30), transparent 62%);
}
.page-hero-top { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.page-hero h1 { color: #fff; margin: 0; }
.page-hero-sub { color: rgba(255,255,255,.72); font-size: 12.5px; margin-top: 5px; }
.page-hero-controls { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.hero-range-label { color: rgba(255,255,255,.72); font-size: 12px; }
.page-hero .form-select { border-color: rgba(255,255,255,.24); }
.page-hero .btn-outline-secondary {
  background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.20); color: rgba(255,255,255,.86);
}
.page-hero .btn-outline-secondary:hover { background: rgba(255,255,255,.18); color: #fff; }
.btn-hero { background: #fff; border: 1px solid #fff; color: var(--brand-secondary); font-weight: 600; }
.btn-hero:hover { background: #eef1f5; color: var(--brand-secondary); }

.section-eyebrow {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: #8794a3; margin: 0 2px 12px; display: flex; align-items: center; gap: 10px;
}
.section-eyebrow::after { content: ''; flex: 1; height: 1px; background: var(--hairline); }

/* ═══════════════════════════════════════════════════════════════════════════
   Universal masthead — promote every legacy .page-header to the hero band so
   all pages share one masthead without per-template edits. Controls are
   restyled to read on the dark gradient.
   ═══════════════════════════════════════════════════════════════════════════ */
.page-header {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #1F4568 0%, #16324c 55%, #0e253a 100%);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--elevation-2);
  align-items: center;
}
.page-header::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(620px 220px at 92% -30%, rgba(255,107,53,.28), transparent 62%);
}
.page-header > * { position: relative; z-index: 1; }
.page-header h1 { color: #fff; }
.page-header .breadcrumb { color: rgba(255,255,255,.72); }
.page-header .breadcrumb a { color: #fff; }
.page-header .text-muted { color: rgba(255,255,255,.68) !important; }
.page-header .toolbar-filters { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.18); }
.page-header .btn-primary { background: #fff; border-color: #fff; color: var(--brand-secondary); }
.page-header .btn-primary:hover { background: #eef1f5; border-color: #eef1f5; color: var(--brand-secondary); box-shadow: none; }
.page-header .btn-outline-secondary,
.page-header .btn-outline-primary {
  background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.22); color: rgba(255,255,255,.88);
}
.page-header .btn-outline-secondary:hover,
.page-header .btn-outline-primary:hover { background: rgba(255,255,255,.18); color: #fff; }
.page-header .form-select, .page-header .form-control { border-color: rgba(255,255,255,.24); }
@media (max-width: 575.98px) { .page-header { align-items: stretch; } }

/* ═══════════════════════════════════════════════════════════════════════════
   Responsive hardening — phone / tablet / desktop.
   Global, token-driven rules so every page adapts without per-template edits.
   ═══════════════════════════════════════════════════════════════════════════ */

/* 1) Wide tables & wide content must SCROLL inside their card, never be clipped
      by body{overflow-x:hidden}. Covers the app's full-bleed table convention
      (.card-body.p-0 > table), DataTables, and any table sitting in a card. */
.table-wrapper,
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.card-body.p-0 { overflow-x: auto; }
.card-body:has(> table),
.card-body:has(> .dataTables_wrapper) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dataTables_wrapper { overflow-x: auto; }
pre { overflow-x: auto; max-width: 100%; }
img, canvas, svg, video { max-width: 100%; }

/* 2) Progressive gutters — 24px desktop pad is too much on small screens. */
@media (max-width: 991.98px) { .main-content { padding: 18px; } }
@media (max-width: 767.98px) {
  .main-content { padding: 14px 12px; }
  .card-body { padding: 16px; }
  /* Let masthead + ad-hoc header control clusters wrap instead of overflowing. */
  .page-header, .page-hero-top, .page-hero-controls { flex-wrap: wrap; }
}
@media (max-width: 575.98px) {
  .main-content { padding: 12px 10px; }
  .card-body { padding: 13px; }
  .card-header { padding: 12px 14px; font-size: 13px; }
}

/* 3) Scale the masthead + KPI tiles down on phones so they don't dominate. */
/* KPI value must wrap/shrink inside its card, never be clipped by the card's
   overflow:hidden — long currency figures (e.g. ZAR 1,146,840) on narrow tiles. */
.kpi-card .card-body { min-width: 0; }
.kpi-content { min-width: 0; }
.kpi-value { overflow-wrap: anywhere; }
@media (max-width: 575.98px) {
  .page-header, .page-hero { padding: 15px 16px; border-radius: 14px; margin-bottom: 16px; }
  .page-header h1, .page-hero h1 { font-size: 18px; }
  .breadcrumb, .page-hero-sub { font-size: 11.5px; }
  .kpi-card .card-body { gap: 12px; padding: 14px; }
  .kpi-icon { width: 44px; height: 44px; font-size: 18px; border-radius: 11px; }
  .kpi-value { font-size: 18px; }
  .kpi-label { font-size: 11px; }
}
@media (max-width: 400px) {
  .kpi-value { font-size: 16.5px; }
  .kpi-card .card-body { gap: 10px; padding: 12px; }
  .kpi-icon { width: 40px; height: 40px; font-size: 16px; }
}

/* 4) Header/toolbar controls become full-width and finger-friendly on phones. */
@media (max-width: 575.98px) {
  .page-header > *, .page-hero-top > *, .page-hero-controls > * { min-width: 0; }
  .page-header .d-flex, .page-hero-controls { width: 100%; }
  .page-header .form-select, .page-header .form-control,
  .toolbar-filters .form-select, .toolbar-filters .form-control { flex: 1 1 150px; min-width: 0; }
  /* DataTables search/length controls: left-align and fit the width. */
  div.dataTables_filter, div.dataTables_length { text-align: left !important; float: none !important; }
  div.dataTables_filter input { width: 150px; }
}

/* 5) Tap targets: keep interactive controls comfortably sized on touch screens. */
@media (max-width: 767.98px) and (pointer: coarse) {
  .btn-sm, .form-select-sm, .form-control-sm { min-height: 38px; }
  .util-btn { width: 42px; height: 42px; }
}
