/* KLM Rentals — design system built on the BluLight apps' sheet (Poppins,
   gradient header, tile grid, token-only dark theme) recolored to the KLM
   brand. Every colour is a token so the dark theme at the bottom is a pure
   token swap — no rule is written twice. */
:root {
    --brand: #12314F;             /* KLM blue */
    --brand-dark: #0C2136;        /* also the "heading ink" role — see dark block */
    --brand-mid: #2C4A68;
    --accent: #D95814;            /* KLM orange */
    --accent-dark: #A8410D;
    --accent-soft: #FDF0E8;

    --bg: #f4f6f8;
    --card-bg: #ffffff;
    --surface-2: #eef2f6;
    --surface-hover: #f7f9fb;
    --input-bg: #ffffff;
    --border: #dfe4ea;
    --text: #16202B;
    --muted: #6b7684;
    --faint: #aeb7c2;
    --highlight: #e9f0f7;
    --disabled-bg: #e0e4e8;

    --green: #1f7a3d;
    --red: #b3261e;
    --red-hover: #7a180f;

    --header-from: #0C2136;
    --header-to: #1D4266;
    --header-ink: #b8c8da;

    --shadow: 0 1px 3px rgba(18, 49, 79, 0.08);
    --shadow-lift: 0 4px 14px rgba(18, 49, 79, 0.16);
    --shadow-tile: 0 14px 30px rgba(18, 49, 79, 0.20);

    --ok-bg: #e6f6ec;
    --ok-fg: #1f7a3d;
    --ok-border: #b7e3c6;
    --err-bg: #fbe9e7;
    --err-fg: #b3261e;
    --err-border: #f0c4bf;
    --warn-bg: #fff7e0;
    --warn-fg: #8a6d00;
    --warn-border: #ecd98a;
    --neutral-bg: #eef2f6;

    color-scheme: light;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Poppins", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.55;
}

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

svg.ic { width: 17px; height: 17px; flex: none; vertical-align: -3px; }

