/*
 * PROCME / EDITION 02 · VARIANT C  —  THE CONTROL LEDGER
 * New visual system, built for the original class names and a zero-library DOM app.
 * The interface retains existing Bulgarian copy, controls, actions and data order.
 * No external images, icon packs or JavaScript dependencies.
 */
:root {
  color-scheme: light;
  --ground: #F2F5EF;
  --surface: #FFFFFF;
  --surface-alt: #F9FAF4;
  --ink: #0F2E26;
  --ink-2: #36584B;
  --muted: #53655D;
  --line: #D7DDD4;
  --line-strong: #A4B1A7;
  --accent: #174C3B;
  --accent-ink: #174C3B;
  --accent-soft: #E9F4EA;
  --signal: #D8F274;
  --signal-ink: #23351A;
  --ok: #145B44;
  --ok-ink: #16583F;
  --ok-soft: #E2F2E7;
  --warn-ink: #85510D;
  --warn-soft: #FFF3D9;
  --warn-border: #DEA638;
  --bad: #9C343D;
  --bad-ink: #922E37;
  --bad-soft: #FCEBED;
  --neutral-soft: #EDF0EA;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Manrope', var(--sans);
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --radius-sm: 5px;
  --radius: 9px;
  --radius-lg: 13px;
  --shadow-card: 0 4px 22px rgba(19, 42, 33, .035);
}

/* 00 / BASE — editorial type and deliberate spacing */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--ground);
  font: 500 14px/1.58 var(--sans);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { color: var(--ink); font-family: var(--display); margin: 0; line-height: 1.16; }
