/* ============================================================
   GODSTORES - Design System Elegante
   ============================================================ */

:root {
  --primary: #0F766E;
  --primary-dark: #115E59;
  --primary-light: #E0F2F0;
  --primary-gradient: linear-gradient(135deg, #2DD4BF 0%, #14B8A6 55%, #0F766E 100%);
  --secondary: #2D3436;
  --surface: #FFFFFF;
  --surface-2: #FBFAF8;
  --bg: #F7F5F2;
  --border: #ECE7E1;
  --border-2: #E9E4DE;
  --text: #2D3436;
  --text-muted: #7A8699;
  --text-strong: #636E72;
  --success: #00B894;
  --danger: #E17055;
  --warning: #FDCB6E;
  --info: #74B9FF;
  --bg-body: #F7F5F2;
  --bg-danger-subtle: #FDEFEC;
  --row-hover: #FFF9F3;
  --scroll-thumb: #D5CFC8;
  --scroll-thumb-hover: #B9B2A8;
  --shadow-sm: 0 1px 2px rgba(45, 52, 54, 0.04), 0 1px 3px rgba(45, 52, 54, 0.06);
  --shadow-md: 0 4px 12px rgba(45, 52, 54, 0.07), 0 2px 4px rgba(45, 52, 54, 0.05);
  --shadow-lg: 0 12px 32px rgba(45, 52, 54, 0.12), 0 4px 8px rgba(45, 52, 54, 0.06);
  --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.18);
  --radius: 14px;
  --radius-lg: 18px;
}

/* ============================================================
   MODO ESCURO - sobrescreve variáveis e classes hardcoded
   ============================================================ */
