/* Logocar POS — Modern UI layer */

:root {
  --pos-radius: 8px;
  --pos-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --pos-bg: #eef1f5;
  --pos-surface: #ffffff;
  --pos-text: #1a1d23;
  --pos-text-muted: #5c6370;
  --pos-border: #dde2ea;
  --pos-input-bg: #f3f5f8;
  --pos-blue: #2563eb;
  --pos-blue-hover: #1d4ed8;
  --pos-orange: #ea580c;
  --pos-orange-hover: #c2410c;
  --pos-green: #16a34a;
  --pos-green-hover: #15803d;
  --pos-purple: #7c3aed;
  --pos-purple-hover: #6d28d9;
  --pos-gray: #64748b;
  --pos-gray-hover: #475569;
  --pos-danger: #dc2626;
  --pos-pay: #059669;
  --pos-pay-hover: #047857;
  --pos-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  --pos-shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.12);
}

html,
body {
  font-family: var(--pos-font);
  background: var(--pos-bg);
  color: var(--pos-text);
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

/* ── Dashboard shell ── */

.pos-dashboard {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  grid-template-columns: minmax(320px, 42%) 1fr;
  gap: 12px;
  padding: 12px;
  box-sizing: border-box;
  background: var(--pos-bg);
}

.pos-dashboard.hidden {
  display: none !important;
}

/* ── Screen 1: Receipt panel ── */

.lista {
  position: relative !important;
  float: none !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  border: none !important;
  border-radius: var(--pos-radius);
  background: var(--pos-surface);
  box-shadow: var(--pos-shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.receipt-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.receipt-panel__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.lista_talao {
  position: relative !important;
  flex: 0 0 auto;
  min-height: 0;
  margin: 0 !important;
  padding: 8px;
  height: 100% !important;
  width: auto !important;
  background: var(--pos-input-bg);
  border: none !important;
  border-radius: 0 !important;
  overflow: visible;
}

table.talao {
  margin-top: 0;
  border-collapse: collapse;
}

table.talao th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--pos-surface) !important;
  background-image: none !important;
  color: var(--pos-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.02em;
  height: auto;
  line-height: 1.4;
  padding: 8px 10px;
  border-bottom: 1px solid var(--pos-border);
}

table.talao td {
  padding: 4px 8px;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--pos-border);
  vertical-align: middle;
}

.linha {
  height: 24px !important;
}

.linha_escolhida {
  background: #fef3c7 !important;
}

.col_quant,
.col_preco {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.receipt-panel__footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 6px;
  border-top: 1px solid var(--pos-border);
  background: var(--pos-surface);
  display: flex;
  align-items: stretch;
  gap: 6px;
  flex-wrap: nowrap;
}

.receipt-actions {
  display: grid;
  grid-template-columns: repeat(4, 34px);
  gap: 4px;
  flex: 0 0 auto;
}

.receipt-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius);
  background: var(--pos-surface);
  color: var(--pos-text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.receipt-action svg {
  width: 16px;
  height: 16px;
}

.receipt-action:hover {
  background: var(--pos-input-bg);
  border-color: #c5cdd8;
}

.receipt-action--danger,
.receipt-action--cancel-order {
  color: var(--pos-danger);
  border-color: #fecaca;
  background: #fef2f2;
}

.receipt-action--danger:hover,
.receipt-action--cancel-order:hover {
  background: #fee2e2 !important;
  border-color: #fca5a5;
}

/* Confirm dialog */

#confirm_backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  background: rgba(15, 23, 42, 0.45);
}

#confirm_dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1101;
  display: none;
  width: min(400px, calc(100vw - 32px));
  padding: 20px;
  box-sizing: border-box;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius);
  box-shadow: var(--pos-shadow-lg);
  font-family: var(--pos-font);
}

#confirm_title {
  margin: 0 0 16px;
  padding: 0;
  color: var(--pos-text);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

#confirm_actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  text-align: center;
}

#confirm_actions button {
  min-height: 44px;
  margin: 0 !important;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--pos-radius);
  color: #fff;
  font-family: var(--pos-font);
  font-size: 0.9375rem;
  font-weight: 600;
  text-transform: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

#confirm_actions button.confirm-btn--danger {
  background: var(--pos-danger) !important;
  border-color: var(--pos-danger);
}

