/* Aerios component patterns — reusable across pages.
   Refine here as patterns recur in page prototypes. */

/* ── INLINE-SVG ICON SYSTEM ──────────────────────────────────
   Default 16×16; stroke uses currentColor so icons inherit text color.
   Size via class (.icon-sm/md/lg/xl) or context selectors. */
.icon {
  display: inline-block;
  width: 16px; height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
  flex-shrink: 0;
}
.icon-sm { width: 14px; height: 14px; }
.icon-md { width: 18px; height: 18px; }
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 40px; height: 40px; stroke-width: 1.5; }
/* Solid-fill child shapes (e.g., circle-dot's inner pip). */
.icon [data-fill="current"] { fill: currentColor; stroke: none; }

/* ── NAV ─────────────────────────────────────────────────── */
.nav {
  background: var(--primary); padding: 0 0 0 20px;
  display: flex; align-items: center; height: 48px;
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.nav-logo {
  display: flex; align-items: center;
  padding-right: 18px; border-right: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}
.nav-logo-mark {
  height: 18px; width: auto; display: block;
}

/* App launcher trigger (4-dot grid) */
.nav-app { margin-left: 12px; }
.nav-app-trigger {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; background: transparent; border: 0; border-radius: 6px;
  cursor: pointer;
  transition: background var(--tr);
}
.nav-app-trigger:hover,
.nav-app-trigger.active { background: rgba(255, 255, 255, 0.12); }
.nav-app-trigger .icon { width: 18px; height: 18px; }

/* Active module label */
.nav-current {
  margin-left: 14px;
  color: #fff; font-size: var(--fs-md); font-weight: 500;
  white-space: nowrap;
}

/* Right-side cluster */
.nav-cluster {
  margin-left: auto;
  display: flex; align-items: center; gap: 14px;
  padding-right: 20px;
  color: #fff;
}

/* Mode switch (iOS-style; placeholder behavior) */
.nav-switch {
  position: relative; display: inline-block;
  width: 36px; height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-switch input {
  position: absolute; width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}
.nav-switch-track {
  position: absolute; inset: 0;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 100px;
  transition: background var(--tr);
}
.nav-switch-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform var(--tr);
}
.nav-switch input:checked ~ .nav-switch-track { background: var(--accent); }
.nav-switch input:checked ~ .nav-switch-track .nav-switch-thumb { transform: translateX(16px); }

/* IST | UTC segmented pill */
.nav-tz {
  display: inline-flex; align-items: stretch;
  height: 26px; padding: 2px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 6px;
}
.nav-tz-seg {
  padding: 0 10px;
  background: transparent; border: 0; border-radius: 4px;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font); font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all var(--tr);
}
.nav-tz-seg:hover { color: #fff; }
.nav-tz-seg.is-active {
  background: #fff; color: var(--primary);
}

/* Live clock */
.nav-clock {
  font-size: var(--fs-sm); color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.nav-clock strong { color: #fff; font-weight: 600; }

/* Notifications bell */
.nav-bell {
  position: relative;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: 6px;
  color: rgba(255, 255, 255, 0.85); cursor: pointer;
  transition: background var(--tr), color var(--tr);
}
.nav-bell:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.nav-bell .icon { width: 18px; height: 18px; }
.nav-bell.has-unread::after {
  content: ''; position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #ef4444; border: 2px solid var(--primary);
}

/* Avatar — refresh */
.nav-avatar {
  width: 30px; height: 30px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs); font-weight: 600;
  border-radius: 6px;
  cursor: pointer; flex-shrink: 0;
}
.nav-avatar:hover { filter: brightness(1.1); }

/* App launcher dropdown — extends .dropdown-menu */
.app-launcher-menu {
  min-width: 280px;
  padding: 6px;
}
.app-launcher-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  color: var(--text-primary); text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--tr), color var(--tr);
}
.app-launcher-item:hover {
  background: var(--accent-light); color: var(--primary);
}
.app-launcher-item .icon {
  width: 18px; height: 18px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.app-launcher-item:hover .icon { color: var(--accent); }
.app-launcher-item.is-current {
  background: var(--accent-light); color: var(--primary);
  font-weight: 600;
}
.app-launcher-item.is-current .icon { color: var(--accent); }
.app-launcher-item span { font-size: var(--fs-md); }

/* ── PAGE HEADER ─────────────────────────────────────────── */
.page-header {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 28px 28px 0; box-shadow: var(--sh-sm);
}
.page-header-top {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.page-header-text { min-width: 0; }
.page-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: inline-flex; align-items: center;
}
a.page-eyebrow {
  text-decoration: none;
  transition: color var(--tr);
}
a.page-eyebrow:hover { color: var(--accent); }
a.page-eyebrow::before {
  content: "";
  display: inline-block;
  width: 10px; height: 10px;
  margin-right: 8px;
  background: currentColor;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='15 18 9 12 15 6'/></svg>") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='15 18 9 12 15 6'/></svg>") center/contain no-repeat;
}
.page-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.6px;
  line-height: 1.15;
  margin: 0 0 6px;
}
/* DEPRECATED — kept for back-compat; new pages should use .page-eyebrow instead */
.page-title-prefix {
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 4px;
}
.page-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 720px;
  margin: 0;
}
.page-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ── ENTITY TABS ─────────────────────────────────────────── */
.entity-tabs { display: flex; gap: 0; }
.entity-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 20px; cursor: pointer;
  font-size: var(--fs-md); font-weight: 500; color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  white-space: nowrap; transition: all var(--tr);
}
.entity-tab:hover { color: var(--text-primary); }
.entity-tab.active {
  color: var(--accent); border-bottom-color: var(--accent); font-weight: 600;
}
.entity-tab .tab-count {
  font-size: var(--fs-caption); font-weight: 700; padding: 2px 8px;
  background: var(--border-light); color: var(--text-muted);
  border-radius: 100px;
}
.entity-tab.active .tab-count { background: var(--accent-light); color: var(--accent); }

