:root {
  /* Paleta Ultra-Neutra Minimalista do Sistema ERP */
  --jesens-burgundy: #18181b;
  --jesens-burgundy-dark: #09090b;
  --jesens-burgundy-light: #27272a;
  --jesens-beige: #f1f3f5;
  --jesens-beige-dark: #e2e5ea;
  --jesens-cream: #f8f9fb;
  --jesens-white: #ffffff;
  --jesens-text: #111827;
  --jesens-muted: #64748b;

  /* Tema Configurável Exclusivo do Sistema ERP */
  --erp-primary: #1e242d;
  --erp-primary-dark: #14181f;
  --erp-primary-hover: #2d3644;
  --erp-primary-text: #ffffff;
  --erp-sidebar-text: #e2e8f0;
  --erp-sidebar-nav: #cbd5e1;
  --erp-sidebar-muted: rgba(255, 255, 255, 0.65);
  --erp-sidebar-section: rgba(255, 255, 255, 0.48);
  --erp-sidebar-border: rgba(255, 255, 255, 0.12);
  --erp-sidebar-hover: rgba(255, 255, 255, 0.10);
  --erp-sidebar-active-bg: #ffffff;
  --erp-sidebar-active-text: #111827;
  --erp-sidebar-pill-bg: rgba(255, 255, 255, 0.14);
  --erp-sidebar-pill-text: #f1f5f9;
  --erp-sidebar-active-pill-bg: #1e242d;
  --erp-sidebar-active-pill-text: #ffffff;
  --erp-sidebar-footer-bg: rgba(0, 0, 0, 0.24);

  /* Cores Semânticas Fortes (Apenas Confirmação & Atenção/Perigo) */
  --jesens-success: #15803d;
  --jesens-success-hover: #166534;
  --jesens-success-bg: #f0fdf4;
  --jesens-warning: #b45309;
  --jesens-warning-hover: #92400e;
  --jesens-warning-bg: #fffbeb;
  --jesens-danger: #dc2626;
  --jesens-danger-hover: #b91c1c;
  --jesens-danger-bg: #fef2f2;

  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --shadow-soft: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow-strong: 0 10px 28px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--jesens-cream);
  color: var(--jesens-text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .brand-serif {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: -0.02em;
  color: #111827;
}

/* Layout Principal */
.app-shell {
  display: flex;
  min-height: 100vh;
  background: #e9edf3;
}

/* Barra Lateral (Sidebar) com Tema Configurável do Sistema ERP */
.sidebar {
  width: 332px;
  background: linear-gradient(180deg, var(--erp-primary) 0%, var(--erp-primary-dark) 100%);
  color: var(--erp-sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  border-right: 1px solid var(--erp-sidebar-border);
}

.brand-header {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--erp-sidebar-border);
}

.brand-logo {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.38rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--erp-primary-text);
  line-height: 1.1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand-badge {
  font-family: 'Inter', sans-serif;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--erp-sidebar-pill-bg);
  color: var(--erp-primary-text);
  border: 1px solid var(--erp-sidebar-border);
}

.brand-subtitle {
  font-size: 0.76rem;
  color: var(--erp-sidebar-muted);
  margin-top: 6px;
  letter-spacing: 0.005em;
}

.nav-menu {
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--erp-sidebar-section);
  padding: 12px 12px 5px;
  font-weight: 700;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--erp-sidebar-nav);
  font-size: 0.89rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
}

.icon-svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.icon-svg-sm {
  width: 15px;
  height: 15px;
}

.icon-svg-lg {
  width: 26px;
  height: 26px;
  stroke-width: 1.5;
}

.nav-btn:hover {
  background: var(--erp-sidebar-hover);
  color: var(--erp-primary-text);
}

.nav-btn.active {
  background: var(--erp-sidebar-active-bg);
  color: var(--erp-sidebar-active-text);
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
}

.nav-btn .nav-pill {
  margin-left: auto;
  font-size: 0.71rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--erp-sidebar-pill-bg);
  color: var(--erp-sidebar-pill-text);
  font-weight: 700;
}

