/* ============================================================
   Backbone P2P — premium UI
   Brand tokens match Backbone Solutions brand.html verbatim
   (Navy 900/800/700 · Gold · Fraunces/Poppins/Open Sans)
   ============================================================ */
@font-face { font-family: "Fraunces"; font-weight: 400 600; font-style: normal; font-display: swap;
  src: url("/static/fonts/fraunces.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("/static/fonts/poppins400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("/static/fonts/poppins500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("/static/fonts/poppins600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("/static/fonts/poppins700.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 300 600; font-style: normal; font-display: swap;
  src: url("/static/fonts/opensans.woff2") format("woff2"); }

:root {
  /* brand — Navy 900 #0B1220 · Navy 800 #0F172A · Navy 700 #1B2A47 · Gold #C9A24A */
  --navy: #0F172A;
  --navy-2: #0B1220;
  --navy-soft: #1B2A47;
  --gold: #C9A24A;
  --gold-lt: #DDBB63;
  --gold-dk: #A5822F;
  --font-display: "Fraunces", Georgia, serif;
  --font-head: "Poppins", -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-body: "Open Sans", -apple-system, "Segoe UI", system-ui, sans-serif;
  /* surfaces */
  --bg: #f5f6f9;
  --bg-2: #eef1f5;
  --panel: #ffffff;
  --ink: #1a2434;
  --ink-soft: #43526b;
  --muted: #78889e;
  --line: #e6eaf0;
  --line-strong: #d6dce6;
  /* semantic */
  --brand: #0F172A;
  --brand-2: #2f6fb0;
  --accent: #eef3f8;
  --ok: #1a7a48; --ok-bg: #e6f5ec;
  --warn: #a8651a; --warn-bg: #fbf0e2;
  --bad: #b42318; --bad-bg: #fbeae8;
  --shadow: 0 1px 2px rgba(16,26,46,.04), 0 4px 16px rgba(16,26,46,.06);
  --shadow-lg: 0 8px 30px rgba(16,26,46,.12);
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1420; --bg-2: #0b111b; --panel: #16202f; --ink: #e7edf5; --ink-soft: #b3c0d3;
    --muted: #7f8ea3; --line: #223046; --line-strong: #2c3c56; --accent: #1a2739;
    --brand-2: #6aa8d8; --ok-bg: #10281b; --warn-bg: #2a1e0e; --bad-bg: #2a1210;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.35);
    --shadow-lg: 0 8px 30px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  --bg: #0e1420; --bg-2: #0b111b; --panel: #16202f; --ink: #e7edf5; --ink-soft: #b3c0d3;
  --muted: #7f8ea3; --line: #223046; --line-strong: #2c3c56; --accent: #1a2739;
  --brand-2: #6aa8d8; --ok-bg: #10281b; --warn-bg: #2a1e0e; --bad-bg: #2a1210;
}
:root[data-theme="light"] {
  --bg: #f5f6f9; --bg-2: #eef1f5; --panel: #ffffff; --ink: #1a2434; --ink-soft: #43526b;
  --muted: #78889e; --line: #e6eaf0; --line-strong: #d6dce6; --accent: #eef3f8;
  --brand-2: #2f6fb0; --ok-bg: #e6f5ec; --warn-bg: #fbf0e2; --bad-bg: #fbeae8;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.55 var(--font-body);
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ---------- app shell: sidebar + content ---------- */
.app { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(178deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #cdd6e6; padding: 18px 14px 28px; position: sticky; top: 0; height: 100vh;
  overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }
.sidebar .logo {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px; margin-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .logo .mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(150deg, var(--navy-soft), var(--navy-2));
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 2px 8px rgba(11,18,32,.3);
}
.mark svg { width: 20px; height: 20px; }
.sidebar .logo .txt { font: 700 16px var(--font-head); color: #fff; letter-spacing: .01em; line-height: 1.1; }
.sidebar .logo .txt small { display: block; font-weight: 500; font-size: 10.5px; letter-spacing: .16em;
  color: var(--gold-lt); text-transform: uppercase; margin-top: 2px; font-family: var(--font-head); }
.nav-group { font: 600 10.5px var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: #6f809c;
  padding: 14px 12px 5px; }
.sidebar a.nav-link {
  display: flex; align-items: center; gap: 11px; color: #c3cddd; text-decoration: none;
  padding: 8px 12px; border-radius: 9px; font: 500 14px var(--font-head); transition: all .13s;
}
.sidebar a.nav-link svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.sidebar a.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar a.nav-link.active { background: rgba(201,162,75,.14); color: #fff; }
.sidebar a.nav-link.active svg { opacity: 1; color: var(--gold-lt); }
.sidebar a.nav-link.active { box-shadow: inset 3px 0 0 var(--gold); }

/* ---------- topbar ---------- */
.topbar-app {
  display: flex; align-items: center; gap: 14px; height: 62px; padding: 0 26px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
  box-shadow: 0 1px 0 rgba(16,26,46,.02);
}
.topbar-app .search { flex: 1; max-width: 420px; position: relative; }
.topbar-app .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted); }
.topbar-app .search input {
  width: 100%; padding: 9px 12px 9px 36px; border: 1px solid var(--line-strong);
  border-radius: 999px; background: var(--bg); font-size: 13.5px;
}
.topbar-app .search input:focus { outline: none; border-color: var(--brand-2); background: var(--panel);
  box-shadow: 0 0 0 3px rgba(47,111,176,.12); }
.topbar-app .spacer { flex: 1; }
.topbar-app .who { text-align: right; line-height: 1.25; }
.topbar-app .who b { font: 600 13.5px var(--font-head); color: var(--ink); display: block; }
.topbar-app .who span { font: 11.5px var(--font-head); color: var(--muted); }
.topbar-app .avatar { width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: linear-gradient(150deg, var(--navy-soft), var(--navy-2)); color: var(--gold-lt);
  display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.topbar-app .logout { color: var(--muted); text-decoration: none; font: 500 13px var(--font-head); padding: 7px 10px;
  border-radius: 8px; border: 1px solid var(--line); }
.topbar-app .logout:hover { color: var(--bad); border-color: var(--bad); }

main { max-width: 1180px; margin: 0 auto; padding: 26px 26px 60px; }

/* ---------- typography ---------- */
h1 { font: 700 23px/1.2 var(--font-head); margin: 0 0 18px; letter-spacing: -.01em; color: var(--ink); }
h2 { font: 650 15.5px/1.3 var(--font-head); margin: 24px 0 11px; color: var(--ink); letter-spacing: -.005em; }
/* brand.html puts every heading level on the head face, not just h1-h3 */
h3, h4, h5 { font-family: var(--font-head); }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- panels / cards ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow); }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(var(--gold-lt), var(--gold-dk)); opacity: .0; transition: opacity .15s; }
.kpi:hover::before { opacity: 1; }
.kpi .n { font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--navy); letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; }
.kpi .l { font: 600 11px var(--font-head); color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
  margin-top: 3px; }
@media (prefers-color-scheme: dark) { .kpi .n { color: var(--gold-lt); } }
:root[data-theme="dark"] .kpi .n { color: var(--gold-lt); }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  margin-bottom: 18px; }
th { text-align: left; font: 650 11px var(--font-head); text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: var(--bg-2); padding: 11px 14px; border-bottom: 1px solid var(--line); }
td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; font-size: 14px; }
tr:first-child td { border-top: 0; }
tbody tr:hover td, table tr:hover td { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.winner td { background: var(--ok-bg) !important; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--navy); color: #fff; border: 0;
  border-radius: 9px; padding: 9px 17px; font: 600 14px var(--font-head); cursor: pointer;
  text-decoration: none; transition: all .14s; box-shadow: 0 1px 2px rgba(16,26,46,.12); }
