:root {
  --surface: #eef2f1;
  --panel: #ffffff;
  --ink: #15231f;
  --muted: #5a6b65;
  --line: #cfd8d4;
  --accent: #0f6b5c;
  --accent-ink: #073f37;
  --accent-soft: #d8ebe6;
  --text: 0.875rem;
  --text-sm: 0.78rem;
  --space: 0.55rem;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Georgia, serif;
  font-size: var(--text);
  line-height: 1.35;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 107, 92, 0.1), transparent 42%),
    linear-gradient(180deg, #f4f7f6 0%, #e8efec 100%);
  min-height: 100vh;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
.shell {
  display: flex;
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 100vh;
}
.sidebar {
  width: 200px;
  flex: 0 0 200px;
  padding: 0.85rem 0.65rem;
  border-right: 1px solid var(--line);
  background: var(--panel);
}
.brand-kicker { font-size: 0.65rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.brand { font-size: 1.25rem; margin: 0.1rem 0; line-height: 1.2; }
.brand-logo {
  display: block;
  margin: 0 0 0.55rem;
  text-decoration: none;
}
.brand-logo img {
  display: block;
  width: 100%;
  max-width: 168px;
  height: auto;
}
.login-logo {
  display: block;
  width: min(16rem, 100%);
  margin: 0 auto 0.65rem;
}
.login-logo img { display: block; width: 100%; height: auto; }
.brand-sub { color: var(--muted); font-size: 0.75rem; margin-bottom: 0.75rem; }
.nav a {
  display: block; padding: 0.35rem 0.55rem; border-radius: 5px; color: var(--ink);
  margin-bottom: 0.12rem; text-decoration: none; font-size: 0.84rem;
}
.nav a:hover, .nav a.active { background: var(--accent-soft); }
.nav-group {
  margin: 0.55rem 0 0.15rem;
  padding: 0.35rem 0 0.15rem;
  border-top: 1px solid var(--line);
}
.nav-group:first-of-type { margin-top: 0.45rem; }
.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.35rem;
  margin: 0;
  padding: 0.28rem 0.55rem;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.nav-group-toggle:hover { background: var(--accent-soft); color: var(--accent-ink); }
.nav-group-chevron {
  flex: 0 0 auto;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  opacity: 0.75;
}
.nav-group.is-open .nav-group-toggle { color: var(--accent-ink); }
.nav-group.is-open .nav-group-chevron { transform: rotate(45deg); }
.nav-group-items {
  display: none;
  padding-top: 0.1rem;
}
.nav-group.is-open .nav-group-items { display: block; }
.nav-group-items a {
  padding-left: 0.7rem;
  font-size: 0.82rem;
}
.nav-sublabel {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 0.45rem 0.7rem 0.15rem;
  opacity: 0.9;
}
.nav-sublabel:first-child { padding-top: 0.15rem; }
.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.55rem 1rem; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.85);
}
.topbar h1 { margin: 0; font-size: 1.15rem; flex: 1 1 auto; min-width: 8rem; line-height: 1.2; }
.topbar .actions { flex: 1 1 auto; justify-content: flex-end; }
.content { padding: 0.75rem 1rem 1.25rem; width: 100%; max-width: 1680px; }
.toolbar-panel { margin-bottom: 0.65rem; }
.toolbar-row { margin-bottom: 0.5rem; }
.filters-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  align-items: flex-end;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}
.filter-field { margin-bottom: 0; min-width: 9rem; flex: 1 1 9rem; }
.filter-actions { display: flex; gap: 0.4rem; align-items: center; padding-bottom: 0.1rem; }
.table-wrap { padding: 0; overflow: auto; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0.7rem 0.8rem;
  box-shadow: 0 1px 0 rgba(28,42,36,0.04);
}
.grid { display: grid; gap: var(--space); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { width: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
.kpi { display: block; transition: border-color .15s; padding: 0.65rem 0.75rem; }
.kpi:hover { border-color: var(--accent); text-decoration: none; }
.kpi .label { font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.kpi .value { font-size: 1.35rem; margin-top: 0.2rem; line-height: 1.15; }
.kpi .hint { font-size: 0.75rem; color: var(--muted); margin-top: 0.2rem; }

.dash-period {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem 0.85rem;
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.75rem;
}
.dash-period .field { min-width: 9rem; }
.dash-period-label { margin-left: auto; font-size: 0.8rem; align-self: center; }
.dash-kpi-row { margin-bottom: 0.25rem; }
.dash-widget-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
}
.dash-mini-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}
.dash-mini-row:last-child { border-bottom: 0; }
.row-overdue td { background: rgba(159, 18, 57, 0.04); }

.primite-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.primite-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 0.82rem;
  text-decoration: none;
}
.primite-tab span {
  min-width: 1.1rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.72rem;
  text-align: center;
}
.primite-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.primite-tab.is-active span {
  background: rgba(255,255,255,0.22);
  color: #fff;
}
.primite-e {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin-left: 0.25rem;
  vertical-align: middle;
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
}
.nowrap { white-space: nowrap; }
.rap-hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.65rem;
}
.rap-hub-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
}
.rap-hub-section h3 {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}
.rap-hub-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.rap-hub-links a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 0.2rem 0;
}
.rap-hub-links a:hover { color: var(--accent); }
.center { text-align: center; }
.user-perms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.35rem;
}
.user-perms label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
}
.perm-ok { color: #15803d; font-weight: 700; }
.perm-no { color: var(--muted); }
.user-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.15rem;
  flex-wrap: wrap;
  align-items: center;
}
.conta-banner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
  background: var(--accent-soft);
  border-color: transparent;
}
.conta-card h3 { font-size: 0.95rem; }
.conta-actions { display: flex; flex-direction: column; gap: 0.55rem; }
.conta-action {
  display: block;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
}
.conta-action strong { display: block; margin-bottom: 0.15rem; }
.conta-action:hover { border-color: var(--accent); }
.conta-action.is-disabled {
  opacity: 0.55;
  pointer-events: none;
  background: #f7f7f7;
}
.conta-doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.conta-doc-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.conta-doc-list li:last-child { border-bottom: 0; }
@media (max-width: 720px) {
  .table .nowrap { white-space: normal; }
}
.field { display: flex; flex-direction: column; gap: 0.15rem; font-size: var(--text); margin-bottom: 0.35rem; }
.field span { color: var(--muted); font-size: var(--text-sm); line-height: 1.2; }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 5px; padding: 0.32rem 0.5rem; font: inherit;
  font-size: 0.875rem; background: #fff; min-height: 2rem;
}
.field textarea { min-height: 3.2rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent-soft); border-color: var(--accent);
}
h2 { font-size: 1.1rem; margin: 0.35rem 0; line-height: 1.25; }
h3 { font-size: 0.95rem; margin: 0.45rem 0 0.2rem; line-height: 1.25; }
.muted { color: var(--muted); font-size: var(--text-sm); line-height: 1.3; }
.panel > .muted:first-child { margin: 0 0 0.45rem; }
.bank-accounts { display: flex; flex-direction: column; gap: 0.5rem; }
.bank-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 0.75rem;
  align-items: end;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}
