:root {
    --bg: #e7ecef;
    --bg-deep: #dbe3e8;
    --bg-top: #eff4f7;
    --bg-overlay-1: rgba(32, 79, 120, 0.18);
    --bg-overlay-2: rgba(176, 146, 105, 0.14);
    --field-bg: rgba(255, 255, 255, 0.92);
    --field-bg-focus: #ffffff;
    --panel: rgba(255, 253, 249, 0.9);
    --panel-strong: #d9e1e7;
    --panel-dark: #11212d;
    --text: #15222d;
    --muted: #5f7180;
    --accent: #204f78;
    --accent-strong: #163956;
    --accent-soft: #e3edf4;
    --danger: #9f3e34;
    --border: rgba(82, 105, 123, 0.2);
    --line: rgba(17, 33, 45, 0.08);
    --shadow: 0 24px 60px rgba(24, 41, 54, 0.12);
    --shadow-soft: 0 14px 30px rgba(24, 41, 54, 0.08);
    --radius: 22px;
    --radius-sm: 14px;
    --font: "Avenir Next", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(circle at top left, var(--bg-overlay-1), transparent 28%),
        radial-gradient(circle at right 15%, var(--bg-overlay-2), transparent 22%),
        linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 40%, var(--bg-deep) 100%);
    line-height: 1.5;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 180ms ease, opacity 180ms ease;
}

a:hover {
    color: var(--accent-strong);
}

button,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(180deg, #2b628f 0%, var(--accent) 100%);
    color: white;
    border: 0;
    border-radius: 999px;
    padding: 0.85rem 1.25rem;
    font: inherit;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(32, 79, 120, 0.18);
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

button:hover,
.button-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(32, 79, 120, 0.22);
}

button.secondary,
.secondary-link,
.secondary.small {
    background: linear-gradient(180deg, #edf2f6 0%, var(--panel-strong) 100%);
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(95, 113, 128, 0.08), var(--shadow-soft);
}

button.danger {
    background: linear-gradient(180deg, #b55147 0%, var(--danger) 100%);
}

input,
select,
textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 13px;
    border: 1px solid var(--border);
    background: var(--field-bg);
    font: inherit;
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(32, 79, 120, 0.45);
    box-shadow: 0 0 0 4px rgba(32, 79, 120, 0.12);
    background: var(--field-bg-focus);
}

textarea {
    resize: vertical;
    min-height: 8rem;
}

label span,
.section-header h3,
.page-header h2,
.panel-header h3 {
    display: block;
    margin-bottom: 0.45rem;
}

label {
    color: var(--muted);
    font-size: 0.95rem;
}

h1,
h2,
h3,
strong {
    color: var(--panel-dark);
}

p {
    color: var(--muted);
}

.eyebrow {
    display: inline-block;
    margin-bottom: 0.55rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.76rem;
    font-weight: 700;
}

small {
    color: var(--danger);
    min-height: 1.1rem;
    display: block;
    margin-top: 0.35rem;
}

.shell {
    display: grid;
    grid-template-columns: 290px 1fr;
    grid-template-areas: "sidebar main";
    min-height: 100vh;
}

.app-topbar {
    display: none;
}

.sidebar {
    grid-area: sidebar;
    position: relative;
    padding: 1.5rem 1.2rem;
    background:
        linear-gradient(180deg, rgba(10, 24, 34, 0.97) 0%, rgba(17, 33, 45, 0.95) 100%),
        var(--panel-dark);
    color: white;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.06), transparent 28%),
        radial-gradient(circle at bottom left, rgba(191, 163, 116, 0.16), transparent 25%);
    pointer-events: none;
}

.brand-block,
.sidebar-nav,
.sidebar-footer {
    position: relative;
    z-index: 1;
}