/* ── TOOLBAR ─────────────────────────────────────────────── */
.toolbar {
  padding: 14px 28px; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.search-wrap { position: relative; flex: 1; max-width: 340px; }
.search-wrap input {
  width: 100%; height: 36px; padding: 0 12px 0 34px;
  border: 1px solid var(--border); background: var(--page-bg);
  font-family: var(--font); font-size: var(--fs-md); color: var(--text-primary);
  outline: none; transition: all var(--tr);
}
.search-wrap input:focus {
  border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 111, 212, 0.10);
}
.search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: var(--fs-md); pointer-events: none;
}
.filter-btn {
  height: 36px; padding: 0 14px;
  border: 1px solid var(--border); background: var(--surface);
  font-family: var(--font); font-size: var(--fs-md); color: var(--text-secondary);
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: all var(--tr);
}
.filter-btn:hover,
.filter-btn.active {
  border-color: var(--accent); color: var(--accent); background: var(--accent-light);
}
.toolbar-spacer { flex: 1; }
.toolbar-meta { font-size: var(--fs-sm); color: var(--text-muted); }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font); font-size: var(--fs-md); font-weight: 500;
  padding: 8px 16px;
  border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: all var(--tr);
}
/* Primary buttons match the frosted-navy topbar (.aerios-topbar) — same
   rgba so they read as one surface family across the suite. */
