/* =========================================================
   AERO — Platform (authenticated prototype) styles
   ========================================================= */

body.platform { background: var(--bg); min-height: 100vh; }
body.no-scroll { overflow: hidden; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns var(--dur) var(--ease); }
.app.sb-collapsed { grid-template-columns: 72px minmax(0, 1fr); }

#sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0A1626 0%, #08111D 100%); border-right: 1px solid var(--line);
  overflow: hidden; z-index: 40;
}
.sb-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 14px 14px 20px; }
.sb-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-size: 1.5rem; letter-spacing: 0.18em; }
.sb-mark { color: var(--gold); font-size: 1.1rem; }
.sb-nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; scrollbar-width: thin; }
.sb-group { margin-top: 14px; }
.sb-group-label { font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-3); padding: 0 10px 6px; opacity: 0.75; }
.sb-group ul { list-style: none; margin: 0; padding: 0; }
.sb-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; text-decoration: none;
  color: var(--text-2); font-size: var(--fs-sm); position: relative; transition: background var(--dur-fast), color var(--dur-fast);
}
.sb-link svg { flex: none; opacity: 0.8; }
.sb-link:hover { background: rgba(244,241,234,0.04); color: var(--text); }
.sb-link.active { background: var(--gold-soft); color: var(--ivory); }
.sb-link.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--gold); }
.sb-link.active svg { color: var(--gold); opacity: 1; }
.sb-foot { padding: 14px 20px 18px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.sb-note { font-size: var(--fs-xs); color: var(--text-3); }

.app.sb-collapsed .sb-text, .app.sb-collapsed .sb-group-label, .app.sb-collapsed .sb-note { display: none; }
.app.sb-collapsed .sb-top { flex-direction: column; gap: 8px; padding: 18px 0 8px; }
.app.sb-collapsed .sb-collapse svg { transform: rotate(180deg); }
.app.sb-collapsed .sb-link { justify-content: center; }
.app.sb-collapsed .sb-foot { padding: 12px 8px; justify-items: center; }
.app.sb-collapsed .sb-link:hover::after {
  content: attr(data-tip); position: fixed; left: 76px; padding: 6px 10px; border-radius: 6px; background: var(--surface-3);
  border: 1px solid var(--line-strong); font-size: var(--fs-xs); white-space: nowrap; color: var(--text); z-index: 60;
}

.app-main { min-width: 0; display: flex; flex-direction: column; }

#topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; min-height: 60px;
  padding: 10px var(--gutter); background: rgba(8,19,33,0.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.tb-menu { display: none; }
.breadcrumbs ol { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; font-size: var(--fs-sm); color: var(--text-3); flex-wrap: wrap; }
.breadcrumbs li + li::before { content: "/"; margin-right: 8px; opacity: 0.5; }
.breadcrumbs a { text-decoration: none; color: var(--text-3); }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs [aria-current] { color: var(--text); }
.tb-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tb-search {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface-1); color: var(--text-3); cursor: pointer; font-size: var(--fs-sm);
}
.tb-search kbd { font: 11px var(--font-ui); padding: 2px 6px; border-radius: 6px; background: var(--surface-3); color: var(--text-3); }
.tb-search:hover { color: var(--text); border-color: var(--gold-line); }
.tb-role select { height: 36px; border-radius: 999px; padding: 0 30px 0 12px; font-size: var(--fs-sm); }
.tb-notif-wrap { position: relative; }
.tb-bell { position: relative; }
.tb-bell .dot { position: absolute; top: 4px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; line-height: 16px; text-align: center; }
.notif-pop {
  position: absolute; right: 0; top: calc(100% + 8px); width: min(360px, calc(100vw - 32px)); max-height: 70vh; overflow: auto;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-2); z-index: 70;
}
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-list { list-style: none; margin: 0; padding: 6px; }
.notif { display: grid; gap: 2px; padding: 10px; border-radius: 8px; text-decoration: none; }
.notif:hover { background: var(--surface-hover); }
.notif.unread .notif-title::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-right: 8px; vertical-align: middle; }
.notif-title { font-weight: 500; font-size: var(--fs-sm); }
.notif-body { font-size: var(--fs-xs); color: var(--text-2); }
.notif-time { font-size: 11px; color: var(--text-3); }

