:root {
  --navy: #0f2540;
  --navy-700: #1b3a5c;
  --ink: #14202e;
  --muted: #64748b;
  --line: #dfe5ec;
  --bg: #eef2f6;
  --card: #ffffff;
  --accent: #0b6cb1;
  --accent-dark: #085489;
  --green: #0d7a4a;
  --green-bg: #e4f5ec;
  --amber: #9a6400;
  --amber-bg: #fdf1dc;
  --red: #b3261e;
  --red-bg: #fdeceb;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(15, 37, 64, .06), 0 4px 14px rgba(15, 37, 64, .06);
}

* { box-sizing: border-box; }

/* Must win over the display rules below, e.g. label.field { display:block }. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- top bar ---------------- */

.topbar {
  background: var(--navy);
  color: #fff;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 54px;
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 2px 12px rgba(15, 37, 64, .18);
}

.topbar .brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: #fff; white-space: nowrap;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 7px; flex: 0 0 30px;
  background: linear-gradient(145deg, #2f82c4, #0b6cb1);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 750; letter-spacing: .5px;
}
.brand-text { font-size: 14px; font-weight: 650; line-height: 1.15; }
.brand-text small {
  display: block; font-weight: 400; font-size: 10px;
  opacity: .6; letter-spacing: .5px; text-transform: uppercase;
}

