/* RBM Group Portal.
 *
 * The palette is not "a gold that looks about right" — it is the one
 * rbmgroup.co.za actually serves, read off the live site's computed styles:
 * gold #C8A96B on a near-black #0F1113, headings in a serif, body in
 * Montserrat. The portal had been using #C9A227, a brighter, greener gold that
 * belonged to nothing.
 *
 * The chrome is dark and the content is light, deliberately. The public site is
 * dark throughout because it is read for two minutes; this is read for eight
 * hours, and a payroll table on a black ground is a headache by Thursday. The
 * sidebar, the sign-in and the page furniture carry the brand; the tables stay
 * on paper.
 *
 * Montserrat is served from this server (public/static/fonts, 41 KB, one
 * variable file covering every weight) rather than from Google. A portal that
 * stops looking like itself when an office loses its DNS is not a portal.
 * The display serif is Cinzel on the public site; it is not licensed here, so
 * this falls through to Georgia, which is what the site's own stack falls
 * through to as well.
 */
@font-face{
  font-family:"Montserrat";
  /* Stamped by hand: this URL is inside the stylesheet, so View::asset cannot
     reach it. The stylesheet's own stamp changes whenever this file does, so
     bumping the number here is only needed if the font file is replaced — and
     replacing it means editing this line anyway. */
  src:url("/static/fonts/montserrat.woff2?v=1") format("woff2-variations"),
      url("/static/fonts/montserrat.woff2?v=1") format("woff2");
  font-weight:100 900;
  font-style:normal;
  font-display:swap;
}
:root{
  /* Brand */
  --gold:#C8A96B; --gold-dk:#D8BE86; --gold-lt:#DCC496;
  --gold-wash:#211C12; --gold-line:#3A3220;

  /* The site's own ground. Used for the portal's chrome, not its tables. */
  --night:#0F1113; --night-2:#1A1E22; --night-3:#252A2F; --night-line:#2E343A;
  --night-ink:#E8EAEE; --night-ink-2:#B8BDC7; --night-ink-3:#8A9199;

  /* Content — dark theme. The chrome was always dark; now the content is too,
     to match the AU999 apps. Cards lift off a near-black page; inputs sit a
     shade above the card so a field reads as a field. */
  --ink:#E8EAEE; --ink-2:#C2C8D0; --ink-3:#8A9199;
  --paper:#0E1113; --card:#171B1F; --sunk:#12161A; --field:#1E2429;
  --rule:#2A3037; --rule-2:#3A424A;

  --ok:#57C99A; --ok-bg:#122A1E; --warn:#D9B15E; --warn-bg:#2A2410;
  --bad:#E28A7C; --bad-bg:#2C1613;

  --font:"Montserrat",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --font-display:"Cinzel",Georgia,"Times New Roman",serif;

  --shadow:0 1px 2px rgba(15,17,19,.04),0 4px 14px rgba(15,17,19,.06);
  --radius:7px;
}
*{box-sizing:border-box}
html,body{margin:0}
body{
  background:var(--paper); color:var(--ink);
  font:15px/1.6 var(--font);
  -webkit-font-smoothing:antialiased;
}
a{color:var(--gold-dk);text-decoration:none}
a:hover{text-decoration:underline}
/* The display serif, used only where the brand should be heard: page titles
   and the sign-in. Everywhere else Montserrat, because a serif set at 11px in
   a table header is just harder to read. */
h1{font-family:var(--font-display);font-size:23px;margin:0;letter-spacing:.005em;font-weight:700}
h2{font-size:11.5px;margin:0 0 14px;letter-spacing:.11em;text-transform:uppercase;
   color:var(--gold-dk);font-weight:700}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px}

/* ---------- shell ---------- */
.shell{display:grid;grid-template-columns:236px minmax(0,1fr);min-height:100vh}
.sidebar{background:var(--night);border-right:1px solid var(--night);padding:24px 14px 20px;
  display:flex;flex-direction:column;gap:22px;position:sticky;top:0;height:100vh;color:var(--night-ink-2)}
.brand{display:block;padding:0 6px}
.brand img{width:132px;display:block}
.sidebar nav{display:flex;flex-direction:column;gap:1px;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--night-3) transparent}
.sidebar nav::-webkit-scrollbar{width:8px}
.sidebar nav::-webkit-scrollbar-thumb{background:var(--night-3);border-radius:4px}
.sidebar nav::-webkit-scrollbar-track{background:transparent}
.sidebar nav a{padding:8px 12px;border-radius:6px;color:var(--night-ink-2);font-weight:500;font-size:13.5px;
  letter-spacing:.005em;transition:background .12s,color .12s}