.btn-primary { background: rgba(7, 27, 52, 0.94); color: #fff; border-color: rgba(7, 27, 52, 0.94); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary {
  background: var(--surface); color: var(--accent); border-color: var(--border);
}
.btn-secondary:hover { background: var(--accent-light); border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { background: var(--page-bg); color: var(--text-primary); }
.btn-sm { font-size: var(--fs-sm); padding: 6px 12px; }
.btn-icon {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); padding: 5px 9px;
  cursor: pointer; font-size: var(--fs-h3); font-family: var(--font);
  transition: all var(--tr);
}
.btn-icon:hover { background: var(--page-bg); color: var(--text-primary); }
.btn:disabled,
.btn-icon:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── DATA TABLE ──────────────────────────────────────────── */
.table-wrap {
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--sh-sm); overflow: hidden;
}
.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
.data-table thead tr {
  background: #fafbfc; border-bottom: 1px solid var(--border);
}
.data-table th {
  padding: 10px 14px; text-align: left;
  font-size: var(--fs-caption); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text-muted);
  white-space: nowrap; cursor: pointer; user-select: none;
}
.data-table th:hover { color: var(--text-primary); }
.data-table th .sort-arrow { opacity: 0.3; font-size: var(--fs-micro); margin-left: 3px; }
.data-table th.sorted .sort-arrow { opacity: 1; color: var(--accent); }
.data-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr {
  transition: background var(--tr); cursor: pointer;
}
.data-table tbody tr:hover td { background: #f5f7fb; }
.data-table tbody tr.selected td { background: var(--accent-light); }
.data-table input[type="checkbox"] {
  accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer;
}

/* ── CODE BADGES ─────────────────────────────────────────── */
.code-badge {
  font-family: var(--mono); font-size: var(--fs-xs); font-weight: 500;
  padding: 3px 8px;
  background: var(--border-light); border: 1px solid var(--border);
  color: var(--text-primary); letter-spacing: 0.3px;
}
.code-badge.icao { background: var(--accent-light); border-color: #bfdbfe; color: #1e40af; }
.code-badge.iata { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }

/* ── STATUS BADGES ───────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: 600; padding: 4px 10px;
  border-radius: 100px; white-space: nowrap;
}
.badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.badge-active { background: var(--green-bg); color: var(--green-text); }
.badge-active::before { background: var(--green-text); }
.badge-inactive { background: var(--slate-bg); color: var(--slate-text); }
.badge-inactive::before { background: var(--text-muted); }
.badge-pending { background: var(--amber-bg); color: var(--amber-text); }
.badge-pending::before { background: var(--amber-text); }
.badge-alert { background: var(--red-bg); color: var(--red-text); }
.badge-alert::before { background: var(--red-text); }
.badge-info { background: var(--violet-bg); color: var(--violet-text); }
.badge-info::before { background: var(--violet-text); }
.badge-disposed { background: var(--slate-bg); color: var(--slate-text); }
.badge-disposed::before { background: var(--slate-text); }

/* ── STAT STRIP ──────────────────────────────────────────── */
.stat-strip {
  display: flex; gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  margin-bottom: 16px; box-shadow: var(--sh-sm); overflow: hidden;
}
.stat-item { flex: 1; background: var(--surface); padding: 14px 18px; }
.stat-label {
  font-size: var(--fs-caption); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text-muted); margin-bottom: 6px;
}
.stat-value {
  font-size: var(--fs-display); font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.7px;
}
.stat-sub { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 4px; }

/* ── KPI STRIP ────────────────────────────────────────────
   Compact horizontal row of metric cards — small uppercase label
   + large mono number. Used on Flight Management (above the
   table), Resource Allocation (above the Gantt), and any other
   module that needs a quick situational summary at the top of a
   data view. Distinct from .stat-strip, which is a heavier
   dashboard-tile pattern.

   - Each metric is one .kpi-card; cards are click-targets by
     default (cursor: pointer + hover wash). Add .is-static for
     a non-interactive card.
   - Add .is-clickable + an onclick handler for click-to-filter
     or click-to-jump behavior; the same .is-active state shows
     when a card is acting as the current filter.
   - Value colour modifiers: kv-good (green), kv-warn (amber),
     kv-bad (red), kv-blue (accent), kv-muted (faded). The 'muted'
     variant also drops one type step so 0/— don't dominate.
   - .kpi-sep inserts a vertical hairline between logical groups.
   - Dark-themed pages (Resource Allocation, the operations
     dashboard) opt into the dark palette by adding .is-dark on
     the strip; works without changing the page-global theme.
   ──────────────────────────────────────────────────────── */
.kpi-strip {
  display: flex; align-items: stretch;
  background: var(--color-bg-surface-alt, #f8fafc);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  gap: 0;
  overflow-x: auto;
  flex-shrink: 0;
}
.kpi-strip::-webkit-scrollbar { height: 0; }

/* Collapsible variant — pages opt in via .is-collapsible on the
   strip, then toggle .is-collapsed to hide. The strip animates
   max-height + padding + border so the collapse feels physical
   rather than just fading out. */
.kpi-strip.is-collapsible {
  max-height: 96px;
  overflow: hidden;
  transition:
    max-height var(--duration-normal, 220ms) var(--ease-standard, cubic-bezier(.2,0,0,1)),
    padding-top var(--duration-fast, 120ms) var(--ease-standard, ease),
    padding-bottom var(--duration-fast, 120ms) var(--ease-standard, ease),
    border-bottom-width var(--duration-fast, 120ms) var(--ease-standard, ease);
}
.kpi-strip.is-collapsible.is-collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-bottom-width: 0;
}
.kpi-card {
  display: flex; flex-direction: column; justify-content: center;
  padding: 5px 12px 5px 10px;
  min-width: 76px;
  flex-shrink: 0;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font: inherit; text-align: left;
  transition: background var(--duration-fast, 120ms) var(--ease-standard, ease),
              border-color var(--duration-fast, 120ms) var(--ease-standard, ease);
}
.kpi-card:hover { background: var(--accent-light, #eef2fa); }
.kpi-card.is-active {
  background: var(--accent-light, #eef2fa);
  border-color: var(--accent);
}
.kpi-card.is-static { cursor: default; }
.kpi-card.is-static:hover { background: transparent; }
.kpi-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.55px;
  color: var(--text-muted);
  white-space: nowrap;
  margin-bottom: 4px;
}
.kpi-value {
  font-family: var(--mono);
  font-size: 20px; font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: -0.4px;
  font-variant-numeric: tabular-nums;
}
.kpi-value.kv-good  { color: #16a34a; }
.kpi-value.kv-warn  { color: #d97706; }
.kpi-value.kv-bad   { color: #dc2626; }
.kpi-value.kv-blue  { color: var(--accent); }
.kpi-value.kv-muted { color: var(--text-muted); font-size: 16px; }
.kpi-sep {
  width: 1px;
  background: var(--border);
  margin: 4px 10px;
  flex-shrink: 0;
  align-self: stretch;
}

/* Dark palette — opt-in via .is-dark on the strip, or via the
   global [data-theme="dark"] attribute when the page uses it.
   Surface tones match the desaturated navy palette adopted across
   Aerios dark surfaces (see Resource Allocation + Flight Management
   page-local theme tokens). */
[data-theme="dark"] .kpi-strip,
.kpi-strip.is-dark             { background: #15171D; border-color: #21262F; }
[data-theme="dark"] .kpi-card:hover,
.kpi-strip.is-dark .kpi-card:hover             { background: #1D2027; }
[data-theme="dark"] .kpi-card.is-active,
.kpi-strip.is-dark .kpi-card.is-active         { background: #1D2027; border-color: var(--accent); }
[data-theme="dark"] .kpi-sep,
.kpi-strip.is-dark .kpi-sep                    { background: #2D3038; }
[data-theme="dark"] .kpi-label,
.kpi-strip.is-dark .kpi-label                  { color: #94A3B8; }
[data-theme="dark"] .kpi-value,
.kpi-strip.is-dark .kpi-value                  { color: #CBD5E1; }
[data-theme="dark"] .kpi-value.kv-good,
.kpi-strip.is-dark .kpi-value.kv-good          { color: #4ADE80; }
[data-theme="dark"] .kpi-value.kv-warn,
.kpi-strip.is-dark .kpi-value.kv-warn          { color: #FBBF24; }
[data-theme="dark"] .kpi-value.kv-bad,
.kpi-strip.is-dark .kpi-value.kv-bad           { color: #F87171; }
[data-theme="dark"] .kpi-value.kv-blue,
.kpi-strip.is-dark .kpi-value.kv-blue          { color: #7AA7F0; }
[data-theme="dark"] .kpi-value.kv-muted,
.kpi-strip.is-dark .kpi-value.kv-muted         { color: #94A3B8; }

/* ── SIDE PANEL ──────────────────────────────────────────── */
.side-panel-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35);
  z-index: var(--z-overlay); display: none;
}
.side-panel-overlay.open { display: block; }
.side-panel {
  position: fixed; top: 0; right: -624px; width: 624px; height: 100vh;
  background: var(--surface); box-shadow: var(--sh-lg);
  z-index: var(--z-modal);
  display: flex; flex-direction: column;
  transition: right 240ms cubic-bezier(.25, .8, .25, 1);
}
.side-panel.open { right: 0; }
.panel-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  background: #fafbfc;
}
.panel-header-icon { font-size: var(--fs-h2); }
.panel-title { font-size: var(--fs-h3); font-weight: 700; color: var(--text-primary); flex: 1; }
.panel-subtitle { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.panel-close {
  background: transparent; border: 0; font-size: var(--fs-h2); color: var(--text-muted);
  cursor: pointer; padding: 4px 8px; transition: color var(--tr);
}
.panel-close:hover { color: var(--text-primary); }
.panel-body { flex: 1; overflow-y: auto; padding: 20px; }
.panel-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end; flex-shrink: 0;
}

/* ── FORM ELEMENTS ───────────────────────────────────────── */
.form-section { margin-bottom: 22px; }
.form-section-title {
  font-size: var(--fs-caption); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text-muted);
  padding-bottom: 8px; border-bottom: 1px solid var(--border-light);
  margin-bottom: 14px;
}
.form-row { display: grid; gap: 12px; margin-bottom: 12px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-label {
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-secondary);
  letter-spacing: 0.2px;
}
.form-label .req { color: var(--red-text); margin-left: 2px; }
.form-input,
.form-select {
  height: 36px; padding: 0 12px;
  border: 1px solid var(--border); background: #fff;
  font-family: var(--font); font-size: var(--fs-md); color: var(--text-primary);
  width: 100%; outline: none;
  transition: all var(--tr);
}
.form-input:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 111, 212, 0.10);
}
.form-input.mono {
  font-family: var(--mono); letter-spacing: 0.5px; text-transform: uppercase;
}
.form-hint { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }

/* ── FIELD DETAIL ROWS (view mode) ───────────────────────── */
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border: 1px solid var(--border); margin-bottom: 16px; overflow: hidden;
}
.detail-row { display: contents; }
.detail-key {
  padding: 10px 14px; background: #fafbfc;
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-light);
}
.detail-val {
  padding: 10px 14px; background: #fff;
  font-size: var(--fs-md); color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  border-left: 1px solid var(--border-light);
}
.detail-row:last-child .detail-key,
.detail-row:last-child .detail-val { border-bottom: none; }

/* ── EMPTY STATE (legacy alias — prefer .state-* below) ──── */
.empty-state { text-align: center; padding: 64px 32px; color: var(--text-muted); }
.empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.6; }  /* decorative emoji/icon — out of type scale */
.empty-title { font-size: var(--fs-h3); font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-sub { font-size: var(--fs-md); }

/* ── CANONICAL STATE CARDS — empty / loading / error / success
   One pattern for every "page is in a non-data state" message.
   Wrap inside the container that would normally hold the data so
   the surrounding chrome (table borders, toolbar) stays intact. */
.state-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-muted);
}
.state-card.is-compact { padding: 28px 16px; gap: 8px; }
.state-icon {
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-info-50);
  color: var(--color-info-700);
  flex-shrink: 0;
}
.state-icon .icon { width: 22px; height: 22px; }
.state-card.is-compact .state-icon { width: 36px; height: 36px; }
.state-card.is-compact .state-icon .icon { width: 18px; height: 18px; }
.state-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: var(--leading-tight);
}
.state-sub {
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  max-width: 480px;
  line-height: var(--leading-normal);
}
.state-card .state-cta { margin-top: 6px; }

/* Variants — change icon tint + (subtly) title color per intent */
.state-card.is-loading .state-icon {
  background: var(--color-bg-surface-alt);
  color: var(--color-text-muted);
  animation: state-pulse 1.4s ease-in-out infinite;
}
.state-card.is-error .state-icon   { background: var(--color-danger-50);  color: var(--color-danger-700); }
.state-card.is-success .state-icon { background: var(--color-success-50); color: var(--color-success-700); }
.state-card.is-warning .state-icon { background: var(--color-warning-50); color: var(--color-warning-700); }

@keyframes state-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* Inline state — for table tbody rows or tight slots where the
   full card would feel too heavy. Uses one row spanning all cols. */
.state-inline {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 22px 16px;
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}
.state-inline .icon { width: 14px; height: 14px; color: var(--color-text-muted); flex-shrink: 0; }
.state-inline strong { color: var(--color-text-secondary); font-weight: 600; }

/* ── TOAST ───────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; min-width: 260px;
  background: var(--text-primary); color: #fff;
  font-size: var(--fs-md); font-weight: 500;
  box-shadow: var(--sh-lg);
  animation: aerios-toast-up 240ms ease;
}
.toast.success { border-left: 3px solid #22c55e; }
.toast.warning { border-left: 3px solid #f59e0b; }
.toast.error   { border-left: 3px solid #ef4444; }
.toast.info    { border-left: 3px solid var(--accent); }
.toast-icon { display: inline-flex; flex-shrink: 0; }
.toast.success .toast-icon { color: #22c55e; }
.toast.warning .toast-icon { color: #f59e0b; }
.toast.error   .toast-icon { color: #ef4444; }
.toast.info    .toast-icon { color: var(--accent); }
@keyframes aerios-toast-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4);
  z-index: var(--z-modal); display: none;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); width: 520px; max-height: 90vh;
  overflow-y: auto; box-shadow: var(--sh-lg);
}
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; background: #fafbfc;
}
.modal-title { font-size: var(--fs-h3); font-weight: 700; flex: 1; }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
}

/* ── DROP ZONE ───────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border); padding: 40px 24px;
  text-align: center; background: var(--page-bg);
  cursor: pointer; margin-bottom: 16px;
  transition: all var(--tr);
}
.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent); background: var(--accent-light);
}
.drop-icon { font-size: 32px; margin-bottom: 10px; }  /* decorative emoji/icon — out of type scale */
.drop-title { font-size: var(--fs-md); font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.drop-sub { font-size: var(--fs-xs); color: var(--text-muted); }
.drop-link { color: var(--accent); text-decoration: underline; cursor: pointer; }

/* ── PAGINATION ──────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 4px; }
.page-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface);
  font-size: var(--fs-sm); font-family: var(--font); color: var(--text-secondary);
  cursor: pointer; transition: all var(--tr);
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn.prev,
.page-btn.next { font-size: var(--fs-md); }

/* ── TABLE FOOTER ────────────────────────────────────────── */
.table-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border); background: #fafbfc;
}
.table-footer-meta { font-size: var(--fs-sm); color: var(--text-muted); }

/* ── COUNTRY FLAG PLACEHOLDER ────────────────────────────── */
.flag {
  display: inline-block; width: 18px; height: 13px;
  background: var(--border); font-size: var(--fs-md); line-height: 1;
  vertical-align: middle; margin-right: 5px;
}

/* ── FILTER CHIPS ────────────────────────────────────────── */
.filter-strip {
  display: none; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 28px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.filter-strip.open { display: flex; }
.filter-strip-label {
  font-size: var(--fs-caption); font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  background: var(--accent-light); border: 1px solid #bfdbfe;
  color: var(--accent); font-size: var(--fs-sm); font-weight: 500;
  cursor: pointer;
}
.chip-remove { font-size: var(--fs-md); font-weight: 700; line-height: 1; opacity: 0.6; }
.chip-remove:hover { opacity: 1; }

/* ── DROPDOWN MENU ───────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 250;
  min-width: 240px; max-height: 360px;
  display: none; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--sh-md);
}
.dropdown-menu.open { display: flex; }
.dropdown-search {
  padding: 8px; border-bottom: 1px solid var(--border-light);
}
.dropdown-search input {
  width: 100%; height: 32px; padding: 0 10px;
  border: 1px solid var(--border); background: var(--page-bg);
  font-family: var(--font); font-size: var(--fs-sm); outline: none;
  transition: all var(--tr);
}
.dropdown-search input:focus { border-color: var(--accent); background: #fff; }
.dropdown-items { flex: 1; overflow-y: auto; padding: 4px 0; }
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; font-size: var(--fs-md); color: var(--text-primary);
  cursor: pointer;
  transition: background var(--tr);
}
.dropdown-item:hover { background: var(--page-bg); }
.dropdown-item input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; }
.dropdown-item.is-hidden { display: none; }
.dropdown-empty {
  padding: 16px; text-align: center;
  font-size: var(--fs-sm); color: var(--text-muted);
}
.dropdown-footer {
  display: flex; gap: 6px; align-items: center; justify-content: space-between;
  padding: 8px;
  border-top: 1px solid var(--border-light); background: #fafbfc;
}
.filter-btn-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px;
  background: var(--accent); color: #fff;
  font-size: var(--fs-caption); font-weight: 700;
  border-radius: 100px;
}

/* ═══════════════════════════════════════════════════════════
   SURFACE OVERRIDES — applies the canonical token system to
   shared components: rounded corners, taller topbar, table
   density, focus rings. Authored from shared/tokens.css.
   ═══════════════════════════════════════════════════════════ */

/* Topbar: 64px height (per --topbar-height) + nav navy + bottom border + low shadow */
.nav {
  height: var(--topbar-height);
  background: var(--color-nav-bg);
  border-bottom: 1px solid var(--color-nav-border);
  box-shadow: var(--shadow-sm);
}

/* Elevated surfaces — soft 14px corners */
.section-card,
.table-wrap,
.modal { border-radius: var(--radius-lg); }

/* Buttons + inputs — 10px corners */
.btn,
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-icon,
.form-input,
.form-select { border-radius: var(--radius-md); }

/* Focus rings — brand-blue soft glow */
.form-input:focus,
.form-select:focus,
.search-wrap input:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 4px rgba(42, 107, 199, 0.12);
}

/* Side panel + drill panel — 14px left corners */
.side-panel,
.drill-panel { border-radius: var(--radius-lg) 0 0 var(--radius-lg); }

/* Status badges + code badges — square (no pill) */
.badge,
.code-badge { border-radius: 0; }
/* Count-display badges KEEP the pill — only place rounding survives */
.topbar-badge-dot,
.sidebar-item-count,
.filter-btn-count,
.tab-count,
.cnt-badge,
.notif-badge { border-radius: var(--radius-pill); }

/* Data tables — enterprise density per spec */
.data-table thead th {
  background: var(--color-bg-surface-alt);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  letter-spacing: 0.04em;
}
.data-table td {
  height: var(--table-row-height);
  padding: var(--table-cell-padding-y) var(--table-cell-padding-x);
  border-bottom: 1px solid var(--table-grid-border);
  font-size: var(--text-md);
}
.data-table tbody tr:hover td   { background: var(--table-row-hover); }
.data-table tbody tr.selected td { background: var(--table-row-selected); }

/* ═══════════════════════════════════════════════════════════
   AERIOS PREMIUM TOP NAV — command-center aesthetic
   Mounted via Aerios.mountTopbar() in shared/components.js.
   ═══════════════════════════════════════════════════════════ */
.aerios-topbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: rgba(7, 27, 52, 0.94);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02), 0 4px 16px rgba(0, 0, 0, 0.18);
}
.topbar-inner {
  display: flex; align-items: center;
  gap: 16px;
  height: var(--topbar-height);
  padding: 0 24px;
  position: relative; /* anchor for the centered search column */
}
.topbar-left  { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.topbar-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; margin-left: auto; }
/* Search is taken out of the flex flow and pinned to viewport-row centre,
   so trigger-button width changes between modules don't push it sideways. */
.topbar-center {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 100%; max-width: 560px;
  pointer-events: none;
}
.topbar-center > * { pointer-events: auto; }

.topbar-logo {
  display: inline-flex; align-items: center;
  text-decoration: none;
  transform: translateY(1px); /* optical centring — sits ~1px below mathematical centre */
}
.topbar-logo img { width: 70px; height: auto; filter: brightness(1.1); }

.topbar-suite-trigger {
  display: inline-flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.95);
  font-family: var(--font-sans); font-size: var(--text-md); font-weight: var(--font-semibold);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard);
}
.topbar-suite-trigger:hover  { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.14); }
.topbar-suite-trigger.is-open { background: rgba(255, 255, 255, 0.10); border-color: rgba(255, 255, 255, 0.20); }
.topbar-suite-trigger .suite-icon { width: 15px; height: 15px; color: rgba(255, 255, 255, 0.78); }
.topbar-suite-trigger .suite-chevron { width: 11px; height: 11px; opacity: 0.55; transition: transform var(--duration-normal) var(--ease-standard); }
.topbar-suite-trigger.is-open .suite-chevron { transform: rotate(180deg); opacity: 0.9; }

