/* AeroFind Admin v3 — tokens & base */

:root {
  /* Surfaces */
  --bg: oklch(0.98 0.004 250);
  --surface: #ffffff;
  --surface-2: oklch(0.965 0.005 250);
  --surface-sunken: oklch(0.955 0.006 250);
  --border: oklch(0.91 0.008 250);
  --border-strong: oklch(0.85 0.01 250);
  --divider: oklch(0.93 0.006 250);

  /* Sidebar (always dark) */
  --nav-bg: oklch(0.22 0.015 250);
  --nav-bg-2: oklch(0.26 0.018 250);
  --nav-border: oklch(0.32 0.018 250);
  --nav-fg: oklch(0.96 0.005 250);
  --nav-fg-dim: oklch(0.68 0.015 250);
  --nav-active-bg: oklch(0.30 0.03 240);
  --nav-active-fg: oklch(0.98 0.005 250);

  /* Text */
  --fg: oklch(0.22 0.015 250);
  --fg-2: oklch(0.42 0.015 250);
  --fg-dim: oklch(0.58 0.012 250);
  --fg-muted: oklch(0.72 0.01 250);

  /* Accents */
  --primary: oklch(0.45 0.12 240);
  --primary-hover: oklch(0.40 0.13 240);
  --primary-soft: oklch(0.95 0.03 240);
  --primary-fg: #ffffff;

  --amber: oklch(0.72 0.14 70);
  --amber-soft: oklch(0.96 0.04 80);
  --amber-fg: oklch(0.42 0.14 60);

  --green: oklch(0.62 0.12 155);
  --green-soft: oklch(0.95 0.04 155);
  --green-fg: oklch(0.40 0.10 155);

  --red: oklch(0.58 0.18 25);
  --red-soft: oklch(0.95 0.03 25);
  --red-fg: oklch(0.42 0.15 25);

  /* Radii & shadows */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;

  --sh-1: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 1px rgba(15, 23, 42, 0.03);
  --sh-2: 0 2px 8px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --sh-pop: 0 12px 32px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.08);

  /* Type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, Consolas, monospace;

  /* Density */
  --row-h: 60px;
  --pad-x: 20px;
  --pad-y: 16px;
}

[data-density="compact"] {
  --row-h: 48px;
  --pad-x: 14px;
  --pad-y: 10px;
}

[data-density="comfortable"] {
  --row-h: 72px;
  --pad-x: 24px;
  --pad-y: 20px;
}

[data-palette="turquoise"] {
  --primary: oklch(0.55 0.11 200);
  --primary-hover: oklch(0.50 0.12 200);
  --primary-soft: oklch(0.95 0.03 200);
}

[data-palette="graphite"] {
  --primary: oklch(0.30 0.008 250);
  --primary-hover: oklch(0.25 0.008 250);
  --primary-soft: oklch(0.94 0.005 250);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* --- Layout shell --- */

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--nav-bg);
  color: var(--nav-fg);
  border-right: 1px solid var(--nav-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--nav-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, oklch(0.55 0.14 240), oklch(0.45 0.12 240));
  display: grid; place-items: center;
  color: white;
  flex-shrink: 0;
}
.brand-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 11px;
  color: var(--nav-fg-dim);
  margin-top: 1px;
  letter-spacing: 0.01em;
}