.demo-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px var(--gutter); font-size: var(--fs-xs); color: var(--text-2);
  background: repeating-linear-gradient(135deg, rgba(201,167,106,0.06) 0 12px, transparent 12px 24px); border-bottom: 1px solid var(--line);
}
.demo-banner a { color: var(--gold); margin-left: auto; }

main#main { padding: 28px var(--gutter) 64px; outline: none; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-family: var(--font-display); font-weight: 300; font-size: var(--fs-2xl); letter-spacing: -0.01em; margin-top: 6px; }
.page-head .lede { color: var(--text-3); max-width: 64ch; margin-top: 8px; font-size: var(--fs-sm); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 16px; }
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 18px; }
.cols-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-main { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.stack { display: grid; gap: 16px; align-content: start; }
.mt { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Cards ---------- */
.card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-flush .card-head { padding: 16px 18px 0; }
.card-title { font-size: var(--fs-md); font-weight: 500; }
.card-sub { font-size: var(--fs-xs); color: var(--text-3); }
.card-foot { margin-top: 14px; font-size: var(--fs-xs); color: var(--text-3); }

.kpi { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden; }
.kpi-label { font-size: var(--fs-xs); color: var(--text-3); letter-spacing: 0.04em; }
.kpi-value { font-family: var(--font-display); font-size: 2.1rem; font-weight: 400; line-height: 1.1; margin-top: 6px; }
.kpi-sub { font-size: var(--fs-xs); color: var(--text-2); margin-top: 4px; }
.kpi-spark { position: absolute; right: 12px; bottom: 12px; opacity: 0.9; }
.kpi-gold { border-color: var(--gold-line); background: linear-gradient(160deg, rgba(201,167,106,0.10), var(--surface-2) 60%); }
.kpi-danger .kpi-value { color: #F0A9A7; }
.sim { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); border: 1px dashed var(--line-strong); padding: 1px 6px; border-radius: 4px; margin-left: 6px; vertical-align: middle; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .field-label { font-size: var(--fs-xs); color: var(--text-3); letter-spacing: 0.03em; }
input[type="text"], input[type="search"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="email"], input[type="time"], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface-1); color: var(--text); font-size: var(--fs-sm); transition: border-color var(--dur-fast);
}
textarea { min-height: 84px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2393A2B3' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
input:hover, select:hover, textarea:hover { border-color: rgba(244,241,234,0.28); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,167,106,0.2); border-radius: var(--radius-sm); }
input[type="date"]::-webkit-calendar-picker-indicator, input[type="datetime-local"]::-webkit-calendar-picker-indicator { filter: invert(0.7); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.field-error { color: #F0A9A7; font-size: var(--fs-xs); }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--fs-sm); }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--fs-sm); }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 11px; background: var(--surface-3); border: 1px solid var(--line-strong); position: relative; cursor: pointer; transition: background var(--dur-fast); }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-3); transition: transform var(--dur-fast) var(--ease), background var(--dur-fast); }
.switch input:checked { background: var(--gold-soft); border-color: var(--gold-line); }
.switch input:checked::after { transform: translateX(16px); background: var(--gold); }

/* toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; padding: 12px; margin-bottom: 16px; background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius); }
.toolbar .field { flex: 1 1 160px; }
.toolbar .field.grow { flex: 2 1 240px; }
.toolbar .result-count { margin-left: auto; font-size: var(--fs-xs); color: var(--text-3); align-self: center; }

.seg { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-1); }
.seg button { border: 0; background: transparent; color: var(--text-3); padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: var(--fs-xs); font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--gold-soft); color: var(--ivory); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent; font-size: var(--fs-sm); white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--gold); }

/* ---------- Tables (become cards under 720px) ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font-weight: 500; color: var(--text-3); font-size: var(--fs-xs); letter-spacing: 0.04em; padding: 10px 12px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; position: sticky; top: 0; background: var(--surface-2); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: rgba(244,241,234,0.025); }
.table tbody tr.is-clickable { cursor: pointer; }
.table .num, .table td.r, .table th.r { text-align: right; font-variant-numeric: tabular-nums; }
.table td.actions { text-align: right; white-space: nowrap; }
.table caption { text-align: left; padding: 0 0 8px; color: var(--text-3); font-size: var(--fs-xs); }
th button.sort { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 0; letter-spacing: inherit; }
th button.sort::after { content: " ↕"; opacity: 0.4; }
th[aria-sort="ascending"] button.sort::after { content: " ↑"; opacity: 1; }
th[aria-sort="descending"] button.sort::after { content: " ↓"; opacity: 1; }

@media (max-width: 720px) {
  table.table.responsive thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.table.responsive tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 12px; border-bottom: 1px solid var(--line); }
  table.table.responsive td { border: 0; padding: 0; display: grid; gap: 2px; text-align: left !important; }
  table.table.responsive td::before { content: attr(data-label); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
  table.table.responsive td.actions { grid-column: 1 / -1; }
  table.table.responsive td.actions::before { display: none; }
}

/* checklist */
.tasks .task { display: flex; gap: 10px; align-items: flex-start; }
.task.done .task-text { text-decoration: line-through; color: var(--text-3); }

/* ---------- Aircraft cards ---------- */
.ac-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ac-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; transition: border-color var(--dur), transform var(--dur) var(--ease); }
.ac-card:hover { border-color: var(--gold-line); transform: translateY(-2px); }
.ac-media { height: 132px; background: radial-gradient(120% 120% at 70% 10%, #1D3150 0%, #0B1626 60%); position: relative; display: grid; place-items: center; overflow: hidden; }
.ac-media svg.ac-sil { width: 78%; height: auto; color: rgba(244,241,234,0.85); }
.ac-media .badge { position: absolute; top: 12px; left: 12px; }
.ac-media .ac-tail { position: absolute; bottom: 10px; right: 14px; font-family: var(--font-display); font-size: 1.25rem; letter-spacing: 0.1em; color: var(--ivory); }
.ac-body { padding: 14px 16px 16px; display: grid; gap: 10px; }
.ac-name { font-weight: 500; }
.ac-specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: var(--fs-xs); color: var(--text-3); }
.ac-specs b { display: block; color: var(--text); font-weight: 500; font-size: var(--fs-sm); }
.meter { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--gold); border-radius: 2px; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--line-strong); }
.timeline li { position: relative; padding: 0 0 16px 10px; }
.timeline li::before { content: ""; position: absolute; left: -17px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--text-3); }
.timeline li.done::before { background: var(--success); border-color: var(--success); }
.timeline li.now::before { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.timeline li.warn::before { background: var(--danger); border-color: var(--danger); }
.timeline .t-time { font-size: var(--fs-xs); color: var(--text-3); }

/* Day gantt (dashboard + operations) */
.gantt { display: grid; gap: 6px; font-size: var(--fs-xs); min-width: 640px; }
.gantt-scroll { overflow-x: auto; }
.gantt-row { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 10px; }
.gantt-label { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-track { position: relative; height: 30px; background: var(--surface-1); border-radius: 6px; border: 1px solid var(--line); }
.gantt-hours { display: grid; grid-template-columns: 96px 1fr; gap: 10px; color: var(--text-3); }
.gantt-hours .ticks { position: relative; height: 16px; }
.gantt-hours .ticks span { position: absolute; transform: translateX(-50%); }
.gantt-bar { position: absolute; top: 3px; bottom: 3px; border-radius: 5px; padding: 0 8px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; cursor: pointer; border: 1px solid transparent; font-size: 11px; color: var(--navy); font-weight: 500; }
.gantt-bar.charter { background: var(--gold); }
.gantt-bar.owner { background: var(--series-2); }
.gantt-bar.reposition { background: transparent; border: 1px dashed var(--text-3); color: var(--text-2); }
.gantt-bar.conflict { box-shadow: 0 0 0 2px var(--danger); }
.gantt-now { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--danger); border-radius: 1px; z-index: 2; }
.gantt-mx { position: absolute; inset: 3px 0; background: repeating-linear-gradient(135deg, rgba(217,107,105,0.18) 0 6px, transparent 6px 12px); border-radius: 5px; }

/* Week calendar (operations) */
.week { display: grid; grid-template-columns: 110px repeat(7, minmax(110px, 1fr)); min-width: 920px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.week > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; min-height: 64px; }
.week .wk-head { background: var(--surface-1); font-size: var(--fs-xs); color: var(--text-3); min-height: 0; padding: 8px; }
.week .wk-head.today { color: var(--gold); }
.week .wk-ac { font-size: var(--fs-xs); background: var(--surface-1); display: grid; align-content: center; }
.week .wk-ac b { font-size: var(--fs-sm); font-weight: 500; }
.week .wk-cell.today { background: rgba(201,167,106,0.04); }
.week .wk-cell.mx { background: repeating-linear-gradient(135deg, rgba(217,107,105,0.10) 0 8px, transparent 8px 16px); }
.trip-chip { display: block; width: 100%; text-align: left; border: 1px solid var(--line-strong); background: var(--surface-3); color: var(--text); border-radius: 6px; padding: 4px 6px; margin-bottom: 4px; font-size: 11px; cursor: pointer; line-height: 1.3; }
.trip-chip.charter { border-left: 3px solid var(--gold); }
.trip-chip.owner { border-left: 3px solid var(--series-2); }
.trip-chip.reposition { border-left: 3px dashed var(--text-3); background: transparent; }
.trip-chip.conflict { border-color: var(--danger); background: var(--danger-soft); }
.trip-chip.pending { border-style: dashed; }
.trip-chip:hover { border-color: var(--gold-line); }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kb-col { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 260px; display: flex; flex-direction: column; gap: 8px; }
.kb-col.drag-over { border-color: var(--gold); background: rgba(201,167,106,0.05); }
.kb-col-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 6px; font-size: var(--fs-xs); color: var(--text-3); letter-spacing: 0.06em; text-transform: uppercase; }
.kb-card { background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; cursor: grab; display: grid; gap: 6px; }
.kb-card:active { cursor: grabbing; }
.kb-card.dragging { opacity: 0.5; }
.kb-card .kb-moves { display: flex; gap: 4px; justify-content: flex-end; }
.kb-card .kb-moves button { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line-strong); background: transparent; color: var(--text-3); cursor: pointer; }
.kb-card .kb-moves button:hover { color: var(--text); border-color: var(--gold-line); }
.overdue { color: #F0A9A7; }

/* ---------- Original AERO filter UI (preserved & refined) ---------- */
.filter-panel { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 16px; margin-bottom: 14px; }
.filter-panel[hidden] { display: none; }
.fp-label { font-size: var(--fs-xs); color: var(--text-3); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 8px; }
.fp-route-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end; }
.fp-airport-field { position: relative; }
.fp-route-swap { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.fp-route-swap:hover { border-color: var(--gold); color: var(--gold); }
.fp-dropdown { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); z-index: 20; max-height: 240px; overflow: auto; box-shadow: var(--shadow-2); }
.fp-dropdown[hidden] { display: none; }
.fp-option { display: flex; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: transparent; text-align: left; cursor: pointer; font-size: var(--fs-sm); }
.fp-option:hover, .fp-option[aria-selected="true"] { background: var(--surface-hover); }
.fp-option b { color: var(--gold); width: 36px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill, .chip { border: 1px solid var(--line-strong); background: transparent; color: var(--text-2); border-radius: 999px; padding: 7px 14px; cursor: pointer; font-size: var(--fs-xs); transition: all var(--dur-fast); }
.chip { border-radius: 10px; text-align: left; display: grid; gap: 2px; }
.chip small { color: var(--text-3); font-size: 10.5px; }
.pill[aria-pressed="true"], .chip[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-soft); color: var(--ivory); }
.pill:hover, .chip:hover { border-color: var(--gold-line); }
.fp-custom { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; max-width: 420px; }
.fp-custom[hidden] { display: none; }
.fp-actions { display: flex; justify-content: flex-end; gap: 8px; }
.active-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.active-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--gold-soft); border: 1px solid var(--gold-line); font-size: var(--fs-xs); }
.active-tag button { background: none; border: 0; color: var(--text-2); cursor: pointer; width: 20px; height: 20px; border-radius: 50%; }
.count-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--gold); color: var(--navy); font-size: 11px; font-weight: 600; }