/* ------------------------------------------------------------------ header */
header {
    position: relative;
    background: linear-gradient(120deg, var(--header-from), var(--header-to));
    color: #fff;
    padding: 12px 32px 0 32px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
header::after {
    content: "";
    display: block;
    height: 3px;
    margin: 14px -32px 0 -32px;
    background: linear-gradient(90deg, var(--accent), var(--accent-dark));
}

.user-bar {
    display: flex; justify-content: flex-end; align-items: center; gap: 6px;
    font-size: 12px; color: var(--header-ink);
    max-width: 1280px; width: 100%; margin: 0 auto; flex-wrap: wrap;
}
.user-bar a, .user-bar .light-link { color: var(--header-ink); }
.user-bar a:hover, .user-bar .light-link:hover { color: #fff; }

.header-inner {
    display: flex; align-items: center; gap: 20px;
    max-width: 1280px; margin: 0 auto; width: 100%;
    padding-bottom: 4px;
}
/* The KLM wordmark is dark charcoal + orange; inverting it reads correctly
   on the dark blue header (monochrome mark, orange survives the rotate). */
.brand-logo { height: 44px; width: auto; flex: none; filter: invert(1) hue-rotate(180deg); }
.header-text { border-left: 1px solid rgba(255, 255, 255, 0.25); padding-left: 18px; }
header h1 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: 0.2px; }
header h1 a { color: #fff; text-decoration: none; }
.subtitle { margin: 1px 0 0 0; color: var(--header-ink); font-size: 12.5px; }

.header-cta { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* ------------------------------------------------------------ primary nav */
nav.main {
    background: transparent;
    max-width: 1280px; margin: 6px auto 0 auto; width: 100%;
}
nav.main ul {
    list-style: none; display: flex; gap: 4px; margin: 0; padding: 0 0 10px 0;
    flex-wrap: wrap;
}
nav.main a {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 13px; border-radius: 9px;
    color: var(--header-ink); text-decoration: none;
    font-size: 13px; font-weight: 500; line-height: 1;
    border: 1px solid transparent;
}
nav.main a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
nav.main a.active {
    color: #fff; background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
}
nav.main a svg.ic { width: 15px; height: 15px; opacity: 0.85; }

main { max-width: 1280px; margin: 22px auto; padding: 0 16px 56px 16px; }

/* ------------------------------------------------------------------- cards */
.card, section.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.card h2 {
    margin: 0 0 14px 0; font-size: 13.5px; font-weight: 700; color: var(--brand);
    text-transform: uppercase; letter-spacing: 0.05em;
    display: flex; align-items: center; gap: 8px;
}
.card h2 .count { color: var(--muted); font-weight: 500; }
.card h2 svg.ic { color: var(--accent); }
.card-actions { margin-left: auto; display: flex; gap: 8px; font-size: 12px;
                text-transform: none; letter-spacing: 0; font-weight: 500; }

.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

/* -------------------------------------------------------------------- kpis */
.kpis {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: 14px; margin-bottom: 20px;
}
.kpi {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow);
    display: flex; gap: 12px; align-items: flex-start;
}
.kpi-ic {
    width: 38px; height: 38px; border-radius: 10px; flex: none;
    background: var(--highlight); color: var(--brand);
    display: flex; align-items: center; justify-content: center;
}
.kpi-ic svg.ic { width: 19px; height: 19px; }
.kpi.accent .kpi-ic { background: var(--accent-soft); color: var(--accent-dark); }
.kpi.warn .kpi-ic { background: var(--err-bg); color: var(--err-fg); }
.kpi .label {
    font-size: 10.5px; color: var(--muted); text-transform: uppercase;
    letter-spacing: 0.05em; font-weight: 600;
}
.kpi .value { font-size: 21px; font-weight: 700; color: var(--brand); line-height: 1.25; }
.kpi .value.money { font-variant-numeric: tabular-nums; }
.kpi.warn .value { color: var(--red); }
.kpi .sub { font-size: 11.5px; color: var(--muted); }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
    padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--surface-2);
    vertical-align: middle;
}
th {
    background: var(--surface-2); font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em; color: #47555f;
    white-space: nowrap; border-bottom: 1px solid var(--border);
}
tbody tr:hover td { background: var(--surface-hover); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.nowrap, th.nowrap { white-space: nowrap; }
.empty { color: var(--muted); font-style: italic; padding: 16px 4px; white-space: normal; }
tfoot td { border-top: 2px solid var(--border); background: var(--surface-2); }

/* ------------------------------------------------------------------- pills */
.pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 600; white-space: nowrap;
}
.pill.live, .pill.paid, .pill.completed-ok, .pill.approved, .pill.enabled
    { background: var(--ok-bg); color: var(--ok-fg); }
