/* Definição de Variáveis de Cor Corporativas */
:root {
  --fgs-primary-dark: #0f172a; /* O azul escuro do teu painel principal */
  --fgs-accent: #6366f1;       /* O roxo elegante usado para links e destaques */
  --fgs-bg-light: #f8fafc;     /* O fundo cinza claro ultra confortável */
  --fgs-danger: #ef4444;       /* Vermelho discreto para ações destrutivas */
  --fgs-border-radius: 8px;    /* Arredondamento suave e moderno */
}

/* Estrutura do Painel Lateral */
.fgs-sidebar-checkout {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #ffffff;
  border-left: 1px solid #e2e8f0;
  padding: 16px;
}

/* Área de Scrolling da Lista de Itens */
.fgs-checkout-items-list {
  flex: 1;
  overflow-y: auto;
  margin-top: 12px;
  margin-bottom: 16px;
}

/* Bloco de Resumo */
.fgs-checkout-summary {
  background-color: var(--fgs-bg-light);
  border-radius: var(--fgs-border-radius);
  padding: 16px;
}

.fgs-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
}

.fgs-total-row {
  font-size: 18px;
  font-weight: 700;
  color: var(--fgs-primary-dark);
}

/* Botões Modernizados e Corporativos */
.fgs-checkout-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.fgs-btn-primary {
  background-image: linear-gradient(to right, #1e293b, var(--fgs-primary-dark));
  color: #ffffff;
  border: none;
  padding: 14px;
  border-radius: var(--fgs-border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fgs-actions-grid-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.fgs-btn-secondary {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 10px;
  border-radius: var(--fgs-border-radius);
  cursor: pointer;
  font-size: 13px;
}

.fgs-btn-danger:hover {
  color: var(--fgs-danger);
  border-color: var(--fgs-danger);
}

/* Ergonomia de Quantidade no Carrinho (POS Tátil) */
#cartList button[data-act="minus"],
#cartList button[data-act="plus"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--fgs-primary-dark, #0f172a);
  background-color: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

#cartList button[data-act="minus"]:hover,
#cartList button[data-act="plus"]:hover {
  background-color: #e2e8f0;
  border-color: #cbd5e1;
}

#cartList button[data-act="minus"]:active,
#cartList button[data-act="plus"]:active {
  background-color: #cbd5e1;
  transform: scale(0.95);
}

/* Espaçamento e alinhamento do bloco de quantidade */
#cartList div.mt-1.flex {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  margin-top: 6px !important;
  margin-right: 4px !important;
}

#cartList .pdv-cart-qty {
  height: 32px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  text-align: center;
  font-size: 13px;
}

#cartList .text-xs.font-medium.text-slate-700 {
  font-size: 12px;
  color: #475569;
  font-weight: 600;
  margin-right: 4px;
}

/**
 * FGS — polimento visual partilhado (cartões zinc, overlays com transição, modais).
 * Usar: <html lang="pt-PT" class="fgs-polish"> e <link rel="stylesheet" href="fgs-ui-polish.css" /> no <head>
 * (ou import no bundle Vite). Inclui regras para #backdrop / #backdropServico em produtos.html.
 */

/* View Transitions API — navegação MPA mesma origem (Chrome 126+, Edge 126+); browsers antigos ignoram. */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.32s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

html.fgs-polish {
  -webkit-font-smoothing: antialiased;
}

/* Tipografia global (alinha com o "Nova reserva" / Inter) */
html.fgs-polish,
html.fgs-polish body {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    "Apple Color Emoji",
    "Segoe UI Emoji";
}

