/* Cargo Enquiry Tracker — UI
   Palette: validated reference palette (categorical slots 1-4 for the pipeline, fixed status
   colours for timers/alerts — always paired with an icon + label). Light + dark both selected. */

:root {
  color-scheme: light;
  --page: #f4f5f2;
  --surface: #fcfcfb;
  --surface-2: #f3f3f0;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --line: #e1e0d9;
  --ring: rgba(11, 11, 11, .10);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -12px rgba(16, 24, 40, .18);
  --accent: #2a78d6;
  --accent-soft: #cde2fb;
  --accent-ink: #1c5cab;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;   /* categorical slots */
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --good-soft: #e3f5e3; --warning-soft: #fef3d7; --critical-soft: #fbe4e4;
  --good-ink: #006300; --warning-ink: #8a5a00; --critical-ink: #a32424;
  --side: #0f1b2d; --side-2: #16263d; --side-ink: #c9d4e3; --side-muted: #7f8ea5;
  --hero: linear-gradient(135deg, #0f1b2d 0%, #1c3d6e 55%, #2a78d6 100%);
  --radius: 14px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #222220;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --line: #2c2c2a;
  --ring: rgba(255, 255, 255, .10);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -14px rgba(0, 0, 0, .7);
  --accent: #3987e5;
  --accent-soft: #184f95;
  --accent-ink: #86b6ef;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --good-soft: #10301a; --warning-soft: #3a2c08; --critical-soft: #3a1515;
  --good-ink: #0ca30c; --warning-ink: #fab219; --critical-ink: #f08a8a;
  --side: #070b12; --side-2: #111a28;
  --hero: linear-gradient(135deg, #070b12 0%, #12294a 55%, #1c5cab 100%);
}

* { box-sizing: border-box; }
html.loading::before { content: ""; position: fixed; z-index: 1000; top: 0; left: 0; height: 3px; width: 40%;
  background: linear-gradient(90deg, var(--accent), var(--s3)); animation: loadbar 1s ease-in-out infinite; }
@keyframes loadbar { 0% { left: -40%; } 100% { left: 100%; } }
html.loading { cursor: progress; }
button:disabled { opacity: .6; cursor: progress; }
.hint-line { font-size: 12.5px; color: var(--ink-2); display: flex; gap: 6px; align-items: flex-start;
  background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 8px; padding: 7px 10px; }
.hint-line .icon { color: var(--accent); margin-top: 1px; }
.guide h2 { font-size: 17px; margin: 0 0 10px; display: flex; gap: 8px; align-items: center; }
.guide ol, .guide ul { margin: 0; padding-left: 20px; } .guide li { margin: 6px 0; }
.steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px 12px; counter-reset: st; padding-top: 8px; }
.step { border: 1px solid var(--ring); border-radius: 12px; padding: 16px 14px 14px; background: var(--surface); position: relative; }
.step::before { counter-increment: st; content: counter(st); position: absolute; top: -11px; left: 12px; width: 24px; height: 24px;
  border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.step b { display: block; margin: 2px 0 4px; } .step span { font-size: 13px; color: var(--ink-2); }
.guide table td, .guide table th { vertical-align: top; }
kbd { font: 600 12px system-ui; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
html, body { margin: 0; }
body {
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page); color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.muted { color: var(--muted); } .ink2 { color: var(--ink-2); } .small { font-size: 12px; }
.num, td.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
        stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.icon.sm { width: 14px; height: 14px; vertical-align: -2px; }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side {
  background: var(--side); color: var(--side-ink); padding: 20px 16px; display: flex; flex-direction: column;
  gap: 18px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; color: #fff; }
.brand .logo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
               background: linear-gradient(135deg, #2a78d6, #1baf7a); box-shadow: 0 6px 18px -6px #2a78d6; }
.brand .logo .icon { stroke: #fff; width: 20px; height: 20px; }
.brand b { display: block; font-size: 15px; }
.brand span { font-size: 11px; color: var(--side-muted); text-transform: uppercase; letter-spacing: .08em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--side-ink); }
.nav a:hover { background: var(--side-2); text-decoration: none; color: #fff; }
.nav a.on { background: var(--side-2); color: #fff; box-shadow: inset 3px 0 0 #3987e5; }
.nav .count { margin-left: auto; background: #d03b3b; color: #fff; font-size: 11px; font-weight: 700;
              border-radius: 999px; padding: 0 7px; line-height: 18px; }
.side-card { background: var(--side-2); border-radius: 12px; padding: 12px; font-size: 12px; }
.side-card .label { color: var(--side-muted); text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }
.side-card .clock { font-size: 20px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.side-card input { width: 100%; margin: 8px 0 6px; background: #0b1422; color: #fff; border: 1px solid #2a3b55;
                   border-radius: 8px; padding: 6px 8px; font: inherit; color-scheme: dark; }
.side-card .btn { width: 100%; justify-content: center; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: var(--side-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
          color: #fff; background: linear-gradient(135deg, #6250d6, #2a78d6); flex: none; }
.user-chip .who { line-height: 1.2; } .user-chip .who b { color: #fff; display: block; }
.user-chip .who span { font-size: 11px; color: var(--side-muted); }
.user-chip a { margin-left: auto; color: var(--side-muted); } .user-chip a:hover { color: #fff; }
.theme-btn { background: none; border: 1px solid #2a3b55; color: var(--side-ink); border-radius: 10px; padding: 7px 10px;
             display: flex; gap: 8px; align-items: center; cursor: pointer; font: inherit; }
.theme-btn:hover { color: #fff; border-color: #3d5375; }

.main { min-width: 0; padding: 24px 28px 48px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 24px; }
.page-head .sub { color: var(--muted); }
.page-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.flash { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--ring);
         border-left: 4px solid var(--good); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; box-shadow: var(--shadow); }
.flash.bad { border-left-color: var(--critical); }

/* ------------------------------------------------------------------ building blocks */
.card { background: var(--surface); border: 1px solid var(--ring); border-radius: var(--radius); box-shadow: var(--shadow);
        padding: 18px 20px; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { font-size: 16px; display: flex; gap: 8px; align-items: center; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.grid.split { grid-template-columns: minmax(0, 1fr) 320px; }
.grid > *, .kpis > *, .actions-grid > * { min-width: 0; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface);
       color: var(--ink); border-radius: 9px; padding: 6px 12px; cursor: pointer; font: 500 13px/1.3 inherit;
       font-family: inherit; transition: transform .08s, box-shadow .15s, background .15s; }
.btn:hover { box-shadow: 0 2px 8px -2px rgba(0,0,0,.18); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.danger { background: var(--critical); border-color: var(--critical); color: #fff; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; justify-content: center; padding: 9px 12px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
                          border-radius: 9px; padding: 6px 10px; }
input:focus, select:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 10px; font-size: 12px;
         font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--ring); }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.s-open { color: var(--s1); } .badge.s-offered, .badge.s-negotiating { color: var(--s2); }
.badge.s-won { color: var(--s3); } .badge.s-lost { color: var(--s4); }
.badge.s-open, .badge.s-offered, .badge.s-negotiating, .badge.s-won, .badge.s-lost { background: var(--surface); }
.badge.s-open span, .badge.s-offered span, .badge.s-negotiating span, .badge.s-won span, .badge.s-lost span { color: var(--ink); }
.badge.sugg { border-style: dashed; border-color: var(--muted); }
.badge.flag { background: var(--critical-soft); color: var(--critical-ink); border-color: transparent; }
.badge.ok { background: var(--good-soft); color: var(--good-ink); border-color: transparent; }
.badge.warn { background: var(--warning-soft); color: var(--warning-ink); border-color: transparent; }
.warn-text { color: var(--critical-ink); font-weight: 600; }

/* ------------------------------------------------------------------ hero */
.hero { background: var(--hero); color: #fff; border-radius: 18px; padding: 22px 26px; position: relative; overflow: hidden;
        margin-bottom: 18px; box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 340px; height: 340px; border-radius: 50%;
               background: radial-gradient(circle, rgba(255,255,255,.16), transparent 65%); pointer-events: none; }
.hero .arc { position: absolute; right: 24px; bottom: 0; opacity: .35; pointer-events: none; }
.hero h1 { font-size: 26px; }
.hero .sub { color: rgba(255,255,255,.75); }
.hero .periods { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; position: relative; z-index: 1; }
.pill-link { padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; font-size: 13px;
             border: 1px solid rgba(255,255,255,.18); }
.pill-link:hover { background: rgba(255,255,255,.22); text-decoration: none; }
.pill-link.on { background: #fff; color: #0f1b2d; font-weight: 600; }
.hero details { display: inline-block; }
.hero details summary { list-style: none; cursor: pointer; }
.hero details[open] form { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.hero details input { background: rgba(255,255,255,.95); color: #0b0b0b; border: 0; padding: 4px 8px; }

/* ------------------------------------------------------------------ KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--ring); border-radius: var(--radius); padding: 14px 16px;
        box-shadow: var(--shadow); position: relative; overflow: hidden; }
.tile .label { color: var(--ink-2); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.tile .label .ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.tile .value { font-size: 30px; font-weight: 650; margin-top: 6px; line-height: 1.1; }
.tile .foot { color: var(--muted); font-size: 12px; margin-top: 4px; }
.tile .key { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.tile.money .value { font-size: 22px; margin: 0; }
.tile.money .row { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 8px; flex-wrap: wrap; }
.tile.money .row .wrap { white-space: normal; text-align: right; }
td.t { white-space: nowrap; }
.tile.money .row + .row { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }

.ring-tile { display: flex; align-items: center; gap: 14px; }
.ring { --p: 0; width: 74px; height: 74px; border-radius: 50%; flex: none; display: grid; place-items: center;
        background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--accent-soft) 0); }
.ring::before { content: ""; width: 56px; height: 56px; border-radius: 50%; background: var(--surface); grid-area: 1 / 1; }
.ring b { grid-area: 1 / 1; font-size: 16px; position: relative; }

/* ------------------------------------------------------------------ pipeline segmented bar */
.segbar { display: flex; gap: 2px; height: 28px; margin: 4px 0 10px; }
.segbar .part { border-radius: 4px; display: flex; align-items: center; padding: 0 8px; color: #fff; font-size: 12px;
                font-weight: 600; min-width: 0; overflow: hidden; white-space: nowrap; }
.segbar .part.p4 { color: #0b0b0b; }
.segbar .empty { flex: 1; border-radius: 4px; background: var(--surface-2); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.p1 { background: var(--s1); } .p2 { background: var(--s2); } .p3 { background: var(--s3); } .p4 { background: var(--s4); }

/* ------------------------------------------------------------------ action cards */
.pulse { position: relative; display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 999px;
         background: var(--critical); color: #fff; font-size: 13px; font-weight: 700; padding: 0 8px; }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 rgba(208,59,59,.55);
                animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(208,59,59,0); } 100% { box-shadow: 0 0 0 0 rgba(208,59,59,0); } }
@media (prefers-reduced-motion: reduce) { .pulse::after { animation: none; } }
.actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.act { border: 1px solid var(--ring); border-radius: 12px; background: var(--surface); padding: 14px 16px 12px;
       display: flex; flex-direction: column; gap: 10px; position: relative; border-top: 4px solid var(--muted); }
.act.k-result.won { border-top-color: var(--s3); } .act.k-result.lost { border-top-color: var(--s4); }
.act.k-autolost { border-top-color: var(--serious); } .act.k-flags { border-top-color: var(--critical); }
.act.k-escalation { border-top-color: var(--warning); } .act.k-unmatched { border-top-color: var(--s1); }
.act .top { display: flex; align-items: center; gap: 8px; }
.act .num-chip { font-size: 11px; color: var(--muted); font-weight: 700; }
.act .type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.act .who { font-weight: 600; } .act .who a { color: var(--ink); }
.act .route { color: var(--muted); font-size: 12.5px; }
.act .suggest { font-size: 18px; font-weight: 650; }
.act .suggest small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.quote { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-size: 13px;
         border-left: 3px solid var(--line); }
.quote .src { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.act .ops { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: auto; }
.act .ops form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; }
.act details > summary, .flag-item details > summary { list-style: none; } .act details > summary::-webkit-details-marker { display: none; }
.act details[open], .flag-item details[open] { flex-basis: 100%; }
.act details[open] > form, .flag-item details[open] > form { margin-top: 8px; padding: 10px; border-radius: 10px; background: var(--surface-2); display: flex; flex-wrap: wrap; gap: 6px; }
.flag-item { padding: 10px 0; border-top: 1px dashed var(--line); font-size: 13px; }
.flag-item:first-of-type { border-top: 0; padding-top: 0; }
.flag-item b { display: flex; gap: 6px; align-items: center; color: var(--critical-ink); }
.flag-item .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.empty-state { text-align: center; padding: 28px 10px; color: var(--muted); }
.empty-state .icon { width: 36px; height: 36px; color: var(--good); }

/* ------------------------------------------------------------------ table */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 10px 10px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
th { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
th a { color: inherit; } th a:hover { color: var(--ink); text-decoration: none; }
tbody tr { transition: background .12s; }
tr.row { cursor: pointer; } tr.row:hover { background: var(--surface-2); }
td .id { font-weight: 650; color: var(--ink); white-space: nowrap; }
td .cust { font-weight: 550; }
.route-cell { white-space: nowrap; font-weight: 600; letter-spacing: .02em; }
.route-cell .icon { color: var(--muted); margin: 0 4px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters input, .filters select { padding: 6px 10px; }
.filters label { font-size: 12px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }

.meter { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.meter .bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter .bar i { display: block; height: 100%; border-radius: 999px; }
.meter.green .bar { background: var(--good-soft); } .meter.green .bar i { background: var(--good); }
.meter.amber .bar { background: var(--warning-soft); } .meter.amber .bar i { background: var(--warning); }
.meter.red .bar { background: var(--critical-soft); } .meter.red .bar i { background: var(--critical); }
.meter .lbl { font-size: 12.5px; font-weight: 600; white-space: nowrap; }

/* ------------------------------------------------------------------ enquiry detail */
.route-hero { display: flex; align-items: center; gap: 18px; margin: 14px 0 8px; position: relative; z-index: 1; }
.route-hero .code { font-size: 38px; font-weight: 700; letter-spacing: .04em; line-height: 1; }
.route-hero .path { flex: 1; max-width: 320px; height: 2px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.7) 0 8px, transparent 8px 14px);
                    position: relative; }
.route-hero .path .icon { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(45deg); width: 22px; height: 22px;
                          color: #fff; background: #1c3d6e; border-radius: 50%; padding: 3px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; position: relative; z-index: 1; }
.chip { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 3px 12px; font-size: 12.5px; }
.chip b { font-weight: 650; }
.hero .status-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; position: relative; z-index: 1; }
.hero .badge { background: rgba(255,255,255,.95); }
.hero .meter .bar { background: rgba(255,255,255,.2); } .hero .meter .lbl { color: #fff; }

.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl li { position: relative; padding: 0 0 14px 40px; }
.tl li .node { position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
               background: var(--surface); border: 2px solid var(--line); color: var(--ink-2); }
.tl li .node .icon { width: 14px; height: 14px; }
.tl li.k-whatsapp .node, .tl li.k-forward .node { border-color: var(--s3); color: var(--s3); }
.tl li.k-rfq .node, .tl li.k-quote .node { border-color: var(--s1); color: var(--s1); }
.tl li.k-offer .node { border-color: var(--s2); color: var(--s2); }
.tl li.k-reply .node { border-color: var(--ink-2); }
.tl li.k-timer .node, .tl li.k-flag .node { border-color: var(--critical); color: var(--critical); }
.tl li.k-confirmation .node, .tl li.k-correction .node, .tl li.k-flag_ok .node { border-color: var(--good); color: var(--good); }
.tl .when { font-size: 12px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.tl .what { font-weight: 550; }
.tl .detail { color: var(--ink-2); font-size: 13px; }

.sum-line { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.sum-line:last-child { border-bottom: 0; }
.sum-line .w { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.sum-line.system { background: linear-gradient(90deg, var(--surface-2), transparent); border-radius: 8px; padding-left: 8px; margin: 2px 0; border-bottom: 0; }
.sum-line.system .w { color: var(--accent-ink); }
.sum-line.flagline { background: linear-gradient(90deg, var(--critical-soft), transparent); }
.sum-line.flagline .w { color: var(--critical-ink); }
.origin-tag { font-size: 11px; color: var(--muted); font-weight: 500; }

/* rounds chart: buying vs selling, one row per round */
.rounds-chart { display: flex; flex-direction: column; gap: 14px; }
.rc-row { display: grid; grid-template-columns: 70px 1fr; gap: 10px; align-items: center; }
.rc-row .rn { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.rc-bars { display: flex; flex-direction: column; gap: 2px; }
.rc-bar { height: 14px; border-radius: 0 4px 4px 0; position: relative; min-width: 2px; }
.rc-bar.buy { background: var(--s1); } .rc-bar.sell { background: var(--s2); }
.rc-bar.unknown { background: repeating-linear-gradient(45deg, var(--surface-2) 0 6px, var(--line) 6px 8px); border-radius: 4px; }
.rc-vals { font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.rc-vals b { color: var(--ink); }
.rc-axis { height: 1px; background: var(--line); }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
pre.code { background: #0f172a; color: #e2e8f0; padding: 12px; border-radius: 10px; overflow: auto; white-space: pre-wrap; font-size: 12.5px; }
.msg { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; white-space: pre-wrap; font-size: 14px; }
.msg.wa { background: #dcf8c6; color: #0b0b0b; border-radius: 4px 14px 14px 14px; max-width: 560px; }
:root[data-theme="dark"] .msg.wa { background: #1f3d2a; color: #f0efec; }

/* ------------------------------------------------------------------ report */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.rep { border: 1px solid var(--ring); border-radius: 12px; padding: 14px 16px; background: var(--surface); }
.rep .k { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.rep .v { font-size: 26px; font-weight: 650; margin: 4px 0 2px; }
.rep .d { font-size: 12.5px; color: var(--ink-2); }
.report-body table td, .report-body table th { border: 1px solid var(--line); }

/* ------------------------------------------------------------------ login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: var(--hero); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
             position: relative; overflow: hidden; }
.login-art h1 { font-size: 40px; line-height: 1.1; max-width: 420px; }
.login-art p { color: rgba(255,255,255,.75); max-width: 420px; font-size: 15px; }
.login-art svg.map { position: absolute; inset: auto -40px -20px auto; width: 640px; opacity: .55; }
.login-form { display: grid; place-items: center; padding: 32px; background: var(--page); }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 26px; margin-bottom: 4px; }
.login-card label { display: block; font-size: 13px; color: var(--ink-2); margin: 16px 0 6px; }
.login-card input { width: 100%; padding: 11px 12px; border-radius: 11px; }
.login-card .btn { margin-top: 22px; }
.hint { margin-top: 18px; font-size: 12.5px; color: var(--muted); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.hint code { font-weight: 700; color: var(--ink); }

/* ------------------------------------------------------------------ responsive (phones / tablets) */
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1000px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 14px; gap: 10px; }
  .nav { flex-direction: row; } .nav a { padding: 7px 10px; } .nav a .t { display: none; }
  .side-card { display: none; } .side-foot { margin: 0 0 0 auto; flex-direction: row; } .user-chip .who { display: none; }
  .theme-btn .t { display: none; }
  .main { padding: 16px; }
  .grid.two, .grid.split { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; } .login-art { padding: 28px; min-height: 220px; } .login-art h1 { font-size: 28px; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions-grid { grid-template-columns: minmax(0, 1fr); }
  .brand div:last-child { display: none; }
  .side { gap: 6px; } .nav a { padding: 7px 8px; }
  .theme-btn { padding: 7px 8px; } .user-chip { padding: 4px; background: none; }
  .hero h1 { font-size: 21px; } .hero .arc { display: none; }
  .tile .value { font-size: 26px; }
  .quote { word-break: break-word; }
  .page-head h1 { font-size: 20px; }
  .route-hero .code { font-size: 28px; }
  .hero { padding: 18px; }
}
@media (forced-colors: active) { .segbar .part, .rc-bar, .meter .bar i { forced-color-adjust: none; border: 1px solid CanvasText; } }

/* ---- per-enquiry summary (dashboard row, WhatsApp chat, Mail, report) */
tr.sum-row td { padding-top: 0; border-top: 0; }
tr.row:has(+ tr.sum-row) td { border-bottom: 0; }
.row-sum > summary { cursor: pointer; list-style: none; font-size: 12.5px; color: var(--ink-2); padding: 2px 0 8px; }
.row-sum > summary::-webkit-details-marker { display: none; }
.row-sum > summary .sum-label { font-weight: 650; color: var(--ink); margin-right: 4px; }
.row-sum > summary .sum-label::before { content: "▸ "; }
.row-sum[open] > summary .sum-label::before { content: "▾ "; }
.row-sum-body { background: var(--surface-2); border-radius: 10px; padding: 8px 14px 10px; margin-bottom: 10px; }
.enq-sum { margin: 8px 12px; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; font-size: 12.5px; }
.enq-sum > summary { cursor: pointer; }
.enq-sum .sum-line { grid-template-columns: 90px 1fr; padding: 4px 0; }
.wa-sums { max-height: 38vh; overflow:auto; flex-shrink:0; }
.prev-card { white-space: pre-wrap; margin: 2px 0 0; padding: 6px 8px; background: var(--surface-2); border-radius: 6px; font-family: inherit; }

/* ---- Daily activity page */
.tag.dir-in { background: var(--accent-soft); color: var(--accent-ink); }
.tag.dir-out { background: var(--good-soft); color: var(--good-ink); }
.tag.dir-internal { background: var(--warning-soft); color: var(--warning-ink); }
.tag.dir-system { background: var(--surface-2); color: var(--ink-2); }
.act-feed td { vertical-align: top; }
.act-feed tr.blocked td { background: var(--critical-soft); }
.act-enq { border-top: 1px dashed var(--line); padding-top: 8px; }
.act-enq > summary .badge { margin-right: 6px; }
.day-words .sum-line { grid-template-columns: 22px 1fr; }
.act-feed td:last-child, .act-feed td:first-child { white-space: nowrap; }

/* AI Won/Lost suggestion inside a chat or mail conversation */
.decide { margin: 8px 0 12px; }
.decide .ops { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.decide .quote { margin: 8px 0 0; }

/* Deal check page */
.deals { display: grid; grid-template-columns: 300px minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.deals-list { padding: 8px; max-height: calc(100vh - 170px); overflow: auto; position: sticky; top: 76px; }
.deals-list .fsep { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #888); margin: 10px 8px 4px; }
.deal-row { display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.deal-row:hover { background: var(--hover, rgba(0,0,0,.04)); }
.deal-row.on { background: var(--sel, rgba(37,99,235,.10)); }
.deal-title { margin: 0 0 2px; font-size: 18px; }
.deal-msg { background: var(--surface, #fff); border: 1px solid var(--ring, #e5e7eb); border-radius: 12px; padding: 12px 14px; margin: 10px 0; max-width: 92%; }
.deal-msg.mine { margin-left: auto; background: var(--mine, rgba(37,99,235,.06)); }
.deal-msg.evidence { outline: 2px solid #f59e0b; }
.deal-msg-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.deal-body { white-space: pre-wrap; margin-top: 6px; font-size: 14px; line-height: 1.45; }
.deal-side { position: sticky; top: 76px; }
.verdict-big { font-size: 28px; font-weight: 800; letter-spacing: .02em; margin: 2px 0 2px; }
.verdict-big small { font-size: 14px; font-weight: 600; }
.v-won { color: #15803d; } .v-lost { color: #b91c1c; } .v-open { color: #1d4ed8; } .v-unclear { color: #6b7280; }
.verdict-card.vc-won { border-top: 4px solid #16a34a; } .verdict-card.vc-lost { border-top: 4px solid #dc2626; }
.verdict-card.vc-open { border-top: 4px solid #2563eb; } .verdict-card.vc-unclear { border-top: 4px solid #9ca3af; }
.verdict-chip { align-self: flex-start; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; }
.verdict-card form { margin-top: 12px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 1100px) { .deals { grid-template-columns: 1fr; } .deals-list, .deal-side { position: static; max-height: none; } }

/* top bar: live clock (real time) */
.live-clock { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.live-clock .tz { opacity: .7; }

.deal-in-mail.vc-won { border-left: 4px solid #16a34a; } .deal-in-mail.vc-lost { border-left: 4px solid #dc2626; }
.deal-in-mail.vc-open { border-left: 4px solid #2563eb; } .deal-in-mail.vc-unclear { border-left: 4px solid #9ca3af; }

/* charter / route board (Dashboard + Daily activity) */
.charter-board { margin-top: 18px; }
.cb-kpis { display: flex; flex-wrap: wrap; gap: 16px; margin: 4px 0 12px; font-size: 13px; }
.cb-table td { vertical-align: top; }
.cb-table .nowrap { white-space: nowrap; }
.tag.cb-charter { background: #fef3c7; color: #92400e; border-color: #f59e0b; }

.cb-tiles { margin-top: 4px; }
.cb-tiles .ic { font-size: 14px; }
.cb-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.cb-filters .pill-link { cursor: pointer; font: inherit; font-size: 13px; }
.cb-filters .pill-link b { margin-left: 4px; }
.cb-sep { width: 1px; height: 18px; background: var(--ring, #ccc); margin: 0 6px; }

.verdict-chip { white-space: nowrap; }

/* clickable charter tiles / rows + popup */
.cb-tile, .cb-row { cursor: pointer; }
.cb-tile:hover { outline: 2px solid var(--accent, #2563eb); }
.cb-row:hover td { background: rgba(37, 99, 235, .06); }
.cb-popup { width: min(980px, 94vw); max-height: 86vh; padding: 0; border: 1px solid var(--ring, #333); border-radius: 14px;
            background: var(--surface, #fff); color: inherit; overflow: hidden; }
.cb-popup::backdrop { background: rgba(0, 0, 0, .55); }
.cbp-top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--ring, #333); }
.cbp-title { margin: 0; font-size: 16px; flex: 1; }
.cbp-content { padding: 12px 16px 16px; overflow: auto; max-height: calc(86vh - 60px); }
.cbp-item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 10px 12px; margin: 0 0 6px;
            border: 1px solid var(--ring, #333); border-radius: 10px; background: transparent; color: inherit; cursor: pointer; font: inherit; }
.cbp-item:hover { border-color: var(--accent, #2563eb); }
.cbp-item span:nth-of-type(1) { flex: 1; }
.cbp-thread { margin-bottom: 18px; }
.cbp-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.cbp-ai { padding: 8px 10px; border-radius: 8px; background: rgba(37, 99, 235, .08); margin-bottom: 8px; }
.cbp-msg { border: 1px solid var(--ring, #333); border-radius: 10px; padding: 10px 12px; margin: 8px 0; max-width: 92%; }
.cbp-msg.mine { margin-left: auto; background: rgba(37, 99, 235, .06); }
.cbp-msg.evidence { outline: 2px solid #f59e0b; }
.cbp-msg-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cbp-body { white-space: pre-wrap; margin-top: 6px; font-size: 14px; line-height: 1.45; }
.cbp-back[hidden] { display: none !important; }


/* ================= charter & route board: calm, easy-to-scan layout ================= */
.cb-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.cb-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); white-space: nowrap;
  font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 650;
  padding: 10px 12px; border-bottom: 1px solid var(--line); }
.cb-table td { vertical-align: top; padding: 14px 12px; border-bottom: 1px solid var(--line); line-height: 1.45; }
.cb-table tr.cb-row { cursor: pointer; transition: background .12s; }
.cb-table tr.cb-row:hover > td { background: var(--surface-2); }
.cb-table tr.cb-row:has(+ tr.cb-air:not([hidden])) > td { border-bottom-color: transparent; background: var(--surface-2); }

/* route + type */
.cb-route { min-width: 108px; max-width: 140px; }
.cb-route-name { font-weight: 700; font-size: 14px; color: var(--ink); line-height: 1.3; }
.cb-type { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.cb-type.charter { color: var(--warning-ink); background: var(--warning-soft); border-color: transparent; }

/* conversation */
.cb-conv { min-width: 180px; max-width: 230px; }
.cb-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--ink); text-decoration: none; font-weight: 550; }
.cb-title:hover { color: var(--accent); text-decoration: underline; }
.cb-air-toggle { margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12px;
  font-weight: 600; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--accent-ink);
  border-radius: 999px; padding: 3px 11px; }
.cb-air-toggle:hover { border-color: var(--accent); }
.cb-air-toggle[aria-expanded="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.cb-air-toggle .arr { font-size: 10px; }
.cb-supplier-note { margin-top: 8px; font-size: 12px; color: var(--warning-ink); }

/* numbers + times */
.cb-count { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.cb-time { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink); min-width: 92px; }

/* status pill */
.cb-status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; font-weight: 650;
  padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.cb-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.cb-status.s-open { background: var(--accent-soft); color: var(--accent-ink); }
.cb-status.s-won { background: var(--good-soft); color: var(--good-ink); }
.cb-status.s-lost { background: var(--critical-soft); color: var(--critical-ink); }
.cb-status.s-unclear, .cb-status.s-unchecked { background: var(--surface-2); color: var(--muted); }

/* what is happening */
.cb-summary { min-width: 240px; max-width: 320px; color: var(--ink-2); }
.cb-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cb-clamp.open { -webkit-line-clamp: unset; display: block; }
.cb-more { border: 0; background: none; padding: 0; margin-top: 2px; font: inherit; font-size: 12px; font-weight: 600;
  color: var(--accent); cursor: pointer; }
.cb-next { margin-top: 8px; padding: 6px 10px; border-radius: 8px; background: var(--warning-soft); color: var(--warning-ink);
  font-size: 12px; line-height: 1.4; }

/* people */
.cb-people { min-width: 120px; }
.cb-person { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 550; color: var(--ink); }
.cb-person + .cb-person { margin-top: 6px; }
.cb-avatar { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 10.5px;
  font-weight: 700; background: var(--accent-soft); color: var(--accent-ink); }
.cb-cust { min-width: 150px; max-width: 200px; }
.cb-cust-name { font-weight: 650; color: var(--ink); }
.cb-email { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }

/* final price */
.cb-final { min-width: 120px; max-width: 160px; white-space: normal; }
.cb-amount { font-size: 15px; font-weight: 750; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* airlines drop-down */
tr.cb-air > td { background: var(--surface-2); padding: 4px 16px 18px; border-bottom: 1px solid var(--line); }
.cb-air-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin: 4px 0 12px; }
.cb-air-head b { font-size: 14px; }
.cb-air-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.cb-air-card { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; cursor: default; }
.cb-air-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.cb-air-name { font-weight: 700; font-size: 14px; color: var(--ink); }
.cb-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cb-stats > div { background: var(--surface-2); border-radius: 8px; padding: 6px 8px; min-width: 0; }
.cb-stats span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cb-stats b { display: block; font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-stats em { display: block; font-style: normal; font-size: 11px; color: var(--muted); }
.cb-stats .late b { color: var(--warning-ink); }
.cb-stats .best { background: var(--good-soft); }
.cb-stats .best b { color: var(--good-ink); }
.cb-air-prices { display: flex; flex-wrap: wrap; gap: 6px; }
.cb-price { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px;
  font-size: 12px; font-weight: 600; cursor: help; }
.cb-air-prices .cb-price.more { display: none; }
.cb-air-prices.all .cb-price.more { display: inline-block; }
.cb-more-prices { border: 0; background: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--accent); cursor: pointer; }
.cb-air-sum { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.cb-air-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }

@media (max-width: 1100px) { .cb-summary { min-width: 200px; } .cb-stats { grid-template-columns: repeat(2, 1fr); } }
/* fit on one screen + roomier airline stats */
.cb-air-toggle { white-space: nowrap; }
.cb-conv { min-width: 160px; max-width: 200px; }
.cb-summary { min-width: 220px; max-width: 280px; }
.cb-cust { min-width: 130px; max-width: 175px; }
.cb-people { min-width: 0; }
.cb-person { white-space: normal; line-height: 1.25; }
.cb-time { min-width: 0; white-space: normal; }
.cb-route { min-width: 96px; max-width: 120px; }
.cb-table td { padding: 14px 10px; }
.cb-stats { grid-template-columns: repeat(2, 1fr); }
.cb-stats b { white-space: normal; }
@media (max-width: 1400px) {
  .cb-summary { min-width: 190px; max-width: 230px; }
  .cb-cust { min-width: 120px; max-width: 150px; }
  .cb-final { min-width: 100px; max-width: 130px; }
  .cb-amount { font-size: 14px; }
  .cb-conv { min-width: 150px; max-width: 180px; }
  .cb-table td, .cb-table thead th { padding-left: 8px; padding-right: 8px; }
}
.cb-final .tiny { white-space: normal; overflow-wrap: anywhere; }
/* deal cell (route + type + conversation), real dates, phones, quotes received */
.cb-deal { min-width: 170px; max-width: 210px; }
.cb-deal .cb-route-name { font-size: 14px; }
.cb-deal-meta { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; }
.cb-deal-meta .cb-type { margin-top: 0; }
.cb-date { font-weight: 600; white-space: nowrap; }
.cb-in { color: var(--accent-ink); }
.cb-time { min-width: 92px; }
.cb-phone { display: block; font-size: 12px; white-space: nowrap; color: var(--ink-2); text-decoration: none; margin-top: 2px; }
.cb-phone:hover { color: var(--accent); }
.cb-quotes { min-width: 160px; max-width: 210px; }
.cb-quote { display: block; width: 100%; text-align: left; font: inherit; cursor: pointer; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }
.cb-quote + .cb-quote { margin-top: 5px; }
.cb-quote:hover { border-color: var(--accent); }
.cb-quote-name { display: block; font-size: 12px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-quote-price { display: block; font-size: 12.5px; font-weight: 700; color: var(--good-ink); font-variant-numeric: tabular-nums; }
.cb-quote-price em { font-style: normal; font-weight: 500; font-size: 11px; color: var(--muted); }
.cb-quote-price em.late { color: var(--warning-ink); }
.cb-quote-phone { display: block; font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.cb-why { font-size: 12px; color: var(--ink-2); background: var(--surface-2); border-radius: 8px; padding: 6px 9px; line-height: 1.4; }
.cb-maybe { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cb-maybe .cb-maybe-item { display: inline-block; width: auto; margin: 0; font-size: 12px; font-weight: 600; }
.cb-maybe .cb-maybe-item em { font-style: normal; font-weight: 500; color: var(--accent); margin-left: 4px; }
@media (max-width: 1400px) {
  .cb-deal { min-width: 150px; max-width: 180px; }
  .cb-quotes { min-width: 140px; max-width: 170px; }
  .cb-summary { min-width: 180px; max-width: 220px; }
}

/* airline & client reference (contact list Excel vs mails) */
.cb-ref { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 10px 0 12px; padding: 10px 14px;
  border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-2); }
.cb-ref-title { font-weight: 700; font-size: 13px; }
.cb-ref .btn { margin-left: auto; }
.cb-ref-more { flex-basis: 100%; }
.cb-ref-more summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.cb-ref-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-top: 8px; }
.cb-ref-grid ul { margin: 4px 0 0; padding-left: 16px; max-height: 220px; overflow: auto; }
.cb-air-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cb-found { font-size: 11px; font-weight: 650; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.cb-found.f-excel-mails { background: var(--good-soft); color: var(--good-ink); }
.cb-found.f-mails { background: var(--warning-soft); color: var(--warning-ink); }
.cb-found.f-excel { background: var(--accent-soft); color: var(--accent-ink); }

/* ---- On hold, days column, reply times ---- */
.v-hold { color: #b45309; }
.verdict-card.vc-hold { border-top: 4px solid #d97706; }
.deal-in-mail.vc-hold { border-left: 4px solid #d97706; }
.cb-status.s-hold { background: var(--warning-soft); color: var(--warning-ink); }
.cb-days { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 12.5px; }
.cb-quote-price em.late { color: var(--critical-ink); font-weight: 600; }
.cb-quote-took { display: block; font-size: 11px; color: var(--muted); }
.cb-stats .late b { color: var(--critical-ink); }
.cbp-reply { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); margin: 0 0 8px;
  padding: 7px 10px; border-radius: 8px; background: var(--surface-2); }
.cbp-took b { color: var(--good-ink); }
.cbp-noreply { color: var(--critical-ink); font-weight: 600; }
.cbp-after { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--good-ink); background: var(--good-soft);
  border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.cb-tiles { grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 1280px) { .cb-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 720px) { .cb-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* filter buttons on the board: the hero's white-on-blue pills were invisible on a light page */
.cb-filters .pill-link { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.cb-filters .pill-link:hover { background: var(--surface); border-color: var(--accent); }
.cb-filters .pill-link.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.cb-filters .pill-link.on .muted { color: rgba(255,255,255,.8); }

/* popup open: the page behind does not scroll; the popup's own scroll does not pass through */
html.cb-lock { overflow: hidden; scrollbar-gutter: stable; }
.cbp-content { overscroll-behavior: contain; }
.cb-popup { overscroll-behavior: contain; }

/* quotes column: compact cards, at most 3; "+N more" opens the full list under the deal */
.cb-quote { padding: 5px 8px 6px; }
.cb-quote + .cb-quote { margin-top: 4px; }
.cb-quote.no-reply { background: transparent; border-style: dashed; }
.cb-quote-price { line-height: 1.3; }
.cb-quote-took { display: block; font-size: 11px; color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
.cb-quote-more { display: block; width: 100%; margin-top: 5px; padding: 4px 8px; font: inherit; font-size: 12px; font-weight: 600;
  color: var(--accent-ink); background: var(--accent-soft); border: 0; border-radius: 8px; cursor: pointer; text-align: center; }
.cb-quote-more:hover { filter: brightness(1.08); }
.cb-clamp + .cb-more + .cb-more { display: none; }
.cb-quote-phone { font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* quotes column: one clean line per airline / broker (name left, price right) */
.cb-quotes { min-width: 230px; max-width: 270px; }
.cb-qlist { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.cb-q { display: flex; align-items: center; gap: 7px; width: 100%; padding: 6px 9px; margin: 0; border: 0; border-radius: 0;
  background: transparent; color: var(--ink); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.cb-q + .cb-q { margin-top: 0; border-top: 1px solid var(--line); }
.cb-q:hover { background: var(--surface-2); }
.cb-q i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.cb-q.q-replied i { background: var(--muted); }
.cb-q.q-none i { background: transparent; border: 1.5px solid var(--critical-ink); }
.cb-q-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cb-q-price { flex: none; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--good-ink); }
.cb-q.q-replied .cb-q-price { font-weight: 500; color: var(--muted); }
.cb-q.q-none .cb-q-price { font-weight: 600; color: var(--critical-ink); }
.cb-qfoot { margin-top: 4px; font-size: 11px; color: var(--muted); }
.cb-qfoot .cb-quote-more { display: inline; width: auto; margin: 0; padding: 0; background: none; color: var(--accent-ink); font-size: 11px; }
@media (max-width: 1400px) { .cb-quotes { min-width: 200px; max-width: 230px; } }

/* fit the whole board (with Final price) without a side scroll from 1366 px screens up */
.cb-quotes { min-width: 205px; max-width: 235px; }
.cb-deal { max-width: 190px; }
.cb-cust { max-width: 165px; }
.cb-final { min-width: 105px; max-width: 135px; }
.cb-table td.cb-days, .cb-table th:nth-child(4) { padding-left: 6px; padding-right: 6px; }
@media (max-width: 1400px) {
  .cb-quotes { min-width: 185px; max-width: 205px; }
  .cb-deal { min-width: 140px; max-width: 165px; }
  .cb-summary { min-width: 165px; max-width: 200px; }
  .cb-cust { max-width: 145px; }
  .cb-final { min-width: 95px; }
}
/* smaller screens: name on its own line, the price under it, so names are never cut */
@media (max-width: 1700px) {
  .cb-q { flex-wrap: wrap; row-gap: 1px; }
  .cb-q-name { flex: 1 1 calc(100% - 20px); white-space: normal; line-height: 1.3; }
  .cb-q-price { flex-basis: 100%; padding-left: 15px; font-size: 12px; }
}
.cb-stats .missing b { color: var(--warning-ink); font-size: 12px; }

/* Mailbox copy: the original mail, as in a mail program */
.mbx-mail .cbp-msg-head{display:flex;gap:8px;align-items:baseline;flex-wrap:wrap}
.mbx-mail.mine{border-left:3px solid var(--accent,#4a7)}
.mbx-files{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.mbx-file{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border:1px solid var(--line,#8884);border-radius:8px;
  text-decoration:none;color:inherit;max-width:320px;background:var(--panel2,transparent)}
.mbx-file:hover{border-color:var(--accent,#4a7)}
.mbx-file span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
.mbx-file small{opacity:.65;font-size:11px;white-space:nowrap}
.mbx-file.off{opacity:.6;cursor:help}
.mbx-body{margin-top:8px}
.mbx-frame{width:100%;height:240px;border:1px solid var(--line,#8884);border-radius:8px;background:#fff;display:block}
.mbx-text{margin-top:4px}.mbx-text pre,.mbx-pre{white-space:pre-wrap;max-height:420px;overflow:auto}
.mbx-sheet{max-height:460px;overflow:auto;margin-top:6px}
.mbx-sheet table{border-collapse:collapse;font-size:12px}
.mbx-sheet td,.mbx-sheet th{border:1px solid var(--line,#8884);padding:3px 8px;white-space:nowrap;text-align:left}
.mbx-sheet th{background:var(--panel2,#8881)}
.cbp-orig{margin-left:6px}
.mbx-progress .mbx-bar{height:8px;border-radius:6px;background:var(--line,#8883);margin:8px 0 4px;overflow:hidden}
.mbx-progress .mbx-bar i{display:block;height:100%;background:var(--accent,#4a7)}
.refresh-form{display:inline-flex;margin:0}

/* ---------------------------------------------------------------- Mailbox, like webmail: folders | list | reading pane */
.ol-top{display:flex;align-items:center;gap:14px;margin:4px 0 10px;flex-wrap:wrap}
.ol-title{font-size:18px}
.ol-search{flex:1;display:flex;gap:6px;min-width:260px;max-width:720px}
.ol-search input{flex:1;padding:8px 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink)}
.ol-prog{padding:4px 10px;border-radius:20px;background:var(--accent-soft);color:var(--accent-ink);text-decoration:none;white-space:nowrap}
.ol{display:grid;grid-template-columns:210px minmax(300px,380px) 1fr;height:calc(100vh - 150px);min-height:480px;
  border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--surface)}
.ol>*{overflow:auto;min-width:0}
.ol-folders{background:var(--surface-2);border-right:1px solid var(--line);padding:8px 0}
.ol-folder{display:flex;justify-content:space-between;align-items:center;gap:6px;padding:7px 12px;color:var(--ink);text-decoration:none;font-size:14px}
.ol-folder span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ol-folder:hover{background:var(--ring)}
.ol-folder.on{background:var(--accent-soft);color:var(--accent-ink);font-weight:600;box-shadow:inset 3px 0 0 var(--accent)}
.ol-count{color:var(--accent);font-size:13px}
.ol-list{border-right:1px solid var(--line)}
.ol-list-head{position:sticky;top:0;z-index:1;background:var(--surface);padding:10px 14px;border-bottom:1px solid var(--line)}
.ol-item{display:block;padding:9px 14px 10px;border-bottom:1px solid var(--line);color:var(--ink);text-decoration:none;
  box-shadow:inset 3px 0 0 transparent}
.ol-item:hover{background:var(--surface-2)}
.ol-item.on{background:var(--accent-soft);box-shadow:inset 3px 0 0 var(--accent)}
.ol-item.unread{box-shadow:inset 3px 0 0 var(--accent)}
.ol-item.unread .ol-who,.ol-item.unread .ol-subj{font-weight:700}
.ol-item.unread .ol-subj{color:var(--accent-ink)}
.ol-item.removed{opacity:.6}
.ol-row1{display:flex;justify-content:space-between;gap:8px;font-size:14px}
.ol-who{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ol-when{color:var(--muted);font-size:12px;white-space:nowrap}
.ol-subj{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:1px}
.ol-prev{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:1px}
.ol-arrow{color:var(--muted);font-weight:400;margin:0 2px}
.ol-box{display:flex;align-items:center;gap:6px;font-size:11px;font-weight:600;color:var(--accent-ink);margin-bottom:3px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ol-box-av{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 4px;border-radius:10px;
  background:var(--accent-soft);color:var(--accent-ink);font-size:10px;font-weight:700}
.ol-pages{display:flex;justify-content:space-between;gap:10px;padding:10px 14px}
.ol-read{padding:16px 20px 30px;background:var(--page)}
.ol-read-subj{font-size:20px;margin:0 0 10px;line-height:1.3}
.ol-mail{background:var(--surface);border:1px solid var(--line);border-radius:10px;margin-bottom:10px;padding:0 14px}
.ol-mail>summary{list-style:none;display:grid;grid-template-columns:36px 1fr auto;gap:10px;align-items:start;padding:12px 0;cursor:pointer}
.ol-mail>summary::-webkit-details-marker{display:none}
.ol-mail[open]>summary{border-bottom:1px solid var(--line);margin-bottom:10px}
.ol-mail[open] .ol-snip{display:none}
.ol-mail:not([open]) .ol-to{display:none}
.ol-avatar{width:36px;height:36px;border-radius:50%;background:var(--accent);color:#fff;display:grid;place-items:center;font-weight:700}
.ol-mail.mine .ol-avatar{background:var(--s3)}
.ol-from{display:flex;flex-direction:column;gap:2px;min-width:0}
.ol-from>*{overflow:hidden;text-overflow:ellipsis}
.ol-snip,.ol-to{white-space:nowrap}
.ol-date{text-align:right;white-space:nowrap}
.ol-mail .mbx-frame{border:0;border-radius:6px;min-height:90px}
.ol-mail .mbx-text,.ol-mail>details:last-child{margin-bottom:12px}
@media (max-width:1100px){.ol{grid-template-columns:minmax(260px,330px) 1fr}.ol-folders{display:none}}
@media (max-width:760px){.ol{grid-template-columns:1fr;height:auto}.ol-list{max-height:45vh}}
.ol-netpics{display:flex;align-items:center;gap:10px;justify-content:space-between;padding:6px 10px;margin:0 0 8px;border-radius:8px;background:var(--warning-soft);color:var(--warning-ink)}
.ol-notice{display:block;padding:8px 12px;margin:0 0 10px;border-radius:8px;background:var(--warning-soft);color:var(--warning-ink);line-height:1.5}

/* ---- deals table: 13 columns that always fit the card width (no sideways scrolling). Column widths are shares
   of the width, so the table grows and shrinks with the screen. Header words are never cut in the middle; only
   very long values (e-mail addresses) may break. Only on very small screens (phone) the table scrolls. */
.charter-board .table-wrap:has(> .cb-fit) { overflow-x: visible; margin: 0; padding: 0; }
.cb-table.cb-fit { table-layout: fixed; width: 100%; font-size: 12.5px; }
.cb-fit col.c-org { width: 7.5%; } .cb-fit col.c-dst { width: 7%; } .cb-fit col.c-when { width: 9.5%; }
.cb-fit col.c-op { width: 7%; }    .cb-fit col.c-ship { width: 6.5%; } .cb-fit col.c-cust { width: 10.5%; }
.cb-fit col.c-type { width: 6%; }  .cb-fit col.c-comm { width: 7%; }  .cb-fit col.c-sales { width: 8%; }
.cb-fit col.c-buy { width: 8%; }   .cb-fit col.c-sell { width: 8%; }  .cb-fit col.c-mar { width: 7%; }
.cb-fit col.c-fb { width: 8%; }
.cb-fit td, .cb-fit thead th { padding: 11px 6px; min-width: 0; max-width: none; overflow-wrap: break-word; word-break: normal; }
.cb-fit thead th { white-space: normal; overflow-wrap: normal; word-break: keep-all; hyphens: none; font-size: 10.5px;
  letter-spacing: .02em; line-height: 1.3; vertical-align: bottom; }
.cb-fit td { font-size: clamp(11.5px, 0.75vw, 13px); }
.cb-fit td { overflow: hidden; }                  /* nothing spills into the next column */
/* small labels and amounts are never cut in the middle of a word or number */
.cb-fit .cb-wl { text-transform: none; letter-spacing: 0; font-size: 10.5px; overflow-wrap: normal; word-break: keep-all; }
.cb-fit td.num .tiny { overflow-wrap: normal; word-break: normal; white-space: normal; }
/* headers in normal letters (not CAPITALS): they need much less width, so whole words fit */
.cb-fit thead th { text-transform: none; letter-spacing: 0; font-size: 11.5px; font-weight: 650; }
.cb-fit .cb-title { font-weight: 400; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.cb-fit .cb-air-toggle { white-space: normal; text-align: left; max-width: 100%; }
.cb-fit .cb-w + .cb-w { margin-top: 6px; }
.cb-fit .cb-wl { display: block; font-weight: 650; color: var(--muted); }
.cb-fit .cb-date { white-space: normal; }
.cb-fit .cb-days { margin-top: 6px; font-size: 11.5px; font-weight: 650; color: var(--ink-2); }
.cb-fit .cb-status { white-space: normal; font-size: 11.5px; padding-left: 7px; padding-right: 7px; }
.cb-fit .cb-person { white-space: normal; align-items: flex-start; gap: 6px; line-height: 1.3; }
.cb-fit .cb-avatar { width: 22px; height: 22px; font-size: 9.5px; flex: none; }
.cb-fit .cb-email, .cb-fit .cb-phone { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cb-fit .cb-amount { font-size: clamp(11.5px, 0.78vw, 13px); white-space: nowrap; overflow-wrap: normal; }
.cb-fit td.num, .cb-fit th.num { text-align: right; }
.cb-fit tr.cb-empty td { text-align: center; }
/* the card measures its own width: when the table area is narrower than 1180px (laptop / tablet / phone), the 13
   columns would be squeezed unreadably, so the table keeps 1180px and scrolls sideways inside the card, with the
   Origin column fixed on the left. Wider (big screens): everything fits, no scrolling. */
.charter-board { container-type: inline-size; }
@container (max-width: 1220px) {
  .charter-board .table-wrap:has(> .cb-fit) { overflow-x: auto; padding-bottom: 6px; }
  .cb-table.cb-fit { min-width: 1180px; }
  .cb-fit thead th:first-child, .cb-fit tr.cb-row > td:first-child { position: sticky; left: 0; z-index: 2;
    background: var(--surface); box-shadow: inset -1px 0 0 var(--line); }
  .cb-fit thead th:first-child { z-index: 3; }
  .cb-fit tr.cb-row:hover > td:first-child { background: var(--surface-2); }
}

/* eye button inside password boxes (pwtoggle.js): open eye = show, crossed eye = hide */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap input { width: 100%; padding-right: 40px; }
.pw-toggle { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); display: grid; place-items: center;
  width: 32px; height: 32px; border: 0; border-radius: 7px; background: none; color: var(--muted, #6b7480);
  padding: 0; cursor: pointer; }
.pw-toggle:hover { color: var(--ink, #111); background: var(--soft, rgba(0,0,0,.05)); }
.pw-toggle:focus-visible { outline: 2px solid var(--brand, #1f6feb); outline-offset: 1px; }
.pw-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round;
  stroke-linejoin: round; pointer-events: none; }
.pw-gen { font: inherit; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line, #d0d5dd); background: transparent; color: inherit; white-space: nowrap; }
.pw-gen:hover, .pw-gen:focus-visible { border-color: currentColor; }
form .pw-gen { align-self: end; }

/* ---- charter board: cargo, speed, waiting, attachment prices, "Not a charter" ---- */
.cb-cargo { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.cb-chip { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; padding: 1px 7px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-size: 11px; line-height: 1.6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-speed { margin: 8px 0 0; padding: 6px 0 0; border-top: 1px dashed var(--line); display: grid; gap: 2px; }
.cb-speed div { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; line-height: 1.35; }
.cb-speed dt { color: var(--muted); }
.cb-speed dd { margin: 0; font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cb-wait { margin-top: 6px; padding: 4px 7px; border-radius: 7px; background: var(--critical-soft); color: var(--critical-ink);
  font-size: 11px; font-weight: 650; line-height: 1.35; }
.cb-table tr.cb-waiting > td:first-child { box-shadow: inset 3px 0 0 var(--critical); }
.cb-tile-alert .value { color: var(--critical-ink); }
.cb-file { margin-right: 3px; }
.cb-file-line { margin-top: 3px; overflow-wrap: anywhere; }
.cb-hide { margin-top: 8px; }
.cb-hide-btn { border: 0; background: none; padding: 0; font: inherit; font-size: 11px; color: var(--muted);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.cb-hide-btn:hover, .cb-hide-btn:focus-visible { color: var(--critical-ink); }
.cb-late { margin-top: 6px; padding: 4px 7px; border-radius: 7px; background: var(--warning-soft); color: var(--warning-ink);
  font-size: 11px; font-weight: 650; line-height: 1.35; }