.pill.pending, .pill.upcoming, .pill.draft
    { background: var(--neutral-bg); color: #47555f; }
.pill.in_progress, .pill.open, .pill.submitted, .pill.month_to_month
    { background: #e3edf8; color: var(--brand); }
.pill.overdue, .pill.failed, .pill.suspended, .pill.void, .pill.cancelled, .pill.emergency
    { background: var(--err-bg); color: var(--err-fg); }
.pill.completed, .pill.closed, .pill.ended, .pill.done, .pill.declined
    { background: #e9eaec; color: #55606b; }
.pill.tag {
    background: var(--accent-soft); color: var(--accent-dark);
    border: 1px solid #f6dccb;
}
.pill.pilot { background: #f3e8ff; color: #6b21a8; }
.pill.plan-basic { background: var(--neutral-bg); color: #47555f; }
.pill.plan-pro { background: #e3edf8; color: var(--brand); }
.pill.plan-portfolio { background: var(--accent-soft); color: var(--accent-dark); }

/* ----------------------------------------------------------------- buttons */
.btn, button.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 16px; border-radius: 8px;
    border: 1px solid var(--brand);
    background: var(--brand); color: #fff;
    font-size: 13px; font-weight: 600; font-family: inherit;
    cursor: pointer; text-decoration: none; line-height: 1.3;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn svg.ic { width: 15px; height: 15px; }
.btn.accent { background: var(--accent); border-color: var(--accent); }
.btn.accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.ghost { background: var(--card-bg); color: var(--brand); border-color: var(--border); }
.btn.ghost:hover { background: var(--highlight); color: var(--brand-dark); border-color: var(--brand); }
.btn.danger { background: var(--card-bg); color: var(--red); border-color: #e8c3bf; }
.btn.danger:hover { background: var(--err-bg); color: var(--red); border-color: var(--red); }
.btn.small { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn.small svg.ic { width: 13px; height: 13px; }
.btn.large { padding: 13px 26px; font-size: 15px; border-radius: 10px; }
.btn:disabled, .btn[disabled] { background: var(--disabled-bg); border-color: var(--disabled-bg);
    color: var(--muted); cursor: default; }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

.link-btn {
    background: none; border: none; color: var(--brand); font-size: 12px;
    font-weight: 600; padding: 0; cursor: pointer; text-decoration: underline;
    font-family: inherit;
}
.link-btn:hover { color: var(--accent); background: none; }
.inline-form { display: inline-flex; }

/* ------------------------------------------------------------------- forms */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: #46525e; margin-bottom: 4px; }
.field .help { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.field .req { color: var(--accent); }
input[type=text], input[type=password], input[type=email], input[type=date],
input[type=number], input[type=search], input[type=url], select, textarea {
    width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 13.5px; font-family: inherit; background: var(--input-bg); color: var(--text);
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(18, 49, 79, 0.12);
}
textarea { min-height: 76px; resize: vertical; }
input[type=file] { font-size: 13px; font-family: inherit; color: var(--text); }
.field.check { display: flex; align-items: center; gap: 8px; }
.field.check input { width: auto; accent-color: var(--brand); }
.field.check label { margin: 0; }

fieldset {
    border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px 4px 16px;
    margin: 0 0 16px 0;
}
legend {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--accent-dark); padding: 0 6px;
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 0 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }

.filters {
    display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
    margin-bottom: 14px;
}
.filters .field { margin-bottom: 0; min-width: 145px; }

.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 4px 14px; }
.checks label { display: flex; align-items: center; gap: 7px; font-size: 12.5px;
    font-weight: 500; color: var(--text); }
.checks input { width: auto; accent-color: var(--brand); }

/* ------------------------------------------------------------------ alerts */
.flash {
    display: flex; align-items: flex-start; gap: 9px;
    padding: 11px 15px; border-radius: 9px; margin-bottom: 14px;
    font-size: 13px; font-weight: 500; border: 1px solid;
}
.flash.ok { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-border); }
.flash.error { background: var(--err-bg); color: var(--err-fg); border-color: var(--err-border); }
.warn-banner {
    background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-fg);
    padding: 10px 14px; border-radius: 9px; font-size: 12.5px; margin-bottom: 12px;
    display: flex; align-items: flex-start; gap: 8px;
}

/* ------------------------------------------------------------------ detail */
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); }

.page-head { display: flex; justify-content: space-between; align-items: flex-start;
    gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 700; color: var(--brand);
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head .meta { font-size: 13px; color: var(--muted); margin-top: 3px; }

dl.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
    gap: 11px 20px; margin: 0; }
dl.facts dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--muted); font-weight: 600; }
dl.facts dd { margin: 1px 0 0 0; font-size: 13.5px; }

.bar { height: 7px; background: var(--surface-2); border-radius: 4px; overflow: hidden; min-width: 70px; }
.bar > div { height: 100%; background: var(--green); }
.bar.warn > div { background: var(--warn-fg); }
.bar.bad > div { background: var(--red); }

.money-pos { color: var(--green); }
.money-neg { color: var(--red); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* --------------------------------------------------------------- auth page */
.auth-wrap { max-width: 400px; margin: 7vh auto; padding: 0 16px; }
.auth-wrap .card { padding: 28px 30px; }
.auth-wrap h1 { font-size: 20px; margin: 0 0 4px 0; color: var(--brand); }
.auth-wrap .sub { color: var(--muted); font-size: 13px; margin: 0 0 20px 0; }
.auth-wrap .btn { width: 100%; }
.auth-links { margin-top: 14px; font-size: 12.5px; text-align: center; }
.auth-logo { display: block; max-width: 210px; margin: 0 auto 18px auto; }

/* ----------------------------------------------------------------- landing */
.hero {
    background: linear-gradient(120deg, var(--header-from), var(--header-to));
    color: #fff;
    padding: 64px 32px 72px 32px;
    text-align: center;
}
.hero .inner { max-width: 780px; margin: 0 auto; }
.hero .eyebrow {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    color: #F0A377; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 700; margin: 0 0 14px 0;
    line-height: 1.15; letter-spacing: -0.5px; }
.hero p.lead { font-size: 16.5px; color: var(--header-ink); margin: 0 auto 30px auto;
    max-width: 560px; }
.hero .btn-row { justify-content: center; }
.hero .btn.ghost { background: rgba(255,255,255,0.1); color: #fff;
    border-color: rgba(255,255,255,0.35); }
.hero .btn.ghost:hover { background: rgba(255,255,255,0.2); }

.section { max-width: 1120px; margin: 0 auto; padding: 52px 16px 8px 16px; }
.section > h2 { text-align: center; font-size: 24px; font-weight: 700; color: var(--brand);
    margin: 0 0 8px 0; }
.section > p.section-sub { text-align: center; color: var(--muted); font-size: 14px;
    margin: 0 auto 34px auto; max-width: 560px; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 18px; }
.feature {
    position: relative; overflow: hidden;
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px;
    padding: 24px 22px 20px 22px; box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 10px;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.feature:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-tile); }
.feature .stripe { position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--brand)); }
.feature-ic {
    width: 46px; height: 46px; border-radius: 13px;
    background: var(--highlight); color: var(--brand);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px -8px var(--brand);
}
.feature-ic svg.ic { width: 22px; height: 22px; }
.feature h3 { margin: 0; font-size: 15.5px; font-weight: 700; }
.feature p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.55; }