#confirm_actions button.confirm-btn--danger:hover {
  background: #b91c1c !important;
}

#confirm_actions button.confirm-btn--secondary {
  background: var(--pos-input-bg) !important;
  border-color: var(--pos-border);
  color: var(--pos-text) !important;
}

#confirm_actions button.confirm-btn--secondary:hover {
  background: var(--pos-surface) !important;
}

.receipt-total-block {
  flex: 1;
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}

.receipt-total {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8px;
  background: var(--pos-input-bg);
  border-radius: var(--pos-radius);
  border: 1px solid var(--pos-border);
  float: none !important;
  width: auto !important;
  min-height: 34px;
  height: 34px !important;
  line-height: 1.2 !important;
}

.receipt-total__value,
.valor_total {
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--pos-text);
  width: 100% !important;
  text-align: right !important;
}

.btn-pay {
  flex: 0 0 34px;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border: none;
  border-radius: var(--pos-radius);
  background: var(--pos-pay);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--pos-shadow);
  transition: background 0.15s, transform 0.1s;
}

.btn-pay svg {
  width: 20px;
  height: 20px;
}

.btn-pay:hover {
  background: var(--pos-pay-hover);
}

.btn-pay:active {
  transform: scale(0.98);
}

/* Line edit modal */

div.edicao_produto {
  position: absolute !important;
  inset: auto 12px 12px 12px !important;
  top: auto !important;
  left: 12px !important;
  width: auto !important;
  height: auto !important;
  padding: 16px;
  background: var(--pos-surface) !important;
  background-image: none !important;
  color: var(--pos-text) !important;
  border-radius: var(--pos-radius);
  box-shadow: var(--pos-shadow-lg);
  border: 1px solid var(--pos-border);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0;
  float: none !important;
}

.edicao_produto__header h3 {
  margin: 0 0 12px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.edicao_produto_quant,
.edicao_produto_preco,
.edicao_produto_obs {
  margin: 0 0 10px !important;
  display: flex;
  gap: 10px;
  float: none !important;
  clear: none !important;
}

.edicao_produto_quant,
.edicao_produto_preco {
  align-items: center;
}

.edicao_produto_obs {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.edicao_produto__label,
.edicao_produto_quant label,
.edicao_produto_preco label,
.edicao_produto_obs label {
  min-width: 56px;
  margin: 0 !important;
  font-size: 0.875rem;
  font-weight: 500;
  float: none !important;
  position: static !important;
  display: block;
}

.edicao_produto_obs .edicao_produto__label,
.edicao_produto_obs label {
  min-width: 0;
}

#edicao_produto_quant,
#edicao_produto_preco {
  width: auto !important;
  flex: 1;
  float: none !important;
}

#edicao_produto_obs {
  width: 100% !important;
  flex: 1;
  height: 72px !important;
  clear: none !important;
  float: none !important;
}

.edicao_produto_opcoes {
  display: flex;
  gap: 10px;
  margin-top: 4px !important;
  flex-shrink: 0;
  clear: both !important;
}

.edicao_produto_ok,
.edicao_produto_cancel {
  flex: 1;
  float: none !important;
  width: auto !important;
  height: 44px !important;
  line-height: 44px !important;
  border-radius: var(--pos-radius) !important;
  background-image: none !important;
  border: none !important;
  font-family: var(--pos-font);
  font-weight: 600;
}

.edicao_produto_ok {
  background: var(--pos-pay) !important;
}

.edicao_produto_cancel {
  background: var(--pos-input-bg) !important;
  color: var(--pos-text) !important;
  border: 1px solid var(--pos-border) !important;
}

/* ── Screen 1: Shortcuts panel ── */

.produtos {
  float: none !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0;
  overflow: hidden;
  background: transparent;
}

.shortcuts-panel {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 2px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shortcut-section {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  clear: both;
  position: relative;
  isolation: isolate;
}

.shortcut-section + .shortcut-section {
  padding-top: 10px;
  border-top: 1px solid var(--pos-border);
}

.shortcut-section__title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pos-text-muted);
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.shortcut-grid {
  display: grid;
  gap: 6px;
  width: 100%;
  clear: both;
}

.shortcut-grid.produtos_lista {
  height: auto !important;
  overflow: visible !important;
}

