/*
 * Falcon Admin styles — brand colors and Tailwind-like utilities
 * Sampled theme variables live in /stylesheets/brand_theme.css
 */
:root {
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
}
body {
  font-family: "Aptos", "Aptos Display", system-ui, -apple-system, sans-serif;
  margin: 0;
  background: var(--bg-page, #f4f6fb);
  color: var(--text-primary, #0f172a);
}
.font-brand { font-family: "Aptos", "Aptos Display", system-ui, -apple-system, sans-serif; }

/* Table typography — Aptos data, Aptos Bold headers app-wide */
table th {
  font-family: "Aptos", "Aptos Display", system-ui, -apple-system, sans-serif;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
}
table td {
  font-family: "Aptos", "Aptos Display", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  text-align: center;
  vertical-align: middle;
}
/* Codes/IDs stay Aptos inside tables (override .font-mono on cells) */
table .font-mono {
  font-family: "Aptos", "Aptos Display", system-ui, -apple-system, sans-serif;
}
.table-actions-cell {
  white-space: nowrap;
}
.table-actions-cell form {
  display: inline;
}

/* Brand colors */
.bg-brand-blue { background: var(--brand-blue); }
.bg-brand-purple { background: var(--brand-purple); }
.bg-brand-sunset { background: var(--brand-sunset); }
.text-brand-blue { color: var(--brand-blue); }
.text-brand-purple { color: var(--brand-purple); }
.text-brand-sunset { color: var(--brand-sunset); }
.border-brand-blue { border-color: var(--brand-blue); }
.border-brand-purple { border-color: var(--brand-purple); }
.border-brand-sunset { border-color: var(--brand-sunset); }

/* App shell — full-width with 3-color brand gradient */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-primary);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--login-gradient-start) 18%, var(--bg-page)) 0%,
      color-mix(in srgb, var(--login-gradient-mid) 14%, var(--bg-page)) 45%,
      color-mix(in srgb, var(--login-gradient-end) 16%, var(--bg-page)) 100%);
}
.app-nav {
  background: #ffffff;
  color: var(--text-primary);
  padding: 0.65rem 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  width: 100%;
  box-sizing: border-box;
  gap: 1rem;
}
[data-theme="dark"] .app-nav {
  background: var(--bg-surface);
  color: var(--text-primary);
}
.app-nav-brand-group {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}
.app-nav-divider {
  width: 1px;
  height: 1.75rem;
  background: color-mix(in srgb, var(--brand-blue) 28%, transparent);
  margin: 0 1rem;
  flex-shrink: 0;
}
.app-nav-primary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.app-nav-primary-wrap {
  display: none;
}
.app-nav-menu-toggle {
  display: none;
  list-style: none;
  cursor: pointer;
  color: var(--brand-blue);
  font-size: 0.875rem;
  font-weight: 600;
  min-height: 44px;
  min-width: 44px;
  padding: 0.65rem;
  border-radius: 0.75rem;
  border: 2px solid var(--brand-blue);
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
[data-theme="dark"] .app-nav-menu-toggle {
  color: var(--text-primary);
}
.app-nav-menu-toggle::-webkit-details-marker { display: none; }
.app-nav-home img { height: 2rem; width: auto; display: block; }
.app-nav-link { color: var(--brand-blue); font-size: 0.875rem; text-decoration: none; background: transparent; border: none; cursor: pointer; }
[data-theme="dark"] .app-nav-link { color: var(--text-primary); }
.app-nav-link:hover { text-decoration: underline; }
.app-nav-primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-blue);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: 0.65rem;
  border-radius: 0.75rem;
  border: 2px solid var(--brand-blue);
  background: transparent;
  box-sizing: border-box;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
[data-theme="dark"] .app-nav-primary-link {
  color: var(--text-primary);
  border-color: var(--brand-blue);
}
.app-nav-primary-link:hover {
  background: color-mix(in srgb, var(--brand-blue) 12%, transparent);
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--brand-sunset);
}
.app-nav-primary-link.is-active {
  background: var(--brand-blue);
  color: #fff;
  border-color: var(--brand-blue);
  font-weight: 600;
  box-shadow: 3px 3px 0 var(--brand-sunset);
}
.app-nav-user { color: inherit; opacity: 0.9; }
@media (max-width: 900px) {
  .app-nav { padding: 0.55rem 1rem; }
  .app-nav-divider { margin: 0 0.65rem; }
  .app-nav-primary-desktop { display: none; }
  .app-nav-primary-wrap {
    display: block;
    position: relative;
  }
  .app-nav-menu-toggle { display: inline-flex; }
  .app-nav-primary-wrap:not([open]) .app-nav-primary { display: none; }
  .app-nav-primary-wrap .app-nav-primary {
    display: flex;
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    z-index: 40;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    min-width: 14rem;
    padding: 0.35rem;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 0.75rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  }
  [data-theme="dark"] .app-nav-primary-wrap .app-nav-primary {
    background: var(--bg-surface);
  }
  .app-nav-primary-wrap .app-nav-primary-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem;
  }
  .app-nav-utilities .nav-user-menu-trigger,
  .app-nav-utilities .theme-toggle {
    min-height: 44px;
    min-width: 44px;
  }
}
@media (max-width: 768px) {
  .app-nav { padding: 0.55rem 1rem; }
}
.app-main {
  flex: 1;
  width: 100%;
  max-width: 90rem;
  margin: 0 auto;
  padding: 1.5rem 2rem 2rem;
  box-sizing: border-box;
}

/* Reusable page panels + FAQ questions — expanding fill/outline (escannord/spotty-jellyfish-36) */
.page-panel,
.faq-item {
  --faq-fill: var(--brand-blue);
  --faq-outline: var(--brand-sunset);
  position: relative;
  isolation: isolate;
  z-index: 0;
  background: var(--bg-surface);
  border: 2px solid var(--faq-fill);
  border-radius: 0.75rem;
  overflow: visible;
  transition: color 0.2s ease;
}
.page-panel {
  box-shadow: 3px 3px 0 var(--faq-outline);
  padding: 1.25rem;
}
.page-panel::before,
.faq-item::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  border-radius: 50%;
  background: var(--faq-fill);
  width: 0;
  height: 0;
  opacity: 0.1;
  pointer-events: none;
  transition: all 0.5s linear;
  outline: 3px solid transparent;
}
.page-panel:hover,
.page-panel:focus-within,
.faq-item:hover,
.faq-item:focus-within {
  z-index: 2;
}
.page-panel:hover::before,
.page-panel:focus-within::before,
.faq-item:hover::before,
.faq-item:focus-within::before {
  width: 100%;
  height: 100%;
  border-radius: 0.75rem;
  outline-offset: 5px;
  outline-color: var(--faq-outline);
}
.page-panel > h2,
.page-panel > .page-header h1 {
  font-weight: 600;
  color: var(--brand-blue);
}
.page-panel > h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin: 0 0 1rem;
}
.page-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-blue);
  line-height: 1.2;
}
.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.page-toolbar-tabs .page-panel {
  border: 1px solid var(--border-subtle);
  box-shadow: none;
  border-radius: 0.5rem;
  isolation: auto;
  padding: 0.5rem 1rem;
}
.page-toolbar-tabs .page-panel::before {
  content: none;
}
.page-toolbar-search { flex: 1; min-width: 12rem; max-width: 24rem; }
.page-toolbar-search input { width: 100%; box-sizing: border-box; }

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.15rem 0.35rem 0.55rem 0;
  background: var(--bg-surface);
  border: 2px solid var(--brand-blue);
  border-radius: 0.75rem;
  box-shadow: 3px 3px 0 var(--brand-sunset);
}

.app-main .page-panel table {
  border-collapse: collapse;
  width: 100%;
}
.app-main .page-panel thead,
.app-main .page-panel thead.bg-slate-100,
.app-main .page-panel thead th {
  background: color-mix(in srgb, var(--brand-blue-soft, #e0e5ef) 45%, var(--bg-surface));
}
.app-main .page-panel thead th {
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}
.app-main .page-panel tbody td {
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}
.app-main .page-panel tbody tr:last-child td {
  border-bottom: none;
}
.table-as-cards {
  min-width: 40rem;
}
@media (max-width: 768px) {
  .table-as-cards {
    min-width: 0;
  }
  .table-as-cards thead {
    position: absolute;
    left: -9999px;
  }
  .table-as-cards tbody tr {
    display: block;
    margin: 0;
    padding: 0.4rem 0.25rem;
    border-bottom: 1px solid var(--border-subtle, #e2e8f0);
    background: transparent;
  }
  .table-as-cards tbody tr:last-child {
    border-bottom: none;
  }
  .table-as-cards tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border: 0;
    padding: 0.45rem 0.65rem;
    text-align: left;
  }
  .table-as-cards tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
  }
}

tr.row-link {
  cursor: pointer;
}
tr.row-link:hover {
  background: color-mix(in srgb, var(--brand-blue, #1d4ed8) 6%, transparent);
}

/* Horizontal status / SLA stepper */
.status-stepper {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}
.status-step {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.status-step-card {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}
.status-step-card .step-label { opacity: 0.85; font-size: 0.75rem; }
.status-step-card .step-due { font-weight: 600; }
.status-step-connector {
  width: 1.5rem;
  height: 2px;
  background: var(--border-subtle);
  flex-shrink: 0;
  margin: 0 0.25rem;
}

/* Two-column form layout */
.form-shell { width: 100%; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 700px) {
  .form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem 1.75rem; }
  .form-grid-full { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .form-grid { gap: 1.5rem 2rem; }
}
.form-col { display: flex; flex-direction: column; gap: 1.5rem; }

/* Detail page 2-col layout */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; }
  .detail-grid-full { grid-column: 1 / -1; }
}
@media (min-width: 1200px) {
  .detail-grid { gap: 1.5rem 2rem; }
}

/* Voyage show: map + timeline row uses more height */
.map-panel { min-height: 20rem; }
.map-panel .h-64 { height: 20rem; }

/* Dashboard — map fills leftover space without locking the viewport */
body.dashboard-page {
  min-height: 100dvh;
}
body.dashboard-page .app-main,
body.dashboard-map-page .app-main {
  max-width: none;
}
body.dashboard-page .app-main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.65rem 1.25rem 0.5rem;
  display: flex;
  flex-direction: column;
}
body.dashboard-page .metainfa-footer {
  display: none;
}
body.dashboard-page .flash-notice,
body.dashboard-page .flash-alert {
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.dashboard-root {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 0.5rem;
  overflow: hidden;
}
.dashboard-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}
.dashboard-header-row h1 { margin: 0; font-size: 1.35rem; }
.dashboard-period-bar {
  padding: 0.4rem 0.75rem;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.dashboard-period-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0;
  flex: 1;
  min-width: 14rem;
}
.dashboard-period-bar .dashboard-presets { margin-bottom: 0; }
.dashboard-status-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.dashboard-status-filter-label {
  flex-shrink: 0;
}
.dashboard-status-select {
  min-width: 10rem;
  max-width: 100%;
}
.dashboard-status-filter-badge {
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-md);
  background: rgba(49, 79, 146, 0.1);
  color: var(--brand-blue, #314f92);
  font-weight: 600;
  white-space: nowrap;
}
.dashboard-period-hint { display: none; }
.dashboard-kpi-lead {
  display: grid;
  grid-template-columns: minmax(13rem, 0.9fr) minmax(0, 2.1fr);
  gap: 0.5rem;
  margin: 0;
  align-items: stretch;
}
.dashboard-kpi-risk {
  cursor: pointer;
  text-align: left;
  padding: 0.75rem 1rem;
}
.dashboard-kpi-risk .text-3xl { font-size: 1.85rem; }
.dashboard-kpi-risk.is-alert {
  border-left: 4px solid var(--brand-sunset);
}
.dashboard-kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.dashboard-kpi-metric {
  padding: 0.45rem 0.65rem;
}
.dashboard-kpi-metric .text-3xl { font-size: 1.25rem; }
.dashboard-exec-tile {
  cursor: pointer;
  text-align: left;
}
.dashboard-exec-tile-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.dashboard-trend-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
}
.dashboard-trend-up {
  color: #15803d;
  background: rgba(21, 128, 61, 0.12);
}
.dashboard-trend-down {
  color: #b45309;
  background: rgba(180, 83, 9, 0.12);
}
.dashboard-trend-flat {
  color: var(--text-muted);
  background: rgba(100, 116, 139, 0.12);
}
.dashboard-map-full {
  margin-top: 0.5rem;
}
.dashboard-map-full .dashboard-map-slot {
  min-height: 360px;
}
.dashboard-popup-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
.dashboard-tile-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.dashboard-tile-modal.is-open {
  display: flex;
}
body.dashboard-tile-modal-open {
  overflow: hidden;
}
.dashboard-tile-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.dashboard-tile-modal-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 96vw);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 0;
}
.dashboard-tile-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}
.dashboard-tile-modal-filters {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}
.dashboard-tile-modal-chart-wrap {
  height: 140px;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}
