/* ==========================================================================
   nezprod — components (all prefixed nz-)

   Index
     Typography ..... nz-kicker, nz-display-xl/lg/md, nz-lead, nz-prose
     Layout ......... nz-stack, nz-grid, nz-cluster, nz-section
     Actions ........ nz-btn (--primary / --outline / --ghost), nz-chip, nz-tabs
     Labels ......... nz-badge (--warn = ⚠ nepotvrđeno, --red, --ok)
     Containers ..... nz-card, nz-band, nz-accent, nz-callout
     Data ........... nz-facts, nz-row, nz-tiles / nz-tile, nz-table
     Forms .......... nz-field, nz-select, nz-check
     Overlays ....... nz-modal (+ --wide, --full, --sheet)
     Placeholder .... nz-wip

   Rules of the system (havc-explorer DESIGN.md):
   - Red marks a decision or an active state; it is never ambient decoration.
   - Flat by default; a shadow only on true overlays.
   - No nested cards, no glassmorphism, no gradient text, no side stripes.
   - Small text never uses --muted or --red; use --text-dim / --red-text.
   ========================================================================== */

/* ── Typography ───────────────────────────────────────────────────────── */
.nz-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.nz-kicker--red {
  color: var(--red-text);
}
.nz-kicker--sm {
  font-size: 10px;
}

.nz-display-xl,
.nz-display-lg,
.nz-display-md {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--paper);
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: manual;
}
.nz-display-xl {
  font-size: clamp(40px, 6.2vw, 72px);
  line-height: 0.95;
}
.nz-display-lg {
  font-size: clamp(28px, 3.8vw, 44px);
  line-height: 1;
}
.nz-display-md {
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.05;
}

.nz-lead {
  max-width: 62ch;
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.45;
  color: var(--paper-dim);
  text-wrap: pretty;
}

/* Prose: long-form reading. Quiet headings, 16px body, capped measure. */
.nz-prose {
  max-width: var(--measure);
  font-size: 16px;
  line-height: 1.6;
  color: var(--paper);
}
.nz-prose > * + * {
  margin-top: 0.85em;
}
.nz-prose h2,
.nz-prose h3,
.nz-prose h4 {
  margin-top: 1.6em;
}
.nz-prose h2 {
  font-size: 24px;
}
.nz-prose h3 {
  font-size: 19px;
  letter-spacing: -0.015em;
}
.nz-prose h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.nz-prose h2 + *,
.nz-prose h3 + *,
.nz-prose h4 + * {
  margin-top: 0.5em;
}
.nz-prose p,
.nz-prose ul,
.nz-prose ol,
.nz-prose blockquote,
.nz-prose pre {
  margin-bottom: 0;
}
.nz-prose ul,
.nz-prose ol {
  padding-left: 1.4em;
}
.nz-prose li + li {
  margin-top: 0.3em;
}
.nz-prose li::marker {
  color: var(--text-dim);
}
.nz-prose a {
  color: var(--paper);
  text-decoration-color: var(--rule);
}
.nz-prose a:hover {
  color: var(--red-text);
  text-decoration-color: currentColor;
}
.nz-prose strong {
  color: var(--paper);
}
.nz-prose em {
  color: var(--paper-dim);
}
.nz-prose code {
  padding: 1px 5px;
  border-radius: var(--radius-code);
  background: var(--code-bg);
  font-size: 0.86em;
}
.nz-prose pre {
  padding: 12px 14px;
  overflow-x: auto;
  border-left: 2px solid var(--rule);
  background: var(--code-bg);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.nz-prose pre code {
  padding: 0;
  background: transparent;
  font-size: inherit;
}
.nz-prose blockquote {
  margin-inline: 0;
  padding-left: 14px;
  border-left: 2px solid var(--rule);
  color: var(--paper-dim);
}
.nz-prose hr {
  margin-block: 1.6em;
  border-top: 1px dashed var(--rule);
}

/* ── Layout primitives ────────────────────────────────────────────────── */
.nz-stack {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap, var(--s-4));
}
.nz-stack > * {
  margin: 0;
}
.nz-stack--xs { --stack-gap: var(--s-1); }
.nz-stack--sm { --stack-gap: var(--s-2); }
.nz-stack--md { --stack-gap: var(--s-3); }
.nz-stack--lg { --stack-gap: var(--s-6); }
.nz-stack--xl { --stack-gap: var(--s-7); }

