/* Vortex portal: tokens, base, masthead, page chrome, filters, banners, buttons.
   Follows the "Vortex Shipment Portal" design (Nov 2026). Load first. */
:root {
  /* Brand palette, sampled from the logo. Decorative only: logo, wordmark, stripe, map. */
  --brand-orange: #F07E22;
  --brand-gold: #FDD04B;
  --brand-yellow: #F7EC66;
  --brand-sky: #8ED8F8;
  --brand-ice: #C7E9FA;
  --brand-cyan: #00AEEF;
  --brand-gray: #8a8c8e;
  /* UI tokens. Every text pair meets WCAG AA contrast. */
  --bg: #f3f7fa;
  --surface: #ffffff;
  --surface-2: #f6f9fb;
  --ink: #1f2a30;
  --ink-2: #3c4950;
  --label: #4a5860;
  --muted: #5c6870;
  --line: #d9e4ea;
  --line-2: #e3ecf1;
  --field: #c9d7df;
  --accent: #0076a8;
  --accent-hover: #00597f;
  --accent-ink: #ffffff;
  --ice: #e5f5fc;
  --ice-line: #c4e6f5;
  --info: #0a6a94;     --info-bg: #e2f4fc;  --info-line: #b3dff3;
  --ok: #1d7a4b;       --ok-bg: #e0f1e8;    --ok-line: #b5dcc6;
  --warn: #9a4300;     --warn-bg: #fdebd8;  --warn-line: #f1c08c;  --warn-row: #fffaf4;
  --off: #4a5860;      --off-bg: #e7ecef;   --off-line: #d3dbe0;
  --danger: #b42318;   --danger-bg: #fff6f5;
  --step-todo: #dbe5eb;
  --step-wait: #9fb0ba;
  --doc-line: #9fd3ea;
  --disabled-bg: #eef3f6;
  --hero: #0a2b3d;
  --shadow: 0 1px 2px rgba(16, 42, 56, .04), 0 8px 24px rgba(16, 42, 56, .06);
  --font-display: "Poppins", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d171c; --surface: #15222a; --surface-2: #1a2a33; --ink: #e8eef1; --ink-2: #d0dade;
    --label: #a9b8c0; --muted: #9aa9b1; --line: #26363f; --line-2: #22313a; --field: #3a4c56;
    --accent: #5ccaf5; --accent-hover: #8ed8f8; --accent-ink: #06222f;
    --ice: #17303b; --ice-line: #24485a; --brand-gray: #b9bcbe;
    --info: #7fd3f7; --info-bg: #11303f; --info-line: #24485a;
    --ok: #62d09a; --ok-bg: #153325; --ok-line: #1f4a35;
    --warn: #f7b26a; --warn-bg: #3a2610; --warn-line: #5a3a18; --warn-row: #1f1a14;
    --off: #9fb0ba; --off-bg: #222f37; --off-line: #33434c;
    --danger: #ff8f85; --danger-bg: #2a1215;
    --step-todo: #2a3a43; --step-wait: #5d6f79; --doc-line: #2f5a6d; --disabled-bg: #1d2b33;
    --shadow: none;
    color-scheme: dark;
  }
}