.nav-btn.active .nav-pill {
  background: var(--erp-sidebar-active-pill-bg);
  color: var(--erp-sidebar-active-pill-text);
}

.nav-btn-store-link {
  margin-top: 8px;
  border: 1px solid var(--erp-sidebar-border);
  background: var(--erp-sidebar-hover);
  color: var(--erp-primary-text);
}

.nav-btn-store-link:hover {
  background: var(--erp-sidebar-pill-bg);
  border-color: var(--erp-sidebar-border);
  color: var(--erp-primary-text);
}

.sidebar-footer {
  padding: 14px 16px;
  background: var(--erp-sidebar-footer-bg);
  border-top: 1px solid var(--erp-sidebar-border);
  font-size: 0.78rem;
  color: var(--erp-sidebar-text);
}

.sidebar-footer #sidebar-user-name {
  color: var(--erp-primary-text) !important;
}

.sidebar-logout-btn {
  background: var(--erp-sidebar-pill-bg);
  border: 1px solid var(--erp-sidebar-border);
  color: var(--erp-primary-text);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.73rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.sidebar-logout-btn:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.db-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  margin-right: 6px;
}

/* Conteúdo Principal */
.main-area {
  margin-left: 332px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left 0.2s ease;
}

/* MODO LOJA VIRTUAL DO CLIENTE (Oculta todo o menu e botões do ERP) */
.app-shell.storefront-mode {
  background: #fafafa;
}

.app-shell.storefront-mode .sidebar {
  display: none !important;
}

.app-shell.storefront-mode .main-area {
  margin-left: 0 !important;
  width: 100%;
  background: #fafafa;
}

.app-shell.storefront-mode .mobile-menu-trigger {
  display: none !important;
}

.app-shell.storefront-mode .topbar {
  padding: 14px max(24px, calc((100% - 1340px) / 2));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #eceef2;
  box-shadow: 0 1px 8px rgba(15, 23, 42, 0.03);
}

.app-shell.storefront-mode .page-content {
  max-width: 1388px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 24px 64px;
}

/* TELA DE LOGIN EXCLUSIVA DO SISTEMA ERP */
.erp-login-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(145deg, #e2e7ef 0%, #eef1f6 100%);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.erp-login-screen.open {
  display: flex;
}

.erp-login-card {
  width: 100%;
  max-width: 408px;
  background: #ffffff;
  border: 1px solid #d6dce6;
  border-top: 4px solid var(--erp-primary);
  border-radius: 14px;
  padding: 36px 32px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

.topbar {
  background: #ffffff;
  border-bottom: 1px solid #d6dce5;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
  padding: 14px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-title {
  min-width: 0;
}

.topbar-title h1 {
  font-size: 1.38rem;
  color: #111827;
  font-weight: 700;
  line-height: 1.25;
}

.topbar-title p {
  font-size: 0.79rem;
  color: #64748b;
  margin-top: 2px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.page-content {
  padding: 24px 28px 48px;
  max-width: 1520px;
  width: 100%;
}

/* =====================================================================
   BOTÕES MINIMALISTAS NEUTROS + CORES FORTES APENAS P/ CONFIRMAÇÃO & ATENÇÃO
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 15px;
  border-radius: var(--radius-md);
  font-size: 0.835rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

/* Cor Principal do ERP (Ações Principais Comuns) */
.btn-primary {
  background: var(--erp-primary);
  color: var(--erp-primary-text);
  border-color: var(--erp-primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--erp-primary-hover);
  border-color: var(--erp-primary-hover);
  box-shadow: 0 3px 10px rgba(30, 36, 45, 0.18);
}

/* Na Loja Virtual (/loja), botões principais seguem a Cor Principal do Site */
.app-shell.storefront-mode .btn-primary {
  background: var(--jesens-burgundy);
  color: #ffffff;
  border-color: var(--jesens-burgundy);
}

.app-shell.storefront-mode .btn-primary:hover:not(:disabled) {
  background: var(--jesens-burgundy-light);
  border-color: var(--jesens-burgundy-light);
}

/* Cor Forte de Confirmação / Salvar / Finalizar */
.btn-success {
  background: var(--jesens-success);
  color: #ffffff;
  border-color: var(--jesens-success);
}

.btn-success:hover:not(:disabled) {
  background: var(--jesens-success-hover);
  border-color: var(--jesens-success-hover);
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.25);
}

/* Cor Forte de Atenção / Alerta */
.btn-warning {
  background: #d97706;
  color: #ffffff;
  border-color: #d97706;
}

.btn-warning:hover:not(:disabled) {
  background: #b45309;
  border-color: #b45309;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.24);
}

/* Cor Forte de Perigo / Excluir / Fechar Caixa */
.btn-danger {
  background: var(--jesens-danger);
  color: #ffffff;
  border-color: var(--jesens-danger);
}

.btn-danger:hover:not(:disabled) {
  background: var(--jesens-danger-hover);
  border-color: var(--jesens-danger-hover);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.24);
}

/* Neutro Cinza Suave (Botões Secundários com Contraste Definido) */
.btn-secondary {
  background: #f1f4f8;
  color: #1e293b;
  border-color: #cbd5e1;
}

.btn-secondary:hover:not(:disabled) {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}

/* Neutro Contorno Limpo */
.btn-outline {
  background: #ffffff;
  color: #1e293b;
  border-color: #94a3b8;
}

.btn-outline:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #475569;
  color: #0f172a;
}