.btn:hover { background: var(--navy-soft); text-decoration: none; transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16,26,46,.18); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: var(--panel); color: var(--navy); border: 1px solid var(--line-strong); box-shadow: none; }
.btn.secondary:hover { background: var(--bg-2); border-color: var(--brand-2); color: var(--brand-2); }
.btn.danger { background: var(--bad); }
.btn.danger:hover { background: #922017; }
.btn.gold { background: linear-gradient(145deg, var(--gold-lt), var(--gold-dk)); color: var(--navy-2); }
.btn.gold:hover { filter: brightness(1.05); }
.btn.small { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; }
:root[data-theme="dark"] .btn.secondary { color: var(--gold-lt); }
@media (prefers-color-scheme: dark) { .btn.secondary { color: var(--gold-lt); } }

/* ---------- forms ---------- */
form.inline { display: inline; }
label { display: block; font: 550 12.5px var(--font-head); color: var(--ink-soft); margin: 11px 0 4px; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong);
  border-radius: 9px; font: inherit; font-size: 14px; background: var(--panel); color: var(--ink);
  transition: border-color .13s, box-shadow .13s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(47,111,176,.13); }
textarea { min-height: 74px; resize: vertical; }
::placeholder { color: var(--muted); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 20px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font: 650 11.5px var(--font-head); background: var(--accent); color: var(--brand); letter-spacing: .01em;
  white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
/* Inline advisory that must be noticed but is not an error — e.g. two settings that
   disagree in a way that may well be deliberate. Uses the warn tokens so it follows
   the light/dark theme instead of hardcoding a colour. */
.warn-note { margin: 0 0 12px; font-size: 13px; color: var(--warn); background: var(--warn-bg);
  border-left: 3px solid var(--warn); padding: 9px 13px; border-radius: 0 8px 8px 0; }
/* Explains what the public/private entity choice actually changes. Not a warning —
   this is confirmation of a deliberate setting, so it uses the neutral surface. */
.entity-effects { margin: 12px 0 4px; padding: 12px 15px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.entity-effects ul { margin: 7px 0 8px; padding-left: 19px; }
.entity-effects li { margin: 3px 0; }

/* ---------- bar chart rows ---------- */
.bar-row { display: grid; grid-template-columns: 190px 1fr 96px; gap: 12px; align-items: center;
  margin: 9px 0; font-size: 13.5px; }
.bar { height: 16px; background: var(--bg-2); border-radius: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 8px;
  background: linear-gradient(90deg, var(--brand-2), var(--navy)); transition: width .5s ease; }
.bar-row > div:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-soft); }