/* ——— Overlays: fade em vez de display:none (mantém flex para animar o painel) ——— */
html.fgs-polish .backdrop,
html.fgs-polish .backdrop-rq,
html.fgs-polish .preck-backdrop {
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
html.fgs-polish .backdrop.show,
html.fgs-polish .backdrop-rq.show,
html.fgs-polish .preck-backdrop.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Entrada do painel modal */
html.fgs-polish .backdrop .modal,
html.fgs-polish .backdrop-rq .modal-rq {
  transform: scale(0.97) translateY(10px);
  opacity: 0;
  transition:
    transform 0.26s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.22s ease,
    box-shadow 0.2s ease;
}
html.fgs-polish .backdrop.show .modal,
html.fgs-polish .backdrop-rq.show .modal-rq {
  transform: scale(1) translateY(0);
  opacity: 1;
}

html.fgs-polish .preck-backdrop .preck-modal {
  transform: scale(0.98) translateY(8px);
  opacity: 0;
  transition:
    transform 0.24s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.2s ease;
}
html.fgs-polish .preck-backdrop.show .preck-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Base do modal "rq" (reservas.html) */
html.fgs-polish .modal-rq {
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e4e4e7; /* zinc-200 */
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
html.fgs-polish .modal-rq-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

/* Cabeçalhos / rodapés de modal */
html.fgs-polish .modal-h,
html.fgs-polish .modal-rq-h {
  padding: 16px 20px;
  border-bottom: 1px solid #e4e4e7 !important;
  background: rgba(250, 250, 250, 0.92);
  font-weight: 600;
  color: #18181b;
}
html.fgs-polish .modal-h strong,
html.fgs-polish .modal-rq-h strong {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #18181b;
}
html.fgs-polish .modal-f,
html.fgs-polish .modal-rq-f {
  padding: 14px 20px;
  border-top: 1px solid #e4e4e7 !important;
  background: rgba(250, 250, 250, 0.72);
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 12px !important;
}
html.fgs-polish .modal-f .btn,
html.fgs-polish .modal-rq-f .btn {
  min-height: 36px;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.875rem;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}
html.fgs-polish .modal-f .btn:not(.primary):not(.btn--primary),
html.fgs-polish .modal-rq-f .btn:not(.primary):not(.btn--primary) {
  border-color: #e4e4e7;
  background: #fff;
  color: #18181b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
html.fgs-polish .modal-f .btn:not(.primary):not(.btn--primary):hover,
html.fgs-polish .modal-rq-f .btn:not(.primary):not(.btn--primary):hover {
  background: #f4f4f5;
  border-color: #d4d4d8;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}
html.fgs-polish .modal-f .btn.primary,
html.fgs-polish .modal-rq-f .btn.primary,
html.fgs-polish .modal-f .btn.btn--primary,
html.fgs-polish .modal-rq-f .btn.btn--primary {
  border-color: #18181b !important;
  background: #18181b !important;
  color: #fafafa !important;
}
html.fgs-polish .modal-f .btn.primary:hover,
html.fgs-polish .modal-rq-f .btn.primary:hover,
html.fgs-polish .modal-f .btn.btn--primary:hover,
html.fgs-polish .modal-rq-f .btn.btn--primary:hover {
  background: #27272a !important;
  border-color: #27272a !important;
}

/* Detalhes da reserva — tabelas e secções dentro do modal rq */
html.fgs-polish .modal-rq-body .det-reserva-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
html.fgs-polish .modal-rq-body .det-reserva-table th {
  text-align: left;
  width: 36%;
  max-width: 260px;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid #e4e4e7; /* zinc-200 */
  color: #71717a; /* zinc-500 */
  font-weight: 600;
  vertical-align: top;
}
html.fgs-polish .modal-rq-body .det-reserva-table td {
  padding: 10px 0;
  border-bottom: 1px solid #e4e4e7; /* zinc-200 */
  word-break: break-word;
  color: #18181b; /* zinc-900 */
}
html.fgs-polish .modal-rq-body .det-reserva-pre {
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  background: #fafafa; /* zinc-50 */
  border: 1px solid #e4e4e7; /* zinc-200 */
  border-radius: 10px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
html.fgs-polish .modal-rq-body .rq-section {
  margin-bottom: 18px;
}
html.fgs-polish .modal-rq-body .rq-section h3 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #18181b; /* zinc-900 */
}
html.fgs-polish .modal-rq-body .rq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
@media (max-width: 700px) {
  html.fgs-polish .modal-rq-body .rq-grid {
    grid-template-columns: 1fr;
  }
}
html.fgs-polish .modal-rq-body .rq-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 14px;
}
@media (max-width: 700px) {
  html.fgs-polish .modal-rq-body .rq-grid-3 {
    grid-template-columns: 1fr;
  }
}
html.fgs-polish .modal-rq-body .rq-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #3f3f46; /* zinc-700 */
  margin-bottom: 6px;
}

/* Botão primário fora de modal (ex.: reservas) */
html.fgs-polish .btn.btn--primary:not(.btn--ghost) {
  border-color: #18181b !important;
  background: #18181b !important;
  color: #fafafa !important;
}
html.fgs-polish .btn.btn--primary:not(.btn--ghost):hover {
  background: #27272a !important;
  border-color: #27272a !important;
}
html.fgs-polish .btn:not(.primary):not(.btn--primary):not(.btn--ghost):hover {
  background: #f8fafc;
  border-color: #d4d4d8;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}
html.fgs-polish .btn:not(.primary):not(.btn--primary):not(.btn--ghost):active,
html.fgs-polish .modal-f .btn:not(.primary):not(.btn--primary):active,
html.fgs-polish .modal-rq-f .btn:not(.primary):not(.btn--primary):active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.07);
}

/* Pré-check-in */
html.fgs-polish .preck-head {
  background: rgba(250, 250, 250, 0.92);
  border-bottom-color: #e4e4e7;
}

/* Campos em formulários de modal / pré-check-in */
html.fgs-polish .modal-b input:not([type='checkbox']):not([type='radio']),
html.fgs-polish .modal-b select,
html.fgs-polish .modal-b textarea,
html.fgs-polish .modal-body-scroll input:not([type='checkbox']):not([type='radio']),
html.fgs-polish .modal-body-scroll select,
html.fgs-polish .modal-body-scroll textarea,
html.fgs-polish .modal-rq-body input:not([type='checkbox']):not([type='radio']),
html.fgs-polish .modal-rq-body select,
html.fgs-polish .modal-rq-body textarea,
html.fgs-polish .preck-body input:not([type='checkbox']):not([type='radio']),
html.fgs-polish .preck-body select,
html.fgs-polish .preck-body textarea {
  width: 100% !important;
  height: 38px !important;
  padding: 8px 12px !important;
  font-size: 13.5px !important;
  border-radius: 6px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #1c1917 !important;
  box-sizing: border-box !important;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.02),
    0 1px 2px rgba(0, 0, 0, 0.04) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

html.fgs-polish .modal-b textarea,
html.fgs-polish .modal-body-scroll textarea,
html.fgs-polish .modal-rq-body textarea,
html.fgs-polish .preck-body textarea {
  height: auto !important;
  min-height: 80px !important;
}

html.fgs-polish .modal-b select,
html.fgs-polish .modal-body-scroll select,
html.fgs-polish .modal-rq-body select,
html.fgs-polish .preck-body select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2371717a' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
  background-position: right 0.75rem center !important;
  background-repeat: no-repeat !important;
  background-size: 1.25em 1.25em !important;
  padding-right: 2.5rem !important;
  cursor: pointer !important;
}
html.fgs-polish .modal-b input::placeholder,
html.fgs-polish .modal-b textarea::placeholder,
html.fgs-polish .modal-body-scroll input::placeholder,
html.fgs-polish .modal-body-scroll textarea::placeholder,
html.fgs-polish .modal-rq-body input::placeholder,
html.fgs-polish .modal-rq-body textarea::placeholder,
html.fgs-polish .preck-body input::placeholder,
html.fgs-polish .preck-body textarea::placeholder {
  color: #71717a; /* zinc-500 */
}
html.fgs-polish .modal-b input:focus,
html.fgs-polish .modal-b select:focus,
html.fgs-polish .modal-b textarea:focus,
html.fgs-polish .modal-body-scroll input:focus,
html.fgs-polish .modal-body-scroll select:focus,
html.fgs-polish .modal-body-scroll textarea:focus,
html.fgs-polish .modal-rq-body input:focus,
html.fgs-polish .modal-rq-body select:focus,
html.fgs-polish .modal-rq-body textarea:focus,
html.fgs-polish .preck-body input:focus,
html.fgs-polish .preck-body select:focus,
html.fgs-polish .preck-body textarea:focus {
  border-color: #a1a1aa !important;
  box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.08) !important;
  outline: none !important;
}

/* Cartões lista (clientes, equipa, reservas, …) */
html.fgs-polish .card {
  border: none;
  border-radius: 12px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 2px 4px -1px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}
html.fgs-polish .card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.08),
    0 4px 6px -2px rgba(0, 0, 0, 0.04);
}
html.fgs-polish .card-h h2 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #18181b;
}

html.fgs-polish .btn.primary {
  border-color: #18181b;
  background: #18181b;
  color: #fafafa;
}
html.fgs-polish .btn.primary:hover {
  background: #27272a;
  border-color: #27272a;
}

/* Listagens com scroll */
html.fgs-polish .clientes-list-wrap,
html.fgs-polish .reservas-tbl-scroll {
  scrollbar-width: thin;
  scrollbar-color: #d4d4d8 transparent;
}
html.fgs-polish .clientes-list-wrap::-webkit-scrollbar,
html.fgs-polish .reservas-tbl-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
html.fgs-polish .clientes-list-wrap::-webkit-scrollbar-thumb,
html.fgs-polish .reservas-tbl-scroll::-webkit-scrollbar-thumb {
  background: #d4d4d8;
  border-radius: 999px;
}

/* Tabelas simples dentro do cartão (sem forçar hover em .tbl-reservas com cores de estado) */
html.fgs-polish main .card .table-wrap tbody tr:hover td {
  background: #fafafa;
}

/* Secções principais Tailwind (documentos, vendas, auditoria, pedidos…) */
html.fgs-polish main section.rounded-2xl.border.border-slate-200.bg-white,
html.fgs-polish main > div.mb-4.rounded-2xl.border.border-slate-200.bg-white {
  border-color: #e4e4e7;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 10px 32px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.22s ease, border-color 0.2s ease;
}
html.fgs-polish main section.rounded-2xl.border.border-slate-200.bg-white:hover,
html.fgs-polish main > div.mb-4.rounded-2xl.border.border-slate-200.bg-white:hover {
  border-color: #d4d4d8;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.05),
    0 14px 40px rgba(15, 23, 42, 0.08);
}

