/*
 * Flight Desk: visual system v2
 *
 * Soft operations dashboard: a cool light canvas, white 18px-rounded cards,
 * a single green brand colour (#66BB6A) used for hero cards, active states,
 * bars and primary actions, and pill-shaped navigation, filters and statuses.
 * Large figures are set light (300); everything is Plus Jakarta Sans.
 *
 * Accessibility: white on #66BB6A is only 2.4:1, so text placed on green
 * fills uses --on-primary (deep green, ~8:1). Green text on white uses
 * --primary-ink (#2E7D32, 5.1:1).
 */

:root {
    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

    --canvas: #eef1f0;
    --surface: #ffffff;
    --surface-2: #f5f7f6;
    --ink: #15191c;
    --ink-2: #3c4449;
    --muted: #5d676d;
    --line: #e5e9e7;
    --line-strong: #d3d9d6;

    --primary: #66bb6a;
    --primary-hover: #5aae5e;
    --primary-soft: #e6f4e7;
    --primary-softer: #f1f9f1;
    --primary-ink: #2e7d32;
    --on-primary: #0e2a12;
    --on-primary-soft: #1b5e20;
    --blue-ink: #23439a;

    --amber: #f4c542;
    --amber-soft: #fdf4d6;
    --amber-ink: #7a5800;
    --red: #d32f2f;
    --red-soft: #fdecec;
    --red-ink: #b3261e;
    --blue: #5b8def;
    --blue-soft: #e9f0fd;

    /* Booking stages */
    --stage-itinerary: #8a96a3;
    --stage-reservation: #66bb6a;
    --stage-payment: #f4c542;
    --stage-ticketed: #2e7d32;
    --stage-exception: #d32f2f;

    --radius-card: 18px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-pop: 0 10px 30px -12px rgba(16, 33, 22, 0.25);
    --focus: 0 0 0 3px rgba(102, 187, 106, 0.55);

    --bs-body-font-family: var(--font);
    --bs-body-bg: var(--canvas);
    --bs-body-color: var(--ink);
    --bs-border-color: var(--line);
    --bs-secondary-color: var(--muted);
    --bs-link-color: var(--primary-ink);
    --bs-link-color-rgb: 46, 125, 50;
    --bs-link-hover-color: #1b5e20;
    --bs-link-hover-color-rgb: 27, 94, 32;
    --bs-emphasis-color: var(--ink);
}

/* Dark theme: opt-in from the header toggle (stored in the "theme" cookie). Light is the default. */
:root[data-theme="dark"] {
    color-scheme: dark;
    --canvas: #101413;
    --surface: #181e1c;
    --surface-2: #1e2523;
    --ink: #e8edeb;
    --ink-2: #c4cdc9;
    --muted: #9aa6a1;
    --line: #2a3330;
    --line-strong: #37423e;
    --primary-soft: #1e3320;
    --primary-softer: #182a1a;
    --primary-ink: #8fd492;
    --on-primary-soft: #b5e6b7;
    --blue-ink: #a9c3f7;
    --amber-soft: #3a3115;
    --amber-ink: #f4d27a;
    --red-soft: #3a1d1c;
    --red-ink: #f59a92;
    --blue-soft: #1c2840;
    --stage-itinerary: #8d9aa7;
    --bs-link-color: #8fd492;
    --bs-link-color-rgb: 143, 212, 146;
    --bs-link-hover-color: #b5e6b7;
    --bs-link-hover-color-rgb: 181, 230, 183;
}

/* ---------- Base ---------- */

body {
    font-family: var(--font);
    font-size: 0.9375rem;
    line-height: 1.55;
    background: var(--canvas);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--ink); font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 1.6rem; margin: 0; }
h2 { font-size: 1.125rem; margin-bottom: 0.75rem; }
h3 { font-size: 1rem; }

.data, .num {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}
.figure {
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1;
}
.text-muted, .muted { color: var(--muted) !important; }
a { text-underline-offset: 0.18em; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }

.icon { width: 1.1em; height: 1.1em; fill: currentColor; vertical-align: -0.15em; flex-shrink: 0; }