.topbar-cmd {
  display: flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-md);
  transition: background var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-normal) var(--ease-standard);
  cursor: text;
}
.topbar-cmd:hover { background: rgba(255, 255, 255, 0.10); border-color: rgba(255, 255, 255, 0.16); }
.topbar-cmd.is-focused {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.16);
}
.topbar-cmd .icon { width: 15px; height: 15px; color: rgba(255, 255, 255, 0.58); flex-shrink: 0; }
.topbar-cmd input {
  flex: 1; background: transparent; border: 0; outline: none;
  font-family: var(--font-sans); font-size: var(--text-md);
  color: #fff;
  padding: 0;
}
.topbar-cmd input::placeholder { color: rgba(255, 255, 255, 0.42); }
.topbar-cmd-shortcut {
  font-family: var(--font-mono); font-size: var(--text-xs);
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-xs);
  color: rgba(255, 255, 255, 0.70);
  letter-spacing: 0.4px;
}

/* ── Right-side utility group — bell + tz + status share one cohesive container */
.topbar-utility {
  display: inline-flex; align-items: center;
  gap: 12px;
  height: 40px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

.topbar-icon-btn {
  position: relative;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: rgba(255, 255, 255, 0.82);
  transition: background var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.topbar-icon-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.topbar-icon-btn .icon { width: 16px; height: 16px; }
.topbar-badge-dot {
  position: absolute; top: 2px; right: 2px;   /* tighter to the bell */
  min-width: 15px; height: 15px;
  background: var(--color-danger-500);
  color: #fff; font-size: 10px; font-weight: var(--font-bold);
  font-family: var(--font-mono);
  border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
  box-shadow: 0 0 0 2px rgba(7, 27, 52, 0.95);
  line-height: 1;
}

/* Timezone segmented control — sits inside the utility group, no
   self-contained background (the group provides it). Subtle vertical
   separator between segments instead of a floating pill outline. */
.topbar-tz {
  display: inline-flex;
  height: 32px;
}
.topbar-tz-seg {
  background: transparent; border: 0;
  padding: 0 12px; height: 32px;
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: var(--font-semibold);
  color: rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-xs);
  cursor: pointer;
  letter-spacing: 0.4px;
  transition: color var(--duration-fast) var(--ease-standard), background var(--duration-fast) var(--ease-standard);
  position: relative;
}
.topbar-tz-seg + .topbar-tz-seg::before {
  content: '';
  position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 1px; background: rgba(255, 255, 255, 0.08);
}
.topbar-tz-seg.is-active { background: rgba(255, 255, 255, 0.10); color: #fff; }
.topbar-tz-seg.is-active + .topbar-tz-seg::before,
.topbar-tz-seg:has(+ .is-active)::before { background: transparent; }
.topbar-tz-seg:hover:not(.is-active) { color: rgba(255, 255, 255, 0.88); }

/* Operational status — softer green tint, no border, integrated into the
   utility group rather than competing as a separate floating pill. */
.topbar-status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 12px; height: 32px;
  font-size: var(--text-xs); font-weight: var(--font-semibold);
  color: rgba(187, 247, 208, 0.82);
  letter-spacing: 0.3px;
}
.topbar-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-success-500);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18), 0 0 6px rgba(34, 197, 94, 0.45);
  animation: topbar-status-pulse 2.4s ease-in-out infinite;
}
@keyframes topbar-status-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18), 0 0 6px rgba(34, 197, 94, 0.35); }
  50%      { box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.28), 0 0 10px rgba(34, 197, 94, 0.60); }
}