.nav {
  padding: 12px 10px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--nav-fg-dim);
  padding: 14px 10px 6px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--nav-fg-dim);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms, color 120ms;
  user-select: none;
}
.nav-item:hover {
  background: var(--nav-bg-2);
  color: var(--nav-fg);
}
.nav-item.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-fg);
}
.nav-item svg { flex-shrink: 0; }
.nav-item .nav-badge {
  margin-left: auto;
  font-size: 11px;
  background: oklch(0.42 0.02 250);
  color: var(--nav-fg);
  padding: 1px 6px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.nav-item.active .nav-badge { background: var(--primary); color: #fff; }

.sidebar-footer {
  border-top: 1px solid var(--nav-border);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sf-avatar {
  width: 32px; height: 32px;
  border-radius: 7px;
  background: oklch(0.42 0.04 240);
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  font-family: var(--font-mono);
}
.sf-meta { flex: 1; min-width: 0; }
.sf-name { font-size: 13px; font-weight: 600; color: var(--nav-fg); }
.sf-role { font-size: 11px; color: var(--nav-fg-dim); }
.sf-icon {
  color: var(--nav-fg-dim);
  padding: 6px;
  border-radius: 5px;
  cursor: pointer;
}
.sf-icon:hover { background: var(--nav-bg-2); color: var(--nav-fg); }

/* Main */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 52px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.crumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px;
  color: var(--fg-2);
}
.crumb .sep { color: var(--fg-muted); }
.crumb .cur { color: var(--fg); font-weight: 600; }

.topbar-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  width: 280px;
  color: var(--fg-dim);
  font-size: 13px;
}
.topbar-search input {
  border: 0; background: transparent; outline: none; flex: 1;
  color: var(--fg);
}
.topbar-search kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-muted);
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
}

.topbar-icon {
  width: 32px; height: 32px;
  border-radius: 7px;
  display: grid; place-items: center;
  color: var(--fg-dim);
  position: relative;
}
.topbar-icon:hover { background: var(--surface-2); color: var(--fg); }
.topbar-icon .dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--amber);
  border: 2px solid var(--surface);
}

/* Page shell */
.page {
  padding: 24px 28px 48px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.page-head h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
}
.page-head p {
  font-size: 13px;
  color: var(--fg-dim);
  margin: 0;
}
.page-actions { display: flex; gap: 8px; align-items: center; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  transition: background 120ms, border-color 120ms;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-fg);
}
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--fg-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--fg); }
.btn.sm { padding: 5px 9px; font-size: 12px; }
.btn.icon { padding: 7px; }

/* Stat filters (top row of pages) */
.stat-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.stat-f {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 120ms, background 120ms;
  text-align: left;
  width: 100%;
}
.stat-f:hover { border-color: var(--border-strong); }
.stat-f.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.stat-f.active .sf-num { color: var(--primary); }
.stat-f .sf-icon-wrap {
  width: 32px; height: 32px;
  border-radius: 7px;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--fg-dim);
  flex-shrink: 0;
}
.stat-f.active .sf-icon-wrap { background: var(--primary); color: white; }
.stat-f .sf-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-f .sf-label { font-size: 12px; color: var(--fg-dim); font-weight: 500; }
.stat-f .sf-num { font-size: 20px; font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* Filtro: seções */
.filter-section { margin-bottom: 22px; }
.filter-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

/* Chip group (período rápido) */
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
}
.chip-btn:hover { border-color: var(--primary); }
.chip-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Month grid (mensal consolidado) */
.month-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.month-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
}
.month-cell:hover { border-color: var(--primary); }
.month-cell.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.month-cell-name { font-size: 13px; font-weight: 600; }
.month-cell-year { font-size: 10px; opacity: 0.7; font-variant-numeric: tabular-nums; }

/* Status check group (multi-select com cores) */
.status-checks {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.status-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.12s;
  user-select: none;
  background: var(--surface);
}
.status-check:hover { border-color: var(--fg-dim); }
.status-check input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
  width: 14px;
  height: 14px;
}
.status-check .status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Radio list (filtro padrão extrato bancário) */
.radio-list { display: flex; flex-direction: column; gap: 2px; }
.radio-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.12s;
  font-size: 14px;
  color: var(--fg);
  user-select: none;
}
.radio-row:hover { background: var(--surface-2); }
.radio-row.active { background: color-mix(in oklab, var(--primary) 8%, transparent); color: var(--primary); font-weight: 500; }
.radio-row input[type="radio"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong, var(--border));
  border-radius: 50%;
  margin: 0;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  transition: border-color 0.12s;
}
.radio-row input[type="radio"]:checked {
  border-color: var(--primary);
}
.radio-row input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--primary);
}