.skip-link {
    position: absolute; left: 1rem; top: -3rem; z-index: 1100;
    padding: 0.5rem 1rem; background: var(--surface); color: var(--ink); border-radius: 999px;
}
.skip-link:focus { top: 1rem; }

/* ---------- Buttons & forms ---------- */

.btn {
    --bs-btn-font-weight: 500;
    --bs-btn-border-radius: 999px;
    --bs-btn-padding-y: 0.55rem;
    --bs-btn-padding-x: 1.15rem;
    min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.btn-sm { --bs-btn-padding-y: 0.3rem; --bs-btn-padding-x: 0.85rem; min-height: 36px; font-size: 0.875rem; }
.btn:focus-visible { box-shadow: var(--focus); }

.btn-primary {
    --bs-btn-color: var(--on-primary);
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-color: var(--on-primary);
    --bs-btn-hover-bg: var(--primary-hover);
    --bs-btn-hover-border-color: var(--primary-hover);
    --bs-btn-active-color: var(--on-primary);
    --bs-btn-active-bg: #4fa154;
    --bs-btn-active-border-color: #4fa154;
    --bs-btn-disabled-color: var(--on-primary);
    --bs-btn-disabled-bg: var(--primary);
    --bs-btn-disabled-border-color: var(--primary);
}
.btn-outline-secondary {
    --bs-btn-color: var(--ink);
    --bs-btn-bg: var(--surface);
    --bs-btn-border-color: var(--line-strong);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-bg: var(--surface-2);
    --bs-btn-hover-border-color: var(--line-strong);
    --bs-btn-active-color: var(--ink);
    --bs-btn-active-bg: var(--line);
}
.btn-approve {
    --bs-btn-color: var(--on-primary); --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary);
    --bs-btn-hover-color: var(--on-primary); --bs-btn-hover-bg: var(--primary-hover); --bs-btn-hover-border-color: var(--primary-hover);
}
.btn-danger-outline {
    --bs-btn-color: var(--red-ink); --bs-btn-bg: var(--surface); --bs-btn-border-color: #f1b8b4;
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--red); --bs-btn-hover-border-color: var(--red);
}
.btn-ghost {
    --bs-btn-color: var(--ink-2); --bs-btn-bg: transparent; --bs-btn-border-color: transparent;
    --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-color: var(--ink);
}

.form-label { font-weight: 500; margin-bottom: 0.35rem; color: var(--ink-2); }
.form-control, .form-select {
    min-height: 44px;
    border-radius: var(--radius);
    border-color: var(--line-strong);
    background-color: var(--surface);
    color: var(--ink);
}
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: var(--focus); }
.form-text { color: var(--muted); }
.invalid-feedback { color: var(--red-ink); font-size: 0.85rem; }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--red); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { box-shadow: var(--focus); border-color: var(--primary); }

.form-alert {
    display: flex; gap: 0.65rem; align-items: flex-start;
    padding: 0.85rem 1.1rem; border-radius: var(--radius);
    background: var(--red-soft); color: var(--ink); margin-bottom: 1.25rem;
}
.form-alert .icon { color: var(--red); margin-top: 0.2rem; }
.form-alert.is-success { background: var(--primary-soft); }
.form-alert.is-success .icon { color: var(--primary-ink); }
.form-alert.is-notice { background: var(--blue-soft); }
.form-alert.is-notice .icon { color: var(--blue); }

/* ---------- App shell: sidebar + top bar ---------- */

.app { min-height: 100dvh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }

.brand {
    display: inline-flex; align-items: center; gap: 0.6rem;
    color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.05rem;
}
.brand:hover { color: var(--ink); }
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }

/* A white card floating on the canvas, one screen tall, pinned while the page scrolls. */
.sidebar {
    position: sticky; top: 1rem; align-self: start;
    height: calc(100dvh - 2rem); margin: 1rem 0 1rem 1rem;
    background: var(--surface); border-radius: 24px;
    padding: 1.25rem 0.9rem; display: flex; flex-direction: column; overflow-y: auto;
    z-index: 1040;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 0.4rem; }