html.dark {
  color-scheme: dark;
  --primary: #2DD4BF;
  --primary-dark: #14B8A6;
  --primary-light: #12312D;
  --primary-gradient: linear-gradient(135deg, #5EEAD4 0%, #2DD4BF 55%, #0F766E 100%);
  --secondary: #E8ECF1;
  --surface: #1C2026;
  --surface-2: #232830;
  --bg: #12151A;
  --border: #2C333D;
  --border-2: #323A45;
  --text: #E8ECF1;
  --text-muted: #9AA6B2;
  --text-strong: #B6C0CB;
  --success: #2ECC8F;
  --danger: #FF8A6B;
  --warning: #F5C542;
  --info: #7FC1F0;
  --bg-body: #12151A;
  --bg-danger-subtle: #331C18;
  --row-hover: #232A33;
  --scroll-thumb: #3A414B;
  --scroll-thumb-hover: #4A525E;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.35);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5), 0 4px 8px rgba(0,0,0,0.35);
  --shadow-modal: 0 24px 64px rgba(0,0,0,0.6);
}

html.dark body { background: var(--bg); color: var(--text); }
html.dark .page-header { background: rgba(28, 32, 38, 0.85); border-bottom-color: var(--border); }
html.dark #sidebar { background: #15181D; }

/* Transição suave ao alternar tema */
body, .page-header, .card, .stat-card, .modal, .toast, table th, table td, .form-control {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* ============================================================
   MODO ESCURO - sobreposição de classes Tailwind hardcoded
   ============================================================ */
html.dark .bg-white { background-color: var(--surface); }
html.dark .bg-\[\#FAFAFA\] { background-color: var(--surface-2); }
html.dark .bg-\[\#FBFAF8\] { background-color: var(--surface-2); }
html.dark .bg-\[\#F8F6F3\] { background-color: var(--surface-2); }
html.dark .bg-\[\#FFF8F0\] { background-color: #2A2218; }
html.dark .bg-\[\#FEF5E0\] { background-color: #332A12; }
html.dark .bg-\[\#FFF0E0\] { background-color: #16263A; }
html.dark .bg-\[\#E9FBF6\] { background-color: #0D2B26; } /* Card Saldo Atual do caixa */
html.dark .bg-gray-50 { background-color: var(--surface-2); }
html.dark .bg-gray-100 { background-color: #262C35; }
html.dark .bg-gray-200 { background-color: #2C333D; }
html.dark .bg-gray-50\/60 { background-color: rgba(38, 44, 53, 0.6); } /* Cards de métricas das integrações */

/* Alertas/avisos amber (configurações, delivery, conversas) */
html.dark .bg-amber-50 { background-color: #332A12; }
html.dark .border-amber-200 { border-color: #6B531F; }
html.dark .text-amber-600 { color: #F5C542; }
html.dark .text-amber-700 { color: #F5C542; }
html.dark .text-amber-800 { color: #F5C542; }

/* Caixas de destaque teal translúcido (integracões) */
html.dark .bg-\[\#0F766E\]\/5 { background-color: rgba(45, 212, 191, 0.08); }
html.dark .bg-\[\#14B8A6\]\/5 { background-color: rgba(45, 212, 191, 0.08); }
html.dark .border-\[\#0F766E\]\/20 { border-color: rgba(45, 212, 191, 0.25); }
html.dark .border-\[\#14B8A6\]\/25 { border-color: rgba(45, 212, 191, 0.30); }

/* Toggle desligado + badge Keeta (configurações) */
html.dark .bg-gray-300 { background-color: #3A414D; }
html.dark .bg-yellow-100 { background-color: #3A3115; }
html.dark .text-yellow-600 { color: #F5C542; }

/* Campos de endereço/CEP e destaques com fundo menta claro */
html.dark .bg-\[\#F3FEFC\] { background-color: #15241F; }
html.dark .bg-\[\#E6F9F4\] { background-color: #0F2B25; }
html.dark .hover\:bg-\[\#E6F9F4\]:hover { background-color: #122E27; }
/* Fundo azul-claro (ícone do cookie banner, hover do alternador de tema) */
html.dark .bg-\[\#E9EFF7\] { background-color: #232A33; }
html.dark .hover\:bg-\[\#E9EFF7\]:hover { background-color: #2A323D; }
/* Linhas divisoras claras (login) */
html.dark .bg-\[\#ECE7E1\] { background-color: var(--border); }

html.dark .border-\[\#E9E4DE\] { border-color: var(--border-2); }
html.dark .border-\[\#ECE7E1\] { border-color: var(--border); }
html.dark .border-\[\#F8E7D5\] { border-color: #4A3A24; }
html.dark .border-\[\#A8E6D8\] { border-color: #1E4A42; } /* Borda do card Saldo Atual do caixa */
html.dark .border-\[\#FFCC80\] { border-color: #6B531F; }
html.dark .border-\[\#F0EDE8\] { border-color: var(--border); }
html.dark .border-\[\#F0ECE6\] { border-color: var(--border); }
html.dark .border-\[\#D8D2CA\] { border-color: var(--border-2); }
html.dark .border-\[\#F5E6D3\] { border-color: #4A3A24; }
html.dark .border-\[\#F1ECE5\] { border-color: var(--border); }

/* --- Auditoria dark: textos escuros que sumiriam no modo escuro --- */
html.dark .text-\[\#115E59\] { color: #2DD4BF; }
html.dark .text-\[\#0F172A\] { color: var(--text); }
html.dark .text-\[\#4A5560\] { color: var(--text-strong); }
html.dark .text-\[\#B7791F\] { color: #F5C542; }
html.dark .text-\[\#CA8A04\] { color: #F5C542; }
html.dark .text-\[\#0D9488\] { color: #2DD4BF; }
html.dark .text-\[\#C0392B\] { color: #FF8A6B; }
html.dark .text-\[\#E17055\] { color: #FF8A6B; }

/* --- Auditoria dark: fundos claros remanescentes (avisos/hovers/sidebar/FAQ) --- */
html.dark .bg-\[\#FFE5E5\] { background-color: #331C18; }
html.dark .bg-\[\#FDCFCF\] { background-color: #3A201C; }
html.dark .bg-\[\#FDEFEC\] { background-color: #331C18; }
html.dark .bg-\[\#F0FAF9\] { background-color: #0F2B25; }
html.dark .bg-\[\#FAFAF7\] { background-color: var(--surface-2); }
html.dark .bg-\[\#FAFAFC\] { background-color: var(--surface-2); }
html.dark .bg-\[\#FAF8F5\] { background-color: var(--surface-2); }
html.dark .bg-\[\#F4F9F7\] { background-color: #15181D; }
html.dark .bg-\[\#E7F3F0\] { background-color: #1A2B26; }
html.dark .bg-\[\#DCEFEA\] { background-color: #1E3530; }
html.dark .bg-\[\#FFF4E0\] { background-color: #332A12; }
html.dark .bg-\[\#FFF7ED\] { background-color: #332315; }
html.dark .bg-\[\#E9E4DE\] { background-color: var(--border-2); }
html.dark .hover\:bg-\[\#F0FAF9\]:hover { background-color: #0F2B25; }
html.dark .hover\:bg-\[\#FDEFEC\]:hover { background-color: #331C18; }
html.dark .hover\:bg-\[\#FAFAFC\]:hover { background-color: #262C35; }
html.dark .hover\:bg-\[\#FAF8F5\]:hover { background-color: #232830; }
html.dark .hover\:bg-\[\#E7F3F0\]:hover { background-color: #1A2B26; }
html.dark .active\:bg-\[\#DCEFEA\]:active { background-color: #1E3530; }
/* Hover de texto/borda em teal escuro (toggle de tema, links, ações de tabela) */
html.dark .hover\:text-\[\#0F766E\]:hover { color: #2DD4BF; }
html.dark .hover\:border-\[\#0F766E\]:hover { border-color: #2DD4BF; }
html.dark .group-hover\:text-\[\#0F766E\]:hover, html.dark .group:hover .group-hover\:text-\[\#0F766E\] { color: #2DD4BF; }
html.dark .border-gray-100 { border-color: var(--border); }
html.dark .border-gray-200 { border-color: var(--border-2); }
html.dark .border-gray-300 { border-color: var(--border-2); }
html.dark .divide-gray-100 > :not([hidden]) ~ :not([hidden]) { border-color: var(--border); }

html.dark .text-\[\#2D3436\] { color: var(--text); }
html.dark .text-\[\#636E72\] { color: var(--text-strong); }
html.dark .text-\[\#7A8699\] { color: var(--text-muted); }
html.dark .text-\[\#B2BEC3\] { color: #7B8794; }
html.dark .text-\[\#5A6673\] { color: var(--text-muted); }
html.dark .text-\[\#8A93A0\] { color: var(--text-muted); }
html.dark .text-\[\#B9B2A8\] { color: #7B8794; }
html.dark .text-\[\#14B8A6\] { color: #2DD4BF; }
html.dark .text-\[\#0F766E\] { color: #2DD4BF; }
html.dark .text-gray-400 { color: #7B8794; }
html.dark .text-gray-500 { color: var(--text-muted); }
html.dark .text-gray-600 { color: var(--text-strong); }
html.dark .text-gray-700 { color: var(--text); }
html.dark .text-gray-800 { color: var(--text); }

html.dark .hover\:bg-\[\#FFF0E0\]:hover { background-color: #16263A; }
html.dark .hover\:bg-\[\#E6F9F4\]:hover { background-color: #12261F; }
html.dark .hover\:bg-gray-50:hover { background-color: #262C35; }
html.dark .hover\:bg-gray-100:hover { background-color: #2C333D; }
html.dark .hover\:text-\[\#2D3436\]:hover { color: var(--text); }
html.dark .hover\:text-gray-600:hover { color: var(--text-strong); }
html.dark .hover\:border-\[\#14B8A6\]:hover { border-color: #2DD4BF; }
html.dark .focus\:bg-white:focus { background-color: var(--surface); }

/* Ícones suaves de estatística (bg-*-50) */
html.dark .bg-green-50 { background-color: #12261F; }
html.dark .bg-blue-50 { background-color: #122536; }
html.dark .bg-orange-50 { background-color: #332315; }
html.dark .bg-red-50 { background-color: #331C18; }
html.dark .bg-yellow-50 { background-color: #332A12; }
html.dark .bg-purple-50 { background-color: #261C36; }
html.dark .from-orange-50 { --tw-gradient-from: #332315; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(51,35,21,0)); }
html.dark .to-amber-50 { --tw-gradient-to: #332A12; }

/* Promo banner do PDV */
html.dark #promoBanner { background: #2A2215; border-color: #6B531F; }

/* ============================================================
   MODO ESCURO - componentes do style.css
   ============================================================ */
html.dark ::selection { background: rgba(245, 146, 74, 0.3); color: #FFE3C2; }
html.dark ::-webkit-scrollbar-thumb { background: var(--scroll-thumb); }
html.dark ::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
html.dark .toast { background: rgba(28, 32, 38, 0.9); }
html.dark .modal { border-color: rgba(255,255,255,0.08); }
html.dark .modal-header { background: rgba(28, 32, 38, 0.92); }
html.dark .modal-footer { background: var(--surface-2); }
html.dark .btn-close:hover { background: #331C18; }
html.dark .btn-remove-item:hover { background: #331C18; }
html.dark .cart-drag-handle { background: var(--scroll-thumb); }
html.dark .cart-summary { background: var(--surface-2); }
html.dark .toggle-slider { background: #3A414B; }
html.dark input[type="date"].form-control, html.dark input[type="time"].form-control { color-scheme: dark; }

/* Badges no escuro */
html.dark .badge-success { background: #12261F; color: #45E0B2; border-color: #1E4A3F; }
html.dark .badge-danger { background: #331C18; color: #FF9B85; border-color: #5A3023; }
html.dark .badge-warning { background: #332A12; color: #F5C542; border-color: #55481A; }
html.dark .badge-info { background: #122536; color: #7FC1F0; border-color: #24506E; }

/* Ícones de estatística no escuro */
html.dark .stat-icon.orange { background: linear-gradient(135deg, #332315, #2A1D10); box-shadow: inset 0 0 0 1px rgba(245,158,11,0.28); }
html.dark .stat-icon.green { background: linear-gradient(135deg, #12261F, #0F201C); box-shadow: inset 0 0 0 1px rgba(46,204,143,0.25); }
html.dark .stat-icon.blue { background: linear-gradient(135deg, #122536, #0F2031); box-shadow: inset 0 0 0 1px rgba(127,193,240,0.25); }
html.dark .stat-icon.purple { background: linear-gradient(135deg, #261C36, #211A30); box-shadow: inset 0 0 0 1px rgba(180,120,240,0.25); }
html.dark .stat-icon.red { background: linear-gradient(135deg, #331C18, #2C1A16); box-shadow: inset 0 0 0 1px rgba(255,138,107,0.25); }
html.dark .stat-icon.amber { background: linear-gradient(135deg, #332A12, #2D2613); box-shadow: inset 0 0 0 1px rgba(245,197,66,0.25); }
html.dark .stat-icon.teal { background: linear-gradient(135deg, #0F241F, #0C1F1B); box-shadow: inset 0 0 0 1px rgba(46,204,143,0.22); }
html.dark .stat-card { border-color: rgba(255,255,255,0.07); }
html.dark .card { border-color: rgba(255,255,255,0.07); }
html.dark table th { background: var(--surface-2); }
html.dark table tbody tr:hover { background: var(--row-hover); }
html.dark .form-control { background: var(--surface-2); }
html.dark .form-control:hover { border-color: var(--border-2); }
html.dark .form-control:focus { background: var(--surface); }
html.dark .form-group label { color: var(--text-strong); }
html.dark .empty-state p { color: #7B8794; }
html.dark .search-box .search-icon { color: #7B8794; }

/* --- Base --- */
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  letter-spacing: -0.01em;
}
::selection { background: rgba(20, 184, 166, 0.24); color: #115E59; }

/* --- Scrollbar Custom --- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D5CFC8; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #B9B2A8; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* --- Page Entry Animation (apenas o conteúdo, não o header sticky) --- */
main > div:last-child { animation: pageFade 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes pageFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- Login Page: Gradiente Animado (sutil) --- */
body.login-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: linear-gradient(160deg, #0B1B22 0%, #0F2A30 45%, #0E2433 70%, #0B1B22 100%);
  background-size: 220% 220%;
  animation: gradientShift 26s ease-in-out infinite;
}
@keyframes gradientShift {
  0%   { background-position: 0% 0%; }
  50%  { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

/* --- Login Page: Canvas de Partículas --- */
#particlesCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* --- Login Page: Brilho de fundo (discreto) --- */
.login-page::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -40%;
  width: 180%;
  height: 180%;
  background:
    radial-gradient(circle at 30% 40%, rgba(20, 184, 166, 0.10) 0%, transparent 45%),
    radial-gradient(circle at 70% 60%, rgba(15, 118, 110, 0.07) 0%, transparent 40%);
  animation: loginGlow 18s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes loginGlow {
  0% { transform: translate(0, 0) scale(1); opacity: 0.85; }
  100% { transform: translate(-1%, -1%) scale(1.02); opacity: 1; }
}
.login-page::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 50% 35%, rgba(45, 212, 191, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

/* --- Toast / Modal Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(24px) scale(0.98); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(120%); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Spinner --- */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(20, 184, 166, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 16px;
}

/* --- Toggle Switch --- */
.toggle-switch { position: relative; width: 46px; height: 26px; cursor: pointer; display: inline-block; flex-shrink: 0; }
.toggle-switch input { display: none; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #E2DCD4; border-radius: 13px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.08);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 20px; height: 20px; border-radius: 50%;
  background: white; top: 3px; left: 3px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.toggle-switch input:checked + .toggle-slider { background: var(--success); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* --- Modal Overlay --- */
.modal-overlay.active { display: flex !important; }

/* --- Toast --- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(92vw, 380px);
}
.toast {
  animation: slideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--success);
  line-height: 1.45;
}
.toast span { font-size: 16px; line-height: 1.3; }
.toast-removing { animation: slideOut 0.3s ease forwards; }
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: #F0A500; }
.toast-info { border-left-color: var(--info); }

/* --- PDV Mobile Cart --- */
@media (max-width: 1024px) {
  .pdv-cart {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 60vh; z-index: 500;
    border-radius: 20px 20px 0 0;
    transform: translateY(calc(100% - 60px));
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.18);
  }
  .pdv-cart.expanded { transform: translateY(0); }
  .pdv-cart #cartItems { overflow-y: auto; flex: 1; min-height: 0; }
  .cart-drag-handle {
    display: block !important;
    width: 44px; height: 5px;
    background: #D5CFC8; border-radius: 3px;
    margin: 10px auto 4px;
  }
}

/* ============================================================
   COMPONENTES
   ============================================================ */

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border: none; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none; white-space: nowrap;
  letter-spacing: -0.01em;
}
.btn:active { transform: scale(0.96); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 2px 6px rgba(20, 184, 166, 0.35);
}
/* Gradiente primário adaptável (claro/escuro) para botões de destaque em Tailwind */
.btn-gradient {
  background-image: var(--primary-gradient);
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 6px 16px rgba(20, 184, 166, 0.4); transform: translateY(-1px); }
.btn-outline {
  background: transparent; border: 1.5px solid var(--border); color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-danger { background: linear-gradient(135deg, #F47B5F, var(--danger)); color: white; box-shadow: 0 2px 6px rgba(225, 112, 85, 0.3); }
.btn-danger:hover { filter: brightness(1.05); box-shadow: 0 6px 16px rgba(225, 112, 85, 0.35); transform: translateY(-1px); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn-close {
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: #A9B2BC; transition: all 0.25s; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; line-height: 1;
}
.btn-close:hover { background: #FDECEC; color: var(--danger); transform: rotate(90deg); }

/* --- Cards --- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(236, 231, 225, 0.7);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-header h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.card-body { padding: 22px; }

/* --- Tables --- */
.table-container { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13.5px; }
table th {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); font-weight: 700; background: #FBFAF8;
  position: sticky; top: 0; z-index: 1;
}
table tbody tr { transition: background 0.15s ease; }
table tbody tr:hover { background: #FFF9F3; }
table tbody tr:last-child td { border-bottom: none; }

/* --- Forms --- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 600; color: #5A6673; margin-bottom: 6px; letter-spacing: 0.01em; }
.form-control {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; transition: all 0.22s ease;
  background: #FBFAF8; font-family: inherit; color: var(--text);
}
.form-control:hover { border-color: #D8D1C8; }
.form-control:focus {
  outline: none; border-color: var(--primary); background: white;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
input[type="date"].form-control, input[type="time"].form-control { color-scheme: light; }

/* --- Badges --- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  border: 1px solid transparent;
}
.badge-success { background: #E6F9F4; color: #00875A; border-color: #C9F0E5; }
.badge-danger { background: #FDEFEC; color: #C0392B; border-color: #F8DCD3; }
.badge-warning { background: #FEF6E3; color: #9A6B00; border-color: #F8E7BB; }
.badge-info { background: #EAF4FE; color: #2471A3; border-color: #CFE6F9; }
.badge-receita { background: #F3EFFA; color: #6C3FA8; border-color: #E3D8F5; }

/* --- Stat Grid --- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(236, 231, 225, 0.7);
  display: flex; align-items: center; gap: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
  position: relative;
}
/* Badge pulsante: meta proporcional do dia superada */
.goal-day-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #00B894, #2ECC8F);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 184, 150, 0.45);
  animation: goal-day-pulse 1.2s ease-in-out infinite;
  z-index: 2;
  cursor: help;
}
@keyframes goal-day-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(0, 184, 150, 0.45); }
  50% { transform: scale(1.07); box-shadow: 0 7px 20px rgba(0, 184, 150, 0.65); }
}
/* Glow sutil no card quando a meta do dia é batida */
.stat-card.goal-hit { border-color: rgba(0, 184, 150, 0.5); box-shadow: 0 6px 18px rgba(0, 184, 150, 0.18), var(--shadow-md); }
html.dark .stat-card.goal-hit { border-color: rgba(46, 204, 143, 0.55); }
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(20, 184, 166, 0.25);
}
.stat-icon {
  width: 50px; height: 50px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
  color: var(--primary);
}
.stat-icon svg { flex-shrink: 0; }
.stat-icon.green { color: #00967D; }
.stat-icon.blue { color: #1F6FB2; }
.stat-icon.purple { color: #7B4FC0; }
.stat-icon.red { color: #D95F47; }
.stat-icon.amber { color: #A87C17; }
.stat-icon.teal { color: #00967D; }
html.dark .stat-icon.orange { color: #F5B84D; }
html.dark .stat-icon.green { color: #2ECC8F; }
html.dark .stat-icon.blue { color: #7FC1F0; }
html.dark .stat-icon.purple { color: #C49BEC; }
html.dark .stat-icon.red { color: #FF8A6B; }
html.dark .stat-icon.amber { color: #F5C542; }
html.dark .stat-icon.teal { color: #2ECC8F; }
.stat-icon.orange { color: #D97706; background: linear-gradient(135deg, #FEF1E2, #FBDCBC); box-shadow: inset 0 0 0 1px rgba(217,119,6,0.16); }
.stat-icon.green { background: linear-gradient(135deg, #E9FBF6, #CDF5EA); box-shadow: inset 0 0 0 1px rgba(0,184,148,0.12); }
.stat-icon.blue { background: linear-gradient(135deg, #EAF5FE, #D0E9FB); box-shadow: inset 0 0 0 1px rgba(116,185,255,0.15); }
.stat-icon.purple { background: linear-gradient(135deg, #F5EDFF, #E8D8FC); box-shadow: inset 0 0 0 1px rgba(155,89,182,0.12); }
.stat-icon.red { background: linear-gradient(135deg, #FDEFEC, #FBDDD6); box-shadow: inset 0 0 0 1px rgba(225,112,85,0.12); }
.stat-icon.amber { background: linear-gradient(135deg, #FEF6E3, #FBECC8); box-shadow: inset 0 0 0 1px rgba(253,203,110,0.15); }
.stat-icon.teal { background: linear-gradient(135deg, #E6FBF7, #C8F3EA); box-shadow: inset 0 0 0 1px rgba(0,184,148,0.14); }
.stat-info { flex: 1; min-width: 0; }
.stat-info .stat-label { font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 600; }
.stat-info .stat-value { font-size: 25px; font-weight: 800; color: var(--text); margin-top: 3px; line-height: 1.15; letter-spacing: -0.03em; }
/* Linha secundária dentro do card (ex.: Vendas dia/mês, Ticket médio ano) */
.stat-sub {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 5px;
  font-size: 11.5px;
}
.stat-sub .stat-sub-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  opacity: 0.85;
}
.stat-sub .stat-sub-value {
  font-weight: 800;
  color: var(--primary);
  font-size: 12.5px;
}
html.dark .stat-sub .stat-sub-value { color: #2DD4BF; }
/* % da meta atingida no último card da primeira parte */
.stat-stacked { flex-wrap: wrap; }
.goal-percent {
  flex-basis: 100%; margin-top: 4px; padding-top: 10px;
  border-top: 1px dashed rgba(127, 141, 158, 0.28);
}
.goal-percent-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10.5px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px;
}
.goal-percent-value { color: var(--primary); font-size: 12.5px; letter-spacing: 0; }
.goal-mini-bar { height: 5px; border-radius: 999px; background: rgba(127, 141, 158, 0.2); overflow: hidden; }
.goal-mini-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #14B8A6, #0F766E);
  transition: width 0.6s ease;
}
.goal-mini-fill.done { background: linear-gradient(90deg, #00B894, #2ECC8F); }
html.dark .goal-percent { border-top-color: rgba(255, 255, 255, 0.12); }
html.dark .goal-mini-bar { background: rgba(255, 255, 255, 0.12); }

/* --- Utilities --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }

/* --- Modal --- */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(20, 22, 26, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000; align-items: center; justify-content: center;
  padding: 16px;
  animation: fadeIn 0.25s ease;
}
.modal {
  background: var(--surface);
  border-radius: 18px;
  width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-modal);
  animation: slideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  border: 1px solid rgba(255,255,255,0.6);
}
.modal-sm { max-width: 400px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  z-index: 1; border-radius: 18px 18px 0 0;
}
.modal-header h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  background: #FBFAF8; border-radius: 0 0 18px 18px;
}

/* --- Search Box --- */
.search-box { position: relative; }
.search-box .search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #B9B2A8; font-size: 15px; }

/* --- Product items (PDV) --- */
.product-item {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.product-item::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.product-item:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(20, 184, 166, 0.14);
}
.product-item:hover::before { opacity: 1; }
.product-item:active { transform: scale(0.96); }
.product-item .product-emoji {
  font-size: 38px; margin-bottom: 10px; display: block;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.08));
  transition: transform 0.25s ease;
}
.product-item:hover .product-emoji { transform: scale(1.12) rotate(-3deg); }
.product-item .product-photo {
  width: 52px; height: 52px;
  border-radius: 12px;
  object-fit: cover;
  margin: 0 auto 10px;
  display: block;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: transform 0.25s ease;
}  .product-item:hover .product-photo { transform: scale(1.12) rotate(-3deg); }

  /* Miniaturas de produto (cozinha, tabela de produtos, PDV) */
  .product-thumb {
    object-fit: cover;
    border-radius: 8px;
    vertical-align: middle;
    flex-shrink: 0;
  }
  .product-thumb-30 { width: 30px; height: 30px; border-radius: 7px; margin-right: 8px; }
  .product-thumb-38 { width: 38px; height: 38px; }
  .product-thumb-42 { width: 42px; height: 42px; border-radius: 10px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }

  /* Linha de item no card de delivery */
  .delivery-item {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 0; font-size: 13px;
    border-bottom: 1px dashed var(--border);
  }
  .delivery-item:last-child { border-bottom: none; }
  .delivery-item .qty-badge { background: var(--bg-body); font-weight: 700; }

  .product-item .product-name { font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--text); }
.product-item .product-price { font-size: 16px; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }

.category-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer; transition: all 0.22s ease;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}
.category-chip:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); transform: translateY(-1px); }
.category-chip.active {
  border-color: var(--primary);
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.cart-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 6px; border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info .item-name { font-size: 14px; font-weight: 600; }
.cart-item-info .item-price { font-size: 13px; color: var(--primary); font-weight: 700; }
.cart-item-qty { display: flex; align-items: center; gap: 7px; }
.cart-item-qty button {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease; color: var(--text);
}
.cart-item-qty button:hover { background: var(--primary); color: white; border-color: var(--primary); transform: scale(1.1); }
.cart-item-qty button:active { transform: scale(0.9); }
.cart-item-qty .qty-value { font-weight: 700; font-size: 15px; min-width: 24px; text-align: center; }
.btn-remove-item {
  background: none; border: none; color: #C5C0B8; cursor: pointer;
  font-size: 15px; transition: all 0.2s ease; padding: 5px;
  width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
}
.btn-remove-item:hover { color: var(--danger); background: #FDEFEC; }

.cart-summary { padding: 16px 20px; border-top: 1px solid var(--border); background: #FBFAF8; }
.cart-summary .summary-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }

.empty-state { text-align: center; padding: 48px 20px; }
.empty-state .empty-icon {
  font-size: 56px; margin-bottom: 16px; opacity: 0.4;
  display: inline-block;
  animation: floatIcon 3s ease-in-out infinite;
}
@keyframes floatIcon { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.empty-state h3 { color: var(--text-muted); font-size: 15px; margin-bottom: 8px; font-weight: 600; }
.empty-state p { color: #B9B2A8; font-size: 13.5px; margin-bottom: 16px; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .toast-container { top: 12px; right: 12px; }
}

/* --- Acessibilidade: respeitar preferência por menos movimento --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .login-page::before, .login-page::after { animation: none !important; }
}

/* ============================================================
   SIDEBAR REFINEMENTS (usa classes do header.php)
   ============================================================ */
.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(178, 190, 195, 0.45);
  padding: 18px 20px 6px;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 18px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.55);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 3px solid transparent;
  font-weight: 500;
}
.nav-item .nav-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.25s ease;
  flex-shrink: 0;
}
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.nav-item:hover .nav-icon { background: rgba(20, 184, 166, 0.2); transform: scale(1.08); }
.nav-item.active {
  color: #5EEAD4;
  border-left-color: var(--primary);
  background: linear-gradient(90deg, rgba(20, 184, 166, 0.16), rgba(20, 184, 166, 0.04));
}
.nav-item.active .nav-icon { background: rgba(20, 184, 166, 0.28); color: #5EEAD4; }
.nav-item .nav-badge {
  background: var(--danger);
  color: white; font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; line-height: 1.5;
}
/* Badge "Novo" — documento legal atualizado aguardando reaceite (aviso discreto) */
.nav-badge-novo {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2DD4BF, #14B8A6);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.6;
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.35);
  animation: badge-novo-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes badge-novo-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.72; transform: scale(0.97); }
}
.sidebar-section-label .nav-badge-novo {
  margin-left: 6px;
  vertical-align: 1px;
}
@media (prefers-reduced-motion: reduce) {
  .nav-badge-novo { animation: none; }
}
.sidebar-brand {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.14), rgba(253, 203, 110, 0.05));
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.user-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

/* ============================================================
   SIDEBAR — MODO CLARO (verde-água claro)
   O menu mantém a identidade verde-água, porém com fundo claro.
   No modo escuro (html.dark) restaura o visual escuro atual.
   ============================================================ */
#sidebar { background: #F4F9F7; color: #2D3436; }
#sidebar .sidebar-brand {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.10), rgba(20, 184, 166, 0.03));
  border-bottom-color: rgba(15, 118, 110, 0.12);
}
.sidebar-section-label { color: rgba(15, 118, 110, 0.55); }
.nav-item { color: #5A6B66; }
.nav-item:hover { color: #0F766E; background: rgba(20, 184, 166, 0.08); }
.nav-item:hover .nav-icon { background: rgba(20, 184, 166, 0.18); transform: scale(1.08); }
.nav-item.active {
  color: #0F766E;
  border-left-color: var(--primary);
  background: linear-gradient(90deg, rgba(20, 184, 166, 0.16), rgba(20, 184, 166, 0.04));
}
.nav-item.active .nav-icon { background: rgba(20, 184, 166, 0.22); color: #0F766E; }

/* Modo escuro: mantém o visual escuro original do menu */
html.dark #sidebar { background: #15181D; color: #fff; }
html.dark #sidebar .sidebar-brand {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.14), rgba(253, 203, 110, 0.05));
  border-bottom-color: rgba(255, 255, 255, 0.07);
}
html.dark .sidebar-section-label { color: rgba(178, 190, 195, 0.45); }
html.dark .nav-item { color: rgba(255, 255, 255, 0.55); }
html.dark .nav-item:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
html.dark .nav-item:hover .nav-icon { background: rgba(20, 184, 166, 0.2); }
html.dark .nav-item.active {
  color: #5EEAD4;
  border-left-color: var(--primary);
  background: linear-gradient(90deg, rgba(20, 184, 166, 0.16), rgba(20, 184, 166, 0.04));
}
html.dark .nav-item.active .nav-icon { background: rgba(20, 184, 166, 0.28); color: #5EEAD4; }

/* ============================================================
   RELATÓRIOS — botões de período rápido (dia/mês/trimestre/semestre/ano)
   ============================================================ */
.report-period-btn {
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #5A6673;
  background: transparent;
  border: 1.5px solid #ECE7E1;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.report-period-btn:hover {
  border-color: #14B8A6;
  color: #0F766E;
  background: #E6F9F4;
}
.report-period-btn.active {
  background: linear-gradient(135deg, #14B8A6, #0F766E);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.3);
}
html.dark .report-period-btn { color: var(--text-strong); border-color: var(--border-2); }
html.dark .report-period-btn:hover { border-color: #2DD4BF; color: #2DD4BF; background: rgba(20, 184, 166, 0.12); }

/* --- Page Header refinado --- */
.page-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   RELATÓRIOS - gráficos e resumos visuais
   ============================================================ */
.report-chart-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.report-chart-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.report-chart-header h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.report-chart-header .report-total {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.report-chart-body { padding: 18px 20px; }

/* Ranking com barras horizontais */
.ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
}
.ranking-item + .ranking-item { border-top: 1px dashed var(--border); }
.ranking-pos {
  width: 26px; height: 26px;
  flex-shrink: 0;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  color: var(--text-muted);
  background: var(--surface-2);
}
.ranking-item:nth-child(1) .ranking-pos { background: linear-gradient(135deg, #2DD4BF, #0F766E); color: #fff; }
.ranking-item:nth-child(2) .ranking-pos { background: linear-gradient(135deg, #B8C0CC, #9AA6B2); color: #fff; }
.ranking-item:nth-child(3) .ranking-pos { background: linear-gradient(135deg, #D9A06B, #B87F4A); color: #fff; }
.ranking-info { flex: 1; min-width: 0; }
.ranking-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 5px;
}
.ranking-bar {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.ranking-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary-gradient);
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.ranking-value {
  text-align: right;
  flex-shrink: 0;
}
.ranking-value .v {
  font-size: 13px; font-weight: 800; color: var(--text);
  letter-spacing: -0.01em;
}
.ranking-value .s {
  font-size: 10.5px; color: var(--text-muted);
  font-weight: 500;
}

/* ============================================================
   META DE VENDAS - barra de progresso visual
   ============================================================ */
.goal-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}
.goal-card::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 4px;
  background: var(--primary-gradient);
}
.goal-card.done::before { background: linear-gradient(180deg, #00B894, #2ECC8F); }
.goal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.goal-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.goal-icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.goal-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}
.goal-value {
  font-size: 21px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.goal-of {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}
.goal-right { text-align: right; flex-shrink: 0; }
.goal-pct {
  font-size: 26px;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.goal-card.done .goal-pct {
  background: linear-gradient(135deg, #2ECC8F, #00B894);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.goal-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.goal-status.pending { background: var(--primary-light); color: var(--primary); }
.goal-status.ok { background: #E6F9F4; color: #00875A; }
html.dark .goal-status.ok { background: #12261F; color: #45E0B2; }
.goal-bar {
  height: 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
  margin: 16px 0 10px;
  position: relative;
}
.goal-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary-gradient);
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}
.goal-bar-fill.done { background: linear-gradient(90deg, #00B894, #2ECC8F); }
/* Brilho sutil percorrendo a barra */
.goal-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
  animation: goal-shine 2.6s ease-in-out infinite;
}
@keyframes goal-shine {
  0% { left: -45%; }
  55%, 100% { left: 105%; }
}
.goal-diff { font-size: 12px; font-weight: 600; }
.goal-diff.up { color: var(--success); }
.goal-diff.down { color: var(--danger); }
/* Rodapé com edição inline da meta (dashboard) */
.goal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.goal-edit { display: flex; align-items: center; gap: 8px; }
.goal-edit label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}
.goal-meta-input { max-width: 150px; }
.goal-setup {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.goal-setup-text {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.goal-setup-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.goal-setup-link:hover { opacity: 0.8; }

/* Donut e legenda de pagamentos */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.donut-legend { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 10px; }
.donut-legend .lg-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--text);
}
.donut-legend .lg-dot {
  width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0;
}
.donut-legend .lg-name { flex: 1; font-weight: 600; }
.donut-legend .lg-pct { font-weight: 800; color: var(--text); }
.donut-legend .lg-val { color: var(--text-muted); font-size: 11.5px; min-width: 76px; text-align: right; }

/* ============================================================
   COMPARATIVO DE PERÍODOS
   ============================================================ */
.comp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.comp-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  position: relative;
}
.comp-icon { font-size: 20px; margin-bottom: 6px; }
.comp-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-bottom: 4px;
}
.comp-value {
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.comp-prev {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}
.comp-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
}
.comp-delta.up { background: #E6F9F4; color: #00875A; }
.comp-delta.down { background: #FDEFEC; color: #C0392B; }
.comp-delta.flat { background: var(--surface-2); color: var(--text-muted); }
html.dark .comp-delta.up { background: #12261F; color: #45E0B2; }
html.dark .comp-delta.down { background: #331C18; color: #FF9B85; }

/* --- Botão de ação no header (primary pill) --- */
.header-action-btn {
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s ease;
  box-shadow: 0 2px 6px rgba(20, 184, 166, 0.3);
  display: inline-flex; align-items: center; gap: 6px;
}
.header-action-btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 6px 14px rgba(20, 184, 166, 0.35); }
.header-action-btn:active { transform: scale(0.96); }

/* ============================================================
   MODO COMPACTO 720p - interface densa e legível
   (sobrepõe componentes e utilitários Tailwind do CDN)
   ============================================================ */
body { font-size: 13px; }

/* --- Header, sidebar e conteúdo --- */
.page-header { padding: 8px 20px !important; }
.page-header h1 { font-size: 16px; }
#sidebar { width: 224px; }
.sidebar-brand span.w-11 { width: 36px; height: 36px; font-size: 18px; }
@media (min-width: 768px) {
  /* Apenas no layout do ERP (páginas com sidebar via includes/header.php).
     Páginas públicas (ex.: planos.php) também usam <main class="flex-1"> e
     não devem ser empurradas 224px para a direita. */
  body.erp-app main.flex-1 { margin-left: 224px; }
}

/* --- Spacings utilitários (ganham do Tailwind CDN) --- */
.p-1 { padding: 4px !important; }
.p-2 { padding: 6px !important; }
.p-3 { padding: 9px !important; }
.p-4 { padding: 11px !important; }
.p-5 { padding: 14px !important; }
.p-6 { padding: 16px !important; }
.px-2 { padding-left: 6px !important; padding-right: 6px !important; }
.px-3 { padding-left: 10px !important; padding-right: 10px !important; }
.px-4 { padding-left: 12px !important; padding-right: 12px !important; }
.px-5 { padding-left: 14px !important; padding-right: 14px !important; }
.px-6 { padding-left: 16px !important; padding-right: 16px !important; }
.py-1 { padding-top: 3px !important; padding-bottom: 3px !important; }
.py-1\.5 { padding-top: 4px !important; padding-bottom: 4px !important; }
.py-2 { padding-top: 5px !important; padding-bottom: 5px !important; }
.py-2\.5 { padding-top: 6px !important; padding-bottom: 6px !important; }
.py-3 { padding-top: 7px !important; padding-bottom: 7px !important; }
.py-4 { padding-top: 9px !important; padding-bottom: 9px !important; }
.py-5 { padding-top: 11px !important; padding-bottom: 11px !important; }
.py-12 { padding-top: 28px !important; padding-bottom: 28px !important; }
.py-16 { padding-top: 36px !important; padding-bottom: 36px !important; }
.mb-3 { margin-bottom: 8px !important; }
.mb-4 { margin-bottom: 10px !important; }
.mb-5 { margin-bottom: 12px !important; }
.mb-6 { margin-bottom: 14px !important; }
.mt-4 { margin-top: 10px !important; }
.mt-5 { margin-top: 12px !important; }
.gap-2 { gap: 6px !important; }
.gap-3 { gap: 8px !important; }
.gap-4 { gap: 10px !important; }
.gap-5 { gap: 12px !important; }
.gap-6 { gap: 14px !important; }
.md\:p-5 { padding: 14px !important; }
.md\:p-6 { padding: 16px !important; }
.lg\:p-8 { padding: 20px !important; }

/* --- Componentes --- */
.card-header { padding: 12px 16px; }
.card-header h3 { font-size: 13.5px; }
.card-body { padding: 15px 16px; }
table th, table td { padding: 9px 12px; font-size: 12.5px; }
table th { font-size: 10px; }
.form-control { padding: 8px 11px; font-size: 13px; border-radius: 8px; }
.form-group { margin-bottom: 11px; }
.form-group label { font-size: 11.5px; margin-bottom: 4px; }
.form-row { gap: 10px; }
textarea.form-control { min-height: 60px; }
.btn { padding: 8px 14px; font-size: 13px; border-radius: 8px; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.header-action-btn { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.stat-card { padding: 14px; gap: 12px; }
.stat-icon { width: 40px; height: 40px; font-size: 19px; border-radius: 11px; }
.stat-info .stat-label { font-size: 10px; }
.stat-info .stat-value { font-size: 20px; margin-top: 2px; }
.stat-sub { font-size: 10px; margin-top: 3px; }
.stat-sub .stat-sub-value { font-size: 11px; }
.goal-percent { margin-top: 2px; padding-top: 8px; }
.goal-percent-head { font-size: 9.5px; margin-bottom: 5px; }
.goal-percent-value { font-size: 11px; }
.goal-mini-bar { height: 4px; }
.report-chart-header { padding: 11px 16px; }
.report-chart-header h4 { font-size: 12.5px; }
.report-chart-body { padding: 12px 16px; }
.ranking-item { padding: 6px 0; }
.ranking-bar { height: 6px; }
.comp-card { padding: 10px; }
.comp-value { font-size: 16px; }
.goal-card { padding: 14px 16px; }
.goal-icon { width: 38px; height: 38px; font-size: 19px; border-radius: 11px; }
.goal-value { font-size: 18px; }
.goal-pct { font-size: 22px; }
.goal-bar { height: 10px; margin: 12px 0 8px; }
.goal-status { font-size: 10px; padding: 3px 8px; }
.cart-item { padding: 9px 6px; gap: 10px; }
.cart-item-info .item-name { font-size: 13px; }
.cart-item-qty button { width: 24px; height: 24px; font-size: 12px; }
.product-item { padding: 10px 8px; border-radius: 12px; }  .product-item .product-emoji { font-size: 22px; }
  .product-item .product-photo { width: 40px; height: 40px; }
  .product-item .product-name { font-size: 12px; margin-bottom: 3px; }
  .product-item .product-price { font-size: 14px; }
.nav-item { padding: 6px 14px; font-size: 12.5px; gap: 10px; }
.nav-item .nav-icon { width: 24px; height: 24px; font-size: 13px; }
.sidebar-section-label { padding: 12px 14px 4px; }
.modal-header { padding: 13px 18px; }
.modal-header h2 { font-size: 15px; }
.modal-body { padding: 16px 18px; }
.modal-footer { padding: 11px 18px; }
.empty-state { padding: 32px 16px; }
.empty-state .empty-icon { font-size: 44px; margin-bottom: 10px; }
.empty-state h3 { font-size: 14px; }
.empty-state p { font-size: 12.5px; margin-bottom: 10px; }

/* ============================================================
   MODO FORMAL - VERDE-ÁGUA CORPORATIVO
   Converte utilitários de cor (Tailwind CDN) para a paleta
   verde-água, sem alterar os arquivos das páginas.
   ============================================================ */
.bg-\[\#FFF0E0\],
.hover\:bg-\[\#FFF0E0\]:hover { background-color: var(--primary-light); }
.text-\[\#14B8A6\],
.text-\[\#0F766E\],
.text-\[\#2DD4BF\],
.hover\:text-\[\#14B8A6\]:hover,
.hover\:text-\[\#0F766E\]:hover { color: var(--primary); }
.hover\:border-\[\#14B8A6\]:hover,
.hover\:border-\[\#0F766E\]:hover,
.border-\[\#14B8A6\],
.border-\[\#0F766E\],
.border-\[\#2DD4BF\] { border-color: var(--primary); }
.from-\[\#2DD4BF\] { --tw-gradient-from: #14B8A6 !important; }
.to-\[\#0F766E\] { --tw-gradient-to: #0F766E !important; }
.focus\:border-\[\#14B8A6\]:focus,
.focus\:border-\[\#0F766E\]:focus,
.focus\:border-\[\#2DD4BF\]:focus { border-color: var(--primary); }
.focus\:shadow-\[0_0_0_4px_rgba\(20,184,166,0\.14\)\]:focus { box-shadow: 0 0 0 4px rgba(20,184,166,0.14); }
.hover\:shadow-\[0_10px_24px_rgba\(20,184,166,0\.4\)\]:hover { box-shadow: 0 10px 24px rgba(20,184,166,0.4); }
.via-\[\#2DD4BF\] { --tw-gradient-via: #2DD4BF !important; }
.via-\[\#14B8A6\] { --tw-gradient-via: #14B8A6 !important; }
.via-\[\#0F766E\] { --tw-gradient-via: #0F766E !important; }

/* ============================================================
   DROPDOWNS - Seletor de empresa e menu do usuário
   ============================================================ */
.gs-dropdown {
  position: fixed;
  z-index: 1500;
  background: #FFFFFF;
  border: 1px solid #ECE7E1;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  animation: gsDropIn 0.14s ease-out;
}
@keyframes gsDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gs-dropdown-border { border-color: #F0EDE8; }
.gs-dropdown-item {
  color: #2D3436;
}
.gs-dropdown-item:hover {
  background: #F5F2EE;
  color: #0F766E;
}
.gs-dropdown-check { color: #0F766E; }
.gs-dropdown-danger:hover {
  background: #FDECEC !important;
  color: #C0392B !important;
}
html.dark .gs-dropdown {
  background: #23272C;
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}
html.dark .gs-dropdown-border { border-color: rgba(255, 255, 255, 0.08); }
html.dark .gs-dropdown-item { color: #E8ECF1; }
html.dark .gs-dropdown-item:hover { background: rgba(255, 255, 255, 0.06); color: #FFFFFF; }
html.dark .gs-dropdown-check { color: #7BA3D4; }
html.dark .gs-dropdown-danger:hover {
  background: rgba(231, 76, 60, 0.18) !important;
  color: #FF8A80 !important;
}

/* ============================================================
   PDV COMPACTADO (720p / telas menores)
   ============================================================ */
.pdv-compact .product-item { padding: 10px 8px !important; }  .pdv-compact .product-item .product-emoji { font-size: 30px !important; margin-bottom: 6px !important; }
  .pdv-compact .product-item .product-photo { width: 34px !important; height: 34px !important; margin-bottom: 6px !important; }
  .pdv-compact .product-item .product-name { font-size: 12px !important; }
.pdv-compact .product-item .product-price { font-size: 14px !important; }

#categoryChips .category-chip { padding: 8px 18px !important; font-size: 13px !important; gap: 7px !important; }
#categoryChips .category-chip svg { width: 13px; height: 13px; }

/* Abas de tipo de item (Produtos / Matéria-prima / Insumos) */
.produto-tab {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border-2);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}
.produto-tab:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.produto-tab.ativa {
  border-color: var(--primary);
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}
html.dark .produto-tab.ativa { color: #06231F; }

/* Cabeçalho do carrinho do PDV (adapta ao modo escuro) */
.pdv-cart-header {
  background: linear-gradient(90deg, #FFF8F0, #FFFFFF);
  border-bottom: 1px solid #ECE7E1;
}
html.dark .pdv-cart-header {
  background: linear-gradient(90deg, #222830, #1C2026);
  border-bottom-color: var(--border);
}

/* ============================================================
   CLIENTE NO PDV (modal de busca + saldo fiado)
   ============================================================ */
.cliente-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border-2);
  border-radius: 12px;
  background: var(--surface-2);
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
}
.cliente-option:hover { border-color: var(--primary); background: var(--primary-light); transform: translateY(-1px); }
.cliente-option:active { transform: scale(0.98); }
.cliente-option .cliente-nome { color: var(--text); }
.cliente-option-avatar {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--primary-light);
  font-size: 16px;
  flex-shrink: 0;
}
.cliente-badge {
  font-size: 10.5px; font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.cliente-badge.fiado { background: rgba(20, 184, 166, 0.15); color: var(--success); }
.cliente-badge.saldo { background: rgba(225, 112, 85, 0.15); color: var(--danger); }

/* Linhas de pagamento dividido no modal */
.pag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 2px solid var(--border-2);
  background: var(--surface-2);
}
.pag-row-name {
  flex: 0 0 auto;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-strong);
  min-width: 86px;
}
.pag-row-name .badge-fiado {
  display: inline-block;
  margin-left: 4px;
  font-size: 9px;
  font-weight: 700;
  color: #B7791F;
  background: #FDF3DC;
  border: 1px solid #F2D9A0;
  border-radius: 5px;
  padding: 1px 4px;
  vertical-align: middle;
}
.pag-row .field {
  flex: 1 1 auto;
  min-width: 70px;
}
.pag-row .field label {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}
.pag-row input {
  width: 100%;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1.5px solid var(--border-2);
  background: var(--surface-1);
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s ease;
}
.pag-row input:focus { border-color: var(--primary); }
.pag-row-troco {
  font-size: 11px;
  font-weight: 700;
  color: var(--success);
  white-space: nowrap;
}
.pag-row-remove {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pag-row-remove:hover { background: var(--bg-danger-subtle); }

/* ============================================================
   MODAL FORMA DE PAGAMENTO (PDV)
   ============================================================ */
.pag-method-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 10px;
  border-radius: 10px;
  border: 2px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  line-height: 1.2;
}
.pag-method-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); transform: translateY(-1px); }
.pag-method-btn:active { transform: scale(0.97); }
.pag-method-btn.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}
html.dark .pag-method-btn.selected { color: #06231F; }

/* Categorias do PDV centralizadas (melhor distribuição) */
.pdv-categories { max-height: 112px; overflow-y: auto; justify-content: center; }
.pdv-categories::-webkit-scrollbar { width: 4px; }
.pdv-categories::-webkit-scrollbar-thumb { background: #D8D2CA; border-radius: 4px; }
html.dark .pdv-categories::-webkit-scrollbar-thumb { background: #3A434D; }

/* ============================================================
   PDV - TELA DE SELEÇÃO DE ATENDIMENTO
   ============================================================ */
.mesa-selecao-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 10px 16px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.22s ease;
  text-align: center;
  user-select: none;
}
.mesa-selecao-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08); }
.mesa-selecao-card:active { transform: scale(0.97); }
.mesa-selecao-card .mesa-emoji { font-size: 26px; line-height: 1; }
.mesa-selecao-card strong { font-size: 15px; color: var(--text); }
.mesa-selecao-card .mesa-status { font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.mesa-selecao-card.livre { border-color: var(--success); background: linear-gradient(180deg, #E9FBF6, var(--surface)); }
.mesa-selecao-card.livre .mesa-status { color: var(--success); }
.mesa-selecao-card.ocupada { border-color: var(--danger); background: var(--bg-danger-subtle); }
.mesa-selecao-card.ocupada .mesa-status { color: var(--danger); }
.mesa-selecao-card.ativa { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18); }
.mesa-selecao-card .mesa-cancel {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  background: rgba(225, 112, 85, 0.14);
  color: var(--danger);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.mesa-selecao-card:hover .mesa-cancel { opacity: 1; }
.mesa-selecao-card .mesa-cancel:hover { background: var(--danger); color: #fff; }
.mesa-selecao-card .mesa-aceitar {
  margin-top: 4px;
  padding: 7px 12px;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}
.mesa-selecao-card .mesa-aceitar:hover { background: var(--primary-dark); transform: scale(1.04); }
html.dark .mesa-selecao-card.livre { background: linear-gradient(180deg, #12312D, var(--surface)); }

.selecao-tipo-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 12px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.22s ease;
  font-size: 14px;
  color: var(--text);
  text-align: left;
}
.selecao-tipo-card:hover { border-color: var(--primary); background: var(--primary-light); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.selecao-tipo-card:active { transform: scale(0.97); }
.selecao-tipo-card .tipo-emoji { font-size: 24px; line-height: 1; }
.selecao-tipo-card strong { display: block; font-size: 14px; }
.selecao-tipo-card small { display: block; font-size: 11px; color: var(--text-muted); font-weight: 500; margin-top: 1px; }

/* Pedidos abertos sem mesa (Balcão #1, Viagem #1...) */
.selecao-tipo-card.tipo-aberto { position: relative; border-color: var(--primary); background: var(--primary-light); }
.selecao-tipo-card.tipo-aberto.ativa { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18); }
.selecao-tipo-card.tipo-aberto .tipo-cancel {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  background: rgba(225, 112, 85, 0.14);
  color: var(--danger);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.selecao-tipo-card.tipo-aberto:hover .tipo-cancel { opacity: 1; }
.selecao-tipo-card.tipo-aberto .tipo-cancel:hover { background: var(--danger); color: #fff; }
.selecao-tipo-card.tipo-novo { border-style: dashed; opacity: 0.85; }
.selecao-tipo-card.tipo-novo:hover { opacity: 1; }

/* ============================================================
   CONVERSAS WHATSAPP (atendimento humano)
   ============================================================ */
.wa-conv-item { background: transparent; }
.wa-conv-item:hover { background: #F5F8F7; }
.wa-conv-item.active { background: #E6F9F4; }
.wa-conv-item.active:hover { background: #E6F9F4; }
html.dark .wa-conv-item:hover { background: #1C2228; }
html.dark .wa-conv-item.active, html.dark .wa-conv-item.active:hover { background: #122E27; }

.wa-bubble { max-width: 82%; padding: 9px 12px; border-radius: 14px; font-size: 13px; line-height: 1.5; word-break: break-word; white-space: pre-wrap; }
.wa-bubble-in { background: #FFFFFF; color: #2D3436; border: 1px solid #ECE7E1; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.wa-bubble-out { background: linear-gradient(135deg, #14B8A6, #0F766E); color: #FFFFFF; border-bottom-right-radius: 4px; }
html.dark .wa-bubble-in { background: #232830; color: #E8ECF1; border-color: #2A3038; }
.wa-bubble-tag { font-size: 10px; font-weight: 700; margin-bottom: 3px; opacity: 0.85; }
.wa-bubble-time { font-size: 9.5px; margin-top: 4px; opacity: 0.7; text-align: right; }
.wa-bubble-out .wa-bubble-time { color: rgba(255,255,255,0.85); }

.wa-chip-bot { display: inline-block; font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: #E6F9F4; color: #0F766E; }
.wa-chip-humano { display: inline-block; font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: #FEF1E2; color: #B45309; }
html.dark .wa-chip-bot { background: #122E27; color: #2DD4BF; }
html.dark .wa-chip-humano { background: #332315; color: #F5B84D; }

.wa-badge-naolida { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; border-radius: 999px; background: #25D366; color: #fff; font-size: 10px; font-weight: 700; text-align: center; flex-shrink: 0; }

.wa-thread-body { background: #F8FAFC; }
html.dark .wa-thread-body { background: #161B21; }

/* Conversas WhatsApp — layout ocupa toda a viewport (sem espaço vazio no rodapé)
   O wrapper do header usa padding uniforme de 20px em todas as larguras
   (utilitários compactos do style.css), então o offset é constante:
   header 62px + padding top 20px + padding bottom 20px + ~2px de respiro. */
.wa-layout { height: calc(100dvh - 104px); }

/* Conversas WhatsApp — anexos (fotos do atendente) */
.wa-bubble-img { padding: 4px; background: #FFFFFF; border: 1px solid #ECE7E1; border-radius: 12px; max-width: 82%; }
html.dark .wa-bubble-img { background: #232830; border-color: #2A3038; }
.wa-bubble-img-img { max-width: 240px; max-height: 256px; border-radius: 10px; object-fit: cover; display: block; cursor: zoom-in; }
.wa-caption-in { font-size: 12.5px; color: #2D3436; margin-top: 6px; white-space: pre-wrap; word-break: break-word; }
.wa-caption-out { font-size: 12.5px; color: #FFFFFF; margin-top: 6px; white-space: pre-wrap; word-break: break-word; }
html.dark .wa-caption-in { color: #E8ECF1; }

/* Conversas WhatsApp — card de pedido vinculado + status do delivery */
.wa-pedido-card { background: #F8FAFC; border: 1px solid #ECE7E1; border-radius: 12px; padding: 10px 14px; font-size: 12px; max-width: 340px; text-align: center; }
html.dark .wa-pedido-card { background: #1A2027; border-color: #2A3038; }
.wa-pedido-top { font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.wa-pedido-meta { color: #7A8699; margin-top: 3px; }
.wa-pedido-link { color: #0F766E; font-weight: 600; margin-top: 6px; display: inline-block; text-decoration: none; }
.wa-pedido-link:hover { text-decoration: underline; }
html.dark .wa-pedido-link { color: #2DD4BF; }

.wa-pedido-status { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.wa-ps-pendente { background: #FEF1E2; color: #B45309; }
.wa-ps-aceito { background: #E6F9F4; color: #0F766E; }
.wa-ps-preparando { background: #FFE5D6; color: #C2410C; }
.wa-ps-rota { background: #E3EDFA; color: #1D4ED8; }
.wa-ps-entregue { background: #E4F6E7; color: #15803D; }
.wa-ps-cancelado { background: #FDE3E3; color: #B91C1C; }
html.dark .wa-ps-pendente { background: #332315; color: #F5B84D; }
html.dark .wa-ps-aceito { background: #122E27; color: #2DD4BF; }
html.dark .wa-ps-preparando { background: #331D12; color: #FB923C; }
html.dark .wa-ps-rota { background: #16233A; color: #93C5FD; }
html.dark .wa-ps-entregue { background: #12261A; color: #4ADE80; }
html.dark .wa-ps-cancelado { background: #331616; color: #FCA5A5; }

/* ============================================================
   EMPRESA FORM (página dedicada) — dark mode
   ============================================================ */
.emp-form-bar { background: rgba(255,255,255,0.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid #F0EDE8; box-shadow: 0 -6px 24px rgba(0,0,0,0.06); }
html.dark .emp-form-bar { background: rgba(28,32,38,0.94); border-color: var(--border); box-shadow: 0 -6px 24px rgba(0,0,0,0.4); }

html.dark .bg-\[\#FAFAF7\] { background-color: var(--surface-2); }
html.dark .text-\[\#2D3436\] { color: var(--text); }
html.dark .text-\[\#7A8699\] { color: var(--text-muted); }
html.dark .text-\[\#B2BEC3\] { color: #6B7683; }
html.dark .text-\[\#0F766E\] { color: #2DD4BF; }
html.dark .text-\[\#14B8A6\] { color: #2DD4BF; }
html.dark .group-hover\:text-\[\#0F766E\]:hover { color: #2DD4BF; }
html.dark .bg-teal-50\/50 { background-color: rgba(13, 43, 38, 0.55); }
html.dark .bg-teal-50 { background-color: #0D2B26; }
html.dark .border-teal-100 { border-color: #1E4A42; }
html.dark .border-teal-200 { border-color: #2A5C52; }
html.dark .bg-\[\#F0FDFA\] { background-color: #0D2B26; }
html.dark .border-blue-100 { border-color: #1F3A5F; }
html.dark .divide-\[\#F0EDE8\] > :not([hidden]) ~ :not([hidden]) { border-color: var(--border); }

/* ============================================================
   PALETA DE CORES PRONTAS (personalização do cardápio)
   ============================================================ */
.paleta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.paleta-swatch { border: 2px solid transparent; border-radius: 10px; padding: 4px; background: transparent; cursor: pointer; transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.paleta-swatch:hover { transform: translateY(-2px); }
.paleta-swatch.paleta-ativa { border-color: #0F766E; box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.25); }
html.dark .paleta-swatch.paleta-ativa { border-color: #2DD4BF; }
.paleta-gradient { width: 100%; height: 28px; border-radius: 7px; display: block; }
.paleta-nome { font-size: 10px; color: var(--text-muted); font-weight: 600; line-height: 1; white-space: nowrap; }