.shortcut-grid--favorites > .produto,
.shortcut-grid--categories > .categoria,
.shortcut-grid .produto,
.shortcut-grid .categoria {
  float: none !important;
  clear: none !important;
}

.shortcut-grid--favorites {
  grid-template-columns: repeat(3, 1fr);
}

.shortcut-grid--categories {
  grid-template-columns: repeat(3, 1fr);
}

/* Favorite product buttons (blue) — outer tile only, not nested label/wrapper */

.shortcut-grid--favorites > .produto,
.produtos_categoria_lista > .produto,
.produtos_categoria_lista > .adiciona_produto_categoria,
.pesquisa_produtos_lista > .adiciona_produto_pesquisa {
  float: none !important;
  width: auto !important;
  height: auto !important;
  min-height: 48px;
  margin: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: var(--pos-radius);
  border: none;
  background: var(--pos-blue) !important;
  background-image: none !important;
  box-shadow: var(--pos-shadow);
  transition: background 0.15s, transform 0.1s;
}

.shortcut-grid--favorites > .produto:hover,
.produtos_categoria_lista > .produto:hover,
.produtos_categoria_lista > .adiciona_produto_categoria:hover,
.pesquisa_produtos_lista > .adiciona_produto_pesquisa:hover {
  background: var(--pos-blue-hover) !important;
}

.produtos_categoria_lista > .adiciona_produto_categoria--added {
  background: var(--pos-green) !important;
}

.produtos_categoria_lista > .adiciona_produto_categoria--added:hover {
  background: var(--pos-green-hover) !important;
}

.shortcut-grid--favorites .descricao_produto,
.produtos_categoria_lista .descricao_produto,
.pesquisa_produtos_lista .descricao_produto {
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  height: auto !important;
  width: 100% !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}

.shortcut-grid--favorites label.produto,
.produtos_categoria_lista label.produto,
.pesquisa_produtos_lista label.produto {
  height: auto !important;
  line-height: 1.3 !important;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff !important;
  padding: 0;
  margin: 0;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  background-image: none !important;
  border-radius: 0 !important;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  cursor: pointer;
}

/* Category buttons (orange) — outer tile only */

.shortcut-grid--categories > .categoria {
  float: none !important;
  width: auto !important;
  height: auto !important;
  min-height: 42px;
  margin: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: var(--pos-radius);
  border: none;
  background: var(--pos-orange) !important;
  background-image: none !important;
  box-shadow: var(--pos-shadow);
  transition: background 0.15s;
}

.shortcut-grid--categories > .categoria:hover {
  background: var(--pos-orange-hover) !important;
}

.shortcut-grid--categories .descricao_categoria {
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  height: auto !important;
  width: 100% !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}

.shortcut-grid--categories label.categoria {
  height: auto !important;
  line-height: 1.3 !important;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff !important;
  padding: 0;
  margin: 0;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  background-image: none !important;
  border-radius: 0 !important;
  cursor: pointer;
}

/* Quick actions row */