.btn-sm {
  min-height: 32px;
  padding: 5px 11px;
  font-size: 0.77rem;
}

/* Cards Limpos & Neutros com Profundidade Definida */
.card {
  background: var(--jesens-white);
  border: 1px solid #d8dfe8;
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.card-beige {
  background: #f1f4f8;
  border: 1px solid #d8dfe8;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.card-burgundy {
  background: #ffffff;
  color: #111827;
  border: 1px solid #d8dfe8;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.quick-actions-grid .btn {
  width: 100%;
  white-space: normal;
  text-align: center;
  padding: 10px 12px;
  min-height: 42px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--jesens-white);
  border: 1px solid #d8dfe8;
  border-top: 3px solid var(--erp-primary);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
  transition: border-color 0.15s ease;
}

.kpi-card.kpi-alert {
  border-color: #f59e0b;
  border-top: 3px solid #d97706;
  background: #fffbeb;
}

.kpi-label {
  font-size: 0.76rem;
  letter-spacing: 0.01em;
  color: #475569;
  font-weight: 600;
}

.kpi-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: #0f172a;
  margin: 6px 0 4px;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.kpi-sub {
  font-size: 0.78rem;
  color: #64748b;
}

/* Tabelas Minimalistas com Cabeçalho Definido */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.865rem;
}

th {
  background: #f1f4f9;
  color: #475569;
  text-align: left;
  padding: 10px 14px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  white-space: nowrap;
  border-top: 1px solid #dce2eb;
  border-bottom: 1px solid #cbd5e1;
}

td {
  padding: 13px 14px;
  border-bottom: 1px solid #e9edf3;
  vertical-align: middle;
  color: #1f2937;
}

tr:hover td {
  background-color: #f4f7fb;
}

/* Toggle Switch "Enviar para meu site" */
.switch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.switch-input {
  display: none;
}

.switch-slider {
  width: 42px;
  height: 22px;
  background: #cbd5e1;
  border-radius: 999px;
  position: relative;
  transition: 0.2s ease;
  flex-shrink: 0;
}

.switch-slider::after {
  content: '';
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 999px;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: 0.2s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
}

.switch-input:checked + .switch-slider {
  background: #16a34a;
}

.switch-input:checked + .switch-slider::after {
  transform: translateX(20px);
  background: #ffffff;
}

