/* FreightX theme — blue / white / yellow (spec §8; linebooker.com as visual reference).
   One stylesheet across the public site, onboarding, dashboards and the staff portal.
   Class names are stable — templates from every stage rely on them. */

:root {
  --fx-blue: #0d47a1;
  --fx-blue-dark: #08306b;
  --fx-navy: #071f4a;
  --fx-blue-light: #e8f0fb;
  --fx-blue-soft: #f3f7fd;
  --fx-yellow: #ffc400;
  --fx-yellow-dark: #e6ad00;
  --fx-yellow-soft: #fff6d6;
  --fx-white: #ffffff;
  --fx-bg: #f5f7fa;
  --fx-text: #16202b;
  --fx-text-muted: #5b6b7c;
  --fx-border: #e2e8f0;
  --fx-danger: #c62828;
  --fx-danger-soft: #fdecea;
  --fx-success: #2e7d32;
  --fx-success-soft: #e6f4e6;
  --fx-warn: #9a5b00;
  --fx-warn-soft: #fff1cc;
  --fx-radius: 10px;
  --fx-radius-lg: 16px;
  --fx-shadow: 0 1px 2px rgba(13, 71, 161, 0.05), 0 4px 16px rgba(13, 71, 161, 0.07);
  --fx-shadow-lg: 0 12px 40px rgba(7, 31, 74, 0.18);
  --fx-font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--fx-font);
  color: var(--fx-text);
  background: var(--fx-bg);
  line-height: 1.6;
  font-size: 15.5px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
h1, h2, h3, h4 { color: var(--fx-blue-dark); line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 12px; font-weight: 800; }
h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; margin-top: 34px; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 12px; }
a { color: var(--fx-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; background: var(--fx-blue-light); padding: 1px 6px; border-radius: 5px; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid rgba(255, 196, 0, 0.7); outline-offset: 2px; }

.fx-container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.fx-muted { color: var(--fx-text-muted); }
.fx-narrow { max-width: 720px; }
.fx-eyebrow {
  display: inline-block; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--fx-yellow-dark); margin-bottom: 10px;
}
.fx-section-alt .fx-eyebrow, .fx-section .fx-eyebrow { color: var(--fx-blue); }
.fx-lead { font-size: 1.1rem; color: var(--fx-text-muted); max-width: 680px; }

/* ---------- Nav ---------- */
.fx-nav { background: var(--fx-blue-dark); position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 6px 24px rgba(7, 31, 74, 0.25); }
.fx-nav-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 18px; }
.fx-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.45rem; font-weight: 900; color: var(--fx-white); text-decoration: none; letter-spacing: -0.03em; }
.fx-brand:hover { text-decoration: none; }
.fx-brand-word b, .fx-brand span { color: var(--fx-yellow); font-weight: inherit; }
.fx-brand-mark { width: 34px; height: 34px; flex: none; }
.fx-nav-links { display: flex; align-items: center; gap: 4px; }
.fx-nav-links a { color: rgba(255,255,255,0.88); text-decoration: none; font-weight: 600; font-size: 0.92rem; padding: 8px 11px; border-radius: 8px; }
.fx-nav-links a:hover { color: var(--fx-white); background: rgba(255,255,255,0.09); text-decoration: none; }
.fx-nav-links a.fx-btn { margin-left: 8px; }
.fx-nav-links .fx-nav-user { color: var(--fx-yellow); }
.fx-inline { display: inline; }
.fx-link-btn { background: none; border: none; color: rgba(255,255,255,0.88); font: inherit; font-weight: 600; font-size: 0.92rem; cursor: pointer; padding: 8px 11px; border-radius: 8px; }
.fx-link-btn:hover { color: var(--fx-white); background: rgba(255,255,255,0.09); }
.fx-nav-bell { position: relative; display: inline-flex; align-items: center; }
.fx-nav-bell svg { width: 20px; height: 20px; }
.fx-nav-badge {
  position: absolute; top: 0; right: 0; background: var(--fx-yellow); color: var(--fx-text);
  border-radius: 12px; font-size: 0.68rem; font-weight: 800; padding: 1px 6px; line-height: 1.3; min-width: 18px; text-align: center;
}
.fx-nav-toggle { display: none; }
.fx-nav-burger { display: none; width: 42px; height: 42px; border-radius: 8px; color: var(--fx-white); align-items: center; justify-content: center; cursor: pointer; }
.fx-nav-burger svg { width: 24px; height: 24px; }