/* Painéis tipo cartão sem .mb-4 (ex.: 2.º bloco do main em auditoria) */
html.fgs-polish main > div.rounded-2xl.border.border-slate-200.bg-white.shadow-sm:not(.mb-4) {
  border-color: #e4e4e7;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 10px 32px rgba(15, 23, 42, 0.06);
  transition:
    box-shadow 0.22s ease,
    border-color 0.2s ease;
}
html.fgs-polish main > div.rounded-2xl.border.border-slate-200.bg-white.shadow-sm:not(.mb-4):hover {
  border-color: #d4d4d8;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.05),
    0 14px 40px rgba(15, 23, 42, 0.08);
}

/* Cartões do painel (index) */
html.fgs-polish main .fgs-dash-card {
  border-color: #e4e4e7;
  transition: box-shadow 0.22s ease, border-color 0.2s ease;
}

/* Login: campos do formulário */
html.fgs-polish .panel-form input:not([type='checkbox']),
html.fgs-polish .panel-form select {
  border-radius: 6px;
  border-color: #e4e4e7;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
html.fgs-polish .panel-form input:focus,
html.fgs-polish .panel-form select:focus {
  border-color: #a1a1aa;
  box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.08);
  outline: none;
}

/* Botão Sair (toolbar) */
html.fgs-polish #btnSair {
  min-height: 2.5rem;
  padding-inline: 1rem;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

/* produtos.html: manter modais de produto/serviço centrados com o mesmo ficheiro */
html.fgs-polish #backdrop,
html.fgs-polish #backdropServico {
  align-items: center;
}

/* ——— Painel "legacy" (clientes/produtos/equipa/…): tabela, botões e modais ——— */
html.fgs-polish .actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* Botões (fora de modais) — manter estética zinc */
html.fgs-polish .btn {
  appearance: none;
  border: 1px solid #e4e4e7; /* zinc-200 */
  background: #fff;
  color: #18181b; /* zinc-900 */
  padding: 9px 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}
html.fgs-polish .btn:hover {
  background: #f4f4f5; /* zinc-100 */
  border-color: #d4d4d8; /* zinc-300 */
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}
html.fgs-polish .btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.07);
}
html.fgs-polish .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
html.fgs-polish .btn.primary {
  border-color: #18181b;
  background: #18181b;
  color: #fafafa;
}
html.fgs-polish .btn.primary:hover {
  background: #27272a;
  border-color: #27272a;
}
html.fgs-polish .btn.danger {
  border-color: rgba(185, 28, 28, 0.4);
  background: rgba(185, 28, 28, 0.08);
  color: #991b1b;
}
html.fgs-polish .btn.danger:hover {
  background: rgba(185, 28, 28, 0.12);
  border-color: rgba(185, 28, 28, 0.55);
}

/* Tabelas genéricas em .table-wrap */
html.fgs-polish .table-wrap {
  overflow-x: auto;
}
html.fgs-polish .table-wrap table {
  width: 100%;
  border-collapse: collapse;
}
html.fgs-polish .table-wrap th,
html.fgs-polish .table-wrap td {
  text-align: left;
  padding: 12px 12px;
  border-bottom: 1px solid #e4e4e7; /* zinc-200 */
  font-size: 13px;
  vertical-align: top;
}
html.fgs-polish .table-wrap th {
  font-size: 12px;
  color: #71717a; /* zinc-500 */
  font-weight: 600;
  letter-spacing: -0.01em;
}
html.fgs-polish .table-wrap tr:hover td {
  background: #fafafa; /* zinc-50 */
}

/* Modais "legacy" (.backdrop) e reservas (.backdrop-rq) */
html.fgs-polish .backdrop,
html.fgs-polish .backdrop-rq {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  align-items: center;
  justify-content: center;
  padding: 18px;
  padding-top: max(18px, env(safe-area-inset-top));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 30000;
}
html.fgs-polish .modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e4e4e7; /* zinc-200 */
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
html.fgs-polish .modal.modal-scrollable {
  /* Explicit, para páginas legacy que usam esta classe */
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 36px);
}
html.fgs-polish .modal.modal-scrollable .modal-form-scroll {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
html.fgs-polish .modal.modal-scrollable .modal-body-scroll {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
html.fgs-polish .modal.modal-scrollable .modal-f {
  flex-shrink: 0;
}
html.fgs-polish .modal-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
html.fgs-polish .modal-b {
  padding: 16px 20px;
  overflow-y: auto;
  min-height: 0;
  flex: 1 1 auto;
}

/* Labels e layout de formulários dentro de modais legacy (alinha com Nova reserva) */
html.fgs-polish .modal-b label,
html.fgs-polish .modal-body-scroll label,
html.fgs-polish .modal-rq-body label,
html.fgs-polish .preck-body label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #3f3f46; /* zinc-700 */
  margin-bottom: 6px;
}
html.fgs-polish .modal-h .modal-x {
  appearance: none;
  border: 1px solid #e4e4e7;
  background: #fff;
  color: #3f3f46;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
html.fgs-polish .modal-h .modal-x:hover {
  background: #f4f4f5;
  border-color: #d4d4d8;
  transform: translateY(-1px);
}
html.fgs-polish .modal-h .modal-x:active {
  transform: translateY(0);
}

/* Larguras padrão para modais legacy (substitui style="max-width: …") */
html.fgs-polish .modal.modal-w-520 { max-width: 520px; }
html.fgs-polish .modal.modal-w-700 { max-width: 700px; }
html.fgs-polish .modal.modal-w-720 { max-width: 720px; }
html.fgs-polish .modal.modal-w-760 { max-width: 760px; }
html.fgs-polish .modal.modal-w-860 { max-width: 860px; }
html.fgs-polish .modal.modal-w-920 { max-width: 920px; }

/* ——— Reservas (reservas.html): tabela + pesquisa no mesmo "polish" ——— */
html.fgs-polish .reservas-lista-head h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #18181b; /* zinc-900 */
}

/* Higienização visual da tabela de reservas */
html.fgs-polish .tbl-reservas td {
  text-decoration: none !important;
}

html.fgs-polish .tbl-reservas td.td-hospede-clean {
  text-decoration: none !important;
  font-weight: 500;
  color: #1e293b;
}

html.fgs-polish .tbl-reservas td a,
html.fgs-polish .tbl-reservas td button {
  text-decoration: none !important;
}

/* Check-in / out empilhado verticalmente sem desalinhamento */
html.fgs-polish .tbl-reservas td:nth-child(7) {
  font-family: monospace;
  font-size: 11px;
  white-space: pre-line;
  line-height: 1.4;
  text-align: center;
}

/* Badges elegantes para o Estado */
html.fgs-polish .tbl-reservas td:nth-child(10) {
  text-align: center;
}

html.fgs-polish .tbl-reservas td:nth-child(10) span,
html.fgs-polish .tbl-reservas td:nth-child(10) {
  text-decoration: none !important;
}

/* Alinhamento e centralização dos botões de acção */
html.fgs-polish .tbl-reservas td.td-accoes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  padding: 8px 12px;
}