.shortcut-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.shortcut-action,
div.produtos_anteriores,
div.produtos_guiablobal,
div.produtos_procurar {
  float: none !important;
  width: auto !important;
  height: auto !important;
  min-height: 52px;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: var(--pos-radius);
  border: none;
  box-shadow: var(--pos-shadow);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.shortcut-action svg,
div.produtos_anteriores svg,
div.produtos_guiablobal svg,
div.produtos_procurar svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.shortcut-action label,
div.produtos_anteriores label,
div.produtos_guiablobal label,
div.produtos_procurar label {
  height: auto !important;
  line-height: 1.25 !important;
  font-size: 0.6875rem !important;
  font-weight: 600;
  text-align: center;
  color: #fff !important;
  white-space: normal;
}

.shortcut-action--green,
div.produtos_anteriores {
  background: var(--pos-green) !important;
  background-image: none !important;
}

.shortcut-action--green:hover,
div.produtos_anteriores:hover {
  background: var(--pos-green-hover) !important;
}

.shortcut-action--purple,
div.produtos_guiablobal {
  background: var(--pos-purple) !important;
  background-image: none !important;
}

.shortcut-action--purple:hover,
div.produtos_guiablobal:hover {
  background: var(--pos-purple-hover) !important;
}

.shortcut-action--gray,
div.produtos_procurar {
  background: var(--pos-gray) !important;
  background-image: none !important;
}

.shortcut-action--gray:hover,
div.produtos_procurar:hover {
  background: var(--pos-gray-hover) !important;
}

/* Category product picker */

.produtos_categoria {
  position: fixed !important;
  inset: 0;
  z-index: 950;
  float: none !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 12px !important;
  box-sizing: border-box;
  background: var(--pos-bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-header {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-shrink: 0;
}

.category-header .filtro_produtos {
  flex: 1;
  float: none !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius);
}

.category-header .filtro_produtos svg {
  width: 18px;
  height: 18px;
  color: var(--pos-text-muted);
  flex-shrink: 0;
}

.category-header input.filtro_produtos {
  flex: 1;
  height: 48px !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0;
  font-size: 0.9375rem;
}

.produtos_categoria_lista {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  align-content: start;
}

/* ── Full-screen panels (product search, etc.) ── */

.pesquisa_produtos {
  position: fixed !important;
  inset: 0;
  z-index: 905;
  float: none !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: var(--pos-bg);
  overflow: hidden;
}

.panel-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 720px;
  margin: 0 auto;
  box-sizing: border-box;
}

.panel-shell__header {
  flex-shrink: 0;
  padding: 10px 10px 0;
}

.panel-shell__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px;
  align-content: start;
}

.panel-shell__footer {
  flex-shrink: 0;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--pos-surface);
  border-top: 1px solid var(--pos-border);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}

.panel-shell__footer--top {
  flex-shrink: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.panel-shell__voltar {
  width: 100%;
  min-height: 44px;
}

.panel-shell--data .panel-shell__voltar {
  width: auto;
  min-height: 40px;
  padding: 0 12px;
  white-space: nowrap;
}

.search-header .filtro_produtos {
  float: none !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius);
  box-shadow: var(--pos-shadow);
}

.search-header .filtro_produtos svg {
  width: 18px;
  height: 18px;
  color: var(--pos-text-muted);
  flex-shrink: 0;
}

.search-header input.filtro_produtos {
  flex: 1;
  height: 48px !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0;
  font-size: 0.9375rem;
}

.pesquisa_produtos_lista {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 8px !important;
  float: none !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
}

.pesquisa_produtos_lista > .adiciona_produto_pesquisa.hidden {
  display: none !important;
}

/* ── Data panel (documents, stocks, etc.) ── */

.dados {
  position: fixed !important;
  inset: 0;
  z-index: 905;
  float: none !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: var(--pos-bg);
  overflow: hidden;
}

.dados .panel-shell--data {
  max-width: 720px;
}

.docs-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.docs-header__row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.docs-header__row .docs-calendar {
  flex: 1;
  min-width: 0;
  width: auto !important;
}

.dados .nome_cliente,
.docs-header__title {
  margin: 0;
  width: auto !important;
  height: auto !important;
  line-height: 1.3 !important;
  padding: 0 !important;
  text-align: left;
  background: transparent !important;
  background-image: none !important;
  color: var(--pos-text) !important;
  font-family: var(--pos-font);
  font-size: 1rem;
  font-weight: 600;
}

.dados .painel_calendario,
.docs-calendar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100% !important;
  max-width: none;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
}

.docs-calendar__nav,
.dados .calendario_ant,
.dados .calendario_prox {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius);
  background: var(--pos-surface) !important;
  background-image: none !important;
  color: var(--pos-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.docs-calendar__nav svg {
  width: 18px;
  height: 18px;
}

.docs-calendar__nav:hover {
  background: var(--pos-input-bg) !important;
  border-color: #c5cdd8;
}

.docs-calendar__status {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius);
  background: var(--pos-surface);
  color: var(--pos-green);
  pointer-events: none;
}

.docs-calendar__status-icon {
  width: 18px;
  height: 18px;
}

.docs-calendar__status-icon--loading {
  display: none;
  color: var(--pos-blue);
}

.docs-calendar__status-icon--done {
  display: none;
}

.docs-calendar__status--idle .docs-calendar__status-icon--done {
  display: block;
  opacity: 0.25;
}

.docs-calendar__status--loading .docs-calendar__status-icon--loading {
  display: block;
  animation: docs-search-spin 0.8s linear infinite;
}