.muted { color: var(--muted); font-size: 13px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.topbar h1 { margin: 0; }
.error { background: var(--bad-bg); color: var(--bad); border-radius: 9px; padding: 11px 14px;
  margin-bottom: 14px; font-size: 14px; border: 1px solid color-mix(in srgb, var(--bad) 22%, transparent); }

/* ---------- callout panels (alerts / my actions) ---------- */
.callout { border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.callout h2 { margin-top: 0; }
.callout.gold { background: linear-gradient(140deg, color-mix(in srgb, var(--gold-lt) 16%, var(--panel)), var(--panel));
  border-color: color-mix(in srgb, var(--gold) 35%, var(--line)); }
.callout.blue { background: linear-gradient(140deg, color-mix(in srgb, var(--brand-2) 10%, var(--panel)), var(--panel));
  border-color: color-mix(in srgb, var(--brand-2) 28%, var(--line)); }
.callout .row { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 13.5px; }

/* ---------- lifecycle progress tracker ---------- */
.tracker { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding: 6px 2px 2px;
  margin-bottom: 18px; }
.tracker .step { flex: 1 1 0; min-width: 92px; text-align: center; position: relative; }
.tracker .step::before { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px;
  background: var(--line-strong); z-index: 0; }
.tracker .step:first-child::before { display: none; }
.tracker .step .dot { position: relative; z-index: 1; width: 28px; height: 28px; margin: 0 auto 7px;
  border-radius: 50%; background: var(--panel); border: 2px solid var(--line-strong); color: var(--muted);
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700; }
.tracker .step .lbl { font: 11.5px var(--font-head); color: var(--muted); line-height: 1.3; padding: 0 3px; }
.tracker .step.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.tracker .step.done::before { background: var(--ok); }
.tracker .step.current .dot { background: linear-gradient(150deg, var(--gold-lt), var(--gold-dk));
  border-color: var(--gold-dk); color: var(--navy-2); box-shadow: 0 0 0 4px rgba(201,162,75,.22); }
.tracker .step.current .lbl { color: var(--ink); font-weight: 650; }
.tracker .step.stopped .dot { background: var(--bad); border-color: var(--bad); color: #fff; }
.tracker .step.stopped .lbl { color: var(--bad); font-weight: 650; }

/* ---------- empty states ---------- */
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty img { width: 132px; height: 132px; opacity: .9; margin-bottom: 14px; }
.empty h3 { margin: 0 0 6px; color: var(--ink); font-size: 16px; }

/* ---------- login / register ---------- */
.auth { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }
.auth .brandside {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff;
  padding: 60px 56px; display: flex; flex-direction: column; justify-content: space-between;
  /* gap stops the footer butting against the feature list once the copy grows;
     space-between alone lets them touch as soon as content fills the panel */
  gap: 40px; position: relative; overflow: hidden;
}
/* Optional hero art — drop an image at /static/img/login-bg.png and it appears
   behind the copy. The navy scrim on top is part of the same layer, so text stays
   readable over any photograph; with no image present the scrim alone renders as
   a clean gradient, so the page never looks broken while art is being sourced. */
.auth .brandside::before { content: ""; position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(155deg, rgba(11,18,32,.93) 0%, rgba(11,18,32,.80) 42%, rgba(11,18,32,.58) 100%),
    url("/static/img/login-bg.png");
  background-size: cover; background-position: center; }
.auth .brandside > * { position: relative; z-index: 1; }
.auth .brandside::after { content: ""; position: absolute; right: -140px; bottom: -140px; width: 440px; height: 440px;
  border-radius: 50%; background: radial-gradient(circle, rgba(201,162,75,.26), transparent 70%); z-index: 0; }
.auth .brandside .mark { width: 66px; height: 66px; border-radius: 18px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16); display: grid; place-items: center;
  box-shadow: 0 4px 20px rgba(11,18,32,.45); }
.auth .brandside .mark svg { width: 36px; height: 36px; }

/* gold eyebrow pill — the brand guide's own hero pattern */
.auth .brandside .eyebrow { display: inline-flex; align-items: center; gap: 9px;
  font: 600 12px var(--font-head); letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold-lt); background: rgba(201,162,74,.12); border: 1px solid rgba(201,162,74,.30);
  padding: 8px 16px; border-radius: 999px; margin: 30px 0 0; }
.auth .brandside .eyebrow .dot { width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold-lt); box-shadow: 0 0 0 4px rgba(221,187,99,.20); }