.brand-block {
    padding: 1.4rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.brand-block h1 {
    margin: 0;
    font-size: 1.75rem;
    color: white;
}

.brand-block p,
.user-card span,
.user-card em {
    color: rgba(227, 236, 243, 0.7);
}

.brand-block p {
    margin: 0.75rem 0 0;
    font-size: 0.95rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.sidebar-nav a {
    color: rgba(255, 255, 255, 0.84);
    padding: 0.7rem 0.75rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: relative;
}

.sidebar-nav a i {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
}

.sidebar-nav a span {
    line-height: 1.25;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.08);
    color: white;
}

.sidebar-nav a.active::before {
    content: "";
    position: absolute;
    left: -0.45rem;
    top: 0.48rem;
    bottom: 0.48rem;
    width: 0.2rem;
    border-radius: 999px;
    background: var(--accent);
}

.sidebar-nav a:focus-visible,
.menu-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 1rem;
}

.user-card {
    padding: 1.15rem 1.2rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.user-card span,
.user-card em {
    display: block;
    font-style: normal;
}

.user-card strong {
    display: block;
    margin: 0.2rem 0;
    color: white;
}

.main {
    grid-area: main;
    padding: 2rem 2.25rem 3rem;
    max-width: 1440px;
    width: auto;
    min-width: 0;
}

.sidebar-backdrop {
    display: none;
}

.page-header,
.panel-header,
.section-header,
.actions,
.pagination,
.filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.page-header {
    padding: 1.6rem 1.75rem;
    border: 1px solid rgba(82, 105, 123, 0.14);
    border-radius: calc(var(--radius) + 2px);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(250, 246, 238, 0.92)),
        var(--panel);
    box-shadow: var(--shadow);
    margin-bottom: 1.35rem;
}

.page-header h2,
.panel-header h3,
.section-header h3 {
    margin: 0;
    letter-spacing: -0.02em;
}

.page-header p {
    margin: 0.35rem 0 0;
    max-width: 42rem;
}

.panel,
.stat-card,
.login-card,
.inline-card {
    background: var(--panel);
    border: 1px solid rgba(82, 105, 123, 0.12);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.panel,
.inline-card {
    padding: 1.45rem;
    margin-top: 1.4rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.1rem;
}

.report-summary {
    margin-top: 1.4rem;
}

.currency-grid {
    grid-template-columns: repeat(2, 1fr);
}

.alert-grid {
    grid-template-columns: repeat(3, 1fr);
}

.stat-card {
    padding: 1.35rem;
    position: relative;
    overflow: hidden;
}

.stat-card span {
    color: var(--muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-card strong {
    display: block;
    font-size: 2.1rem;
    margin-top: 0.55rem;
}

.stat-card .compact-stat {
    font-size: 1.55rem;
}

.currency-card p {
    color: var(--muted);
    margin: 0.55rem 0 0;
}

.alert-card p {
    color: var(--muted);
    margin: 0.55rem 0 0;
}

.alert-card strong {
    font-size: 1.45rem;
}

.alert-card.is-warning::after {
    background: linear-gradient(90deg, rgba(183, 126, 38, 0.95), rgba(191, 163, 116, 0.75));
}

.alert-card.is-expired::after {
    background: linear-gradient(90deg, rgba(165, 64, 54, 0.95), rgba(191, 163, 116, 0.75));
}

.alert-card.is-missing::after {
    background: linear-gradient(90deg, rgba(95, 113, 128, 0.95), rgba(191, 163, 116, 0.75));
}

.currency-card.is-current::after {
    background: linear-gradient(90deg, rgba(34, 128, 86, 0.95), rgba(191, 163, 116, 0.75));
}

.currency-card.is-expired::after {
    background: linear-gradient(90deg, rgba(165, 64, 54, 0.95), rgba(191, 163, 116, 0.75));
}

.stat-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, rgba(32, 79, 120, 0.95), rgba(191, 163, 116, 0.75));
}

.stack {
    display: grid;
    gap: 1rem;
}

.grid {
    display: grid;
    gap: 1rem;
}

.grid.two {
    grid-template-columns: repeat(2, 1fr);
}

.grid.four {
    grid-template-columns: repeat(4, 1fr);
}

.grid.three {
    grid-template-columns: repeat(3, 1fr);
}

.grid.five {
    grid-template-columns: repeat(5, 1fr);
}

.risk-value-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    min-width: 5.5rem;
    padding: 0 1rem;
    border: 2px solid var(--line);
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.7);
    color: var(--panel-dark);
}