.sidebar-close { display: none; }
.sidebar-context { color: var(--muted); font-size: 0.8rem; line-height: 1.35; margin: 0.6rem 0.4rem 1.25rem; }
.side-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.side-nav a {
    display: flex; align-items: center; gap: 0.75rem;
    min-height: 44px; padding: 0.5rem 0.85rem; border-radius: 14px;
    color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 0.92rem;
}
.side-nav a .icon { width: 1.1rem; height: 1.1rem; color: var(--muted); flex-shrink: 0; }
.side-nav a:hover { background: var(--surface-2); color: var(--ink); }
.side-nav a[aria-current="page"] { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.side-nav a[aria-current="page"] .icon { color: var(--on-primary); }
.side-group { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin: 1.5rem 0.85rem 0.5rem; }

.app-body { min-width: 0; display: flex; flex-direction: column; }
.app-header {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 1rem 2rem 0.6rem;
    position: sticky; top: 0; z-index: 1030;
    background: var(--canvas);
    transition: box-shadow 0.2s ease;
}
.app-header.is-scrolled { box-shadow: 0 6px 16px -10px rgba(16, 33, 22, 0.35); }
.header-brand { display: none; }

/* Platform admin inside an agency account: amber, so it never reads as the agency's own session. */
.support-banner {
    display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
    margin: 1rem 2rem 0; padding: 0.7rem 0.8rem 0.7rem 1.1rem; border-radius: 16px;
    background: var(--amber); color: #3b2a00; font-size: 0.875rem;
}
.support-banner p { margin: 0; flex: 1 1 18rem; }
.support-banner .icon { width: 1.2rem; height: 1.2rem; flex-shrink: 0; }
.support-banner .btn { background: #3b2a00; color: #fff; border: 0; }
.support-banner .btn:hover { background: #241a00; color: #fff; }
@media (max-width: 991.98px) { .support-banner { margin: 0.75rem 1rem 0; } }
.dropdown-menu {
    border: 0; border-radius: var(--radius); box-shadow: var(--shadow-pop);
    padding: 0.4rem; background: var(--surface); --bs-dropdown-link-color: var(--ink);
    --bs-dropdown-link-hover-bg: var(--surface-2); --bs-dropdown-link-active-bg: var(--primary-soft); --bs-dropdown-link-active-color: var(--on-primary-soft);
}
.dropdown-item { border-radius: var(--radius-sm); padding: 0.55rem 0.8rem; display: flex; gap: 0.6rem; align-items: center; }
.dropdown-item[aria-current="page"] { background: var(--primary-soft); color: var(--on-primary-soft); font-weight: 600; }
.dropdown-header { color: var(--muted); font-size: 0.75rem; }

.header-tools { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; flex-shrink: 0; }
.top-search { position: relative; }
.top-search input {
    width: 15rem; min-height: 44px; padding: 0.5rem 1rem 0.5rem 2.6rem;
    border-radius: 999px; border: 0; background: var(--surface); color: var(--ink);
}
.top-search input::placeholder { color: var(--muted); }
.top-search input:focus { outline: none; box-shadow: var(--focus); }
.top-search .icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

.avatar-btn {
    width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--surface);
    background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: 0.85rem;
    display: grid; place-items: center; padding: 0;
}
.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center; flex-shrink: 0;
    background: var(--primary-soft); color: var(--on-primary-soft);
    font-size: 0.8rem; font-weight: 700;
}
.avatar.is-amber { background: var(--amber-soft); color: var(--amber-ink); }
.avatar.is-blue { background: var(--blue-soft); color: var(--blue-ink); }
.avatar.is-red { background: var(--red-soft); color: var(--red-ink); }

.nav-toggle, .sidebar-close {
    display: none; place-items: center; width: 44px; height: 44px; flex-shrink: 0;
    border-radius: 50%; border: 0; padding: 0; background: var(--surface); color: var(--ink);
}
.sidebar-close { background: var(--surface-2); }
.theme-toggle {
    width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0;
    background: var(--surface); color: var(--ink); display: grid; place-items: center;
}
.theme-toggle:hover { background: var(--surface-2); }
:root[data-theme="dark"] .theme-toggle .is-light, :root:not([data-theme="dark"]) .theme-toggle .is-dark { display: none; }

.content { padding: 0.75rem 2rem 3rem; width: 100%; max-width: 1480px; margin: 0 auto; }
/* Title with its actions on the right; on phones the intro drops beneath both at full width. */
.page-head {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title actions" "intro actions";
    column-gap: 1rem; row-gap: 0.25rem; align-items: center; margin: 0.5rem 0 1.25rem;
}
.page-head h1 { grid-area: title; }
.page-head .page-intro { grid-area: intro; color: var(--muted); margin: 0; max-width: 70ch; }
.page-actions { grid-area: actions; display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 575.98px) {
    .page-head { grid-template-areas: "title actions" "intro intro"; }
    .page-head h1 { font-size: 1.4rem; }
    .page-actions .btn { padding-inline: 0.9rem; font-size: 0.875rem; }
}

/* Below desktop the sidebar becomes a drawer that slides in from the left over a dimmed page. */
@media (max-width: 991.98px) {
    .app { grid-template-columns: minmax(0, 1fr); }
    .sidebar {
        position: fixed; top: 0.5rem; left: 0.5rem; bottom: 0.5rem; height: auto; margin: 0; align-self: stretch;
        width: min(300px, calc(100vw - 3rem));
        transform: translateX(calc(-100% - 1rem)); visibility: hidden;
        transition: transform 0.25s ease, visibility 0s linear 0.25s;
    }
    .sidebar.is-open {
        transform: none; visibility: visible; transition: transform 0.25s ease;
        box-shadow: 0 0 0 100vmax rgba(9, 18, 12, 0.45);
    }
    .sidebar-close, .nav-toggle { display: inline-grid; }
    .app-header { padding: 0.75rem 1rem 0.6rem; gap: 0.5rem; }
    .header-brand { display: block; flex: 1 1 0; min-width: 0; }
    .header-tools { gap: 0.4rem; }
    .top-search { display: none; }
    .content { padding: 0.5rem 1rem 2.5rem; }
}
@media (max-width: 359.98px) {
    .brand-mark { width: 30px; height: 30px; }
    .brand { gap: 0.45rem; font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- Cards ---------- */

.panel, .card-x {
    background: var(--surface);
    border-radius: var(--radius-card);
    padding: 1.25rem 1.35rem;
    border: 0;
}
.panel + .panel { margin-top: 1rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.panel-head h2 { margin: 0; display: flex; align-items: center; gap: 0.6rem; }
.panel-head > a:not(.btn), .link-underline {
    font-size: 0.8rem; color: var(--ink); text-decoration: underline; text-underline-offset: 0.25em; white-space: nowrap;
}
.card-icon {
    width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center;
    background: var(--surface-2); color: var(--ink); flex-shrink: 0;
}
.card-icon .icon { width: 1.05rem; height: 1.05rem; }

.section-gap { margin-top: 1rem; }

/* Hero (green) card */
.hero-card {
    background: var(--primary);
    color: var(--on-primary);
    border-radius: var(--radius-card);
    padding: 1.25rem 1.35rem;
    position: relative;
    overflow: hidden;
    min-height: 168px;
    display: flex; flex-direction: column;
}
.hero-card::after {
    content: ""; position: absolute; right: -40px; top: -60px;
    width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
}
.hero-card .card-icon { background: rgba(255, 255, 255, 0.55); color: var(--on-primary); }
.hero-card h2, .hero-card a { color: var(--on-primary); }
.hero-card .hero-meta { font-size: 0.8rem; opacity: 0.9; }
.hero-card .hero-figure { font-size: 3rem; margin-top: auto; }
.hero-card .hero-label { font-size: 0.85rem; }
.hero-card .hero-side { text-align: right; }
.hero-card .hero-side .figure { font-size: 1.5rem; font-weight: 400; }

/* Stat figures */
.stat-figure { font-size: 2.6rem; }
.stat-figure.is-md { font-size: 2rem; }
.stat-label { color: var(--muted); font-size: 0.82rem; margin-top: 0.35rem; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.stat-row.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Readout (row of figures inside one card) */
.readout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    background: var(--surface);
    border-radius: var(--radius-card);
    padding: 0.4rem;
    gap: 0.4rem;
}
.readout > div { padding: 0.9rem 1rem; border-radius: 14px; }
.readout > div:hover { background: var(--surface-2); }
.readout dt { font-weight: 500; font-size: 0.82rem; color: var(--muted); line-height: 1.3; }
.readout dd {
    margin: 0.45rem 0 0; font-size: 2rem; font-weight: 300; line-height: 1;
    font-variant-numeric: tabular-nums; letter-spacing: -0.02em; color: var(--ink);
}
.readout .is-alert dd { color: var(--red-ink); }
.readout .is-cleared dd { color: var(--primary-ink); }
.readout small { display: block; font-size: 0.76rem; color: var(--muted); margin-top: 0.3rem; }

/* Mini bars (attendance-style) */
.mini-legend { display: flex; gap: 0.9rem; flex-wrap: wrap; font-size: 0.75rem; color: var(--muted); margin-bottom: 0.9rem; }
.mini-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 0.35rem; background: var(--swatch); vertical-align: 0; }
.mini-bars { display: flex; gap: 4px; align-items: flex-end; }
.mini-bars > div { flex: var(--grow, 1) 1 0; min-width: 34px; }
.mini-bars .num { font-size: 0.78rem; color: var(--ink-2); display: block; margin-bottom: 0.3rem; }
.mini-bars .bar { height: 46px; border-radius: 10px; background: var(--swatch); }

/* Progress rows (workforce-issue style) */
.progress-rows { display: flex; flex-direction: column; gap: 0.55rem; }
.progress-row { display: grid; grid-template-columns: 1fr 8.5rem; gap: 0.75rem; align-items: center; }
.progress-track { height: 36px; border-radius: 10px; background: var(--primary-softer); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 10px; background: var(--primary); min-width: 6px; }
.progress-row.is-red .progress-fill { background: var(--red); }
.progress-row.is-red .progress-track { background: var(--red-soft); }
.progress-row.is-amber .progress-fill { background: var(--amber); }
.progress-row.is-amber .progress-track { background: var(--amber-soft); }
.progress-value .figure { font-size: 1.45rem; display: block; }
.progress-value small { font-size: 0.75rem; line-height: 1.25; display: block; color: var(--muted); }

/* ---------- Activity list ---------- */

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 0.85rem; align-items: center; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; padding-bottom: 0; }
.feed li:first-child { padding-top: 0; }
.feed .feed-main { min-width: 0; flex: 1; }
.feed .feed-main > strong:first-child { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .feed-title { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.feed .feed-title strong { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .feed-title .pill { flex-shrink: 0; }
.feed .feed-sub { color: var(--muted); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed time, .feed .feed-side { color: var(--muted); font-size: 0.78rem; white-space: nowrap; text-align: right; }
.feed .feed-side strong { display: block; color: var(--ink); font-size: 1.05rem; font-weight: 500; }

/* ---------- Pills ---------- */

.pill {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.18rem 0.65rem; border-radius: 999px;
    font-size: 0.75rem; font-weight: 600; white-space: nowrap; line-height: 1.5;
    background: var(--surface-2); color: var(--ink-2);
}
.pill-active, .pill-green { background: var(--primary); color: var(--on-primary); }
.pill-pending, .pill-amber { background: var(--amber); color: #3b2a00; }
.pill-suspended, .pill-rejected, .pill-disabled, .pill-red { background: var(--red); color: #fff; }
.pill-neutral { background: var(--surface-2); color: var(--ink-2); }
.pill-soft { background: var(--primary-soft); color: var(--on-primary-soft); }

.filter-bar { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.filter-bar a {
    padding: 0.35rem 0.95rem; border-radius: 999px; min-height: 36px;
    background: var(--surface-2); color: var(--ink-2); text-decoration: none; font-size: 0.82rem; font-weight: 500;
    display: inline-flex; align-items: center; gap: 0.35rem;
}
.panel .filter-bar a { background: var(--canvas); }
.filter-bar a:hover { color: var(--ink); }
.content > .filter-bar a { background: var(--surface); }
.filter-bar a[aria-current="true"] { background: var(--primary); color: var(--on-primary); font-weight: 600; }

/* Status tag (booking statuses) */
.status-tag {
    --stage: var(--stage-itinerary);
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.82rem; font-weight: 600; line-height: 1.3; color: var(--ink);
}
.status-tag::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--stage); flex-shrink: 0; }

/* ---------- Tables ---------- */

.table {
    --bs-table-bg: transparent; --bs-table-color: var(--ink);
    --bs-table-border-color: var(--line); --bs-table-hover-bg: var(--surface-2); --bs-table-hover-color: var(--ink);
    margin-bottom: 0;
}
.table th { font-weight: 500; font-size: 0.8rem; color: var(--muted); white-space: nowrap; border-bottom-color: var(--line); }
.table td { vertical-align: middle; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.table-panel { overflow-x: auto; }
/* Inside a padded card the card already provides the edge spacing; line the table up with its heading. */
.panel:not(.p-0) .table-panel .table th:first-child, .panel:not(.p-0) .table-panel .table td:first-child { padding-left: 0; }
.panel:not(.p-0) .table-panel .table th:last-child, .panel:not(.p-0) .table-panel .table td:last-child { padding-right: 0; }
.panel.p-0 .table-panel .table th:first-child, .panel.p-0 .table-panel .table td:first-child { padding-left: 1.35rem; }
.panel.p-0 .table-panel .table th:last-child, .panel.p-0 .table-panel .table td:last-child { padding-right: 1.35rem; }
.person { display: flex; gap: 0.7rem; align-items: center; min-width: 0; }
.person .avatar { width: 34px; height: 34px; }
.person-sub { color: var(--muted); font-size: 0.76rem; }

.empty-note { color: var(--muted); padding: 0.25rem 0; }
.empty-note strong { color: var(--ink); font-weight: 600; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.5rem; margin: 0; }
.kv dt { font-weight: 400; color: var(--muted); }
.kv dd { margin: 0; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.5rem; border-left: 2px solid var(--line); margin-left: 0.4rem; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
    content: ""; position: absolute; left: -7px; top: 0.3rem; width: 12px; height: 12px; border-radius: 50%;
    background: var(--stage, var(--line-strong)); box-shadow: 0 0 0 3px var(--surface);
}

/* ---------- Booking board (stage bays) ---------- */

.stage-board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; }
@media (max-width: 1199.98px) { .stage-board { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .stage-board { grid-template-columns: 1fr; } }
.bay { --stage: var(--stage-itinerary); background: var(--surface); border-radius: var(--radius-card); padding: 1rem 1.1rem 0.6rem; }
.bay-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.bay-head h3 { margin: 0; font-size: 0.88rem; font-weight: 600; display: flex; align-items: center; gap: 0.45rem; }
.bay-head h3::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--stage); }
.bay-total { font-size: 1.6rem; font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums; }
.bay ul { list-style: none; margin: 0; padding: 0; }
.bay li a, .bay li > span {
    display: flex; justify-content: space-between; gap: 0.5rem; align-items: center;
    padding: 0.3rem 0; font-size: 0.82rem; color: var(--ink-2); text-decoration: none; min-height: 30px;
}
.bay li a:hover { color: var(--primary-ink); }
.bay li .count { font-variant-numeric: tabular-nums; color: var(--muted); }
.bay li .count.has { color: var(--ink); font-weight: 700; }

/* ---------- Booking / offer rows ("strips") ---------- */

.strip-rack { display: flex; flex-direction: column; gap: 0.6rem; }
.strip {
    --stage: var(--stage-itinerary);
    position: relative;
    display: grid;
    grid-template-columns: 7.25rem minmax(8.5rem, 1fr) minmax(7rem, 1.1fr) minmax(9.5rem, 1.2fr) 8.25rem;
    align-items: stretch;
    background: var(--surface);
    border-radius: 16px;
    color: var(--ink);
    text-decoration: none;
    min-height: 66px;
    padding-left: 0.25rem;
    overflow: hidden;
}
a.strip:hover { background: var(--surface-2); color: var(--ink); }
.strip > div { padding: 0.65rem 0.95rem; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.strip > div + div { border-left: 1px solid var(--line); }
.strip > div:last-child { text-align: right; }
.strip .cell-label { font-size: 0.72rem; color: var(--muted); line-height: 1.25; }
.strip .ref { font-weight: 700; font-size: 0.9rem; letter-spacing: 0.03em; font-variant-numeric: tabular-nums; }
.strip .route { font-size: 1.1rem; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.strip .route .icon { color: var(--muted); margin: 0 0.15rem; width: 0.9em; height: 0.9em; }
.strip .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip .amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 767.98px) {
    .strip { grid-template-columns: 1fr 1fr; }
    .strip > div { border-bottom: 1px solid var(--line); }
    .strip > div + div { border-left: 0; }
    .strip > div:nth-child(2n) { border-left: 1px solid var(--line); }
    .strip > div:last-child { text-align: left; border-bottom: 0; grid-column: 1 / -1; border-left: 0; }
}

.strip-empty {
    border: 1.5px dashed var(--line-strong);
    border-radius: 16px; padding: 1.1rem 1.25rem; color: var(--muted); background: transparent;
}
.strip-empty strong { color: var(--ink); font-weight: 600; display: block; margin-bottom: 0.15rem; }

.offer-strip { grid-template-columns: minmax(7rem, 0.9fr) minmax(8rem, 1fr) minmax(8rem, 1fr) minmax(7rem, 0.9fr) 10.5rem; }
.offer-strip .route { font-size: 1.3rem; font-weight: 500; }
.offer-strip .route .fw-normal { font-size: 0.9rem; color: var(--muted); }
.offer-strip > .offer-fare { align-items: flex-end; }
.offer-strip > details { grid-column: 1 / -1; border-top: 1px solid var(--line); padding: 0.4rem 0.95rem 0.65rem; }
.offer-strip > details summary { cursor: pointer; font-size: 0.82rem; color: var(--primary-ink); min-height: 32px; display: flex; align-items: center; }
.segment-list { list-style: none; padding: 0; margin: 0; }
.segment-list li { padding: 0.45rem 0 0.45rem 0.9rem; border-left: 2px solid var(--line-strong); margin-bottom: 0.25rem; }
.segment-list .connection { color: var(--amber-ink); margin-top: 0.3rem; }
.price-strip, .booking-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.price-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.price-strip > div:last-child, .booking-strip > div:last-child { text-align: left; }
.booking-row { grid-template-columns: 8.5rem minmax(8rem, 0.9fr) minmax(8rem, 1fr) minmax(12rem, 1.6fr) 8.25rem; }
.booking-row .attention { color: var(--red-ink); display: inline-flex; gap: 0.25rem; align-items: center; margin-top: 0.15rem; }
@media (max-width: 767.98px) {
    .offer-strip, .price-strip, .booking-strip, .booking-row { grid-template-columns: 1fr 1fr; }
    .offer-strip > .offer-fare { align-items: flex-start; }
}

/* ---------- Flight search form ---------- */

.trip-toggle { display: flex; gap: 0.4rem; border: 0; padding: 0; }
.trip-toggle .btn { --bs-btn-bg: var(--canvas); --bs-btn-border-color: transparent; }
.trip-toggle .btn-check:checked + .btn { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.child-ages { border: 0; padding: 0; }
.child-ages .form-select { width: auto; min-width: 7.5rem; }
.filter-panel .form-label { margin-bottom: 0.2rem; }

/* ---------- Inbox ---------- */

.thread { display: flex; flex-direction: column; gap: 0.6rem; max-height: 70vh; overflow-y: auto; }
.bubble { max-width: 78%; padding: 0.6rem 0.9rem; border-radius: 16px 16px 16px 4px; background: var(--surface-2); overflow-wrap: anywhere; }
.bubble.is-out { align-self: flex-end; background: var(--primary-soft); border-radius: 16px 16px 4px 16px; }
.bubble-meta { color: var(--muted); margin-bottom: 0.15rem; }

/* ---------- Auth pages ---------- */

.auth { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: 100dvh; padding: 1rem; gap: 1rem; }
.auth-aside {
    background: var(--primary); color: var(--on-primary);
    border-radius: 24px; padding: 2.5rem 3rem;
    display: flex; flex-direction: column; gap: 2rem; overflow: hidden;
    /* One screen tall on every auth page; long forms scroll past it. */
    position: sticky; top: 1rem; align-self: start; height: calc(100dvh - 2rem);
}
.auth-aside::after {
    content: ""; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 70%);
}
.auth-aside .brand { color: var(--on-primary); }
.auth-aside h1 { color: var(--on-primary); font-size: clamp(1.7rem, 2.6vw, 2.3rem); font-weight: 600; line-height: 1.2; max-width: 22ch; margin-top: auto; }
.auth-aside p { max-width: 44ch; margin: 0; position: relative; z-index: 1; }
.strip-stack { display: flex; flex-direction: column; gap: 0.5rem; max-width: 420px; margin-bottom: auto; position: relative; z-index: 1; }
.strip-stack div {
    display: grid; grid-template-columns: 5.5rem 1fr auto; align-items: center;
    background: rgba(255, 255, 255, 0.85); color: var(--ink); border-radius: 14px; min-height: 48px; font-size: 0.85rem;
}
.strip-stack div > span { padding: 0.45rem 0.85rem; }
.strip-stack div > span:first-child { font-weight: 700; }
.strip-stack div > span:last-child { font-size: 0.75rem; }
.strip-stack div > span:last-child::before { content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; margin-right: 0.35rem; background: var(--stage); }
.strip-stack div:nth-child(2) { margin-left: 1.25rem; }
.strip-stack div:nth-child(3) { margin-left: 0.5rem; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; background: var(--surface); border-radius: 24px; }
.auth-form { width: 100%; max-width: 420px; }
.auth-form.is-wide { max-width: 640px; }
.auth-form h2 { font-size: 1.6rem; margin-bottom: 0.35rem; }
.auth-form > p.lead-in { color: var(--muted); margin-bottom: 1.75rem; }
.auth-form fieldset { border-top: 1px solid var(--line); padding-top: 1.25rem; margin-top: 1.5rem; }
.auth-form legend { font-size: 1rem; font-weight: 600; float: none; margin-bottom: 0.25rem; }
.auth-form .legend-note { color: var(--muted); font-size: 0.875rem; margin-bottom: 1rem; }
.auth-switch { margin-top: 1.5rem; color: var(--muted); }

.password-field { position: relative; }
.password-field .form-control { padding-right: 3rem; }
.password-toggle {
    position: absolute; right: 2px; top: 2px; width: 40px; height: 40px; border: 0; background: transparent;
    color: var(--muted); border-radius: var(--radius); display: grid; place-items: center;
}
.password-toggle:hover { color: var(--ink); }

@media (max-width: 991.98px) {
    .auth { grid-template-columns: 1fr; padding: 0.5rem; }
    .auth-aside { padding: 1.25rem; gap: 1rem; border-radius: 18px; position: relative; top: auto; height: auto; }
    .auth-aside h1, .auth-aside p, .strip-stack { display: none; }
    .auth-main { align-items: flex-start; padding: 2rem 1rem; border-radius: 18px; }
}

/* ---------- Status page & errors ---------- */

.hold-screen { max-width: 640px; margin: 2rem auto; }
.hold-screen .strip { grid-template-columns: 1fr auto; margin-bottom: 1.5rem; }
.error-code { font-size: 4.5rem; font-weight: 300; line-height: 1; color: var(--primary); margin-bottom: 1rem; }
.error-detail {
    font-family: ui-monospace, Consolas, monospace; font-size: 0.8rem; background: var(--surface-2);
    padding: 0.75rem; border-radius: var(--radius); white-space: pre-wrap; word-break: break-word;
}

.permission-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.25rem 1rem; }
.permission-grid .form-check { min-height: 32px; display: flex; align-items: center; gap: 0.5rem; padding-left: 0; }
.permission-grid .form-check-input { margin: 0; float: none; width: 1.15rem; height: 1.15rem; }

/* ---------- Stage colours (last, so they override component defaults) ---------- */

.stage-itinerary { --stage: var(--stage-itinerary); }
.stage-reservation { --stage: var(--stage-reservation); }
.stage-payment { --stage: var(--stage-payment); }
.stage-ticketed { --stage: var(--stage-ticketed); }
.stage-exception { --stage: var(--stage-exception); }