/* Botão block (largura total) */
.btn.block { width: 100%; justify-content: center; padding: 12px 18px; font-size: 14px; }

/* Advance popover (hover no chip Antecipado/Split) */
.advance-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 12px 14px;
  min-width: 280px;
  z-index: 100;
  text-align: left;
  font-weight: 400;
}
.advance-popover .ap-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--fg-dim);
  margin-bottom: 8px;
}
.advance-popover .ap-note {
  font-size: 11px;
  color: var(--fg-dim);
  margin-bottom: 8px;
  font-style: italic;
}
.advance-popover .ap-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--fg);
  padding: 4px 0;
}
.advance-popover .ap-row.strong { font-weight: 600; }
.advance-popover .ap-row span:first-child { color: var(--fg-2); }
.advance-popover .ap-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* Period bar (extrato bancário) */
.period-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  user-select: none;
  flex-wrap: wrap;
}
.period-bar:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 10%, transparent);
}
.period-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--fg-2);
  flex-wrap: wrap;
}
.period-bar-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--fg);
  white-space: nowrap;
}
.period-bar-sep {
  width: 1px;
  height: 14px;
  background: var(--border);
}
.period-bar-dates {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-dim);
  white-space: nowrap;
}
.period-bar-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  white-space: nowrap;
}
.period-bar:hover .period-bar-cta { color: var(--primary); }
@media (max-width: 720px) {
  .period-bar-sep, .period-bar-dates { display: none; }
}

/* KPI strip (dashboard) */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 20px;
}
.kpi {
  background: var(--surface);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
  font-weight: 600;
}
.kpi-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}
.kpi-value.mono { font-family: var(--font-mono); font-weight: 500; }
.kpi-sub {
  font-size: 12px;
  color: var(--fg-dim);
  display: flex; align-items: center; gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-sub .delta-up { color: var(--green-fg); }
.kpi-sub .delta-dn { color: var(--red-fg); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.card-head {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--divider);
}
.card-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.card-head .meta { font-size: 12px; color: var(--fg-dim); }
.card-body { padding: 4px 0; }
.card-foot {
  padding: 10px 18px;
  border-top: 1px solid var(--divider);
  font-size: 12px;
  color: var(--fg-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Chips / badges */
.chip {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--fg-2);
  border: 1px solid var(--border);
  white-space: nowrap;
  line-height: 1.5;
}
.chip.mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.02em; }
.chip.primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.chip.amber { background: var(--amber-soft); color: var(--amber-fg); border-color: transparent; }
.chip.green { background: var(--green-soft); color: var(--green-fg); border-color: transparent; }
.chip.red { background: var(--red-soft); color: var(--red-fg); border-color: transparent; }
.chip.ghost { background: transparent; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Matricula (aircraft registration) */
.mat {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--fg);
}
.mat.lg { font-size: 16px; }
.mat.xl { font-size: 18px; }

/* Route arrow */
.route {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-2);
}
.route .code {
  padding: 2px 6px;
  background: var(--surface-2);
  border-radius: 4px;
  color: var(--fg);
  letter-spacing: 0.04em;
}
.route .code.here { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.route .arrow { color: var(--fg-muted); font-size: 11px; }

/* Tabs */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.tab {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-dim);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--fg); border-bottom-color: var(--primary); }
.tab .count { font-size: 11px; color: var(--fg-dim); background: var(--surface-2); padding: 1px 6px; border-radius: 10px; }
.tab.active .count { color: var(--primary); background: var(--primary-soft); }

/* Pill tabs (for financeiro period) */
.pill-tabs {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  gap: 2px;
}
.pill-tabs .pt {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-dim);
  border-radius: 5px;
  cursor: pointer;
}
.pill-tabs .pt.active { background: var(--surface); color: var(--fg); box-shadow: var(--sh-1); }