.bank-row .field { margin-bottom: 0; }
.bank-remove {
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.35rem 0.55rem;
  color: var(--muted);
  min-width: 2.2rem;
}
.bank-remove:hover { color: #a33; }
@media (max-width: 700px) {
  .bank-row { grid-template-columns: 1fr; }
  .bank-remove { justify-self: end; }
}
.settings-shell { display: flex; flex-direction: column; gap: 0.5rem; }
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(28,42,36,0.04);
}
.settings-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 7px;
  cursor: pointer;
}
.settings-tab:hover { background: var(--accent-soft); color: var(--ink); }
.settings-tab.is-active {
  background: var(--accent);
  color: #fff;
}
.settings-card { display: none; }
.settings-card.is-active { display: block; }
.settings-card.panel { padding: 0.75rem 0.9rem; }
.settings-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}
.settings-card-head h2 { margin: 0; font-size: 1.05rem; }
.settings-card-head .muted {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  line-height: 1.3;
}
.settings-card .grid { gap: 0.45rem 0.75rem; }
.settings-card .field {
  margin-bottom: 0.2rem;
  gap: 0.15rem;
  font-size: 0.86rem;
}
.settings-card .field > span { font-size: 0.78rem; line-height: 1.2; }
.settings-card .field input,
.settings-card .field select,
.settings-card .field textarea {
  padding: 0.35rem 0.5rem;
  font-size: 0.88rem;
  border-radius: 5px;
}
.settings-card .notice {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  line-height: 1.25;
}
.settings-card .muted { font-size: 0.8rem; line-height: 1.3; }
.settings-card h3 {
  margin: 0.75rem 0 0.25rem;
  font-size: 0.95rem;
}
.settings-card .bank-accounts { gap: 0.35rem; }
.settings-card .bank-row {
  gap: 0.45rem;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
}
.settings-card .bank-remove {
  font-size: 1.15rem;
  padding: 0.2rem 0.4rem;
  min-width: 1.8rem;
}
.settings-card .btn { padding: 0.35rem 0.7rem; font-size: 0.88rem; }
.settings-card .row-cui { gap: 0.4rem; }
.settings-card .mt { margin-top: 0.65rem; }
.settings-card .tpl-grid { gap: 0.5rem; margin-top: 0.35rem; }
.settings-card .tpl-card { padding: 0.55rem; }
.settings-card .tpl-card .tpl-swatch { height: 1.4rem; margin-bottom: 0.35rem; }
.settings-card .logo-preview { max-height: 42px; max-width: 120px; }
.settings-card .invoice-live-preview { margin-top: 0.65rem; }
.settings-card #anaf-msg:empty { display: none; margin: 0; }
@media (max-width: 700px) {
  .settings-card-head { flex-direction: column; align-items: stretch; }
}
.row-cui { display: flex; gap: 0.5rem; }
.row-cui input { flex: 1; }
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 5px; padding: 0.32rem 0.65rem; font: inherit; cursor: pointer;
  border: 1px solid transparent; text-decoration: none; font-size: 0.84rem; line-height: 1.2;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); text-decoration: none; color: #fff; }