.sidebar nav a:hover{background:var(--night-2);color:var(--night-ink);text-decoration:none}
.sidebar nav a.on{background:var(--night-2);color:var(--gold);box-shadow:inset 2px 0 0 var(--gold);font-weight:600}
.ticklist{list-style:none;padding:0;margin:0 0 14px;columns:2;column-gap:28px;font-size:14px}
.ticklist li{padding:3px 0;break-inside:avoid}
.ticklist label{display:flex;align-items:center;gap:8px;text-transform:none;letter-spacing:0;
  font-weight:400;font-size:14px}
.ticklist input{margin:0}
@media (max-width:640px){.ticklist{columns:1}}
.navgroup{padding:14px 12px 4px;font-size:10.5px;text-transform:uppercase;letter-spacing:.09em;
  color:var(--night-ink-3);font-weight:700}
.sidebar nav > .navgroup:first-child{padding-top:4px}
.who{border-top:1px solid var(--night-line);padding-top:14px;font-size:13px;color:var(--night-ink-2)}
.who-name{font-weight:600;color:var(--night-ink)}
.who-role{color:var(--night-ink-3);font-size:11.5px;letter-spacing:.03em;margin-bottom:6px}
.linky{background:none;border:0;padding:0;color:var(--gold);cursor:pointer;font:inherit;font-size:12px}
.linky:hover{color:var(--gold-lt)}
main{padding:28px 32px 64px;min-width:0;max-width:1180px}
@media (max-width:860px){
  .shell{grid-template-columns:1fr}
  .sidebar{position:static;height:auto;flex-direction:row;align-items:center;flex-wrap:wrap;
    gap:12px;padding:14px 16px}
  .brand img{width:108px}
  .sidebar nav{flex-direction:row;flex-wrap:wrap}
  .navgroup{display:none}
  main{padding:20px 16px 48px}
}

/* ---------- page furniture ---------- */
.page-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;
  margin-bottom:22px;padding-bottom:16px;border-bottom:1px solid var(--rule);flex-wrap:wrap;position:relative}
.page-head::after{content:"";position:absolute;left:0;bottom:-1px;width:52px;height:2px;background:var(--gold)}
.lede{color:var(--ink-3);margin:6px 0 0;font-size:14px}
.sub{color:var(--ink-3);font-size:12px}
.hint{color:var(--ink-3);font-size:12px;font-weight:400}
.empty{color:var(--ink-3);margin:0;font-size:14px}

.card{background:var(--card);border:1px solid var(--rule);border-radius:var(--radius);
  padding:20px 22px;box-shadow:var(--shadow);margin-bottom:20px}
.cols{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:20px;align-items:start}
.cols .card{margin-bottom:0}

.stat-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;margin-bottom:22px}
.stat{background:var(--card);border:1px solid var(--rule);border-top:2px solid var(--gold);
  border-radius:var(--radius);padding:15px 17px;box-shadow:var(--shadow)}
.stat .k{font-size:10.5px;letter-spacing:.11em;text-transform:uppercase;color:var(--ink-3);margin-bottom:7px;font-weight:600}
.stat .v{font-family:var(--font-display);font-size:24px;font-weight:700;letter-spacing:0;
  font-variant-numeric:tabular-nums}
.stat .n{font-size:11.5px;color:var(--ink-3);margin-top:5px}

/* ---------- tables ---------- */
.tw{overflow-x:auto;margin:0 -22px -20px;padding:0 22px 4px}
table{border-collapse:collapse;width:100%;font-size:13.5px}
th,td{text-align:left;padding:9px 12px;border-bottom:1px solid var(--rule);vertical-align:top}
thead th{font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-3);
  font-weight:700;white-space:nowrap;background:var(--sunk);border-bottom:1px solid var(--rule-2)}
tbody tr:hover{background:var(--gold-wash)}
/* The whole row is the target; the reference cell is still the real link. */
tbody tr.row-link{cursor:pointer}
tbody tr:last-child td{border-bottom:0}
tfoot td{border-top:2px solid var(--rule-2);border-bottom:0;font-weight:600;background:var(--sunk)}
td.num,th.num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}

/* A compact list inside a card — officers under the registration block. Not a
   data table: no header, no hover, no zebra. It is a list that happens to have
   three columns, and dressing it as a table would make the card look busier
   than the thing it is part of. */