.risk-value-box.risk-level-1 {
    border-color: #2e8b57;
    color: #1d6b41;
}

.risk-value-box.risk-level-2 {
    border-color: #78a44d;
    color: #5f8539;
}

.risk-value-box.risk-level-3 {
    border-color: #c9a93b;
    color: #8f7421;
}

.risk-value-box.risk-level-4 {
    border-color: #cc7b3b;
    color: #9f5d2b;
}

.risk-value-box.risk-level-5 {
    border-color: #b34747;
    color: #8e2f2f;
}

.risk-total-box {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.8rem;
    padding: 0.45rem 0.9rem;
    border: 2px solid #2e8b57;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
}

.risk-total-box strong {
    font-size: 1.2rem;
    line-height: 1;
}

.risk-total-box span {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.8rem;
}

.risk-total-box.risk-total-low {
    border-color: #2e8b57;
    color: #1d6b41;
}

.risk-total-box.risk-total-medium {
    border-color: #c9a93b;
    color: #8f7421;
}

.risk-total-box.risk-total-high {
    border-color: #b34747;
    color: #8e2f2f;
}

.risk-total-panel {
    display: grid;
    gap: 0.85rem;
    max-width: 34rem;
}

.risk-scale {
    display: grid;
    gap: 0.35rem;
}

.risk-scale-track {
    position: relative;
    height: 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: linear-gradient(90deg, #2e8b57 0%, #c9a93b 55%, #b34747 100%);
}

.risk-scale-marker {
    position: absolute;
    top: -0.32rem;
    width: 0.45rem;
    height: 1.55rem;
    border-radius: 6px;
    background: #11212d;
    transform: translateX(-50%);
    left: 0;
}

.risk-scale-legend {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 0;
}

.detail-grid div {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.55);
}

.detail-grid dt {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.detail-grid dd {
    margin: 0.4rem 0 0;
    font-weight: 700;
}

.detail-grid .detail-wide {
    grid-column: 1 / -1;
}

.filters {
    align-items: end;
    flex-wrap: wrap;
}

.filters input,
.filters select {
    flex: 1 1 180px;
}

.filter-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.filter-checkbox input[type="checkbox"] {
    width: auto;
    min-width: 1rem;
    flex: 0 0 auto;
    box-shadow: none;
}

.filter-checkbox small {
    display: none;
}

.report-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.report-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.65);
    color: var(--accent-strong);
    padding: 0.55rem 1rem;
    font-weight: 600;
}

.report-links a.active {
    background: linear-gradient(180deg, #2b628f 0%, var(--accent) 100%);
    color: white;
    border-color: transparent;
}

.link-list {
    margin: 0;
    padding-left: 1.15rem;
    color: var(--muted);
}

.link-list li + li {
    margin-top: 0.45rem;
}

.table-shell {
    overflow: auto;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.55);
}

.trip-overview-panel,
.trip-overview-card,
[data-trip-overview-pane],
[data-trip-overview-pane] .route-map-shell,
[data-trip-overview-pane] .external-route-map {
    max-width: 100%;
    min-width: 0;
}

.trip-overview-panel .table-shell {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.trip-timeline-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.trip-timeline-summary span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.22rem 0.62rem;
    background: rgba(255, 255, 255, 0.78);
    color: var(--panel-dark);
    font-size: 0.82rem;
    font-weight: 650;
}

.trip-timeline-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.trip-timeline-legend .swatch {
    display: inline-block;
    width: 14px;
    height: 10px;
    border-radius: 3px;
    margin-right: 0.32rem;
    border: 1px solid rgba(17, 33, 45, 0.22);
}