/* Badges Minimalistas Neutros + Semânticos Claros */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.badge-store {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.badge-internal {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.badge-channel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 600;
  background: #f4f4f5;
  color: #3f3f46;
  border: 1px solid #e4e4e7;
  white-space: nowrap;
}

.badge-channel .icon-svg {
  color: #52525b;
  width: 14px;
  height: 14px;
  stroke-width: 1.75;
}

.badge-success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-warning {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.stock-stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.stepper-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #334155;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.stepper-icon-btn:hover {
  color: #111827;
  border-color: #cbd5e1;
  background: #f3f4f6;
}

.stepper-icon-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.stock-pill {
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  min-width: 62px;
  text-align: center;
  white-space: nowrap;
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

.stock-pill.low-stock {
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #b45309;
}

/* Formulários e Seções do Modal (Layout Fluido em Branco & Tons de Cinza) */
.form-section-box {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px 26px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.form-section-title {
  font-size: 0.88rem;
  letter-spacing: -0.01em;
  font-weight: 700;
  color: #111827;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f3f5;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  align-items: end;
}

.form-grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px 20px;
  align-items: end;
}

.col-12 { grid-column: span 12; }
.col-8  { grid-column: span 8; }
.col-7  { grid-column: span 7; }
.col-6  { grid-column: span 6; }
.col-5  { grid-column: span 5; }
.col-4  { grid-column: span 4; }
.col-3  { grid-column: span 3; }

@media (max-width: 820px) {
  .col-8, .col-7, .col-6, .col-5, .col-4, .col-3 {
    grid-column: span 12;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.form-group label {
  font-size: 0.84rem;
  font-weight: 600;
  color: #1f2937;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form-control {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  color: #111827;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea.form-control {
  height: auto;
  padding: 12px 14px;
}

.form-control:focus {
  outline: none;
  border-color: #6b7280;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.12);
}

/* Padronização em MAIÚSCULAS nos campos de cadastro do ERP (exceto tokens, URLs, senhas e chaves) */
.app-shell:not(.storefront-mode) input[type="text"].form-control:not([data-preserve-case="true"]),
.app-shell:not(.storefront-mode) textarea.form-control:not([data-preserve-case="true"]),
#product-modal input[type="text"].form-control:not([data-preserve-case="true"]),
#product-modal textarea.form-control:not([data-preserve-case="true"]) {
  text-transform: uppercase;
}

.app-shell:not(.storefront-mode) input[type="text"].form-control::placeholder,
.app-shell:not(.storefront-mode) textarea.form-control::placeholder,
#product-modal input[type="text"].form-control::placeholder,
#product-modal textarea.form-control::placeholder {
  text-transform: none;
}

/* Layout de 2 Colunas (PDV, Etiquetas, Checkout) */
.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

@media (max-width: 1200px) {
  .split-grid {
    grid-template-columns: 1fr;
  }
}

/* Grid de Produtos no PDV e Loja Virtual (Mais Colunas Alinhadas com o Topo) */
.product-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 16px;
}

.store-products-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

@media (max-width: 1180px) {
  .store-products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (max-width: 820px) {
  .store-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 440px) {
  .store-products-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.product-card {
  background: #ffffff;
  border: 1px solid #e6e8ec;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: #d1d5db;
  box-shadow: var(--shadow-strong);
}

.product-img-wrap {
  height: 180px;
  background: #f3f4f6;
  position: relative;
  overflow: hidden;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-tag-top {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(17, 24, 39, 0.85);
  color: #ffffff;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.product-card-body {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.product-sku {
  font-size: 0.72rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: #111827;
  margin: 4px 0 8px;
}

.product-price-row {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-top: 8px;
}

.price-current {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.price-old {
  font-size: 0.8rem;
  text-decoration: line-through;
  color: #94a3b8;
}

/* =====================================================================
   GERADOR DE ETIQUETAS TÉRMICAS (Elgin, Zebra, Argox)
   ===================================================================== */
.thermal-preview-stage {
  background: #f1f5f9;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1.5px dashed #cbd5e1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  overflow-x: auto;
}

.thermal-roll-row {
  display: flex;
  gap: 3mm;
  background: rgba(255, 255, 255, 0.55);
  padding: 3mm;
  border-radius: 6px;
}

.thermal-label {
  background: #ffffff;
  color: #000000;
  border: 1px solid #cfd3da;
  border-radius: 2mm;
  padding: 2mm 2.5mm;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

/* Medidas reais em milímetros para impressoras térmicas */
.label-size-33x22 {
  width: 33mm;
  height: 22mm;
}

.label-size-40x25 {
  width: 40mm;
  height: 25mm;
}

.label-size-50x30 {
  width: 50mm;
  height: 30mm;
}

.thermal-brand {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  font-size: 7.5pt;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #000;
  line-height: 1;
  border-bottom: 0.3mm solid #000;
  width: 100%;
  padding-bottom: 0.6mm;
}

.thermal-prod-name {
  font-size: 6pt;
  font-weight: 700;
  line-height: 1.1;
  max-height: 4.5mm;
  overflow: hidden;
  width: 100%;
  margin-top: 0.5mm;
}

.thermal-barcode-svg {
  width: 96%;
  height: 7.5mm;
  margin: 0.3mm 0;
}

.thermal-code-text {
  font-family: monospace;
  font-size: 5.5pt;
  letter-spacing: 0.06em;
  line-height: 1;
}

.thermal-price-box {
  font-size: 8.5pt;
  font-weight: 900;
  line-height: 1;
  margin-top: 0.4mm;
}

.thermal-installment {
  font-size: 5pt;
  font-weight: 600;
}

/* Modal Fluido em Branco & Escala de Cinza */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  max-width: 1040px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 32px 36px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.16);
}

/* Vitrine da Loja Virtual Je'sens */
.storefront-hero {
  background: linear-gradient(125deg, var(--jesens-burgundy) 0%, #2a0009 100%);
  color: var(--jesens-cream);
  border-radius: var(--radius-lg);
  padding: 36px 34px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--jesens-beige-dark);
}

.storefront-hero h2 {
  font-size: 2.4rem;
  color: var(--jesens-beige);
  margin-bottom: 8px;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--erp-primary);
  color: var(--erp-primary-text);
  border-left: 4px solid #22c55e;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Componentes Responsivos da Ficha Técnica e Barra de Lucro (Branco & Cinza Clean) */
.bom-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 16px 20px;
}

.bom-summary-total {
  border-left: 1px solid #d1d5db;
  padding-left: 16px;
}

.profit-preview-flex {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 20px;
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 13px 18px;
  font-size: 0.84rem;
  color: #374151;
}

/* Upload de Múltiplas Fotos & Galeria do Produto (ERP -> Loja Virtual) */
.upload-dropzone {
  border: 1.5px dashed #cbd5e1;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 22px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.upload-dropzone:hover {
  border-color: #64748b;
  background: #ffffff;
}

.gallery-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.gallery-thumb-card {
  position: relative;
  border: 1px solid var(--jesens-beige-dark);
  border-radius: var(--radius-sm);
  background: #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gallery-thumb-card.is-cover {
  border: 2px solid var(--jesens-burgundy);
}

.gallery-thumb-card img {
  width: 100%;
  height: 84px;
  object-fit: cover;
  display: block;
}

.gallery-thumb-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  background: #f8f9fa;
  border-top: 1px solid var(--jesens-beige);
  font-size: 0.68rem;
}

.gallery-cover-btn {
  border: none;
  background: transparent;
  color: var(--jesens-text);
  font-weight: 700;
  font-size: 0.68rem;
  cursor: pointer;
  padding: 2px 4px;
}

.gallery-cover-btn.active {
  color: var(--jesens-burgundy);
}

/* Miniaturas de Troca de Foto nos Cards da Loja Virtual */
.store-card-thumbs {
  display: flex;
  gap: 6px;
  padding: 8px 15px 0;
  overflow-x: auto;
}

.store-mini-thumb {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--jesens-beige-dark);
  cursor: pointer;
  opacity: 0.72;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.store-mini-thumb:hover,
.store-mini-thumb.active {
  opacity: 1;
  border: 1.5px solid var(--jesens-burgundy);
}

/* =====================================================================
   VITRINE E-COMMERCE COMPLETA (CARROSSEL, GRUPOS, COLEÇÕES & SACOLA)
   ===================================================================== */
@keyframes carouselFadeIn {
  from { opacity: 0.65; }
  to { opacity: 1; }
}

.store-promo-carousel {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--jesens-burgundy);
  color: #ffffff;
  margin-bottom: 18px;
  min-height: 295px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.07);
  animation: carouselFadeIn 0.3s ease;
}