.auth .brandside h1 { font-family: var(--font-display); font-weight: 500; color: #fff;
  font-size: clamp(34px, 3.1vw, 50px); line-height: 1.1; margin: 22px 0 18px;
  max-width: 15ch; letter-spacing: -.02em; }
/* the brand's hero accent: gold italic on the phrase that matters */
.auth .brandside h1 .accent { color: var(--gold-lt); font-style: italic; }
.auth .brandside p { color: #c2cee2; font-size: clamp(15.5px, 1.1vw, 18px); max-width: 44ch; line-height: 1.65; font-weight: 300; }
.auth .brandside .feats { display: flex; flex-direction: column; gap: 16px; margin-top: 38px; font-family: var(--font-head); }
.auth .brandside .feats div { display: flex; align-items: center; gap: 14px; color: #e2e9f4;
  font-size: clamp(14.5px, 1vw, 16.5px); font-weight: 500; }
.auth .brandside .feats div::before { content: "✓"; width: 28px; height: 28px; flex: none; border-radius: 50%;
  background: rgba(201,162,75,.20); border: 1px solid rgba(201,162,74,.34);
  color: var(--gold-lt); display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.auth .brandside .foot { color: #8593ab; font: 500 13px var(--font-head); position: relative; z-index: 1; }

/* The panel clips (overflow:hidden keeps the gold glow inside), so on shorter
   screens — 768px laptops, or a browser with toolbars eating height — the tall
   type would push the footer out of sight. Tighten the scale instead of letting
   content disappear. Large displays keep the full-size treatment. */
@media (max-height: 900px) {
  .auth .brandside { padding: 42px 48px; gap: 22px; }
  .auth .brandside .mark { width: 54px; height: 54px; border-radius: 15px; }
  .auth .brandside .mark svg { width: 29px; height: 29px; }
  .auth .brandside .eyebrow { margin-top: 22px; padding: 7px 14px; font-size: 11px; }
  .auth .brandside h1 { font-size: clamp(27px, 2.5vw, 36px); margin: 16px 0 12px; }
  .auth .brandside p { font-size: 15px; line-height: 1.55; }
  .auth .brandside .feats { gap: 11px; margin-top: 24px; }
  .auth .brandside .feats div { font-size: 14px; gap: 11px; }
  .auth .brandside .feats div::before { width: 24px; height: 24px; font-size: 12px; }
}
.auth .formside { display: grid; place-items: center; padding: 40px; background: var(--bg); }
.auth .formside .box { width: 100%; max-width: 380px; }
.auth .formside .box h2 { font-size: 22px; color: var(--ink); margin: 0 0 4px; }
.auth .formside .box .sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.auth .formside .box .btn { width: 100%; justify-content: center; padding: 11px; margin-top: 8px; }

/* legacy login-wrap fallback */
.login-wrap { max-width: 400px; margin: 9vh auto; }
.login-wrap .brand-big { text-align: center; font: 700 27px var(--font-head); color: var(--brand); margin-bottom: 18px; }

/* ---------- page section heading ---------- */
.page-head { margin-bottom: 20px; }
.page-head .eyebrow { font: 700 11px var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-dk); }
.page-head h1 { margin: 4px 0 0; }
.page-head p { color: var(--muted); margin: 6px 0 0; font-size: 14px; }

/* ---------- mobile ---------- */
.menu-btn { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; width: 244px; transform: translateX(-100%);
    transition: transform .2s; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: translateX(0); }
  .menu-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px;
    border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth .brandside { display: none; }
  .bar-row { grid-template-columns: 120px 1fr 80px; }
}
@media (max-width: 560px) {
  main { padding: 18px 14px 50px; }
  .topbar-app { padding: 0 14px; }
  .topbar-app .who { display: none; }
}

/* ---- Date fields: bigger calendar affordance, quick picks, plain-English echo ---- */
.datefield input[type="date"] { cursor: pointer; }
/* Enlarge and brand the native calendar button (WebKit/Blink).
   Keep it in normal flow - absolute positioning escapes the input box. */
.datefield input[type="date"]::-webkit-calendar-picker-indicator {
  width: 18px; height: 18px; padding: 2px; margin-left: 4px;
  border-radius: 5px; cursor: pointer;
  opacity: .55; transition: opacity .15s ease, background .15s ease;
}
.datefield input[type="date"]:hover::-webkit-calendar-picker-indicator,
.datefield input[type="date"]:focus::-webkit-calendar-picker-indicator {
  opacity: 1; background: rgba(201, 162, 75, .18);
}
.date-echo { font-size: 12px; color: var(--ink-soft); margin-top: 4px; min-height: 15px; }
.date-echo.warn { color: #b45309; }
/* Quick picks stay out of the way until the field is in use - they are a
   shortcut, not the primary control (the calendar itself is). */
.date-picks { display: none; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.datefield:hover .date-picks,
.datefield:focus-within .date-picks { display: flex; }
.date-pick {
  font: 500 11.5px var(--font-head); line-height: 1; cursor: pointer;
  padding: 5px 9px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink-soft);
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.date-pick:hover { border-color: var(--gold); color: var(--ink); background: rgba(201, 162, 75, .10); }
.date-pick.clear { color: var(--muted); }
.date-pick.clear:hover { border-color: var(--line-strong); background: transparent; color: var(--ink-soft); }
@media (prefers-color-scheme: dark) {
  .datefield input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1) brightness(1.6); }
}


/* ---- Sourcing project workspace nav: one page, every section a click away ---- */
.proj-nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; flex-wrap: wrap; gap: 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px; margin: 0 0 16px;
  box-shadow: 0 4px 14px rgba(11, 18, 32, .05);
}
.proj-nav a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 7px;
  font: 600 13px var(--font-head); color: var(--ink-soft); text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.proj-nav a:hover { background: rgba(201, 162, 75, .12); color: var(--ink); }