.mini{border-collapse:collapse;width:100%;font-size:13.5px;margin:0}
.mini td{padding:4px 0;border:0;vertical-align:baseline}
.mini td:first-child{padding-right:14px}
.mini td+td{width:1%;white-space:nowrap;padding-left:14px}

/* ---------- pills ---------- */
.pill{display:inline-block;font-size:11px;letter-spacing:.05em;text-transform:uppercase;font-weight:600;padding:2px 8px;border-radius:999px;background:var(--sunk);color:var(--ink-3);white-space:nowrap}
.pill-active,.pill-released,.pill-settled,.pill-in_use{background:var(--ok-bg);color:var(--ok)}
.pill-draft,.pill-warn,.pill-suspended,.pill-in_repair{background:var(--warn-bg);color:var(--warn)}
.pill-terminated,.pill-written_off{background:var(--bad-bg);color:var(--bad)}
.pill-approved,.pill-locked{background:var(--gold-wash);color:var(--gold-dk)}
/* Available is not good news or bad news — it is a car standing still. */
.pill-available{background:var(--sunk);color:var(--ink-3)}

/* ---------- forms ---------- */
.grid-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px 18px;margin-bottom:18px}
.grid-form.inline{align-items:end}
label{display:block;font-size:12px;font-weight:600;color:var(--ink-2)}
textarea{min-height:120px;resize:vertical;font-family:inherit;line-height:1.5}
input,select,textarea{
  width:100%;margin-top:5px;padding:8px 10px;font:inherit;font-size:14px;font-weight:400;
  border:1px solid var(--rule-2);border-radius:6px;background:var(--field);color:var(--ink);
}
input:focus,select:focus,textarea:focus{outline:2px solid var(--gold);outline-offset:1px;border-color:var(--gold)}
.check{display:flex;align-items:center;gap:8px;font-weight:500}
.check input{width:auto;margin:0}

/* A group of tick boxes inside a grid-form: it is one field, so it occupies
   one cell and does not stretch the row it sits in. */
/* A card title with an action beside it. The alternative - a separate Edit
   card further down the page - meant scrolling past everything to change one
   field, and reading the same values twice. */
.card-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:10px}
.card-head h2{margin:0}
.card-head .btn{font-size:12.5px;padding:5px 12px;flex:none}

.sub-head{font-size:12px;font-weight:600;color:var(--ink-3);text-transform:uppercase;
  letter-spacing:.05em;margin:26px 0 6px;padding-top:16px;border-top:1px solid var(--rule)}
.sub-head + .hint{margin:0 0 12px}
.sub-head.first{margin-top:14px;padding-top:0;border-top:0}
/* Two decision buttons side by side in one table cell. */
.inline-decide{display:inline;margin-left:10px}
.inline-decide:first-of-type{margin-left:0}

.checks{border:1px solid var(--rule-2);border-radius:6px;padding:8px 12px 10px;margin:0;align-self:start}
.checks legend{font-size:12px;font-weight:600;color:var(--ink-2);padding:0 4px}
.checks .check{margin-top:5px;font-size:13.5px}
.filters{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:18px;align-items:center}
.filters input,.filters select{width:auto;min-width:170px;margin-top:0}
.form-actions{display:flex;gap:10px;margin-top:20px;padding-top:18px;border-top:1px solid var(--rule)}

.btn{display:inline-block;padding:8px 15px;border-radius:6px;border:1px solid var(--rule-2);background:var(--field);color:var(--ink-2);font-size:13.5px;font-weight:600;cursor:pointer;font-family:inherit}
.btn:hover{background:var(--sunk);text-decoration:none}
.btn-primary{background:var(--gold);border-color:var(--gold);color:var(--night)}
.btn-primary:hover{background:var(--gold-lt);border-color:var(--gold-lt);color:var(--night)}
.btn:focus-visible,.linky:focus-visible,.linkbtn:focus-visible{outline:2px solid var(--gold-dk);outline-offset:2px}
.btn-quiet{border-color:transparent;color:var(--ink-3)}
.btn-wide{width:100%;padding:10px}

.adder{margin-top:16px;border-top:1px solid var(--rule);padding-top:14px}
.adder summary{cursor:pointer;font-size:13px;font-weight:600;color:var(--gold-dk)}
.adder .grid-form{margin-top:14px}

/* ---------- key/value ---------- */
.kv{display:grid;grid-template-columns:auto 1fr;gap:8px 18px;margin:0;font-size:14px}
.kv dt{color:var(--ink-3);font-size:12px;text-transform:uppercase;letter-spacing:.05em;font-weight:600;padding-top:2px}
.kv dd{margin:0}