.carousel-slide {
  width: 100%;
  padding: 46px 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background-size: cover;
  background-position: center;
}

.carousel-slide-content {
  max-width: 580px;
  z-index: 2;
}

.carousel-kicker {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  color: #ffffff;
  margin-bottom: 14px;
}

.carousel-slide h2 {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.15;
  color: #ffffff;
  margin-bottom: 10px;
  letter-spacing: -0.025em;
}

.carousel-slide p {
  font-size: 0.96rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.55;
}

.carousel-side-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: background 0.18s ease, transform 0.18s ease;
}

.carousel-side-arrow:hover {
  background: rgba(255, 255, 255, 0.32);
  transform: translateY(-50%) scale(1.06);
}

.carousel-side-arrow.prev {
  left: 16px;
}

.carousel-side-arrow.next {
  right: 16px;
}

.carousel-controls {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(6px);
  z-index: 5;
}

.carousel-dot {
  width: 20px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  transition: all 0.22s ease;
}

.carousel-dot.active {
  width: 34px;
  background: #ffffff;
}

.carousel-arrow-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.carousel-arrow-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Barra de Botões de Grupo (Logo Abaixo do Carrossel) + Busca Rápida */
.store-groups-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #ffffff;
  border: 1px solid #eceef2;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 28px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.store-groups-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.store-group-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #374151;
  font-size: 0.84rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.store-group-pill:hover {
  border-color: var(--jesens-burgundy);
  color: var(--jesens-burgundy);
  background: #fdfbfc;
}

