/* ClaimGuard — VAT input-claim assurance. Design system.
   Subject: a fiscal reconciliation instrument. Type: Space Grotesk (display), Inter (UI),
   IBM Plex Mono (fiscal codes & money — the receipt-printer texture). */

:root {
  --paper:      #F7F7F4;   /* ledger paper (cooled, not cream) */
  --surface:    #FFFFFF;
  --surface-2:  #FBFBF9;
  --ink:        #17211D;   /* green-black */
  --ink-2:      #33413B;
  --muted:      #6B7671;
  --line:       #E6E7E2;
  --line-2:     #EFEFEA;
  --brand:      #0E5A47;   /* deep fiscal emerald — brand only */
  --brand-ink:  #0A4738;

  --ok:      #12805C;  --ok-bg:      #E6F3EC;  --ok-line:   #BFE0CE;
  --warn:    #B4740A;  --warn-bg:    #FBF0DC;  --warn-line: #EAD3A0;
  --risk:    #BE3A2F;  --risk-bg:    #FBE9E7;  --risk-line: #F0C4BE;
  --pending: #5B6B7A;  --pending-bg: #EDF0F2;  --pending-line: #D3DAE0;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(23,33,29,.04), 0 8px 24px -12px rgba(23,33,29,.10);
  --shadow-lg: 0 24px 60px -24px rgba(23,33,29,.28);

  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv05" 1, "ss01" 1;
}
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; margin: 0; color: var(--ink); }
.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.money { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* ── App shell ─────────────────────────────────────────────── */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--ink);
  color: #C9D2CD;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: 22px 16px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; }