.dashboard-tile-modal-body {
  overflow: auto;
  flex: 1;
  padding-top: 0.5rem;
}
.dashboard-tile-table {
  border-collapse: collapse;
}
.dashboard-tile-data-row {
  cursor: pointer;
}
.dashboard-tile-data-row:hover {
  background: rgba(49, 79, 146, 0.06);
}
.dashboard-tile-row-selected {
  background: rgba(49, 79, 146, 0.12);
}
.dashboard-expenses-coa-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.dashboard-expenses-coa-reset {
  border: none;
  background: none;
  color: var(--brand-blue, #314f92);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
.dashboard-tile-voyage-link {
  color: var(--brand-blue, #314f92);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.dashboard-tile-voyage-link:hover {
  text-decoration: underline;
}
.sortable-table th.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.sortable-table th.sortable-th-active {
  color: var(--brand-blue, #314f92);
}
.sortable-table th.sortable-th .sort-indicator {
  margin-left: 0.2rem;
  font-size: 0.7rem;
  opacity: 0.85;
}
.dashboard-risk-section + .dashboard-risk-section {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
}
.dashboard-expenses-tile {
  cursor: default;
}
.dashboard-expense-more-btn {
  margin-left: 0.35rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--brand-blue, #314f92);
  font-size: 0.65rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.dashboard-map-with-drawer.dashboard-embedded-map {
  flex-direction: row;
}
.dashboard-map-with-drawer.dashboard-embedded-map .dashboard-map-main {
  border-right: none;
}
.dashboard-map-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.dashboard-map-with-drawer .dashboard-embedded-map-canvas {
  flex: 1;
  min-height: 220px;
}
.dashboard-expense-drawer {
  width: 0;
  overflow: hidden;
  border-left: 0 solid var(--border-subtle, #e2e8f0);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease, border-width 0.2s ease;
  flex-shrink: 0;
}
.dashboard-expense-drawer.is-open {
  width: min(320px, 42vw);
  border-left-width: 1px;
}
.dashboard-expense-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
  flex-shrink: 0;
}
.dashboard-expense-drawer-close {
  border: none;
  background: none;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}
.dashboard-expense-drawer-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.5rem 0.65rem;
}
.dashboard-expense-coa-table th,
.dashboard-expense-coa-table td {
  vertical-align: top;
}
.dashboard-discrepancy-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.dashboard-discrepancy-modal.is-open {
  display: flex;
}
.dashboard-discrepancy-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.dashboard-discrepancy-panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(80vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 0;
}
.dashboard-discrepancy-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}
.dashboard-discrepancy-body {
  overflow: auto;
  padding: 0.75rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.dashboard-discrepancy-row {
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 0.375rem;
  padding: 0.65rem 0.75rem;
}
.dashboard-discrepancy-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}
.dashboard-discrepancy-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
  background: rgba(49, 79, 146, 0.1);
  color: var(--brand-blue, #314f92);
  white-space: nowrap;
}
.dashboard-discrepancy-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  margin: 0;
  font-size: 0.75rem;
}
.dashboard-discrepancy-stats div {
  background: var(--bg-page);
  border-radius: 0.25rem;
  padding: 0.35rem 0.45rem;
}
.dashboard-discrepancy-stats dt {
  color: var(--text-muted);
  font-size: 0.65rem;
  margin: 0;
}
.dashboard-discrepancy-stats dd {
  margin: 0;
  font-weight: 600;
}
body.dashboard-discrepancy-open {
  overflow: hidden;
}
.dashboard-kpi-tile {
  text-align: left;
  border-radius: 0.5rem;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}
.dashboard-kpi-tile .text-3xl { font-size: 1.5rem; }
.dashboard-kpi-tile .text-sm { font-size: 0.75rem; }
.dashboard-kpi-tile .text-xs { font-size: 0.65rem; line-height: 1.2; }
.dashboard-kpi-risk { padding: 0.75rem 1rem; }
.dashboard-kpi-risk .text-3xl { font-size: 1.85rem; }
.dashboard-kpi-metric { padding: 0.45rem 0.65rem; }
.dashboard-kpi-metric .text-3xl { font-size: 1.25rem; }
.dashboard-chart-full {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.dashboard-chart-full .dashboard-chart-panel {
  flex: 1;
  min-height: 280px;
}
.dashboard-chart-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}
.dashboard-header-actions {
  text-align: right;
}

/* Full-page map report */
body.dashboard-map-page {
  height: auto;
  min-height: 100vh;
  overflow: auto;
}
body.dashboard-map-page .app-main {
  flex: 1;
  min-height: 0;
  overflow: visible;
  padding: 0.75rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
}
.dashboard-map-report-root {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: calc(100vh - 8rem);
}
.dashboard-map-report-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}
.dashboard-map-report-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0.75rem 1rem;
}
.dashboard-map-report-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}
.dashboard-map-report-canvas {
  flex: 1;
  min-height: min(72vh, 820px);
  width: 100%;
  display: flex;
  flex-direction: column;
}
.dashboard-map-report-canvas-inner {
  min-height: min(68vh, 780px);
}
.dashboard-map-report-canvas .leaflet-container,
.dashboard-map-report-canvas-inner .leaflet-container,
.falcon-map-canvas .leaflet-container {
  height: 100% !important;
  width: 100% !important;
  min-height: inherit;
  cursor: grab;
}
.dashboard-map-report-canvas .leaflet-container:active,
.falcon-map-canvas .leaflet-container:active { cursor: grabbing; }

/* Shared Falcon map shell (report + voyage) */
.falcon-map-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg-page);
}
.falcon-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.55rem;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
  background: var(--bg-surface);
}
.falcon-map-fullscreen-btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 0.375rem;
  border: 1px solid var(--brand-blue, #314f92);
  color: var(--brand-blue, #314f92);
  background: var(--bg-surface);
  cursor: pointer;
}
.falcon-map-fullscreen-btn:hover {
  background: rgba(49, 79, 146, 0.08);
}
.falcon-map-selection-hint {
  flex: 1;
  text-align: right;
}
.falcon-map-canvas {
  flex: 1;
  min-height: 0;
  position: relative;
}
.voyage-route-map-shell {
  flex: none;
  height: 220px;
  min-height: 220px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 0.375rem;
}
.voyage-route-map-shell .falcon-map-canvas {
  min-height: 180px;
  height: 180px;
}
.falcon-map-shell:fullscreen,
.falcon-map-shell.falcon-map-shell-fullscreen {
  width: 100%;
  height: 100%;
  max-height: 100vh;
  background: var(--bg-surface);
  border-radius: 0;
  border: none;
}
.falcon-map-shell:fullscreen .falcon-map-canvas,
.falcon-map-shell.falcon-map-shell-fullscreen .falcon-map-canvas {
  min-height: calc(100vh - 2.75rem);
}
.falcon-map-shell:fullscreen .falcon-map-toolbar,
.falcon-map-shell.falcon-map-shell-fullscreen .falcon-map-toolbar {
  padding: 0.5rem 0.75rem;
}

/* Selected route — brief pulse, then hold the highlight */
.leaflet-overlay-pane path.falcon-route-glow.falcon-route-glow-active {
  animation: falcon-route-pulse 0.9s ease-in-out 3;
  filter: drop-shadow(0 0 6px rgba(233, 159, 100, 0.85));
  stroke-linecap: round;
  stroke-linejoin: round;
}
.leaflet-overlay-pane path.falcon-route-line-selected {
  filter: drop-shadow(0 0 4px rgba(233, 159, 100, 0.75));
}
@keyframes falcon-route-pulse {
  0%, 100% {
    stroke-opacity: 0.55;
    stroke-width: 10;
  }
  50% {
    stroke-opacity: 1;
    stroke-width: 14;
  }
}
.falcon-route-falcon-selected .falcon-map-marker {
  filter: drop-shadow(0 0 10px rgba(233, 159, 100, 0.9));
  transform: scale(1.05);
}

.dashboard-split {
  display: grid;
  grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);
  gap: 0.5rem;
  align-items: stretch;
  min-height: 0;
  overflow: hidden;
  flex: 1;
}
.dashboard-map-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  margin-bottom: 0.35rem;
}
.dashboard-map-expand-btn,
.dashboard-map-close-btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 0.375rem;
  border: 1px solid var(--brand-blue, #314f92);
  color: var(--brand-blue, #314f92);
  background: var(--bg-surface);
  cursor: pointer;
  flex-shrink: 0;
}
.dashboard-map-expand-btn:hover,
.dashboard-map-close-btn:hover {
  background: rgba(49, 79, 146, 0.08);
}
.dashboard-map-close-btn {
  border-color: var(--text-muted);
  color: #334155;
}
.dashboard-map-slot {
  flex: 1;
  min-height: 14rem;
  display: flex;
  flex-direction: column;
}
.dashboard-embedded-map {
  flex: 1;
  min-height: 14rem;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 0.375rem;
}
.dashboard-embedded-map-canvas {
  flex: 1;
  min-height: 280px;
  height: 280px;
  position: relative;
}
.dashboard-map-overlay-slot .falcon-map-canvas {
  flex: 1;
  min-height: 480px;
  height: 100%;
  position: relative;
}
.dashboard-embedded-map [data-dashboard-map-target="routesJson"] {
  display: none;
}
.falcon-map-error {
  color: #b91c1c;
  font-weight: 600;
}
.falcon-map-toolbar-compact {
  padding: 0.25rem 0.45rem;
}
.dashboard-map-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.dashboard-map-overlay.is-open {
  display: flex;
}
body.dashboard-map-expanded {
  overflow: hidden;
}
.dashboard-map-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}
.dashboard-map-overlay-panel {
  position: relative;
  z-index: 1;
  width: min(96vw, 1400px);
  height: min(92vh, 920px);
  background: var(--bg-surface);
  border-radius: 0.5rem;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dashboard-map-overlay-controls .dashboard-map-overlay-period {
  width: 100%;
}
.dashboard-map-overlay-controls {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.dashboard-map-overlay-period {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}
.dashboard-presets-compact .dashboard-preset-btn {
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
}
.dashboard-timeline-row-compact {
  gap: 0.45rem;
}
.dashboard-map-overlay-title-block {
  flex: 1;
  min-width: 0;
}
.dashboard-map-overlay-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
  flex-shrink: 0;
}
.dashboard-map-overlay-slot {
  flex: 1;
  min-height: 0;
  padding: 0.5rem 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
}
.dashboard-map-overlay-slot .falcon-map-shell {
  flex: 1;
  min-height: 0;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 0.375rem;
}
.dashboard-embedded-map-canvas .leaflet-container,
.dashboard-map-overlay-slot .falcon-map-canvas .leaflet-container {
  height: 100% !important;
  width: 100% !important;
  min-height: inherit;
}
.dashboard-chart-panel,
.dashboard-map-panel {
  min-height: 14rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0.65rem 0.85rem;
  margin: 0;
}
.dashboard-chart-panel h2,
.dashboard-map-panel h2 {
  font-size: 1rem;
  margin: 0 0 0.25rem;
  flex-shrink: 0;
}
.dashboard-chart-panel .text-xs,
.dashboard-map-panel .text-xs {
  flex-shrink: 0;
  margin-bottom: 0.35rem;
}
.dashboard-chart-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  height: auto;
}
.dashboard-map {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: auto;
  z-index: 1;
}
.dashboard-map .leaflet-container {
  height: 100% !important;
  width: 100% !important;
  cursor: grab;
}
.dashboard-map .leaflet-container:active { cursor: grabbing; }