/* Responsive auto-fit grid; never overflows at 360px (min() clamp). */
.nz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(var(--grid-min, 280px), 100%), 1fr));
  gap: var(--grid-gap, var(--s-5));
}
.nz-grid--sm { --grid-min: 200px; }
.nz-grid--lg { --grid-min: 360px; }
.nz-grid--tight { --grid-gap: var(--s-3); }
/* Exactly two columns from 820px (e.g. Razvoj vs Proizvodnja). */
.nz-grid--2 {
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 820px) {
  .nz-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Inline wrap row (buttons, chips) */
.nz-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster-gap, var(--s-2));
}
.nz-cluster--lg { --cluster-gap: var(--s-3); }

/* Section: sections are separated by a rule and space, not by boxes. */
.nz-section {
  padding-block: var(--s-6);
  border-top: 1px solid var(--rule);
}
.nz-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-2) var(--s-5);
  margin-bottom: var(--s-5);
}
.nz-section__title {
  font-size: clamp(22px, 2.4vw, 28px);
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.nz-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 11px 18px;
  border: 1.5px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-hover) ease, border-color var(--dur-hover) ease,
    color var(--dur-hover) ease;
}
.nz-btn:hover {
  border-color: var(--paper-dim);
  color: var(--paper);
}
.nz-btn i {
  font-size: 0.95em;
}

/* Primary: red fill, cream text, label ends in "→". */
.nz-btn--primary {
  border-color: var(--red-fill);
  background: var(--red-fill);
  color: var(--on-red);
  font-weight: 700;
}
.nz-btn--primary:hover {
  border-color: var(--red-deep);
  background: var(--red-deep);
  color: var(--on-red);
}

/* Outline: paper border; hover inverts. */
.nz-btn--outline {
  border-color: var(--paper);
  color: var(--paper);
}
.nz-btn--outline:hover {
  border-color: var(--paper);
  background: var(--paper);
  color: var(--ink);
}

/* Ghost mono: small uppercase mono with a red border; hover fills red. */
.nz-btn--ghost {
  min-height: 34px;
  padding: 7px 12px;
  border-color: var(--red);
  color: var(--red-text);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.nz-btn--ghost:hover {
  border-color: var(--red-fill);
  background: var(--red-fill);
  color: var(--on-red);
}

/* Quiet: no border; for tertiary actions such as "Resetiraj". */
.nz-btn--quiet {
  border-color: transparent;
  color: var(--paper-dim);
  padding-inline: 8px;
}
.nz-btn--quiet:hover {
  border-color: transparent;
  color: var(--red-text);
}

.nz-btn--sm {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 12px;
}
.nz-btn--block {
  display: flex;
  width: 100%;
}
.nz-btn--icon {
  min-width: 42px;
  padding-inline: 10px;
}

.nz-btn:disabled,
.nz-btn[aria-disabled='true'] {
  border-color: var(--rule);
  background: transparent;
  color: var(--text-dim);
  opacity: 0.75;
  pointer-events: none;
}

/* ── Chips (pills) ────────────────────────────────────────────────────── */
.nz-chip {
  --chip-hue: var(--rule);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 5px 11px;
  border: 1.5px solid var(--chip-hue);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-chip) ease, border-color var(--dur-chip) ease,
    color var(--dur-chip) ease;
}
/* Hue dot for category chips */
.nz-chip--dot::before,
.nz-chip[class*='nz-chip--cat-']::before {
  content: '';
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--chip-hue);
}
/* Interactive chips get a firmer outline than static tags. */
button.nz-chip,
a.nz-chip {
  --chip-hue: var(--muted);
  cursor: pointer;
}
button.nz-chip:hover,
a.nz-chip:hover {
  border-color: var(--paper-dim);
  color: var(--paper);
}
.nz-chip[class*='nz-chip--cat-']:hover {
  border-color: var(--chip-hue);
}
/* Active / pressed: filled with the hue, dark ink text (5.1–6.8:1). */
.nz-chip.is-active,
.nz-chip[aria-pressed='true'],
.nz-chip[aria-selected='true'] {
  border-color: var(--paper);
  background: var(--paper);
  color: var(--ink);
}
.nz-chip[class*='nz-chip--cat-'].is-active,
.nz-chip[class*='nz-chip--cat-'][aria-pressed='true'],
.nz-chip[class*='nz-chip--cat-'][aria-selected='true'] {
  border-color: var(--chip-hue);
  background: var(--chip-hue);
  color: var(--on-hue);
}
.nz-chip[class*='nz-chip--cat-'].is-active::before,
.nz-chip[class*='nz-chip--cat-'][aria-pressed='true']::before,
.nz-chip[class*='nz-chip--cat-'][aria-selected='true']::before {
  background: var(--on-hue);
}
/* Red is the one hue whose fill takes cream text (on dark ink it is 3.05:1).
   Doubled class to outrank the [class*='nz-chip--cat-'] rules above. */
