/* Layout: una columna de trabajo. Arriba la mesa de carga, abajo la bandeja de comprobantes. */
:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --line: #d5dbe5;
  --fg: #172033;
  --muted: #5b6679;
  --accent: #0c4f9e;      /* azul Amore */
  --brand: #e61928;       /* rojo Amore */
  --brand-dark: #c8101e;
  --accent-fg: #ffffff;
  --accent-soft: #e3ecf8;
  --ok: #1d6b45;      --ok-soft: #dcf0e5;
  --warn: #8a5a00;    --warn-soft: #fbecc9;
  --bad: #a52a2a;     --bad-soft: #f8dddd;
  --wait: #4a5568;    --wait-soft: #e6e9ef;
  --display: "Archivo", "Arial Narrow", Arial, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10141c; --surface: #181e29; --line: #2c3545; --fg: #e8ecf3; --muted: #9aa5b8;
    --accent: #7fb0f0; --accent-fg: #0a1a33; --accent-soft: #1a2a45; --brand: #ff4d5a; --brand-dark: #e61928;
    --ok: #7fd3a6; --ok-soft: #173326; --warn: #f0c366; --warn-soft: #3a2e12;
    --bad: #f19a9a; --bad-soft: #3d1c1c; --wait: #b3bccb; --wait-soft: #262e3c;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 15px; line-height: 1.5; }
.wrap { max-width: 860px; margin: 0 auto; padding-inline: 16px; padding-block: 28px 56px; display: flex; flex-direction: column; gap: 28px; }
h1, h2 { font-family: var(--display); margin: 0; text-wrap: balance; }
h1 { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0; }
.lead { color: var(--muted); max-width: 62ch; margin-top: 6px; }
.eyebrow { font-family: var(--display); font-size: .72rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
section { display: flex; flex-direction: column; gap: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
label, .lbl { font-size: .8rem; font-weight: 600; color: var(--muted); }
select, input[type="text"], input[type="password"] { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; width: 100%; }
select:focus-visible, input:focus-visible, button:focus-visible, a:focus-visible, .drop:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop { border: 2px dashed var(--line); border-radius: 6px; padding: 26px 16px; text-align: center; cursor: pointer; background: var(--bg); display: flex; flex-direction: column; gap: 4px; align-items: center; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { font-family: var(--display); font-size: 1.05rem; }
.drop span { color: var(--muted); font-size: .85rem; }
.queue { display: flex; flex-direction: column; gap: 6px; }
.qrow { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; font-size: .88rem; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.qrow .name { min-width: 0; overflow-wrap: anywhere; }
.qrow .st { flex: none; color: var(--muted); }
.qrow.err .st { color: var(--bad); }
.qrow.done .st { color: var(--ok); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
button { font: inherit; cursor: pointer; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); padding: 8px 14px; }
button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.link { border: 0; background: none; padding: 0; color: var(--muted); text-decoration: underline; font-size: .82rem; }
.notice { border: 1px solid var(--line); border-left: 4px solid var(--warn); background: var(--warn-soft); color: var(--fg); padding: 10px 12px; border-radius: 4px; font-size: .9rem; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: .82rem; padding: 4px 10px; border-radius: 999px; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.item .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.item .file { font-weight: 600; color: var(--accent); overflow-wrap: anywhere; min-width: 0; }
.meta { color: var(--muted); font-size: .84rem; }
.pill { font-size: .76rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: var(--wait-soft); color: var(--wait); }
.pill.leido { background: var(--accent-soft); color: var(--accent); }
.pill.diferencia { background: var(--warn-soft); color: var(--warn); }
.pill.aprobado, .pill.cargado { background: var(--ok-soft); color: var(--ok); }
.pill.rechazado { background: var(--bad-soft); color: var(--bad); }
.read { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; border-top: 1px solid var(--line); padding-top: 8px; }
.read div { min-width: 0; overflow-wrap: anywhere; }
.read .v { font-family: var(--mono); font-size: .88rem; font-variant-numeric: tabular-nums; }
.alerts { margin: 0; padding-left: 18px; color: var(--warn); font-size: .88rem; }
.empty { border: 1px dashed var(--line); border-radius: 6px; padding: 22px 16px; color: var(--muted); text-align: center; }
.pol { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.pol .item p { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: no-preference) { .drop { transition: background .15s, border-color .15s; } }

img { max-width: 100%; }
[hidden] { display: none !important; }
.grow { min-width: 0; flex: 1 1 240px; }
.login { max-width: 380px; }
.notice.ok { border-left-color: var(--ok); background: var(--ok-soft); }
.notice.mal { border-left-color: var(--bad); background: var(--bad-soft); }
.drop { position: relative; }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
a.chip { border: 1px solid var(--line); background: var(--surface); color: var(--fg); text-decoration: none; }
a.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.pill.diferencia { background: var(--warn-soft); color: var(--warn); }
.priv { border-top: 1px solid var(--line); padding-top: 8px; }
.priv p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; }
.del summary { cursor: pointer; color: var(--muted); font-size: .82rem; width: fit-content; }
.del form { margin-top: 8px; }

/* Políticas (solo admin) */
fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 12px 0 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
fieldset:first-of-type { border-top: 0; padding-top: 0; }
legend { font-family: var(--display); font-weight: 600; font-size: .95rem; padding: 0; margin-bottom: 4px; }
textarea { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; width: 100%; resize: vertical; }
textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hint { color: var(--muted); font-size: .8rem; }
.checks { display: flex; gap: 8px 18px; flex-wrap: wrap; }
.check { font-size: .92rem; font-weight: 400; color: var(--fg); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.calc { background: var(--accent-soft); border-radius: 6px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.calc-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.calc-row input { width: 140px; font-family: var(--mono); }
.calc-out { display: flex; flex-direction: column; gap: 2px; max-width: 420px; }
.calc-line { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }
.calc-line.tot { font-weight: 600; border-top: 1px solid var(--line); padding-top: 3px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.tabla { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .86rem; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .76rem; color: var(--muted); font-weight: 600; }
.n { text-align: right; white-space: nowrap; }
table.desc input[type="text"] { padding: 6px 8px; }
table.desc .pc { width: 72px; text-align: right; font-family: var(--mono); }
.calc-line.pct { color: var(--muted); }
.calc-line .mono { white-space: nowrap; }

/* Identidad Amore */
body { border-top: 6px solid var(--brand); }
body::before { content: ""; display: block; height: 3px; background: var(--accent); }
.logo-link { display: inline-block; width: fit-content; margin-bottom: -12px; }
.logo { display: block; height: 64px; width: auto; }
.eyebrow { color: var(--brand-dark); }
button.primary { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.pill.cerrada { background: var(--ok); color: #fff; }
@media print { body { border-top: 0; } body::before { display: none; } }

/* Solapas */
.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin-top: -14px; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-family: var(--display); font-weight: 600; font-size: .92rem; border-bottom: 3px solid transparent; margin-bottom: -2px; border-radius: 6px 6px 0 0; }
.tabs a:hover { color: var(--fg); background: var(--accent-soft); }
.tabs a.on { color: var(--brand-dark); border-bottom-color: var(--brand); }
@media print { .tabs { display: none; } }