.store-group-pill.active {
  background: var(--jesens-burgundy);
  border-color: var(--jesens-burgundy);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(77, 0, 17, 0.18);
}

.store-group-count {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
}

.store-group-pill.active .store-group-count {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.store-search-box {
  position: relative;
  width: 265px;
  flex-shrink: 0;
}

.store-search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
  display: inline-flex;
}

.store-search-input {
  width: 100%;
  height: 38px;
  padding: 0 34px 0 36px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f9fafb;
  color: #111827;
  font-size: 0.84rem;
  font-family: inherit;
  transition: all 0.18s ease;
}

.store-search-input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--jesens-burgundy);
  box-shadow: 0 0 0 3px rgba(77, 0, 17, 0.08);
}

.store-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: none;
  background: #e5e7eb;
  color: #4b5563;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.store-search-clear:hover {
  background: #d1d5db;
  color: #111827;
}

/* Cards de Produto Limpos e Claros (Exclusivos da Loja Virtual) */
.store-product-card {
  background: #ffffff;
  border: 1px solid #eceef2;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.store-product-card:hover {
  transform: translateY(-3px);
  border-color: #d8dce3;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.07);
}

.store-product-card .product-img-wrap {
  height: 235px;
  background: #f5f6f8;
  position: relative;
  overflow: hidden;
}

.store-product-card .product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.store-product-card:hover .product-img-wrap img {
  transform: scale(1.04);
}

.store-product-card .product-tag-top {
  top: 12px;
  left: 12px;
  background: var(--jesens-burgundy);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 8px rgba(77, 0, 17, 0.22);
}

.store-product-card .product-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.store-product-card .product-sku {
  font-size: 0.7rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.store-product-card .product-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.35;
  margin: 5px 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.store-product-desc {
  font-size: 0.79rem;
  color: #6b7280;
  line-height: 1.45;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.3em;
}

.store-product-card .product-price-row {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.store-product-card .price-current {
  font-size: 1.22rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
}

.store-product-card .price-old {
  font-size: 0.8rem;
  color: #9ca3af;
  text-decoration: line-through;
}

.store-product-installment {
  font-size: 0.74rem;
  color: #6b7280;
  margin-top: 2px;
}

.store-product-pix-hint {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--jesens-burgundy);
  margin-top: 2px;
}

.store-product-add-btn {
  margin-top: 14px;
  width: 100%;
  height: 40px;
  border-radius: 8px;
  font-size: 0.84rem;
}

/* Seções da Vitrine (Espaçamento Claro e Respirável) */
.store-section {
  margin-bottom: 44px;
}

.store-section-surface {
  background: #ffffff;
  border: 1px solid #eceef2;
  border-radius: 14px;
  padding: 26px 26px 28px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.03);
}