/* Avatar — identity, separate from operational utilities (16px gap
   from the utility group via .topbar-right's gap). */
.topbar-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--color-brand-500);
  color: #fff;
  font-family: var(--font-sans); font-size: var(--text-sm); font-weight: var(--font-bold);
  border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  letter-spacing: 0.3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: filter var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}
.topbar-avatar:hover { filter: brightness(1.08); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14); }

/* ── MEGA MENU — Operations Suite switcher ──────────────── */
.mega-bg {
  position: fixed; inset: var(--topbar-height) 0 0 0;
  background: var(--color-bg-overlay);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  z-index: var(--z-overlay);
  opacity: 0; visibility: hidden;
  transition: opacity var(--duration-normal) var(--ease-standard), visibility 0s linear var(--duration-normal);
}
.mega-bg.is-open {
  opacity: 1; visibility: visible;
  transition: opacity var(--duration-normal) var(--ease-standard), visibility 0s;
}
.mega-menu {
  position: fixed; top: var(--topbar-height); left: 0; right: 0;
  z-index: calc(var(--z-overlay) + 1);
  display: block;
  padding: 12px 20px 24px 20px; /* padding-left overridden by JS to align under trigger */
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--duration-normal) var(--ease-standard), transform var(--duration-normal) var(--ease-standard), visibility 0s linear var(--duration-normal);
  pointer-events: none;
}
.mega-menu.is-open {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition: opacity var(--duration-normal) var(--ease-standard), transform var(--duration-normal) var(--ease-standard), visibility 0s;
  pointer-events: auto;
}
.mega-inner {
  width: min(1140px, calc(100vw - 60px));
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(7, 27, 52, 0.02);
  display: grid;
  grid-template-columns: 290px 1fr;
  overflow: hidden;
}
.mega-side {
  background: var(--color-bg-surface-alt);
  border-right: 1px solid var(--color-border-subtle);
  padding: 24px 0;
}
.mega-side-section { padding: 0 0 18px; }
.mega-side-section + .mega-side-section { padding-top: 22px; }
.mega-side-title {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: var(--font-semibold);
  text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--color-text-muted);
  padding: 0 24px 14px;
}
.mega-side-item {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: var(--text-base); font-weight: var(--font-medium);
  line-height: var(--leading-tight);
  transition: background var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.mega-side-item:hover { background: var(--color-bg-hover); color: var(--color-brand-500); }
.mega-side-item .icon { width: 16px; height: 16px; color: var(--color-text-secondary); }
.mega-side-item:hover .icon { color: var(--color-brand-500); }
.mega-side-item span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mega-side-meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 400;
}
.mega-side-star {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  background: transparent; border: 0; padding: 0; cursor: pointer;
  color: var(--color-border-default);
  transition: color var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
}
.mega-side-star .icon { width: 14px; height: 14px; }
.mega-side-star:hover { color: var(--color-brand-500); transform: scale(1.1); }
.mega-side-star.is-on { color: var(--color-brand-500); }