/* empty-leg cards */
.leg-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.leg { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; align-content: start; }
.leg.is-published { border-color: var(--gold-line); }
.leg-route { display: flex; align-items: center; gap: 12px; }
.leg-route .code { font-family: var(--font-display); font-size: 1.9rem; line-height: 1; }
.leg-route .city { font-size: var(--fs-xs); color: var(--text-3); }
.leg-route .line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold-line), var(--line-strong)); position: relative; }
.leg-route .line::after { content: "✈"; position: absolute; left: 50%; top: -10px; transform: translateX(-50%); color: var(--gold); font-size: 12px; }
.leg-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: var(--fs-xs); color: var(--text-3); }
.leg-meta b { display: block; color: var(--text); font-weight: 500; font-size: var(--fs-sm); }
.price { font-family: var(--font-display); font-size: 1.6rem; }
.price small { font-family: var(--font-ui); font-size: var(--fs-xs); color: var(--text-3); margin-left: 6px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--fs-xs); }
.checks li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; }
.checks .ok { color: var(--success); }
.checks .bad { color: var(--danger); }
.checks .human { color: var(--warning); }
details.assumptions { font-size: var(--fs-xs); color: var(--text-2); }
details.assumptions summary { cursor: pointer; color: var(--gold); }
details.assumptions ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }

/* booking steps (original) */
.steps { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; list-style: none; padding: 0; }
.steps li { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--text-3); }
.steps li .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); }
.steps li[aria-current="step"] { color: var(--ivory); }
.steps li[aria-current="step"] .n { border-color: var(--gold); background: var(--gold); color: var(--navy); }
.steps li.done .n { border-color: var(--success); color: var(--success); }
.steps .step-line { width: 28px; height: 1px; background: var(--line-strong); }

/* ---------- Chat (copilot) ---------- */
.chat { display: flex; flex-direction: column; height: min(72vh, 760px); min-height: 460px; }
.chat-log { flex: 1; overflow-y: auto; padding: 4px 4px 12px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 92%; padding: 12px 14px; border-radius: 14px; font-size: var(--fs-sm); line-height: 1.6; }
.msg.user { align-self: flex-end; background: var(--gold-soft); border: 1px solid var(--gold-line); border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--surface-1); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .evidence { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-strong); font-size: var(--fs-xs); color: var(--text-2); }
.msg .evidence h4 { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); margin: 6px 0 4px; font-weight: 500; }
.msg .evidence ul { margin: 0; padding-left: 18px; }
.proposal { margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--gold-line); background: rgba(201,167,106,0.06); display: grid; gap: 8px; }
.chat-form { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.chat-form textarea { min-height: 44px; height: 44px; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.typing span { display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; } .typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* map */
.map-box { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface-1); }
.map { display: block; width: 100%; height: auto; }
.map-grat line { stroke: rgba(244,241,234,0.05); stroke-width: 1; }
.map-land path { fill: #13233A; stroke: rgba(244,241,234,0.08); stroke-width: 0.8; }
.map-ap { fill: rgba(244,241,234,0.35); }
.map-route { fill: none; stroke-width: 1.4; opacity: 0.85; }
.map-label { fill: var(--text-2); font-size: 10.5px; letter-spacing: 0.08em; font-family: var(--font-ui); }
.map-note { font-size: 11px; color: var(--text-3); padding: 8px 12px; border-top: 1px solid var(--line); display: flex; gap: 14px; flex-wrap: wrap; }
.map-note i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

/* ---------- States ---------- */
.state { display: grid; justify-items: center; gap: 10px; padding: 32px 16px; text-align: center; color: var(--text-3); font-size: var(--fs-sm); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.state-error { color: #F0A9A7; border-color: rgba(217,107,105,0.4); }
.state-loading { display: grid; gap: 10px; }
.skeleton { height: 44px; border-radius: 8px; background: linear-gradient(90deg, var(--surface-1), var(--surface-3), var(--surface-1)); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: var(--fs-xs); line-height: 1.55; background: var(--warning-soft); border: 1px solid rgba(217,167,90,0.3); color: #EBC48A; }
.notice svg { flex: none; margin-top: 1px; }
.notice.info { background: var(--info-soft); border-color: rgba(127,166,207,0.3); color: #A9C6E4; }

/* ---------- Overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; }
.overlay-backdrop { position: absolute; inset: 0; background: rgba(3,8,15,0.66); opacity: 0; transition: opacity var(--dur) var(--ease); }
.overlay.open .overlay-backdrop { opacity: 1; }
.modal { position: relative; margin: auto; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); opacity: 0; transform: translateY(12px) scale(0.98); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.modal-wide { width: min(860px, calc(100vw - 32px)); }
.overlay.open .modal { opacity: 1; transform: none; }
.modal-head, .drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-title, .drawer-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 400; }
.modal-body, .drawer-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot, .drawer-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: var(--surface-2); border-left: 1px solid var(--line-strong); display: flex; flex-direction: column; transform: translateX(100%); transition: transform var(--dur) var(--ease); box-shadow: var(--shadow-2); }
.drawer-wide { width: min(640px, 100vw); }
.overlay.open .drawer { transform: none; }
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: var(--fs-sm); margin: 0; }
.dl dt { color: var(--text-3); font-size: var(--fs-xs); padding-top: 2px; }
.dl dd { margin: 0; }

.cmd-list { list-style: none; margin: 10px 0 0; padding: 0; max-height: 50vh; overflow: auto; }
.cmd-item { display: grid; grid-template-columns: 80px 1fr auto; gap: 10px; padding: 9px 10px; border-radius: 8px; text-decoration: none; font-size: var(--fs-sm); }
.cmd-item.active, .cmd-item:hover { background: var(--surface-hover); }
.cmd-kind { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); padding-top: 2px; }
.cmd-hint { font-size: 11px; margin-top: 10px; }

.toast-region { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: calc(100vw - 32px); }
.toast { padding: 10px 18px; border-radius: 999px; background: var(--ivory); color: var(--navy); font-size: var(--fs-sm); font-weight: 500; box-shadow: var(--shadow-2); opacity: 0; transform: translateY(10px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); max-width: 100%; text-align: center; }
.toast.show { opacity: 1; transform: none; }
.toast-danger { background: var(--danger); color: #fff; }
.toast-success { background: var(--success); color: var(--navy); }

/* ---------- Aircraft hero (detail) ---------- */
.ac-hero { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); background: radial-gradient(90% 140% at 75% 0%, #22385A 0%, #0B1626 55%, #081321 100%); padding: 28px; min-height: 260px; display: grid; grid-template-columns: 1fr 1.2fr; align-items: center; gap: 20px; margin-bottom: 18px; }
.ac-hero h1 { font-family: var(--font-display); font-weight: 300; font-size: clamp(2.4rem, 5vw, 4rem); letter-spacing: 0.06em; }
.ac-hero .ac-sil { color: rgba(244,241,234,0.9); width: 100%; filter: drop-shadow(0 20px 30px rgba(0,0,0,0.5)); }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.spec-grid > div { background: var(--surface-2); padding: 14px; }
.spec-grid dt { font-size: var(--fs-xs); color: var(--text-3); }
.spec-grid dd { margin: 4px 0 0; font-size: var(--fs-md); }

.avail-grid { display: grid; grid-template-columns: 130px repeat(14, minmax(28px, 1fr)); gap: 3px; font-size: 11px; min-width: 620px; }
.avail-grid .h { color: var(--text-3); text-align: center; }
.avail-grid .n { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avail-cell { height: 26px; border-radius: 4px; background: var(--success-soft); border: 1px solid rgba(104,183,155,0.25); }
.avail-cell.duty { background: var(--gold-soft); border-color: var(--gold-line); }
.avail-cell.off { background: var(--surface-1); border-color: var(--line); }
.avail-cell.warn { background: var(--danger-soft); border-color: rgba(217,107,105,0.4); }

.statement { background: var(--ivory); color: #1B2430; border-radius: 10px; padding: 24px; font-size: var(--fs-sm); }
.statement h3 { font-family: var(--font-display); font-size: 1.6rem; color: #0B1626; }
.statement table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.statement td, .statement th { padding: 6px 4px; border-bottom: 1px solid #D9D3C6; text-align: left; }
.statement .r { text-align: right; }

/* Scroll containers own their absolutely-positioned descendants (e.g. .sr-only text) so nothing escapes and widens the page */
.gantt-scroll, .kanban, .table-wrap, .tabs, .chat-log, .notif-pop, .cmd-list, .persona-tabs { position: relative; }
.page-actions .badge { white-space: normal; }
.table tr.is-focus { background: var(--gold-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .cols-main { grid-template-columns: 1fr; }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .app, .app.sb-collapsed { grid-template-columns: minmax(0, 1fr); }
  #sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform var(--dur) var(--ease); box-shadow: var(--shadow-2); }
  .app.sb-open #sidebar { transform: none; }
  .app .sb-text, .app .sb-group-label, .app .sb-note { display: revert !important; }
  .app .sb-link { justify-content: flex-start !important; }
  .sb-collapse { display: none; }
  .sb-scrim { position: fixed; inset: 0; background: rgba(3,8,15,0.6); z-index: 35; opacity: 0; pointer-events: none; transition: opacity var(--dur); }
  .app.sb-open .sb-scrim { opacity: 1; pointer-events: auto; }
  .tb-menu { display: inline-flex; }
}
@media (max-width: 768px) {
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .tb-search span, .tb-search kbd { display: none; }
  .tb-search { width: 36px; justify-content: center; padding: 0; }
  .breadcrumbs li:not([aria-current]) { display: none; }
  .breadcrumbs li + li::before { display: none; }
  .ac-hero { grid-template-columns: 1fr; padding: 20px; }
  .fp-route-row { grid-template-columns: 1fr; }
  .fp-route-swap { justify-self: center; transform: rotate(90deg); }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .kpi-value { font-size: 1.7rem; }
  main#main { padding-top: 20px; }
  .demo-banner a { margin-left: 0; }
}
@media (max-width: 420px) {
  .tb-role select { max-width: 120px; }
  .kpis { grid-template-columns: 1fr 1fr; }
}

/* ---------- Real photography in cards ---------- */
.ac-media .ac-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease), opacity 0.4s; }
.ac-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,19,33,0.15) 30%, rgba(8,19,33,0.8)); pointer-events: none; }
.ac-media .badge, .ac-media .ac-tail { z-index: 1; }
.ac-card:hover .ac-photo { transform: scale(1.04); }
.ac-hero-photo { position: relative; height: 100%; min-height: 220px; border-radius: var(--radius); overflow: hidden; background: var(--surface-1); }
.ac-hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