/* ---------- Buttons ---------- */
.fx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 22px; height: 46px; border-radius: var(--fx-radius);
  font-weight: 700; font-size: 0.98rem; font-family: inherit; text-decoration: none;
  border: 2px solid transparent; cursor: pointer; line-height: 1; white-space: nowrap;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.fx-btn:hover { text-decoration: none; transform: translateY(-1px); }
.fx-btn:active { transform: translateY(0); }
.fx-btn-yellow { background: var(--fx-yellow); color: var(--fx-text) !important; box-shadow: 0 6px 18px rgba(255, 196, 0, 0.35); }
.fx-btn-yellow:hover { background: var(--fx-yellow-dark); }
.fx-btn-outline { background: transparent; color: var(--fx-white) !important; border-color: rgba(255,255,255,0.7); }
.fx-btn-outline:hover { border-color: var(--fx-yellow); color: var(--fx-yellow) !important; background: rgba(255,255,255,0.05); }
.fx-btn-blue { background: var(--fx-blue); color: var(--fx-white) !important; box-shadow: 0 6px 18px rgba(13, 71, 161, 0.22); }
.fx-btn-blue:hover { background: var(--fx-blue-dark); }
.fx-btn-outline-blue { background: var(--fx-white); color: var(--fx-blue) !important; border-color: var(--fx-blue); }
.fx-btn-outline-blue:hover { background: var(--fx-blue-light); }
.fx-btn-sm { height: 34px; padding: 0 13px; font-size: 0.84rem; border-radius: 8px; box-shadow: none; }
.fx-btn:disabled, .fx-btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.fx-nav-links .fx-btn-yellow { height: 40px; padding: 0 18px; box-shadow: none; }

/* ---------- Hero (landing) + page headers ---------- */
.fx-hero {
  position: relative; overflow: hidden; color: var(--fx-white);
  background: radial-gradient(1200px 600px at 85% -10%, rgba(255,196,0,0.18), transparent 60%),
              linear-gradient(135deg, var(--fx-blue) 0%, var(--fx-navy) 100%);
  padding: 84px 0 96px;
}
.fx-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.35;
  background-image: linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent 85%);
}
.fx-hero > .fx-container { position: relative; z-index: 1; }
.fx-hero h1 { color: var(--fx-white); font-size: 3rem; margin: 0 0 16px; max-width: 620px; letter-spacing: -0.03em; }
.fx-hero h1 em { font-style: normal; color: var(--fx-yellow); }
.fx-hero-sub { font-size: 1.18rem; max-width: 560px; opacity: 0.9; margin: 0 0 30px; line-height: 1.55; }
.fx-hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }
.fx-hero .fx-eyebrow { color: var(--fx-yellow); }
.fx-hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.fx-hero-trust { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 28px; font-size: 0.9rem; opacity: 0.9; }
.fx-hero-trust span { display: inline-flex; align-items: center; gap: 7px; }
.fx-hero-trust svg { width: 16px; height: 16px; color: var(--fx-yellow); }
.fx-hero-sm { padding: 54px 0 58px; }
.fx-hero-sm h1 { font-size: 2.3rem; }
.fx-hero-sm .fx-hero-sub { margin-bottom: 0; }
.fx-hero-sm .fx-hero-ctas { margin-top: 24px; }

/* product mock in the hero */
.fx-hero-visual { position: relative; min-height: 380px; }
.fx-route { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.55; }
.fx-mock {
  position: relative; background: var(--fx-white); color: var(--fx-text); border-radius: var(--fx-radius-lg);
  box-shadow: var(--fx-shadow-lg); padding: 20px 22px; max-width: 430px; margin-left: auto;
}
.fx-mock-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.fx-mock-ref { font-weight: 800; color: var(--fx-blue); font-size: 1.05rem; }
.fx-mock-route { font-weight: 700; font-size: 1.1rem; margin-bottom: 2px; }
.fx-mock-meta { color: var(--fx-text-muted); font-size: 0.86rem; margin-bottom: 14px; }
.fx-mock-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; position: relative; margin: 10px 0 16px; }
.fx-mock-steps::before { content: ""; position: absolute; left: 10%; right: 10%; top: 9px; height: 3px; background: var(--fx-border); }
.fx-mock-steps::after { content: ""; position: absolute; left: 10%; width: 40%; top: 9px; height: 3px; background: var(--fx-success); }
.fx-mock-step { position: relative; text-align: center; font-size: 0.7rem; color: var(--fx-text-muted); font-weight: 600; }
.fx-mock-step i { display: block; width: 20px; height: 20px; border-radius: 50%; margin: 0 auto 6px; background: var(--fx-white); border: 3px solid var(--fx-border); position: relative; z-index: 1; }
.fx-mock-step.done i { background: var(--fx-success); border-color: var(--fx-success); }
.fx-mock-step.now i { background: var(--fx-yellow); border-color: var(--fx-yellow); box-shadow: 0 0 0 5px rgba(255,196,0,0.25); }
.fx-mock-step.now { color: var(--fx-text); }
.fx-mock-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-top: 1px solid var(--fx-border); font-size: 0.88rem; }
.fx-mock-row strong { font-weight: 700; }
.fx-mock-live { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 700; color: var(--fx-success); }
.fx-mock-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--fx-success); box-shadow: 0 0 0 4px rgba(46,125,50,0.2); }
.fx-mock-float {
  position: absolute; left: -10px; bottom: -22px; background: var(--fx-white); color: var(--fx-text); border-radius: 12px;
  box-shadow: var(--fx-shadow-lg); padding: 10px 14px; display: flex; align-items: center; gap: 10px; font-size: 0.84rem;
}
.fx-mock-float svg { width: 22px; height: 22px; color: var(--fx-success); }
.fx-mock-float strong { display: block; font-size: 0.9rem; }