/* pricing */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
    gap: 20px; align-items: stretch; }
.plan {
    position: relative;
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px;
    padding: 26px 24px; box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 14px;
}
.plan.featured { border-color: var(--accent); box-shadow: var(--shadow-lift); }
.plan .flag {
    position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
    background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700;
    letter-spacing: 0.06em; text-transform: uppercase;
    padding: 3px 12px; border-radius: 999px; white-space: nowrap;
}
.plan h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--brand); }
.plan .blurb { font-size: 12.5px; color: var(--muted); margin: -8px 0 0 0; }
.plan .price { font-size: 32px; font-weight: 700; color: var(--text); line-height: 1; }
.plan .price small { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column;
    gap: 8px; flex: 1; }
.plan ul li { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; }
.plan ul li svg.ic { width: 15px; height: 15px; color: var(--green); margin-top: 2px; }
.plan .btn { width: 100%; }
.plan-note { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 18px; }

.cta-band {
    max-width: 1120px; margin: 48px auto 0 auto; padding: 0 16px;
}
.cta-band .inner {
    background: linear-gradient(120deg, var(--header-from), var(--header-to));
    border-radius: 18px; color: #fff; text-align: center;
    padding: 44px 24px;
}
.cta-band h2 { margin: 0 0 8px 0; font-size: 22px; }
.cta-band p { margin: 0 0 22px 0; color: var(--header-ink); font-size: 14px; }

footer { text-align: center; color: var(--muted); font-size: 12px; padding: 34px 16px; }
footer a { color: var(--muted); }

/* ---------------------------------------------------------------- platform */
.stat-row { display: flex; gap: 26px; flex-wrap: wrap; margin-bottom: 4px; }
.stat-box .stat-label { font-size: 11.5px; color: var(--muted); }
.stat-box .stat-value { font-size: 22px; font-weight: 700; color: var(--brand); }

/* ------------------------------------------------------------------ mobile */
@media (max-width: 700px) {
    header { padding: 10px 14px 0 14px; }
    header::after { margin: 12px -14px 0 -14px; }
    .header-text { border-left: none; padding-left: 0; }
    .brand-logo { height: 34px; }
    main { margin-top: 14px; padding: 0 10px 40px 10px; }
    .card, section.card { padding: 15px; }
    .page-head h1 { font-size: 19px; }
    .form-grid { grid-template-columns: 1fr; }
    table { font-size: 12.5px; }
    th, td { padding: 7px 8px; }
    .hero { padding: 44px 18px 52px 18px; }
    .section { padding-top: 36px; }
}