.docs-calendar__status--done .docs-calendar__status-icon--done {
  display: block;
  opacity: 1;
}

@keyframes docs-search-spin {
  to {
    transform: rotate(360deg);
  }
}

.docs-calendar__field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  min-height: 40px;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius);
  box-shadow: var(--pos-shadow);
}

.docs-calendar__label,
.dados .calendario_lbl {
  flex-shrink: 0;
  font-family: var(--pos-font);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--pos-text-muted);
}

.docs-calendar__input,
.dados #filtro_data,
.dados .calendario_input {
  flex: 1;
  min-width: 0;
  height: 40px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  color: var(--pos-text);
  font-family: var(--pos-font);
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.dados .detalhe_dados,
.docs-panel__body {
  height: auto !important;
  overflow-x: hidden;
  clear: none !important;
}

.dados .docs {
  width: 100% !important;
  max-width: none;
  margin: 0 !important;
}

.docs-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--pos-text-muted);
  font-size: 0.9375rem;
  background: var(--pos-surface);
  border: 1px dashed var(--pos-border);
  border-radius: var(--pos-radius);
}

.docs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.docs-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.85fr) minmax(0, 2fr) 44px 44px;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 0 10px;
  border-radius: var(--pos-radius);
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  box-shadow: var(--pos-shadow);
}

.docs-row--header {
  min-height: 36px;
  background: var(--pos-input-bg);
  border-color: var(--pos-border);
  box-shadow: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pos-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.docs-row--item {
  transition: border-color 0.15s, box-shadow 0.15s;
}

.docs-row--item:hover {
  border-color: #c5cdd8;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.docs-row.docs_linha {
  clear: none;
  height: auto;
}

.docs-row .docs_invoice,
.docs-row .docs_cliente {
  float: none;
  width: auto;
  height: auto;
  padding-left: 0;
}

.docs-col {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-col--doc,
.docs-col--client {
  display: flex;
  align-items: center;
}

.docs-col--doc span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  color: var(--pos-blue);
}

.docs-col--client span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  color: var(--pos-text);
}

.docs-col--email,
.docs-col--print,
.docs-col--action {
  display: flex;
  align-items: center;
  justify-content: center;
}

.docs-col--email {
  overflow: visible;
}

.docs-action,
.docs-print,
.docs-email,
.docs_imprime,
.docs_envia_email {
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius);
  background: var(--pos-input-bg) !important;
  background-image: none !important;
  color: var(--pos-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.docs-action svg,
.docs-print svg,
.docs-email svg {
  width: 18px;
  height: 18px;
}

.docs-email:hover {
  background: var(--pos-surface) !important;
  border-color: var(--pos-blue);
  color: var(--pos-blue);
}

.docs-print:hover {
  background: var(--pos-surface) !important;
  border-color: var(--pos-blue);
  color: var(--pos-blue);
}

/* Classic datagrid (Desenha) */

.clientes_lista .pos-datagrid-classic,
.dados .detalhe_dados .pos-datagrid-classic,
.div_details .pos-datagrid-classic {
  width: 100%;
  max-width: 100%;
}

.pos-datagrid-classic {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pos-datagrid-classic[data-grid="clientes"] {
  --pos-datagrid-classic-columns: minmax(88px, 0.75fr) minmax(0, 1fr);
}

.pos-datagrid-classic .wrapper {
  margin: 0;
  float: none;
  display: grid;
  grid-template-columns: var(
    --pos-datagrid-classic-columns,
    repeat(var(--pos-datagrid-classic-count, 2), minmax(0, 1fr))
  );
  gap: 8px;
  width: 100%;
  color: inherit;
}

.pos-datagrid-classic__header {
  padding: 10px;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius);
  box-shadow: var(--pos-shadow);
}

.pos-datagrid-classic__header .boxheader {
  margin: 0;
  padding: 0;
  background: transparent !important;
  background-image: none !important;
  color: var(--pos-text-muted) !important;
  border: none;
  border-radius: 0;
  font-family: var(--pos-font);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: left;
  cursor: default;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-datagrid-classic__filters {
  display: grid;
  grid-template-columns: var(
    --pos-datagrid-classic-columns,
    repeat(var(--pos-datagrid-classic-count, 2), minmax(0, 1fr))
  );
  gap: 8px;
  padding: 10px;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius);
  box-shadow: var(--pos-shadow);
}

.pos-datagrid-classic__filter {
  min-width: 0;
}

.pos-datagrid-classic__filter-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--pos-font);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--pos-text-muted);
}