/* ── MEGA MAIN — tabs + panels ─────────────────────────── */
.mega-main { display: flex; flex-direction: column; min-width: 0; }
.mega-tabs {
  display: flex; gap: 0;
  padding: 0 28px;
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--color-bg-surface);
}
.mega-tab {
  position: relative;
  flex: 1;
  background: transparent; border: 0;
  padding: 22px 12px 18px;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--color-text-secondary);
  cursor: pointer;
  text-align: center;
  transition: color var(--duration-fast) var(--ease-standard);
}
.mega-tab:hover { color: var(--color-text-primary); }
.mega-tab.is-active { color: var(--color-brand-500); }
.mega-tab.is-active::after {
  content: '';
  position: absolute; left: 12px; right: 12px; bottom: -1px;
  height: 2px;
  background: var(--color-brand-500);
}

.mega-panels { padding: 28px; min-height: 320px; }
.mega-panel { display: none; }
.mega-panel.is-active {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.mega-card {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 20px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-subtle);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--duration-fast) var(--ease-standard),
              background var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard);
}
.mega-card:hover {
  border-color: var(--color-brand-500);
  background: var(--color-bg-surface);
  box-shadow: var(--shadow-sm);
}
.mega-card-icon {
  width: 52px; height: 52px;
  background: var(--color-info-50);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--color-brand-500);
  flex-shrink: 0;
  transition: background var(--duration-fast) var(--ease-standard);
}
.mega-card-icon .icon { width: 22px; height: 22px; }
.mega-card:hover .mega-card-icon { background: var(--color-info-100); }
.mega-card-body { min-width: 0; }
.mega-card-name {
  font-family: var(--font-sans);
  font-size: var(--text-lg); font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  line-height: var(--leading-tight);
  letter-spacing: -0.2px;
  margin-bottom: 4px;
}
.mega-card-sub {
  font-size: var(--text-md);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
}
.mega-card.is-active {
  border-color: var(--color-brand-500);
  background: var(--color-bg-selected);
}
.mega-card.is-active .mega-card-icon { background: var(--color-brand-500); color: #fff; }
.mega-card.is-active .mega-card-name { color: var(--color-brand-900); }

/* ── NOTIFICATION PANEL — recent cross-module activity ──── */
.notif-bg {
  position: fixed; inset: var(--topbar-height) 0 0 0;
  background: transparent;
  z-index: var(--z-overlay);
  opacity: 0; visibility: hidden;
  transition: opacity var(--duration-fast) var(--ease-standard), visibility 0s linear var(--duration-fast);
}
.notif-bg.is-open { opacity: 1; visibility: visible; transition: opacity var(--duration-fast) var(--ease-standard), visibility 0s; }
.notif-panel {
  position: fixed;
  top: calc(var(--topbar-height) + 8px);
  right: 16px;
  width: 380px;
  max-height: calc(100vh - var(--topbar-height) - 32px);
  z-index: calc(var(--z-overlay) + 1);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(7, 27, 52, 0.02);
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--duration-normal) var(--ease-standard), transform var(--duration-normal) var(--ease-standard), visibility 0s linear var(--duration-normal);
  pointer-events: none;
}
.notif-panel.is-open {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition: opacity var(--duration-normal) var(--ease-standard), transform var(--duration-normal) var(--ease-standard), visibility 0s;
  pointer-events: auto;
}
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--color-bg-surface);
}
.notif-title {
  font-size: var(--fs-md); font-weight: 600;
  color: var(--color-text-primary);
}
.notif-mark-read {
  background: transparent; border: 0; padding: 4px 6px;
  font-size: var(--fs-xs); font-weight: 600;
  color: var(--color-brand-500);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-standard);
}
.notif-mark-read:hover { color: var(--color-brand-700); text-decoration: underline; }