@media print {
    header, nav.main, .btn, .btn-row, .filters, .app-back, footer { display: none !important; }
    .card { border: none; box-shadow: none; page-break-inside: avoid; }
    body { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
    .feature, .plan { transition: none; }
    .feature:hover { transform: none; }
}

/* ==================== theme.js chrome (menu, back, sort, collapse) ========
   These classes are created by theme.js at runtime — same contract as the
   BluLight apps, so the script is reused byte-identical. */
.nav-menu { position: relative; }
.user-bar { position: relative; }

.nav-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff; border-radius: 8px; padding: 7px 13px;
    font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; line-height: 1;
}
.nav-toggle:hover { background: rgba(255, 255, 255, 0.24); }
.nav-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.nav-bars {
    width: 17px; height: 11px;
    background: linear-gradient(to bottom,
        currentColor 0 2px, transparent 2px 4.5px,
        currentColor 4.5px 6.5px, transparent 6.5px 9px,
        currentColor 9px 11px);
}
.nav-panel {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
    min-width: 244px; display: flex; flex-direction: column; padding: 6px;
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28); text-align: left;
}
.nav-panel[hidden] { display: none; }
.nav-who {
    padding: 9px 12px 10px 12px; font-size: 12px; color: var(--muted);
    border-bottom: 1px solid var(--border); margin-bottom: 5px;
    white-space: normal; word-break: break-word;
}
.nav-who strong { color: var(--text); font-weight: 600; }
.nav-panel .nav-item, .nav-panel .nav-form button {
    display: block; width: 100%; text-align: left; padding: 9px 12px;
    border: none; border-radius: 7px; background: none; color: var(--text);
    font-family: inherit; font-size: 13.5px; font-weight: 500;
    text-decoration: none; cursor: pointer; line-height: 1.35;
}
.nav-panel .nav-item:hover, .nav-panel .nav-form button:hover {
    background: var(--highlight); color: var(--brand-dark);
}
.nav-panel .nav-item:focus-visible, .nav-panel .nav-form button:focus-visible {
    outline: 2px solid var(--brand); outline-offset: -2px;
}
.nav-panel .nav-home { font-weight: 700; color: var(--brand); }
.nav-sep { height: 1px; background: var(--border); margin: 5px 4px; }
.nav-panel .nav-form { display: block; width: 100%; margin: 0; padding: 0; }
.nav-panel .nav-form button { color: var(--red); font-weight: 600; }
.nav-panel .nav-form button:hover { background: var(--err-bg); color: var(--red); }
.nav-panel .theme-toggle { background: none; border: none; border-radius: 7px; }
.nav-panel .theme-toggle:hover { background: var(--highlight); color: var(--brand-dark); }

.theme-toggle {
    font-family: inherit; cursor: pointer;
}
.theme-toggle.floating {
    position: absolute; top: 14px; right: 20px; z-index: 5;
    background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff; border-radius: 20px; padding: 5px 13px; font-size: 12px; font-weight: 500;
}
.theme-toggle.floating:hover { background: rgba(255, 255, 255, 0.26); }

@media (max-width: 700px) {
    .nav-toggle-text { display: none; }
    .nav-toggle { padding: 8px 10px; }
    .nav-panel { min-width: 0; width: min(84vw, 300px); }
}

.brand-logo-link { display: inline-flex; text-decoration: none; }
.brand-logo-link:hover { opacity: .85; }

.app-back {
    display: inline-flex; align-items: center; gap: 7px;
    margin: 0 0 16px 0; padding: 8px 15px;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--card-bg); color: var(--brand);
    font-size: 13.5px; font-weight: 600; text-decoration: none; line-height: 1;
}
.app-back:hover { border-color: var(--brand); background: var(--highlight); }

th.th-sort { cursor: pointer; user-select: none; position: relative; padding-right: 20px; }
th.th-sort:hover { color: var(--brand); }
th.th-sort:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
th.th-sort::after {
    content: ""; position: absolute; right: 7px; top: 50%; margin-top: -2px;
    border-left: 4px solid transparent; border-right: 4px solid transparent; opacity: 0;
}
th.th-sort-asc::after  { border-bottom: 5px solid currentColor; opacity: .8; }
th.th-sort-desc::after { border-top: 5px solid currentColor; opacity: .8; }