.pos-datagrid-classic__filter-input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.875rem;
  box-sizing: border-box;
}

.pos-datagrid-classic__results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: visible;
}

.pos-datagrid-classic__row {
  min-height: 44px;
  padding: 0 10px;
  align-items: center;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius);
  box-shadow: var(--pos-shadow);
  transition: border-color 0.15s, background 0.15s;
}

.pos-datagrid-classic__row:hover {
  background: #f8fafc !important;
  border-color: #c5cdd8;
}

.pos-datagrid-classic__row.hidden {
  display: none !important;
}

.pos-datagrid-classic .box {
  margin: 0;
  padding: 8px 0;
  border-radius: 0;
  color: var(--pos-text) !important;
  font-family: var(--pos-font);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-datagrid-classic .col_Nome,
.pos-datagrid-classic .col_Designação,
.pos-datagrid-classic .col_Designacao {
  font-weight: 600;
}

.pos-datagrid-classic .col_Cliente {
  font-variant-numeric: tabular-nums;
  color: var(--pos-text-muted);
}

.pos-datagrid-classic__empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--pos-text-muted);
  font-size: 0.9375rem;
  background: var(--pos-surface);
  border: 1px dashed var(--pos-border);
  border-radius: var(--pos-radius);
}

.linha_datagrid_clientes {
  height: auto !important;
  min-height: 44px;
}

.clientes_lista {
  padding: 10px;
  box-sizing: border-box;
}

/* Datagrid inside data panel */

.dados .detalhe_dados .div_details {
  width: 100%;
}

.pos-datagrid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-width: var(--pos-datagrid-width, auto);
}

.pos-datagrid__filters {
  display: grid;
  grid-template-columns: repeat(var(--pos-datagrid-filters-mobile-cols, 2), minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius);
  box-shadow: var(--pos-shadow);
}

.pos-datagrid__empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--pos-text-muted);
  font-size: 0.9375rem;
  background: var(--pos-surface);
  border: 1px dashed var(--pos-border);
  border-radius: var(--pos-radius);
}

.pos-datagrid__filter {
  min-width: 0;
}

.pos-datagrid__filter--primary {
  grid-column: 1 / -1;
  order: -1;
}

.pos-datagrid__filter-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--pos-text-muted);
}

.pos-datagrid__filter-input {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.875rem;
}