/* ---------- Sections, cards, grids ---------- */
.fx-section { padding: 64px 0; }
.fx-section-alt { background: var(--fx-white); border-top: 1px solid var(--fx-border); border-bottom: 1px solid var(--fx-border); }
.fx-section-head { max-width: 680px; margin-bottom: 34px; }
.fx-section-head h2 { font-size: 2rem; margin-top: 0; }
.fx-section-head p { color: var(--fx-text-muted); font-size: 1.05rem; }
.fx-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; align-items: start; }
.fx-cards-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.fx-card {
  background: var(--fx-white); border: 1px solid var(--fx-border);
  border-radius: var(--fx-radius-lg); padding: 24px; box-shadow: var(--fx-shadow);
}
.fx-card h2 { margin-top: 0; font-size: 1.2rem; }
.fx-card h3 { margin-top: 0; }
.fx-card > :last-child { margin-bottom: 0; }
.fx-card + .fx-card { margin-top: 14px; }
h2 + .fx-card, h2 + .fx-cards, h2 + form.fx-card, .fx-muted + .fx-card { margin-top: 6px; }
.fx-feature { display: flex; flex-direction: column; gap: 10px; transition: transform .15s ease, box-shadow .15s ease; }
.fx-feature:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(13, 71, 161, 0.12); }
.fx-icon { width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--fx-blue-light); color: var(--fx-blue); flex: none; }
.fx-icon svg { width: 24px; height: 24px; }
.fx-icon-yellow { background: var(--fx-yellow-soft); color: var(--fx-warn); }
.fx-feature h3 { margin: 4px 0 0; }
.fx-feature p { color: var(--fx-text-muted); margin: 0; }

.fx-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.fx-fact { background: var(--fx-white); border: 1px solid var(--fx-border); border-radius: var(--fx-radius); padding: 18px 20px; display: flex; gap: 14px; align-items: center; }
.fx-fact strong { display: block; font-size: 1.05rem; color: var(--fx-blue-dark); }
.fx-fact span { color: var(--fx-text-muted); font-size: 0.88rem; }

/* Small print sitting beside a hero CTA — build version, file size, etc. */
.fx-hero-note { display: inline-block; align-self: center; color: rgba(255,255,255,0.78); font-size: 0.9rem; }
.fx-steps { max-width: 720px; padding-left: 20px; }
.fx-steps li { margin: 10px 0; }
.fx-steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; counter-reset: step; }
.fx-step { position: relative; padding: 26px 22px 22px; background: var(--fx-white); border: 1px solid var(--fx-border); border-radius: var(--fx-radius-lg); box-shadow: var(--fx-shadow); }
.fx-step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: -18px; left: 22px; width: 36px; height: 36px; border-radius: 50%;
  background: var(--fx-yellow); color: var(--fx-text); font-weight: 900; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(255,196,0,0.4);
}
.fx-step h3 { margin: 6px 0 6px; }
.fx-step p { color: var(--fx-text-muted); margin: 0; }

.fx-split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.fx-panel { background: var(--fx-white); border: 1px solid var(--fx-border); border-radius: var(--fx-radius-lg); padding: 30px; box-shadow: var(--fx-shadow); border-top: 5px solid var(--fx-blue); }
.fx-panel-yellow { border-top-color: var(--fx-yellow); }
.fx-panel h3 { font-size: 1.35rem; }
.fx-panel ul { list-style: none; padding: 0; margin: 14px 0 22px; }
.fx-panel li { padding: 7px 0 7px 30px; position: relative; color: var(--fx-text); }
.fx-panel li::before { content: ""; position: absolute; left: 0; top: 11px; width: 18px; height: 18px; border-radius: 50%; background: var(--fx-success-soft); }
.fx-panel li::after { content: ""; position: absolute; left: 6px; top: 15px; width: 5px; height: 9px; border: solid var(--fx-success); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }

.fx-showcase { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.fx-showcase h2 { font-size: 1.9rem; margin-top: 0; }
.fx-showcase p { color: var(--fx-text-muted); font-size: 1.02rem; }
.fx-drawdown { background: var(--fx-white); border: 1px solid var(--fx-border); border-radius: var(--fx-radius-lg); padding: 22px; box-shadow: var(--fx-shadow-lg); }
.fx-drawdown-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.fx-drawdown-head strong { font-size: 1.05rem; color: var(--fx-blue); }
.fx-progress { height: 12px; border-radius: 8px; background: var(--fx-blue-light); overflow: hidden; margin: 8px 0 14px; }
.fx-progress i { display: block; height: 100%; width: 64%; background: linear-gradient(90deg, var(--fx-blue), #1e6fe0); border-radius: 8px; }
.fx-drawdown table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.fx-drawdown td { padding: 7px 0; border-top: 1px solid var(--fx-border); }
.fx-drawdown td:last-child { text-align: right; font-weight: 700; }

.fx-cta-band { background: linear-gradient(135deg, var(--fx-blue-dark), var(--fx-navy)); color: var(--fx-white); padding: 64px 0; text-align: center; }
.fx-cta-band h2 { color: var(--fx-white); font-size: 2rem; margin-top: 0; }
.fx-cta-band p { opacity: 0.85; max-width: 560px; margin: 0 auto 26px; }
.fx-cta-band .fx-hero-ctas { justify-content: center; }

/* ---------- Forms ---------- */
.fx-form-card {
  max-width: 480px; margin: 48px auto; background: var(--fx-white);
  border: 1px solid var(--fx-border); border-radius: var(--fx-radius-lg);
  padding: 34px; box-shadow: var(--fx-shadow-lg);
}
.fx-form-card h1 { font-size: 1.55rem; margin-top: 0; }
.fx-form-card p.fx-muted { color: var(--fx-text-muted); }
.fx-form-card form > p { margin: 0 0 16px; }

/* ---------- Form fields (rendered by templates/django/forms/p.html) ----------
   One wrapper for every field in the project, so inputs, selects and textareas
   share a width and a vertical rhythm instead of each form drifting. */
.fx-field { margin: 0 0 18px; }
.fx-field:last-of-type { margin-bottom: 0; }
.fx-field-label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; color: var(--fx-blue-dark); }
.fx-field-help { display: block; color: var(--fx-text-muted); font-size: 0.82rem; margin-top: 5px; line-height: 1.45; }
.fx-field > input:not([type="checkbox"]):not([type="radio"]),
.fx-field > select, .fx-field > textarea { width: 100%; max-width: 100%; }
.fx-field > textarea { min-height: 110px; resize: vertical; }
.fx-field input[type="checkbox"], .fx-field input[type="radio"] { width: auto; }
/* Checkbox / radio groups: Django emits a bare <ul>; make it a readable column. */
.fx-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fx-fieldset ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fx-fieldset li { margin: 0; }
.fx-fieldset label { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; margin: 0; cursor: pointer; }
.fx-field ul.errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: var(--fx-danger); font-size: 0.85rem; font-weight: 600; }
.fx-field-invalid > input, .fx-field-invalid > select, .fx-field-invalid > textarea { border-color: var(--fx-danger); }
form > ul.errorlist { list-style: none; margin: 0 0 14px; padding: 12px 16px; border-radius: var(--fx-radius);
  background: var(--fx-danger-soft); color: var(--fx-danger); font-weight: 600; border-left: 4px solid var(--fx-danger); }
.fx-form-card label, .fx-card form label, .fx-form label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; }
.fx-form-card input[type="text"], .fx-form-card input[type="email"], .fx-form-card input[type="password"],
.fx-form-card input[type="tel"], .fx-form-card input[type="number"], .fx-form-card select,
.fx-card input[type="text"], .fx-card input[type="email"], .fx-card input[type="tel"], .fx-card input[type="number"],
.fx-card input[type="date"], .fx-card input[type="datetime-local"], .fx-card input[type="password"], .fx-card select, .fx-card textarea,
.fx-form input, .fx-form select, .fx-form textarea, .fx-inline-form input, .fx-inline-form select, .fx-filter-bar select {
  width: 100%; max-width: 420px; padding: 10px 13px; border: 1px solid #cbd5e1; background: var(--fx-white);
  border-radius: var(--fx-radius); font: inherit; font-size: 0.95rem; color: var(--fx-text); transition: border-color .12s, box-shadow .12s;
}
.fx-form-card input, .fx-form-card select { max-width: none; }
.fx-form input[type="checkbox"], .fx-card input[type="checkbox"], .fx-form input[type="radio"] { width: auto; }
.fx-form input[type="file"], .fx-card input[type="file"] { border: 1px dashed #cbd5e1; padding: 10px; background: var(--fx-blue-soft); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--fx-blue); box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.15); }
.fx-form-card .helptext, .fx-card .helptext, .fx-form .helptext { display: block; color: var(--fx-text-muted); font-size: 0.82rem; margin-top: 4px; }
ul.errorlist { color: var(--fx-danger); margin: 4px 0; padding-left: 18px; font-size: 0.88rem; }
.fx-form-card button[type="submit"] { width: 100%; margin-top: 6px; }
.fx-form-foot { text-align: center; margin-top: 18px; color: var(--fx-text-muted); font-size: 0.92rem; }

/* Headline money figure + the sections stacked under it inside one card. */
.fx-balance { font-size: 2.1rem; font-weight: 800; color: var(--fx-blue-dark); letter-spacing: -0.02em; margin: 2px 0 0; line-height: 1.15; }
.fx-balance-held { margin: 4px 0 0; font-size: 0.92rem; }
.fx-card-section { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--fx-border); }
.fx-card-section h3 { margin: 0 0 12px; font-size: 1.02rem; }
.fx-money-form input { width: 100%; margin-bottom: 12px; }
.fx-money-form .fx-btn { width: 100%; }
.fx-form-wide { max-width: 640px; }
.fx-form { max-width: 640px; }
/* Inside an already-narrowed page the card should fill it, not sit off-centre
   in a second, tighter box. */