.proj-nav .chip {
  font: 600 11px var(--font-head); line-height: 1;
  padding: 3px 7px; border-radius: 999px;
  background: var(--line); color: var(--ink-soft);
}
.proj-nav .chip.warn { background: #fde8d7; color: #9a3412; }


/* ---- Source-to-pay journey: the whole process at first glance ---- */
.journey {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  border-radius: 14px; padding: 18px 20px 20px; margin: 0 0 20px;
  color: #e7edf5; overflow-x: auto;
}
.journey .eyebrow { color: var(--gold-lt); }
.journey-head { display: flex; justify-content: space-between; align-items: flex-end;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.journey-head strong { font: 600 15px var(--font-head); }
.journey-head .muted { color: #8fa0b8; }
.journey-track { display: flex; align-items: stretch; min-width: 860px; }
.j-step {
  flex: 1; min-width: 86px; text-decoration: none; color: #b3c0d3;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 5px; padding: 8px 4px; border-radius: 10px;
  transition: background .15s ease, color .15s ease;
}
.j-step:hover { background: rgba(231, 200, 120, .10); color: #fff; }
.j-dot {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy-soft); color: #b3c0d3;
  font-size: 12px; font-weight: 700;
  border: 1.5px solid rgba(179, 192, 211, .35);
}
.j-step.mine .j-dot { background: var(--gold); border-color: var(--gold-lt); color: var(--navy-2); }
.j-step.mine { color: #fff; }
.j-step.mine .j-name { color: var(--gold-lt); }
.j-name { font: 700 12.5px var(--font-head); display: flex; gap: 5px; align-items: center; }
.j-count {
  font: 700 10.5px var(--font-head); line-height: 1;
  background: rgba(231, 200, 120, .22); color: var(--gold-lt);
  padding: 3px 6px; border-radius: 999px;
}
.j-hint { font-size: 10.5px; color: #8fa0b8; line-height: 1.35; max-width: 110px; }
.j-step.mine .j-hint { color: #c9d4e4; }
.j-link {
  align-self: center; width: 18px; height: 2px; flex: 0 0 auto;
  background: linear-gradient(90deg, rgba(179,192,211,.35), rgba(231,200,120,.5));
  margin-top: -26px;
}
@media (max-width: 760px) { .journey-track { min-width: 760px; } }


/* ---- KPI card row (360 page, dashboard lenses) ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin: 0 0 18px; }
.cards .card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; box-shadow: 0 4px 14px rgba(11, 18, 32, .04); }
.cards .num { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }
.cards .num.warn { color: #9a3412; }
.cards .lbl { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.cards .lbl a { color: inherit; }