html.fgs-polish .tbl-reservas td.td-accoes button {
  margin: 0 !important;
  height: 28px !important;
  line-height: 28px !important;
  padding: 0 10px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* Consistência dos botões superiores */
html.fgs-polish #btnEditarReserva {
  background-color: #1e293b !important;
  border-color: #1e293b !important;
  color: #ffffff !important;
}

html.fgs-polish #btnEditarReserva:hover {
  background-color: #0f1b33 !important;
  border-color: #0f1b33 !important;
}

html.fgs-polish .reservas-lista-acoes .btn {
  border-radius: 8px !important;
  transition: all 0.15s ease-in-out;
}

html.fgs-polish .reservas-search {
  margin: 0 0 10px 0;
  max-width: 380px;
}
html.fgs-polish .reservas-search label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #3f3f46; /* zinc-700 */
  margin-bottom: 6px;
}
html.fgs-polish .reservas-search input[type='text'] {
  width: 100%;
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid #e4e4e7; /* zinc-200 */
  background: #fff;
  font-size: 13px;
  color: #18181b; /* zinc-900 */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
html.fgs-polish .reservas-search input[type='text']:focus {
  border-color: #a1a1aa; /* zinc-400 */
  box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.08);
  outline: none;
}

html.fgs-polish .reservas-tbl-scroll {
  border: 1px solid #e4e4e7; /* zinc-200 */
  border-radius: 12px;
}
html.fgs-polish .tbl-reservas th,
html.fgs-polish .tbl-reservas td {
  border-color: #e4e4e7; /* zinc-200 */
  padding: 10px 12px;
}
html.fgs-polish .tbl-reservas th {
  background: rgba(250, 250, 250, 0.92); /* zinc-50 */
  font-weight: 600;
  color: #18181b; /* zinc-900 */
}
html.fgs-polish .tbl-reservas tbody tr:nth-child(even) {
  background: #fafafa; /* zinc-50 */
}
html.fgs-polish .tbl-reservas tbody tr.row-selected {
  background: #f4f4f5 !important; /* zinc-100 */
}
html.fgs-polish .tbl-reservas .td-cb input[type='checkbox'] {
  accent-color: #18181b; /* zinc-900 */
}

/* Linhas com estado: suaves (mantêm semântica) */
html.fgs-polish .tbl-reservas tbody tr.tr-reserva-checkin {
  background: #f0fdf4 !important; /* emerald-50 */
}
html.fgs-polish .tbl-reservas tbody tr.tr-reserva-checkin:nth-child(even) {
  background: #ecfdf5 !important; /* emerald-50 alt */
}
html.fgs-polish .tbl-reservas tbody tr.tr-reserva-checkout {
  background: #fafafa !important; /* zinc-50 */
}
html.fgs-polish .tbl-reservas tbody tr.tr-reserva-checkout:nth-child(even) {
  background: #f4f4f5 !important; /* zinc-100 */
}
html.fgs-polish .tbl-reservas tbody tr.tr-reserva-online:not(.tr-reserva-checkin):not(.tr-reserva-checkout) {
  background: #f5f3ff !important; /* violet-50 */
  box-shadow: inset 3px 0 0 #7c3aed; /* violet-600 */
}
html.fgs-polish .tbl-reservas tbody tr.tr-reserva-online:not(.tr-reserva-checkin):not(.tr-reserva-checkout):nth-child(even) {
  background: #ede9fe !important; /* violet-100 */
}

/* ——— PDV manual: catálogo alinhado a Nova reserva (zinc / Inter) ——— */
html.fgs-polish main section#secCatalogoPdv.rounded-2xl {
  border-color: #e4e4e7;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 10px 32px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.22s ease, border-color 0.2s ease;
}
html.fgs-polish main section#secCatalogoPdv.rounded-2xl:hover {
  border-color: #d4d4d8;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.05),
    0 14px 40px rgba(15, 23, 42, 0.08);
}
html.fgs-polish #secCatalogoPdv input[type='search'],
html.fgs-polish #secCatalogoPdv select {
  width: 100%;
  padding: 9px 10px !important;
  border-radius: 6px !important;
  border: 1px solid #a1a1aa !important; /* zinc-400 · paridade campo Nova reserva */
  background: #ffffff !important;
  color: #18181b !important;
  font-size: 13px !important;
  box-shadow:
    inset 0 0 0 1px rgba(24, 24, 27, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
html.fgs-polish #secCatalogoPdv input[type='search']::placeholder {
  color: #71717a;
}
html.fgs-polish #secCatalogoPdv input[type='search']:focus,
html.fgs-polish #secCatalogoPdv select:focus {
  border-color: #a1a1aa !important;
  box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.08) !important;
  outline: none !important;
}
html.fgs-polish #pdvCatChipsRow button.pdv-cat-chip {
  border: 2px solid #e4e4e7;
  background: #ffffff;
  color: #27272a; /* zinc-800 */
  font-weight: 500;
  appearance: none;
  cursor: pointer;
}
html.fgs-polish #pdvCatChipsRow button.pdv-cat-chip:hover {
  background: #fafafa;
  border-color: #d4d4d8;
}
html.fgs-polish #pdvCatChipsRow button.pdv-cat-chip[aria-pressed='true'] {
  border-color: #18181b;
  background: #18181b;
  color: #fafafa;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
