/* apps/web/assets/app.css — the calm-ledger palette from the approved mock-ups (order 47).
   Phone (below 760px): the checklist. Desktop: the navy rail, the flat journey, colour-edged
   cards and rows. One stylesheet, no framework, no build step. */
:root {
  --navy: #2c3a78; --rail-a: #26336b; --rail-b: #34498a;
  --ink: #1b2340; --line: #e6e9f3; --bg: #f4f6fb; --grey: #6b7190;
  --amber: #b26a00; --amberbg: #fff4e0; --amberln: #f0b44c;
  --blue: #2f4db0; --bluebg: #e8ecfb;
  --green: #2e7d57; --greenbg: #e3f4ea;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.muted { color: var(--grey); font-size: 12px; }
.error { margin: 16px; padding: 12px 14px; border: 1px solid var(--amberln); background: var(--amberbg); border-radius: 12px; color: var(--amber); }
.denied { margin: 24px 16px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }

/* --- login ------------------------------------------------------------------------- */
.login { max-width: 340px; margin: 12vh auto; padding: 0 20px; text-align: center; }
.login img { width: 96px; height: 96px; }
.login h1 { font-size: 22px; margin: 10px 0 18px; }
.login input {
  width: 100%; padding: 11px 12px; margin-bottom: 10px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.login button { width: 100%; padding: 11px; border: 0; border-radius: 10px; background: var(--navy); color: #fff; font-size: 15px; font-weight: 600; }
#error { color: var(--amber); min-height: 18px; font-size: 13px; }

/* --- the phone header and checklist -------------------------------------------------- */
.top { display: flex; align-items: center; gap: 8px; padding: 14px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.top img { width: 28px; height: 28px; }
.top #company { margin-left: auto; color: var(--grey); font-size: 12px; }
.hero { margin: 14px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.hero .step { font-size: 12px; color: var(--grey); }
.hero .big { font-size: 18px; font-weight: 700; margin: 2px 0 8px; }
.prog { display: flex; gap: 4px; }
.prog i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.prog i.d { background: var(--green); }
.prog i.n { background: #e39a1c; }
.steps { margin: 0 14px 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.s { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.s:last-child { border: 0; }
.s[data-state="current"] { background: #fffaf0; }
.dot { width: 20px; height: 20px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; background: #c9cde0; }
.dot.done { background: var(--green); }
.dot.current { background: #e39a1c; }
.chev { margin-left: auto; color: var(--grey); text-decoration: none; font-size: 18px; }
.s .btn { margin-left: auto; }

/* --- the desktop rail and fix list ---------------------------------------------------- */
.rail { display: none; }
.hd { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.hd h3 { margin: 0; font-size: 19px; }
.hd .month { margin-left: auto; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 5px 10px; font-size: 12px; }
.journey { display: flex; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; gap: 10px; }
.j { flex: 1 1 150px; display: flex; align-items: center; gap: 8px; }
.j .t { font-size: 12px; color: var(--grey); }
.j .t b { display: block; font-size: 12.5px; color: var(--ink); }
.j.cur .t b { color: var(--amber); }
.j .dot { width: 24px; height: 24px; font-size: 12px; }
.j.cur .dot { box-shadow: 0 0 0 4px #fdebc8; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.card {
  border-radius: 12px; padding: 14px 14px 14px 18px; border: 1px solid var(--line); background: #fff;
  position: relative; overflow: hidden; text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.card:before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.card.c-action:before { background: var(--amberln); }
.card.c-decision:before { background: var(--blue); }
.card.c-fine:before { background: var(--green); }
.card .n { font-size: 28px; font-weight: 800; line-height: 1.1; }
.card.c-action .n { color: var(--amber); }
.card.c-decision .n { color: var(--blue); }
.card.c-fine .n { color: var(--green); }
.card.on { box-shadow: 0 0 0 2px var(--navy) inset; }
.list { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.lh { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fffaf1; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.row:last-child { border: 0; }
.cnt { width: 34px; height: 34px; border-radius: 9px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; font-size: 14px; background: var(--amberbg); color: var(--amber); }
.cnt.decision { background: var(--bluebg); color: var(--blue); }
.cnt.fine { background: var(--greenbg); color: var(--green); }
.what { flex: 1; }
.what b { display: block; }
.av { width: 26px; height: 26px; border-radius: 50%; background: #dfe6ff; color: var(--navy); font-weight: 700; font-size: 11px; display: flex; align-items: center; justify-content: center; flex: none; }
.btn { border: 0; border-radius: 8px; padding: 6px 12px; font-size: 12px; background: var(--navy); color: #fff; flex: none; font-family: inherit; }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.vouchers { width: 100%; border-collapse: collapse; background: #fbfcff; font-size: 12px; }
.vouchers th, .vouchers td { padding: 8px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; word-break: break-word; }
.vouchers th { color: var(--grey); font-weight: 600; }
.vouchers td.amt { text-align: right; white-space: nowrap; }
main { padding: 0; }
main[data-page="fixes"] { padding: 16px; }

@media (min-width: 761px) {
  body { display: flex; min-height: 100vh; }
  .top { display: none; }
  .rail {
    display: block; width: 190px; flex: none; background: linear-gradient(180deg, var(--rail-a), var(--rail-b));
    color: #dfe5ff; padding: 16px 12px;
  }
  .rail .brand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: #fff; font-size: 15px; margin-bottom: 20px; }
  .rail .brand img { width: 30px; height: 30px; }
  .rail a { display: block; padding: 8px 10px; border-radius: 9px; margin-bottom: 3px; color: #dfe5ff; text-decoration: none; }
  .rail a.on { background: rgba(255, 255, 255, .16); color: #fff; font-weight: 600; }
  .rail .soon { display: block; padding: 8px 10px; font-size: 12px; opacity: .7; }
  main { flex: 1; padding: 18px 22px; }
  .hero, .steps { margin: 0 0 16px; }
}
@media (max-width: 760px) {
  .cards { grid-template-columns: 1fr; }
  .journey { display: none; }
  .hd { padding: 14px 0 0; }
}

/* VRA-283: the instruction leads; shared table tracks keep every group aligned. */
.next-action { margin: 14px; padding: 18px; background: #fffaf0; border-left: 4px solid var(--amberln); }
.next-action h1 { margin: 0 0 8px; font-size: 20px; }
.next-action p { margin: 0 0 12px; max-width: 75ch; }
.next-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.next-action a.btn { display: inline-block; text-decoration: none; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 14px; }
.month-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.month-form input { min-height: 40px; padding: 6px 8px; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.sync-note { flex-basis: 100%; margin: 0; color: var(--grey); font-size: 12px; }
.page-links { display: flex; gap: 18px; }
.page-links a { color: var(--navy); }
.btn { min-height: 40px; cursor: pointer; }
.btn:disabled { cursor: wait; opacity: .6; }
a:focus-visible, button:focus-visible, input:focus-visible, .table-scroll:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
main { min-width: 0; }
.row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 80px 65px; }
.av { width: auto; height: auto; padding: 5px 8px; border-radius: 5px; font-size: 12px; }
.table-scroll { width: 100%; overflow-x: auto; }
.vouchers { table-layout: fixed; min-width: 940px; }
.col-voucher { width: 11%; }
.col-date { width: 10%; }
.col-type { width: 9%; }
.col-party { width: 16%; }
.col-amount { width: 16%; }
.col-instruction { width: 38%; }
.vouchers th:nth-child(5) { text-align: right; }
.vouchers td.amt { white-space: normal; font-variant-numeric: tabular-nums; }
.vouchers td p { margin: 0 0 8px; }
.vouchers td p:last-child { margin-bottom: 0; }
.difference { color: var(--amber); }
@media (min-width: 761px) {
  .next-action, .toolbar { margin: 0 0 18px; }
}
@media (max-width: 760px) {
  main[data-page="fixes"] .next-action, main[data-page="fixes"] .toolbar { margin: 0 0 16px; }
  .hd { flex-wrap: wrap; }
  .row { grid-template-columns: 34px minmax(0, 1fr) 65px; gap: 8px; }
  .row .what { grid-column: 2 / 4; }
  .row .av { grid-column: 2; justify-self: start; }
  .lh { flex-wrap: wrap; }
}
@media (max-width: 1100px) {
  .vouchers { min-width: 0; }
  .vouchers colgroup, .vouchers thead { display: none; }
  .vouchers, .vouchers tbody { display: block; }
  .vouchers tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; gap: 12px; border-bottom: 1px solid var(--line); }
  .vouchers td { display: block; padding: 0; border: 0; overflow-wrap: anywhere; }
  .vouchers td::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--grey); font-size: 11px; }
  .vouchers td.instruction-cell { grid-column: 1 / -1; grid-row: 1; font-size: 14px; }
  .vouchers td.amt { text-align: left; }
}