.brand .seal { flex: 0 0 auto; }
.brand .word { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: #fff; letter-spacing: -.02em; }
.brand .word small { display: block; font-family: var(--font-mono); font-weight: 400; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #6E8079; margin-top: 2px; }

/* flex:1 so the nav fills the sidebar and its .spacer can push the side-foot to the bottom. */
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; flex: 1; }
.nav-label { font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: #59695F; padding: 14px 10px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: #B4BFB9; font-weight: 500; font-size: 14px;
  transition: background .14s ease, color .14s ease;
}
.nav-link svg { width: 17px; height: 17px; opacity: .8; }
.nav-link:hover { background: rgba(255,255,255,.05); color: #F1F4F2; }
.nav-link.active { background: var(--brand); color: #fff; }
.nav-link.active svg { opacity: 1; }
.sidebar .spacer { flex: 1; }
.side-foot { border-top: 1px solid rgba(255,255,255,.07); padding-top: 14px; font-size: 12px; color: #6E8079; }
.side-foot .co { color: #C9D2CD; font-weight: 500; }

/* ── Topbar + main ─────────────────────────────────────────── */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 62px; display: flex; align-items: stretch;
  border-bottom: 1px solid var(--line); background: rgba(247,247,244,.85);
  backdrop-filter: saturate(1.4) blur(8px); position: sticky; top: 0; z-index: 20;
}
.topbar .crumb { font-size: 13px; color: var(--muted); }
.topbar .crumb b { color: var(--ink); font-weight: 600; }
.usermenu { display: flex; align-items: center; gap: 12px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 600; font-family: var(--font-mono); }
.content { padding: 30px 32px 64px; max-width: 1180px; width: 100%; margin-inline: auto; }
.topbar-inner { width: 100%; max-width: 1180px; margin-inline: auto; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head .eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); margin-bottom: 8px; }
.page-head h1 { font-size: 27px; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

/* ── Cards ─────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { font-size: 15px; }
.card-head .hint { font-size: 12.5px; color: var(--muted); }

/* ── KPI stats ─────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .k { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.stat .k .dot { width: 8px; height: 8px; border-radius: 50%; }
.stat .v { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat .v .cur { font-family: var(--font-mono); font-size: 13px; color: var(--muted); font-weight: 400; margin-right: 5px; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ── Reconciliation bar (signature) ────────────────────────── */
.recon { padding: 22px; }
.recon .top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.recon .headline { font-family: var(--font-display); font-size: 34px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.recon .headline .cur { font-family: var(--font-mono); font-size: 15px; color: var(--muted); font-weight: 400; margin-right: 6px; }
.recon .headline .lbl { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 400; margin-bottom: 4px; }
.recon .of { text-align: right; font-size: 13px; color: var(--muted); }
.recon .of b { font-family: var(--font-mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.meter { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--line); box-shadow: inset 0 0 0 1px rgba(23,33,29,.04); }
.meter span { display: block; height: 100%; transition: width .5s cubic-bezier(.4,0,.1,1); }
.meter .s-ok { background: var(--ok); }
.meter .s-warn { background: var(--warn); }
.meter .s-risk { background: var(--risk); }
.meter .s-pending { background: var(--pending); background-image: linear-gradient(45deg, rgba(255,255,255,.18) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.18) 50%, rgba(255,255,255,.18) 75%, transparent 75%); background-size: 14px 14px; animation: stripe 1s linear infinite; }
@keyframes stripe { to { background-position: 14px 0; } }
.legend { display: flex; gap: 20px; margin-top: 14px; flex-wrap: wrap; }
.legend .item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.legend .swatch { width: 10px; height: 10px; border-radius: 3px; }
.legend .item b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ── Verdict pills ─────────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.pill.ok      { color: var(--ok);   background: var(--ok-bg);   border-color: var(--ok-line); }   .pill.ok .dot { background: var(--ok); }
.pill.warn    { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }  .pill.warn .dot { background: var(--warn); }
.pill.risk    { color: var(--risk); background: var(--risk-bg); border-color: var(--risk-line); }  .pill.risk .dot { background: var(--risk); }
.pill.pending { color: var(--pending); background: var(--pending-bg); border-color: var(--pending-line); } .pill.pending .dot { background: var(--pending); animation: pulse 1.2s ease-in-out infinite; }
.pill.neutral { color: var(--muted); background: var(--surface-2); border-color: var(--line); }
@keyframes pulse { 50% { opacity: .35; } }

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.ledger { width: 100%; border-collapse: collapse; font-size: 14px; }
table.ledger th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  font-weight: 600; padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; }
table.ledger td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.ledger tr:last-child td { border-bottom: none; }
table.ledger tbody tr { transition: background .12s ease; }
table.ledger tbody tr:hover { background: var(--surface-2); }
table.ledger td.r, table.ledger th.r { text-align: right; }
table.ledger .file { font-weight: 500; }
table.ledger .sub { color: var(--muted); font-size: 12px; }

/* ── Dropzone ──────────────────────────────────────────────── */
.dropzone {
  display: block; border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--surface-2);
  padding: 42px 24px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--ok-bg); }
.dropzone .ico { display: block; width: 44px; height: 44px; margin: 0 auto 14px; color: var(--brand); }
.dropzone h4 { font-size: 16px; margin-bottom: 5px; }
.dropzone p { color: var(--muted); font-size: 13px; margin: 0; }
.filelist { margin-top: 16px; display: flex; flex-direction: column; gap: 7px; }
.filelist .f { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.filelist .f .nm { flex: 1; font-weight: 500; }
.filelist .f .sz { font-family: var(--font-mono); color: var(--muted); font-size: 12px; }

/* ── Buttons + forms ───────────────────────────────────────── */
/* line-height + box-sizing pinned so <a class="btn"> and <button class="btn"> render the same height. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-sizing: border-box;
  font-family: var(--font-ui); font-weight: 600; font-size: 14px; line-height: 1.2;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
  transition: all .14s ease; text-decoration: none; white-space: nowrap; }
.row-actions .btn { height: 40px; padding-top: 0; padding-bottom: 0; }
.row-actions form { display: contents; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-2); background: var(--surface-2); }
.btn-danger { background: var(--risk); color: #fff; border-color: var(--risk); }
.btn-danger:hover { background: #A5312A; border-color: #A5312A; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field select { font-family: var(--font-ui); font-size: 14px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.field input:focus, .field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ok-bg); }
.field .help { font-size: 12px; color: var(--muted); }

/* ── Empty state ───────────────────────────────────────────── */
.empty { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty .ico { width: 46px; height: 46px; margin: 0 auto 14px; color: var(--line); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty p { margin: 0 0 18px; }

/* ── Toast ─────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px;
  box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500; z-index: 100;
  display: flex; align-items: center; gap: 10px; transition: opacity .4s ease;
  animation: toast-in .35s cubic-bezier(.2,.8,.2,1);
}
.toast .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
@keyframes toast-in { from { transform: translate(-50%, 12px); opacity: 0; } }

/* ── Modal / confirm dialog ────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200; padding: 24px;
  display: grid; place-items: center;
  background: rgba(23,33,29,.42); backdrop-filter: saturate(1.2) blur(2px);
  opacity: 0; visibility: hidden; transition: opacity .18s ease, visibility .18s ease;
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal {
  width: 100%; max-width: 430px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  overflow: hidden; transform: translateY(10px) scale(.985);
  transition: transform .2s cubic-bezier(.2,.8,.2,1);
}
.modal-backdrop.open .modal { transform: none; }
.modal-body { display: flex; gap: 15px; padding: 22px 22px 18px; }
.modal-ico { flex: none; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; }
.modal-ico svg { width: 21px; height: 21px; }
.modal-ico.danger { background: var(--risk-bg); color: var(--risk); }
.modal-ico.info   { background: var(--ok-bg);   color: var(--brand); }
.modal h3 { font-size: 16.5px; margin-bottom: 5px; }
.modal-body p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px;
  background: var(--surface-2); border-top: 1px solid var(--line-2);
}

/* ── Verdict filter chips ──────────────────────────────────── */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); transition: all .12s; }
.chip:hover { border-color: var(--ink-2); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.row-actions { display: flex; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.muted { color: var(--muted); }
.mt-0 { margin-top: 0; }
.tag { font-family: var(--font-mono); font-size: 11px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: 2px 7px; border-radius: 5px; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
  .sidebar .nav { flex-direction: row; flex-wrap: wrap; margin: 0; }
  .nav-label, .sidebar .spacer, .side-foot { display: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .content { padding: 20px; }
  .topbar-inner { padding: 0 20px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ── Auth / sign-in ────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(400px, 490px) 1fr; }

.auth-brand {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 46px 48px 38px;
  background: var(--ink);
  background-image:
    radial-gradient(90% 70% at 15% 0%, rgba(14,90,71,.55), transparent 60%),
    radial-gradient(70% 55% at 100% 100%, rgba(14,90,71,.30), transparent 60%);
  color: #C9D2CD;
}
.auth-ring {
  position: absolute; right: -170px; bottom: -170px; width: 520px; height: 520px;
  color: #3E8E78; opacity: .32; pointer-events: none;
  animation: seal-turn 240s linear infinite;
}
@keyframes seal-turn { to { transform: rotate(360deg); } }
.auth-mark { position: relative; display: flex; align-items: center; gap: 11px; }
.auth-mark .word { font-family: var(--font-display); font-weight: 600; font-size: 19px; color: #fff; letter-spacing: -.02em; }
.auth-mark .word small { display: block; font-family: var(--font-mono); font-weight: 400; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #6E8079; margin-top: 2px; }

.auth-pitch { position: relative; margin: auto 0; padding: 40px 0; max-width: 400px; }
.auth-pitch h1 { color: #fff; font-size: 30px; line-height: 1.18; letter-spacing: -.02em; }
.auth-pitch > p { margin: 14px 0 0; font-size: 14.5px; line-height: 1.6; color: #93A39B; }

.auth-points { list-style: none; margin: 30px 0 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.auth-points li { display: flex; gap: 13px; align-items: flex-start; }
.auth-points .pt-ico {
  flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(14,90,71,.5); border: 1px solid rgba(62,142,120,.45); color: #8FD0BC;
}
.auth-points .pt-ico svg { width: 15px; height: 15px; }
.auth-points li > span:last-child { font-size: 12.5px; line-height: 1.5; color: #93A39B; }
.auth-points b { display: block; color: #EAF3EE; font-size: 13.5px; font-weight: 600; margin-bottom: 1px; }

.auth-foot { position: relative; font-size: 12px; color: #6E8079; }
.auth-foot .sep, .auth-panel-foot .sep { margin: 0 6px; opacity: .7; }

.auth-panel {
  display: grid; place-items: center; padding: 40px 24px;
  background: radial-gradient(60% 40% at 50% 0%, rgba(14,90,71,.05), transparent 70%), var(--paper);
}
.auth-card-wrap { width: 100%; max-width: 432px; }
.auth-mobile-brand { display: none; align-items: center; justify-content: center; gap: 10px; margin-bottom: 22px; }
.auth-mobile-brand .word { font-family: var(--font-display); font-weight: 600; font-size: 20px; }

.auth-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 34px 36px 30px;
  animation: card-rise .45s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes card-rise { from { opacity: 0; transform: translateY(10px); } }

.auth-head { margin-bottom: 24px; }
.auth-head .eyebrow { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--brand); margin-bottom: 10px; }
.auth-head h2 { font-size: 24px; letter-spacing: -.02em; }
.auth-head p { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }

.auth-errors { display: none; }
.auth-errors.validation-summary-errors {
  display: block; margin-bottom: 18px; padding: 11px 14px;
  background: var(--risk-bg); border: 1px solid var(--risk-line); border-radius: var(--radius-sm);
  color: var(--risk); font-size: 13px; font-weight: 500;
}
.auth-errors ul { list-style: none; margin: 0; padding: 0; }

.field-error { font-size: 12.5px; color: var(--risk); }
.field-error:empty { display: none; }
input.input-validation-error { border-color: var(--risk) !important; }
input.input-validation-error:focus { box-shadow: 0 0 0 3px var(--risk-bg) !important; }

.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 44px; }
.pw-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: grid; place-items: center; width: 32px; height: 32px;
  background: none; border: none; border-radius: 7px; cursor: pointer; color: var(--muted);
}
.pw-toggle:hover { color: var(--ink); background: var(--surface-2); }
.pw-toggle svg { width: 17px; height: 17px; }

.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; margin: 2px 0 20px; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; margin: 0; }

.auth-submit { width: 100%; justify-content: center; padding: 12px 18px; font-size: 15px; border-radius: 10px; }
.auth-submit svg { width: 16px; height: 16px; transition: transform .15s ease; }
.auth-submit:hover svg { transform: translateX(3px); }

.auth-help { margin: 18px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }
.auth-panel-foot { text-align: center; font-size: 12px; color: var(--muted); margin: 18px 0 0; }

@media (max-width: 980px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-mobile-brand { display: flex; }
  .auth-card { padding: 28px 24px 24px; }
}

/* ── Feedback pass 2026-07-08: navigation + invoice-correction states ── */

/* Dashboard KPI tiles are links now — keep the card look, add an affordance on hover. */
a.stat { display: block; text-decoration: none; color: inherit; transition: border-color .15s ease, box-shadow .15s ease; }
a.stat:hover { border-color: var(--brand); box-shadow: var(--shadow), 0 0 0 3px var(--ok-bg); }

/* Clickable table rows (suppliers, invoices list) — same affordance as the batch tables. */
tr.rowlink { cursor: pointer; }
tr.rowlink:hover td { background: var(--surface-2); }

/* Sidebar company switcher (users who belong to several companies). */
.co-switch {
  width: 100%; padding: 7px 9px; font: inherit; font-size: 12.5px;
  color: #fff; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.22); border-radius: 8px; cursor: pointer;
}
.co-switch:hover { background: rgba(255,255,255,.14); }
.co-switch option { color: var(--ink); background: #fff; }

/* Invoice correction (Edit): two-pane layout with a tall, sticky PDF. */
.edit-grid { display: grid; grid-template-columns: minmax(460px, 1.15fr) minmax(430px, 1fr); gap: 20px; align-items: start; }
.edit-pdf { position: sticky; top: 12px; }
.edit-pdf iframe { display: block; width: 100%; height: calc(100vh - 170px); min-height: 480px; border: 0; border-top: 1px solid var(--line-2); background: #fff; }
@media (max-width: 1150px) {
  .edit-grid { grid-template-columns: 1fr; }
  .edit-pdf { position: static; }
  .edit-pdf iframe { height: 60vh; }
}

/* Field states on the correction form: verified-and-locked vs needs-attention. */
#editForm input.locked {
  background: var(--surface-2); color: var(--ink-2);
  border-style: dashed; cursor: default;
}
#editForm input.attention {
  border-color: var(--warn); background: #fffbeb;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, .09);
}
#editForm input.attention-soft { border-color: var(--warn-line); background: #fffdf4; }
.flag {
  display: inline-block; margin-left: 5px; padding: 1px 6px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--warn); background: var(--warn-bg); border: 1px solid var(--warn-line);
}
.unlock-bar { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.unlock-bar input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; margin: 0; }

/* == UX pass 2026-07-20: shared components ================================== */

/* Info note: a soft callout for helper copy that deserves more weight than .help text. */
.note { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; line-height: 1.5; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.note svg { flex: none; width: 15px; height: 15px; margin-top: 1px; color: var(--brand); }

/* Switch toggle (upload page "scan now"). The input stays a real checkbox for model binding. */
.switch { position: relative; display: inline-block; flex: none; width: 46px; height: 26px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .15s ease; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(23,33,29,.25); transition: transform .15s ease; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }

.scan-toggle { display: flex; gap: 13px; align-items: flex-start; margin-top: 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--surface-2); }
.scan-toggle b { font-size: 13.5px; }
.scan-toggle .desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.5; }

/* Verdict legend (upload page): equal mini-cards with a fixed-width pill column. */
.verdict-legend { display: flex; flex-direction: column; gap: 10px; }
.vl-item { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 11px 13px; background: var(--surface); }
.vl-item .pill { flex: none; width: 112px; justify-content: center; }
.vl-item span:last-child { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* Filter bar (Periods etc.): one clean row of labelled controls above the content. */
.filter-bar { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.filter-bar .field { margin: 0; }

/* Sidebar company switcher: custom drop-UP menu in the sidebar's palette. */
.co-menu { position: relative; }
.co-menu .co-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  font: inherit; font-size: 12.5px; font-weight: 500; color: #C9D2CD; text-align: left;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 9px;
  padding: 9px 11px; cursor: pointer; transition: background .12s ease, border-color .12s ease; }
.co-menu .co-btn:hover { background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.26); }
.co-menu .co-btn .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-menu .co-btn svg { flex: none; width: 13px; height: 13px; opacity: .6; transition: transform .15s ease; }
.co-menu.open .co-btn svg { transform: rotate(180deg); }
.co-menu .co-list { position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  display: none; flex-direction: column; gap: 2px; padding: 5px;
  background: #1F2A25; border: 1px solid rgba(255,255,255,.14); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,.45); }
.co-menu.open .co-list { display: flex; }
.co-menu .co-item { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font: inherit; font-size: 12.5px; color: #C9D2CD; text-align: left; width: 100%;
  background: none; border: none; border-radius: 7px; padding: 8px 9px; cursor: pointer; }
.co-menu .co-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.co-menu .co-item.on { color: #fff; font-weight: 600; background: rgba(14,90,71,.55); }
.co-menu .co-item svg { flex: none; width: 13px; height: 13px; }
.co-menu .co-cap { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #59695F; padding: 4px 9px 2px; }

/* Correct-fields page: Field data / PDF tabs, each panel spanning the full width. */
.edit-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.edit-pane { display: none; }
.edit-pane.on { display: block; }
.edit-pane .edit-pdf iframe { height: calc(100vh - 230px); min-height: 520px; }