.dashboard-presets { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.dashboard-preset-btn {
  border: 1px solid var(--border-subtle);
  background: var(--bg-page);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.85rem;
  font-size: 0.8125rem;
  cursor: pointer;
}
.dashboard-preset-btn.dashboard-preset-active {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
}
.dashboard-timeline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.dashboard-range-slider { min-width: 8rem; accent-color: var(--brand-purple); }
@media (max-width: 960px) {
  body.dashboard-page { height: auto; overflow: auto; }
  body.dashboard-page .app-main { overflow: visible; }
  .dashboard-root { overflow: visible; }
  .dashboard-kpi-lead { grid-template-columns: 1fr; }
  .dashboard-status-filter-row { margin-left: 0; width: 100%; }
}
@media (max-width: 1199px) {
  .dashboard-split { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dashboard-kpi-strip { grid-template-columns: 1fr; }
}
.dashboard-kpi-tile:hover {
  box-shadow: 3px 3px 0 var(--brand-sunset);
}
.dashboard-kpi-tile.dashboard-tile-active {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}
.dashboard-snapshot-note {
  font-style: italic;
  color: var(--brand-purple);
}

.flash-toast {
  position: fixed;
  top: 4.75rem;
  left: 50%;
  transform: translateX(-50%) translateY(-0.35rem);
  z-index: 80;
  margin: 0;
  padding: 0.7rem 1.15rem;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  box-shadow: 3px 3px 0 var(--brand-sunset);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease, transform 0.45s ease;
  max-width: min(36rem, calc(100vw - 2rem));
  text-align: center;
}
.flash-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.flash-toast.is-fading {
  opacity: 0;
  transform: translateX(-50%) translateY(-0.35rem);
}
.flash-toast-notice {
  color: var(--brand-blue);
  background: var(--bg-surface);
  border: 2px solid var(--brand-blue);
}
.flash-toast-alert {
  color: #b91c1c;
  background: var(--bg-surface);
  border: 2px solid #dc2626;
}

.app-dialog {
  position: fixed;
  inset: 0;
  z-index: 4100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.app-dialog.is-open {
  display: flex;
}
.app-dialog[hidden] {
  display: none;
}
.app-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--brand-blue) 28%, transparent);
}
.app-dialog-panel {
  position: relative;
  z-index: 1;
  width: min(26rem, calc(100vw - 2rem));
  margin: 0;
  padding: 1.15rem 1.25rem 1.2rem;
  background: var(--bg-surface);
  border: 2px solid var(--brand-blue);
  border-radius: 0.75rem;
  box-shadow: 3px 3px 0 var(--brand-sunset);
}
.app-dialog-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-purple);
}
.app-dialog-title {
  margin: 0 0 0.55rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand-blue);
}
.app-dialog-message {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--text-primary);
}
.app-dialog-ok {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  padding: 0.4rem 1.1rem;
  border-radius: 0.75rem;
  border: 2px solid var(--brand-blue);
  background: var(--brand-blue);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--brand-sunset);
}
.app-dialog-ok:hover,
.app-dialog-ok:focus-visible {
  background: var(--brand-purple);
  border-color: var(--brand-purple);
  outline: none;
}

.flash-notice { margin-bottom: 1rem; color: #15803d; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 0.25rem; padding: 0.75rem; }
.flash-alert { margin-bottom: 1rem; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 0.25rem; padding: 0.75rem; }

/* Login shell */
.login-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--login-gradient-start), var(--login-gradient-mid), var(--login-gradient-end));
  position: relative;
  overflow: hidden;
}
.login-watermark {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0.14;
  z-index: 0;
}
.login-watermark img {
  width: min(72vmin, 640px);
  height: min(72vmin, 640px);
  max-width: none;
  max-height: none;
  object-fit: contain;
}
.login-content {
  position: relative;
  z-index: 1;
  width: min(26rem, calc(100% - 2rem));
  max-width: 26rem;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  margin: 0 auto;
}
.login-card {
  background: var(--bg-surface);
  border-radius: 0.75rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  padding: 2rem;
  border: 1px solid var(--border-subtle);
}
.login-logo { display: block; height: 3rem; width: auto; margin: 0 auto 1rem; }
.login-title { text-align: center; font-size: 1.35rem; font-weight: 700; color: var(--brand-blue); margin: 0 0 1.5rem; }
.login-form { display: flex; flex-direction: column; gap: 1rem; }
.login-field label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.25rem; color: var(--text-primary); }
.login-field input {
  width: 100%; box-sizing: border-box;
  border: 1px solid var(--border-subtle);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-page);
  color: var(--text-primary);
}
.login-submit {
  background: var(--brand-blue);
  color: #fff;
  border: none;
  border-radius: 0.375rem;
  padding: 0.625rem 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
}
.login-submit:hover { filter: brightness(1.05); }
.login-theme-toggle { margin-top: 1.25rem; text-align: center; }
.login-flash {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  text-align: center;
}
.login-flash-notice { background: #f0fdf4; color: #15803d; }
.login-flash-alert { background: #fef2f2; color: #b91c1c; }

/* MetaInfa footer */
.metainfa-footer {
  margin-top: auto;
  padding: 1rem 2rem;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  width: 100%;
  box-sizing: border-box;
}
.login-shell .metainfa-footer {
  margin-top: 0;
  padding: 0;
  width: 100%;
  background: transparent;
  border-top: none;
}
.login-shell .metainfa-footer-copy { color: rgba(255,255,255,0.85); text-align: center; }
.login-shell .metainfa-footer-link { color: #fff; justify-content: center; }
.metainfa-footer-copy { font-size: 0.75rem; color: var(--text-muted); margin: 0 0 0.35rem; }
.metainfa-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--brand-blue);
  font-size: 0.875rem;
  font-weight: 500;
}
.metainfa-footer-logo { height: 1.25rem; width: auto; }

/* Theme toggle */
.theme-toggle {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: inherit;
  border-radius: var(--radius-md);
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  cursor: pointer;
}
[data-theme="light"] .app-nav .theme-toggle,
.login-card .theme-toggle {
  background: var(--bg-page);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}
[data-theme="dark"] .app-nav .theme-toggle {
  background: color-mix(in srgb, var(--brand-blue) 18%, transparent);
  border-color: var(--brand-blue);
  color: var(--text-primary);
}

/* Falcon circular bevel icons */
.falcon-icon-key {
  border-radius: 50%;
  object-fit: cover;
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.45),
    inset 0 -2px 4px rgba(0,0,0,0.25),
    0 2px 6px rgba(0,0,0,0.2);
  border: 2px solid rgba(255,255,255,0.35);
  background: var(--bg-surface);
}
.falcon-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.falcon-avatar img { width: 100%; height: 100%; object-fit: cover; }
.falcon-leaflet-icon { background: transparent !important; border: none !important; }
.falcon-map-marker { display: flex; align-items: center; justify-content: center; }
.falcon-tooltip-wrapper { background: var(--bg-surface) !important; border: 1px solid var(--border-subtle) !important; border-radius: 0.5rem !important; padding: 0 !important; box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important; }
.falcon-tooltip { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; }
.falcon-tooltip-photo { width: 36px; height: 36px; }
.falcon-tooltip-name { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; }

