/* NEXUS Atlas components — docs/design-system.md §4, §7, §10, §11. */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.45; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-text); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[class^="ri-"], [class*=" ri-"] { font-size: 1.2em; line-height: 1; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Shell */
.shell { display: grid; grid-template-columns: 248px 1fr; grid-template-rows: auto auto 1fr; min-height: 100vh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 10px 20px;
  background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 8px; align-items: center; font-weight: 800; text-decoration: none; color: var(--text); white-space: nowrap; }
.brand i { color: var(--accent); font-size: 26px; }
.topbar .business { font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.topbar form { margin: 0; }
.banner-slot { grid-column: 1 / -1; }
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 20px; background: var(--warn-bg); color: var(--warn); font-weight: 600; }
.sidebar { padding: 16px 12px; border-right: 1px solid var(--line); background: var(--card); }
.sidebar h2 { font-size: 12px; font-weight: 600; color: var(--muted); margin: 16px 10px 6px; }
.sidebar h2:first-child { margin-top: 0; }
.sidebar a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.sidebar a:hover { background: var(--sunk); }
.sidebar a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
.content { padding: 28px 32px 64px; max-width: 1240px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.3px; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* Controls */
.btn { display: inline-flex; gap: 6px; align-items: center; justify-content: center; min-height: var(--compact);
  padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card);
  font-weight: 700; font-size: 14px; white-space: nowrap; text-decoration: none; color: var(--text); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.soft { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.btn.danger { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.btn.ghost { background: none; border-color: transparent; }
.btn.touch { min-height: var(--touch); padding: 0 22px; font-size: 17px; border-radius: var(--r-md); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: var(--compact); height: var(--compact);
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card); }
.field { display: grid; gap: 5px; align-content: start; }
.field label { font-size: 13px; font-weight: 600; }
.field input, .field select, .field textarea { min-height: var(--compact); border: 1px solid var(--line);
  background: var(--card); border-radius: var(--r-sm); padding: 7px 12px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft); }
.field .help { font-size: 13px; color: var(--muted); }
.field input[type="checkbox"] { min-height: 0; width: 18px; height: 18px; }
.field input[type="file"] { padding: 6px; }
.field.error input, .field.error select { border-color: var(--bad); }
.field .error-text { font-size: 13px; color: var(--bad); }
.lang-switch select { min-height: 32px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); padding: 0 8px; }

/* Content blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card > h2 { margin: 0; padding: 14px 16px; font-size: 15px; border-bottom: 1px solid var(--line); }
.card .body { padding: 16px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px;
  border-radius: 8px; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.info { background: var(--accent-soft); color: var(--accent-text); }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); font-size: 14px; }
.alert.ok { background: var(--ok-bg); color: var(--ok); } .alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.info { background: var(--accent-soft); color: var(--accent-text); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { height: var(--compact); padding: 0 14px; text-align: left; border-bottom: 1px solid var(--line); }
table.data th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--sunk); }
table.data td.n, table.data th.n { text-align: right; font-variant-numeric: tabular-nums; }

/* Forms and stacks */
.stack { display: grid; gap: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.choices { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.choices legend { font-size: 13px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.choice { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.title { margin: 0; font-size: 22px; font-weight: 800; }
h2.title { font-size: 17px; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.panel { margin-bottom: 16px; }
.narrow { max-width: 640px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; align-items: start; }
.form-section { display: grid; gap: 14px; padding: 18px; }
.form-section + .form-section { border-top: 1px solid var(--line); }
.form-section h2, .card.form-section > h2 { margin: 0; padding: 0; border: 0; font-size: 16px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; }
.list li:last-child a { border-bottom: 0; }
.list li a:hover { background: var(--sunk); }

/* Touch PIN pad (design-system §5: min 56 px targets, 72 px keys) */
[x-cloak] { display: none !important; }
.pinpad { display: grid; grid-template-columns: 1fr minmax(280px, 360px); gap: 24px; align-items: start; }
.pin-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pin-tile { min-height: 96px; display: grid; place-items: center; align-content: center; gap: 8px; border: 1px solid var(--line);
  background: var(--card); border-radius: var(--r-md); font-weight: 700; font-size: 16px; }
.pin-tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pin-initials { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.pin-entry { display: grid; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.pin-who { margin: 0; font-size: 20px; font-weight: 800; text-align: center; }
.pin-dots { display: flex; justify-content: center; gap: 14px; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); }
.pin-dots span.filled { background: var(--text); border-color: var(--text); }
.pin-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pin-keys button { min-height: var(--touch-xl); border-radius: var(--r-md); border: 1px solid var(--line); background: var(--card);
  font-size: 26px; font-weight: 700; }
.pin-keys button:active { background: var(--accent-soft); }
@media (max-width: 760px) { .pinpad { grid-template-columns: 1fr; } }

/* Plain layout (login, sign-up, onboarding) */
.plain { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.plain .card { width: min(100%, 440px); padding: 28px; display: grid; gap: 16px; }
.plain .brand { justify-content: center; font-size: 20px; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .content { padding: 20px 16px 48px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Company name in place of a missing logo (FR-068) */
.logo-fallback { font-weight: 800; font-size: 20px; color: var(--text); }

/* Product picture or fallback tile: the category color at 20 % tint with the product's initials (design system §8). */
.product-tile { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; object-fit: cover;
  vertical-align: middle; margin-right: 8px; flex: none; }
.product-tile.fallback { --tile-color: var(--accent); background: color-mix(in oklab, var(--tile-color) 20%, var(--card));
  color: color-mix(in oklab, var(--tile-color) 80%, var(--text)); font-size: 13px; font-weight: 700; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.image-card { display: flex; flex-direction: column; gap: 8px; }
.image-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); }
.drop-zone { border: 2px dashed var(--line); border-radius: 14px; padding: 24px; text-align: center; }
.drop-zone.over { border-color: var(--accent); background: var(--accent-soft); }

/* Inputs inside data tables (variants, units, packagings) look like form fields. */
table.data input:not([type="checkbox"]):not([type="radio"]), table.data textarea, table.data select {
  min-height: var(--compact); border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: var(--r-sm); padding: 5px 10px; width: 100%; min-width: 6em; }
table.data input:focus, table.data textarea:focus, table.data select:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft); }
/* A group of choices (radio buttons) styled like a field, without the browser's frame. */
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field legend { font-size: 13px; font-weight: 600; padding: 0; margin-bottom: 5px; }
/* The selected option of a switch made of buttons / links. */
.btn.active, .btn[aria-current="true"] { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }

/* The picture section of the product form. */
.picture-field { margin-bottom: 16px; }
.picture-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.picture-current img, .picture-current .product-tile { width: 120px; height: 120px; border-radius: 14px; object-fit: cover;
  border: 1px solid var(--line);
  font-size: 32px; margin: 0; }
.picture-empty { display: grid; place-items: center; width: 120px; height: 120px; border-radius: 14px;
  border: 2px dashed var(--line); color: var(--muted); font-size: 32px; }
.picture-actions { display: grid; gap: 8px; flex: 1; min-width: 240px; }

/* Pages of a long list. */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--line); }
.pagination .pages { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pagination .btn { min-width: var(--compact); }

/* Suggestions under a search box while typing. */
.search-box { position: relative; }
.suggestions { position: absolute; z-index: 30; left: 0; min-width: min(440px, calc(100vw - 32px)); width: 100%;
  top: calc(100% + 4px); background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
  max-height: 420px; overflow-y: auto; padding: 4px; }
.suggestions:empty { display: none; }
.suggestion { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text);
  text-decoration: none; }
.suggestion:hover, .suggestion:focus, .suggestion[aria-selected="true"] { background: var(--accent-soft); outline: none; }
.suggestion .product-tile { margin: 0; }
.suggestion .meta { display: grid; gap: 2px; min-width: 0; flex: 1; }
.suggestion .meta b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggestion .meta span { font-size: 12px; color: var(--muted); }
.suggestion .price { font-weight: 700; white-space: nowrap; }

/* Printable pages (numbering rules, reports): only the content. */
@media print {
  .topbar, .sidebar, .no-print, .messages { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* Journal entry lines (003): pickers open under their cell; account names in small text. */
.picker-cell { position: relative; min-width: 9rem; }
.small { font-size: .8125rem; }
.entry-lines input { width: 100%; }

/* Register screen (005): touch-first, two columns from 1024 px, the sale always visible. */
.pos-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.pos-banner { position: sticky; top: 0; z-index: 20; padding: 12px 16px; margin-bottom: 12px; border-radius: var(--r-md);
  background: var(--bad-bg); color: var(--bad); font-weight: 700; }
/* Selling screen: products on the left, the bill as a full-height panel on the right (design system §10). */
.pos-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 420px); gap: 16px; align-items: start; }
.pos-left { display: grid; gap: 14px; min-width: 0; align-content: start; }
.pos-scan { position: relative; display: flex; gap: 8px; }
.pos-scan > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 24px; color: var(--muted); pointer-events: none; }
.pos-scan input { flex: 1; min-width: 0; min-height: var(--touch); padding: 0 16px 0 52px; font-size: 18px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--card); }
.pos-scan input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pos-filter { display: flex; gap: 10px; align-items: center; min-width: 0; }
.pos-cats { flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.pos-cats::-webkit-scrollbar { display: none; }
.pos-chip { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 22px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); font-weight: 700; font-size: 14px; text-decoration: none; }
.pos-chip-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tile-color, var(--line)); }
.pos-chip.active { background: var(--text); border-color: var(--text); color: var(--card); }
.pos-search { position: relative; flex: 0 1 260px; }
.pos-search > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.pos-search input { width: 100%; min-height: 44px; padding: 0 12px 0 36px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); }
.pos-search input:focus { outline: none; border-color: var(--accent); }
.pos-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pos-tiles > form { display: contents; }
.pos-tile { position: relative; display: grid; grid-template-rows: auto 1fr auto; gap: 6px; width: 100%; padding: 8px 8px 12px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); color: var(--text); cursor: pointer;
  transition: transform .06s, border-color .12s, box-shadow .12s; overflow: hidden; }