.nz-chip.nz-chip--cat-rok.is-active,
.nz-chip.nz-chip--cat-rok[aria-pressed='true'],
.nz-chip.nz-chip--cat-rok[aria-selected='true'] {
  border-color: var(--red-fill);
  background: var(--red-fill);
  color: var(--on-red);
}
.nz-chip.nz-chip--cat-rok.is-active::before,
.nz-chip.nz-chip--cat-rok[aria-pressed='true']::before,
.nz-chip.nz-chip--cat-rok[aria-selected='true']::before {
  background: var(--on-red);
}

/* Doubled class so the hue beats `button.nz-chip { --chip-hue: muted }`. */
.nz-chip.nz-chip--cat-razvoj { --chip-hue: var(--cat-razvoj); }
.nz-chip.nz-chip--cat-proizvodnja { --chip-hue: var(--cat-proizvodnja); }
.nz-chip.nz-chip--cat-porez { --chip-hue: var(--cat-porez); }
.nz-chip.nz-chip--cat-rok { --chip-hue: var(--cat-rok); }
.nz-chip.nz-chip--cat-dokument { --chip-hue: var(--cat-dokument); }
.nz-chip.nz-chip--cat-warn { --chip-hue: var(--cat-warn); }

/* ── Tabs / segmented control (role="tablist") ───────────────────────── */
.nz-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--rule);
  scrollbar-width: none;
}
.nz-tabs::-webkit-scrollbar {
  display: none;
}
.nz-tabs__tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  color: var(--paper-dim);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--dur-hover) ease;
}
.nz-tabs__tab:first-child {
  padding-left: 0;
}
.nz-tabs__tab:hover {
  color: var(--paper);
}
.nz-tabs__tab:focus-visible {
  outline-offset: -2px;
}
.nz-tabs__tab[aria-selected='true'] {
  color: var(--paper);
  font-weight: 700;
}
.nz-tabs__tab[aria-selected='true']::after {
  content: '';
  position: absolute;
  right: 16px;
  bottom: -1px;
  left: 16px;
  height: 2px;
  background: var(--red);
}
.nz-tabs__tab[aria-selected='true']:first-child::after {
  left: 0;
}

/* ── Badges ───────────────────────────────────────────────────────────── */
.nz-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-code);
  background: transparent;
  color: var(--paper-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}
/* ⚠ nepotvrđeno: write only the word, the glyph comes from CSS:
     <span class="nz-badge nz-badge--warn">nepotvrđeno</span>
   Amber fill + dark ink text = 6.81:1 in both themes. */