.trip-timeline-legend .swatch.leg {
    background: #2f688f;
}

.trip-timeline-legend .swatch.event-stay {
    background: #688b35;
}

.trip-timeline-legend .swatch.event-refuel {
    background: #8b5e2f;
}

.trip-timeline-legend .swatch.event-repair {
    background: #845a8f;
}

.trip-timeline-legend .swatch.reservation {
    background: rgba(66, 153, 225, 0.35);
}

.trip-timeline-legend .swatch.warning {
    background: #ad3f35;
}

.trip-timeline-legend .swatch.now {
    background: repeating-linear-gradient(90deg, #8b5e2f 0 3px, transparent 3px 6px);
}

.trip-timeline-shell {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(248, 251, 253, 0.92), rgba(255, 255, 255, 0.95));
    overflow: hidden;
}

.trip-timeline-axis-labels {
    display: none;
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 66px 0 0 0.7rem;
    position: absolute;
    z-index: 2;
    pointer-events: none;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.trip-timeline-canvas-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    padding-left: 56px;
}

.trip-timeline-canvas {
    display: block;
    min-height: 232px;
    cursor: default;
}

.timeline-bar {
    cursor: pointer;
    stroke: rgba(17, 33, 45, 0.22);
    stroke-width: 1;
}

.timeline-bar-leg {
    fill: #2f688f;
}

.timeline-bar-event-stay {
    fill: #688b35;
}

.timeline-bar-event-refuel {
    fill: #8b5e2f;
}

.timeline-bar-event-repair {
    fill: #845a8f;
}

.timeline-bar-label {
    fill: rgba(255, 255, 255, 0.96);
    font-size: 10px;
    font-weight: 700;
    pointer-events: none;
}

.timeline-warning-tag {
    fill: #ad3f35;
}

.timeline-reservation-band {
    fill: rgba(66, 153, 225, 0.12);
    stroke: rgba(47, 104, 143, 0.45);
    stroke-width: 1;
    pointer-events: none;
}

.timeline-bar-missing-transfer {
    fill: rgba(173, 63, 53, 0.22);
    stroke: #ad3f35;
    stroke-width: 1.6;
    stroke-dasharray: 5 3;
}

.timeline-bar-outside-reservation {
    fill: rgba(173, 63, 53, 0.55);
    stroke: #ad3f35;
    stroke-width: 1.2;
    stroke-dasharray: 4 2;
    pointer-events: none;
}

.trip-timeline-tooltip {
    position: absolute;
    z-index: 5;
    max-width: 360px;
    border: 1px solid rgba(53, 81, 102, 0.28);
    border-radius: 10px;
    background: rgba(14, 32, 45, 0.94);
    color: #f7fbff;
    padding: 0.55rem 0.68rem;
    font-size: 0.74rem;
    line-height: 1.35;
    box-shadow: 0 10px 26px rgba(10, 23, 34, 0.35);
    pointer-events: none;
}

@media (max-width: 900px) {
    .trip-timeline-summary {
        gap: 0.45rem;
    }
    .trip-timeline-summary span {
        font-size: 0.76rem;
    }
}

.trip-overview-panel .table-shell table {
    width: max-content;
    min-width: 100%;
}

.trip-overview-panel .inline-card,
.trip-overview-panel .table-shell,
.trip-overview-panel [data-trip-overview-pane],
.trip-overview-panel [data-trip-overview-pane] .route-map-shell {
    min-width: 0;
}

.empty-note {
    color: var(--muted);
    margin: 0.75rem 0 0;
}