.doclist{list-style:none;padding:0;margin:0;font-size:14px}
.doclist li{padding:7px 0;border-bottom:1px solid var(--rule)}
.doclist li:last-child{border:0}
.doc-cat{display:inline-block;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--gold-dk);font-weight:600;margin-right:8px}
.doc-exp{color:var(--ink-3);font-size:12px;margin-left:8px}

/* ---------- flashes ---------- */
.flash{padding:11px 15px;border-radius:6px;margin-bottom:18px;font-size:14px;border-left:3px solid}
.flash-success{background:var(--ok-bg);border-color:var(--ok);color:var(--ok)}
.flash-error{background:var(--bad-bg);border-color:var(--bad);color:var(--bad)}
.flash-note{background:var(--gold-wash);border-color:var(--gold);color:var(--ink-2)}

/* ---------- sign in ---------- */
/* The sign-in is the one page an outsider might see, so it looks like the
   company rather than like an admin tool: the site's own near-black, the white
   wordmark, and the card floating on it. */
body.bare{display:grid;place-items:center;align-content:center;min-height:100vh;
  background:var(--night);padding:32px 24px;gap:0}
/* The wordmark sits on the ground, not inside the card: the same white mark the
   sidebar uses, so signing in and being signed in look like one product. */
.page-logo{width:168px;display:block;margin:0 auto 26px}
.signin{background:var(--card);border:1px solid var(--night-line);border-radius:12px;
  box-shadow:0 18px 50px rgba(0,0,0,.45);padding:34px 32px;width:min(380px,92vw);text-align:center}
.signin-logo{width:150px;margin-bottom:22px}
body.bare > .signin-logo{filter:none}
.signin h1{font-size:19px;margin-bottom:2px}
.signin .sub{color:var(--ink-3);font-size:13.5px;margin:0 0 20px}
.signin label{text-align:left;margin-bottom:14px}
.signin .flash{text-align:left}

/* A note attached to the row above it, not a row of its own data. */
.note-row td{background:var(--warn-bg);color:var(--warn);font-size:12.5px;padding-top:7px;padding-bottom:9px;border-bottom:1px solid var(--rule)}

.note-row.agreed td{background:var(--ok-bg);color:var(--ok)}
.inline-form{display:inline}
.rowacts{white-space:nowrap}
.rowacts>*{margin-left:12px}
.rowacts>*:first-child{margin-left:0}
.savebtns{display:flex;flex-wrap:wrap;gap:10px;margin-top:6px}
.payline{display:block;max-width:340px;margin-bottom:12px}
.warn-text{color:var(--warn)}

