/* Estilos customizados e refinamentos visuais para o Gestão & Vitrine */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

body {
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

/* Scrollbar fina e moderna */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
html.dark ::-webkit-scrollbar-track,
.dark ::-webkit-scrollbar-track {
  background: #0f172a;
}
html.dark ::-webkit-scrollbar-thumb,
.dark ::-webkit-scrollbar-thumb {
  background: #334155;
}
html.dark ::-webkit-scrollbar-thumb:hover,
.dark ::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Oculta barra de rolagem mantendo deslize suave por toque */
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Animações suaves */
.fade-in {
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-pop {
  animation: modalPop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Efeito Glassmorphism moderno */
.glass-panel {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.glass-nav {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Badge estilizados com pulso */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  line-height: 1rem;
  transition: all 0.15s ease-in-out;
}

/* Botão de Nova Venda flutuante no celular */
.fab-btn {
  box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4), 0 8px 10px -6px rgba(79, 70, 229, 0.2);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
}
.fab-btn:active {
  transform: scale(0.92);
}

/* Estilo para impressão do Comprovante / Recibo de Venda */
@media print {
  @page {
    margin: 8mm;
    size: auto;
  }
  body * {
    visibility: hidden !important;
  }
  #print-receipt-modal, 
  #print-receipt-modal #receipt-content,
  #print-receipt-modal #receipt-content * {
    visibility: visible !important;
  }
  #print-receipt-modal {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }
  #print-receipt-modal > div {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
    background: #ffffff !important;
    color: #000000 !important;
  }
  #receipt-content {
    background: #ffffff !important;
    border: 1px dashed #cbd5e1 !important;
    color: #000000 !important;
    padding: 16px !important;
    box-shadow: none !important;
  }
  #receipt-content * {
    color: #000000 !important;
    text-shadow: none !important;
  }
  .no-print,
  #print-receipt-modal .border-b,
  #print-receipt-modal .border-t,
  #print-receipt-modal button,
  #print-receipt-modal .no-print {
    display: none !important;
  }
}

/* Efeito de toque no celular */
@media (hover: none) {
  button:active, a:active {
    opacity: 0.85;
    transform: scale(0.98);
  }
}

/* Correção de altura para safe area no iPhone / Safari */
.safe-bottom {
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

/* ========================================================================= */
/* VISUAL PREMIUM: SUPORTE TOTAL E ELIMINAÇÃO DE BOTÕES QUADRADOS EM SELECTS */
/* ========================================================================= */
html.dark,
.dark {
  color-scheme: dark;
}

select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ea580c' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 1rem 1rem !important;
  padding-right: 2.25rem !important;
  border-radius: 0.75rem !important;
  cursor: pointer !important;
}

select::-ms-expand {
  display: none !important;
}

select:focus,
select:focus-visible {
  outline: none !important;
  border-color: #ea580c !important;
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.25) !important;
  border-radius: 0.75rem !important;
}

html.dark select,
.dark select {
  color-scheme: dark;
  background-color: #09090b;
  color: #f8fafc;
}

select option,
select optgroup {
  background-color: #ffffff;
  color: #0f172a;
  padding: 8px 12px !important;
}

html.dark select option,
html.dark select optgroup,
.dark select option,
.dark select optgroup {
  background-color: #0c1322 !important;
  color: #f8fafc !important;
}

/* Remove bordas, contornos e caixas nativas dos selects embutidos */
.select-clean,
#filter-customer-period,
#filter-customer-sort {
  border: none !important;
  border-style: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  background-color: transparent !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  cursor: pointer !important;
  user-select: none;
}

.select-clean:focus,
.select-clean:focus-visible,
.select-clean:active,
#filter-customer-period:focus,
#filter-customer-period:focus-visible,
#filter-customer-period:active,
#filter-customer-sort:focus,
#filter-customer-sort:focus-visible,
#filter-customer-sort:active {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

.select-clean::-ms-expand,
#filter-customer-period::-ms-expand,
#filter-customer-sort::-ms-expand {
  display: none !important;
}

/* ========================================================================= */
/* COMPONENTE DE DROPDOWN VISUAL PREMIUM COM CANTOS ARREDONDADOS E ANIMAÇÃO  */
/* ========================================================================= */
.custom-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.custom-dropdown-wrap.w-full {
  width: 100%;
}