/* Table */
.table { width: 100%; border-collapse: collapse; }
.table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
  padding: 10px 18px;
  border-bottom: 1px solid var(--divider);
  background: var(--surface-sunken);
}
.table tbody td {
  padding: 14px 18px;
  font-size: 13px;
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { font-variant-numeric: tabular-nums; text-align: right; font-family: var(--font-mono); }
.table .right { text-align: right; }

/* List rows (operations, pedidos, hangar) */
.list { display: flex; flex-direction: column; }
.list-row {
  padding: 16px 18px;
  border-bottom: 1px solid var(--divider);
  display: grid;
  gap: 10px;
  align-items: center;
  transition: background 120ms;
}
.list-row > * { min-width: 0; }
.list-row .col { min-width: 0; }
.list-row .col > .row { flex-wrap: nowrap; min-width: 0; }
.list-row .col > .row.t-xs > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.list-row .col > .row > .mat + .t-sm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); }

/* Empty state */
.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--fg-dim);
  font-size: 13px;
}
.empty-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface-2);
  display: grid; place-items: center;
  margin: 0 auto 12px;
  color: var(--fg-muted);
}
.empty h4 { font-size: 15px; color: var(--fg); margin: 0 0 4px; font-weight: 600; }
.empty p { margin: 0; }

/* Two-col grid */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 1100px) {
  .two-col { grid-template-columns: 1fr; }
}

/* Money */
.money {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 500;
}
.money.credit { color: var(--green-fg); }
.money.debit { color: var(--red-fg); }

/* Avatar */
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--fg-2);
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}
.avatar.sq { border-radius: 7px; }

/* Segmented */
.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
}
.seg > button {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-dim);
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.seg > button:last-child { border-right: 0; }
.seg > button:hover { color: var(--fg); background: var(--surface-2); }
.seg > button.active { background: var(--fg); color: var(--surface); }

/* Toggle */
.toggle {
  width: 34px; height: 20px;
  background: var(--border-strong);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  transition: background 120ms;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 160ms;
  box-shadow: var(--sh-1);
}
.toggle.on { background: var(--primary); }
.toggle.on::after { transform: translateX(14px); }

/* Tweaks panel */
.tweaks {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-pop);
  z-index: 100;
  overflow: hidden;
}
.tweaks-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tweaks-head h4 { margin: 0; font-size: 13px; font-weight: 600; }
.tweaks-body { padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.tweak-row { display: flex; flex-direction: column; gap: 6px; }
.tweak-row > label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-dim); }
.tweak-row .seg { width: 100%; }
.tweak-row .seg > button { flex: 1; }

/* Divider */
.hr { height: 1px; background: var(--divider); margin: 16px 0; }

/* Utility text */
.t-dim { color: var(--fg-dim); }
.t-muted { color: var(--fg-muted); }
.t-xs { font-size: 11px; }
.t-sm { font-size: 12px; }
.t-num { font-variant-numeric: tabular-nums; }
.t-mono { font-family: var(--font-mono); }

.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }

