/*
 * Nuvo site: shared tokens and the product fragments ([data-ui]).
 * Colours are the web app's (docs/design/nuvo.md, diseno/web-oscuro/tokens-oscuro.css).
 * System fonts only, like the app: no font downloads, no third-party requests.
 */
:root {
  color-scheme: light;
  --ink: #142344;
  --muted: #52627d;
  --line: #dce4ef;
  --canvas: #f2f5fa;
  --card: #ffffff;
  --blue: #2355df;
  --blue-dark: #1742bd;
  --blue-light: #7fa3f7;
  --on-blue: #ffffff;
  --ice: #edf3ff;
  --ice-line: #dbe5fa;
  --tint: #f2f6fe;
  --segment: #eef2f8;
  --head: #f6f8fc;
  --green: #126147;
  --green-bg: #e8f6ef;
  --amber: #795000;
  --amber-bg: #fff3d9;
  --red: #9a3029;
  --red-bg: #fff0ed;
  --control-line: #b9c9e1;
  --input: #aabbd3;
  --chart-1: #223d79;
  --chart-2: #4163bd;
  --chart-3: #7fa3f7;
  --chart-4: #a7b9db;
  --rail: #e7eef9;
  --navy: #0d1525;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --ticket: "Courier New", Courier, monospace;
}

/* Dark: follows the system unless the page pins light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink: #e7edf8;
    --muted: #9aa9c4;
    --line: #26334c;
    --canvas: #0d1525;
    --card: #141e33;
    --blue: #7c9ef4;
    --blue-dark: #a3bcfa;
    --blue-light: #34508f;
    --on-blue: #0d1525;
    --ice: #1a2b52;
    --ice-line: #2a3f70;
    --tint: #172443;
    --segment: #1b2740;
    --head: #18233a;
    --green: #6fd3a6;
    --green-bg: #123227;
    --amber: #f0c064;
    --amber-bg: #35280d;
    --red: #f19a8f;
    --red-bg: #3a1a17;
    --control-line: #3a4e74;
    --input: #566c93;
    --chart-1: #a9c0f8;
    --chart-2: #7c9ef4;
    --chart-3: #4d72d6;
    --chart-4: #34508f;
    --rail: #1b2740;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e7edf8;
  --muted: #9aa9c4;
  --line: #26334c;
  --canvas: #0d1525;
  --card: #141e33;
  --blue: #7c9ef4;
  --blue-dark: #a3bcfa;
  --blue-light: #34508f;
  --on-blue: #0d1525;
  --ice: #1a2b52;
  --ice-line: #2a3f70;
  --tint: #172443;
  --segment: #1b2740;
  --head: #18233a;
  --green: #6fd3a6;
  --green-bg: #123227;
  --amber: #f0c064;
  --amber-bg: #35280d;
  --red: #f19a8f;
  --red-bg: #3a1a17;
  --control-line: #3a4e74;
  --input: #566c93;
  --chart-1: #a9c0f8;
  --chart-2: #7c9ef4;
  --chart-3: #4d72d6;
  --chart-4: #34508f;
  --rail: #1b2740;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: var(--sans); line-height: 1.5; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
::selection { background: var(--ice); color: var(--ink); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Owner data still missing: visible on purpose until it is filled in. */
.pending { background: var(--amber-bg); color: var(--amber); font-weight: 650; padding: 0 .3em; border-radius: 4px; }

/* ---------- Product fragments: the app's own conventions (lines, small radii) ---------- */
[data-ui] { font-family: var(--sans); font-size: 14px; line-height: 1.45; color: var(--ink); text-align: left; letter-spacing: 0; }
.ui-panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.ui-pad { padding: 16px 18px; }
.ui-title { font-size: 17px; font-weight: 700; letter-spacing: -.015em; margin: 0; }
.ui-sub { color: var(--muted); font-size: 13px; margin: 0; }
.ui-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
[data-ui] .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ui-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.ui-row:last-child { border-bottom: 0; }
.ui-row.tint { background: var(--tint); font-weight: 650; }
.ui-muted { color: var(--muted); }
[data-ui] table { width: 100%; border-collapse: collapse; }
[data-ui] th { background: var(--head); color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); }
[data-ui] td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
[data-ui] tr:last-child td { border-bottom: 0; }
[data-ui] .r { text-align: right; }
.ui-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--control-line); background: var(--card); color: var(--ink); font-weight: 650; font-size: 14px; cursor: pointer; transition: background .15s, transform .1s; }
.ui-btn:hover { background: var(--ice); }
.ui-btn:active { transform: translateY(1px); }
.ui-btn.primary { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.ui-btn.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.ui-seg { display: inline-flex; background: var(--segment); border-radius: 8px; padding: 3px; gap: 2px; }
.ui-seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 6px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.ui-seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); }
.ui-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12.5px; font-weight: 650; background: var(--segment); color: var(--muted); white-space: nowrap; }
.ui-tag.ok { background: var(--green-bg); color: var(--green); }
.ui-tag.warn { background: var(--amber-bg); color: var(--amber); }
.ui-tag.late { background: var(--red-bg); color: var(--red); }
.ui-tag.ice { background: var(--ice); color: var(--blue-dark); }
[data-ui] .in { color: var(--green); }
[data-ui] .out { color: var(--red); }
.ui-field { display: grid; gap: 4px; }
.ui-field label { font-weight: 700; font-size: 13px; }
.ui-input { height: 38px; border: 1px solid var(--input); border-radius: 8px; padding: 0 10px; background: var(--card); width: 100%; }
.ui-total { background: var(--ice); border-radius: 10px; padding: 14px 16px; }
.ui-total strong { display: block; font-size: 30px; font-weight: 750; letter-spacing: -.02em; }

/* The printed ticket: the thermal printer's own fixed-width letters (32 per line on 58 mm paper). */
[data-ui].ticket, [data-ui] .ticket { font-family: var(--ticket); font-size: 13px; line-height: 1.35; color: #111; background: #fff; white-space: pre; padding: 18px 14px 26px; width: max-content; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