.custom-dropdown-trigger {
  user-select: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-dropdown-trigger:hover {
  border-color: rgba(234, 88, 12, 0.6) !important;
}

.custom-dropdown-menu {
  transform-origin: top center;
  z-index: 9999 !important;
  border-radius: 1rem !important; /* Bordas arredondadas estilo premium */
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5) !important;
}

.custom-dropdown-menu button {
  border-radius: 0.75rem !important; /* Opções internas arredondadas */
}

.custom-dropdown-menu:not(.hidden) {
  display: flex !important;
  flex-direction: column !important;
  animation: dropdownIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ========================================================================= */
/* 1. OLHO MÁGICO / MODO PRIVACIDADE (ATALHO F3 & BOTÃO NO TOPO)             */
/* ========================================================================= */
body.privacy-mode-active .privacy-sensitive,
body.privacy-mode-active #wallet-balance,
body.privacy-mode-active #wallet-projected,
body.privacy-mode-active #wallet-in,
body.privacy-mode-active #wallet-out-raw,
body.privacy-mode-active #wallet-out-exp,
body.privacy-mode-active #wallet-pending,
body.privacy-mode-active #wallet-initial-line,
body.privacy-mode-active #wallet-ip-balance,
body.privacy-mode-active #kpi-faturamento,
body.privacy-mode-active #kpi-custo-total,
body.privacy-mode-active #kpi-receitas-extras-total,
body.privacy-mode-active #kpi-receitas-extras-detalhe,
body.privacy-mode-active #kpi-despesas-total,
body.privacy-mode-active #kpi-despesas-detalhe,
body.privacy-mode-active #kpi-salarios-total,
body.privacy-mode-active #kpi-salarios-detalhe,
body.privacy-mode-active #kpi-lucro-total,
body.privacy-mode-active #kpi-margem-media,
body.privacy-mode-active #kpi-a-receber,
body.privacy-mode-active #badge-extra-entrega-total,
body.privacy-mode-active #badge-extra-embalagem-total,
body.privacy-mode-active #badge-extra-gorjeta-total,
body.privacy-mode-active #badge-extra-reembolso-total,
body.privacy-mode-active #badge-extra-outros-total,
body.privacy-mode-active #badge-frete-total,
body.privacy-mode-active #badge-trafego-total,
body.privacy-mode-active #badge-market-direto-total,
body.privacy-mode-active #badge-material-total,
body.privacy-mode-active #badge-salarios-total,
body.privacy-mode-active #badge-aprimoramento-total,
body.privacy-mode-active #badge-outros-total,
body.privacy-mode-active #monthly-target-current,
body.privacy-mode-active #monthly-target-remaining,
body.privacy-mode-active #monthly-target-goal-display,
body.privacy-mode-active .kpi-financial-val,
body.privacy-mode-active .goal-num,
body.privacy-mode-active .sale-financial-val,
body.privacy-mode-active .cost-sensitive-val,
body.privacy-mode-active .ranking-financial-val,
body.privacy-mode-active #tbody-product-ranking td:nth-child(n+3),
body.privacy-mode-active #tfoot-product-ranking td,
body.privacy-mode-active #seller-dispute-header,
body.privacy-mode-active #seller-view-products-box,
body.privacy-mode-active #sales-table-body td:nth-child(4),
body.privacy-mode-active #sales-table-body td:nth-child(5),
body.privacy-mode-active #sales-summary-total,
body.privacy-mode-active #sales-summary-profit,
body.privacy-mode-active #kpi-avg-ticket,
body.privacy-mode-active #best-customer-spent,
body.privacy-mode-active #customers-table-body td:nth-child(4),
body.privacy-mode-active #cal-kpi-selected-total,
body.privacy-mode-active #cal-kpi-month-gross,
body.privacy-mode-active #cal-kpi-month-net,
body.privacy-mode-active #stock-total-cost,
body.privacy-mode-active #stock-total-revenue,
body.privacy-mode-active #stock-total-losses,
body.privacy-mode-active .stock-financial-val,
body.privacy-mode-active #stock-table-body td:nth-child(5),
body.privacy-mode-active #stock-table-body td:nth-child(6),
body.privacy-mode-active #expenses-tbody td:nth-child(4),
body.privacy-mode-active #extra-revenues-tbody td:nth-child(4) {
  filter: blur(10px) !important;
  user-select: none !important;
  transition: filter 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Ocultação e Borramento Completo de Todos os Gráficos no Modo Olho Mágico */
body.privacy-mode-active #chart-evolution,
body.privacy-mode-active #chart-overview,
body.privacy-mode-active #chart-payments,
body.privacy-mode-active #chart-sellers,
body.privacy-mode-active #chart-product-performance,
body.privacy-mode-active #section-admin canvas,
body.privacy-mode-active .chart-container canvas {
  filter: blur(14px) !important;
  pointer-events: none !important;
  user-select: none !important;
  transition: filter 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Indicador pulsante do botão Olho Mágico quando ativo */
#btn-global-privacy.privacy-active {
  background-color: rgba(245, 158, 11, 0.15) !important;
  border-color: rgba(245, 158, 11, 0.6) !important;
  color: #d97706 !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}
html.dark #btn-global-privacy.privacy-active {
  background-color: rgba(245, 158, 11, 0.2) !important;
  color: #fbbf24 !important;
}

/* ========================================================================= */
/* 2. CHUVA DE MOEDAS DOURADAS & PARTICULAS DE DOPAMINA (DURAÇÃO ESTENDIDA)  */
/* ========================================================================= */
@keyframes coinFloatRise {
  0% {
    opacity: 0;
    transform: translateY(105vh) scale(0.3) rotate(0deg);
  }
  12% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-25vh) scale(1.2) rotate(1080deg);
  }
}