.notif-body {
  flex: 1;
  overflow-y: auto;
  background: var(--color-bg-app);
}
.notif-group { padding: 6px 0 0; }
.notif-group-title {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 10px 18px 6px;
}

.notif-item {
  position: relative;
  display: grid; grid-template-columns: 28px 1fr;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 18px 12px 21px;   /* extra left to clear the 3px severity rail */
  background: var(--color-bg-surface);
  border-bottom: 1px solid var(--color-border-subtle);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
}
.notif-item::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: transparent;
}
.notif-item:hover { background: var(--color-bg-hover); }
.notif-group:last-child .notif-item:last-child { border-bottom: 0; }

/* Severity left-rail */
.notif-item.is-sev-urgent::before  { background: var(--color-danger-500); }
.notif-item.is-sev-warning::before { background: var(--color-warning-500); }
.notif-item.is-sev-success::before { background: var(--color-success-500); }
.notif-item.is-sev-info::before    { background: var(--color-border-default); }

/* Unread strengthens the rail (so read items dim but still carry their tone) */
.notif-item:not(.is-unread)::before { opacity: 0.35; }
.notif-item.is-unread .notif-item-title { color: var(--color-text-primary); font-weight: 700; }

/* Severity-tinted icon block */
.notif-sev-icon {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-bg-surface-alt);
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.notif-sev-icon .icon { width: 14px; height: 14px; }
.is-sev-urgent  > .notif-sev-icon { background: var(--color-danger-50);  color: var(--color-danger-700); }
.is-sev-warning > .notif-sev-icon { background: var(--color-warning-50); color: var(--color-warning-700); }
.is-sev-success > .notif-sev-icon { background: var(--color-success-50); color: var(--color-success-700); }
.is-sev-info    > .notif-sev-icon { background: var(--color-info-50);    color: var(--color-info-700); }