.fx-narrow .fx-form { max-width: none; }
/* Fields fill their card. Without this the shared `max-width: 420px` above caps
   inputs and selects while textareas (which opt out) run full width — the two
   never line up. Declared after that rule so it wins on source order. */
.fx-field > input, .fx-field > select, .fx-field > textarea { width: 100%; max-width: 100%; }
.fx-form textarea { max-width: none; min-height: 110px; }
.fx-inline-form { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.fx-inline-form input, .fx-inline-form select { width: auto; padding: 8px 11px; }
.fx-inline-form label { margin: 0; }
.fx-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; align-items: center; }
.fx-upload-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.fx-upload-row input[type="file"] { max-width: 240px; font-size: 0.85rem; padding: 6px; }
.fx-upload-row label { font-size: 0.85rem; color: var(--fx-text-muted); margin: 0; }
.fx-filter-bar { display: flex; gap: 18px; margin: 14px 0; flex-wrap: wrap; align-items: center; }
.fx-filter-bar label { font-weight: 600; color: var(--fx-text-muted); }
.fx-filter-bar select { width: auto; margin-left: 6px; padding: 7px 10px; }
.fx-submit-bar { margin-top: 24px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.fx-submit-bar form { display: flex; align-items: center; gap: 14px; }

/* auth split layout */
/* Auth pages are full-bleed. `main` becomes a column so the split panel can
   grow to fill the viewport, and the footer's normal 56px top margin is
   dropped so the blue panel meets it flush — otherwise an off-white band
   shows under the panel. Scoped with :has() so no other page is touched. */
body:has(.fx-auth) main { display: flex; flex-direction: column; }
body:has(.fx-auth) .fx-footer { margin-top: 0; }
.fx-auth { display: grid; grid-template-columns: 1fr 1fr; flex: 1; min-height: 520px; }
.fx-auth-panel { background: linear-gradient(160deg, var(--fx-blue) 0%, var(--fx-navy) 100%); color: var(--fx-white); padding: 56px 56px 64px; display: flex; flex-direction: column; justify-content: flex-start; }
.fx-auth-panel h2 { color: var(--fx-white); font-size: 2rem; margin-top: 0; max-width: 420px; }
.fx-auth-panel p { opacity: 0.88; max-width: 420px; }
.fx-auth-panel ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 14px; max-width: 440px; }
.fx-auth-panel li { display: flex; gap: 12px; align-items: flex-start; }
.fx-auth-panel li svg { width: 22px; height: 22px; color: var(--fx-yellow); flex: none; margin-top: 2px; }
.fx-auth-panel li strong { display: block; }
.fx-auth-panel li span { opacity: 0.8; font-size: 0.92rem; }
.fx-auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.fx-auth-form .fx-form-card { margin: 0; width: 100%; box-shadow: var(--fx-shadow); }

