/* Atlas: the paper, ink and type of pequodco.com (decision 19), drawn as an app (decision 25).
   White paper, black ink, Franklin Gothic URW. Ink, never fill: colour is a dot, a fine rule
   or a figure. It says two things and nothing else: a state (green, amber, red), and whose
   money a figure is — four quiet inks, the same on every screen: the client's, the artists',
   the third parties' (producers and intermediaries) and the gallery's. The only fill is the
   lightest shade of the paper: on every other row of a table, which tells the rows apart (a
   shade deeper under the pointer), and behind a message.
   Type carries the order of things; hairlines group; a button and a form's field keep an edge,
   a search or a filter is a single line; a table closes with a double rule, as in a ledger.
   No dark mode. */

@font-face { font-family: "Franklin Gothic URW"; src: url(fonts/franklin-book.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Franklin Gothic URW"; src: url(fonts/franklin-medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Franklin Gothic URW"; src: url(fonts/franklin-demi.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Franklin Gothic URW Cond"; src: url(fonts/franklin-cond-book.woff2) format("woff2"); font-weight: 400; font-display: swap; }

:root {
  color-scheme: light;
  accent-color: var(--ink);
  --ink: #000;
  --paper: #fff;
  --muted: #5f5f5f;
  --red: #a3261b;
  --green: #2d6a39;
  --amber: #8a5a00;
  --font: "Franklin Gothic URW", "Franklin Gothic", "Helvetica Neue", Arial, sans-serif;
  --cond: "Franklin Gothic URW Cond", "Franklin Gothic URW", "Arial Narrow", sans-serif;
  --line: #d9d7cf;                 /* hairlines that group */
  --edge: #908e85;                 /* the edge of what is pressed or typed in (3:1 on paper) */
  --rule: #eceae3;                 /* the faintest: between rows */
  --panel: #f6f5f1;                /* the light shade: every other row of a table, a message */
  --hover: #ebe9e2;                /* a shade deeper: the row under the pointer */
  --f-cliente: #23527c;            /* the client's money: blue ink */
  --f-artista: #6a3f7a;            /* the artists': plum */
  --f-tercero: #1f6b6b;            /* producers and intermediaries: petrol */
  --f-galeria: #2b2a27;            /* what stays for the gallery: graphite */
  --info: #3d5a99;                 /* paid over: neither good nor bad, to be placed */
  --page: 90vw;                 /* the whole of Atlas, its menu bar included, is this wide (Mau, 11 Nov 2026) */
  font-size: 15px;                 /* «Tamaño»: normal */
}
:root[data-size="compacto"] { font-size: 13px; }
:root[data-size="grande"] { font-size: 18px; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body {
  font-family: var(--font); font-weight: 400; line-height: 1.5;
  -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }

h1, h2, h3 { font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 0.75rem; }
h1 { font-size: 2.3rem; letter-spacing: -0.028em; }
h2 { font-size: 1.35rem; }
h1 .plus { font-weight: 400; color: var(--ink-f, var(--ink)); margin-right: 0.1em; }      /* a screen that writes carries the mark of its button */
p { margin: 0 0 0.75rem; }
a { color: inherit; text-underline-offset: 0.18em; }
.eyebrow {
  font-weight: 500; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
  margin: 0 0 0.35rem;
}
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
p.num { white-space: normal; }                  /* a sentence with figures wraps; a figure in a cell never does */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }   /* for readers only */

/* What every screen says the same way (decision 25). A family's ink, for whatever carries the
   class; the invoice's own columns and the notes have none. */
.f-cliente { --ink-f: var(--f-cliente); }
.f-artista { --ink-f: var(--f-artista); }
.f-tercero { --ink-f: var(--f-tercero); }
.f-galeria { --ink-f: var(--f-galeria); }
.f-factura, .f-nota { --ink-f: var(--muted); }
.neg { color: var(--red); }
.zero { color: var(--muted); }                  /* a nought steps back so the figures that matter stand out */
.due { color: var(--ink-f); font-weight: 500; }   /* what is still owed, in the ink of whose money it is */
/* A state: its word and a small mark. The word says it; the mark's shape — full, half, hollow,
   ringed or dotted — and its colour say it at a glance (unpaid and not yet due are both
   hollow: red and amber). The word sits on the row's own baseline; the mark is centred on its
   capitals. */
.pill { display: inline-block; font-size: 0.74rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; color: var(--muted); }
.pill::before { content: ""; display: inline-block; box-sizing: border-box; width: 0.76em; height: 0.76em; border-radius: 50%; border: 1.5px solid currentColor; margin-right: 0.55em; vertical-align: -0.04em; }
.pill.ok { color: var(--green); }
.pill.ok::before { background: currentColor; }
.pill.warn { color: var(--amber); }
.pill.warn::before { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.pill.bad { color: var(--red); }
.pill.wait { color: var(--amber); }                            /* not yet due, not yet paid: hollow, in amber */
.pill.bad::before, .pill.wait::before, .pill.off::before { border-width: 2px; }   /* a ring alone has to be seen */
.pill.info { color: var(--info); }
.pill.info::before { background: currentColor; box-shadow: 0 0 0 1.5px var(--paper), 0 0 0 3px currentColor; margin-left: 0.2em; margin-right: 0.75em; }
.pill.off::before { border-style: dotted; }
.pill.rol { color: var(--ink-f); letter-spacing: 0; font-size: 0.8rem; text-transform: none; }
.pill.rol::before { content: none; }
/* Figures: large, light numerals in a line; a dot keys each to its family's ink. No boxes. A
   figure is never narrower than its amount: a line that does not fit wraps. */
.kpis { display: flex; flex-wrap: wrap; gap: 0.9rem 3.5rem; padding: 0.2rem 0 0.1rem; }
.kset { display: flex; flex-wrap: wrap; gap: 0.7rem 2.2rem; align-items: end; }
.kpi { flex: 0 0 auto; display: grid; gap: 0.2rem; }
.kpi .l { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.kpi[class*="f-"] .l::before { content: ""; display: inline-block; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--ink-f); margin-right: 0.4rem; vertical-align: 0.08em; }
.kpi .v { font-size: 1.5rem; font-weight: 400; letter-spacing: -0.015em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 700px) {
  .kpis { gap: 0.9rem 2rem; }
  .kset { gap: 0.6rem 1.6rem; }
  .kpi .v { font-size: 1.25rem; }
}

/* Header (ui.js): the wordmark with «Tamaño» and «Salir»; under them the working bar — the
   screens that read as tabs in groups, the three that write as buttons. */
.top { width: var(--page); margin: 0 auto; padding: 0.9rem 0 0; }
.top .strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding-bottom: 0.75rem; }
.top .filtros { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1.1rem; padding: 0.55rem 0 0; font-size: 0.85rem; }
.top .filtros[hidden] { display: none; }
.top .filtros .link { margin-left: auto; }
.top .bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 1.5rem;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--ink);
}
.brand { display: flex; align-items: baseline; gap: 0.6rem; text-decoration: none; }
.brand img { height: 1.7rem; width: auto; display: block; }
.brand span { font-family: var(--cond); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.14em; }
.nav { display: flex; flex-wrap: wrap; align-self: flex-end; }   /* a narrow window wraps the groups; no screen is ever hidden */
.nav .grp { display: flex; gap: 1.2rem; padding: 0 1.2rem; position: relative; }
.nav .grp:first-child { padding-left: 0; }
.nav .grp + .grp::before { content: ""; position: absolute; left: 0; top: 0.7rem; bottom: 0.7rem; border-left: 1px solid var(--line); }
.nav a {
  font-weight: 500; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted);
  text-decoration: none; padding: 0.8rem 0 0.65rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.top .do { display: flex; gap: 0.4rem; padding: 0.4rem 0; }
.act {
  display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 500; font-size: 0.86rem; white-space: nowrap; text-decoration: none;
  padding: 0.38rem 0.8rem 0.36rem 0.65rem; background: var(--paper); border: 1px solid var(--edge); border-radius: 6px;
}
.plus { font-weight: 700; font-size: 1.05em; line-height: 1; }                 /* the mark of what writes; never read aloud */
.act.in .plus { color: var(--f-cliente); }
.act.out .plus { color: var(--f-artista); }
.act.new { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.act:hover { border-color: var(--ink); }
.act.in[aria-current="page"] { border-color: var(--f-cliente); box-shadow: inset 0 -2px 0 var(--f-cliente); }
.act.out[aria-current="page"] { border-color: var(--f-artista); box-shadow: inset 0 -2px 0 var(--f-artista); }
.act.new[aria-current="page"] { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--ink); }
.act.new[aria-current="page"]:focus-visible { outline-offset: 5px; }
.tools { display: flex; align-items: center; gap: 1rem; }
.size { display: flex; border: 1px solid var(--edge); border-radius: 6px; }
.size button {
  font: inherit; background: var(--paper); color: var(--muted); border: 0; border-left: 1px solid var(--line); border-radius: 0;
  width: 1.9rem; height: 1.7rem; cursor: pointer; line-height: 1; padding: 0;
}
.size button:first-child { border-left: 0; border-radius: 5px 0 0 5px; }
.size button:last-child { border-radius: 0 5px 5px 0; }
.size button:focus-visible { outline-offset: -2px; position: relative; }
.size button[aria-pressed="true"]:focus-visible { outline-color: var(--paper); }
.size button:nth-child(1) { font-size: 0.72rem; }
.size button:nth-child(2) { font-size: 0.9rem; }
.size button:nth-child(3) { font-size: 1.1rem; }
.size button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

main { width: var(--page); margin: 0 auto; padding: 2rem 0 4rem; }

/* Buttons and fields: a soft edge that turns to ink under the pointer or the cursor; the one
   that saves is solid ink. */
button, .button {
  font: inherit; font-weight: 500; font-size: 0.92rem;
  color: var(--ink); background: var(--paper); border: 1px solid var(--edge); border-radius: 6px;
  padding: 0.55rem 1rem; cursor: pointer; text-decoration: none; display: inline-block;
}
button:hover:not(:disabled), .button:hover { border-color: var(--ink); }
button.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.button.write { color: var(--ink-f); border-color: var(--ink-f); }                 /* the two that move money, in the ink of whose money it is */
.button.write:hover { border-color: var(--ink-f); box-shadow: inset 0 0 0 1px var(--ink-f); }
button:disabled { opacity: 0.4; cursor: default; }
button.link { border: 0; border-radius: 0; padding: 0; background: none; font-weight: 400; text-decoration: underline; text-underline-offset: 0.18em; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

label { display: block; margin: 0 0 1rem; }
label > span { display: block; font-weight: 500; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.3rem; }
input {
  font: inherit; font-size: 1rem; width: 100%; color: var(--ink); background: var(--paper);
  border: 1px solid var(--edge); border-radius: 6px; padding: 0.55rem 0.7rem;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--ink); outline-offset: 0; }
input.code { font-size: 1.6rem; letter-spacing: 0.3em; font-variant-numeric: tabular-nums; max-width: 12rem; }

.message { border-left: 3px solid var(--ink); border-radius: 0 6px 6px 0; padding: 0.5rem 0.9rem; margin: 0 0 1rem; background: var(--panel); }
.message.error { border-left-color: var(--red); color: var(--red); }

/* Entrar */
.gate { max-width: 24rem; margin: 3rem auto; }
.gate .brand img { height: 2.6rem; }
.gate .brand { margin-bottom: 2.5rem; }
.gate form + form, .gate p:last-child { margin-top: 1.5rem; }
.qr { display: block; width: 12rem; height: 12rem; border: 1px solid var(--line); border-radius: 6px; margin: 0 0 0.75rem; image-rendering: pixelated; }
.secret { font-family: var(--cond); font-size: 1rem; letter-spacing: 0.12em; word-break: break-all; }

/* Inicio: what to write, what to find, what is pending, where to look. Type and rules, no boxes. */
.home section > h2 { font-size: 0.95rem; font-weight: 500; color: var(--muted); margin: 0 0 0.7rem; letter-spacing: 0; border-top: 0; padding-top: 0; }
.home section { margin: 0 0 2.6rem; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.action { display: grid; gap: 0.3rem; align-content: start; padding: 1.1rem 1.4rem 1.2rem; text-decoration: none; border-left: 1px solid var(--line); }
.action:first-child { border-left: 0; padding-left: 0; }
.action strong { font-weight: 500; font-size: 1.55rem; letter-spacing: -0.025em; line-height: 1.15; }
.action .plus { color: var(--ink-f, var(--ink)); font-weight: 400; }
.action > span { color: var(--muted); }
.action:hover strong { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.action.in, .figure.in { --ink-f: var(--f-cliente); }
.action.out, .figure.out { --ink-f: var(--f-artista); }
.action[aria-disabled="true"] { opacity: 0.45; }
.search input { font-size: 1.25rem; padding: 0.6rem 0 0.7rem; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; }
.search label { margin: 0; }
.results { list-style: none; margin: 0; padding: 0; }
.results li { display: grid; grid-template-columns: 7rem 1fr auto; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--rule); }
.results .kind { font-family: var(--cond); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.figures { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 3rem; border-top: 1px solid var(--ink); }
.figure { padding: 1rem 0 0.4rem; }
.figure h3 { font-size: 1rem; font-weight: 500; margin: 0 0 0.5rem; letter-spacing: 0; }
.figure h3::before { content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--ink-f, var(--ink)); margin-right: 0.5rem; vertical-align: 0.08em; }
.figure ul { list-style: none; margin: 0; padding: 0; }
.figure li { font-size: 1.6rem; font-weight: 400; letter-spacing: -0.015em; line-height: 1.3; }
.figure li.approx, .figure li.approx ~ li { font-size: 1rem; letter-spacing: 0; color: var(--muted); }
.figure li.muted { font-size: 0.9rem; }
.figure .approx { border-top: 1px solid var(--line); margin-top: 0.7rem; padding-top: 0.6rem; }
.hub { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 3rem; border-top: 1px solid var(--ink); }
.hub a { display: grid; gap: 0.1rem; padding: 0.75rem 0 0.8rem; border-bottom: 1px solid var(--line); text-decoration: none; }
.hub a strong { font-weight: 500; font-size: 1.05rem; }
.hub a span { color: var(--muted); font-size: 0.92rem; }
.hub a:hover strong { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.stale { color: var(--amber); }

@media (max-width: 700px) {
  .top .bar { border-top: 0; }
  .top .do { order: -1; flex-basis: 100%; padding: 0 0 0.6rem; }
  .top .act { flex: 1; justify-content: center; padding: 0.55rem 0.3rem; font-size: 0.82rem; white-space: normal; text-align: center; line-height: 1.15; }
  .nav { flex-basis: 100%; border-top: 1px solid var(--line); }
  .nav .grp { gap: 1rem; padding: 0 1.5rem 0 0; }     /* on a phone the groups wrap: a wider gap tells them apart, not a rule */
  .nav .grp + .grp::before { content: none; }
  .nav a { padding: 0.6rem 0 0.5rem; }
  h1 { font-size: 1.7rem; }
  .actions { grid-template-columns: 1fr; }
  .action, .action:first-child { padding: 0.8rem 0 0.85rem; border-left: 0; border-top: 1px solid var(--line); }
  .action:first-child { border-top: 0; }
  .action strong { font-size: 1.35rem; }
  .figures, .hub { grid-template-columns: 1fr; }
  .figure + .figure { border-top: 1px solid var(--line); }
  .results li { grid-template-columns: 1fr auto; }
  .results .kind { grid-column: 1 / -1; }
}

/* Forms: «Nueva factura» and the ones after it. */
section { margin: 0 0 2.5rem; }
section > h2 { border-top: 1px solid var(--line); padding-top: 1rem; }
.field { margin: 0 0 1rem; min-width: 0; }
.field > label { display: block; font-weight: 500; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.3rem; }
.field.end { display: flex; align-items: flex-end; }
.hint { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 0.25rem; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0 1.25rem; }
select, textarea {
  font: inherit; font-size: 1rem; width: 100%; color: var(--ink); background: var(--paper);
  border: 1px solid var(--edge); border-radius: 6px; padding: 0.55rem 0.7rem;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 1rem) 55%, calc(100% - 0.7rem) 55%; background-size: 0.3rem 0.3rem; background-repeat: no-repeat; padding-right: 2rem; }
input.num { text-align: right; font-variant-numeric: tabular-nums; }
input.pct { max-width: 7rem; }
input.code-input { text-transform: uppercase; }
.check { display: flex; gap: 0.6rem; align-items: center; margin: 0 0 1rem; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; margin: 0; }
.check span { font-weight: 400; font-size: 1rem; text-transform: none; letter-spacing: 0; margin: 0; }
/* A block inside a form (a work, the exchange rate, one debt of an adjustment): no box — its
   name, then a hairline, as a heading on a ruled page. */
.cards { display: grid; gap: 0.6rem; }
.card { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 0.9rem 0 0.2rem; margin: 0 0 1rem; min-width: 0; }
fieldset.card { padding-top: 0.5rem; }
.card legend { padding: 0 0.8rem 0 0; }
.card legend h3 { margin: 0; font-size: 1.05rem; }
h2 + .card { border-top: 0; padding-top: 0; }                 /* right under its section's heading it needs no second rule */
.card .production { border-left: 2px solid var(--f-tercero); padding-left: 1rem; margin: 0 0 1rem; }
form.adjust, form.card { max-width: 52rem; }                  /* a form inside a record keeps a measure */
form .scroll + .field { margin-top: 1rem; }
.card > button.link { margin: 0 0 0.8rem; }
.buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.party .create { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.party .create input { flex: 1 1 12rem; }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--edge); }
td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
/* Every other row carries the light shade, so each row is told from the next (Mau, 11 Nov
   2026). «:where» keeps it the weakest rule there is: a table that draws its own rows — the
   sheet, a phone's cards — says so and wins. */
:where(tbody tr:nth-child(even)) > td { background: var(--panel); }
td > input:not([type=checkbox]) { min-width: 6rem; }               /* a field in a cell is never squeezed shut: its table scrolls sideways instead */
.proposal td input, .proposal td select { padding: 0.4rem 0.5rem; font-size: 0.95rem; min-width: 4.5rem; }
.proposal td:last-child input { min-width: 9rem; }
.proposal td:nth-child(4) { width: 6rem; }
.proposal td:nth-child(5), .proposal td:nth-child(6) { width: 9rem; }
.proposal tr.edited td:first-child::after { content: " · cambiado"; color: var(--amber); font-size: 0.8rem; }
.gallery { font-family: var(--cond); letter-spacing: 0.03em; }
.gallery .summary-line { display: block; }      /* one payee's total per line */

.checks { list-style: none; padding: 0; margin: 0 0 1rem; }
.checks li { padding: 0.35rem 0 0.35rem 1.4rem; position: relative; }
.checks li::before { position: absolute; left: 0; }
.checks li.ok::before { content: "✓"; color: var(--green); }
.checks li.bad { color: var(--red); }
.checks li.bad::before { content: "✕"; }
.debts { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.debts li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
.debts:empty { display: none; }
a.action { color: inherit; }

@media (max-width: 700px) {
  .proposal thead { display: none; }
  .proposal tr { display: block; border-bottom: 1px solid var(--line); padding: 0.6rem 0.75rem; }
  .proposal tbody tr:nth-child(even) { background: var(--panel); }
  .proposal td { display: grid; grid-template-columns: 6rem 1fr; gap: 0.5rem; align-items: center; border: 0; padding: 0.25rem 0; width: auto !important; background: none; }
  .proposal td::before { content: attr(data-label); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
  .proposal td input, .proposal td select, .proposal td:last-child input { min-width: 0; }
}
.echo { margin: -0.6rem 0 1rem; font-weight: 500; }
.checks li.warn { color: var(--amber); }
.checks li.warn::before { content: "!"; font-weight: 700; }

/* Pago recibido, Pago hecho */
.choices { margin: 0 0 1rem; }
.choices .check { margin-bottom: 0.5rem; }
.far { color: var(--red); font-weight: 500; }
.debts li.warn { color: var(--amber); }
.debts-table td input[type=checkbox] { width: 1.1rem; height: 1.1rem; }
.debts-table td.num, .debts-table th:nth-child(n+4) { text-align: right; }
@media (max-width: 700px) {
  .debts-table thead { display: none; }
  .debts-table tr { display: grid; grid-template-columns: 2rem 1fr; border-bottom: 1px solid var(--line); padding: 0.6rem 0.75rem; }
  .debts-table tbody tr:nth-child(even) { background: var(--panel); }
  .debts-table td { border: 0; padding: 0.15rem 0; background: none; }
  .debts-table td:first-child { grid-row: span 6; }
  .debts-table td[data-label]::before { content: attr(data-label) " · "; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
  .debts-table td.num { text-align: left; }
}

/* The three screens that write (Nueva factura, Pago recibido, Pago hecho): a ruled page with a
   margin. On a wide page each step's name stands in the margin beside its fields, and the
   last step — what is about to be saved, its checks and the button — stays in view at the
   right. «Wide» is measured on the page itself and in rem, so it follows «Tamaño». */
main.capture { container-type: inline-size; }
.capture form { max-width: 52rem; }                           /* one column: a form keeps a measure */
.capture form > section { border-top: 1px solid var(--line); padding-top: 1.1rem; margin-bottom: 1.6rem; }
.capture form > section > h2 { border-top: 0; padding-top: 0; font-size: 1.15rem; }
.capture form > section > * { min-width: 0; }
.capture form > section > button { justify-self: start; }
@container (min-width: 80rem) {
  .capture form { max-width: none; display: grid; grid-template-columns: minmax(0, 60rem) 22rem; column-gap: 3.5rem; align-items: start; }
  .capture form > * { grid-column: 1; }
  .capture form > section:last-of-type { grid-column: 2; grid-row: 1 / span 12; position: sticky; top: 1rem; border-top-color: var(--ink); }
  .capture form > section:not(.reader):not(:last-of-type) { display: grid; grid-template-columns: 10.5rem minmax(0, 1fr); column-gap: 2rem; }
  .capture form > section:not(.reader):not(:last-of-type) > h2 { grid-column: 1; }
  .capture form > section:not(.reader):not(:last-of-type) > :not(h2) { grid-column: 2; }
  /* a table takes the margin too, on a row of its own under the step's name */
  .capture form > section:not(.reader):not(:last-of-type) > .scroll { grid-column: 1 / -1; margin-top: 0.3rem; }
}

/* The PDF reader: where a file is dropped keeps a dashed edge. */
.capture form > section.reader { border: 1px dashed var(--edge); border-radius: 8px; padding: 0.9rem 1.1rem 0.5rem; }
.reader.over { background: var(--panel); border-color: var(--ink); }
.reader input[type=file] { border: 0; padding: 0.3rem 0; }

/* Lists (Facturas, Clientes, Artistas, Galería) and «Factura» */
.list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.1rem; margin: 0 0 1rem; }
.list-tools input[type=search], .list-tools select { font-size: 0.93rem; padding: 0.4rem 0.1rem; border: 0; border-bottom: 1px solid var(--edge); border-radius: 0; }
.list-tools input[type=search]:hover, .list-tools select:hover, .list-tools input[type=search]:focus-visible, .list-tools select:focus-visible { border-bottom-color: var(--ink); }
.list-tools input[type=search] { flex: 1 1 14rem; width: auto; }
.list-tools select { width: auto; min-width: 9rem; padding-right: 1.5rem; background-position: calc(100% - 0.5rem) 55%, calc(100% - 0.2rem) 55%; }
.list-tools button { font-size: 0.9rem; padding: 0.38rem 0.75rem; }
.list-tools .count { margin-left: auto; font-size: 0.85rem; }
.list-tools select.order { display: none; }
table.list { font-size: 0.93rem; }                            /* the sheet's size */
table.list th, table.list td { padding: 0.7rem 0.7rem; border-bottom: 1px solid var(--rule); }
table.list th { color: var(--muted); border-bottom: 1px solid var(--ink); white-space: nowrap; padding-top: 0.4rem; padding-bottom: 0.5rem; }
table.list th.num, table.list td.num { text-align: right; }
/* A code, a name, a date or a figure stays on its line, so a row is one line while there is
   room and the shade keeps its rhythm; a longer text (table.js «wrap») gives way first and
   wraps, at a measure at most; only then does a table scroll sideways. */
table.list td { white-space: nowrap; }
table.list td.wrap { white-space: normal; max-width: 26rem; }
table.list tbody td { transition: background-color 0.12s; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list th button.sort {
  border: 0; padding: 0; background: none; font: inherit; text-transform: inherit; letter-spacing: inherit; text-align: inherit; cursor: pointer;
}
table.list tr.link { cursor: pointer; }
table.list tbody tr.link:hover td, table.list tbody tr.link:focus-within td { background: var(--hover); }
table.list tr.link a { text-decoration: none; font-weight: 500; }
table.list tfoot td { border-top: 3px double var(--ink); border-bottom: 0; font-weight: 500; vertical-align: top; }   /* totals close with a double rule, as in a ledger */
td.inked { color: var(--ink-f); }                              /* whose money a cell is (table.js «ink») */
td.inked.num { font-weight: 500; }
#resumen .summary-line { display: block; }
.message.warn { border-left-color: var(--amber); }
section.record { margin-top: 2rem; }
section.record h3 { font-size: 1rem; margin: 1.25rem 0 0.5rem; }
/* A record's head: its states as marks, its figures as large numerals, then the rest as a list. */
#resumen .states { margin-top: 0.25rem; }
.record-head .kpis { border-top: 1px solid var(--ink); padding: 1.1rem 0 1.2rem; }
.record-foot { border-top: 1px solid var(--line); padding-top: 1.2rem; }
.record-foot .buttons + .buttons { margin-top: 0.9rem; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.5rem; margin: 0 0 1.5rem; border-top: 1px solid var(--line); padding-top: 0.9rem; }
dl.facts dt { font-weight: 500; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding-top: 0.15rem; }
dl.facts dd { margin: 0; white-space: pre-line; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  table.list thead { display: none; }
  table.list tr { display: block; border-bottom: 1px solid var(--line); padding: 0.7rem 0.75rem; }             /* a row is a block of the page, shaded in turn like the rows of a table */
  table.list tbody tr:nth-child(even) { background: var(--panel); }
  table.list td, table.list td.num { display: grid; grid-template-columns: 9rem 1fr; gap: 0.5rem; border: 0; padding: 0.15rem 0; text-align: left; background: none; white-space: normal; }
  table.list { font-size: 1rem; }
  table.list td::before { content: attr(data-label); font-size: 0.75rem; font-weight: 400; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
  table.list td.empty, table.list tbody td:empty { display: none; }
  table.list td.wrap { max-width: none; }
  table.list tbody tr.link:hover td, table.list tbody tr.link:focus-within td { background: none; }      /* the whole block answers the pointer, not its lines */
  table.list tbody tr.link:hover, table.list tbody tr.link:focus-within { background: var(--hover); }
  table.list tfoot td { border-top: 0; }
  table.list tfoot tr { border-top: 3px double var(--ink); border-bottom: 0; }
  .list-tools .count { margin-left: 0; }
  .list-tools select.order { display: block; }
  dl.facts { grid-template-columns: 1fr; gap: 0 0; }
  dl.facts dd { margin-bottom: 0.5rem; }
}

/* Libro, Revisar */
.tabs { display: flex; gap: 1.25rem; margin: 0 0 1.25rem; border-bottom: 1px solid var(--line); }
.tabs a { font-weight: 500; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.07em; text-decoration: none; padding: 0.3rem 0; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { border-bottom-color: var(--ink); }
.buttons { align-items: center; }
.warn-text { color: var(--amber); }