html.fgs-polish button.pdv-catalog-card {
  border-radius: 12px;
  border: 2.5px solid var(--fgs-header-g2, #0f1b33) !important;
  background: #fff !important;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 2px 4px -1px rgba(0, 0, 0, 0.03);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
html.fgs-polish button.pdv-catalog-card:hover {
  border-color: var(--fgs-header-g2, #0f1b33) !important;
  transform: translateY(-4px);
  box-shadow:
    0 12px 20px -3px rgba(15, 23, 42, 0.08),
    0 4px 8px -2px rgba(15, 23, 42, 0.04);
}
html.fgs-polish button.pdv-catalog-card:active {
  transform: translateY(0);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.06),
    0 2px 4px -1px rgba(0, 0, 0, 0.04);
}
html.fgs-polish button.pdv-catalog-card:focus-visible {
  outline: none !important;
  box-shadow:
    0 0 0 3px rgba(30, 41, 59, 0.12),
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
}

/* Imagens remotas (Firebase Storage): slot fixo + skeleton até carregar */
.fgs-storage-image {
  position: relative;
  display: inline-block;
  overflow: hidden;
  flex-shrink: 0;
  vertical-align: middle;
  background-color: #e2e8f0;
}
.fgs-storage-image--empty .fgs-storage-image-skel {
  display: block;
}
.fgs-storage-image-skel {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.fgs-storage-image-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.fgs-storage-image--loaded .fgs-storage-image-img {
  opacity: 1;
}
.fgs-storage-image--loaded .fgs-storage-image-skel,
.fgs-storage-image--error .fgs-storage-image-skel {
  display: none;
}
.fgs-storage-image--error {
  background-color: #f1f5f9;
}
.fgs-storage-image-img.object-contain,
.fgs-storage-image:has(.object-contain) .fgs-storage-image-img {
  object-fit: contain;
}

/* ——— Carregamento assíncrono (fgs-async-ui.js) ——— */
@keyframes fgs-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

html.fgs-polish .fgs-skel,
.fgs-skel {
  display: inline-block;
  background: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 45%, #e2e8f0 90%);
  background-size: 200% 100%;
  animation: fgs-shimmer 1.35s ease-in-out infinite;
  border-radius: 4px;
  vertical-align: middle;
}

.fgs-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid #e2e8f0;
  border-top-color: #22c55e;
  border-radius: 50%;
  animation: fgs-spin 0.75s linear infinite;
}

@keyframes fgs-spin {
  to {
    transform: rotate(360deg);
  }
}

.fgs-catalog-card-skel,
.fgs-pending-card-skel {
  pointer-events: none;
  user-select: none;
}

/* Borda azul de tonalidade igual ao navbar delimitando o carrinho de venda */
html.fgs-polish #cartDrawer {
  border: 5px solid var(--fgs-header-g2, #0f1b33) !important;
}

/* Botões do carrinho (Finalizar, Pedir Cotação, Limpar) — Estética Unificada Premium */
html.fgs-polish #btnFinalizar {
  background: var(--fgs-header-g2, #0f1b33) !important;
  border: 1px solid var(--fgs-header-g2, #0f1b33) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 14px rgba(15, 27, 51, 0.25) !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease !important;
}

html.fgs-polish #btnFinalizar:not(:disabled):hover {
  background: var(--fgs-header-g3, #152a50) !important;
  border-color: var(--fgs-header-g3, #152a50) !important;
  box-shadow: 0 6px 20px rgba(15, 27, 51, 0.35) !important;
}

html.fgs-polish #btnPedirCotacao,
html.fgs-polish #btnLimpar,
html.fgs-polish #btnCongelar {
  background-color: transparent !important;
  background: transparent !important;
  border: 2px solid var(--fgs-header-g2, #0f1b33) !important;
  color: var(--fgs-header-g2, #0f1b33) !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease !important;
}

html.fgs-polish #btnPedirCotacao:not(:disabled):hover,
html.fgs-polish #btnLimpar:not(:disabled):hover,
html.fgs-polish #btnCongelar:not(:disabled):hover {
  background-color: rgba(15, 27, 51, 0.06) !important;
}

html.fgs-polish #btnFinalizar:disabled,
html.fgs-polish #btnPedirCotacao:disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

/* Badges de IVA nos cartões de produtos — pílula discreta e profissional */
html.fgs-polish .pdv-catalog-card span.shrink-0 {
  background-color: #f1f5f9 !important;
  color: #64748b !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em !important;
  text-transform: none !important;
  border: none !important;
  border-radius: 9999px !important;
  padding: 3px 10px !important;
  line-height: 1.2 !important;
}

/* Botão flutuante do carrinho — identidade corporativa premium */
html.fgs-polish #btnOpenCartDrawer {
  border: none !important;
  border-radius: 9999px !important;
  background: linear-gradient(180deg, #1e293b 0%, var(--fgs-header-g2, #0f1b33) 100%) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  padding: 0.85rem 1.15rem 0.85rem 1.25rem !important;
  box-shadow:
    0 10px 24px rgba(15, 27, 51, 0.28),
    0 4px 8px rgba(15, 27, 51, 0.12) !important;
  transition: all 0.2s ease;
}

html.fgs-polish #btnOpenCartDrawer:hover {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%) !important;
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px rgba(15, 27, 51, 0.32),
    0 6px 12px rgba(15, 27, 51, 0.14) !important;
}

html.fgs-polish #btnOpenCartDrawer:active {
  transform: translateY(0);
  box-shadow:
    0 6px 16px rgba(15, 27, 51, 0.22),
    0 2px 6px rgba(15, 27, 51, 0.1) !important;
}

html.fgs-polish #btnOpenCartDrawer:focus-visible {
  outline: none !important;
  box-shadow:
    0 0 0 3px rgba(30, 41, 59, 0.35),
    0 10px 24px rgba(15, 27, 51, 0.28) !important;
}

/* Simetria do Botão "Sair de Wide Screen" — alinhado perfeitamente com o Carrinho */
html.fgs-polish #fgsFullscreenFloatingExitBtn {
  border: none !important;
  border-radius: 9999px !important;
  background: linear-gradient(180deg, #1e293b 0%, var(--fgs-header-g2, #0f1b33) 100%) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  padding: 0.85rem 1.25rem !important;
  height: auto !important;
  min-height: 0 !important;
  box-shadow:
    0 10px 24px rgba(15, 27, 51, 0.28),
    0 4px 8px rgba(15, 27, 51, 0.12) !important;
  transition: all 0.2s ease;
}

html.fgs-polish #fgsFullscreenFloatingExitBtn:hover {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%) !important;
  transform: translateY(-1px) scale(1) !important;
  box-shadow:
    0 14px 28px rgba(15, 27, 51, 0.32),
    0 6px 12px rgba(15, 27, 51, 0.14) !important;
}

html.fgs-polish #fgsFullscreenFloatingExitBtn:active {
  transform: translateY(0) scale(1) !important;
  box-shadow:
    0 6px 16px rgba(15, 27, 51, 0.22),
    0 2px 6px rgba(15, 27, 51, 0.1) !important;
}

html.fgs-polish #fgsFullscreenFloatingExitBtn:focus-visible {
  outline: none !important;
  box-shadow:
    0 0 0 3px rgba(30, 41, 59, 0.35),
    0 10px 24px rgba(15, 27, 51, 0.28) !important;
}

html.fgs-polish #cartFabCount {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 1.65rem !important;
  height: 1.65rem !important;
  padding: 0 0.35rem !important;
  border-radius: 9999px !important;
  background: rgba(255, 255, 255, 0.18) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.35) !important;
  color: #ffffff !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ==========================================
   SUPORTE PREMIUM PARA MODO WIDE SCREEN / KIOSK
   ========================================== */

/* Quando em ecrã inteiro (Wide Screen), oculta os cabeçalhos, menus e rodapés principais */
html.fgs-fullscreen-active header.fgs-header-gradient,
html.fgs-fullscreen-active footer.fgs-footer-bar {
  display: none !important;
}

/* Força o wrapper principal do PDV a ocupar toda a largura e altura do ecrã (True Wide Screen) */
html.fgs-fullscreen-active #pdvMainWrap {
  max-width: 100% !important;
  width: 100% !important;
  padding-left: 2rem !important;
  padding-right: 2rem !important;
  padding-top: 1.5rem !important;
  padding-bottom: 1.5rem !important;
  margin: 0 !important;
}

html.fgs-fullscreen-active #pdvEmpresaBrandStrip {
  margin-bottom: 1.25rem !important;
}

