/* =====================================================================
   Dezhub - admin stylesheet
   Palette: deep evergreen shell, cool paper canvas, marigold for action
   ===================================================================== */

:root {
  --evergreen:    #123C3A;   /* sidebar */
  --evergreen-2:  #1A4D4A;   /* sidebar hover */
  --canvas:       #F3F5F4;
  --paper:        #FFFFFF;
  --ink:          #1C2A29;
  --muted:        #5D6D6A;
  --line:         #DCE3E1;
  --line-strong:  #C3CECB;
  --marigold:     #E3A13B;   /* primary action */
  --marigold-dk:  #C98722;
  --marigold-ink: #3A2606;

  --ok:   #1E7A4C;  --ok-bg:   #E3F3EA;
  --warn: #8A5300;  --warn-bg: #FCF0DC;
  --bad:  #B42318;  --bad-bg:  #FCE8E6;
  --info: #1F5F8B;  --info-bg: #E4EFF7;

  --radius-sm: 6px;
  --radius:    10px;
  --sidebar-w: 248px;
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
}
a { color: var(--info); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }

/* ---------- Shell ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--evergreen);
  color: #E6EFED;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: .65rem;
  padding: 1.1rem 1.25rem;
  color: #fff; text-decoration: none;
  font-weight: 700; font-size: 1.05rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--marigold); color: var(--marigold-ink);
  font-weight: 700;
}
.nav { padding: .75rem .6rem 2rem; }
.nav-section { margin-top: 1.1rem; }
.nav-heading {
  font-size: .78rem; font-weight: 600;
  color: rgba(230,239,237,.55);
  padding: 0 .7rem .3rem;
}
.nav-link {
  display: block;
  padding: .45rem .7rem;
  border-radius: var(--radius-sm);
  color: #D5E2DF; text-decoration: none;
  font-size: .94rem;
}
.nav-link:hover { background: var(--evergreen-2); color: #fff; }
.nav-link.is-active {
  background: rgba(227,161,59,.16);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--marigold);
}
.nav-top { font-weight: 600; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 1rem;
  height: 60px; padding: 0 1.5rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-spacer { flex: 1; }
.menu-btn {
  display: none;
  width: 40px; height: 40px; border: 0; background: none; cursor: pointer;
  flex-direction: column; justify-content: center; gap: 5px; padding: 0 9px;
}
.menu-btn span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }

.usermenu { position: relative; }
.usermenu summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: .6rem;
  padding: .3rem .5rem; border-radius: var(--radius-sm);
}
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: var(--canvas); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--evergreen); color: #fff;
  display: grid; place-items: center; font-size: .8rem; font-weight: 600;
}
.usermenu-name { display: flex; flex-direction: column; font-size: .9rem; font-weight: 600; line-height: 1.2; }
.usermenu-name small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.usermenu-panel {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 190px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(18,60,58,.12);
  padding: .35rem;
}
.usermenu-panel a {
  display: block; padding: .5rem .7rem; border-radius: var(--radius-sm);
  color: var(--ink); text-decoration: none; font-size: .92rem;
}
.usermenu-panel a:hover { background: var(--canvas); }

.content { padding: 1.5rem; max-width: 1280px; width: 100%; }
.page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 1.25rem;
}
.page-head h1 { margin: 0; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Panels ---------- */
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .9rem; }
.panel-head h2 { margin: 0; }
.panel-flush { padding: 0; }
.panel-flush .panel-head { padding: 1rem 1.25rem 0; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1.25rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1rem;
  font: inherit; font-weight: 600; font-size: .92rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--paper); color: var(--ink);
  text-decoration: none; cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--marigold); border-color: var(--marigold); color: var(--marigold-ink); }