.pos-tile:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgb(0 0 0 / .06); }
.pos-tile:active { transform: scale(.97); background: var(--accent-soft); }
.pos-tile:disabled { opacity: .6; }
.pos-tile-visual { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden;
  background: color-mix(in srgb, var(--tile-color, var(--accent)) 14%, var(--card)); }
.pos-tile-visual img, .pos-tile-visual .product-tile { width: 100%; height: 100%; object-fit: contain; border-radius: 0; }
.pos-tile-visual .product-tile.fallback { display: grid; place-items: center; font-size: 30px; font-weight: 800; background: transparent;
  color: color-mix(in srgb, var(--tile-color, var(--accent)) 70%, var(--text)); }
.pos-tile-name { padding: 0 4px; font-weight: 700; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.pos-tile-price { padding: 0 4px; font-weight: 800; font-size: 15px; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.pos-tiles.colors .pos-tile { padding-top: 16px; min-height: 110px; border-top: 6px solid var(--tile-color, var(--accent)); }
.pos-tiles.colors .pos-tile-visual { display: none; }
.pos-tiles.colors .pos-tile-name { font-size: 15px; }

.pos-right { position: sticky; top: 64px; display: flex; flex-direction: column; gap: 12px; padding: 0; overflow: hidden;
  height: calc(100dvh - 88px); }
.pos-bill-head { padding: 14px 16px 0; }
.pos-customer-find { position: relative; }
.pos-customer-find > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; }
.pos-customer-find input { width: 100%; min-height: 44px; padding: 0 12px 0 40px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sunk); }
.pos-customer-find input:focus { outline: none; border-color: var(--accent); background: var(--card); }
.pos-customer-chip { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border-radius: var(--r-sm); background: var(--accent-soft);
  color: var(--accent-text); }