.nz-badge--warn {
  border-color: var(--hue-amber);
  background: var(--hue-amber);
  color: var(--on-hue);
}
.nz-badge--warn::before {
  content: '\26A0\FE0E';
  /* Empty alt text: screen readers read only the word, not "warning sign". */
  content: '\26A0\FE0E' / '';
  font-family: system-ui, sans-serif;
  font-size: 11px;
  line-height: 1;
}
.nz-badge--red {
  border-color: var(--red);
  color: var(--red-text);
}
.nz-badge--solid {
  border-color: var(--red-fill);
  background: var(--red-fill);
  color: var(--on-red);
}
.nz-badge--ok {
  border-color: var(--hue-green);
  color: var(--paper);
}
.nz-badge--ok::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hue-green);
}
/* Live/pending dot (e.g. "U izradi", "čeka se objava") */
.nz-badge--pending::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hue-amber);
}

/* ── Card ─────────────────────────────────────────────────────────────── */
.nz-card {
  --surface: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--rule);
  background: var(--panel);
  color: var(--paper);
}
.nz-card__kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.nz-card__kicker--hue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nz-card__kicker--hue::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--card-hue, var(--red));
}
.nz-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.nz-card__body {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--paper-dim);
}
.nz-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}
a.nz-card,
.nz-card--link {
  text-decoration: none;
  transition: border-color var(--dur-hover) ease;
}
a.nz-card:hover,
.nz-card--link:hover {
  border-color: var(--paper-dim);
  color: var(--paper);
}
.nz-card--plain {
  --surface: var(--ink);
  background: transparent;
}

/* ── Band (CTA band) ──────────────────────────────────────────────────── */
.nz-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px;
  border: 1.5px solid var(--rule);
}
.nz-band__text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.nz-band__kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red-text);
}
.nz-band__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.2vw, 24px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
}
.nz-band__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── Accent panel: the one red-tinted surface per screen ─────────────── */
.nz-accent {
  --text-dim: var(--paper-dim);
  --surface: transparent;
  padding: 20px 24px;
  border: 1.5px solid var(--red);
  background: linear-gradient(135deg, rgba(193, 72, 67, 0.22), rgba(193, 72, 67, 0.04));
}

/* ── Callout ──────────────────────────────────────────────────────────── */
.nz-callout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 14px;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  background: var(--panel);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--paper);
}
.nz-callout__icon {
  grid-row: span 2;
  padding-top: 1px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text-dim);
}
.nz-callout__title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.nz-callout__body > * + * {
  margin-top: 0.5em;
}
.nz-callout--warn {
  border-color: var(--hue-amber);
  border-width: 1.5px;
}
.nz-callout--warn .nz-callout__icon,
.nz-callout--warn .nz-callout__title {
  color: var(--paper);
}
.nz-callout--red {
  border-color: var(--red);
  border-width: 1.5px;
}
.nz-callout--red .nz-callout__icon,
.nz-callout--red .nz-callout__title {
  color: var(--red-text);
}
.nz-callout--plain {
  background: transparent;
}

/* ── Facts grid (key / value) ─────────────────────────────────────────── */
.nz-facts {
  display: grid;
  grid-template-columns: minmax(96px, var(--facts-key, 150px)) minmax(0, 1fr);
  align-items: baseline;
  gap: 9px 16px;
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}
.nz-facts dt,
.nz-facts__k {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.nz-facts dd,
.nz-facts__v {
  margin: 0;
  min-width: 0;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--paper);
  overflow-wrap: anywhere;
}
.nz-facts--compact {
  --facts-key: 110px;
  gap: 7px 12px;
}
.nz-facts--compact dd {
  font-size: 13.5px;
}

/* ── List rows (indexed) ──────────────────────────────────────────────── */
.nz-rows {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}
.nz-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px 16px;
  width: 100%;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  color: var(--paper);
  text-align: left;
  text-decoration: none;
}
.nz-row__index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.nz-row__main {
  min-width: 0;
}
.nz-row__title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--paper);
}
.nz-row__meta {
  display: block;
  margin-top: 3px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-dim);
}
.nz-row__aside {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: right;
  white-space: nowrap;
}
a.nz-row,
button.nz-row {
  cursor: pointer;
  transition: color var(--dur-hover) ease;
}
a.nz-row:hover .nz-row__title,
button.nz-row:hover .nz-row__title {
  color: var(--red-text);
}
a.nz-row:hover .nz-row__index,
button.nz-row:hover .nz-row__index {
  color: var(--red-text);
}
.nz-row--noindex {
  grid-template-columns: minmax(0, 1fr) auto;
}