.btn-primary:hover { background: var(--marigold-dk); border-color: var(--marigold-dk); }
.btn-dark { background: var(--evergreen); border-color: var(--evergreen); color: #fff; }
.btn-dark:hover { background: var(--evergreen-2); }
.btn-danger { color: var(--bad); border-color: #EBB5AF; }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn-sm { padding: .3rem .65rem; font-size: .84rem; }
.btn-link { border: 0; background: none; padding: 0; color: var(--info); font-weight: 500; cursor: pointer; font: inherit; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-block { width: 100%; }
.inline-form { display: inline; margin: 0; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem 1.25rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field label { font-weight: 600; font-size: .9rem; }
.field .hint { font-size: .82rem; color: var(--muted); }
.req { color: var(--bad); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel],
input[type=date], input[type=search], select, textarea {
  width: 100%;
  font: inherit; color: var(--ink);
  padding: .55rem .7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--evergreen); box-shadow: 0 0 0 3px rgba(18,60,58,.15); }
textarea { min-height: 90px; resize: vertical; }
.input-with-btn { display: flex; gap: .4rem; }
.input-with-btn input { flex: 1; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--evergreen); }
.form-actions { display: flex; gap: .6rem; margin-top: 1.25rem; flex-wrap: wrap; }
.field-error { color: var(--bad); font-size: .84rem; }

.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { min-width: 170px; }
.filters .grow { flex: 1; min-width: 220px; }

/* ---------- Alerts ---------- */
.alert {
  padding: .75rem 1rem; border-radius: var(--radius-sm);
  margin-bottom: 1rem; border: 1px solid transparent; font-size: .94rem;
}
.alert-success { background: var(--ok-bg);   color: var(--ok);   border-color: #BFE3CE; }
.alert-warn    { background: var(--warn-bg); color: var(--warn); border-color: #F1D5A6; }
.alert-error   { background: var(--bad-bg);  color: var(--bad);  border-color: #F3C1BB; }
.alert-info    { background: var(--info-bg); color: var(--info); border-color: #BCD5E8; }
.alert strong.code {
  font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem;
  background: rgba(255,255,255,.7); padding: .1rem .4rem; border-radius: 4px; color: var(--ink);
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .65rem .9rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-weight: 600; color: var(--muted); font-size: .84rem; background: #F8FAF9; white-space: nowrap; }
.table tbody tr:hover { background: #FAFBFA; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions > * + * { margin-left: .35rem; }
.table-empty { padding: 2rem; text-align: center; color: var(--muted); }

/* ---------- Status pills ---------- */
.pill {
  display: inline-block; padding: .12rem .55rem;
  border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap;
}
.pill-ok      { background: var(--ok-bg);   color: var(--ok); }
.pill-warn    { background: var(--warn-bg); color: var(--warn); }
.pill-bad     { background: var(--bad-bg);  color: var(--bad); }
.pill-info    { background: var(--info-bg); color: var(--info); }
.pill-neutral { background: #ECEFEE;        color: var(--muted); }

/* ---------- Pager ---------- */
.pager { display: flex; gap: .3rem; padding: 1rem 1.25rem; flex-wrap: wrap; }
.pager a {
  min-width: 34px; text-align: center; padding: .3rem .55rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  text-decoration: none; color: var(--ink); font-size: .88rem;
}
.pager a.is-current { background: var(--evergreen); color: #fff; border-color: var(--evergreen); }
.pager-gap { padding: .3rem .2rem; color: var(--muted); }

/* ---------- Dashboard: provider pipeline (the signature element) ---------- */
.pipeline {
  display: grid;
  grid-template-columns: repeat(var(--steps, 7), minmax(0,1fr));
  counter-reset: step;
  margin: .25rem 0 0;
  padding: 0;
  list-style: none;
}
.pipeline li { position: relative; }
.pipeline a {
  display: block; text-decoration: none; color: var(--ink);
  padding: 1.6rem .5rem .25rem;
  text-align: center;
  border-radius: var(--radius-sm);
}
.pipeline a:hover { background: var(--canvas); }
/* connecting track */
.pipeline li::before {
  content: ""; position: absolute; top: .72rem; left: 0; right: 0;
  height: 3px; background: var(--line);
}
.pipeline li:first-child::before { left: 50%; }
.pipeline li:last-child::before  { right: 50%; }
/* node */
.pipeline li::after {
  content: ""; position: absolute; top: .38rem; left: 50%;
  width: 14px; height: 14px; margin-left: -7px;
  border-radius: 50%; background: var(--paper); border: 3px solid var(--line-strong);
}
.pipeline li.has-count::after { border-color: var(--evergreen); background: var(--evergreen); }
.pipeline li.is-final::after  { border-color: var(--marigold); background: var(--marigold); }
.pipeline .count { display: block; font-size: 1.9rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pipeline .label { display: block; font-size: .84rem; color: var(--muted); margin-top: .2rem; }

.figures { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
.figure { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; }
.figure .value { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.figure .caption { color: var(--muted); font-size: .88rem; }

.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.activity li:last-child { border-bottom: 0; }
.activity time { color: var(--muted); font-size: .84rem; white-space: nowrap; }

/* ---------- Role matrix ---------- */
.matrix th.role { text-align: center; min-width: 110px; }
.matrix td.cell { text-align: center; }
.matrix tr.module-row td { background: #F4F7F6; font-weight: 600; }
.matrix input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--evergreen); }

/* ---------- Empty state ---------- */
.empty-state { background: var(--paper); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 2.5rem 1.5rem; text-align: center; }
.empty-state p { color: var(--muted); }

/* ---------- Auth pages (login / install) ---------- */
.auth {
  min-height: 100vh; width: 100%;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
}
.auth-side {
  background: var(--evergreen); color: #E6EFED;
  padding: 3rem;
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side .brand { border: 0; padding: 0; font-size: 1.2rem; }
.auth-journey { list-style: none; padding: 0; margin: 2rem 0; max-width: 420px; }
.auth-journey li {
  position: relative; padding: 0 0 1.1rem 1.9rem; color: #CFDDDA;
}
.auth-journey li::before {
  content: ""; position: absolute; left: 4px; top: .45rem;
  width: 10px; height: 10px; border-radius: 50%; background: var(--marigold);
}
.auth-journey li::after {
  content: ""; position: absolute; left: 8px; top: 1.1rem; bottom: -.2rem;
  width: 2px; background: rgba(255,255,255,.15);
}
.auth-journey li:last-child::after { display: none; }
.auth-journey strong { color: #fff; display: block; font-weight: 600; }
.auth-side h2 { color: #fff; font-size: 1.6rem; max-width: 18ch; }
.auth-foot { font-size: .84rem; color: rgba(230,239,237,.6); }
.auth-main { background: var(--paper); display: flex; align-items: center; padding: 3rem; }
.auth-card { width: 100%; }
.auth-card h1 { font-size: 1.45rem; }
.auth-card .field { margin-bottom: 1rem; }

/* ---------- Forms: extras ---------- */
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.check-list { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.check-list-col { flex-direction: column; }
.radio-group { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .5rem .75rem; }
.skill-item { display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .4rem .5rem .4rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.skill-item:has(input:checked) { border-color: var(--evergreen); background: #F1F7F6; }
.skill-item select { width: auto; padding: .25rem .4rem; font-size: .84rem; }
.row-card { border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 1rem; margin-bottom: .75rem; background: #FBFCFC; }
.remove-row { margin-top: .6rem; font-size: .86rem; color: var(--bad); }
.photo-field { display: flex; gap: 1rem; align-items: flex-start; }
.photo-thumb { width: 64px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.category-current { font-size: 1.15rem; font-weight: 600; margin: 0 0 1rem; }
.consent { align-items: flex-start; font-weight: 400; }
.consent input { margin-top: .2rem; flex-shrink: 0; }
.doc-table td { vertical-align: top; }
.doc-table input[type=file] { font-size: .86rem; max-width: 260px; }
.doc-needed { color: var(--warn); font-weight: 600; }
.sticky-actions { position: sticky; bottom: 0; background: var(--canvas); padding: .9rem 0; margin-top: 0; border-top: 1px solid var(--line); z-index: 5; }
.inline-upload { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; padding: 1rem 1.25rem; border-top: 1px solid var(--line); background: #FAFBFA; }
.inline-upload .field { min-width: 150px; }
.inline-upload .grow { flex: 1; }
.d-block { display: block; }

/* ---------- Category picker ---------- */
.category-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.category-card { display: flex; flex-direction: column; gap: .35rem; padding: 1.1rem 1.2rem; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.category-card strong { font-size: 1.05rem; }
.category-card:hover { border-color: var(--evergreen); box-shadow: inset 4px 0 0 var(--marigold); }

/* ---------- Provider list & profile ---------- */
.provider-cell { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); }
.provider-cell:hover strong { text-decoration: underline; }
.avatar-img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-light { background: #DDE8E6; color: var(--evergreen); flex-shrink: 0; }
.profile-head { display: flex; gap: 1.25rem; align-items: center; }
.profile-photo { width: 104px; height: 128px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; }
.profile-photo-empty { display: grid; place-items: center; background: #DDE8E6; color: var(--evergreen); font-size: 2rem; font-weight: 700; }
.profile-no { font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.profile-cat { font-size: 1.05rem; margin: .1rem 0 .5rem; }
.profile-badges { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.profile-badges .small { margin-left: .6rem; }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: .45rem 1rem; margin: 0; }
.dl dt { color: var(--muted); font-size: .9rem; }
.dl dd { margin: 0; }
.bio { background: #F6F8F7; padding: .75rem 1rem; border-radius: var(--radius-sm); margin: 1rem 0 0; }
.tag-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.tag-list li { background: #EEF3F2; border-radius: 999px; padding: .2rem .7rem; font-size: .88rem; display: inline-flex; gap: .4rem; align-items: center; }
.tag-list li.is-off { opacity: .55; text-decoration: line-through; }
.tag-list-actions { margin-bottom: 1rem; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.1rem; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1rem .6rem; }
.timeline li::before { content: ""; position: absolute; left: -1.5rem; top: .45rem; width: 10px; height: 10px; border-radius: 50%; background: var(--evergreen); }

/* ---------- Verification ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.verify-head { display: grid; grid-template-columns: auto 1fr auto; gap: 1.25rem; align-items: center; }
.dl-tight { grid-template-columns: 110px 1fr; gap: .2rem .75rem; font-size: .92rem; }
.verify-progress { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(110px, 1fr)); gap: .5rem; }
.verify-progress li { border: 1px solid var(--line); border-top: 4px solid var(--line-strong); border-radius: var(--radius-sm); padding: .55rem .75rem; }
.verify-progress li.done { border-top-color: var(--ok); }
.verify-progress span { display: block; font-size: .8rem; color: var(--muted); }
.verify-progress strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.req-docs { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; padding: 0 1.25rem 1rem; }
.req-doc { font-size: .9rem; }
.review-form { display: flex; gap: .35rem; align-items: center; }
.review-form input { min-width: 170px; padding: .35rem .5rem; font-size: .88rem; }
.ref-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.ref-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.ref-top { display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; }
.ref-card .field { gap: .2rem; }
.ref-card button { align-self: flex-start; }
.check-rows { display: flex; flex-direction: column; }
.check-row { display: grid; grid-template-columns: minmax(220px, 1.4fr) 130px 90px minmax(160px, 2fr) auto; gap: .6rem; align-items: center;
  padding: .75rem 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.check-row .field.score:empty { display: none; }
.check-row:not(:has(.score)) { grid-template-columns: minmax(220px, 1.4fr) 130px minmax(160px, 2fr) auto; }
.blockers { margin: .25rem 0 1rem; padding-left: 1.2rem; }
.blockers li { margin-bottom: .3rem; }
.decision-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.decision-actions form { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.progress-count { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--muted); }
.progress-count.is-done { color: var(--ok); }
td.overdue { color: var(--bad); font-weight: 600; }

/* ---------- Contracts ---------- */
.contract-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
.contract-meta { display: flex; flex-direction: column; gap: .3rem; padding-bottom: .9rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.contract-body { max-width: 72ch; line-height: 1.65; }
.contract-body h3 { font-size: 1.02rem; margin: 1.3rem 0 .4rem; color: var(--evergreen); }
.contract-body ol, .contract-body ul { padding-left: 1.3rem; }
.contract-body li { margin-bottom: .35rem; }
.sign-link-panel { border-left: 4px solid var(--marigold); }
.sign-link-panel input { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.sig-img { display: block; max-width: 200px; max-height: 70px; margin-top: .4rem; border-bottom: 1px solid var(--line); }
.template-editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
.template-help { position: sticky; top: 76px; }
textarea.mono { font-family: ui-monospace, Consolas, monospace; font-size: .88rem; line-height: 1.55; }
.placeholder-list { display: grid; grid-template-columns: auto 1fr; gap: .3rem .6rem; font-size: .86rem; margin: 0; }
.placeholder-list dd { margin: 0; color: var(--muted); }
.placeholder-list code { background: #EEF3F2; padding: .05rem .3rem; border-radius: 4px; font-size: .82rem; }

/* ---------- Academy ---------- */
.intake-head { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.intake-head p { margin: .4rem 0 0; }
.intake-steps { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-start; }
.intake-steps form { margin: 0; }
.enrol-form { padding: 1.1rem 1.25rem; border-top: 1px solid var(--line); background: #FAFBFA; }
.enrol-form h3 { margin-bottom: .6rem; }
tr.row-muted td { color: var(--muted); opacity: .7; }
.register td:not(:first-child), .register th:not(:first-child) { text-align: center; width: 90px; }
.reg-opt { display: inline-grid; place-items: center; width: 44px; height: 44px; cursor: pointer; border-radius: 50%; }
.reg-opt:hover { background: var(--canvas); }
.reg-opt input { width: 20px; height: 20px; accent-color: var(--evergreen); }
.score-input { max-width: 100px; text-align: right; }

/* ---------- Requests, matching, placements ---------- */
.hide-fee .category-card span.small:last-child { display: none; }
.request-head { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.5rem; }
.req-reqs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.chip { background: #EEF3F2; border-radius: 999px; padding: .2rem .7rem; font-size: .86rem; }
.chip-strong { background: var(--evergreen); color: #fff; }
.sl-form { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.sl-form select, .sl-form input { width: auto; padding: .3rem .45rem; font-size: .85rem; }
.sl-form input[type=text] { min-width: 150px; }
.sl-actions { margin-top: .4rem; }
.match-list { list-style: none; margin: 0; padding: 0; }
.match { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.match:last-child { border-bottom: 0; }
.match-score { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--evergreen) calc(var(--pct) * 1%), var(--line) 0); }
.match-score span { width: 44px; height: 44px; border-radius: 50%; background: var(--paper); display: grid; place-items: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.match-who > span { display: block; }
.factor-bars { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin-top: .4rem; }
.factor { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--muted); }
.factor-bar { width: 46px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.factor-bar span { display: block; height: 100%; background: var(--marigold); }
.match-notes { color: var(--warn); margin-top: .3rem; }
.placement-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.placement-parties { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.placement-arrow { font-size: 1.4rem; color: var(--muted); }

/* ---------- Finance ---------- */
.quote-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.quote-total { display: flex; flex-direction: column; align-items: flex-end; }
.quote-total strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.quote-lines input, .quote-lines select, .table td > select, .table td > input { padding: .35rem .5rem; font-size: .9rem; }
.table tfoot td { border-bottom: 0; padding-top: .35rem; padding-bottom: .35rem; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .55rem .9rem; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .92rem; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.is-active { color: var(--ink); border-bottom-color: var(--marigold); }
.stk-line { padding: .45rem 0; border-top: 1px solid var(--line); }
code.d-block { display: block; background: #F4F7F6; padding: .35rem .5rem; border-radius: 4px; margin-top: .3rem; word-break: break-all; }

/* ---------- Reports ---------- */
.quick-ranges { display: flex; gap: .8rem; align-self: center; }
.report-table tr.row-strong td { font-weight: 600; background: #F7F9F8; }
.report-table tr.row-total td { font-weight: 700; border-top: 2px solid var(--ink); font-size: 1rem; }
.bars { display: flex; align-items: flex-end; gap: .6rem; height: 200px; padding-top: .5rem; overflow-x: auto; }
.bar-group { flex: 1; min-width: 44px; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.bar { width: 40%; max-width: 22px; border-radius: 3px 3px 0 0; min-height: 1px; }
.bar-a, .key-a { background: var(--evergreen); }
.bar-b, .key-b { background: var(--marigold); }
.bar-label { font-size: .75rem; color: var(--muted); margin-top: .3rem; white-space: nowrap; }
.bar-legend { display: flex; gap: .5rem 1rem; align-items: center; font-size: .85rem; margin-bottom: .4rem; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: -.6rem; }
.print-only { display: none; }
@media print {
  .sidebar, .topbar, .page-actions, .no-print, .filters, .scrim { display: none !important; }
  .content { padding: 0; max-width: none; }
  .panel { border: 0; padding: 0; }
  .print-only { display: block; }
  body { background: #fff; }
}

/* ---------- Portal (providers and clients, mobile first) ---------- */
body.portal { background: var(--canvas); }
.portal-top { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1.25rem; background: var(--evergreen); color: #fff; }
.portal-top .brand { border: 0; padding: 0; }
.portal-tabs { display: flex; gap: .2rem; overflow-x: auto; background: var(--paper); border-bottom: 1px solid var(--line); padding: 0 .75rem; }
.portal-tabs a { padding: .8rem .8rem; white-space: nowrap; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; }
.portal-tabs a.is-active { color: var(--ink); border-bottom-color: var(--marigold); }
.portal-main { max-width: 760px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.portal-foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 1.5rem 1rem; }
.portal-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; max-width: 440px; margin: 1.5rem auto; }
.portal-card .field { margin-bottom: 1rem; }
.who { border: 0; padding: 0; margin: 0 0 1rem; display: grid; gap: .6rem; }
.who label { display: flex; gap: .75rem; align-items: flex-start; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: .8rem 1rem; cursor: pointer; }
.who label:has(input:checked) { border-color: var(--evergreen); box-shadow: inset 4px 0 0 var(--marigold); }
.who input { margin-top: .25rem; accent-color: var(--evergreen); }
.who strong { display: block; }
.who span { font-size: .9rem; color: var(--muted); }
.otp-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }
.portal-hello { display: flex; gap: .9rem; align-items: center; margin-bottom: 1rem; }
.portal-hello h1 { margin: 0; font-size: 1.35rem; }
.portal-hello p { margin: 0; }
.portal-hello .avatar { width: 46px; height: 46px; font-size: 1rem; }
.portal-todo { border-left: 4px solid var(--marigold); }
.portal-todo h2 { margin-bottom: .3rem; }
.portal-steps { list-style: none; margin: 0; padding: 0; }
.portal-steps li { position: relative; padding: 0 0 .9rem 1.8rem; color: var(--muted); }
.portal-steps li::before { content: ""; position: absolute; left: 0; top: .2rem; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--paper); }
.portal-steps li::after { content: ""; position: absolute; left: 8px; top: 1.3rem; bottom: .1rem; width: 2px; background: var(--line); }
.portal-steps li:last-child::after { display: none; }
.portal-steps li.done { color: var(--ink); font-weight: 600; }
.portal-steps li.done::before { background: var(--ok); border-color: var(--ok); }
.portal-group { font-size: 1.05rem; margin: 1.25rem 0 .6rem; }
.candidate { display: grid; grid-template-columns: 96px 1fr; gap: 1rem; }
.candidate-photo { width: 96px; height: 120px; object-fit: cover; border-radius: var(--radius-sm); display: grid; place-items: center; font-size: 1.8rem; }
.candidate h3 { margin: 0; font-size: 1.1rem; }
.candidate-body p { margin: .35rem 0; }
.candidate-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.candidate-actions input { flex: 1 1 100%; }
@media (max-width: 560px) { .candidate { grid-template-columns: 72px 1fr; } .candidate-photo { width: 72px; height: 90px; } .candidate-actions .btn { flex: 1; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .figures { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .pipeline { grid-template-columns: repeat(4, minmax(0,1fr)); row-gap: 1rem; }
  .pipeline li::before { display: none; }
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 50;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .sidebar-open .sidebar { transform: none; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(12,30,29,.45); z-index: 40; }
  .sidebar-open .scrim { display: block; }
  .menu-btn { display: flex; }
  .usermenu-name { display: none; }
  .grid-2, .grid-3, .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
  .profile-head { flex-direction: column; align-items: flex-start; }
  .verify-head { grid-template-columns: 1fr; }
  .verify-progress { grid-template-columns: repeat(2, 1fr); }
  .check-row, .check-row:not(:has(.score)) { grid-template-columns: 1fr; }
  .decision-actions { grid-template-columns: 1fr; }
  .contract-layout, .template-editor, .request-head { grid-template-columns: 1fr; }
  .match { grid-template-columns: 56px 1fr; }
  .match > div:last-child { grid-column: 2; }
  .template-help { position: static; }
  .review-form { flex-wrap: wrap; }
  .dl { grid-template-columns: 1fr; gap: .1rem; }
  .dl dd { margin-bottom: .5rem; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-main { padding: 2rem 1.25rem; }
  .content { padding: 1rem; }
}
@media (max-width: 560px) {
  .figures { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Vetting form additions ---------- */
.yn-field .yn-label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: .3rem; }
.yn-field .radio-group { gap: 1.25rem; }
.panel.confidential { border-left: 4px solid var(--line-strong); }
.sign-pad { border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: #FBFCFC; width: 100%; max-width: 480px; height: 150px; touch-action: none; display: block; margin: .3rem 0; }
.link-box { background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .75rem; overflow-x: auto; }
.link-box code { white-space: nowrap; font-size: .9rem; }
.qr-box { margin-top: .75rem; padding: .5rem; background: #fff; display: inline-block; border-radius: var(--radius-sm); }