.pos-datagrid__header {
  display: none;
  grid-template-columns: repeat(var(--pos-datagrid-columns, 1), minmax(0, 1fr));
  gap: 8px;
  padding: 0 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pos-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pos-datagrid__header-cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-datagrid__results {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pos-datagrid__row {
  display: grid;
  grid-template-columns: repeat(var(--pos-datagrid-filters-mobile-cols, 2), minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius);
  box-shadow: var(--pos-shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pos-datagrid__row:hover {
  border-color: #c5cdd8;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.pos-datagrid__row.hidden {
  display: none !important;
}

.pos-datagrid__cell {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.pos-datagrid__cell--primary {
  grid-column: 1 / -1;
  order: -1;
}

.pos-datagrid__cell-label {
  flex-shrink: 0;
  max-width: none;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35rem;
  color: var(--pos-text-muted);
}

.pos-datagrid__cell-label::after {
  content: ':';
}

.pos-datagrid__cell-value {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35rem;
  color: var(--pos-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-datagrid__cell--primary .pos-datagrid__cell-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--pos-blue);
  white-space: normal;
}

.pos-datagrid__totals {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.pos-datagrid__total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius);
}

.pos-datagrid__total-row--emphasis {
  background: var(--pos-input-bg);
  font-weight: 600;
}

.pos-datagrid__total-label {
  font-size: 0.875rem;
  color: var(--pos-text-muted);
}

.pos-datagrid__total-value {
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  color: var(--pos-text);
}

@media (min-width: 901px) {
  .pos-datagrid {
    margin-inline: auto;
  }

  .pos-datagrid__filters,
  .pos-datagrid__header,
  .pos-datagrid__row {
    grid-template-columns: var(--pos-datagrid-template-columns, repeat(var(--pos-datagrid-columns, 1), minmax(0, 1fr)));
  }

  .pos-datagrid__filters {
    display: grid;
  }

  .pos-datagrid__header {
    display: grid;
  }

  .pos-datagrid__results {
    gap: 4px;
  }

  .pos-datagrid__row {
    display: grid;
    gap: 8px;
    align-items: center;
    padding: 0 10px;
    min-height: 44px;
  }

  .pos-datagrid__cell {
    display: block;
  }

  .pos-datagrid__cell--primary {
    grid-column: auto;
    order: 0;
  }

  .pos-datagrid__filter--primary {
    grid-column: auto;
    order: 0;
  }

  .pos-datagrid__cell-label {
    display: none;
  }

  .pos-datagrid__cell-value {
    text-align: left;
    white-space: nowrap;
  }

  .pos-datagrid__cell--primary .pos-datagrid__cell-value {
    white-space: nowrap;
  }
}

.dados .detalhe_dados table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
}

.dados .detalhe_dados .linha_datagrid,
.dados .detalhe_dados tr {
  background: var(--pos-surface);
}

/* ── Screen 2: Checkout ── */

.detalhe {
  position: fixed !important;
  inset: 0;
  z-index: 920;
  overflow: hidden;
  background: var(--pos-bg);
}

.checkout-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 640px;
  margin: 0 auto;
}

.checkout-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 10px 0;
}

.checkout-scroll-spacer {
  height: 72px;
}

.checkout-section {
  background: var(--pos-surface);
  border-radius: var(--pos-radius);
  border: 1px solid var(--pos-border);
  box-shadow: var(--pos-shadow);
  padding: 12px;
  margin-bottom: 10px;
}

.checkout-section__title {
  margin: 0 0 10px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.field-group {
  margin-bottom: 10px;
}

.field-group:last-child {
  margin-bottom: 0;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--pos-text-muted);
}

.field-row {
  display: grid;
  gap: 12px;
}

.field-row--2 {
  grid-template-columns: 1fr 1.4fr;
}

.nif-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.nif-row .nif {
  flex: 1 1 auto;
  width: auto;
  min-width: 10.5ch;
  min-height: 0;
  padding: 10px 8px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.nif-row .btn-nif {
  margin-left: auto;
}

.nif-row .pos-btn--compact {
  flex: 0 0 auto;
  align-self: stretch;
  min-height: 0;
  height: auto;
  padding: 0 5px;
  font-size: 0.8125rem;
  gap: 3px;
  white-space: nowrap;
}

.nif-row .pos-btn--compact svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.pos-input,
.pos-textarea,
.pos-select {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-family: var(--pos-font);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--pos-text);
  background: var(--pos-input-bg) !important;
  border: 1px solid var(--pos-border) !important;
  border-radius: var(--pos-radius) !important;
  box-shadow: none !important;
  transition: border-color 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.pos-input:focus,
.pos-textarea:focus,
.pos-select:focus {
  outline: none;
  border-color: var(--pos-blue) !important;
  background: var(--pos-surface) !important;
}

.pos-textarea {
  min-height: 72px;
  resize: vertical;
}

.pos-select {
  padding-right: 40px;
  cursor: pointer;
  height: auto;
  min-height: 46px;
}

.select-wrap {
  position: relative;
}

.select-wrap__icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--pos-text-muted);
  pointer-events: none;
}

select.pais {
  background-image: none !important;
}

.cliente-badge {
  margin-top: 10px;
  padding: 10px 14px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--pos-radius);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cliente-badge__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #047857;
}

.cliente-badge__value,
.lbl_cliente {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--pos-text);
  line-height: 1.4 !important;
  width: auto !important;
}

/* POS buttons */