/* Quando o carrinho (drawer) está aberto no modo Wide Screen, garante que o conteúdo não seja obliterado/coberto */
@media (min-width: 640px) {
  html.fgs-fullscreen-active.fgs-cart-open #pdvMainWrap {
    padding-right: 440px !important; /* largura do carrinho (420px) + margem confortável de respiro */
  }
}

/* Garante que o aside do carrinho ocupe 100% da altura visível no modo de ecrã inteiro */
html.fgs-fullscreen-active #cartDrawer {
  height: 100vh !important;
  top: 0 !important;
  bottom: 0 !important;
}

/* Adaptação inteligente da grelha de produtos no modo Wide Screen para evitar cards esticados */
html.fgs-fullscreen-active #gridPdvCatalogo {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
}

html.fgs-fullscreen-active #gridPendentesFaturacao {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
}

/* ==========================================================================
   TECLADO VIRTUAL CONTEXTUAL DE ALTA PERFORMANCE (ESPECIAL PARA POS SEM TECLADO)
   ========================================================================== */

/* Contentor principal do Teclado Virtual */
.fgs-virtual-keyboard {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(248, 250, 252, 0.98); /* Slate 50 com ligeira transparência premium */
  border-top: 2px solid #cbd5e1;
  box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.12), 0 -8px 10px -6px rgba(0, 0, 0, 0.06);
  z-index: 99999; /* Fica acima de tudo, inclusive do carrinho e modals */
  padding: 14px;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  user-select: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-sizing: border-box;
}

/* Quando ativo, desliza para cima */
.fgs-virtual-keyboard.active {
  transform: translateY(0);
}

/* Linha de teclas */
.fgs-keyboard-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

/* Teclas individuais */
.fgs-keyboard-key {
  flex: 1;
  max-width: 72px;
  height: 52px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f1b33 !important; /* Azul escuro institucional */
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.1s ease, transform 0.05s ease, border-color 0.1s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  touch-action: manipulation; /* Evita atraso de duplo toque e zoom */
  box-sizing: border-box;
}

/* Toque ou clique ativo */
.fgs-keyboard-key:active {
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
  transform: scale(0.95);
}

/* Teclas especiais (ex: Shift, Backspace, Espaço, Caps) */
.fgs-keyboard-key.special {
  background: #f1f5f9;
  border-color: #cbd5e1;
  max-width: 95px;
  font-size: 14px;
}

/* Tecla de Espaço larga */
.fgs-keyboard-key.space-key {
  max-width: 340px;
}