.notif-item-body { min-width: 0; }
.notif-item-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  line-height: var(--leading-tight);
  margin-bottom: 2px;
}
.notif-item-text {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
}
.notif-item-meta {
  display: flex; align-items: center; gap: 6px;
  margin-top: 8px;
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}
.notif-meta-dot { opacity: 0.6; }
.notif-item-cta {
  margin-left: auto;
  background: transparent; border: 0; padding: 0;
  font-size: var(--fs-xs); font-weight: 600;
  color: var(--color-brand-500);
  cursor: pointer;
}
.notif-item-cta:hover { color: var(--color-brand-700); text-decoration: underline; }

.notif-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--color-border-subtle);
  background: var(--color-bg-surface);
  text-align: center;
}
.notif-footer-hint {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

/* ── COMMAND PALETTE ────────────────────────────────────── */
.cmd-palette {
  position: absolute; top: 44px; left: 0; right: 0;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--duration-normal) var(--ease-standard), transform var(--duration-normal) var(--ease-standard), visibility 0s linear var(--duration-normal);
  overflow: hidden;
  pointer-events: none;
  z-index: var(--z-dropdown);
}
.cmd-palette.is-open {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition: opacity var(--duration-normal) var(--ease-standard), transform var(--duration-normal) var(--ease-standard), visibility 0s;
  pointer-events: auto;
}
.cmd-group { padding: 6px 0 10px; }
.cmd-group + .cmd-group { border-top: 1px solid var(--color-border-subtle); padding-top: 10px; }
.cmd-group-label {
  font-family: var(--font-sans);
  font-size: var(--text-xs); font-weight: var(--font-bold);
  text-transform: uppercase; letter-spacing: 0.9px;
  color: var(--color-text-muted);
  padding: 8px 14px 6px;
}
.cmd-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: var(--text-md);
  color: var(--color-text-primary);
  transition: background var(--duration-fast) var(--ease-standard);
  text-decoration: none;
  line-height: var(--leading-tight);
}
.cmd-item:hover { background: var(--color-info-50); }
.cmd-item.is-active { background: var(--color-info-50); box-shadow: inset 2px 0 0 var(--color-brand-500); }
.cmd-item .cmd-icon {
  width: 26px; height: 26px;
  border-radius: var(--radius-xs);
  background: var(--color-bg-app); border: 1px solid var(--color-border-subtle);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}
.cmd-item .cmd-icon .icon { width: 13px; height: 13px; }
.cmd-item-text { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.cmd-item-name { font-weight: var(--font-medium); color: var(--color-text-primary); }
.cmd-item-meta { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--color-text-muted); white-space: nowrap; }
.cmd-item-kbd { display: inline-flex; gap: 2px; }
.cmd-item-kbd kbd {
  font-family: var(--font-mono); font-size: var(--text-xs);
  padding: 2px 6px;
  background: var(--color-bg-app);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xs);
  color: var(--color-text-secondary);
  line-height: 1;
}
.cmd-iata {
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: var(--font-bold);
  background: var(--color-info-50); color: var(--color-brand-900);
  padding: 3px 7px; border-radius: var(--radius-xs);
  letter-spacing: 0.3px;
}
.cmd-tag {
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: var(--font-semibold);
  padding: 2px 7px; border-radius: var(--radius-xs);
  letter-spacing: 0.3px;
  background: var(--color-border-subtle); color: var(--color-text-secondary);
}
.cmd-footer {
  display: flex; gap: 14px;
  padding: 9px 14px;
  background: var(--color-bg-app);
  border-top: 1px solid var(--color-border-subtle);
  font-size: var(--text-xs); color: var(--color-text-muted);
}
.cmd-footer span { display: inline-flex; align-items: center; gap: 4px; }
.cmd-footer kbd {
  font-family: var(--font-mono); font-size: var(--text-xs);
  padding: 1px 5px;
  background: var(--color-bg-surface); border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xs);
  color: var(--color-text-secondary);
  line-height: 1;
}

/* The premium topbar must NOT inherit .nav surface styling */
.aerios-topbar.nav { height: var(--topbar-height); box-shadow: none; border-bottom: 1px solid var(--color-nav-border); background: rgba(7, 27, 52, 0.92); }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .stat-strip { flex-wrap: wrap; }
  .form-row.cols-2,
  .form-row.cols-3 { grid-template-columns: 1fr; }
  .side-panel { width: 100%; right: -100%; }
  .modal { width: calc(100vw - 32px); }
}