.pos-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--pos-radius);
  font-family: var(--pos-font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.pos-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.pos-btn--secondary {
  background: var(--pos-surface);
  border-color: var(--pos-border);
  color: var(--pos-text);
}

.pos-btn--secondary:hover {
  background: var(--pos-input-bg);
}

.pos-btn--ghost {
  width: 100%;
  margin-top: 8px;
  background: transparent;
  border: 1px dashed var(--pos-border);
  color: var(--pos-blue);
}

.pos-btn--ghost:hover {
  background: #eff6ff;
  border-color: var(--pos-blue);
}

.pos-btn--confirm {
  background: var(--pos-pay);
  color: #fff;
  border: none;
  min-height: 44px;
  font-size: 0.9375rem;
}

.pos-btn--confirm:hover {
  background: var(--pos-pay-hover);
}

.pos-btn--cancel {
  background: var(--pos-surface);
  color: var(--pos-text);
  border: 1px solid var(--pos-border);
  min-height: 44px;
  font-size: 0.9375rem;
}

.pos-btn--cancel:hover {
  background: var(--pos-input-bg);
}

/* Document type buttons */

.checkout-section--docs {
  padding-bottom: 12px;
}

.doc-groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc-group__title {
  margin: 0 0 6px;
  font-size: 0.6875rem;
}

.doc-group__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.doc-type-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 8px;
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius);
  background: var(--pos-input-bg);
  color: var(--pos-text);
  font-family: var(--pos-font);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.doc-type-btn__icon svg {
  width: 16px;
  height: 16px;
  color: var(--pos-orange);
  flex-shrink: 0;
}

.doc-type-btn__label {
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
}

.doc-type-btn:hover {
  border-color: #fdba74;
  background: #fff7ed;
}

.doc-type-btn--active {
  border-color: var(--pos-orange);
  background: #fff7ed;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
}

.doc-type-btn--active .doc-type-btn__icon svg {
  color: var(--pos-orange);
}

.checkout-footer {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: var(--pos-surface);
  border-top: 1px solid var(--pos-border);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}

.campo_errado {
  border-color: var(--pos-danger) !important;
  background: #fef2f2 !important;
}

/* ── Main menu refresh ── */

div.menu_lista {
  width: min(480px, 100%);
  padding: 16px;
  box-sizing: border-box;
}

div.opcao_menu label {
  background: var(--pos-blue) !important;
  background-image: none !important;
  border: none !important;
  border-radius: var(--pos-radius) !important;
  color: #fff !important;
  font-family: var(--pos-font);
  font-size: 0.9375rem !important;
  font-weight: 600;
  height: 56px !important;
  line-height: 56px !important;
  padding-top: 0 !important;
  margin-bottom: 10px !important;
  box-shadow: var(--pos-shadow);
}

div.opcao_menu label:hover {
  background: var(--pos-blue-hover) !important;
}

div.separador_menu label {
  font-family: var(--pos-font);
  font-weight: 600;
  color: var(--pos-text-muted);
}

/* Login form */

.login-form form {
  border-radius: var(--pos-radius) !important;
  font-family: var(--pos-font);
}

.login-form .form-control,
.login-form .btn {
  border-radius: var(--pos-radius) !important;
}

/* Remove debug orientation backgrounds */

@media only screen and (max-device-width: 1024px) and (orientation: landscape),
       only screen and (max-device-width: 1024px) and (orientation: portrait) {
  body {
    background-color: var(--pos-bg) !important;
  }
}

/* ── Responsive: mobile-first ── */

@media (max-width: 900px) {
  .pos-dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(200px, 38vh) 1fr;
    padding: 6px;
    gap: 6px;
  }

  .shortcuts-panel {
    gap: 10px;
    padding: 0 0 10px;
  }

  .shortcut-grid--favorites,
  .shortcut-grid--categories,
  .produtos_categoria_lista,
  .pesquisa_produtos_lista {
    grid-template-columns: repeat(2, 1fr);
  }

  .shortcut-actions {
    grid-template-columns: 1fr;
  }

  .receipt-actions {
    grid-template-columns: repeat(4, 32px);
  }

  .receipt-action {
    width: 32px;
    min-height: 32px;
  }

  .receipt-total,
  .btn-pay {
    min-height: 32px;
    height: 32px !important;
  }

  .btn-pay {
    flex-basis: 32px;
    width: 32px;
  }

  .nif-row {
    gap: 4px;
  }

  .nif-row .pos-btn--compact {
    padding: 0 4px;
    font-size: 0.75rem;
  }

  .nif-row .pos-btn--compact svg {
    width: 14px;
    height: 14px;
  }

  .field-row--2 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .shortcut-grid--favorites,
  .shortcut-grid--categories {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 901px) {
  .checkout-shell {
    max-width: 720px;
  }
}