/* Tecla de Ação de Destaque (Fechar / Concluir) */
.fgs-keyboard-key.action-key {
  background: var(--fgs-header-g2, #0f1b33) !important;
  color: #ffffff !important;
  border-color: var(--fgs-header-g2, #0f1b33) !important;
  max-width: 110px;
  font-size: 14px;
}
.fgs-keyboard-key.action-key:active {
  background: var(--fgs-header-g3, #152a50) !important;
  border-color: var(--fgs-header-g3, #152a50) !important;
}

/* Teclado numérico compacto (Numpad) — estética POS premium / corporativa */
.fgs-virtual-keyboard.numpad {
  max-width: 320px;
  left: auto !important;
  right: 16px !important;
  bottom: 16px !important;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 12px;
  box-shadow:
    0 12px 32px rgba(15, 23, 42, 0.12),
    0 2px 8px rgba(15, 23, 42, 0.06);
  background: rgba(248, 250, 252, 0.98);
  padding: 10px;
  gap: 6px;
}

/* Teclas numéricas base (0–9, vírgula, apagar) — sem contornos agressivos */
.fgs-virtual-keyboard.numpad .fgs-keyboard-key:not(.action-key):not(.fgs-numpad-clear),
.fgs-virtual-keyboard.numpad .fgs-keyboard-row:nth-child(4) .fgs-keyboard-key.special {
  flex: 1;
  max-width: none;
  height: 48px;
  border: none !important;
  border-radius: 8px;
  background: #f1f5f9;
  color: #1e293b !important;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.01em;
  box-shadow: none;
  transition:
    background-color 0.14s ease,
    transform 0.08s ease,
    box-shadow 0.14s ease;
}

@media (hover: hover) {
  .fgs-virtual-keyboard.numpad .fgs-keyboard-key:not(.action-key):not(.fgs-numpad-clear):hover,
  .fgs-virtual-keyboard.numpad .fgs-keyboard-row:nth-child(4) .fgs-keyboard-key.special:hover {
    background: #e2e8f0 !important;
  }
}

.fgs-virtual-keyboard.numpad .fgs-keyboard-key:not(.action-key):not(.fgs-numpad-clear):active,
.fgs-virtual-keyboard.numpad .fgs-keyboard-row:nth-child(4) .fgs-keyboard-key.special:active {
  background: #e2e8f0 !important;
  border: none !important;
  transform: scale(0.97);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

/* Botão C (Limpar) — destaque subtil de acção de limpeza */
.fgs-virtual-keyboard.numpad .fgs-keyboard-row:last-child .fgs-keyboard-key.special,
.fgs-virtual-keyboard.numpad .fgs-numpad-clear {
  flex: 1;
  max-width: none;
  height: 48px;
  border: none !important;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412 !important;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  box-shadow: none;
  transition:
    background-color 0.14s ease,
    transform 0.08s ease;
}

@media (hover: hover) {
  .fgs-virtual-keyboard.numpad .fgs-keyboard-row:last-child .fgs-keyboard-key.special:hover,
  .fgs-virtual-keyboard.numpad .fgs-numpad-clear:hover {
    background: #ffedd5 !important;
  }
}

.fgs-virtual-keyboard.numpad .fgs-keyboard-row:last-child .fgs-keyboard-key.special:active,
.fgs-virtual-keyboard.numpad .fgs-numpad-clear:active {
  background: #fed7aa !important;
  border: none !important;
  transform: scale(0.97);
}

/* Botão Fechar — sólido institucional (alinhado a «Adicionar ao pedido») */
.fgs-virtual-keyboard.numpad .fgs-keyboard-key.action-key {
  flex: 1;
  max-width: none;
  height: 48px;
  border: none !important;
  border-radius: 8px;
  background: linear-gradient(180deg, #1e293b 0%, var(--fgs-header-g2, #0f1b33) 100%) !important;
  color: #ffffff !important;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(15, 27, 51, 0.22);
  transition:
    background 0.14s ease,
    transform 0.08s ease,
    box-shadow 0.14s ease;
}

@media (hover: hover) {
  .fgs-virtual-keyboard.numpad .fgs-keyboard-key.action-key:hover {
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%) !important;
    box-shadow: 0 4px 12px rgba(15, 27, 51, 0.28);
  }
}

.fgs-virtual-keyboard.numpad .fgs-keyboard-key.action-key:active {
  background: var(--fgs-header-g3, #152a50) !important;
  border: none !important;
  transform: scale(0.98);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.18);
}

/* Grelha equilibrada do numpad */
.fgs-virtual-keyboard.numpad .fgs-keyboard-row {
  gap: 6px;
  width: 100%;
}

.fgs-virtual-keyboard.numpad .fgs-keyboard-row:last-child {
  gap: 8px;
}

/* Quando o carrinho está aberto, encolhe o teclado alfabético (não-numérico) 
   para a mesma largura útil dos produtos, desimpedindo a área do carrinho */
@media (min-width: 640px) {
  html.fgs-cart-open .fgs-virtual-keyboard:not(.numpad) {
    right: 440px !important; /* largura do carrinho (420px) + respiro confortável */
  }
}

/* Quando o teclado numérico virtual está ativo, cortamos o topo do carrinho em 200px (20%) */
html.fgs-numpad-active #cartDrawer {
  top: 200px !important;
  height: calc(100vh - 200px) !important;
  border-top: none !important; /* Fusão visual premium */
  transition: top 0.22s cubic-bezier(0.16, 1, 0.3, 1), height 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Posiciona o teclado numérico virtual horizontalmente e sem margens ociosas no topo do carrinho */
html.fgs-numpad-active .fgs-virtual-keyboard.numpad {
  position: fixed !important;
  top: 0 !important;
  bottom: auto !important;
  right: 0 !important;
  left: auto !important;
  width: min(420px, 100vw) !important; /* Alinhamento exato à largura do carrinho */
  max-width: 420px !important;
  height: 200px !important; /* Ocupa exatamente os 20% recortados no topo */
  border: none !important;
  border-bottom: 1px solid #e2e8f0 !important;
  border-radius: 0 !important; /* Perfeitamente integrado */
  background: #f8fafc !important;
  box-sizing: border-box !important;
  padding: 10px 12px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  transform: translateY(-100%); /* Desliza de cima para baixo */
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.1) !important;
}

/* Desliza para baixo quando o numpad é ativado */
html.fgs-numpad-active .fgs-virtual-keyboard.numpad.active {
  transform: translateY(0) !important;
  opacity: 1 !important;
}

/* Compactação e disposição horizontal ideal das teclas numéricas para POS táctil */
html.fgs-numpad-active .fgs-virtual-keyboard.numpad .fgs-keyboard-row {
  gap: 6px !important;
}

html.fgs-numpad-active .fgs-virtual-keyboard.numpad .fgs-keyboard-key:not(.action-key):not(.fgs-numpad-clear),
html.fgs-numpad-active .fgs-virtual-keyboard.numpad .fgs-keyboard-row:nth-child(4) .fgs-keyboard-key.special {
  height: 34px !important;
  min-height: 34px !important;
  font-size: 15px !important;
  border-radius: 7px !important;
  border: none !important;
  background: #f1f5f9 !important;
  color: #1e293b !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

html.fgs-numpad-active .fgs-virtual-keyboard.numpad .fgs-keyboard-row:last-child .fgs-keyboard-key.special,
html.fgs-numpad-active .fgs-virtual-keyboard.numpad .fgs-numpad-clear {
  height: 36px !important;
  min-height: 36px !important;
  font-size: 14px !important;
  border-radius: 7px !important;
  border: none !important;
  background: #fff7ed !important;
  color: #9a3412 !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

html.fgs-numpad-active .fgs-virtual-keyboard.numpad .fgs-keyboard-key.action-key {
  height: 36px !important;
  min-height: 36px !important;
  font-size: 13px !important;
  border-radius: 7px !important;
  border: none !important;
  background: linear-gradient(180deg, #1e293b 0%, var(--fgs-header-g2, #0f1b33) 100%) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 6px rgba(15, 27, 51, 0.2) !important;
}

@media (hover: hover) {
  html.fgs-numpad-active .fgs-virtual-keyboard.numpad .fgs-keyboard-key:not(.action-key):not(.fgs-numpad-clear):hover,
  html.fgs-numpad-active .fgs-virtual-keyboard.numpad .fgs-keyboard-row:nth-child(4) .fgs-keyboard-key.special:hover {
    background: #e2e8f0 !important;
  }

  html.fgs-numpad-active .fgs-virtual-keyboard.numpad .fgs-keyboard-row:last-child .fgs-keyboard-key.special:hover,
  html.fgs-numpad-active .fgs-virtual-keyboard.numpad .fgs-numpad-clear:hover {
    background: #ffedd5 !important;
  }

  html.fgs-numpad-active .fgs-virtual-keyboard.numpad .fgs-keyboard-key.action-key:hover {
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%) !important;
  }
}

html.fgs-numpad-active .fgs-virtual-keyboard.numpad .fgs-keyboard-key:not(.action-key):not(.fgs-numpad-clear):active,
html.fgs-numpad-active .fgs-virtual-keyboard.numpad .fgs-keyboard-row:nth-child(4) .fgs-keyboard-key.special:active {
  background: #e2e8f0 !important;
  border: none !important;
  transform: scale(0.97);
}

html.fgs-numpad-active .fgs-virtual-keyboard.numpad .fgs-keyboard-row:last-child .fgs-keyboard-key.special:active,
html.fgs-numpad-active .fgs-virtual-keyboard.numpad .fgs-numpad-clear:active {
  background: #fed7aa !important;
  border: none !important;
}

html.fgs-numpad-active .fgs-virtual-keyboard.numpad .fgs-keyboard-key.action-key:active {
  background: var(--fgs-header-g3, #152a50) !important;
  border: none !important;
  transform: scale(0.98);
}

/* Remove a margem extra do wrapper inferior do ecrã para acomodar o teclado sem rolar se possível */
html.fgs-keyboard-visible #pdvMainWrap {
  padding-bottom: 240px !important;
}

/* Estilos elegantes para o dropdown de Pedidos Suspensos (em Espera) */
.fgs-espera-item {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  padding: 10px 14px !important;
  cursor: pointer !important;
  border-bottom: 1px solid #f1f5f9 !important;
  transition: background-color 0.15s ease, color 0.15s ease !important;
  text-align: left !important;
}
.fgs-espera-item:last-child {
  border-bottom: none !important;
}
.fgs-espera-item:hover {
  background-color: #f1f5f9 !important;
}
.fgs-espera-item .title {
  font-weight: 600 !important;
  color: #1e293b !important;
  font-size: 13px !important;
}
.fgs-espera-item .meta {
  font-size: 11px !important;
  color: #64748b !important;
  font-family: monospace !important;
}
.fgs-espera-item .delete-btn {
  color: #ef4444 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  margin-top: 4px !important;
  align-self: flex-start !important;
}
.fgs-espera-item .delete-btn:hover {
  text-decoration: underline !important;
}

/* Upload de imagem — modal de produtos (produtos.html) */
.fgs-image-upload-container {
  margin-top: 16px;
}
.fgs-field-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  margin-bottom: 6px;
}
.fgs-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.fgs-dropzone:hover,
.fgs-dropzone:focus-visible {
  border-color: #94a3b8;
  background: #f1f5f9;
  outline: none;
}
.fgs-dropzone.fgs-dropzone--active {
  border-color: #1e293b;
  background: #eef2ff;
  box-shadow: 0 0 0 3px rgba(30, 41, 59, 0.08);
}
.fgs-dropzone-icon {
  font-size: 24px;
  line-height: 1;
}
.fgs-dropzone-hint {
  margin: 4px 0 0;
  font-size: 13px;
  color: #64748b;
}
#fgs-dropzone-preview {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.fgs-dropzone.fgs-dropzone--selected {
  border-color: #6366f1 !important;
}
#fgs-image-preview-element {
  max-height: 100px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.fgs-dropzone-remove {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
  padding: 0;
}
.fgs-dropzone-remove:hover {
  text-decoration: underline;
}

.fgs-vestuario-only.hidden {
  display: none !important;
}

.fgs-size-grade {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.fgs-size-chip {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.fgs-size-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.fgs-size-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0.4rem 0.75rem;
  border: 1.5px solid #1e293b;
  border-radius: 0.5rem;
  color: #1e293b;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.fgs-size-chip:hover span {
  box-shadow: 0 0 0 2px rgba(30, 41, 59, 0.12);
}

.fgs-size-chip input:checked + span {
  background: #1e293b;
  color: #fff;
}

.fgs-size-chip input:focus-visible + span {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.fgs-nav-item-hidden {
  display: none !important;
}

/* Farmácia / saúde: ocultar abas de restaurante antes do JS async (evita flash no 1.º paint). */
html[data-fgs-business-type='farmacia'] [data-fgs-tenant-vd-remota],
html[data-fgs-business-type='farmacia'] [data-fgs-tenant-ft-remota],
html[data-fgs-business-type='farmacia'] [data-fgs-tenant-manual-ft],
html[data-fgs-business-type='farmacia'] [data-fgs-nav-key='reservas'],
html[data-fgs-business-type='saude'] [data-fgs-tenant-vd-remota],
html[data-fgs-business-type='saude'] [data-fgs-tenant-ft-remota],
html[data-fgs-business-type='saude'] [data-fgs-tenant-manual-ft],
html[data-fgs-business-type='saude'] [data-fgs-nav-key='reservas'] {
  display: none !important;
}

/* Farmácia / saúde: painel e blocos verticais — evita flash de «Pedidos Online» / «Reservas». */
html[data-fgs-business-type='farmacia'] [data-fgs-farmacia-hide],
html[data-fgs-business-type='saude'] [data-fgs-farmacia-hide] {
  display: none !important;
}

html[data-fgs-business-type='farmacia'] nav[data-fgs-farmacia-only].hidden,
html[data-fgs-business-type='saude'] nav[data-fgs-farmacia-only].hidden {
  display: flex !important;
}

html[data-fgs-business-type='farmacia'] div[data-fgs-farmacia-only].hidden,
html[data-fgs-business-type='saude'] div[data-fgs-farmacia-only].hidden {
  display: grid !important;
}

html[data-fgs-business-type='farmacia'] section[data-fgs-farmacia-only].hidden,
html[data-fgs-business-type='saude'] section[data-fgs-farmacia-only].hidden {
  display: block !important;
}

html[data-fgs-business-type='farmacia'] button[data-fgs-farmacia-only].hidden,
html[data-fgs-business-type='saude'] button[data-fgs-farmacia-only].hidden {
  display: inline-flex !important;
}

html[data-fgs-business-type='farmacia'] a.fgs-nav-tab[data-fgs-farmacia-wizard].hidden,
html[data-fgs-business-type='farmacia'] a.fgs-nav-tab[data-fgs-farmacia-wizard].fgs-nav-item-hidden,
html[data-fgs-business-type='saude'] a.fgs-nav-tab[data-fgs-farmacia-wizard].hidden,
html[data-fgs-business-type='saude'] a.fgs-nav-tab[data-fgs-farmacia-wizard].fgs-nav-item-hidden {
  display: inline-flex !important;
}

html[data-fgs-business-type='farmacia'] #dashboardHeroFarmaciaMark.hidden,
html[data-fgs-business-type='saude'] #dashboardHeroFarmaciaMark.hidden {
  display: inline !important;
}

/* Rótulos farmácia no 1.º paint (hero + nav com data-fgs-label-farmacia). */
html[data-fgs-business-type='farmacia']:not([data-fgs-ui-labels-applied]) [data-fgs-label-farmacia]:not(title),
html[data-fgs-business-type='saude']:not([data-fgs-ui-labels-applied]) [data-fgs-label-farmacia]:not(title) {
  font-size: 0 !important;
  line-height: 0 !important;
  color: transparent;
}

html[data-fgs-business-type='farmacia']:not([data-fgs-ui-labels-applied]) [data-fgs-label-farmacia]:not(title)::after,
html[data-fgs-business-type='saude']:not([data-fgs-ui-labels-applied]) [data-fgs-label-farmacia]:not(title)::after {
  content: attr(data-fgs-label-farmacia);
  font-size: 0.75rem;
  line-height: 1.25;
  font-weight: inherit;
  color: inherit;
}

html[data-fgs-business-type='farmacia']:not([data-fgs-ui-labels-applied]) #dashboardHeroTitleText::after,
html[data-fgs-business-type='saude']:not([data-fgs-ui-labels-applied]) #dashboardHeroTitleText::after {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
}

@media (min-width: 640px) {
  html[data-fgs-business-type='farmacia']:not([data-fgs-ui-labels-applied]) #dashboardHeroTitleText::after,
  html[data-fgs-business-type='saude']:not([data-fgs-ui-labels-applied]) #dashboardHeroTitleText::after {
    font-size: 13.5px;
  }
}

html[data-fgs-business-type='farmacia']:not([data-fgs-ui-labels-applied]) a[data-fgs-tenant-manual-vd]:not([data-fgs-label-farmacia]),
html[data-fgs-business-type='saude']:not([data-fgs-ui-labels-applied]) a[data-fgs-tenant-manual-vd]:not([data-fgs-label-farmacia]) {
  font-size: 0 !important;
  line-height: 0 !important;
  color: transparent;
}

html[data-fgs-business-type='farmacia']:not([data-fgs-ui-labels-applied]) a[data-fgs-tenant-manual-vd]:not([data-fgs-label-farmacia])::after,
html[data-fgs-business-type='saude']:not([data-fgs-ui-labels-applied]) a[data-fgs-tenant-manual-vd]:not([data-fgs-label-farmacia])::after {
  content: 'Caixa / PDV';
  font-size: 0.75rem;
  line-height: 1.25;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
}

html[data-fgs-business-type='farmacia']:not([data-fgs-ui-labels-applied]) a.fgs-nav-tab[data-fgs-tenant-manual-vd]:not([data-fgs-label-farmacia])::after,
html[data-fgs-business-type='saude']:not([data-fgs-ui-labels-applied]) a.fgs-nav-tab[data-fgs-tenant-manual-vd]:not([data-fgs-label-farmacia])::after {
  color: rgba(255, 255, 255, 0.78);
}

/* Farmácia: indicador deslizante só após rótulos finais (evita underline no tab errado). */
html[data-fgs-business-type='farmacia']:not([data-fgs-ui-labels-applied]) .fgs-nav-slide-indicator,
html[data-fgs-business-type='saude']:not([data-fgs-ui-labels-applied]) .fgs-nav-slide-indicator {
  opacity: 0 !important;
}