.store-section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eceef2;
}

.store-section-header h3 {
  font-size: 1.32rem;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.02em;
}

.store-section-header p {
  font-size: 0.84rem;
  color: #6b7280;
  margin-top: 2px;
}

.store-result-meta {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Grade de Coleções & Mais Vendidos (Realocada abaixo do Catálogo) */
.store-mini-banners-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 1024px) {
  .store-mini-banners-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .store-mini-banners-grid {
    grid-template-columns: 1fr;
  }
}

.store-mini-banner-card {
  position: relative;
  height: 175px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #111827;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.store-mini-banner-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
}

.store-mini-banner-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.store-mini-banner-card:hover img {
  transform: scale(1.06);
}

.store-mini-banner-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 18px 16px 15px;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0) 0%, rgba(17, 24, 39, 0.78) 100%);
  color: #ffffff;
}

.store-mini-banner-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(4px);
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.store-mini-banner-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
}

.store-mini-banner-cta {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.82);
  margin-top: 4px;
  display: inline-block;
}

/* Faixa Limpa de Benefícios / Rodapé da Loja */
.store-benefits-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
  padding: 20px 22px;
  background: #ffffff;
  border: 1px solid #eceef2;
  border-radius: 12px;
}

.store-benefit-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.store-benefit-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #f6f7f9;
  color: var(--jesens-burgundy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.store-benefit-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
}

.store-benefit-sub {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 2px;
}

@media (max-width: 960px) {
  .store-groups-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .store-groups-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .store-search-box {
    width: 100%;
  }

  .store-benefits-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-shell.storefront-mode .page-content {
    padding: 14px 14px 48px;
  }

  .store-promo-carousel {
    min-height: 220px;
    border-radius: 12px;
  }

  .carousel-slide {
    padding: 28px 46px 46px;
  }

  .carousel-slide h2 {
    font-size: 1.5rem;
  }

  .carousel-side-arrow {
    width: 32px;
    height: 32px;
  }

  .carousel-side-arrow.prev { left: 8px; }
  .carousel-side-arrow.next { right: 8px; }

  .store-section-surface {
    padding: 18px 14px 20px;
  }

  .store-benefits-strip {
    grid-template-columns: 1fr;
  }
}

/* Botão da Sacola no Topo da Loja Virtual */
.store-bag-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  background: var(--jesens-burgundy);
  color: #ffffff;
  border: 1px solid var(--jesens-burgundy);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 3px 10px rgba(77, 0, 17, 0.16);
}

.store-bag-trigger:hover {
  background: var(--jesens-burgundy-light);
  border-color: var(--jesens-burgundy-light);
  transform: translateY(-1px);
}

.store-bag-count {
  background: #ffffff;
  color: var(--jesens-burgundy);
  font-size: 0.74rem;
  font-weight: 800;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Gaveta / Modal Deslizante da Sacola de Compras & Checkout */
.bag-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 120;
  display: none;
  justify-content: flex-end;
}

.bag-drawer-backdrop.open {
  display: flex;
}

.bag-drawer-panel {
  width: 100%;
  max-width: 540px;
  background: #ffffff;
  height: 100vh;
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 36px rgba(15, 23, 42, 0.18);
  animation: slideInRight 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.bag-drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.bag-drawer-body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bag-drawer-footer {
  padding: 18px 24px;
  border-top: 1px solid #e5e7eb;
  background: #f8f9fa;
}

/* Cards Minimalistas Monocromáticos de Forma de Pagamento (PIX, Crédito, Débito) */
.payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.payment-method-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 10px;
  border: 1.5px solid #e5e7eb;
  border-radius: 6px;
  background: #ffffff;
  color: #374151;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.payment-method-card:hover {
  border-color: #9ca3af;
  background: #f9fafb;
}

