/* AVIONA web: calm operations-desk look. Tokens first, light and dark. */
:root {
  --bg: #F3F5F6; --panel: #FFFFFF; --ink: #16202A; --muted: #566370; --line: #D8DEE3;
  --accent: #A86400; --accent-soft: #FBEFD9; --nav: #0F1E33; --nav-ink: #C9D3E0; --danger: #B3261E;
  --body: "IBM Plex Sans", system-ui, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1519; --panel: #172027; --ink: #E6ECEF; --muted: #9AA8B3; --line: #2A363F;
    --accent: #F0B44C; --accent-soft: #3A2D14; --nav: #0A1117; --nav-ink: #9AA8B3; --danger: #F2827A;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.5; }

.shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100%; }
@media (max-width: 800px) { .shell { grid-template-columns: minmax(0, 1fr); } .sidebar { position: static; } }

.sidebar { background: var(--nav); color: var(--nav-ink); padding: 20px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: block; color: #FFFFFF; font-weight: 600; font-size: 20px; letter-spacing: .08em; text-decoration: none; margin-bottom: 24px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #E8A33D; margin: 16px 0 6px; }
.nav a { color: var(--nav-ink); text-decoration: none; padding: 6px 10px; border-radius: 4px; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #FFFFFF; }
.nav a.active { background: rgba(232, 163, 61, .16); color: #FFFFFF; }
.nav-soon { padding: 6px 10px; color: #6F7E8C; font-size: 13px; }

.content { padding: 28px clamp(16px, 4vw, 40px) 48px; min-width: 0; max-width: 1760px; }
/* Text keeps a readable width; tables and forms use the whole width of the window. */
h1 { font-size: 28px; margin: 0; font-weight: 600; text-wrap: balance; }
.lede { color: var(--muted); max-width: 65ch; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
/* Code fields: registrations, flight numbers, IATA/ICAO and supplier codes (js/upper.js makes the value upper case). */
input.upper, textarea.upper { text-transform: uppercase; }
input.upper::placeholder, textarea.upper::placeholder { text-transform: none; }
.notice { background: var(--accent-soft); border: 1px solid var(--accent); padding: 10px 14px; border-radius: 4px; }

.page-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 20px; }

.btn, .btn-secondary, .btn-danger {
  font: inherit; font-weight: 500; border-radius: 4px; padding: 8px 16px; cursor: pointer; text-decoration: none; display: inline-block; border: 1px solid transparent;
}
.btn { background: var(--ink); color: var(--bg); }
.btn:hover { background: var(--accent); color: var(--ink); }
.btn[disabled] { opacity: .6; cursor: default; }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-danger { background: var(--danger); color: #FFFFFF; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0 6px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.search { font: inherit; width: min(420px, 100%); padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--ink); margin-bottom: 14px; }

.grid-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }
.table a { color: var(--accent); }

fieldset { border: 1px solid var(--line); border-radius: 6px; background: var(--panel); padding: 16px 18px 18px; margin: 0 0 16px; }
legend { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 6px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.form-grid .wide { grid-column: span 2; }
@media (max-width: 560px) { .form-grid .wide { grid-column: auto; } }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; min-width: 0; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
input, select { font: inherit; font-family: var(--mono); font-size: 14px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--ink); min-width: 0; }
input.invalid, select.invalid { border-color: var(--danger); }
.validation-message { color: var(--danger); font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; margin-bottom: 16px; }
.inline-form .wide { flex: 1 1 220px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 18px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 6px; }
.card:hover { border-color: var(--accent); }
.card span { color: var(--muted); font-size: 14px; }

nav[aria-label="pagination"], .paginator { margin-top: 10px; }

/* Invoice check */
h2 { font-size: 18px; font-weight: 600; margin: 28px 0 10px; }
h3 { font-size: 15px; font-weight: 600; margin: 18px 0 8px; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.empty { background: var(--panel); border: 1px dashed var(--line); border-radius: 6px; padding: 20px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 0 0 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.kpi span { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kpi strong { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi.bad strong { color: var(--danger); }
.kpi.ok strong { color: var(--ok); }
.kpi.info strong { color: var(--info); }
.chip { display: inline-block; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 10px; background: var(--line); color: var(--ink); white-space: nowrap; margin-right: 4px; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--accent-soft); color: var(--accent); }
.chip.bad { background: var(--danger-soft); color: var(--danger); }
.chip.info { background: var(--info-soft); color: var(--info); }
.table th.num, .table td.num { text-align: right; white-space: nowrap; }
.table td.neg { color: var(--danger); }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--accent-soft); }
.table tr.cancelled td { color: var(--muted); text-decoration: line-through; }
.table tr.cancelled td:last-child { text-decoration: none; }
.table td.reason { max-width: 420px; font-size: 13px; }
.table.lines td { vertical-align: top; }
.table.edit { margin: 8px 0; background: transparent; }
.table.edit td { padding: 4px 6px; }
.table.edit input { width: 100%; }
.calc { font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--bg); border-left: 3px solid var(--accent); padding: 6px 10px; margin-top: 6px; }
.calc-row td { background: var(--bg); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tab { font: inherit; font-size: 13px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--ink); cursor: pointer; }
.tab.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
textarea.paste { width: 100%; font-family: var(--mono); font-size: 13px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--ink); }
.error-box { background: var(--danger-soft); color: var(--danger); border-radius: 4px; padding: 10px 14px; font-size: 13px; margin-bottom: 12px; }
.pax-grid { display: grid; grid-template-columns: 140px repeat(2, minmax(0, 160px)); gap: 6px 12px; align-items: center; }
.adjustment { border: 1px solid var(--line); border-radius: 6px; padding: 12px; margin-bottom: 10px; }
.danger-zone { margin-top: 32px; }
label.file { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
:root { --ok: #1E7A46; --ok-soft: #DDF1E5; --info: #2457A6; --info-soft: #E2EAF8; --danger-soft: #F9E1DF; }
@media (prefers-color-scheme: dark) {
  :root { --ok: #6FD39A; --ok-soft: #173826; --info: #8DB3F2; --info-soft: #1A2840; --danger-soft: #3D1C1A; }
}

/* Tariff import from PDF */
.proposal { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; margin-bottom: 10px; opacity: .75; }
.proposal.selected { opacity: 1; border-color: var(--accent); }
.proposal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.proposal-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; font-size: 14px; }
@media (max-width: 800px) { .proposal-body { grid-template-columns: minmax(0, 1fr); } }
.proposal .source blockquote { margin: 4px 0; padding: 6px 10px; border-left: 3px solid var(--line); color: var(--muted); font-size: 13px; }
.warn-text { color: var(--accent); font-size: 13px; }

/* Charges breakdown */
.table tfoot td { border-top: 2px solid var(--line); border-bottom: 0; }
.table.inner { background: transparent; font-size: 13px; }
.table.inner td { padding: 5px 8px; }
.bar { display: inline-block; width: 60px; height: 6px; background: var(--line); border-radius: 3px; margin-right: 6px; vertical-align: middle; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }

details.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px; margin-bottom: 16px; }
details.panel summary { cursor: pointer; }
details.panel .inline-form { border: 0; padding: 0; background: transparent; }

/* Flown vs scheduled flights on the charges page */
.kpi small { font-size: 12px; color: var(--muted); }
.badge { display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--line); color: var(--muted); }
.badge.ok { color: #1E6B3A; border-color: #9CCBAA; background: #E7F4EB; }
@media (prefers-color-scheme: dark) { .badge.ok { color: #8FD3A5; border-color: #2F5B3E; background: #15291D; } }

/* Tabs on the reference-data page */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 8px 0 14px; }
.tab { background: transparent; border: 1px solid transparent; border-bottom: 0; padding: 8px 14px; font: inherit; color: var(--muted); cursor: pointer; border-radius: 4px 4px 0 0; }
.tab.active { color: var(--ink); border-color: var(--line); background: var(--panel); margin-bottom: -1px; font-weight: 600; }

/* Invoice upload */
.file-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.table input.cell { font: inherit; padding: 3px 6px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); color: var(--ink); }
.table input.cell.num { text-align: right; }

/* Import from the reference-data folder on the master data pages */
.import-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0 14px; }
.import-panel .notice, .import-panel .error { flex-basis: 100%; }

/* Dispatch board */
.rotation { margin: 18px 0; }
.rotation h3 { margin: 0 0 6px; font-size: 16px; }
.table tr.turn-row td { padding: 3px 12px; font-size: 12px; background: var(--bg); }
.table tr.selected td { background: var(--accent-soft); }
.badge.warn { color: var(--accent); border-color: var(--accent); }
.badge.danger { color: var(--danger); border-color: var(--danger); }
.dispatch-detail { margin-top: 18px; }
.fuel-table { max-width: 640px; margin-top: 12px; }
.fuel-table tr.total td { border-top: 2px solid var(--line); }

/* Route map */
.route-map { height: 540px; border: 1px solid var(--line); border-radius: 6px; margin: 14px 0; background: var(--panel); }
.route-map .zone-label { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); text-align: center; font-weight: 500; }
.route-map .zone-label.crossed { color: var(--accent); font-weight: 600; font-size: 12px; }
.route-map .ad-label span { display: inline-block; white-space: nowrap; font-family: var(--mono); font-size: 12px; font-weight: 600; padding: 2px 7px;
  border-radius: 3px; background: var(--nav); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.route-map .ad-label.arr span { background: var(--accent); }
.map-tiles-dark { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
.leaflet-tooltip.map-tip { font-family: var(--body); font-size: 12px; border-radius: 3px; }
.route-layout { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .route-layout { grid-template-columns: 1fr; } }
.route-result .total-charge { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; }
.rates-grid label { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.rates-grid input { width: 7em; text-align: right; }

/* Navigation: categories (collapsible) and sub-categories */
.nav-cat > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.nav-cat > summary::-webkit-details-marker { display: none; }
.nav-cat > summary::after { content: "▾"; font-size: 10px; opacity: .7; margin-right: 6px; }
.nav-cat:not([open]) > summary::after { content: "▸"; }
.nav-cat a, .nav-cat .nav-soon, .nav-cat .nav-sub { display: block; }
.nav-cat a { margin: 1px 0; }
.nav-sub { font-size: 11px; color: #9AA7B3; margin: 8px 0 2px 10px; font-weight: 600; }
.nav a.sub, .nav .nav-soon.sub { padding-left: 22px; font-size: 13.5px; }
.nav-sub2 { display: block; font-size: 11px; color: #7F8E9B; margin: 6px 0 2px 22px; }
.nav a.sub2 { display: block; padding-left: 34px; font-size: 13.5px; }

/* Sign-in and user box */
.login-shell { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: #0F1E33; overflow: hidden; isolation: isolate; }
.login-card { position: relative; z-index: 1; width: min(420px, 100%); background: var(--panel); border-radius: 16px; padding: 30px 30px 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .06); }
.login-brand { color: var(--ink); margin-bottom: 12px; }
.login-form { display: flex; flex-direction: column; gap: 12px; margin: 16px 0 8px; }
.login-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; }
.login-form input { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--ink); }
.userbox { border: 1px solid rgba(255,255,255,.12); border-radius: 6px; padding: 10px 12px; margin: -8px 0 18px; font-size: 13px; }
.userbox-name { color: #FFFFFF; font-weight: 600; }
.userbox-role { opacity: .8; }
.userbox-org { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.userbox-org select { font: inherit; font-size: 13px; padding: 3px 4px; border-radius: 4px; max-width: 100%; }
.userbox-links { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.userbox-links a, .userbox-links .link { color: var(--nav-ink); font-size: 13px; }
.userbox-links form { margin: 0; }
code.password { font-family: var(--mono); font-size: 16px; padding: 2px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; user-select: all; }
.lang-switch { text-align: right; font-size: 13px; margin-bottom: 4px; }
.lang-switch .link.active { font-weight: 600; text-decoration: none; }

/* Kostnadsberäkning: the three steps on one page. */
.steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.steps a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 13px; }
.step { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 18px; scroll-margin-top: 12px; }
.step-no { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; margin-right: 6px; }
/* Kostnadsberäkning: tabs for estimated cost, actual cost, invoices, CRCO and flights. */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.tabs .tab { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: inherit; cursor: pointer; font: inherit; text-align: left; }
.tabs .tab small { color: var(--muted, #6b7280); font-size: 12px; }
.tabs .tab.active { border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); background: var(--accent-soft); }

/* SearchSelect: AVIONA's own result list (best matches first, arrow keys and Enter), written in capital letters. */
.ss-box { position: relative; }
.ss-list { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 2px); min-width: 18em; max-height: 320px; overflow-y: auto;
  margin: 0; padding: 4px 0; list-style: none; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .14); font-size: 14px; text-transform: uppercase; }
.ss-item { display: flex; gap: 8px; align-items: baseline; padding: 5px 10px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-item strong { font-family: var(--mono); min-width: 3.5em; }
.ss-item .muted { font-size: 12px; }
.ss-item.active, .ss-item:hover { background: var(--accent-soft); }
.ss-empty { padding: 6px 10px; color: var(--muted); font-size: 13px; text-transform: none; }

/* The way of a supplier invoice: check → attest → attested → payment. */
.wf-steps { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 12px 0; }
.wf-step { display: inline-flex; align-items: center; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--muted); }
.wf-step .step-no { background: var(--line); color: var(--ink); }
.wf-step.done { color: var(--ink); }
.wf-step.done .step-no { background: var(--ok, #2E7D32); color: #fff; }
.wf-step.active { border-color: var(--accent); color: var(--ink); font-weight: 600; }
.wf-step.active .step-no { background: var(--accent); color: #fff; }
.wf-step.disputed { border-color: var(--danger); color: var(--danger); font-weight: 600; }
.wf-step.disputed .step-no { background: var(--danger); color: #fff; }
.workflow textarea, .panel textarea { width: 100%; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--ink); }
.messages { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.messages li { padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); max-width: 80ch; white-space: pre-wrap; }
.messages li.from-supplier { background: var(--accent-soft); align-self: flex-end; }
.messages li.from-airline { background: var(--panel); }

/* The bell with notices. */
.bell { position: relative; display: inline-block; }
.bell-button { background: none; border: 1px solid rgba(255, 255, 255, .2); color: inherit; border-radius: 4px; padding: 4px 8px; cursor: pointer; font: inherit; }
.bell-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 12px; text-align: center; }
.bell-list { position: fixed; z-index: 60; left: 16px; top: 64px; width: min(360px, 80vw); max-height: 420px; overflow-y: auto; background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); padding: 4px 0; }
.bell-item { display: block; padding: 8px 12px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); cursor: pointer; }
.bell-item:last-child { border-bottom: none; }
.bell-item.unread { background: var(--accent-soft); }
.bell-item small { display: block; color: var(--muted); }

/* Meddelanden: conversations on the left, the open conversation on the right. */
.msg-layout { display: grid; grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 800px) { .msg-layout { grid-template-columns: minmax(0, 1fr); } }
.msg-list { display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow-y: auto; }
.msg-item { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); cursor: pointer; }
.msg-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-item.unread { border-color: var(--accent); }
.msg-item.active { border-color: var(--accent); background: var(--accent-soft); }
.msg-item-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.msg-main textarea, .msg-main input { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--ink); }

/* Flights: header with the 3D aircraft */
.flights-hero { position: relative; overflow: hidden; min-height: 250px; display: flex; align-items: center; margin-bottom: 14px; padding: 26px 28px; border-radius: 14px;
  background: radial-gradient(120% 140% at 80% 120%, #12406e 0%, #08182c 55%, #040b16 100%); color: #FFFFFF; box-shadow: 0 10px 30px rgba(4, 11, 22, .25); }
.flights-hero > .aircraft3d { position: absolute; inset: 0; }
.flights-hero-text { position: relative; z-index: 1; max-width: 560px; padding: 14px 18px; border-radius: 12px;
  background: linear-gradient(90deg, rgba(4, 11, 22, .72) 0%, rgba(4, 11, 22, .35) 80%, rgba(4, 11, 22, 0) 100%); }
@media (max-width: 760px) { .flights-hero { min-height: 300px; align-items: flex-start; } }
.flights-hero h1 { margin: 0 0 6px; color: #FFFFFF; }
.flights-hero .lede { color: #C9D5E1; margin: 0; }
.aircraft3d { position: relative; overflow: hidden; }
.aircraft3d canvas { display: block; }
.aircraft3d-off { display: none; }

/* Paging for long lists (Components/Shared/Pager.razor) */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 12px; font-size: 14px; }
.pager-count { font-family: var(--mono); color: var(--muted); }
.pager-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pager-btn { min-width: 38px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; }
.pager-btn:hover:not(:disabled) { border-color: var(--accent); }
.pager-btn.active { background: var(--accent); border-color: var(--accent); color: #FFFFFF; font-weight: 600; }
.pager-btn:disabled { opacity: .4; cursor: default; }
.pager-gap { color: var(--muted); padding: 0 4px; }
.pager-jump, .pager-size { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.pager-jump input { width: 4.5em; }
/* QuickGrid fills the last page with empty rows; they are not shown. */
.table tbody tr:not(:has(td:not(:empty))) { display: none; }

/* Compact tables with inputs (aircraft types): fit the screen without scrolling sideways. */
.table.compact td, .table.compact th { padding: 7px 8px; vertical-align: top; }
.table.compact .type-cell { min-width: 11em; max-width: 18em; }
.table .cell-input { width: 6.5em; max-width: 100%; padding: 4px 6px; text-align: right; }
.table .cell-input.narrow { width: 4.5em; }
.table .small, .small { font-size: 12px; }
.table .nowrap, .nowrap { white-space: nowrap; }
@media (max-width: 1100px) { .table .cell-input { width: 5.2em; } .table.compact .type-cell { min-width: 9em; } }

/* Compact tables wrap instead of running out of the frame: the four-phase values break onto two lines when needed. */
.table.compact { table-layout: auto; }
.table.compact td.num.small { white-space: normal; min-width: 9em; }
.table.compact th { white-space: normal; }

/* ---------- Modern form fields (all pages) ---------- */
:root { --field-bg: #FFFFFF; --field-line: #CBD3DA; --field-hover: #9FAAB4; --ring: rgba(168, 100, 0, .18); --radius: 8px; }
@media (prefers-color-scheme: dark) { :root { --field-bg: #101820; --field-line: #33414C; --field-hover: #4C5D6A; --ring: rgba(240, 180, 76, .22); } }

label { font-family: var(--body); font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: .01em; gap: 6px; }
label.check, label.file { color: var(--ink); font-weight: 400; font-size: 14px; }
input, select, textarea {
  font-family: var(--body); font-size: 14px; color: var(--ink); background: var(--field-bg);
  border: 1px solid var(--field-line); border-radius: var(--radius); padding: 9px 12px; min-height: 40px;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
  box-shadow: 0 1px 2px rgba(16, 32, 42, .04);
}
textarea { min-height: 0; line-height: 1.45; }
input:hover, select:hover, textarea:hover { border-color: var(--field-hover); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }
input[disabled], select[disabled], textarea[disabled] { background: var(--bg); color: var(--muted); cursor: not-allowed; }
input[type="checkbox"], input[type="radio"] { min-height: 0; width: 16px; height: 16px; padding: 0; box-shadow: none; accent-color: var(--accent); }
input[type="file"] { min-height: 0; padding: 6px; }
input[type="number"] { font-variant-numeric: tabular-nums; }
/* Codes (registrations, IATA/ICAO, flight numbers) keep the code font; their placeholder reads as normal text. */
input.upper { font-family: var(--mono); letter-spacing: .02em; }
input.upper::placeholder { font-family: var(--body); letter-spacing: 0; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23566370' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
select[multiple] { background-image: none; padding-right: 12px; }

/* Filter and form boxes: a little more air, softer corners. */
.inline-form { border-radius: 12px; padding: 16px 18px; gap: 14px 16px; box-shadow: 0 1px 2px rgba(16, 32, 42, .04); }
.inline-form .btn, .inline-form .btn-secondary { min-height: 40px; }
.form-grid { gap: 14px 18px; }
fieldset { border-radius: 12px; }
details.panel { border-radius: 12px; padding: 14px 18px; }
details.panel > summary { font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::before { content: "▸"; font-size: 11px; color: var(--muted); transition: transform .15s ease; }
details.panel[open] > summary::before { transform: rotate(90deg); }
details.panel[open] > summary { margin-bottom: 12px; }
.btn, .btn-secondary, .btn-danger { border-radius: var(--radius); }
.hint { line-height: 1.55; }
.calc-page { min-width: 0; }
/* SearchSelect: a rounded result list under the field, chips for the chosen values. */
.ss-list { border-radius: 10px; top: calc(100% + 4px); padding: 6px; border-color: var(--field-line); box-shadow: 0 10px 28px rgba(16, 32, 42, .16); }
.ss-item { border-radius: 6px; padding: 7px 10px; }
.search-select .chip { border-radius: 999px; padding: 2px 4px 2px 10px; }

/* Sign-in background: the aircraft photo with a dark blue shade (see LoginLayout). */
.login-photo { position: absolute; inset: 0; z-index: 0; background: #0F1E33 url("img/login-bg.webp") 20% center / cover no-repeat; }
.login-photo::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(6, 16, 29, .15) 0%, rgba(6, 16, 29, .25) 50%, rgba(6, 16, 29, .78) 100%); }
.login-shell { place-items: center end; padding: 24px clamp(16px, 7vw, 120px); }
.login-tagline { position: absolute; left: clamp(16px, 5vw, 72px); bottom: clamp(20px, 6vh, 64px); z-index: 1; color: #E6ECEF; max-width: 26em;
  font-size: 15px; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.login-tagline-brand { font-weight: 600; font-size: 28px; letter-spacing: .22em; color: #FFFFFF; margin-bottom: 4px; }
.login-card { background: rgba(255, 255, 255, .94); backdrop-filter: blur(6px); }
@media (prefers-color-scheme: dark) { .login-card { background: rgba(23, 32, 39, .92); } }
.login-brand { font-size: 22px; letter-spacing: .18em; }
@media (max-width: 760px) {
  .login-shell { place-items: center; }
  .login-photo::after { background: rgba(6, 16, 29, .55); }
  .login-tagline { display: none; }
}
/* The open tab is clearly marked: in the menu (amber bar on the left) and on the page (amber frame and title). */
.nav a.active { background: rgba(232, 163, 61, .18); color: #FFFFFF; box-shadow: inset 3px 0 0 #E8A33D; font-weight: 600; }
.tabs .tab.active { border-color: var(--accent); border-width: 2px; padding: 7px 13px; box-shadow: 0 2px 8px rgba(168, 100, 0, .15); }
.tabs .tab.active strong { color: var(--accent); }
.tabs .tab:not(.active):hover { border-color: var(--field-hover, #9FAAB4); }

/* Aircraft in a fleet that are not on the pasted fleet list (Grunddata → Flygbolag). */
.table tr.warn td { background: var(--accent-soft); }

/* Page tabs inside AVIONA (PageTabs.razor): each page chosen in the menu is a tab at the top of the content. */
.pagetabs { position: sticky; top: 0; z-index: 5; display: flex; gap: 4px; overflow-x: auto; margin: -16px 0 18px; padding: 8px 0 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.pagetabs .ptab { display: flex; align-items: center; flex: 0 0 auto; max-width: 240px; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; background: var(--panel); }
.pagetabs .ptab a { padding: 7px 4px 7px 12px; color: var(--muted); text-decoration: none; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pagetabs .ptab.active { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); margin-bottom: -1px; background: var(--bg); }
.pagetabs .ptab.active a { color: var(--ink); font-weight: 600; }
.pagetabs .ptab:not(.active):hover a { color: var(--ink); }
.pagetabs .ptab-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 6px 8px; border-radius: 4px; }
.pagetabs .ptab-x:hover { color: var(--danger); background: var(--accent-soft); }

/* Flygningar: status buttons, filter grid and the filters in use. */
.filters .seg { display: inline-flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.filters .seg-btn { border: 0; border-right: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 8px 14px; cursor: pointer; font: inherit; }
.filters .seg-btn:last-child { border-right: 0; }
.filters .seg-btn small { color: var(--muted); margin-left: 4px; }
.filters .seg-btn.active { background: var(--accent); color: #fff; }
.filters .seg-btn.active small { color: rgba(255,255,255,.85); }
.filters .filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 14px; }
.filters .filter-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.filters .filter-grid label.wide { grid-column: span 2; }
.filters .active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.filters .active-filters .chip button { padding: 0 0 0 4px; }

/* Flygningar: the flight board. */
.flight-board { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.flight-table { margin: 0; }
.flight-table thead th { position: sticky; top: 0; background: var(--panel); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.flight-table tbody tr { transition: background .15s; }
.flight-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--line) 22%, transparent); }
.flight-table tbody tr:hover { background: var(--accent-soft); }
.flight-table td { padding-top: 10px; padding-bottom: 10px; vertical-align: middle; }
.fb-time { display: flex; flex-direction: column; line-height: 1.2; }
.fb-time strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.fb-time .fb-new { color: var(--accent); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.fb-time small { color: var(--muted); font-size: 11.5px; }
.fb-flight { display: flex; align-items: center; gap: 10px; }
.fb-flight small { display: block; color: var(--muted); font-size: 12px; }
.fb-code { flex: 0 0 auto; display: inline-grid; place-items: center; min-width: 38px; height: 30px; padding: 0 6px; border-radius: 8px;
  background: linear-gradient(135deg, #14107a, #00a0c6); color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .03em; }
.fb-route { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fb-route strong { font-size: 15px; }
.fb-route small { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.fb-arrow { display: inline-block; color: var(--accent); font-size: 14px; }
.fb-arrow.dep { transform: rotate(-20deg); }
.fb-arrow.arr { transform: rotate(20deg); }
.fb-aircraft { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.fb-type { padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: #e3f6ea; color: #17733a; }
.pill.bad { background: #fde7e7; color: #b42318; }
.pill.warn { background: #fff2dc; color: #a35a00; }
.pill.info { background: #e4efff; color: #1d4ea8; }
.fb-raw { display: block; margin-top: 2px; font-size: 11.5px; }

/* Fleet showcase (AircraftShowcase.razor): the chosen aircraft climbing, its registration, neighbours and data. */
.showcase { margin: 4px 0 20px; padding: 20px 16px 22px; border-radius: 16px; text-align: center;
  background: radial-gradient(120% 90% at 50% 0%, #ffffff 0%, #f1f5f9 60%, #e6ecf2 100%); border: 1px solid var(--line); }
.showcase-stage { display: flex; justify-content: center; padding: 6px 0 0; }
.showcase-plane { width: min(820px, 100%); height: auto; filter: drop-shadow(0 18px 18px rgba(11, 26, 43, .14));
  animation: showcase-in .55s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes showcase-in { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .showcase-plane { animation: none; } }
.showcase-title h2 { margin: 6px 0 0; font-size: 40px; line-height: 1.1; letter-spacing: .02em; color: #14107a; font-weight: 800; }
.showcase-title p { margin: 4px 0 0; font-size: 20px; color: #3b4652; }
.showcase-strip { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 22px; }
.showcase-nav { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; box-shadow: 0 4px 14px rgba(11, 26, 43, .14);
  font-size: 24px; line-height: 1; color: #14107a; cursor: pointer; }
.showcase-nav:disabled { opacity: .35; cursor: default; }
.showcase-item { flex: 1 1 0; max-width: 260px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px; border: 0; background: none;
  cursor: pointer; opacity: .38; filter: grayscale(.5); transition: opacity .25s, filter .25s, transform .25s; }
.showcase-item:hover { opacity: .7; }
.showcase-item.active { opacity: 1; filter: none; transform: translateY(-2px); }
.showcase-chip { display: inline-flex; align-items: stretch; border-radius: 4px; overflow: hidden; font-size: 13px; font-weight: 600; }
.showcase-chip .reg { padding: 3px 9px; background: #9aa4ad; color: #fff; }
.showcase-chip .typ { padding: 3px 8px; color: #6b7783; }
.showcase-item.active .showcase-chip .reg { background: #0f2742; }
.showcase-item.active .showcase-chip .typ { color: #14107a; }
.showcase-mini { width: 100%; max-width: 220px; height: auto; }
.showcase-item.active .showcase-mini { border-bottom: 4px solid rgba(15, 39, 66, .18); border-radius: 0 0 50% 50% / 0 0 10px 10px; }
.showcase-count { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.showcase-spec-title { margin: 22px 0 10px; font-size: 24px; font-weight: 500; color: #1d4e78; }
.showcase-specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; max-width: 900px; margin: 0 auto; }
.showcase-specs div { display: flex; flex-direction: column; gap: 4px; }
.showcase-specs span { color: #5b6876; font-weight: 600; font-size: 14px; }
.showcase-specs strong { font-size: 16px; color: #26323e; font-weight: 500; }
.showcase-specs small { color: var(--muted); font-size: 12px; }
.table tr.picked td { background: var(--accent-soft); }
@media (max-width: 700px) { .showcase-title h2 { font-size: 30px; } .showcase-item:not(.active) { display: none; } }

/* Airline groups (koncerner): chips and key figures. */
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chips-row a.chip { text-decoration: none; }
.chips-row .chip small { color: var(--muted); margin-left: 4px; }
.group-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 10px 0 18px; }
.group-stats div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); display: flex; flex-direction: column; gap: 4px; }
.group-stats span { color: var(--muted); font-size: 13px; }
.group-stats strong { font-size: 24px; }

/* A field that takes the whole row of a form grid (e.g. the bases of an airline). */
.form-grid .span-all { grid-column: 1 / -1; }
.form-grid label > input { max-width: 100%; box-sizing: border-box; }

/* Airline logos (uploaded under Grunddata → Flygbolag). */
.airline-logo { display: inline-block; width: auto; max-width: 140px; object-fit: contain; vertical-align: middle; }
.name-with-logo { display: inline-flex; align-items: center; gap: 8px; }
.logo-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 0; }
.logo-edit > span { font-size: 13px; }
.logo-edit small { flex-basis: 100%; }


/* Tilldela flygplan: wider filters and rows that keep the aircraft data under the choice. */
.filter-wide label { min-width: 9em; }
.filter-wide label.wide { flex: 1 1 22em; }
.assign-table td { vertical-align: top; }
.flight-toggle { white-space: nowrap; }
.detail-row > td { background: var(--panel); }
.flight-detail { padding: 6px 4px 10px; }
.flight-detail-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 16px; margin-bottom: 8px; }
.flight-detail-facts span { display: block; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.flight-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

/* Grunddata → Enheter */
.unit-group { margin: 18px 0 8px; }
.unit-group small { font-weight: 400; font-size: 12.5px; margin-left: 6px; }
.unit-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 8px; }
.unit-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.unit-card.own { border-style: dashed; }
.unit-card.active { border-color: var(--accent, #1d5fbf); box-shadow: 0 0 0 2px rgba(29, 95, 191, .15); }
.unit-card-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.unit-code { font-family: var(--mono); font-weight: 700; font-size: 18px; }
.unit-name { color: var(--muted); font-size: 13px; }
.unit-factor { font-variant-numeric: tabular-nums; }
.unit-card .link { align-self: flex-start; }
.factor-input { display: flex; align-items: center; gap: 6px; }
.factor-input input { width: 10em; }
.unit-form { margin-bottom: 16px; }
.table tr.row-warn td { background: rgba(230, 150, 0, .07); }

/* Flygningar: the overview above the flight list (FlightsInfographic). */
.fi-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fi { margin: 4px 0 18px; --fi-ok: #2E8B57; --fi-info: #2F6FB0; --fi-warn: #D08A00; --fi-bad: #C0392B; --fi-dep: #1F4E79; --fi-arr: #8CB4DA; }
.fi-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.fi-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 10px; border-top: 4px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.fi-kpi.ok { border-top-color: var(--fi-ok); } .fi-kpi.info { border-top-color: var(--fi-info); }
.fi-kpi.warn { border-top-color: var(--fi-warn); } .fi-kpi.bad { border-top-color: var(--fi-bad); }
.fi-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fi-kpi strong { font-size: 26px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.fi-kpi small { color: var(--muted); font-size: 12px; }
.fi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fi-card.fi-half { grid-column: span 2; }
@media (max-width: 1100px) { .fi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fi-card.fi-half { grid-column: auto; } }
@media (max-width: 760px) { .fi-grid { grid-template-columns: 1fr; } }
.fi-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.fi-card.fi-wide { grid-column: span 2; }
@media (max-width: 760px) { .fi-card.fi-wide { grid-column: auto; } }
.fi-card h4 { margin: 0 0 10px; font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.fi-donut-wrap { display: flex; align-items: center; gap: 16px; }
.fi-donut { width: 128px; height: 128px; flex: none; }
.fi-ring-bg { fill: none; stroke: var(--line); stroke-width: 14; }
.fi-ring { fill: none; stroke-width: 14; }
.fi-ring.ok { stroke: var(--fi-ok); } .fi-ring.info { stroke: var(--fi-info); } .fi-ring.bad { stroke: var(--fi-bad); }
.fi-donut-num { text-anchor: middle; font-size: 22px; font-weight: 700; fill: var(--ink); }
.fi-donut-cap { text-anchor: middle; font-size: 9px; fill: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.fi-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; flex: 1; }
.fi-legend li { display: flex; align-items: center; }
.fi-legend i, .fi-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.fi-legend b { margin-left: auto; padding-left: 10px; font-variant-numeric: tabular-nums; }
.fi-legend i.ok { background: var(--fi-ok); } .fi-legend i.info { background: var(--fi-info); } .fi-legend i.bad { background: var(--fi-bad); }
.fi-key { font-weight: 400; color: var(--muted); font-size: 12px; }
.fi-key i { margin-left: 10px; } .fi-key i.dep { background: var(--fi-dep); } .fi-key i.arr { background: var(--fi-arr); }
.fi-bars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 3px; align-items: end; height: 150px; }
.fi-bar { display: grid; grid-template-rows: 1fr auto; height: 100%; min-width: 0; }
.fi-col { display: flex; flex-direction: column; justify-content: flex-end; min-height: 0; }
.fi-stack { display: flex; flex-direction: column; border-radius: 3px 3px 0 0; overflow: hidden; min-height: 0; }
.fi-stack .dep { background: var(--fi-dep); } .fi-stack .arr { background: var(--fi-arr); }
.fi-bar small { text-align: center; font-size: 10px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums; }
.fi-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.fi-rank li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13px; }
.fi-rank-name { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fi-rank-name .muted { overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.fi-rank-bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.fi-rank-bar span { display: block; height: 100%; background: var(--fi-info); border-radius: 4px; }
.fi-rank-num { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 2.5em; text-align: right; }

/* Flygningar: the filter panel (status pills, search, grouped filters). */
.panel.filters.ff { display: block; padding: 0; overflow: hidden; border-radius: 12px; }
.ff-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ff-status { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--bg); padding: 4px; border-radius: 999px; }
.ff-pill { border: 0; background: transparent; color: var(--ink); padding: 7px 14px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; transition: background .15s, color .15s; }
.ff-pill:hover { background: var(--panel); }
.ff-pill.active { background: var(--panel); box-shadow: 0 1px 3px rgba(15, 30, 51, .18); font-weight: 600; }
.ff-count { font-size: 11.5px; font-variant-numeric: tabular-nums; background: var(--line); color: var(--ink); border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.ff-pill.active .ff-count { background: var(--accent); color: #fff; }
.ff-search { position: relative; flex: 1 1 320px; max-width: 520px; }
.ff-search input { width: 100%; padding: 9px 12px 9px 34px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font: inherit; color: var(--ink); }
.ff-search input:focus { background: var(--panel); border-color: var(--accent); outline: none; }
.ff-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ff-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.ff-group { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; border-right: 1px solid var(--line); min-width: 0; }
.ff-group:last-child { border-right: 0; }
.ff-group-title { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ff-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ff-group label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.ff-group input, .ff-group select { font: inherit; font-size: 14px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; width: 100%; min-width: 0; }
.ff-group input:focus, .ff-group select:focus { border-color: var(--accent); outline: none; }
.ff-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.ff-chip { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 12.5px; cursor: pointer; }
.ff-chip:hover { border-color: var(--accent); color: var(--accent); }
.ff-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; align-self: flex-start; }
.ff-toggle button { border: 0; border-right: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.ff-toggle button:last-child { border-right: 0; }
.ff-toggle button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.panel.filters.ff .active-filters { padding: 10px 16px; margin: 0; border-top: 1px solid var(--line); background: var(--bg); }
@media (max-width: 760px) { .ff-group { border-right: 0; border-bottom: 1px solid var(--line); } .ff-row { grid-template-columns: 1fr; } }

/* ===== Modern look across the whole system (same language as the flight filter panel and overview) ===== */
:root { --radius: 12px; --radius-sm: 8px; --shadow: 0 1px 2px rgba(16, 32, 42, .05), 0 2px 8px rgba(16, 32, 42, .04);}
@media (prefers-color-scheme: dark) {
  :root { --shadow: 0 1px 2px rgba(0, 0, 0, .3);}
}

/* Page head */
.page-head { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
h1 { font-size: 26px; letter-spacing: -.01em; }
h3 { font-size: 16px; font-weight: 600; }

/* Cards: panels, fieldsets, inline forms, table wraps */
.panel, fieldset, .inline-form, .grid-wrap, details.panel {
  border-radius: var(--radius); box-shadow: var(--shadow); border-color: var(--line);
}
.panel { background: var(--panel); border: 1px solid var(--line); padding: 16px 18px; margin-bottom: 16px; }
.panel > h3:first-child, fieldset > legend { margin-top: 0; }
fieldset { padding: 18px 20px 20px; }
fieldset > legend { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
                    background: var(--panel); padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; }
.inline-form { padding: 16px 18px; gap: 14px 16px; }

/* Labels and inputs */
label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; gap: 6px; }
label > input, label > select, label > textarea, label > * { color: var(--ink); letter-spacing: normal; }
label.check { font-size: 14px; font-weight: 400; color: var(--ink); }
input, select, textarea {
  font-family: var(--body); font-size: 14px; padding: 8px 11px; border-radius: var(--radius-sm);
  background: var(--panel); border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s;
}
input[type=checkbox], input[type=radio] { padding: 0; accent-color: var(--accent); width: 16px; height: 16px; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled, select:disabled, textarea:disabled { background: var(--bg); color: var(--muted); cursor: not-allowed; }
input.code, input.mono, .mono { font-family: var(--mono); }

/* Buttons */
.btn, .btn-secondary, .btn-danger { border-radius: var(--radius-sm); padding: 8px 16px; font-weight: 600; font-size: 14px;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn { box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.btn:hover { box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.btn-secondary { background: var(--panel); }
.btn-secondary:hover { background: var(--accent-soft); color: var(--ink); }
.btn:focus-visible, .btn-secondary:focus-visible, .btn-danger:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

/* Key figures like the flight overview */
.kpis { gap: 12px; }
.kpi { border-radius: 10px; border-top: 4px solid var(--line); padding: 12px 14px 10px; box-shadow: var(--shadow); }
.kpi span { font-family: var(--body); font-size: 11px; font-weight: 600; letter-spacing: .08em; }
.kpi strong { font-size: 24px; line-height: 1.2; }
.kpi.ok { border-top-color: var(--ok); }
.kpi.info { border-top-color: var(--info); }
.kpi.bad { border-top-color: var(--danger); }
.kpi.warn { border-top-color: var(--accent); }
.kpi.warn strong { color: var(--accent); }

/* Status chips as pills */
.chip { border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; line-height: 1.5; }

/* Tables */
.grid-wrap { overflow: auto; }
.table th { font-family: var(--body); font-weight: 600; letter-spacing: .06em; background: color-mix(in srgb, var(--bg) 70%, var(--panel));
            position: sticky; top: 0; z-index: 1; padding: 11px 14px; }
.table td { padding: 10px 14px; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.table td .btn-secondary, .table td .btn { padding: 5px 12px; font-size: 13px; }

/* Messages */
.notice { border-radius: var(--radius-sm); border-left-width: 4px; }
p.error { background: var(--danger-soft); border: 1px solid var(--danger); border-left-width: 4px; padding: 10px 14px; border-radius: var(--radius-sm); }
.hint { font-size: 13px; }

/* Old-style filter bars get the same card look as the flight filter panel */
.panel.filters:not(.ff) { border-radius: var(--radius); padding: 14px 16px; gap: 12px 16px; align-items: flex-end; }
.filters .seg { border-radius: 999px; overflow: hidden; }

/* Sidebar */
.nav a { border-radius: var(--radius-sm); transition: background .15s, color .15s; }
.nav a.active { box-shadow: inset 3px 0 0 #E8A33D; }

/* ===== Modern look, part 2: tabs, steps, cards and the cost pages (Kostnadsberäkning, fakturor, CRCO) ===== */
/* Tabs as a row of cards with a coloured underline on the active one */
.tabs { gap: 10px; border-bottom: 0; padding-bottom: 0; margin: 4px 0 20px; }
.tabs .tab, .tabs > button, .tabs > a { border-radius: var(--radius); padding: 10px 16px; box-shadow: var(--shadow); border: 1px solid var(--line);
  background: var(--panel); transition: border-color .15s, box-shadow .15s, transform .15s; min-width: 170px; }
.tabs .tab:hover, .tabs > button:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16, 32, 42, .08); }
.tabs .tab.active, .tabs > button.active { border: 1px solid var(--accent); padding: 10px 16px; background: var(--panel);
  box-shadow: inset 0 -3px 0 var(--accent), 0 4px 12px rgba(168, 100, 0, .12); }
.tabs .tab strong { font-size: 14px; }

/* Numbered steps */
.step { border-top: 0; margin-top: 22px; }
.step > h2 { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.step-no { width: 28px; height: 28px; margin: 0; font-weight: 700; box-shadow: 0 0 0 4px var(--accent-soft); }

/* Collapsible panels */
details.panel > summary { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::before { content: "▸"; color: var(--accent); transition: transform .15s; display: inline-block; }
details.panel[open] > summary::before { transform: rotate(90deg); }
details.panel[open] > summary { margin-bottom: 4px; }

/* Cards, empty states, search, pager */
.card { border-radius: var(--radius); box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s, transform .15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16, 32, 42, .08); }
.empty { border-radius: var(--radius); text-align: center; color: var(--muted); padding: 28px 20px; }
.search { border-radius: 999px; padding: 9px 16px; }
.search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pager-btn { border-radius: var(--radius-sm); }

/* Badges become soft pills like the chips */
.badge { font-family: var(--body); font-weight: 600; font-size: 11px; letter-spacing: .04em; padding: 2px 9px; border-radius: 999px; }
.badge.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.badge.warn { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.badge.danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; }

/* Cost calculations and explanations */
.calc { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 8px 12px; }
.calc-row td { background: color-mix(in srgb, var(--bg) 60%, var(--panel)); }
.table tr.calc-row:hover td { background: color-mix(in srgb, var(--bg) 60%, var(--panel)); }
.table td.num strong, .table tfoot td { font-variant-numeric: tabular-nums; }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--line); background: color-mix(in srgb, var(--bg) 50%, var(--panel)); }
.route-result .total-charge { font-size: 30px; letter-spacing: -.01em; }
.import-panel { background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); padding: 14px 16px; }
.import-panel:hover { border-color: var(--accent); }

/* Messages (supplier ↔ airline) */
.messages li { border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 14px; }

/* Notices on the cost pages with an icon-like accent */
.notice { background: color-mix(in srgb, var(--accent-soft) 70%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); border-left-color: var(--accent); padding: 12px 16px; }

/* Cost overview on Kostnadsberäkning (CostsInfographic) */
.ci .ci-donut-num { font-size: 17px; }
.ci .ci-bars { height: 170px; }
.ci .fi-rank-num small { font-weight: 400; font-size: 11px; }
.ci .fi-key { display: inline-flex; flex-wrap: wrap; gap: 2px 0; }
@media (max-width: 1000px) { .ci .fi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .ci .fi-grid { grid-template-columns: minmax(0, 1fr); } .ci .fi-card.fi-wide, .ci .fi-card.fi-half { grid-column: auto; } }
.ci .fi-legend b { white-space: nowrap; }

/* Costs of one flight (FlightCostCard), opened in the cost list on Kostnadsberäkning */
.fc { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius, 12px); padding: 14px 16px; margin: 4px 0 10px; box-shadow: var(--shadow); font-family: var(--body); color: var(--ink); }
.fc-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; margin-bottom: 12px; }
.fc-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 14px; }
.fc-title strong { font-size: 18px; }
.fc-route { font-weight: 600; font-size: 16px; }
.fc-arrow { color: var(--accent); margin: 0 2px; }
.fc-figures { display: flex; flex-wrap: wrap; gap: 8px; }
.fc-figures > div { display: flex; flex-direction: column; background: var(--bg); border-radius: 10px; padding: 6px 12px; min-width: 110px; }
.fc-figures span { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fc-figures strong { font-size: 18px; font-variant-numeric: tabular-nums; line-height: 1.25; }
.fc-figures small { color: var(--muted); font-size: 11px; }
.fc-bar { display: flex; height: 28px; border-radius: 8px; overflow: hidden; gap: 2px; background: var(--bg); margin-bottom: 14px; }
.fc-bar span { display: flex; align-items: center; justify-content: center; min-width: 3px; }
.fc-bar b { color: #fff; font-size: 11px; font-weight: 700; text-shadow: 0 1px 1px rgba(0, 0, 0, .35); white-space: nowrap; }
.fc-body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(200px, 1fr); gap: 16px 24px; }
@media (max-width: 760px) { .fc-body { grid-template-columns: minmax(0, 1fr); } }
.fc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fc-list li { display: grid; grid-template-columns: 12px minmax(110px, 1.2fr) minmax(60px, 1fr) 7.5em 3.2em; align-items: center; gap: 10px; font-size: 13px; }
.fc-list i { width: 12px; height: 12px; border-radius: 3px; }
.fc-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-track { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.fc-track span { display: block; height: 100%; border-radius: 4px; }
.fc-amount { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.fc-pct { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.fc-airports { border-left: 1px solid var(--line); padding-left: 18px; }
@media (max-width: 760px) { .fc-airports { border-left: 0; padding-left: 0; } }
.fc-airports h5 { margin: 0 0 8px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fc-ap { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.fc-ap:last-child { border-bottom: 0; }
.fc-ap-code { font-weight: 700; }
.fc-ap-sum { font-variant-numeric: tabular-nums; font-weight: 600; }
.calc-row .fc { margin: 6px 0; }

/* Aviona Hub overview (HubInfographic): the invoices' way through the airline as a flow */
.hub-flow { display: flex; align-items: stretch; gap: 6px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 2px; }
.hub-step { flex: 1 1 0; min-width: 150px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; position: relative; box-shadow: var(--shadow);
  border-left: 5px solid var(--hub-c, var(--line)); transition: transform .15s, box-shadow .15s; }
.hub-step:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16, 32, 42, .1); }
.hub-step.info { --hub-c: #2F6FB0; } .hub-step.warn { --hub-c: #D08A00; } .hub-step.bad { --hub-c: #C0392B; }
.hub-step.ok { --hub-c: #2E8B57; } .hub-step.done { --hub-c: #7F8FA6; }
.hub-step-no { position: absolute; top: 10px; right: 12px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff; background: var(--hub-c); }
.hub-step-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-right: 26px; }
.hub-step strong { font-size: 28px; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--hub-c); }
.hub-step small { color: var(--muted); font-variant-numeric: tabular-nums; }
.hub-arrow { align-self: center; font-size: 26px; color: var(--muted); flex: none; }
@media (max-width: 900px) { .hub-arrow { display: none; } }
.hub .hub-donut-num { font-size: 17px; }
.hub .hub-bars { height: 170px; }
.hub .fi-rank-num small { font-weight: 400; font-size: 11px; }
.hub .hub-check { margin: 4px 0 12px; }
.hub .fi-legend b { white-space: nowrap; }
.hub-links { margin-bottom: 12px; }