.card-head { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 9px; }
.card-toggle {
    flex: none; width: 20px; height: 20px; padding: 0; border: 0; background: none;
    cursor: pointer; color: inherit; position: relative;
}
.card-toggle::before {
    content: ""; position: absolute; left: 5px; top: 5px; width: 7px; height: 7px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg); transition: transform .15s ease;
}
.card-closed .card-toggle::before { transform: rotate(-45deg); }
.card-closed > h2 { margin-bottom: 0; }
.card-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* =============================== dark theme ===============================
   Keyed only on [data-theme="dark"] — theme.js resolves "system" before
   first paint, so CSS only ever sees a decided value. Tokens only. */
:root[data-theme="dark"] {
    --brand: #7FB0E0;
    --brand-dark: #A9CCEC;
    --brand-mid: #4E7CA8;
    --accent: #F07A38;
    --accent-dark: #FF9358;
    --accent-soft: #33241A;

    --bg: #10151B;
    --card-bg: #171E26;
    --surface-2: #1E2731;
    --surface-hover: #1C242E;
    --input-bg: #131A22;
    --border: #2A343F;
    --text: #E4E9EF;
    --muted: #93A0AE;
    --faint: #5A6774;
    --highlight: #21313f;
    --disabled-bg: #262b41;

    --green: #5BC98A;
    --red: #F08279;
    --red-hover: #FF9D95;

    --header-from: #081119;
    --header-to: #14293D;
    --header-ink: #9FB4C8;

    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-lift: 0 4px 14px rgba(0, 0, 0, 0.55);
    --shadow-tile: 0 14px 30px rgba(0, 0, 0, 0.65);

    --ok-bg: #16301F; --ok-fg: #5BC98A; --ok-border: #1d5546;
    --err-bg: #35191A; --err-fg: #F08279; --err-border: #6b2620;
    --warn-bg: #322817; --warn-fg: #E0B44A; --warn-border: #55431c;
    --neutral-bg: #232D38;

    color-scheme: dark;
}

:root[data-theme="dark"] th { color: #A7B4C1; }
:root[data-theme="dark"] .pill.in_progress, :root[data-theme="dark"] .pill.open,
:root[data-theme="dark"] .pill.submitted, :root[data-theme="dark"] .pill.month_to_month,
:root[data-theme="dark"] .pill.plan-pro { background: #1B2C3D; color: #93BFE8; }
:root[data-theme="dark"] .pill.pending, :root[data-theme="dark"] .pill.upcoming,
:root[data-theme="dark"] .pill.draft, :root[data-theme="dark"] .pill.plan-basic
    { background: #232D38; color: #B4C1CE; }
:root[data-theme="dark"] .pill.completed, :root[data-theme="dark"] .pill.closed,
:root[data-theme="dark"] .pill.ended, :root[data-theme="dark"] .pill.done,
:root[data-theme="dark"] .pill.declined { background: #262E36; color: #9DA9B5; }
:root[data-theme="dark"] .pill.tag, :root[data-theme="dark"] .pill.plan-portfolio
    { background: #33241A; color: #F0A377; border-color: #4A3524; }
:root[data-theme="dark"] .pill.pilot { background: #2d1f3d; color: #c9a8f0; }

/* Buttons: dark-blue fill would vanish on dark cards — invert the pair. */
:root[data-theme="dark"] .btn { background: var(--brand-mid); border-color: var(--brand-mid); color: #0C1218; }
:root[data-theme="dark"] .btn:hover { background: var(--brand); border-color: var(--brand); color: #0C1218; }
:root[data-theme="dark"] .btn.ghost { background: var(--card-bg); color: var(--brand); border-color: var(--border); }
:root[data-theme="dark"] .btn.ghost:hover { background: var(--surface-2); }
:root[data-theme="dark"] .btn.accent { background: var(--accent); border-color: var(--accent); color: #1A0C04; }
:root[data-theme="dark"] .btn.danger { background: var(--card-bg); color: var(--red); border-color: #4A2724; }
:root[data-theme="dark"] .hero .btn.ghost,
:root[data-theme="dark"] .cta-band .btn.ghost { background: rgba(255,255,255,0.1); color: #fff; }

:root[data-theme="dark"] .feature-ic { box-shadow: none; }