.voyage-tooltip-wrapper { background: var(--bg-surface) !important; border: 1px solid var(--border-subtle) !important; border-radius: 0.5rem !important; padding: 0 !important; box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important; }
.voyage-tooltip { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.6rem 0.75rem; min-width: 12rem; }
.voyage-tooltip-row { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.8125rem; line-height: 1.3; }
.voyage-tooltip-label { color: var(--text-muted, #64748b); font-weight: 500; white-space: nowrap; }
.voyage-tooltip-row span:last-child { color: var(--text-primary); font-weight: 600; text-align: right; }

.falcon-tooltip-hover { position: relative; cursor: help; }
.falcon-tooltip-hover:hover::after,
.falcon-tooltip-hover:focus-visible::after,
.falcon-tooltip-hover:active::after {
  content: attr(data-tooltip-name);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 0.375rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  z-index: 20;
}

.bg-slate-100 { background: var(--bg-page, #f1f5f9); }
.bg-slate-50 { background: var(--bg-page, #f8fafc); }
.bg-slate-900 { background: #0f172a; }
.bg-green-50 { background: #f0fdf4; }
.bg-green-700 { background: #15803d; }
.bg-red-50 { background: #fef2f2; }
.bg-red-700 { background: #b91c1c; }
.bg-white { background: var(--bg-surface, #fff); }
.text-white { color: #fff; }
.text-green-700 { color: #15803d; }
.text-red-700 { color: #b91c1c; }
.text-slate-600 { color: var(--text-muted, #475569); }
.text-slate-500 { color: var(--text-muted, #475569); }
.text-slate-400 { color: var(--text-muted, #475569); }
.text-indigo-600 { color: #4f46e5; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-mono { font-family: ui-monospace, monospace; }
.min-h-screen { min-height: 100vh; }
.max-w-6xl { max-width: 72rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-1 { flex: 1; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.grid { display: grid; }
.block { display: block; }
.hidden { display: none; }
[hidden] { display: none !important; }
.w-full { width: 100%; }
.w-56 { width: 14rem; }
.w-40 { width: 10rem; }
.w-64 { width: 16rem; }
.w-16 { width: 4rem; }
.h-8 { height: 2rem; }
.h-12 { height: 3rem; }
.h-64 { height: 16rem; }
.shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.space-y-0 > * + * { margin-top: 0; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-t { border-top-left-radius: 0.25rem; border-top-right-radius: 0.25rem; }
.border { border: 1px solid var(--border-subtle, #cbd5e1); }
.border-t { border-top: 1px solid var(--border-subtle, #e2e8f0); }
.border-b { border-bottom: 1px solid var(--border-subtle, #e2e8f0); }
.border-l-4 { border-left: 4px solid; }
.border-green-200 { border-color: #bbf7d0; }
.border-red-200 { border-color: #fecaca; }
.border-slate-200 { border-color: var(--border-subtle, #e2e8f0); }
.border-transparent { border-color: transparent; }
.shadow { box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.shadow-md { box-shadow: 0 4px 6px rgba(0,0,0,0.07); }
.app-main .page-panel.overflow-hidden {
  overflow: visible;
}
.underline { text-decoration: underline; }
.no-underline { text-decoration: none; }
.whitespace-nowrap { white-space: nowrap; }
.text-center { text-align: center; }
.sticky { position: sticky; }
.top-4 { top: 1rem; }
.relative { position: relative; }
.absolute { position: absolute; }
.z-10 { z-index: 10; }
.cursor-pointer { cursor: pointer; }
.opacity-75 { opacity: 0.75; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.col-span-1 { grid-column: span 1; }

@media (min-width: 768px) {
  .md\\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .lg\\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

code { background: var(--border-subtle, #e2e8f0); padding: 0.1rem 0.3rem; border-radius: 0.2rem; font-size: 0.875em; }
table { border-collapse: collapse; }
.app-main table th,
.app-main table td {
  text-align: center;
  vertical-align: middle;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button.bg-transparent { background: transparent; border: none; }

:focus-visible {
  outline: 2px solid var(--brand-sunset, #e99f64);
  outline-offset: 2px;
}
.app-nav :focus-visible {
  outline-color: #fff;
}

.border-red-500 { border-color: #ef4444; }
.text-red-600 { color: #dc2626; }
.list-disc { list-style-type: disc; }
.list-inside { list-style-position: inside; }

/* Airport / country / prefix autocomplete */
.airport-results, .prefix-dropdown, .country-results { max-height: 12rem; overflow-y: auto; }
.airport-result, .prefix-option, .country-option {
  display: block; width: 100%; text-align: left; padding: 0.5rem 0.75rem;
  background: var(--bg-surface, #fff); border: none; border-bottom: 1px solid #f1f5f9; cursor: pointer;
}
.airport-result:hover, .prefix-option:hover, .country-option:hover { background: var(--brand-blue-soft, #eff6ff); }

/* SLA strip */
.sla-ok { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.sla-breached { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; animation: sla-pulse 0.7s ease-in-out 3; }
.workflow-met { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.workflow-missed { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.workflow-pending { background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; }
.workflow-upcoming { background: #f8fafc; color: var(--text-muted); border: 1px dashed #cbd5e1; opacity: 0.92; }
.step-upcoming-label { font-weight: 500; font-size: 0.6875rem; opacity: 0.85; }
.workflow-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}
.workflow-met .workflow-icon { background: #166534; color: #fff; }
.workflow-missed .workflow-icon { background: #d97706; color: #fff; }
.sla-breached .workflow-icon { background: #dc2626; color: #fff; }
@keyframes sla-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.85; } }
@media (prefers-reduced-motion: reduce) {
  .leaflet-overlay-pane path.falcon-route-glow.falcon-route-glow-active,
  .sla-breached {
    animation: none;
  }
}

/* Voyage show — scrollable page layout (sections stack naturally) */
body.voyage-show-page {
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}
body.voyage-show-page .app-main {
  flex: 1;
  min-height: 0;
  overflow: visible;
  padding: 0.75rem 1rem 1.5rem;
  display: block;
}
body.voyage-show-page .metainfa-footer {
  flex-shrink: 0;
  padding: 0.3rem 1rem;
}
body.voyage-show-page .metainfa-footer-copy { margin-bottom: 0.1rem; font-size: 0.7rem; }
body.voyage-show-page .flash-notice,
body.voyage-show-page .flash-alert {
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  padding: 0.35rem 0.65rem;
}

.voyage-show-root {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 100%;
}

.voyage-show-flights {
  margin: 0;
  padding: 0.65rem 0.85rem;
}
.voyage-expenses-leg-title { font-size: 0.8125rem; font-weight: 600; margin: 0 0 0.35rem; color: var(--brand-blue); }

.flights-leg-title { font-size: 0.875rem; font-weight: 600; margin: 0 0 0.5rem; color: var(--brand-blue); }
.flight-segment-row {
  display: grid;
  grid-template-columns: minmax(4rem, 0.6fr) minmax(6rem, 0.75fr) minmax(5rem, 0.6fr) minmax(9rem, 1fr) minmax(0, 1.1fr) minmax(0, 1.1fr) auto;
  gap: 0.5rem;
  align-items: end;
  margin-bottom: 0.5rem;
  position: relative;
}
.flight-field { min-width: 0; position: relative; }
.flight-field span { display: block; font-size: 0.6875rem; color: var(--text-muted, #64748b); margin-bottom: 0.15rem; }
.flight-out-of-window { border-color: #dc2626 !important; background: #fef2f2; }
.flight-lookup-matches.hidden { display: none; }
.flight-lookup-status { grid-column: 1 / -1; font-size: 0.8125rem; margin: 0 0 0.25rem; }
.flight-lookup-status--ok { color: #15803d; }
.flight-lookup-status--warn { color: #b45309; }
.flight-lookup-status--error { color: #dc2626; }
.flight-lookup-status--loading { color: var(--text-muted); font-style: italic; }
.flight-remove-btn { background: none; border: none; cursor: pointer; padding: 0.35rem 0; white-space: nowrap; }
.flights-table th, .flights-table td { padding: 0.35rem 0.5rem; }
@media (max-width: 768px) {
  .flight-segment-row { grid-template-columns: 1fr; }
}
.voyage-show-header-bar { margin: 0; padding: 0.55rem 0.85rem; }
.voyage-section-title {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
}
.voyage-show-workflow {
  margin: 0;
  padding: 0.65rem 0.85rem;
}
.voyage-show-lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}
.voyage-show-map-panel,
.voyage-show-expenses {
  margin: 0;
  padding: 0.65rem 0.85rem;
}
.voyage-show-expenses-full { grid-column: 1 / -1; }
.voyage-route-map-shell .voyage-route-map {
  border: none;
  border-radius: 0;
}
.voyage-expenses-scroll {
  overflow: visible;
}
.voyage-expenses-table th,
.voyage-expenses-table td { padding: 0.35rem 0.5rem; font-size: 0.8125rem; }
.voyage-empty-note { margin: 0; }
.voyage-show-close {
  margin: 0;
  padding: 0.65rem 0.85rem;
  flex-shrink: 0;
}
.voyage-show-recovery {
  margin: 0;
  padding: 0.65rem 0.85rem;
}
.voyage-close-forms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.voyage-close-form textarea { font-size: 0.8125rem; }

.voyage-pre-close-review { margin: 0; padding: 0.65rem 0.85rem; }
.voyage-pre-close-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.voyage-pre-close-summary-text {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  font-size: 0.875rem;
}
.voyage-pre-close-stat { color: #475569; }
.voyage-pre-close-more-btn {
  background: #1e3a5f;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  cursor: pointer;
}
body.voyage-review-modal-open { overflow: hidden; }
.voyage-review-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.voyage-review-modal[hidden] { display: none !important; }
.voyage-review-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}
.voyage-review-modal-panel {
  position: relative;
  z-index: 1;
  background: var(--bg-surface);
  border-radius: 8px;
  width: min(960px, 100%);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}
.voyage-review-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}
.voyage-review-close-btn {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}
.voyage-review-modal-body {
  overflow: auto;
  padding: 0.75rem 1rem 1rem;
}
.voyage-review-section { margin-bottom: 1rem; }
.voyage-review-subtitle {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.voyage-review-photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.voyage-review-photo-card {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.35rem;
  background: var(--bg-page);
  cursor: pointer;
  text-align: center;
  font-size: 0.75rem;
}
.voyage-review-photo-thumb {
  display: block;
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 0.25rem;
}
.voyage-review-receipt-link {
  border: none;
  background: none;
  color: #1d4ed8;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.8125rem;
  padding: 0;
}
.voyage-review-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.voyage-review-lightbox[hidden] { display: none !important; }
.voyage-review-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}
.voyage-review-lightbox-img {
  position: relative;
  z-index: 1;
  max-width: min(960px, 95vw);
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}
.voyage-review-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  font-size: 1.25rem;
  cursor: pointer;
}
.workflow-evidence-address {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 900px) {
  .voyage-show-lower { grid-template-columns: 1fr; }
  .voyage-close-forms { grid-template-columns: 1fr; }
}

/* Voyage show header — single row */
.voyage-show-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}
.voyage-header-id {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-blue);
  white-space: nowrap;
  flex-shrink: 0;
}
.voyage-header-sep { color: var(--text-muted, #94a3b8); flex-shrink: 0; }
.voyage-header-item {
  font-size: 0.875rem;
  color: var(--text-muted, #475569);
  white-space: nowrap;
  flex-shrink: 0;
}
.voyage-header-falcon .inline-flex { vertical-align: middle; }
.voyage-header-back {
  margin-left: auto;
  font-size: 0.875rem;
  color: var(--brand-blue);
  text-decoration: underline;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Workflow grid — 2 rows × 4 stages */
.workflow-grid { display: flex; flex-direction: column; gap: 0.5rem; }
.workflow-grid-compact { gap: 0.4rem; }
.workflow-grid-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}
.workflow-grid-row:first-child { align-items: end; }
.workflow-grid-row:first-child .workflow-stage-cell { justify-content: flex-end; }
.workflow-grid-row:last-child { align-items: start; }
.workflow-grid-row:last-child .workflow-stage-cell { justify-content: flex-start; }
@media (max-width: 1100px) {
  .workflow-grid-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .workflow-grid-row { grid-template-columns: 1fr; }
}
.workflow-stage-cell { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; min-height: 0; }
.workflow-stage-pill {
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
  flex-direction: column;
  align-items: center;
  padding: 0.3rem 0.45rem;
  font-size: 0.6875rem;
  gap: 0.15rem;
  line-height: 1.25;
  white-space: normal;
}
.workflow-stage-pill .step-label { font-size: 0.6875rem; font-weight: 600; }
.step-sla-detail {
  font-size: 0.625rem;
  line-height: 1.35;
  text-align: center;
  max-width: 100%;
  font-variant-numeric: tabular-nums;
}
.step-sla-delayed { font-weight: 500; }
.step-upcoming-label { font-weight: 500; font-size: 0.625rem; opacity: 0.85; }

.workflow-evidence-inline {
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: auto auto;
  gap: 0.2rem 0.35rem;
  padding: 0.25rem;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 0.375rem;
  background: var(--bg-page, #f8fafc);
}
.workflow-evidence-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 0.25rem;
  grid-row: span 2;
}
.workflow-evidence-compact-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.625rem;
  color: var(--text-muted, #64748b);
  line-height: 1.2;
}
.workflow-evidence-map-inline {
  grid-column: 1 / -1;
  height: 56px;
  width: 100%;
  border-radius: 0.25rem;
  overflow: hidden;
}

.workflow-evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
@media (max-width: 900px) {
  .workflow-evidence-grid { grid-template-columns: 1fr; }
}
.workflow-evidence-title {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--brand-blue);
}
.workflow-evidence {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 0.5rem;
  background: var(--bg-page, #f8fafc);
}
.workflow-evidence-media {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 0.75rem;
  align-items: start;
}
.workflow-evidence-photo {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 0.375rem;
  border: 1px solid var(--border-subtle, #e2e8f0);
  background: var(--bg-surface);
}
.workflow-evidence-meta { font-size: 0.8125rem; color: var(--text-muted, #475569); line-height: 1.45; }
.workflow-evidence-meta p { margin: 0 0 0.35rem; }
.workflow-evidence-time strong,
.workflow-evidence-coords strong { color: var(--text-primary, #0f172a); }
.workflow-evidence-address { font-size: 0.75rem; }
.workflow-evidence-map { height: 180px; width: 100%; }

/* Voyage timeline animation */
.voyage-timeline { list-style: none; padding: 0; margin: 0; }
.timeline-item {
  display: flex; gap: 0.75rem; padding: 0.75rem 0; position: relative;
  animation: timeline-fade-in 0.5s ease forwards; opacity: 0;
}
.timeline-item:nth-child(1) { animation-delay: 0s; }
.timeline-item:nth-child(2) { animation-delay: 0.1s; }
.timeline-item:nth-child(3) { animation-delay: 0.2s; }
.timeline-item:nth-child(4) { animation-delay: 0.3s; }
.timeline-item:nth-child(5) { animation-delay: 0.4s; }
@keyframes timeline-fade-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
.timeline-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--brand-purple);
  margin-top: 0.35rem; flex-shrink: 0;
}
.timeline-item:not(:last-child)::after {
  content: ""; position: absolute; left: 4px; top: 1.5rem; bottom: 0;
  width: 2px; background: var(--border-subtle, #e2e8f0);
}

/* Status badges */
.status-badge { font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: var(--radius-sm); background: #f1f5f9; }
.stat-card { transition: box-shadow 0.15s ease; background: var(--bg-surface); border: 1px solid var(--border-subtle); }

fieldset { border: 1px solid var(--border-subtle, #e2e8f0); border-radius: 0.5rem; padding: 1rem; }
legend { padding: 0 0.5rem; }

/* Voyage next-action summary (list + dashboard) */
.voyage-action-cell { min-width: 12rem; }
.voyage-action-owner { font-size: 0.75rem; color: var(--text-muted, #64748b); margin-bottom: 0.15rem; }
.voyage-action-label { font-size: 0.875rem; line-height: 1.25; }
.voyage-action-progress { margin-top: 0.15rem; }
.voyage-action-sla { margin-top: 0.2rem; }
.voyage-action-overdue { background: #fef2f2; }
.voyage-action-due-soon { background: #fffbeb; }
.voyage-action-on-track { background: #f0fdf4; }
.voyage-show-next-action {
  margin: 0;
  padding: 0.55rem 0.85rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-subtle, #e2e8f0);
  background: var(--bg-surface, #fff);
}

/* Nav utilities — theme icon + account menu */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.app-nav-utilities { align-items: center; }
.theme-toggle-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; padding: 0; border-radius: var(--radius-md);
}
.theme-toggle-icon svg { display: block; }
.theme-toggle-icon .theme-toggle-icon-sun,
.theme-toggle-icon .theme-toggle-icon-moon {
  display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle-icon [hidden] { display: none !important; }

.nav-user-menu { position: relative; }
.nav-user-menu-trigger {
  display: inline-flex; align-items: center; gap: 0.25rem;
  background: transparent;
  border: 2px solid var(--brand-blue);
  border-radius: 0.75rem;
  padding: 0.35rem 0.55rem 0.35rem 0.35rem;
  cursor: pointer;
  color: var(--brand-blue);
}
[data-theme="dark"] .nav-user-menu-trigger {
  color: var(--text-primary);
}
.nav-user-menu-trigger:hover {
  background: color-mix(in srgb, var(--brand-blue) 12%, transparent);
  box-shadow: 3px 3px 0 var(--brand-sunset);
}
.nav-user-menu-logo-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.nav-user-menu-logo {
  display: block; width: 2rem; height: 2rem; object-fit: contain;
  border-radius: 50%; background: rgba(255, 255, 255, 0.95); padding: 0.15rem;
}
.nav-user-menu-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 9999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
  border: 2px solid #ffffff;
  box-sizing: content-box;
}
[data-theme="dark"] .nav-user-menu-badge {
  border-color: var(--bg-surface);
}
.nav-user-menu-chevron { opacity: 0.85; flex-shrink: 0; }
.nav-user-menu-panel {
  position: absolute; right: 0; top: calc(100% + 0.45rem); min-width: 14rem;
  background: var(--bg-surface, #fff); color: var(--text-primary, #0f172a);
  border: 1px solid var(--border-subtle, #e2e8f0); border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15); z-index: 50; overflow: hidden;
}
.nav-user-menu-header {
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-subtle, #e2e8f0);
  background: color-mix(in srgb, var(--brand-blue-soft) 35%, var(--bg-surface));
}
.nav-user-menu-email {
  margin: 0; font-size: 0.875rem; font-weight: 600; word-break: break-all;
}
.nav-user-menu-meta {
  margin: 0.25rem 0 0; font-size: 0.75rem; color: var(--text-muted, #64748b);
}
.nav-user-menu-items { padding: 0.35rem 0; }
.nav-user-menu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.5rem 1rem; font-size: 0.875rem;
  color: var(--text-primary); text-decoration: none;
}
.nav-user-menu-item:hover { background: var(--brand-blue-soft, #e0e5ef); }
.nav-user-menu-item-notifications { font-weight: 500; }
.nav-user-menu-item-badge {
  min-width: 1.25rem;
  padding: 0 0.35rem;
  border-radius: var(--radius-sm);
  background: #dc2626;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.35rem;
  text-align: center;
}
.nav-user-menu-footer {
  padding: 0.5rem 1rem 0.75rem; border-top: 1px solid var(--border-subtle, #e2e8f0);
}
.nav-user-menu-logout {
  width: 100%; padding: 0.45rem 0.75rem; border: none; border-radius: 0.375rem;
  background: #fef2f2; color: #b91c1c; font-size: 0.875rem; font-weight: 600;
  cursor: pointer;
}
.nav-user-menu-logout:hover { background: #fee2e2; }
[data-theme="dark"] .nav-user-menu-panel {
  background: var(--bg-surface); border-color: var(--border-subtle);
}

/* -------------------------------------------------------------------------- */
/* Falcon UI components — uiverse references, brand tokens                    */
/* -------------------------------------------------------------------------- */

.app-shell input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="range"]),
.app-shell select,
.app-shell textarea {
  border: 1.5px solid var(--border-subtle);
  border-radius: 1rem;
  background: var(--bg-surface);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  transition: border 150ms cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}
.app-shell input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="range"]):focus,
.app-shell select:focus,
.app-shell textarea:focus {
  outline: none;
  border-color: var(--brand-blue);
}
.falcon-input-group {
  position: relative;
}
.falcon-input-group .falcon-label {
  position: absolute;
  left: 15px;
  color: var(--text-muted);
  pointer-events: none;
  transform: translateY(0.85rem);
  transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
}
.falcon-input-group input:focus ~ .falcon-label,
.falcon-input-group input:not(:placeholder-shown) ~ .falcon-label,
.falcon-input-group input:valid ~ .falcon-label {
  transform: translateY(-50%) scale(0.8);
  background: var(--bg-surface);
  padding: 0 0.2em;
  color: var(--brand-blue);
}

.app-shell .falcon-search-group {
  font-family: inherit;
  margin: 0 0 1rem;
  max-width: 24rem;
  width: 100%;
  position: relative;
}
.app-shell .falcon-search-group input {
  font-size: 1rem;
  padding: 0.8em 2.4em 0.8em 0.8em;
  outline: none;
  border: 2px solid var(--brand-blue);
  background-color: transparent;
  border-radius: 20px;
  width: 100%;
  box-sizing: border-box;
  color: var(--text-primary);
}
.app-shell .falcon-search-group label {
  font-size: 1rem;
  position: absolute;
  left: 0;
  top: 0;
  padding: 0.8em;
  margin-left: 0.5em;
  pointer-events: none;
  transition: all 0.3s ease;
  color: var(--text-muted, #64748b);
}
.app-shell .falcon-search-group :is(input:focus, input:not(:placeholder-shown)) ~ label {
  transform: translateY(-50%) scale(0.9);
  margin: 0;
  margin-left: 1.3em;
  padding: 0.4em;
  background-color: var(--bg-surface);
  color: var(--brand-blue);
}
.app-shell .falcon-search-group :is(input:focus, input:not(:placeholder-shown)) {
  border-color: var(--brand-sunset);
}
.table-search-clear {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--brand-blue) 12%, transparent);
  color: var(--brand-blue);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.table-search-clear:hover {
  background: color-mix(in srgb, var(--brand-sunset) 35%, transparent);
}
.table-search-clear[hidden] {
  display: none;
}
.table-search-hit {
  background: color-mix(in srgb, var(--brand-sunset) 55%, transparent);
  color: inherit;
  padding: 0 0.12em;
  border-radius: 0.15rem;
  font-weight: 600;
}
.table-search-empty {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted, #64748b);
}

/* 1. Theme pill switch (alexruix/splendid-liger-23) */
.falcon-switch {
  font-size: 17px;
  position: relative;
  display: inline-block;
  width: 3.5em;
  height: 2em;
  flex-shrink: 0;
}
.falcon-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.falcon-switch .slider {
  --switch-bg: var(--brand-purple);
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--switch-bg);
  transition: 0.5s;
  border-radius: 30px;
}
.falcon-switch .slider:before {
  position: absolute;
  content: "";
  height: 1.4em;
  width: 1.4em;
  border-radius: 50%;
  left: 10%;
  bottom: 15%;
  box-shadow: inset 8px -4px 0 0 var(--brand-sunset);
  background: var(--switch-bg);
  transition: 0.5s;
}
.falcon-switch input:checked + .slider {
  background-color: var(--brand-blue);
}
.falcon-switch input:checked + .slider:before {
  transform: translateX(100%);
  box-shadow: inset 15px -4px 0 15px var(--brand-sunset);
  background: var(--brand-blue);
}

/* 3. Login glass card (santhosh_2608/evil-robin-98) */
.login-shell .login-content {
  max-width: 26rem;
}
.login-shell .metainfa-footer-link {
  display: flex;
  width: 100%;
}
.login-wrapper {
  --blob-1-color: var(--brand-sunset);
  --blob-2-color: var(--brand-purple);
  --btn-hover-glow: color-mix(in srgb, var(--brand-purple) 25%, transparent);
  --input-focus-glow: color-mix(in srgb, var(--brand-purple) 15%, transparent);
  position: relative;
  width: 100%;
  animation: falcon-float-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(30px);
}
@keyframes falcon-float-up {
  to { opacity: 1; transform: translateY(0); }
}
.login-card {
  position: relative;
  width: 100%;
  background-color: #0d0f14;
  border-radius: 24px;
  padding: 36px 28px;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2), 0 8px 16px rgba(0, 0, 0, 0.1);
  border: none;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.login-wrapper:hover .login-card {
  transform: translateY(-6px);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.3), 0 12px 24px rgba(0, 0, 0, 0.15);
}
.login-glow-blob {
  position: absolute;
  filter: blur(45px);
  border-radius: 50%;
  z-index: 0;
  opacity: 0.6;
  animation: falcon-pulse-glow 4s infinite alternate ease-in-out;
  pointer-events: none;
}
.login-blob-1 {
  top: -30px;
  right: -30px;
  width: 170px;
  height: 170px;
  background: var(--blob-1-color, var(--brand-sunset));
}
.login-blob-2 {
  bottom: -50px;
  left: -50px;
  width: 210px;
  height: 210px;
  background: var(--blob-2-color, var(--brand-purple));
  animation-delay: -2s;
}
@keyframes falcon-pulse-glow {
  0% { transform: scale(0.9); opacity: 0.5; }
  100% { transform: scale(1.1); opacity: 0.7; }
}
.login-dark-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(5, 5, 8, 0.85) 30%, transparent 100%);
  z-index: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  border-radius: inherit;
  pointer-events: none;
}
.login-card-inner {
  position: relative;
  z-index: 10;
  text-align: center;
}
.login-card .login-form {
  text-align: left;
}
.login-card .login-logo {
  position: relative;
  z-index: 10;
  height: 3.25rem;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.25));
}
.login-card .login-title {
  position: relative;
  z-index: 10;
  color: #fff;
}
.login-card .login-form,
.login-card .login-theme-toggle {
  position: relative;
  z-index: 10;
}
.login-card .login-field label {
  color: rgba(255, 255, 255, 0.7);
}
.login-card .login-field input {
  width: 100%;
  padding: 1.05em 1.2em;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: #fff;
  outline: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
}
.login-card .login-field input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
.login-card .login-field input:focus {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 20px var(--input-focus-glow);
  transform: translateY(-2px);
}
.login-card .login-submit,
.login-card .falcon-btn {
  width: 100%;
}
.login-card .theme-toggle,
.login-card .falcon-switch {
  color: #fff;
}
.login-flash {
  position: relative;
  z-index: 10;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  margin: 0;
}

/* 4. Clock loader — overlay wash stays --bg-page */
.falcon-loader-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 4000;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: color-mix(in srgb, var(--bg-page) 55%, transparent);
  backdrop-filter: blur(2px);
}
.falcon-loader-overlay.is-visible {
  display: flex;
  pointer-events: auto;
}
.falcon-loader {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--brand-blue);
  position: relative;
  flex-shrink: 0;
  background: radial-gradient(circle at center, var(--brand-sunset) 0 3px, transparent 3.5px);
}
.falcon-loader-inline {
  margin: 0 auto;
}
.falcon-loader.compact {
  width: 28px;
  height: 28px;
  border-width: 1.5px;
  background: radial-gradient(circle at center, var(--brand-sunset) 0 2px, transparent 2.5px);
}
.falcon-loader::before,
.falcon-loader::after {
  content: "";
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform-origin: bottom center;
  border-radius: 2px;
}
.falcon-loader::before {
  width: 2px;
  height: 35%;
  margin-left: -1px;
  background: var(--brand-sunset);
  animation: falcon-clock-spin 1s linear infinite;
}
.falcon-loader::after {
  width: 4px;
  height: 25%;
  margin-left: -2px;
  background: var(--brand-purple);
  animation: falcon-clock-spin 12s linear infinite;
}
.falcon-loader.compact::before {
  width: 1.5px;
  margin-left: -0.75px;
}
.falcon-loader.compact::after {
  width: 3px;
  margin-left: -1.5px;
}
@keyframes falcon-clock-spin {
  to { transform: rotate(1turn); }
}

/* 5. Action button (ilkhoeri/foolish-shrimp-59) */
.falcon-btn {
  --round: 0.75rem;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all 0.25s ease;
  background:
    radial-gradient(65.28% 65.28% at 50% 100%, color-mix(in srgb, var(--brand-sunset) 80%, transparent) 0%, transparent 100%),
    linear-gradient(0deg, var(--brand-purple), var(--brand-blue));
  border-radius: var(--round);
  border: none;
  outline: none;
  padding: 12px 18px;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
}
.falcon-btn::before,
.falcon-btn::after {
  content: "";
  position: absolute;
  inset: var(--space);
  transition: all 0.5s ease-in-out;
  border-radius: calc(var(--round) - var(--space));
  z-index: 0;
}
.falcon-btn::before {
  --space: 1px;
  background: linear-gradient(177.95deg, rgba(255, 255, 255, 0.19) 0%, rgba(255, 255, 255, 0) 100%);
}
.falcon-btn::after {
  --space: 2px;
  background:
    radial-gradient(65.28% 65.28% at 50% 100%, color-mix(in srgb, var(--brand-sunset) 80%, transparent) 0%, transparent 100%),
    linear-gradient(0deg, var(--brand-purple), var(--brand-blue));
}
.falcon-btn:active { transform: scale(0.95); }
.falcon-btn.falcon-btn-compact {
  padding: 6px 10px;
  font-size: 0.75rem;
}
.falcon-btn.falcon-btn-compact .inner {
  font-size: 13px;
  gap: 4px;
}
.falcon-btn.falcon-btn-compact .inner svg.icon {
  width: 14px;
  height: 14px;
}
.falcon-btn .fold {
  z-index: 1;
  position: absolute;
  top: 0;
  right: 0;
  height: 1rem;
  width: 1rem;
  display: inline-block;
  transition: all 0.5s ease-in-out;
  background: radial-gradient(100% 75% at 55%, color-mix(in srgb, var(--brand-sunset) 80%, transparent) 0%, transparent 100%);
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.45);
  border-bottom-left-radius: 0.5rem;
  border-top-right-radius: var(--round);
}
.falcon-btn .fold::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 150%;
  height: 150%;
  transform: rotate(45deg) translateX(0%) translateY(-18px);
  background-color: var(--bg-page, #e8e8e8);
  pointer-events: none;
}
.falcon-btn:hover .fold {
  margin-top: -1rem;
  margin-right: -1rem;
}
.falcon-btn .points_wrapper {
  overflow: hidden;
  width: 100%;
  height: 100%;
  pointer-events: none;
  position: absolute;
  z-index: 1;
  inset: 0;
}
.falcon-btn .point {
  bottom: -10px;
  position: absolute;
  animation: falcon-floating-points infinite ease-in-out;
  pointer-events: none;
  width: 2px;
  height: 2px;
  background-color: #fff;
  border-radius: 9999px;
}
@keyframes falcon-floating-points {
  0% { transform: translateY(0); }
  85% { opacity: 0; }
  100% { transform: translateY(-55px); opacity: 0; }
}
.falcon-btn .point:nth-child(1) { left: 10%; opacity: 1; animation-duration: 2.35s; animation-delay: 0.2s; }
.falcon-btn .point:nth-child(2) { left: 30%; opacity: 0.7; animation-duration: 2.5s; animation-delay: 0.5s; }
.falcon-btn .point:nth-child(3) { left: 25%; opacity: 0.8; animation-duration: 2.2s; animation-delay: 0.1s; }
.falcon-btn .point:nth-child(4) { left: 44%; opacity: 0.6; animation-duration: 2.05s; }
.falcon-btn .point:nth-child(5) { left: 50%; opacity: 1; animation-duration: 1.9s; }
.falcon-btn .point:nth-child(6) { left: 75%; opacity: 0.5; animation-duration: 1.5s; animation-delay: 1.5s; }
.falcon-btn .point:nth-child(7) { left: 88%; opacity: 0.9; animation-duration: 2.2s; animation-delay: 0.2s; }
.falcon-btn .point:nth-child(8) { left: 58%; opacity: 0.8; animation-duration: 2.25s; animation-delay: 0.2s; }
.falcon-btn .point:nth-child(9) { left: 98%; opacity: 0.6; animation-duration: 2.6s; animation-delay: 0.1s; }
.falcon-btn .point:nth-child(10) { left: 65%; opacity: 1; animation-duration: 2.5s; animation-delay: 0.2s; }
.falcon-btn .inner {
  z-index: 2;
  gap: 6px;
  position: relative;
  width: 100%;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
}
.falcon-btn .inner svg.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
}
.falcon-btn:hover svg.icon {
  animation: falcon-icon-dash 1s linear forwards, falcon-icon-fill 0.1s linear forwards 0.95s;
}
@keyframes falcon-icon-dash {
  from { stroke-dasharray: 0 0 0 0; }
  to { stroke-dasharray: 68 68 0 0; }
}
@keyframes falcon-icon-fill {
  to { fill: white; }
}

/* 6. Circular splash checkbox (Shoh2008/big-deer-80) */
.falcon-checkbox {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}
.falcon-checkbox .cbx {
  position: relative;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.falcon-checkbox .cbx input {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-subtle);
  border-radius: 50%;
  margin: 0;
  cursor: pointer;
  background: var(--bg-surface);
}
.falcon-checkbox .cbx .splash {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}
.falcon-checkbox .cbx svg {
  position: absolute;
  top: 5px;
  left: 4px;
  z-index: 1;
  pointer-events: none;
  width: 16px;
  height: 16px;
}
.falcon-checkbox .cbx svg path {
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 19;
  stroke-dashoffset: 19;
  fill: none;
  transition: stroke-dashoffset 0.3s ease;
  transition-delay: 0.2s;
}
.falcon-checkbox .cbx input:checked + .splash {
  animation: falcon-checkbox-splash 0.6s ease forwards;
}
.falcon-checkbox .cbx input:checked + .splash + svg path {
  stroke-dashoffset: 0;
}
@keyframes falcon-checkbox-splash {
  40% {
    background: var(--brand-purple);
    box-shadow:
      0 -18px 0 -8px var(--brand-purple),
      16px -8px 0 -8px var(--brand-purple),
      16px 8px 0 -8px var(--brand-purple),
      0 18px 0 -8px var(--brand-purple),
      -16px 8px 0 -8px var(--brand-purple),
      -16px -8px 0 -8px var(--brand-purple);
  }
  100% {
    background: var(--brand-purple);
    box-shadow:
      0 -36px 0 -10px transparent,
      32px -16px 0 -10px transparent,
      32px 16px 0 -10px transparent,
      0 36px 0 -10px transparent,
      -32px 16px 0 -10px transparent,
      -32px -16px 0 -10px transparent;
  }
}

/* 7. Two-option toggle (Shoh2008/cowardly-catfish-27) */
.falcon-toggle-pair {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}
.falcon-toggle-pair input[type="checkbox"] {
  background-image:
    linear-gradient(hsla(0, 0%, 0%, 0.1), hsla(0, 0%, 100%, 0.1)),
    linear-gradient(to right, var(--brand-sunset) 50%, var(--brand-blue) 50%);
  background-size: 100% 100%, 200% 100%;
  background-position: 0 0, 15px 0;
  border-radius: 25px;
  box-shadow:
    inset 0 1px 4px hsla(0, 0%, 0%, 0.35),
    0 0 0 1px var(--border-subtle);
  cursor: pointer;
  height: 25px;
  padding-left: 0;
  padding-right: 25px;
  width: 75px;
  box-sizing: content-box;
  appearance: none;
  -webkit-appearance: none;
  transition: 0.25s;
  border: none;
  margin: 0;
}
.falcon-toggle-pair input[type="checkbox"]::after {
  background-color: var(--bg-surface);
  border-radius: 25px;
  box-shadow: 0 1px 3px hsla(0, 0%, 0%, 0.35);
  content: "";
  display: block;
  height: 25px;
  width: 50px;
}
.falcon-toggle-pair input[type="checkbox"]:checked {
  background-position: 0 0, 35px 0;
  padding-left: 25px;
  padding-right: 0;
}
.falcon-toggle-pair-labels {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  line-height: 1.2;
  color: var(--text-muted);
}
.falcon-toggle-pair-labels strong {
  color: var(--text-primary);
}

/* 8. Glass tile (SteveBloX/dangerous-warthog-85) — FAQ question chrome */
.falcon-tile,
.dashboard-kpi-tile.stat-card {
  box-sizing: border-box;
  background: color-mix(in srgb, var(--bg-surface) 58%, transparent);
  border: 2px solid var(--brand-blue);
  box-shadow: 3px 3px 0 var(--brand-sunset);
  backdrop-filter: blur(6px);
  border-radius: 0.75rem;
  transition: all 0.5s;
  user-select: none;
}
[data-theme="dark"] .falcon-tile,
[data-theme="dark"] .dashboard-kpi-tile.stat-card {
  border-color: rgba(255, 255, 255, 0.12);
}
.falcon-tile:hover,
.dashboard-kpi-tile.stat-card:hover {
  border-color: var(--brand-purple);
  transform: scale(1.05);
}
.falcon-tile:active,
.dashboard-kpi-tile.stat-card:active {
  transform: scale(0.95) rotateZ(1.7deg);
}

/* 9. Radio pills (Pradeepsaranbishnoi/selfish-ladybug-61) — ready for future groups */
.falcon-radio {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.falcon-radio label {
  display: flex;
  cursor: pointer;
  font-weight: 500;
  position: relative;
  overflow: hidden;
  margin-bottom: 0.25em;
}
.falcon-radio label input {
  position: absolute;
  left: -9999px;
}
.falcon-radio label span {
  display: flex;
  align-items: center;
  padding: 0.375em 0.75em 0.375em 0.375em;
  border-radius: 99em;
  transition: 0.25s ease;
  color: var(--brand-blue);
}
.falcon-radio label span:hover {
  background-color: var(--brand-blue-soft);
}
.falcon-radio label span::before {
  display: flex;
  flex-shrink: 0;
  content: "";
  background-color: var(--bg-surface);
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  margin-right: 0.375em;
  transition: 0.25s ease;
  box-shadow: inset 0 0 0 0.125em var(--brand-purple);
}
.falcon-radio label input:checked + span {
  background-color: var(--brand-blue);
  color: #fff;
}
.falcon-radio label input:checked + span::before {
  box-shadow: inset 0 0 0 0.4375em var(--brand-purple);
}

/* 10. Tooltip + FAQ accordion (escannord/spotty-jellyfish-36) */
.falcon-tooltip-trigger {
  --background: var(--brand-blue);
  --outline-border-color: var(--brand-sunset);
  --tooltip-radius: 10px 10px 10px 0;
  position: relative;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.45em 1em;
  color: var(--background);
  border: solid 2px var(--background);
  display: inline-block;
}
.falcon-tooltip-trigger::before {
  content: "";
  display: inline-block;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  transition: all 0.5s linear;
  outline: 3px solid transparent;
  background: var(--background);
  width: 0;
  height: 0;
}
.falcon-tooltip-trigger:hover,
.falcon-tooltip-trigger:focus-visible {
  color: #fff;
}
.falcon-tooltip-trigger:hover::before,
.falcon-tooltip-trigger:focus-visible::before {
  width: 100%;
  height: 100%;
  border-radius: 0;
  outline-offset: 5px;
  outline-color: var(--outline-border-color);
}
.falcon-tooltip-bubble {
  position: absolute;
  display: inline-block;
  top: 0;
  left: 50%;
  transform: translateX(-5%);
  padding: 0.35em 0.7em;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  background: var(--background);
  border-radius: var(--tooltip-radius);
  color: #fff;
  box-shadow: 3px 3px 0 var(--outline-border-color);
  white-space: nowrap;
  font-size: 0.75rem;
  z-index: 30;
}
.falcon-tooltip-trigger:hover .falcon-tooltip-bubble,
.falcon-tooltip-trigger:focus-visible .falcon-tooltip-bubble {
  top: calc(-100% - 12px);
  opacity: 1;
  animation: falcon-tooltip-shake 0.5s 0.4s linear;
  transition: all 0.3s 0.2s;
}
@keyframes falcon-tooltip-shake {
  0%, 40%, 80% { transform: translateX(-10%); }
  20%, 60%, 100% { transform: translateX(0); }
}
.falcon-tooltip-hover:hover::after,
.falcon-tooltip-hover:focus-visible::after,
.falcon-tooltip-hover:active::after {
  background: var(--brand-blue);
  color: #fff;
  border-color: var(--brand-sunset);
  box-shadow: 3px 3px 0 var(--brand-sunset);
  border-radius: 10px 10px 10px 0;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.faq-item[open] {
  box-shadow: 3px 3px 0 var(--faq-outline, var(--brand-sunset));
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 0.85rem 1rem;
  font-weight: 600;
  color: var(--brand-blue);
  position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand-sunset);
  font-size: 1.25rem;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item .faq-answer {
  padding: 0 1rem 1rem;
  color: var(--text-primary);
  font-size: 0.9375rem;
  line-height: 1.55;
}
.faq-section-title {
  margin: 1.5rem 0 0.75rem;
  color: var(--brand-purple);
  font-size: 1.05rem;
}

@media (prefers-reduced-motion: reduce) {
  .login-wrapper,
  .login-glow-blob,
  .falcon-btn .point,
  .falcon-btn:hover svg.icon,
  .falcon-switch .slider,
  .falcon-switch .slider:before,
  .falcon-tile,
  .dashboard-kpi-tile.stat-card,
  .page-panel::before,
  .faq-item::before,
  .falcon-search-group label,
  .falcon-tooltip-trigger:hover .falcon-tooltip-bubble {
    animation: none !important;
    transition: none !important;
  }
  .login-wrapper { opacity: 1; transform: none; }
}

.onboard-form .falcon-search-group {
  max-width: none;
  margin: 0 0 0.85rem;
}
.onboard-form .falcon-search-group select {
  font-size: 1rem;
  padding: 0.8em;
  outline: none;
  border: 2px solid var(--brand-blue);
  background-color: transparent;
  border-radius: 20px;
  width: 100%;
  box-sizing: border-box;
  color: var(--text-primary);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--brand-blue) 50%), linear-gradient(135deg, var(--brand-blue) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(1em + 2px), calc(100% - 13px) calc(1em + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.onboard-form .falcon-search-group:has(select) select {
  border-color: var(--brand-sunset);
}
.onboard-form .falcon-search-group:has(select) label {
  transform: translateY(-50%) scale(0.9);
  margin: 0;
  margin-left: 1.3em;
  padding: 0.4em;
  background-color: var(--bg-surface);
  color: var(--brand-blue);
}
.onboard-form .falcon-search-group.is-invalid input,
.onboard-form .falcon-search-group.is-invalid select {
  border-color: #b91c1c;
}
.onboard-section { margin-bottom: 1.25rem; }
.onboard-section-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--brand-purple);
  margin: 0 0 1rem;
}
.onboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem 1rem;
}
@media (min-width: 768px) {
  .onboard-grid { grid-template-columns: 1fr 1fr; }
}
.onboard-grid-full { grid-column: 1 / -1; }
.onboard-media-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0.5rem 0 1rem;
}
@media (min-width: 768px) {
  .onboard-media-row { grid-template-columns: 120px 1fr; align-items: start; }
}
.onboard-dropzone {
  position: relative;
  border: 2px dashed var(--brand-blue);
  border-radius: 0.75rem;
  padding: 0.85rem;
  min-height: 8rem;
  background: var(--bg-surface);
  cursor: pointer;
}
.onboard-dropzone.is-hover,
.onboard-dropzone:focus-visible {
  border-color: var(--brand-sunset);
  box-shadow: 3px 3px 0 var(--brand-sunset);
}
.onboard-dropzone-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.onboard-photo-preview {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 0.65rem;
  display: block;
  margin-bottom: 0.5rem;
}
.onboard-dropzone-title { font-size: 0.9rem; font-weight: 600; margin: 0 0 0.25rem; }
.onboard-dropzone-hint { font-size: 0.75rem; color: var(--text-muted, #64748b); margin: 0; }
.onboard-extract-btn {
  margin-top: 0.5rem;
  background: var(--brand-purple);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.onboard-phone-row { display: flex; gap: 0.75rem; align-items: flex-start; }
.onboard-prefix { width: 7.5rem; flex: 0 0 7.5rem; position: relative; }
.onboard-dropdown {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 0.75rem;
  box-shadow: 3px 3px 0 var(--brand-sunset);
  margin-top: 0.25rem;
}
.onboard-dropdown[hidden] { display: none !important; }
.onboard-prefix .onboard-dropdown { min-width: 18rem; }
.onboard-visa-list { display: grid; gap: 1rem; margin-bottom: 0.75rem; }
.onboard-visa-row {
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 0.75rem;
  padding: 1rem;
  background: color-mix(in srgb, var(--brand-blue-soft, #e0e5ef) 35%, var(--bg-surface));
}
.onboard-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
  margin: 0.5rem 0 1.5rem;
}
.falcon-btn-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.65rem 1.1rem;
  border: 2px solid var(--brand-blue);
  border-radius: 0.75rem;
  color: var(--brand-blue);
  text-decoration: none;
  font-weight: 600;
  background: var(--bg-surface);
}
.falcon-btn-cancel:hover { box-shadow: 3px 3px 0 var(--brand-sunset); }
.flatpickr-ym-selects {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.flatpickr-month:has(.flatpickr-ym-selects) .flatpickr-current-month { display: none; }
.flatpickr-months .flatpickr-month:has(.flatpickr-ym-selects) {
  height: 42px;
  overflow: visible;
}
.flatpickr-year-select,
.flatpickr-month-select {
  border: 1px solid var(--brand-blue);
  border-radius: 0.4rem;
  padding: 0.15rem 0.35rem;
  font-size: 0.8rem;
  color: var(--brand-blue);
  background: var(--bg-surface);
}
.plane-switch-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0 0.85rem;
}
.plane-switch {
  --dot: #fff;
  --street: var(--brand-purple);
  --street-line: color-mix(in srgb, var(--brand-purple) 45%, #fff);
  --street-line-mid: color-mix(in srgb, var(--brand-purple) 30%, #fff);
  --sky-1: var(--brand-blue);
  --sky-2: #4b65a0;
  --light-1: var(--brand-sunset);
  --light-2: color-mix(in srgb, var(--brand-sunset) 35%, transparent);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.plane-switch input { display: none; }
.plane-switch input + div {
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  position: relative;
  overflow: hidden;
  width: 50px;
  height: 25px;
  padding: 1px;
  border-radius: 13px;
  background: linear-gradient(90deg, var(--street) 0%, var(--street) 25%, var(--sky-1) 75%, var(--sky-2) 100%) left var(--p, 0%) top 0;
  background-position-x: var(--p, 0%);
  background-size: 400% auto;
  transition: background-position 0.6s;
}
.plane-switch input + div:before,
.plane-switch input + div:after {
  content: "";
  display: block;
  position: absolute;
  transform: translateX(var(--s, 0));
  transition: transform 0.3s;
}
.plane-switch input + div:before {
  width: 42px;
  right: 2px;
  top: 4px;
  height: 1px;
  background: var(--street-line);
  box-shadow: 0 16px 0 0 var(--street-line);
}
.plane-switch input + div:after {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  left: 23px;
  top: 1px;
  animation: lights2 2s linear infinite;
  box-shadow: inset 0 0 0 2px var(--light-1), 0 21px 0 var(--light-1), 8px 0 0 var(--light-2), 8px 21px 0 var(--light-2), 16px 0 0 var(--light-2), 16px 21px 0 var(--light-2);
}
.plane-switch input + div span { display: block; position: absolute; }
.plane-switch input + div span.street-middle {
  top: 12px;
  left: 21px;
  width: 3px;
  height: 1px;
  transform: translateX(var(--s, 0));
  background: var(--street-line-mid);
  box-shadow: 5px 0 0 var(--street-line-mid), 10px 0 0 var(--street-line-mid), 15px 0 0 var(--street-line-mid), 20px 0 0 var(--street-line-mid), 25px 0 0 var(--street-line-mid);
  transition: transform 0.3s;
}
.plane-switch input + div span.cloud {
  width: 12px;
  height: 4px;
  border-radius: 2px;
  background: #fff;
  position: absolute;
  top: var(--ct, 8px);
  left: 100%;
  opacity: var(--co, 0);
  transition: opacity 0.3s;
  animation: clouds2 2s linear infinite var(--cd, 0s);
}
.plane-switch input + div span.cloud:before,
.plane-switch input + div span.cloud:after {
  content: "";
  position: absolute;
  transform: translateX(var(--cx, 0));
  border-radius: 50%;
  width: var(--cs, 5px);
  height: var(--cs, 5px);
  background: #fff;
  bottom: 1px;
  left: 1px;
}
.plane-switch input + div span.cloud:after { --cs: 6px; --cx: 4px; }
.plane-switch input + div span.cloud.two { --ct: 20px; --cd: 1s; opacity: var(--co-2, 0); }
.plane-switch input + div div {
  display: table;
  position: relative;
  z-index: 1;
  padding: 5px;
  border-radius: 50%;
  background: var(--dot);
  transform: translateX(var(--x, 0));
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.35, 1.2);
}
.plane-switch input + div div svg {
  width: 13px;
  height: 13px;
  display: block;
  color: var(--c, var(--street));
  transition: color 0.6s;
}
.plane-switch input:checked + div {
  --p: 100%;
  --x: 25px;
  --s: -50px;
  --c: var(--sky-2);
  --co: .8;
  --co-2: .6;
}
@keyframes lights2 {
  20%, 30% {
    box-shadow: inset 0 0 0 2px var(--light-2), 0 21px 0 var(--light-2), 8px 0 0 var(--light-1), 8px 21px 0 var(--light-1), 16px 0 0 var(--light-2), 16px 21px 0 var(--light-2);
  }
  55%, 65% {
    box-shadow: inset 0 0 0 2px var(--light-2), 0 21px 0 var(--light-2), 8px 0 0 var(--light-2), 8px 21px 0 var(--light-2), 16px 0 0 var(--light-1), 16px 21px 0 var(--light-1);
  }
  90%, 100% {
    box-shadow: inset 0 0 0 2px var(--light-1), 0 21px 0 var(--light-1), 8px 0 0 var(--light-2), 8px 21px 0 var(--light-2), 16px 0 0 var(--light-2), 16px 21px 0 var(--light-2);
  }
}
@keyframes clouds2 {
  97% { transform: translateX(-72px); visibility: visible; }
  98%, 100% { visibility: hidden; }
  99% { transform: translateX(-72px); }
  100% { transform: translateX(0); }
}

.onboard-form .input-container {
  display: flex;
  background: linear-gradient(135deg, #314f92 0%, #5a2c6f 100%);
  border-radius: 1rem;
  box-shadow: 8px 8px 18px color-mix(in srgb, #314f92 40%, #0e1013), -8px -8px 24px color-mix(in srgb, #4b65a0 28%, #ffffff);
  padding: 0.3rem;
  gap: 0.3rem;
  margin: 0 0 1rem;
}
[data-theme="dark"] .onboard-form .input-container {
  background: linear-gradient(135deg, #4b65a0 0%, #6b417d 100%);
  box-shadow: 8px 8px 18px #0e1013, -8px -8px 24px color-mix(in srgb, #6b417d 35%, #1a1d24);
}
.onboard-form .input-container input {
  border-radius: 0.8rem 0 0 0.8rem;
  background: color-mix(in srgb, #314f92 18%, var(--bg-surface));
  box-shadow: inset 4px 4px 10px color-mix(in srgb, #314f92 35%, transparent);
  width: 100%;
  flex-basis: 75%;
  padding: 1rem;
  border: 1px solid transparent;
  color: var(--text-primary);
  transition: all 0.2s ease-in-out;
}
[data-theme="dark"] .onboard-form .input-container input {
  background: color-mix(in srgb, #4b65a0 22%, var(--bg-surface));
}
.onboard-form .input-container input:focus {
  border: 1px solid #e99f64;
  outline: none;
  box-shadow: inset 0 0 10px color-mix(in srgb, #e99f64 45%, transparent), 0 0 24px color-mix(in srgb, #e99f64 45%, transparent);
}
[data-theme="dark"] .onboard-form .input-container input:focus {
  border-color: #eba670;
}
.onboard-form .input-container button {
  flex-basis: 25%;
  padding: 1rem;
  background: linear-gradient(135deg, #e99f64 0%, #5a2c6f 100%);
  box-shadow: 0 0 8px color-mix(in srgb, #e99f64 40%, transparent);
  font-weight: 900;
  letter-spacing: 0.2rem;
  text-transform: uppercase;
  color: #fff;
  border: none;
  width: 100%;
  border-radius: 0 1rem 1rem 0;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}
[data-theme="dark"] .onboard-form .input-container button {
  background: linear-gradient(135deg, #eba670 0%, #6b417d 100%);
}
.onboard-form .input-container button:hover {
  background: linear-gradient(135deg, #e99f64 40%, #314f92 100%);
  box-shadow: 0 0 28px color-mix(in srgb, #e99f64 50%, transparent);
}
.special-form-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-top: 0.25rem;
}
.special-form-row {
  margin: 0;
}
@media (max-width: 500px) {
  .onboard-form .input-container {
    flex-direction: column;
  }
  .onboard-form .input-container input,
  .onboard-form .input-container button {
    border-radius: 0.8rem;
  }
}