/* ── Key-number tiles: a ruled ledger, not a metric-card grid ────────── */
.nz-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(var(--tile-min, 210px), 100%), 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--rule);
  background: var(--rule);
  list-style: none;
}
.nz-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 18px 20px 16px;
  background: var(--surface, var(--ink));
}
.nz-tile__label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.nz-tile__value {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--paper);
  font-variant-numeric: tabular-nums lining-nums;
  overflow-wrap: anywhere;
}
.nz-tile__unit {
  margin-left: 0.15em;
  font-size: 0.55em;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--paper-dim);
}
.nz-tile__note {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-dim);
}
.nz-tile__foot {
  margin-top: auto;
  padding-top: 4px;
}
.nz-tile--key .nz-tile__value {
  color: var(--red-text);
}

/* ── Table ────────────────────────────────────────────────────────────── */
/* Wrap wide tables so they scroll inside, never the page. The background
   draws edge shadows only while there is more to scroll (local/scroll trick). */
.nz-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(to right, var(--surface, var(--ink)) 30%, transparent) left / 28px 100% no-repeat local,
    linear-gradient(to left, var(--surface, var(--ink)) 30%, transparent) right / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.32), transparent) left / 10px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.32), transparent) right / 10px 100% no-repeat scroll;
}
.nz-table-wrap:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.nz-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums lining-nums;
}
.nz-table caption {
  padding: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: left;
  caption-side: top;
}
.nz-table th,
.nz-table td {
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.nz-table th:last-child,
.nz-table td:last-child {
  padding-right: 0;
}
.nz-table thead th {
  border-bottom: 1.5px solid var(--paper);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
  vertical-align: bottom;
}
.nz-table tbody th {
  min-width: 14ch;
  font-weight: 600;
}
/* .is-num right-aligns a numeric column; .nz-num only sets tabular figures. */
.nz-table .is-num {
  text-align: right;
  white-space: nowrap;
}
.nz-table .nz-num {
  white-space: nowrap;
}
.nz-table tfoot th,
.nz-table tfoot td {
  border-top: 1.5px solid var(--paper);
  border-bottom: 0;
  font-weight: 700;
}
.nz-table tbody tr:hover > * {
  background: var(--red-soft);
}
.nz-table--compact {
  font-size: 13px;
}
.nz-table--compact th,
.nz-table--compact td {
  padding-block: 7px;
}

/* ── Form fields: underline idiom (afweb form.js) ────────────────────── */
.nz-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.nz-field__label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.nz-field__req {
  color: var(--red-text);
}
.nz-field__input,
.nz-field input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']),
.nz-field select,
.nz-field textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  margin: 0;
  padding: 6px 0;
  border: 0;
  border-bottom: 1.5px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  box-shadow: none;
  transition: border-color var(--dur-hover) ease, box-shadow var(--dur-hover) ease;
  -webkit-appearance: none;
  appearance: none;
}
.nz-field textarea {
  min-height: 84px;
  resize: vertical;
}
/* Date inputs app-wide (Izračun, Rokovi, Generatori, Dokumentacija): tabular digits and a
   picker icon that stays visible on the dark theme. */
