:root {
  --ink: #1c1d21;
  --muted: #5b5f68;
  --line: #d9d6d0;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --accent: #7a1f2b;      /* maroon, as in the CLAADEX reports */
  --accent-ink: #ffffff;
  --ok: #1e6b3a;
  --ok-bg: #e7f3eb;
  --bad: #a3221b;
  --bad-bg: #fbe9e7;
  --warn-bg: #fff6dc;
  --warn-line: #e3c463;
}
* { box-sizing: border-box; }
html { font-size: 17px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif; line-height: 1.5;
  min-height: 100vh; display: flex; flex-direction: column;
}
.test-band { background: #2f3a4a; color: #fff; text-align: center; font-size: .85rem; padding: .3rem 1rem; letter-spacing: .02em; }
.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem;
  padding: .9rem 1.5rem; background: var(--panel); border-bottom: 3px solid var(--accent);
}
.brand .mark { font-weight: 700; letter-spacing: .08em; color: var(--accent); font-size: 1.15rem; }
.brand .sub { color: var(--muted); }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.25rem; }
nav a { color: var(--ink); text-decoration: none; }
nav a:hover { color: var(--accent); text-decoration: underline; }
form.inline { display: inline; margin: 0; }
main.page { width: 100%; max-width: 1200px; margin: 0 auto; padding: 1.5rem; flex: 1; }
main.narrow { width: 100%; max-width: 30rem; margin: 0 auto; padding: 2.5rem 1rem; flex: 1; }
h1 { font-size: 1.6rem; margin: 0 0 .75rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 .5rem; color: var(--accent); }
.step { color: var(--muted); margin-top: -.25rem; }
.hint { color: var(--muted); font-size: .92rem; }
.field { margin: 0 0 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .3rem; }
input[type=email], input[type=password], input[type=text], select {
  width: 100%; font: inherit; padding: .6rem .7rem; border: 1px solid #a9a59d; border-radius: 4px; background: #fff;
}
select { width: auto; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid #e2a7af; outline-offset: 1px; }
button, .button {
  display: inline-block; font: inherit; font-weight: 600; padding: .55rem 1.1rem; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--ink); background: #fff; color: var(--ink); text-decoration: none;
}
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.danger { border-color: var(--bad); color: var(--bad); }
button.link { border: 0; background: none; padding: 0; font-weight: 400; color: var(--ink); }
button.link:hover { color: var(--accent); text-decoration: underline; }
.messages { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.messages li { padding: .65rem .9rem; border-radius: 4px; margin-bottom: .5rem; border: 1px solid var(--line); background: #fff; }
.msg-success { background: var(--ok-bg) !important; border-color: #9fcdb0 !important; color: var(--ok); }
.msg-error { background: var(--bad-bg) !important; border-color: #e6aaa5 !important; color: var(--bad); }
.msg-warning { background: var(--warn-bg) !important; border-color: var(--warn-line) !important; }
.error-box { background: var(--bad-bg); border: 1px solid #e6aaa5; color: var(--bad); padding: .6rem .9rem; border-radius: 4px; margin-bottom: 1rem; }
.error-box p { margin: 0; }
.field-error { color: var(--bad); margin: .25rem 0 0; font-size: .92rem; }
.warn-box { background: var(--warn-bg); border: 1px solid var(--warn-line); padding: .6rem 1rem; border-radius: 4px; margin-bottom: 1rem; }
.placeholder { border: 2px dashed var(--line); padding: 1.5rem; border-radius: 6px; color: var(--muted); background: #fff; }
.steps { padding-left: 1.3rem; }
.qr { background: #fff; border: 1px solid var(--line); display: inline-block; padding: .5rem; }
.qr svg { display: block; width: 220px; height: 220px; }
code { font-family: Consolas, "Courier New", monospace; }
code.secret { display: inline-block; font-size: 1.05rem; letter-spacing: .03em; background: #fff; border: 1px solid var(--line); padding: .1rem .35rem; }
ol.codes { columns: 2; font-size: 1.15rem; padding-left: 1.6rem; background: #fff; border: 1px solid var(--line); padding: 1rem 1rem 1rem 2.2rem; }
table { border-collapse: collapse; width: 100%; background: #fff; }
table.grid th, table.grid td { border: 1px solid var(--line); padding: .45rem .6rem; text-align: left; vertical-align: top; font-size: .93rem; }
table.grid thead th { background: #f1eee8; }
table.facts { width: auto; }
table.facts th, table.facts td { text-align: left; padding: .4rem 1rem .4rem 0; border-bottom: 1px solid var(--line); }
.nowrap { white-space: nowrap; }
.toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; margin: 1rem 0 .5rem; }
.filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.filters label { font-weight: 600; display: flex; flex-direction: column; gap: .2rem; }
.row-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.row-form .field { margin: 0; }
.row-form input { width: 9rem; }
.table-scroll { overflow-x: auto; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 1.25rem; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  html { font-size: 16px; }
  .top, main.page { padding-left: 1rem; padding-right: 1rem; }
  ol.codes { columns: 1; }
}
@media print {
  .top nav, .test-band, .foot, .button, button { display: none; }
  body { background: #fff; }
}

/* Customers (step 2) */
.title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.title-row h1 { margin: 0; }
.counts { list-style: none; padding: 0; margin: 0 0 1.25rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.counts li { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .6rem 1rem; color: var(--muted); }
.counts a { color: inherit; text-decoration: none; }
.counts .n { display: block; font-size: 1.6rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.filters.wide { margin: 0 0 1rem; }
.filters input[type=text] { width: 100%; }
.filters .grow { flex: 1 1 16rem; }
.filters label.check, label.check { flex-direction: row; align-items: center; gap: .4rem; font-weight: 400; display: flex; }
table.customers td a { color: var(--accent); }
.status { display: inline-block; padding: .05rem .5rem; border-radius: 999px; background: #eef1ee; border: 1px solid #c9d3cb; font-size: .88rem; white-space: nowrap; }
.status.big { font-size: 1rem; padding: .2rem .8rem; }
.pay-overdue { color: var(--bad); font-weight: 600; }
.pay-part_paid { color: #8a5a00; font-weight: 600; }
.big-form fieldset { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 1rem 1.25rem .5rem; margin: 0 0 1.25rem; }
.big-form legend { font-weight: 700; color: var(--accent); padding: 0 .4rem; font-size: 1.1rem; }
.big-form textarea, .big-form input[type=date], .big-form input[type=number] {
  width: 100%; font: inherit; padding: .6rem .7rem; border: 1px solid #a9a59d; border-radius: 4px; background: #fff;
}
.big-form select { width: 100%; }
.big-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.help { color: var(--muted); font-size: .88rem; margin: .25rem 0 0; }
.optional { font-weight: 400; color: var(--muted); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--bad); }
.module-group h3 { font-size: 1rem; margin: .5rem 0 .25rem; }
ul.ticks { list-style: none; padding: 0; margin: 0 0 .75rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .3rem 1rem; }
ul.ticks label { display: flex; align-items: flex-start; gap: .45rem; }
ul.ticks .tick-text { line-height: 1.35; }
ul.ticks input { width: 1.1rem; height: 1.1rem; flex: none; margin-top: .12rem; }
ul.ticks .unreleased { color: var(--muted); }
.tag { display: inline-block; font-size: .78rem; padding: 0 .45rem; border-radius: 999px; background: #f1eee8; border: 1px solid var(--line); color: var(--ink); }
.tag.muted { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin: 1rem 0; }
.actions .warn-box { flex-basis: 100%; }
.sentence { font-size: 1.15rem; font-weight: 600; background: #fff; border-left: 4px solid var(--accent); padding: .75rem 1rem; }
.blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1rem; margin: 1rem 0; }
.block { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .5rem 1.1rem 1rem; }
.block h2 { margin-top: .5rem; }
.block h2 .sub { color: var(--muted); font-weight: 400; font-size: .95rem; }
.pre { white-space: pre-line; }
tr.not-bought td { color: var(--muted); }
.crumb { margin: 0 0 .25rem; color: var(--muted); }
.crumb a { color: var(--muted); }
.actions-line { margin: 0 0 .5rem; }
.footer-preview { margin: 1rem 0; }
.fp-label { font-weight: 600; margin-bottom: .35rem; }
.fp-page { position: relative; background: #fff; border: 1px solid #b9b5ad; box-shadow: 0 1px 3px rgba(0,0,0,.08); height: 7rem; max-width: 40rem; overflow: hidden; }
.fp-watermark { position: absolute; top: 1.4rem; left: 0; right: 0; text-align: center; font-size: 1.3rem; font-weight: 700; color: rgba(160, 30, 30, .28); letter-spacing: .06em; transform: rotate(-4deg); }
.fp-foot { position: absolute; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid #c8c4bc; padding: .4rem .8rem; font-size: .8rem; color: #444; }
@media (max-width: 640px) { .big-form .two { grid-template-columns: 1fr; } .blocks { grid-template-columns: 1fr; } }
.big-form input[type=number] { max-width: 10rem; }
table.customers td:first-child { min-width: 12rem; }
.block table.grid td, .block table.grid th { padding: .35rem .5rem; }

/* Licences (step 3) */
.action-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin: .25rem 0 1rem; }
.button.danger { border-color: var(--bad); color: var(--bad); }
.button.disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
button.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
button.small, .button.small { padding: .25rem .6rem; font-size: .88rem; }
.sentence.danger { border-left-color: var(--bad); }
.intro { max-width: 46rem; }
.narrow-form { max-width: 40rem; }
.suspension p { margin: .2rem 0; }
.notes { margin: 1rem 0; }
.note-form { display: flex; gap: .5rem; align-items: flex-start; margin-bottom: .75rem; }
.note-form textarea { flex: 1; font: inherit; padding: .5rem .6rem; border: 1px solid #a9a59d; border-radius: 4px; }
.note { border-top: 1px solid var(--line); padding: .5rem 0; }
.note-meta { color: var(--muted); font-size: .88rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.big-form input[type=file] { font: inherit; }
.big-form input[type=checkbox] { width: 1.1rem; height: 1.1rem; }
nav { row-gap: .4rem; }

/* Exports (step 4) */
.export-list { display: grid; gap: .6rem; max-width: 60rem; margin-top: 1rem; }
.export-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .75rem 1rem; }
.export-text { flex: 1 1 18rem; display: flex; flex-direction: column; }
.export-row label, .filters label { font-weight: 600; }
.export-row input[type=date], .filters input[type=date] { font: inherit; padding: .4rem .5rem; border: 1px solid #a9a59d; border-radius: 4px; }
.inline-export { margin: 0 0 1rem; }
.title-row .action-bar { margin: 0; }
table.grid td a { color: var(--accent); }
table.grid .status { white-space: normal; border-radius: 10px; }

/* A, B or C: one choice per line, the whole line clickable */
.radio-list > div { margin: 0 0 .35rem; }
.radio-list label { display: flex; align-items: flex-start; gap: .5rem; font-weight: 400; margin: 0; }
.radio-list input { width: 1.1rem; height: 1.1rem; flex: none; margin-top: .15rem; }
.code-confirm { max-width: 18rem; margin: 1rem 0; }
.code-confirm input { font-size: 1.2rem; letter-spacing: .15em; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
@media (max-width: 720px) { .three { grid-template-columns: 1fr; } }
.logo-preview { max-width: 12rem; max-height: 5rem; margin-top: .4rem; border: 1px solid var(--line, #ddd); }