/* Loosened from the design package (-.067em / -.052em): at that tracking Cyrillic words ran together. */
h1 { font-size: clamp(32px, 3vw, 48px); font-weight: 800; letter-spacing: -.035em; word-spacing: .06em; }
h2 { font-size: 20px; font-weight: 800; letter-spacing: -.025em; word-spacing: .04em; }
p { margin: 0; }
strong, b { font-weight: 750; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { color: #0D6F4F; }
button, input, select, textarea { font: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 500; letter-spacing: -.035em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1 1 auto; }
:focus-visible { outline: 3px solid #2F7961; outline-offset: 3px; }
[hidden] { display: none !important; }
::selection { background: #D8EE74; color: #15302B; }

/* 01 / APPLICATION CHROME */
.topbar {
  min-height: 86px;
  background: #0F2E26;
  color: #F9FFF3;
  border-top: 4px solid var(--signal);
  border-bottom: 1px solid #39564B;
  padding: 0 clamp(18px, 3.2vw, 58px);
  display: flex;
  gap: 10px clamp(16px, 2.6vw, 42px);
  flex-wrap: wrap;
  align-items: center;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  font: 800 26px/1 var(--display);
  letter-spacing: -.077em;
  min-height: 56px;
  white-space: nowrap;
}
.brand svg { width: 40px; height: 40px; flex: 0 0 40px; display: block; }
/* The mark contains three filled ribbons; never force stroke or fill globally. */
.brand:hover { color: #fff; }
.topbar nav {
  align-self: stretch;
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  align-items: stretch;
}
.topbar nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0 3px;
  color: #C9D9CF;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: color .16s ease;
}
.topbar nav a:hover { color: #fff; }
.topbar nav a.on { color: var(--signal); }
.topbar nav a.on::after {
  content: '';
  position: absolute;
  left: 2px; right: 2px; bottom: 0;
  height: 3px; background: var(--signal);
}
.who {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 56px;
  margin-left: auto;
  padding-left: 22px;
  border-left: 1px solid #3E5B50;
}
.who .name, .who a.name { display: block; color: #F8FFF6; text-decoration: none; font-size: 13px; font-weight: 650; }
.who a.name:hover { color: var(--signal); }
.who .role { font-size: 11px; color: #BDCEC2; line-height: 1.4; }
.who button {
  min-height: 44px;
  padding: 0 15px;
  background: transparent;
  border: 1px solid #72887B;
  border-radius: 4px;
  color: #EFF9ED;
  font-size: 12px;
}
.who button:hover { background: #284C3F; border-color: #A6D0AD; }
main {
  width: min(100%, 1580px);
  margin: 0 auto;
  padding: 39px clamp(18px, 3.2vw, 58px) 94px;
  display: flex;
  flex-direction: column;
  gap: 25px;
}
.head {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 0 3px;
}
.head > div { display: flex; min-width: 0; flex-direction: column; gap: 9px; }
.head > div:first-child > p { max-width: 690px; font-size: 14px; line-height: 1.6; }
.head > div > .row:first-child { gap: 10px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.cols > section { flex: 1 1 425px; min-width: 0; display: flex; flex-direction: column; gap: 21px; }
.group { display: flex; flex-direction: column; gap: 9px; }

/* 02 / SURFACES */
.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: clamp(20px, 2vw, 30px);
  display: flex;
  flex-direction: column;
  gap: 21px;
}
.card h2 { padding-bottom: 15px; border-bottom: 1px solid #E3E8E1; }
.card.flush { padding: 0; gap: 0; overflow: hidden; border-radius: var(--radius); }
.card.flush h2 { border-bottom: 0; }

/* 03 / BUTTONS — square-minded actions, not inflated pills */
.btn, button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 0 18px;
  color: var(--ink);
  text-decoration: none;
  font: 750 13px/1.2 var(--sans);
  cursor: pointer;
  transition: background .17s ease, border-color .17s ease, color .17s ease, transform .17s ease;
}
.btn:hover, button:hover { color: var(--ink); border-color: #567B6A; background: #F2F7EF; }
.btn:active, button:active { transform: translateY(1px); }
.btn.primary, button.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.btn.primary:hover, button.primary:hover { background: #245F49; border-color: #245F49; color: #fff; }
.btn.primary[href="#/new"]::before {
  content: '';
  width: 7px; height: 7px;
  background: var(--signal); border-radius: 1px; transform: rotate(45deg);
}
.btn.ok, button.ok {
  background: #19614A;
  color: #fff;
  border-color: #19614A;
}
.btn.ok:hover, button.ok:hover { background: #104D3A; border-color: #104D3A; color: #fff; }
button.back { color: #85510D; background: #FFFCF2; border: 1px solid #C99336; }
button.back:hover { background: #FFF3D9; border-color: #A97615; }
button.bad { color: var(--bad-ink); background: #FFF9F9; border: 1px solid #BC7A7C; }
button.bad:hover { background: var(--bad-soft); border-color: var(--bad); }
button:disabled { opacity: .56; cursor: not-allowed; transform: none; }
button.pill {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: #40574C;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -.02em;
}
button.pill:hover { background: #EDF3E8; }
button.pill.on { background: var(--ink); color: #fff; border-color: var(--ink); }
button.pill.on:hover { background: var(--ink); color: #fff; }

/* 04 / FORM CONTROLS */
label { display: flex; flex-direction: column; gap: 8px; min-width: 0; font-size: 13px; font-weight: 650; color: #2D453C; }
label .hint { font: 400 12px/1.55 var(--sans); color: var(--muted); }
input, select, textarea {
  min-width: 0;
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  background: #FCFDF9;
  border: 1px solid #ADBAB0;
  border-radius: 5px;
  color: #152C27;
  outline-offset: 2px;
  font: 400 14px/1.48 var(--sans);
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
input:hover, select:hover, textarea:hover { border-color: #5D8874; }
input:focus, select:focus, textarea:focus {
  background: #fff;
  border-color: #226B50;
  box-shadow: 0 0 0 3px rgba(27, 100, 68, .13);
  outline: none;
}
input.mono, textarea.mono { font-family: var(--mono); font-size: 13px; font-weight: 500; }
textarea { min-height: 110px; resize: vertical; }
select { padding-right: 28px; }
input[type="file"] { padding: 10px 12px; background: #F9FBF6; }
input[type="file"]::file-selector-button {
  border: 1px solid #789385; border-radius: 4px;
  background: #EAF2E5; color: var(--ink);
  padding: 7px 12px; margin-right: 11px; font: 650 12px var(--sans);
  cursor: pointer;
}
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr)); gap: 18px 19px; }
.fields .wide { grid-column: 1 / -1; }
.kv { min-width: 0; display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; }
.kv .k, th {
  font: 700 10.5px/1.4 var(--sans);
  letter-spacing: .105em;
  text-transform: uppercase;
  color: #55685D;
}
.kv .v { font-size: 14px; font-weight: 550; color: var(--ink); }
.kv .v.mono { font-size: 12.5px; line-height: 1.7; }

/* 05 / METRICS */
.tiles { display: grid; grid-template-columns: 1.2fr repeat(3, minmax(0, 1fr)); gap: 13px; }
.tile {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 164px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 9px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.tile::before { content: ''; position: absolute; left: 23px; top: 0; width: 32px; height: 3px; background: #9EB99F; }
.tile .small { font-size: 12px; }
.tile .n { display: block; font: 800 clamp(37px, 3.4vw, 54px)/1 var(--display); letter-spacing: -.07em; font-variant-numeric: tabular-nums; }
.tile .muted { color: #51645A; }
.tile.dark { background: #13372D; color: white; border-color: #13372D; }
.tile.dark::before { background: var(--signal); width: 64px; }
.tile.dark::after {
  content: '';
  position: absolute; z-index: -1;
  width: 200px; height: 200px;
  right: -69px; top: 7px;
  border: 1px solid rgba(216, 238, 116, .4);
  border-radius: 50%;
  box-shadow: 0 0 0 26px rgba(216, 238, 116, .055), 0 0 0 52px rgba(216, 238, 116, .04), 0 0 0 78px rgba(216, 238, 116, .025);
}
.tile.dark .n { color: var(--signal); }
.tile.dark .muted { color: #DFEEE0; }
.tile:last-child::before { background: #D2A043; }

/* 06 / DATA TABLES — dense but not claustrophobic */
.scroll { min-width: 0; width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-color: #B8C9B8 #EFF2EB; scrollbar-width: thin; }
.scroll:focus-visible { outline-offset: -3px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: white; font-size: 13px; }
thead { background: #F6F8F2; }
th { padding: 17px 19px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
td {
  padding: 18px 19px;
  vertical-align: middle;
  border-bottom: 1px solid #E9ECE6;
  color: #344B41;
  line-height: 1.48;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #F8FAF5; }
td b { color: var(--ink); font-weight: 650; }
td a { display: inline-flex; align-items: center; min-height: 32px; font-weight: 650; text-decoration-thickness: 1px; }
td a.mono { font-size: 12.5px; text-decoration: none; border-bottom: 1px solid #739886; }
tbody tr:has(.badge.pending) > td:first-child { box-shadow: inset 3px 0 #BCD565; }
tbody tr:has(.badge.warn) > td:first-child { box-shadow: inset 3px 0 #D5A442; }
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.empty { padding: 44px 22px; text-align: center; color: var(--muted); }

/* 07 / MEANINGFUL STATUS, NEVER COLOR ALONE */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 3px;
  background: #EDF0EB;
  color: #3A5146;
  font: 650 11.5px/1.5 var(--sans);
  white-space: nowrap;
}
.badge::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: currentColor;
  border-radius: 50%;
  flex: none;
}
.badge.pending, .badge.warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge.returned, .badge.info { background: #E5F1EA; color: #235B4B; }
.badge.approved, .badge.booked, .badge.ok { background: var(--ok-soft); color: var(--ok-ink); }
.badge.rejected, .badge.fail { background: var(--bad-soft); color: var(--bad-ink); }

/* 08 / AUTOMATED CHECKS */
.check { display: flex; gap: 13px; align-items: flex-start; padding: 0 0 14px; border-bottom: 1px solid #EDF0E9; }
.check:last-child { border-bottom: 0; padding-bottom: 0; }
.check > div { min-width: 0; padding-top: 1px; }
.check .dot {
  flex: 0 0 24px;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 3px;
  background: #E0F1E5; color: #156043;
  font: 700 13px var(--display);
}
.check b { display: block; color: #243F34; font-size: 12.8px; line-height: 1.45; margin-bottom: 3px; }
.check .small { display: block; color: #53665D; line-height: 1.5; overflow-wrap: anywhere; }
.check.warn, .check.fail {
  margin: -4px -9px 4px;
  padding: 12px 10px;
  border: 1px solid #E9C36E;
  background: #FFFBF1;
  border-radius: 4px;
}
.check.warn .dot { background: #F5DE9E; color: #85510D; }
.check.fail { background: #FFF5F5; border-color: #E4A9AF; }
.check.fail .dot { background: #F4D6DA; color: var(--bad-ink); }
.check.info .dot { background: #E7EEE8; color: #245B4C; }
.checks-card { gap: 16px; }
.checks-card h2 { padding: 0; border-bottom: 0; }
.checks-card > .row:first-child { border-bottom: 1px solid var(--line); padding-bottom: 15px; }
.checks-card > .check.warn, .checks-card > .check.fail { order: -1; }
.checks-card > .row:first-child { order: -2; }
.checks-card.has-issues { border-color: #E4C377; }

/* 09 / NOTES AND EXPLANATIONS */
.note {
  padding: 16px 19px;
  border-radius: var(--radius-sm);
  background: #E8F1E9;
  border: 1px solid #BBD1C1;
  border-left: 4px solid #326D51;
  color: #264F3C;
  font-size: 13px;
  line-height: 1.6;
}
.note b { display: block; margin-bottom: 3px; font-weight: 700; }
.note a { font-weight: 650; }
.note.ok { background: var(--ok-soft); color: #16543D; border-color: #B0D7BC; border-left-color: #1D754E; }
.note.bad { background: var(--bad-soft); color: var(--bad-ink); border-color: #E4B0B4; border-left-color: var(--bad); }
.note.warn { background: #FFF6E4; color: #764912; border-color: #E7CE9C; border-left-color: #B67B24; }
.note.dark {
  position: relative;
  overflow: hidden;
  padding: 22px 28px 22px 28px;
  background: #16362C;
  color: #E8F4E4;
  border-color: #16362C;
  border-left: 5px solid var(--signal);
}
.note.dark b { color: #E8F8D7; font: 800 18px/1.3 var(--display); margin-bottom: 7px; }
.note.dark::after { content: ''; position: absolute; right: 26px; top: 21px; height: 36px; width: 36px; border-radius: 50%; border: 2px solid #D8EE74; box-shadow: 0 0 0 8px rgba(216, 238, 116, .07); }
main > .note.warn:first-child { align-self: stretch; background: #FFFAEF; }

/* 10 / REQUEST DETAIL — financial summary takes the lead */
main > a[href="#/"] {
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 650 !important;
  text-decoration: none !important;
  line-height: 1.5;
  margin-top: -1px;
}
main > a[href="#/"]:hover { color: #0D7650; }
.detail-head, .head:has(.amount) {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(285px, 355px);
  gap: 26px;
  padding: 0;
}
.detail-head > div:first-child, .head:has(.amount) > div:first-child { align-self: center; gap: 11px; }
.detail-head .row > .mono, .head:has(.amount) .row > .mono { font-size: 11.5px; letter-spacing: -.01em; }
.detail-head h1, .head:has(.amount) h1 { max-width: 820px; font-size: clamp(31px, 2.8vw, 46px); }
.amount-hero, .head:has(.amount) > div:last-child {
  position: relative;
  overflow: hidden;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: flex-start !important;
  justify-content: center;
  gap: 12px;
  min-height: 158px;
  background: #123C30;
  color: #fff;
  padding: 24px 28px;
  border-radius: 7px;
  border-left: 4px solid var(--signal);
}
.amount-hero::after, .head:has(.amount) > div:last-child::after {
  content: '';
  position: absolute;
  width: 135px; height: 135px;
  border: 1px solid rgba(216, 238, 116, .19);
  border-radius: 50%;
  right: -34px; top: -52px;
  box-shadow: 0 0 0 16px rgba(216,238,116,.045), 0 0 0 32px rgba(216,238,116,.02);
  pointer-events: none;
}
.amount-hero > .muted, .head:has(.amount) > div:last-child .muted { color: #DCECDF; }
.amount { color: var(--signal); font: 600 clamp(26px, 2.5vw, 35px)/1.2 var(--mono); letter-spacing: -.075em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.detail-layout, .cols:has(.doc) {
  align-items: start;
  display: grid;
  grid-template-columns: minmax(0, 1.13fr) minmax(340px, .87fr);
  gap: 24px;
}
.document-column, .review-column, .cols:has(.doc) > section { min-width: 0; flex: initial; display: flex; flex-direction: column; gap: 20px; }
.doc {
  min-width: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: #DFE7DE;
  border: 1px solid #CED8CD;
  border-radius: var(--radius);
}
.doc iframe { display: block; width: 100%; height: 670px; border: 0; background: #fff; border-radius: 2px; }
.doc img { display: block; max-width: 100%; width: 100%; height: auto; border-radius: 2px; }
.doc > .row { color: #435B51; padding: 0 4px; }
.doc > .row a { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.doc > .row span.mono { font-size: 10px; }
.doc-placeholder {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 430px;
  padding: 40px;
  background: #fff;
  color: #647569;
  border-radius: 2px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(18,42,32,.08);
  font-size: 13px;
}
.doc-placeholder::before {
  content: '';
  display: block;
  height: 66px; width: 52px;
  margin-bottom: 22px;
  border: 2px solid #A8B6A8;
  background: linear-gradient(#A8B6A8 0 0) 10px 17px / 29px 2px no-repeat,
              linear-gradient(#A8B6A8 0 0) 10px 26px / 24px 2px no-repeat,
              linear-gradient(#A8B6A8 0 0) 10px 35px / 28px 2px no-repeat,
              #fff;
  box-shadow: 7px 7px 0 #EDF2EB;
}
.trail { display: flex; position: relative; gap: 13px; align-items: flex-start; padding: 1px 0 15px; }
.trail:not(:last-child)::after { content: ''; position: absolute; left: 6px; top: 18px; bottom: -3px; border-left: 1px solid #C7D4C8; }
.trail i { position: relative; z-index: 1; flex: 0 0 13px; width: 13px; height: 13px; border: 3px solid #F7F9F3; border-radius: 50%; background: #789486; margin-top: 4px; box-shadow: 0 0 0 1px #B9C6B8; }
.trail.ok i { background: #226E50; box-shadow: 0 0 0 1px #226E50; }
.trail.bad i { background: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.trail.back i { background: #BA862B; box-shadow: 0 0 0 1px #BA862B; }
.trail > div { min-width: 0; flex: 1; }
.trail b { color: var(--ink); }
.trail .mono { font-size: 10.5px; margin-top: 5px; }
.timeline-card { gap: 15px; }
.timeline-card h2 { margin-bottom: 3px; }
.request-panel, .decision-panel { position: relative; }
.decision-panel { border-top: 4px solid #173A2E; padding-top: 24px; }
.decision-panel h2 { font-size: 23px; font-weight: 800; }
.decision-panel label { font-weight: 650; }
.decision-panel textarea { min-height: 82px; }
.decision-panel > .small.muted { font-size: 11.5px; line-height: 1.6; }
.decision-panel > .row.decide { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr) minmax(0, .74fr); gap: 8px; }
.decide button { flex: initial !important; min-height: 51px; padding: 0 12px; font-size: 12.5px; }
.decide button.ok::before { content: ''; display: block; width: 10px; height: 6px; border-left: 2px solid white; border-bottom: 2px solid white; transform: translateY(-1px) rotate(-45deg); }
.data-card .fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.data-card .kv:last-child { grid-column: auto; }
.data-card .kv:has(.mono) { overflow-wrap: anywhere; }
.data-card .kv .k { font-size: 10px; }
.data-card .kv .v { font-size: 13px; }
.data-card .kv .mono { font-size: 11.5px; }

/* The one-screen risk summary sits ahead of the irreversible decision. */
.risk-spotlight {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 15px 18px;
  background: #FFF2D3;
  border: 1px solid #DBA74B;
  border-left: 5px solid #BC8124;
  border-radius: var(--radius-sm);
  color: #573A0B;
}
.risk-spotlight:has(.risk-item.fail) { background: #FCEBED; border-color: #C8797E; border-left-color: var(--bad); }
.risk-item { display: flex; gap: 13px; align-items: start; }
.risk-item + .risk-item { border-top: 1px solid rgba(143,102,33,.22); padding-top: 9px; }
.risk-item .risk-symbol { flex: 0 0 26px; width: 26px; height: 26px; display: grid; place-items: center; font: 800 15px var(--display); background: #E7B950; border-radius: 3px; color: #503300; }
.risk-item.fail .risk-symbol { background: #F0BFC4; color: #922E37; }
.risk-item > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.risk-item b { display: block; font: 800 13.5px/1.35 var(--display); }
.risk-item .small { display: block; color: #6E5122; font-size: 12.5px; overflow-wrap: anywhere; }
.risk-item.fail .small { color: #743A3E; }

/* 11 / LOGIN — editorial split, bespoke locally-authored SVG */
.login {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(420px, .82fr);
  overflow: hidden;
  background: #0F2E26;
  padding: 0;
}
.login::before {
  content: '';
  min-height: 100vh;
  background: url('./assets/route-art.svg') center 47% / min(94%, 900px) auto no-repeat;
  grid-column: 1;
  grid-row: 1;
}
.login::after {
  content: '';
  position: absolute;
  left: clamp(25px, 5vw, 75px);
  bottom: 40px;
  width: min(33vw, 390px);
  height: 7px;
  background: linear-gradient(to right, var(--signal) 0 19%, rgba(216,238,116,.24) 19% 100%);
  pointer-events: none;
}
.login form {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: none;
  padding: clamp(35px, 7.7vw, 106px);
  border-radius: 0;
  background: #F9FAF4;
  box-shadow: -23px 0 40px rgba(4, 24, 16, .08);
}
.login form::before { content: ''; display: block; width: 36px; height: 3px; background: #27674C; margin-bottom: 11px; }
.login .brand { color: #0F2E26; font-size: clamp(36px, 3.4vw, 48px); letter-spacing: -.085em; margin-bottom: 2px; min-height: 58px; }
.login .brand svg { height: 54px; width: 54px; flex-basis: 54px; }
.login .brand + .muted { font: 500 16px/1.6 var(--display); color: #4E6659; margin-bottom: 26px; max-width: 310px; }
.login label { font-size: 13px; }
.login input { min-height: 51px; background: #fff; }
.login form button.primary { min-height: 52px; margin-top: 7px; width: 100%; background: var(--ink); font-size: 14px; }
.login form button.primary::after { content: '→'; font: 600 18px/1 var(--sans); margin-left: auto; }
.login form button.primary::before { content: ''; width: 17px; flex: 0 0 17px; }

/* 12 / SPECIALIZED PANELS, EXTENDED FOR ALL 18 SCREENS */
form.card { max-width: 100%; }
form.card[style*="max-width: 720px"] { width: 100%; max-width: 815px !important; }
form.card > .group:first-child > b { display: block; padding-bottom: 8px; font: 700 15px var(--display); }
form.card > .row:last-child { margin-top: 3px; }
form.card > .row:last-child > button[type="submit"] { min-width: 180px; }
.card:has(> img[alt*="QR"]) > img { max-width: 220px; border: 12px solid #F8FAF5; box-shadow: 0 0 0 1px var(--line); }
.card:has(> img[alt*="QR"]) > label { max-width: 260px; }
.card:has(> img[alt*="QR"]) .mono { overflow-wrap: anywhere; }
.card.flush:has(table) .scroll { width: 100%; }
.card.flush:has(table) { box-shadow: 0 6px 22px rgba(18, 45, 34, .035); }
.card:has(> .fields) > .fields > label { gap: 8px; }
.card h2 + .note { margin-top: -3px; }
.card .note + .fields { margin-top: -1px; }
.card:has(.fields) { min-width: 0; }

/* 13 / RESPONSIVE BEHAVIOR */
@media (max-width: 1200px) {
  .topbar { gap: 8px 26px; }
  .topbar nav { gap: 4px 15px; }
  .who { gap: 10px; padding-left: 15px; }
  .detail-layout, .cols:has(.doc) { grid-template-columns: minmax(0, 1fr) minmax(335px, .95fr); }
  .data-card .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decide button { padding: 0 9px; }
}
@media (max-width: 960px) {
  .topbar { padding-top: 12px; padding-bottom: 10px; }
  .topbar nav { order: 3; flex: 1 1 100%; align-self: auto; border-top: 1px solid #3E5B50; }
  .topbar nav a { min-height: 48px; }
  .who { margin-left: auto; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-layout, .cols:has(.doc) { grid-template-columns: 1fr; }
  .detail-layout > .review-column, .cols:has(.doc) > section:nth-child(2) { order: -1; }
  .detail-layout > .document-column, .cols:has(.doc) > section:nth-child(1) { order: 1; }
  .detail-layout .doc iframe, .cols:has(.doc) .doc iframe { height: 540px; }
  .decision-panel > .row.decide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .data-card .fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .login { grid-template-columns: minmax(0, 1fr) minmax(380px, 1fr); }
  .login form { padding: clamp(25px, 5.5vw, 65px); }
}
@media (max-width: 680px) {
  main { padding: 25px 17px 60px; gap: 18px; }
  .topbar { padding: 11px 17px 8px; gap: 10px; }
  .brand { font-size: 23px; font-weight: 800; }
  .brand svg { width: 33px; height: 33px; flex-basis: 33px; }
  .topbar nav { justify-content: flex-start; flex: 1 1 100%; gap: 0 13px; overflow: visible; }
  .topbar nav a { font-size: 12px; padding: 0 2px; min-height: 44px; }
  .who { min-height: 44px; padding-left: 11px; gap: 8px; }
  .who .name { font-size: 11.5px; }
  .who .role { font-size: 10px; }
  .who button { min-height: 44px; padding: 0 9px; font-size: 11px; }
  .head { align-items: flex-start; gap: 14px; }
  .head h1 { font-size: 34px; }
  .head > div:first-child > p { font-size: 13px; }
  .head .row > .btn { width: auto; }
  .card { padding: 20px 18px; gap: 17px; }
  .cols { gap: 16px; }
  .cols > section { flex-basis: 100%; gap: 16px; }
  .tiles { gap: 9px; }
  .tile { padding: 18px; min-height: 145px; }
  .tile .n { font-size: 40px; }
  .tile .small { font-size: 11px; }
  .tabs { gap: 3px; padding: 9px; }
  button.pill { min-height: 44px; padding: 0 9px; font-size: 11px; }
  .badge { font-size: 11px; }
  .detail-head, .head:has(.amount) { grid-template-columns: 1fr; gap: 18px; }
  .detail-head h1, .head:has(.amount) h1 { font-size: 30px; }
  .amount-hero, .head:has(.amount) > div:last-child { min-height: 135px; padding: 18px 22px; }
  .amount { font-size: clamp(28px, 6.7vw, 38px); }
  .detail-layout, .cols:has(.doc) { gap: 16px; }
  .data-card .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc { padding: 10px; }
  .doc iframe { height: 425px !important; }
  .doc-placeholder { min-height: 330px; }
  .doc > .row { gap: 4px; flex-wrap: wrap; }
  .decision-panel > .row.decide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decide button { min-height: 51px; }
  .decide button:first-child { grid-column: 1 / -1; }
  .login { min-height: 100dvh; display: flex; flex-direction: column; padding: 0; background: #F9FAF4; }
  .login::before { min-height: 200px; height: 200px; background-position: center 28%; background-size: 350px auto; flex: 0 0 200px; }
  .login::after { left: 24px; top: 182px; bottom: auto; width: 125px; height: 4px; }
  .login form { flex: 1 1 auto; padding: 37px 25px 56px; box-shadow: none; }
  .login form::before { display: none; }
  .login .brand { font-size: 36px; margin-bottom: 0; }
  .login .brand svg { width: 45px; height: 45px; flex-basis: 45px; }
  .login .brand + .muted { margin-bottom: 7px; font-size: 14px; }
}
@media (max-width: 390px) {
  .topbar nav { gap: 0 10px; }
  .topbar nav a { font-size: 11.5px; }
  .who .role { max-width: 138px; }
  .tile { padding: 14px; min-height: 132px; }
  .tile .n { font-size: 36px; }
  .card { padding: 17px 15px; }
  .amount { font-size: 27px; }
  .fields { grid-template-columns: 1fr; }
  .data-card .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login form { padding: 32px 21px 48px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 14 / EDITION 02 — BRAND C TYPOGRAPHIC REFINEMENTS */
:root { --brand-deep: #0F2E26; --brand-mid: #42684A; --brand-lime: #D8F274; }
.brand { font-kerning: normal; font-feature-settings: "kern" 1; }
.brand svg { filter: none; overflow: visible; }
.brand:hover svg { transform: none; }
h1, h2, h3, .tile .n, .brand { text-wrap: balance; }
.head h1, .detail-head h1 { overflow-wrap: anywhere; }
.card h2 { font-weight: 800; }
.card h2, .decision-panel h2 { letter-spacing: -.025em; }
.tile .n { letter-spacing: -.077em; }
.kv .v { font-weight: 650; }
.btn, button { letter-spacing: -.008em; }
.check b, .risk-item b { font-weight: 750; }
.login form::before { background: var(--brand-mid); }
.login .brand + .muted { font-weight: 600; letter-spacing: -.018em; }
.topbar .brand { letter-spacing: -.085em; }
.topbar .brand svg { flex: 0 0 40px; }
@media(max-width: 680px) { .topbar .brand svg { flex-basis: 33px; } }
.login-alt { display: flex; flex-direction: column; align-items: stretch; gap: 10px; text-align: center; }
.login-alt:empty { display: none; }

/* Supplier onboarding: public form and review screens */
input[type='checkbox'] { width: 22px; height: 22px; min-height: 0; padding: 0; flex: none; accent-color: var(--accent); }
.check-line { flex-direction: row; align-items: flex-start; gap: 12px; font-weight: 500; }
.check-line input { margin-top: 2px; }
.linkbox { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 10px 0; user-select: all; }
.supplier-page { max-width: 820px; margin: 0 auto; padding: 32px 16px 64px; }
.supplier-form { display: flex; flex-direction: column; gap: 18px; }
.supplier-form h2 { margin-top: 8px; }
.tabs h2 { align-self: center; }

/* Document preview drawn by PDF.js */
.pdf-pages { display: flex; flex-direction: column; gap: 10px; max-height: 82vh; overflow: auto; border-radius: 6px; }
.pdf-pages canvas { width: 100%; height: auto; display: block; background: #fff; border-radius: 6px; }
