:root {
  --green: #173f2a;
  --accent: #329a53;
  --paper: #f4f6f2;
  --ink: #1b2b22;
  --line: #dce3da;
  --muted: #627065;
  font-family: system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button,
.button {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--ink);
  padding: 11px 15px;
  cursor: pointer;
  font-weight: 650;
  text-decoration: none;
  min-height: 44px;
}
button:hover {
  border-color: var(--accent);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.danger {
  color: #a12a2a;
}
.muted,
small {
  color: var(--muted);
}
:focus-visible {
  outline: 3px solid #dc9b20;
  outline-offset: 3px;
}
input,
select,
textarea {
  width: 100%;
  padding: 11px;
  border: 1px solid #b8c6b8;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  min-height: 44px;
}
textarea {
  min-height: 90px;
  resize: vertical;
}
input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
}
label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}
h1 {
  font-size: 1.65rem;
  margin: 0;
}
h2 {
  font-size: 1.12rem;
}
h3 {
  font-size: 1rem;
}
p {
  line-height: 1.5;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 18px 26px;
  background: white;
  border-bottom: 1px solid var(--line);
}
header img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.brand,
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.shell {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  min-height: calc(100vh - 81px);
}
nav {
  padding: 18px 12px;
  border-right: 1px solid var(--line);
  background: white;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
nav button {
  text-align: left;
  border: 0;
  background: transparent;
}
nav button[aria-current="page"] {
  background: #e5eee3;
  color: var(--green);
}
main {
  padding: 26px;
  min-width: 0;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 18px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}
.metric {
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.metric strong {
  display: block;
  font-size: 1.6rem;
  margin-top: 8px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  align-items: end;
}
.filters label {
  flex: 1;
  min-width: 140px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}
th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: #f7f9f5;
}
td,
th {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td.wrap {
  white-space: normal;
  min-width: 180px;
}
.badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 20px;
  background: #eef1eb;
  font-size: 0.8rem;
}
.badge.paid,
.badge.completed {
  background: #ddf2dd;
  color: #205c28;
}
.badge.cancelled,
.badge.failed,
.badge.uncertain {
  background: #fde7e3;
  color: #9b2d1a;
}
.badge.pending,
.badge.unknown {
  background: #fff1cf;
  color: #71570c;
}
/* Register (PDV): one screen, big targets, payment by buttons. Desktop layout is fixed to the window below. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.pos {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 410px);
  gap: 16px;
}
.pos-catalog {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.pos-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.pos-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pos-chips button {
  border-radius: 22px;
  padding: 9px 18px;
}
.pos-chips button[aria-pressed="true"] {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
#pos-search {
  max-width: 280px;
}
.pos-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  align-content: start;
  padding: 10px 10px 10px 2px;
}
.pos-product {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 150px;
  padding: 10px;
  text-align: left;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: white;
}
.pos-product.in-cart {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}
.pos-product img {
  width: 100%;
  height: 84px;
  object-fit: contain;
}
.pos-product-name {
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.pos-product-price {
  margin-top: auto;
  font-size: 1.15rem;
  color: var(--green);
}
.pos-qty {
  position: absolute;
  top: -10px;
  right: -10px;
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border-radius: 17px;
  background: var(--green);
  color: white;
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: 0 2px 8px #0003;
}
.pos-qty[hidden] {
  display: none;
}
.pos-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.pos-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.pos-head .pos-channel {
  flex: 1;
}
.pos-lines {
  display: grid;
  align-content: start;
  min-height: 96px;
}
.pos-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.pos-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pos-stepper button {
  width: 40px;
  min-height: 40px;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
}
.pos-stepper span {
  min-width: 26px;
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
}
.pos-line-name {
  display: grid;
  gap: 1px;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.25;
}
.pos-line-name small {
  font-weight: 500;
}
.pos-link {
  justify-self: start;
  min-height: 24px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: underline;
}
.pos-hint {
  margin: auto 0;
  padding: 24px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 1.1rem;
}
.pos-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding-top: 8px;
  border-top: 2px solid var(--ink);
  font-size: 1.1rem;
  font-weight: 700;
}
.pos-total strong {
  font-size: 2rem;
  line-height: 1.1;
}
.pos-channel,
.pos-methods {
  display: grid;
  gap: 6px;
}
.pos-channel {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.pos-channel button {
  min-height: 40px;
  padding: 6px 4px;
  font-size: 0.88rem;
}
.pos-channel button[aria-pressed="true"] {
  border-color: var(--ink);
  background: #eef1eb;
  box-shadow: inset 0 0 0 1px var(--ink);
}
.pos-methods {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.pos-methods button,
.pos-cash-notes button {
  min-height: 52px;
  padding: 6px 4px;
}
.pos-methods button[aria-pressed="true"],
.pos-cash-notes button[aria-pressed="true"] {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.pos-cash-notes {
  display: flex;
  gap: 6px;
}
.pos-cash-notes > * {
  flex: 1 1 0;
  min-width: 0;
}
.pos-cash-notes button {
  font-size: 0.9rem;
  line-height: 1.15;
}
.pos-cash-notes input {
  flex-grow: 1.3;
  min-height: 52px;
}
.pos-change {
  margin: 0;
  font-size: 1.05rem;
}
.pos-change strong {
  font-size: 1.55rem;
}
.pos-change.short {
  color: #9b2d1a;
}
.pos-tip {
  margin: 0;
  color: var(--muted);
}
.pos-finish {
  display: grid;
  gap: 2px;
  min-height: 62px;
  border-radius: 12px;
  font-size: 1.25rem;
}
.pos-finish small {
  color: inherit;
  font-size: 0.88rem;
  font-weight: 600;
}
.pos-finish:disabled {
  cursor: not-allowed;
  opacity: 1;
  background: #e3e7e1;
  border-color: #e3e7e1;
  color: #3d4a41;
  font-size: 1.05rem;
}
.pos-extra-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.pos-alert,
.pos-done,
.pos-open {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 12px;
}
.pos-alert p,
.pos-done p,
.pos-open p,
.pos-open h2 {
  margin: 0;
}
.pos-alert {
  background: #fff4d8;
  color: #4d3d12;
}
.pos-done {
  background: #e3f3e3;
  color: #1d4d25;
}
.pos-done strong {
  font-size: 1.2rem;
}
.pos-done .pos-change-big {
  font-size: 1.6rem;
  font-weight: 800;
}
.pos-done button {
  justify-self: start;
}
.pos-open {
  background: #f4f6f2;
  border: 1px solid var(--line);
}
.pos-big {
  min-height: 56px;
  font-size: 1.1rem;
}
@media (min-width: 1051px) {
  body.pos-mode #app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  body.pos-mode header {
    padding: 6px 20px;
  }
  body.pos-mode header img {
    width: 34px;
    height: 34px;
  }
  body.pos-mode header .muted {
    display: none;
  }
  body.pos-mode .shell {
    flex: 1;
    min-height: 0;
  }
  body.pos-mode nav {
    overflow-y: auto;
  }
  body.pos-mode main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 12px 16px;
    overflow: hidden;
  }
  body.pos-mode .heading {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  body.pos-mode #workspace,
  body.pos-mode .pos {
    flex: 1;
    min-height: 0;
    height: 100%;
  }
  body.pos-mode .pos-catalog {
    min-height: 0;
  }
  body.pos-mode .pos-products {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }
  body.pos-mode .pos-side {
    min-height: 0;
    overflow-y: auto;
  }
  body.pos-mode .pos-lines {
    flex: 1 1 auto;
    overflow-y: auto;
  }
}
.total {
  font-size: 1.4rem;
  display: flex;
  justify-content: space-between;
  margin: 20px 0;
  font-weight: 750;
}
.stack {
  display: grid;
  gap: 14px;
}
.empty {
  padding: 30px;
  text-align: center;
  color: var(--muted);
}
.login {
  max-width: 420px;
  margin: 12vh auto;
  padding: 28px;
}
.login h1 {
  margin-bottom: 10px;
}
dialog {
  width: min(670px, 94vw);
  max-height: 90dvh;
  border: 0;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 18px 90px #0004;
}
dialog::backdrop {
  background: #10231999;
}
dialog h2 {
  margin-top: 0;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
}
.dialog-foot {
  display: flex;
  justify-content: end;
  gap: 10px;
  margin-top: 22px;
}
#notice {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 22px;
  border-radius: 12px;
  background: #173f2a;
  color: white;
  box-shadow: 0 5px 25px #0003;
  z-index: 99;
  max-width: 92vw;
  display: none;
}
#notice.visible {
  display: block;
}
#notice.error {
  background: #8b3027;
}
.warning {
  background: #fff4d8;
  color: #624f21;
  padding: 12px;
  border-radius: 8px;
}
.bars {
  display: grid;
  gap: 12px;
}
.bar {
  display: grid;
  grid-template-columns: 115px 1fr 110px;
  gap: 10px;
  align-items: center;
  font-size: 0.85rem;
}
.bar i {
  display: block;
  height: 12px;
  background: var(--accent);
  border-radius: 6px;
  min-width: 2px;
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 10px;
  top: 10px;
  z-index: 100;
  background: white;
  padding: 10px;
}
.loading {
  padding: 30px;
}
.secret {
  word-break: break-all;
  background: #f0f3ed;
  padding: 15px;
  user-select: all;
}
.receipt {
  font-family: monospace;
  max-width: 320px;
  margin: auto;
}
.receipt .row {
  justify-content: space-between;
}
.receipt h2 {
  text-align: center;
}
.receipt hr {
  border: 0;
  border-top: 1px dashed;
}
.compact {
  padding: 7px 10px;
  min-height: 36px;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px;
  margin: 0;
}
legend {
  font-weight: 700;
}
details > summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 650;
}
@media (max-width: 1050px) {
  .shell {
    grid-template-columns: 175px 1fr;
  }
  main {
    padding: 18px;
  }
  .pos {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 650px) {
  header {
    padding: 12px;
    align-items: start;
  }
  header .muted {
    display: none;
  }
  .shell {
    display: block;
  }
  nav {
    flex-direction: row;
    overflow: auto;
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 1px solid var(--line);
    padding: 8px;
  }
  nav button {
    white-space: nowrap;
  }
  main {
    padding: 15px;
  }
  .heading {
    align-items: start;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric {
    padding: 13px;
  }
  .metric strong {
    font-size: 1.25rem;
  }
  .pos-methods {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .pos-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bar {
    grid-template-columns: 80px 1fr 90px;
  }
  .login {
    margin: 6vh 15px;
  }
  .card {
    padding: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
@media print {
  body > * {
    display: none !important;
  }
  body > dialog[open] {
    display: block !important;
    position: static;
    width: 58mm;
    max-height: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
  }
  dialog > *:not(.receipt) {
    display: none !important;
  }
  .receipt {
    font-size: 10pt;
    max-width: 48mm;
  }
  button {
    display: none !important;
  }
}