.topbar nav { display: flex; gap: 2px; flex: 1; min-width: 0; }
.topbar nav a {
  color: #b9cbdd; text-decoration: none; padding: 7px 12px;
  border-radius: 6px; font-weight: 500; font-size: 13px; white-space: nowrap;
}
.topbar nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.topbar nav a.active { background: rgba(255, 255, 255, .16); color: #fff; font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.topbar .who { font-size: 11.5px; text-align: right; line-height: 1.3; color: #b9cbdd; }
.topbar .who b { display: block; font-weight: 600; font-size: 12.5px; color: #fff; }

/* set-up menu */
.menu { position: relative; }
.menu-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: #b9cbdd; border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 6px; padding: 6px 11px; font: inherit; font-size: 12.5px;
  font-weight: 500; cursor: pointer;
}
.menu-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.menu-btn .caret { font-size: 9px; opacity: .8; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 232px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15, 37, 64, .2); padding: 5px; z-index: 40;
}
.menu-list a {
  display: block; padding: 9px 11px; border-radius: 5px;
  color: var(--ink); text-decoration: none; font-size: 13px; white-space: nowrap;
}
.menu-list a:hover { background: #eef3f8; }
.menu-list a.active { background: #e8f0f8; color: var(--accent-dark); font-weight: 600; }

.wrap { max-width: 1220px; margin: 0 auto; padding: 22px 20px 60px; }
.page-title { margin: 0 0 4px; font-size: 20px; font-weight: 650; }
.page-sub { margin: 0 0 20px; color: var(--muted); font-size: 13px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.card > h2 {
  margin: 0; padding: 13px 18px; font-size: 13px; font-weight: 650;
  letter-spacing: .5px; text-transform: uppercase; color: var(--navy);
  border-bottom: 1px solid var(--line); background: #f8fafc;
  border-radius: var(--radius) var(--radius) 0 0;
}
.card .body { padding: 18px; }

.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }

/* ---------------- forms ---------------- */

label.field { display: block; }
/* Not every field is editable - a fixed rule is shown as a plain value. */
.field > span {
  display: block; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .4px; color: var(--muted); margin-bottom: 5px;
}
.readonly-value {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: #f6f8fa; color: var(--ink); font-weight: 600;
}
input, select, textarea {
  width: 100%; padding: 8px 10px; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11, 108, 177, .14);
}
input[readonly] { background: #f6f8fa; color: var(--muted); }
input.num, td input.num { text-align: right; font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; border-radius: 6px; background: var(--accent); color: #fff;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn.ghost:hover { background: #f4f7fa; }
.btn.danger { background: var(--red); }
.btn.sm { padding: 5px 11px; font-size: 12px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- tables ---------------- */

.tbl-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-size: 11px; font-weight: 650; text-transform: uppercase;
  letter-spacing: .4px; color: var(--muted); padding: 9px 10px;
  border-bottom: 1px solid var(--line); background: #f8fafc; white-space: nowrap;
}
td { padding: 6px 10px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
th.r, td.r { text-align: right; }
tbody tr:hover { background: #fafbfd; }
td.money, th.money { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td input { padding: 6px 8px; }
tfoot td { font-weight: 650; background: #f8fafc; border-top: 2px solid var(--line); }

/* ---------------- badges ---------------- */

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .4px; white-space: nowrap;
}
.badge.normal { background: var(--green-bg); color: var(--green); }
.badge.review { background: var(--amber-bg); color: var(--amber); }
.badge.risk { background: var(--red-bg); color: var(--red); }
.badge.nodata { background: #eceff3; color: var(--muted); }
.badge.draft { background: #eceff3; color: var(--muted); }
.badge.role { background: #e8f0f8; color: var(--navy-700); }
.badge.off { background: var(--red-bg); color: var(--red); }
.badge.on { background: var(--green-bg); color: var(--green); }

/* ---------------- results ---------------- */

.results { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); }
.stat { background: #fff; padding: 14px 16px; }
.stat .k {
  font-size: 10.5px; font-weight: 650; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted); margin-bottom: 5px;
}
.stat .v { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 12px; font-weight: 500; color: var(--muted); }
.stat.hero { background: var(--navy); color: #fff; }
.stat.hero .k { color: #9fb6cd; }
.stat.hero .v { font-size: 24px; }
.stat.pos .v { color: var(--green); }
.stat.warn .v { color: var(--amber); }
.stat.neg .v { color: var(--red); }

.banner {
  padding: 11px 15px; border-radius: 6px; font-size: 13px; margin-bottom: 14px;
  border: 1px solid transparent;
}
.banner.err { background: var(--red-bg); color: var(--red); border-color: #f4c9c6; }
.banner.ok { background: var(--green-bg); color: var(--green); border-color: #bfe5d1; }
.banner.warn { background: var(--amber-bg); color: var(--amber); border-color: #f0dcb4; }
.banner.info { background: #e9f2fa; color: var(--accent-dark); border-color: #c6ddf0; }
.banner:empty { display: none; }

.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.cost-missing { color: var(--red); font-weight: 700; font-size: 11px; letter-spacing: .3px; }
.empty { padding: 34px; text-align: center; color: var(--muted); }

/* ---------------- login ---------------- */

.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #0f2540 0%, #1b3a5c 55%, #23527c 100%); padding: 20px;
}
.login-box { width: 100%; max-width: 390px; background: #fff; border-radius: 10px; padding: 32px; box-shadow: 0 18px 50px rgba(0, 0, 0, .28); }
.login-box h1 { margin: 0 0 4px; font-size: 17px; color: var(--navy); }
.login-box p.sub { margin: 0 0 24px; font-size: 12.5px; color: var(--muted); }
.login-box .field { margin-bottom: 15px; }
.login-box .btn { width: 100%; padding: 10px; margin-top: 6px; }
.login-foot { margin-top: 20px; font-size: 11px; color: var(--muted); text-align: center; line-height: 1.6; }

/* ---------------- modal ---------------- */

.modal-bg {
  position: fixed; inset: 0; background: rgba(15, 37, 64, .55);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal-bg[hidden] { display: none; }
.modal { background: #fff; border-radius: 10px; width: 100%; max-width: 460px; box-shadow: 0 18px 50px rgba(0, 0, 0, .3); max-height: 92vh; overflow-y: auto; }
.modal h3 { margin: 0; padding: 15px 20px; font-size: 15px; border-bottom: 1px solid var(--line); color: var(--navy); }
.modal .body { padding: 20px; display: grid; gap: 13px; }
.modal .foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; background: #f8fafc; border-radius: 0 0 10px 10px; }

/* ---------------- responsive ---------------- */

@media (max-width: 900px) {
  .grid.c4, .grid.c3, .grid.c2 { grid-template-columns: 1fr 1fr; }
  .results { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .topbar nav { order: 3; width: 100%; overflow-x: auto; }
  .wrap { padding: 16px 12px 50px; }
  .grid.c4, .grid.c3, .grid.c2 { grid-template-columns: 1fr; }
  .results { grid-template-columns: 1fr; }
}



.claim-link {
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
}
.claim-link:hover { text-decoration: underline; }
.btn.ghost.sm.del { color: var(--red); border-color: var(--line); line-height: 1; }
.btn.ghost.sm.del:hover { background: var(--red-bg); border-color: #f4c9c6; }

/* ---------------- workflow ---------------- */

.flow { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.flow .step {
  flex: 1 1 130px; min-width: 118px; padding: 9px 12px; border-radius: 6px;
  background: #f1f4f8; color: var(--muted); font-size: 11.5px; font-weight: 650;
  letter-spacing: .3px; text-align: center; border: 1px solid var(--line);
}
.flow .step.done { background: var(--green-bg); color: var(--green); border-color: #bfe5d1; }
.flow .step.current { background: var(--navy); color: #fff; border-color: var(--navy); }
.flow .step.rejected { background: var(--red-bg); color: var(--red); border-color: #f4c9c6; }
.flow .step small { display: block; font-weight: 500; font-size: 10px; opacity: .8; margin-top: 2px; }

.timeline { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 16px; }
.timeline .ev { position: relative; padding: 8px 0; font-size: 13px; }
.timeline .ev::before {
  content: ''; position: absolute; left: -22px; top: 14px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line);
}
.timeline .ev .when { color: var(--muted); font-size: 11.5px; }
.timeline .ev .what { font-weight: 600; }
.timeline .ev .why { color: var(--muted); font-style: italic; margin-top: 2px; }

.msg-preview {
  white-space: pre-wrap; font-family: Consolas, "Courier New", monospace; font-size: 12px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 6px; padding: 12px;
  margin-top: 8px; max-height: 260px; overflow-y: auto;
}

/* =================================================================
   PRINT - the approval report the Boss signs
   ================================================================= */

.print-only { display: none; }

@media print {
  @page { size: A4 portrait; margin: 11mm 10mm 12mm; }

  .print-only { display: block; }

  /* Anything interactive or navigational has no place on paper. */
  /* The workflow strip and its buttons are screen furniture; the printed report
     carries the status in the masthead and the signatures at the foot. */
  .topbar, .btn, .no-print, #alert, #workflowCard,
  #flowActions, #flowNotify, .hint { display: none !important; }

  html, body { background: #fff !important; color: #000; font-size: 9.5pt; }
  .wrap { max-width: none; margin: 0; padding: 0; }

  /* ---- masthead ---- */
  .report-head { margin-bottom: 8pt; }
  .rh-top { display: flex; justify-content: space-between; align-items: flex-start; }
  .rh-company { font-size: 12pt; font-weight: 700; }
  .rh-meta { text-align: right; font-size: 9pt; line-height: 1.4; }
  .rh-title {
    margin: 8pt 0 2pt; font-size: 13pt; font-weight: 700; letter-spacing: .6px;
    text-align: center; border-top: 2px solid #000; border-bottom: 2px solid #000;
    padding: 5pt 0;
  }
  .rh-sub { text-align: center; font-size: 8.5pt; margin-bottom: 4pt; }

  /* The on-screen claim heading is replaced by the masthead. */
  .page-title, .page-sub { display: none; }

  /* ---- cards become plain sections ---- */
  .card {
    box-shadow: none; border: 1px solid #999; border-radius: 0;
    margin-bottom: 7pt; break-inside: avoid;
  }
  .card > h2 {
    background: #eee !important; color: #000; border-bottom: 1px solid #999;
    padding: 3pt 6pt; font-size: 8.5pt; letter-spacing: .4px; border-radius: 0;
  }
  .card .body { padding: 6pt; }
  .card .body div[style*='color'] { color: #333 !important; }
  .grid { gap: 5pt 10pt; }

  /* ---- tables ---- */
  .tbl-scroll { overflow: visible !important; }
  table { font-size: 8pt; }
  th {
    background: #eee !important; color: #000; padding: 3pt 4pt;
    border-bottom: 1px solid #666; font-size: 7.5pt;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  td { padding: 2.5pt 4pt; border-bottom: 1px solid #ddd; }
  tfoot td { background: #eee !important; border-top: 1.5px solid #000; font-size: 8.5pt; }
  thead { display: table-header-group; }   /* repeat headings across pages */
  tr { break-inside: avoid; }

  /* ---- gross profit summary: flat, ink-friendly, never split ---- */
  .results {
    display: grid !important; grid-template-columns: repeat(4, 1fr);
    gap: 0; background: #fff; border: 1px solid #999; break-inside: avoid;
  }
  .stat { border-right: 1px solid #ccc; padding: 5pt 6pt; }
  .stat:last-child { border-right: 0; }
  .stat.hero, .stat.pos, .stat.warn, .stat.neg {
    background: #fff !important; color: #000 !important;
  }
  .stat .k { color: #444 !important; font-size: 6.5pt; }
  .stat .v, .stat.hero .v { font-size: 11pt !important; color: #000 !important; }
  .stat.hero .v { font-weight: 700; text-decoration: underline; }

  .badge {
    border: 1px solid #000; background: #fff !important; color: #000 !important;
    font-size: 8pt; padding: 1pt 6pt;
  }
  .cost-missing { color: #000; text-decoration: underline; }

  /* ---- history prints as a plain audit list ---- */
  .timeline { border-left: 1px solid #999; }
  .timeline .ev::before { display: none; }
  .timeline .ev { padding: 2pt 0; font-size: 8pt; }

  /* ---- signatures ---- */
  .sig-block {
    display: flex; gap: 14pt; margin-top: 16pt; break-inside: avoid;
  }
  .sig { flex: 1; }
  .sig-line { border-bottom: 1px solid #000; height: 30pt; }
  .sig-role { font-size: 7pt; font-weight: 700; letter-spacing: .5px; margin-top: 3pt; }
  .sig-name { font-size: 8pt; color: #333; min-height: 22pt; }

  .print-foot {
    margin-top: 10pt; padding-top: 4pt; border-top: 1px solid #ccc;
    font-size: 7pt; color: #555; text-align: center;
  }
}

/* =================================================================
   PHONE - the Boss reviewing and approving on a handset
   ================================================================= */

@media (max-width: 620px) {
  .wrap { padding: 12px 10px 40px; }
  .page-title { font-size: 17px; }

  /* Approve / Reject must be big, obvious and thumb-reachable. */
  #flowActions { flex-direction: column; gap: 10px; }
  #flowActions .btn { width: 100%; padding: 14px; font-size: 15px; }

  /* A phone has no room for the whole strip - show only where the claim is now.
     flex:0 0 auto matters: in a column the old flex-basis stretched each step
     to fill the screen. */
  .flow { flex-direction: column; gap: 4px; margin-bottom: 12px; }
  .flow .step { flex: 0 0 auto; text-align: left; padding: 9px 12px; }
  .flow .step:not(.current):not(.rejected) { display: none; }

  /* Top bar: let the nav drop to its own line instead of running off-screen. */
  .topbar { height: auto; flex-wrap: wrap; padding: 10px 12px; gap: 8px; row-gap: 6px; }
  .topbar .brand { flex: 1 1 auto; font-size: 13px; }
  .topbar .who { flex: 0 0 auto; font-size: 11px; }
  /* flex-basis beats width in a flex row, and the base rule sets flex:1 (basis 0%).
     Forcing basis to 100% is what actually pushes the nav onto its own line. */
  .topbar nav { order: 3; flex: 0 0 100%; margin-left: 0; overflow-x: auto; gap: 2px; }
  .topbar nav a { padding: 6px 10px; font-size: 12px; white-space: nowrap; }

  /* The claim heading and its actions stack instead of fighting for one row. */
  .row-actions { width: 100%; }
  .row-actions .btn { flex: 1 1 auto; }

  /* Summary tiles stack two-up so the key figures stay side by side. */
  .results { grid-template-columns: 1fr 1fr; }
  .stat .v { font-size: 17px; }
  .stat.hero .v { font-size: 21px; }

  .card > h2 { font-size: 11.5px; padding: 11px 14px; }
  .card .body { padding: 14px; }

  /* Wide tables become one stacked card per line - no sideways scrolling. */
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr {
    border: 1px solid var(--line); border-radius: 6px;
    margin-bottom: 8px; padding: 8px 10px; background: #fff;
  }
  table.stack td {
    border: 0; padding: 2px 0; display: flex; justify-content: space-between;
    gap: 12px; text-align: right;
  }
  table.stack td::before {
    content: attr(data-label);
    font-size: 10.5px; font-weight: 650; text-transform: uppercase;
    letter-spacing: .3px; color: var(--muted); text-align: left; flex: 0 0 auto;
  }
  table.stack td:empty { display: none; }
  table.stack tfoot tr { background: #f8fafc; border-color: var(--navy); }

  /* The Boss wants the figures before the paper trail. */
  #body { display: flex; flex-direction: column; }
  #workflowCard { order: 1; }
  #summaryCard  { order: 2; }
  #detailsCard  { order: 3; }
  #paymentCard  { order: 4; }
  #linesCard    { order: 5; }
  #excludedCard { order: 6; }
  #historyCard  { order: 7; }

  .sig-block { display: none; }
}

/* ---------------- integrations ---------------- */

.integration {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.integration:first-child { border-top: none; padding-top: 0; }
.integration-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px;
}
/* An unconfigured integration should read as unfinished, not as an error. */
.integration.off .integration-head strong { color: var(--muted); }
.env-block {
  margin-top: 6px; padding: 10px 12px; border-radius: 6px;
  background: #f6f8fa; border: 1px solid var(--line);
  font-family: ui-monospace, Consolas, monospace; font-size: 12px;
  color: var(--ink); overflow-x: auto; white-space: pre;
}

/* ------------- bank details read off an invoice ------------- */

.read-invoice-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-top: 14px;
  padding: 12px 14px; border: 1px dashed var(--line); border-radius: 8px;
}
.reading {
  margin-top: 14px; padding: 14px; border-radius: 8px;
  border: 1px solid var(--line); background: #f6f8fa;
}
/* A changed account number is the one case that must stop someone mid-click. */
.reading.severe { border-color: var(--red); background: var(--red-bg); }
.read-warnings { margin: 8px 0 0; padding-left: 20px; }
.read-warnings li { margin-bottom: 6px; line-height: 1.45; }
.reading.severe .read-warnings li:first-child { font-weight: 600; color: var(--red); }

/* ------------- payment files, grouped by paying company ------------- */

.company-files { margin-top: 12px; }
.company-files + .company-files { border-top: 1px solid var(--line); padding-top: 12px; }
.company-files-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px;
}

/* ------------- fields filled from an invoice ------------- */

/* Marked so nobody mistakes a machine reading for something a person typed. */
input.from-invoice {
  background: #fffbea;
  border-color: #e0b64d;
}
input.from-invoice:focus { border-color: var(--accent); }

.confirm-read {
  margin-top: 16px; padding: 12px 14px;
  border: 1px solid #e0b64d; border-radius: 6px; background: #fffbea;
}
.confirm-read .check {
  display: flex; align-items: flex-start; gap: 8px;
  font-weight: 600; cursor: pointer;
}
.confirm-read .check input { width: auto; margin-top: 2px; flex: none; }

/* ---------- choosing between accounts printed on one invoice ---------- */

.account-choice { margin-top: 12px; }
.account-choice .choice-head { font-weight: 650; margin-bottom: 8px; }
.account-choice .pick-account {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  text-align: left; height: auto; padding: 10px 12px; margin: 0 8px 8px 0;
  min-width: 200px;
}
.account-choice .pick-account .acct-no {
  font-family: ui-monospace, Consolas, monospace; font-size: 14px; letter-spacing: .5px;
}
.account-choice .pick-account .acct-name { font-size: 11.5px; color: var(--muted); }
.account-choice .pick-account .acct-warn { font-size: 11.5px; color: var(--red); font-weight: 600; }
.account-choice .pick-account.chosen {
  border-color: var(--accent); background: #eaf3fb; box-shadow: 0 0 0 2px rgba(11,108,177,.18);
}

/* ---------- the SQL posting on a payment-queue row ---------- */

.posting { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.posting .hint { margin: 0; }
.posting-ok { color: var(--muted); }

/* ---------- splitting one invoice across several accounts ---------- */

.posting-lines .integration-head { margin-bottom: 10px; }
.posting-lines select.pl-gl { width: 100%; }
.posting-lines input.pl-desc { width: 100%; }
/* A line with no account cannot be imported, so it is marked while being edited. */
.posting-lines tr.needs-account td { background: #fffbea; }
.posting-lines tfoot td { font-weight: 600; border-top: 2px solid var(--line); }

/* ---------- bank details already on file for a payee ---------- */

.payee-book { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 6px; background: #f6f8fa; }
.payee-book .choice-head { font-weight: 650; margin-bottom: 8px; }
.payee-book .use-payee {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  text-align: left; height: auto; padding: 10px 12px; margin: 0 8px 8px 0; min-width: 220px;
  background: #fff;
}
.payee-book .acct-no { font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
.payee-book .acct-name { font-size: 11.5px; color: var(--muted); }
.payee-book .acct-meta { font-size: 11px; color: var(--muted); }
.payee-book .use-payee.chosen {
  border-color: var(--accent); box-shadow: 0 0 0 2px rgba(11,108,177,.18);
}

/* ---------- a supplier this company has never paid ---------- */

.new-supplier {
  margin-top: 8px; padding: 10px 12px; border-radius: 6px;
  background: #fffbea; border: 1px solid #e0b64d;
}
.new-supplier .hint { margin: 4px 0 8px; }
.new-supplier-set { color: var(--muted); margin-top: 6px; }

/* A chosen name or account, so it is obvious which one was picked. */
.account-choice .btn.picked { border-color: var(--accent); background: #eaf3fa; }
.account-choice .btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------------- supporting documents ---------------- */

.att-list { list-style: none; margin: 0 0 10px; padding: 0; }
.att-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.att-row:last-child { border-bottom: none; }
.att-row .hint { flex: 1; }
.att-add { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.att-pick { cursor: pointer; }
.att-pick.busy { opacity: .6; pointer-events: none; }
/* The count beside a row in a listing, so a record with evidence is obvious. */
.att-count { font-variant-numeric: tabular-nums; color: var(--muted); }
.att-count.has { color: var(--ink); font-weight: 600; }

/* ---------------- attached files on a form ---------------- */

.filelist { list-style: none; margin: 10px 0 0; padding: 0; }
.filelist li {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; margin-bottom: 6px;
  border: 1px solid var(--line); border-radius: 6px; background: #f6f8fa;
}
.filelist .fl-name { flex: 1 1 auto; word-break: break-all; }
.filelist .fl-size { color: var(--muted); font-variant-numeric: tabular-nums; }

/* A field the portal works out, so it reads as shown rather than editable. */
input.computed { background: #f6f8fa; color: var(--muted); cursor: default; }

/* An account the ledger settled, shown as an answer rather than a prompt. */
.resolved-gl { margin-top: 6px; line-height: 1.45; }
.resolved-gl strong { color: var(--green); }

/* The split the ledger worked out, before anyone splits by hand. */
.proposed-split {
  margin-top: 14px; padding: 14px;
  border: 1px solid var(--line); border-radius: 8px; background: #f6f8fa;
}
.proposed-split table { background: var(--card); }