.nz-field input[type='date'] {
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.nz-field input[type='date']::-webkit-calendar-picker-indicator {
  opacity: 0.6;
  cursor: pointer;
}
html.theme-dark .nz-field input[type='date']::-webkit-calendar-picker-indicator {
  filter: invert(0.85);
}
@media (prefers-color-scheme: dark) {
  html.theme-auto .nz-field input[type='date']::-webkit-calendar-picker-indicator {
    filter: invert(0.85);
  }
}
.nz-field input::placeholder,
.nz-field textarea::placeholder {
  color: var(--text-dim);
  opacity: 0.8;
}
.nz-field input:hover,
.nz-field select:hover,
.nz-field textarea:hover {
  border-bottom-color: var(--paper-dim);
}
/* Focus: the underline turns red and thickens (inset shadow, no reflow). */
.nz-field input:focus,
.nz-field select:focus,
.nz-field textarea:focus,
.nz-field__input:focus {
  border-bottom-color: var(--focus);
  box-shadow: inset 0 -1px 0 var(--focus);
  outline: none;
}
.nz-field input[aria-invalid='true'],
.nz-field select[aria-invalid='true'],
.nz-field textarea[aria-invalid='true'],
.nz-field.is-invalid input,
.nz-field.is-invalid select,
.nz-field.is-invalid textarea {
  border-bottom-color: var(--red-text);
}
.nz-field input:disabled,
.nz-field select:disabled,
.nz-field textarea:disabled {
  color: var(--text-dim);
  border-bottom-style: dashed;
}
.nz-field input[type='number'],
.nz-field .is-num {
  font-variant-numeric: tabular-nums;
}
.nz-field__hint {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-dim);
}
.nz-field__error {
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--red-text);
}
.nz-field__error:empty {
  display: none;
}
.nz-field__error:not(:empty)::before {
  content: '✕ ';
  content: '✕ ' / '';
}

/* Select: wrap in .nz-select for the chevron (select has no ::after). */
.nz-select {
  position: relative;
  display: block;
}
.nz-select select {
  padding-right: 24px;
  cursor: pointer;
}
.nz-select::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 4px;
  width: 7px;
  height: 7px;
  margin-top: -6px;
  border-right: 1.5px solid var(--paper-dim);
  border-bottom: 1.5px solid var(--paper-dim);
  transform: rotate(45deg);
  pointer-events: none;
}
.nz-select select option {
  background: var(--panel);
  color: var(--paper);
}

/* Checkbox / radio row */
.nz-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 24px;
  font-size: 14.5px;
  line-height: 1.4;
  cursor: pointer;
}
.nz-check input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--red-fill);
  cursor: pointer;
}

/* ── Modal shell (Task 5's preview modal and the mobile "Više" sheet) ──
   Markup (js/lib/modal.js builds it):
     <div class="nz-modal" data-state="open">
       <div class="nz-modal__backdrop"></div>
       <div class="nz-modal__dialog" role="dialog" aria-modal="true" aria-labelledby>
         <header class="nz-modal__head">
           <div class="nz-modal__heading"><p class="nz-modal__kicker"/><h2 class="nz-modal__title"/></div>
           <div class="nz-modal__actions">…<button class="nz-modal__close">zatvori ✕</button></div>
         </header>
         <div class="nz-modal__body">…</div>
         <footer class="nz-modal__foot">…</footer>   (optional)
       </div>
     </div>
   Full screen below 820px, with safe-area insets. */
.nz-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.nz-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity var(--dur-chip) ease;
}
.nz-modal__dialog {
  --surface: var(--panel);
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(880px, 100%);
  max-height: calc(100dvh - 48px);
  border: 1.5px solid var(--rule);
  background: var(--panel);
  color: var(--paper);
  box-shadow: var(--shadow-overlay);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}
.nz-modal[data-state='open'] .nz-modal__backdrop,
.nz-modal[data-state='open'] .nz-modal__dialog {
  opacity: 1;
}
.nz-modal[data-state='open'] .nz-modal__dialog {
  transform: none;
}
.nz-modal__dialog:focus {
  outline: none;
}

.nz-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 18px 32px;
  border-bottom: 1px solid var(--rule);
}
.nz-modal__heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.nz-modal__kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.nz-modal__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.nz-modal__actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.nz-modal__close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition: border-color var(--dur-hover) ease, color var(--dur-hover) ease;
}
.nz-modal__close:hover {
  border-color: var(--paper-dim);
}
.nz-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 28px 32px 32px;
}
.nz-modal__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px 16px 32px;
  border-top: 1px solid var(--rule);
}

.nz-modal--wide .nz-modal__dialog {
  width: min(1240px, 100%);
}
.nz-modal--full {
  padding: 0;
}
.nz-modal--full .nz-modal__dialog {
  width: 100%;
  height: 100%;
  max-height: none;
  border: 0;
}