/* ---------- Flash messages ---------- */
.fx-flashes { margin-top: 18px; }
.fx-flash { padding: 12px 16px 12px 18px; border-radius: var(--fx-radius); margin-bottom: 10px; border-left: 5px solid; font-weight: 500; }
.fx-flash-success { background: var(--fx-success-soft); color: var(--fx-success); border-color: var(--fx-success); }
.fx-flash-error { background: var(--fx-danger-soft); color: var(--fx-danger); border-color: var(--fx-danger); }
.fx-flash-warning { background: var(--fx-warn-soft); color: var(--fx-warn); border-color: var(--fx-yellow); }
.fx-flash-info { background: var(--fx-blue-light); color: var(--fx-blue); border-color: var(--fx-blue); }
.fx-flash a { color: inherit; text-decoration: underline; }

/* ---------- Detail rows, badges ---------- */
.fx-detail { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; margin: 14px 0; }
.fx-detail dt { font-weight: 600; color: var(--fx-text-muted); }
.fx-detail dd { margin: 0; }
.fx-detail-table th { text-align: left; width: 200px; color: var(--fx-text-muted); font-weight: 600; }
.fx-badge {
  display: inline-block; padding: 3px 11px; border-radius: 20px; vertical-align: middle;
  font-size: 0.76rem; font-weight: 700; letter-spacing: 0.01em; line-height: 1.5; white-space: nowrap;
}
h1 .fx-badge { font-size: 0.85rem; margin-left: 6px; vertical-align: middle; }
.fx-badge-pending { background: var(--fx-warn-soft); color: var(--fx-warn); }
.fx-badge-active { background: var(--fx-success-soft); color: var(--fx-success); }
.fx-badge-rejected, .fx-badge-suspended { background: var(--fx-danger-soft); color: var(--fx-danger); }
.fx-badge-doc-missing { background: #eef1f5; color: #5a6472; }
.fx-badge-doc-pending, .fx-badge-doc-pending_review { background: var(--fx-warn-soft); color: var(--fx-warn); }
.fx-badge-doc-verified { background: var(--fx-success-soft); color: var(--fx-success); }
.fx-badge-doc-rejected, .fx-badge-doc-expired { background: var(--fx-danger-soft); color: var(--fx-danger); }
.fx-badge-doc-superseded { background: #eef1f5; color: #5a6472; }
.fx-badge-expiring { background: #ffe9cc; color: var(--fx-warn); }
.fx-badge-load-draft { background: #eef1f5; color: #5a6472; }
.fx-badge-load-posted { background: var(--fx-blue-light); color: var(--fx-blue); }
.fx-badge-load-booked, .fx-badge-load-completed { background: var(--fx-success-soft); color: var(--fx-success); }
.fx-badge-load-cancelled, .fx-badge-load-closed { background: var(--fx-danger-soft); color: var(--fx-danger); }
.fx-badge-bid-pending { background: var(--fx-warn-soft); color: var(--fx-warn); }
.fx-badge-bid-accepted { background: var(--fx-success-soft); color: var(--fx-success); }
.fx-badge-bid-rejected, .fx-badge-bid-withdrawn { background: #eef1f5; color: #5a6472; }
.fx-badge-trip-confirmed { background: var(--fx-blue-light); color: var(--fx-blue); }
.fx-badge-trip-en_route_pickup, .fx-badge-trip-loading, .fx-badge-trip-weighed_loaded,
.fx-badge-trip-in_transit, .fx-badge-trip-arrived, .fx-badge-trip-weighed_offloaded { background: var(--fx-warn-soft); color: var(--fx-warn); }
.fx-badge-trip-delivered, .fx-badge-trip-completed { background: var(--fx-success-soft); color: var(--fx-success); }
.fx-badge-trip-disputed, .fx-badge-trip-cancelled { background: var(--fx-danger-soft); color: var(--fx-danger); }
.fx-badge-priority-normal { background: #eef1f5; color: #5a6472; }
.fx-badge-priority-high { background: #ffe9cc; color: var(--fx-warn); }
.fx-badge-priority-critical { background: var(--fx-danger-soft); color: var(--fx-danger); }
.fx-reject-reason { color: var(--fx-danger); font-size: 0.85rem; margin-top: 4px; }
.fx-qr { display: block; margin: 14px auto; width: 220px; height: 220px; }
.fx-secret { font-family: ui-monospace, Menlo, monospace; background: var(--fx-blue-light); padding: 6px 10px; border-radius: 6px; }

/* ---------- Tables ---------- */
.fx-table-card { padding: 0; overflow-x: auto; }
.fx-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.fx-table th, .fx-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--fx-border); vertical-align: top; }
.fx-table th { background: var(--fx-blue-soft); color: var(--fx-blue-dark); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800; white-space: nowrap; }
.fx-table tbody tr:hover td { background: #fafcff; }
.fx-table tr:last-child td { border-bottom: 0; }
.fx-table td .fx-btn { vertical-align: middle; }
.fx-table td .fx-inline + .fx-inline { margin-left: 4px; }
.fx-row-unread td { background: var(--fx-yellow-soft); font-weight: 600; }
.fx-row-alert td { background: var(--fx-danger-soft); }
.fx-timeline { list-style: none; padding-left: 0; max-width: 720px; }
.fx-timeline li { padding: 10px 0 10px 22px; border-bottom: 1px solid var(--fx-border); position: relative; }
.fx-timeline li::before { content: ""; position: absolute; left: 4px; top: 18px; width: 9px; height: 9px; border-radius: 50%; background: var(--fx-blue); }
.fx-card ul { padding-left: 18px; }

/* ---------- Dashboards ---------- */
.fx-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; margin: 14px 0 24px; }
.fx-stat {
  display: flex; flex-direction: column; gap: 4px; background: var(--fx-white); position: relative;
  border: 1px solid var(--fx-border); border-radius: var(--fx-radius-lg); padding: 18px 18px 16px; text-decoration: none; color: var(--fx-text);
  box-shadow: var(--fx-shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.fx-stat::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 4px; border-radius: 0 4px 4px 0; background: var(--fx-blue); }
a.fx-stat:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(13, 71, 161, 0.14); text-decoration: none; }
.fx-stat-attn { background: #fffbea; }
.fx-stat-attn::before { background: var(--fx-yellow); }
.fx-stat-n { font-size: 1.75rem; font-weight: 800; color: var(--fx-blue-dark); line-height: 1.1; letter-spacing: -0.02em; }
.fx-stat-l { font-size: 0.84rem; color: var(--fx-text-muted); font-weight: 500; }
.fx-stat-icon { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 10px; background: var(--fx-blue-light); color: var(--fx-blue); display: flex; align-items: center; justify-content: center; }
.fx-stat-icon svg { width: 18px; height: 18px; }
.fx-stat-attn .fx-stat-icon { background: var(--fx-yellow-soft); color: var(--fx-warn); }
.fx-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 8px; }
.fx-page-head h1 { margin-bottom: 4px; }

/* ---------- Comms ---------- */
.fx-chat-list { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.fx-chat-msg { background: var(--fx-blue-light); border-radius: 14px 14px 14px 4px; padding: 9px 13px; max-width: 78%; align-self: flex-start; }
.fx-chat-msg p { margin: 2px 0 0; }
.fx-chat-mine { background: var(--fx-yellow-soft); align-self: flex-end; border-radius: 14px 14px 4px 14px; }
.fx-chat-meta { font-size: 0.76rem; color: var(--fx-text-muted); font-weight: 700; }
.fx-chat-form { display: flex; gap: 8px; align-items: flex-start; }
.fx-chat-form textarea { flex: 1; max-width: none; min-height: 48px; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: var(--fx-radius); font: inherit; }
.fx-rating-stars { color: #e0a800; letter-spacing: 1px; font-size: 1.05rem; }

/* ---------- Public site + legal ---------- */
.fx-prose { max-width: 820px; }
.fx-prose h2 { margin-top: 34px; }
.fx-prose ul, .fx-prose ol { padding-left: 22px; }
.fx-prose li { margin: 6px 0; }
.fx-faq { border: 1px solid var(--fx-border); border-radius: var(--fx-radius); padding: 14px 18px; margin: 10px 0; background: var(--fx-white); box-shadow: var(--fx-shadow); }
.fx-faq summary { cursor: pointer; font-weight: 700; color: var(--fx-blue-dark); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.fx-faq summary::-webkit-details-marker { display: none; }
.fx-faq summary::after { content: "+"; font-size: 1.3rem; color: var(--fx-blue); font-weight: 400; }
.fx-faq[open] summary::after { content: "–"; }
.fx-faq p { margin: 10px 0 4px; color: var(--fx-text-muted); }
.fx-news { margin-bottom: 16px; }
.fx-news h3 { margin: 4px 0 8px; font-size: 1.25rem; }
.fx-legal { display: grid; grid-template-columns: 230px 1fr; gap: 40px; }
.fx-legal-nav { position: sticky; top: 86px; align-self: start; display: flex; flex-direction: column; gap: 4px; }
.fx-legal-nav h4 { margin: 0 0 8px; color: var(--fx-text-muted); text-transform: uppercase; font-size: 0.76rem; letter-spacing: 0.08em; }
.fx-legal-nav a { text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; color: var(--fx-text); }
.fx-legal-nav a.fx-active, .fx-legal-nav a:hover { background: var(--fx-blue-light); color: var(--fx-blue); font-weight: 700; text-decoration: none; }
.fx-legal-body { background: var(--fx-white); border: 1px solid var(--fx-border); border-radius: var(--fx-radius-lg); padding: 36px 40px; box-shadow: var(--fx-shadow); }
.fx-legal-body h1 { margin-top: 0; }
.fx-legal-body h2 { font-size: 1.15rem; margin-top: 30px; }
.fx-legal-body table { margin: 12px 0; }
.fx-legal-body table th, .fx-legal-body table td { padding: 8px 10px; }
.fx-contact-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 22px; align-items: start; }

/* ---------- Footer ---------- */
.fx-footer { background: var(--fx-navy); color: rgba(255, 255, 255, 0.82); padding: 54px 0 0; margin-top: 56px; }
.fx-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 36px; }
.fx-footer-grid h4 { margin: 0 0 12px; color: var(--fx-white); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; }
.fx-footer-grid a { display: block; color: rgba(255, 255, 255, 0.78); text-decoration: none; margin: 6px 0; font-size: 0.93rem; }
.fx-footer-grid a:hover { color: var(--fx-yellow); }
.fx-footer-grid p { margin: 6px 0; font-size: 0.9rem; max-width: 360px; }
.fx-footer-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.45rem; font-weight: 900; color: var(--fx-white); letter-spacing: -0.03em; margin-bottom: 6px; }
.fx-footer-brand span, .fx-footer-brand b { color: var(--fx-yellow); font-weight: inherit; }
.fx-footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding: 18px 0; font-size: 0.84rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: rgba(255,255,255,0.6); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .fx-hero-grid, .fx-showcase, .fx-split, .fx-auth { grid-template-columns: 1fr; }
  .fx-hero-visual { min-height: 0; margin-top: 10px; }
  .fx-mock { margin: 0 auto; }
  .fx-mock-float { left: 0; bottom: -18px; }
  .fx-auth-panel { padding: 40px 28px; }
  .fx-nav-links { position: absolute; left: 0; right: 0; top: 66px; background: var(--fx-blue-dark); flex-direction: column; align-items: stretch; padding: 10px 16px 16px; gap: 2px; display: none; box-shadow: 0 16px 32px rgba(7,31,74,0.35); }
  .fx-nav-links a, .fx-link-btn { padding: 12px 10px; }
  .fx-nav-links form.fx-inline { display: block; }
  .fx-nav-links .fx-btn { margin: 8px 0 0; }
  .fx-nav-burger { display: inline-flex; }
  .fx-nav-toggle:checked ~ .fx-nav-links { display: flex; }
  .fx-nav-bell { padding: 12px 10px; }
  .fx-nav-badge { position: static; margin-left: 8px; }
}
@media (max-width: 760px) {
  /* Data tables can't reflow usefully on a phone — let them scroll sideways
     inside the page instead of stretching it. Key/value detail tables are
     excluded: those stack fine. */
  .fx-table:not(.fx-detail-table) { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .fx-table:not(.fx-detail-table) td, .fx-table:not(.fx-detail-table) th { padding: 11px 13px; }
  .fx-detail-table th { width: auto; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .fx-container { padding: 0 16px; }
  .fx-page-head, .fx-filter-bar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .fx-page-head .fx-btn, .fx-hero-ctas .fx-btn { width: 100%; }
  .fx-balance { font-size: 1.8rem; }
  .fx-split, .fx-cards { gap: 16px; }
  .fx-hero { padding: 56px 0 64px; }
  .fx-hero h1 { font-size: 2.15rem; }
  .fx-hero-sm h1 { font-size: 1.8rem; }
  .fx-section { padding: 44px 0; }
  .fx-section-head h2, .fx-cta-band h2 { font-size: 1.6rem; }
  .fx-detail { grid-template-columns: 1fr; }
  .fx-legal { grid-template-columns: 1fr; }
  .fx-legal-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .fx-legal-body { padding: 24px 20px; }
  .fx-footer-grid { grid-template-columns: 1fr 1fr; }
  .fx-contact-grid { grid-template-columns: 1fr; }
  .fx-form-card { padding: 24px; margin: 24px auto; }
  .fx-hero-ctas .fx-btn { width: 100%; }
}