/* --- Overlays: Drawer + Modal --- */
.overlay {
  position: fixed;
  inset: 0;
  background: oklch(0.22 0.015 250 / 0.42);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: flex;
  animation: ovIn 160ms ease-out forwards;
  opacity: 1;
}
.overlay.center { align-items: center; justify-content: center; }
@keyframes ovIn { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  margin-left: auto;
  background: var(--surface);
  height: 100vh;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  box-shadow: -20px 0 40px rgba(15, 23, 42, 0.12);
  animation: drIn 220ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 1;
}
@keyframes drIn { from { transform: translateX(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }

.drawer-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.drawer-head h3 {
  margin: 0 0 3px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.drawer-head p {
  margin: 0;
  font-size: 12px;
  color: var(--fg-dim);
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 20px;
}
.drawer-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--divider);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  background: var(--surface-sunken);
}
.drawer-foot .grow-left { margin-right: auto; }

.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-pop);
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: mdIn 200ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 1;
}
@keyframes mdIn { from { transform: translateY(8px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.modal-head h3 {
  margin: 0 0 3px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.modal-head p { margin: 0; font-size: 12px; color: var(--fg-dim); }
.modal-body { flex: 1; overflow-y: auto; padding: 16px 22px; }
.modal-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--divider);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  background: var(--surface-sunken);
}

.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover { background: oklch(0.52 0.18 25); border-color: oklch(0.52 0.18 25); }

/* --- Form inputs --- */
.f-field { display: flex; flex-direction: column; gap: 6px; }
.f-field > label {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-2);
}
.f-input {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  transition: border-color 120ms, box-shadow 120ms;
}
.f-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(from var(--primary) l c h / 0.15);
}
.f-input input, .f-input select {
  border: 0;
  outline: none;
  background: transparent;
  flex: 1;
  min-width: 0;
  font-size: 13px;
  width: 100%;
}
.f-input select { appearance: none; cursor: pointer; }
.f-input.mono input { font-family: var(--font-mono); letter-spacing: 0.02em; }
.f-input > svg { color: var(--fg-muted); flex-shrink: 0; pointer-events: none; }
.f-prefix, .f-suffix { font-size: 12px; color: var(--fg-dim); font-family: var(--font-mono); flex-shrink: 0; }
.f-hint { font-size: 11px; color: var(--fg-dim); }
.f-err { font-size: 11px; color: var(--red-fg); }
.f-textarea {
  width: 100%;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  resize: vertical;
  outline: none;
}
.f-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px oklch(from var(--primary) l c h / 0.15); }

.f-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  cursor: pointer;
  user-select: none;
}

.tag-x {
  width: 16px; height: 16px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: inherit;
  opacity: 0.6;
}
.tag-x:hover { opacity: 1; background: rgba(0,0,0,0.08); }

/* Form grid */
.f-grid { display: grid; gap: 14px; }
.f-grid.two { grid-template-columns: 1fr 1fr; }
.f-grid.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 600px) { .f-grid.two, .f-grid.three { grid-template-columns: 1fr; } }

/* --- Toast --- */
.toasts {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--nav-bg);
  color: var(--nav-fg);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--sh-pop);
  animation: tIn 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.success { background: oklch(0.35 0.08 155); }
.toast.error { background: oklch(0.42 0.15 25); }
.toast svg { opacity: 0.9; }
@keyframes tIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* --- Detail rows inside drawers --- */
.d-section { margin-bottom: 22px; }
.d-section:last-child { margin-bottom: 0; }
.d-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.d-section-head h4 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
}
.d-section-body {
  background: var(--surface-sunken);
  border: 1px solid var(--divider);
  border-radius: 8px;
  overflow: hidden;
}
.d-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--divider);
  font-size: 13px;
}
.d-row:last-child { border-bottom: 0; }
.d-label { color: var(--fg-dim); font-size: 12px; }
.d-val { color: var(--fg); font-weight: 500; text-align: right; }
.d-val.mono { font-family: var(--font-mono); }

/* Timeline */
.timeline { padding: 4px 0; }
.tl-item {
  position: relative;
  padding: 8px 14px 8px 36px;
  font-size: 13px;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: 19px; top: 18px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  z-index: 1;
}
.tl-item.done::before { background: var(--green); border-color: var(--green); }
.tl-item.active::before { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.tl-item::after {
  content: '';
  position: absolute;
  left: 23px; top: 16px;
  bottom: -8px;
  width: 1px;
  background: var(--border);
}
.tl-item:last-child::after { display: none; }
.tl-label { font-weight: 500; color: var(--fg); }
.tl-meta { font-size: 11px; color: var(--fg-dim); font-family: var(--font-mono); margin-top: 2px; }

/* Antecipação preview */
.adv-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 14px;
  background: var(--surface-sunken);
  border: 1px solid var(--divider);
  border-radius: 8px;
  margin: 8px 0 16px;
}
.adv-preview .apv-col { display: flex; flex-direction: column; gap: 3px; }
.adv-preview .apv-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-dim); font-weight: 600; }
.adv-preview .apv-val { font-size: 20px; font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.adv-preview .apv-val.primary { color: var(--primary); }
.adv-preview .apv-val.amber { color: var(--amber-fg); }
.adv-preview .apv-sub { font-size: 11px; color: var(--fg-dim); }
.adv-preview .apv-divider { grid-column: 1 / -1; height: 1px; background: var(--divider); }

/* Quick stats (inside drawers) */
.qstats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1px;
  background: var(--divider);
  border: 1px solid var(--divider);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}
