/* =============================================================================
   AVESTA — design system.
   Tokens first, then the shell (sidebar, top bar, user menu), then the components every
   screen is built from. The module-specific styles further down use only these tokens.
   ========================================================================== */

:root {
  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f4f9;
  --ink: #0f1d2e;
  --ink-2: #48586d;
  --ink-3: #8391a5;
  --line: #e1e7ef;
  --line-2: #edf1f6;

  --brand: #1a4d8f;
  --brand-2: #2563b8;
  --brand-ink: #0b2447;
  --brand-soft: #eaf1fb;
  --accent: #0b7285;
  --gold: #c9a24f;

  --side: #0a1a31;
  --side-2: #0e2240;
  --side-ink: #a9bbd6;
  --side-ink-2: #6f86a8;

  --ok: #12805c;
  --ok-bg: #e3f5ed;
  --warn: #9a6309;
  --warn-bg: #fdf2dd;
  --bad: #b3261e;
  --bad-bg: #fdeae8;
  --info: #1b5fa8;
  --info-bg: #e8f0fb;

  --r: 12px;
  --r-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 29, 46, .04), 0 2px 8px rgba(15, 29, 46, .04);
  --shadow-md: 0 2px 4px rgba(15, 29, 46, .05), 0 10px 28px rgba(15, 29, 46, .07);
  --shadow-lg: 0 4px 10px rgba(15, 29, 46, .08), 0 24px 60px rgba(15, 29, 46, .16);
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --side-w: 264px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.55 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.012em; }
a { color: var(--brand-2); }
::selection { background: #cfe0f8; }

/* Scrollbars that do not shout. */
* { scrollbar-width: thin; scrollbar-color: #c6d0dd transparent; }
.side * { scrollbar-color: #2a3f60 transparent; }

/* ================================================================= shell */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; transition: grid-template-columns .18s; }
body.collapsed { --side-w: 72px; }

.side {
  background:
    radial-gradient(420px 300px at 0% 100%, rgba(37, 99, 184, .18), transparent 70%),
    linear-gradient(180deg, var(--side-2) 0%, var(--side) 100%);
  color: var(--side-ink);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid rgba(255, 255, 255, .04);
  z-index: 20;
}

/* The name as text, with nothing beside it. */
.side .brand { display: flex; align-items: center; justify-content: space-between; padding: 22px 18px 18px 22px; }
.side .brand .word { color: #fff; font-size: 17px; font-weight: 600; letter-spacing: .3em; line-height: 1; }
.side .brand .word small { display: block; margin-top: 7px; font-size: 10px; font-weight: 500; letter-spacing: .12em;
  color: var(--side-ink-2); text-transform: uppercase; }
.collapse-btn {
  border: 0; background: transparent; color: var(--side-ink-2); cursor: pointer;
  width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center;
}
.collapse-btn:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.collapse-btn svg { width: 16px; height: 16px; transition: transform .18s; }
body.collapsed .collapse-btn svg { transform: rotate(180deg); }

.side-search { position: relative; margin: 0 14px 12px; }
.side-search input {
  width: 100%; font: inherit; font-size: 12.8px; color: #e6eefb;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 9px; padding: 8px 44px 8px 32px;
}
.side-search input::placeholder { color: var(--side-ink-2); }
.side-search input:focus { outline: 0; border-color: rgba(120, 170, 255, .45); background: rgba(255, 255, 255, .09); }
.side-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--side-ink-2); }
.side-search kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font: 600 10px var(--mono); color: var(--side-ink-2);
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 5px; padding: 1px 5px;
}

nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; padding: 4px 10px 12px; flex: 1; }
.nav {
  display: flex; align-items: center; gap: 11px; width: 100%;
  border: 0; background: transparent; color: var(--side-ink);
  font: inherit; font-size: 13.2px; text-align: left;
  padding: 8px 11px; border-radius: 9px; cursor: pointer;
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.nav svg { width: 17px; height: 17px; flex: 0 0 auto; opacity: .85; }
.nav:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav.on { background: linear-gradient(90deg, rgba(64, 132, 230, .28), rgba(64, 132, 230, .10)); color: #fff; font-weight: 600; }
.nav.on svg { opacity: 1; color: #8fc0ff; }

.nav.grp { font-weight: 550; }
.nav.grp em { margin-left: auto; font-style: normal; display: grid; place-items: center; opacity: .55; }
.nav.grp em svg { width: 13px; height: 13px; transition: transform .15s; }
.navgrp.open > .nav.grp em svg { transform: rotate(90deg); }
.navgrp.has-on > .nav.grp { color: #fff; }
.navgrp .sub { display: none; padding: 2px 0 6px; position: relative; }
.navgrp .sub::before { content: ''; position: absolute; left: 19px; top: 2px; bottom: 8px; width: 1px; background: rgba(255, 255, 255, .09); }
.navgrp.open .sub { display: block; }
.nav.child { padding: 6px 11px 6px 39px; font-size: 12.9px; color: #93a8c7; position: relative; }
.nav.child.on { background: rgba(64, 132, 230, .16); color: #fff; }
.nav.child.on::before { content: ''; position: absolute; left: 18px; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: #6aa9ff; }
.nav mark { background: rgba(217, 181, 106, .35); color: #fff; border-radius: 2px; }
.nav-empty { padding: 12px; font-size: 12px; color: var(--side-ink-2); }

body.collapsed .side .brand .word small, body.collapsed .side-search, body.collapsed .nav span,
body.collapsed .nav.grp em, body.collapsed .navgrp .sub, body.collapsed .side-foot .txt { display: none !important; }
body.collapsed .side .brand { justify-content: center; padding: 22px 0 18px; flex-direction: column; gap: 14px; }
body.collapsed .side .brand .word { letter-spacing: .12em; font-size: 13px; }
body.collapsed .nav { justify-content: center; padding: 10px 0; }

.side-foot {
  padding: 12px 18px 16px; border-top: 1px solid rgba(255, 255, 255, .06);
  display: flex; align-items: center; gap: 9px; font-size: 11.5px; color: var(--side-ink-2);
}
.side-foot .dot { width: 7px; height: 7px; border-radius: 50%; background: #39d98a; box-shadow: 0 0 0 3px rgba(57, 217, 138, .18); flex: 0 0 auto; }
.side-foot.down .dot { background: #ff6b5e; box-shadow: 0 0 0 3px rgba(255, 107, 94, .2); }
.side-foot .txt b { color: #d3def0; font-weight: 600; }
.side-foot .txt small { display: block; font-family: var(--mono); font-size: 10.5px; }

main { min-width: 0; display: flex; flex-direction: column; }

/* ------------------------------------------------------------- top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 30px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 15;
}
.topbar .titles { min-width: 0; }
.crumb { margin: 0 0 3px; font-size: 11px; color: var(--ink-3); letter-spacing: .03em; display: flex; gap: 6px; align-items: center; }
.crumb b { font-weight: 600; color: var(--ink-2); }
.crumb i { font-style: normal; opacity: .6; }
.topbar h1 { font-size: 20px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { margin: 2px 0 0; color: var(--ink-3); font-size: 12.5px; }
.topbar-right { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }

.chip {
  font-size: 11.5px; color: var(--ink-2); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 100px; padding: 4px 11px; white-space: nowrap;
}
.chip b { color: var(--ink); font-weight: 600; }
.chip-warn { background: var(--warn-bg); border-color: #f0ddb4; color: var(--warn); }
.chip-ok { background: var(--ok-bg); border-color: #bfe6d6; color: var(--ok); }

.user-btn {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); border-radius: 100px;
  padding: 4px 12px 4px 4px; font: inherit; color: var(--ink);
  transition: box-shadow .12s, border-color .12s;
}
.user-btn:hover { border-color: #cdd7e4; box-shadow: var(--shadow); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #2563b8, #1a4d8f); color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
}
.user-btn .who { text-align: left; line-height: 1.2; }
.user-btn .who b { display: block; font-size: 12.5px; font-weight: 600; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-btn .who small { display: block; font-size: 10.8px; color: var(--ink-3); }

.menu-pop {
  position: absolute; right: 30px; top: 64px; width: 300px; z-index: 30;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  overflow: hidden; animation: pop .14s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } }
.menu-pop header { padding: 16px 18px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); }
.menu-pop header b { display: block; font-size: 14px; }
.menu-pop header small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 1px; }
.menu-pop .roles { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.menu-pop .item {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent;
  font: inherit; font-size: 13px; color: var(--ink); padding: 11px 18px; cursor: pointer; text-align: left;
}
.menu-pop .item:hover { background: var(--surface-2); }
.menu-pop .item svg { width: 16px; height: 16px; color: var(--ink-3); }
.menu-pop .item.danger { color: var(--bad); }
.menu-pop .item.danger svg { color: var(--bad); }
.menu-pop .sep { height: 1px; background: var(--line-2); }

.view { padding: 24px 30px 56px; max-width: 1680px; width: 100%; }

.ro-banner {
  display: flex; align-items: center; gap: 10px;
  margin: -4px 0 18px; padding: 9px 14px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px dashed #c9d4e3; color: var(--ink-2); font-size: 12.5px;
}
.ro-banner svg { width: 15px; height: 15px; color: var(--ink-3); }

.denied { max-width: 520px; margin: 70px auto; text-align: center; }
.denied h2 { font-size: 19px; margin-bottom: 8px; }
.denied p { color: var(--ink-2); }
.denied .big { font-size: 13px; letter-spacing: .3em; color: var(--ink-3); margin-bottom: 16px; }

/* ================================================================= cards */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden;
}
.card > header {
  padding: 14px 18px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card > header h3 { font-size: 14px; font-weight: 650; }
.card > header .hint-inline { font-size: 11.5px; color: var(--ink-3); }
.body { padding: 16px 18px; }
.body.tight { padding: 0; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1150px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ================================================================== kpis */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 15px 17px 14px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi::after {
  content: ''; position: absolute; left: 17px; right: 17px; bottom: 0; height: 3px;
  border-radius: 3px 3px 0 0; background: var(--line-2);
}
.kpi.good::after { background: linear-gradient(90deg, var(--ok), #3fbf8e); }
.kpi.warn::after { background: linear-gradient(90deg, #c48a1a, #e8b54d); }
.kpi.bad::after { background: linear-gradient(90deg, var(--bad), #e0675c); }
.kpi.brand::after { background: linear-gradient(90deg, var(--brand), #4a8be0); }
.kpi.teal::after { background: linear-gradient(90deg, #0b8a7e, #2cc0b0); }
.kpi small { display: block; color: var(--ink-3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kpi strong { display: block; font-size: 25px; font-weight: 680; margin: 6px 0 2px; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 11.8px; color: var(--ink-2); }

/* ================================================================ tables */
table.t { width: 100%; border-collapse: collapse; font-size: 12.9px; }
table.t th {
  text-align: left; font-weight: 600; font-size: 10.8px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-3);
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2);
  white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
table.t td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tbody tr { transition: background .08s; }
table.t tbody tr:hover { background: #f8fafd; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover { background: var(--brand-soft); }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; }
table.t .mono { font-family: var(--mono); font-size: 12px; }
table.t td.empty { text-align: center; color: var(--ink-3); padding: 34px; }
.scroll { max-height: 560px; overflow: auto; }

/* ================================================================ badges */
.b {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 650; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 100px; background: var(--surface-3); color: var(--ink-2);
  text-transform: uppercase; white-space: nowrap; border: 1px solid transparent;
}
.b.ok { background: var(--ok-bg); color: var(--ok); }
.b.warn { background: var(--warn-bg); color: var(--warn); }
.b.bad { background: var(--bad-bg); color: var(--bad); }
.b.info { background: var(--info-bg); color: var(--info); }
.b.out { background: transparent; border-color: var(--line); }

/* =============================================================== buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 12.9px; font-weight: 600;
  padding: 8px 14px; border-radius: var(--r-sm); cursor: pointer;
  box-shadow: 0 1px 1px rgba(15, 29, 46, .03);
  transition: background .12s, border-color .12s, box-shadow .12s, filter .12s;
}
.btn:hover { background: var(--surface-2); border-color: #cbd5e2; }
.btn:focus-visible, .mini:focus-visible, .nav:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.btn.primary {
  background: linear-gradient(180deg, #2a68bd, var(--brand)); border-color: var(--brand); color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .14) inset, 0 4px 12px rgba(26, 77, 143, .22);
}
.btn.primary:hover { filter: brightness(1.07); background: linear-gradient(180deg, #2a68bd, var(--brand)); }
.btn.sm { padding: 5px 10px; font-size: 11.8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.row-end { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

/* ================================================================= forms */
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.form.one { grid-template-columns: 1fr; }
.f { display: flex; flex-direction: column; gap: 5px; }
.f > span { font-size: 11.5px; color: var(--ink-2); font-weight: 600; }
.f input, .f select {
  font: inherit; font-size: 13px; color: var(--ink);
  padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
.f input:hover, .f select:hover { border-color: #cdd7e4; }
.f input:focus, .f select:focus {
  outline: 0; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(37, 99, 184, .13);
}
.f small { font-size: 10.8px; color: var(--ink-3); }

/* ============================================== key / value description */
dl.kv { display: grid; grid-template-columns: minmax(150px, auto) 1fr; gap: 0; margin: 0; font-size: 12.9px; }
dl.kv dt { color: var(--ink-3); padding: 8px 14px 8px 0; border-bottom: 1px solid var(--line-2); }
dl.kv dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-weight: 500; }
dl.kv dt:last-of-type, dl.kv dd:last-of-type { border-bottom: 0; }
dl.kv dd .mono { font-family: var(--mono); font-size: 12px; }

/* ========================================= the rating waterfall */
.quote-head {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0;
  background: linear-gradient(100deg, var(--brand-ink), var(--brand-2)); color: #fff;
}
.quote-head > div { padding: 15px 18px; border-right: 1px solid rgba(255, 255, 255, .13); }
.quote-head > div:last-child { border-right: 0; }
.quote-head small { display: block; font-size: 10.5px; color: #b6cce4; text-transform: uppercase; letter-spacing: .05em; }
.quote-head strong { display: block; font-size: 19px; font-weight: 680; margin-top: 4px; letter-spacing: -.02em; }
.quote-head span { font-size: 11px; color: #a7c1dc; }

.cand { border-bottom: 1px solid var(--line-2); padding: 11px 18px; display: grid;
        grid-template-columns: 46px 1fr 110px 130px 150px; gap: 12px; align-items: center; font-size: 12.7px; }
.cand:last-child { border-bottom: 0; }
.cand.applied { background: #eef7f2; }
.cand.rejected { opacity: .55; }
.cand .cls { font-family: var(--mono); font-weight: 700; font-size: 13px; color: var(--brand); }
.cand .desc { color: var(--ink); }
.cand .desc em { font-style: normal; display: block; font-size: 11px; color: var(--bad); margin-top: 2px; }
.cand .n { text-align: right; font-variant-numeric: tabular-nums; }
.cand .amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.cand .tag { text-align: right; }
@media (max-width: 900px) { .cand { grid-template-columns: 40px 1fr; } .cand .n, .cand .amt, .cand .tag { text-align: left; } }

.bar-wrap { height: 5px; background: var(--line-2); border-radius: 100px; overflow: hidden; margin-top: 6px; }
.bar-wrap i { display: block; height: 100%; background: var(--brand-2); border-radius: 100px; }
.bar-wrap.win i { background: var(--ok); }

/* ================================================================ trace */
pre.trace {
  margin: 0; padding: 14px 18px; background: #0d1a2c; color: #cfe0f0;
  font-family: var(--mono); font-size: 11.6px; line-height: 1.75;
  overflow: auto; max-height: 340px; white-space: pre-wrap;
}
pre.trace .k { color: #7fd1b9; }

/* ============================================================= timeline */
ol.tl { list-style: none; margin: 0; padding: 4px 0; }
ol.tl li { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center;
           padding: 9px 18px 9px 34px; position: relative; font-size: 12.7px; }
ol.tl li::before {
  content: ''; position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 9px; height: 9px; border-radius: 50%; background: var(--ok);
}
ol.tl li::after { content: ''; position: absolute; left: 22px; top: 50%; bottom: -50%; width: 1px; background: var(--line); }
ol.tl li:last-child::after { display: none; }
ol.tl .code { font-family: var(--mono); font-weight: 700; color: var(--brand); }
ol.tl .when { color: var(--ink-3); font-family: var(--mono); font-size: 11.3px; }

.hint { font-size: 11.8px; color: var(--ink-3); margin: 10px 0 0; line-height: 1.6; }
.hint b, .hint strong { color: var(--ink-2); }

/* ================================================================ toasts */
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast {
  background: #13243a; color: #eaf2fa; font-size: 12.9px; padding: 12px 16px 12px 14px;
  border-radius: 10px; box-shadow: var(--shadow-lg); max-width: 400px;
  border-left: 3px solid #6aa9ff;
  animation: slide .18s ease-out;
}
.toast.ok { border-left-color: #3fd19a; }
.toast.bad { border-left-color: #ff6b5e; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .25s; }
@keyframes slide { from { opacity: 0; transform: translateY(8px); } }

.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line);
        border-top-color: var(--brand-2); border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

.center-note { text-align: center; color: var(--ink-3); padding: 48px 20px; font-size: 13px; }

/* Tabs used across screens. */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button {
  border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-3);
  padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand-2); }
.tabs button .count { margin-left: 6px; font-size: 11px; color: var(--ink-3); background: var(--surface-3); padding: 1px 7px; border-radius: 99px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; width: 280px; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; box-shadow: var(--shadow-lg); }
  .topbar { padding: 12px 16px; }
  .view { padding: 16px; }
  .user-btn .who { display: none; }
  .topbar .chip { display: none; }
  .hamburger { display: grid !important; }
}
.hamburger { display: none; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; margin-right: 6px; }
.hamburger svg { width: 18px; height: 18px; }

/* ===========================================================================
   Charts
   ======================================================================== */
.ct { width: 100%; height: auto; display: block; }
.ct-grid { stroke: #eef2f7; stroke-width: 1; }
.ct-ax { font-size: 10px; fill: #8798ad; }
.ct-sub2 { font-size: 9px; fill: #a9b6c6; }
.ct-val { font-size: 10px; fill: #fff; font-weight: 600; }
.ct-big { font-size: 19px; font-weight: 700; fill: #16202c; }
.ct-sub { font-size: 9.5px; fill: #8798ad; }
.chart-empty { display: grid; place-items: center; color: #8798ad; font-size: 12px; }

.chart-donut { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.chart-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 150px; }
.chart-legend li { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 3px 0; }
.chart-legend li i { width: 9px; height: 9px; border-radius: 2px; flex: 0 0 auto; }
.chart-legend li span { flex: 1; color: #51637a; }
.chart-legend li b { font-variant-numeric: tabular-nums; }
.chart-legend.row { display: flex; flex-wrap: wrap; gap: 14px; }
.chart-legend.row li { padding: 0; }

.chart-hbars { list-style: none; margin: 0; padding: 0; }
.chart-hbars li { display: grid; grid-template-columns: 150px 1fr 86px; gap: 10px;
                  align-items: center; padding: 5px 0; font-size: 12px; }
.hb-label { color: #51637a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { background: #eef2f7; border-radius: 100px; height: 9px; overflow: hidden; }
.hb-track i { display: block; height: 100%; border-radius: 100px; }
.hb-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.chart-stack .st-bar { display: flex; height: 16px; border-radius: 100px; overflow: hidden; background: #eef2f7; }
.chart-stack .st-bar i { display: block; height: 100%; }
.chart-stack .chart-legend { margin-top: 11px; }

.chart-gauge { display: grid; place-items: center; padding: 4px 0 10px; }

.mini-bar { position: relative; background: #eef2f7; border-radius: 100px; height: 14px; min-width: 70px; }
.mini-bar i { display: block; height: 100%; border-radius: 100px; }
.mini-bar em { position: absolute; inset: 0; display: grid; place-items: center;
               font-style: normal; font-size: 9.5px; font-weight: 700; color: #16202c; }

.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1150px) { .grid-2-1 { grid-template-columns: 1fr; } }

/* ===========================================================================
   Verdict banner, alerts, reason lists
   ======================================================================== */
.verdict { border-radius: var(--r); color: #fff; margin-bottom: 18px; overflow: hidden; box-shadow: var(--shadow); }
.verdict.ok { background: linear-gradient(100deg, #0e6b4d, #15926a); }
.verdict.warn { background: linear-gradient(100deg, #8a6210, #c08a1c); }
.verdict.bad { background: linear-gradient(100deg, #8e1d16, #c0362c); }
.v-main { padding: 14px 18px 12px; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.v-flag { font-size: 15px; font-weight: 700; letter-spacing: .05em; }
.v-sub { font-size: 12px; opacity: .85; }
.v-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
          border-top: 1px solid rgba(255, 255, 255, .17); }
.v-nums > div { padding: 11px 18px; border-right: 1px solid rgba(255, 255, 255, .13); }
.v-nums > div:last-child { border-right: 0; }
.v-nums small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; opacity: .72; }
.v-nums strong { display: block; font-size: 17px; font-weight: 680; margin-top: 3px; }
.v-nums span { font-size: 10.5px; opacity: .72; }

ul.alert-list { list-style: none; margin: 0; padding: 0; }
ul.alert-list li { padding: 10px 18px; border-bottom: 1px solid var(--line-2); font-size: 12.8px;
                   border-left: 3px solid var(--line); }
ul.alert-list li:last-child { border-bottom: 0; }
ul.alert-list li.bad { border-left-color: var(--bad); background: #fef7f6; }
ul.alert-list li.warn { border-left-color: var(--warn); background: #fffbf2; }
ul.alert-list li.info { border-left-color: var(--info); background: #f6faff; }
ul.alert-list a { color: inherit; text-decoration: none; }
ul.alert-list a:hover { text-decoration: underline; }

ol.reason-list { margin: 0; padding-left: 20px; font-size: 12.3px; color: #51637a; }
ol.reason-list li { padding: 3px 0; }

/* ===========================================================================
   Modal
   ======================================================================== */
.modal-back { position: fixed; inset: 0; background: rgba(8, 20, 38, .52); z-index: 40;
              display: grid; place-items: center; padding: 20px; backdrop-filter: blur(2px); }
.modal { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); animation: pop .16s ease-out;
         width: min(560px, 100%); max-height: 88vh; display: flex; flex-direction: column; }
.modal.wide { width: min(900px, 100%); }
.modal > header { padding: 16px 20px; border-bottom: 1px solid var(--line-2);
                  display: flex; justify-content: space-between; align-items: center; }
.modal > header h3 { font-size: 15px; }
.modal .x { border: 0; background: transparent; font-size: 22px; line-height: 1;
            color: var(--ink-3); cursor: pointer; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal > footer { padding: 12px 20px; border-top: 1px solid var(--line-2); border-radius: 0 0 16px 16px;
                  display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); }
.btn.danger, .mini.danger { color: var(--bad); border-color: #f0c9c5; }
.mini { font: inherit; font-size: 11px; padding: 3px 8px; border: 1px solid var(--line);
        background: #fff; border-radius: 5px; cursor: pointer; }
.mini:hover { background: var(--surface-2); }
.mini.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }

.checks { display: grid; gap: 8px; }
.chk { display: flex; gap: 10px; align-items: flex-start; padding: 9px 11px;
       border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; }
.chk:hover { background: var(--surface-2); }
.chk input { margin-top: 3px; }
.chk span { font-size: 12.6px; }
.chk small { display: block; color: var(--ink-3); font-size: 11.3px; margin-top: 1px; }

/* ===========================================================================
   Settings and the permission matrix
   ======================================================================== */
.settings { display: flex; flex-direction: column; }
.setting { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center;
           padding: 13px 18px; border-bottom: 1px solid var(--line-2); }
.setting:last-child { border-bottom: 0; }
.s-main label { font-size: 13px; display: flex; gap: 8px; align-items: center; }
.s-main p { margin: 3px 0 2px; font-size: 11.8px; color: var(--ink-2); max-width: 70ch; line-height: 1.55; }
.s-main small { font-size: 10.5px; color: var(--ink-3); }
.s-edit { display: flex; gap: 7px; align-items: center; }
.s-edit input, .s-edit select { font: inherit; font-size: 12.8px; padding: 7px 9px;
                                border: 1px solid var(--line); border-radius: var(--r-sm); width: 190px; }
.s-edit .unit { font-size: 11.5px; color: var(--ink-3); min-width: 42px; }
@media (max-width: 900px) { .setting { grid-template-columns: 1fr; } }

table.matrix th.rot { height: 94px; vertical-align: bottom; padding: 0 0 8px; width: 34px; }
table.matrix th.rot span { writing-mode: vertical-rl; transform: rotate(180deg);
                           font-size: 10px; letter-spacing: .04em; }
table.matrix tr.grp td { background: var(--surface-2); font-weight: 650; font-size: 11px;
                         text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
table.matrix .yes { color: var(--ok); font-size: 13px; }
table.matrix .no { color: #d8e0ea; }

.dim { color: var(--ink-3); }
.good { color: var(--ok); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }

/* ----------------------------------------------------------- flight screens */
/* A load factor is read at a glance, so it gets a bar. The thresholds are commercial:
   under 40 is a problem, over 95 means the next disruption has nowhere to put anybody. */
.lf { display: flex; align-items: center; gap: 7px; min-width: 104px; }
.lf-bar { height: 7px; border-radius: 99px; background: var(--info); min-width: 2px; }
.lf-bar.ok { background: var(--ok); }
.lf-bar.warn { background: #d8a33a; }
.lf-bar.bad { background: var(--bad); }
.lf b { font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.cabin-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line-2); }
.cabin-head small { display: block; color: var(--ink-3); font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em; }
.cabin-head strong { font-size: 19px; }
.cabin-head span { display: block; color: var(--ink-3); font-size: 11.5px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 6px; }
.muted { color: var(--ink-3); font-size: 12px; }

/* ------------------------------------------------------- reservation screens */
.flight-line { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 12px; }
.flight-line small { display: block; color: var(--ink-3); font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em; }
.flight-line strong { font-size: 15px; }

/* Booking classes are chosen by eye, letter first, so they are tiles rather than a dropdown.
   A disabled tile still shows: an agent needs to see that J is full, not that it vanished. */
.rbd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 7px; }
.rbd { display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 9px 6px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); cursor: pointer; font: inherit; }
.rbd:hover:not(.out) { border-color: var(--brand-2); background: #f3f8ff; }
.rbd b { font-size: 17px; font-family: var(--mono); color: var(--brand); }
.rbd .seats { font-size: 11.5px; color: var(--ok); font-weight: 600; }
.rbd .fare { font-size: 11px; color: var(--ink-3); }
.rbd.out { opacity: .45; cursor: not-allowed; }
.rbd.out .seats { color: var(--bad); }

.pax-row { display: grid; grid-template-columns: 86px 1fr 1fr 92px; gap: 8px;
  align-items: end; margin-bottom: 8px; }
.pax-tag { font-size: 11.5px; color: var(--ink-3); padding-bottom: 8px; }

.tkt { border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 10px 12px; margin-bottom: 10px; background: var(--surface-2); }
.tkt-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.tkt-head b:first-child { font-size: 13.5px; }
.tkt-head b:last-child { margin-left: auto; }

h4.sec { margin: 16px 0 8px; font-size: 12px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-3); }

details.trace { margin-top: 10px; }
details.trace summary { cursor: pointer; font-size: 12.5px; color: var(--brand-2); }
details.trace ol { margin: 8px 0 0; padding-left: 20px; color: var(--ink-2); font-size: 12.5px; }
details.trace li { margin: 3px 0; }

/* ------------------------------------------------------- departure control */
/* The barcode payload shown as what it is: a fixed width string where every character
   is positional. Monospaced and wrapped so the field boundaries can be counted. */
.bcbp { font-family: var(--mono); font-size: 13px; letter-spacing: .5px;
  background: #0d2744; color: #cfe0f2; padding: 12px 14px; border-radius: var(--r-sm);
  word-break: break-all; margin-bottom: 12px; }

.seatmap { display: flex; flex-direction: column; gap: 3px; margin-bottom: 14px; }
.smrow { display: flex; align-items: center; gap: 3px; }
.smrow .rn { width: 26px; text-align: right; font-size: 11px; color: var(--ink-3);
  font-family: var(--mono); }
.st { width: 23px; height: 23px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 4px; font-size: 10.5px;
  font-family: var(--mono); color: var(--ink-2); background: var(--surface); }
.st.win { border-color: #c5d8ec; }
.st.taken { background: var(--brand); border-color: var(--brand); color: #fff; }

.notice { display: block; padding: 11px 14px; border-radius: var(--r-sm); margin-bottom: 16px;
  font-size: 12.9px; background: var(--info-bg); color: #134a84; border: 1px solid #cfe0f5; }
.notice.info { background: var(--info-bg); color: #134a84; border-color: #cfe0f5; }
.notice.ok { background: var(--ok-bg); color: #0d6247; border-color: #c2e8d7; }
.notice.warn { background: var(--warn-bg); color: #7a4e07; border-color: #f0ddb4; }
.notice.bad { background: var(--bad-bg); color: #8e1d16; border-color: #f3c9c5; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; margin-bottom: 12px; }

/* --------------------------------------------------------- handling screens */
/* The turnaround chain reuses the portal's milestone styling and adds the one thing that
   matters operationally: critical steps are marked, because those are the ones that move
   the departure. */
.chain.turn li { grid-template-columns: 22px 1fr auto; align-items: start; }
.chain.turn li.done .dot, .chain.turn li.late .dot { background: var(--ok); border-color: var(--ok); }
.chain.turn li.late .dot { background: #d8a33a; border-color: #d8a33a; }
.chain.turn li.overdue .dot { background: var(--bad); border-color: var(--bad); }
.chain.turn li.overdue b { color: var(--bad); }
.chain.turn li.done b, .chain.turn li.late b { color: var(--ink); }
.chain.turn li.crit b small.mono { color: var(--bad); }
.chain.turn li em { color: var(--ink-2); }
.chain.turn li.late em { color: var(--warn); }

.memo-tot { display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; padding: 10px 12px; background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: var(--r-sm); margin: 8px 0 18px; }
.memo-tot > span { color: var(--ink-3); font-size: 12px; text-transform: uppercase;
  letter-spacing: .05em; padding-top: 3px; }
.memo-tot dl { display: grid; grid-template-columns: auto auto; gap: 2px 18px;
  margin: 0; text-align: right; }
.memo-tot dt { color: var(--ink-2); font-size: 12.5px; }
.memo-tot dd { margin: 0; font-variant-numeric: tabular-nums; font-size: 12.5px; }

/* ------------------------------------------------------------- load control */
/* The envelope plot. Two shapes and three dots is the whole of weight and balance for
   anybody who has never seen a loadsheet — so it gets to be large and uncluttered. */
.envelope { width: 100%; height: auto; display: block; }
.envelope .env { fill: #2a6cb514; stroke: var(--brand-2); stroke-width: 1.2; }
.envelope .env-1 { fill: #12805c12; stroke: var(--ok); stroke-dasharray: 4 3; }
.envelope .env-label { font-size: 10px; fill: var(--ink-3); }
.envelope .grid { stroke: var(--line-2); stroke-width: 1; }
.envelope .axis { font-size: 10px; fill: var(--ink-3); }
.envelope .axis-title { font-size: 10px; fill: var(--ink-3); }
.envelope .cg circle { fill: var(--brand); stroke: #fff; stroke-width: 2; }
.envelope .cg text { font-size: 10.5px; fill: var(--ink); font-weight: 600; }
.envelope .cg.out circle { fill: var(--bad); }
.envelope .cg.out text { fill: var(--bad); }

/* --------------------------------------------------------- revenue accounting */
/* The one picture that explains the module: most of what an airline has collected it has
   not yet earned, because it has not yet flown anybody. */
.liability-bar { display: flex; height: 22px; border-radius: var(--r-sm);
  overflow: hidden; background: var(--line-2); margin-bottom: 10px; }
.liability-bar span { display: block; height: 100%; }
.liability-bar .lia { background: linear-gradient(90deg, #d8a33a, #c08f2c); }
.liability-bar .earn { background: linear-gradient(90deg, #16936a, #12805c); }
.liability-bar .ref { background: var(--bad); }

.liability-key { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12.5px;
  color: var(--ink-2); margin-bottom: 4px; }
.liability-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px;
  margin-right: 5px; vertical-align: -1px; }
.liability-key .k-lia { background: #d8a33a; }
.liability-key .k-earn { background: var(--ok); }
.liability-key .k-ref { background: var(--bad); }

.jv { border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 9px 11px; margin-bottom: 9px; background: var(--surface-2); }
.jv-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 5px; font-size: 12.5px; color: var(--ink-2); }

/* ------------------------------------------------------------ Type-B messaging */
/* The wire format shown as what it is: fixed-width, positional, upper case. Rendering it
   in a proportional font would hide the one property that matters about it. */
.msg { border: 1px solid var(--line-2); border-radius: var(--r-sm);
  margin-bottom: 12px; overflow: hidden; }
.msg-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 11px; background: var(--surface-2); border-bottom: 1px solid var(--line-2);
  font-size: 12.5px; }
.wire { margin: 0; padding: 12px 14px; background: #0d2744; color: #cfe0f2;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-all; }

/* ------------------------------------------------------- travel documents */
.pax-block { border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 10px 12px; margin-bottom: 10px; background: var(--surface-2); }
.pax-block .form-grid { margin-bottom: 0; }

.doc-findings { margin-top: 10px; padding: 9px 12px; background: var(--surface-2);
  border-left: 3px solid var(--bad); border-radius: var(--r-sm); }
.doc-findings b { font-size: 13px; }
.doc-findings .reasons { margin-top: 4px; font-size: 12.5px; }
.warn-ink { color: var(--warn); }

/* =============================================================== interline */

/* The three rejection stages, shown as three pips rather than a number, because the point a
   clerk needs at a glance is how little room is left before the stages run out. */
.stage { display: inline-flex; align-items: center; gap: 4px; }
.stage i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--line); border: 1px solid var(--line);
}
.stage i.on { background: var(--warn); border-color: var(--warn); }
.stage.s3 i.on { background: var(--bad); border-color: var(--bad); }
.stage em { font-style: normal; font-size: 12px; color: var(--ink-2); margin-left: 2px; }

/* A letter or a printed rejection as the partner receives it — fixed pitch, because the
   alignment of the columns is part of the document. */
pre.print {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 14px 16px; margin: 0;
  white-space: pre-wrap; overflow-x: auto; color: var(--ink);
}

.memo-chain { list-style: none; margin: 0; padding: 0; }
.memo-chain li {
  padding: 10px 0 10px 16px; border-left: 2px solid var(--line-2); margin-left: 6px;
}
.memo-chain li + li { border-top: 0; }
.memo-chain li:last-child { border-left-color: var(--ok); }
.memo-chain li > div { color: var(--ink-2); font-size: 13px; margin-top: 3px; }

.sector-row {
  display: grid; grid-template-columns: 26px repeat(5, minmax(0, 1fr));
  gap: 10px; align-items: start; padding: 8px 0;
  border-bottom: 1px dashed var(--line-2);
}
.sector-row .seq {
  margin-top: 26px; text-align: center; font-family: var(--mono);
  color: var(--ink-3); font-size: 13px;
}

.slip-foot {
  display: flex; flex-wrap: wrap; gap: 22px;
  padding: 12px 18px 16px; border-top: 1px solid var(--line-2);
  font-size: 13px; color: var(--ink-2);
}
.slip-foot b { color: var(--ink); }

.f textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px 10px; width: 100%; resize: vertical;
}
.f textarea:focus { outline: 2px solid var(--brand-2); outline-offset: -1px; }

p.small, .small { font-size: 12.5px; color: var(--ink-2); }

/* A ticket number or an invoice number broken across three lines is unreadable. Inside a
   scrolling table these stay on one line and the table scrolls sideways instead. */
.scroll table.t .mono { white-space: nowrap; }

/* ======================================== flight document control */

/* The columns the control is read across: difference first, then LOD, then each kind of
   document that accounts for a seat. It is the paper form, laid out the same way. */
.control-strip {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px;
}
.control-strip .cs {
  flex: 1 1 110px; min-width: 110px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow);
  border-left: 3px solid var(--line);
}
.control-strip .cs small {
  display: block; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 650;
}
.control-strip .cs strong {
  display: block; font-size: 22px; line-height: 1.25; margin: 2px 0; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.control-strip .cs span { font-size: 11.5px; color: var(--ink-2); }
.control-strip .cs.ok { border-left-color: var(--ok); }
.control-strip .cs.ok strong { color: var(--ok); }
.control-strip .cs.warn { border-left-color: var(--warn); }
.control-strip .cs.warn strong { color: var(--warn); }
.control-strip .cs.bad { border-left-color: var(--bad); }
.control-strip .cs.bad strong { color: var(--bad); }
.control-strip .cs.nil strong { color: var(--ink-3); }

.msg-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }

/* A class count on the traffic report: M31 rather than a column per class, because the
   classes differ by flight and a fixed column set would be mostly empty. */
.rbkd {
  display: inline-block; font-family: var(--mono); font-size: 11px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 5px; margin: 1px 3px 1px 0; color: var(--ink-2);
}
.rbkd em { font-style: normal; color: var(--ink); font-weight: 650; }

.kpis.small-kpis .kpi strong { font-size: 20px; }

/* ================================================ base data and agent accounts */

/* The header strip of the agent transaction screen: name, currency and the two balances
   the agency checks before it sells anything. */
.account-strip {
  display: flex; flex-wrap: wrap; gap: 26px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px 18px; box-shadow: var(--shadow);
}
.account-strip span { display: flex; flex-direction: column; gap: 2px; }
.account-strip small {
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 650;
}
.account-strip b { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* The remittance statement, laid out as the printed one is. */
.statement-doc {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px 26px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.statement-doc > header { text-align: center; border-bottom: 1px solid var(--line); }
.statement-doc h2 {
  margin: 0 0 14px; font-size: 17px; letter-spacing: .04em; color: var(--brand-ink);
}
.statement-head {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 32px; padding: 14px 0 16px;
}
.statement-head div { display: flex; gap: 10px; align-items: baseline; }
.statement-head small {
  min-width: 118px; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 650;
}
.statement-head b { font-size: 13px; color: var(--ink); }

table.t.statement { font-size: 12.5px; }
table.t.statement td { padding: 6px 10px; border-bottom: 1px solid var(--line-2); }
table.t.statement tr.em td { background: var(--surface-2); font-weight: 650; }
table.t.statement.head th { padding: 8px 10px; }

.statement-foot {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 24px; padding: 14px 0; margin-top: 10px;
  border-top: 1px solid var(--line);
}
.statement-foot div { display: flex; flex-direction: column; }
.statement-foot small { font-size: 11px; color: var(--ink-2); }
.statement-foot b { font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Printing a statement prints the statement, not the application around it. */
@media print {
  .side, #nav, .topbar, .ro-banner, .row-actions, .card:not(.statement-doc) { display: none !important; }
  .statement-doc { border: 0; box-shadow: none; padding: 0; }
}

details > summary {
  cursor: pointer; font-size: 12.5px; color: var(--ink-2);
  padding: 6px 0; user-select: none;
}
details > summary:hover { color: var(--brand); }

/* The break point tick on the rate book. */
.tick { font-size: 15px; color: var(--ink-3); }
.tick.on { color: var(--ok); font-weight: 700; }

/* ======================================================= roles and module access */
.role-list { display: flex; flex-direction: column; }
.role-item {
  display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; text-align: left;
  border: 0; border-bottom: 1px solid var(--line-2); background: transparent; font: inherit;
  padding: 11px 18px; cursor: pointer; border-left: 3px solid transparent;
}
.role-item:hover { background: var(--surface-2); }
.role-item.on { background: var(--brand-soft); border-left-color: var(--brand-2); }
.role-item b { font-size: 13px; }
.role-item .mono { font-size: 10.5px; color: var(--ink-3); align-self: center; }
.role-item small { grid-column: 1 / -1; color: var(--ink-3); font-size: 11.5px; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 11.5px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { color: var(--ink-2); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.lv-View { --lv: #8aa0bd; }
.lv-Edit { --lv: #2563b8; }
.lv-Approve { --lv: #12805c; }
.lv-Admin { --lv: #b7791f; }
.legend i { background: var(--lv); }

.grant-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); }
.grant-group { padding: 14px 18px 10px; border-bottom: 1px solid var(--line-2); }
.grant-group h5 { margin: 0 0 6px; font-size: 10.8px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.grant-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px dashed var(--line-2); }
.grant-row:last-child { border-bottom: 0; }
.grant-row b { font-size: 12.9px; font-weight: 600; }
.grant-row small { display: block; font-size: 11.3px; color: var(--ink-3); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: 0 0 auto; background: var(--surface-2); }
.seg button {
  border: 0; background: transparent; font: inherit; font-size: 11px; font-weight: 600; color: var(--ink-3);
  padding: 5px 9px; cursor: pointer; border-right: 1px solid var(--line-2);
}
.seg button:last-child { border-right: 0; }
.seg button:hover:not(:disabled) { background: #fff; color: var(--ink); }
.seg button.on { color: #fff; background: var(--lv, #8aa0bd); }
.seg button.on.lv-None { background: #e7ecf3; color: var(--ink-2); }
.seg.locked button { cursor: default; }
.seg.locked button:not(.on) { opacity: .55; }

.lvl { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--lv); }
table.matrix td { padding: 6px 8px; }

/* ================================================================ dashboard */
.hello {
  display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 22px; align-items: center;
  padding: 22px 24px; margin-bottom: 24px; border-radius: 16px; color: #e8f0fb;
  background:
    radial-gradient(600px 240px at 100% 0%, rgba(217, 181, 106, .16), transparent 70%),
    radial-gradient(500px 260px at 0% 100%, rgba(64, 132, 230, .30), transparent 70%),
    linear-gradient(135deg, #12315c, #0b1f3c);
  box-shadow: var(--shadow-md);
}
.hello-text small { color: #8fa9cc; font-size: 12px; letter-spacing: .03em; }
.hello-text h2 { color: #fff; font-size: 24px; font-weight: 600; margin: 6px 0 4px; letter-spacing: -.01em; }
.hello-text p { margin: 0; color: #b6c8e2; font-size: 13px; }
.hello-text p span { color: #7f97ba; }
.launch { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.launch-tile {
  display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: #fff;
  padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08); transition: background .14s, transform .14s, border-color .14s;
}
.launch-tile:hover { background: rgba(255, 255, 255, .12); border-color: rgba(143, 192, 255, .4); transform: translateY(-1px); }
.launch-tile .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(143, 192, 255, .14); color: #a9cdff; margin-bottom: 6px; }
.launch-tile .ic svg { width: 17px; height: 17px; }
.launch-tile b { font-size: 13.5px; font-weight: 600; }
.launch-tile small { font-size: 11px; color: #8fa9cc; line-height: 1.4; }
.dash-h { display: flex; align-items: baseline; justify-content: space-between; font-size: 15px; margin: 6px 0 14px; color: var(--ink); }
.dash-h a { font-size: 12px; font-weight: 600; text-decoration: none; }
@media (max-width: 1100px) { .hello { grid-template-columns: 1fr; } }

/* ============================================================ sales periods */
.period-strip { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.period {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 7px 9px;
  font: inherit; cursor: pointer; text-align: left; transition: border-color .12s, background .12s;
}
.period:hover { border-color: #b9c8dc; }
.period b { font: 700 13px var(--mono); color: var(--brand); }
.period small { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.period i { position: absolute; top: 6px; right: 7px; font-style: normal; font-size: 10px; font-weight: 700; color: var(--ink-2); }
.period.cur { border-color: var(--brand-2); box-shadow: 0 0 0 2px rgba(37, 99, 184, .12); }
.period.future { opacity: .5; }
.period.on { background: var(--brand-soft); border-color: var(--brand-2); }
@media (max-width: 1100px) { .period-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ================================================================ fares */
.tariff-kpi { text-align: left; font: inherit; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.tariff-kpi strong { font-size: 16px; }
.tariff-kpi:hover { border-color: #b9c8dc; }
.tariff-kpi.on { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(37, 99, 184, .12); }
table.fare-grid th, table.fare-grid td { padding: 6px 8px; font-size: 12px; }
table.fare-grid td:first-child { position: sticky; left: 0; background: var(--surface); }
table.t.statement.rtrd th { background: #f6e9ec; color: var(--ink-2); }
table.t.statement.rtrd tbody tr:nth-child(even) td { background: #fbf6f7; }
.statement-foot.sign { margin-top: 30px; border-top: 0; }

/* ================================================================ SkyGift */
.tier-chip { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  color: #fff; background: var(--tc); }
.ffp-card { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding: 22px 26px; margin-bottom: 18px;
  border-radius: 16px; color: #fff; box-shadow: var(--shadow-md);
  background: radial-gradient(400px 200px at 100% 0%, rgba(255,255,255,.18), transparent 70%), linear-gradient(135deg, var(--tc), #0b1f3c); }
.ffp-card small { display: block; font-size: 10.5px; letter-spacing: .3em; opacity: .75; }
.ffp-card b { display: block; font-size: 20px; margin: 8px 0 4px; letter-spacing: .04em; }
.ffp-card span { display: block; font-size: 13px; opacity: .9; }
.ffp-card .right { text-align: right; }
.ffp-card em { display: block; font-style: normal; font-size: 22px; font-weight: 700; letter-spacing: .2em; }
.chain-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.chain-tkt { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--surface-2); }
.chain-tkt.on { border-color: var(--brand-2); background: var(--brand-soft); }
.chain-tkt small { display: block; font-size: 11px; color: var(--ink-3); }
.chain-arrow { color: var(--ink-3); font-size: 18px; }
.flt-row { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr auto; gap: 6px; margin-bottom: 6px; align-items: center; }
.flt-row:has([data-fval2]) { grid-template-columns: 1fr 1fr auto; }
.flt-row:has([data-fval2]) [data-ffield] { grid-area: 1 / 1; }
.flt-row:has([data-fval2]) [data-fop] { grid-area: 1 / 2; }
.flt-row:has([data-fval2]) [data-del] { grid-area: 1 / 3; }
.flt-row:has([data-fval2]) [data-fval] { grid-area: 2 / 1; }
.flt-row:has([data-fval2]) [data-fval2] { grid-area: 2 / 2; }
.flt-row select, .flt-row input { font: inherit; font-size: 12px; padding: 6px 7px; border: 1px solid var(--line); border-radius: 7px; min-width: 0; }
table.t.psr th { background: #2c2f36; color: #fff; }

/* ---- airmail forms: the post's own layouts ---- */
.mail-doc { margin-bottom: 18px; }
.mail-airline { text-align: center; line-height: 1.25; }
.mail-airline b { display: block; font-size: 20px; letter-spacing: .04em; }
.mail-airline span { font-size: 12px; letter-spacing: .03em; }
.mail-form-no { text-align: right; font-size: 22px; font-weight: 700; margin-top: -6px; }
.mail-sub { text-align: right; font-size: 12px; } .mail-sub b { display: block; font-size: 16px; }
.mail-title { display: block; text-align: center; font-size: 22px; letter-spacing: .12em; }
.mail-co { text-align: center; font-size: 26px; letter-spacing: .08em; margin: 14px 0 6px; }
table.t.mail-grid { border: 1px solid var(--line); margin-top: 8px; }
table.t.mail-grid td, table.t.mail-grid th { border: 1px solid var(--line); padding: 5px 7px; }
table.t.mail-grid.head td { vertical-align: top; }
table.t.mail-grid.fa { direction: rtl; }
.fa-head { text-align: center; line-height: 1.5; } .fa-head b { display: block; font-size: 18px; } .fa-head span { font-weight: 600; }
.sign { display: flex; flex-direction: column; align-items: center; margin: 22px 0 0 auto; width: 240px; border-top: 1px dashed var(--line); padding-top: 8px; }
.rate-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 18px 16px; }
.rate-chips span { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-variant-numeric: tabular-nums; }
@media print { .noprint { display: none !important; } }

.rtrd-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.barcode-img { height: 52px; }
.commercial-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px; }
.commercial-chips > span { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 12px; }
.commercial-chips > span small { display: block; color: var(--muted, #6b7280); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.tax-invoice { direction: rtl; } .tax-invoice table.t td, .tax-invoice table.t th { border: 1px solid var(--line); padding: 6px 8px; }

.bar { height: 6px; background: var(--line-2, #eef1f6); border-radius: 4px; overflow: hidden; min-width: 70px; }
.bar i { display: block; height: 100%; }

.grant-group h5 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.group-seg { transform: scale(.85); transform-origin: right center; }
.group-seg button { font-size: 10.5px; }

/* A table wider than its card scrolls inside the card instead of being cut off at the edge. */
.card > .body { overflow-x: auto; }
.grid2 > *, .grid-2-1 > * { min-width: 0; }
.grid2.wide-left { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.nowrap { white-space: nowrap; }
@media (max-width: 1100px) { .grid2.wide-left { grid-template-columns: 1fr; } }