.coin-particle {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  user-select: none;
  animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
}

/* ========================================================================= */
/* 3. DISPUTA DIVERTIDA ENTRE VENDEDORES                                     */
/* ========================================================================= */
@keyframes leaderGlowPulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
  }
  50% {
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.55);
  }
}

.leader-badge-glow {
  animation: leaderGlowPulse 2.5s infinite ease-in-out;
}

/* ========================================================================= */
/* 4. GAMIFICAÇÃO & CONQUISTAS DO ATELIÊ 97 (TÍTULOS E MEDALHAS)              */
/* ========================================================================= */
.medal-card {
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.medal-card:hover {
  transform: translateY(-2px);
}
.medal-card.unlocked {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 4px 14px -3px rgba(245, 158, 11, 0.15);
}
html.dark .medal-card.unlocked {
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 4px 16px -3px rgba(245, 158, 11, 0.2);
}
.medal-icon-box {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.medal-card:hover .medal-icon-box {
  transform: scale(1.12) rotate(4deg);
}

@keyframes levelBadgeGlow {
  0%, 100% {
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
  }
  50% {
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.65);
  }
}
.level-badge-glow {
  animation: levelBadgeGlow 2.8s infinite ease-in-out;
}

/* Barra de XP com feixe luminoso deslizante */
.xp-shimmer-bar {
  position: relative;
  overflow: hidden;
}
.xp-shimmer-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: xpShimmer 2.2s infinite ease-in-out;
}
@keyframes xpShimmer {
  0% { left: -100%; }
  100% { left: 200%; }
}

/* ========================================================================= */
/* 5. SUÍTE DE TESTES AUTOMATIZADOS ZERO REGRESSÃO                           */
/* ========================================================================= */
.test-row {
  transition: background-color 0.15s ease-in-out;
}
.test-row:hover {
  background-color: rgba(241, 245, 249, 0.7);
}
html.dark .test-row:hover {
  background-color: rgba(30, 41, 59, 0.5);
}

@keyframes sealPulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.25);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.45);
    transform: scale(1.01);
  }
}
.zero-regression-seal {
  animation: sealPulse 3s infinite ease-in-out;
}

/* ========================================================================= */
/* 6. EXPERIÊNCIA APP NATIVO PARA CELULARES (MOBILE-FIRST UX)                */
/* ========================================================================= */
@keyframes sheetUp {
  from {
    opacity: 0.4;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sheet-up {
  animation: sheetUp 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.w-13 { width: 3.25rem; }
.h-13 { height: 3.25rem; }

@media (max-width: 767px) {
  /* Evita zoom automático do celular ao tocar em campos de texto/números */
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Modais confortáveis e com rolagem fluida no toque */
  #modal-sale > div,
  #modal-wallet > div,
  #modal-expense > div,
  #modal-raw-material > div,
  #modal-product > div,
  #modal-admin-auth > div {
    max-height: 92dvh;
    -webkit-overflow-scrolling: touch;
  }

  /* Garante que nenhum bloco estoure a largura da tela do celular */
  main, section {
    max-width: 100vw;
    overflow-x: clip;
  }
}