.qstat { background: var(--surface); padding: 10px 12px; }
.qstat .ql { font-size: 11px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.qstat .qv { font-size: 16px; font-weight: 600; font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--fg); margin-top: 2px; }

/* Action buttons inside rows */
.row-actions { display: flex; gap: 4px; align-items: center; }
.row-actions .btn.icon { padding: 6px; color: var(--fg-dim); }
.row-actions .btn.icon:hover { color: var(--fg); }

/* Image placeholder (photos) */
.ph {
  background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 6px, var(--surface-sunken) 6px, var(--surface-sunken) 12px);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  min-height: 80px;
  padding: 8px;
}


/* ========= Aircraft detail ========= */
.aa-detail { display: flex; flex-direction: column; gap: 14px; }

.aa-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.aa-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}
.aa-kl {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  font-weight: 600;
}
.aa-kv {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--fg);
  font-feature-settings: "tnum";
}
.aa-kv.green { color: var(--ok, #10B981); }
.aa-kv.md { font-size: 16px; font-weight: 600; }

.aa-cat { padding: 16px 18px; }
.aa-cat-head h4 { margin: 0; font-size: 13px; font-weight: 700; }
.aa-cat-head p { margin: 2px 0 12px; font-size: 11px; color: var(--fg-dim); }
.aa-cat-list { display: flex; flex-direction: column; gap: 8px; }
.aa-cat-item {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.aa-cat-item:hover { border-color: var(--primary); }
.aa-cat-item input { position: absolute; opacity: 0; pointer-events: none; }
.aa-cb {
  width: 18px; height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  background: var(--surface);
  transition: all .12s;
}
.aa-cat-item.on .aa-cb {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.aa-cat-item.on { background: var(--primary-soft); border-color: var(--primary); }
.aa-cat-name { font-size: 13px; font-weight: 600; }
.aa-cat-sub { font-size: 11px; color: var(--fg-dim); margin-top: 1px; }

.aa-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
}
.aa-block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 18px 10px;
}
.aa-block-head h4 { margin: 0; font-size: 13px; font-weight: 700; }

.aa-bars {
  padding: 0 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.aa-bar {
  display: grid;
  grid-template-columns: 8px 110px 1fr auto;
  gap: 10px;
  align-items: center;
}
.aa-bar-dot { width: 8px; height: 8px; border-radius: 2px; }
.aa-bar-label { font-size: 12px; font-weight: 500; }
.aa-bar-track {
  height: 6px;
  background: var(--fg-soft, #F1F5F9);
  border-radius: 3px;
  overflow: hidden;
}
.aa-bar-fill { height: 100%; border-radius: 3px; transition: width .25s; }
.aa-bar-val {
  font-size: 12px;
  font-weight: 600;
  font-feature-settings: "tnum";
  white-space: nowrap;
}

.aa-people {
  padding: 0 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.aa-person {
  display: flex;
  align-items: center;
  gap: 10px;
}
.aa-person .col { flex: 1; min-width: 0; gap: 1px; }
.aa-person-ops {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
}
.aa-person-ops strong { font-size: 15px; }

.aa-monthly { padding: 0 0 16px; }
.aa-monthly-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 18px 0;
}
.aa-monthly-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}
.aa-monthly-val span {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-dim);
  margin-left: 2px;
}