/* ---- Base ------------------------------------------------------------------ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mono { font-family: var(--font-data); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; }
button { font: inherit; }
select, input { font: inherit; color: var(--ink); }

/* ---- Masthead ------------------------------------------------------------------ */
.mast { background: var(--surface); position: relative; }
.mast-in { max-width: 1240px; margin: 0 auto; padding: 16px 24px 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.mast-left { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; min-width: 0; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 44px; height: 42px; display: block; }
.wordmark { display: grid; gap: 3px; line-height: 1; }
.wm-name { font-family: var(--font-display); font-weight: 300; font-size: 22px; letter-spacing: .32em; color: var(--brand-gray); }
.wm-sub { font-family: var(--font-display); font-weight: 400; font-size: 9.5px; letter-spacing: .37em; color: var(--brand-cyan); }
.titleblock { border-left: 1px solid var(--line); padding-left: 22px; min-width: 0; }
.eyebrow { font-family: var(--font-display); font-weight: 500; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.titleblock .title, .ptitle .title { font-size: 22px; line-height: 1.2; color: var(--ink); }
.mast-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.updated { display: flex; align-items: center; gap: 6px; }
.asof { font-family: var(--font-data); font-size: 12.5px; color: var(--muted); }
.iconbtn { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; border-radius: 8px; color: var(--accent); cursor: pointer; }
.iconbtn:hover { background: var(--ice); }
.iconbtn:disabled { opacity: .5; cursor: progress; }
.iconbtn.boxed { background: var(--surface); border: 1px solid var(--field); border-radius: 10px; }
.acct { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.viewing { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.viewing select { height: 40px; font-size: 14px; font-weight: 600; background: var(--surface); border: 1px solid var(--field); border-radius: 8px; padding: 0 10px; max-width: 260px; }
.adminlink, .navlink { font-weight: 600; font-size: 14px; }
.userline { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ice); color: var(--accent-hover); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600; font-size: 12.5px; flex: none; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.linkish:hover { color: var(--accent-hover); }
.acctbtn { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; background: transparent; border: 0; cursor: pointer; padding: 0; }
.stripe { height: 5px; background: linear-gradient(90deg, #F07E22 0 18%, #FDD04B 18% 36%, #F7EC66 36% 50%, #C7E9FA 50% 64%, #8ED8F8 64% 82%, #00AEEF 82% 100%); }
.adminbar { background: var(--ice); border-bottom: 1px solid var(--ice-line); }
.adminbar p { max-width: 1240px; margin: 0 auto; padding: 10px 24px; font-size: 14px; color: var(--accent-hover); }

/* Phone-only title block (the header shows it on desktop) */
.ptitle { display: none; }

/* ---- Page ---------------------------------------------------------------------- */
.page { max-width: 1240px; margin: 0 auto; padding: 24px 24px 48px; display: flex; flex-direction: column; gap: 18px; }

/* Status tiles */
.tiles { display: flex; flex-wrap: wrap; gap: 12px; }
.tile { flex: 1 1 160px; min-width: 0; min-height: 96px; text-align: left; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 13px 16px 12px; display: flex; flex-direction: column; gap: 3px; color: var(--ink); }
.tile:hover { border-color: var(--field); }
.tile-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--label); }
.tile-n { font-family: var(--font-display); font-weight: 600; font-size: 28px; line-height: 1.15; }
.tile-sub { font-size: 13px; color: var(--muted); }
.tile.alert .tile-sub { color: var(--warn); }
.tile[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tile[aria-pressed="true"] .tile-label, .tile[aria-pressed="true"] .tile-sub { color: var(--accent-ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tile[aria-pressed="true"] .dot { box-shadow: 0 0 0 2px #ffffff; }
.dot-all { background: #00AEEF; }
.dot-scheduled { background: #4fb6e3; }
.dot-transit { background: #0076a8; }
.dot-delivered { background: #1d7a4b; }
.dot-pending { background: #F07E22; }
.dot-cancelled { background: #8a8c8e; }

/* Phone status chips */
.chips { display: none; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
.chip { flex: none; height: 40px; display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; font-size: 14px; font-weight: 600; white-space: nowrap; color: var(--ink); background: var(--surface); border: 1px solid var(--field); border-radius: 999px; cursor: pointer; }
.chip b { font-family: var(--font-data); font-size: 12.5px; font-weight: 500; color: var(--muted); }
.chip[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.chip[aria-pressed="true"] b { color: var(--accent-ink); }

/* Search, carrier and sort */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.search { position: relative; flex: 1 1 340px; min-width: 0; display: block; }
.search svg { position: absolute; left: 14px; top: 13px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; height: 44px; background: var(--surface); border: 1px solid var(--field); border-radius: 8px; padding: 0 12px 0 42px; }
.toolbar select { width: 100%; height: 44px; background: var(--surface); border: 1px solid var(--field); border-radius: 8px; padding: 0 10px; }
.toolbar .sel-carrier { flex: 0 1 230px; min-width: 0; }
.toolbar .sel-sort { flex: 0 1 260px; min-width: 0; }

/* Banners and alerts */
.banner { margin: 0; padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.banner.demo { background: var(--warn-bg); color: var(--warn); }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--danger); }
.alert > svg { flex: none; margin-top: 2px; color: var(--danger); }
.alert-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.alert-body p { margin: 0; font-size: 14px; color: var(--danger); }
.alert.info { border-color: var(--ice-line); background: var(--ice); }
.alert.info > svg, .alert.info .alert-body p { color: var(--accent-hover); }

.countline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; align-items: baseline; }
.countline p { margin: 0; font-size: 14px; color: var(--muted); }
.countline strong { color: var(--ink); }
.countline .tz { font-size: 13px; }

/* Buttons */
.btn { height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; font-weight: 700; color: var(--accent-ink); background: var(--accent); border: 1px solid var(--accent); border-radius: 8px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { color: var(--accent-ink); background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.secondary { color: var(--ink); background: var(--surface); border-color: var(--field); }
.btn.secondary:hover { background: var(--surface-2); color: var(--ink); }
.btn.wait, .btn:disabled { color: var(--muted); background: var(--disabled-bg); border-color: var(--line); cursor: not-allowed; }
.btn.small { height: 34px; padding: 0 12px; font-size: 13.5px; }


@media (max-width: 760px) {
  .mast-in { padding: 8px 8px 8px 16px; flex-wrap: nowrap; }
  .brand { gap: 10px; }
  .brand img { width: 32px; height: 31px; }
  .wm-name { font-size: 17px; letter-spacing: .3em; }
  .wm-sub { font-size: 7.5px; letter-spacing: .36em; }
  .mast .titleblock, .mast .updated { display: none; }
  .stripe { height: 4px; }
  .acctbtn { display: inline-flex; }
  .acct { display: none; position: absolute; right: 8px; top: 56px; z-index: 20; width: min(320px, calc(100vw - 16px)); flex-direction: column; align-items: stretch; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: 0 8px 24px rgba(16, 42, 56, .14); }
  .acct.open { display: flex; }
  .acct .avatar { display: none; }
  .viewing { flex-direction: column; align-items: stretch; }
  .viewing select { max-width: none; }
  .adminbar p { padding: 10px 16px; }
  .ptitle { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
  .page { padding: 14px 16px 32px; gap: 12px; }
  .tiles { display: none; }
  .chips { display: flex; }
  .toolbar .sel-carrier, .toolbar .sel-sort { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