.btn-secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { background: var(--accent-soft); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--muted); border: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.table th, .table td { padding: 0.32rem 0.45rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 0.74rem; }
.badge {
  display: inline-flex; border-radius: 5px; padding: 0.08rem 0.32rem; font-size: 0.68rem;
  font-weight: 600; border: 1px solid;
}
.badge-draft { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.badge-issued { background: #f0f9ff; color: #075985; border-color: #bae6fd; }
.badge-paid { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.badge-cancelled { background: #fff1f2; color: #9f1239; border-color: #fecdd3; }
.row-highlight td { background: #ecfdf5; }
.badge-invoice { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--line); }
.badge-proforma { background: #f5f3ff; color: #5b21b6; border-color: #ddd6fe; }
.badge-credit_note { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.badge-self_invoice { background: #ecfeff; color: #155e75; border-color: #a5f3fc; }
.badge-delivery_note { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.flash { padding: 0.45rem 0.7rem; border-radius: 8px; margin-bottom: 0.65rem; font-size: 0.84rem; }
.flash-ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-err { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }
.flash-warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.muted { color: var(--muted); }
.right { text-align: right; }
.mt { margin-top: 0.65rem; }
.notice { font-size: 0.78rem; color: var(--muted); margin: 0.25rem 0 0; line-height: 1.3; }
.cat-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.cat-chip {
  display: inline-block;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--ink);
  background: #fff;
  text-decoration: none;
  line-height: 1.2;
}
.cat-chip:hover { background: var(--accent-soft); text-decoration: none; }
.cat-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.stock-cat-title {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-ink);
}
.row-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.row-inline-form input[type="text"],
.row-inline-form input:not([type]) {
  min-width: 10rem;
  flex: 1;
}
.info-tip-btn {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font: 700 0.75rem/1 Georgia, serif;
  cursor: pointer;
  padding: 0;
}
.info-tip-btn[aria-expanded="true"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.info-tip-panel {
  margin-top: 0.65rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8faf9;
  font-size: 0.88rem;
  color: var(--ink);
}
.info-tip-panel ul {
  margin: 0.35rem 0 0.75rem 1.1rem;
  padding: 0;
}
.info-tip-panel li { margin: 0.2rem 0; }
.info-tip-panel code {
  font-size: 0.82rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
}
.receipt-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border: 1px solid #86efac;
  border-radius: 10px;
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.92rem;
}
.receipt-preview-label {
  margin: 1.5rem 0 0.65rem;
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.receipt-sheet {
  border: 2px dashed var(--accent);
  background: #f7fbf9;
  scroll-margin-top: 1rem;
}
.receipt-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.35rem;
}
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; }
  .receipt-sheet {
    break-before: page;
    page-break-before: always;
    box-shadow: none;
    border-radius: 0;
    border-style: solid;
  }
  .nir-sheet {
    box-shadow: none;
    border: none;
  }
}

/* NIR 14-3-1A */
.nir-sheet .nir-head {
  display: flex;
  justify-content: space-between;
  gap: 0.85rem;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
}
.nir-sheet .nir-title {
  margin: 0.1rem 0 0.2rem;
  font-size: 1rem;
  line-height: 1.25;
}
.nir-sheet .nir-meta { text-align: right; font-size: 0.84rem; }
.nir-sheet .nir-info {
  display: grid;
  gap: 0.2rem;
  font-size: 0.84rem;
}
.nir-sheet .nir-label {
  display: inline-block;
  min-width: 7.5rem;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  font-weight: 600;
}
.nir-sheet .nir-diff {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  background: #fffdf7;
}
.nir-sheet .nir-diff h3 {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
}
.nir-sheet .nir-signs {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 0.85rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
}
.nir-sheet .nir-sign-row {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 0.4rem;
  align-items: flex-end;
}
.nir-sheet .nir-sign-line {
  border-bottom: 1px solid #111;
  min-width: 7rem;
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted);
  padding-bottom: 0.1rem;
}
.nir-sheet .nir-table th,
.nir-sheet .nir-table td {
  padding: 0.25rem 0.35rem;
  font-size: 0.8rem;
}
.nir-form .section-title {
  margin: 0.55rem 0 0.25rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.15rem;
}
.section-title {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.2rem;
}
.code-lookup { position: relative; }
.code-suggest {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% - 0.1rem);
  max-height: 14rem;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(15, 40, 35, 0.12);
}
.code-suggest-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.4rem 0.55rem;
  font-size: 0.84rem;
  cursor: pointer;
  color: var(--ink);
  line-height: 1.3;
}
.code-suggest-item:hover,
.code-suggest-item:focus {
  background: var(--accent-soft);
  outline: 0;
}
.code-suggest-item .risk {
  color: #a15c00;
  font-style: normal;
  font-size: 0.72rem;
  margin-left: 0.25rem;
}
.code-suggest-empty {
  padding: 0.45rem 0.55rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.pill {
  display: inline-block;
  font-size: 0.68rem;
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
  margin-left: 0.35rem;
  vertical-align: middle;
  font-weight: 600;
}
.pill-warn {
  background: #fff3d6;
  color: #8a5a00;
  border: 1px solid #f0d49a;
}
.scan-field { margin: 0.5rem 0 0.75rem; }
.barcode-scan-input {
  font-family: ui-monospace, Consolas, monospace;
  letter-spacing: 0.02em;
  border: 1px dashed var(--accent) !important;
  background: #f4fbf8 !important;
}
.barcode-scan-input.is-scanning { opacity: 0.7; }
.barcode-scan-input.is-miss {
  border-color: #9f1239 !important;
  background: #fff1f2 !important;
}
tr.scan-hit {
  outline: 2px solid var(--accent);
  background: var(--accent-soft);
}
.nir-form .line-row {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
  margin-top: 0.35rem;
  background: var(--surface);
  gap: 0.35rem 0.45rem;
}
.nir-form .line-row .field { margin-bottom: 0; }
.nir-form .line-preview {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  margin: 0;
  padding-top: 0.15rem;
  border-top: 1px dashed var(--line);
}
@media (max-width: 800px) {
  .nir-sheet .nir-head,
  .nir-sheet .nir-signs { grid-template-columns: 1fr; display: grid; }
  .nir-sheet .nir-meta { text-align: left; }
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.login-card {
  width: 100%;
  max-width: 22rem;
}
.row-cui {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.row-cui input { flex: 1; }

.cookie-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  background: #15231f;
  color: #f4f7f6;
  padding: 0.85rem 1rem;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
}
.cookie-bar-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: 0.88rem;
}
.cookie-bar p { margin: 0; max-width: 44rem; }
.cookie-bar a { color: #9ee0d4; }
.cookie-bar-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.cookie-bar .btn { text-decoration: none; }