/* Sheet variant: a bottom sheet on mobile, a right side panel on desktop. */
.nz-modal--sheet {
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
}
.nz-modal--sheet .nz-modal__dialog {
  width: min(480px, 92vw);
  height: 100%;
  max-height: none;
  border: 0;
  border-left: 1px solid var(--rule);
  box-shadow: var(--shadow-overlay);
  opacity: 1;
  transform: translateX(110%);
  transition: transform var(--dur-panel) var(--ease-panel);
}
.nz-modal--sheet[data-state='open'] .nz-modal__dialog {
  transform: none;
}

@media (max-width: 819.98px) {
  .nz-modal {
    padding: 0;
  }
  .nz-modal__dialog {
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    box-shadow: none;
  }
  .nz-modal__head {
    align-items: center;
    padding: 14px 16px 12px;
  }
  .nz-modal__body {
    padding: 20px 16px 28px;
  }
  .nz-modal__foot {
    padding: 12px 16px;
  }
  .nz-modal__close {
    min-height: var(--tap);
    padding-inline: 14px;
  }

  .nz-modal--sheet {
    align-items: flex-end;
  }
  .nz-modal--sheet .nz-modal__dialog {
    width: 100%;
    height: auto;
    max-height: calc(100dvh - 48px);
    padding-top: 0;
    border: 0;
    border-top: 1px solid var(--rule);
    box-shadow: var(--shadow-sheet);
    transform: translateY(105%);
  }
  .nz-modal--sheet .nz-modal__head {
    position: relative;
    padding-top: 22px;
  }
  /* Grab handle */
  .nz-modal--sheet .nz-modal__head::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 36px;
    height: 3px;
    border-radius: 2px;
    background: var(--rule);
    transform: translateX(-50%);
  }
  .nz-modal--sheet .nz-modal__body {
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
}

/* ── Placeholder view ("U izradi") ────────────────────────────────────── */
.nz-wip {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}
.nz-wip__head {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: var(--s-3);
}
.nz-wip__status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.nz-wip__route {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.nz-wip__next {
  border-top: 1px solid var(--rule);
  padding-top: var(--s-5);
}

/* ── Touch: 44px targets in mobile mode ───────────────────────────────── */
@media (max-width: 819.98px) {
  .nz-btn {
    min-height: var(--tap);
  }
  .nz-btn--ghost,
  .nz-btn--sm {
    min-height: 40px;
  }
  .nz-btn--ghost::after,
  .nz-btn--sm::after {
    content: '';
    position: absolute;
    inset: -9px -2px;
  }
  /* Interactive chips: a 32px pill + 7px invisible margin = 46px; in a
     wrapping group keep rows ≥ 12px apart (32 + 12 = 44 per chip). */
  button.nz-chip,
  a.nz-chip {
    min-height: 32px;
  }
  button.nz-chip::after,
  a.nz-chip::after {
    content: '';
    position: absolute;
    inset: -7px -2px;
  }
  .nz-field input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']),
  .nz-field select,
  .nz-field__input {
    min-height: var(--tap);
    font-size: 16px; /* >= 16px stops iOS zooming into the field */
  }
  .nz-field textarea {
    font-size: 16px;
  }
  .nz-check {
    min-height: var(--tap);
    align-items: center;
  }
  .nz-check input {
    margin-top: 0;
  }
  .nz-band {
    padding: 20px;
  }
  .nz-accent {
    padding: 18px;
  }
  .nz-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }
  .nz-row__aside {
    grid-column: 2;
    text-align: left;
  }
  .nz-row--noindex {
    grid-template-columns: minmax(0, 1fr);
  }
  .nz-row--noindex .nz-row__aside {
    grid-column: 1;
  }
}

@media (max-width: 419.98px) {
  .nz-facts {
    --facts-key: 104px;
    gap: 8px 12px;
  }
  .nz-tile {
    padding: 16px;
  }
}

/* ── Reduced motion: sheet/modal fade only ────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .nz-modal__dialog,
  .nz-modal--sheet .nz-modal__dialog {
    transform: none !important;
  }
}

.nz-wip__next .nz-rows {
  margin-top: 14px;
}