.pos-customer-chip b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-customer-chip form { margin: 0; }
.pos-right > .alert, .pos-right > .actions, .pos-right > .pos-override { margin: 0 16px; }
.pos-lines { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px; }
.pos-cart { width: 100%; border-collapse: collapse; }
.pos-cart td { padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.pos-cart tr:last-child td { border-bottom: 0; }
.pos-line-name { padding-right: 8px !important; }
.pos-line-name b { font-size: 14px; }
.pos-line-amount { padding-left: 8px !important; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos-line-more { width: 1%; padding-left: 4px !important; }
.pos-stepper { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 12px; background: var(--sunk); }
.pos-stepper form { margin: 0; }
.pos-step { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent;
  color: var(--text); font-size: 18px; cursor: pointer; }
.pos-step:hover { background: var(--card); }
.pos-qty input { width: 3.6em; height: 36px; border: 0; background: transparent; text-align: center; font-weight: 700; font-size: 15px; }
.pos-qty input:focus { outline: 2px solid var(--accent); border-radius: 8px; background: var(--card); }
.pos-empty { display: grid; place-items: center; align-content: center; gap: 8px; height: 100%; min-height: 160px; color: var(--muted); text-align: center; }
.pos-empty i { font-size: 44px; opacity: .5; }
.pos-empty p { margin: 0; }
.pos-done { display: grid; gap: 10px; padding: 12px 0; }
.pos-done .alert { display: flex; gap: 8px; align-items: center; }
.pos-send { display: flex; gap: 8px; }
.pos-send input { flex: 1; min-width: 0; min-height: var(--compact); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 10px; }
.pos-bill-foot { display: grid; gap: 10px; padding: 12px 16px 16px; border-top: 1px solid var(--line); background: var(--sunk); }
.pos-bill-tools { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pos-bill-tools .btn { padding: 0 8px; color: var(--muted); }
.pos-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; font-weight: 600; }
.pos-total b { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.pos-pay { display: grid; gap: 8px; }
.pos-pay label { font-size: 13px; color: var(--muted); font-weight: 600; }
.pos-pay input { min-height: var(--touch); padding: 0 14px; font-size: 20px; font-weight: 700; text-align: right; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--card); font-variant-numeric: tabular-nums; }
.pos-pay input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pos-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.btn.pay { min-height: 72px; font-size: 18px; border-radius: var(--r-md); }
.pos-finish { width: 100%; }
.pos-payments, .pos-parked { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pos-payments li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pos-payments form { margin: 0; }
.pos-parked-list > summary { list-style: none; color: var(--muted); padding: 0 8px; }
.pos-parked-list > summary::-webkit-details-marker { display: none; }
.pos-override { border-color: var(--accent); }
@media (max-width: 1023px) { .pos-grid { grid-template-columns: 1fr; } .pos-right { position: static; height: auto; } }

/* The register as its own full-screen app (005): slim bar, no back-office menu. */
.reg-shell { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; background: var(--bg); }
.reg-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 8px 16px;
  background: var(--card); border-bottom: 1px solid var(--line); }
.reg-bar .spacer { flex: 1; }
.reg-brand { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; }
.reg-brand i { color: var(--accent); font-size: 22px; }
.reg-person { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.reg-online { width: 10px; height: 10px; border-radius: 50%; background: var(--ok, #2e7d32); }
.reg-online.off { background: var(--bad); }
.reg-main { padding: 12px 16px; min-width: 0; }
.reg-menu { position: relative; }
.reg-menu > summary { list-style: none; }
.reg-menu > summary::-webkit-details-marker { display: none; }
.reg-menu-panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; padding: 6px; display: grid; gap: 2px;
  box-shadow: 0 12px 32px rgb(0 0 0 / .2); }
.reg-menu-panel form { margin: 0; }
.reg-menu-item { width: 100%; display: flex; align-items: center; gap: 10px; min-height: var(--touch); padding: 0 12px;
  border: 0; border-radius: var(--r-md); background: none; color: var(--text); font: inherit; text-align: left;
  text-decoration: none; cursor: pointer; }
.reg-menu-item:hover, .reg-menu-item:focus-visible { background: var(--accent-soft); }
.pos-dialog { max-width: 520px; width: calc(100% - 32px); border: 1px solid var(--line); color: var(--text); }
.pos-dialog::backdrop { background: rgb(0 0 0 / .45); }
.pos-more > summary { list-style: none; }
.pos-more > summary::-webkit-details-marker { display: none; }
.pos-more-panel { display: grid; gap: 10px; padding-top: 8px; }
.pos-inline { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: end; }
.pos-inline label { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.reg-main .pos-grid { min-height: calc(100dvh - 90px); }
.pos-dialog:not([open]) { display: none; }
.pos-dialog[open] { display: grid; gap: 10px; margin: auto; }
.pos-dialog { max-height: calc(100dvh - 48px); overflow-y: auto; }
.pos-dialog h2 { margin: 0; font-size: 17px; }
.pos-dialog-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; padding: 10px 0;
  border-top: 1px solid var(--line); }
.pos-dialog-row:has(> .field:only-of-type) { grid-template-columns: 1fr auto; }
.pos-dialog-row .btn { min-height: var(--touch); }
@media (max-width: 560px) { .pos-dialog-row { grid-template-columns: 1fr; } }

/* Settings pages: one card per group, title + explanation on the left, fields on the right. */
.settings { display: grid; gap: 16px; max-width: 1080px; }
.settings-group { display: grid; grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); gap: 24px; padding: 24px; }
.settings-group > header h2 { display: flex; gap: 8px; align-items: center; margin: 0 0 6px; font-size: 16px; }
.settings-group > header h2 i { color: var(--accent); font-size: 20px; }
.settings-group > header p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.settings-fields { display: grid; gap: 18px; min-width: 0; }
.settings-fields .row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-bar { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 8px; padding: 14px 0;
  background: linear-gradient(to top, var(--bg) 70%, transparent); }
@media (max-width: 900px) { .settings-group { grid-template-columns: 1fr; gap: 14px; padding: 18px; }
  .settings-fields .row2 { grid-template-columns: 1fr; } }

/* Choices as cards (radio). */
.option-group legend { margin-bottom: 8px; }
.option-group > .help { margin: -4px 0 8px; display: block; }
.option-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.option-card { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); transition: border-color .12s, background .12s; }
.option-card:hover { border-color: var(--accent); }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card .option-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--sunk); color: var(--muted); font-size: 19px; }
.option-body { display: grid; gap: 3px; min-width: 0; }
.option-body b { font-size: 14px; }
.option-body span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.option-card::after { content: ""; position: absolute; top: 12px; right: 12px; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--line); background: var(--card); }
.option-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.option-card:has(input:checked) .option-icon { background: var(--accent); color: var(--on-accent); }
.option-card:has(input:checked)::after { border-color: var(--accent); background: radial-gradient(var(--accent) 45%, var(--card) 50%); }
.option-card:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.option-card .option-body { padding-right: 22px; }