.payment-method-card.active {
  border-color: #111827;
  background: #f3f4f6;
  color: #111827;
  font-weight: 700;
}

.payment-method-card svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
}

/* Tela de Pagamento PIX (QR Code + Copia e Cola + Confirmação) */
.pix-inline-info {
  margin-top: 12px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-left: 3px solid var(--jesens-burgundy);
  border-radius: 8px;
  font-size: 0.79rem;
  color: #374151;
}

.pix-payment-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 6px 2px;
}

.pix-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pix-status-pill.pending {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.pix-status-pill.approved {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.pix-qr-box {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pix-qr-box img {
  width: 215px;
  height: 215px;
  display: block;
  border-radius: 6px;
}

.pix-copy-box {
  width: 100%;
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  text-align: left;
}

.pix-copy-code {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.73rem;
  color: #1f2937;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px 10px;
  resize: none;
  word-break: break-all;
}

.pix-gateway-note {
  width: 100%;
  font-size: 0.74rem;
  color: #6b7280;
  background: #f9fafb;
  border: 1px solid #eceef2;
  border-radius: 8px;
  padding: 9px 12px;
  line-height: 1.45;
}

/* Controles de Menu Mobile / Tablet */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.mobile-menu-trigger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #18181b;
  cursor: pointer;
  flex-shrink: 0;
}

.mobile-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--erp-sidebar-border);
  background: var(--erp-sidebar-hover);
  color: var(--erp-primary-text);
  cursor: pointer;
}

.mobile-close-btn:hover {
  background: var(--erp-sidebar-pill-bg);
  color: var(--erp-primary-text);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(2px);
  z-index: 45;
}

/* =====================================================================
   RESPONSIVIDADE PARA TABLETS E CELULARES
   ===================================================================== */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
    width: 280px;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.14);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .mobile-menu-trigger {
    display: inline-flex;
  }

  .mobile-close-btn {
    display: inline-flex;
  }

  .main-area {
    margin-left: 0;
    width: 100%;
  }

  .topbar {
    padding: 14px 18px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .page-content {
    padding: 18px 16px 36px;
  }

  .storefront-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 20px;
    gap: 16px;
  }

  .storefront-hero h2 {
    font-size: 1.85rem;
  }
}

@media (max-width: 680px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-title h1 {
    font-size: 1.28rem;
    line-height: 1.2;
  }

  .topbar-title p {
    font-size: 0.76rem;
  }

  .topbar-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .topbar-actions .btn {
    flex: 1 1 auto;
    padding: 8px 12px;
    font-size: 0.78rem;
    justify-content: center;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .kpi-value {
    font-size: 1.3rem;
  }

  .card, .card-beige, .card-burgundy {
    padding: 16px 14px;
  }

  .modal-backdrop {
    padding: 8px;
  }

  .modal-box {
    padding: 18px 14px;
    max-height: 95vh;
  }

  .bom-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .bom-summary-total {
    border-left: none;
    padding-left: 0;
  }

  .product-catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .toast-container {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 440px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions .btn {
    flex: 1 1 100%;
  }

  .product-catalog-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================================================================
   REGRAS DE IMPRESSÃO TÉRMICA DIRETA (Elgin / Zebra / Argox)
   ===================================================================== */
@media print {
  body * {
    visibility: hidden;
  }
  #thermal-print-area,
  #thermal-print-area * {
    visibility: visible;
  }
  #thermal-print-area {
    position: absolute;
    left: 0;
    top: 0;
    background: #fff !important;
    padding: 0 !important;
    border: none !important;
  }
  .thermal-roll-row {
    background: transparent !important;
    padding: 0 !important;
    page-break-inside: avoid;
    margin-bottom: 2mm;
  }
  .thermal-label {
    border: none !important;
    box-shadow: none !important;
  }
}