.report-charts .panel-header {
    margin-bottom: 1rem;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.chart-card {
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    min-width: 0;
}

.chart-card-wide {
    grid-column: span 2;
}

.chart-card h4 {
    margin: 0 0 0.85rem;
    font-size: 1rem;
}

.chart-bar-list,
.duration-chart {
    display: grid;
    gap: 0.7rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.chart-bar-list-compact {
    gap: 0.55rem;
}

.chart-bar-row {
    display: grid;
    grid-template-columns: minmax(8rem, 1fr) minmax(7rem, 1.25fr) auto;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.chart-bar-label {
    min-width: 0;
}

.chart-bar-label span,
.chart-bar-label small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chart-bar-label small {
    color: var(--muted);
    font-size: 0.78rem;
}

.chart-bar-track {
    height: 0.55rem;
    border-radius: 999px;
    background: rgba(32, 79, 120, 0.12);
    overflow: hidden;
}

.chart-bar-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), #bfa374);
}

.chart-bar-row strong {
    color: var(--accent-strong);
    font-size: 0.9rem;
    white-space: nowrap;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 1rem 0.9rem;
    border-bottom: 1px solid var(--line);
}

th {
    position: sticky;
    top: 0;
    z-index: 2;
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: rgba(223, 231, 236, 0.45);
}

.table-sort-button {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    letter-spacing: inherit;
    padding: 0;
    text-align: left;
    text-transform: inherit;
}

.table-sort-button[data-sort-direction="asc"]::after {
    content: " ↑";
}

.table-sort-button[data-sort-direction="desc"]::after {
    content: " ↓";
}

tbody tr:nth-child(even) {
    background: rgba(248, 250, 251, 0.72);
}

tbody tr:hover {
    background: rgba(227, 237, 244, 0.62);
}

tbody tr.is-selected {
    background: rgba(32, 79, 120, 0.14);
}

[data-clickable-row] {
    cursor: pointer;
}

[data-clickable-row]:focus {
    outline: 3px solid rgba(32, 79, 120, 0.28);
    outline-offset: -3px;
}

.flash {
    padding: 1rem 1.2rem;
    border-radius: 16px;
    margin: 1rem 0;
    border: 1px solid transparent;
}

.flash.success {
    background: rgba(56, 137, 86, 0.14);
    border-color: rgba(56, 137, 86, 0.16);
}

.flash.error {
    background: rgba(166, 63, 46, 0.14);
    border-color: rgba(166, 63, 46, 0.16);
}

.guest-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.login-card {
    width: min(440px, calc(100vw - 2rem));
    padding: 2.25rem;
}

.flight-form .actions {
    justify-content: flex-start;
}

.inline-form {
    display: inline-block;
}

.inline-actions {
    margin-top: 1rem;
}

.admin-grid {
    align-items: start;
}

.sql-input {
    font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
    min-height: 22rem;
}

.sql-result {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.user-row-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(110px, 1fr)) auto;
    gap: 0.75rem;
    align-items: center;
}

.qualification-summary {
    display: grid;
    gap: 0.25rem;
    min-width: 170px;
    color: var(--muted);
    font-size: 0.85rem;
}

.muted-copy,
.inline-card p {
    color: var(--muted);
}

.alarm-copy {
    color: var(--danger);
    font-weight: 600;
}

.comment-list {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.comment-card {
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.62);
}

.comment-card span {
    display: block;
    margin: 0.2rem 0 0.55rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.comment-card p {
    margin: 0;
}

.prep-aircraft-pane {
    margin-top: 0;
}

.prep-aircraft-pane .panel-header {
    align-items: flex-start;
}

.prep-aircraft-pane h4 {
    margin: 0 0 0.65rem;
    color: var(--panel-dark);
}

.prep-planning-grid {
    align-items: start;
}

.compact-metrics {
    display: grid;
    gap: 0.45rem;
    margin: 0;
}

.compact-metrics div {
    display: grid;
    grid-template-columns: minmax(150px, 0.9fr) minmax(110px, 1fr);
    gap: 0.8rem;
    align-items: baseline;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--line);
}

.compact-metrics div:last-child {
    border-bottom: 0;
}

.compact-metrics dt {
    color: var(--muted);
    font-size: 0.85rem;
}

.compact-metrics dd {
    margin: 0;
    color: var(--panel-dark);
    font-weight: 700;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.tool-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(243, 238, 230, 0.9));
}