/* Many choices as tiles (checkboxes). */
.check-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.check-tile { position: relative; display: grid; gap: 8px; justify-items: start; padding: 14px; min-height: 88px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); font-weight: 600; }
.check-tile:hover { border-color: var(--accent); }
.check-tile input { position: absolute; opacity: 0; pointer-events: none; }
.check-tile > i:first-of-type { font-size: 24px; color: var(--muted); }
.check-tile-mark { position: absolute; top: 10px; right: 10px; font-size: 20px; color: var(--accent); opacity: 0; }
.check-tile:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.check-tile:has(input:checked) > i:first-of-type { color: var(--accent-text); }
.check-tile:has(input:checked) .check-tile-mark { opacity: 1; }
.check-tile:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Yes / no settings as switches with an explanation. */
.switch-row { display: grid; gap: 4px; }
.switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { flex: none; position: relative; width: 40px; height: 24px; margin-top: 1px; border-radius: 12px;
  background: var(--line); transition: background .15s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--accent); outline-offset: 2px; }
.switch-text { display: grid; gap: 2px; }
.switch-text b { font-size: 14px; }
.switch-text .help { font-size: 13px; color: var(--muted); }

/* Bill lines: tap to select; the keypad edits the selected line. */
.pos-cart { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pos-line { position: relative; display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer;
  border-left: 3px solid transparent; }
.pos-line:hover { background: var(--sunk); }
.pos-line.selected { background: var(--accent-soft); border-left-color: var(--accent); }
.pos-line-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.pos-line-name { font-weight: 700; font-size: 15px; min-width: 0; }
.pos-line-amount { flex: none; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.pos-line-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 13px; color: var(--muted);
  font-variant-numeric: tabular-nums; }
.pos-line-sub b { color: var(--text); }
.pos-line.selected .pos-line-sub [data-show] { color: var(--accent-text); font-weight: 800; }
.pos-line-note { display: inline-flex; gap: 4px; align-items: center; font-style: italic; }
.pos-lines { padding: 0 8px; }

.pos-totals { display: grid; gap: 2px; }
.pos-subtotal { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pos-bill-foot { gap: 8px; padding-top: 10px; }
.pos-bill-tools { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.pos-bill-tools:empty { display: none; }

/* The keypad: Payment on the left, digits and modes on the right. */
.pos-pad { display: grid; grid-template-columns: minmax(96px, 30%) 1fr; gap: 6px; }
.pos-pad-main { display: grid; }
.pos-pay-open-form { display: grid; }
.pos-pay-open { height: 100%; min-height: 200px; display: grid; place-content: center; justify-items: center; gap: 4px; padding: 8px;
  border-radius: var(--r-md); font-size: 18px; white-space: normal; text-align: center; }
.pos-pay-open i { font-size: 30px; }
.pos-pay-open small { font-size: 15px; font-weight: 700; opacity: .85; font-variant-numeric: tabular-nums; }
.pos-pad-keys, .pos-pay-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pos-key { min-height: 52px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text);
  font-size: 19px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
.pos-key:hover:not(:disabled) { border-color: var(--accent); }
.pos-key:active:not(:disabled) { transform: scale(.96); background: var(--accent-soft); }
.pos-key:disabled { opacity: .45; cursor: not-allowed; }
.pos-key.mode { font-size: 14px; background: var(--sunk); }
.pos-key.mode.active { background: var(--text); border-color: var(--text); color: var(--card); }

/* Payment dialog */
.pos-pay-dialog { max-width: 460px; }
.pos-pay-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pos-pay-due { display: grid; justify-items: end; }
.pos-pay-due span { font-size: 13px; color: var(--muted); }
.pos-pay-due b { font-size: 28px; font-variant-numeric: tabular-nums; }
.pos-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 6px; }
.pos-quick .btn { min-height: 48px; font-variant-numeric: tabular-nums; }
.pos-pay-keys { grid-template-columns: repeat(3, 1fr); }
@media (max-height: 820px) { .pos-key { min-height: 46px; } .pos-pay-open { min-height: 176px; } }
.pos-line-disc[hidden] { display: none; }

/* Sales: the invoice editor and document view (006). */
.sales-editor, .sales-view { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.sales-editor > .alert { grid-column: 1 / -1; }
.sales-main { padding: 18px; display: grid; gap: 14px; min-width: 0; }
.sales-side { display: grid; gap: 16px; position: sticky; top: 16px; }
.sales-side h2 { margin: 0; font-size: 16px; }
.sales-customer { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.sales-customer-name { display: grid; gap: 2px; margin: 2px 0 6px; } .sales-customer-name b { font-size: 17px; }
.sales-change > summary { list-style: none; } .sales-change > summary::-webkit-details-marker { display: none; }
.sales-change[open] { display: grid; gap: 8px; min-width: 280px; }
.sales-change input, .sales-find input { width: 100%; min-height: var(--compact); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 10px; background: var(--card); }
.sales-options { display: grid; gap: 4px; max-height: 260px; overflow-y: auto; }
.sales-option { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; width: 100%; padding: 8px 10px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); color: var(--text); cursor: pointer; }
.sales-option:hover { border-color: var(--accent); background: var(--accent-soft); }
.sales-scan { position: relative; display: flex; gap: 8px; }
.sales-scan > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--muted); }
.sales-scan input { flex: 1; min-height: 44px; padding: 0 12px 0 40px; border: 1px solid var(--line); border-radius: var(--r-md); font-size: 16px; background: var(--card); }
.sales-scan input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sales-lines td { vertical-align: top; }
.sales-lines input { border: 1px solid transparent; border-radius: 8px; background: var(--sunk); padding: 4px 8px; min-height: 32px; }
.sales-lines input:hover { border-color: var(--line); } .sales-lines input:focus { outline: none; border-color: var(--accent); background: var(--card); }
.sales-num { width: 7.5em; text-align: right; font-variant-numeric: tabular-nums; } .sales-num.sm { width: 4.5em; }
.sales-desc { display: block; width: 100%; margin-top: 4px; font-size: 13px; }
.sales-section td input { width: 100%; font-weight: 700; } .sales-note td input { width: 100%; font-style: italic; }
.sales-addtext { display: flex; flex-wrap: wrap; gap: 8px; } .sales-addtext form { display: flex; gap: 6px; }
.sales-addtext input { min-height: var(--compact); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 10px; background: var(--card); }
.sales-totals { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sales-totals td { padding: 4px 0; } .sales-totals .grand td { font-size: 20px; font-weight: 800; border-top: 1px solid var(--line); padding-top: 8px; }
.sales-validate { display: grid; gap: 8px; } .sales-validate .btn { min-height: 44px; }
.sales-dates { padding: 0; }
.sales-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sales-pay-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sales-pay-row span { flex: 1; font-size: 14px; } .sales-reverse > summary { list-style: none; } .sales-reverse > summary::-webkit-details-marker { display: none; }
.sales-open { display: flex; justify-content: space-between; padding: 10px 16px; font-variant-numeric: tabular-nums; } .sales-open b { font-size: 17px; }
.sales-pay-form { padding: 0; }
.sales-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 14px; } .sales-dl dt { color: var(--muted); } .sales-dl dd { margin: 0; }
@media (max-width: 1100px) { .sales-editor, .sales-view { grid-template-columns: 1fr; } .sales-side { position: static; } }
.sales-lines td.num { white-space: nowrap; }
.sales-lines td:first-child { min-width: 220px; }
.sales-view > .card > .sales-totals { width: min(360px, 100%); margin: 12px 16px 16px auto; }
.sales-view > .card > .muted.small { padding: 0 16px 16px; text-align: right; }
.pos-recall-q { min-height: 44px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 12px; background: var(--card); }

/* Customer portal (006 US9) */
.portal { max-width: 920px; margin: 0 auto; padding: 24px 16px 48px; display: grid; gap: 16px; }
.portal-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.portal-head h1 { margin: 2px 0; } .portal-head .party { display: grid; text-align: right; }
.portal-form { display: grid; gap: 16px; }
.portal-optional td { background: var(--sunk); }
.portal-totals { width: min(360px, 100%); margin: 12px 16px 16px auto; }
.portal-canvas { width: 100%; max-width: 600px; height: 160px; border: 1px dashed var(--line); border-radius: var(--r-md); background: var(--card); touch-action: none; }
.portal-sign .btn.primary { min-height: 48px; justify-self: start; }
.sales-inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .sales-inline input, .sales-inline select { flex: 1; min-width: 0; min-height: var(--compact); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 10px; background: var(--card); }
.sales-margin { display: flex; justify-content: space-between; padding: 6px 0; color: var(--muted); } .sales-margin b { color: var(--ok, #2e7d32); }

/* PDV reporting (007) */
.vat-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 16px; counter-reset: s; }
.vat-steps li { counter-increment: s; padding: 6px 12px; border-radius: 20px; background: var(--sunk); color: var(--muted); font-weight: 600; font-size: 13px; }
.vat-steps li::before { content: counter(s) ". "; } .vat-steps li.done { background: var(--ok-bg); color: var(--ok); }
.vat-tabs { display: flex; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.table-scroll { overflow-x: auto; } .vat-book td, .vat-book th { white-space: nowrap; font-size: 13px; }
.vat-form td { padding: 8px 12px; } .vat-lines select, .vat-lines input:not([type=checkbox]) { min-height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; background: var(--card); max-width: 100%; }

/* Inventory (008) */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--ink, inherit); border-bottom-color: var(--accent, currentColor); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }
td.num.bad, .num.bad { color: var(--bad); font-weight: 600; }
.inv-kalk td, .inv-kalk th { white-space: nowrap; font-size: 13px; }
.inv-add { display: grid; grid-template-columns: 2fr repeat(5, minmax(90px, 1fr)) auto; gap: 8px; align-items: end; padding: 16px; }
@media (max-width: 1100px) { .inv-add { grid-template-columns: 1fr 1fr; } }
.inv-count-row input { width: 120px; min-height: 44px; font-size: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.inv-scan { display: flex; gap: 8px; padding: 16px; } .inv-scan input { flex: 1; min-height: 48px; font-size: 18px; }
/* Purchasing (009): inline line edits, totals and the 3-way match */
.inline-qty, .inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; flex-wrap: wrap; }
.inline-qty input, .inline-form input { width: 96px; min-height: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.pur-totals { margin: 12px 0 0 auto; max-width: 360px; width: 100%; }
.pur-totals td { padding: 4px 8px; } .pur-totals .grand td { font-weight: 800; border-top: 1px solid var(--line); }
.pur-match td.diff { color: var(--bad, #b42318); font-weight: 600; }
.pur-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.pur-steps li { padding: 4px 10px; border-radius: 999px; background: var(--soft, #f2f4f7); color: var(--muted); font-size: 13px; }
.pur-steps li[aria-current="step"] { background: var(--accent, #2f6fed); color: #fff; font-weight: 700; }
/* POS Restaurant (010): floor plan, table status, order screen — touch-first */
.rst-floor { position: relative; width: 100%; aspect-ratio: 16 / 10; background: var(--soft, #f2f4f7) center / cover no-repeat; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; touch-action: manipulation; }
.rst-table { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 64px; min-height: 64px; border-radius: 12px; border: 2px solid var(--line); background: var(--card, #fff); color: inherit; text-decoration: none; font-weight: 700; padding: 6px; font-size: 15px; cursor: pointer; }
.rst-table.round { border-radius: 50%; }
.rst-table small { font-weight: 500; font-size: 12px; color: var(--muted); }
.rst-table.occupied { border-color: var(--accent, #3b5bdb); background: color-mix(in srgb, var(--accent, #3b5bdb) 12%, var(--card, #fff)); }
.rst-table.bill { border-color: var(--warn, #f08c00); background: color-mix(in srgb, var(--warn, #f08c00) 16%, var(--card, #fff)); }
.rst-table.attention { border-color: var(--bad, #e03131); }
.rst-table.mine { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #3b5bdb) 35%, transparent); }
.rst-side { display: grid; gap: 12px; align-content: start; }
.rst-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
@media (max-width: 900px) { .rst-layout { grid-template-columns: 1fr; } }
.rst-order { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, 1fr); gap: 16px; }
@media (max-width: 900px) { .rst-order { grid-template-columns: 1fr; } }
.rst-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.rst-tile { min-height: 72px; border-radius: 12px; border: 1px solid var(--line); background: var(--card, #fff); font-weight: 700; padding: 10px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; color: inherit; text-decoration: none; }
.rst-item { display: grid; grid-template-columns: 48px 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rst-item.held { opacity: .75; } .rst-item .meta { font-size: 13px; color: var(--muted); }
.rst-bill-big { font-size: clamp(48px, 10vw, 120px); font-weight: 800; text-align: center; letter-spacing: -1px; margin: 24px 0; }
.rst-badge-red { background: var(--bad, #e03131); color: #fff; border-radius: 999px; padding: 2px 10px; font-weight: 700; }
