/* Centro aeronáutico · interfaz responsive propia de BoA Crew */
.aviation-page { --aviation-blue: #1765aa; --aviation-cyan: #31a6d8; --aviation-ink: #071b3b; }
.aviation-command {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 172px;
  margin-bottom: 16px;
  padding: clamp(24px, 4vw, 38px);
  overflow: hidden;
  border-radius: 26px;
  color: #fff;
  background:
    radial-gradient(circle at 86% 18%, rgba(87, 188, 229, .35), transparent 28%),
    linear-gradient(125deg, #071d43 0%, #0d376d 56%, #1765aa 100%);
  box-shadow: var(--shadow);
}
.aviation-command::after { content: ""; position: absolute; right: -78px; bottom: -120px; width: 320px; height: 320px; border: 42px solid rgba(255,255,255,.07); border-radius: 50%; pointer-events: none; }
.aviation-command > * { position: relative; z-index: 1; }
.aviation-command .eyebrow { color: #a9ddf4; }
.aviation-command h2 { margin: 7px 0 8px; font-size: clamp(24px, 4vw, 38px); letter-spacing: -.045em; line-height: 1.06; }
.aviation-command p { max-width: 720px; margin: 0; color: rgba(255,255,255,.76); font-size: 13px; line-height: 1.55; }
.aviation-command-states { display: grid; gap: 8px; min-width: 190px; }
.aviation-command-states span { min-height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid rgba(255,255,255,.13); border-radius: 12px; background: rgba(5,22,50,.28); color: #fff; font-size: 10px; font-weight: 800; backdrop-filter: blur(8px); }
.aviation-command-states .icon { width: 17px; height: 17px; color: #81d0f0; }

.aviation-tabs { position: sticky; z-index: 14; top: calc(var(--topbar) + 7px); display: flex; gap: 7px; margin-bottom: 16px; padding: 6px; overflow-x: auto; border: 1px solid var(--border); border-radius: 16px; background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: var(--shadow-sm); backdrop-filter: blur(15px); scrollbar-width: thin; }
.aviation-tabs button { flex: 1 0 auto; min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 850; }
.aviation-tabs button.active { background: var(--navy); color: #fff; box-shadow: 0 7px 18px rgba(13,43,96,.2); }
.aviation-tabs .icon { width: 18px; height: 18px; }
.aviation-tab-content { min-width: 0; }
.aviation-view { display: grid; gap: 16px; }

.aviation-toolbar { display: flex; align-items: flex-end; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow-sm); }
.aviation-toolbar .primary-button, .aviation-toolbar .secondary-button { white-space: nowrap; }
.aviation-select-field { min-width: 220px; display: grid; flex: 1; gap: 6px; color: var(--text); font-size: 10px; font-weight: 850; }
.aviation-select-field .select-control { min-height: 44px; }
.active-toggle { border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); background: color-mix(in srgb, var(--navy-soft) 72%, var(--surface)); }

.aviation-inline-error { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid #d8a35c; border-radius: 13px; background: #fff3df; color: #714414; font-size: 11px; line-height: 1.45; }
[data-theme="dark"] .aviation-inline-error { border-color: #7b5d30; background: #3e2b14; color: #ffddaa; }
.aviation-workspace { min-width: 0; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .72fr); gap: 16px; align-items: start; }
.aviation-map-panel, .aviation-detail-panel { margin: 0 !important; }
.aviation-map-panel .panel-header { min-height: 72px; }
.aviation-map-wrap { position: relative; min-width: 0; }
.aviation-map { width: 100%; height: clamp(440px, 59vh, 650px); background: #dce8f4; isolation: isolate; }
.aviation-map-unavailable { height: 100%; display: grid; place-items: center; padding: 30px; color: var(--muted); text-align: center; }
.aviation-map-legend { position: absolute; z-index: 500; left: 12px; bottom: 24px; display: flex; flex-wrap: wrap; gap: 5px; padding: 7px; border-radius: 10px; background: rgba(255,255,255,.92); color: #23334c; box-shadow: 0 5px 16px rgba(7,31,68,.18); }
.aviation-map-legend span { display: flex; align-items: center; gap: 4px; font-size: 8px; font-weight: 850; }
.aviation-map-legend i { width: 8px; height: 8px; border-radius: 50%; }
.aviation-map-legend .vfr { background: #178651; }
.aviation-map-legend .mvfr { background: #2675c7; }
.aviation-map-legend .ifr { background: #ce3846; }
.aviation-map-legend .lifr { background: #9a48b9; }

.aviation-source-state { min-height: 28px; display: inline-flex; align-items: center; gap: 6px; padding: 0 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 8px; font-weight: 900; white-space: nowrap; }
.aviation-source-state i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.aviation-source-state.live { background: #e2f7ec; color: #087047; }
.aviation-source-state.cached { background: #e7f1fb; color: #25669e; }
.aviation-source-state.stale, .aviation-source-state.unavailable { background: #fff0dc; color: #986018; }
[data-theme="dark"] .aviation-source-state.live { background: #123c31; color: #9ce6c6; }
[data-theme="dark"] .aviation-source-state.cached { background: #173b61; color: #b6dcff; }
[data-theme="dark"] .aviation-source-state.stale, [data-theme="dark"] .aviation-source-state.unavailable { background: #4b3519; color: #ffdda8; }

.aviation-detail-panel { overflow: hidden; }
.aviation-airport-hero { min-height: 144px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 23px; color: #fff; background: linear-gradient(135deg, #0b2c5d, #1b609c); }
.aviation-airport-hero .eyebrow { color: #9fd6ef; }
.aviation-airport-hero h2 { margin: 6px 0 3px; font-size: 28px; letter-spacing: -.04em; }
.aviation-airport-hero p { margin: 0; color: rgba(255,255,255,.72); font-size: 10px; }
.flight-category { min-width: 45px; min-height: 27px; display: inline-grid; place-items: center; padding: 0 8px; border-radius: 9px; background: #7d8797; color: #fff; font-size: 9px; font-weight: 950; }
.flight-category.large { min-width: 63px; min-height: 48px; border: 4px solid rgba(255,255,255,.18); border-radius: 15px; font-size: 13px; }
.flight-category.vfr { background: #178651; }
.flight-category.mvfr { background: #2675c7; }
.flight-category.ifr { background: #ce3846; }
.flight-category.lifr { background: #8842a7; }
.aviation-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; padding: 1px; background: var(--border); }
.aviation-metrics > div { min-width: 0; min-height: 72px; display: grid; align-content: center; gap: 5px; padding: 12px 15px; background: var(--surface); }
.aviation-metrics small { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.aviation-metrics strong { overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; }
.aviation-metrics.compact > div { min-height: 64px; }
.aviation-raw-report { border-top: 1px solid var(--border); background: var(--surface); }
.aviation-raw-report summary { padding: 13px 15px; color: var(--text); font-size: 10px; font-weight: 850; cursor: pointer; }
.aviation-raw-report code { display: block; margin: 0 15px 14px; padding: 12px; overflow-wrap: anywhere; border-radius: 10px; background: var(--aviation-ink); color: #d7ebff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; line-height: 1.55; }
.aviation-raw-report > small { display: block; margin: -6px 15px 14px; color: var(--muted); font-size: 8px; }
.aviation-data-note { display: flex; align-items: flex-start; gap: 8px; padding: 13px 15px; border-top: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 9px; line-height: 1.45; }
.aviation-data-note .icon { width: 16px; height: 16px; color: var(--brand); }
.aviation-empty { min-height: 220px; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 24px; color: var(--muted); text-align: center; }
.aviation-empty.compact { min-height: 155px; }
.aviation-empty > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: var(--navy-soft); color: var(--brand); }
.aviation-empty h3, .aviation-empty p { margin: 0; }
.aviation-empty h3 { color: var(--text); font-size: 14px; }
.aviation-empty p { max-width: 280px; font-size: 10px; line-height: 1.5; }

.aviation-favorites-section { display: grid; grid-template-columns: minmax(180px, .35fr) minmax(0, 1fr); align-items: center; gap: 18px; padding: 17px 19px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.aviation-favorites-section h2 { margin: 0 0 4px; font-size: 14px; }
.aviation-favorites-section p { margin: 0; color: var(--muted); font-size: 9px; }
.aviation-favorite-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 8px; }
.aviation-favorite-airport { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); text-align: left; }
.aviation-favorite-airport.active { border-color: var(--brand); background: var(--navy-soft); }
.aviation-favorite-airport span { display: grid; gap: 2px; }
.aviation-favorite-airport strong { font-size: 13px; }
.aviation-favorite-airport small { color: var(--muted); font-size: 8px; }

.weather-marker-shell, .aircraft-map-marker-shell { border: 0 !important; background: transparent !important; }
.weather-map-marker { width: 48px; height: 48px; display: grid; place-content: center; justify-items: center; gap: 1px; padding: 0; border: 3px solid #fff; border-radius: 50%; background: #687386; color: #fff; box-shadow: 0 5px 14px rgba(7,31,68,.3); }
.weather-map-marker.selected { transform: scale(1.13); box-shadow: 0 0 0 5px rgba(39,112,176,.22), 0 6px 16px rgba(7,31,68,.34); }
.weather-map-marker strong { font-size: 10px; }
.weather-map-marker small { font-size: 7px; font-weight: 900; }
.weather-map-marker.vfr { background: #178651; }
.weather-map-marker.mvfr { background: #2675c7; }
.weather-map-marker.ifr { background: #ce3846; }
.weather-map-marker.lifr { background: #8842a7; }

.aviation-radar-status { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.aviation-radar-status > div { min-height: 72px; display: grid; align-content: center; gap: 3px; padding: 12px 15px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); }
.aviation-radar-status strong { color: var(--text); font-size: 18px; }
.aviation-radar-status span { color: var(--muted); font-size: 8px; }
.aviation-radar-side { min-width: 0; display: grid; gap: 16px; }
.aviation-live-label, .aviation-phase { padding: 6px 8px; border-radius: 8px; background: var(--navy-soft); color: var(--brand); font-size: 7px; font-weight: 950; letter-spacing: .08em; white-space: nowrap; }
.radar-selected-flight { min-width: 0; overflow: hidden; }
.radar-selected-heading { min-height: 120px; display: flex; align-items: center; gap: 15px; padding: 18px; color: #fff; background: linear-gradient(135deg, #0c2b5c, #194e87); }
.radar-selected-heading h2 { margin: 5px 0 2px; font-size: 23px; letter-spacing: -.035em; }
.radar-selected-heading p { margin: 0; color: rgba(255,255,255,.7); font-size: 9px; }
.radar-selected-heading .eyebrow { color: #93d3f0; }
.aircraft-symbol { width: 52px; height: 52px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 16px; background: rgba(255,255,255,.12); color: #fff; font-size: 29px; transform: rotate(var(--track)); }
.aircraft-symbol.small { width: 34px; height: 34px; border-radius: 10px; background: var(--navy-soft); color: var(--brand); font-size: 18px; }
.radar-list-panel { min-height: 0; }
.radar-flight-list { max-height: 420px; padding: 8px; overflow-y: auto; }
.radar-flight-row { width: 100%; min-height: 58px; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 7px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--text); text-align: left; }
.radar-flight-row:hover, .radar-flight-row.active { border-color: var(--border); background: var(--surface-2); }
.radar-flight-row > span:not(.aircraft-symbol) { min-width: 0; display: grid; gap: 2px; }
.radar-flight-row > span:last-child { text-align: right; }
.radar-flight-row strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.radar-flight-row small { overflow: hidden; color: var(--muted); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.aircraft-map-marker { min-width: 58px; min-height: 43px; display: grid; justify-items: center; gap: 0; padding: 2px 5px; border: 0; border-radius: 10px; background: rgba(255,255,255,.93); color: #174c82; box-shadow: 0 4px 13px rgba(5,26,60,.27); }
.aircraft-map-marker.boa { background: #0d2b60; color: #fff; box-shadow: 0 0 0 4px rgba(47,139,198,.24), 0 5px 14px rgba(5,26,60,.35); }
.aircraft-map-marker span { display: block; font-size: 20px; line-height: 20px; transform: rotate(var(--track)); }
.aircraft-map-marker small { max-width: 54px; overflow: hidden; font-size: 7px; font-weight: 950; text-overflow: ellipsis; white-space: nowrap; }
.aviation-safety-banner { margin-top: 0; }

.aviation-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.aviation-guide-grid .panel { margin: 0; }
.aviation-check-list { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.aviation-check-list li { display: flex; align-items: flex-start; gap: 9px; color: var(--text); font-size: 11px; line-height: 1.45; }
.aviation-check-list .icon { width: 17px; height: 17px; color: #178651; }
.aviation-check-list.pending .icon { color: #bf7a17; }
.aviation-provider-table { margin: 0 !important; }
.provider-row { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 66px; padding: 10px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); }
.provider-row + .provider-row { margin-top: 8px; }
.provider-row > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.provider-row strong { font-size: 11px; }
.provider-row small { color: var(--muted); font-size: 8px; }
.provider-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--navy-soft); color: var(--brand); }
.provider-status { min-height: 25px; display: inline-grid; place-items: center; padding: 0 8px; border-radius: 8px; font-size: 7px; font-weight: 950; letter-spacing: .06em; }
.provider-status.active { background: #e1f6eb; color: #0a7046; }
.provider-status.test { background: #e4effa; color: #236499; }
.provider-status.pending { background: #fff0dc; color: #986018; }
[data-theme="dark"] .provider-status.active { background: #153d30; color: #98e3c3; }
[data-theme="dark"] .provider-status.test { background: #173a5e; color: #aed8ff; }
[data-theme="dark"] .provider-status.pending { background: #4a351b; color: #ffdda5; }

.aviation-admin-layout { align-items: start; }
.aviation-admin-layout .panel { margin: 0; }
.aviation-admin-health { display: grid; gap: 8px; margin-bottom: 14px; }
.aviation-admin-health article { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 61px; padding: 9px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.aviation-admin-health article > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--navy-soft); color: var(--brand); }
.aviation-admin-health article > div { min-width: 0; display: grid; gap: 2px; }
.aviation-admin-health strong { font-size: 10px; }
.aviation-admin-health small { color: var(--muted); font-size: 8px; }
.full-button { width: 100%; margin-top: 14px; }

.aviation-map .leaflet-control-zoom a { color: #17375f; }
.aviation-map .leaflet-control-attribution { max-width: 76%; overflow: hidden; background: rgba(255,255,255,.88); color: #314258; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.aviation-map .leaflet-popup-content-wrapper, .aviation-map .leaflet-popup-tip { background: var(--surface); color: var(--text); }
.aviation-map .leaflet-popup-content { font-size: 10px; line-height: 1.45; }

@media (max-width: 1080px) {
  .aviation-workspace { grid-template-columns: minmax(0, 1fr); }
  .aviation-detail-panel, .aviation-radar-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aviation-airport-hero { grid-column: 1 / -1; }
  .aviation-detail-panel > .aviation-metrics { grid-column: 1; }
  .aviation-detail-panel > .aviation-raw-report, .aviation-detail-panel > .aviation-data-note { grid-column: 2; }
  .aviation-detail-panel > .aviation-raw-report + .aviation-raw-report { grid-column: 2; }
}

@media (max-width: 760px) {
  .aviation-command { grid-template-columns: 1fr; }
  .aviation-command-states { grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; }
  .aviation-command-states span { justify-content: center; padding: 8px; text-align: center; }
  .aviation-tabs { top: calc(var(--topbar) + 3px); margin-left: -4px; margin-right: -4px; }
  .aviation-tabs button { padding: 0 13px; }
  .aviation-toolbar { align-items: stretch; flex-direction: column; }
  .aviation-select-field { min-width: 0; }
  .aviation-toolbar .primary-button, .aviation-toolbar .secondary-button { width: 100%; }
  .aviation-map { height: 420px; }
  .aviation-detail-panel, .aviation-radar-side { display: block; }
  .aviation-detail-panel > * { grid-column: auto; }
  .aviation-airport-hero { grid-column: auto; }
  .aviation-radar-side > .panel + .panel { margin-top: 16px !important; }
  .aviation-radar-status { grid-template-columns: 1fr; }
  .aviation-radar-status > div { min-height: 60px; }
  .aviation-favorites-section { grid-template-columns: 1fr; }
  .aviation-guide-grid { grid-template-columns: 1fr; }
  .provider-row { grid-template-columns: 42px minmax(0,1fr); }
  .provider-row .provider-status { grid-column: 2; justify-self: start; }
}

@media (max-width: 520px) {
  .aviation-command { min-height: 0; padding: 22px 18px; border-radius: 21px; }
  .aviation-command h2 { font-size: 25px; }
  .aviation-command-states { grid-template-columns: 1fr; }
  .aviation-command-states span { justify-content: flex-start; min-height: 34px; }
  .aviation-map { height: 350px; }
  .aviation-airport-hero { min-height: 126px; padding: 18px; }
  .aviation-airport-hero h2 { font-size: 24px; }
  .aviation-metrics > div { min-height: 66px; padding: 11px; }
  .aviation-favorite-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .radar-flight-list { max-height: 350px; }
}

@media (orientation: landscape) and (max-height: 720px) and (min-width: 620px) {
  .aviation-command { min-height: 120px; padding-block: 20px; grid-template-columns: minmax(0, 1fr) auto; }
  .aviation-command h2 { font-size: 27px; }
  .aviation-command p { max-width: 640px; }
  .aviation-command-states { grid-template-columns: 1fr; }
  .aviation-workspace { grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); }
  .aviation-detail-panel, .aviation-radar-side { display: block; }
  .aviation-map { height: calc(100vh - 205px); min-height: 390px; max-height: 590px; }
  .aviation-radar-side > .panel + .panel { margin-top: 16px !important; }
  .radar-flight-list { max-height: 42vh; }
}

@media (prefers-reduced-motion: reduce) {
  .aviation-map .leaflet-zoom-animated { transition: none !important; }
}