.tool-card p {
    margin: 0;
}

.tool-coordinate-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.tool-coordinate-grid-single {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-actions {
    display: flex;
    justify-content: flex-start;
}

.tool-result {
    margin-top: 0.25rem;
}

.tool-error {
    color: var(--danger);
}

.prep-route-pane {
    margin-top: 0;
    max-width: 100%;
    overflow: hidden;
}

.prep-solar-pane {
    margin: 0 0 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
}

.prep-solar-pane .panel-header {
    margin-bottom: 0.75rem;
}

.solar-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.85rem;
}

.solar-event-card {
    padding: 0.95rem;
    border-radius: 14px;
    border: 1px solid rgba(104, 124, 141, 0.25);
    background: linear-gradient(180deg, rgba(247, 248, 250, 0.96), rgba(236, 241, 246, 0.96));
}

.solar-event-card h4 {
    margin: 0 0 0.55rem;
}

.solar-event-table {
    display: grid;
    gap: 0.6rem;
    margin: 0;
}

.solar-event-table div {
    display: grid;
    gap: 0.25rem;
}

.solar-event-table dt {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--heading);
}

.solar-event-table dd {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    color: var(--text);
}

.route-map-shell {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    background: rgba(227, 237, 244, 0.48);
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.external-route-map {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 520px;
    display: block;
    background:
        linear-gradient(180deg, rgba(227, 237, 244, 0.95), rgba(255, 253, 249, 0.92));
}

.airport-map-shell {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    background: rgba(227, 237, 244, 0.48);
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.airport-list-map {
    height: 810px;
}

/* Critical Leaflet layout rules kept local so tiles/layers render correctly even if CDN CSS is delayed. */
.leaflet-container {
    overflow: hidden;
    position: relative;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-layer {
    position: absolute;
    left: 0;
    top: 0;
}

.leaflet-tile-pane {
    z-index: 200;
}

.leaflet-overlay-pane {
    z-index: 400;
}

.leaflet-shadow-pane {
    z-index: 500;
}

.leaflet-marker-pane {
    z-index: 600;
}

.leaflet-tooltip-pane {
    z-index: 650;
}

.leaflet-popup-pane {
    z-index: 700;
}

.leaflet-tile {
    user-select: none;
}

.leaflet-control-container {
    position: relative;
    z-index: 800;
}

.route-airport-marker {
    align-items: center;
    background: var(--accent);
    border: 2px solid white;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(17, 33, 45, 0.22);
    color: white;
    display: flex;
    font-size: 0.74rem;
    font-weight: 800;
    height: 2.15rem;
    justify-content: center;
    min-width: 3.4rem;
    padding: 0 0.55rem;
}

.airport-list-marker {
    align-items: center;
    background: #245c8a;
    border: 2px solid white;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(17, 33, 45, 0.22);
    color: white;
    display: flex;
    font-size: 0.72rem;
    font-weight: 800;
    height: 2.15rem;
    justify-content: center;
    min-width: 3.6rem;
    padding: 0 0.55rem;
}

.airport-list-marker.inactive {
    background: #7c8a93;
}

.airport-list-marker.selected {
    background: #1f6f43;
    box-shadow: 0 0 0 4px rgba(31, 111, 67, 0.16), 0 4px 14px rgba(17, 33, 45, 0.22);
}

.route-airport-icon {
    background: transparent;
    border: 0;
}

.airport-list-icon {
    background: transparent;
    border: 0;
}

.route-airport-marker.destination {
    background: #8b5e2f;
}

.route-distance-tooltip {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(82, 105, 123, 0.18);
    border-radius: 999px;
    box-shadow: 0 6px 16px rgba(17, 33, 45, 0.16);
    color: var(--panel-dark);
    font: 700 0.86rem var(--font);
    padding: 0.35rem 0.65rem;
}

.route-distance-tooltip::before {
    display: none;
}

.route-metrics {
    margin-top: 0.9rem;
}

.prep-status-icon {
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    display: inline-flex;
    font-weight: 800;
    height: 1.8rem;
    justify-content: center;
    line-height: 1;
    width: 1.8rem;
}

.prep-status-icon.none {
    background: rgba(95, 113, 128, 0.1);
    color: var(--muted);
}

.prep-status-icon.partial {
    background: rgba(191, 163, 116, 0.18);
    color: #8b5e2f;
}

.prep-status-icon.complete {
    background: rgba(56, 137, 86, 0.16);
    color: #23744a;
}

.preparation-checklist {
    border-top: 1px solid var(--line);
    margin-top: 0.2rem;
    padding-top: 0.8rem;
}

.check-section {
    display: grid;
    gap: 0.35rem;
}

.check-section h4 {
    margin: 0;
    color: var(--panel-dark);
}

.check-list {
    display: grid;
    gap: 0.15rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.check-list-item {
    display: grid;
    grid-template-columns: minmax(220px, 0.85fr) minmax(260px, 1.15fr);
    gap: 0.65rem;
    align-items: center;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--line);
}

.check-list-item:last-child {
    border-bottom: 0;
}

.check-toggle {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text);
    font-weight: 600;
}

.check-toggle input {
    width: auto;
    min-width: 1.1rem;
    box-shadow: none;
}

.check-toggle span {
    margin: 0;
}

.pagination {
    margin-top: 1.2rem;
    color: var(--muted);
}

.pagination > div {
    display: flex;
    gap: 1rem;
}

@media (max-width: 1500px) {
    .chart-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .stats-grid,
    .grid.four {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 720px) {
    .external-route-map {
        height: 360px;
    }
}

@media (max-width: 720px) {
    .stats-grid,
    .detail-grid,
    .grid.two,
    .grid.three,
    .grid.four,
    .tools-grid,
    .chart-grid,
    .check-list-item {
        grid-template-columns: 1fr;
    }

    .tool-coordinate-grid {
        grid-template-columns: 1fr;
    }

    .chart-card-wide {
        grid-column: auto;
    }

    .chart-bar-row {
        grid-template-columns: 1fr auto;
    }

    .chart-bar-track {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .page-header,
    .panel,
    .inline-card,
    .login-card {
        padding: 1.2rem;
    }

    th,
    td {
        padding: 0.85rem 0.7rem;
    }
}

.inline-actions {
    margin-top: 1rem;
}

.filters {
    flex-wrap: wrap;
}

@media (max-width: 960px) {
    .shell {
        grid-template-columns: 1fr;
        grid-template-areas:
            "topbar"
            "main";
    }

    .app-topbar {
        grid-area: topbar;
        position: sticky;
        top: 0;
        z-index: 35;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        background: var(--panel);
        border-bottom: 1px solid var(--line);
        backdrop-filter: blur(12px);
    }

    .menu-toggle {
        border-radius: 8px;
        padding: 0.55rem 0.8rem;
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
    }

    .menu-toggle i {
        width: 1rem;
        height: 1rem;
    }

    .app-topbar-title {
        color: var(--panel-dark);
        font-size: 1rem;
        margin-right: auto;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(320px, 84vw);
        transform: translateX(-100%);
        transition: transform 220ms ease;
        z-index: 40;
        overflow: auto;
        gap: 1.1rem;
        box-shadow: 0 16px 42px rgba(0, 0, 0, 0.3);
    }

    .app-shell-body.nav-open {
        overflow: hidden;
    }

    .app-shell-body.nav-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 30;
        border: 0;
        background: rgba(6, 12, 18, 0.52);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
    }

    .app-shell-body.nav-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .main {
        padding: 1.2rem 1rem 2rem;
    }

    .stats-grid,
    .detail-grid,
    .grid.two,
    .grid.four {
        grid-template-columns: 1fr;
    }

    .page-header,
    .panel-header,
    .section-header,
    .actions,
    .pagination {
        align-items: flex-start;
        flex-direction: column;
    }
}