/* ---------- loan agreement (employee-facing, no login) ---------- */
.agreement{background:#fff;border:1px solid var(--rule);border-radius:10px;box-shadow:var(--shadow);padding:34px 34px 30px;width:min(560px,94vw);margin:40px auto;text-align:left}
.agreement.narrow{width:min(460px,94vw);text-align:center}
.agreement h1{font-size:21px;margin:0 0 4px}
.agreement .sub{color:var(--ink-3);font-size:14px;margin:0 0 22px}
.agreement .signin-logo{width:126px;margin-bottom:20px}
.agreement.narrow .signin-logo{margin-inline:auto}
.terms{display:grid;grid-template-columns:auto 1fr;gap:9px 20px;margin:0 0 22px;padding:18px 20px;background:var(--gold-wash);border-radius:8px;border-left:3px solid var(--gold);font-size:14px}
.agreement.narrow .terms{text-align:left}
.terms dt{color:var(--ink-3);font-size:11.5px;text-transform:uppercase;letter-spacing:.05em;font-weight:600;padding-top:3px}
.terms dd{margin:0}
.terms dd.big{font-size:17px;font-weight:650;font-variant-numeric:tabular-nums}
.terms-body{font-size:14px;line-height:1.65;color:var(--ink-2);margin-bottom:18px}
.agreement .note{font-size:13px;color:var(--ink-3);background:var(--sunk);padding:12px 14px;border-radius:7px;margin:0 0 22px}
.agree-form label{margin-bottom:16px}
.decline{margin-top:22px;border-top:1px solid var(--rule);padding-top:16px}
.decline summary{cursor:pointer;font-size:13px;color:var(--ink-3)}
.decline form{margin-top:14px}

/* ---------- inline editing ---------- */
.edit-row td{background:var(--sunk);padding:0;border-bottom:1px solid var(--rule)}
.edit-row details{padding:0}
.edit-row summary{cursor:pointer;font-size:12.5px;font-weight:600;color:var(--gold-dk);padding:9px 12px;list-style-position:inside}
.edit-row summary:hover{background:var(--gold-wash)}
.edit-row details[open] summary{border-bottom:1px solid var(--rule)}
.edit-row .grid-form{padding:16px 12px 4px;margin-bottom:0}
.edit-row .hint{padding:0 12px 12px;margin:0}
.danger-form{padding:0 12px 12px}
.linky.danger{color:var(--bad)}

/* Detail panels sit side by side; tables below get the full width so their
   inline edit forms are not squeezed into one column. */
.cols-detail{grid-template-columns:repeat(auto-fit,minmax(300px,1fr));margin-bottom:20px}
.edit-row .grid-form{grid-template-columns:repeat(auto-fit,minmax(190px,1fr))}


/* ------------------------------------------------------------- documents -- */
/* A remove control inside a list row: it has to be a form (a POST with a CSRF
   token), but it must not look like one sitting in the middle of a line. */
.inline-del{display:inline;margin:0}
.linkbtn{background:none;border:0;padding:0 0 0 10px;font:inherit;font-size:12px;
  cursor:pointer;color:var(--ink-3);text-decoration:underline}
.linkbtn.danger:hover{color:#B02A2A}
.grid-form.upload{margin-top:14px;padding-top:14px;border-top:1px solid var(--rule)}
.grid-form.upload input[type=file]{padding:9px 10px;background:var(--field);font-size:13px}
label .opt{color:var(--ink-3);font-weight:400;text-transform:none;letter-spacing:0;font-size:11px}
.subrow > td{background:var(--gold-wash);padding-top:0}
.subrow details summary{cursor:pointer;font-size:13px;color:var(--gold-dk);padding:6px 0}

/* --------------------------------------------------------------- requests -- */
.navcount{display:inline-block;min-width:18px;padding:1px 5px;border-radius:9px;
  background:var(--gold);color:var(--night);font-size:11px;font-weight:700;text-align:center;
  vertical-align:middle}
.req{border:1px solid var(--rule);border-radius:10px;padding:14px 16px;margin-bottom:12px}
.req-head{display:flex;justify-content:space-between;align-items:baseline;gap:16px}
.req-amt{font-size:20px;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
.req .reason{background:var(--gold-wash);border-radius:8px;padding:10px 12px;font-size:14px;margin:10px 0}

/* Per-row actions: small, right-aligned, and laid out so a form and a link sit
   on one line without the form's block display pushing them apart. */
.row-actions{white-space:nowrap;text-align:right}
.row-actions .btn{font-size:12px;padding:4px 10px;margin-left:6px}
.row-actions form.inline{display:inline}
.row-actions .btn[disabled]{opacity:.45;cursor:not-allowed}
.inline-check{font-size:13px;color:var(--ink-2);font-weight:500;display:flex;align-items:center;gap:6px}
.inline-check input{margin:0}

/* the statement being worked, in the bank statement list */
tbody tr.row-selected{background:var(--gold-wash);box-shadow:inset 3px 0 0 var(--gold)}

/* Per-user module access (Users page) --------------------------------- */
.modules.full{grid-column:1/-1;border:1px solid var(--rule);border-radius:var(--radius);padding:10px 14px;margin:4px 0 2px}
.modules legend{font-size:12px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;color:var(--ink-3);padding:0 4px}
.modules .opt{color:var(--ink-3);font-weight:400}
.modgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:6px 16px;margin-top:8px}
.modgrid .check{font-size:13.5px;font-weight:500}

/* Invoicing module ---------------------------------------------------- */
.head-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.tabs{display:flex;gap:4px;flex-wrap:wrap;margin:2px 0 16px;border-bottom:1px solid var(--rule)}
.tabs a{padding:8px 14px;font-size:13.5px;font-weight:600;color:var(--ink-3);border-bottom:2px solid transparent;margin-bottom:-1px}
.tabs a.on{color:var(--ink);border-bottom-color:var(--gold)}
.mt{margin-top:14px}
table.lines input,table.lines select{width:100%}
table.lines td.num input{text-align:right}
table.lines th.num,table.lines td.num{width:88px}
tfoot .grand th,tfoot .grand td{border-top:2px solid var(--gold);font-size:15px}
tfoot th.num{text-align:right;font-weight:600;color:var(--ink-3)}
details.card summary{cursor:pointer;font-weight:600}
details.card[open] summary{margin-bottom:12px}

/* Invoicing — from-company panel and line inputs ---------------------- */
.frompanel{background:var(--sunk);border:1px solid var(--rule);border-left:3px solid var(--gold);border-radius:var(--radius);padding:12px 16px;margin:6px 0 16px}
.frompanel-mark{font-size:14px;margin-bottom:5px}
.frompanel-lines{display:flex;flex-wrap:wrap;gap:4px 16px;font-size:12.5px;color:var(--ink-2)}
.frompanel-note{font-size:12px;color:var(--ink-3);margin:9px 0 0}
.warn-txt{color:var(--warn);font-weight:600}
table.lines textarea{width:100%;min-height:32px;resize:vertical;font:inherit;padding:6px 8px}
table.lines input.item{width:100%}

/* Invoicing — live totals bar and line remove ------------------------ */
.totbar{display:flex;justify-content:flex-end;gap:28px;margin-top:14px;padding-top:14px;border-top:1px solid var(--rule);flex-wrap:wrap}
.totbar > div{text-align:right}
.totbar .sub{display:block}
.totbar strong{font-size:16px;font-variant-numeric:tabular-nums}
.totbar .grand strong{font-size:20px;color:var(--gold)}
table.lines td.lineTotal{font-variant-numeric:tabular-nums;white-space:nowrap;font-weight:600}
.rmLine{font-size:18px;line-height:1;color:var(--ink-3)}
.rmLine:hover{color:var(--bad)}

/* ---------------------------------------------------------------------------
   Counterparty upload — the one page in this system a stranger ever sees.
   It sits on the bare layout, outside the login, and is the first impression
   a counterparty gets of how RBM handles their identity documents.
--------------------------------------------------------------------------- */
.cp-upload { max-width: 40rem; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.cp-upload h1 { margin: 1.25rem 0 .25rem; font-size: 1.6rem; letter-spacing: -.01em; }
.cp-upload .sub { color: var(--muted); margin: 0 0 1.75rem; }
.cp-upload h2 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase;
                color: var(--gold); margin: 2.25rem 0 .75rem; }

.cp-progress { margin-bottom: 1.75rem; }
.cp-progress p { margin: .5rem 0 0; font-size: .92rem; color: var(--muted); }
.cp-progress strong { color: var(--ink); }
.cp-bar { height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.cp-bar span { display: block; height: 100%; background: var(--gold);
               transition: width .4s ease; }
@media (prefers-reduced-motion: reduce) { .cp-bar span { transition: none; } }

.cp-form { background: var(--card); border: 1px solid var(--rule); border-radius: 6px;
           padding: 1.25rem; }
.cp-form label { display: block; margin-bottom: 1rem; font-weight: 600; font-size: .9rem; }
.cp-form select, .cp-form input[type=file] { width: 100%; margin-top: .35rem; }
.cp-form .hint { display: block; font-weight: 400; color: var(--muted);
                 font-size: .82rem; margin-top: .3rem; }

.cp-rules { margin-top: 1.5rem; }
.cp-rules ul { margin: 0; padding-left: 1.1rem; }
.cp-rules li { margin-bottom: .5rem; font-size: .92rem; color: var(--muted); }
.cp-rules li strong { color: var(--ink); font-weight: 600; }

.cp-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.cp-list li { display: grid; grid-template-columns: 1.6rem 1fr; gap: .6rem;
              padding: .85rem .25rem; border-bottom: 1px solid var(--rule); }
.cp-tick { color: var(--ok); font-weight: 700; line-height: 1.5; }
.cp-doc { display: block; font-weight: 600; }
.cp-state { display: block; font-size: .82rem; color: var(--muted); margin-top: .1rem; }
.cp-help { display: block; font-size: .82rem; color: var(--muted); margin-top: .3rem;
           opacity: .85; }
/* The blank form, offered where the document is asked for. Underlined and
   spaced away from the guidance so it reads as a thing to click, not as more
   advice — the counterparties who stall on the written authority stall because
   nobody ever showed them one. */
.cp-sample { display: inline-block; font-size: .82rem; margin-top: .35rem;
  text-decoration: underline; text-underline-offset: 2px; }
.cp-list li.is-done .cp-doc { color: var(--muted); font-weight: 400; }
.cp-list li.is-done .cp-state { color: var(--ok); }
.cp-list li.is-bad .cp-state { color: var(--bad); }

.cp-foot { margin-top: 2.5rem; font-size: .8rem; color: var(--muted); line-height: 1.5; }
.cp-message p { color: var(--muted); }

/* Intake form — the long relative of the upload page. */
.cp-intake .cp-form { padding: 1.5rem; }
.cp-intake h2 { margin-top: 2rem; }
.cp-intake h2:first-of-type { margin-top: .5rem; }
.cp-long input[type=text], .cp-long input[type=email], .cp-long input[type=date],
.cp-long input:not([type]), .cp-long select, .cp-long textarea {
  width: 100%; margin-top: .35rem;
}
.cp-long textarea { resize: vertical; }
.cp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 540px) { .cp-row { grid-template-columns: 1fr; } }
.cp-err { display: block; font-weight: 400; color: var(--bad); font-size: .82rem; margin-top: .3rem; }
.hint-block { display: block; color: var(--muted); font-size: .85rem; margin: 0 0 1rem; }
.cp-check { display: grid; grid-template-columns: 1.2rem 1fr; gap: .6rem;
            align-items: start; font-weight: 400; }
.cp-check input { margin-top: .3rem; }
.cp-check .hint { display: block; margin-top: .25rem; }

/* --- the counterparty register ------------------------------------------
   Additions only. Everything that already had a class in this file keeps it:
   a register that invents its own buttons is a register that stops looking
   like the rest of the portal the first time either one is restyled. */

/* Filter tabs are buttons rather than links, because the search box and the
   rating filter have to survive a tab change and a link would drop them. */
.tabs button{padding:8px 14px;font-size:13.5px;font-weight:600;color:var(--ink-3);
  background:none;border:0;border-bottom:2px solid transparent;margin-bottom:-1px;
  cursor:pointer;font-family:inherit}
.tabs button:hover{color:var(--ink-2)}
.tabs button.on{color:var(--ink);border-bottom-color:var(--gold)}
.tabs .navcount{margin-left:6px}

.filter-row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.filter-row input[type=search]{flex:1;min-width:240px;margin-top:0}
.filter-row select{width:auto;min-width:150px;margin-top:0}

.btn-row{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:4px}
.btn-row form{margin:0}
.btn-danger{border-color:var(--bad);color:var(--bad);background:var(--bad-bg)}
.btn-danger:hover{background:var(--bad-bg);border-color:var(--bad);filter:brightness(1.25)}

/* A card asking for a decision. The wash is the same gold the rest of the
   portal uses for "this is waiting on you", not a new colour. */
.card-attention{border-color:var(--gold);background:var(--gold-wash)}
.card-attention h2{margin-top:0}

/* The four risk bands, side by side, so the overall rating is read as the
   highest of four rather than as a verdict handed down from nowhere. */
.bands{display:flex;gap:26px;flex-wrap:wrap;margin:4px 0 14px}
.band-label{font-size:11px;text-transform:uppercase;letter-spacing:.06em;
  color:var(--ink-3);font-weight:600;margin-bottom:5px}

.ok{color:var(--ok);font-weight:600}

/* The custody chain. A list, not a table: the entries are of wildly different
   lengths and a table forces the short ones to carry the tall ones' rows. */
.trail{list-style:none;margin:8px 0 0;padding:0}
.trail li{display:flex;gap:18px;padding:11px 0;border-top:1px solid var(--rule)}
.trail li:first-child{border-top:0}
.trail-when{flex:none;width:118px;font-size:12px;color:var(--ink-3);padding-top:1px}
.trail-what{font-size:13.5px;line-height:1.5}
.trail-what .sub{margin-top:2px}

@media (max-width:640px){
  .trail li{flex-direction:column;gap:3px}
  .trail-when{width:auto}
  .bands{gap:18px}
}

/* Reviewing one document. Folded away by default: the common case is a file
   where nothing needs a decision, and eight open forms is a page nobody
   reads. */
.review summary{cursor:pointer;font-size:13px;font-weight:600;color:var(--gold-dk);
  list-style:none}
.review summary::-webkit-details-marker{display:none}
.review summary:hover{color:var(--gold-lt)}
.review[open] summary{margin-bottom:8px}
.review form{min-width:280px}
.review .btn{margin-bottom:8px}
.review-why{display:block;font-size:12px;color:var(--ink-3);margin:6px 0}
.review-why input{margin-top:3px;font-size:13px}

/* ---------- the onboarding chrome ----------
 * This application is one register and one team page. Two links do not earn
 * 236px of permanent furniture, so it wears a bar where the portal wears a
 * sidebar. Everything else — the ground, the gold, the type — is the portal's,
 * because a counterparty officer who moves between the two should not feel
 * they have changed companies.
 */
.ob{min-height:100vh;display:flex;flex-direction:column}

.ob-bar{display:flex;align-items:center;gap:26px;flex-wrap:wrap;
  padding:13px 32px;background:var(--night);border-bottom:1px solid var(--gold-line);
  position:sticky;top:0;z-index:20}

/* The mark is a wide wordmark. Left unconstrained it renders at its natural
   width and eats the page — which is exactly what it did on the first live
   look. Height, not width, so the bar stays one line whatever the file is. */
.ob-brand{display:flex;align-items:center;gap:14px;color:var(--night-ink);flex:0 0 auto}
.ob-brand:hover{text-decoration:none}
.ob-brand img{height:28px;width:auto;display:block}
.ob-brand span{font-size:10.5px;letter-spacing:.13em;text-transform:uppercase;font-weight:600;
  color:var(--night-ink-3);padding-left:14px;border-left:1px solid var(--night-line);
  line-height:1.25;max-width:104px}

.ob-nav{display:flex;align-items:center;gap:4px;flex:1;min-width:0}
.ob-nav a{padding:8px 13px;border-radius:6px;color:var(--night-ink-2);font-weight:500;
  font-size:13.5px;white-space:nowrap;transition:background .12s,color .12s}
.ob-nav a:hover{background:var(--night-2);color:var(--night-ink);text-decoration:none}
/* The sidebar marks the current page with a gold rule down its left edge; a
   horizontal bar marks it underneath, which is the same idea turned 90°. */
.ob-nav a.on{background:var(--night-2);color:var(--gold);font-weight:600;
  box-shadow:inset 0 -2px 0 var(--gold)}

.ob-who{display:flex;align-items:center;gap:13px;flex:0 0 auto;
  padding-left:18px;border-left:1px solid var(--night-line)}
.ob-name{font-size:13px;font-weight:600;color:var(--night-ink)}
.ob-role{font-size:10.5px;letter-spacing:.09em;text-transform:uppercase;color:var(--night-ink-3)}
.ob-who form{margin:0}

/* main already carries the portal's padding and 1180px ceiling; in the portal
   the grid centred it and here nothing does. */
.ob main{width:100%;margin:0 auto;flex:1}

.ob-foot{border-top:1px solid var(--rule);margin:0 auto;width:100%;max-width:1180px;
  padding:18px 32px 32px;font-size:11.5px;color:var(--ink-3)}

@media (max-width:760px){
  .ob-bar{padding:11px 16px;gap:12px}
  .ob-brand img{height:23px}
  .ob-brand span{display:none}
  .ob-nav{order:3;flex-basis:100%;flex-wrap:wrap}
  .ob-who{margin-left:auto;padding-left:0;border-left:0}
  .ob-foot{padding:16px 16px 28px}
}

/* ---------- the screening card ----------
 * A provider says "nothing found" in 314 legally-hedged characters, and that
 * used to arrive as the value of a one-line text input — readable sixty
 * characters at a time, by dragging. The verdict now comes first as a chip, in
 * three words, and the provider's own wording sits under it as quoted evidence,
 * which is what it is. The wording is still shown in full and never summarised:
 * an inspector reads the provider, not us.
 */
.screen-head{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 12px}
.screen-head .sub{margin:0}
.screen-text{margin:0 0 12px;padding:13px 17px;max-width:76ch;
  background:var(--sunk);border-left:2px solid var(--rule-2);
  border-radius:0 var(--radius) var(--radius) 0;
  font-size:14px;line-height:1.65;color:var(--ink-2)}
.screen-hit{border-left-color:var(--bad)}
.screen-clear{border-left-color:var(--ok)}
.screen-unreadable{border-left-color:var(--warn)}
.screen-input{width:100%;min-height:92px}

/* Recording a screening is rare and correcting one rarer, so the form is folded
   away on a file that already has a result — and left open on one that does
   not, because there it is the thing to do. */
details.editline{margin-top:14px;border-top:1px solid var(--rule);padding-top:12px}
details.editline>summary{cursor:pointer;list-style:none;color:var(--gold-dk);font-size:12.5px}
details.editline>summary::-webkit-details-marker{display:none}
details.editline>summary::before{content:"+ ";font-weight:700}
details.editline[open]>summary::before{content:"− "}
details.editline>summary:hover{text-decoration:underline}
details.editline[open]>summary{margin-bottom:14px}

/* The document cross-check, under the filename it belongs to. Deliberately
   quiet: it is advice for the officer reading the file, not a status the
   system acts on, and it must not compete with the document's real status. */
.check-line{margin-top:6px;display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;max-width:46ch}
.check-line .sub{font-size:11.5px;line-height:1.45}