@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/Roboto-400.ttf") format("truetype");
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/Roboto-500.ttf") format("truetype");
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/Roboto-700.ttf") format("truetype");
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("fonts/Roboto-800.ttf") format("truetype");
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("fonts/Roboto-900.ttf") format("truetype");
}

/* RDX Gestão — réplica visual fiel do Canal Express Admin (tema claro Apple).
   Paleta espelhada de lib/login_gate_page.dart (_LoginGatePalette._light) e
   lib/hub_page.dart (_HubPalette._light). */

:root {
  --apple-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --bg: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(29, 29, 31, 0.10);
  --blue-rgb: 32, 32, 35;
  --blue: rgb(var(--blue-rgb));
  --blue-ink: #ffffff;
  --blue-soft: #a1a1a6;
  --accent-blue: #0071e3;
  --green: #13a065;
  --card: #ffffff;
  --card-soft: #f5f5f7;
  --field: #e9ebef;
  --shadow: rgba(0, 0, 0, 0.08);
  --google-bg: #1d1d1f;
  --google-fg: #ffffff;
  --app-height: 100vh;
  --browser-ui-bleed: 0px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

@supports (height: 100dvh) {
  :root { --app-height: 100dvh; }
}

html, body {
  margin: 0;
  height: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Roboto, Arial, sans-serif;
  font-size: 15px;
  font-weight: 500;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body {
  min-height: var(--app-height);
}

#app {
  min-height: var(--app-height);
}

.page-gradient {
  min-height: var(--app-height);
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f7 50%, #eef6ff 100%);
}

.grad-text {
  background: linear-gradient(135deg, var(--ink), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.icon { display: inline-flex; flex-shrink: 0; }
.icon svg { width: 100%; height: 100%; fill: currentColor; }

/* ---------- Splash ---------- */
.splash {
  min-height: var(--app-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f7 50%, #eef6ff 100%);
}
.splash img { width: 64px; height: 64px; object-fit: contain; }
.spinner {
  width: 26px; height: 26px;
  border: 3px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Carregando ---------- */
/* Estado de carregamento padrão do sistema: a mesma bolinha do splash com o
   rótulo "Carregando" logo abaixo. É inline-flex de propósito — assim ele se
   centraliza tanto dentro de quem já é flex/grid (.stats-empty,
   .config-payment-loading) quanto dentro de quem só tem text-align: center
   (as células .empty das tabelas), sem precisar mexer em cada container.
   Cor e fonte são herdadas do lugar onde ele cai, então cada tela mantém o
   próprio tom — inclusive os pop-ups escuros. */
.rdx-loading {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  vertical-align: middle;
  text-align: center;
  line-height: 1.3;
}
/* O anel acompanha a cor do texto do container e o topo continua azul, que é
   o que dá o giro visível em fundo claro e em fundo escuro. */
.rdx-loading .spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid color-mix(in srgb, currentColor 24%, transparent);
  border-top-color: var(--blue);
}
.rdx-loading-text { font-size: 0.92em; }
/* Para os poucos containers que alinham o conteúdo à esquerda e precisam
   centralizar só enquanto carregam (a fila da Financeira, a lista do CRM, a
   linha do seletor de loja). O padding de quem hospeda continua valendo. */
.rdx-loading-host {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 0;
}

/* ---------- Login ---------- */
.login-page {
  min-height: var(--app-height);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.orb-1 {
  width: 340px; height: 340px; left: -80px; top: -40px;
  background: radial-gradient(circle, rgba(var(--blue-rgb), 0.22), transparent 70%);
  animation: orb-drift-1 14s ease-in-out infinite alternate;
}
.orb-2 {
  width: 280px; height: 280px; right: -60px; bottom: -80px;
  background: radial-gradient(circle, rgba(var(--blue-rgb), 0.16), transparent 70%);
  animation: orb-drift-2 17s ease-in-out infinite alternate;
}
.orb-3 {
  width: 200px; height: 200px; right: 100px; top: 200px;
  background: radial-gradient(circle, rgba(19, 160, 101, 0.12), transparent 70%);
  animation: orb-drift-3 12s ease-in-out infinite alternate;
}
@keyframes orb-drift-1 { from { transform: translate(0, 0); } to { transform: translate(60px, 40px); } }
@keyframes orb-drift-2 { from { transform: translate(0, 0); } to { transform: translate(-50px, -50px); } }
@keyframes orb-drift-3 { from { transform: translate(0, 0); } to { transform: translate(-40px, 30px); } }

.login-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1540px;
  padding: 46px 92px;
  display: flex;
  align-items: center;
  zoom: 0.85;
}

/* Coluna da marca (esquerda) */
.brand-side { flex: 12; min-width: 0; }
.brand-headline {
  font-size: 48px;
  font-weight: 500;
  line-height: 0.94;
  margin: 0 0 70px 75px;
  letter-spacing: 0;
  white-space: nowrap;
}
.preview-scene {
  position: relative;
  height: 600px;
  margin-top: 20px;
}
.phone-mockup {
  position: absolute;
  left: 125px;
  top: 20px;
  width: 480px;
  height: 960px;
  object-fit: contain;
  pointer-events: none;
}
.float-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 18px 32px var(--shadow);
}
.float-card .fc-icon {
  width: 54px; height: 54px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
}
.float-card .fc-icon .icon { width: 26px; height: 26px; }
.float-card .fc-label { color: var(--muted); font-size: 12px; font-weight: 500; }
.float-card .fc-value { color: var(--ink); font-size: 20px; font-weight: 500; letter-spacing: -0.5px; margin-top: 2px; }

.fc-blue-bg { background: rgba(var(--blue-rgb), 0.10); color: var(--blue); }
.fc-green-bg { background: rgba(19, 160, 101, 0.12); color: var(--green); }

.float-vendas { left: 20px; top: 32px; animation: floaty 3.2s ease-in-out infinite alternate; }
.float-receber { left: 0; top: 340px; animation: floaty 3.4s ease-in-out infinite alternate-reverse; }
.float-confirm { right: -55px; top: 85px; border-color: rgba(19, 160, 101, 0.18); animation: floaty 2.8s ease-in-out infinite alternate; }
.float-chart { right: -55px; bottom: 50px; width: 250px; padding: 20px; display: block; animation: floaty 3.6s ease-in-out infinite alternate-reverse; }
.float-tag { right: -15px; top: -7px; border-radius: 18px; padding: 13px 16px; animation: floaty 3.0s ease-in-out infinite alternate; }
@keyframes floaty { from { transform: translateY(0); } to { transform: translateY(-8px); } }

.float-chart .fc-label { color: var(--muted); font-size: 12px; font-weight: 500; }
.float-chart .fc-total { color: var(--ink); font-size: 24px; font-weight: 500; letter-spacing: -0.5px; margin: 4px 0 18px; }
.chart-bars { display: flex; align-items: flex-end; justify-content: space-between; height: 60px; }
.chart-bars span {
  width: 14px;
  border-radius: 999px;
  background: linear-gradient(to top, var(--blue), var(--blue-soft));
}

/* Zona de vidro fosco à direita do divisor — cobre a página inteira em altura,
   começando exatamente na linha divisória (posicionada via JS). */
.side-glass {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    160deg,
    rgba(230, 235, 243, 0.60) 0%,
    rgba(222, 229, 240, 0.74) 100%
  );
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  pointer-events: none;
}
.side-glass.glass-in {
  animation: authFadeIn 600ms ease-out 180ms both;
}
@media (max-width: 940px) {
  .side-glass { display: none; }
}

/* Divisor vertical */
.login-divider {
  width: 1px;
  height: 640px;
  margin: 0 76px;
  background: linear-gradient(to bottom, transparent, var(--line), transparent);
  flex-shrink: 0;
}

/* Painel de login (direita) */
.panel-side { flex: 10; min-width: 0; display: flex; justify-content: center; }

.login-panel {
  position: relative;
  width: 588px;
  max-width: 100%;
  padding: 42px;
  border-radius: 34px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.42) 0%,
    rgba(255, 255, 255, 0.16) 55%,
    rgba(255, 255, 255, 0.34) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    0 28px 48px var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.90),
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    inset 0 -24px 48px -32px rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  overflow: hidden;
}
/* brilho especular do liquid glass */
.login-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(120% 55% at 14% 0%, rgba(255, 255, 255, 0.55), transparent 58%),
    radial-gradient(90% 45% at 92% 100%, rgba(255, 255, 255, 0.30), transparent 62%);
}

/* Animação de entrada — espelha _staggerCtrl (1200ms) de login_gate_page.dart:
   brand Interval(0.0–0.55) slide 15%, divider Interval(0.15–0.65) fade,
   panel Interval(0.25–0.80) slide 0.12 × altura da área (~12vh), Curves.easeOut */
.login-content.animate-in .brand-side {
  animation: authBrandIn 660ms ease-out both;
}
.login-content.animate-in .login-divider {
  animation: authFadeIn 600ms ease-out 180ms both;
}
.login-content.animate-in .panel-side {
  animation: authPanelIn 660ms ease-out 300ms both;
}
@keyframes authBrandIn {
  from { opacity: 0; transform: translateY(15%); }
  to { opacity: 1; transform: none; }
}
@keyframes authPanelIn {
  from { opacity: 0; transform: translateY(12vh); }
  to { opacity: 1; transform: none; }
}
@keyframes authFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Troca login <-> cadastro — espelha _AuthPanelSwitcher (AnimatedSwitcher:
   saída 280ms easeInCubic, entrada 360ms easeOutCubic, fade + scale 0.92) */
.login-panel.panel-swap {
  animation: authPanelSwapIn 360ms cubic-bezier(0.33, 1, 0.68, 1) both;
}
.login-panel.panel-swap-out {
  animation: authPanelSwapOut 280ms cubic-bezier(0.32, 0, 0.67, 0) both;
  pointer-events: none;
}
@keyframes authPanelSwapIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes authPanelSwapOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.94); }
}

.btn-signup-submit { height: 54px; }
.btn-signup-submit .icon { width: 18px; height: 18px; }
.signup-terms {
  margin: 16px 0 0;
  font-size: 11px;
  line-height: 1.45;
  font-weight: 500;
  color: rgba(110, 110, 115, 0.82);
  text-align: center;
}

@media (min-width: 941px) {
  /* usa a propriedade `translate` (e não `transform`) para o deslocamento não
     ser sobrescrito pelas animações de entrada/troca, que animam `transform` */
  .brand-side {
    translate: -33px 45px;
  }

  .panel-side {
    overflow: visible;
  }

  .login-panel {
    width: 588px;
    max-width: none;
    flex-shrink: 0;
    translate: 34px 0;
  }
}

.panel-head {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 34px;
}
.panel-head img { width: 46px; height: 46px; object-fit: contain; display: block; }
.panel-title {
  font-size: 38px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.panel-title-sub {
  font-size: 0.75em;
  font-weight: 400;
}

.login-field {
  display: flex;
  align-items: center;
  height: 54px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 15px;
  transition: border-color .2s, box-shadow .2s;
}
.login-field:focus-within {
  border: 1.5px solid var(--blue);
  box-shadow: 0 0 20px 1px rgba(var(--blue-rgb), 0.30);
}
.login-field .icon {
  width: 22px; height: 22px;
  margin: 0 15px;
  color: rgba(110, 110, 115, 0.84);
}
.login-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  background: none;
  outline: none;
  color: var(--ink);
  font-weight: 500;
  font-size: 15px;
  font-family: inherit;
}
.login-field input::placeholder { color: rgba(110, 110, 115, 0.64); font-weight: 500; }
/* Secure Fields do Mercado Pago: o container recebe um iframe com o input do
   cartão (PCI) — ocupa o espaço que era do input nativo. */
.login-field .mp-secure-field {
  flex: 1;
  min-width: 0;
  height: 100%;
}
.login-field .mp-secure-field iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
/* O foco fica dentro do iframe e não aciona :focus-within — a classe
   mp-focused (via eventos focus/blur do campo) replica o realce. */
.login-field.mp-focused {
  border: 1.5px solid var(--blue);
  box-shadow: 0 0 20px 1px rgba(var(--blue-rgb), 0.30);
}
.login-field .eye-btn {
  background: none; border: none; cursor: pointer;
  width: 52px; height: 54px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(110, 110, 115, 0.90);
  padding: 0;
}
.login-field .eye-btn .icon { margin: 0; width: 22px; height: 22px; color: inherit; }
.field-gap { height: 16px; }

.panel-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--blue);
  font-weight: 500;
  font-size: 13px;
  font-family: inherit;
  padding: 4px 8px;
  border-radius: 8px;
}
.link-btn:hover { background: rgba(var(--blue-rgb), 0.06); }
.link-btn .icon { width: 16px; height: 16px; }
.link-btn:disabled { color: rgba(110, 110, 115, 0.52); cursor: default; }

.feedback-wrapper {
  display: grid;
  grid-template-rows: 1fr;
}
.feedback-wrapper.feedback-expand {
  animation: feedbackExpand 400ms cubic-bezier(0.33, 1, 0.68, 1) both;
}
.feedback-inner {
  min-height: 0;
  overflow: hidden;
}
@keyframes feedbackExpand {
  from { grid-template-rows: 0fr; }
  to { grid-template-rows: 1fr; }
}

.feedback {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 14px;
  text-align: center;
  font-weight: 500;
  font-size: 14px;
}
/* entrada da mensagem de erro/aviso */
.feedback.feedback-in {
  animation: feedbackFadeIn 320ms cubic-bezier(0.33, 1, 0.68, 1) 320ms both;
}
@keyframes feedbackFadeIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.feedback-error {
  background: rgba(255, 82, 82, 0.08);
  border: 1px solid rgba(255, 82, 82, 0.18);
  color: rgba(255, 82, 82, 0.94);
}
.feedback-ok {
  background: rgba(19, 160, 101, 0.08);
  border: 1px solid rgba(19, 160, 101, 0.18);
  color: rgba(19, 160, 101, 0.94);
}

.big-btn {
  width: 100%;
  height: 64px;
  border: none;
  border-radius: 18px;
  font-weight: 500;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform .12s ease, filter .12s;
}
.big-btn:active { transform: scale(0.97); }
.big-btn:disabled { cursor: wait; filter: opacity(0.6); }
.big-btn .icon { width: 22px; height: 22px; }
.big-btn img { width: 22px; height: 22px; object-fit: contain; }
.btn-google { background: var(--google-bg); color: var(--google-fg); margin-top: 28px; }
.btn-login { background: var(--blue); color: #ffffff; margin-top: 12px; }
.btn-login .icon { width: 18px; height: 18px; }

/* ---------- Hub ---------- */
.hub-page {
  min-height: var(--app-height);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hub-content {
  width: 100%;
  max-width: 1500px;
  padding: 0 60px;
  zoom: 1.10;
}
.hub-head {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}
.hub-title { font-size: 34px; font-weight: 500; margin: 0; }
.hub-sub { color: var(--muted); font-weight: 500; margin: 10px 0 0; }
.hub-signout-row {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}
.hub-signout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  font-family: inherit;
  padding: 8px 12px;
  border-radius: 10px;
}
.hub-signout:hover { background: rgba(29, 29, 31, 0.05); }
.hub-signout .icon { width: 18px; height: 18px; }

.hub-carousel {
  width: 100%;
  max-width: 1248px;
  position: relative;
  margin: 10px auto 0;
}
.hub-carousel::before,
.hub-carousel::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 108px;
  pointer-events: none;
  -webkit-backdrop-filter: blur(22px) saturate(115%);
  backdrop-filter: blur(22px) saturate(115%);
}
.hub-carousel::before {
  left: 0;
  background: linear-gradient(to right, rgba(248, 249, 251, 0.98) 0%, rgba(248, 249, 251, 0.70) 42%, rgba(248, 249, 251, 0.18) 76%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 0 40%, rgba(0, 0, 0, 0.64) 65%, transparent 100%);
  mask-image: linear-gradient(to right, #000 0 40%, rgba(0, 0, 0, 0.64) 65%, transparent 100%);
}
.hub-carousel::after {
  right: 0;
  background: linear-gradient(to left, rgba(238, 246, 255, 0.98) 0%, rgba(238, 246, 255, 0.72) 42%, rgba(238, 246, 255, 0.18) 76%, transparent 100%);
  -webkit-mask-image: linear-gradient(to left, #000 0 40%, rgba(0, 0, 0, 0.64) 65%, transparent 100%);
  mask-image: linear-gradient(to left, #000 0 40%, rgba(0, 0, 0, 0.64) 65%, transparent 100%);
}
.hub-cards {
  width: 100%;
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 16px 66px 32px;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.hub-cards.is-overflowing { justify-content: flex-start; }
.hub-cards::-webkit-scrollbar { display: none; width: 0; height: 0; }
.hub-scroll-control {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.10), inset 0 0 0 0.5px rgba(255, 255, 255, 0.62);
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease, background .12s ease;
  transform: translateY(-50%);
}
.hub-scroll-control#hub-scroll-left { left: 12px; }
.hub-scroll-control#hub-scroll-right { right: 12px; }
.hub-scroll-control:hover:not(:disabled) { transform: translateY(-50%) translateY(-1px); background: rgba(255, 255, 255, 0.62); }
.hub-scroll-control:active:not(:disabled) { transform: translateY(-50%) scale(0.94); }
.hub-scroll-control:disabled { color: rgba(29, 29, 31, 0.28); cursor: default; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06); }
.hub-scroll-control .icon { position: relative; z-index: 1; width: 24px; height: 24px; }
.hub-card {
  flex: 0 0 360px;
  width: 360px;
  height: 104px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid rgba(29, 29, 31, 0.07);
  border-radius: 22px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.065), 0 3px 10px rgba(15, 23, 42, 0.035);
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s, box-shadow .18s;
  text-align: left;
  font-family: inherit;
  min-width: 0;
  scroll-snap-align: center;
}
.hub-card:hover {
  border-color: var(--blue);
  background: rgba(0, 113, 227, 0.04);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 113, 227, 0.15);
}
.hub-card:active { transform: scale(0.98); }
.hub-card .hc-logo {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hub-card .hc-logo img { width: 46px; height: 46px; object-fit: contain; }
.hub-card .hc-logo .icon { width: 30px; height: 30px; color: var(--ink); }
.hub-card .hc-text { flex: 1; min-width: 0; }
.hub-card .hc-title {
  color: var(--ink); font-weight: 500; font-size: 18px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hub-card .hc-sub {
  color: var(--muted); font-weight: 500; font-size: 13px; margin-top: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hub-card .hc-chevron { width: 24px; height: 24px; color: var(--muted); flex-shrink: 0; }

/* ---------- Painel interno (shell) ---------- */
/* No painel desktop, a rolagem pertence à main e ao menu quando necessário.
   A página externa fica na altura da janela, inclusive com viewport fracionária. */
@media (min-width: 941px) {
  html.rdx-shell-open,
  html.rdx-shell-open body {
    min-height: 0;
    overflow: hidden;
  }
  html.rdx-shell-open #app {
    height: 100%;
    min-height: 0;
  }
  html.rdx-shell-open #app > .shell {
    height: min(100%, var(--app-height));
  }
}

.shell {
  width: 100%;
  height: var(--app-height);
  overflow: hidden;
  background: #f5f5f7;
}
.system-scale {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative; /* referência para a camada da transição de página */
}
.mobile-drawer {
  display: none;
}
/* =====================================================================
   Barra lateral — rail flutuante no tema do sistema.
   Cartão arredondado sobre o fundo da página, ícone solto (sem caixa),
   item ativo em pílula sólida que encosta na borda de dentro do cartão,
   e um botão redondo no pé que alterna entre rail (só ícone) e expandido.
   Paleta espelhada dos tokens --pop-* dos pop-ups: mesma superfície,
   mesma borda, mesmo azul de destaque.
   ===================================================================== */

/* A lista de Configurações usa a mesma paleta: assim os dois lados da tela
   mudam juntos quando estes tokens forem mexidos. */
.sidebar,
.mobile-drawer-panel,
.config-menu {
  --sb-surface: #ffffff;
  --sb-hover: rgba(29, 29, 31, 0.05);
  --sb-border: transparent;
  --sb-ink: #1d1d1f;
  --sb-muted: #6e6e73;
  --sb-accent: var(--blue);
  --sb-accent-rgb: var(--blue-rgb);
  --sb-accent-soft: rgba(var(--blue-rgb), 0.10);
  --sb-on-accent: var(--blue-ink);
  /* Vender, a página ativa e o recolher acompanham a cor configurada para
     o sistema ou para a loja ativa. */
  --sb-primary-bg: var(--blue);
  --sb-primary-ink: var(--blue-ink);
  --sb-danger: #d70015;
  --sb-shadow: none;
  --sb-w: 214px;
  --sb-w-rail: 84px;
  --sb-padx: 14px;
  --sb-item-h: 40px;
  --sb-primary-h: 44px;
  --sb-radius: 26px;
  --sb-ic: 22px;
  --sb-ic-glyph: 20px;
  --sb-logo: 34px;
  --sb-pic: 24px;
  --sb-pic-glyph: 19px;
  --sb-fab: 36px;
  /* Raio dos recortes auxiliares na emenda com a borda direita. */
  --sb-bulge: 10px;
  /* O raio da curva não é livre: a ponta da pílula é um semicírculo de raio
     igual à metade da altura dela, e a curva só emenda sem trecho reto no
     meio se  ressalto + curva = esse raio. Cada botão calcula o seu, porque
     as alturas diferem (item 40px, Vender 44px). */
  --sb-notch: 10px;
  /* Compensa somente o padding: o botão termina exatamente na borda externa
     da barra, sem o avanço extra que aparecia na captura. */
  --sb-ext: var(--sb-padx);
  --sb-page: #f5f5f7;
  /* Largura útil de dentro do cartão: usada para centralizar o que sobra no
     rail com padding calculado, já que justify-content não anima. */
  --sb-inner: calc(100% - 2px - 2 * var(--sb-padx));
}

.sidebar {
  width: var(--sb-w);
  min-width: var(--sb-w-rail);
  min-height: 0;
  max-width: 320px;
  flex-shrink: 0;
  margin: 14px 0 0 14px;
  border-radius: var(--sb-radius) var(--sb-radius) 0 0;
  background: var(--sb-surface);
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  padding: 16px var(--sb-padx) 14px;
  /* Sem recorte horizontal, para a ponta da pílula sair do cartão; o
     z-index a põe por cima do conteúdo à direita. */
  overflow: visible;
  position: relative;
  z-index: 5;
  scrollbar-width: none;
  --sb-scale: 1;
  transition: width .26s cubic-bezier(.4, 0, .2, 1), padding .26s cubic-bezier(.4, 0, .2, 1);
}
.sidebar::-webkit-scrollbar { width: 0; height: 0; }

/* O menu preserva as dimensões dos botões. Quando seu conteúdo não cabe,
   libera rolagem pela medida real da barra, inclusive com zoom do navegador. */
.sidebar > .side-brand,
.sidebar > .side-primary,
.sidebar > .side-sep,
.sidebar > .side-nav,
.sidebar > .side-foot,
.sidebar .nav-item {
  flex-shrink: 0;
}
.sidebar.is-overflowing { overflow-y: auto; overflow-x: hidden; }
.sidebar.is-overflowing .sidebar-context-card { display: none; }

/* Rail: some o texto, centraliza o ícone e usa a largura fixa compacta. */
.sidebar.collapsed {
  width: var(--sb-w-rail);
  --sb-padx: 12px;
  --sb-ic: 20px;
  --sb-ic-glyph: 18px;
  --sb-logo: 30px;
  --sb-pic: 22px;
  --sb-pic-glyph: 17px;
}
/* 2) Os rótulos encolhem junto com a barra em vez de sumirem de uma vez:
   display:none não anima e fazia o texto piscar antes da largura andar. */
.sidebar.collapsed .nav-label,
.sidebar.collapsed .sb-name,
.sidebar.collapsed .side-primary-label {
  flex-grow: 0;
  opacity: 0;
}
.sidebar.collapsed .side-primary-arrow,
.sidebar.collapsed .side-brand-arrow {
  width: 0;
  opacity: 0;
}
/* `justify-content: center` recentraria o ícone no mesmo frame, com a barra
   ainda em 214px — era daí que vinha o salto. O padding calculado leva o
   ícone até o meio do rail junto com a largura, na mesma curva. */
.sidebar.collapsed .side-brand,
.sidebar.collapsed .side-primary,
.sidebar.collapsed .nav-item {
  padding-right: 0;
  gap: 0;
}
.sidebar.collapsed .nav-item {
  padding-left: calc((var(--sb-w-rail) - 2px - 2 * var(--sb-padx) - var(--sb-ic)) / 2);
}
.sidebar.collapsed .side-primary {
  padding-left: calc((var(--sb-w-rail) - 2px - 2 * var(--sb-padx) - var(--sb-pic)) / 2);
  padding-right: var(--sb-ext);
}
.sidebar.collapsed .side-brand {
  padding-left: calc((var(--sb-w-rail) - 2px - 2 * var(--sb-padx) - var(--sb-logo)) / 2);
}
/* No rail a pílula ativa continua correndo até a borda, e o ícone fica
   centralizado na faixa visível por causa do padding que compensa. */
.sidebar.collapsed .nav-item.active {
  padding-right: var(--sb-ext);
}
/* Sem rótulo não cabe número: o contador vira um ponto no canto do ícone. */
.sidebar.collapsed .nav-item { position: relative; }
.sidebar.collapsed .nav-dot {
  position: absolute;
  top: 7px;
  right: 20px;
  min-width: 9px;
  width: 9px;
  height: 9px;
  margin: 0;
  padding: 0;
  font-size: 0;
  line-height: 0;
  border: 2px solid var(--sb-surface);
  box-sizing: content-box;
}
.sidebar.collapsed .nav-item.active .nav-dot { border-color: var(--sb-primary-bg); }
/* Entre os dois estados o contador troca de âncora (canto direito da linha
   <-> canto do ícone) e nem `position` nem `display` animam. Em vez de
   arrastar um ponto solto pelo vão, ele reaparece já no lugar certo depois
   que a largura assentou. */
@keyframes sb-dot-in { from { opacity: 0; } to { opacity: 1; } }
.sidebar.collapsed .nav-dot,
.sidebar:not(.collapsed) .nav-dot { animation: sb-dot-in .18s ease .15s both; }

/* Card contextual do rail: replica o hover do vídeo sem alterar a navegação.
   A cor acompanha a identidade ativa da loja/sistema e um único card se move
   entre os ícones, em vez de duplicar elementos sobre toda a lista. */
.sidebar-context-card {
  --sb-context-top: 50%;
  --sb-context-exit-shift: -9px;
  --sb-context-enter-shift: 11px;
  position: absolute;
  z-index: 8;
  top: var(--sb-context-top);
  left: calc(100% + 18px);
  width: 432px;
  min-height: 196px;
  box-sizing: border-box;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 15px;
  padding: 28px 36px 30px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 18px;
  background: var(--sb-primary-bg);
  color: var(--sb-primary-ink);
  box-shadow: 0 30px 72px rgba(17, 24, 39, 0.28);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(10px, -50%) scaleX(0.18) scaleY(0.86);
  transform-origin: left center;
  will-change: top, opacity, transform;
  transition: top .30s cubic-bezier(.22, 1, .36, 1),
    opacity .12s ease-out,
    transform .28s cubic-bezier(.22, 1, .36, 1),
    visibility 0s linear .28s;
}
.sidebar-context-card.is-instant-dismiss {
  transition: none !important;
}
.sidebar .sidebar-context-card.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%) scaleX(1) scaleY(1);
  transition-delay: 0s;
}
.sidebar-context-card-icons {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .15s ease-out,
    transform .24s cubic-bezier(.22, 1, .36, 1);
}
.sidebar-context-card-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
  opacity: 0;
  transform: translateX(-9px) scale(0.76);
  transition: opacity .14s ease-out,
    transform .25s cubic-bezier(.22, 1.34, .36, 1);
}
.sidebar-context-card-icon.is-main {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.30);
}
.sidebar-context-card-icon.is-side { opacity: 0; }
.sidebar-context-card-icon .icon,
.sidebar-context-card-icon .icon svg {
  width: 22px;
  height: 22px;
}
.sidebar-context-card-icon.is-main .icon,
.sidebar-context-card-icon.is-main .icon svg {
  width: 29px;
  height: 29px;
}
.sidebar-context-card-copy {
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  opacity: 0;
  transform: translateY(11px);
  transition: opacity .16s ease-out,
    transform .25s cubic-bezier(.22, 1, .36, 1);
}

/* Abertura curta a partir da lateral, seguida pelo mesmo encadeamento visual
   do exemplo: ícones em sequência e texto subindo logo depois. */
.sidebar .sidebar-context-card.is-visible:not(.is-switching):not(.is-content-entering) .sidebar-context-card-icons,
.sidebar .sidebar-context-card.is-visible:not(.is-switching):not(.is-content-entering) .sidebar-context-card-copy {
  opacity: 1;
  transform: translateY(0);
}
.sidebar .sidebar-context-card.is-visible:not(.is-switching):not(.is-content-entering) .sidebar-context-card-icons {
  transition-delay: .06s;
}
.sidebar .sidebar-context-card.is-visible:not(.is-switching):not(.is-content-entering) .sidebar-context-card-copy {
  transition-delay: .14s;
}
.sidebar .sidebar-context-card.is-visible:not(.is-switching):not(.is-content-entering) .sidebar-context-card-icon {
  opacity: 1;
  transform: translateX(0) scale(1);
}
.sidebar .sidebar-context-card.is-visible:not(.is-switching):not(.is-content-entering) .sidebar-context-card-icon.is-side {
  opacity: 0.68;
}
.sidebar .sidebar-context-card.is-visible:not(.is-switching):not(.is-content-entering) .sidebar-context-card-icon:nth-child(1) {
  transition-delay: .08s;
}
.sidebar .sidebar-context-card.is-visible:not(.is-switching):not(.is-content-entering) .sidebar-context-card-icon:nth-child(2) {
  transition-delay: .12s;
}
.sidebar .sidebar-context-card.is-visible:not(.is-switching):not(.is-content-entering) .sidebar-context-card-icon:nth-child(3) {
  transition-delay: .16s;
}

/* Ao descer ou subir o mouse, o corpo do card vai até o novo item enquanto
   o conteúdo antigo sai na direção oposta e o novo entra pela direção do
   movimento. Isso evita fechar e abrir outro card entre itens vizinhos. */
.sidebar-context-card.is-switching .sidebar-context-card-icons,
.sidebar-context-card.is-switching .sidebar-context-card-copy {
  opacity: 0;
  transform: translateY(var(--sb-context-exit-shift));
  transition-duration: .09s;
  transition-delay: 0s;
}
.sidebar-context-card.is-content-entering .sidebar-context-card-icons,
.sidebar-context-card.is-content-entering .sidebar-context-card-copy {
  opacity: 0;
  transform: translateY(var(--sb-context-enter-shift));
  transition: none;
}
.sidebar-context-card.is-content-entering .sidebar-context-card-icon {
  opacity: 0;
  transform: translateY(var(--sb-context-enter-shift)) scale(0.76);
  transition: none;
}
.sidebar-context-card-title {
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-context-card-description {
  max-width: 356px;
  color: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
  opacity: 0.84;
}

/* O item do Gemini usa o mesmo balão preto com a estrela como identificação,
   mas sem repetir o nome do recurso nem o texto de permissão. */
.sidebar-context-card.is-text-only {
  min-height: 164px;
  gap: 14px;
  padding: 24px 32px;
}
.sidebar-context-card.is-text-only .sidebar-context-card-icons { min-height: 56px; }
.sidebar-context-card.is-text-only .sidebar-context-card-title { display: none; }
.sidebar-context-card.is-text-only .sidebar-context-card-copy { gap: 0; }
.sidebar-context-card.is-text-only .sidebar-context-card-description {
  max-width: 100%;
  font-size: 17px;
  font-weight: 600;
  opacity: 1;
}

@media (hover: none), (pointer: coarse) {
  .sidebar-context-card { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-context-card { transition: none; }
  .sidebar-context-card-icons,
  .sidebar-context-card-icon,
  .sidebar-context-card-copy { transition: none; }
}

/* Selo da loja: dentro do cartão ele não precisa de cartão próprio. */
.side-brand {
  min-height: calc(48px * var(--sb-scale, 1));
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--sb-ink);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background .18s, border-color .18s,
    padding .26s cubic-bezier(.4, 0, .2, 1), gap .26s cubic-bezier(.4, 0, .2, 1);
}
.side-brand:not(:disabled):hover { background: var(--sb-hover); }
.side-brand:disabled { cursor: default; }
.side-brand:disabled .side-brand-arrow { display: none; }
.side-logo {
  width: calc(var(--sb-logo) * var(--sb-scale, 1));
  height: calc(var(--sb-logo) * var(--sb-scale, 1));
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  background: var(--sb-hover);
  border: 1px solid var(--sb-border);
  transition: width .26s cubic-bezier(.4, 0, .2, 1), height .26s cubic-bezier(.4, 0, .2, 1);
}
.side-logo img { width: 100%; height: 100%; object-fit: cover; }
.side-brand .sb-name {
  min-width: 0;
  flex: 1;
  color: var(--sb-ink);
  font-weight: 600;
  font-size: calc(13.5px * var(--sb-scale, 1));
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-brand small {
  display: block;
  margin-top: 2px;
  color: var(--sb-muted);
  font-weight: 500;
  font-size: calc(10.5px * var(--sb-scale, 1));
}
.side-brand-arrow {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--sb-muted);
  opacity: .55;
}

/* Vender: o botão primário do sistema (mesma convenção do --pop-primary). */
.side-primary {
  height: calc(var(--sb-primary-h) * var(--sb-scale, 1));
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  /* A borda esquerda continua arredondada; a extremidade que encontra o
     conteúdo fica reta. */
  position: relative;
  width: calc(100% + var(--sb-ext));
  margin-right: calc(-1 * var(--sb-ext));
  padding: 0 calc(12px + var(--sb-ext)) 0 12px;
  border-radius: 999px 0 0 999px;
  /* Sem borda: os .nav-item também não têm, e 1px transparente deslocava o
     ícone em 1px no rail. */
  border: none;
  background: var(--sb-primary-bg);
  color: var(--sb-primary-ink);
  font-family: inherit;
  font-size: calc(13.5px * var(--sb-scale, 1));
  font-weight: 600;
  cursor: pointer;
  transition: transform .16s, filter .16s,
    padding .26s cubic-bezier(.4, 0, .2, 1), gap .26s cubic-bezier(.4, 0, .2, 1);
}
.side-primary:hover { transform: translateY(-1px); filter: brightness(1.12); }
.side-primary:active { transform: none; }
.side-primary-ic {
  width: calc(var(--sb-pic) * var(--sb-scale, 1));
  height: calc(var(--sb-pic) * var(--sb-scale, 1));
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  transition: width .26s cubic-bezier(.4, 0, .2, 1), height .26s cubic-bezier(.4, 0, .2, 1);
}
.side-primary-ic .icon {
  width: calc(var(--sb-pic-glyph) * var(--sb-scale, 1));
  height: calc(var(--sb-pic-glyph) * var(--sb-scale, 1));
  transition: width .26s cubic-bezier(.4, 0, .2, 1), height .26s cubic-bezier(.4, 0, .2, 1);
}
.side-primary-label { flex: 1; min-width: 0; }
.side-primary-arrow { flex: 0 0 auto; width: 18px; height: 18px; opacity: .6; }

.side-sep { height: 1px; background: var(--sb-border); margin: 12px 2px 6px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  height: calc(var(--sb-item-h) * var(--sb-scale, 1));
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0 12px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--sb-ink);
  font-size: calc(13px * var(--sb-scale, 1));
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  position: relative;
  /* O fundo troca sem atraso para nascer junto com os recortes ::before e
     ::after do item ativo. */
  transition: color .16s ease,
    padding .26s cubic-bezier(.4, 0, .2, 1), gap .26s cubic-bezier(.4, 0, .2, 1);
}
.nav-item:hover { background: var(--sb-hover); }
.nav-item:focus-visible { outline: 2px solid var(--sb-accent); outline-offset: 2px; }

/* Ativo: pílula sólida que corre até a borda de dentro do cartão. */
.nav-item.active {
  background: var(--sb-primary-bg);
  color: var(--sb-primary-ink);
  font-weight: 600;
  width: calc(100% + var(--sb-ext));
  margin-right: calc(-1 * var(--sb-ext));
  padding-right: calc(12px + var(--sb-ext));
  border-radius: 999px 0 0 999px;
}
.nav-item.active:hover { background: var(--sb-primary-bg); }
.nav-item.active:focus-visible {
  outline-color: var(--sb-primary-ink);
  outline-offset: -4px;
}

/* As curvas auxiliares que acompanham a borda direita usam o mesmo fundo do
   botão. Assim nenhum fragmento branco aparece ao redor da aba ativa. */
.nav-item.active::before,
.nav-item.active::after {
  --sb-notch: calc(var(--sb-item-h) * var(--sb-scale, 1) / 2 - var(--sb-bulge));
}
.side-primary::before,
.side-primary::after {
  --sb-notch: calc(var(--sb-primary-h) * var(--sb-scale, 1) / 2 - var(--sb-bulge));
}
.nav-item.active::before,
.nav-item.active::after,
.side-primary::before,
.side-primary::after {
  content: "";
  position: absolute;
  /* O recorte termina na mesma borda externa do botão e da barra. */
  right: 0;
  width: var(--sb-notch);
  /* Os 6px extras fecham a emenda entre o botão e o recorte. */
  height: calc(var(--sb-notch) + 6px);
  pointer-events: none;
}
.nav-item.active::before,
.side-primary::before {
  bottom: calc(100% - 6px);
  background: radial-gradient(circle at 0 0,
    transparent var(--sb-notch),
    var(--sb-primary-bg) var(--sb-notch));
}
.nav-item.active::after,
.side-primary::after {
  top: calc(100% - 6px);
  background: radial-gradient(circle at 0 100%,
    transparent var(--sb-notch),
    var(--sb-primary-bg) var(--sb-notch));
}

/* Destaque independente da navegação. O card se move por baixo da lista;
   os botões, ícones e nomes permanecem nos seus lugares. */
.sidebar-active-glider {
  --sb-notch: calc(var(--sb-item-h) * var(--sb-scale, 1) / 2 - var(--sb-bulge));
  position: absolute;
  left: var(--sb-padx);
  right: 0;
  height: calc(var(--sb-item-h) * var(--sb-scale, 1));
  border-radius: 999px 0 0 999px;
  background: var(--sb-primary-bg);
  pointer-events: none;
  z-index: 1;
  will-change: transform;
}
.sidebar-active-glider[hidden] { display: none; }
.sidebar-active-glider::before,
.sidebar-active-glider::after {
  content: "";
  position: absolute;
  right: 0;
  width: var(--sb-notch);
  height: calc(var(--sb-notch) + 6px);
  pointer-events: none;
}
.sidebar-active-glider::before {
  bottom: calc(100% - 6px);
  background: radial-gradient(circle at 0 0,
    transparent var(--sb-notch),
    var(--sb-primary-bg) var(--sb-notch));
}
.sidebar-active-glider::after {
  top: calc(100% - 6px);
  background: radial-gradient(circle at 0 100%,
    transparent var(--sb-notch),
    var(--sb-primary-bg) var(--sb-notch));
}

/* Os blocos reais ficam acima do card móvel. O item ativo conserva somente
   sua geometria e acessibilidade; o fundo e os recortes pertencem ao glider. */
.sidebar.has-active-glider .side-brand,
.sidebar.has-active-glider .side-primary,
.sidebar.has-active-glider .side-nav,
.sidebar.has-active-glider .side-foot {
  position: relative;
  z-index: 2;
}
.sidebar.has-active-glider .nav-item.active,
.sidebar.has-active-glider .nav-item.active:hover,
.sidebar.has-active-glider .nav-item.glider-covered:hover {
  background: transparent;
}
.sidebar.has-active-glider .nav-item.active::before,
.sidebar.has-active-glider .nav-item.active::after {
  content: none;
}

/* O nome coberto pelo card assume o contraste ativo. Durante o percurso o
   destino ainda não muda de cor: ele só é "absorvido" quando o card chega. */
.sidebar.has-active-glider .nav-item.glider-covered,
.sidebar.has-active-glider.is-nav-gliding .nav-item.active.glider-covered {
  color: var(--sb-primary-ink);
  font-weight: 600;
}
.sidebar.has-active-glider .nav-item.glider-covered .nav-ic {
  color: var(--sb-primary-ink);
}
.sidebar.has-active-glider.is-nav-gliding .nav-item.active:not(.glider-covered) {
  color: var(--sb-ink);
  font-weight: 500;
}
.sidebar.has-active-glider.is-nav-gliding .nav-item.active:not(.glider-covered) .nav-ic {
  color: var(--sb-muted);
}

/* Abrir ou recolher não precisa medir o glider em cada frame.
   Durante esse movimento o fundo volta temporariamente para o próprio item
   ativo, que acompanha o layout nativamente. Ao terminar, JS posiciona o
   glider uma vez e troca as camadas no mesmo frame. */
.sidebar.has-active-glider.is-sidebar-resizing .sidebar-active-glider {
  opacity: 0;
}
.sidebar.has-active-glider.is-sidebar-resizing .nav-item.active,
.sidebar.has-active-glider.is-sidebar-resizing .nav-item.active:hover {
  background: var(--sb-primary-bg);
  color: var(--sb-primary-ink);
  font-weight: 600;
}
.sidebar.has-active-glider.is-sidebar-resizing .nav-item.active .nav-ic {
  color: var(--sb-primary-ink);
}
.sidebar.has-active-glider.is-sidebar-resizing .nav-item.active::before,
.sidebar.has-active-glider.is-sidebar-resizing .nav-item.active::after {
  content: "";
}

/* Ícone solto: sem caixa, sem borda. A caixa era ruído em coluna. */
.nav-ic {
  width: calc(var(--sb-ic) * var(--sb-scale, 1));
  height: calc(var(--sb-ic) * var(--sb-scale, 1));
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: transparent;
  border: none;
  color: var(--sb-muted);
  transition: color .16s ease, width .26s cubic-bezier(.4, 0, .2, 1), height .26s cubic-bezier(.4, 0, .2, 1);
}
.nav-ic .icon {
  width: calc(var(--sb-ic-glyph) * var(--sb-scale, 1));
  height: calc(var(--sb-ic-glyph) * var(--sb-scale, 1));
  transition: width .26s cubic-bezier(.4, 0, .2, 1), height .26s cubic-bezier(.4, 0, .2, 1);
}
.nav-item:hover .nav-ic { color: var(--sb-ink); }
.nav-item.active .nav-ic { background: transparent; border: none; color: var(--sb-primary-ink); }

.nav-label { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Tudo que encolhe junto com a barra usa a mesma curva e duração dela; a
   opacidade sai antes para o texto não ficar espremido no fim. */
.nav-label,
.side-brand .sb-name,
.side-primary-label {
  transition: flex-grow .26s cubic-bezier(.4, 0, .2, 1), opacity .16s ease;
}
.side-primary-arrow,
.side-brand-arrow {
  transition: width .26s cubic-bezier(.4, 0, .2, 1), opacity .16s ease;
}
.side-primary-label { overflow: hidden; white-space: nowrap; }
.side-primary-arrow,
.side-brand-arrow { overflow: hidden; }

/* `.sidebar button` (0,1,1) vencia `.nav-item` (0,1,0) e deixava a navegação
   inteira em peso 300 — apagada demais para um menu. Estes seletores têm
   duas classes, então ganham sem precisar de !important. */
.sidebar .nav-item,
.mobile-drawer-panel .nav-item { font-weight: 500; }
.sidebar .nav-item.active,
.mobile-drawer-panel .nav-item.active { font-weight: 600; }
.sidebar .side-primary,
.mobile-drawer-panel .side-primary { font-weight: 600; }

/* O ponto vira contador de pendência; sem valor ele não aparece. */
.nav-dot {
  min-width: 18px;
  height: 18px;
  margin-left: auto;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--sb-danger);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  display: none;
}
.nav-item[data-badge]:not([data-badge=""]) .nav-dot { display: block; }

.nav-item.danger { color: var(--sb-danger); }
.nav-item.danger .nav-ic { color: var(--sb-danger); background: transparent; border: none; }
.nav-item.danger:hover { background: rgba(215, 0, 21, 0.08); }

.side-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--sb-border);
}

/* Configurações fica sozinho na linha de cima, com o nome; Sair divide a
   linha de baixo com o botão redondo, também com o nome.

   Nada aqui usa quebra de linha, margin:auto nem width:auto — os três
   mudariam de posição de um frame para o outro. O botão sai do fluxo e
   percorre a distância pelo `left`, o Sair encolhe por uma largura
   calculada, e o espaço que o botão ocupa no rail é aberto pelo
   padding-bottom. Todos são comprimentos, então todos interpolam. */
.sidebar .side-foot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding-bottom: 0;
  transition: padding-bottom .26s cubic-bezier(.4, 0, .2, 1);
}
.sidebar .side-foot .nav-item {
  width: 100%;
  transition: color .16s ease,
    padding .26s cubic-bezier(.4, 0, .2, 1),
    gap .26s cubic-bezier(.4, 0, .2, 1);
}
/* Configurações ativo usa a mesma largura e a mesma emenda dos itens do
   menu principal; a regra genérica do rodapé não pode encurtá-lo. */
.sidebar .side-foot .nav-item.active {
  width: calc(100% + var(--sb-ext));
  margin-right: calc(-1 * var(--sb-ext));
  padding-right: calc(12px + var(--sb-ext));
}
/* Sair abre espaço para o botão à direita; no rail volta à largura cheia. */
.sidebar .side-foot .nav-item.danger { width: calc(100% - var(--sb-fab) - 8px); }
.sidebar.collapsed .side-foot .nav-item.danger { width: 100%; }
/* Aberta, o botão fica encostado à direita na linha do Sair; recolhida, vai
   para o centro de uma faixa própria aberta abaixo. */
.sidebar .side-foot .side-toggle {
  position: absolute;
  bottom: 0;
  left: calc(100% - var(--sb-fab));
  margin: 0;
}
.sidebar.collapsed .side-foot { padding-bottom: calc(var(--sb-fab) + 6px); }
.sidebar.collapsed .side-foot .side-toggle { left: calc(50% - var(--sb-fab) / 2); }

/* Botão redondo que alterna rail / expandido. */
.side-toggle {
  width: var(--sb-fab);
  height: var(--sb-fab);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: none;
  background: var(--sb-primary-bg);
  color: var(--sb-primary-ink);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: filter .16s, transform .16s, box-shadow .16s,
    left .26s cubic-bezier(.4, 0, .2, 1);
}
.side-toggle:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.26);
}
.side-toggle:active { transform: none; }
/* Anel do foco com folga maior: sobre um botão já azul, o vão claro é o que
   separa o anel do preenchimento. */
.side-toggle:focus-visible { outline: 2px solid var(--sb-accent); outline-offset: 3px; }
.side-toggle .icon { width: 15px; height: 15px; }
/* O X do ICONS está fora do centro do próprio viewBox 24x24: a bbox do path
   vai de 2.88 a 18.30, ou seja centro em 10.59 e não 12. Num círculo pequeno
   isso aparece. A correção fica só aqui, para não mexer no ícone que os
   pop-ups compartilham. (O hambúrguer já é simétrico e não precisa.) */
.side-toggle[aria-expanded="true"] .icon svg { transform: translateX(5.875%); }
.home-ui-mode-sidebar {
  height: auto;
  min-height: calc(48px * var(--sb-scale, 1));
  margin-bottom: 5px;
  border: 1px solid var(--sb-accent);
  border-radius: 16px;
  background: var(--sb-accent-soft);
  color: var(--sb-ink);
}
.home-ui-mode-sidebar:hover { background: var(--sb-accent-soft); }
.home-ui-mode-sidebar .nav-ic { color: var(--sb-accent); }
.home-ui-mode-sidebar-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  line-height: 1.05;
}
.home-ui-mode-sidebar-copy > span { overflow: hidden; font-size: 11.5px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.home-ui-mode-sidebar-copy > small { color: var(--blue); font-size: 9.5px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.home-ui-mode-sidebar-action {
  flex: 0 0 auto;
  padding: 4px 6px;
  border: 1px solid rgba(var(--blue-rgb), 0.24);
  border-radius: 7px;
  background: var(--card);
  color: var(--blue);
  font-size: 8.5px;
  font-weight: 900;
}
html[data-theme="dark"] .home-ui-mode-sidebar-copy > span,
html[data-theme="dark"] .home-ui-mode-sidebar-copy > small,
html[data-theme="dark"] .home-ui-mode-sidebar-action {
  color: #fff;
}
html[data-theme="dark"] .home-ui-mode-sidebar-action {
  border-color: rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.10);
}

.main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 32px;
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f7 52%, #eef6ff 100%);
}
.main.home-main { padding: 0; }
.main h2 { margin: 0 0 4px; font-size: 24px; font-weight: 500; }
.main .sub { color: var(--muted); font-size: 13px; font-weight: 500; margin-bottom: 22px; }

@media (min-width: 941px) {
  .system-scale {
    width: 125%;
    /* Compensa o scale usando a mesma altura já calculada para a shell. */
    height: 125%;
    transform: scale(0.8);
    transform-origin: top left;
  }
}

/* ========================================================================== */
/* Avaliação de usados — PDV + Configurações                                  */
/* ========================================================================== */
.pos-tool-btn.pos-trade-in-tool {
  width: auto;
  min-width: 48px;
  padding: 0 14px;
  gap: 7px;
  white-space: nowrap;
}

.pos-trade-in-tool > span:not(.icon) {
  font-size: 12px;
  font-weight: 850;
}

.pos-trade-in-tool.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.pos-trade-in-summary {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 32px 32px;
  align-items: center;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card-soft);
}

.pos-trade-in-summary-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--ink);
}

.pos-trade-in-summary-icon .icon { width: 20px; height: 20px; }

.pos-trade-in-summary-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.pos-trade-in-summary-copy small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.pos-trade-in-summary-copy b {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-trade-in-summary-copy > span {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.pos-trade-in-edit,
.pos-trade-in-remove {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.pos-trade-in-edit:hover,
.pos-trade-in-remove:hover { color: var(--ink); background: var(--field); }
.pos-trade-in-edit .icon,
.pos-trade-in-remove .icon { width: 17px; height: 17px; }

.stats-modal-card.trade-in-dialog {
  width: min(940px, calc(100vw - 36px));
  max-height: min(880px, calc(100svh - 28px));
}

.trade-in-dialog > .stats-modal-body { padding: 0; }

.trade-in-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .85fr);
  min-height: 510px;
}

.trade-in-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}

.trade-in-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.trade-in-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.trade-in-field > label,
.trade-in-rules-head b {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.trade-in-field input,
.trade-in-field select,
.trade-in-field textarea {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  color: var(--ink);
  background: var(--field);
  font: inherit;
  font-size: 13px;
  padding: 10px 12px;
}

.trade-in-field textarea { min-height: 82px; resize: vertical; }
.trade-in-field input:focus,
.trade-in-field select:focus,
.trade-in-field textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 9%, transparent); }

.trade-in-suffix { position: relative; }
.trade-in-suffix input { padding-right: 36px; }
.trade-in-suffix > span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; font-weight: 800; }

.trade-in-rules-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-top: 2px;
}

.trade-in-rules-head > div { display: flex; flex-direction: column; gap: 3px; }
.trade-in-rules-head span { color: var(--muted); font-size: 11px; }

.trade-in-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.trade-in-rule {
  position: relative;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 58px;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  cursor: pointer;
}

.trade-in-rule input { position: absolute; opacity: 0; pointer-events: none; }
.trade-in-check { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: transparent; background: var(--field); }
.trade-in-check .icon { width: 15px; height: 15px; }
.trade-in-rule input:checked + .trade-in-check { color: #fff; border-color: var(--ink); background: var(--ink); }
.trade-in-rule.block input:checked + .trade-in-check { border-color: var(--red, #e5484d); background: var(--red, #e5484d); }
.trade-in-rule-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.trade-in-rule-copy b { overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.trade-in-rule-copy small { color: var(--muted); font-size: 10px; }
.trade-in-empty-rules { grid-column: 1 / -1; padding: 18px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); font-size: 12px; text-align: center; }
.trade-in-condition { display: flex; flex-direction: column; gap: 9px; }
.trade-in-condition[hidden] { display: none; }

.trade-in-photos {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  padding-top: 2px;
}
.trade-in-photos > div:first-child { display: flex; flex-direction: column; gap: 3px; }
.trade-in-photos > div:first-child b { color: var(--ink); font-size: 12px; font-weight: 850; }
.trade-in-photos > div:first-child span { color: var(--muted); font-size: 10px; }
.trade-in-photos > input { display: none; }
.trade-in-photo-list { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; min-height: 24px; color: var(--muted); font-size: 10px; }
.trade-in-photo { position: relative; width: 72px; height: 72px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--field); }
.trade-in-photo img { width: 100%; height: 100%; object-fit: cover; }
.trade-in-photo button { position: absolute; top: 4px; right: 4px; width: 23px; height: 23px; display: grid; place-items: center; border: 0; border-radius: 8px; color: #fff; background: rgb(0 0 0 / .72); cursor: pointer; }
.trade-in-photo button .icon { width: 13px; height: 13px; }

.trade-in-offer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 28px 24px;
  color: #fff;
  background: var(--ink);
}

.trade-in-offer-kicker { font-size: 11px; font-weight: 850; letter-spacing: .09em; opacity: .62; text-transform: uppercase; }
.trade-in-offer > strong { margin-top: 12px; font-size: clamp(30px, 4vw, 48px); line-height: 1; letter-spacing: -.05em; }
.trade-in-offer-device { margin-top: 10px; min-height: 32px; font-size: 13px; font-weight: 750; opacity: .75; }
.trade-in-offer-breakdown { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; padding: 18px 0; border-top: 1px solid rgb(255 255 255 / .18); border-bottom: 1px solid rgb(255 255 255 / .18); }
.trade-in-offer-breakdown > div { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.trade-in-offer-breakdown span { opacity: .62; }
.trade-in-offer-breakdown b { font-weight: 850; }
.trade-in-eligibility { display: flex; align-items: flex-start; gap: 8px; margin-top: auto; padding: 14px; border-radius: 13px; color: #c9f7dc; background: rgb(37 191 103 / .17); font-size: 12px; font-weight: 750; }
.trade-in-eligibility.blocked { color: #ffd1d1; background: rgb(229 72 77 / .18); }
.trade-in-eligibility.waiting { color: rgb(255 255 255 / .72); background: rgb(255 255 255 / .08); }
.trade-in-eligibility .icon { width: 17px; height: 17px; flex: 0 0 auto; }
.trade-in-offer > small { margin-top: 12px; font-size: 10px; opacity: .52; }

.trade-in-dialog > .stats-modal-foot {
  grid-template-columns: repeat(4, minmax(0, auto));
  justify-content: end;
}

.pos-pay-line-locked { flex-wrap: wrap; }
.pos-pay-locked-label { width: 100%; padding-left: 30px; color: var(--muted); font-size: 10px; font-weight: 750; }

.config-trade-in-loading,
.config-trade-in-empty {
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--muted);
  background: var(--card);
  text-align: center;
}

.config-trade-in-empty > .icon { width: 32px; height: 32px; }
.config-trade-in-empty h2,
.config-trade-in-empty p { margin: 0; }
.config-trade-in-empty h2 { color: var(--ink); font-size: 20px; }
.config-trade-in-empty p { max-width: 540px; font-size: 13px; line-height: 1.5; }

.config-trade-in-page { display: flex; flex-direction: column; gap: 16px; }
.config-trade-in-hero,
.config-trade-in-section,
.config-trade-in-footer { border: 1px solid var(--line); border-radius: 22px; background: var(--card); }

.config-trade-in-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  padding: 22px 24px;
}

.config-trade-in-eyebrow { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.config-trade-in-hero h2 { margin: 5px 0 6px; color: var(--ink); font-size: 23px; letter-spacing: -.025em; }
.config-trade-in-hero p { max-width: 660px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.config-trade-in-expiry { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 750; white-space: nowrap; }
.config-trade-in-expiry > span:last-child { display: flex; align-items: center; gap: 7px; }
.config-trade-in-expiry input { width: 70px; height: 40px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--field); padding: 0 10px; font: inherit; }

.config-trade-in-section { overflow: hidden; }
.config-trade-in-section > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.config-trade-in-section > header > div { display: flex; align-items: center; gap: 12px; }
.config-trade-in-section > header > div > span { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: #fff; background: var(--ink); font-size: 11px; font-weight: 900; }
.config-trade-in-section > header .stats-modal-secondary {
  width: auto;
  min-width: max-content;
  box-sizing: border-box;
  padding: 0 16px;
}
.config-trade-in-section > header .stats-modal-secondary .icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 0;
}
.config-trade-in-section h3,
.config-trade-in-section p { margin: 0; }
.config-trade-in-section h3 { color: var(--ink); font-size: 14px; }
.config-trade-in-section p { margin-top: 3px; color: var(--muted); font-size: 11px; }
.config-trade-in-section > header > div > span .icon { width: 17px; height: 17px; }

.config-trade-in-models { display: flex; flex-direction: column; gap: 16px; padding: 16px; background: var(--card-soft); }
.config-trade-in-model-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.config-trade-in-model-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.config-trade-in-model-title,
.config-trade-in-model-actions { display: flex; align-items: center; gap: 12px; }
.config-trade-in-model-actions .config-trade-in-active { display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 750; }
.config-trade-in-model-actions .config-trade-in-remove { width: 40px; flex: 0 0 40px; }
.config-trade-in-model-title > span { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 32px; border-radius: 10px; color: var(--ink); background: var(--field); border: 1px solid var(--line); font-size: 10px; font-weight: 900; }
.config-trade-in-model-title > span .icon { width: 16px; height: 16px; }
.config-trade-in-model-title h3,
.config-trade-in-model-title p,
.config-trade-in-model-rules h4,
.config-trade-in-model-rules p { margin: 0; }
.config-trade-in-model-title h3,
.config-trade-in-model-rules h4 { color: var(--ink); font-size: 13px; }
.config-trade-in-model-title p,
.config-trade-in-model-rules p { margin-top: 3px; color: var(--muted); font-size: 10px; }
.config-trade-in-model-fields { display: grid; grid-template-columns: .8fr 1.35fr .9fr .8fr; gap: 10px; padding: 16px; }
.config-trade-in-model-fields > label,
.config-trade-in-row > label { min-width: 0; display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 750; }
.config-trade-in-model-fields input,
.config-trade-in-row input:not([type="checkbox"]),
.config-trade-in-row select { width: 100%; height: 40px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 10px; outline: 0; color: var(--ink); background: var(--field); padding: 0 10px; font: inherit; font-size: 12px; }
.config-trade-in-model-fields input:focus,
.config-trade-in-row input:focus,
.config-trade-in-row select:focus { border-color: var(--ink); }
.config-trade-in-model-rules { overflow: hidden; margin: 0 16px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.config-trade-in-model-rules > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 14px; border-bottom: 1px solid var(--line); background: var(--card-soft); }
.config-trade-in-model-rules > header .stats-modal-secondary { width: auto; min-width: max-content; box-sizing: border-box; padding: 0 14px; }
.config-trade-in-model-rules > header .stats-modal-secondary .icon { width: 16px; height: 16px; flex: 0 0 16px; margin: 0; }

.config-trade-in-table-head,
.config-trade-in-row { display: grid; align-items: end; gap: 10px; padding: 11px 16px; }
.config-trade-in-table-head.model-head,
.config-trade-in-row.model-row { grid-template-columns: .8fr 1.35fr .9fr .8fr 54px 38px; }
.config-trade-in-table-head.rule-head,
.config-trade-in-row.rule-row { grid-template-columns: 1.5fr .8fr .8fr .65fr 54px 38px; }
.config-trade-in-table-head { color: var(--muted); background: var(--card-soft); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .045em; }
.config-trade-in-row { border-top: 1px solid var(--line); }
.config-trade-in-row:first-child { border-top: 0; }
.config-trade-in-active { align-items: center; }
.config-trade-in-active input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.config-trade-in-active input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .16);
  transition: transform 160ms ease, background-color 160ms ease;
}
.config-trade-in-active input[type="checkbox"]:checked { border-color: var(--ink); background: var(--ink); }
.config-trade-in-active input[type="checkbox"]:checked::after { transform: translateX(16px); background: var(--card); }
.config-trade-in-active input[type="checkbox"]:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.config-trade-in-active input[type="checkbox"]:disabled { cursor: default; opacity: .55; }
.config-trade-in-remove { width: 36px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--field); cursor: pointer; }
.config-trade-in-remove:hover { color: var(--red, #e5484d); }
.config-trade-in-remove .icon { width: 16px; height: 16px; }
.config-trade-in-no-rows { padding: 28px 18px; color: var(--muted); font-size: 12px; text-align: center; }

.config-trade-in-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 20px; }
.config-trade-in-footer > div { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.config-trade-in-footer > div .icon { width: 16px; height: 16px; }
.config-trade-in-footer > .config-trade-in-footer-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-left: auto;
  font-size: 13px;
}
.config-trade-in-footer-actions .stats-modal-secondary,
.config-trade-in-footer-actions .stats-modal-primary {
  width: auto;
  min-width: max-content;
  box-sizing: border-box;
  padding: 0 16px;
}
.config-trade-in-footer-actions .stats-modal-secondary { background: var(--card); }
.config-trade-in-footer-actions .stats-modal-secondary:disabled { cursor: default; opacity: .5; }

.stats-modal-card.config-trade-in-export-dialog,
.stats-modal-card.config-trade-in-import-dialog { width: min(680px, 100%); }
.config-trade-in-import-dialog .stats-modal-body { padding: 14px; }
.config-trade-in-import-dialog .stats-modal-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0 14px 14px;
}
.config-trade-in-import-copy { display: flex; flex-direction: column; gap: 12px; }
.config-trade-in-import-copy > p {
  margin: 0;
  color: var(--pop-muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.config-trade-in-import-status {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  padding: 13px;
  border: 1px solid var(--pop-border);
  border-radius: 14px;
  color: var(--pop-ink);
  background: var(--pop-surface-alt);
}
.config-trade-in-import-status > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border: 1px solid var(--pop-border);
  border-radius: 11px;
  color: var(--pop-accent);
  background: var(--pop-hover);
}
.config-trade-in-import-status > span .icon { width: 19px; height: 19px; }
.config-trade-in-import-status > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.config-trade-in-import-status b,
.config-trade-in-import-status small { overflow-wrap: anywhere; }
.config-trade-in-import-status b { color: var(--pop-ink); font-size: 13px; font-weight: 600; }
.config-trade-in-import-status small { color: var(--pop-muted); font-size: 11px; line-height: 1.4; }
.config-trade-in-import-status.success { border-color: var(--pop-accent); background: var(--pop-accent-soft); }
.config-trade-in-import-status.error { border-color: var(--pop-danger-border); background: var(--pop-danger-bg); }
.config-trade-in-import-status.error > span,
.config-trade-in-import-status.error b { color: var(--pop-danger); }
.config-trade-in-import-warning {
  padding: 10px 12px;
  border: 1px solid var(--pop-border);
  border-radius: 12px;
  background: var(--pop-surface-alt);
}

.tools-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 250px);
  gap: 16px;
  align-items: start;
  padding-top: 4px;
}
.tools-action-square {
  width: 250px;
  aspect-ratio: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 58px;
  box-sizing: border-box;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(29, 29, 31, 0.10);
  border-radius: 22px;
  color: #fff;
  background: #1d1d1f;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.06);
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.tools-action-square:hover { border-color: rgba(29, 29, 31, 0.10); transform: translateY(-2px); box-shadow: 0 14px 26px rgba(0, 0, 0, 0.06); }
.tools-action-square:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.tools-action-square:disabled { cursor: default; opacity: .62; transform: none; }
.tools-action-icon {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #fff;
  background: #1d1d1f;
}
.tools-action-icon .icon {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 0;
  border-radius: 0;
  color: #fff;
  background: transparent;
}
.tools-action-copy {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  padding: 0 16px;
  border-top: 1px solid rgba(29, 29, 31, 0.10);
  background: #f5f5f7;
}
.tools-action-copy b { color: #1d1d1f; font-size: 15px; line-height: 1.2; font-weight: 750; }

html[data-theme="dark"] .tools-action-square {
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .tools-action-copy {
  border-top-color: rgba(255, 255, 255, 0.12);
  background: #181b22;
}

html[data-theme="dark"] .tools-action-copy b { color: #f5f5f7; }

.trade-in-evaluation-screen { padding-bottom: 40px; }
.trade-in-evaluation-page { gap: 16px; }
.trade-in-page-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.trade-in-page-heading > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.trade-in-page-header h1 { margin: 0; }
.trade-in-page-header p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.trade-in-page-body {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}
.trade-in-evaluation-page .trade-in-layout { min-height: calc(var(--app-height) - 270px); }
.trade-in-page-footer {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto auto minmax(190px, 1fr);
  gap: 10px;
  padding-top: 4px;
}
.trade-in-page-footer .stats-modal-danger,
.trade-in-page-footer .stats-modal-secondary,
.trade-in-page-footer .stats-modal-primary {
  width: auto;
  min-width: 150px;
  height: 46px;
  box-sizing: border-box;
}

html[data-theme="dark"] .trade-in-offer,
html[data-theme="dark"] .pos-trade-in-summary-icon,
html[data-theme="dark"] .config-trade-in-section > header > div > span,
html[data-theme="dark"] .pos-trade-in-tool.active { color: #fff; background: #171719; border-color: #38383d; }
html[data-theme="dark"] .config-trade-in-model-title > span { color: var(--ink); background: var(--field); border-color: var(--line); }

@media (max-width: 900px) {
  .pos-search-row { overflow-x: auto; scrollbar-width: none; }
  .pos-search-row::-webkit-scrollbar { display: none; }
  .pos-search-row .pos-search { min-width: min(320px, 70vw); }
  .pos-trade-in-tool > span:not(.icon) { display: none; }
  .pos-tool-btn.pos-trade-in-tool { width: 48px; padding: 0; }
  .trade-in-layout { grid-template-columns: 1fr; }
  .trade-in-offer { min-height: 280px; }
  .trade-in-eligibility { margin-top: 24px; }
  .trade-in-dialog > .stats-modal-foot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trade-in-page-footer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trade-in-page-footer .stats-modal-danger,
  .trade-in-page-footer .stats-modal-secondary,
  .trade-in-page-footer .stats-modal-primary { width: 100%; min-width: 0; }
  .config-trade-in-table-head { display: none; }
  .config-trade-in-model-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .config-trade-in-row.model-row,
  .config-trade-in-row.rule-row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; }
  .config-trade-in-rule-label { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .trade-in-form { padding: 18px 15px; }
  .trade-in-fields-row,
  .trade-in-rules { grid-template-columns: 1fr; }
  .trade-in-dialog > .stats-modal-foot { grid-template-columns: 1fr; }
  .trade-in-page-header { align-items: flex-start; }
  .trade-in-page-footer { grid-template-columns: 1fr; }
  .config-trade-in-hero,
  .config-trade-in-section > header,
  .config-trade-in-footer { align-items: stretch; flex-direction: column; }
  .config-trade-in-section > header .stats-modal-secondary,
  .config-trade-in-footer .stats-modal-primary { width: 100%; }
  .config-trade-in-footer > .config-trade-in-footer-actions {
    width: 100%;
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
  }
  .config-trade-in-footer-actions .stats-modal-secondary,
  .config-trade-in-footer-actions .stats-modal-primary { width: 100%; }
  .config-trade-in-models { padding: 12px; }
  .config-trade-in-model-card-head,
  .config-trade-in-model-rules > header { align-items: stretch; flex-direction: column; }
  .config-trade-in-model-actions { justify-content: space-between; }
  .config-trade-in-model-fields { grid-template-columns: 1fr; padding: 14px; }
  .config-trade-in-model-rules { margin: 0 12px 12px; }
  .config-trade-in-model-rules > header .stats-modal-secondary { width: 100%; }
  .config-trade-in-row.model-row,
  .config-trade-in-row.rule-row { grid-template-columns: 1fr; }
  .config-trade-in-active { align-items: flex-start; }
  .config-trade-in-remove { width: 100%; }
  .tools-action-grid { grid-template-columns: 210px; padding: 4px 8px 0; }
  .tools-action-square { width: 210px; padding: 0; border-radius: 20px; }
}

/* ---------- Telas ligadas ao Firestore ---------- */
.data-page {
  min-height: 100%;
}
.data-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.data-head h1 {
  margin: 0;
  color: #1d1d1f;
  font-size: 42px;
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: 0;
}
.data-head p {
  margin: 8px 0 0;
  color: #6e6e73;
  font-size: 15px;
  font-weight: 800;
}
.data-search-card {
  margin-bottom: 14px;
  border-radius: 18px;
  box-shadow: none;
}
.data-search-card .login-field {
  border: none;
  border-radius: 18px;
  background: #f5f5f7;
}
.data-table-card {
  border-radius: 24px;
}
.data-table-card table {
  min-width: 760px;
}

/* ---------- Início ---------- */
.home-page {
  min-height: var(--app-height);
  position: relative;
  padding: 14px 20px 36px 40px;
  background:
    radial-gradient(circle at 98% 68%, rgba(19, 160, 101, 0.10), transparent 32%),
    linear-gradient(135deg, #ffffff 0%, #f5f5f7 46%, #eef6ff 100%);
}
.home-top-actions {
  position: absolute;
  top: 28px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6e6e73;
  font-size: 13px;
  font-weight: 900;
}
.home-top-actions .icon { width: 18px; height: 18px; }
.home-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 32px 2px 18px;
}
.home-header h1 {
  margin: 0;
  color: #1d1d1f;
  font-size: 42px;
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: 0;
}
.home-header p {
  margin: 8px 0 0;
  color: #6e6e73;
  font-size: 15px;
  font-weight: 800;
}
.home-badge {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: rgba(255, 255, 255, 0.72);
  color: #1d1d1f;
  font-size: 12px;
  font-weight: 900;
}
.home-grid {
  display: grid;
  grid-template-columns: minmax(620px, 1.15fr) minmax(360px, 0.95fr);
  gap: 16px;
  align-items: start;
}
.home-grid::after {
  content: "";
  display: block;
  height: 5px;
  grid-column: 1 / -1;
}
.home-left,
.home-right {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.inicio-card,
.inicio-hero {
  border: 1px solid rgba(29, 29, 31, 0.08);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.08);
}
.inicio-hero {
  min-height: 196px;
  padding: 28px;
  border-radius: 34px;
  background: #1d1d1f;
  color: #ffffff;
  display: grid;
  grid-template-columns: 1fr 330px;
  align-items: stretch;
  gap: 22px;
}
.hero-summary > span,
.hero-goal span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 900;
}
.hero-summary strong {
  display: block;
  margin-top: 8px;
  color: #ffffff;
  font-size: 54px;
  line-height: 0.94;
  font-weight: 900;
  letter-spacing: 0;
}
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.hero-chips span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 900;
}
.hero-chips .icon { width: 15px; height: 15px; }
.hero-goal {
  padding: 22px 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
}
.goal-head,
.goal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.goal-head b {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(19, 160, 101, 0.22);
  color: #7ee0af;
  font-size: 13px;
  font-weight: 900;
}
.goal-track {
  height: 10px;
  margin: 18px 0 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
}
.goal-track span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #13a065, var(--accent-blue));
  transition: width .25s ease;
}
.goal-track.light { background: #f5f5f7; border: 1px solid rgba(29,29,31,0.06); }
.hero-goal strong {
  display: block;
  color: #ffffff;
  font-size: 20px;
  font-weight: 900;
}
.hero-goal small {
  color: rgba(255, 255, 255, 0.60);
  font-size: 12px;
  font-weight: 800;
}
.inicio-card {
  padding: 20px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.96);
}
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.section-title > .icon {
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 12px;
  background: #f5f5f7;
  color: rgba(29, 29, 31, 0.84);
}
.section-title h2 {
  margin: 0;
  color: #1d1d1f;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
}
.section-title.with-pill span:last-child {
  margin-left: auto;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #f5f5f7;
  color: #1d1d1f;
  font-size: 11.5px;
  font-weight: 900;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.metric-tile {
  min-height: 150px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #f5f5f7;
}
.metric-tile span {
  display: inline-flex;
  color: var(--blue);
}
.metric-tile .icon { width: 17px; height: 17px; }
.metric-tile small,
.metric-tile em {
  display: block;
  color: #6e6e73;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}
.metric-tile strong {
  display: block;
  margin-top: 8px;
  color: #1d1d1f;
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
}
.metric-tile em { margin-top: 5px; }
.day-list,
.notify-list,
.birthday-list { display: flex; flex-direction: column; }
.day-row,
.notify-row,
.birthday-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.day-row {
  min-height: 54px;
  border-bottom: 1px solid rgba(29, 29, 31, 0.08);
}
.day-row:last-child { border-bottom: none; }
.day-row > .icon,
.notify-row > span,
.birthday-row > span {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  padding: 7px;
  border-radius: 10px;
  background: #f5f5f7;
  color: var(--blue);
}
.day-row div,
.notify-row div { flex: 1; min-width: 0; }
.day-row strong,
.notify-row strong,
.birthday-row strong {
  display: block;
  color: #1d1d1f;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.day-row small,
.notify-row small {
  display: block;
  margin-top: 2px;
  color: #6e6e73;
  font-size: 12px;
  font-weight: 800;
}
.day-row b {
  color: #1d1d1f;
  font-size: 15px;
  font-weight: 900;
}
.day-row > .icon:last-child {
  width: 20px;
  height: 20px;
  padding: 0;
  color: #b0b3b8;
  background: transparent;
}
.home-extra p {
  margin: 0;
  color: #6e6e73;
  font-weight: 800;
}
.goal-row strong { color: #1d1d1f; font-size: 18px; font-weight: 900; }
.goal-row span { color: #6e6e73; font-weight: 900; }
.bars {
  height: 178px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
}
.bar-group {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.bar-group div {
  height: 128px;
  display: flex;
  align-items: flex-end;
  gap: 5px;
}
.bar-group span {
  width: 10px;
  border-radius: 999px;
  display: block;
}
.bar-sales { background: linear-gradient(to top, var(--accent-blue), #7fb7ff); }
.bar-profit { background: linear-gradient(to top, #13a065, #7ee0af); }
.bar-group small { color: #6e6e73; font-size: 11px; font-weight: 800; }
.home-right {
  padding-top: 66px;
}
.notifications-card { border-radius: 30px; }
.notify-row {
  min-height: 64px;
  padding: 12px 14px;
  margin-top: 8px;
  border-radius: 16px;
  border: 1px solid rgba(29, 29, 31, 0.09);
  background: #f5f5f7;
}
.notify-row > span {
  background: #ffffff;
}
.notify-row i {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border-radius: 999px;
  background: #13a065;
}
.birthdays-card { border-radius: 28px; }
.birthday-row {
  min-height: 42px;
  border-bottom: 1px solid rgba(29,29,31,0.08);
}
.birthday-row:last-child { border-bottom: none; }
.birthday-row > span {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}
.muted-line {
  margin: 8px 0 0;
  color: #6e6e73;
  font-size: 13px;
  font-weight: 800;
}

.sidebar,
.sidebar button,
.home-main,
.home-main button {
  font-family: var(--apple-font);
  font-weight: 300;
  letter-spacing: 0;
}

.side-brand .sb-name,
.side-primary,
.home-header h1,
.hero-summary strong,
.hero-goal strong,
.section-title h2,
.metric-tile strong,
.day-row strong,
.notify-row strong,
.birthday-row strong,
.day-row b,
.goal-row strong {
  font-weight: 500;
}

.nav-item {
  font-weight: 400;
}

.side-brand small,
.home-top-actions,
.home-header p,
.home-badge,
.hero-summary > span,
.hero-goal span,
.hero-chips span,
.goal-head b,
.hero-goal small,
.section-title.with-pill span:last-child,
.metric-tile small,
.metric-tile em,
.day-row small,
.notify-row small,
.home-extra p,
.goal-row span,
.bar-group small,
.birthday-row > span,
.muted-line {
  font-weight: 300;
}

.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 12px 26px var(--shadow);
  padding: 18px 22px;
  min-width: 180px;
}
.stat .k { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat .v { font-size: 24px; font-weight: 500; margin-top: 4px; letter-spacing: -0.5px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 12px 26px var(--shadow);
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left; padding: 13px 18px;
  color: var(--muted); font-size: 12px; font-weight: 500;
  border-bottom: 1px solid var(--line);
  text-transform: uppercase; letter-spacing: .4px;
  white-space: nowrap;
}
tbody td { padding: 13px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 600; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(var(--blue-rgb), 0.03); }
.t-right { text-align: right !important; }
.t-center { text-align: center; }

.chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.chip-gray { background: rgba(110, 110, 115, 0.12); color: var(--muted); }
.chip-green { background: rgba(19, 160, 101, 0.12); color: var(--green); }
.chip-amber { background: rgba(255, 149, 0, 0.14); color: #c93400; }
.chip-red { background: rgba(255, 59, 48, 0.10); color: #d70015; }
.chip-blue { background: rgba(var(--blue-rgb), 0.10); color: var(--blue); }

.empty { padding: 40px; text-align: center; color: var(--muted); font-weight: 500; }
.placeholder {
  padding: 60px 30px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 20px;
  line-height: 1.7;
}
.placeholder b { color: var(--ink); font-weight: 500; }

/* Tela de erro de permissão */
.error-page {
  min-height: var(--app-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.error-card {
  max-width: 420px;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 16px 34px var(--shadow);
  padding: 32px;
  text-align: center;
}

/* ---------- Responsivo ---------- */
@media (max-width: 1450px) {
  .brand-headline { font-size: 34px; }
  .login-divider { margin: 0 46px; }
  .phone-mockup { left: 65px; }
  .home-page { padding-left: 24px; }
  .inicio-hero { grid-template-columns: 1fr 300px; }
}

@media (max-width: 1180px) {
  .preview-scene { display: none; }
  .login-content { align-items: center; }
  .home-grid { grid-template-columns: 1fr; }
  .home-right { padding-top: 0; }
  .home-header { margin-top: 18px; }
}

@media (max-width: 940px) {
  html,
  body,
  #app {
    min-height: calc(var(--app-height) + var(--browser-ui-bleed));
    background:
      linear-gradient(135deg, #ffffff 0%, #f5f5f7 50%, #eff8f4 100%);
  }
  body {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.mobile-drawer-open {
    overflow: hidden;
  }
  /* narrow no Flutter: só o painel, alinhado ao topo, largura máx. 560 */
  .login-page {
    align-items: stretch;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .login-content {
    flex-direction: column;
    max-width: 560px;
    min-height: var(--app-height);
    padding: 28px;
    align-items: stretch;
    zoom: 1;
  }
  .brand-side, .login-divider { display: none; }
  .panel-side { width: 100%; min-height: 100%; align-items: stretch; }
  .login-panel { width: 100%; padding: 24px; border-radius: 30px; }
  .panel-title { font-size: 28px; }
  .panel-head { margin-bottom: 30px; }
  .panel-head img { width: 38px; height: 38px; }
  .big-btn { height: 54px; }
  .btn-google { margin-top: 22px; }
  .hub-page {
    align-items: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: calc(24px + var(--safe-top)) 0 calc(24px + var(--safe-bottom));
  }
  .hub-content {
    min-height: calc(var(--app-height) - var(--safe-top) - var(--safe-bottom) - 48px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 24px;
    zoom: 1;
  }
  .hub-head { flex-direction: column; align-items: center; text-align: center; gap: 10px; }
  .hub-carousel {
    width: 100%;
    max-width: 720px;
    margin: 26px auto 0;
  }
  .hub-carousel::before,
  .hub-carousel::after,
  .hub-scroll-control { display: none; }
  .hub-cards,
  .hub-cards.is-overflowing {
    width: 100%;
    flex-direction: column;
    justify-content: flex-start;
    gap: 14px;
    overflow: visible;
    padding: 0;
    scroll-snap-type: none;
  }
  .hub-card {
    flex: 0 0 auto;
    width: 100%;
    height: 104px;
    scroll-snap-align: none;
  }
  .hub-signout-row { margin-top: 18px; }
  .shell {
    overflow: visible;
    height: auto;
    min-height: calc(var(--app-height) + var(--browser-ui-bleed) + 96px);
    background:
      linear-gradient(135deg, #ffffff 0%, #f5f5f7 50%, #eff8f4 100%);
  }
  .system-scale {
    flex-direction: column;
    width: 100%;
    height: auto;
    min-height: inherit;
    transform: none;
  }
  .sidebar {
    display: none;
  }
  .side-brand {
    width: auto;
    min-width: 62px;
    min-height: 52px;
    flex-shrink: 0;
    padding: 7px;
  }
  .side-brand .sb-name { display: none; }
  .side-logo { width: 38px; height: 38px; }
  .side-primary {
    width: auto;
    min-width: 132px;
    margin-top: 0;
    flex-shrink: 0;
  }
  .side-sep { display: none; }
  .side-nav {
    flex-direction: row;
    gap: 4px;
    flex: 1;
    min-width: max-content;
  }
  .side-foot {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    display: flex;
    gap: 4px;
    flex-shrink: 0;
  }
  .sidebar > .side-foot .home-ui-mode-sidebar {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    margin: 0;
    padding: 0 6px;
  }
  .sidebar > .side-foot .home-ui-mode-sidebar-copy,
  .sidebar > .side-foot .home-ui-mode-sidebar-action { display: none; }
  .nav-item {
    width: auto;
    min-width: 42px;
    flex-shrink: 0;
  }
  .nav-label { display: none; }
  .nav-dot { display: none; }
  .mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: block;
    pointer-events: none;
  }
  .mobile-drawer.open {
    pointer-events: auto;
  }
  /* O scrim (fundo escurecido) faz o fade; o painel fica opaco e desliza,
     para que a saída para a esquerda seja claramente visível. */
  .mobile-drawer-scrim {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    transition: opacity 220ms ease;
  }
  .mobile-drawer.open .mobile-drawer-scrim {
    opacity: 1;
  }
  .mobile-drawer-panel {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    bottom: max(12px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    width: min(var(--sb-w), calc(100vw - 40px));
    --sb-item-h: 44px;
    --sb-primary-h: 46px;
    display: flex;
    flex-direction: column;
    padding: 16px var(--sb-padx) 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: none;
    background: var(--sb-surface);
    border: none;
    border-radius: var(--sb-radius);
    box-shadow: 22px 0 50px rgba(0, 0, 0, 0.22);
    color: var(--sb-ink);
    font-family: var(--apple-font);
    transform: translateX(calc(-100% - 24px));
    /* SAÍDA (fechar): mais lenta, para a barra deslizar para a esquerda com
       calma. A transição de página começa junto (por baixo). */
    transition: transform 360ms cubic-bezier(.2, .8, .2, 1), background-color 220ms ease, color 220ms ease;
  }
  .mobile-drawer.open .mobile-drawer-panel {
    transform: translateX(0);
    /* ENTRADA (abrir): continua rápida/snappy. */
    transition: transform 240ms cubic-bezier(.2, .8, .2, 1), background-color 220ms ease, color 220ms ease;
  }
  .mobile-drawer-panel::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
  .mobile-drawer-panel .side-brand {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 7px 8px;
    flex-shrink: 0;
  }
  .mobile-drawer-panel .side-brand .sb-name {
    display: block;
  }
  .mobile-drawer-panel .side-logo {
    width: var(--sb-logo);
    height: var(--sb-logo);
  }
  .mobile-drawer-panel .side-primary {
    width: calc(100% + var(--sb-ext));
    min-width: 0;
    height: var(--sb-primary-h);
    margin-top: 10px;
    margin-right: calc(-1 * var(--sb-ext));
    padding: 0 calc(12px + var(--sb-ext)) 0 12px;
    border-radius: 999px 0 0 999px;
    flex-shrink: 0;
  }
  .mobile-drawer-panel .side-primary span:not(.side-primary-ic) {
    display: inline;
  }
  .mobile-drawer-panel .side-primary-arrow {
    display: inline-flex;
  }
  .mobile-drawer-panel .side-sep {
    display: block;
    margin: 12px 2px 6px;
    flex-shrink: 0;
  }
  .mobile-drawer-panel .side-nav {
    flex: 0 0 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }
  .mobile-drawer-panel .side-foot {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(29, 29, 31, 0.10);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    flex-shrink: 0;
  }
  .mobile-drawer-panel .nav-item {
    width: 100%;
    min-width: 0;
    height: var(--sb-item-h);
    margin-top: 0;
    padding: 0 12px;
  }
  .mobile-drawer-panel .nav-item.active,
  .mobile-drawer-panel .side-foot > .nav-item.active {
    width: calc(100% + var(--sb-ext));
    margin-right: calc(-1 * var(--sb-ext));
    padding-right: calc(12px + var(--sb-ext));
  }
  .mobile-drawer-panel .mobile-drawer-foot-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .mobile-drawer-panel .home-ui-mode-sidebar {
    min-height: 48px;
    margin: 4px 0;
    padding: 5px 8px;
  }
  .mobile-drawer-panel .home-ui-mode-sidebar-copy { display: flex; }
  .mobile-drawer-panel .home-ui-mode-sidebar-action { display: inline-flex; }
  .mobile-drawer-panel .mobile-drawer-foot-actions .nav-item {
    flex: 1;
    width: auto;
  }
  .mobile-drawer-panel .mobile-drawer-theme {
    width: var(--sb-fab);
    height: var(--sb-fab);
    flex: 0 0 var(--sb-fab);
    margin: 0;
    border: none;
    border-radius: 999px;
    background: var(--sb-primary-bg);
    color: var(--sb-primary-ink);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  }
  .mobile-drawer-panel .mobile-drawer-theme:hover {
    background: var(--sb-primary-bg);
    filter: brightness(1.12);
  }
  .mobile-drawer-panel .mobile-drawer-theme:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
  }
  .mobile-drawer-panel .nav-label {
    display: block;
  }
  .mobile-drawer-panel .nav-dot {
    display: none;
    margin-left: auto;
  }
  .mobile-drawer-panel .nav-item[data-badge]:not([data-badge=""]) .nav-dot {
    display: block;
  }
  .main {
    overflow: visible;
    min-height: calc(var(--app-height) + var(--browser-ui-bleed) + 96px);
    padding: 18px 14px calc(18px + var(--browser-ui-bleed));
    background:
      linear-gradient(135deg, #ffffff 0%, #f5f5f7 50%, #eff8f4 100%);
    scroll-padding-bottom: calc(24px + var(--browser-ui-bleed));
  }
  .main.home-main {
    padding: 0 0 calc(var(--browser-ui-bleed) + 96px);
    background: transparent;
  }
  .home-page {
    min-height: calc(var(--app-height) + var(--browser-ui-bleed));
    padding: 14px 14px calc(22px + var(--safe-bottom) + var(--browser-ui-bleed));
  }
  .home-top-actions { display: none; }
  .home-header { align-items: flex-start; margin-top: 18px; }
  .home-header h1 { font-size: 34px; }
  .home-badge { display: none; }
  .inicio-hero {
    grid-template-columns: 1fr;
    padding: 20px;
    border-radius: 26px;
  }
  .hero-summary strong { font-size: 38px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* isMobile no Flutter: o login fica mobile quando a largura de LAYOUT é < 600.
   Em janelas com shortestSide >= 600 o Flutter aplica Transform.scale(1.25),
   então o layout vira mobile até 750px reais (600 × 1.25) — com zoom 1.25. */
@media (max-width: 600px), (max-width: 750px) and (min-height: 600px) {
  /* painel colado no topo, sem card, altura natural
     (gradiente e orbes aparecem abaixo do conteúdo) */
  .login-content { max-width: none; padding: 0; }
  .login-panel {
    min-height: var(--app-height);
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: calc(42px + var(--safe-top)) 22px calc(42px + var(--safe-bottom));
  }
  .login-panel::before { display: none; }
}

/* espelha Transform.scale(1.25) do Flutter (isPhone = shortestSide < 600) */
@media (min-width: 600px) and (max-width: 750px) and (min-height: 600px) {
  .login-page { zoom: 1.25; }
}

@media (max-width: 600px) {
  .shell {
    height: auto;
    min-height: calc(var(--app-height) + var(--browser-ui-bleed) + 96px);
  }
  .side-primary { min-width: 54px; width: 54px; padding: 0 12px; }
  .side-primary span:not(.side-primary-ic),
  .side-primary-arrow { display: none; }
  .mobile-drawer-panel .side-primary {
    width: calc(100% + var(--sb-ext));
    min-width: 0;
    padding: 0 calc(12px + var(--sb-ext)) 0 12px;
  }
  .mobile-drawer-panel .side-primary span:not(.side-primary-ic) {
    display: inline;
  }
  .mobile-drawer-panel .side-primary-arrow {
    display: inline-flex;
  }
  .home-page { min-height: calc(var(--app-height) + var(--browser-ui-bleed)); }
  .home-header { flex-direction: column; gap: 10px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-tile { min-height: 118px; }
  .hero-chips span { width: 100%; }
  .day-row b { display: none; }
  .inicio-card { padding: 16px; border-radius: 24px; }
  .card { overflow-x: auto; }
}

/* ---------- Início 1:1 com lib/pages/dashboard_page.dart ---------- */
.main.home-main {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px 18px 0;
  background: #f5f5f7;
}

.home-page {
  flex: 1 0 auto;
  min-height: calc(var(--app-height) - 16px);
  margin-top: 52px;
  padding: 20px 20px 0;
  border-radius: 34px 34px 0 0;
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f7 50%, #eff8f4 100%);
  overflow: visible;
}

/* Cartão branco no topo, para a faixa de ações fechar a simetria com a barra
   lateral e com o card da página: mesmo topo da barra (14px) e mesma borda
   direita do card de conteúdo (os 18px de padding do .main). */
.home-top-actions {
  top: 14px;
  left: 18px;
  right: 18px;
  justify-content: flex-end;
  z-index: 3;
  font-size: 13px;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 18px;
  /* Mesmo material do card da página: o gradiente do .home-page, sem borda e
     sem sombra — é o que faz ele ficar de leve sobre o fundo. */
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f7 50%, #eff8f4 100%);
  border: none;
  box-shadow: none;
}

/* Configurações preserva os controles de tema e usuário, mas sem o card
   horizontal usado nas demais páginas. */
.main.stats-main:has(> .config-page) > .home-top-actions,
html[data-theme="dark"] .main.stats-main:has(> .config-page) > .home-top-actions {
  background: transparent;
}

/* Crediário também mantém tema e usuário no topo sem a faixa de fundo. */
.crediario-overlay .home-top-actions.crediario-top-actions {
  background: transparent;
}

.home-header {
  margin: 0 0 18px;
  align-items: flex-end;
}

.home-title-block {
  min-width: 0;
}

.home-mobile-title-row {
  display: block;
}

.home-title-copy {
  min-width: 0;
}

.home-mobile-menu {
  display: none;
}

.home-header h1 {
  font-size: 42px;
  line-height: 0.95;
  font-weight: 500;
}

.home-header p {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 300;
}

.home-badge {
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 300;
}

.home-grid {
  grid-template-columns: minmax(620px, 7fr) minmax(360px, 6fr);
  gap: 16px;
}

.home-left,
.home-right {
  gap: 16px;
}

.home-right {
  padding-top: 0;
}

.inicio-card,
.inicio-hero {
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.078);
}

.inicio-hero {
  min-height: 0;
  padding: 28px;
  border-radius: 34px;
  grid-template-columns: 7fr 5fr;
  gap: 20px;
}

.hero-summary > span,
.hero-goal span {
  font-size: 13px;
  font-weight: 300;
}

.hero-summary strong {
  margin-top: 8px;
  font-size: 54px;
  line-height: 0.94;
  font-weight: 500;
}

.hero-chips {
  gap: 8px;
  margin-top: 14px;
}

.hero-chips span {
  min-height: 31px;
  height: auto;
  padding: 8px 11px;
  gap: 7px;
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 300;
}

.hero-chips .icon {
  width: 15px;
  height: 15px;
  min-height: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--blue);
}

.hero-chips b {
  font-weight: 300;
}

.hero-goal {
  padding: 16px;
  border-radius: 24px;
}

.goal-head b {
  padding: 6px 10px;
  background: rgba(19, 160, 101, 0.18);
  color: #8dffc6;
  font-size: 12px;
  font-weight: 500;
}

.goal-track {
  height: 10px;
  margin: 14px 0 12px;
  background: rgba(255, 255, 255, 0.12);
}

.goal-track.light {
  height: 12px;
  margin: 10px 0;
  background: #f5f5f7;
}

.hero-goal strong {
  font-size: 18px;
  font-weight: 500;
}

.hero-goal small {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 300;
}

.inicio-card {
  padding: 20px;
  border-radius: 30px;
  background: #ffffff;
}

.section-title {
  margin-bottom: 14px;
}

.section-title > .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: #f5f5f7;
  color: rgba(29, 29, 31, 0.84);
}

.notifications-card .section-title > .icon {
  padding: 0;
}

.notifications-card .section-title > .icon svg {
  width: 17px;
  height: 17px;
}

.section-title h2 {
  font-size: 22px;
  line-height: 1;
  font-weight: 500;
}

.section-title.with-pill span:last-child {
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 300;
}

.metric-grid {
  gap: 10px;
}

.metric-tile {
  min-height: 0;
  aspect-ratio: 1.9;
  padding: 12px;
  border-radius: 16px;
}

.metric-head {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.metric-tile > span {
  display: none;
}

.metric-head span {
  display: inline-flex;
  color: var(--blue);
}

.metric-head .icon {
  width: 16px;
  height: 16px;
}

.metric-tile small,
.metric-tile em {
  font-size: 12px;
  font-weight: 300;
}

.metric-tile small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-tile strong {
  margin-top: 8px;
  font-size: 26px;
  line-height: 1;
  font-weight: 500;
}

.metric-tile em {
  margin-top: 2px;
}

.day-row {
  min-height: 0;
  padding: 10px 0;
  border-bottom-color: rgba(29, 29, 31, 0.10);
}

.day-row > span:first-child,
.day-row > .icon {
  width: 30px;
  height: 30px;
  padding: 8px;
  border-radius: 999px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f7;
  color: var(--blue);
}

.day-row > span:first-child .icon {
  width: 14px;
  height: 14px;
  min-height: 0;
  padding: 0;
  background: transparent;
}

.day-row strong {
  font-size: 17px;
  font-weight: 500;
}

.day-row small {
  font-size: 12.5px;
  font-weight: 300;
}

.day-row b {
  font-size: 16px;
  font-weight: 500;
}

.home-extra p {
  font-weight: 300;
}

.goal-row strong {
  font-size: 16px;
  font-weight: 500;
}

.goal-row span {
  font-weight: 300;
}

.bars {
  height: 180px;
  gap: 0;
  padding-top: 0;
}

.bar-group {
  gap: 10px;
  padding: 0 4px;
}

.bar-group div {
  height: 128px;
  gap: 4px;
}

.bar-group span {
  width: 12px;
  border-radius: 6px;
}

.bar-sales { background: linear-gradient(to top, #7ae2ad, #13a065); }
.bar-profit { background: linear-gradient(to top, #7fb7ff, var(--accent-blue)); }
.bar-group small { font-size: 11.5px; font-weight: 300; }

.notifications-card {
  border-radius: 30px;
}

.notify-row {
  min-height: 0;
  padding: 12px 12px 11px;
  margin-top: 8px;
  border-radius: 18px;
}

.notify-row > span {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(29, 29, 31, 0.10);
}

.notify-row > span .icon {
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  background: transparent;
}

.notify-row strong {
  font-size: 17px;
  font-weight: 500;
}

.notify-row small {
  font-size: 12.5px;
  font-weight: 300;
}

.birthdays-card {
  border-radius: 30px;
}

.birthday-row {
  min-height: 0;
  padding: 9px 0;
  border-bottom-color: rgba(29, 29, 31, 0.10);
}

.birthday-row strong {
  flex: 1;
  font-size: 14px;
  font-weight: 300;
}

.birthday-row > span {
  display: none;
}

.birthday-row > .icon {
  width: 17px;
  height: 17px;
  display: inline-flex;
  padding: 0;
  color: rgba(var(--blue-rgb), 0.78);
  background: transparent;
}

.birthday-whatsapp-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(37, 211, 102, 0.25);
  border-radius: 11px;
  background: rgba(37, 211, 102, 0.10);
  color: #149447;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.birthday-whatsapp-btn .icon,
.birthday-whatsapp-btn svg {
  width: 18px;
  height: 18px;
}

.birthday-whatsapp-btn:hover:not(:disabled) {
  border-color: #25d366;
  background: #25d366;
  color: #fff;
  transform: translateY(-1px);
}

.birthday-whatsapp-btn:disabled {
  border-color: transparent;
  background: var(--card-soft);
  color: var(--muted);
  cursor: not-allowed;
  opacity: .45;
}

.birthday-whatsapp-btn.is-sending .icon {
  animation: birthdayWhatsappPulse .8s ease-in-out infinite alternate;
}

@keyframes birthdayWhatsappPulse {
  to { opacity: .35; transform: scale(.86); }
}

.stats-modal-card.birthday-message-dialog {
  width: min(540px, calc(100vw - 36px));
  padding: 0;
  border: 1px solid rgba(29, 29, 31, 0.10);
  border-radius: 20px;
  background: #fff;
  color: #1d1d1f;
  overflow: hidden;
}

.birthday-message-dialog .stats-modal-head {
  min-height: 58px;
  margin: 0;
  padding: 15px 18px;
  border-bottom: 1px solid rgba(29, 29, 31, 0.08);
}

.birthday-message-dialog .stats-modal-head h3 {
  font-size: 17px;
  font-weight: 500;
}

.birthday-message-dialog .stats-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.birthday-message-recipient {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
  padding: 12px 14px;
  border-radius: 13px;
  background: #f5f5f7;
}

.birthday-message-recipient span {
  grid-column: 1 / -1;
  color: #6e6e73;
  font-size: 11px;
}

.birthday-message-recipient strong {
  min-width: 0;
  overflow: hidden;
  color: #1d1d1f;
  font-size: 13.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.birthday-message-recipient small {
  color: #6e6e73;
  font-size: 12px;
}

.birthday-message-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #f5f5f7;
}

.birthday-message-field:focus-within {
  border-color: rgba(37, 211, 102, 0.56);
}

.birthday-message-field > span {
  color: #8a8a8f;
  font-size: 10.5px;
}

.birthday-message-field input,
.birthday-message-field select,
.birthday-message-field textarea {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #1d1d1f;
  font: 400 13px/1.45 var(--apple-font);
}

.birthday-message-field textarea {
  min-height: 48px;
  max-height: 260px;
  resize: none;
  overflow-y: hidden;
}

.birthday-message-dialog .stats-modal-foot {
  margin: 0;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(29, 29, 31, 0.08);
}

.birthday-message-dialog .stats-modal-secondary,
.birthday-message-dialog .stats-modal-primary {
  width: auto;
  min-width: 118px;
}

.birthday-message-dialog .birthday-message-send {
  width: auto;
  min-width: 184px;
  border: 1px solid #16a856;
  background: #16b85f;
  color: #fff;
}

.birthday-message-dialog .birthday-message-send:hover:not(:disabled) {
  background: #109c4c;
}

.birthday-message-dialog .birthday-message-send:disabled {
  cursor: wait;
  opacity: .58;
}

.muted-line {
  margin: 10px 0 0;
  font-weight: 300;
}

@media (max-width: 1450px) {
  .main.home-main { padding: 16px 18px 0; }
  .home-page { margin-top: 52px; padding: 20px 20px 5px; }
  .inicio-hero { grid-template-columns: 7fr 5fr; }
}

@media (max-width: 1220px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
  .home-right {
    padding-top: 0;
  }
}

@media (max-width: 940px) {
  .main.home-main {
    padding: 0 0 calc(var(--browser-ui-bleed) + 96px);
    background: transparent;
  }
  .home-page {
    min-height: calc(var(--app-height) + var(--browser-ui-bleed));
    margin-top: 0;
    padding: 12px 14px calc(18px + var(--safe-bottom) + var(--browser-ui-bleed));
    border-radius: 0;
  }
  .home-top-actions {
    display: none;
  }
  .home-header {
    align-items: stretch;
    margin: 0 0 12px;
  }
  .home-header h1 {
    font-size: 29px;
    line-height: 1;
  }
  .home-header p {
    margin-top: 9px;
    font-size: 13px;
    line-height: 1.22;
  }
  .home-title-block {
    padding: 15px 16px 14px 12px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    background: #ffffff;
  }
  /* No Crediário o título fica solto sobre o fundo, sem a placa branca que as
     outras páginas usam no celular. Os três nomes de classe também vencem a
     versão escura lá do bloco html[data-theme="dark"], que só tem dois. */
  .crediario-overlay .cred-overlay-header .home-title-block {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
  }
  .home-mobile-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .home-mobile-menu {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 13px;
    border: 1px solid rgba(29, 29, 31, 0.10);
    background: #f5f5f7;
    color: rgba(29, 29, 31, 0.90);
  }
  .home-mobile-menu .icon {
    width: 20px;
    height: 20px;
  }
  .home-badge {
    display: none;
  }
  .inicio-hero {
    grid-template-columns: 1fr;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    padding: 18px;
    border-radius: 26px;
    box-sizing: border-box;
    overflow: hidden;
  }
  .hero-summary,
  .hero-summary-main-row,
  .hero-summary-texts {
    min-width: 0;
    max-width: 100%;
  }
  .hero-summary-main-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(128px, 46%);
    gap: 12px !important;
  }
  .home-hero-mobile-chart-container {
    width: auto !important;
    min-width: 0;
    max-width: 100%;
  }
  .hero-summary-texts strong {
    max-width: 100%;
    white-space: nowrap;
  }
  .hero-summary strong {
    font-size: 36px;
  }
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .metric-tile {
    aspect-ratio: 1.58;
    padding: 9px;
    border-radius: 12px;
  }
  .metric-head {
    gap: 6px;
  }
  .metric-head .icon {
    width: 14px;
    height: 14px;
  }
  .metric-tile small {
    font-size: 11.2px;
  }
  .metric-tile strong {
    font-size: 21px;
  }
  .metric-tile em {
    font-size: 10.6px;
  }
}

@media (max-width: 600px) {
  .home-page {
    min-height: calc(var(--app-height) + var(--browser-ui-bleed));
  }
  .home-header {
    flex-direction: column;
    gap: 0;
  }
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-chips {
    flex-wrap: nowrap;
    gap: 8px;
  }
  .hero-chips span {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    justify-content: center;
    height: 31px;
    padding: 0 10px;
    gap: 6px;
    font-size: 11.7px;
    font-weight: 300;
  }
  .hero-chips span b {
    flex: 0 1 auto;
    min-width: 0;
    font-weight: 300;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .hero-chips .icon {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
  }
  .day-row b {
    display: block;
  }
  .inicio-card {
    padding: 14px;
    border-radius: 22px;
  }
}

/* ---------- Estatísticas 1:1 com a lógica original em Dart ---------- */
@keyframes statsBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

.main.stats-main {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px 18px 0;
  background: #f5f5f7;
}

.stats-page {
  flex: 1 0 auto;
  min-height: calc(var(--app-height) - 16px);
  margin-top: 52px;
  padding: 20px 20px 0;
  border-radius: 34px 34px 0 0;
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f7 50%, #eff8f4 100%);
  color: #1d1d1f;
  overflow: visible;
}

.stats-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.stats-mobile-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stats-title-block h1 {
  margin: 0;
  color: #1d1d1f;
  font-size: 42px;
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: 0;
}

.stats-title-block p {
  margin: 8px 0 0;
  color: #6e6e73;
  font-size: 15px;
  font-weight: 700;
}

.stats-badge {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: rgba(255, 255, 255, 0.86);
  color: #1d1d1f;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.stats-hero,
.stats-panel,
.stats-tab {
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.078);
}

.stats-hero {
  padding: 28px;
  border-radius: 34px;
  background: #1d1d1f;
  color: #ffffff;
}

.stats-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.stats-pills > span {
  max-width: 260px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.86);
  font-size: 12.5px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform 160ms ease, background 180ms ease, border-color 180ms ease;
}

.stats-pills .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--blue);
  overflow: visible;
}

.stats-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px;
}

.stats-eyebrow {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
  font-weight: 800;
}

.stats-hero strong {
  display: block;
  margin-top: 4px;
  color: #ffffff;
  font-size: 40px;
  line-height: 1.04;
  font-weight: 900;
}

.stats-hero p {
  max-width: 760px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 14.5px;
  line-height: 1.22;
  font-weight: 700;
}

.stats-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.stats-action-card {
  width: 184px;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.stats-action-card:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.15);
}

.stats-action-card:active {
  transform: translateY(0) scale(0.985);
}

.stats-action-card > .icon:not(.stats-action-chevron) {
  width: 32px;
  height: 32px;
  padding: 7px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.10);
  color: var(--blue);
  flex-shrink: 0;
}

.stats-action-card > div {
  min-width: 0;
  flex: 1;
}

.stats-action-card span {
  display: block;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11.5px;
  font-weight: 800;
}

.stats-action-card b {
  display: block;
  margin-top: 2px;
  max-width: 118px;
  color: rgba(255, 255, 255, 0.95);
  font-size: 13.2px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-action-chevron {
  width: 20px;
  height: 20px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  color: rgba(255, 255, 255, 0.50);
  flex-shrink: 0;
}

.stats-tabs {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.stats-tabs::-webkit-scrollbar {
  display: none;
}

.stats-tab {
  height: 56px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border-radius: 20px;
  background: #f5f5f7;
  color: #6e6e73;
  font: inherit;
  cursor: pointer;
  transition:
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    background 180ms cubic-bezier(0.22, 1, 0.36, 1),
    color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.stats-tab.active {
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}

.stats-tab:hover {
  transform: translateY(-1px);
}

.stats-tab:active {
  transform: scale(0.985);
}

.stats-tab > span {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #ffffff;
  color: #6e6e73;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.stats-tab.active > span {
  background: #f5f5f7;
  color: var(--blue);
}

.stats-tab .icon {
  width: 17px;
  height: 17px;
}

.stats-tab b {
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.stats-body {
  margin-top: 14px;
  padding-bottom: 36px;
}

.stats-body > * {
  animation: statsContentIn 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.stats-grid {
  display: grid;
  gap: 12px;
  align-items: start;
}

.stats-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats-stack {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stats-panel {
  min-width: 0;
  padding: 18px;
  border-radius: 26px;
  background: #ffffff;
}

.stats-panel-title {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
}

.stats-panel-title > .icon {
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #f5f5f7;
  color: var(--blue);
}

.stats-panel-title h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: #1d1d1f;
  font-size: 17px;
  line-height: 1.05;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stats-metric {
  min-height: 96px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #f5f5f7;
}

.stats-metric span {
  display: block;
  color: #6e6e73;
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-metric strong {
  display: block;
  margin-top: 8px;
  color: #1d1d1f;
  font-size: 24px;
  line-height: 1.02;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-metric.danger strong {
  color: #ff3b30;
}

.stats-progress-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stats-progress-row {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #f5f5f7;
}

.stats-progress-row div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-progress-row strong {
  flex: 1;
  min-width: 0;
  color: #1d1d1f;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-progress-row b {
  color: #1d1d1f;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.stats-progress-row > span {
  height: 9px;
  display: block;
  margin-top: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(29, 29, 31, 0.10);
}

.stats-progress-row i {
  width: var(--w);
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--c), var(--accent-blue));
}

.stats-donut-wrap {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.stats-donut-box {
  width: min(240px, 100%);
  justify-self: center;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #f5f5f7;
}

.stats-donut {
  aspect-ratio: 1;
  width: 100%;
  min-height: 0;
  border-radius: 999px;
  -webkit-mask: radial-gradient(circle, transparent 0 58%, #000 59%);
  mask: radial-gradient(circle, transparent 0 58%, #000 59%);
}

.stats-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-legend-row {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 14px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #f5f5f7;
}

.stats-legend-row i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.stats-legend-row span {
  flex: 1;
  min-width: 0;
  color: #1d1d1f;
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-legend-row b {
  color: #1d1d1f;
  font-size: 12.5px;
  font-weight: 900;
  white-space: nowrap;
}

.stats-chart-legend {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  color: #6e6e73;
  font-size: 12px;
  font-weight: 800;
}

.stats-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stats-chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.stats-chart-legend .green { background: #13a065; }
.stats-chart-legend .blue { background: var(--accent-blue); }

.stats-bars-scroll,
.stats-line-scroll,
.stats-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.stats-bars {
  height: 260px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 0 6px;
}

.stats-bar-day {
  flex: 1;
  min-width: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.stats-bar-day div {
  height: 190px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

.stats-bar-day span {
  width: 10px;
  display: block;
  border-radius: 999px 999px 4px 4px;
}

.stats-bar-day .sales { background: linear-gradient(to top, #7ae2ad, #13a065); }
.stats-bar-day .profit { background: linear-gradient(to top, #7fb7ff, var(--accent-blue)); }

.stats-bar-day small {
  color: #6e6e73;
  font-size: 11px;
  font-weight: 700;
}

.stats-line-chart {
  min-height: 240px;
  color: var(--accent-blue);
  background: #f5f5f7;
  border: 1px solid rgba(29, 29, 31, 0.10);
  border-radius: 18px;
}

.stats-line-chart circle {
  fill: var(--accent-blue);
}

.stats-line-chart text {
  fill: #6e6e73;
  font-size: 11px;
  font-weight: 700;
}

.stats-table {
  width: 100%;
  min-width: 620px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #f5f5f7;
}

.stats-table th,
.stats-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(29, 29, 31, 0.10);
  color: #6e6e73;
  font-size: 12.5px;
  font-weight: 300;
  white-space: nowrap;
  text-align: left;
}

.stats-table th {
  color: #1d1d1f;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.72);
  text-transform: none;
  letter-spacing: 0;
}

.stats-table .icon {
  width: 16px;
  height: 16px;
  vertical-align: text-bottom;
  margin-right: 4px;
}

.stats-table tr:last-child td {
  border-bottom: none;
}

.stats-empty {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #f5f5f7;
  color: #6e6e73;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.stats-empty .icon {
  width: 17px;
  height: 17px;
}

.stats-empty .spinner {
  width: 22px;
  height: 22px;
}

.stats-empty.danger {
  color: #ff3b30;
}

.stats-crm-card {
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #f5f5f7;
}

.stats-crm-card > div:first-child {
  display: flex;
  gap: 8px;
  align-items: center;
}

.stats-crm-card strong {
  flex: 1;
  min-width: 0;
  color: #1d1d1f;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-crm-card span,
.stats-crm-card p {
  color: #6e6e73;
  font-size: 12px;
  font-weight: 700;
}

.stats-crm-card p {
  margin: 6px 0 10px;
  line-height: 1.35;
}

.stats-crm-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stats-crm-actions button {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #ffffff;
  color: #1d1d1f;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.stats-crm-actions .icon {
  width: 15px;
  height: 15px;
  color: var(--blue);
}

.stats-main,
.stats-main button,
.stats-main input,
.stats-main select,
.stats-modal-root,
.stats-modal-root button,
.stats-modal-root input,
.stats-modal-root select {
  font-family: var(--apple-font);
  font-weight: 300;
  letter-spacing: 0;
}

.stats-title-block h1,
.stats-hero strong,
.stats-action-card b,
.stats-tab b,
.stats-panel-title h2,
.stats-metric strong,
.stats-progress-row b,
.stats-legend-row b,
.stats-table th,
.stats-crm-card strong,
.stats-crm-actions button,
.stats-modal-head h3,
.stats-modal-secondary,
.stats-modal-primary {
  font-weight: 500;
}

.stats-title-block p,
.stats-badge,
.stats-pills > span,
.stats-eyebrow,
.stats-hero p,
.stats-action-card span,
.stats-metric span,
.stats-progress-row strong,
.stats-legend-row span,
.stats-chart-legend,
.stats-bar-day small,
.stats-line-chart text,
.stats-table td,
.stats-empty,
.stats-crm-card span,
.stats-crm-card p,
.stats-period-choice,
.stats-filter-field > span:not(.icon),
.stats-option-tile > span:not(.icon),
.stats-modal-field span,
.stats-modal-field input,
.stats-modal-field select,
.stats-modal-clear {
  font-weight: 300;
}

.stats-progress-row div {
  min-width: 0;
}

.stats-progress-row b {
  flex-shrink: 0;
  margin-left: auto;
}

.stats-modal-root {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.stats-modal-root.system-alert-root {
  z-index: 100010;
}

.stats-modal-backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  cursor: pointer;
  animation: statsBackdropIn 160ms ease-out both;
}

.stats-modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: min(680px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  padding: 16px 16px 12px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: #ffffff;
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.18);
  color: #1d1d1f;
  animation: statsDialogIn 210ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.stats-modal-card.stats-period-dialog {
  width: min(356px, 100%);
  padding: 0;
  border-radius: 24px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(30, 30, 30, 0.95);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.30);
  overflow: hidden;
}

.stats-modal-card.stats-filter-dialog {
  width: min(356px, 100%);
  padding: 0;
  border-radius: 24px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(30, 30, 30, 0.95);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.30);
  overflow: hidden;
}

.stats-modal-card.stats-option-dialog {
  width: min(356px, 100%);
  padding: 0;
  border-radius: 24px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(30, 30, 30, 0.95);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.30);
  overflow: hidden;
}

/* Modais de importação (produtos/clientes): o card é sempre escuro, então
   fixamos aqui cores/variáveis claras para ficar legível e idêntico no tema
   claro e no escuro (o conteúdo usa var(--text)/var(--muted)/var(--border)). */
.stats-modal-card.client-import-dialog {
  color: #f4f4f5;
  --text: #f4f4f5;
  --muted: #a4a7ae;
  --border: rgba(255, 255, 255, 0.14);
  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.06);
}

.stats-option-dialog .stats-modal-close {
  display: none;
}

/* Diálogo "Reabrir caixa retroativo": o card é sempre escuro (stats-option-dialog),
   então fixamos texto claro e o rodapé aqui p/ ficar legível e idêntico no tema
   claro e no escuro (mesmo padrão do client-import-dialog). */
.stats-modal-card.cash-retro-dialog {
  color: #f4f4f5;
}
.cash-retro-dialog .stats-modal-body {
  padding: 16px 20px 6px;
  font-size: 13.5px;
  color: rgba(244, 244, 245, 0.88);
}
.cash-retro-dialog .stats-modal-foot {
  margin-top: 0;
  padding: 14px 16px 16px;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.cash-retro-dialog .stats-modal-primary,
.cash-retro-dialog .stats-modal-danger {
  flex: 1 1 0;
  width: auto;
  height: 42px;
  border-radius: 14px;
}
.cash-retro-dialog .stats-modal-primary,
html[data-theme="dark"] .cash-retro-dialog .stats-modal-primary {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}
.cash-retro-dialog .stats-modal-danger,
html[data-theme="dark"] .cash-retro-dialog .stats-modal-danger {
  border: 1px solid rgba(255, 77, 77, 0.30);
  background: rgba(58, 30, 35, 0.90);
  color: rgba(255, 108, 108, 0.95);
}

.stats-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.stats-period-dialog .stats-modal-head {
  margin: 0;
  padding: 14px 14px 12px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stats-filter-dialog .stats-modal-head {
  margin: 0;
  padding: 14px 14px 12px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stats-option-dialog .stats-modal-head {
  margin: 0;
  padding: 14px 14px 12px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stats-modal-head h3 {
  flex: 1;
  margin: 0;
  color: #1d1d1f;
  font-size: 18px;
  line-height: 1;
  font-weight: 300;
}

.stats-filter-dialog .stats-modal-head h3 {
  color: rgba(255, 255, 255, 0.92);
  font-size: 18px;
}

.stats-option-dialog .stats-modal-head h3 {
  color: rgba(255, 255, 255, 0.92);
  font-size: 18px;
}

.stats-period-dialog .stats-modal-head h3 {
  color: rgba(255, 255, 255, 0.92);
}

.stats-period-dialog .stats-modal-close {
  display: none;
}

.stats-filter-dialog .stats-modal-close {
  display: none;
}

.stats-modal-close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #6e6e73;
  cursor: pointer;
}

.stats-modal-close .icon {
  width: 18px;
  height: 18px;
}

.stats-modal-body {
  overflow: auto;
}

.stats-period-dialog .stats-modal-body {
  padding: 10px;
}

.stats-filter-dialog .stats-modal-body {
  padding: 10px;
}

.stats-option-dialog .stats-modal-body {
  padding: 10px;
  overflow: auto;
}

.stats-period-choice-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stats-period-choice {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
  font: inherit;
  font-size: 13.5px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 150ms ease, background 170ms ease, border-color 170ms ease, color 170ms ease;
}

.stats-period-choice:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.09);
}

.stats-period-choice:active {
  transform: scale(0.985);
}

.stats-period-choice.selected {
  background: rgba(105, 255, 180, 0.12);
  border-color: rgba(105, 255, 180, 0.22);
  color: rgba(255, 255, 255, 0.95);
}

.stats-custom-period {
  display: none;
  margin-top: 8px;
}

.stats-custom-period.show {
  display: block;
  animation: statsContentIn 170ms ease-out both;
}

.stats-modal-field,
.stats-filter-field,
.stats-option-tile,
.stats-modal-clear {
  border-radius: 12px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #f5f5f7;
  color: #1d1d1f;
  font: inherit;
}

.stats-modal-field {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 0 10px;
}

.stats-modal-field span {
  color: #6e6e73;
  font-size: 13px;
  font-weight: 300;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

.stats-modal-field input,
.stats-modal-field select,
.stats-modal-field textarea {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  color: #1d1d1f;
  font-size: 14px;
  font-weight: 300;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  outline: none;
}

.stats-modal-field textarea {
  resize: vertical;
  padding: 12px 0;
  line-height: 1.4;
}

.stats-period-dialog .stats-modal-field,
.stats-filter-dialog .stats-modal-field {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.stats-period-dialog .stats-modal-field span,
.stats-filter-dialog .stats-modal-field span {
  color: rgba(255, 255, 255, 0.66);
}

.stats-period-dialog .stats-modal-field input,
.stats-filter-dialog .stats-modal-field input,
.stats-period-dialog .stats-modal-field textarea,
.stats-filter-dialog .stats-modal-field textarea {
  color: rgba(255, 255, 255, 0.92);
  color-scheme: dark;
}

.stats-filter-field {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  padding: 0 12px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.stats-filter-dialog .stats-filter-field,
.stats-option-dialog .stats-option-tile {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
}

.stats-filter-field + .stats-filter-field {
  margin-top: 8px;
}

.stats-filter-dialog .stats-filter-field:hover,
.stats-option-dialog .stats-option-tile:hover {
  background: rgba(255, 255, 255, 0.09);
}

.stats-filter-dialog .stats-filter-field:active,
.stats-option-dialog .stats-option-tile:active {
  background: rgba(255, 255, 255, 0.10);
}

.stats-filter-field > span:not(.icon),
.stats-option-tile > span:not(.icon) {
  flex: 1;
  min-width: 0;
  color: #1d1d1f;
  font-size: 14px;
  font-weight: 300;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-filter-field.empty > span:not(.icon) {
  color: #6e6e73;
}

.stats-filter-field.has-value > span:not(.icon) {
  color: #1d1d1f;
}

.stats-filter-dialog .stats-filter-field.empty > span:not(.icon) {
  color: rgba(255, 255, 255, 0.66);
}

.stats-filter-dialog .stats-filter-field.has-value > span:not(.icon),
.stats-option-dialog .stats-option-tile > span:not(.icon) {
  color: rgba(255, 255, 255, 0.92);
}

.stats-filter-field .icon,
.stats-option-tile .icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #6e6e73;
}

.stats-filter-dialog .stats-filter-field .icon,
.stats-option-dialog .stats-option-tile .icon {
  color: rgba(255, 255, 255, 0.66);
}

.stats-option-list {
  max-height: 320px;
  overflow: auto;
  padding: 0;
}

.stats-option-tile {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
  margin-bottom: 6px;
  padding: 0 12px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.stats-modal-clear {
  height: 40px;
  display: block;
  margin: 12px auto 0;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: #6e6e73;
  font-size: 13px;
  font-weight: 300;
  cursor: pointer;
}

.stats-filter-dialog .stats-modal-clear {
  color: rgba(255, 255, 255, 0.66);
}

.stats-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.stats-filter-dialog .stats-modal-foot {
  margin-top: 0;
  padding: 10px 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stats-period-dialog .stats-modal-foot {
  margin-top: 0;
  padding: 10px 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stats-modal-secondary,
.stats-modal-primary,
.stats-modal-danger {
  width: 124px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 12px;
  font: inherit;
  font-weight: 300;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 150ms ease, background 160ms ease, border-color 160ms ease;
}

.stats-modal-secondary .icon,
.stats-modal-primary .icon,
.stats-modal-danger .icon {
  width: 16px;
  height: 16px;
}


.stats-modal-secondary:active,
.stats-modal-primary:active,
.stats-modal-danger:active {
  transform: scale(0.985);
}

.stats-modal-secondary {
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: transparent;
  color: #1d1d1f;
}

.stats-modal-primary {
  border: 0;
  background: #1d1d1f;
  color: #ffffff;
}

.stats-modal-danger {
  border: 1px solid rgba(255, 77, 77, 0.30);
  background: rgba(58, 30, 35, 0.90);
  color: rgba(255, 108, 108, 0.95);
}

/* ---------- Seletor de loja (vidro — réplica do popup Flutter) ---------- */
.store-select-root .stats-modal-backdrop {
  background: rgba(0, 0, 0, 0.04);
}

.stats-modal-card.store-select-dialog {
  width: min(560px, 100%);
  height: auto;
  max-height: min(80vh, 640px);
  padding: 0;
  border-radius: 24px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(30, 30, 30, 0.95);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.30);
  overflow: hidden;
}

.store-select-dialog .stats-modal-head {
  margin: 0;
  padding: 14px 14px 12px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.store-select-dialog .stats-modal-head h3 {
  color: rgba(255, 255, 255, 0.92);
  font-size: 18px;
  font-weight: 300;
}

.store-select-dialog .stats-modal-close {
  display: none;
}

.store-select-dialog .stats-modal-body {
  flex: 0 1 auto;
  min-height: 0;
  padding: 14px 24px 20px;
  overflow: auto;
}

.store-select-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.store-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  font: inherit;
  font-weight: 400;
  cursor: pointer;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, transform 150ms ease;
}

.store-row:hover { background: rgba(255, 255, 255, 0.09); }
.store-row:active { transform: scale(0.99); }

.store-row.selected {
  background: rgba(var(--blue-rgb), 0.18);
  border-color: rgba(94, 168, 255, 0.45);
  color: rgba(255, 255, 255, 0.95);
}

.store-row .store-row-ic {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.store-row .store-row-ic .icon { width: 22px; height: 22px; }

.store-row.selected .store-row-ic {
  background: transparent;
  color: inherit;
}

.store-row.selected .store-row-ic .icon { width: 15px; height: 15px; }

.store-row > span:not(.store-row-ic) {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.store-select-dialog .stats-modal-foot {
  margin: 0;
  padding: 8px 6px 2px;
  border: 0;
  justify-content: flex-end;
}

.store-select-close {
  width: auto;
  min-width: 0;
  height: auto;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.store-select-close:hover { opacity: 0.7; }

.store-select-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 12px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 300;
}

.store-select-status .icon { width: 18px; height: 18px; color: rgba(255, 255, 255, 0.6); }

/* Removido overrides do tema escuro, pois agora o dialog é escuro nativamente */

.stats-period-dialog .stats-modal-primary,
.stats-period-dialog .stats-modal-danger,
.stats-filter-dialog .stats-modal-primary,
.stats-filter-dialog .stats-modal-danger {
  width: 100%;
  height: 42px;
  border-radius: 14px;
}

.stats-period-dialog .stats-modal-primary,
.stats-filter-dialog .stats-modal-primary {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.stats-period-dialog .stats-modal-primary .icon,
.stats-period-dialog .stats-modal-danger .icon,
.stats-filter-dialog .stats-modal-primary .icon,
.stats-filter-dialog .stats-modal-danger .icon {
  width: 16px;
  height: 16px;
}

@media (max-width: 1220px) {
  .stats-grid.two,
  .stats-hero-grid {
    grid-template-columns: 1fr;
  }
  .stats-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 940px) {
  .main.stats-main {
    padding: 0 0 calc(var(--browser-ui-bleed) + 96px);
    background: transparent;
  }
  .stats-page {
    min-height: calc(var(--app-height) + var(--browser-ui-bleed));
    margin-top: 0;
    padding: 12px 14px calc(18px + var(--safe-bottom) + var(--browser-ui-bleed));
    border-radius: 0;
  }
  .stats-header {
    align-items: stretch;
    margin: 0 8px 12px;
  }
  .stats-title-block {
    width: 100%;
    padding: 15px 16px 14px 12px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    background: #ffffff;
  }
  .stats-mobile-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  /* A caixa do .config-back no celular saiu daqui: o botão agora usa a seta do
     Crediário (.rdx-assistant-back), e este bloco vencia por !important. Só
     existe um .config-back no app e ele sempre carrega aquela classe, então
     não sobrou nada para estas regras vestirem. */
  .stats-title-block h1 {
    font-size: 29px;
    line-height: 1;
  }
  .stats-title-block p {
    margin-top: 9px;
    font-size: 13px;
    line-height: 1.22;
  }
  .stats-badge {
    display: none;
  }
  .stats-hero {
    padding: 16px;
    border-radius: 24px;
  }
  .stats-pills {
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0 -2px 15px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .stats-pills::-webkit-scrollbar {
    display: none;
  }
  .stats-pills > span {
    flex: 0 0 auto;
    max-width: 210px;
    height: 31px;
    padding: 0 10px;
    gap: 6px;
    font-size: 11.7px;
  }
  .stats-pills .icon {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
  }
  .stats-hero-grid {
    gap: 14px;
  }
  .stats-eyebrow {
    font-size: 13px;
  }
  .stats-hero strong {
    font-size: 30px;
    line-height: 1.02;
  }
  .stats-hero p {
    margin-top: 9px;
    font-size: 13px;
    line-height: 1.25;
  }
  .stats-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .stats-action-card {
    width: auto;
    min-height: 62px;
    padding: 10px;
    border-radius: 16px;
  }
  .stats-action-card > .icon:not(.stats-action-chevron) {
    width: 29px;
    height: 29px;
    padding: 6px;
    border-radius: 11px;
  }
  .stats-action-card b {
    max-width: 100%;
    font-size: 12.2px;
  }
  .stats-action-card span {
    font-size: 10.8px;
  }
  .stats-tabs {
    height: 56px;
    margin: 12px -2px 0;
    gap: 8px;
  }
  .stats-tab {
    height: 46px;
    padding: 0 10px;
    border-radius: 17px;
    gap: 7px;
  }
  .stats-tab > span {
    width: 28px;
    height: 28px;
    border-radius: 10px;
  }
  .stats-tab b {
    font-size: 12.2px;
  }
  .stats-tab .icon {
    width: 16px;
    height: 16px;
  }
  .stats-body {
    margin-top: 12px;
    padding-bottom: 22px;
  }
  .stats-grid,
  .stats-stack {
    gap: 10px;
  }
  .stats-panel {
    padding: 14px;
    border-radius: 22px;
  }
  .stats-panel-title {
    gap: 9px;
    margin-bottom: 12px;
  }
  .stats-panel-title h2 {
    font-size: 20px;
  }
  .stats-metric-grid,
  .stats-donut-wrap {
    grid-template-columns: 1fr;
  }
  .stats-donut-box {
    width: min(220px, 100%);
  }
  .stats-metric {
    min-height: 82px;
    padding: 13px;
  }
  .stats-metric strong {
    font-size: 21px;
  }
  .stats-modal-root {
    align-items: center;
    justify-content: center;
    padding: max(18px, var(--safe-top)) 16px max(18px, var(--safe-bottom));
  }
  .stats-modal-card {
    width: min(356px, calc(100vw - 32px));
    max-height: min(620px, calc(var(--app-height) - 56px));
    border-radius: 24px;
  }
  .stats-modal-card.stats-period-dialog,
  .stats-modal-card.stats-filter-dialog,
  .stats-modal-card.stats-option-dialog {
    width: min(356px, calc(100vw - 32px));
    border-radius: 24px;
  }
  .stats-modal-body {
    max-height: calc(var(--app-height) - 190px);
  }
  .stats-modal-field {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    padding: 10px 12px;
  }
  .stats-modal-field span {
    min-width: 0;
  }
  .stats-modal-foot {
    justify-content: stretch;
  }
  .stats-modal-secondary,
  .stats-modal-primary,
  .stats-modal-danger {
    width: 100%;
  }
}

/* ---------- Tema escuro: espelha AppThemeScope + paletas dark do Flutter ---------- */
html[data-theme="dark"] {
  --bg: #07080a;
  --ink: #f5f5f7;
  --muted: #a4a7ae;
  --line: rgba(255, 255, 255, 0.14);
  --blue-rgb: 164, 167, 174;
  --blue: rgb(var(--blue-rgb));
  --blue-ink: #111318;
  --blue-soft: #3a3a3c;
  --accent-blue: #5ea8ff;
  --green: #4fe39a;
  --card: #111318;
  --card-soft: #181b22;
  --field: rgba(255, 255, 255, 0.10);
  --shadow: rgba(0, 0, 0, 0.40);
  --google-bg: #f5f5f7;
  --google-fg: #090a0d;
  color-scheme: dark;
}

.pos-dialog {
  --bg: #07080a;
  --ink: #f5f5f7;
  --muted: #a4a7ae;
  --line: rgba(255, 255, 255, 0.14);
  --blue-rgb: 164, 167, 174;
  --blue: rgb(var(--blue-rgb));
  --blue-soft: #3a3a3c;
  --accent-blue: #5ea8ff;
  --green: #4fe39a;
  --card: #111318;
  --card-soft: #181b22;
  --field: rgba(255, 255, 255, 0.10);
  --shadow: rgba(0, 0, 0, 0.40);
  color-scheme: dark;
}

html[data-theme="dark"],
html[data-theme="dark"] body,
html[data-theme="dark"] #app {
  background: #07080a;
  color: #f5f5f7;
}

html[data-theme="dark"] .page-gradient,
html[data-theme="dark"] .splash,
html[data-theme="dark"] .login-page,
html[data-theme="dark"] .hub-page {
  background: linear-gradient(135deg, #06070a 0%, #0e1117 52%, #071a2e 100%);
}

html[data-theme="dark"] .shell,
html[data-theme="dark"] .main,
html[data-theme="dark"] .main.home-main {
  background: #07080a;
}

html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .mobile-drawer-panel,
html[data-theme="dark"] .config-menu {
  --sb-surface: #242835;
  --sb-hover: rgba(255, 255, 255, 0.07);
  --sb-border: transparent;
  --sb-ink: #f5f5f7;
  --sb-muted: #a4a7ae;
  --sb-accent: var(--blue);
  --sb-accent-rgb: var(--blue-rgb);
  --sb-accent-soft: rgba(var(--blue-rgb), 0.18);
  --sb-on-accent: var(--blue-ink);
  --sb-primary-bg: var(--blue);
  --sb-primary-ink: var(--blue-ink);
  --sb-danger: #ff6c6c;
  --sb-shadow: none;
  --sb-page: #07080a;
}

html[data-theme="dark"] .mobile-drawer-scrim {
  background: rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] .mobile-drawer-panel {
  box-shadow: 28px 0 54px rgba(0, 0, 0, 0.48);
}

html[data-theme="dark"] .mobile-drawer-panel .side-sep,
html[data-theme="dark"] .mobile-drawer-panel .side-foot {
  border-color: rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] .mobile-drawer-theme {
  color: var(--sb-primary-ink);
  background: var(--sb-primary-bg);
  border-color: transparent;
}

html[data-theme="dark"] .mobile-drawer-theme:hover {
  background: var(--sb-primary-bg);
  filter: brightness(1.12);
}

html[data-theme="dark"] .mobile-drawer-panel .side-sep {
  background: rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] .side-glass {
  background: linear-gradient(
    160deg,
    rgba(7, 8, 10, 0.75) 0%,
    rgba(0, 0, 0, 0.90) 100%
  );
}

html[data-theme="dark"] .hub-card,
html[data-theme="dark"] .login-panel,
html[data-theme="dark"] .card,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .data-search-card,
html[data-theme="dark"] .data-table-card {
  background: #15171c;
  border-color: #343740;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .hub-scroll-control {
  color: #f5f5f7;
  background: rgba(21, 23, 28, 0.52);
  border-color: rgba(255, 255, 255, 0.20);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.34), inset 0 0 0 0.5px rgba(255, 255, 255, 0.10);
}
html[data-theme="dark"] .hub-scroll-control:disabled { color: rgba(245, 245, 247, 0.30); }
html[data-theme="dark"] .hub-carousel::before,
html[data-theme="dark"] .hub-carousel::after {
  top: -20px;
  bottom: -20px;
  width: calc(50vw - 50% + 120px);
}
html[data-theme="dark"] .hub-carousel::before {
  left: calc(50% - 50vw);
  background: radial-gradient(
    ellipse 150px 78% at calc(100% - 120px) 50%,
    rgba(7, 8, 10, 0.76) 0%,
    rgba(7, 8, 10, 0.32) 45%,
    rgba(7, 8, 10, 0.08) 72%,
    transparent 100%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 120px 64% at calc(100% - 120px) 50%,
    #000 0%,
    rgba(0, 0, 0, 0.84) 42%,
    rgba(0, 0, 0, 0.45) 65%,
    rgba(0, 0, 0, 0.12) 85%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse 120px 64% at calc(100% - 120px) 50%,
    #000 0%,
    rgba(0, 0, 0, 0.84) 42%,
    rgba(0, 0, 0, 0.45) 65%,
    rgba(0, 0, 0, 0.12) 85%,
    transparent 100%
  );
}
html[data-theme="dark"] .hub-carousel::after {
  right: calc(50% - 50vw);
  background: radial-gradient(
    ellipse 150px 78% at 120px 50%,
    rgba(7, 15, 24, 0.76) 0%,
    rgba(7, 15, 24, 0.32) 45%,
    rgba(7, 15, 24, 0.08) 72%,
    transparent 100%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 120px 64% at 120px 50%,
    #000 0%,
    rgba(0, 0, 0, 0.84) 42%,
    rgba(0, 0, 0, 0.45) 65%,
    rgba(0, 0, 0, 0.12) 85%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse 120px 64% at 120px 50%,
    #000 0%,
    rgba(0, 0, 0, 0.84) 42%,
    rgba(0, 0, 0, 0.45) 65%,
    rgba(0, 0, 0, 0.12) 85%,
    transparent 100%
  );
}

html[data-theme="dark"] .login-panel::before {
  display: none;
}

html[data-theme="dark"] .login-panel .panel-head img {
  filter: brightness(0) invert(1);
}

html[data-theme="dark"] .side-logo,
html[data-theme="dark"] .home-mobile-menu,
html[data-theme="dark"] .section-title > .icon,
html[data-theme="dark"] .metric-tile,
html[data-theme="dark"] .notify-row,
html[data-theme="dark"] .day-row > span:first-child,
html[data-theme="dark"] .birthday-row > span {
  background: #24272e;
  border-color: #343740;
  color: #a4a7ae;
}

html[data-theme="dark"] .side-brand .sb-name,
html[data-theme="dark"] .hub-title,
html[data-theme="dark"] .hc-title,
html[data-theme="dark"] .panel-title,
html[data-theme="dark"] .home-header h1,
html[data-theme="dark"] .section-title h2,
html[data-theme="dark"] .metric-tile strong,
html[data-theme="dark"] .day-row strong,
html[data-theme="dark"] .day-row b,
html[data-theme="dark"] .notify-row strong,
html[data-theme="dark"] .birthday-row strong,
html[data-theme="dark"] .goal-row strong,
html[data-theme="dark"] .data-head h1,
html[data-theme="dark"] .main h2,
html[data-theme="dark"] .stat .v,
html[data-theme="dark"] tbody td {
  color: #f5f5f7;
}

html[data-theme="dark"] .side-brand small,
html[data-theme="dark"] .hub-sub,
html[data-theme="dark"] .hc-sub,
html[data-theme="dark"] .panel-title-sub,
html[data-theme="dark"] .home-header p,
html[data-theme="dark"] .metric-tile small,
html[data-theme="dark"] .metric-tile em,
html[data-theme="dark"] .day-row small,
html[data-theme="dark"] .notify-row small,
html[data-theme="dark"] .home-extra p,
html[data-theme="dark"] .goal-row span,
html[data-theme="dark"] .muted-line,
html[data-theme="dark"] .main .sub,
html[data-theme="dark"] .data-head p,
html[data-theme="dark"] .stat .k,
html[data-theme="dark"] thead th {
  color: #a4a7ae;
}

html[data-theme="dark"] tbody tr:hover {
  background: #24272e;
}

html[data-theme="dark"] .home-page {
  background: linear-gradient(135deg, #06070a 0%, #0e1117 50%, #07140f 100%);
}

html[data-theme="dark"] .main.stats-main {
  background: #07080a;
}

html[data-theme="dark"] .stats-page {
  background: linear-gradient(135deg, #06070a 0%, #0e1117 50%, #07140f 100%);
  color: #f5f5f7;
}

html[data-theme="dark"] .stats-title-block h1,
html[data-theme="dark"] .stats-panel-title h2,
html[data-theme="dark"] .stats-metric strong,
html[data-theme="dark"] .stats-progress-row strong,
html[data-theme="dark"] .stats-progress-row b,
html[data-theme="dark"] .stats-legend-row span,
html[data-theme="dark"] .stats-legend-row b,
html[data-theme="dark"] .stats-table th,
html[data-theme="dark"] .stats-crm-card strong,
html[data-theme="dark"] .stats-crm-actions button,
html[data-theme="dark"] .stats-tab.active {
  color: #f5f5f7;
}

html[data-theme="dark"] .stats-title-block p,
html[data-theme="dark"] .stats-metric span,
html[data-theme="dark"] .stats-chart-legend,
html[data-theme="dark"] .stats-bar-day small,
html[data-theme="dark"] .stats-line-chart text,
html[data-theme="dark"] .stats-table td,
html[data-theme="dark"] .stats-empty,
html[data-theme="dark"] .stats-crm-card span,
html[data-theme="dark"] .stats-crm-card p,
html[data-theme="dark"] .stats-tab {
  color: #a4a7ae;
}

html[data-theme="dark"] .stats-badge,
html[data-theme="dark"] .stats-toolbar,
html[data-theme="dark"] .stats-panel,
html[data-theme="dark"] .stats-tab.active {
  background: #111318;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.40);
}

html[data-theme="dark"] .stats-badge {
  color: #f5f5f7;
}

html[data-theme="dark"] .stats-hero {
  background: #050609;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.40);
}

html[data-theme="dark"] .stats-toolbar button,
html[data-theme="dark"] .stats-toolbar label,
html[data-theme="dark"] .stats-toolbar select,
html[data-theme="dark"] .stats-tab,
html[data-theme="dark"] .stats-tab > span,
html[data-theme="dark"] .stats-panel-title > .icon,
html[data-theme="dark"] .stats-metric,
html[data-theme="dark"] .stats-progress-row,
html[data-theme="dark"] .stats-legend-row,
html[data-theme="dark"] .stats-line-chart,
html[data-theme="dark"] .stats-table,
html[data-theme="dark"] .stats-empty,
html[data-theme="dark"] .stats-crm-card,
html[data-theme="dark"] .stats-crm-actions button,
html[data-theme="dark"] .stats-donut-box,
html[data-theme="dark"] .stats-modal-card,
html[data-theme="dark"] .stats-modal-field,
html[data-theme="dark"] .stats-modal-clear,
html[data-theme="dark"] .stats-filter-field,
html[data-theme="dark"] .stats-option-tile {
  background: #181b22;
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .stats-modal-card.stats-period-dialog {
  background: rgba(30, 30, 30, 0.95);
  border-color: rgba(255, 255, 255, 0.14);
}

html[data-theme="dark"] .stats-modal-card.stats-filter-dialog,
html[data-theme="dark"] .stats-modal-card.stats-option-dialog,
.stats-modal-card.pos-dialog {
  background: rgba(30, 30, 30, 0.95);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.30);
}

html[data-theme="dark"] .stats-period-choice {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.78);
}

html[data-theme="dark"] .stats-period-choice.selected {
  background: rgba(105, 255, 180, 0.12);
  border-color: rgba(105, 255, 180, 0.22);
  color: rgba(255, 255, 255, 0.95);
}

html[data-theme="dark"] .stats-filter-dialog .stats-filter-field,
html[data-theme="dark"] .stats-filter-dialog .stats-modal-field,
html[data-theme="dark"] .stats-option-dialog .stats-option-tile,
.stats-filter-dialog.pos-dialog .stats-modal-field {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .stats-toolbar input,
html[data-theme="dark"] .stats-toolbar select,
html[data-theme="dark"] .stats-modal-field input,
html[data-theme="dark"] .stats-modal-field select,
html[data-theme="dark"] .stats-modal-field textarea,
.pos-dialog .stats-modal-field input,
.pos-dialog .stats-modal-field select,
.pos-dialog .stats-modal-field textarea {
  color: #f5f5f7;
}

html[data-theme="dark"] .stats-toolbar label,
html[data-theme="dark"] .stats-modal-field span,
html[data-theme="dark"] .stats-modal-clear,
html[data-theme="dark"] .stats-modal-close,
html[data-theme="dark"] .stats-filter-field .icon,
html[data-theme="dark"] .stats-option-tile .icon,
.pos-dialog .stats-modal-field span {
  color: #a4a7ae;
}

html[data-theme="dark"] .stats-filter-field > span:not(.icon),
html[data-theme="dark"] .stats-option-tile > span:not(.icon) {
  color: #f5f5f7;
}

html[data-theme="dark"] .stats-filter-field[data-notas-new-type] > .icon {
  color: #f5f5f7;
}

html[data-theme="dark"] .stats-filter-field.empty > span:not(.icon) {
  color: #a4a7ae;
}

html[data-theme="dark"] .stats-filter-field:hover,
html[data-theme="dark"] .stats-filter-field:active,
html[data-theme="dark"] .stats-option-tile:hover,
html[data-theme="dark"] .stats-option-tile:active {
  background: #181b22;
}

html[data-theme="dark"] .stats-filter-dialog .stats-filter-field:hover,
html[data-theme="dark"] .stats-filter-dialog .stats-filter-field:active,
html[data-theme="dark"] .stats-option-dialog .stats-option-tile:hover,
html[data-theme="dark"] .stats-option-dialog .stats-option-tile:active {
  background: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .stats-filter-dialog .stats-modal-clear {
  background: transparent;
  border-color: transparent;
}

html[data-theme="dark"] .stats-tab.active > span,
html[data-theme="dark"] .stats-table th,
html[data-theme="dark"] .stats-crm-actions button {
  background: #111318;
}

html[data-theme="dark"] .stats-progress-row > span {
  background: #3a3d45;
}

html[data-theme="dark"] .stats-panel-title > .icon,
html[data-theme="dark"] .stats-tab.active > span,
html[data-theme="dark"] .stats-crm-actions .icon {
  color: #5ea8ff;
}

html[data-theme="dark"] .stats-donut,
html[data-theme="dark"] .stats-table th,
html[data-theme="dark"] .stats-table td,
html[data-theme="dark"] .stats-modal-secondary {
  border-color: rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] .stats-modal-head h3,
html[data-theme="dark"] .stats-modal-secondary {
  color: #f5f5f7;
}

html[data-theme="dark"] .stats-modal-primary {
  background: #f5f5f7;
  color: #111318;
}

html[data-theme="dark"] .stats-period-dialog .stats-modal-primary,
html[data-theme="dark"] .stats-filter-dialog .stats-modal-primary,
html[data-theme="dark"] .pos-pay-method,
.stats-filter-dialog.pos-dialog .stats-modal-primary,
.pos-dialog .pos-pay-method {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

@media (max-width: 940px) {
  html[data-theme="dark"] .stats-title-block {
    background: #111318;
    border-color: rgba(255, 255, 255, 0.12);
  }
}

html[data-theme="dark"] .home-top-actions {
  color: rgba(255, 255, 255, 0.54);
  background: linear-gradient(135deg, #06070a 0%, #0e1117 50%, #07140f 100%);
}

.theme-toggle,
.home-alert-button {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.theme-toggle:hover,
.home-alert-button:hover {
  background: rgba(110, 110, 115, 0.10);
}

.theme-toggle .icon,
.home-alert-button .icon {
  width: 17px;
  height: 17px;
}

html[data-theme="dark"] .home-badge {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f5f5f7;
}

html[data-theme="dark"] .section-title.with-pill span:last-child {
  background: #24272e;
  border-color: #343740;
  color: #f5f5f7;
}

html[data-theme="dark"] .inicio-card {
  background: #111318;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.40);
}

html[data-theme="dark"] .inicio-hero {
  background: #050609;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.40);
}

html[data-theme="dark"] .hero-goal {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .goal-track.light,
html[data-theme="dark"] .goal-track {
  background: #3a3d45;
  border-color: rgba(255, 255, 255, 0.14);
}

html[data-theme="dark"] .goal-head b {
  background: rgba(79, 227, 154, 0.18);
  color: #8dffc6;
}

html[data-theme="dark"] .metric-head span,
html[data-theme="dark"] .day-row > span:first-child,
html[data-theme="dark"] .birthday-row > .icon,
html[data-theme="dark"] .section-title > .icon {
  color: #5ea8ff;
}

html[data-theme="dark"] .birthday-whatsapp-btn {
  border-color: rgba(79, 227, 154, 0.24);
  background: rgba(79, 227, 154, 0.12);
  color: #4fe39a;
}

html[data-theme="dark"] .birthday-whatsapp-btn:hover:not(:disabled) {
  border-color: #25d366;
  background: #25d366;
  color: #07110b;
}

html[data-theme="dark"] .stats-modal-card.birthday-message-dialog {
  border-color: rgba(255, 255, 255, 0.12);
  background: #181b22;
  color: #f5f5f7;
}

html[data-theme="dark"] .birthday-message-dialog .stats-modal-head,
html[data-theme="dark"] .birthday-message-dialog .stats-modal-foot {
  border-color: rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] .birthday-message-dialog .stats-modal-head h3,
html[data-theme="dark"] .birthday-message-recipient strong,
html[data-theme="dark"] .birthday-message-field input,
html[data-theme="dark"] .birthday-message-field select,
html[data-theme="dark"] .birthday-message-field textarea {
  color: #f5f5f7;
}

html[data-theme="dark"] .birthday-message-recipient,
html[data-theme="dark"] .birthday-message-field {
  background: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .birthday-message-recipient span,
html[data-theme="dark"] .birthday-message-recipient small,
html[data-theme="dark"] .birthday-message-field > span {
  color: #a4a7ae;
}

@media (max-width: 600px) {
  .birthday-message-dialog .stats-modal-foot {
    flex-direction: column-reverse;
  }
  .birthday-message-dialog .stats-modal-secondary,
  .birthday-message-dialog .stats-modal-primary,
  .birthday-message-dialog .birthday-message-send {
    width: 100%;
  }
}

html[data-theme="dark"] .notify-row > span {
  background: #111318;
  border-color: rgba(255, 255, 255, 0.14);
  color: #5ea8ff;
}

html[data-theme="dark"] .notify-row i {
  background: #4fe39a;
}

html[data-theme="dark"] .day-row,
html[data-theme="dark"] .birthday-row,
html[data-theme="dark"] thead th,
html[data-theme="dark"] tbody td {
  border-color: rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] .login-field,
html[data-theme="dark"] .data-search-card .login-field {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f5f5f7;
}

html[data-theme="dark"] .login-field input,
html[data-theme="dark"] .login-field input::placeholder {
  color: #a4a7ae;
}

html[data-theme="dark"] .btn-google {
  background: #f5f5f7;
  color: #090a0d;
}

@media (max-width: 940px) {
  html[data-theme="dark"] body,
  html[data-theme="dark"] #app,
  html[data-theme="dark"] .shell,
  html[data-theme="dark"] .main {
    background: linear-gradient(135deg, #06070a 0%, #0e1117 50%, #07140f 100%);
  }

  html[data-theme="dark"] .home-title-block,
  html[data-theme="dark"] .cash-title-block {
    background: #111318;
    border-color: rgba(255, 255, 255, 0.12);
  }
}

/* ===========================================================================
   Clientes — espelha lib/pages/clients_page.dart
   =========================================================================== */

.clients-page .stats-hero {
  margin-bottom: 14px;
}

.clients-hero-grid {
  grid-template-columns: 1fr;
}

.clients-panel {
  min-height: 0;
  padding: 18px;
  border-radius: 26px;
}

.clients-desktop-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.clients-search {
  flex: 1 1 240px;
  margin-bottom: 0;
}

.clients-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.clients-desktop-controls .prod-tool-btn,
.clients-desktop-controls .prod-btn-new {
  gap: 9px;
  padding: 0 16px;
  border-radius: 18px;
}

.clients-desktop-controls .prod-btn-chip {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  border: 0;
}

.clients-desktop-controls .prod-btn-chip .icon {
  width: 18px;
  height: 18px;
}

.clients-birthday-action {
  border-color: rgba(var(--blue-rgb), 0.24) !important;
  color: var(--blue) !important;
}

.clients-birthday-action .prod-btn-chip {
  color: var(--blue);
}

.clients-mobile-controls {
  display: none;
}

.clients-filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.client-filter-chip {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #ffffff;
  color: #6e6e73;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.05);
  font: inherit;
  font-size: 13px;
  font-weight: 300;
  cursor: pointer;
  transition: transform 160ms ease, background 170ms ease, color 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.client-filter-chip.active {
  background: #ffffff;
  border-color: rgba(var(--blue-rgb), 0.36);
  color: #1d1d1f;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06), inset 0 0 0 1px rgba(var(--blue-rgb), 0.16);
}

.client-filter-chip:hover {
  transform: translateY(-1px);
}

.client-filter-chip:active {
  transform: scale(0.985);
}

.clients-list-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px 140px;
  align-items: center;
  margin-bottom: 12px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #f5f5f7;
  color: #6e6e73;
  font-size: 12px;
  font-weight: 300;
}

.clients-list-head span:nth-child(2) {
  text-align: center;
}

.clients-list-head span:nth-child(3) {
  text-align: right;
}

.clients-desktop-list {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 0;
}

.clients-desktop-list .stats-empty {
  min-height: 108px;
}

.clients-mobile-list {
  display: none;
}

.client-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 160px 140px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #f5f5f7;
}

.client-avatar {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(29, 29, 31, 0.08);
  background: #ffffff;
  color: var(--blue);
}

.client-avatar .icon {
  width: 22px;
  height: 22px;
}

.client-main {
  min-width: 0;
}

.client-main strong,
.client-main span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-main strong {
  color: #1d1d1f;
  font-size: 14px;
  font-weight: 300;
}

.client-main span {
  margin-top: 4px;
  color: #6e6e73;
  font-size: 12px;
  font-weight: 300;
}

.client-status-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.client-switch {
  width: 50px;
  height: 30px;
  position: relative;
  border: 0;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.24);
  cursor: pointer;
  transition: background 180ms ease, transform 150ms ease;
}

.client-switch:active {
  transform: scale(0.96);
}

.client-switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.client-switch.on {
  background: var(--blue);
}

.client-switch.on span {
  transform: translateX(20px);
}

.client-actions-cell {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.client-icon-action {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(29, 29, 31, 0.08);
  background: #ffffff;
  color: var(--blue);
  cursor: pointer;
  transition: transform 150ms ease, background 170ms ease;
}

.client-icon-action:hover {
  transform: translateY(-1px);
}

.client-icon-action:active {
  transform: scale(0.96);
}

.client-icon-action.danger {
  color: #ff3b30;
}

.client-icon-action .icon {
  width: 20px;
  height: 20px;
}

.clients-mobile-filter {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #ffffff;
  color: var(--blue);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.06);
  cursor: pointer;
}

.clients-mobile-filter .icon {
  width: 19px;
  height: 19px;
}

.clients-mobile-birthday {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  border: 1px solid rgba(var(--blue-rgb), 0.24);
  background: rgba(var(--blue-rgb), 0.10);
  color: var(--blue);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.06);
  cursor: pointer;
}

.clients-mobile-birthday .icon {
  width: 19px;
  height: 19px;
}

.stats-modal-card.client-birthday-bulk-dialog {
  width: min(680px, calc(100vw - 36px));
  padding: 0;
  border: 1px solid rgba(29, 29, 31, 0.10);
  border-radius: 22px;
  background: #fff;
  color: #1d1d1f;
  overflow: hidden;
}

.client-birthday-bulk-dialog .stats-modal-head {
  flex: 0 0 auto;
  min-height: 60px;
  margin: 0;
  padding: 15px 18px 15px 22px;
  border-bottom: 1px solid rgba(29, 29, 31, 0.08);
}

.client-birthday-bulk-dialog .stats-modal-head h3 {
  min-width: 0;
  color: #1d1d1f;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.25;
  white-space: normal;
}

.client-birthday-bulk-dialog .stats-modal-close {
  flex: 0 0 32px;
}

.client-birthday-bulk-dialog .stats-modal-body {
  min-height: 0;
  max-height: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
}

/* O corpo rola em telas baixas; os campos e a lista não se comprimem. */
.client-birthday-bulk-dialog .stats-modal-body > * {
  flex: 0 0 auto;
}

.client-birthday-bulk-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 13px;
  background: #f5f5f7;
  color: #6e6e73;
  font-size: 12px;
}

.client-birthday-bulk-summary strong {
  color: var(--blue);
  font-weight: 500;
}

.client-birthday-bulk-list {
  max-height: 230px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

.client-birthday-bulk-row {
  /* Cada destinatário conserva a altura necessária para todas as linhas. */
  flex: 0 0 auto;
  min-height: 54px;
  display: grid;
  grid-template-columns: 20px 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid rgba(29, 29, 31, 0.09);
  border-radius: 13px;
  background: #fff;
  cursor: pointer;
}

.client-birthday-bulk-row input {
  margin: 0;
  width: 17px;
  height: 17px;
  accent-color: var(--blue);
}

.client-birthday-bulk-date {
  color: #6e6e73;
  font-size: 12px;
}

.client-birthday-bulk-person { min-width: 0; }

.client-birthday-bulk-person strong,
.client-birthday-bulk-person small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-birthday-bulk-person strong {
  color: #1d1d1f;
  font-size: 13px;
  font-weight: 500;
}

.client-birthday-bulk-person small {
  margin-top: 2px;
  color: #8a8a8f;
  font-size: 11px;
}

.client-birthday-bulk-row em {
  min-width: 0;
  color: #6e6e73;
  font-size: 10.5px;
  font-style: normal;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.client-birthday-bulk-row.is-missing { cursor: default; opacity: .55; }
.client-birthday-bulk-row[data-status="sending"] em { color: #b7791f; }
.client-birthday-bulk-row[data-status="sent"] { border-color: rgba(var(--blue-rgb), 0.32); background: rgba(var(--blue-rgb), 0.07); }
.client-birthday-bulk-row[data-status="sent"] em { color: var(--blue); }
.client-birthday-bulk-row[data-status="failed"] { border-color: rgba(229, 72, 77, 0.30); background: rgba(229, 72, 77, 0.06); }
.client-birthday-bulk-row[data-status="failed"] em { color: #d0383d; }

.client-birthday-bulk-message textarea {
  min-height: 54px;
  max-height: 220px;
  resize: none;
  overflow-y: hidden;
}

.client-birthday-bulk-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  color: #6e6e73;
  font-size: 11.5px;
  line-height: 1.4;
}

.client-birthday-bulk-note .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.client-birthday-bulk-dialog .stats-modal-foot {
  flex: 0 0 auto;
  margin: 0;
  padding: 13px 18px 17px;
  border-top: 1px solid rgba(29, 29, 31, 0.08);
}

.client-birthday-bulk-dialog .stats-modal-secondary,
.client-birthday-bulk-dialog .stats-modal-primary {
  width: auto;
  min-width: 122px;
}

.client-birthday-bulk-dialog .client-birthday-bulk-send {
  min-width: 190px;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
}

.client-birthday-bulk-dialog .client-birthday-bulk-send > .icon {
  position: static;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.client-birthday-bulk-send-label {
  display: block;
  position: static;
  min-width: 0;
  line-height: 1;
}

.client-birthday-bulk-dialog .client-birthday-bulk-send:hover:not(:disabled) {
  background: color-mix(in srgb, var(--blue) 88%, #000);
}
.client-birthday-bulk-dialog button:disabled { cursor: wait; opacity: .56; }

.client-mobile-row {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  border-bottom: 0;
  background: #f5f5f7;
  color: #1d1d1f;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.client-mobile-row.first {
  border-radius: 12px 12px 0 0;
}

.client-mobile-row.last {
  border-bottom: 1px solid rgba(29, 29, 31, 0.10);
  border-radius: 0 0 12px 12px;
}

.client-mobile-row.first.last {
  border-radius: 12px;
}

.client-mobile-name {
  min-width: 0;
  flex: 1;
  color: #1d1d1f;
  font-size: 14.5px;
  font-weight: 300;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-mobile-name small {
  color: #6e6e73;
  font-size: 12px;
  font-weight: 300;
}

.client-recurring-icon,
.client-mobile-chevron {
  flex: 0 0 auto;
  color: #6e6e73;
}

.client-recurring-icon {
  width: 16px;
  height: 16px;
  color: var(--blue);
}

.client-mobile-chevron {
  width: 24px;
  height: 24px;
}

.client-filter-dialog-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.client-filter-tile {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-size: 13px;
  font-weight: 300;
  text-align: left;
  cursor: pointer;
}

.client-filter-tile.selected {
  background: rgba(105, 255, 180, 0.12);
  border-color: rgba(105, 255, 180, 0.22);
}

.client-filter-tile.danger {
  color: #ff6c6c;
  border-color: rgba(255, 77, 77, 0.24);
}

.client-filter-tile .icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
}

.client-confirm-text {
  padding: 6px 4px 2px;
  text-align: center;
}

.client-confirm-text strong {
  display: block;
  color: rgba(255, 255, 255, 0.94);
  font-size: 18px;
  font-weight: 300;
}

.client-confirm-text p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 300;
}

.stats-modal-card.client-form-dialog {
  width: min(750px, calc(100vw - 40px));
  max-height: min(88vh, 760px);
  padding: 0;
  border-radius: 20px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(30, 30, 30, 0.95);
  overflow: hidden;
}

.client-form-dialog .stats-modal-head {
  margin: 0;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.client-form-dialog .stats-modal-head h3 {
  color: #ffffff;
  font-size: 19px;
  font-weight: 300;
}

.client-form-dialog .stats-modal-close {
  color: rgba(255, 255, 255, 0.72);
}

.client-form-dialog .stats-modal-body {
  padding: 14px 16px 12px;
  overflow: auto;
}

.client-form-dialog .stats-modal-foot {
  margin: 0;
  padding: 10px 16px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.client-form-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.client-form-row,
.client-document-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.client-document-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.client-form-row-address {
  grid-template-columns: minmax(0, 1fr) 120px 300px;
}

.client-form-row-address2 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 120px;
}

.client-form-row-cep {
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: center;
}

.client-form-dialog .stats-modal-field {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: 12px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
}

.client-form-dialog .stats-modal-field span,
.client-form-dialog .stats-modal-field input,
.client-form-dialog .stats-modal-field select,
.client-form-dialog .stats-modal-field textarea {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 300;
  width: 100%;
}

.client-form-dialog .stats-modal-field span {
  color: rgba(255, 255, 255, 0.62);
}

.client-form-dialog .stats-modal-field input::placeholder,
.client-form-dialog .stats-modal-field textarea::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.client-form-textarea {
  align-items: flex-start;
}

.client-form-toggle {
  min-height: 38px;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-size: 14px;
  font-weight: 300;
  cursor: pointer;
}

.client-form-toggle b {
  font-size: 14px;
  font-weight: 300;
}

.client-form-toggle > .icon {
  width: 16px;
  height: 16px;
  color: rgba(255, 255, 255, 0.58);
}

.client-form-switch {
  width: 38px;
  height: 22px;
  position: relative;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.client-form-switch i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.client-form-toggle.on .client-form-switch {
  background: rgba(255, 255, 255, 0.35);
}

.client-form-toggle.on .client-form-switch i {
  transform: translateX(16px);
  background: #ffffff;
}

.client-section-toggle {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-size: 15px;
  font-weight: 300;
  cursor: pointer;
}

.client-section-toggle .icon {
  width: 20px;
  height: 20px;
  color: rgba(255, 255, 255, 0.72);
  transition: transform 170ms ease;
}

.client-section-toggle .client-section-open {
  transform: rotate(90deg);
}

.client-form-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.client-form-spacer {
  height: 8px;
}

.client-cep-status,
.client-validation {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 300;
}

.client-validation {
  min-height: 16px;
  margin: 0;
}

.client-form-dialog .stats-modal-primary:disabled {
  opacity: 0.46;
  cursor: default;
}

html[data-theme="dark"] .clients-panel,
html[data-theme="dark"] .client-avatar,
html[data-theme="dark"] .client-icon-action,
html[data-theme="dark"] .clients-mobile-filter,
html[data-theme="dark"] .clients-mobile-birthday {
  background: #111318;
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .clients-birthday-action {
  border-color: rgba(var(--blue-rgb), 0.28) !important;
  color: var(--blue) !important;
}

html[data-theme="dark"] .stats-modal-card.client-birthday-bulk-dialog {
  border-color: rgba(255, 255, 255, 0.12);
  background: #181b22;
  color: #f5f5f7;
}

html[data-theme="dark"] .client-birthday-bulk-dialog .stats-modal-head,
html[data-theme="dark"] .client-birthday-bulk-dialog .stats-modal-foot {
  border-color: rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] .client-birthday-bulk-dialog .stats-modal-head h3,
html[data-theme="dark"] .client-birthday-bulk-person strong {
  color: #f5f5f7;
}

html[data-theme="dark"] .client-birthday-bulk-summary,
html[data-theme="dark"] .client-birthday-bulk-row,
html[data-theme="dark"] .client-birthday-bulk-message {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .client-birthday-bulk-summary,
html[data-theme="dark"] .client-birthday-bulk-date,
html[data-theme="dark"] .client-birthday-bulk-person small,
html[data-theme="dark"] .client-birthday-bulk-row em,
html[data-theme="dark"] .client-birthday-bulk-note {
  color: #a4a7ae;
}

html[data-theme="dark"] .client-row,
html[data-theme="dark"] .clients-list-head,
html[data-theme="dark"] .client-filter-chip,
html[data-theme="dark"] .client-mobile-row {
  background: #181b22;
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .client-main strong,
html[data-theme="dark"] .client-mobile-name {
  color: #f5f5f7;
}

html[data-theme="dark"] .client-main span,
html[data-theme="dark"] .clients-list-head,
html[data-theme="dark"] .client-filter-chip,
html[data-theme="dark"] .client-mobile-name small,
html[data-theme="dark"] .client-mobile-chevron {
  color: #a4a7ae;
}

html[data-theme="dark"] .client-filter-chip.active {
  background: #2a2d35;
  border-color: rgba(255, 255, 255, 0.18);
  color: #f5f5f7;
}

html[data-theme="dark"] .clients-desktop-controls .prod-btn-chip {
  background: transparent;
  border-color: transparent;
}

@media (max-width: 940px) {
  .clients-page .stats-hero {
    margin-bottom: 12px;
  }
  .clients-panel {
    min-height: 0;
    padding: 14px;
    border-radius: 26px;
  }
  .clients-desktop-controls,
  .clients-filter-row,
  .clients-list-head,
  .clients-desktop-list {
    display: none;
  }
  .clients-mobile-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
  }
  .clients-mobile-controls .clients-search {
    flex: 1 1 auto;
  }
  .clients-mobile-list {
    display: block;
  }
  .stats-modal-card.client-birthday-bulk-dialog {
    width: min(520px, calc(100vw - 32px));
    max-height: min(760px, calc(var(--app-height) - max(18px, var(--safe-top)) - max(18px, var(--safe-bottom))));
  }
  .client-birthday-bulk-dialog .stats-modal-foot {
    flex-direction: column-reverse;
  }
  .client-birthday-bulk-dialog .stats-modal-secondary,
  .client-birthday-bulk-dialog .stats-modal-primary,
  .client-birthday-bulk-dialog .client-birthday-bulk-send {
    width: 100%;
  }
  .client-birthday-bulk-row {
    grid-template-columns: 20px 44px minmax(0, 1fr);
    grid-template-areas:
      "check date person"
      "check date status";
    row-gap: 4px;
    padding-block: 10px;
  }
  .client-birthday-bulk-row input {
    grid-area: check;
  }
  .client-birthday-bulk-date {
    grid-area: date;
  }
  .client-birthday-bulk-person {
    grid-area: person;
  }
  .client-birthday-bulk-person strong {
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .client-birthday-bulk-row em {
    grid-area: status;
  }
  .stats-modal-card.client-form-dialog {
    width: min(356px, calc(100vw - 32px));
    max-height: min(680px, calc(var(--app-height) - 40px));
    border-radius: 24px;
  }
  .client-form-dialog .stats-modal-body {
    max-height: calc(var(--app-height) - 158px);
  }
  .client-form-row,
  .client-document-row,
  .client-form-row-address,
  .client-form-row-address2,
  .client-form-row-cep {
    grid-template-columns: 1fr;
  }
  .client-document-row {
    align-items: start;
  }
  .client-form-dialog .stats-modal-field {
    min-height: 52px;
  }
  .client-form-dialog .stats-modal-foot {
    justify-content: stretch;
  }
  .client-form-dialog .stats-modal-danger,
  .client-form-dialog .stats-modal-primary {
    width: 100%;
  }
}

/* ===========================================================================
   Produtos — espelha lib/pages/dashboard_page.dart (_ProductsFirebaseState)
   =========================================================================== */

.prod-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.prod-hero-pills span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f5f5f7;
  border: 1px solid rgba(29, 29, 31, 0.10);
  color: #1d1d1f;
  font-size: 12px;
  font-weight: 300;
}

.prod-hero-pills .icon { width: 14px; height: 14px; color: var(--blue); }

.prod-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.prod-search {
  flex: 1 1 100%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(29, 29, 31, 0.10);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.06);
}

.prod-search .icon { width: 16px; height: 16px; color: var(--blue); flex: 0 0 auto; }

.prod-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1d1d1f;
  font: inherit;
  font-weight: 300;
  font-size: 13px;
}

.prod-search input::placeholder { color: #6e6e73; }

.prod-tool-btn,
.prod-btn-new {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 4px 14px 4px 4px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(29, 29, 31, 0.10);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.06);
  color: #1d1d1f;
  font: inherit;
  font-weight: 300;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.prod-btn-chip {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #f5f5f7;
  border: 1px solid rgba(29, 29, 31, 0.08);
}

.prod-btn-chip .icon { width: 16px; height: 16px; color: var(--blue); }

.prod-btn-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Toolbar Produtos (Filtros / Lista / Exportar / Novo):
   ícone azul "flat" solto, sem o chip cinza — igual ao app Flutter.
   Escopado em .prod-toolbar para não mexer nos botões do diálogo. */
.prod-toolbar .prod-tool-btn,
.prod-toolbar .prod-btn-new {
  gap: 9px;
  padding: 0 16px;
  border-radius: 18px;
}
.prod-toolbar .prod-btn-chip {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  border: 0;
}
.prod-toolbar .prod-btn-chip .icon {
  width: 18px;
  height: 18px;
}
html[data-theme="dark"] .prod-toolbar .prod-btn-chip {
  background: transparent;
  border-color: transparent;
}
@media (max-width: 940px) {
  .prod-toolbar .prod-tool-btn,
  .prod-toolbar .prod-btn-new {
    padding: 0 8px;
    gap: 6px;
  }
}

.prod-subhead {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.prod-subhead-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: #f5f5f7;
  border: 1px solid rgba(29, 29, 31, 0.10);
  color: var(--blue);
}

.prod-subhead-icon .icon { width: 20px; height: 20px; }

.prod-subhead h2 {
  margin: 0;
  color: #1d1d1f;
  font-size: 20px;
  font-weight: 300;
}

.prod-subhead p {
  margin: 4px 0 0;
  color: #6e6e73;
  font-size: 12.5px;
  font-weight: 300;
}

.prod-panel { padding: 14px; }

.prod-seg {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: 14px;
  background: #f5f5f7;
  border: 1px solid rgba(29, 29, 31, 0.10);
}

.prod-seg-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #6e6e73;
  font: inherit;
  font-weight: 300;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.prod-seg-btn.active {
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

/* ===================== Vendas (espelho de sales_page.dart) ===================== */
.vendas-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.vendas-search {
  flex: 1 1 240px; min-width: 0; display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 14px; border-radius: 18px; background: #f5f5f7;
  border: 1px solid rgba(29, 29, 31, 0.10); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.04);
}
.vendas-search .icon { width: 18px; height: 18px; color: var(--blue); flex: 0 0 auto; }
.vendas-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #1d1d1f; font: inherit; font-weight: 300; font-size: 13px; }
.vendas-search input::placeholder { color: #6e6e73; }

.vendas-pill {
  display: inline-flex; align-items: center; gap: 9px; height: 48px; padding: 0 16px;
  border-radius: 18px; background: #f5f5f7; border: 1px solid rgba(29, 29, 31, 0.10);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.04); color: #1d1d1f; font: inherit; font-weight: 300; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.vendas-pill .icon { width: 18px; height: 18px; color: var(--blue); }
.vendas-pill.outlined { background: transparent; box-shadow: none; }
.vendas-pill.primary { background: var(--blue); border-color: var(--blue); color: #ffffff; }
.vendas-pill.primary .icon { color: #ffffff; }

.vendas-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.vendas-tab {
  height: 36px; padding: 0 16px; border-radius: 10px; border: 1px solid rgba(29, 29, 31, 0.10);
  background: #f5f5f7; color: #6e6e73; font: inherit; font-weight: 300; font-size: 12.5px; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
}
.vendas-tab.active { background: #ffffff; border-color: rgba(var(--blue-rgb), 0.36); color: #1d1d1f; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06), inset 0 0 0 1px rgba(var(--blue-rgb), 0.16); }

.vendas-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.vendas-stat { padding: 12px 14px; border-radius: 18px; background: #f5f5f7; border: 1px solid rgba(29, 29, 31, 0.08); }
.vendas-stat .k { color: #6e6e73; font-size: 11px; font-weight: 300; }
.vendas-stat .v { color: #1d1d1f; font-size: 16px; font-weight: 400; margin-top: 6px; }
.vendas-stat .icon { width: 14px; height: 14px; margin-right: 2px; }

.vendas-panel { margin-top: 20px; }
.vendas-thead {
  display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 14px;
  background: #f5f5f7; border: 1px solid rgba(29, 29, 31, 0.08); margin-bottom: 12px;
}
.vendas-thead > span { color: #6e6e73; font-size: 11px; font-weight: 400; letter-spacing: 0.02em; }
.vendas-thead .h-venda { flex: 2; } .vendas-thead .h-cliente { flex: 5; }
.vendas-thead .h-fiscal { flex: 2; text-align: center; } .vendas-thead .h-pg { flex: 3; text-align: center; }
.vendas-thead .h-data { flex: 3; text-align: center; } .vendas-thead .h-valor { flex: 2; text-align: right; }
.vendas-thead .h-status { width: 100px; flex: 0 0 auto; text-align: center; }

.vendas-list { display: flex; flex-direction: column; gap: 12px; }
.vendas-row {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; padding: 14px;
  border-radius: 18px; background: #f5f5f7; border: 1px solid rgba(29, 29, 31, 0.08); cursor: pointer;
  font: inherit; transition: background 140ms ease;
}
.vendas-row:hover { background: #eceef1; }
.vendas-row.vendas-row-pending {
  background: rgba(255, 149, 0, 0.14);
  border-color: rgba(255, 149, 0, 0.38);
}
.vendas-row.vendas-row-pending:hover { background: rgba(255, 149, 0, 0.20); }
/* Venda retroativa: mesma paleta do aviso de caixa retroativo, para o laranja
   significar sempre "isto pertence a um caixa antigo". O tom é mais fraco que o
   da venda em andamento porque a linha retroativa já está fechada. */
.vendas-row.vendas-row-retro {
  background: rgba(255, 149, 0, 0.09);
  border-color: rgba(255, 149, 0, 0.34);
}
.vendas-row.vendas-row-retro:hover { background: rgba(255, 149, 0, 0.15); }
.vendas-col { display: flex; flex-direction: column; min-width: 0; }
.vendas-col .cl { color: #6e6e73; font-size: 11px; font-weight: 300; }
.vendas-col .cv { color: #1d1d1f; font-size: 12.5px; font-weight: 400; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 25px; display: flex; align-items: center; }
.vendas-col.center { align-items: center; text-align: center; }
.vendas-col.right { align-items: flex-end; text-align: right; }
.vendas-col.c-venda { flex: 2; } .vendas-col.c-cliente { flex: 5; } .vendas-col.c-fiscal { flex: 2; }
.vendas-col.c-pg { flex: 3; } .vendas-col.c-data { flex: 3; } .vendas-col.c-valor { flex: 2; }
.vendas-status { width: 100px; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.vendas-status .cl { color: #6e6e73; font-size: 11px; font-weight: 300; }
.vendas-badge { padding: 0 10px; border-radius: 999px; font-size: 10.5px; font-weight: 400; border: 1px solid; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; height: 25px; display: flex; align-items: center; justify-content: center; }
.vendas-badge.ok { color: #13a065; background: rgba(19, 160, 101, 0.13); border-color: rgba(19, 160, 101, 0.30); }
.vendas-badge.cancel { color: #ff3b30; background: rgba(255, 59, 48, 0.10); border-color: rgba(255, 59, 48, 0.24); }
.vendas-badge.pending { color: #b85f00; background: rgba(255, 149, 0, 0.18); border-color: rgba(255, 149, 0, 0.42); }
.vendas-badge.conditional { color: #7357d8; background: rgba(115, 87, 216, 0.12); border-color: rgba(115, 87, 216, 0.30); }
.vendas-badge.retro { color: #b85f00; background: rgba(255, 149, 0, 0.16); border-color: rgba(255, 149, 0, 0.40); font-weight: 500; }
.vendas-val-ok { color: #13a065; }
.vendas-val-cancel { color: #ff3b30; }
.vendas-val-pending { color: #b85f00; }
.vendas-val-conditional { color: #7357d8; }
.vendas-col .cv.vendas-val-ok { color: #13a065; }
.vendas-col .cv.vendas-val-cancel { color: #ff3b30; }
.vendas-col .cv.vendas-val-pending { color: #b85f00; }
.vendas-col .cv.vendas-val-conditional { color: #7357d8; }
html[data-theme="dark"] .vendas-col .cv.vendas-val-ok { color: #4fe39a; }
html[data-theme="dark"] .vendas-col .cv.vendas-val-cancel { color: #ff6c6c; }
.vendas-empty { text-align: center; color: #6e6e73; padding: 44px 0; font-weight: 300; }
.vendas-filter-field .icon { width: 18px; height: 18px; flex: 0 0 18px; color: #6e6e73; }
.vendas-payment-field { margin-top: 8px; }
html[data-theme="dark"] .vendas-filter-field .icon { color: #a4a7ae; }
.venda-cancel-btn { width: 100%; margin-top: 6px; }

.vendas-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(10px);
  background: var(--ink);
  color: var(--bg);
  border: 0;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 12px 30px var(--shadow);
  opacity: 0;
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 100020;
  max-width: min(480px, calc(100vw - 32px));
  text-align: center;
  pointer-events: none;
}
.vendas-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.stats-option-dialog .stats-modal-foot {
  justify-content: flex-start;
  padding-top: 4px;
  margin-top: 6px;
}
.stats-option-dialog .stats-modal-secondary {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  width: auto;
  padding: 0 20px;
}
.stats-option-dialog .stats-modal-secondary:hover { background: rgba(255, 255, 255, 0.10); }

/* Detalhe da venda (modal) */
.venda-detail { display: flex; flex-direction: column; gap: 14px; }
.venda-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.venda-detail-head .cl { color: #6e6e73; font-size: 11px; display: block; }
.venda-detail-head strong { color: #1d1d1f; font-size: 18px; font-weight: 500; }
.venda-info { display: flex; flex-direction: column; gap: 8px; }
.venda-info-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.venda-info-row span { color: #6e6e73; font-size: 12.5px; font-weight: 300; }
.venda-info-row b { color: #1d1d1f; font-size: 12.5px; font-weight: 400; }
.venda-items { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; border-top: 1px solid rgba(29, 29, 31, 0.08); }
.venda-items .cl { color: #6e6e73; font-size: 11px; font-weight: 300; margin-bottom: 2px; }
.venda-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.venda-item span { color: #1d1d1f; font-size: 12.5px; font-weight: 300; }
.venda-item b { color: #1d1d1f; font-size: 12.5px; font-weight: 400; }
.venda-item.muted span { color: #6e6e73; }
.venda-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; border-top: 1px solid rgba(29, 29, 31, 0.08); }
.venda-total span { color: #6e6e73; font-size: 13px; font-weight: 300; }
.venda-total b { font-size: 18px; font-weight: 500; }
.venda-info-note { color: #6e6e73; font-size: 13px; font-weight: 300; line-height: 1.5; }

/* Tema escuro */

html[data-theme="dark"] .vendas-search,
html[data-theme="dark"] .vendas-pill,
html[data-theme="dark"] .vendas-tab { background: #0e1015; border-color: rgba(255, 255, 255, 0.10); color: #f5f5f7; }
html[data-theme="dark"] .vendas-pill.outlined { background: transparent; }
html[data-theme="dark"] .vendas-pill.primary { background: var(--blue); border-color: var(--blue); color: #ffffff; }
html[data-theme="dark"] .vendas-search input { color: #f5f5f7; }
html[data-theme="dark"] .vendas-search .icon,
html[data-theme="dark"] .vendas-pill .icon { color: #5ea8ff; }
html[data-theme="dark"] .vendas-pill.primary .icon { color: #ffffff; }
html[data-theme="dark"] .vendas-tab { color: #a4a7ae; }
html[data-theme="dark"] .vendas-tab.active { background: #2a2d35; border-color: rgba(255, 255, 255, 0.18); color: #f5f5f7; }
html[data-theme="dark"] .vendas-stat,
html[data-theme="dark"] .vendas-thead,
html[data-theme="dark"] .vendas-row { background: #0e1015; border-color: rgba(255, 255, 255, 0.10); }
html[data-theme="dark"] .vendas-row:hover { background: #12151c; }
html[data-theme="dark"] .vendas-row.vendas-row-pending {
  background: rgba(255, 159, 10, 0.13);
  border-color: rgba(255, 159, 10, 0.34);
}
html[data-theme="dark"] .vendas-row.vendas-row-pending:hover { background: rgba(255, 159, 10, 0.19); }
html[data-theme="dark"] .vendas-row.vendas-row-retro {
  background: rgba(255, 159, 10, 0.085);
  border-color: rgba(255, 159, 10, 0.30);
}
html[data-theme="dark"] .vendas-row.vendas-row-retro:hover { background: rgba(255, 159, 10, 0.14); }
html[data-theme="dark"] .vendas-stat .v,
html[data-theme="dark"] .vendas-col .cv,
html[data-theme="dark"] .venda-detail-head strong,
html[data-theme="dark"] .venda-info-row b,
html[data-theme="dark"] .venda-item span,
html[data-theme="dark"] .venda-item b { color: #f5f5f7; }
html[data-theme="dark"] .vendas-stat .k,
html[data-theme="dark"] .vendas-thead > span,
html[data-theme="dark"] .vendas-col .cl,
html[data-theme="dark"] .vendas-status .cl,
html[data-theme="dark"] .vendas-empty,
html[data-theme="dark"] .venda-info-row span,
html[data-theme="dark"] .venda-total span,
html[data-theme="dark"] .venda-info-note,
html[data-theme="dark"] .venda-items .cl { color: #a4a7ae; }
html[data-theme="dark"] .vendas-val-ok { color: #4fe39a; }
html[data-theme="dark"] .vendas-badge.ok { color: #4fe39a; background: rgba(79, 227, 154, 0.12); border-color: rgba(79, 227, 154, 0.28); }
html[data-theme="dark"] .vendas-badge.pending { color: #ffb340; background: rgba(255, 159, 10, 0.16); border-color: rgba(255, 159, 10, 0.38); }
html[data-theme="dark"] .vendas-col .cv.vendas-val-pending { color: #ffb340; }
html[data-theme="dark"] .vendas-badge.conditional { color: #b7a7ff; background: rgba(142, 119, 255, 0.16); border-color: rgba(183, 167, 255, 0.36); }
html[data-theme="dark"] .vendas-badge.retro { color: #ffb340; background: rgba(255, 159, 10, 0.16); border-color: rgba(255, 159, 10, 0.38); }
html[data-theme="dark"] .vendas-col .cv.vendas-val-conditional { color: #b7a7ff; }

/* ===================== Detalhes da venda — tema atual =====================
   O resumo preserva todo o conteúdo operacional, mas passa a usar os tokens
   claros/escuros dos pop-ups novos do sistema. */
.stats-modal-card.pos-dialog.venda-detail-dialog {
  width: min(800px, 100%);
  max-height: min(720px, calc(100dvh - 40px));
  border-color: var(--pop-border);
  border-radius: 20px;
  background: var(--pop-surface);
  color: var(--pop-ink);
  box-shadow: var(--pop-shadow);
}
.venda-detail-dialog .stats-modal-head { display: none; }
.stats-modal-card.pos-dialog.venda-detail-dialog .stats-modal-body { padding: 18px; }

.vd2 { display: flex; flex-direction: column; gap: 12px; }
.vd2-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.vd2-head-l { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vd2-title { color: var(--pop-ink); font-size: 16px; font-weight: 600; }
.vd2-customer { color: var(--pop-muted); font-size: 12px; font-weight: 500; }
.vd2-head-r { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.vd2-close { width: 30px; height: 30px; border: 1px solid var(--pop-border); background: var(--pop-surface-alt); color: var(--pop-close-ink); cursor: pointer; padding: 0; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; }
.vd2-close:hover { background: var(--pop-hover); color: var(--pop-ink); }
.vd2-close:focus-visible { outline: 2px solid var(--pop-accent); outline-offset: 2px; }
.vd2-close .icon { width: 20px; height: 20px; transform: translateX(0.5px); }
.vd2-close .icon svg { width: 20px; height: 20px; }

.vd2-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--pop-accent) 16%, var(--pop-border)); border-radius: 16px; background: var(--pop-accent-soft); }
.vd2-total { color: var(--pop-ink); font-size: 27px; font-weight: 600; letter-spacing: -0.5px; }
.vd2-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.vd2-date, .vd2-seller { color: var(--pop-muted); font-size: 12px; font-weight: 500; word-break: break-all; }
/* A data do cabeçalho é a da digitação; este selo diz o dia contábil. */
.vd2-retro {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  padding: 3px 9px;
  border: 1px solid rgba(255, 149, 0, 0.40);
  border-radius: 999px;
  color: #b85f00;
  background: rgba(255, 149, 0, 0.14);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.vd2-retro svg { width: 13px; height: 13px; fill: currentColor; }
html[data-theme="dark"] .vd2-retro {
  color: #ffb340;
  border-color: rgba(255, 159, 10, 0.38);
  background: rgba(255, 159, 10, 0.16);
}

/* Ações no estilo dos menus compactos (rdx-project-popover): o quadrado
   arredondado envolve a ação inteira, com o ícone e o nome embaixo; só o
   Cancelar fica vermelho. */
.vd2-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.vd2-act {
  min-width: 0;
  min-height: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 6px;
  border: 1px solid var(--pop-border);
  border-radius: 12px;
  background: var(--pop-surface);
  color: var(--pop-ink);
  font-family: var(--apple-font);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  transition: background 160ms ease, transform 120ms ease;
}
.vd2-act > .icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pop-muted);
}
.vd2-act > .icon svg { width: 18px; height: 18px; fill: currentColor; }
.vd2-act:hover { background: var(--pop-hover); }
.vd2-act:active { transform: scale(0.985); }
.vd2-act:focus-visible { outline: 2px solid var(--pop-accent); outline-offset: 2px; }
.vd2-act.danger { border-color: var(--pop-danger-border); background: var(--pop-danger-bg); }
.vd2-act.danger,
.vd2-act.danger > .icon { color: var(--pop-danger); }
.vd2-act.danger:hover { background: var(--pop-danger-bg); opacity: 0.86; }
.vd2-act:disabled { opacity: 0.42; cursor: not-allowed; transform: none; }
.vd2-act:disabled:hover { background: var(--pop-surface); }
.vd2-act.danger:disabled:hover { background: var(--pop-danger-bg); opacity: 0.42; }
.vd2-act.is-loading { opacity: 1; pointer-events: none; }
.vd2-act .dialog-action-spinner { width: 18px; height: 18px; flex-basis: 18px; margin: 8px 0; }

.vd2-divider { height: 1px; background: var(--pop-border); }
.vd2-section-title { color: var(--pop-ink); font-size: 12px; font-weight: 600; }

.vd2-items { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--pop-border); border-radius: 14px; background: var(--pop-surface); }
.vd2-item { display: flex; flex-direction: column; gap: 4px; padding: 11px 14px; }
.vd2-item + .vd2-item { border-top: 1px solid var(--pop-border); }
.vd2-item-row { display: flex; align-items: center; gap: 12px; }
.vd2-item-name { flex: 1; color: var(--pop-ink); font-size: 12px; font-weight: 600; min-width: 0; }
.vd2-item-qty { color: var(--pop-muted); font-size: 12px; font-weight: 500; }
.vd2-item-total { color: var(--pop-ink); font-size: 12px; font-weight: 600; }
.vd2-item-profit { text-align: right; color: var(--pop-muted); font-size: 11px; font-weight: 500; }
.vd2-item-inst { color: var(--pop-muted); font-size: 11px; font-weight: 500; }

.vd2-profit-card { display: flex; flex-direction: column; gap: 10px; padding: 16px 14px; border-radius: 14px; border: 1px solid var(--pop-border); background: var(--pop-surface); }
.vd2-profit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vd2-profit-row span { color: var(--pop-muted); font-size: 13px; font-weight: 500; }
.vd2-profit-row b { color: var(--pop-ink); font-size: 16px; font-weight: 600; }
.vd2-profit-total { text-align: right; color: var(--pop-muted); font-size: 12px; font-weight: 500; }

.vd2-pay { text-align: right; color: var(--pop-muted); font-size: 12px; font-weight: 500; }

.dialog-action-spinner {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  display: inline-block;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: dialogActionSpin 680ms linear infinite;
}

.stats-modal-card.pos-dialog .stats-modal-primary.is-loading {
  cursor: wait;
  opacity: 0.88;
}

@keyframes dialogActionSpin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .stats-modal-card.pos-dialog.venda-detail-dialog {
    width: min(100%, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
  }

  .stats-modal-card.pos-dialog.venda-detail-dialog .stats-modal-body {
    padding-inline: 14px;
  }

  .vd2-summary {
    flex-wrap: wrap;
  }

  .vd2-total,
  .vd2-meta,
  .vd2-date,
  .vd2-seller {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .vd2-meta {
    align-items: flex-start;
    text-align: left;
  }

  .vd2-item-row {
    flex-wrap: wrap;
  }

  .vd2-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .dialog-action-spinner { animation-duration: 1.2s; }
  .vd2-act { transition: none; }
}

/* ===================== Pedidos (espelho de pedidos_page.dart) ===================== */
.pedidos-headerbar {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}

.pedidos-status-tabs {
  flex: 1 1 auto;
  margin-bottom: 0;
}

.pedidos-search {
  flex: 0 1 360px;
  width: 360px;
}

.pedidos-stats {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 12px;
}

.pedidos-row {
  min-height: 60px;
  cursor: pointer;
}

.pedidos-row .vendas-col .cv {
  margin-top: 0;
  font-weight: 400;
}

.pedidos-row .vendas-col .cl {
  margin-top: 4px;
}

.pedido-code {
  font-weight: 500 !important;
}

.pedido-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid;
  font-size: 10.5px;
  font-weight: 400;
  white-space: nowrap;
}

.pedido-status-badge.amber {
  color: #a66b00;
  background: rgba(255, 179, 64, 0.14);
  border-color: rgba(255, 179, 64, 0.30);
}

.pedido-status-badge.teal {
  color: #0f9189;
  background: rgba(45, 212, 191, 0.13);
  border-color: rgba(45, 212, 191, 0.30);
}

.pedido-status-badge.blue {
  color: var(--blue);
  background: rgba(var(--blue-rgb), 0.12);
  border-color: rgba(var(--blue-rgb), 0.24);
}

.pedido-status-badge.green {
  color: #13a065;
  background: rgba(19, 160, 101, 0.13);
  border-color: rgba(19, 160, 101, 0.30);
}

.pedido-status-badge.red {
  color: #ff3b30;
  background: rgba(255, 59, 48, 0.10);
  border-color: rgba(255, 59, 48, 0.24);
}

.pedidos-action-cell {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.pedido-action-duo {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.pedido-action-duo.full {
  width: 100%;
}

.pedido-action-duo.full .pedido-action-btn,
.pedido-action-duo.full .pedido-action-state {
  flex: 1 1 0;
}

.pedido-action-btn,
.pedido-action-state,
.pedido-deadline {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 300;
  white-space: nowrap;
}

.pedido-action-btn {
  border: 1px solid rgba(29, 29, 31, 0.10);
  cursor: pointer;
  transition: transform 150ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.pedido-action-btn:active {
  transform: scale(0.985);
}

.pedido-action-btn:disabled {
  opacity: 0.60;
  cursor: default;
}

.pedido-action-btn.solid {
  background: #1d1d1f;
  border-color: #1d1d1f;
  color: #ffffff;
}

.pedido-action-btn.dark {
  background: #ffffff;
  color: #1d1d1f;
}

.pedido-action-btn.green {
  min-width: 104px;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 12px;
  border-color: #1d1d1f;
  background: #1d1d1f;
  color: #ffffff;
  font-weight: 400;
  letter-spacing: 0;
  box-shadow: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    opacity 160ms ease;
}

.pedido-action-btn.green::before {
  content: none;
}

.pedido-action-btn.green:hover:not(:disabled) {
  border-color: #000000;
  background: #000000;
  color: #ffffff;
}

.pedido-action-btn.green:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), 0.22);
}

.pedido-action-btn.green:active:not(:disabled) {
  transform: scale(0.985);
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .pedido-action-btn.green {
    transition: none;
  }

  .pedido-action-btn.green:active:not(:disabled) { transform: none; }
}

.pedido-action-btn.full,
.pedido-action-state.full {
  width: 100%;
}

.pedido-action-state {
  border: 1px solid rgba(29, 29, 31, 0.08);
  background: rgba(29, 29, 31, 0.04);
  color: #3a3a3c;
}

.pedido-action-state i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}

.pedido-action-state.blue { color: var(--blue); }
.pedido-action-state.teal { color: #0f9189; }

.pedido-deadline {
  min-height: 32px;
  color: #a66b00;
  background: rgba(255, 179, 64, 0.12);
  border: 1px solid rgba(255, 179, 64, 0.24);
}

.pedido-deadline.late {
  color: #ff3b30;
  background: rgba(255, 59, 48, 0.10);
  border-color: rgba(255, 59, 48, 0.24);
}

.pedidos-empty {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #6e6e73;
  text-align: center;
  font-weight: 300;
}

.pedidos-empty .icon {
  width: 42px;
  height: 42px;
  color: rgba(110, 110, 115, 0.48);
}

.pedidos-empty strong {
  color: #1d1d1f;
  font-size: 16px;
  font-weight: 400;
}

.pedidos-empty span {
  font-size: 13px;
}

.stats-modal-card.pedidos-detail-dialog {
  width: min(860px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  padding: 0;
  border-radius: 24px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(30, 30, 30, 0.96);
  color: #ffffff;
  overflow: hidden;
}

.pedidos-detail-dialog .stats-modal-head {
  margin: 0;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pedidos-detail-dialog .stats-modal-head h3 {
  color: rgba(255, 255, 255, 0.92);
  font-size: 18px;
  font-weight: 300;
}

.pedidos-detail-dialog .stats-modal-close {
  color: rgba(255, 255, 255, 0.70);
}

.pedidos-detail-dialog .stats-modal-body {
  padding: 18px;
}

.pedido-detail {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pedido-detail-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.pedido-detail-title strong {
  display: block;
  color: rgba(255, 255, 255, 0.94);
  font-size: 18px;
  font-weight: 500;
}

.pedido-detail-title span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-weight: 300;
}

.pedido-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.pedido-detail-stats > div,
.pedido-detail-line,
.pedido-detail-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
}

.pedido-detail-stats > div {
  min-width: 0;
  padding: 12px;
}

.pedido-detail-stats .icon {
  width: 16px;
  height: 16px;
  color: rgba(255, 255, 255, 0.56);
}

.pedido-detail-stats span,
.pedido-detail-line span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.54);
  font-size: 11px;
  font-weight: 300;
}

.pedido-detail-stats b,
.pedido-detail-line b {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.90);
  font-size: 13px;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.pedido-detail-lines {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pedido-detail-line {
  padding: 11px 12px;
}

.pedido-detail-line span {
  margin-top: 0;
}

.pedido-detail-section h4 {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.90);
  font-size: 15px;
  font-weight: 400;
}

.pedido-detail-items {
  max-height: 280px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pedido-detail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.pedido-detail-item span,
.pedido-detail-item b {
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 400;
}

.pedido-detail-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pedido-detail-empty {
  padding: 24px 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.54);
  font-size: 13px;
  font-weight: 300;
}

.pedido-detail-actions {
  padding-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pedidos-detail-dialog .pedido-action-btn.solid {
  background: #ffffff;
  border-color: #ffffff;
  color: #1d1d1f;
}

.pedidos-detail-dialog .pedido-action-btn.dark {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.pedidos-detail-dialog .pedido-action-state {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.82);
}

html[data-theme="dark"] .pedido-status-badge.amber { color: #ffd166; background: rgba(255, 209, 102, 0.12); border-color: rgba(255, 209, 102, 0.24); }
html[data-theme="dark"] .pedido-status-badge.teal { color: #5eead4; background: rgba(45, 212, 191, 0.12); border-color: rgba(45, 212, 191, 0.24); }
html[data-theme="dark"] .pedido-status-badge.blue { color: #5ea8ff; background: rgba(41, 151, 255, 0.12); border-color: rgba(41, 151, 255, 0.24); }
html[data-theme="dark"] .pedido-status-badge.green { color: #4fe39a; background: rgba(79, 227, 154, 0.12); border-color: rgba(79, 227, 154, 0.26); }
html[data-theme="dark"] .pedido-status-badge.red { color: #ff6c6c; background: rgba(255, 108, 108, 0.12); border-color: rgba(255, 108, 108, 0.24); }
html[data-theme="dark"] .pedido-action-btn.solid { background: #ffffff; border-color: #ffffff; color: #111318; }
html[data-theme="dark"] .pedido-action-btn.dark { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.12); color: #f5f5f7; }
html[data-theme="dark"] .pedido-action-btn.green {
  border-color: rgba(255, 255, 255, 0.18);
  background: #090a0c;
  color: #ffffff;
  box-shadow: none;
}
html[data-theme="dark"] .pedido-action-state { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.10); color: #f5f5f7; }
html[data-theme="dark"] .pedido-action-state.blue { color: #5ea8ff; }
html[data-theme="dark"] .pedido-action-state.teal { color: #5eead4; }
html[data-theme="dark"] .pedido-deadline { color: #ffd166; background: rgba(255, 209, 102, 0.12); border-color: rgba(255, 209, 102, 0.24); }
html[data-theme="dark"] .pedido-deadline.late { color: #ff6c6c; background: rgba(255, 108, 108, 0.12); border-color: rgba(255, 108, 108, 0.24); }
html[data-theme="dark"] .pedidos-empty strong { color: #f5f5f7; }

@media (max-width: 980px) {
  [data-nav="crm"], [data-mobile-nav="crm"] {
    display: none !important;
  }

  .pedidos-headerbar {
    align-items: stretch;
    flex-direction: column-reverse;
    gap: 10px;
  }

  .pedidos-search {
    width: 100%;
    flex: 1 1 auto;
  }

  .pedidos-status-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .pedidos-status-tabs::-webkit-scrollbar {
    display: none;
  }

  .pedidos-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .pedidos-thead {
    display: none;
  }

  .pedidos-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "code status"
      "client client"
      "items payment"
      "total total"
      "action action";
    gap: 12px 10px;
    align-items: center;
    background: #f5f5f7;
    border-radius: 18px;
    padding: 16px;
    border: none;
    margin-bottom: 12px;
  }

  .pedidos-row .vendas-col {
    flex: initial !important;
  }

  .pedidos-row .vendas-col:nth-child(1) { grid-area: code; justify-self: start; }
  .pedidos-row .vendas-col:nth-child(2) { grid-area: client; justify-self: stretch; }
  .pedidos-row .vendas-col:nth-child(3) { grid-area: items; }
  .pedidos-row .vendas-col:nth-child(4) { grid-area: payment; }
  .pedidos-date-col { display: none !important; }
  .pedidos-row .vendas-col:nth-child(6) { grid-area: total; }
  .pedidos-row .vendas-col:nth-child(7) { grid-area: status; justify-self: end; }
  .pedidos-action-cell { grid-area: action; justify-self: stretch; }

  .pedidos-row .vendas-col:nth-child(3),
  .pedidos-row .vendas-col:nth-child(4),
  .pedidos-row .vendas-col:nth-child(6) {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start !important;
    text-align: left !important;
    width: 100%;
  }

  .pedidos-row .vendas-col:nth-child(6) {
    margin-top: -4px;
  }

  .pedidos-mobile-label {
    display: block !important;
    font-size: 11px;
    color: #6e6e73;
    margin-bottom: 4px;
    font-weight: 500;
  }

  html[data-theme="dark"] .pedidos-row {
    background: #1c1c1e;
  }

  html[data-theme="dark"] .pedidos-row .vendas-col:nth-child(3),
  html[data-theme="dark"] .pedidos-row .vendas-col:nth-child(4),
  html[data-theme="dark"] .pedidos-row .vendas-col:nth-child(6) {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.05);
  }

  .pedidos-action-cell {
    justify-content: stretch !important;
  }

  .pedido-action-duo,
  .pedido-action-btn,
  .pedido-action-state {
    width: 100%;
  }

  .pedido-detail-stats,
  .pedido-detail-lines {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pedidos-mobile-label { display: none; }
@media (max-width: 640px) {
  .pedido-detail-stats,
  .pedido-detail-lines {
    grid-template-columns: 1fr;
  }

  .pedido-action-duo {
    flex-direction: column;
  }

  .stats-modal-card.pedidos-detail-dialog {
    max-height: calc(100vh - 28px);
  }
}

/* Cadastro rápido de categoria, marca e fornecedor.
   É modal (com backdrop/blur), acompanha o tema ativo e possui um único campo. */
.stats-modal-card.pos-dialog.catalog-entity-dialog {
  width: min(400px, calc(100vw - 32px)) !important;
  background: var(--pop-surface) !important;
  color: var(--pop-ink) !important;
}

.stats-modal-card.pos-dialog.catalog-entity-dialog .stats-modal-head {
  background: var(--pop-surface);
  border-bottom-color: var(--pop-border);
}

.stats-modal-card.pos-dialog.catalog-entity-dialog .stats-modal-head h3 {
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.catalog-entity-dialog .stats-modal-body {
  padding: 16px;
  background: var(--pop-surface);
}

.catalog-entity-name-input {
  width: 100%;
  height: 52px;
  display: block;
  padding: 0 14px;
  border: 1px solid var(--pop-border);
  border-radius: 13px;
  outline: 0;
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
  font: 400 14px/1 var(--apple-font);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.catalog-entity-name-input::placeholder {
  color: var(--pop-muted);
  opacity: 1;
}

.catalog-entity-name-input:focus {
  border-color: var(--pop-accent);
  background: var(--pop-surface);
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), 0.11);
}

.stats-modal-card.pos-dialog.catalog-entity-dialog .stats-modal-foot {
  display: flex;
  padding: 12px 16px 14px;
  background: var(--pop-foot);
  border-top-color: var(--pop-border);
}

.stats-modal-card.pos-dialog.catalog-entity-dialog .stats-modal-foot > button {
  width: auto;
  flex: 1 1 0;
}

@media (max-width: 520px) {
  .stats-modal-card.pos-dialog.catalog-entity-dialog .stats-modal-body {
    padding: 13px;
  }

  .stats-modal-card.pos-dialog.catalog-entity-dialog .stats-modal-foot {
    padding: 10px 13px 12px;
  }
}


/* ===================== Contas a Pagar (espelho de contas_a_pagar_page.dart) ===================== */
.cp-maintabs { margin-bottom: 14px; }

.cp-statusrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cp-statuspill {
  height: 32px; padding: 0 14px; border-radius: 10px; border: 1px solid rgba(29, 29, 31, 0.10);
  background: #f5f5f7; color: #6e6e73; font: inherit; font-weight: 300; font-size: 12px; cursor: pointer;
}
.cp-statuspill.active { background: #ffffff; border-color: rgba(var(--blue-rgb), 0.36); color: #1d1d1f; box-shadow: inset 0 0 0 1px rgba(var(--blue-rgb), 0.16); }
.cp-tiny { border: 0; background: transparent; color: var(--blue); font: inherit; font-size: 12px; font-weight: 300; cursor: pointer; padding: 0 6px; }

.cp-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 16px; background: #f5f5f7; border: 1px solid rgba(29, 29, 31, 0.08); margin-bottom: 12px; }
.cp-sum-left { display: flex; flex-direction: column; }
.cp-sum-left span { color: #6e6e73; font-size: 11px; font-weight: 300; }
.cp-sum-left b { color: #1d1d1f; font-size: 18px; font-weight: 500; margin-top: 4px; }
.cp-sum-right { display: flex; align-items: center; gap: 12px; }
.cp-sum-hint { color: #8a8a8e; font-size: 12.5px; font-weight: 300; }
.cp-sum-sel { display: flex; flex-direction: column; align-items: flex-end; }
.cp-sum-sel span { color: #6e6e73; font-size: 11.5px; }
.cp-sum-sel b { color: #1d1d1f; font-size: 12.5px; font-weight: 400; }
.cp-pay-btn { height: 40px; }

#cp-list, #cr-list { overflow-x: auto; padding-bottom: 4px; }
.cp-thead { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: #f5f5f7; border: 1px solid rgba(29, 29, 31, 0.08); margin-bottom: 8px; min-width: 800px; }
.cp-thead > span { color: #6e6e73; font-size: 11px; font-weight: 400; }
.cp-rows { display: flex; flex-direction: column; gap: 8px; min-width: 800px; }
.cp-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: #f5f5f7; border: 1px solid rgba(29, 29, 31, 0.06); }

.cp-c-check { flex: 0 0 34px; display: flex; align-items: center; justify-content: center; }
.cp-c-acc { flex: 5; min-width: 0; display: flex; flex-direction: column; }
.cp-c-acc > b { color: #1d1d1f; font-size: 13px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-c-acc > small { color: #6e6e73; font-size: 11.5px; font-weight: 300; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.cp-c-num { flex: 3; text-align: right; color: #3a3a3c; font-size: 12px; font-weight: 300; white-space: nowrap; }
.cp-c-num.strong { color: #1d1d1f; font-weight: 400; }
.cp-c-mid { flex: 3; text-align: center; display: flex; align-items: center; justify-content: center; color: #3a3a3c; font-size: 12px; font-weight: 300; }
.cp-c-act { flex: 0 0 34px; display: flex; align-items: center; justify-content: center; }

.cp-check { width: 18px; height: 18px; accent-color: var(--blue); cursor: pointer; }
.cp-actbtn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: #6e6e73; cursor: pointer; border-radius: 8px; }
.cp-actbtn:hover { background: rgba(0, 0, 0, 0.05); }
.cp-actbtn .icon { width: 18px; height: 18px; }

.cp-badge { display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 999px; font-size: 11px; font-weight: 400; border: 1px solid; white-space: nowrap; }
.cp-badge.ok { color: #17a06a; background: rgba(51, 219, 150, 0.14); border-color: rgba(51, 219, 150, 0.30); }
.cp-badge.cancel { color: #e5484d; background: rgba(255, 126, 126, 0.14); border-color: rgba(255, 126, 126, 0.30); }
.cp-badge.warn { color: #b7791f; background: rgba(255, 179, 108, 0.16); border-color: rgba(255, 179, 108, 0.34); }

.cp-cat-name { flex-direction: row; align-items: center; gap: 10px; }
.cp-cat-name .icon { width: 20px; height: 20px; flex: 0 0 20px; }
.cp-cat-name .icon.cp-entry { color: #28cc8b; }
.cp-cat-name .icon.cp-exit { color: #ff6a6a; }
.cp-cat-name b { color: #1d1d1f; font-size: 13.5px; font-weight: 400; }

.cp-recurring { justify-content: space-between; }
.stats-modal-card.cp-new-dialog { width: min(960px, 100%); max-height: min(760px, calc(100vh - 48px)); }

/* Contas a pagar/receber > Novo: mantém os formulários financeiros
   centralizados com backdrop e usa o mesmo tema do popup Novo Cliente. */
.stats-modal-card.finance-new-dialog .stats-filter-field,
.stats-modal-card.finance-new-menu-dialog .stats-option-tile {
  min-height: 49px;
  margin-top: 0;
  padding: 0 12px;
  border: 1px solid var(--pop-border);
  border-radius: 13px;
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}

.stats-modal-card.finance-new-dialog .stats-filter-field:hover,
.stats-modal-card.finance-new-menu-dialog .stats-option-tile:hover {
  background: var(--pop-hover);
}

.stats-modal-card.finance-new-dialog .stats-filter-field > span:not(.icon),
.stats-modal-card.finance-new-menu-dialog .stats-option-tile > span:not(.icon) {
  color: var(--pop-ink);
  font-size: 13px;
  font-weight: 400;
}

.stats-modal-card.finance-new-dialog .stats-filter-field.empty > span:not(.icon) {
  color: var(--pop-muted);
}

.stats-modal-card.finance-new-dialog .stats-filter-field .icon,
.stats-modal-card.finance-new-menu-dialog .stats-option-tile .icon {
  color: var(--pop-accent);
}

.stats-modal-card.finance-new-menu-dialog .stats-option-list {
  gap: 8px;
}

.stats-modal-card.finance-new-dialog .cr-seg-btn {
  border-color: var(--pop-border);
  background: var(--pop-surface-alt);
  color: var(--pop-muted);
}

.stats-modal-card.finance-new-dialog .cr-seg-btn:hover {
  background: var(--pop-hover);
}

.stats-modal-card.finance-new-dialog .cr-seg-btn.active {
  border-color: var(--pop-accent);
  background: var(--pop-accent-soft);
  color: var(--pop-ink);
}

.stats-modal-card.finance-new-dialog.pos-dialog .stats-modal-danger.cp-inst-remove {
  border-color: var(--pop-danger-border);
  background: var(--pop-danger-bg);
  color: var(--pop-danger);
}

.stats-modal-card.finance-new-dialog.pos-dialog .stats-modal-danger.cp-inst-remove:hover {
  background: var(--pop-danger-bg);
  opacity: 0.85;
}
.cp-inst-block { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.cp-inst-row { display: flex; align-items: center; gap: 10px; }
.cp-inst-field { flex: 1; min-width: 0; flex-direction: column; align-items: stretch; justify-content: center; gap: 2px; min-height: 56px; }
.cp-inst-field span { font-size: 10.5px; }
.cp-inst-field input { width: 100%; }
.cp-inst-remove { width: 48px; flex: 0 0 48px; padding: 0; }
.stats-filter-field[data-add-inst] { justify-content: flex-start; }
.stats-filter-field[data-add-inst] span { display: inline-flex; align-items: center; gap: 8px; }
.stats-filter-field[data-add-inst] .icon { width: 16px; height: 16px; color: var(--blue); }
.cp-new-form { display: flex; flex-direction: column; gap: 10px; }
.cp-new-form .stats-filter-field,
.cp-new-form .stats-modal-field { margin-top: 0; }
.cp-new-textarea { align-items: flex-start; min-height: 90px; }
.cp-inst-block { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.cp-inst-head {
  display: flex; gap: 10px; padding: 10px 14px; border-radius: 12px;
  background: #f5f5f7; border: 1px solid rgba(29, 29, 31, 0.08);
}
.cp-inst-head span { flex: 1; color: #6e6e73; font-size: 11px; font-weight: 400; }
.cp-inst-head span:last-child { flex: 0 0 40px; }
.cp-inst-list { display: flex; flex-direction: column; gap: 8px; }
.cp-inst-row { display: flex; align-items: center; gap: 10px; }
.cp-inst-value, .cp-inst-due {
  flex: 1; min-width: 0; height: 48px; padding: 0 14px; border-radius: 12px;
  border: 1px solid rgba(29, 29, 31, 0.10); background: #f5f5f7; color: #1d1d1f;
  font: inherit; font-weight: 300; font-size: 14px;
}
.cp-inst-remove {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid rgba(255, 77, 77, 0.30); background: rgba(255, 77, 77, 0.10); color: #ff3b30;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.cp-inst-remove:disabled { opacity: 0.35; cursor: not-allowed; }
.cp-inst-remove .icon { width: 16px; height: 16px; }
.cp-add-inst {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; margin-top: 10px;
  border-radius: 12px; border: 1px solid rgba(29, 29, 31, 0.10); background: #f5f5f7; color: #1d1d1f;
  font: inherit; font-weight: 400; font-size: 13px; cursor: pointer;
}
.cp-add-inst .icon { width: 16px; height: 16px; color: var(--blue); }


/* especificidade maior que ".stats-filter-field > span:not(.icon)" (que forcava flex:1 e esticava o toggle) */
.stats-filter-field.cp-recurring > .cp-recdot { flex: 0 0 40px; width: 40px; }
.cp-recdot { width: 40px; height: 24px; flex: 0 0 40px; border-radius: 999px; background: rgba(120, 120, 128, 0.24); position: relative; transition: background 160ms ease; }
.cp-recdot::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1); }
.cp-recdot.on { background: #13a065; }
.cp-recdot.on::after { transform: translateX(16px); }

.cp-entryexit { display: flex; gap: 10px; margin-top: 10px; }
.cp-entryexit + .stats-filter-field { margin-top: 10px; }
.cp-entryexit-btn {
  flex: 1; height: 36px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.11); background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.78); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.cp-entryexit-btn.entry.active { background: rgba(51, 219, 150, 0.14); border-color: rgba(51, 219, 150, 0.30); color: #33db96; }
.cp-entryexit-btn.exit.active { background: rgba(255, 126, 126, 0.14); border-color: rgba(255, 126, 126, 0.30); color: #ff7e7e; }

/* Tema escuro */
html[data-theme="dark"] .cp-statuspill { background: #0e1015; border-color: rgba(255, 255, 255, 0.10); color: #a4a7ae; }
html[data-theme="dark"] .cp-statuspill.active { background: #2a2d35; border-color: rgba(255, 255, 255, 0.18); color: #f5f5f7; box-shadow: none; }
html[data-theme="dark"] .cp-summary,
html[data-theme="dark"] .cp-thead,
html[data-theme="dark"] .cp-row { background: #0e1015; border-color: rgba(255, 255, 255, 0.10); }
html[data-theme="dark"] .cp-sum-left b,
html[data-theme="dark"] .cp-c-acc > b,
html[data-theme="dark"] .cp-c-num.strong,
html[data-theme="dark"] .cp-sum-sel b,
html[data-theme="dark"] .cp-cat-name b { color: #f5f5f7; }
html[data-theme="dark"] .cp-sum-left span,
html[data-theme="dark"] .cp-thead > span,
html[data-theme="dark"] .cp-c-acc > small,
html[data-theme="dark"] .cp-c-num,
html[data-theme="dark"] .cp-c-mid,
html[data-theme="dark"] .cp-sum-hint,
html[data-theme="dark"] .cp-sum-sel span,
html[data-theme="dark"] .cp-actbtn { color: #a4a7ae; }
html[data-theme="dark"] .cp-actbtn:hover { background: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .cp-badge.ok { color: #4fe39a; background: rgba(51, 219, 150, 0.12); border-color: rgba(51, 219, 150, 0.28); }
html[data-theme="dark"] .cp-badge.cancel { color: #ff8a8a; background: rgba(255, 126, 126, 0.12); border-color: rgba(255, 126, 126, 0.26); }
html[data-theme="dark"] .cp-badge.warn { color: #ffc487; background: rgba(255, 179, 108, 0.12); border-color: rgba(255, 179, 108, 0.28); }


/* ===================== Ordem de Serviço ===================== */
/* réplica de lib/pages/ordem_servico_page.dart (desktop) */
.os-page > .os-panel { margin-top: 14px; }
.os-toolbar { margin-bottom: 12px; }

.os-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 12px; }
.os-stat { padding: 12px 14px; border-radius: 18px; background: #f5f5f7; border: 1px solid rgba(29, 29, 31, 0.08); display: flex; flex-direction: column; }
.os-stat span { color: #6e6e73; font-size: 11px; font-weight: 400; }
.os-stat b { color: #1d1d1f; font-size: 18px; font-weight: 500; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.os-scroll { overflow-x: auto; }
.os-table { display: flex; flex-direction: column; min-width: 940px; }
.os-table.os-table-svc { min-width: 0; }

.os-thead { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: #f5f5f7; border: 1px solid rgba(29, 29, 31, 0.08); margin-bottom: 8px; }
.os-thead .os-c { color: #6e6e73; font-size: 11px; font-weight: 500; }
.os-rows { display: flex; flex-direction: column; gap: 10px; }
.os-row { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 14px; background: #f5f5f7; border: 1px solid rgba(29, 29, 31, 0.06); }
.os-row.clickable-row { cursor: pointer; transition: background .12s, border-color .12s; }
.os-row.clickable-row:hover { border-color: rgba(0, 122, 255, 0.4); }
.os-row.canceled { background: rgba(255, 77, 77, 0.10); border-color: rgba(255, 77, 77, 0.35); }
.os-row.draft { background: rgba(255, 149, 0, 0.18); border-color: rgba(255, 149, 0, 0.52); }
.os-row.draft.clickable-row:hover { background: rgba(255, 149, 0, 0.24); border-color: rgba(255, 149, 0, 0.68); }
/* Última O.S. mexida: azul do sistema, forte o bastante para achar de longe. */
.os-row.os-last-touched,
.os-row.draft.os-last-touched,
.os-row.canceled.os-last-touched { background: rgba(0, 113, 227, 0.12); border-color: rgba(0, 113, 227, 0.55); }
.os-row.os-last-touched.clickable-row:hover,
.os-row.draft.os-last-touched.clickable-row:hover { background: rgba(0, 113, 227, 0.18); border-color: rgba(0, 113, 227, 0.72); }
.os-row .os-c { color: #1d1d1f; font-size: 11.5px; font-weight: 400; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-th-center { text-align: center; justify-content: center; }

.os-c-code { flex: 8; } .os-c-cust { flex: 22; } .os-c-tech { flex: 17; } .os-c-model { flex: 12; }
.os-c-serial { flex: 11; } .os-c-open { flex: 12; } .os-c-due { flex: 12; }
.os-c-value { flex: 10; text-align: right; font-weight: 600; }
.os-c-value.bad { color: #e5484d; }
.os-c-status { flex: 13; display: flex; align-items: center; justify-content: center; }
.os-c-flags { flex: 0 0 92px; display: flex; align-items: center; justify-content: center; gap: 3px; }
.os-c-menu { flex: 0 0 40px; display: flex; align-items: center; justify-content: center; }
.os-row .os-c-menu { overflow: visible; }

.os-flag { display: inline-flex; align-items: center; gap: 1px; }
.os-flag .icon { width: 15px; height: 15px; color: #8a8a8e; }
.os-flag .icon.os-ok { color: #17a06a; }
.os-flag .icon.os-no { color: #e5484d; }

.os-menu-btn { width: 30px; height: 30px; border: 0; background: transparent; color: #6e6e73; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.os-menu-btn:hover { background: rgba(0, 0, 0, 0.05); }
.os-menu-btn .icon { width: 18px; height: 18px; }

.os-pill { display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 999px; font-size: 11px; font-weight: 500; border: 1px solid; white-space: nowrap; }
.os-pill.positive { color: #17a06a; background: rgba(51, 219, 150, 0.14); border-color: rgba(51, 219, 150, 0.30); }
.os-pill.danger { color: #e5484d; background: rgba(255, 126, 126, 0.14); border-color: rgba(255, 126, 126, 0.30); }
.os-pill.warn { color: #b7791f; background: rgba(255, 179, 108, 0.16); border-color: rgba(255, 179, 108, 0.34); }
.os-pill.draft { color: #c46800; background: rgba(255, 149, 0, 0.16); border-color: rgba(255, 149, 0, 0.38); }

/* Aba serviços — tabela mais estreita */
.os-svc-chips { margin-bottom: 12px; }
.os-c-svc { flex: 8; } .os-c-price { flex: 2; text-align: right; font-weight: 600 !important; }
.os-c-svcstatus { flex: 2; display: flex; align-items: center; justify-content: center; }
.os-c-chev { flex: 0 0 32px; display: flex; align-items: center; justify-content: center; color: #8a8a8e; }
.os-c-chev .icon { width: 18px; height: 18px; }
.os-svc-row { cursor: pointer; transition: background 140ms ease; }
.os-svc-row:hover { background: #ececf0; }

/* Diálogos de OS — o acabamento do card vem do tema novo (.pos-dialog);
   estas regras são só a estrutura. As cores estão no bloco
   "Ordem de Serviço — pop-ups no tema novo", no fim do arquivo. */
.stats-option-tile:disabled { opacity: 0.4; cursor: not-allowed; }
.stats-option-tile.is-loading:disabled {
  opacity: 1;
  cursor: wait;
  pointer-events: none;
}
.os-note { color: rgba(255, 255, 255, 0.7); font-size: 13.5px; line-height: 1.5; font-weight: 300; padding: 4px 6px 6px; }
.os-events { display: flex; flex-direction: column; gap: 8px; }
.os-event {
  display: flex; flex-direction: column; padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12);
}
.os-event b { color: rgba(255, 255, 255, 0.92); font-size: 13px; font-weight: 400; }
.os-event span { color: rgba(255, 255, 255, 0.6); font-size: 11.5px; margin-top: 2px; }

/* Tema escuro (tabela e cards da página) */
html[data-theme="dark"] .os-stat,
html[data-theme="dark"] .os-thead,
html[data-theme="dark"] .os-row { background: #0e1015; border-color: rgba(255, 255, 255, 0.10); }
html[data-theme="dark"] .os-row.clickable-row:hover { border-color: rgba(10, 132, 255, 0.6); }
html[data-theme="dark"] .os-stat b,
html[data-theme="dark"] .os-row .os-c { color: #f5f5f7; }
html[data-theme="dark"] .os-stat span,
html[data-theme="dark"] .os-thead .os-c { color: #a4a7ae; }
html[data-theme="dark"] .os-row.canceled { background: rgba(255, 77, 77, 0.12); border-color: rgba(255, 77, 77, 0.40); }
html[data-theme="dark"] .os-row.draft { background: rgba(255, 149, 0, 0.18); border-color: rgba(255, 179, 64, 0.48); }
html[data-theme="dark"] .os-row.draft.clickable-row:hover { background: rgba(255, 149, 0, 0.24); border-color: rgba(255, 179, 64, 0.68); }
html[data-theme="dark"] .os-row.os-last-touched,
html[data-theme="dark"] .os-row.draft.os-last-touched,
html[data-theme="dark"] .os-row.canceled.os-last-touched { background: rgba(10, 132, 255, 0.20); border-color: rgba(94, 168, 255, 0.62); }
html[data-theme="dark"] .os-row.os-last-touched.clickable-row:hover,
html[data-theme="dark"] .os-row.draft.os-last-touched.clickable-row:hover { background: rgba(10, 132, 255, 0.27); border-color: rgba(94, 168, 255, 0.80); }
html[data-theme="dark"] .os-pill.draft { color: #ffb340; background: rgba(255, 149, 0, 0.16); border-color: rgba(255, 179, 64, 0.38); }
html[data-theme="dark"] .os-svc-row:hover { background: #181b22; }
html[data-theme="dark"] .os-menu-btn:hover { background: rgba(255, 255, 255, 0.08); }

@media (max-width: 640px) {
  .os-stats { grid-template-columns: 1fr; }
}


/* ===================== Contas a Receber ===================== */
.cr-summary { display: flex; gap: 26px; padding: 12px 16px; border-radius: 18px; background: #f5f5f7; border: 1px solid rgba(29, 29, 31, 0.08); margin-bottom: 12px; flex-wrap: wrap; }
.cr-metric { display: flex; flex-direction: column; }
.cr-metric span { color: #6e6e73; font-size: 11px; font-weight: 300; }
.cr-metric b { color: #1d1d1f; font-size: 17px; font-weight: 500; margin-top: 4px; }

.cr-thead .h-cli { flex: 8; }
.cr-thead .h-num { flex: 3; text-align: right; }
.cr-thead .h-due { flex: 2.4; text-align: center; }
.cr-thead .h-status { flex: 3; text-align: center; }
.cr-thead .h-act { flex: 0 0 34px; }

.cr-c-cli { flex: 8; min-width: 0; display: flex; flex-direction: column; }
.cr-c-cli > b { color: #1d1d1f; font-size: 13px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-c-cli > small { color: #6e6e73; font-size: 11.5px; font-weight: 300; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.cr-c-num { flex: 3; text-align: right; color: #3a3a3c; font-size: 12px; font-weight: 300; white-space: nowrap; }
.cr-c-num.strong { color: #1d1d1f; font-weight: 400; }
/* Vencimento: a data que faz a listagem servir de fila de cobrança. Vermelho
   quando já venceu — é o mesmo sinal que já pinta a coluna "Valor Vencido". */
.cr-c-due { flex: 2.4; text-align: center; color: #3a3a3c; font-size: 12px; font-weight: 300; white-space: nowrap; }
.cr-c-due.overdue { color: #d70015; font-weight: 400; }
.cr-c-status { flex: 3; display: flex; align-items: center; justify-content: center; }

.cp-badge.credit { color: var(--blue); background: rgba(var(--blue-rgb), 0.10); border-color: rgba(var(--blue-rgb), 0.24); }

.cr-seg { display: flex; gap: 8px; }
.cr-seg-btn {
  flex: 0 0 auto; height: 36px; padding: 0 16px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.11); background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.78); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.cr-seg-btn.active { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.30); color: #ffffff; }
.cr-3col { display: flex; gap: 10px; }
.cr-3col .stats-modal-field { flex: 1; min-width: 0; }
.cr-3col .stats-modal-field input { text-align: right; }
.cr-val-field input { text-align: right; }

html[data-theme="dark"] .cr-summary { background: #0e1015; border-color: rgba(255, 255, 255, 0.10); }
html[data-theme="dark"] .cr-metric span,
html[data-theme="dark"] .cr-c-cli > small,
html[data-theme="dark"] .cr-c-due,
html[data-theme="dark"] .cr-c-num,
html[data-theme="dark"] .cr-thead > span { color: #a4a7ae; }
html[data-theme="dark"] .cr-metric b,
html[data-theme="dark"] .cr-c-cli > b,
html[data-theme="dark"] .cr-c-num.strong { color: #f5f5f7; }
html[data-theme="dark"] .cr-c-due.overdue { color: #ff8a8a; }
html[data-theme="dark"] .cp-badge.credit { color: #5ea8ff; background: rgba(94, 168, 255, 0.12); border-color: rgba(94, 168, 255, 0.26); }


/* ===================== Popup de contas do cliente ===================== */
.stats-modal-card.cr-cust-dialog { width: min(1120px, 100%); max-height: min(680px, calc(100vh - 48px)); }
.cr-cust-dialog .stats-modal-body { display: block; }

.cr-cust-tabs { display: flex; gap: 18px; border-bottom: 1px solid rgba(29, 29, 31, 0.10); margin-bottom: 14px; }
.cr-cust-tab { border: 0; background: transparent; padding: 8px 2px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: #6e6e73; font: inherit; font-weight: 400; font-size: 14px; cursor: pointer; }
.cr-cust-tab.active { color: #f5f5f7; border-bottom-color: #f5f5f7; }
.cr-cust-tabs { border-bottom-color: rgba(255, 255, 255, 0.12); }
.cr-cust-tab { color: #a4a7ae; }

.cr-cust-summary { display: flex; flex-wrap: wrap; gap: 24px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.10); margin-bottom: 10px; }
.cr-cust-summary .cr-metric span { color: #a4a7ae; }
.cr-cust-summary .cr-metric b { color: #f5f5f7; }
.cr-cust-name { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.10); color: #c9ccd2; font-weight: 500; font-size: 13.5px; margin-bottom: 10px; }

.cr-cust-receive { padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.10); margin-bottom: 10px; }
.cr-cust-receive-row { display: flex; gap: 8px; }
.cr-cust-value { flex: 1; display: flex; align-items: center; padding: 0 12px; height: 40px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); color: #f5f5f7; font-size: 12.5px; font-weight: 500; }
.cr-pay-input { flex: 1; background: transparent; border: none; outline: none; color: #5ea8ff; font: inherit; font-weight: 700; font-size: 13.5px; width: 100%; min-width: 60px; }
.cr-pay-input::placeholder { color: rgba(255, 255, 255, 0.35); }
.cr-cust-receber { flex: 0 0 140px; height: 40px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.12); color: #f5f5f7; font: inherit; font-weight: 500; cursor: pointer; }
.cr-cust-receber:hover { background: rgba(255, 255, 255, 0.18); }
.cr-cust-actbtns { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.cr-cust-actbtns button { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.07); color: #f5f5f7; font: inherit; font-weight: 500; font-size: 12px; cursor: pointer; }
.cr-cust-actbtns button:hover { background: rgba(255, 255, 255, 0.12); }
.cr-cust-actbtns .icon { width: 14px; height: 14px; color: #5ea8ff; }

.cr-cust-thead { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); }
.cr-cust-thead > span { color: #c9ccd2; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.cr-cust-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 300px; overflow: auto; }
.cr-cust-row { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.10); }
.cr-cust-row:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.16); }
.cr-cust-thead .c-chk, .cr-cust-row .c-chk { flex: 0 0 34px; display: flex; justify-content: center; }
.cr-cust-thead .c-conta, .cr-cust-row .c-conta { flex: 4; min-width: 0; display: flex; flex-direction: column; }
.cr-cust-row .c-conta > b { color: #f5f5f7; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-cust-row .c-conta > small { color: #a4a7ae; font-size: 10.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-cust-thead .c-num, .cr-cust-row .c-num { flex: 3; text-align: right; color: #e2e4e8; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.cr-cust-thead .c-mid, .cr-cust-row .c-mid { flex: 2; display: flex; align-items: center; justify-content: center; text-align: center; color: #e2e4e8; font-size: 12px; }
.cr-cust-thead .c-act, .cr-cust-row .c-act { flex: 0 0 30px; display: flex; justify-content: center; }
.cr-cust-row .cp-actbtn { color: #c9ccd2; }
.cr-cust-row .cp-actbtn:hover { background: rgba(255, 255, 255, 0.10); }

.cr-row { cursor: pointer; }
.cr-cust-dialog .stats-modal-foot .stats-modal-secondary { background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.20); color: #ffffff; font-weight: 500; opacity: 1; }
.cr-cust-dialog .stats-modal-foot .stats-modal-secondary:hover { background: rgba(255, 255, 255, 0.20); }

.prod-status-pill {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 300;
  white-space: nowrap;
}

.prod-status-pill.ok { background: rgba(19, 160, 101, 0.12); color: #13a065; border: 1px solid rgba(19, 160, 101, 0.22); }
.prod-status-pill.off { background: rgba(255, 59, 48, 0.10); color: #ff3b30; border: 1px solid rgba(255, 59, 48, 0.20); }

.prod-icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 11px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #f5f5f7;
  color: var(--blue);
  cursor: pointer;
}

.prod-icon-btn .icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}
.prod-icon-btn .icon svg {
  display: block;
}
.prod-icon-btn.danger { color: #ff3b30; }

.prod-row-actions {
  display: inline-flex;
  justify-content: flex-end;
  gap: 6px;
}

/* Grid de produtos */

/* Transição grade <-> lista (botão "Lista/Grade") */
@keyframes prodSwapOut { to { opacity: 0; transform: translateY(6px) scale(0.99); } }
@keyframes prodItemIn { from { opacity: 0; transform: translateY(12px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes prodChipSpin { from { opacity: 0; transform: rotate(-120deg) scale(0.5); } to { opacity: 1; transform: none; } }

.prod-swap-out { animation: prodSwapOut 0.15s ease forwards; }
.prod-swap-in > * { animation: prodItemIn 0.34s cubic-bezier(0.22, 0.61, 0.36, 1) backwards; }
.prod-swap-in > *:nth-child(1) { animation-delay: 0s; }
.prod-swap-in > *:nth-child(2) { animation-delay: 0.03s; }
.prod-swap-in > *:nth-child(3) { animation-delay: 0.06s; }
.prod-swap-in > *:nth-child(4) { animation-delay: 0.09s; }
.prod-swap-in > *:nth-child(5) { animation-delay: 0.12s; }
.prod-swap-in > *:nth-child(6) { animation-delay: 0.15s; }
.prod-swap-in > *:nth-child(7) { animation-delay: 0.18s; }
.prod-swap-in > *:nth-child(8) { animation-delay: 0.21s; }
.prod-swap-in > *:nth-child(n+9) { animation-delay: 0.24s; }

.prod-btn-chip.prod-chip-swap .icon { animation: prodChipSpin 0.32s cubic-bezier(0.22, 0.61, 0.36, 1); }

/* Troca de aba (genérico, usado em Produtos, Vendas, OS, Contas, Notas, Estatísticas).
   Slide direcional do conteúdo abaixo das abas:
   botão à esquerda -> entra pela direita; botão à direita -> entra pela esquerda. */
@keyframes tabSlideFromRight { from { opacity: 0; transform: translateX(38px); } to { opacity: 1; transform: translateX(0); } }
@keyframes tabSlideFromLeft  { from { opacity: 0; transform: translateX(-38px); } to { opacity: 1; transform: translateX(0); } }
.tab-slide-left,
.tab-slide-right { overflow-x: clip; }
.tab-slide-left  { animation: tabSlideFromRight 0.32s cubic-bezier(0.22, 1, 0.36, 1) both; }
.tab-slide-right { animation: tabSlideFromLeft 0.32s cubic-bezier(0.22, 1, 0.36, 1) both; }
/* durante o slide do container, não animar cada filho (evita animação dupla) */
.tab-slide-left > *,
.tab-slide-right > * { animation: none; }

/* Produtos e Estatísticas já animam o contêiner inteiro na troca de subaba.
   Manter também o statsContentIn nos filhos faz os cards voltarem a opacity:0
   quando a classe do slide é removida, produzindo uma segunda piscada. */
.prod-body > *,
.stats-project-control .stats-body > * { animation: none; }

/* Hero (card preto): o nome/descrição atual some e o novo aparece. */
@keyframes tabSwapOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-7px); } }
@keyframes tabSwapIn  { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
.tab-swap-out { animation: tabSwapOut 0.15s ease forwards; }
.tab-swap-in  { animation: tabSwapIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* Troca de página pela barra lateral: transição de duas camadas (scroll
   contínuo) feita via JS (Web Animations) em beginNavSlide() no app.
   A página que sai desliza inteira para fora enquanto a nova entra colada,
   na mesma direção. A camada da página que sai usa .nav-anim-old. */
.nav-anim-old { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  .prod-swap-out,
  .prod-swap-in > *,
  .prod-btn-chip.prod-chip-swap .icon,
  .tab-slide-left,
  .tab-slide-right,
  .tab-swap-out,
  .tab-swap-in { animation: none !important; }
}

/* ---------- Eventos fiscais: diálogos centrais, legíveis e orientados à tarefa ---------- */
.stats-modal-card.pos-dialog.notas-fiscal-event-dialog {
  width: min(640px, calc(100vw - 48px));
  max-height: min(780px, calc(100dvh - 48px));
  --notas-event-blue: #0071e3;
  --notas-event-blue-soft: rgba(0, 113, 227, 0.08);
  --notas-event-red: #d70015;
  --notas-event-red-soft: rgba(215, 0, 21, 0.07);
}

.stats-modal-card.pos-dialog.notas-fiscal-event-dialog.notas-events-dialog {
  width: min(760px, calc(100vw - 48px));
}

.stats-modal-card.pos-dialog.notas-fiscal-event-dialog .stats-modal-head {
  min-height: 66px;
  padding: 0 18px 0 24px;
}

.stats-modal-card.pos-dialog.notas-fiscal-event-dialog .stats-modal-head h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.18px;
}

.stats-modal-card.pos-dialog.notas-fiscal-event-dialog .stats-modal-close {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  border-radius: 10px;
}

.stats-modal-card.pos-dialog.notas-fiscal-event-dialog .stats-modal-body {
  padding: 22px 24px 24px;
}

.stats-modal-card.pos-dialog.notas-fiscal-event-dialog .stats-modal-foot {
  padding: 14px 24px 18px;
  justify-content: flex-end;
  gap: 10px;
}

.stats-modal-card.pos-dialog.notas-fiscal-event-dialog .stats-modal-foot > button {
  width: auto;
  min-width: 132px;
  padding: 0 18px;
}

.stats-modal-card.pos-dialog.notas-fiscal-event-dialog .stats-modal-foot > .stats-modal-primary {
  min-width: 190px;
}

.notas-event-intro {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(0, 113, 227, 0.13);
  border-radius: 16px;
  background: var(--notas-event-blue-soft);
}

.notas-event-intro.is-danger {
  border-color: rgba(215, 0, 21, 0.14);
  background: var(--notas-event-red-soft);
}

.notas-event-intro-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: #ffffff;
  color: var(--notas-event-blue);
  box-shadow: inset 0 0 0 1px rgba(0, 113, 227, 0.11), 0 5px 14px rgba(0, 0, 0, 0.05);
}

.notas-event-intro.is-danger .notas-event-intro-icon {
  color: var(--notas-event-red);
  box-shadow: inset 0 0 0 1px rgba(215, 0, 21, 0.12), 0 5px 14px rgba(0, 0, 0, 0.05);
}

.notas-event-intro-icon .icon {
  width: 21px;
  height: 21px;
}

.notas-event-intro strong {
  display: block;
  margin: 1px 0 4px;
  color: var(--pop-ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}

.notas-event-intro p {
  margin: 0;
  color: var(--pop-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.48;
}

.notas-event-rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.notas-event-rules > span {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid var(--pop-border);
  border-radius: 12px;
  background: var(--pop-surface-alt);
  color: var(--pop-muted);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.25;
}

.notas-event-rules .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: var(--notas-event-red);
}

.notas-event-text-field {
  position: relative;
  display: block;
  margin-top: 18px;
}

.notas-event-text-field > span {
  display: block;
  color: var(--pop-ink);
  font-size: 13px;
  font-weight: 600;
}

.notas-event-text-field > small {
  display: block;
  margin-top: 3px;
  color: var(--pop-muted);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.35;
}

.notas-event-text-field textarea {
  width: 100%;
  min-height: 138px;
  margin-top: 10px;
  padding: 14px 15px 34px;
  resize: vertical;
  border: 1px solid var(--pop-border);
  border-radius: 14px;
  outline: none;
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
  font: 400 13px/1.5 var(--apple-font);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.notas-cancel-dialog .notas-event-text-field textarea {
  min-height: 112px;
}

.notas-event-text-field textarea::placeholder {
  color: var(--pop-muted);
}

.notas-event-text-field textarea:focus {
  border-color: var(--notas-event-blue);
  background: var(--pop-surface);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.10);
}

.notas-cancel-dialog .notas-event-text-field textarea:focus {
  border-color: var(--notas-event-red);
  box-shadow: 0 0 0 3px rgba(215, 0, 21, 0.09);
}

.notas-event-text-field output {
  position: absolute;
  right: 12px;
  bottom: 11px;
  padding: 2px 5px;
  border-radius: 6px;
  background: var(--pop-surface-alt);
  color: var(--pop-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.notas-cancel-document {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 5px 9px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--pop-border);
  border-radius: 14px;
  background: var(--pop-surface-alt);
}

.notas-cancel-document span {
  color: var(--pop-muted);
  font-size: 10.5px;
  font-weight: 500;
}

.notas-cancel-document strong {
  min-width: 0;
  overflow: hidden;
  color: var(--pop-ink);
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-modal-card.pos-dialog.notas-fiscal-event-dialog .stats-modal-primary.notas-event-danger-button {
  border-color: var(--notas-event-red);
  background: var(--notas-event-red);
  color: #ffffff;
}

.stats-modal-card.pos-dialog.notas-fiscal-event-dialog .stats-modal-primary.notas-event-danger-button:hover {
  background: #bd0012;
  opacity: 1;
}

.notas-event-summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 13px 14px;
  border: 1px solid var(--pop-border);
  border-radius: 15px;
  background: var(--pop-surface-alt);
}

.notas-event-summary > span {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: var(--pop-surface);
  color: var(--notas-event-blue);
  box-shadow: inset 0 0 0 1px var(--pop-border);
}

.notas-event-summary > span .icon {
  width: 19px;
  height: 19px;
}

.notas-event-summary div {
  min-width: 0;
}

.notas-event-summary strong,
.notas-event-summary small {
  display: block;
}

.notas-event-summary strong {
  color: var(--pop-ink);
  font-size: 13px;
  font-weight: 600;
}

.notas-event-summary small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--pop-muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notas-event-summary > b {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--notas-event-blue-soft);
  color: var(--notas-event-blue);
  font-size: 10.5px;
  font-weight: 600;
}

.notas-event-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notas-event-timeline::before {
  content: '';
  position: absolute;
  z-index: 0;
  top: 24px;
  bottom: 24px;
  left: 20px;
  width: 1px;
  background: var(--pop-border);
}

.notas-event-entry {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--pop-border);
  border-radius: 15px;
  background: var(--pop-surface);
}

.notas-event-entry-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: 13px;
  background: var(--notas-event-blue-soft);
  color: var(--notas-event-blue);
}

.notas-event-entry.is-danger .notas-event-entry-icon {
  border-color: rgba(215, 0, 21, 0.15);
  background: var(--notas-event-red-soft);
  color: var(--notas-event-red);
}

.notas-event-entry-icon .icon {
  width: 18px;
  height: 18px;
}

.notas-event-entry-main {
  min-width: 0;
  padding-top: 1px;
}

.notas-event-entry-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notas-event-entry-title strong {
  color: var(--pop-ink);
  font-size: 13px;
  font-weight: 600;
}

.notas-event-entry-title span {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--pop-surface-alt);
  color: var(--pop-muted);
  font-size: 9.5px;
  font-weight: 600;
}

.notas-event-entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 6px;
}

.notas-event-entry-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--pop-muted);
  font-size: 10.5px;
}

.notas-event-entry-meta .icon {
  width: 12px;
  height: 12px;
}

.notas-event-entry p,
.notas-event-entry blockquote {
  margin: 8px 0 0;
  color: var(--pop-muted);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.45;
}

.notas-event-entry blockquote {
  padding: 8px 10px;
  border-left: 2px solid var(--notas-event-blue);
  border-radius: 0 9px 9px 0;
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}

.notas-event-download {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--pop-border);
  border-radius: 10px;
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
  font: 500 10.5px var(--apple-font);
  cursor: pointer;
}

.notas-event-download:hover {
  background: var(--pop-hover);
}

.notas-event-download .icon {
  width: 14px;
  height: 14px;
  color: var(--notas-event-blue);
}

.notas-event-empty {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
}

.notas-event-empty .icon {
  width: 30px;
  height: 30px;
  margin-bottom: 12px;
  color: var(--notas-event-blue);
}

.notas-event-empty strong {
  color: var(--pop-ink);
  font-size: 14px;
  font-weight: 600;
}

.notas-event-empty span {
  max-width: 380px;
  margin-top: 6px;
  color: var(--pop-muted);
  font-size: 12px;
  line-height: 1.45;
}

html[data-theme="dark"] .stats-modal-card.pos-dialog.notas-fiscal-event-dialog {
  --notas-event-blue: #5ea8ff;
  --notas-event-blue-soft: rgba(94, 168, 255, 0.11);
  --notas-event-red: #ff6961;
  --notas-event-red-soft: rgba(255, 105, 97, 0.10);
}

html[data-theme="dark"] .notas-event-intro-icon {
  background: #111318;
  box-shadow: inset 0 0 0 1px #343740;
}

@media (max-width: 680px) {
  .stats-modal-card.pos-dialog.notas-fiscal-event-dialog,
  .stats-modal-card.pos-dialog.notas-fiscal-event-dialog.notas-events-dialog {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(var(--app-height) - 20px);
    border-radius: 18px;
  }

  .stats-modal-card.pos-dialog.notas-fiscal-event-dialog .stats-modal-head {
    min-height: 58px;
    padding: 0 13px 0 18px;
  }

  .stats-modal-card.pos-dialog.notas-fiscal-event-dialog .stats-modal-body {
    padding: 16px;
  }

  .stats-modal-card.pos-dialog.notas-fiscal-event-dialog .stats-modal-foot {
    padding: 12px 16px 16px;
  }

  .stats-modal-card.pos-dialog.notas-fiscal-event-dialog .stats-modal-foot > button,
  .stats-modal-card.pos-dialog.notas-fiscal-event-dialog .stats-modal-foot > .stats-modal-primary {
    min-width: 0;
    flex: 1 1 0;
    padding: 0 10px;
  }

  .notas-event-rules {
    grid-template-columns: 1fr;
  }

  .notas-cancel-document {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .notas-event-entry {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .notas-event-entry-icon {
    width: 38px;
    height: 38px;
  }

  .notas-event-download {
    grid-column: 2;
    justify-self: start;
    margin-top: 2px;
  }
}

.prod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.prod-card {
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  background: #f5f5f7;
  border: 1px solid rgba(29, 29, 31, 0.10);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.06);
}

/* Virtualiza os produtos fora da rolagem. `auto` preserva acessibilidade e
   dimensões, mas permite ao Chrome pular layout/pintura do conteúdo distante. */
.prod-page .prod-grid > .prod-motion-item {
  content-visibility: auto;
  contain-intrinsic-size: auto 270px;
}

/* Durante a mudança de largura da sidebar, somente a faixa visível continua
   animando. Os itens já classificados como fora do viewport conservam seu
   espaço na grade, mas não pintam nem executam transições. */
.sidebar.is-sidebar-resizing + .main .prod-page .prod-motion-item.prod-motion-observed:not(.is-viewport-visible) {
  content-visibility: hidden;
  animation: none !important;
  transition: none !important;
}

.prod-card-img {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: rgba(var(--blue-rgb), 0.42);
}

.prod-card-img img { width: 100%; height: 100%; object-fit: contain; }
.prod-card-img .icon { width: 34px; height: 34px; }

.prod-card-body { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 4px; flex: 1; }

.prod-card-name {
  color: #1d1d1f;
  font-size: 13px;
  font-weight: 300;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prod-card-meta {
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 300;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.prod-card-meta > .promo { color: #b7791f; }
.prod-stock-label { display: inline-flex; align-items: center; gap: 3px; }
.prod-stock-label .icon { width: 12px; height: 12px; flex: 0 0 12px; }
.prod-stock-label.is-empty { color: #d70015; font-weight: 500; }
.prod-card-promo { color: #b7791f; font-size: 10.8px; font-weight: 300; }

.prod-card-foot {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Lista de produtos */

.prod-list { display: flex; flex-direction: column; gap: 10px; }

.prod-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(29, 29, 31, 0.10);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.prod-page .prod-list > .prod-motion-item {
  content-visibility: auto;
  contain-intrinsic-size: auto 78px;
}

.prod-row-img {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: #f5f5f7;
  color: rgba(var(--blue-rgb), 0.42);
  overflow: hidden;
}

.prod-row-img img { width: 100%; height: 100%; object-fit: contain; }
.prod-row-img .icon { width: 24px; height: 24px; }

.prod-row-mid { flex: 1; min-width: 0; }
.prod-row-mid > b { display: block; color: #1d1d1f; font-size: 13.5px; font-weight: 300; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.prod-row-meta { display: flex; gap: 12px; margin-top: 2px; color: #6e6e73; font-size: 12px; font-weight: 300; }
.prod-row-meta span.promo { color: #b7791f; }

/* Toggle switch usado nos formulários (sempre dentro de modal escuro) */

.prod-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 2px;
  margin-bottom: 8px;
}

.prod-toggle-row span { color: #f5f5f7; font-size: 13px; font-weight: 300; }

.prod-switch {
  width: 44px;
  height: 26px;
  flex: 0 0 auto;
  position: relative;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.10);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.prod-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

.prod-switch.on {
  background: #13a065;
  border-color: #13a065;
}

.prod-switch.on::after { transform: translateX(18px); }

.prod-inline-toggle { display: flex; align-items: center; }

/* Formulários dentro dos modais escuros */

.prod-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.prod-form-row-single { grid-template-columns: 1fr; }
.prod-form-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.prod-form-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.prod-form-row-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.stats-modal-card.prod-product-dialog,
.stats-modal-card.prod-purchase-dialog {
  width: min(680px, 100%);
}

.stats-modal-card.prod-purchase-dialog { width: min(820px, 100%); }
.stats-modal-card.prod-product-dialog { width: min(1160px, 100%); }
.stats-modal-card.prod-loose-dialog { width: min(580px, 100%) !important; }

.prod-form-shell {
  display: flex;
  align-items: flex-start;
  gap: 22px;
}

.prod-form-main {
  flex: 1;
  min-width: 0;
  max-height: 62vh;
  overflow-y: auto;
  padding-right: 4px;
}

.prod-form-side {
  flex: 0 0 320px;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prod-form-tabs {
  display: flex;
  width: 100%;
  margin-bottom: 14px;
}

.prod-form-tabs .prod-seg-btn { flex: 1; }

.prod-form-section {
  margin: 16px 0 8px;
  color: #f5f5f7;
  font-size: 13px;
  font-weight: 300;
}

.prod-form-section:first-child { margin-top: 0; }

.prod-form-preview {
  display: block;
  cursor: pointer;
}

.prod-form-preview-box {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  overflow: hidden;
}

.prod-form-preview-box img { width: 100%; height: 100%; object-fit: cover; }
.prod-form-preview-box .icon { width: 40px; height: 40px; color: rgba(255, 255, 255, 0.25); }
.prod-form-empty-label { color: rgba(255, 255, 255, 0.35); font-size: 12.5px; font-weight: 300; }
.prod-product-dialog .prod-form-empty-label { color: rgba(255, 255, 255, 0.40); }
.prod-form-uploading { color: rgba(255, 255, 255, 0.55); font-size: 12.5px; font-weight: 300; }

.prod-form-preview-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.60);
  font-size: 12px;
  font-weight: 300;
}

.prod-form-preview-label .icon { width: 14px; height: 14px; }

.prod-form-confirm {
  width: 100%;
  height: 46px;
  border-radius: 14px;
}

.prod-image-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.prod-image-row .prod-image-url { flex: 1; margin-top: 0; }

.prod-image-row .prod-tool-btn {
  flex: 0 0 auto;
  height: 58px;
  border-radius: 14px;
}

.prod-stock-edit-row {
  align-items: flex-end;
}

.prod-stock-adjust-btn {
  min-height: 58px;
}

.prod-stock-moves-panel {
  min-height: 180px;
  max-height: 260px;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(29, 29, 31, 0.08);
  background: #ffffff;
}

.prod-stock-moves-head,
.prod-stock-move-row {
  display: grid;
  grid-template-columns: 132px minmax(160px, 1fr) minmax(128px, .65fr) 96px 74px 112px;
  gap: 10px;
  align-items: center;
}

.prod-stock-moves-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px;
  background: #f0f0f2;
  color: #1d1d1f;
  font-size: 11.5px;
  font-weight: 700;
}

.prod-stock-move-row {
  padding: 10px 12px;
  color: #1d1d1f;
  font-size: 12px;
  border-top: 1px solid rgba(29, 29, 31, 0.07);
}

.prod-stock-move-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prod-stock-moves-empty {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  color: #6e6e73;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

.prod-product-dialog button:disabled {
  cursor: wait;
  opacity: 0.62;
}

@media (max-width: 760px) {
  .prod-form-shell {
    flex-direction: column;
  }
  .prod-form-main {
    max-height: none;
    overflow-y: visible;
    width: 100%;
  }
  .prod-form-side {
    position: static;
    width: 100%;
    flex: 0 0 auto;
  }
  .prod-form-preview-box { max-width: 220px; margin: 0 auto; }
  .prod-stock-moves-head { display: none; }
  .prod-stock-move-row {
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
  }
  .prod-stock-move-row > span:nth-child(2),
  .prod-stock-move-row > span:nth-child(3) {
    grid-column: 1 / -1;
  }
  .prod-stock-move-row > span:nth-child(6) {
    grid-column: 2;
    grid-row: 1;
  }
}

.prod-actions-list { display: flex; flex-direction: column; gap: 6px; }

.prod-action-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
  color: #f5f5f7;
  font: inherit;
  font-weight: 300;
  font-size: 13px;
  cursor: pointer;
}

.prod-action-item .icon { width: 17px; height: 17px; }
.prod-action-item.danger { color: #ff6c6c; }

/* Exportar para lojas — espelho dos dois pop-ups do Flutter. */
.stats-modal-card.prod-export-dialog,
.stats-modal-card.prod-export-store-dialog {
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  color: #f5f5f7;
}

.prod-export-dialog .stats-modal-head,
.prod-export-store-dialog .stats-modal-head {
  padding: 16px 18px 14px 22px;
}

.prod-export-dialog .stats-modal-head h3,
.prod-export-store-dialog .stats-modal-head h3 {
  font-weight: 800;
}

.prod-export-dialog .stats-modal-body {
  min-height: 0;
  padding: 14px;
  overflow: hidden;
}

.prod-export-subtitle {
  margin: 0 2px 10px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  font-weight: 700;
}

.prod-export-products {
  max-height: 430px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.prod-export-product {
  width: 100%;
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #f5f5f7;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, background 160ms ease, border-color 160ms ease;
}

.prod-export-product:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.09);
}

.prod-export-product:active { transform: scale(0.992); }

.prod-export-product.selected {
  border-color: rgba(255, 255, 255, 0.30);
  background: rgba(255, 255, 255, 0.11);
}

.prod-export-product-image {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.35);
}

.prod-export-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prod-export-product-image .icon { width: 23px; height: 23px; }

.prod-export-product-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.prod-export-product-copy b {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.93);
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prod-export-product-copy small {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.64);
  font-size: 11.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prod-export-check {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: 7px;
  color: #e2e2e5;
}

.prod-export-product.selected .prod-export-check {
  border-color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.13);
}

.prod-export-check .icon { width: 17px; height: 17px; }

.prod-export-dialog .stats-modal-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0 14px 14px;
}

.prod-export-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.prod-export-button,
.prod-export-store-cancel {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.94);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.prod-export-button:hover,
.prod-export-store-cancel:hover { background: rgba(255, 255, 255, 0.12); }
.prod-export-button:active,
.prod-export-store-cancel:active { transform: scale(0.99); }
.prod-export-button.primary { background: rgba(255, 255, 255, 0.11); border-color: rgba(255, 255, 255, 0.24); }
.prod-export-button .icon,
.prod-export-store-cancel .icon { width: 18px; height: 18px; }

.prod-export-cancel {
  align-self: center;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.58);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.stats-modal-card.prod-export-store-dialog { width: min(560px, 100%); }
.prod-export-store-dialog .stats-modal-body { padding: 14px; }

.prod-export-stores {
  max-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
}

.prod-export-store {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.95);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.prod-export-store:hover { background: rgba(255, 255, 255, 0.11); }
.prod-export-store:active { transform: scale(0.992); }
.prod-export-store .icon { width: 20px; height: 20px; color: rgba(255, 255, 255, 0.90); }

.prod-export-empty {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}
.prod-export-empty.danger { color: #ff8080; }

.prod-export-store-dialog .stats-modal-foot {
  margin: 0;
  padding: 0 14px 14px;
}

.prod-export-store-cancel {
  width: 100%;
  color: #ff8080;
  background: rgba(255, 77, 77, 0.11);
  border-color: rgba(255, 77, 77, 0.25);
}

@media (max-width: 640px) {
  .stats-modal-card.prod-export-dialog,
  .stats-modal-card.prod-export-store-dialog {
    width: min(100%, calc(100vw - 24px));
    max-height: calc(var(--app-height) - 32px);
  }
  .prod-export-dialog .stats-modal-body { padding: 12px; }
  .prod-export-products { max-height: calc(var(--app-height) - 260px); }
  .prod-export-dialog .stats-modal-foot { padding: 0 12px 12px; }
  .prod-export-actions { grid-template-columns: 1fr; gap: 8px; }
  .prod-export-product { min-height: 62px; padding: 8px; }
  .prod-export-product-image { width: 40px; height: 40px; flex-basis: 40px; }
  .prod-export-product-copy small { font-size: 10.5px; }
}

.prod-confirm-text {
  margin: 0;
  color: rgba(255, 255, 255, 0.80);
  font-size: 13px;
  font-weight: 300;
  text-align: center;
}

.prod-danger-btn {
  background: rgba(255, 77, 77, 0.16) !important;
  border-color: rgba(255, 77, 77, 0.30) !important;
  color: #ff8080 !important;
}

.prod-stock-seg { margin-bottom: 4px; }

.prod-stock-preview {
  margin: 6px 2px 2px;
  color: #f5f5f7;
  font-size: 14px;
  font-weight: 300;
  text-align: center;
}

.prod-stock-preview.danger { color: #ff6c6c; }

.prod-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }

.prod-chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.80);
  font: inherit;
  font-weight: 300;
  font-size: 12px;
  cursor: pointer;
}

.prod-chip-toggle .icon { width: 15px; height: 15px; }
.prod-chip-toggle.active { background: rgba(19, 160, 101, 0.18); border-color: rgba(19, 160, 101, 0.36); color: #ffffff; }

.prod-qty-pos { color: #13a065; font-weight: 300; }
.prod-qty-neg { color: #ff3b30; font-weight: 300; }

.prod-view-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.prod-view-grid > div {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.prod-view-grid span { display: block; color: rgba(255, 255, 255, 0.55); font-size: 11px; font-weight: 300; margin-bottom: 4px; }
.prod-view-grid b { color: #ffffff; font-size: 14px; font-weight: 300; }
.prod-view-full { grid-column: 1 / -1; }

.prod-section-title {
  margin: 14px 0 8px;
  color: #f5f5f7;
  font-size: 13px;
  font-weight: 300;
}

.prod-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  margin-bottom: 4px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12.5px;
  font-weight: 300;
  cursor: pointer;
  width: fit-content;
}

.prod-file-btn .icon { width: 16px; height: 16px; }

.prod-lines-head,
.prod-line-row {
  display: grid;
  grid-template-columns: 2.2fr 0.7fr 0.9fr 0.9fr 0.8fr 0.8fr 0.9fr 32px;
  gap: 6px;
  align-items: center;
}

.prod-lines-head {
  padding: 0 8px;
  color: rgba(255, 255, 255, 0.50);
  font-size: 10.5px;
  font-weight: 300;
  text-transform: uppercase;
}

.prod-lines { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }

.prod-line-row {
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.prod-line-row input,
.prod-input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font: inherit;
  font-size: 12px;
}

.prod-line-row .pl-total {
  color: #ffffff;
  font-size: 12px;
  font-weight: 300;
  text-align: right;
}

.prod-payments-head,
.prod-payment-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 32px;
  gap: 6px;
  align-items: center;
}

.prod-payments-head {
  padding: 0 8px;
  color: rgba(255, 255, 255, 0.50);
  font-size: 10.5px;
  font-weight: 300;
  text-transform: uppercase;
}

.prod-payments { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }

.prod-payment-row {
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.prod-payment-row input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font: inherit;
  font-size: 12px;
}

.prod-totals-card {
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prod-totals-card > div { display: flex; align-items: center; justify-content: space-between; }
.prod-totals-card span { color: rgba(255, 255, 255, 0.60); font-size: 12.5px; font-weight: 300; }
.prod-totals-card b { color: #ffffff; font-size: 14px; font-weight: 300; }
.prod-totals-final b { color: #4fe39a; font-size: 18px; }

@media (max-width: 940px) {
  .prod-toolbar {
    gap: 8px;
    flex-wrap: wrap;
  }
  .prod-search {
    flex: 1 1 100%;
    min-width: 0;
  }
  .prod-tool-btn,
  .prod-btn-new {
    flex: 0 0 auto;
    height: 48px;
    gap: 8px;
    padding: 0 16px 0 6px;
    font-size: 13px;
  }
  .prod-btn-chip {
    width: 36px;
    height: 36px;
  }
  .prod-btn-chip .icon {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 640px) {
  .prod-form-row,
  .prod-form-row-3,
  .prod-form-row-4,
  .prod-form-row-5 {
    grid-template-columns: 1fr;
  }
  .prod-lines-head { display: none; }
  .prod-line-row {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: auto;
  }
  .prod-payments-head { display: none; }
  .prod-payment-row { grid-template-columns: 1fr 1fr; }
  .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Tema escuro — parte externa da página (fora dos modais) */

html[data-theme="dark"] .prod-hero-pills span {
  background: #181b22;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
}

html[data-theme="dark"] .prod-hero-pills .icon { color: #5ea8ff; }

html[data-theme="dark"] .prod-search,
html[data-theme="dark"] .prod-tool-btn,
html[data-theme="dark"] .prod-btn-new,
html[data-theme="dark"] .prod-seg,
html[data-theme="dark"] .prod-icon-btn,
html[data-theme="dark"] .prod-card,
html[data-theme="dark"] .prod-row,
html[data-theme="dark"] .prod-row-img,
html[data-theme="dark"] .prod-subhead-icon {
  background: #181b22;
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .prod-btn-chip {
  background: #0e1015;
  border-color: rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] .prod-search input,
html[data-theme="dark"] .prod-tool-btn,
html[data-theme="dark"] .prod-btn-new,
html[data-theme="dark"] .prod-subhead h2,
html[data-theme="dark"] .prod-card-name,
html[data-theme="dark"] .prod-row-mid > b {
  color: #f5f5f7;
}

html[data-theme="dark"] .prod-icon-btn { color: #5ea8ff; }
html[data-theme="dark"] .prod-icon-btn.danger { color: #ff6c6c; }

html[data-theme="dark"] .prod-subhead p,
html[data-theme="dark"] .prod-row-meta,
html[data-theme="dark"] .prod-seg-btn {
  color: #a4a7ae;
}

html[data-theme="dark"] .prod-stock-label.is-empty { color: #ff6b6b; }

html[data-theme="dark"] .prod-btn-chip .icon,
html[data-theme="dark"] .prod-search .icon,
html[data-theme="dark"] .prod-subhead-icon {
  color: #5ea8ff;
}

html[data-theme="dark"] .prod-seg-btn.active {
  background: #111318;
  color: #f5f5f7;
}

/* ---- Diálogo de produto: tema claro Apple, igual ao sistema real ---- */

.prod-product-dialog {
  background: #f5f5f7 !important;
  border-color: rgba(29, 29, 31, 0.08) !important;
}

.prod-product-dialog .stats-modal-head {
  border-bottom-color: rgba(29, 29, 31, 0.08);
}

.prod-product-dialog .stats-modal-head h3 {
  color: #1d1d1f;
  font-weight: 300;
}

.prod-product-dialog .stats-modal-close {
  color: #1d1d1f;
}

.prod-product-dialog .stats-modal-close:hover {
  background: rgba(29, 29, 31, 0.06);
}

.prod-product-dialog,
.prod-product-dialog * {
  font-weight: 300;
}

.prod-product-dialog .stats-modal-field {
  flex-direction: column;
  align-items: flex-start;
  height: auto;
  min-height: 0;
  gap: 6px;
  padding: 8px 12px 10px;
  border-radius: 18px;
  background: #f7f7f8;
  border: 1px solid rgba(29, 29, 31, 0.10);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

.prod-product-dialog .stats-modal-field span {
  min-width: 0;
  color: #1d1d1f;
  font-size: 12.5px;
  line-height: 1;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
}

.prod-product-dialog .stats-modal-field input,
.prod-product-dialog .stats-modal-field textarea,
.prod-product-dialog .stats-modal-field select {
  width: 100%;
  color: #1d1d1f;
  border-radius: 14px;
  border: 1px solid rgba(29, 29, 31, 0.24);
  background: #dededf;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 15.5px;
  font-weight: 300;
  line-height: 1.2;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.62);
}

.prod-product-dialog .stats-modal-field input,
.prod-product-dialog .stats-modal-field select {
  height: 48px;
  min-height: 48px;
  padding: 0 14px;
}

.prod-product-dialog .stats-modal-field textarea {
  min-height: 84px;
  padding: 12px 14px;
  resize: vertical;
}

.prod-product-dialog .stats-modal-field input::placeholder,
.prod-product-dialog .stats-modal-field textarea::placeholder {
  color: #8f8f93;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 15.5px;
  font-weight: 300;
  opacity: 1;
}

.prod-product-dialog .prod-product-id-field {
  margin-bottom: 10px;
}

.prod-product-dialog .prod-product-id-field span {
  font-weight: 600;
}

.prod-product-dialog .prod-product-id-field input {
  line-height: 1;
}

.prod-product-dialog .prod-product-id-field input::placeholder {
  line-height: 1;
}

.prod-product-dialog .stats-filter-field {
  background: #f7f7f8;
  border: 1px solid rgba(29, 29, 31, 0.10);
  border-radius: 18px;
  transition: background 160ms ease, transform 150ms ease;
}

.prod-product-dialog .prod-form-row {
  gap: 14px;
  margin-top: 12px;
}

.prod-product-dialog .prod-form-panel > .stats-filter-field {
  margin-top: 12px;
}

.prod-product-dialog .prod-picker-btn {
  align-self: stretch;
  height: auto;
  min-height: 0;
  width: 100%;
  display: block;
  padding: 8px;
  border-radius: 18px;
  background: #f7f7f8;
  border: 1px solid rgba(29, 29, 31, 0.10);
  box-shadow: none;
  color: #1d1d1f;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 15.5px;
  font-weight: 300;
  margin: 0 !important;
}

.prod-product-dialog .prod-picker-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border-radius: 14px;
  background: #dededf;
  border: 1px solid rgba(29, 29, 31, 0.24);
  transition: background 160ms ease;
}

.prod-product-dialog .prod-picker-inner:has(.prod-btn-chip) {
  padding-left: 4px;
}

.prod-product-dialog .prod-picker-btn:hover .prod-picker-inner {
  background: #d4d4d6;
}

.prod-product-dialog .prod-picker-btn .prod-btn-chip {
  flex: 0 0 34px;
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 34px;
  background: #ffffff;
}

.prod-product-dialog .prod-picker-btn .prod-btn-chip .icon {
  width: 14px;
  height: 14px;
  color: var(--blue);
}

.prod-product-dialog .prod-picker-btn .prod-btn-label {
  flex: 1;
  min-width: 0;
  color: #1d1d1f !important;
  font-size: 15.5px;
  line-height: 1;
  text-align: left;
}

.prod-product-dialog .prod-picker-btn.empty .prod-btn-label {
  color: #8f8f93 !important;
}

.prod-product-dialog .prod-picker-btn .prod-picker-chevron {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: #8e8e93;
}

.prod-product-dialog .stats-filter-field:hover {
  background: #eeeef0;
}

.prod-product-dialog .stats-filter-field:active {
  transform: scale(0.99);
}

.prod-product-dialog .stats-filter-field > span:not(.icon) {
  color: #1d1d1f;
}

.prod-product-dialog .stats-filter-field.empty > span:not(.icon) {
  color: #8e8e93;
}

.prod-product-dialog .stats-filter-field.has-value > span:not(.icon) {
  color: #1d1d1f !important;
}

.prod-product-dialog .stats-filter-field .icon {
  color: #8e8e93;
}

.prod-product-dialog .prod-form-section {
  color: #1d1d1f;
}

.prod-product-dialog .prod-seg {
  background: #f0f0f2;
  border-color: rgba(29, 29, 31, 0.06);
}

.prod-product-dialog .prod-seg-btn {
  color: #1d1d1f;
  transition: background 160ms ease, color 160ms ease, transform 150ms ease;
}

.prod-product-dialog .prod-seg-btn:active {
  transform: scale(0.97);
}

.prod-product-dialog .prod-seg-btn.active {
  background: #cdf0dc;
  color: #13a065;
  box-shadow: 0 4px 10px rgba(19, 160, 101, 0.14);
}

.prod-product-dialog .prod-toggle-row span {
  color: #1d1d1f;
}

.prod-product-dialog .prod-switch {
  background: #e2e2e5;
  border-color: rgba(29, 29, 31, 0.10);
}

.prod-product-dialog .prod-switch::after {
  background: #1d1d1f;
}

.prod-product-dialog .prod-switch.on {
  background: #13a065;
  border-color: #13a065;
}

.prod-product-dialog .prod-switch.on::after {
  background: #ffffff;
}

.prod-product-dialog .prod-tool-btn {
  background: #f0f0f2;
  border-color: rgba(29, 29, 31, 0.08);
  color: #1d1d1f;
}

.prod-product-dialog .prod-btn-chip {
  background: #ffffff;
}

.prod-product-dialog .stats-modal-primary {
  background: #eeeeef;
  border: 1px solid rgba(29, 29, 31, 0.08);
  color: #1d1d1f;
}

.prod-product-dialog .stats-modal-primary:hover {
  background: #e4e4e6;
}

.prod-product-dialog .stats-modal-danger {
  background: rgba(255, 59, 48, 0.07);
  border-color: rgba(255, 59, 48, 0.22);
  color: #ff3b30;
}

.prod-product-dialog .stats-modal-danger:hover {
  background: rgba(255, 59, 48, 0.12);
}

.prod-product-dialog .stats-modal-primary:active,
.prod-product-dialog .stats-modal-danger:active {
  transform: scale(0.985);
}

.prod-product-dialog .prod-form-preview-box {
  background: #111318;
  border-color: rgba(29, 29, 31, 0.08);
}

.prod-product-dialog .prod-form-preview-box .icon {
  color: rgba(255, 255, 255, 0.30);
}

.prod-product-dialog .prod-form-preview-label {
  color: #1d1d1f;
}

.prod-product-dialog .prod-form-uploading {
  color: rgba(255, 255, 255, 0.60);
}

/* ---- DARK GLASSMORPHISM POPUP OVERRIDES (FLUTTER STYLE) ---- */

.prod-product-dialog:not(.prod-form-page) {
  background: rgba(32, 32, 35, 0.75) !important;
  backdrop-filter: blur(28px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6) !important;
  color-scheme: dark !important;
}

.prod-product-dialog:not(.prod-form-page) .stats-modal-head {
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

.prod-product-dialog:not(.prod-form-page) .stats-modal-head h3 {
  color: #f5f5f7 !important;
}

.prod-product-dialog:not(.prod-form-page) .stats-modal-close {
  color: #f5f5f7 !important;
}
.prod-product-dialog:not(.prod-form-page) .stats-modal-close:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

.prod-product-dialog:not(.prod-form-page) .prod-seg {
  background: rgba(0, 0, 0, 0.3) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

.prod-product-dialog:not(.prod-form-page) .prod-seg-btn {
  color: #a1a1a6 !important;
}

.prod-product-dialog:not(.prod-form-page) .prod-seg-btn.active {
  background: rgba(var(--blue-rgb), 0.8) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 10px rgba(var(--blue-rgb), 0.3) !important;
}

.prod-product-dialog:not(.prod-form-page) .stats-modal-field span,
.prod-product-dialog:not(.prod-form-page) .prod-product-id-field span {
  color: #a1a1a6 !important;
}

.prod-product-dialog:not(.prod-form-page) .stats-modal-field input,
.prod-product-dialog:not(.prod-form-page) .stats-modal-field textarea,
.prod-product-dialog:not(.prod-form-page) .stats-modal-field select,
.prod-product-dialog:not(.prod-form-page) .prod-product-id-field input {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #f5f5f7 !important;
  box-shadow: none !important;
}

.prod-product-dialog:not(.prod-form-page) .stats-modal-field input::placeholder,
.prod-product-dialog:not(.prod-form-page) .stats-modal-field textarea::placeholder,
.prod-product-dialog:not(.prod-form-page) .prod-product-id-field input::placeholder {
  color: #6e6e73 !important;
}

.prod-product-dialog:not(.prod-form-page) .stats-filter-field,
.prod-product-dialog:not(.prod-form-page) .prod-picker-inner {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.prod-product-dialog:not(.prod-form-page) .stats-filter-field:hover,
.prod-product-dialog:not(.prod-form-page) .prod-picker-btn:hover .prod-picker-inner {
  background: rgba(255, 255, 255, 0.12) !important;
}

.prod-product-dialog:not(.prod-form-page) .prod-picker-btn .prod-btn-label,
.prod-product-dialog .stats-filter-field > span:not(.icon) {
  color: #f5f5f7 !important;
}

.prod-product-dialog:not(.prod-form-page) .prod-picker-btn.empty .prod-btn-label,
.prod-product-dialog .stats-filter-field.empty > span:not(.icon) {
  color: #8e8e93 !important;
}

.prod-product-dialog:not(.prod-form-page) .stats-modal-primary {
  background: rgba(255, 255, 255, 0.15) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

.prod-product-dialog:not(.prod-form-page) .stats-modal-primary:hover {
  background: rgba(255, 255, 255, 0.25) !important;
}

.prod-product-dialog:not(.prod-form-page) .stats-modal-danger {
  background: rgba(255, 59, 48, 0.15) !important;
  border: 1px solid rgba(255, 59, 48, 0.25) !important;
  color: #ff453a !important;
}

.prod-product-dialog:not(.prod-form-page) .stats-modal-danger:hover {
  background: rgba(255, 59, 48, 0.25) !important;
}

.prod-product-dialog:not(.prod-form-page) .prod-form-preview-box {
  background: rgba(0, 0, 0, 0.5) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.prod-product-dialog:not(.prod-form-page) .prod-form-preview-label {
  color: #a1a1a6 !important;
}

.prod-product-dialog:not(.prod-form-page) .prod-form-section {
  color: #f5f5f7 !important;
}

.prod-product-dialog:not(.prod-form-page) .stats-modal-field,
.prod-product-dialog:not(.prod-form-page) .prod-product-id-field {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  padding: 10px 14px !important;
  border-radius: 18px !important;
}

.prod-product-dialog:not(.prod-form-page) .stats-modal-field span {
  padding-left: 2px !important;
  margin-bottom: 4px !important;
  display: inline-block;
  color: #a1a1a6 !important;
}

.prod-product-dialog:not(.prod-form-page) .stats-modal-field input::placeholder,
.prod-product-dialog:not(.prod-form-page) .stats-modal-field textarea::placeholder,
.prod-product-dialog:not(.prod-form-page) .prod-product-id-field input::placeholder {
  color: #a1a1a6 !important;
}

.prod-product-dialog:not(.prod-form-page) .prod-tool-btn,
.prod-purchase-dialog .prod-tool-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #f5f5f7 !important;
}

.prod-product-dialog:not(.prod-form-page) .prod-tool-btn:hover,
.prod-purchase-dialog .prod-tool-btn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}

.prod-product-dialog:not(.prod-form-page) .prod-btn-chip,
.prod-purchase-dialog .prod-btn-chip {
  background: transparent !important;
}

.prod-product-dialog:not(.prod-form-page) .prod-btn-chip .icon,
.prod-purchase-dialog .prod-btn-chip .icon {
  color: #f5f5f7 !important;
}

.prod-product-dialog:not(.prod-form-page) .prod-toggle-row span {
  color: #a1a1a6 !important;
}

.prod-product-dialog .prod-image-row .prod-tool-btn {
  height: auto !important;
  align-self: stretch !important;
  border-radius: 18px !important;
}

.prod-product-dialog .prod-form-main {
  min-height: 62vh !important;
  height: 62vh !important;
  overflow: hidden !important;
}

.prod-product-dialog .prod-form-panels-wrapper {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.prod-product-dialog .prod-form-panel {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  padding: 2px;
  overflow-y: auto;
  overflow-x: hidden;
}

.prod-product-dialog .prod-form-shell {
  align-items: stretch !important;
}

.prod-product-dialog .prod-form-confirm[data-modal-cancel] {
  margin-top: auto !important;
}

.prod-product-dialog:not(.prod-form-page) .prod-stock-moves-panel {
  background: rgba(0, 0, 0, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.prod-product-dialog:not(.prod-form-page) .prod-stock-moves-head {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #f5f5f7 !important;
}

.prod-product-dialog:not(.prod-form-page) .prod-stock-move-row {
  color: #f5f5f7 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

@media (max-width: 760px) {
  .prod-product-dialog .prod-form-main {
    min-height: 0 !important;
    height: auto !important;
  }

  .prod-product-dialog .prod-form-panels-wrapper[data-active-tab="estoque"] #pf-panel-cadastro {
    height: 0 !important;
    overflow: hidden !important;
  }

  .prod-product-dialog .prod-form-panels-wrapper[data-active-tab="cadastro"] #pf-panel-estoque {
    height: 0 !important;
    overflow: hidden !important;
  }
}

.prod-product-dialog,
.prod-product-dialog h3,
.prod-product-dialog span,
.prod-product-dialog button,
.prod-product-dialog input {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif !important;
}

.prod-product-dialog .stats-modal-head h3,
.prod-product-dialog .stats-modal-field span,
.prod-product-dialog .stats-modal-field input,
.prod-product-dialog .stats-modal-primary,
.prod-product-dialog .stats-modal-danger {
  font-weight: 300 !important;
}

.stats-modal-card.prod-simple-dialog {
  width: min(400px, 100%) !important;
}

.prod-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}
.prod-status-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}
.prod-row-actions.plain-icons .prod-icon-btn {
  background: transparent;
  border: none;
  width: 24px;
  height: 24px;
  color: #6e6e73;
}
.prod-row-actions.plain-icons .prod-icon-btn.danger {
  color: #ff3b30;
}
.prod-row-actions.plain-icons .prod-icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}
html[data-theme="dark"] .prod-row-actions.plain-icons .prod-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}


@media (max-width: 940px) {
  .prod-toolbar-actions .prod-seg {
    flex: 0 0 auto;
    padding: 4px;
  }
  .prod-toolbar-actions .prod-btn-new {
    flex: 0 0 auto;
    height: 42px;
    padding: 0 16px 0 8px;
    font-size: 12.5px;
  }
}


@media (max-width: 640px) {
  .prod-simple-table {
    min-width: 0;
  }
}

/* ==========================================================================
   Caixa — réplica HTML da página Flutter cashier_page.dart
   ========================================================================== */

.main.cash-main {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px 18px 0;
  background: #f5f5f7;
}

.cash-main,
.cash-main button,
.cash-main input,
.cash-main select,
.cash-main textarea,
.cash-dialog,
.cash-dialog button,
.cash-dialog input,
.cash-dialog select,
.cash-dialog textarea {
  font-family: var(--apple-font);
  font-weight: 300;
  letter-spacing: 0;
}

.cash-page {
  flex: 1 0 auto;
  min-height: calc(var(--app-height) - 16px);
  margin-top: 52px;
  padding: 20px;
  border-radius: 34px 34px 0 0;
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f7 54%, #eff8f4 100%);
}

.cash-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.cash-title-block {
  min-width: 0;
}

.cash-mobile-title-row {
  display: block;
}

.cash-header h1 {
  margin: 0;
  color: #1d1d1f;
  font-size: 42px;
  line-height: 0.95;
  font-weight: 500;
}

.cash-header p {
  margin: 8px 0 0;
  color: #6e6e73;
  font-size: 15px;
}

.cash-badge {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: rgba(255, 255, 255, 0.86);
  color: #1d1d1f;
  font-size: 12px;
  white-space: nowrap;
}

.cash-hero {
  padding: 18px 22px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: #1d1d1f;
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.078);
}

.cash-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.cash-pills,
.cash-hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.cash-pills span {
  max-width: 260px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.86);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* O cabeçalho do Caixa é escuro nos dois temas, então o chip do modo
   retroativo usa um laranja claro só uma vez — a mesma família do aviso fixo
   da shell e do selo das vendas retroativas. */
.cash-pills span.retro {
  border-color: rgba(255, 185, 94, 0.48);
  background: rgba(255, 149, 0, 0.22);
  color: #ffd9a6;
}
.cash-pills span.retro .icon { color: #ffb95e; }

.cash-pills .icon {
  width: 14px;
  height: 14px;
  color: var(--blue);
  flex: 0 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.cash-pills .icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.cash-hero-action {
  width: 184px;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
  cursor: pointer;
}

.cash-hero-action > span:first-child {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.10);
}

.cash-hero-action .icon {
  width: 18px;
  height: 18px;
  color: var(--blue);
}

.cash-hero-action > span:nth-child(2) {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.cash-hero-action small {
  max-width: 100%;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cash-hero-action b {
  max-width: 100%;
  color: rgba(255, 255, 255, 0.95);
  font-size: 13.2px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cash-hero-action > .icon:last-child {
  color: rgba(255, 255, 255, 0.50);
}

.cash-hero-info {
  margin-top: 10px;
  color: #ffffff;
}

.cash-hero-info span {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
}

.cash-hero-info strong {
  display: block;
  margin-top: 3px;
  color: #ffffff;
  font-size: 34px;
  line-height: 1.02;
  font-weight: 500;
}

.cash-hero-info p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13.2px;
}

.cash-tabs {
  height: 76px;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.cash-tabs::-webkit-scrollbar { display: none; }

.cash-tab {
  height: 56px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border-radius: 20px;
  border: 0;
  background: #f5f5f7;
  color: #6e6e73;
  font-family: var(--apple-font);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    background 180ms cubic-bezier(0.22, 1, 0.36, 1),
    color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cash-tab.active {
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}

.cash-tab:hover {
  transform: translateY(-1px);
}

.cash-tab:active {
  transform: scale(0.985);
}

.cash-tab > span {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #ffffff;
  color: #6e6e73;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.cash-tab.active > span {
  background: #f5f5f7;
  color: var(--blue);
}

.cash-tab .icon {
  width: 17px;
  height: 17px;
}

.cash-tab b {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
}

.cash-current-grid {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.cash-current-grid.previous-detail {
  align-items: start;
}

.cash-flutter-grid {
  min-height: 590px;
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(340px, 0.95fr);
  gap: 16px;
  align-items: start;
}

.cash-previous-shell {
  display: block;
}

.cash-flutter-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cash-left-stack {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cash-card,
.cash-centered-card,
.cash-status-card,
.cash-previous-row {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: #ffffff;
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.078);
}

.cash-card {
  min-width: 0;
  padding: 14px;
  border-radius: 24px;
}

.cash-status-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 22px;
  box-shadow: none;
}

.cash-status-card > span {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 12px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #f5f5f7;
}

.cash-status-card .icon {
  width: 21px;
  height: 21px;
  color: var(--blue);
}

.cash-status-card h2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  color: #1d1d1f;
  font-size: 15px;
  font-weight: 500;
}

.cash-status-card h2 em {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.16);
  color: #13a065;
  font-size: 10px;
  font-style: normal;
  font-weight: 500;
}

.cash-status-card p,
.cash-list-head p,
.cash-summary-card > p,
.cash-previous-row small {
  margin: 3px 0 0;
  color: #6e6e73;
  font-size: 12px;
}

.cash-movements-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.cash-flutter-grid .cash-movements-card {
  padding: 18px;
  border-radius: 28px;
  box-shadow: none;
}

.cash-list-head,
.cash-list-foot,
.cash-detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cash-list-head {
  margin-bottom: 12px;
}

.cash-flutter-grid .cash-list-head {
  margin: 0 0 18px;
  padding: 0 0 0 2px;
}

.cash-list-head h2,
.cash-summary-card h2 {
  margin: 0;
  color: #1d1d1f;
  font-size: 20px;
  font-weight: 500;
}

.cash-flutter-grid .cash-list-head h2 {
  font-size: 18px;
}

.cash-view-seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #f5f5f7;
}

.cash-view-seg button {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #6e6e73;
  font-size: 12px;
  cursor: pointer;
}

.cash-view-seg button.active {
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.cash-movement-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
}

.cash-flutter-grid .cash-movement-list {
  gap: 10px;
}

.cash-movement-row {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: #1d1d1f;
  text-align: left;
  cursor: default;
}

.cash-flutter-grid .cash-movement-row {
  min-height: 62px;
  padding: 8px 12px;
  border: none;
  border-radius: 0;
  background: transparent;
}

.cash-movement-row[data-cash-order] {
  cursor: pointer;
}

.cash-movement-row.danger strong {
  color: #ef4444;
}

.cash-movement-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: none;
  background: #e8f0fe;
  color: #1967d2;
}

.cash-movement-icon svg {
  width: 20px;
  height: 20px;
}

.cash-flutter-grid .cash-movement-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #f5f5f7;
}

.cash-movement-icon .icon,
.cash-payment-lines .icon,
.cash-close-row .icon,
.cash-action-list .icon {
  width: 18px;
  height: 18px;
}

.cash-movement-main {
  min-width: 0;
}

.cash-movement-main b,
.cash-movement-row strong,
.cash-summary-lines b,
.cash-payment-lines b,
.cash-previous-row b {
  color: #1d1d1f;
  font-weight: 500;
}

.cash-movement-main b,
.cash-movement-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cash-movement-main small {
  margin-top: 3px;
  color: #6e6e73;
  font-size: 12px;
}

.cash-flutter-grid .cash-movement-main b {
  font-size: 13px;
}

.cash-flutter-grid .cash-movement-row strong {
  font-size: 13px;
}

.cash-movement-row > .icon {
  color: #b5b5ba;
}

.cash-list-foot {
  margin-top: auto;
  padding-top: 12px;
}

.cash-list-foot span {
  color: #6e6e73;
  font-size: 13px;
}

.cash-inline-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  white-space: nowrap;
}

.cash-inline-btn .icon {
  width: 18px;
  height: 18px;
  color: var(--blue);
}

.cash-inline-btn.full {
  width: 100%;
  margin-top: auto;
}

.cash-inline-btn.ghost {
  box-shadow: none;
}

.cash-summary-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.cash-flutter-grid > .cash-summary-card,
.cash-current-grid.previous-detail > .cash-summary-card {
  position: sticky;
  top: 18px;
  align-self: start;
  height: calc(125vh - 36px);
  min-height: 520px;
  max-height: calc(125vh - 36px);
  padding: 14px;
  border-radius: 24px;
  overflow: hidden;
}

.cash-audit {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  margin-top: 6px;
  color: #6e6e73;
  font-size: 12px;
}

.cash-audit b {
  color: #6e6e73;
  font-weight: 300;
}

.cash-summary-lines {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(29, 29, 31, 0.10);
}

.cash-summary-lines div,
.cash-payment-lines div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
}

.cash-summary-lines span,
.cash-payment-lines span {
  color: #1d1d1f;
  font-size: 13px;
}

.cash-balance-block {
  margin: 12px 0;
  padding: 12px 0;
  border-top: 1px solid rgba(29, 29, 31, 0.10);
  border-bottom: 1px solid rgba(29, 29, 31, 0.10);
}

.cash-balance-block span,
.cash-payment-lines h3 {
  display: block;
  color: #6e6e73;
  font-size: 14px;
  font-weight: 500;
}

.cash-balance-block strong {
  display: block;
  margin-top: 2px;
  color: #22c55e;
  font-size: 21px;
  line-height: 1.1;
  font-weight: 500;
  text-align: right;
}

.cash-payment-lines {
  min-height: 0;
  margin-bottom: 16px;
  overflow: hidden;
}

.cash-payment-lines h3 {
  margin: 0 0 8px;
}

.cash-payment-lines div {
  justify-content: flex-start;
}

.cash-payment-lines div b {
  margin-left: auto;
}

.cash-payment-lines .icon {
  color: var(--blue);
  flex: 0 0 auto;
}

@media (min-width: 1101px) {
  .cash-flutter-grid > .cash-summary-card .cash-inline-btn.full,
  .cash-current-grid.previous-detail > .cash-summary-card .cash-inline-btn.full {
    flex: 0 0 auto;
    margin-top: auto;
  }
}

.cash-centered-card {
  width: min(560px, 100%);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 48px auto;
  padding: 18px;
  border-radius: 28px;
  text-align: center;
}

.cash-centered-card > .icon {
  width: 38px;
  height: 38px;
  color: var(--blue);
}

.cash-centered-card h2 {
  margin: 0;
  color: #1d1d1f;
  font-size: 16px;
  font-weight: 500;
}

.cash-centered-card p {
  margin: 0;
  color: #6e6e73;
  font-size: 13px;
}

.cash-centered-card.danger > .icon,
.cash-centered-card.danger h2 {
  color: #ff3b30;
}

.cash-empty {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #f5f5f7;
  color: #6e6e73;
  font-size: 13px;
}

.cash-previous-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-x: auto;
}

.cash-previous-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(120px, 0.7fr)) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  color: #1d1d1f;
  text-align: left;
  cursor: pointer;
}

.cash-prev-main {
  min-width: 0;
}

.cash-prev-main b,
.cash-prev-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cash-previous-row > span:not(.cash-prev-main) {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.cash-previous-row em {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
}

.cash-previous-row em.closed {
  border: 1px solid rgba(34, 197, 94, 0.40);
  background: rgba(34, 197, 94, 0.10);
  color: #13a065;
}

.cash-previous-row em.open {
  border: 1px solid rgba(255, 184, 77, 0.40);
  background: rgba(255, 184, 77, 0.10);
  color: #b7791f;
}

.cash-detail-actions {
  margin-bottom: 12px;
}

.cash-action-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cash-action-list button {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.cash-dialog {
  background: rgba(17, 19, 24, 0.96) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #ffffff;
}

.cash-dialog .stats-modal-head h3,
.cash-dialog .stats-modal-field span,
.cash-dialog .stats-modal-field input,
.cash-dialog .stats-modal-field select,
.cash-dialog .stats-modal-field textarea,
.cash-dialog .stats-modal-close,
.cash-dialog .stats-modal-primary,
.cash-dialog .stats-modal-danger {
  color: #ffffff;
}

.cash-dialog .stats-modal-field {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.cash-dialog .stats-modal-field input,
.cash-dialog .stats-modal-field select,
.cash-dialog .stats-modal-field textarea {
  background: transparent;
}

.cash-dialog-sub {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.cash-close-dialog {
  width: min(920px, 100%) !important;
  background: rgba(30, 30, 30, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #ffffff !important;
}

.cash-close-dialog .stats-modal-head {
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

.cash-close-dialog .stats-modal-head h3 {
  color: #ffffff !important;
  font-weight: 300 !important;
}

.cash-close-dialog .stats-modal-close {
  color: rgba(255, 255, 255, 0.66) !important;
}

.cash-close-dialog .stats-modal-close:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

.cash-close-dialog .cash-dialog-sub {
  color: rgba(255, 255, 255, 0.78) !important;
}

.cash-close-dialog .cash-close-head {
  color: rgba(255, 255, 255, 0.82) !important;
}

.cash-close-dialog .cash-close-row,
.cash-close-dialog .cash-close-total {
  border-top-color: rgba(255, 255, 255, 0.10) !important;
  color: #ffffff !important;
}

.cash-close-dialog .cash-close-row input {
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #ffffff !important;
  box-shadow: none !important;
  border-radius: 10px !important;
}

.cash-close-dialog .cash-close-row input::placeholder {
  color: rgba(255, 255, 255, 0.40) !important;
}

.cash-close-dialog .cash-close-row strong,
.cash-close-dialog .cash-close-total strong {
  color: #ffffff !important;
}

.cash-close-dialog .cash-close-row strong.positive,
.cash-close-dialog .cash-close-total strong.positive {
  color: #86efac !important;
}

.cash-close-dialog .cash-close-row strong.negative,
.cash-close-dialog .cash-close-total strong.negative {
  color: #fca5a5 !important;
}

.cash-close-dialog .cash-autofill {
  color: rgba(255, 255, 255, 0.70) !important;
}

.cash-close-dialog .cash-autofill:hover {
  color: #ffffff !important;
}

.cash-close-dialog .stats-modal-field {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 18px !important;
}

.cash-close-dialog .stats-modal-field span {
  color: rgba(255, 255, 255, 0.78) !important;
  font-weight: 600 !important;
}

.cash-close-dialog .stats-modal-field textarea {
  color: #ffffff !important;
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.cash-close-dialog .stats-modal-danger {
  border: 1px solid rgba(255, 77, 77, 0.30) !important;
  background: rgba(58, 30, 35, 0.90) !important;
  color: rgba(255, 108, 108, 0.95) !important;
}

.cash-close-dialog .stats-modal-primary {
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  background: rgba(255, 255, 255, 0.14) !important;
  color: #ffffff !important;
}

.cash-close-dialog .stats-modal-foot {
  border-top-color: rgba(255, 255, 255, 0.08) !important;
}

.cash-close-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cash-close-head,
.cash-close-row,
.cash-close-total {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr 1fr 0.8fr;
  align-items: center;
  gap: 8px;
}

.cash-close-head {
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}

.cash-close-row,
.cash-close-total {
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  color: #ffffff;
}

.cash-close-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cash-close-row input {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  outline: 0;
}

.cash-close-row strong,
.cash-close-total strong {
  text-align: right;
  color: #ffffff;
}

.cash-close-row strong.positive,
.cash-close-total strong.positive {
  color: #86efac;
}

.cash-close-row strong.negative,
.cash-close-total strong.negative {
  color: #fca5a5;
}

.cash-autofill {
  align-self: flex-end;
  margin: 8px 0;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.70);
  cursor: pointer;
}

.cash-order-detail,
.cash-order-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cash-order-detail div,
.cash-order-items div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.cash-order-detail span,
.cash-order-items span,
.cash-order-items p {
  color: rgba(255, 255, 255, 0.68);
}

.cash-order-detail b,
.cash-order-items b {
  color: #ffffff;
  font-weight: 500;
}

.cash-sale-detail-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 48px));
  padding: 0;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(30, 30, 30, 0.95) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.30);
  overflow: hidden;
}

.cash-sale-detail-dialog .stats-modal-head {
  align-items: center;
  margin: 0;
  padding: 14px 14px 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cash-sale-detail-dialog .stats-modal-head h3 {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.92) !important;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 600;
}

.cash-sale-detail-dialog .stats-modal-head h3 .icon {
  width: 18px;
  height: 18px;
  color: #5ea8ff;
}

.cash-sale-detail-dialog .stats-modal-close {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.78) !important;
}

.cash-sale-detail-dialog .stats-modal-close .icon {
  width: 18px;
  height: 18px;
}

.cash-sale-detail-dialog .stats-modal-body {
  overflow: auto;
  padding: 16px 18px 18px;
}

.cash-sale-detail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cash-sale-section h4 {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  line-height: 1.15;
  font-weight: 600;
}

.cash-sale-seller,
.cash-sale-item {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.cash-sale-seller .icon {
  width: 16px;
  height: 16px;
  color: #5ea8ff;
}

.cash-sale-seller b,
.cash-sale-item span,
.cash-sale-item b,
.cash-sale-payment b,
.cash-sale-total b {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}

.cash-sale-client div,
.cash-sale-payment div,
.cash-sale-total {
  display: grid;
  grid-template-columns: minmax(94px, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 24px;
}

.cash-sale-client span,
.cash-sale-payment span,
.cash-sale-total span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-weight: 500;
}

.cash-sale-client b {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.cash-sale-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cash-sale-notes p {
  margin: 0;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cash-sale-item {
  justify-content: space-between;
}

.cash-sale-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cash-sale-item b,
.cash-sale-payment b,
.cash-sale-total b {
  text-align: right;
  white-space: nowrap;
}

.cash-sale-item.muted span,
.cash-sale-item.muted b {
  color: rgba(255, 255, 255, 0.58);
}

.cash-sale-total {
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 640px) {
  .cash-sale-detail-dialog {
    width: calc(100vw - 24px);
    border-radius: 22px;
  }

  .cash-sale-detail-dialog .stats-modal-head {
    padding: 13px 12px 11px 14px;
  }

  .cash-sale-detail-dialog .stats-modal-head h3 {
    gap: 8px;
    font-size: 16px;
  }

  .cash-sale-detail-dialog .stats-modal-close {
    width: 32px;
    height: 32px;
  }

  .cash-sale-section h4,
  .cash-sale-seller b,
  .cash-sale-item span,
  .cash-sale-item b,
  .cash-sale-client span,
  .cash-sale-client b,
  .cash-sale-payment span,
  .cash-sale-payment b,
  .cash-sale-notes p,
  .cash-sale-total span,
  .cash-sale-total b {
    font-size: 12.5px;
  }
}

html[data-theme="dark"] .main.cash-main {
  background: #07080a;
}

html[data-theme="dark"] .cash-page {
  background: linear-gradient(135deg, #06070a 0%, #0e1117 54%, #07140f 100%);
}

html[data-theme="dark"] .cash-header h1,
html[data-theme="dark"] .cash-list-head h2,
html[data-theme="dark"] .cash-summary-card h2,
html[data-theme="dark"] .cash-status-card h2,
html[data-theme="dark"] .cash-centered-card h2,
html[data-theme="dark"] .cash-movement-main b,
html[data-theme="dark"] .cash-movement-row strong,
html[data-theme="dark"] .cash-summary-lines b,
html[data-theme="dark"] .cash-payment-lines b,
html[data-theme="dark"] .cash-previous-row b,
html[data-theme="dark"] .cash-summary-lines span,
html[data-theme="dark"] .cash-payment-lines span,
html[data-theme="dark"] .cash-inline-btn,
html[data-theme="dark"] .cash-badge,
html[data-theme="dark"] .cash-tab.active {
  color: #f5f5f7;
}

html[data-theme="dark"] .cash-header p,
html[data-theme="dark"] .cash-status-card p,
html[data-theme="dark"] .cash-list-head p,
html[data-theme="dark"] .cash-summary-card > p,
html[data-theme="dark"] .cash-previous-row small,
html[data-theme="dark"] .cash-movement-main small,
html[data-theme="dark"] .cash-audit,
html[data-theme="dark"] .cash-audit b,
html[data-theme="dark"] .cash-list-foot span,
html[data-theme="dark"] .cash-centered-card p,
html[data-theme="dark"] .cash-balance-block span,
html[data-theme="dark"] .cash-payment-lines h3,
html[data-theme="dark"] .cash-tab {
  color: #a4a7ae;
}

html[data-theme="dark"] .cash-card,
html[data-theme="dark"] .cash-centered-card,
html[data-theme="dark"] .cash-status-card,
html[data-theme="dark"] .cash-previous-row,
html[data-theme="dark"] .cash-badge,
html[data-theme="dark"] .cash-tab.active,
html[data-theme="dark"] .cash-inline-btn {
  background: #111318;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.40);
}

html[data-theme="dark"] .cash-tab,
html[data-theme="dark"] .cash-view-seg,
html[data-theme="dark"] .cash-empty,
html[data-theme="dark"] .cash-status-card > span,
html[data-theme="dark"] .cash-tab span,
html[data-theme="dark"] .cash-tab.active span {
  background: #181b22;
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .cash-movement-icon {
  background: rgba(25, 103, 210, 0.2);
  color: #8ab4f8;
}

html[data-theme="dark"] .cash-view-seg button.active {
  background: #111318;
  color: #f5f5f7;
}

html[data-theme="dark"] .cash-hero {
  background: #050609;
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .cash-pills .icon,
html[data-theme="dark"] .cash-hero-action .icon,
html[data-theme="dark"] .cash-tab.active .icon,
html[data-theme="dark"] .cash-inline-btn .icon,
html[data-theme="dark"] .cash-status-card .icon,
html[data-theme="dark"] .cash-payment-lines .icon,
html[data-theme="dark"] .cash-movement-icon {
  color: #5ea8ff;
}

/* Caixa: as subabas seguem o mesmo acabamento azul das demais paginas. */
.cash-page .cash-tab {
  border: 1px solid rgba(0, 113, 227, 0.14);
  background: rgba(255, 255, 255, 0.94);
  color: #4175a8;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.cash-page .cash-tab > span {
  border-color: rgba(0, 113, 227, 0.12);
  background: #ffffff;
  color: #0071e3;
}

.cash-page .cash-tab.active {
  border-color: rgba(0, 113, 227, 0.34);
  background: rgba(0, 113, 227, 0.09);
  color: #0071e3;
  box-shadow: 0 8px 18px rgba(0, 113, 227, 0.10);
}

.cash-page .cash-tab.active > span {
  border-color: rgba(0, 113, 227, 0.18);
  background: rgba(0, 113, 227, 0.10);
  color: #0071e3;
}

.cash-page .cash-tab:hover {
  border-color: rgba(0, 113, 227, 0.26);
  background: #ffffff;
}

.cash-page .cash-tab:focus-visible {
  outline: 2px solid rgba(0, 113, 227, 0.42);
  outline-offset: 2px;
}

html[data-theme="dark"] .cash-page .cash-tab {
  border-color: rgba(94, 168, 255, 0.20);
  background: #181b22;
  color: #a4a7ae;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .cash-page .cash-tab > span {
  border-color: rgba(94, 168, 255, 0.18);
  background: #0e1015;
  color: #5ea8ff;
}

html[data-theme="dark"] .cash-page .cash-tab.active {
  border-color: rgba(94, 168, 255, 0.42);
  background: rgba(94, 168, 255, 0.13);
  color: #5ea8ff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .cash-page .cash-tab.active > span {
  border-color: rgba(94, 168, 255, 0.26);
  background: rgba(94, 168, 255, 0.12);
  color: #5ea8ff;
}

html[data-theme="dark"] .cash-page .cash-tab:hover {
  border-color: rgba(94, 168, 255, 0.38);
  background: #24272e;
}

@media (max-width: 1100px) {
  .cash-current-grid,
  .cash-flutter-grid {
    grid-template-columns: 1fr;
  }

  .cash-flutter-grid > .cash-summary-card,
  .cash-current-grid.previous-detail > .cash-summary-card {
    position: static;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 940px) {
  .main.cash-main {
    padding: 0 0 calc(var(--browser-ui-bleed) + 96px);
    background: transparent;
  }

  .cash-page {
    min-height: calc(var(--app-height) + var(--browser-ui-bleed));
    margin-top: 0;
    padding: 12px 14px calc(18px + var(--safe-bottom) + var(--browser-ui-bleed));
    border-radius: 0;
  }

  .cash-header {
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    margin: 0 8px 12px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .cash-title-block {
    width: 100%;
    padding: 15px 16px 14px 12px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    background: #ffffff;
    box-shadow: 0 22px 42px rgba(0, 0, 0, 0.078);
  }

  .cash-mobile-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .cash-header h1 {
    font-size: 29px;
    line-height: 1;
  }

  .cash-header p {
    font-size: 13px;
  }

  .cash-badge {
    display: none;
  }

  .cash-hero {
    padding: 18px;
    border-radius: 26px;
  }

  .cash-hero-top,
  .cash-hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .cash-pills {
    flex-wrap: nowrap;
  }

  .cash-pills span {
    flex-shrink: 1;
    min-width: 0;
  }

  .cash-hero-action {
    width: 100%;
  }

  .cash-hero-info {
    margin-top: 18px;
  }

  .cash-hero-info strong {
    font-size: 28px;
  }

  .cash-tabs {
    height: 76px;
  }

  .cash-tab {
    height: 52px;
  }

  .cash-current-grid {
    min-height: 0;
  }

  .cash-flutter-grid {
    min-height: 0;
  }

  .cash-flutter-grid .cash-movements-card {
    padding: 16px 14px 0;
    border-radius: 22px;
  }

  .cash-list-head,
  .cash-list-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .cash-detail-actions {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .cash-view-seg {
    width: 100%;
  }

  .cash-view-seg button {
    flex: 1;
  }

  .cash-list-foot .cash-inline-btn {
    width: 100%;
  }

  .cash-detail-actions .cash-inline-btn {
    width: auto;
  }

  .cash-detail-actions [data-cash-back] span:not(.icon) {
    display: none;
  }

  .cash-close-head {
    display: none;
  }

  .cash-close-row,
  .cash-close-total {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

@media (max-width: 640px) {
  .cash-previous-row {
    grid-template-columns: 1fr auto auto;
  }

  .cash-previous-row > span:nth-child(2),
  .cash-previous-row > span:nth-child(3) {
    display: none;
  }

  .vendas-thead .h-fiscal,
  .vendas-thead .h-pg,
  .vendas-thead .h-data,
  .vendas-row .c-fiscal,
  .vendas-row .c-pg,
  .vendas-row .c-data {
    display: none;
  }

  .vendas-thead .h-cliente,
  .vendas-row .c-cliente {
    flex: 1;
  }

  .vendas-thead .h-venda,
  .vendas-row .c-venda,
  .vendas-thead .h-valor,
  .vendas-row .c-valor {
    flex: 0 0 auto;
  }

  .vendas-thead .h-valor,
  .vendas-row .c-valor {
    align-items: center;
    text-align: center;
  }

  .vendas-thead .h-status,
  .vendas-status {
    width: auto;
    flex: 0 0 auto;
  }

  .cash-movement-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .cash-movement-row > .icon {
    display: none;
  }
}

.prod-stock-seg .prod-seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.prod-stock-seg .prod-seg-btn .icon {
  width: 16px;
  height: 16px;
}

.stats-modal-card .prod-seg {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}
.stats-modal-card .prod-seg-btn {
  color: rgba(255, 255, 255, 0.66);
}
.stats-modal-card .prod-seg-btn.active {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.prod-stock-seg {
  width: 100%;
  display: flex;
}
.prod-stock-seg .prod-seg-btn {
  flex: 1;
}
.prod-product-dialog .prod-form-side {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: 4px !important;
}
.prod-product-dialog .prod-form-main {
  display: flex !important;
  flex-direction: column !important;
}
.prod-product-dialog .prod-form-panels-wrapper {
  flex: 1 !important;
  min-height: 0 !important;
  height: auto !important;
}

/* Pix do dia */
.pix-card-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 20px;
  box-sizing: border-box;
}

.pix-main-card {
  background: #ffffff;
  border-radius: 30px;
  padding: 24px;
  border: 1px solid rgba(29, 29, 31, 0.1);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 680px;
  width: 100%;
  box-sizing: border-box;
}

html[data-theme="dark"] .pix-main-card {
  background: #181b22;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.4);
}

.pix-qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.pix-qr-inner {
  background: #ffffff;
  border-radius: 24px;
  padding: 16px;
  border: 1px solid rgba(29, 29, 31, 0.1);
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
}

html[data-theme="dark"] .pix-qr-inner {
  border-color: rgba(255, 255, 255, 0.12);
}

.pix-qr-inner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pix-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #6e6e73;
}
html[data-theme="dark"] .pix-empty-state {
  color: #a1a1a6;
}
.pix-empty-state svg {
  width: 40px;
  height: 40px;
  opacity: 0.5;
}

.pix-key-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #1d1d1f;
  text-align: center;
  word-break: break-word;
}
html[data-theme="dark"] .pix-key-title {
  color: #f5f5f7;
}

.pix-key-card {
  background: #f5f5f7;
  border-radius: 22px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(29, 29, 31, 0.05);
}
html[data-theme="dark"] .pix-key-card {
  background: #111318;
  border-color: rgba(255, 255, 255, 0.05);
}

.pix-key-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(29, 29, 31, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  flex-shrink: 0;
}
html[data-theme="dark"] .pix-key-icon {
  background: #181b22;
  border-color: rgba(255, 255, 255, 0.12);
  color: #2997ff;
}
.pix-key-icon svg {
  width: 20px;
  height: 20px;
}

.pix-key-text {
  flex: 1;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #1d1d1f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html[data-theme="dark"] .pix-key-text {
  color: #f5f5f7;
}

.pix-copy-btn {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(29, 29, 31, 0.1);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}
html[data-theme="dark"] .pix-copy-btn {
  background: #181b22;
  border-color: rgba(255, 255, 255, 0.12);
  color: #2997ff;
}
.pix-copy-btn:hover {
  background: #f5f5f7;
}
html[data-theme="dark"] .pix-copy-btn:hover {
  background: #252830;
}
.pix-copy-btn svg {
  width: 20px;
  height: 20px;
}

/* ===================== Notas Fiscais ===================== */
.notas-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.notas-search {
  flex: 1 1 240px; min-width: 0; display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 14px; border-radius: 18px; background: #f5f5f7;
  border: 1px solid rgba(29, 29, 31, 0.10); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.04);
}
.notas-search .icon { width: 18px; height: 18px; color: var(--blue); flex: 0 0 auto; }
.notas-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #1d1d1f; font: inherit; font-weight: 300; font-size: 13px; }
.notas-search input::placeholder { color: #6e6e73; }

.notas-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.notas-tab {
  height: 36px; padding: 0 16px; border-radius: 10px; border: 1px solid rgba(29, 29, 31, 0.10);
  background: #f5f5f7; color: #6e6e73; font: inherit; font-weight: 300; font-size: 12.5px; cursor: pointer;
}
.notas-tab.active { background: #ffffff; border-color: rgba(var(--blue-rgb), 0.36); color: #1d1d1f; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06), inset 0 0 0 1px rgba(var(--blue-rgb), 0.16); }

.notas-stats { display: flex; gap: 16px; margin-bottom: 12px; font-size: 12.5px; color: #6e6e73; }

.notas-panel { margin-top: 20px; }
.notas-list { display: flex; flex-direction: column; gap: 12px; }

.nota-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 20px;
  background: #f5f5f7;
  border: 1px solid rgba(29, 29, 31, 0.05);
  transition: background 140ms ease;
}
.nota-row:hover { background: #eceef1; }

.nota-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #e8f0fe;
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
}
.nota-avatar svg { width: 22px; height: 22px; }

.nota-main { display: flex; flex-direction: column; gap: 4px; }
.nota-main strong { color: #1d1d1f; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nota-main span { color: #6e6e73; font-size: 13px; }

.nota-status { display: flex; align-items: center; }
.nota-chip {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}
.nota-chip.status-pending { background: #f5f5f7; color: #6e6e73; border: 1px solid rgba(29, 29, 31, 0.1); }
.nota-chip.status-success { background: #e8f0fe; color: var(--blue); border: 1px solid rgba(var(--blue-rgb), 0.2); }
.nota-chip.status-danger { background: #fce4e4; color: #d93025; border: 1px solid rgba(217, 48, 37, 0.2); }

.nota-value { display: flex; align-items: center; justify-content: flex-end; width: 100px; }
.nota-value strong { color: #1d1d1f; font-size: 15px; font-weight: 600; }

.notas-fiscal-badge.ok {
  color: var(--blue);
  background: rgba(var(--blue-rgb), 0.12);
  border-color: rgba(var(--blue-rgb), 0.20);
}

.notas-fiscal-badge.danger {
  color: #c93636;
  background: #ffe3e3;
  border-color: rgba(201, 54, 54, 0.20);
}

.notas-row-action {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #6e6e73;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.notas-row-action:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #1d1d1f;
}

.notas-row-action:active {
  transform: scale(0.96);
}

.notas-row-action .icon {
  width: 19px;
  height: 19px;
}

.notas-action-dialog .stats-modal-close {
  display: inline-flex;
  color: rgba(255, 255, 255, 0.70);
}

.notas-action-danger {
  color: rgba(255, 108, 108, 0.95) !important;
}

.notas-action-danger .icon {
  color: rgba(255, 108, 108, 0.95) !important;
}

.notas-action-danger.disabled,
.notas-action-danger:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.vendas-pill.active {
  background: #ffffff;
  border-color: rgba(var(--blue-rgb), 0.30);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06), inset 0 0 0 1px rgba(var(--blue-rgb), 0.12);
}

.stats-modal-card.notas-filter-dialog {
  width: min(640px, 100%);
}

.stats-modal-card.notas-inutilizar-dialog {
  width: min(560px, 100%);
}

.notas-filter-selects,
.notas-dialog-grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.notas-filter-selects .stats-modal-field,
.notas-dialog-grid .stats-modal-field {
  margin-top: 0;
}

.notas-filter-title {
  display: block;
  margin: 12px 2px 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 900;
}

.notas-status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notas-status-chip {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.82);
  font: inherit;
  font-size: 13px;
  font-weight: 300;
  cursor: pointer;
  transition: transform 150ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.notas-status-chip:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.10);
}

.notas-status-chip.selected {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.notas-textarea-field {
  min-height: 108px;
  align-items: stretch;
  flex-direction: column;
  padding-top: 10px;
}

.notas-option-dialog .stats-modal-secondary {
  width: auto;
  min-width: 104px;
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.76);
}

.stats-modal-card.notas-new-dialog {
  width: min(1040px, calc(100vw - 48px));
  max-height: min(860px, calc(100vh - 48px));
  padding: 0;
  border-radius: 24px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(30, 30, 30, 0.96);
  color: #ffffff;
  overflow: hidden;
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.34);
}

.notas-new-dialog .stats-modal-head {
  margin: 0;
  padding: 16px 16px 14px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.notas-new-dialog .stats-modal-head h3 {
  color: rgba(255, 255, 255, 0.94);
  font-size: 18px;
  font-weight: 900;
}

.notas-new-dialog .stats-modal-close {
  color: rgba(255, 255, 255, 0.70);
}

.notas-new-dialog .stats-modal-body {
  padding: 14px;
  overflow: auto;
}

.notas-new-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.notas-new-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.notas-new-tab {
  height: 38px;
  flex: 1 1 0;
  min-width: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  font: inherit;
  font-size: 13px;
  font-weight: 300;
  cursor: pointer;
  transition: transform 150ms ease, background 160ms ease, color 160ms ease;
}

.notas-new-tab:hover {
  transform: translateY(-1px);
  color: rgba(255, 255, 255, 0.92);
}

.notas-new-tab.active {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.notas-new-panel {
  display: none;
  animation: statsContentIn 180ms ease-out both;
}

.notas-new-panel.active {
  display: block;
}

.notas-new-panel h4 {
  margin: 2px 0 12px;
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
}

.notas-new-grid {
  display: grid;
  gap: 10px;
}

.notas-new-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.notas-new-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.notas-editor-field {
  min-height: 62px;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.notas-editor-field span {
  color: rgba(255, 255, 255, 0.62);
}

.notas-editor-field input,
.notas-editor-field select,
.notas-filter-dialog .stats-modal-field select {
  width: 100%;
  min-height: 24px;
  border: 0;
  outline: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.94);
  font: inherit;
  font-size: 14px;
  font-weight: 300;
  color-scheme: dark;
}

.notas-editor-field input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.notas-new-empty {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 26px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
}

.notas-new-empty.hidden {
  display: none;
}

.notas-new-empty .icon {
  width: 64px;
  height: 64px;
  color: rgba(255, 255, 255, 0.24);
}

.notas-new-empty strong {
  color: #ffffff;
  font-size: 17px;
  font-weight: 900;
}

.notas-new-empty span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
  font-weight: 300;
}

.notas-add-item-btn,
.notas-add-item-inline {
  width: auto;
  min-width: 160px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.notas-add-item-inline {
  margin-top: 10px;
}

.notas-new-empty:not(.hidden) ~ .notas-add-item-inline {
  display: none;
}

.notas-new-item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notas-draft-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto max-content;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
}

.notas-draft-actions {
  display: flex;
  gap: 6px;
}

/* Item herdado de uma venda, sem NCM/CFOP/tributação: a nota é recusada pela
   SEFAZ enquanto ele estiver assim. */
.notas-draft-item.pending-fiscal {
  border-color: rgba(214, 138, 20, 0.55);
  background: rgba(214, 138, 20, 0.12);
}

.notas-draft-item .notas-draft-item-issue {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  color: #b9781a;
  font-size: 12px;
  font-weight: 500;
}

.notas-draft-item .notas-draft-item-issue .icon {
  width: 14px;
  height: 14px;
  flex: none;
}

.notas-draft-item strong,
.notas-draft-item b {
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
}

.notas-draft-item span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 300;
}

.notas-draft-item button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.76);
  cursor: pointer;
}

.notas-draft-item button .icon {
  width: 17px;
  height: 17px;
}

.notas-total-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.notas-total-grid div {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.notas-total-grid span {
  display: block;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 300;
}

.notas-total-grid strong {
  display: block;
  margin-top: 5px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
}

.notas-new-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.notas-new-actions .stats-modal-danger,
.notas-new-actions .stats-modal-primary {
  width: auto;
  min-width: 136px;
  border-radius: 14px;
}

.notas-new-actions .stats-modal-primary {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.notas-editor-screen {
  flex: 1 0 auto;
  min-height: calc(var(--app-height) - 16px);
  margin-top: 52px;
  padding: 20px 20px 72px;
  background: transparent;
  color: #111113;
  font-family: var(--apple-font);
  font-weight: 300;
}

.notas-editor-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border-radius: 28px;
  border: 1px solid rgba(29, 29, 31, 0.06);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.05);
}

.notas-editor-form h1,
.notas-editor-form h2 {
  margin: 0;
  color: #111113;
  font-weight: 500;
  letter-spacing: 0;
}

.notas-editor-form h1 {
  margin-bottom: 6px;
  font-size: 26px;
  line-height: 1.12;
}

.notas-editor-mobile-header {
  margin-bottom: 6px;
}

.notas-editor-mobile-header h1 {
  margin-bottom: 0;
}

.notas-editor-form h2 {
  margin-top: 12px;
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.14;
}

.notas-page-grid {
  display: grid;
  gap: 10px;
}

.notas-page-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.notas-page-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.notas-page-grid.recipient-main {
  grid-template-columns: minmax(0, 3fr) minmax(190px, 1fr);
}

/* Texto de apoio dentro do campo (usado no Número da nota, que só deve ser
   preenchido quando a série vem usada de outro emissor). Fica dentro da mesma
   caixa do campo, abaixo do input, sem empurrar o layout da grade. */
.notas-page-field-hint {
  display: block;
  margin-top: 3px;
  font: 400 10.5px/1.35 var(--apple-font);
  color: rgba(29, 29, 31, 0.52);
}

html[data-theme="dark"] .notas-page-field-hint {
  color: rgba(255, 255, 255, 0.48);
}

.notas-page-field {
  min-height: 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  gap: 2px;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  border: 1px solid rgba(29, 29, 31, 0.06);
  background: #f5f5f7;
  color: #111113;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70);
}

.notas-page-field.compact {
  width: min(206px, 100%);
}

.notas-page-field.address {
  width: min(88px, 100%);
}

.notas-page-field.full {
  width: 100%;
}

.notas-page-field span {
  display: block;
  color: #5e5e62;
  font-size: 11px;
  line-height: 1.05;
  font-weight: 300;
}

.notas-page-field input,
.notas-page-field select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111113;
  font: inherit;
  font-size: 14px;
  line-height: 1.12;
  font-weight: 300;
  appearance: auto;
}

.notas-page-field.empty input {
  color: #111113;
}

.notas-page-field input::placeholder {
  color: #5e5e62;
  opacity: 1;
}

.notas-page-field.strong-value input {
  font-size: 15px;
}

.notas-page-empty {
  min-height: 198px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 18px;
  text-align: center;
}

.notas-page-empty.hidden {
  display: none;
}

.notas-page-empty .icon {
  width: 64px;
  height: 64px;
  color: rgba(17, 17, 19, 0.24);
}

.notas-page-empty strong {
  color: #111113;
  font-size: 16px;
  line-height: 1.1;
  font-weight: 500;
}

.notas-page-empty span {
  color: #333337;
  font-size: 12px;
  line-height: 1.1;
  font-weight: 300;
}

.notas-page-add-btn,
.notas-page-add-inline {
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  border: 1px solid rgba(29, 29, 31, 0.06);
  background: #f5f5f7;
  color: #111113;
  font: inherit;
  font-size: 13px;
  font-weight: 300;
  cursor: pointer;
}

.notas-page-add-btn .icon,
.notas-page-add-inline .icon {
  width: 16px;
  height: 16px;
}

.notas-page-add-inline {
  align-self: flex-start;
}

.notas-page-empty:not(.hidden) ~ .notas-page-add-inline {
  display: none;
}

/* Pop-ups do editor fiscal: seguem o mesmo tema claro/escuro da página nova. */
.stats-modal-card.notas-page-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  border-radius: 24px;
  border: 1px solid rgba(29, 29, 31, 0.08);
  background: rgba(255, 255, 255, 0.98);
  color: #111113;
  overflow: hidden;
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.18);
}

.stats-modal-card.notas-page-choice-dialog {
  width: min(420px, calc(100vw - 32px));
}

.stats-modal-card.notas-page-picker-dialog {
  width: min(620px, calc(100vw - 32px));
}

.stats-modal-card.notas-page-item-dialog {
  width: min(760px, calc(100vw - 32px));
}

.notas-page-dialog .stats-modal-head {
  margin: 0;
  padding: 16px 16px 14px 20px;
  border-bottom: 1px solid rgba(29, 29, 31, 0.07);
}

.notas-page-dialog .stats-modal-head h3 {
  color: #111113;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 500;
}

.notas-page-dialog .stats-modal-close {
  display: inline-flex;
  color: #6e6e73;
}

.notas-page-dialog .stats-modal-close:hover {
  background: #f1f1f3;
  color: #111113;
}

.notas-page-dialog .stats-modal-body {
  padding: 14px;
  overflow: auto;
}

.notas-page-choice-dialog .stats-option-list {
  max-height: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notas-page-dialog .stats-option-tile {
  min-height: 52px;
  height: auto;
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  border-color: rgba(29, 29, 31, 0.07);
  background: #f5f5f7;
  color: #111113;
}

.notas-page-dialog .stats-option-tile:hover {
  border-color: rgba(var(--blue-rgb), 0.20);
  background: #eeeef1;
}

.notas-page-dialog .stats-option-tile > span:not(.icon) {
  color: #111113;
}

.notas-page-dialog .stats-option-tile .icon {
  color: #6e6e73;
}

.notas-page-picker-dialog .os-pick-search-wrap {
  border-color: rgba(29, 29, 31, 0.07);
  background: #f5f5f7;
}

.notas-page-picker-dialog .os-pick-search-wrap .icon {
  color: #6e6e73;
}

.notas-page-picker-dialog .os-pick-search-wrap input {
  color: #111113;
  color-scheme: light;
}

.notas-page-picker-dialog .os-pick-search-wrap input::placeholder,
.notas-page-picker-dialog .os-pick-empty {
  color: #6e6e73;
}

.notas-page-picker-dialog .os-pick-list {
  max-height: min(56vh, 520px);
}

.notas-page-picker-dialog .os-pick-tile > span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.notas-page-picker-dialog .os-pick-tile small {
  color: #6e6e73;
  font-size: 11px;
  font-weight: 300;
}

.notas-page-picker-dialog .os-pick-tile .os-pick-price {
  color: #111113;
}

.notas-page-item-dialog .stats-modal-body {
  padding: 14px;
}

.notas-page-item-dialog .stats-modal-field {
  min-height: 62px;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 4px;
  padding: 9px 12px;
  border-radius: 12px;
  border-color: rgba(29, 29, 31, 0.06);
  background: #f5f5f7;
}

.notas-page-item-dialog .stats-modal-field span {
  color: #5e5e62;
  font-size: 11px;
}

.notas-page-item-dialog .stats-modal-field input,
.notas-page-item-dialog .stats-modal-field select,
.notas-page-item-dialog .stats-modal-field textarea {
  width: 100%;
  color: #111113;
  color-scheme: light;
}

.notas-page-item-dialog .stats-modal-field input::placeholder {
  color: #6e6e73;
  opacity: 1;
}

.notas-page-dialog .stats-modal-foot {
  margin: 0;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(29, 29, 31, 0.07);
}

.notas-page-dialog .stats-modal-primary,
.notas-page-dialog .stats-modal-danger {
  width: auto;
  min-width: 124px;
  height: 42px;
  border-radius: 999px;
}

.notas-page-dialog .stats-modal-primary {
  border: 0;
  background: var(--blue);
  color: #ffffff;
}

.notas-page-dialog .stats-modal-danger {
  border: 1px solid rgba(255, 59, 48, 0.20);
  background: rgba(255, 59, 48, 0.08);
  color: #c12720;
}

html[data-theme="dark"] .stats-modal-card.notas-page-dialog {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(18, 19, 23, 0.98);
  color: #f5f5f7;
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.46);
}

html[data-theme="dark"] .notas-page-dialog .stats-modal-head,
html[data-theme="dark"] .notas-page-dialog .stats-modal-foot {
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .notas-page-dialog .stats-modal-head h3 {
  color: #f5f5f7;
}

html[data-theme="dark"] .notas-page-dialog .stats-modal-close {
  color: rgba(255, 255, 255, 0.68);
}

html[data-theme="dark"] .notas-page-dialog .stats-modal-close:hover,
html[data-theme="dark"] .notas-page-dialog .stats-option-tile:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
}

html[data-theme="dark"] .notas-page-dialog .stats-option-tile,
html[data-theme="dark"] .notas-page-picker-dialog .os-pick-search-wrap,
html[data-theme="dark"] .notas-page-item-dialog .stats-modal-field {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .notas-page-dialog .stats-option-tile > span:not(.icon),
html[data-theme="dark"] .notas-page-picker-dialog .os-pick-tile .os-pick-price,
html[data-theme="dark"] .notas-page-picker-dialog .os-pick-search-wrap input,
html[data-theme="dark"] .notas-page-item-dialog .stats-modal-field input,
html[data-theme="dark"] .notas-page-item-dialog .stats-modal-field select,
html[data-theme="dark"] .notas-page-item-dialog .stats-modal-field textarea {
  color: #f5f5f7;
  color-scheme: dark;
}

html[data-theme="dark"] .notas-page-dialog .stats-option-tile .icon,
html[data-theme="dark"] .notas-page-picker-dialog .os-pick-search-wrap .icon,
html[data-theme="dark"] .notas-page-picker-dialog .os-pick-tile small,
html[data-theme="dark"] .notas-page-picker-dialog .os-pick-empty,
html[data-theme="dark"] .notas-page-item-dialog .stats-modal-field span,
html[data-theme="dark"] .notas-page-item-dialog .stats-modal-field input::placeholder {
  color: rgba(255, 255, 255, 0.58);
}

html[data-theme="dark"] .notas-page-dialog .stats-modal-danger {
  border-color: rgba(255, 77, 77, 0.30);
  background: rgba(255, 77, 77, 0.10);
  color: #ff6c6c;
}

.notas-page-item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notas-page-item-list .notas-draft-item {
  border-color: rgba(17, 17, 19, 0.08);
  background: #ffffff;
}

.notas-page-item-list .notas-draft-item strong,
.notas-page-item-list .notas-draft-item b {
  color: #111113;
  font-weight: 300;
}

.notas-page-item-list .notas-draft-item span {
  color: #6e6e73;
  font-weight: 300;
}

.notas-page-item-list .notas-draft-item button {
  background: #f1f1f3;
  color: var(--blue);
}

.notas-page-item-list .notas-draft-item.pending-fiscal {
  border-color: rgba(184, 116, 12, 0.45);
  background: #fff8ec;
}

html[data-theme="dark"] .notas-page-item-list .notas-draft-item.pending-fiscal {
  border-color: rgba(240, 178, 78, 0.42);
  background: rgba(240, 178, 78, 0.12);
}

html[data-theme="dark"] .notas-draft-item .notas-draft-item-issue {
  color: #f0b24e;
}

html[data-theme="dark"] .notas-page-item-list .notas-draft-item {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}
html[data-theme="dark"] .notas-page-item-list .notas-draft-item strong,
html[data-theme="dark"] .notas-page-item-list .notas-draft-item b {
  color: #f5f5f7;
}
html[data-theme="dark"] .notas-page-item-list .notas-draft-item span {
  color: rgba(255, 255, 255, 0.58);
}
html[data-theme="dark"] .notas-page-item-list .notas-draft-item button {
  background: rgba(255, 255, 255, 0.08);
  color: #a4a7ae;
}
html[data-theme="dark"] .notas-page-item-list .notas-draft-item button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.notas-page-total-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.notas-page-subtitle {
  margin: 0 0 -4px;
  color: #333337;
  font-size: 13px;
  font-weight: 500;
}

.notas-page-total-grid.taxes {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.notas-page-total-grid > div,
.notas-page-total-grid > label {
  min-height: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(29, 29, 31, 0.06);
  background: #f5f5f7;
}

.notas-page-total-card.editable {
  cursor: text;
}

.notas-page-total-grid span {
  color: #5e5e62;
  font-size: 11px;
  font-weight: 300;
}

.notas-page-total-grid strong {
  color: #111113;
  font-size: 15px;
  font-weight: 300;
}

.notas-page-total-grid input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111113;
  font: inherit;
  font-size: 15px;
  font-weight: 300;
}

.notas-page-payment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notas-page-payment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.8fr) 40px;
  align-items: center;
  gap: 10px;
}

.notas-page-payment-row .notas-page-field {
  min-height: 54px;
}

.notas-page-payment-value input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111113;
  font: inherit;
  font-size: 14px;
  font-weight: 300;
}

.notas-page-remove-payment {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 59, 48, 0.16);
  border-radius: 12px;
  background: rgba(255, 59, 48, 0.08);
  color: #c12720;
  cursor: pointer;
}

.notas-page-remove-payment:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

.notas-page-remove-payment .icon {
  width: 17px;
  height: 17px;
}

.notas-page-add-payment {
  height: 34px;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 300;
  cursor: pointer;
}

.notas-page-add-payment .icon {
  width: 16px;
  height: 16px;
}

.notas-page-additional-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.notas-page-textarea {
  min-height: 170px;
  justify-content: flex-start;
  padding-top: 12px;
}

.notas-page-textarea textarea {
  flex: 1 1 auto;
  min-height: 132px;
  resize: vertical;
}

.notas-page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
}

.notas-page-submit-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notas-page-back,
.notas-page-save,
.notas-page-send {
  height: 42px;
  min-width: 136px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 300;
  cursor: pointer;
}

.notas-page-back {
  border: 1px solid rgba(255, 59, 48, 0.24);
  background: rgba(255, 59, 48, 0.10);
  color: #c12720;
}

.notas-page-save {
  border: 0;
  background: #f5f5f7;
  color: #111113;
  box-shadow: inset 0 0 0 1px rgba(29, 29, 31, 0.06);
}

.notas-page-send {
  border: 0;
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(var(--blue-rgb), 0.20);
}

.notas-page-send .icon {
  width: 16px;
  height: 16px;
}

.notas-page-save:disabled,
.notas-page-send:disabled {
  opacity: 0.58;
  cursor: wait;
}

.notas-new-actions.single {
  justify-content: flex-end;
}

/* Dark mode for Notas */
html[data-theme="dark"] .notas-search { background: #1c1d21; border-color: rgba(255, 255, 255, 0.1); }
html[data-theme="dark"] .notas-search input { color: #f5f5f7; }
html[data-theme="dark"] .notas-tab { background: #1c1d21; border-color: rgba(255, 255, 255, 0.1); color: #a1a1a6; }
html[data-theme="dark"] .notas-tab.active { background: var(--blue); border-color: var(--blue); color: #ffffff; }
html[data-theme="dark"] .vendas-pill.active { background: rgba(255, 255, 255, 0.10); border-color: rgba(94, 168, 255, 0.32); }
html[data-theme="dark"] .nota-row { background: #181b22; border-color: rgba(255, 255, 255, 0.05); }
html[data-theme="dark"] .nota-row:hover { background: #22252c; }
html[data-theme="dark"] .nota-main strong { color: #f5f5f7; }
html[data-theme="dark"] .nota-value strong { color: #f5f5f7; }
html[data-theme="dark"] .nota-avatar { background: #1c1d21; color: #2997ff; }
html[data-theme="dark"] .nota-chip.status-pending { background: #1c1d21; color: #a1a1a6; border-color: rgba(255, 255, 255, 0.1); }
html[data-theme="dark"] .nota-chip.status-success { background: rgba(var(--blue-rgb), 0.2); color: #2997ff; border-color: rgba(var(--blue-rgb), 0.4); }
html[data-theme="dark"] .nota-chip.status-danger { background: rgba(217, 48, 37, 0.2); color: #f28b82; border-color: rgba(217, 48, 37, 0.4); }
html[data-theme="dark"] .notas-fiscal-badge.ok {
  color: #5ea8ff;
  background: rgba(94, 168, 255, 0.14);
  border-color: rgba(94, 168, 255, 0.26);
}
html[data-theme="dark"] .notas-fiscal-badge.danger {
  color: #ff6c6c;
  background: rgba(255, 108, 108, 0.12);
  border-color: rgba(255, 108, 108, 0.24);
}
html[data-theme="dark"] .notas-row-action {
  color: #a4a7ae;
}
html[data-theme="dark"] .notas-row-action:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #f5f5f7;
}
html[data-theme="dark"] .notas-editor-form {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(18, 19, 23, 0.94);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}
html[data-theme="dark"] .notas-editor-form h1,
html[data-theme="dark"] .notas-editor-form h2,
html[data-theme="dark"] .notas-page-subtitle,
html[data-theme="dark"] .notas-page-field input,
html[data-theme="dark"] .notas-page-field select,
html[data-theme="dark"] .notas-page-payment-value input,
html[data-theme="dark"] .notas-page-total-grid input,
html[data-theme="dark"] .notas-page-total-grid strong,
html[data-theme="dark"] .notas-page-empty strong,
html[data-theme="dark"] .notas-page-save {
  color: #f5f5f7;
}
html[data-theme="dark"] .notas-page-field,
html[data-theme="dark"] .notas-page-total-grid > div,
html[data-theme="dark"] .notas-page-total-grid > label,
html[data-theme="dark"] .notas-page-save {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}
html[data-theme="dark"] .notas-page-field span,
html[data-theme="dark"] .notas-page-field input::placeholder,
html[data-theme="dark"] .notas-page-total-grid span,
html[data-theme="dark"] .notas-page-empty span {
  color: rgba(255, 255, 255, 0.58);
}
html[data-theme="dark"] .notas-page-field .notas-select-caret {
  color: #f5f5f7;
  opacity: 1;
}
html[data-theme="dark"] .notas-page-add-btn,
html[data-theme="dark"] .notas-page-add-inline {
  border-color: rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
}
html[data-theme="dark"] .notas-page-add-btn .icon,
html[data-theme="dark"] .notas-page-add-inline .icon {
  color: rgba(255, 255, 255, 0.72);
}
html[data-theme="dark"] .notas-page-add-btn:hover,
html[data-theme="dark"] .notas-page-add-inline:hover {
  background: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .notas-page-remove-payment {
  border-color: rgba(255, 77, 77, 0.24);
  background: rgba(255, 77, 77, 0.10);
  color: #ff6c6c;
}

/* ===================== Editor de Ordem de Serviço (página Novo) ===================== */
.os-ed-client-field {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.os-ed-client-main {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}
.os-ed-cpf-option {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  border-left: 1px solid rgba(29, 29, 31, 0.09);
}
.os-ed-cpf-option.is-hidden { display: none; }
.notas-page-field .os-ed-cpf-option > span {
  color: #5e5e62;
  font-size: 12px;
  font-weight: 400;
}
.os-ed-cpf-switch {
  position: relative;
  width: 38px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.24);
  cursor: pointer;
  transition: background 160ms ease, transform 120ms ease;
}
.os-ed-cpf-switch:active { transform: scale(0.96); }
.os-ed-cpf-switch i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.24);
  transition: transform 160ms ease;
}
.os-ed-cpf-switch.on { background: var(--blue); }
.os-ed-cpf-switch.on i { transform: translateX(16px); }

html[data-theme="dark"] .os-ed-cpf-option {
  border-left-color: rgba(255, 255, 255, 0.12);
}

.notas-page-field textarea {
  width: 100%; min-width: 0; border: 0; outline: 0; background: transparent;
  color: #111113; font: inherit; font-size: 14px; line-height: 1.35; font-weight: 300;
  resize: vertical; padding: 2px 0;
}
.notas-page-field textarea::placeholder { color: #5e5e62; opacity: 1; }
.notas-page-field.os-ed-textarea { justify-content: flex-start; }

.notas-page-total-grid.os-total-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.notas-page-total-grid.os-total-4 div { align-items: flex-end; text-align: right; }

.os-ed-checklist { display: flex; flex-direction: column; gap: 8px; }
.os-ed-checklist-box {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border-radius: 12px;
  border: 1px solid rgba(29, 29, 31, 0.08); background: #f5f5f7;
}
.os-ed-tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px;
  border: 1px solid rgba(31, 209, 122, 0.30); background: rgba(31, 209, 122, 0.12); color: #17a06a;
  font-size: 12px; font-weight: 500;
}
.os-ed-tag .icon { width: 13px; height: 13px; }
.os-checklist-list { max-height: 52vh; overflow: auto; }
.os-checklist-choice { justify-content: flex-start !important; gap: 9px; text-align: left; }
.os-checklist-choice .icon { width: 16px; height: 16px; color: #1fd17a; flex: 0 0 16px; }
.os-checklist-choice span { flex: 1; min-width: 0; }

/* Diálogo Novo/Editar serviço — espaçamento uniforme entre campos */
.os-svc-form { display: flex; flex-direction: column; gap: 10px; }
.os-svc-form > * { margin-top: 0; }

/* Diálogo Adicionar Serviço/Produto — campo seletor + qtd/valor */
.stats-modal-card.os-line-dialog { width: min(560px, 100%); }
.os-line-picker { margin-bottom: 10px; }
.os-line-picker > .icon { width: 18px; height: 18px; flex: 0 0 18px; color: rgba(255, 255, 255, 0.55); }
.os-line-picker span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-line-stock { margin: -2px 0 10px; color: var(--pop-muted); font-size: 12px; }
.os-line-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.os-line-fields .stats-modal-field { margin-top: 0; }

/* Picker "Selecionar produto/serviço" — estrutura; cores no tema novo */
.stats-modal-card.os-pick-dialog { width: min(560px, 100%); }
.os-pick-search-wrap {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; margin-bottom: 10px;
  border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.06);
}
.os-pick-search-wrap .icon { width: 18px; height: 18px; color: rgba(255, 255, 255, 0.6); flex: 0 0 18px; }
.os-pick-search-wrap input { flex: 1; min-width: 0; border: 0; background: transparent; color: rgba(255, 255, 255, 0.92); font: inherit; font-size: 14px; outline: none; }
.os-pick-search-wrap input::placeholder { color: rgba(255, 255, 255, 0.5); }
.os-pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 56vh; overflow: auto; }
.os-pick-tile.has-stock { min-height: 58px; }
.os-pick-tile .os-pick-copy { display: flex; flex-direction: column; gap: 3px; }
.os-pick-tile .os-pick-copy > span { overflow: hidden; text-overflow: ellipsis; }
.os-pick-tile .os-pick-copy small { color: var(--pop-muted); font-size: 11px; font-weight: 400; }
.os-pick-tile .os-pick-price { margin-left: auto; padding: 0 10px; color: rgba(255, 255, 255, 0.9); font-weight: 500; font-size: 12.5px; white-space: nowrap; }
.os-pick-empty { padding: 26px 10px; text-align: center; color: rgba(255, 255, 255, 0.6); font-size: 13px; }
/* Só a lista rola: em tela alta os 56vh da lista passavam do teto de 680px do
   card e o corpo ganhava uma segunda barra, por fora. Agora a lista encolhe para
   caber no card e a busca fica fixa no topo. */
.stats-modal-card.os-pick-dialog .stats-modal-body { display: flex; flex-direction: column; min-height: 0; }
.stats-modal-card.os-pick-dialog .os-pick-search-wrap { flex: 0 0 auto; }
.stats-modal-card.os-pick-dialog .os-pick-list { flex: 1 1 auto; min-height: 0; }

.os-ed-payments { display: flex; flex-wrap: wrap; gap: 8px; }
.os-ed-payments:empty { display: none; }
.os-ed-hint { color: #6e6e73; font-size: 13px; font-weight: 300; margin: 0; }
.os-ed-hint.hidden { display: none; }

/* Botão outline — réplica de _InlineOutlineButton do Flutter */
.os-ed-outline-btn {
  height: 40px; align-self: flex-start; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 16px; border-radius: 10px; border: 1px solid rgba(29, 29, 31, 0.24);
  background: transparent; color: #1d1d1f; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}
.os-ed-outline-btn:hover { background: rgba(0, 0, 0, 0.035); }
.os-ed-outline-btn.green { border-color: rgba(31, 209, 122, 0.44); background: rgba(31, 209, 122, 0.12); color: #17a06a; }
.os-ed-outline-btn.danger { border-color: rgba(255, 77, 77, 0.34); color: #e5484d; }
.os-ed-outline-btn.danger:hover { background: rgba(255, 77, 77, 0.06); }
.os-ed-pay-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid rgba(29, 29, 31, 0.10); background: #f5f5f7; color: #111113; font-size: 13px; font-weight: 400;
}
.os-ed-pay-chip .icon { width: 15px; height: 15px; color: var(--blue); }

.os-live-update[hidden] { display: none; }
.os-live-update {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 16px; border: 1px solid rgba(255, 149, 0, 0.34); border-radius: 14px;
  background: rgba(255, 149, 0, 0.10); color: #7a4700;
}
.os-live-update > div:first-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.os-live-update strong { font-size: 13px; font-weight: 750; }
.os-live-update span { font-size: 12px; line-height: 1.35; }
.os-live-update-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.os-live-update-actions button {
  min-height: 36px; padding: 0 13px; border: 0; border-radius: 9px;
  background: #d97900; color: #fff; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.os-live-update-actions button.ghost {
  border: 1px solid rgba(122, 71, 0, 0.24); background: transparent; color: #7a4700;
}

.os-ed-save-group { display: flex; gap: 10px; }
.notas-page-save.os-ed-save-draft, .notas-page-save.os-ed-save-plain { background: #8e8e93; color: #fff; box-shadow: none; }
.notas-page-save.os-ed-save-draft:hover, .notas-page-save.os-ed-save-plain:hover { background: #707075; }
.notas-page-save.os-ed-save-primary { background: var(--blue); color: #fff; box-shadow: none; }
.notas-page-save.os-ed-save-primary:hover { background: #0063c9; }

/* Dark */
html[data-theme="dark"] .notas-page-save.os-ed-save-draft, html[data-theme="dark"] .notas-page-save.os-ed-save-plain { background: #444; color: #fff; box-shadow: none; }
html[data-theme="dark"] .notas-page-save.os-ed-save-draft:hover, html[data-theme="dark"] .notas-page-save.os-ed-save-plain:hover { background: #555; }
html[data-theme="dark"] .notas-page-field textarea { color: #f5f5f7; }
html[data-theme="dark"] .notas-page-field textarea::placeholder { color: rgba(255, 255, 255, 0.58); }
html[data-theme="dark"] .os-ed-pay-chip { border-color: rgba(255, 255, 255, 0.10); background: rgba(255, 255, 255, 0.06); color: #f5f5f7; }
html[data-theme="dark"] .os-ed-hint { color: rgba(255, 255, 255, 0.58); }
html[data-theme="dark"] .notas-page-save.os-ed-save-primary { background: var(--blue); color: #fff; box-shadow: none; }
html[data-theme="dark"] .os-ed-checklist-box { border-color: rgba(255, 255, 255, 0.08); background: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .os-ed-outline-btn { border-color: rgba(255, 255, 255, 0.32); color: rgba(255, 255, 255, 0.92); }
html[data-theme="dark"] .os-ed-outline-btn:hover { background: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .os-ed-outline-btn.green { border-color: rgba(31, 209, 122, 0.44); background: rgba(31, 209, 122, 0.14); color: #4fe39a; }
html[data-theme="dark"] .os-ed-outline-btn.danger { border-color: rgba(255, 77, 77, 0.40); color: #ff8a8a; }
html[data-theme="dark"] .os-live-update { border-color: rgba(255, 179, 64, 0.36); background: rgba(255, 149, 0, 0.12); color: #ffd08a; }
html[data-theme="dark"] .os-live-update-actions button.ghost { border-color: rgba(255, 208, 138, 0.30); color: #ffd08a; }

@media (max-width: 768px) {
  .notas-page-total-grid.os-total-4 { grid-template-columns: 1fr 1fr; }
  .os-ed-save-group { flex-direction: column; width: 100%; }
  .os-ed-save-group .notas-page-save { width: 100%; }
  .os-live-update { align-items: stretch; flex-direction: column; }
  .os-live-update-actions { flex-direction: column; }
  .os-live-update-actions button { width: 100%; }
}

@media (max-width: 768px) {
  .notas-search { flex: 1 1 100%; }
  .stats-modal-card.notas-filter-dialog,
  .stats-modal-card.notas-inutilizar-dialog,
  .stats-modal-card.notas-new-dialog {
    width: calc(100vw - 28px);
    max-height: calc(100vh - 28px);
  }
  .notas-filter-selects,
  .notas-dialog-grid.two,
  .notas-new-grid.two,
  .notas-new-grid.three,
  .notas-total-grid {
    grid-template-columns: 1fr;
  }
  .notas-new-tabs {
    overflow-x: auto;
  }
  .notas-new-tab {
    flex: 0 0 auto;
    padding: 0 14px;
  }
  .notas-new-actions {
    flex-direction: column;
  }
  .notas-new-actions .stats-modal-danger,
  .notas-new-actions .stats-modal-primary {
    width: 100%;
  }
  .notas-editor-screen {
    margin-top: 18px;
    padding: 16px 8px 48px;
  }
  .notas-editor-form {
    padding: 16px;
    border-radius: 20px;
  }
  .notas-page-grid.two,
  .notas-page-grid.three,
  .notas-page-grid.recipient-main,
  .notas-page-additional-grid,
  .notas-page-total-grid {
    grid-template-columns: 1fr;
  }
  .notas-page-payment-row {
    grid-template-columns: minmax(0, 1fr) 40px;
  }
  .notas-page-payment-row .notas-page-payment-value {
    grid-column: 1;
  }
  .notas-page-payment-row .notas-page-remove-payment {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
  .notas-page-field.compact,
  .notas-page-field.address {
    width: 100%;
  }
  .notas-page-actions {
    flex-direction: column;
  }
  .notas-page-submit-actions {
    width: 100%;
    flex-direction: column;
  }
  .notas-page-back,
  .notas-page-save,
  .notas-page-send {
    width: 100%;
  }
  .nota-row { grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-rows: auto auto; padding: 12px; }
  .nota-avatar { grid-column: 1; grid-row: 1; width: 40px; height: 40px; }
  .nota-main { grid-column: 2; grid-row: 1; }
  .nota-status { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; margin-top: 8px; }
  .nota-value { grid-column: 3; grid-row: 1; width: auto; }
}

/* ---------- Barra de atualizar página (web update banner, espelha pop-ups do sistema) ---------- */
/* Fica abaixo dos pop-ups (.stats-modal-root = 99999) de propósito: aviso de
   versão não pode tapar o rodapé de um diálogo aberto. */
.web-update-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99998;
  display: flex;
  justify-content: center;
  padding: 0;
  pointer-events: none;
}
.web-update-banner-inner {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  width: 50%;
  min-width: 288px;
  max-width: calc(100% - 24px);
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px calc(7px + var(--safe-bottom, 0px));
  border-radius: 20px 20px 0 0;
  background: #ffffff;
  border: 1px solid rgba(29, 29, 31, 0.10);
  border-bottom: 0;
  box-shadow: 0 -12px 30px rgba(29, 29, 31, 0.14);
  animation: bannerDropExpand 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.web-update-banner-inner::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(0, 113, 227, 0.18);
  border-top-color: #0071e3;
  border-right-color: #0071e3;
  border-radius: 50%;
  animation: bannerSpinnerSpin 0.7s linear infinite, bannerSpinnerFade 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  z-index: 2;
  pointer-events: none;
}

.web-update-banner-icon,
.web-update-banner-msg,
.web-update-banner-btn,
.web-update-banner-close {
  position: relative;
  z-index: 1;
  opacity: 0;
  animation: bannerContentFadeIn 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.web-update-banner-icon {
  flex: none;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #f5f5f7;
  border: 1px solid rgba(29, 29, 31, 0.08);
  color: #1d1d1f;
}
.web-update-banner-icon svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}
.web-update-banner-msg {
  flex: 1 1 auto;
  min-width: 0;
  color: #1d1d1f;
  font-family: var(--apple-font);
  font-weight: 300;
  font-size: 13.5px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.web-update-banner-btn {
  flex: none;
  min-width: 88px;
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0, 113, 227, 0.20);
  background: #ffffff;
  color: #0071e3;
  font-family: var(--apple-font);
  font-weight: 300;
  font-size: 13.5px;
  letter-spacing: -0.2px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.web-update-banner-btn:hover { background: #eef4fd; }
.web-update-banner-btn:active { transform: scale(0.97); }
.web-update-banner-close {
  flex: none;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(29, 29, 31, 0.45);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.web-update-banner-close svg { width: 13px; height: 13px; fill: currentColor; }
.web-update-banner-close:hover { background: #f5f5f7; color: #1d1d1f; }

/* Botão virando indicador durante o download da nova versão do programa. */
.web-update-banner-btn:disabled {
  cursor: default;
  background: #f5f5f7;
  color: rgba(29, 29, 31, 0.55);
  border-color: rgba(29, 29, 31, 0.10);
  font-variant-numeric: tabular-nums;
}
.web-update-banner-btn:disabled:hover { background: #f5f5f7; }
.web-update-banner-btn:disabled:active { transform: none; }

.web-update-banner-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  z-index: 3;
  background: rgba(29, 29, 31, 0.08);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.web-update-banner.is-busy .web-update-banner-progress { opacity: 1; }
.web-update-banner-progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: #0071e3;
  transition: width 0.25s ease;
}

/* A barra de ação do PDV também mora no rodapé: sobe junto enquanto o aviso
   estiver na tela (a altura vem do JS, em --web-update-banner-h). */
html.has-web-update-banner .pos-mobile-bar {
  bottom: var(--web-update-banner-h, 0px);
  transition: bottom 0.18s ease;
}

html[data-theme="dark"] .web-update-banner-inner {
  background: #000000;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.48);
}

html[data-theme="dark"] .web-update-banner-inner::before {
  border-color: rgba(255, 255, 255, 0.20);
  border-top-color: #ffffff;
  border-right-color: #ffffff;
}

html[data-theme="dark"] .web-update-banner-icon {
  background: #1c1c1e;
  border-color: rgba(255, 255, 255, 0.10);
  color: #ffffff;
}

html[data-theme="dark"] .web-update-banner-msg {
  color: #ffffff;
}

html[data-theme="dark"] .web-update-banner-btn {
  border-color: rgba(255, 255, 255, 0.16);
  background: #1c1c1e;
  color: #ffffff;
}

html[data-theme="dark"] .web-update-banner-btn:hover {
  background: #2c2c2e;
}

html[data-theme="dark"] .web-update-banner-close {
  color: rgba(255, 255, 255, 0.45);
}

html[data-theme="dark"] .web-update-banner-close:hover {
  background: #1c1c1e;
  color: #ffffff;
}

html[data-theme="dark"] .web-update-banner-btn:disabled,
html[data-theme="dark"] .web-update-banner-btn:disabled:hover {
  background: #1c1c1e;
  color: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] .web-update-banner-progress {
  background: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .web-update-banner-progress > i {
  background: #ffffff;
}

@keyframes bannerDropExpand {
  0% {
    clip-path: inset(calc(50% - 24px) calc(50% - 24px) calc(50% - 24px) calc(50% - 24px) round 24px);
    transform: translateY(40px);
    opacity: 0;
  }
  15% {
    clip-path: inset(calc(50% - 24px) calc(50% - 24px) calc(50% - 24px) calc(50% - 24px) round 24px);
    transform: translateY(0);
    opacity: 1;
  }
  30% {
    clip-path: inset(calc(50% - 24px) calc(50% - 24px) calc(50% - 24px) calc(50% - 24px) round 24px);
    transform: translateY(0);
  }
  75%, 100% {
    clip-path: inset(-50px -50px -50px -50px round 20px 20px 0 0);
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes bannerContentFadeIn {
  0%, 75% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bannerSpinnerSpin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes bannerSpinnerFade {
  0%, 70% { opacity: 1; }
  85%, 100% { opacity: 0; }
}

@media (max-width: 640px) {
  .web-update-banner { padding: 0; }
  .web-update-banner-inner {
    min-height: 46px;
    border-radius: 16px 16px 0 0;
    padding: 6px 12px calc(6px + var(--safe-bottom, 0px));
    gap: 8px;
  }
  .web-update-banner-icon { width: 24px; height: 24px; border-radius: 7px; }
  .web-update-banner-icon svg { width: 14px; height: 14px; }
  .web-update-banner-msg { font-size: 13px; }
  .web-update-banner-btn { min-width: 84px; min-height: 32px; padding: 6px 12px; font-size: 13px; border-radius: 9px; }
  .web-update-banner-close { width: 24px; height: 24px; }
}

/* ==========================================================================
   Vender (PDV) — porta lib/pages/sell_pos_dialog.dart (SellPosDialog)
   ========================================================================== */
/* Tela cheia — cobre toda a página (sobre a sidebar), como o app Flutter. */
.pos-overlay {
  position: fixed; inset: 0; z-index: 60; background: var(--bg);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 16px max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  padding-top: max(16px, env(safe-area-inset-top));
}
.pos-late-entry-banner {
  position: sticky; top: 0; z-index: 5;
  margin: -4px -8px 12px; padding: 10px 16px;
  background: #b26a00; color: #fff;
  border-radius: 12px; text-align: center;
  font-size: 13px; font-weight: 700; letter-spacing: 0.2px;
  box-shadow: 0 8px 22px rgba(178, 106, 0, 0.32);
}
html[data-theme="dark"] .pos-late-entry-banner {
  background: #ffb95e; color: #3a2400;
}

/* O caixa retroativo afeta mais do que o PDV: baixas, O.S. e lançamentos da
   Financeira também usam a sessão escolhida. O aviso fica acima da shell para
   continuar visível durante toda a navegação e oferecer uma saída imediata. */
.retro-cash-global-banner {
  position: fixed;
  z-index: 96;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  width: min(720px, calc(100vw - 32px));
  min-height: 52px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 9px 10px 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  color: #fff;
  background: rgba(151, 83, 0, 0.96);
  box-shadow: 0 14px 40px rgba(62, 34, 0, 0.34);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}
.retro-cash-global-banner-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
}
.retro-cash-global-banner-icon svg { width: 19px; height: 19px; fill: currentColor; }
.retro-cash-global-banner-copy { min-width: 0; display: grid; gap: 2px; }
.retro-cash-global-banner-copy b { font-size: 13px; line-height: 1.2; }
.retro-cash-global-banner-copy small {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.retro-cash-global-banner button {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 10px;
  color: #4a2700;
  background: #fff4e3;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.retro-cash-global-banner button:hover { background: #fff; }
html[data-theme="dark"] .retro-cash-global-banner {
  color: #3a2400;
  border-color: rgba(74, 39, 0, 0.18);
  background: rgba(255, 185, 94, 0.97);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.38);
}
html[data-theme="dark"] .retro-cash-global-banner-copy small { color: rgba(58, 36, 0, 0.76); }
html[data-theme="dark"] .retro-cash-global-banner-icon { background: rgba(74, 39, 0, 0.1); }

@media (max-width: 640px) {
  .retro-cash-global-banner {
    top: max(8px, env(safe-area-inset-top));
    width: calc(100vw - 16px);
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px;
    border-radius: 14px;
  }
  .retro-cash-global-banner-icon { width: 30px; height: 30px; }
  .retro-cash-global-banner-copy small { max-width: 45vw; }
  .retro-cash-global-banner button { min-height: 32px; padding-inline: 9px; }
}
/* Primeiros passos do sistema novo. No desktop, ocupa a primeira posição da
   coluna operacional e conversa com o Movimento do caixa logo abaixo. */
.home-first-steps-card {
  min-height: 324px;
  padding: 20px;
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.12);
  background: #1d1d1f;
  color: #ffffff;
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.16);
}

.home-right { position: relative; }
.home-first-steps-card[hidden] { display: none !important; }
.home-first-steps-card.is-preparing {
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  visibility: hidden;
  pointer-events: none;
}

.home-first-steps-card.is-entering {
  position: relative;
  z-index: 2;
  isolation: isolate;
  overflow: visible;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.home-first-steps-card.is-entering::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: inherit;
  background: #1d1d1f;
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.16);
  transform-origin: 50% 0;
  backface-visibility: hidden;
  will-change: opacity, transform;
  animation: homeFirstStepsSurfaceEnter 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.home-first-steps-card.is-entering > .first-steps {
  position: relative;
  z-index: 1;
  backface-visibility: hidden;
  will-change: opacity, transform;
  animation: homeFirstStepsContentEnter 480ms 80ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes homeFirstStepsSurfaceEnter {
  from {
    opacity: 0;
    transform: translate3d(0, -5px, 0) scale3d(1, 0.04, 1);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
  }
}

@keyframes homeFirstStepsContentEnter {
  from { opacity: 0; transform: translate3d(0, -8px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.home-right > .home-first-steps-card.is-entering ~ * {
  backface-visibility: hidden;
  will-change: transform;
  animation: homeFirstStepsStackEnter 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes homeFirstStepsStackEnter {
  from { transform: translate3d(0, var(--first-steps-stack-shift), 0); }
  to { transform: translate3d(0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .home-first-steps-card.is-entering::before,
  .home-first-steps-card.is-entering > .first-steps,
  .home-right > .home-first-steps-card.is-entering ~ * { animation: none; }
}

.home-operations-card { min-height: 324px; }

.first-steps {
  min-height: 282px;
  display: flex;
  flex-direction: column;
}

.first-steps-head {
  margin-bottom: 0;
}

.home-first-steps-card .home-panel-kicker { color: #5ea8ff; }
.home-first-steps-card .home-panel-heading h2 { color: #ffffff; }

.home-first-steps-card .first-steps-count {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.10);
}

.first-steps-progress {
  width: 100%;
  height: 6px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.first-steps-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #13a065;
  transition: width .4s cubic-bezier(0.22, 1, 0.36, 1);
}

.first-steps-summary {
  margin: 8px 0 14px;
  color: rgba(255, 255, 255, 0.58);
  font: 400 11.5px/1.35 var(--apple-font);
}

.first-steps-list {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.first-step {
  min-width: 0;
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, transform .12s ease;
}

.first-step:hover {
  border-color: rgba(94, 168, 255, 0.62);
  background: rgba(255, 255, 255, 0.10);
}
.first-step:active { transform: scale(.99); }
.first-step:focus-visible { outline: 2px solid #5ea8ff; outline-offset: 2px; }
.first-step:disabled { opacity: 1; }

.first-step-ic {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(94, 168, 255, 0.16);
  color: #5ea8ff;
}
.first-step-ic .icon svg { width: 17px; height: 17px; fill: currentColor; }
.first-step-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.first-step-text b { color: #ffffff; font: 500 13px/1.2 var(--apple-font); }
.first-step-text span { color: rgba(255, 255, 255, 0.56); font: 400 10.8px/1.35 var(--apple-font); }
.first-step .first-step-go { flex: 0 0 auto; color: rgba(255, 255, 255, 0.46); }
.first-step .first-step-go svg { width: 15px; height: 15px; fill: currentColor; }

.first-step.done {
  cursor: default;
  border-color: rgba(79, 227, 154, 0.22);
  background: rgba(19, 160, 101, 0.13);
}
.first-step.done .first-step-ic { background: rgba(79, 227, 154, 0.16); color: #7ee0af; }
.first-step.done .first-step-text b { color: rgba(255, 255, 255, 0.64); text-decoration: line-through; }
.first-step.done .first-step-text span { color: rgba(255, 255, 255, 0.42); }

@media (max-width: 680px) {
  .home-first-steps-card,
  .home-operations-card { min-height: 0; }
  .first-steps { min-height: 0; }
  .first-steps-list { grid-template-columns: 1fr; }
  .first-step { min-height: 74px; }
}

/* Lista vazia porque ainda não existe nada (não porque o filtro não achou):
   a frase seca vira convite com o botão que resolve. */
.empty-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 34px 20px;
  text-align: center;
}

.empty-cta-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: var(--card-soft); color: var(--muted); }
.empty-cta-ic .icon svg { width: 22px; height: 22px; fill: currentColor; }
.empty-cta b { color: var(--ink); font: 800 15px var(--apple-font); }
.empty-cta p { margin: 0; max-width: 42ch; color: var(--muted); font: 500 13px/1.5 var(--apple-font); }

.empty-cta-btn {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--card);
  font: 700 13px var(--apple-font);
  cursor: pointer;
  transition: transform .12s ease, opacity .15s ease;
}

.empty-cta-btn:hover { opacity: .9; }
.empty-cta-btn:active { transform: scale(.98); }
.empty-cta-btn .icon svg { width: 15px; height: 15px; fill: currentColor; }

/* No catálogo e em Vendas, a ação vazia pertence à mesma família visual
   do botão Novo: superfície clara, azul de ação e borda discreta. Vendas
   leva a classe no próprio botão para preservar o tema nos clones da navegação. */
#prod-list-wrap .empty-cta-btn,
.prod-empty-state-row .empty-cta-btn,
.empty-cta-btn.empty-cta-btn-system {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(0, 113, 227, 0.24);
  border-radius: 12px;
  background: var(--card);
  color: var(--accent-blue);
  font-weight: 500;
  box-shadow: none;
  transition: background-color .16s ease, border-color .16s ease, transform .12s ease;
}

#prod-list-wrap .empty-cta-btn:hover,
.prod-empty-state-row .empty-cta-btn:hover,
.empty-cta-btn.empty-cta-btn-system:hover {
  opacity: 1;
  border-color: rgba(0, 113, 227, 0.42);
  background: rgba(0, 113, 227, 0.07);
}

#prod-list-wrap .empty-cta-btn:focus-visible,
.prod-empty-state-row .empty-cta-btn:focus-visible,
.empty-cta-btn.empty-cta-btn-system:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
}

html[data-theme="dark"] #prod-list-wrap .empty-cta-btn,
html[data-theme="dark"] .prod-empty-state-row .empty-cta-btn,
html[data-theme="dark"] .empty-cta-btn.empty-cta-btn-system {
  border-color: rgba(94, 168, 255, 0.28);
  background: var(--card-soft);
  color: var(--accent-blue);
}

html[data-theme="dark"] #prod-list-wrap .empty-cta-btn:hover,
html[data-theme="dark"] .prod-empty-state-row .empty-cta-btn:hover,
html[data-theme="dark"] .empty-cta-btn.empty-cta-btn-system:hover {
  border-color: rgba(94, 168, 255, 0.48);
  background: rgba(94, 168, 255, 0.12);
}

.prod-empty-state-row > td {
  padding: 0 !important;
  border-bottom: 0 !important;
  background: transparent !important;
}

.prod-empty-state-row .empty-cta {
  min-height: 220px;
  justify-content: center;
  padding: 38px 20px 42px;
}

.empty-cta.empty-cta-system {
  min-height: 210px;
  justify-content: center;
  padding: 36px 20px 40px;
}

@media (max-width: 680px) {
  .prod-empty-state-row .empty-cta {
    min-height: 190px;
    padding: 30px 16px 34px;
  }
  .empty-cta.empty-cta-system {
    min-height: 185px;
    padding: 28px 16px 32px;
  }
}

/* Caixa fechado no PDV. Texto à esquerda, ação à direita; o cartão fica
   vermelho e o botão segue o tema do app (claro/escuro), em vez de um branco
   fixo que brigava com o modo escuro. */
.pos-cash-closed-banner {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: -4px -8px 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #b3261e;
  color: #fff;
  box-shadow: 0 8px 22px rgba(179, 38, 30, 0.30);
  overflow: hidden;
}

.pos-cash-closed-text { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.pos-cash-closed-text b { font-size: 14px; font-weight: 800; letter-spacing: 0.2px; }
.pos-cash-closed-text span { font-size: 12.5px; font-weight: 600; opacity: .94; }

.pos-cash-closed-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font: 800 13px var(--apple-font);
  cursor: pointer;
  transition: transform .12s ease, background .15s ease;
}

.pos-cash-closed-btn:hover { background: var(--card-soft); }
.pos-cash-closed-btn:active { transform: scale(.97); }
.pos-cash-closed-btn .icon svg { width: 16px; height: 16px; fill: currentColor; }

html[data-theme="dark"] .pos-cash-closed-banner { background: #8c1d18; }

/* A faixa ocupa espaço acima da página, e a página tem altura travada em 100%
   do PDV — por isso o rodapé do carrinho caía abaixo da dobra. A correção é
   descontar a altura da faixa (medida em JS), e não soltar a altura: soltar
   fazia a lista de produtos parar de rolar por dentro e o resumo encolher.
   A transição faz a página crescer de volta junto com a saída da faixa. */
.pos-overlay.pos-has-cash-banner .pos-page {
  height: calc(100% - var(--pos-cash-banner-h, 0px));
  transition: height 380ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* No desktop a página roda com `transform: scale(0.8)` e altura de 125% para
   compensar o zoom. O desconto da faixa precisa entrar ANTES dessa conta —
   senão a página encolhe de verdade e sobra um vão embaixo do carrinho. */
@media (min-width: 941px) {
  .pos-overlay.pos-has-cash-banner .pos-page {
    height: calc((100% - var(--pos-cash-banner-h, 0px)) * 1.25);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pos-overlay.pos-has-cash-banner .pos-page { transition: none; }
}

/* Saída: sobe e encolhe ao mesmo tempo, para a tela voltar ao normal sem
   solavanco quando o caixa é aberto. */
.pos-cash-closed-banner.leaving {
  animation: posCashBannerOut 380ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

@keyframes posCashBannerOut {
  from { opacity: 1; transform: translateY(0); max-height: 160px; margin-bottom: 12px; padding-block: 12px; }
  60%  { opacity: 0; transform: translateY(-100%); max-height: 160px; }
  to   { opacity: 0; transform: translateY(-100%); max-height: 0; margin-bottom: 0; padding-block: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pos-cash-closed-banner.leaving { animation: none; display: none; }
}

/* O Gemini agora ocupa uma linha real da navegação, logo depois do CRM.
   O painel continua global, mas não existe mais botão flutuante ou arraste. */
.gemini-sidebar-entry .gemini-sidebar-mark {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.gemini-sidebar-entry .gemini-sidebar-mark .icon {
  width: 18px;
  height: 18px;
  display: block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M12%202c.82%205.12%204.88%209.18%2010%2010-5.12.82-9.18%204.88-10%2010C11.18%2016.88%207.12%2012.82%202%2012%207.12%2011.18%2011.18%207.12%2012%202Z%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M12%202c.82%205.12%204.88%209.18%2010%2010-5.12.82-9.18%204.88-10%2010C11.18%2016.88%207.12%2012.82%202%2012%207.12%2011.18%2011.18%207.12%2012%202Z%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
}

.gemini-sidebar-entry .gemini-sidebar-mark .icon svg {
  width: 18px;
  height: 18px;
  opacity: 0;
}
/* O RDX aberto recebe uma segunda barra, independente do glider da página
   ativa. Assim a navegação continua marcando a aba atual enquanto o estado
   do assistente permanece visível até o popup ser recolhido. */
.gemini-sidebar-entry.is-open {
  --sb-notch: calc(var(--sb-item-h) * var(--sb-scale, 1) / 2 - var(--sb-bulge));
  width: calc(100% + var(--sb-ext));
  margin-right: calc(-1 * var(--sb-ext));
  padding-right: calc(12px + var(--sb-ext));
  border-radius: 999px 0 0 999px;
  background: var(--sb-primary-bg);
  color: var(--sb-primary-ink);
  font-weight: 600;
  z-index: 3;
}
.gemini-sidebar-entry.is-open:hover { background: var(--sb-primary-bg); }
.gemini-sidebar-entry.is-open .gemini-sidebar-mark { color: var(--sb-primary-ink); }
.gemini-sidebar-entry.is-open:focus-visible {
  outline-color: var(--sb-primary-ink);
  outline-offset: -4px;
}
.gemini-sidebar-entry.is-open::before,
.gemini-sidebar-entry.is-open::after {
  content: "";
  position: absolute;
  right: 0;
  width: var(--sb-notch);
  height: calc(var(--sb-notch) + 6px);
  pointer-events: none;
}
.gemini-sidebar-entry.is-open::before {
  bottom: calc(100% - 6px);
  background: radial-gradient(circle at 0 0,
    transparent var(--sb-notch),
    var(--sb-primary-bg) var(--sb-notch));
}
.gemini-sidebar-entry.is-open::after {
  top: calc(100% - 6px);
  background: radial-gradient(circle at 0 100%,
    transparent var(--sb-notch),
    var(--sb-primary-bg) var(--sb-notch));
}
.sidebar.collapsed .gemini-sidebar-entry.is-open { padding-right: var(--sb-ext); }

.gemini-assistant-widget { display: contents; }

.gemini-assistant-panel {
  position: fixed;
  inset: auto;
  z-index: 90;
  width: min(420px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 24px));
  max-height: calc(100vh - 24px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  background: #000000;
  color: #f5f5f7;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
}

.gemini-assistant-panel.is-opening {
  animation: geminiAssistantPanelOpen 170ms ease-out both;
  will-change: opacity;
}

.gemini-assistant-panel.is-closing {
  animation: geminiAssistantPanelClose 150ms ease-in forwards;
  pointer-events: none;
  will-change: opacity;
}

.gemini-assistant-panel[hidden] { display: none; }
.gemini-assistant-page { display: contents; }
/* O popup é um card independente: o vão até o botão permanece livre e os
   quatro cantos são formados somente pelo border-radius do próprio painel. */
.gemini-assistant-head,
.gemini-assistant-messages,
.gemini-assistant-composer {
  position: relative;
  z-index: 1;
}

.gemini-assistant-head {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 20px 20px 0 0;
  background: #000000;
}

.gemini-assistant-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.gemini-assistant-mark img { width: 30px; height: 30px; display: block; object-fit: contain; filter: brightness(0) invert(1); }
html[data-theme="dark"] .gemini-assistant-mark img.is-default { filter: brightness(0) invert(1); }

.gemini-assistant-title {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gemini-assistant-title b { color: #ffffff; font: 800 14px var(--apple-font); }
.gemini-assistant-title small { overflow: hidden; color: rgba(255, 255, 255, 0.64); font: 600 11px var(--apple-font); text-overflow: ellipsis; white-space: nowrap; }

.gemini-assistant-view-back {
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: none;
  color: #57574f;
  cursor: pointer;
  transition: color .14s ease, transform .14s ease;
}
.gemini-assistant-view-back:hover { color: #111110; transform: translateX(-2px); }
.gemini-assistant-view-back:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.gemini-assistant-view-back .icon,
.gemini-assistant-view-back .icon svg { width: 21px; height: 21px; }
.gemini-assistant-view-back .icon svg { fill: currentColor; }

.gemini-assistant-view-toggle {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.68);
  cursor: pointer;
  transition: color .14s ease, transform .14s ease;
}
.gemini-assistant-view-toggle:hover {
  color: #ffffff;
  transform: scale(1.06);
}
.gemini-assistant-view-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.gemini-assistant-view-toggle .icon,
.gemini-assistant-view-toggle .icon svg { width: 17px; height: 17px; }
.gemini-assistant-view-toggle .icon svg { fill: currentColor; }

.gemini-assistant-mobile-sidebar-open,
.gemini-assistant-mobile-sidebar-scrim { display: none; }

.gemini-assistant-mobile-sidebar-open {
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: none;
  color: #57574f;
  cursor: pointer;
}
.gemini-assistant-mobile-sidebar-open .icon,
.gemini-assistant-mobile-sidebar-open .icon svg { width: 20px; height: 20px; }
.gemini-assistant-mobile-sidebar-open .icon svg { fill: currentColor; }
.gemini-assistant-mobile-sidebar-open:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.gemini-assistant-messages {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 15px 14px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.gemini-assistant-messages.is-empty {
  justify-content: flex-end;
  overflow: hidden;
}
.gemini-assistant-empty {
  padding: 0 8px 10px;
  color: #ffffff;
  font: 500 22px/1.2 var(--apple-font);
  letter-spacing: -0.025em;
  text-align: center;
}
.gemini-assistant-empty.is-leaving {
  animation: geminiAssistantEmptyOut 280ms cubic-bezier(.4, 0, 1, 1) forwards;
  pointer-events: none;
  will-change: transform;
}

.gemini-assistant-message { display: flex; width: 100%; }
.gemini-assistant-message.is-user { justify-content: flex-end; }
.gemini-assistant-message.is-model { justify-content: flex-start; }

.gemini-assistant-bubble {
  max-width: min(84%, 320px);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px 14px 14px 5px;
  background: var(--card-soft);
  color: var(--ink);
  font: 600 12.5px/1.48 var(--apple-font);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.gemini-assistant-message.is-model .gemini-assistant-bubble {
  min-width: 78px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 24px;
  border: 0;
  border-radius: 32px;
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 26px 54px rgba(0, 0, 0, 0.14), 0 8px 22px rgba(0, 0, 0, 0.08);
  font-weight: 500;
  text-align: left;
}
.gemini-assistant-message.is-user .gemini-assistant-bubble {
  min-width: 64px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 18px;
  border: 0;
  border-radius: 32px;
  background: #1d1d1f;
  color: #ffffff;
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.18);
  font-weight: 500;
  text-align: center;
}
.gemini-assistant-typing {
  min-width: 58px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 14px;
  white-space: normal;
}
.gemini-assistant-message.is-model .gemini-assistant-bubble.gemini-assistant-typing {
  justify-content: center;
  text-align: center;
}
.gemini-assistant-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6e6e73;
  animation: geminiAssistantTypingDot 900ms ease-in-out infinite;
}
.gemini-assistant-typing-dot:nth-child(2) { animation-delay: 120ms; }
.gemini-assistant-typing-dot:nth-child(3) { animation-delay: 240ms; }

.gemini-assistant-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: end;
  gap: 6px;
  margin: 0 12px 12px;
  padding: 5px 5px 5px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: #1d1d1f;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.gemini-assistant-composer:focus-within {
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.gemini-assistant-composer textarea {
  width: 100%;
  min-height: 38px;
  max-height: 96px;
  resize: none;
  overflow-y: auto;
  padding: 9px 2px;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  color: #ffffff;
  font: 600 12.5px/1.45 var(--apple-font);
}
.gemini-assistant-composer textarea::placeholder { color: rgba(255, 255, 255, 0.52); }
.gemini-assistant-composer textarea:disabled { opacity: .68; cursor: wait; }

.gemini-assistant-composer button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: #1d1d1f;
  cursor: pointer;
  box-shadow: none;
  transition: transform .14s ease, opacity .14s ease;
}
.gemini-assistant-composer button:hover { transform: translateY(-1px); }
.gemini-assistant-composer button:active { transform: scale(.96); }
.gemini-assistant-composer button:disabled { opacity: .55; cursor: wait; transform: none; }
.gemini-assistant-composer button .icon,
.gemini-assistant-composer button .icon svg { width: 18px; height: 18px; }
.gemini-assistant-composer button .icon svg { fill: currentColor; }
.gemini-assistant-composer button.is-stop .icon,
.gemini-assistant-composer button.is-stop .icon svg { width: 20px; height: 20px; }

/* O card compacto acompanha o tema do sistema. O modo de página completa
   fica fora destes seletores porque sua direção visual continua branca. */
html[data-theme="dark"] .gemini-assistant-panel:not(.is-fullscreen) {
  border: 1px solid rgba(255, 255, 255, 0.34);
}
html:not([data-theme="dark"]) .gemini-assistant-panel:not(.is-fullscreen) {
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
}
html:not([data-theme="dark"]) .gemini-assistant-panel:not(.is-fullscreen) .gemini-assistant-head {
  border-bottom-color: rgba(29, 29, 31, 0.10);
  background: #ffffff;
}
html:not([data-theme="dark"]) .gemini-assistant-panel:not(.is-fullscreen) .gemini-assistant-mark img {
  filter: none;
}
html:not([data-theme="dark"]) .gemini-assistant-panel:not(.is-fullscreen) .gemini-assistant-title b {
  color: #1d1d1f;
}
html:not([data-theme="dark"]) .gemini-assistant-panel:not(.is-fullscreen) .gemini-assistant-title small {
  color: #6e6e73;
}
html:not([data-theme="dark"]) .gemini-assistant-panel:not(.is-fullscreen) .gemini-assistant-view-toggle {
  color: #6e6e73;
}
html:not([data-theme="dark"]) .gemini-assistant-panel:not(.is-fullscreen) .gemini-assistant-view-toggle:hover {
  color: #1d1d1f;
}
html:not([data-theme="dark"]) .gemini-assistant-panel:not(.is-fullscreen) .gemini-assistant-empty {
  color: #1d1d1f;
}
html:not([data-theme="dark"]) .gemini-assistant-panel .gemini-assistant-message.is-model .gemini-assistant-bubble {
  background: #f5f5f7;
  color: #1d1d1f;
  box-shadow: 0 26px 54px rgba(0, 0, 0, 0.14), 0 8px 22px rgba(0, 0, 0, 0.08);
}
html:not([data-theme="dark"]) .gemini-assistant-panel .gemini-assistant-message.is-user .gemini-assistant-bubble {
  background: #1d1d1f;
  color: #ffffff;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.14);
}
html:not([data-theme="dark"]) .gemini-assistant-panel:not(.is-fullscreen) .gemini-assistant-composer {
  border-color: rgba(29, 29, 31, 0.14);
  background: #f5f5f7;
}
html:not([data-theme="dark"]) .gemini-assistant-panel:not(.is-fullscreen) .gemini-assistant-composer:focus-within {
  border-color: rgba(29, 29, 31, 0.34);
  box-shadow: 0 0 0 3px rgba(29, 29, 31, 0.06);
}
html:not([data-theme="dark"]) .gemini-assistant-panel:not(.is-fullscreen) .gemini-assistant-composer textarea {
  color: #1d1d1f;
}
html:not([data-theme="dark"]) .gemini-assistant-panel:not(.is-fullscreen) .gemini-assistant-composer textarea::placeholder {
  color: #7d7d82;
}
html:not([data-theme="dark"]) .gemini-assistant-panel:not(.is-fullscreen) .gemini-assistant-composer button {
  background: #1d1d1f;
  color: #ffffff;
}

/* A seta do card compacto abre uma superfície de conversa integral. A barra
   fica à direita e contém somente controles que existem no RDX. */

html.gemini-assistant-fullscreen-open,
html.gemini-assistant-fullscreen-open body { overflow: hidden; }

/* No mobile o assistente é uma página integral. O body fixed é aplicado pelo
   JavaScript para preservar a posição exata da tela de trás ao fechar. */
html.gemini-assistant-mobile-scroll-locked,
html.gemini-assistant-mobile-scroll-locked body {
  width: 100%;
  height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none;
}

/* Fundo opaco independente da tela do sistema. Mesmo durante o efeito elástico
   do navegador, nunca existe uma fresta por onde a página anterior apareça. */
html.gemini-assistant-mobile-scroll-locked body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 179;
  background: #ffffff;
  pointer-events: none;
}
html[data-theme="dark"].gemini-assistant-mobile-scroll-locked body::before {
  background: #07080a;
}

.gemini-assistant-panel.is-fullscreen {
  inset: 0;
  z-index: 180;
  width: 100vw;
  height: 100dvh;
  max-height: none;
  grid-template-columns: minmax(0, 1fr) 200px;
  grid-template-rows: minmax(0, 1fr);
  transition: grid-template-columns .24s cubic-bezier(.22, .61, .36, 1);
  grid-template-areas: "page sidebar";
  overflow: hidden;
  border-radius: 0;
  background: #ffffff;
  color: #1d1d1f;
  color-scheme: light;
  box-shadow: none;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

.gemini-assistant-panel.is-fullscreen .gemini-assistant-page {
  grid-area: page;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "head"
    "messages"
    "composer";
  position: relative;
  overflow: hidden;
}

.gemini-assistant-panel.is-fullscreen .gemini-assistant-head {
  grid-area: head;
  z-index: 3;
  isolation: isolate;
  grid-template-columns: 34px 38px minmax(0, 1fr);
  padding: 20px 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.gemini-assistant-panel.is-fullscreen .gemini-assistant-head::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 0;
  height: clamp(112px, 13vh, 150px);
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.36) 0%,
    rgba(255, 255, 255, 0.10) 58%,
    rgba(255, 255, 255, 0) 100%
  );
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 34%, rgba(0, 0, 0, 0.20) 74%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 34%, rgba(0, 0, 0, 0.20) 74%, transparent 100%);
}
.gemini-assistant-panel.is-fullscreen .gemini-assistant-head > * {
  position: relative;
  z-index: 1;
}
.gemini-assistant-panel.is-fullscreen .gemini-assistant-mark img { filter: none; }
.gemini-assistant-panel.is-fullscreen .gemini-assistant-title b {
  color: #1d1d1f;
  font-size: 16px;
  font-weight: 700;
}
.gemini-assistant-panel.is-fullscreen .gemini-assistant-title small {
  color: #777773;
  font-size: 12px;
  font-weight: 500;
}

.gemini-assistant-full-sidebar { display: none; }
.gemini-assistant-panel.is-fullscreen .gemini-assistant-view-toggle { display: none; }
.gemini-assistant-panel.is-fullscreen .gemini-assistant-view-back { display: grid; }

.gemini-assistant-panel.is-fullscreen .gemini-assistant-messages {
  grid-area: messages;
  grid-column: 1;
  grid-row: 1 / 4;
  gap: 18px;
  padding: clamp(112px, 13vh, 150px) clamp(32px, calc((100% - 820px) / 2), 160px) clamp(130px, 15vh, 168px);
  background: #ffffff;
  scrollbar-color: #cacac5 transparent;
}
.gemini-assistant-panel.is-fullscreen .gemini-assistant-messages.is-empty {
  justify-content: center;
  padding-bottom: 90px;
}

/* Tela inicial: enquanto não há conversa, a saudação e o campo de digitação
   ficam no meio da tela, com o brilho azul atrás — e voltam para o lugar de
   sempre assim que a primeira mensagem entra. As duas faixas iguais fazem a
   saudação terminar e o campo começar exatamente no centro. */
.gemini-assistant-panel.is-fullscreen .gemini-assistant-page:has(> .gemini-assistant-messages.is-empty) {
  grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr);
}
.gemini-assistant-panel.is-fullscreen .gemini-assistant-page:has(> .gemini-assistant-messages.is-empty) > .gemini-assistant-messages.is-empty {
  grid-area: messages;
  justify-content: flex-end;
  padding-bottom: 26px;
}
.gemini-assistant-panel.is-fullscreen .gemini-assistant-page:has(> .gemini-assistant-messages.is-empty) > .gemini-assistant-composer {
  align-self: start;
  margin-bottom: 0;
}
.gemini-assistant-panel.is-fullscreen .gemini-assistant-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .34s ease;
  /* Halo curto atrás do campo, não um lençol azul: o raio vertical fecha bem
     antes do rodapé para não deixar a borda reta na base da tela. */
  background:
    radial-gradient(42% 22% at 50% 57%, rgba(59, 130, 246, 0.28), rgba(59, 130, 246, 0) 70%),
    radial-gradient(22% 12% at 50% 58%, rgba(37, 99, 235, 0.22), rgba(37, 99, 235, 0) 72%);
}
.gemini-assistant-panel.is-fullscreen .gemini-assistant-page::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  height: clamp(130px, 15vh, 168px);
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.10) 42%,
    rgba(255, 255, 255, 0.34) 100%
  );
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.20) 26%, #000 76%);
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.20) 26%, #000 76%);
}
html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-page::before {
  background:
    radial-gradient(46% 26% at 50% 57%, rgba(59, 130, 246, 0.34), rgba(59, 130, 246, 0) 70%),
    radial-gradient(24% 14% at 50% 58%, rgba(37, 99, 235, 0.28), rgba(37, 99, 235, 0) 72%);
}
html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-page::after {
  background: linear-gradient(
    to bottom,
    rgba(7, 8, 10, 0) 0%,
    rgba(7, 8, 10, 0.12) 42%,
    rgba(7, 8, 10, 0.42) 100%
  );
}
.gemini-assistant-panel.is-fullscreen .gemini-assistant-page:has(> .gemini-assistant-messages.is-empty)::before { opacity: 1; }
.gemini-assistant-panel.is-fullscreen .gemini-assistant-page:has(> .gemini-assistant-messages.is-empty)::after {
  opacity: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.gemini-assistant-panel.is-fullscreen .gemini-assistant-page:has(> .gemini-assistant-messages.is-empty) > .gemini-assistant-head::before {
  opacity: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
/* A área da conversa é opaca para o texto rolar sem borrar o fundo; na tela
   inicial ela precisa deixar o brilho passar. */
.gemini-assistant-panel.is-fullscreen .gemini-assistant-page:has(> .gemini-assistant-messages.is-empty) > .gemini-assistant-messages,
.gemini-assistant-panel.is-fullscreen .gemini-assistant-page:has(> .gemini-assistant-messages.is-empty) > .gemini-assistant-head {
  background: transparent;
}
.gemini-assistant-panel.is-fullscreen .gemini-assistant-empty {
  padding: 0;
  color: #1d1d1f;
  font: 500 clamp(28px, 3vw, 38px)/1.12 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.035em;
}
.gemini-assistant-panel.is-fullscreen .gemini-assistant-bubble {
  max-width: min(78%, 680px);
  font-size: 15px;
  line-height: 1.55;
}

.gemini-assistant-panel.is-fullscreen .gemini-assistant-composer {
  grid-area: composer;
  z-index: 3;
  width: min(780px, calc(100% - 48px));
  justify-self: center;
  margin: 0 24px max(28px, env(safe-area-inset-bottom));
  padding: 7px 7px 7px 18px;
  border-color: #dededb;
  background: #f4f4f1;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.08);
}
.gemini-assistant-panel.is-fullscreen .gemini-assistant-composer:focus-within {
  border-color: #b9b9b4;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.10), 0 0 0 3px rgba(29, 29, 31, 0.05);
}
.gemini-assistant-panel.is-fullscreen .gemini-assistant-composer textarea {
  color: #1d1d1f;
  font-size: 15px;
  font-weight: 500;
}
.gemini-assistant-panel.is-fullscreen .gemini-assistant-composer textarea::placeholder { color: #858580; }
.gemini-assistant-panel.is-fullscreen .gemini-assistant-composer button {
  width: 40px;
  height: 40px;
  background: #1d1d1f;
  color: #ffffff;
}

.gemini-assistant-panel.is-fullscreen .gemini-assistant-full-sidebar {
  grid-area: sidebar;
  min-width: 0;
  /* Item de grade nasce com min-height:auto: sem isto a coluna estica para
     caber todas as conversas, o cartão passa da tela e a lista nunca rola. */
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 14px 0;
  background: none;
  color: #1d1d1f;
}

/* Cópia da barra do sistema: o cartão ocupa a coluna inteira, sem a margem
   que ele tem dentro da shell, e some junto com a coluna quando ela recolhe. */
.gemini-assistant-nav-sidebar {
  /* A barra da shell roda dentro do scale(.8) do .system-scale. A tela do
     assistente fica fora dessa escala, então o mesmo zoom aqui deixa cartão,
     botões e texto exatamente do tamanho da barra do sistema. */
  zoom: .8;
  width: var(--sb-w);
  min-width: 0;
  max-width: none;
  min-height: 0;
  flex: 1 1 auto;
  margin: 0;
}
.gemini-assistant-nav-sidebar.collapsed { width: var(--sb-w-rail); }
.gemini-assistant-panel.is-fullscreen .gemini-assistant-nav-sidebar { display: flex; }
/* No claro o cartão é branco sobre a tela branca do assistente: a sombra é o
   que dá o contorno dele. No escuro a própria superfície já o separa. */
.gemini-assistant-nav-sidebar {
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.10), 0 2px 6px rgba(0, 0, 0, 0.05);
}
html[data-theme="dark"] .gemini-assistant-nav-sidebar { box-shadow: none; }

/* Botões do assistente dentro do cartão. */
.gemini-assistant-full-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
}
.gemini-assistant-sidebar-toggle,
.gemini-assistant-full-actions .theme-toggle.gemini-assistant-theme-toggle {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: #57574f;
  cursor: pointer;
  transition: color .14s ease;
}
.gemini-assistant-sidebar-toggle:hover,
.gemini-assistant-full-actions .theme-toggle.gemini-assistant-theme-toggle:hover { background: none; color: #111110; }
.gemini-assistant-sidebar-toggle:focus-visible,
.gemini-assistant-theme-toggle:focus-visible { outline: 2px solid #1d1d1f; outline-offset: 3px; }
.gemini-assistant-sidebar-toggle .icon,
.gemini-assistant-sidebar-toggle .icon svg,
.gemini-assistant-full-actions .theme-toggle.gemini-assistant-theme-toggle .icon,
.gemini-assistant-full-actions .theme-toggle.gemini-assistant-theme-toggle .icon svg { width: 17px; height: 17px; }
.gemini-assistant-sidebar-toggle .icon svg,
.gemini-assistant-theme-toggle .icon svg { fill: currentColor; }

/* O "Nova conversa" é o mesmo botão do Vender (.side-primary) e cada conversa
   do histórico é um .nav-item — os dois espelhados: a barra fica à direita da
   tela, então a ponta reta, a que avança para fora do cartão em direção à
   conversa, é a da esquerda. */
.gemini-assistant-new-chat,
.gemini-assistant-history-item.active {
  width: calc(100% + var(--sb-ext));
  margin-right: 0;
  margin-left: calc(-1 * var(--sb-ext));
  padding: 0 12px 0 calc(12px + var(--sb-ext));
  border-radius: 0 999px 999px 0;
}
.gemini-assistant-new-chat::before,
.gemini-assistant-new-chat::after,
.gemini-assistant-history-item.active::before,
.gemini-assistant-history-item.active::after { right: auto; left: 0; }
.gemini-assistant-new-chat::before,
.gemini-assistant-history-item.active::before {
  background: radial-gradient(circle at 100% 0,
    transparent var(--sb-notch),
    var(--sb-primary-bg) var(--sb-notch));
}
.gemini-assistant-new-chat::after,
.gemini-assistant-history-item.active::after {
  background: radial-gradient(circle at 100% 100%,
    transparent var(--sb-notch),
    var(--sb-primary-bg) var(--sb-notch));
}
.gemini-assistant-new-chat:disabled { opacity: .45; cursor: wait; transform: none; }

/* Separadores da barra. O .side-sep do sistema pinta com --sb-border, que é
   transparente neste tema — aqui a linha precisa aparecer de verdade. */
.gemini-assistant-sep {
  flex: 0 0 auto;
  height: 1px;
  margin: 12px 2px;
  background: rgba(29, 29, 31, 0.10);
}

/* Histórico: ocupa o que sobra do cartão e rola sozinho. */
.gemini-assistant-history {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gemini-assistant-history-title {
  flex: 0 0 auto;
  padding: 0 8px;
  color: var(--sb-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.gemini-assistant-history-list {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* A pílula da conversa aberta é filha desta lista: daqui saem a origem das
     coordenadas e o recorte. O respiro à esquerda (margem negativa + padding)
     deixa o avanço dela aparecer sem ser cortado pelo overflow. */
  position: relative;
  margin-left: calc(-1 * var(--sb-ext));
  /* O respiro de cima é para o recorte curvo da pílula, que é desenhado acima
     dela: sem isso o primeiro item aparece com o topo cortado pela lista. */
  padding: 16px 0 4px var(--sb-ext);
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Os botões de cima e o "Nova conversa" ficam parados: quem rola é só esta
     lista — e sem barra à vista, como a própria barra do sistema faz. */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.gemini-assistant-history-list::-webkit-scrollbar { width: 0; height: 0; }
.gemini-assistant-history-empty {
  padding: 2px 8px;
  color: var(--sb-muted);
  font-size: 12px;
  line-height: 1.35;
}
/* O destaque da conversa aberta é o mesmo glider da barra do sistema: uma
   pílula que desliza até o item clicado. Aqui ele é espelhado — colado na
   borda esquerda do cartão, com a ponta arredondada à direita. */
.gemini-assistant-nav-sidebar .sidebar-active-glider {
  left: 0;
  right: 0;
  border-radius: 0 999px 999px 0;
}
.gemini-assistant-nav-sidebar .sidebar-active-glider::before,
.gemini-assistant-nav-sidebar .sidebar-active-glider::after { right: auto; left: 0; }
.gemini-assistant-nav-sidebar .sidebar-active-glider::before {
  background: radial-gradient(circle at 100% 0,
    transparent var(--sb-notch),
    var(--sb-primary-bg) var(--sb-notch));
}
.gemini-assistant-nav-sidebar .sidebar-active-glider::after {
  background: radial-gradient(circle at 100% 100%,
    transparent var(--sb-notch),
    var(--sb-primary-bg) var(--sb-notch));
}
/* Como .side-nav e .side-foot fazem na barra: o conteúdo fica acima da pílula. */
.sidebar.has-active-glider .gemini-assistant-full-actions,
.sidebar.has-active-glider .gemini-assistant-history {
  position: relative;
  z-index: 2;
}

/* O .nav-item anima padding e gap para acompanhar o recolher da barra. Aqui
   isso só faz o rótulo escorregar quando o item vira ativo: fica só a cor. */
.gemini-assistant-history-item {
  flex: 0 0 auto;
  /* O glider é filho da própria lista e tem z-index: 1. Mantém cada
     conversa acima dele, como a .side-nav fica acima do glider na barra do
     Início; assim a pílula preta não encobre o rótulo branco do item ativo. */
  z-index: 2;
  transition: color .16s ease;
}
/* A cor vem das mesmas regras .glider-covered da barra do Início. Aqui muda
   apenas a duração: sem o atraso antigo, cada item responde à sua própria
   cobertura enquanto a pílula passa. */
.gemini-assistant-nav-sidebar.is-nav-gliding .gemini-assistant-history-item {
  transition: color .12s ease;
}

/* Cartão que abre ao pousar o mouse na conversa. Mesma ideia do card de
   contexto da barra, espelhado: como a barra fica na direita, ele cresce para
   a esquerda — e aqui aceita clique, porque é um botão. */
.gemini-assistant-chat-card {
  position: absolute;
  z-index: 9;
  top: var(--gemini-chat-card-top, 50%);
  right: calc(100% + 10px);
  padding: 6px;
  /* Mesma pele do card de contexto da barra: preto com o fio claro em volta,
     igual nos dois temas — é um cartão flutuante, não uma peça da superfície. */
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 16px;
  background: #000000;
  box-shadow: 0 30px 72px rgba(17, 24, 39, 0.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(8px, -50%) scaleX(.3);
  transform-origin: right center;
  will-change: top, opacity, transform;
  transition: top .30s cubic-bezier(.22, 1, .36, 1),
    opacity .12s ease-out,
    transform .28s cubic-bezier(.22, 1, .36, 1),
    visibility 0s linear .28s;
}
.gemini-assistant-chat-card.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(0, -50%) scaleX(1);
  transition-delay: 0s;
}
.gemini-assistant-chat-delete {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px 0 12px;
  border: 0;
  border-radius: 11px;
  background: none;
  color: #ff6c6c;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background .14s ease;
}
.gemini-assistant-chat-delete:hover { background: rgba(255, 108, 108, 0.16); }
.gemini-assistant-chat-delete:focus-visible { outline: 2px solid #ff6c6c; outline-offset: -3px; }
.gemini-assistant-chat-delete .icon,
.gemini-assistant-chat-delete .icon svg { width: 17px; height: 17px; fill: currentColor; }


/* No rail cada conversa continua acessível como uma bolinha. O texto permanece
   no botão para leitores de tela e no atributo title para o tooltip, mas não
   ocupa espaço visual enquanto a barra estiver recolhida. */
.gemini-assistant-nav-sidebar.collapsed .gemini-assistant-history {
  display: flex;
  gap: 0;
}
.gemini-assistant-nav-sidebar.collapsed .gemini-assistant-history-title,
.gemini-assistant-nav-sidebar.collapsed .gemini-assistant-history-empty {
  display: none;
}
.gemini-assistant-nav-sidebar.collapsed .gemini-assistant-history-list {
  align-items: stretch;
  gap: 2px;
  margin-left: 0;
  padding: 8px 0 4px;
}
.gemini-assistant-nav-sidebar.collapsed .gemini-assistant-history-list > .sidebar-active-glider {
  display: none;
}
.gemini-assistant-nav-sidebar.collapsed .gemini-assistant-history-item,
.gemini-assistant-nav-sidebar.collapsed .gemini-assistant-history-item.active {
  width: 100%;
  height: 30px;
  margin: 0;
  padding: 0;
  justify-content: center;
  gap: 0;
  border-radius: 999px;
  background: transparent;
}
.gemini-assistant-nav-sidebar.collapsed .gemini-assistant-history-item:hover {
  background: transparent;
}
.gemini-assistant-nav-sidebar.collapsed .gemini-assistant-history-item.active::before,
.gemini-assistant-nav-sidebar.collapsed .gemini-assistant-history-item.active::after {
  content: none;
}
.gemini-assistant-nav-sidebar.collapsed .gemini-assistant-history-item .nav-label {
  width: 10px;
  min-width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: var(--sb-muted);
  color: transparent;
  font-size: 0;
  line-height: 0;
  opacity: 1;
  overflow: hidden;
  transition: background .14s ease, transform .14s ease;
}
.gemini-assistant-nav-sidebar.collapsed .gemini-assistant-history-item:hover .nav-label {
  background: var(--sb-ink);
  transform: scale(1.18);
}
.gemini-assistant-nav-sidebar.collapsed .gemini-assistant-history-item.active .nav-label {
  background: var(--sb-ink);
  transform: scale(1.24);
}

html[data-theme="dark"] .gemini-assistant-sep { background: rgba(255, 255, 255, 0.12); }
/* No rail o ícone fica no meio da faixa visível. Como a pílula avança para a
   esquerda, o avanço entra na conta do padding — é o espelho do cálculo que a
   barra do sistema faz do outro lado. */
.gemini-assistant-nav-sidebar.collapsed .gemini-assistant-new-chat {
  padding-left: calc(var(--sb-ext) + (var(--sb-w-rail) - 2px - 2 * var(--sb-padx) - var(--sb-pic)) / 2);
  padding-right: 0;
}

/* Recolhido: a coluna vira trilho e o cartão acompanha com o rail da shell. */
.gemini-assistant-panel.is-fullscreen.is-sidebar-collapsed { grid-template-columns: minmax(0, 1fr) 96px; }
.gemini-assistant-panel.is-fullscreen.is-sidebar-collapsed .gemini-assistant-full-actions {
  flex-direction: column;
  gap: 4px;
}
.gemini-assistant-panel.is-fullscreen.is-sidebar-collapsed .gemini-assistant-theme-toggle { display: none; }



/* Tema escuro do assistente em tela inteira — o botão de tema da barra lateral
   troca o tema do sistema inteiro, então esta tela precisa acompanhar. */
html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen {
  background: #07080a;
  color: #f5f5f7;
  color-scheme: dark;
}
html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-head { background: transparent; }
html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-head::before {
  background: linear-gradient(
    to bottom,
    rgba(7, 8, 10, 0.44) 0%,
    rgba(7, 8, 10, 0.12) 58%,
    rgba(7, 8, 10, 0) 100%
  );
}
html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-mark img { filter: brightness(0) invert(1); }
html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-title b { color: #f5f5f7; }
html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-title small { color: #a4a7ae; }
html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-view-back { color: #a4a7ae; }
html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-view-back:hover { color: #f5f5f7; }

html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-messages {
  background: #07080a;
  scrollbar-color: #3a3a3c transparent;
}
html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-empty { color: #f5f5f7; }

html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-composer {
  border-color: rgba(255, 255, 255, 0.12);
  background: #111318;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.40);
}
html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-composer:focus-within {
  border-color: rgba(255, 255, 255, 0.26);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.46), 0 0 0 3px rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-composer textarea { color: #f5f5f7; }
html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-composer textarea::placeholder { color: #8b8e96; }
html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-composer button {
  background: #f5f5f7;
  color: #111318;
}

html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-full-sidebar {
  background: none;
  color: #f5f5f7;
}
html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-sidebar-toggle,
html[data-theme="dark"] .gemini-assistant-full-actions .theme-toggle.gemini-assistant-theme-toggle {
  border: 0;
  background: none;
  color: #a4a7ae;
}
html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-sidebar-toggle:hover,
html[data-theme="dark"] .gemini-assistant-full-actions .theme-toggle.gemini-assistant-theme-toggle:hover {
  border: 0;
  background: none;
  color: #f5f5f7;
}
html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-sidebar-toggle:focus-visible,
html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-theme-toggle:focus-visible { outline-color: #f5f5f7; }
html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-new-chat:focus-visible { outline-color: #f5f5f7; }

@keyframes geminiAssistantPanelOpen {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes geminiAssistantPanelClose {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes geminiAssistantEmptyOut {
  from { transform: translateY(0); }
  to { transform: translateY(64px); }
}

@keyframes geminiAssistantTypingDot {
  0%, 60%, 100% { opacity: .34; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

@media (max-width: 940px) {
  .gemini-assistant-panel { overflow: hidden; border-radius: 20px; }

  /* No mobile a conversa é sempre a página principal. A barra fica fora
     da tela e somente seu botão aparece no cabeçalho. */
  .gemini-assistant-panel.is-fullscreen {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "page";
    /* A altura grande do viewport não encolhe quando o teclado abre. Assim a
       página permanece parada e somente o compositor recebe deslocamento. */
    height: 100vh;
    height: 100lvh;
    min-height: 100vh;
    min-height: 100lvh;
    max-height: none;
    overflow: hidden;
    overscroll-behavior: none;
  }
  /* O Safari posiciona a barra inferior por cima do large viewport. No WebKit
     móvel usamos o small viewport, que termina antes dos controles expandidos;
     o teclado continua sendo tratado separadamente pelo VisualViewport. */
  @supports (-webkit-touch-callout: none) {
    .gemini-assistant-panel.is-fullscreen {
      height: 100svh;
      min-height: 100svh;
    }
  }
  .gemini-assistant-panel.is-fullscreen.is-sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }
  .gemini-assistant-panel.is-fullscreen .gemini-assistant-head {
    grid-template-columns: 34px 38px minmax(0, 1fr) 34px;
  }
  .gemini-assistant-panel.is-fullscreen .gemini-assistant-composer,
  .gemini-assistant-panel.is-fullscreen .gemini-assistant-messages.is-empty .gemini-assistant-empty {
    position: relative;
    bottom: var(--gemini-mobile-keyboard-shift, 0px);
  }
  .gemini-assistant-panel.is-fullscreen .gemini-assistant-composer textarea {
    /* iOS/Chrome ampliam automaticamente campos com fonte menor que 16px. */
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  .gemini-assistant-panel.is-fullscreen .gemini-assistant-messages {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .gemini-assistant-panel.is-fullscreen.is-mobile-keyboard-open .gemini-assistant-composer {
    will-change: bottom;
  }
  .gemini-assistant-panel.is-fullscreen .gemini-assistant-mobile-sidebar-open { display: grid; }
  .gemini-assistant-panel.is-fullscreen .gemini-assistant-mobile-sidebar-scrim {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: block;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, visibility 0s linear .24s;
  }
  .gemini-assistant-panel.is-fullscreen .gemini-assistant-full-sidebar {
    position: absolute;
    inset: 0 0 0 auto;
    z-index: 11;
    display: flex;
    /* Mesma coluna de 200px do desktop: 214px internos em zoom .8 + os
       respiros laterais do cartão. */
    width: min(200px, calc(100vw - 52px));
    padding: 14px 14px 0;
    background: none;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(calc(100% + 16px));
    transition: transform .30s cubic-bezier(.22, 1, .36, 1), visibility 0s linear .32s;
  }
  .gemini-assistant-panel.is-fullscreen.is-mobile-sidebar-open .gemini-assistant-mobile-sidebar-scrim {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }
  .gemini-assistant-panel.is-fullscreen.is-mobile-sidebar-open .gemini-assistant-full-sidebar {
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition-delay: 0s;
  }
  /* A barra é literalmente o cartão do PC. Estas regras apenas impedem os
     estilos genéricos do menu mobile (.sidebar/.nav-label) de deformarem o
     clone; geometria, tokens e zoom continuam vindo do desktop. */
  .gemini-assistant-panel.is-fullscreen .gemini-assistant-nav-sidebar,
  .gemini-assistant-panel.is-fullscreen .gemini-assistant-nav-sidebar.collapsed {
    display: flex;
    width: var(--sb-w);
    min-width: 0;
    max-width: none;
    flex-direction: column;
    margin: 0;
    padding: 16px var(--sb-padx) 14px;
    zoom: .8;
  }
  .gemini-assistant-panel.is-fullscreen .gemini-assistant-nav-sidebar .gemini-assistant-new-chat {
    width: calc(100% + var(--sb-ext));
    min-width: 0;
    height: var(--sb-primary-h);
    margin-top: 10px;
    flex-shrink: 0;
  }
  .gemini-assistant-panel.is-fullscreen .gemini-assistant-nav-sidebar .side-primary-ic {
    display: inline-flex !important;
    width: var(--sb-pic);
    height: var(--sb-pic);
    min-width: var(--sb-pic);
    flex: 0 0 var(--sb-pic);
    color: var(--sb-primary-ink);
    visibility: visible;
    opacity: 1;
  }
  .gemini-assistant-panel.is-fullscreen .gemini-assistant-nav-sidebar .gemini-assistant-new-chat > .side-primary-ic > .icon {
    display: inline-flex !important;
    width: var(--sb-pic-glyph);
    height: var(--sb-pic-glyph);
    color: inherit;
    visibility: visible;
    opacity: 1;
  }
  .gemini-assistant-panel.is-fullscreen .gemini-assistant-nav-sidebar .gemini-assistant-new-chat > .side-primary-ic > .icon > svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
  }
  .gemini-assistant-panel.is-fullscreen .gemini-assistant-nav-sidebar .side-primary-label {
    display: block;
    flex: 1;
    opacity: 1;
  }
  .gemini-assistant-panel.is-fullscreen .gemini-assistant-nav-sidebar .gemini-assistant-history-item {
    width: 100%;
    min-width: 0;
    flex-shrink: 0;
  }
  .gemini-assistant-panel.is-fullscreen .gemini-assistant-nav-sidebar .gemini-assistant-history-item.active {
    width: calc(100% + var(--sb-ext));
  }
  .gemini-assistant-panel.is-fullscreen .gemini-assistant-nav-sidebar .nav-label {
    display: block;
    opacity: 1;
  }
  html[data-theme="dark"] .gemini-assistant-panel.is-fullscreen .gemini-assistant-mobile-sidebar-open {
    color: #a4a7ae;
  }
}

@media (max-width: 760px) {
  /* Em telas menores apenas reduzimos os respiros da página e do compositor. */
  .gemini-assistant-panel.is-fullscreen .gemini-assistant-head { padding: 17px 18px; }
  .gemini-assistant-panel.is-fullscreen .gemini-assistant-messages { padding-inline: 20px; }
  .gemini-assistant-panel.is-fullscreen .gemini-assistant-composer {
    width: calc(100% - 24px);
    margin-inline: 12px;
    margin-bottom: max(16px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 540px) {
  .gemini-assistant-panel {
    width: calc(100vw - 24px);
    height: min(500px, calc(100vh - 24px));
    max-height: calc(100vh - 92px - env(safe-area-inset-bottom));
    border-radius: 18px;
  }
  .gemini-assistant-head { grid-template-columns: 36px minmax(0, 1fr) 30px; padding: 12px; border-radius: 18px 18px 0 0; }
  .gemini-assistant-mark { width: 36px; height: 36px; }
  .gemini-assistant-empty { padding-inline: 4px; font-size: 20px; }
  .gemini-assistant-bubble { max-width: 88%; }
}

@media (prefers-reduced-motion: reduce) {
  .gemini-assistant-panel.is-fullscreen,
  .gemini-assistant-view-toggle,
  .gemini-assistant-view-back,
  .gemini-assistant-composer,
  .gemini-assistant-composer button { transition: none; }
  .gemini-assistant-panel.is-opening,
  .gemini-assistant-panel.is-closing { animation: none; }
  .gemini-assistant-empty.is-leaving { animation: none; transform: translateY(64px); }
  .gemini-assistant-typing-dot { animation: none; opacity: .72; }
}

/* Loja sem certificado A1 / dados fiscais. O aviso nasce como uma pequena aba
   flutuante; a mensagem completa só ocupa a tela quando a pessoa pedir. */
.fiscal-setup-float {
  position: fixed;
  inset-inline-start: auto;
  inset-inline-end: 24px;
  bottom: 24px;
  z-index: 55;
  display: block;
  width: 44px;
  height: 44px;
  pointer-events: none;
}

.fiscal-setup-toggle,
.fiscal-setup-warning { pointer-events: auto; }

.fiscal-setup-toggle {
  position: relative;
  z-index: 2;
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(178, 106, 0, .25);
  border-radius: 13px;
  background: #fff3dd;
  color: #b26a00;
  box-shadow: 0 8px 22px rgba(104, 63, 0, .14);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.fiscal-setup-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(178, 106, 0, .45);
  box-shadow: 0 11px 26px rgba(104, 63, 0, .19);
}

.fiscal-setup-toggle:focus-visible {
  outline: 2px solid #b26a00;
  outline-offset: 3px;
}

.fiscal-setup-float.is-dragging .fiscal-setup-toggle { cursor: grabbing; transform: none; }
.fiscal-setup-float.is-expanded .fiscal-setup-toggle { background: #ffe9bf; }
.fiscal-setup-toggle .icon { display: grid; place-items: center; width: 20px; height: 20px; }
.fiscal-setup-toggle .icon svg { width: 20px; height: 20px; fill: currentColor; }

.fiscal-setup-warning {
  position: absolute;
  inset-inline-start: auto;
  inset-inline-end: calc(100% + 10px);
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  margin: 0;
  padding: 15px 16px;
  border: 1px solid rgba(178, 106, 0, .30);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 176, 32, .13), rgba(255, 176, 32, .05)), var(--card);
  box-shadow: 0 18px 48px rgba(49, 31, 0, .17);
  animation: fiscalSetupPopoverIn 220ms cubic-bezier(.22, 1, .36, 1) both;
}

.fiscal-setup-warning.has-readiness {
  align-items: start;
  width: min(680px, calc(100vw - 24px));
}

.fiscal-setup-warning[hidden] { display: none; }
.fiscal-setup-text { min-width: 190px; display: flex; flex-direction: column; gap: 3px; }
.fiscal-setup-text b { color: var(--ink); font: 800 14px var(--apple-font); }
.fiscal-setup-text span { color: var(--muted); font: 600 12.5px var(--apple-font); }
.fiscal-setup-text ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font: 600 12.5px/1.55 var(--apple-font); }

.fiscal-setup-actions {
  display: grid;
  gap: 8px;
}

.fiscal-setup-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: 700 12.5px var(--apple-font);
  cursor: pointer;
  transition: border-color .16s ease;
}

.fiscal-setup-btn:hover { border-color: var(--ink); }
.fiscal-setup-btn:disabled { opacity: .62; cursor: wait; }
.fiscal-setup-btn .icon svg { width: 15px; height: 15px; fill: currentColor; }

.fiscal-setup-readiness {
  grid-column: 1 / -1;
  min-width: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(178, 106, 0, .20);
}

.fiscal-setup-readiness[hidden] { display: none; }

.fiscal-readiness-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 11px;
}

.fiscal-readiness-heading > div,
.fiscal-readiness-item > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fiscal-readiness-heading b {
  color: var(--ink);
  font: 800 13.5px var(--apple-font);
}

.fiscal-readiness-heading > div > span {
  color: var(--muted);
  font: 600 11.5px var(--apple-font);
}

.fiscal-readiness-state {
  flex: none;
  padding: 5px 9px;
  border: 1px solid rgba(178, 106, 0, .22);
  border-radius: 999px;
  background: rgba(178, 106, 0, .09);
  color: #9a5a00;
  font: 800 10.5px var(--apple-font);
  letter-spacing: .01em;
}

.fiscal-readiness-state.is-ready {
  border-color: rgba(24, 123, 73, .24);
  background: rgba(24, 123, 73, .10);
  color: #187b49;
}

.fiscal-readiness-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.fiscal-readiness-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
}

.fiscal-readiness-item > .icon {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  color: #a66300;
}

.fiscal-readiness-item > .icon svg { width: 17px; height: 17px; fill: currentColor; }
.fiscal-readiness-item b { color: var(--ink); font: 750 12px/1.35 var(--apple-font); overflow-wrap: anywhere; }
.fiscal-readiness-item small { color: var(--muted); font: 600 10.8px/1.35 var(--apple-font); overflow-wrap: anywhere; }
.fiscal-readiness-item.is-danger { border-color: rgba(196, 65, 55, .20); background: rgba(196, 65, 55, .055); }
.fiscal-readiness-item.is-danger > .icon { color: #c44137; }
.fiscal-readiness-item.is-warning { border-color: rgba(178, 106, 0, .20); background: rgba(178, 106, 0, .055); }

.fiscal-readiness-loading,
.fiscal-readiness-error {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid rgba(178, 106, 0, .20);
  border-radius: 12px;
  color: var(--muted);
  font: 700 12px/1.4 var(--apple-font);
}

.fiscal-readiness-loading .icon { display: grid; color: #a66300; }
.fiscal-readiness-loading .icon svg { width: 18px; height: 18px; fill: currentColor; }
.fiscal-readiness-error { border-color: rgba(196, 65, 55, .24); color: #b23b33; background: rgba(196, 65, 55, .06); }

@keyframes fiscalSetupPopoverIn {
  from { opacity: 0; transform: translateY(6px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

html[data-theme="dark"] .fiscal-setup-toggle {
  border-color: rgba(255, 185, 94, .26);
  background: rgba(255, 185, 94, .14);
  color: #ffb95e;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .32);
}
html[data-theme="dark"] .fiscal-setup-float.is-expanded .fiscal-setup-toggle { background: rgba(255, 185, 94, .22); }
html[data-theme="dark"] .fiscal-setup-warning {
  border-color: rgba(255, 185, 94, .26);
  background: linear-gradient(135deg, rgba(255, 185, 94, .12), rgba(255, 185, 94, .04)), #17191e;
  box-shadow: 0 20px 54px rgba(0, 0, 0, .42);
}
html[data-theme="dark"] .fiscal-setup-readiness { border-top-color: rgba(255, 185, 94, .18); }
html[data-theme="dark"] .fiscal-readiness-item { background: rgba(255, 255, 255, .025); }
html[data-theme="dark"] .fiscal-readiness-state { color: #ffc172; background: rgba(255, 185, 94, .10); border-color: rgba(255, 185, 94, .20); }
html[data-theme="dark"] .fiscal-readiness-state.is-ready { color: #73d8a5; background: rgba(61, 184, 122, .10); border-color: rgba(61, 184, 122, .22); }
html[data-theme="dark"] .fiscal-readiness-error { color: #ff8f87; }

@media (max-width: 940px) {
  .fiscal-setup-float {
    inset-inline-start: auto;
    inset-inline-end: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 540px) {
  .fiscal-setup-warning {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 15px;
    max-height: calc(100vh - 82px - env(safe-area-inset-bottom));
  }
  .fiscal-setup-actions { width: 100%; }
  .fiscal-setup-btn { width: 100%; justify-content: center; }
  .fiscal-readiness-heading { align-items: stretch; flex-direction: column; gap: 9px; }
  .fiscal-readiness-state { align-self: flex-start; }
  .fiscal-readiness-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .fiscal-setup-toggle { transition: none; }
  .fiscal-setup-warning { animation: none; }
}

.pos-overlay.pos-overlay-entering {
  animation: posOverlaySlideIn 450ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform;
}
.pos-overlay.pos-overlay-leave {
  animation: posOverlaySlideOut 350ms cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  will-change: transform;
}
@keyframes posOverlaySlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes posOverlaySlideOut {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .pos-overlay,
  .pos-overlay.pos-overlay-entering,
  .pos-overlay.pos-overlay-leave {
    animation: none !important;
  }
}
.pos-overlay .pos-page { height: 100%; }
/* Mesmo zoom 0.8 do shell (.system-scale) — mantém o PDV na escala do app Flutter. */
@media (min-width: 941px) {
  .pos-overlay { overflow: hidden; }
  .pos-overlay .pos-page {
    width: 125%;
    height: 125%;
    transform: scale(0.8);
    transform-origin: top left;
  }
}
.pos-page { display: flex; flex-direction: column; gap: 14px; margin-top: 0; }

/* ---- Cabeçalho ---- */
.pos-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pos-header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pos-header-left h1 { font-size: 18px; font-weight: 900; color: var(--ink); margin: 0; letter-spacing: -0.02em; }
.pos-back, .pos-menu {
  width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; cursor: pointer;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.pos-back .icon, .pos-menu .icon { width: 20px; height: 20px; }
.pos-header-right { display: flex; align-items: center; gap: 10px; }
.pos-theme { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.pos-theme .icon { width: 20px; height: 20px; }

/* Aviso de conexão do PDV. Fica fora do fluxo enquanto há servidor: só acende
   quando o Firestore passa a responder pelo cache, e aí a venda não fecha. */
.pos-net {
  width: 40px; height: 40px; flex: 0 0 auto; display: none; place-items: center;
  border-radius: 12px; border: 1px solid rgba(229, 72, 77, 0.34);
  background: rgba(229, 72, 77, 0.12); color: var(--red, #e5484d);
}
.pos-net.is-offline { display: grid; }
.pos-net .icon { width: 20px; height: 20px; }
html[data-theme="dark"] .pos-net {
  border-color: rgba(255, 105, 110, 0.38);
  background: rgba(255, 105, 110, 0.16);
  color: #ff8a8e;
}
.pos-seller-card {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px; cursor: pointer;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); max-width: 220px;
}
.pos-seller-text { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.pos-seller-text small { color: var(--muted); font-weight: 800; font-size: 10.5px; line-height: 1.1; }
.pos-seller-text b { font-weight: 900; font-size: 14px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-seller-card > .icon { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }

.pos-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(320px, 1fr); gap: 16px; align-items: stretch; }

/* ---- Catálogo ---- */
.pos-catalog { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
.pos-search-row { display: flex; gap: 10px; align-items: stretch; }
.pos-search {
  flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0;
  background: var(--field); border: 1px solid var(--line); border-radius: 14px;
  padding: 0 14px; height: 46px;
}
.pos-search-ic { width: 20px; height: 20px; color: var(--muted); flex: 0 0 auto; }
.pos-search input {
  flex: 1; min-width: 0; border: none; background: transparent; outline: none;
  font-size: 15px; color: var(--ink); font-family: var(--apple-font);
}
.pos-search input::placeholder { color: var(--muted); }
.pos-tool-btn {
  width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  color: var(--ink); cursor: pointer; box-shadow: 0 6px 16px var(--shadow); transition: transform .12s;
}
.pos-tool-btn:hover { transform: translateY(-1px); }
.pos-tool-btn .icon { width: 20px; height: 20px; }
.pos-tool-dot { position: relative; }
.pos-tool-dot::after { content: ""; position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px var(--card); }

.pos-cat-row { display: flex; align-items: center; gap: 6px; }
.pos-cat-arrow { width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer; }
.pos-cat-arrow .icon { width: 14px; height: 14px; }
.pos-categories { flex: 1; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; scroll-behavior: smooth; min-width: 0; }
.pos-categories::-webkit-scrollbar { display: none; }
.pos-categories::-webkit-scrollbar-thumb { background: transparent; }
.pos-cat-chip {
  flex: 0 0 auto; padding: 8px 6px; border: none; border-bottom: 2px solid transparent; border-radius: 0;
  background: transparent !important; color: var(--muted); font-weight: 700; font-size: 11px; cursor: pointer;
  white-space: nowrap; transition: all .12s;
}
.pos-cat-chip:hover { color: var(--ink); }
.pos-cat-chip.active { background: transparent !important; border-color: transparent; border-bottom: 2px solid var(--ink); color: var(--ink); box-shadow: none; }

.pos-products { flex: 1; min-height: 0; overflow-y: auto; padding-right: 2px; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
.pos-products.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; align-content: start;
}
.pos-products.list { display: flex; flex-direction: column; gap: 10px; }
.pos-empty { padding: 40px 16px; text-align: center; color: var(--muted); font-weight: 800; }

.pos-card {
  display: flex; flex-direction: column; text-align: left; gap: 6px; padding: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; cursor: pointer;
  box-shadow: 0 6px 16px var(--shadow); transition: transform .12s, box-shadow .12s; color: var(--ink);
}
.pos-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px var(--shadow); }
.pos-card:active { transform: translateY(0); }
.pos-card-img {
  width: 100%; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; display: grid; place-items: center;
  background: #fff; color: var(--muted);
}
.pos-card-img img { width: 100%; height: 100%; object-fit: cover; }
.pos-card-img .icon { width: 34px; height: 34px; }
.pos-card-name { display: flex; align-items: flex-start; gap: 5px; font-weight: 900; font-size: 12.5px; line-height: 1.2; color: var(--ink); min-height: 2.4em; }
.pos-card-name span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pos-card-tag { width: 13px; height: 13px; flex: 0 0 auto; color: var(--muted); margin-top: 1px; }
.pos-card-price { font-weight: 900; font-size: 14px; color: var(--ink); margin-top: auto; }
.pos-card-stock { font-size: 11px; color: var(--muted); font-weight: 700; }

.pos-row {
  display: flex; align-items: center; gap: 12px; padding: 12px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 6px 16px var(--shadow);
}
.pos-row:hover { border-color: var(--blue-soft); }
.pos-row-img { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 14px; overflow: hidden; display: grid; place-items: center; background: #fff; color: var(--muted); }
.pos-row-img img { width: 100%; height: 100%; object-fit: cover; }
.pos-row-img .icon { width: 22px; height: 22px; }
.pos-row-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pos-row-mid b { font-weight: 900; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-row-mid span { font-size: 12px; color: var(--muted); font-weight: 700; }
.pos-row-add { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; border: 1.5px solid var(--blue); background: transparent; color: var(--blue); cursor: pointer; transition: background .12s, color .12s; }
.pos-row-add:hover { background: var(--blue); color: #fff; }
.pos-row-add .icon { width: 20px; height: 20px; }

/* ---- Resumo / carrinho ---- */
.pos-summary {
  height: 100%; min-height: 0; display: flex; flex-direction: column; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 14px;
  box-shadow: 0 12px 30px var(--shadow);
  margin-bottom: max(18px, env(safe-area-inset-bottom));
}
.pos-summary-head { font-weight: 900; font-size: 15px; color: var(--ink); }
.pos-client-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card-soft);
  color: var(--ink); font-weight: 900; font-size: 15px; cursor: pointer;
}
.pos-client-btn .icon { width: 20px; height: 20px; color: var(--muted); }
.pos-cart { flex: 1; min-height: 80px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.pos-cart-empty { color: var(--muted); font-weight: 800; text-align: center; padding: 24px 0; }
.pos-cart-row { display: flex; align-items: center; gap: 10px; padding: 7px 6px 8px; border-bottom: 1px solid var(--line); border-radius: 10px; }
.pos-cart-row[data-edit-item],
.pos-cart-row[data-mb-edit-item] { cursor: pointer; transition: background 140ms ease, border-color 140ms ease; }
.pos-cart-row[data-edit-item]:hover,
.pos-cart-row[data-mb-edit-item]:hover { background: var(--card-soft); }
.pos-cart-row[data-edit-item]:focus-visible,
.pos-cart-row[data-mb-edit-item]:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.pos-cart-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pos-cart-info b { font-weight: 900; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-cart-info span { font-size: 12px; color: var(--muted); font-weight: 700; }
.pos-qty-btn {
  min-width: 40px; height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card-soft); color: var(--ink); font-weight: 900; cursor: pointer;
}
.pos-remove-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px;
  border: none; background: #ffeef0; color: #e5484d; cursor: pointer;
  transition: opacity .12s, background .12s;
}
.pos-remove-btn:active { opacity: 0.75; }
html[data-theme="dark"] .pos-remove-btn { background: rgba(229, 72, 77, 0.16); color: #ff6b70; }
.pos-remove-btn .icon { width: 18px; height: 18px; }
.pos-totals { display: flex; flex-direction: column; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.pos-total-line { display: flex; justify-content: space-between; font-size: 13px; font-weight: 800; color: var(--muted); }
.pos-total-line span:last-child { color: var(--ink); }
.pos-total-line.big { font-size: 14px; font-weight: 900; margin-top: 4px; }
.pos-total-line.big span { color: var(--ink); }
.pos-total-line.big span:last-child { font-size: 18px; }
.pos-summary-actions { display: flex; gap: 10px; }
.pos-ghost-btn {
  flex: 1; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-soft);
  color: var(--ink); font-weight: 800; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.pos-ghost-btn:hover { border-color: var(--blue-soft); }
.pos-ghost-btn .icon { width: 18px; height: 18px; }
.pos-finalize-btn {
  width: 100%; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-soft); color: var(--ink);
  font-weight: 900; font-size: 15px; cursor: pointer;
}
.pos-conditional-btn {
  width: 100%; padding: 13px 14px; border-radius: 12px;
  border: 1px solid rgba(115, 87, 216, 0.34); background: rgba(115, 87, 216, 0.10); color: #6245cf;
  font-weight: 900; font-size: 14px; cursor: pointer;
  transition: background .12s, border-color .12s, transform .12s;
}
.pos-conditional-btn:hover { background: rgba(115, 87, 216, 0.16); border-color: rgba(115, 87, 216, 0.52); }
.pos-conditional-btn:active { transform: scale(0.99); }
.pos-conditional-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.pos-finalize-btn:hover { border-color: var(--blue-soft); }
.pos-finalize-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---- Diálogos do PDV ---- */
.stats-modal-card.pos-item-edit-dialog {
  width: min(580px, 100%);
  max-height: min(660px, calc(100vh - 48px));
  padding: 0;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.18);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}
.pos-item-edit-dialog .stats-modal-head {
  margin: 0;
  padding: 17px 18px 8px;
}
.pos-item-edit-dialog .stats-modal-head h3 {
  color: #1d1d1f;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.pos-item-edit-dialog .stats-modal-close {
  display: inline-flex;
  background: #f5f5f7;
  color: #6e6e73;
}
.pos-item-edit-dialog .stats-modal-body {
  padding: 0 18px;
  overflow-y: auto;
}
.pos-item-edit-product {
  margin-bottom: 14px;
  color: #1d1d1f;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.pos-item-edit-main-grid,
.pos-item-edit-discount-grid {
  display: grid;
  gap: 10px;
}
.pos-item-edit-main-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pos-item-edit-discount-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
.pos-item-edit-field {
  min-width: 0;
  min-height: 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 4px;
  padding: 8px 11px;
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 12px;
  background: #f5f5f7;
}
.pos-item-edit-field span {
  color: #6e6e73;
  font-size: 11.5px;
  line-height: 1.1;
  font-weight: 500;
  text-align: right;
}
.pos-item-edit-field input,
.pos-item-edit-field strong {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1d1d1f;
  font: inherit;
  font-size: 14.5px;
  line-height: 1.3;
  font-weight: 500;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pos-item-edit-field input:focus-visible { box-shadow: 0 2px 0 #1d1d1f; }
.pos-item-edit-subtotal,
.pos-item-edit-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #1d1d1f;
  font-variant-numeric: tabular-nums;
}
.pos-item-edit-subtotal {
  margin-top: 8px;
  padding: 0 2px 10px;
  border-bottom: 1px solid rgba(29, 29, 31, 0.10);
  font-size: 14px;
}
.pos-item-edit-subtotal strong { font-size: 18px; }
.pos-item-edit-total {
  margin-top: 14px;
  padding: 14px 2px 2px;
  border-top: 1px solid rgba(29, 29, 31, 0.10);
  font-size: 16px;
}
.pos-item-edit-total strong { font-size: 22px; letter-spacing: -0.025em; }
.pos-item-edit-dialog .stats-modal-foot {
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 14px 18px 16px;
}
.pos-item-edit-footer-spacer { flex: 1; }
.pos-item-edit-remove,
.pos-item-edit-cancel,
.pos-item-edit-confirm {
  width: auto;
  height: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}
.pos-item-edit-remove .icon,
.pos-item-edit-cancel .icon,
.pos-item-edit-confirm .icon { width: 16px; height: 16px; }
.pos-item-edit-remove {
  padding-left: 0;
  border: 0;
  background: transparent;
  color: #8a94a6;
}
.pos-item-edit-cancel {
  border: 1px solid transparent;
  background: transparent;
  color: #596579;
}
.pos-item-edit-confirm {
  border: 1px solid #1d1d1f;
  background: #1d1d1f;
  color: #ffffff;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.16);
}
.pos-item-edit-remove:hover { color: #d14852; }
.pos-item-edit-cancel:hover { background: #f5f5f7; }
.pos-item-edit-confirm:hover { background: #000000; border-color: #000000; }
.pos-item-edit-remove:active,
.pos-item-edit-cancel:active,
.pos-item-edit-confirm:active { transform: scale(0.98); }

html[data-theme="dark"] .stats-modal-card.pos-item-edit-dialog {
  border-color: rgba(255, 255, 255, 0.12);
  background: #181b22;
  color: #f5f5f7;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.48);
}
html[data-theme="dark"] .pos-item-edit-dialog .stats-modal-head h3,
html[data-theme="dark"] .pos-item-edit-product,
html[data-theme="dark"] .pos-item-edit-field input,
html[data-theme="dark"] .pos-item-edit-field strong,
html[data-theme="dark"] .pos-item-edit-subtotal,
html[data-theme="dark"] .pos-item-edit-total { color: #f5f5f7; }
html[data-theme="dark"] .pos-item-edit-field {
  border-color: rgba(255, 255, 255, 0.08);
  background: #111318;
}
html[data-theme="dark"] .pos-item-edit-field span,
html[data-theme="dark"] .pos-item-edit-remove { color: #a4a7ae; }
html[data-theme="dark"] .pos-item-edit-subtotal,
html[data-theme="dark"] .pos-item-edit-total { border-color: rgba(255, 255, 255, 0.10); }
html[data-theme="dark"] .pos-item-edit-cancel { color: #d4d6dc; }
html[data-theme="dark"] .pos-item-edit-cancel:hover { background: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .pos-item-edit-dialog .stats-modal-close { background: #111318; color: #a4a7ae; }
html[data-theme="dark"] .pos-item-edit-confirm,
html[data-theme="dark"] .pos-item-edit-confirm:hover { background: #050609; border-color: #050609; color: #ffffff; }

.pos-dialog {
  --bg: #07080a;
  --ink: #f5f5f7;
  --muted: #a4a7ae;
  --line: rgba(255, 255, 255, 0.14);
  --blue-rgb: 164, 167, 174;
  --blue: rgb(var(--blue-rgb));
  --blue-soft: #3a3a3c;
  --green: #4fe39a;
  --card: #111318;
  --card-soft: #181b22;
  --card-hover: rgba(255, 255, 255, 0.04);
  --field: rgba(255, 255, 255, 0.10);
  --shadow: rgba(0, 0, 0, 0.40);
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif !important;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.pos-dialog .pos-dialog-sub { color: var(--muted); font-weight: 700; font-size: 13.5px; margin: 0 0 12px; }
.pos-dialog-row { display: flex; gap: 12px; flex-wrap: wrap; }
.pos-dialog-row .stats-modal-field { flex: 1; min-width: 140px; }
.pos-stepper { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 8px 0; width: 100%; }
.pos-step-btn { width: 46px; height: 46px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.92); cursor: pointer; display: grid; place-items: center; }
.pos-step-btn .icon { width: 22px; height: 22px; }
.pos-stepper input { flex: 1; min-width: 0; text-align: center; font-size: 22px; font-weight: 600; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.92); padding: 8px; }
.pos-dialog-search { height: 44px; margin-bottom: 10px; }

.pos-picker-dialog { width: min(800px, 100%) !important; }
.pos-picker-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; margin-bottom: 10px; }
.pos-picker-item {
  display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; padding: 12px 14px;
  border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer;
}
.pos-picker-item:hover { background: rgba(255,255,255,0.03); }
.pos-picker-item.selected { border-color: var(--blue); background: rgba(59, 130, 246, 0.1); }
.pos-picker-item-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.pos-picker-item-left > .icon { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }
.pos-picker-item-left b { font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.pos-picker-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: 0 0 auto; }
.pos-picker-item-right span { font-size: 11px; color: var(--muted); font-weight: 600; }
.pos-client-item-actions { flex-direction: row; align-items: center; gap: 10px; }
.pos-client-contact { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 112px; }
.pos-client-contact span { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.pos-client-edit-btn {
  width: 38px; height: 38px; flex: 0 0 38px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: 1px solid var(--line); border-radius: 11px; background: transparent; color: var(--blue);
  cursor: pointer; transition: background 160ms ease, transform 150ms ease;
}
.pos-client-edit-btn:hover { background: rgba(var(--blue-rgb), 0.08); }
.pos-client-edit-btn:active { transform: scale(0.95); }
.pos-client-edit-btn .icon { width: 20px; height: 20px; margin: 0; }
.stats-modal-card.pos-picker-dialog #pos-client-continue:disabled { opacity: 0.45; cursor: not-allowed; }
.pos-footer-btn { flex: 1; justify-content: center; font-weight: 700; font-size: 13px; padding: 12px; border-radius: 12px; }

/* ---- Pagamento ---- */
.stats-modal-card.pos-pay-dialog { width: min(680px, 100%) !important; }
.pos-pay-dialog .pos-pay-remaining { text-align: center; display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.pos-pay-remaining-label { color: var(--muted); font-weight: 700; font-size: 12px; }
.pos-pay-remaining strong { font-size: 40px; font-weight: 300; color: var(--ink); letter-spacing: -1px; }
.pos-pay-change { color: var(--green); font-weight: 900; font-size: 13px; min-height: 16px; }
.pos-pay-selected { min-height: 60px; display: flex; flex-direction: column; gap: 6px; }
.pos-pay-empty { color: var(--muted); font-weight: 700; font-size: 13px; padding: 8px 0; }
.pos-pay-line { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pos-pay-line > .icon { width: 20px; height: 20px; color: var(--muted); }
.pos-pay-line-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pos-pay-line-info b { font-weight: 800; font-size: 14px; color: var(--ink); }
.pos-pay-line-info span { font-size: 11px; color: var(--muted); font-weight: 800; }
.pos-pay-line-val { font-weight: 900; color: var(--ink); }
.pos-pay-clear { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 999px; border: none; background: transparent; color: var(--muted); cursor: pointer; }
.pos-pay-clear .icon { width: 18px; height: 18px; }
.pos-pay-sep { height: 1px; background: var(--line); margin: 10px 0; }
.pos-pay-caption { color: var(--muted); font-weight: 800; font-size: 13px; }
.pos-pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.pos-pay-method {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 62px;
  padding: 10px; border-radius: 14px; border: 1px solid #111318; background: #111318; color: #fff;
  font-weight: 900; font-size: 12px; cursor: pointer; text-align: center;
  transition: all 150ms ease;
}
.pos-pay-method .icon { width: 20px; height: 20px; }
.pos-pay-method:not(.active):hover { background: var(--card-hover); border-color: var(--card-hover); }
.pos-pay-method.active { border-color: var(--blue); color: var(--blue); box-shadow: 0 8px 18px var(--shadow); }
.pos-pay-method.active .icon { color: var(--blue); }

/* ---- Revisão ---- */
.stats-modal-card.pos-review-dialog { width: min(540px, 100%) !important; }
.pos-review-dialog .stats-modal-foot { justify-content: flex-end; gap: 8px; margin-top: 10px; }
.pos-review-dialog .stats-modal-primary,
.pos-review-dialog .stats-modal-danger { width: auto; padding: 0 16px; flex: none; height: 36px; }
.pos-review-dialog textarea { resize: none; overflow: hidden; }
.pos-dialog .stats-modal-danger,
.pos-dialog .stats-modal-primary { background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.14); }
.pos-dialog .stats-modal-primary:hover,
.pos-dialog .stats-modal-danger:hover { background: rgba(255, 255, 255, 0.2); }
.pos-dialog .pos-review-row,
.pos-dialog .pos-review-pay,
.pos-dialog .stats-modal-field { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.14); }

.pos-review-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 6px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card-soft); color: var(--ink); cursor: pointer; margin-bottom: 10px; }
.pos-review-row small { display: block; color: var(--muted); font-weight: 800; font-size: 11px; text-align: left; }
.pos-review-row b { font-weight: 900; font-size: 15px; }
.pos-review-row .icon { width: 20px; height: 20px; color: var(--muted); }
.pos-review-sep { height: 1px; background: var(--line); margin: 6px 0 12px; }
.pos-review-pays { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 14px; }
.pos-review-pay { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-soft); }
.pos-review-pay .icon { width: 18px; height: 18px; color: var(--muted); flex: none; }
.pos-review-pay span:not(.icon) { flex: 1; font-weight: 900; color: var(--ink); font-size: 14px; text-align: left; }
.pos-review-pay b { font-weight: 900; color: var(--ink); }

.pos-dialog .stats-modal-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

/* ---- Pós-venda ---- */
.stats-modal-card.pos-post-dialog { width: min(420px, 100%) !important; }
.pos-post-dialog .stats-modal-head h3 { font-weight: 300; }
.pos-post-dialog .pos-dialog-sub { color: rgba(255, 255, 255, 0.7); }
.pos-post-dialog .pos-dialog-sub b { color: #fff; }
.pos-post-dialog .stats-modal-close { display: none; }
.pos-post-dialog .stats-modal-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pos-post-dialog .stats-modal-primary,
.pos-post-dialog .stats-modal-secondary,
.pos-post-dialog .stats-modal-danger { height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 300; cursor: pointer; }
.pos-post-dialog .stats-modal-primary { width: 100%; order: 1; height: 46px; font-size: 15px; }
.pos-post-dialog .stats-modal-danger { width: calc(50% - 4px); order: 2; }
.pos-post-dialog .stats-modal-secondary { width: calc(50% - 4px); order: 3; background: rgba(255, 255, 255, 0.08); color: #fff; border: 1px solid rgba(255, 255, 255, 0.08); }
.pos-post-dialog .stats-modal-secondary:hover { background: rgba(255, 255, 255, 0.14); }
.pos-post-dialog .stats-modal-primary .icon,
.pos-post-dialog .stats-modal-secondary .icon,
.pos-post-dialog .stats-modal-danger .icon { width: 18px; height: 18px; flex: none; }

.pos-mobile-bar {
  display: none;
}
.pos-mb-more {
  width: 48px; height: 48px; border-radius: 14px; border: none;
  background: var(--card-soft); color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
  transition: opacity .12s;
}
.pos-mb-more .icon { width: 22px; height: 22px; }
.pos-mb-more:active { opacity: 0.7; }

.pos-mb-pay {
  flex: 1; height: 48px; border-radius: 14px; border: none;
  background: var(--card-soft); color: var(--ink);
  font-weight: 900; font-size: 15px; cursor: pointer;
  text-align: center; display: flex; align-items: center; justify-content: center;
  transition: opacity .12s;
}
.pos-mb-pay:active { opacity: 0.7; }
.pos-mb-pay:disabled { opacity: 0.55; cursor: not-allowed; }

/* Menu de opções de venda */
.stats-modal-card.pos-options-dialog {
  width: min(460px, 92%) !important;
}
.pos-options-dialog .stats-modal-head h3 {
  font-family: var(--apple-font);
  font-weight: 300 !important;
}
.pos-options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0;
}
.pos-option-row {
  display: flex;
  align-items: center;
  width: 100%;
  border: none;
  background: transparent;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: background .12s;
}
.pos-option-row:hover, .pos-option-row:active {
  background: var(--card-soft);
}
.pos-opt-icon {
  margin-right: 14px;
  display: grid;
  place-items: center;
  color: var(--muted);
  flex-shrink: 0;
}
.pos-opt-icon .icon {
  width: 22px;
  height: 22px;
}
.pos-opt-label {
  flex: 1;
  font-family: var(--apple-font);
  font-weight: 300;
  font-size: 14.5px;
  color: var(--ink);
}
.pos-option-row > .icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .pos-overlay .pos-page,
  .pos-overlay.pos-has-cash-banner .pos-page { height: auto; }
  .pos-page.mobile-summary-active {
    height: calc(100vh - max(16px, env(safe-area-inset-top)) - 16px) !important;
    display: flex;
    flex-direction: column;
  }
  .pos-grid { grid-template-columns: 1fr; height: auto; }
  .pos-page.mobile-summary-active .pos-grid {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .pos-products { overflow: visible; min-height: 240px; padding-bottom: 90px; }
  .pos-summary { display: none !important; }
  .pos-summary #pos-finalize { display: none !important; }
  .pos-page.mobile-summary-active .pos-catalog { display: none !important; }
  .pos-page.mobile-summary-active .pos-summary {
    display: flex !important;
    flex: 1;
    min-height: 0;
    margin-bottom: 84px;
  }
  .pos-cart { max-height: 320px; }
  .pos-page.mobile-summary-active .pos-cart {
    max-height: none;
    flex: 1;
  }
  .pos-pay-remaining strong { font-size: 34px; }
  .pos-mobile-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card);
    border-top: 1px solid var(--line);
    padding: 12px 16px max(12px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px var(--shadow);
    z-index: 65;
  }
}

@media (max-width: 640px) {
  .stats-modal-card.pos-item-edit-dialog {
    width: min(100%, calc(100vw - 24px));
    max-height: calc(var(--app-height) - 24px);
    border-radius: 18px;
  }
  .pos-item-edit-dialog .stats-modal-head { padding: 18px 16px 9px; }
  .pos-item-edit-dialog .stats-modal-body { padding: 0 16px; }
  .pos-item-edit-main-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-item-edit-discount-grid { grid-template-columns: 1fr; gap: 8px; margin-top: 14px; }
  .pos-item-edit-field { min-height: 58px; }
  .pos-item-edit-total { margin-top: 14px; padding-top: 14px; }
  .pos-item-edit-dialog .stats-modal-foot { flex-wrap: wrap; padding: 14px 16px 16px; }
  .pos-item-edit-footer-spacer { display: none; }
  .pos-item-edit-remove { margin-right: auto; }
  .pos-item-edit-cancel,
  .pos-item-edit-confirm { min-width: 108px; }
}

/* ==========================================================================
   PDV (Venda) - Flutter System Dark Mode Aesthetics
   ========================================================================== */
html[data-theme="dark"] .pos-overlay {
  background: #07080a; /* Deep dark background */
}

/* Header */
html[data-theme="dark"] .pos-back,
html[data-theme="dark"] .pos-theme {
  background: transparent;
  border: none;
  box-shadow: none;
}
html[data-theme="dark"] .pos-header-left h1 {
  font-size: 16px;
  font-weight: 700;
}
html[data-theme="dark"] .pos-seller-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Toolbar & Search */
html[data-theme="dark"] .pos-search {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
html[data-theme="dark"] .pos-tool-btn,
html[data-theme="dark"] .pos-cat-arrow {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

/* Category Chips */
html[data-theme="dark"] .pos-cat-chip {
  background: transparent !important;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
}
html[data-theme="dark"] .pos-cat-chip.active {
  background: transparent !important;
  border-bottom: 2px solid #fff;
  color: #fff;
  box-shadow: none;
}

/* Product Rows */
html[data-theme="dark"] .pos-row {
  background: #111318;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: none;
  border-radius: 16px;
}
html[data-theme="dark"] .pos-row-add {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: #3b82f6;
}
html[data-theme="dark"] .pos-row-add:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Summary Sidebar */
html[data-theme="dark"] .pos-summary {
  background: #0b0d10;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: none;
}
html[data-theme="dark"] .pos-client-btn {
  background: #111318;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
html[data-theme="dark"] .pos-ghost-btn,
html[data-theme="dark"] .pos-conditional-btn,
html[data-theme="dark"] .pos-finalize-btn {
  background: #111318;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: none;
}
html[data-theme="dark"] .pos-conditional-btn {
  color: #b7a7ff;
  background: rgba(142, 119, 255, 0.13);
  border-color: rgba(183, 167, 255, 0.24);
}

/* ---------- Financeira: análise de CPF / crédito ---------- */
.client-icon-action.view { color: #13a065; }
.fin-back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer;
}
.fin-back:hover { background: var(--card-soft); }
.fin-back .icon svg { width: 18px; height: 18px; }
.fin-page .stats-mobile-title-row { margin-bottom: 6px; }
.fin-panel { display: flex; flex-direction: column; gap: 16px; }
.fin-search-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.fin-cpf-field { flex: 1 1 240px; }
.fin-cpf-field input { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.fin-result { display: flex; flex-direction: column; gap: 16px; margin-top: 2px; }
.fin-hint { color: var(--muted); font-size: 14px; margin: 4px 2px; }
.fin-warn { color: #e5843d; display: flex; align-items: center; gap: 6px; }
.fin-warn .icon svg, .fin-note .icon svg { width: 16px; height: 16px; }

.fin-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card-soft);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.fin-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fin-eyebrow { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 3px; }
.fin-cpf-display strong { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--ink); }

.fin-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.fin-chip .icon svg { width: 16px; height: 16px; }
.fin-chip.ok { background: rgba(19, 160, 101, 0.14); color: var(--green); border-radius: 10px; }
.fin-chip.bad { background: rgba(229, 72, 77, 0.14); color: #e5484d; }

.fin-client {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.fin-client-name { display: flex; align-items: center; gap: 8px; font-size: 16px; color: var(--ink); }
.fin-client-name .icon svg { width: 18px; height: 18px; }
.fin-client-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 13px; }
.fin-client-meta span { display: inline-flex; align-items: center; gap: 5px; }
.fin-client-meta .icon svg { width: 15px; height: 15px; }

.fin-ext-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fin-note {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; line-height: 1.45; color: var(--muted);
  background: rgba(229, 132, 61, 0.10);
  border: 1px solid rgba(229, 132, 61, 0.25);
  border-radius: 12px; padding: 10px 12px; margin: 0;
}

.fin-decision { display: flex; flex-direction: column; gap: 12px; }
.fin-field { display: flex; flex-direction: column; gap: 5px; }
.fin-field > span { font-size: 12px; color: var(--muted); }
.fin-field input, .fin-field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink);
  padding: 10px 12px; font-size: 14px; font-family: inherit; resize: vertical;
}
.fin-field input:focus, .fin-field textarea:focus { outline: none; border-color: var(--blue); }

.fin-dec-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.fin-dec-btn {
  flex: 1 1 120px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; cursor: pointer;
  background: var(--card); color: var(--ink);
  transition: transform 0.08s ease, filter 0.15s ease;
}
.fin-dec-btn .icon svg { width: 17px; height: 17px; }
.fin-dec-btn:hover { transform: translateY(-1px); }
.fin-dec-btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.fin-dec-btn.approve { background: var(--green); color: #fff; border-color: transparent; }
.fin-dec-btn.negativado { background: #e5843d; color: #fff; border-color: transparent; }
.fin-dec-btn.reject { background: #e5484d; color: #fff; border-color: transparent; }

.fin-history-head { display: flex; align-items: center; gap: 8px; }
.fin-history-head h3 { margin: 0; font-size: 16px; color: var(--ink); }
.fin-history-head .icon svg { width: 18px; height: 18px; color: var(--muted); }
.fin-history { display: flex; flex-direction: column; gap: 8px; }
.fin-recent-tabs { margin-bottom: 4px; }
.fin-recent-list { display: flex; flex-direction: column; gap: 8px; min-height: 48px; }
.fin-hist-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); padding: 10px 12px;
}
.fin-hist-badge {
  flex: 0 0 auto; padding: 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.fin-hist-badge.aprovado { background: rgba(19, 160, 101, 0.14); color: var(--green); }
.fin-hist-badge.pendente { background: rgba(110, 110, 115, 0.14); color: var(--muted); }
.fin-hist-badge.em-analise { background: rgba(229, 132, 61, 0.20); color: #b85f21; }
.fin-hist-badge.documentacao { background: rgba(229, 132, 61, 0.16); color: #e5843d; }
.fin-hist-badge.arquivos { background: rgba(19, 160, 101, 0.14); color: #13885a; }
.fin-hist-badge.negativado { background: rgba(229, 132, 61, 0.16); color: #e5843d; }
.fin-hist-badge.reprovado { background: rgba(229, 72, 77, 0.14); color: #e5484d; }
.fin-hist-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fin-hist-main strong { font-size: 14px; color: var(--ink); }
.fin-hist-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-hist-meta { flex: 0 0 auto; text-align: right; font-size: 11px; color: var(--muted); line-height: 1.4; }
.fin-hist-row.has-documentation {
  align-items: center;
  flex-wrap: wrap;
}
.fin-hist-row.has-documentation .fin-doc-request-inline {
  width: 100%;
  flex: 0 0 100%;
  margin-top: 0;
}
.fin-hist-row.is-openable {
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.fin-hist-row.is-openable:hover {
  border-color: color-mix(in srgb, var(--blue) 38%, var(--line));
  transform: translateY(-1px);
  box-shadow: 0 7px 18px var(--shadow);
}
.fin-hist-row.is-openable:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 24%, transparent);
  outline-offset: 2px;
}
.fin-hist-open-icon {
  width: 28px; height: 28px; display: grid; place-items: center;
  flex: 0 0 28px; align-self: center; border-radius: 9px;
  background: var(--card-soft); color: var(--muted);
}
.fin-hist-open-icon .icon, .fin-hist-open-icon .icon svg { width: 17px; height: 17px; }
.fin-hist-row.fin-request-status-pendente {
  border-color: var(--line);
  background: var(--card);
  box-shadow: none;
}
.fin-hist-row.fin-request-status-em-analise {
  border-color: rgba(229, 132, 61, 0.46);
  background-color: var(--card);
  background-image: linear-gradient(90deg, rgba(229, 132, 61, 0.20), rgba(229, 132, 61, 0.09));
  background-position: left center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  box-shadow: none;
}
.fin-hist-row.fin-request-status-em-analise.fin-request-status-entering {
  animation: fin-analysis-orange-enter 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes fin-analysis-orange-enter {
  from {
    border-color: var(--line);
    background-size: 0% 100%;
  }
  to {
    border-color: rgba(229, 132, 61, 0.46);
    background-size: 100% 100%;
  }
}
.fin-hist-row.fin-request-status-pendente.fin-request-status-exiting {
  background-color: var(--card);
  background-image: linear-gradient(90deg, rgba(229, 132, 61, 0.20), rgba(229, 132, 61, 0.09));
  background-position: left center;
  background-repeat: no-repeat;
  animation: fin-analysis-orange-exit 460ms cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes fin-analysis-orange-exit {
  from {
    border-color: rgba(229, 132, 61, 0.46);
    background-size: 100% 100%;
  }
  to {
    border-color: var(--line);
    background-size: 0% 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fin-hist-row.fin-request-status-em-analise.fin-request-status-entering,
  .fin-hist-row.fin-request-status-pendente.fin-request-status-exiting {
    animation: none;
  }
}
.fin-hist-row.fin-request-status-aprovado {
  border-color: rgba(19, 160, 101, 0.44);
  background: linear-gradient(135deg, rgba(19, 160, 101, 0.18), rgba(19, 160, 101, 0.07)), var(--card);
}
.fin-hist-row.fin-request-status-recusado {
  border-color: rgba(229, 72, 77, 0.44);
  background: linear-gradient(135deg, rgba(229, 72, 77, 0.18), rgba(229, 72, 77, 0.07)), var(--card);
  box-shadow: inset 4px 0 0 #e5484d;
}
.fin-hist-row.has-contract {
  flex-wrap: wrap;
}
.fin-contract-status-card {
  width: 100%;
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--card) 82%, transparent);
}
.fin-contract-status-card.signed,
.fin-contract-status-card.regularize {
  border-color: rgba(19, 160, 101, 0.30);
  background: rgba(19, 160, 101, 0.08);
}
.fin-contract-status-card.failed,
.fin-contract-status-card.cancelled {
  border-color: rgba(229, 72, 77, 0.34);
  background: rgba(229, 72, 77, 0.08);
}
.fin-contract-status-card.queued {
  border-color: rgba(229, 132, 61, 0.34);
  background: rgba(229, 132, 61, 0.09);
}
.fin-contract-status-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--card-soft);
  color: var(--muted);
}
.fin-contract-status-card.signed .fin-contract-status-icon,
.fin-contract-status-card.regularize .fin-contract-status-icon { color: var(--green); }
.fin-contract-status-card.failed .fin-contract-status-icon,
.fin-contract-status-card.cancelled .fin-contract-status-icon { color: #e5484d; }
.fin-contract-status-card.queued .fin-contract-status-icon { color: #e5843d; }
.fin-contract-status-icon .icon,
.fin-contract-status-icon .icon svg {
  width: 18px;
  height: 18px;
}
.fin-contract-status-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.fin-contract-status-copy strong {
  color: var(--ink);
  font-size: 12.5px;
}
.fin-contract-status-copy span {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
}
.fin-contract-status-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
}
.cred-btn.compact {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 12px;
}
.stats-modal-card.fin-contract-send-dialog {
  width: min(640px, calc(100vw - 48px));
  padding: 0;
  border: 1px solid rgba(29, 29, 31, 0.12);
  border-radius: 24px;
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}
.fin-contract-send-dialog .stats-modal-head {
  min-height: 62px;
  margin: 0;
  padding: 14px 18px 14px 24px;
  border-bottom: 1px solid rgba(29, 29, 31, 0.10);
}
.fin-contract-send-dialog .stats-modal-head h3 {
  color: #1d1d1f;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 500;
}
.fin-contract-send-dialog .stats-modal-close {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  background: #f5f5f7;
  color: #6e6e73;
}
.fin-contract-send-dialog .stats-modal-close:hover {
  background: #e9e9ed;
  color: #1d1d1f;
}
.fin-contract-send-dialog .stats-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 24px;
}
.fin-contract-send-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  border-radius: 14px;
  background: #f5f5f7;
}
.fin-contract-send-summary strong {
  color: #1d1d1f;
  font-size: 14px;
  font-weight: 500;
}
.fin-contract-send-summary span {
  color: #6e6e73;
  font-size: 12px;
}
.fin-contract-send-dialog .stats-modal-field {
  min-height: 52px;
  margin: 0;
  padding: 0 14px;
  border-color: rgba(29, 29, 31, 0.12);
  background: #f5f5f7;
}
.fin-contract-send-dialog .stats-modal-field span {
  color: #6e6e73;
}
.fin-contract-send-dialog .stats-modal-field input,
.fin-contract-send-dialog .stats-modal-field select {
  color: #1d1d1f;
  color-scheme: light;
}
.fin-contract-link-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  border-radius: 14px;
  background: #f5f5f7;
}
.fin-contract-link-preview span {
  color: #6e6e73;
  font-size: 11px;
}
.fin-contract-link-preview code {
  color: #1d1d1f;
  font: 11.5px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}
.fin-contract-send-note {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #6e6e73;
  font-size: 12px;
  line-height: 1.5;
}
.fin-contract-send-note .icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: 1px;
}
.fin-contract-send-dialog .stats-modal-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  padding: 14px 24px 18px;
  border-top: 1px solid rgba(29, 29, 31, 0.10);
}
.fin-contract-send-dialog .stats-modal-secondary,
.fin-contract-send-dialog .stats-modal-primary {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 16px;
  border-radius: 14px;
}
.fin-contract-send-dialog .stats-modal-secondary {
  border-color: rgba(29, 29, 31, 0.14);
  background: #ffffff;
  color: #1d1d1f;
}
.fin-contract-send-dialog .stats-modal-primary {
  border: 1px solid #1d1d1f;
  background: #1d1d1f;
  color: #ffffff;
}
.fin-contract-send-dialog button:focus-visible,
.fin-contract-send-dialog input:focus-visible,
.fin-contract-send-dialog select:focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: 2px;
}
.fin-contract-send-dialog button:disabled {
  cursor: wait;
  opacity: 0.58;
}
html[data-theme="dark"] .stats-modal-card.fin-contract-send-dialog {
  border-color: rgba(255, 255, 255, 0.14);
  background: #181b22;
  color: #f5f5f7;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.46);
}
html[data-theme="dark"] .fin-contract-send-dialog .stats-modal-head,
html[data-theme="dark"] .fin-contract-send-dialog .stats-modal-foot {
  border-color: rgba(255, 255, 255, 0.10);
}
html[data-theme="dark"] .fin-contract-send-dialog .stats-modal-head h3,
html[data-theme="dark"] .fin-contract-send-dialog .fin-contract-send-summary strong,
html[data-theme="dark"] .fin-contract-send-dialog .fin-contract-link-preview code {
  color: #f5f5f7;
}
html[data-theme="dark"] .fin-contract-send-dialog .stats-modal-close,
html[data-theme="dark"] .fin-contract-send-dialog .fin-contract-send-summary,
html[data-theme="dark"] .fin-contract-send-dialog .stats-modal-field,
html[data-theme="dark"] .fin-contract-send-dialog .fin-contract-link-preview {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .fin-contract-send-dialog .stats-modal-close,
html[data-theme="dark"] .fin-contract-send-dialog .fin-contract-send-summary span,
html[data-theme="dark"] .fin-contract-send-dialog .stats-modal-field span,
html[data-theme="dark"] .fin-contract-send-dialog .fin-contract-link-preview span,
html[data-theme="dark"] .fin-contract-send-dialog .fin-contract-send-note {
  color: #a4a7ae;
}
html[data-theme="dark"] .fin-contract-send-dialog .stats-modal-close:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #f5f5f7;
}
html[data-theme="dark"] .fin-contract-send-dialog .stats-modal-field input,
html[data-theme="dark"] .fin-contract-send-dialog .stats-modal-field select {
  color: #f5f5f7;
  color-scheme: dark;
}
html[data-theme="dark"] .fin-contract-send-dialog .stats-modal-secondary {
  border-color: rgba(255, 255, 255, 0.14);
  background: transparent;
  color: #f5f5f7;
}
html[data-theme="dark"] .fin-contract-send-dialog .stats-modal-primary {
  border-color: #f5f5f7;
  background: #f5f5f7;
  color: #111318;
}
@media (max-width: 720px) {
  .fin-contract-status-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .fin-contract-status-actions {
    width: 100%;
  }
  .fin-contract-status-actions .cred-btn {
    flex: 1;
  }
  .stats-modal-card.fin-contract-send-dialog {
    width: calc(100vw - 32px);
  }
  .fin-contract-send-dialog .stats-modal-head {
    padding: 13px 14px 13px 18px;
  }
  .fin-contract-send-dialog .stats-modal-body {
    padding: 14px 16px;
  }
  .fin-contract-send-dialog .stats-modal-foot {
    grid-template-columns: 1fr;
    padding: 12px 16px 16px;
  }
}
.fin-doc-request-inline {
  display: flex; align-items: flex-start; gap: 9px; margin-top: 8px; padding: 10px 11px;
  border-radius: 11px; border: 1px solid rgba(229, 132, 61, 0.25);
  background: rgba(229, 132, 61, 0.10);
}
.fin-doc-request-inline-icon {
  width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center;
  border-radius: 9px; background: rgba(229, 132, 61, 0.15); color: #e5843d;
}
.fin-doc-request-inline-icon .icon,
.fin-doc-request-inline-icon svg { width: 15px; height: 15px; fill: currentColor; }
.fin-doc-request-inline > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fin-doc-request-inline > div > strong { font-size: 12.5px; color: #b76427; }
.fin-doc-request-inline > div > span { font-size: 12px; color: var(--ink); line-height: 1.4; }
.fin-doc-request-inline > div > small { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.fin-doc-request-inline.uploaded {
  border-color: rgba(19, 160, 101, 0.28);
  background: rgba(19, 160, 101, 0.10);
}
.fin-doc-request-inline.uploaded .fin-doc-request-inline-icon {
  background: rgba(19, 160, 101, 0.16);
  color: var(--green);
}
.fin-doc-request-inline.uploaded > div > strong { color: #13885a; }

.fin-editing-banner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid rgba(0, 113, 227, .26); border-radius: 16px;
  background: color-mix(in srgb, var(--blue) 8%, var(--card));
  color: var(--ink);
}
.fin-editing-banner-icon {
  width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 38px;
  border-radius: 12px; background: color-mix(in srgb, var(--blue) 14%, var(--card));
  color: var(--blue);
}
.fin-editing-banner-icon .icon, .fin-editing-banner-icon svg { width: 19px; height: 19px; }
.fin-editing-banner > div { min-width: 0; flex: 1 1 auto; }
.fin-editing-banner > div > strong,
.fin-editing-banner > div > span,
.fin-editing-banner-status { display: block; }
.fin-editing-banner strong { font-size: 14px; font-weight: 800; }
.fin-editing-banner > div > span { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.fin-editing-banner-status {
  flex: 0 0 auto; padding: 6px 10px; border-radius: 999px;
  background: rgba(229, 132, 61, .16); color: #b85f21;
  font-size: 11.5px; font-weight: 800;
}
.fin-editing-hint, .fin-upload-privacy {
  display: flex; align-items: center; gap: 7px; margin: 0;
  color: var(--muted); font-size: 12px; line-height: 1.45;
}
.fin-editing-hint .icon, .fin-editing-hint svg,
.fin-upload-privacy .icon, .fin-upload-privacy svg { width: 15px; height: 15px; flex: 0 0 15px; }
.fin-request-editor-panel .sim-panel-head .icon svg { color: #e5843d; fill: currentColor; }
.fin-requested-docs {
  display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px;
  border: 1px solid rgba(229, 132, 61, .30); border-radius: 14px;
  background: rgba(229, 132, 61, .10);
}
.fin-requested-docs-icon {
  width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 34px;
  border-radius: 10px; background: rgba(229, 132, 61, .16); color: #d46f29;
}
.fin-requested-docs-icon .icon, .fin-requested-docs-icon svg { width: 18px; height: 18px; }
.fin-requested-docs > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fin-requested-docs strong { color: var(--ink); font-size: 13px; font-weight: 800; }
.fin-requested-docs span, .fin-requested-docs small { font-size: 12px; line-height: 1.4; }
.fin-requested-docs span { color: var(--ink); }
.fin-requested-docs small { color: var(--muted); }
.fin-client-resend-alert {
  display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px;
  border: 1px solid rgba(229, 72, 77, .42); border-radius: 14px;
  background: rgba(229, 72, 77, .08); color: #d9363e;
}
.fin-client-resend-alert-icon {
  width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 34px;
  border-radius: 10px; background: rgba(229, 72, 77, .15); color: #d9363e;
}
.fin-client-resend-alert-icon .icon, .fin-client-resend-alert-icon svg { width: 18px; height: 18px; }
.fin-client-resend-alert > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fin-client-resend-alert strong { color: #c92f37; font-size: 13px; font-weight: 800; }
.fin-client-resend-alert span { font-size: 12px; line-height: 1.45; }
.fin-upload-list { display: flex; flex-direction: column; gap: 8px; }
.fin-upload-file-row {
  width: 100%; display: flex; align-items: center; gap: 11px; min-height: 54px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 13px;
  background: var(--card-soft); color: var(--ink); font-family: inherit; text-align: left;
}
button.fin-upload-file-row { cursor: pointer; }
button.fin-upload-file-row:hover { border-color: color-mix(in srgb, var(--blue) 36%, var(--line)); }
.fin-upload-file-row.existing.client.needs-resend {
  border-color: rgba(229, 72, 77, .52);
  background: rgba(229, 72, 77, .08);
}
button.fin-upload-file-row.existing.client.needs-resend:hover { border-color: rgba(229, 72, 77, .72); }
.fin-upload-file-row.needs-resend .fin-upload-file-icon {
  background: rgba(229, 72, 77, .14);
  color: #d9363e;
}
.fin-upload-file-row.needs-resend .fin-upload-file-copy small,
.fin-upload-file-row.needs-resend .fin-upload-file-action { color: #d9363e; }
.fin-upload-file-row.pending { border-style: dashed; }
.fin-upload-file-icon {
  width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 34px;
  border-radius: 10px; background: var(--card); color: var(--muted);
}
.fin-upload-file-icon .icon, .fin-upload-file-icon svg { width: 17px; height: 17px; }
.fin-upload-file-copy { min-width: 0; flex: 1 1 auto; }
.fin-upload-file-copy strong, .fin-upload-file-copy small {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fin-upload-file-copy strong { color: var(--ink); font-size: 12.5px; font-weight: 800; }
.fin-upload-file-copy small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.fin-upload-file-action { width: 30px; height: 30px; display: grid; place-items: center; color: var(--blue); }
.fin-upload-file-action .icon, .fin-upload-file-action svg { width: 17px; height: 17px; }
.fin-upload-file-remove {
  width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 30px;
  padding: 0; border: 1px solid var(--line); border-radius: 9px;
  background: var(--card); color: #e5484d; cursor: pointer;
}
.fin-upload-file-remove .icon, .fin-upload-file-remove svg { width: 15px; height: 15px; }
.fin-upload-empty { margin: 2px 0; color: var(--muted); font-size: 12px; }
.fin-upload-picker {
  min-height: 82px; display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 14px; border: 1.5px dashed color-mix(in srgb, var(--blue) 40%, var(--line));
  border-radius: 15px; background: color-mix(in srgb, var(--blue) 4%, var(--card));
  color: var(--ink); cursor: pointer; text-align: left;
}
.fin-upload-picker:hover { background: color-mix(in srgb, var(--blue) 8%, var(--card)); }
.fin-upload-picker.disabled { opacity: .58; cursor: wait; }
.fin-upload-picker input { display: none; }
.fin-upload-picker-icon {
  width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 38px;
  border-radius: 12px; background: var(--blue); color: #fff;
}
.fin-upload-picker-icon .icon, .fin-upload-picker-icon svg { width: 19px; height: 19px; }
.fin-upload-picker > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.fin-upload-picker strong { font-size: 13px; font-weight: 800; }
.fin-upload-picker small { color: var(--muted); font-size: 11px; line-height: 1.35; }

/* Coleta antecipada dos documentos essenciais na própria simulação. */
.fin-essential-documents-panel .sim-panel-head > .icon {
  color: var(--ink);
  background: var(--card-soft);
}
.fin-essential-documents-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.fin-essential-documents-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fin-essential-documents-copy strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}
.fin-essential-documents-copy span {
  max-width: 760px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.fin-essential-documents-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.fin-essential-document-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card-soft);
  color: var(--ink);
}
.fin-essential-document-item.received {
  border-color: rgba(19, 160, 101, .30);
  background: rgba(19, 160, 101, .07);
}
.fin-essential-document-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--muted) 11%, transparent);
  color: var(--muted);
}
.fin-essential-document-item.received .fin-essential-document-icon {
  background: rgba(19, 160, 101, .13);
  color: #13885a;
}
.fin-essential-document-item .icon,
.fin-essential-document-item svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
.fin-essential-document-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fin-essential-document-copy strong {
  min-width: 0;
  color: inherit;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}
.fin-essential-document-copy small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}
.fin-essential-document-item.received .fin-essential-document-copy small {
  color: #13885a;
  font-weight: 750;
}
.fin-essential-document-files {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
}
.fin-essential-document-view {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #13885a;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.fin-essential-document-view:hover { text-decoration: underline; }
.fin-essential-document-view .icon,
.fin-essential-document-view svg { width: 13px; height: 13px; }
.fin-essential-documents-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 2px;
}
.fin-essential-documents-footer p {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.fin-essential-documents-footer p .icon,
.fin-essential-documents-footer p svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}
.fin-essential-documents-actions {
  flex: 0 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.fin-essential-documents-actions .cred-btn {
  flex: 0 0 auto;
  justify-content: center;
  min-width: 0;
  white-space: nowrap;
}
.fin-essential-documents-actions .cred-btn.primary { background: #171719; }
.fin-essential-documents-actions .cred-btn:disabled {
  cursor: not-allowed;
  opacity: .58;
}
html[data-theme="dark"] .fin-essential-documents-panel .sim-panel-head > .icon {
  background: var(--card-soft);
  color: var(--ink);
}
html[data-theme="dark"] .fin-essential-document-item.received .fin-essential-document-icon {
  background: rgba(45, 191, 127, .14);
  color: #54d69a;
}
html[data-theme="dark"] .fin-essential-document-item.received .fin-essential-document-copy small,
html[data-theme="dark"] .fin-essential-document-view { color: #54d69a; }
html[data-theme="dark"] .fin-essential-documents-actions .cred-btn.primary {
  background: #f5f5f7;
  color: #111318;
}

.stats-modal-card.rdx-project-popover.fin-seller-upload-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(29, 29, 31, .10);
  border-radius: 22px;
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .22);
}
.rdx-project-popover.fin-seller-upload-dialog .stats-modal-head {
  min-height: 60px;
  margin: 0;
  padding: 15px 18px 15px 22px;
  border-bottom: 1px solid rgba(29, 29, 31, .08);
}
.rdx-project-popover.fin-seller-upload-dialog .stats-modal-head h3 {
  color: #1d1d1f;
  font-size: 18px;
  font-weight: 500;
}
.rdx-project-popover.fin-seller-upload-dialog .stats-modal-close {
  display: inline-flex;
  border: 1px solid rgba(29, 29, 31, .08);
  background: #f5f5f7;
  color: #6e6e73;
}
.rdx-project-popover.fin-seller-upload-dialog .stats-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  overflow-y: auto;
}
.fin-seller-upload-intro {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--blue) 24%, var(--line));
  border-radius: 13px;
  background: color-mix(in srgb, var(--blue) 6%, var(--card));
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.fin-seller-upload-intro .icon,
.fin-seller-upload-intro svg,
.fin-seller-upload-note .icon,
.fin-seller-upload-note svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}
.fin-seller-upload-list { display: flex; flex-direction: column; gap: 8px; }
.fin-seller-upload-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card-soft);
}
.fin-seller-upload-row.received {
  border-color: rgba(19, 160, 101, .28);
  background: rgba(19, 160, 101, .06);
}
.fin-seller-upload-row.selected {
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  background: color-mix(in srgb, var(--blue) 6%, var(--card));
}
.fin-seller-upload-row-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
}
.fin-seller-upload-row.received .fin-seller-upload-row-icon {
  background: rgba(19, 160, 101, .13);
  color: #13885a;
}
.fin-seller-upload-row-icon .icon,
.fin-seller-upload-row-icon svg { width: 17px; height: 17px; }
.fin-seller-upload-row-copy { min-width: 0; }
.fin-seller-upload-row-copy strong,
.fin-seller-upload-row-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fin-seller-upload-row-copy strong { color: var(--ink); font-size: 12.5px; font-weight: 800; }
.fin-seller-upload-row-copy small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.fin-seller-upload-pick,
.fin-seller-upload-clear {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}
.fin-seller-upload-pick { padding: 0 11px; }
.fin-seller-upload-clear { width: 34px; padding: 0; color: #d9363e; }
.fin-seller-upload-pick .icon,
.fin-seller-upload-pick svg,
.fin-seller-upload-clear .icon,
.fin-seller-upload-clear svg { width: 15px; height: 15px; }
.fin-seller-upload-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.rdx-project-popover.fin-seller-upload-dialog .stats-modal-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  padding: 13px 18px 17px;
  border-top: 1px solid rgba(29, 29, 31, .08);
  background: #ffffff;
}
.rdx-project-popover.fin-seller-upload-dialog .stats-modal-foot > button {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 0 16px;
  border-radius: 14px;
  box-shadow: none;
  font-size: 13px;
  font-weight: 500;
}
.rdx-project-popover.fin-seller-upload-dialog .stats-modal-secondary {
  border: 1px solid rgba(29, 29, 31, .12);
  background: #ffffff;
  color: #1d1d1f;
}
.rdx-project-popover.fin-seller-upload-dialog .stats-modal-primary {
  border: 1px solid #1d1d1f;
  background: #1d1d1f;
  color: #ffffff;
}
.rdx-project-popover.fin-seller-upload-dialog .stats-modal-foot .icon,
.rdx-project-popover.fin-seller-upload-dialog .stats-modal-foot svg {
  position: static;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}
.fin-seller-upload-submit-label {
  position: static;
  display: block;
  min-width: 0;
  line-height: 1;
}
.rdx-project-popover.fin-seller-upload-dialog button:disabled { cursor: not-allowed; opacity: .55; }
html[data-theme="dark"] .stats-modal-card.rdx-project-popover.fin-seller-upload-dialog {
  border-color: rgba(255, 255, 255, .12);
  background: #181b22;
  color: #f5f5f7;
}
html[data-theme="dark"] .rdx-project-popover.fin-seller-upload-dialog .stats-modal-head,
html[data-theme="dark"] .rdx-project-popover.fin-seller-upload-dialog .stats-modal-foot {
  border-color: rgba(255, 255, 255, .10);
  background: #181b22;
}
html[data-theme="dark"] .rdx-project-popover.fin-seller-upload-dialog .stats-modal-head h3 { color: #f5f5f7; }
html[data-theme="dark"] .rdx-project-popover.fin-seller-upload-dialog .stats-modal-close,
html[data-theme="dark"] .rdx-project-popover.fin-seller-upload-dialog .stats-modal-secondary {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .06);
  color: #f5f5f7;
}
html[data-theme="dark"] .rdx-project-popover.fin-seller-upload-dialog .stats-modal-primary {
  border-color: #f5f5f7;
  background: #f5f5f7;
  color: #111318;
}
html[data-theme="dark"] .fin-seller-upload-row.received .fin-seller-upload-row-icon {
  background: rgba(45, 191, 127, .14);
  color: #54d69a;
}

@media (max-width: 640px) {
  .fin-dec-btn { flex-basis: 100%; }
  .fin-hist-meta { display: none; }
  .fin-hist-open-icon { display: none; }
  .fin-editing-banner { align-items: flex-start; flex-wrap: wrap; }
  .fin-editing-banner-status { margin-left: 50px; }
  .fin-upload-picker { justify-content: flex-start; }
  .fin-essential-documents-top,
  .fin-essential-documents-footer { align-items: stretch; flex-direction: column; }
  .fin-essential-documents-grid { grid-template-columns: 1fr; }
  .fin-essential-documents-actions { align-items: stretch; flex-direction: column; }
  .fin-essential-documents-actions .cred-btn { width: 100%; min-width: 0; }
  .fin-seller-upload-row { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .fin-seller-upload-row-copy { grid-column: 2 / -1; }
  .fin-seller-upload-row-icon { grid-row: 1 / span 2; }
  .fin-seller-upload-clear { grid-column: 2; justify-self: start; }
  .fin-seller-upload-pick { grid-column: 3; }
  .rdx-project-popover.fin-seller-upload-dialog .stats-modal-foot { grid-template-columns: 1fr; }
}

@media (min-width: 641px) and (max-width: 1080px) {
  .fin-essential-documents-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================ Página Crediário ============================ */
.cred-page { display: flex; flex-direction: column; }
.cred-header { margin-bottom: 4px; }

/* Crediário usa a mesma entrada de tela inteira do PDV: sobrepõe a sidebar e
   desliza pela lateral direita, sem alterar o shell que fica por trás. */
.crediario-overlay {
  position: fixed; inset: 0; z-index: 60;
  overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: max(16px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left));
  background: #f5f5f7;
}
.crediario-overlay.crediario-overlay-entering {
  animation: crediarioOverlaySlideIn 450ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform;
}
.crediario-overlay.crediario-overlay-leave {
  animation: crediarioOverlaySlideOut 350ms cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  will-change: transform;
}
@keyframes crediarioOverlaySlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes crediarioOverlaySlideOut {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}
.crediario-overlay .cred-overlay-page {
  min-height: calc(100% - 52px); margin: 52px 0 0; padding: 20px 20px 24px;
  border-radius: 34px 34px 0 0;
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f7 50%, #eff8f4 100%);
  overflow: visible;
}
.cred-overlay-header {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
  margin: 0 0 18px;
}
.cred-overlay-title, .cred-overlay-actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cred-overlay-title .stats-title-block,
.cred-overlay-title .home-title-block { min-width: 0; }
.cred-overlay-actions .stats-badge {
  height: 42px; box-sizing: border-box; display: inline-flex; align-items: center;
  padding: 0 14px; border-radius: 13px;
}
.cred-overlay-back, .cred-overlay-theme {
  width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 13px; background: var(--card); color: var(--ink); cursor: pointer;
  box-shadow: 0 6px 16px var(--shadow);
}
.cred-overlay-back:hover, .cred-overlay-theme:hover { background: var(--card-soft); }
.cred-overlay-back .icon, .cred-overlay-theme .icon { width: 20px; height: 20px; }
.cred-overlay-back-top {
  position: absolute;
  /* A linha do topo (seta, tema e usuário) sobe junto: o -50px do
     .crediario-top-actions acompanha este 8px. */
  top: max(8px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
  z-index: 4;
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

/* Vender, Crediário e as páginas de Configurações reutilizam a apresentação
   da seta da Nara. A área clicável continua grande, mas a caixa visual
   desaparece. */
.pos-back.rdx-assistant-back,
.cred-overlay-back-top.rdx-assistant-back,
.config-back.rdx-assistant-back {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: #57574f;
  box-shadow: none;
  /* O .config-back só ganhava a mãozinha no bloco injetado das Configurações;
     fora dele (Avaliar aparelho) o cursor ficava de seta. Mora aqui, junto da
     aparência, para valer em toda seta que usa esta apresentação. */
  cursor: pointer;
}

/* No PDV, o toque não deve desenhar uma caixa quadrada atrás da seta.
   O foco por teclado continua usando o contorno de :focus-visible abaixo. */
.pos-page .pos-back.rdx-assistant-back {
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.pos-page .pos-back.rdx-assistant-back:focus:not(:focus-visible) {
  outline: none;
}

/* Pelo mesmo motivo o tamanho da caixa também morava só lá: fora das
   Configurações a seta encolhia até o desenho do ícone e saía menor que o
   resto do cabeçalho. */
.config-back.rdx-assistant-back {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  transition: color .14s ease, transform .14s ease;
}
.pos-back.rdx-assistant-back:hover,
.cred-overlay-back-top.rdx-assistant-back:hover,
.config-back.rdx-assistant-back:hover {
  background: none;
  color: #111110;
  transform: translateX(-2px);
}
.pos-back.rdx-assistant-back:focus-visible,
.cred-overlay-back-top.rdx-assistant-back:focus-visible,
.config-back.rdx-assistant-back:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.pos-back.rdx-assistant-back .icon,
.pos-back.rdx-assistant-back .icon svg,
.cred-overlay-back-top.rdx-assistant-back .icon,
.cred-overlay-back-top.rdx-assistant-back .icon svg,
.config-back.rdx-assistant-back .icon,
.config-back.rdx-assistant-back .icon svg {
  width: 21px;
  height: 21px;
}
.pos-back.rdx-assistant-back .icon svg,
.cred-overlay-back-top.rdx-assistant-back .icon svg,
.config-back.rdx-assistant-back .icon svg { fill: currentColor; }
html[data-theme="dark"] .pos-back.rdx-assistant-back,
html[data-theme="dark"] .cred-overlay-back-top.rdx-assistant-back,
html[data-theme="dark"] .config-back.rdx-assistant-back { color: #a4a7ae; }
html[data-theme="dark"] .pos-back.rdx-assistant-back:hover,
html[data-theme="dark"] .cred-overlay-back-top.rdx-assistant-back:hover,
html[data-theme="dark"] .config-back.rdx-assistant-back:hover { color: #f5f5f7; }

.crediario-top-actions {
  /* Virou uma linha de controles como a da Venda: sem a faixa, o padding de
     14px só desalinhava. A página começa 68px abaixo do topo da camada (16 de
     padding + 52 de margem), então -60 põe o cartão em 8px, na mesma linha da
     seta; o right de 20px o alinha com o conteúdo logo abaixo. */
  top: -60px;
  right: 20px;
  padding: 0;
}
.crediario-hero {
  flex: 0 0 auto;
}
.crediario-hero .stats-hero-grid {
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 941px) {
  .crediario-overlay .cred-overlay-page {
    width: 100%; min-height: calc(100% - 52px);
    /* Mantém a redução visual sem deixar a altura original reservada na
       rolagem, evitando a faixa vazia depois do fim do card de fundo. */
    zoom: 0.8;
  }
  /* A seta mora FORA desse zoom (é irmã da página, para o clique funcionar
     sobre a sidebar), então saía em tamanho cheio enquanto a da aba Vender —
     que roda dentro do scale(.8) do PDV — saía menor. Estes números são os
     40px e 21px do padrão já multiplicados por 0.8. */
  .cred-overlay-back-top { width: 32px; height: 32px; }
  .cred-overlay-back-top.rdx-assistant-back .icon,
  .cred-overlay-back-top.rdx-assistant-back .icon svg {
    width: 16.8px;
    height: 16.8px;
  }
}
@media (max-width: 640px) {
  .crediario-overlay { padding: 0 0 max(18px, env(safe-area-inset-bottom)); }
  .crediario-overlay .cred-overlay-page {
    min-height: 100%;
    margin-top: 0;
    padding: calc(max(12px, env(safe-area-inset-top)) + 52px) 14px max(18px, env(safe-area-inset-bottom));
    border-radius: 0;
  }
  .cred-overlay-back-top {
    top: max(12px, env(safe-area-inset-top));
    left: 14px;
  }
  .cred-overlay-header { align-items: flex-start; gap: 10px; }
  .cred-overlay-actions .stats-badge { display: none; }
  .cred-overlay-title .stats-title-block h1,
  .cred-overlay-title .home-title-block h1 { font-size: 30px; }
  .cred-overlay-title .stats-title-block p,
  .cred-overlay-title .home-title-block p { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .crediario-overlay,
  .crediario-overlay.crediario-overlay-entering,
  .crediario-overlay.crediario-overlay-leave { animation: none !important; }
}

/* --- Simulação de crédito (tela única, fluxo tipo Agoracred, nosso tema) --- */
.sim-page { display: flex; flex-direction: column; }
.sim-page .fin-result { display: flex; flex-direction: column; gap: 14px; margin: 14px 0 0; }
.crediario-section-tabs {
  height: auto;
  min-height: 68px;
  margin: 14px 0 0;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.70);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.078);
}
.crediario-section-panel.is-hidden { display: none; }

.sim-panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  overflow: hidden; box-shadow: 0 1px 2px var(--shadow); margin-top: 14px;
}
.crediario-home-page .sim-panel {
  border-color: rgba(255, 255, 255, 0.72);
  border-radius: 30px;
  background: #ffffff;
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.078);
}
.crediario-home-page .sim-panel-head {
  padding: 20px 20px 0;
  border-bottom: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  font-weight: 500;
}
.crediario-home-page .sim-panel-head > .icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 12px;
  background: #f5f5f7;
  color: rgba(29, 29, 31, 0.84);
}
.crediario-home-page .sim-panel-head > .icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.crediario-home-page .sim-panel-body { padding: 14px 20px 20px; }
.crediario-home-page .fin-editing-banner {
  border-color: rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.064);
}

html[data-theme="dark"] .crediario-overlay { background: #07080a; }
html[data-theme="dark"] .crediario-overlay .cred-overlay-page {
  background: linear-gradient(135deg, #06070a 0%, #0e1117 50%, #07140f 100%);
}
html[data-theme="dark"] .crediario-section-tabs,
html[data-theme="dark"] .crediario-home-page .sim-panel,
html[data-theme="dark"] .crediario-home-page .fin-editing-banner {
  background: #111318;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.40);
}
html[data-theme="dark"] .crediario-home-page .sim-panel-head > .icon {
  background: #24272e;
  border-color: #343740;
  color: #a4a7ae;
}
.sim-panel-head {
  display: flex; align-items: center; gap: 9px;
  padding: 13px 18px; background: var(--card-soft);
  border-bottom: 1px solid var(--line);
  font-size: 15px; font-weight: 700; color: var(--ink);
}
.sim-panel-head .icon svg { width: 19px; height: 19px; fill: var(--blue); }
.sim-panel-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }

.fin-receivables {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.fin-receivable-search {
  width: 100%;
  margin: 0;
  flex: none;
}
.fin-receivable-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.fin-receivable-metric {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fin-receivable-metric > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}
.fin-receivable-metric > strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.fin-receivable-metric > small {
  color: var(--muted);
  font-size: 11px;
}
.fin-receivable-metric.overdue > strong { color: #e5484d; }
.fin-receivable-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}
.fin-receivable-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.8fr) minmax(170px, 1.45fr) minmax(125px, .8fr) minmax(150px, 1fr);
  gap: 16px;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 15px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  appearance: none;
  cursor: pointer;
  transition: background-color 150ms ease, box-shadow 150ms ease;
}
.fin-receivable-row:last-child { border-bottom: 0; }
.fin-receivable-row.is-overdue { background: rgba(229, 72, 77, .035); }
.fin-receivable-row:hover { background: rgba(22, 119, 255, .055); }
.fin-receivable-row.is-overdue:hover { background: rgba(229, 72, 77, .075); }
.fin-receivable-row:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}
.fin-receivable-client,
.fin-receivable-account,
.fin-receivable-money,
.fin-receivable-state {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fin-receivable-client > strong,
.fin-receivable-account > strong,
.fin-receivable-money > strong,
.fin-receivable-state > strong {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}
.fin-receivable-account > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fin-receivable-client > span,
.fin-receivable-account > span,
.fin-receivable-money > span,
.fin-receivable-state > small {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.fin-receivable-money,
.fin-receivable-state { align-items: flex-end; text-align: right; }
.fin-receivable-money > strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.fin-receivable-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.fin-receivable-badge.open {
  color: #138a5b;
  border-color: rgba(19, 160, 101, .28);
  background: rgba(19, 160, 101, .10);
}
.fin-receivable-badge.overdue {
  color: #d9343b;
  border-color: rgba(229, 72, 77, .30);
  background: rgba(229, 72, 77, .10);
}
.fin-receivable-empty {
  min-height: 112px;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: var(--card-soft);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}
.fin-receivable-empty > strong { color: var(--ink); font-size: 14px; }
.fin-receivable-empty > span { max-width: 520px; font-size: 12px; line-height: 1.45; }

.stats-modal-card.fin-receivable-details-dialog {
  width: min(920px, 100%);
  max-height: min(780px, calc(100dvh - 48px));
  padding: 0;
  overflow: hidden;
}
.fin-receivable-details-dialog .stats-modal-head {
  margin: 0;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}
/* Mesmo botão de fechar dos outros pop-ups da Financeira (fin-contract-send-dialog). */
.fin-receivable-details-dialog .stats-modal-close {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  background: #f5f5f7;
  color: #6e6e73;
}
.fin-receivable-details-dialog .stats-modal-close:hover {
  background: #e9e9ed;
  color: #1d1d1f;
}
html[data-theme="dark"] .fin-receivable-details-dialog .stats-modal-close {
  background: rgba(255, 255, 255, 0.06);
  color: #a4a7ae;
}
html[data-theme="dark"] .fin-receivable-details-dialog .stats-modal-close:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #f5f5f7;
}
.fin-receivable-details-dialog .stats-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 20px 20px;
}
.fin-receivable-detail-account {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.fin-receivable-detail-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card-soft);
  color: var(--blue);
}
.fin-receivable-detail-icon .icon,
.fin-receivable-detail-icon svg { width: 20px; height: 20px; }
.fin-receivable-detail-account > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.fin-receivable-detail-account strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fin-receivable-detail-account span,
.fin-receivable-detail-account small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fin-receivable-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.fin-receivable-detail-summary article {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fin-receivable-detail-summary span {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.3;
}
.fin-receivable-detail-summary strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.fin-receivable-detail-summary article.overdue strong { color: #d9343b; }
.fin-receivable-detail-summary article.total {
  border-color: rgba(22, 119, 255, .24);
  background: rgba(22, 119, 255, .075);
}
.fin-receivable-detail-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fin-receivable-detail-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.fin-receivable-detail-section > header strong {
  color: var(--ink);
  font-size: 13px;
}
.fin-receivable-detail-section > header span {
  min-width: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--card-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}
.fin-receivable-detail-section.has-overdue > header strong,
.fin-receivable-detail-section.has-overdue > header span { color: #d9343b; }
.fin-receivable-detail-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.fin-receivable-installment {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(260px, 1.6fr);
  gap: 16px;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.fin-receivable-installment:last-child { border-bottom: 0; }
.fin-receivable-installment.is-overdue { background: rgba(229, 72, 77, .035); }
.fin-receivable-installment-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.fin-receivable-installment-main > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.fin-receivable-installment-main strong {
  color: var(--ink);
  font-size: 12.5px;
}
.fin-receivable-installment-main small {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
}
.fin-receivable-installment-values {
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 18px;
}
.fin-receivable-installment-values > span {
  min-width: 96px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  text-align: right;
}
.fin-receivable-installment-values small {
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.2;
}
.fin-receivable-installment-values strong {
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fin-receivable-installment-values .late strong { color: #d9343b; }
.fin-receivable-installment-values .total strong { font-size: 14px; }
.fin-receivable-detail-empty {
  padding: 16px;
  background: var(--card-soft);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.fin-receivable-detail-note {
  margin: 0;
  padding-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .fin-receivable-summary { grid-template-columns: minmax(0, 1fr); }
  .fin-receivable-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "client state"
      "account state"
      "money state";
    gap: 10px 14px;
    align-items: start;
    padding: 14px;
  }
  .fin-receivable-client { grid-area: client; }
  .fin-receivable-account { grid-area: account; }
  .fin-receivable-money { grid-area: money; align-items: flex-start; text-align: left; }
  .fin-receivable-state { grid-area: state; align-items: flex-end; text-align: right; }
  .stats-modal-card.fin-receivable-details-dialog {
    width: min(100%, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
  }
  .fin-receivable-details-dialog .stats-modal-head { padding: 15px 16px; }
  .fin-receivable-details-dialog .stats-modal-body { padding: 15px 14px 18px; }
  .fin-receivable-detail-account strong,
  .fin-receivable-detail-account span,
  .fin-receivable-detail-account small {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .fin-receivable-detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fin-receivable-installment {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .fin-receivable-installment-values {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 12px 18px;
  }
  .fin-receivable-installment-values > span {
    min-width: calc(50% - 9px);
    align-items: flex-start;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fin-receivable-row { transition: none; }
}

.sim-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.sim-grid-search { grid-template-columns: repeat(auto-fit, minmax(200px, 260px)); }

.sim-field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.sim-field.full { grid-column: 1 / -1; }
.sim-field > span { font-weight: 600; }
.sim-field input, .sim-field select, .sim-field textarea {
  background: var(--field); border: 1px solid transparent; border-radius: 10px;
  padding: 10px 12px; font-size: 15px; color: var(--ink); font-family: inherit;
  width: 100%; box-sizing: border-box;
}
/* Só o textarea pode ser redimensionado. Sem isto o WebKit desenha a alcinha
   de resize no input[type=date] (campo Nascimento) e deixa esticar o campo. */
.sim-field input, .sim-field select { resize: none; }
.sim-field textarea { resize: vertical; }
.sim-field select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.sim-field input:focus, .sim-field select:focus, .sim-field textarea:focus { outline: none; border-color: var(--blue); }
.sim-field.readonly input {
  background: var(--card-soft); color: var(--ink); font-weight: 700;
  font-variant-numeric: tabular-nums; cursor: default;
}
.sim-field.readonly.clickable input {
  cursor: pointer;
  border-color: var(--line);
}
.sim-field.readonly.clickable:hover input,
.sim-field.readonly.clickable input:focus-visible {
  border-color: var(--blue);
}
.sim-field.readonly.negative input { color: #e5484d; }
.sim-field .sim-picker-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--field); border: 1px solid transparent; border-radius: 10px;
  padding: 10px 12px; font-size: 15px; color: var(--ink); font-family: inherit;
  width: 100%; box-sizing: border-box; cursor: pointer; text-align: left;
}
.sim-field .sim-picker-btn:hover { border-color: var(--line); }
.sim-field .sim-picker-btn:focus-visible { outline: none; border-color: var(--blue); }
.sim-field .sim-picker-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-field .sim-picker-val.ph { color: var(--muted); }
.sim-field .sim-picker-ic { flex: none; width: 18px; height: 18px; color: var(--muted); }

.sim-cpf-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 2px;
  background: var(--card-soft); border: 1px solid var(--line); border-radius: 14px;
}
.sim-ext-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sim-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sim-actions.end { justify-content: flex-end; }

@media (max-width: 640px) {
  .sim-actions .cred-btn, .sim-actions.end .cred-btn { flex: 1 1 auto; justify-content: center; }
  .sim-grid-search { grid-template-columns: 1fr 1fr; }
}

.cred-tabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 10px;
  margin: 6px 0 2px; scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.cred-tabs::-webkit-scrollbar { height: 0; }
.cred-tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer; white-space: nowrap; transition: all .15s ease;
}
.cred-tab .cred-tab-ic .icon svg { width: 18px; height: 18px; fill: currentColor; }
.cred-tab:hover:not(.active) { color: var(--ink); border-color: var(--ink); }
.cred-tab.active { background: var(--ink); color: var(--card); border-color: var(--ink); }

.cred-body { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }

/* Resumo */
.cred-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.cred-metric {
  display: flex; align-items: center; gap: 13px; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px; padding: 15px 17px;
  box-shadow: 0 1px 2px var(--shadow);
}
.cred-metric-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--card-soft); flex: 0 0 auto; }
.cred-metric-ic .icon svg { width: 22px; height: 22px; fill: var(--muted); }
.cred-metric.tone-blue .cred-metric-ic .icon svg { fill: var(--blue); }
.cred-metric.tone-green .cred-metric-ic .icon svg { fill: var(--green); }
.cred-metric.tone-red .cred-metric-ic .icon svg { fill: #e5484d; }
.cred-metric-label { font-size: 12.5px; color: var(--muted); display: block; margin-bottom: 2px; }
.cred-metric-value { font-size: 21px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }

.cred-quick { display: flex; flex-wrap: wrap; gap: 10px; }
.cred-quick-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); font-weight: 600; font-size: 14px; font-family: inherit; cursor: pointer; transition: border-color .15s ease;
}
.cred-quick-btn .icon svg { width: 18px; height: 18px; fill: var(--muted); }
.cred-quick-btn:hover { border-color: var(--ink); }

/* Carnês */
.cred-carne-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.cred-search { flex: 1 1 240px; min-width: 200px; }
.cred-carne-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cred-carne-list { display: flex; flex-direction: column; gap: 8px; }
.cred-carne-row {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; transition: border-color .15s ease;
}
.cred-carne-row:hover { border-color: var(--ink); }
.cred-carne-row.overdue { border-left: 3px solid #e5484d; }
.cred-carne-cli { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cred-carne-cli strong { font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cred-carne-cli span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cred-carne-vals { flex: 0 0 auto; text-align: right; display: flex; flex-direction: column; gap: 1px; }
.cred-carne-due { font-weight: 700; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.cred-carne-over { font-size: 11px; color: #e5484d; font-variant-numeric: tabular-nums; }
.cred-carne-act { flex: 0 0 auto; background: transparent; border: none; padding: 6px; cursor: pointer; border-radius: 8px; color: var(--muted); }
.cred-carne-act .icon svg { width: 20px; height: 20px; fill: currentColor; }
.cred-carne-act:hover { background: var(--card-soft); color: var(--ink); }

.cred-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 46px 20px; color: var(--muted); text-align: center; }
.cred-empty .icon svg { width: 40px; height: 40px; fill: currentColor; opacity: .5; }

/* Formulários (Nova venda / Configurações) */
.cred-form-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 1px 2px var(--shadow);
}
.cred-form-title { font-size: 17px; font-weight: 700; color: var(--ink); margin: 0; display: flex; align-items: center; gap: 8px; }
.cred-form-title .icon svg { width: 20px; height: 20px; fill: var(--muted); }
.cred-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.cred-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.cred-field.full { width: 100%; }
.cred-field > span { font-weight: 600; }
.cred-field input, .cred-field textarea, .cred-field select {
  background: var(--field); border: 1px solid transparent; border-radius: 10px;
  padding: 10px 12px; font-size: 15px; color: var(--ink); font-family: inherit; width: 100%; box-sizing: border-box; resize: vertical;
}
.cred-field input:focus, .cred-field textarea:focus { outline: none; border-color: var(--blue); }

.cred-preview { background: var(--card-soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.cred-preview-head { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.cred-preview-head strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.cred-preview-list { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.cred-preview-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; padding: 7px 9px; border-radius: 8px; background: var(--card); font-variant-numeric: tabular-nums; }
.cred-preview-row span:first-child { color: var(--muted); font-weight: 600; }
.cred-preview-row strong { color: var(--ink); text-align: right; }

.cred-form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.cred-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 12px; font-weight: 700; font-size: 14.5px; font-family: inherit; cursor: pointer; border: 1px solid transparent; transition: filter .15s ease; }
.cred-btn .icon svg { width: 18px; height: 18px; fill: currentColor; }
.cred-btn.primary { background: var(--blue); color: #fff; }
.cred-btn.primary:hover { filter: brightness(.95); }
.cred-btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.cred-btn.ghost:hover { border-color: var(--ink); }

.cred-hint { font-size: 13px; color: var(--muted); margin: 0; }
.cred-hint.cred-warn, .cred-warn { color: #e5484d; }

/* Resultado da consulta ao bureau (Serasa) — modo simulação e real */
.fin-bureau { margin-top: 2px; }
.fin-bureau:empty { display: none; }
.fin-bureau-loading { display: flex; align-items: center; gap: 12px; padding: 20px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--muted); font-size: 14px; font-weight: 600; }
.fin-bureau-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.fin-bureau-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.fin-bureau-head .fbh-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px; color: var(--ink); }
.fin-bureau-head .fbh-title svg { width: 18px; height: 18px; fill: var(--muted); }
.fin-sim-badge { display: inline-flex; align-items: center; gap: 5px; background: rgba(229, 132, 61, 0.16); color: #e5843d; font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 4px 10px; border-radius: 999px; }
.fin-sim-badge svg { width: 13px; height: 13px; fill: currentColor; }
.fin-bureau-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 16px; }
.fin-metric { background: var(--card-soft); border-radius: 10px; padding: 12px 14px; }
.fin-metric-decision { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 8px; }
.fin-metric-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.fin-metric-value { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.fin-metric-value svg { width: 18px; height: 18px; fill: currentColor; }
.fin-metric-value.score { font-size: 24px; }
.fin-metric-unit { font-size: 13px; color: var(--muted); font-weight: 600; }
.fin-metric-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.fin-decision { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 7px 14px; border-radius: 999px; }
.fin-decision svg { width: 16px; height: 16px; fill: currentColor; }
.fin-decision.aprovado { background: rgba(19, 160, 101, 0.14); color: var(--green); }
.fin-decision.negativado { background: rgba(229, 132, 61, 0.16); color: #e5843d; }
.fin-decision.reprovado { background: rgba(229, 72, 77, 0.14); color: #e5484d; }
.fin-dividas { padding: 0 16px 14px; display: flex; flex-direction: column; gap: 6px; }
.fin-divida-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 8px 12px; background: var(--card-soft); border-radius: 8px; }
.fin-divida-row span:first-child { color: var(--muted); }
.fin-divida-row strong { color: #e5843d; font-variant-numeric: tabular-nums; }
.fin-bureau-foot { display: flex; align-items: center; gap: 6px; padding: 0 16px 14px; font-size: 12px; color: var(--muted); }
.fin-bureau-foot svg { width: 14px; height: 14px; fill: currentColor; }

@media (max-width: 640px) {
  .cred-carne-cli strong { font-size: 14px; }
  .cred-carne-row .cp-badge { display: none; }
  .cred-form-actions { justify-content: stretch; }
  .cred-btn { flex: 1 1 auto; justify-content: center; }
}

/* Card de pesquisa no Option Dialog */
.stats-option-search-wrapper {
  padding: 0 0 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
}

.stats-option-search-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0 12px;
  height: 44px;
  transition: border-color 0.2s, background-color 0.2s;
}

.stats-option-search-card:focus-within {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
}

.stats-option-search-card .icon {
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stats-option-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--apple-font, inherit);
}

.stats-option-search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}


/* ---------- Assinatura — popup de pagamento (Mercado Pago) ---------- */
.sub-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(29, 29, 31, 0.34);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  animation: subOverlayIn 240ms ease-out both;
}
.sub-overlay.sub-closing {
  animation: subOverlayOut 220ms ease-in both;
}
@keyframes subOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes subOverlayOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
body.sub-modal-open { overflow: hidden; }

.sub-modal {
  position: relative;
  display: flex;
  width: 900px;
  max-width: 100%;
  max-height: calc(var(--app-height) - 48px);
  overflow: auto;
  border-radius: 34px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.88) 0%,
    rgba(255, 255, 255, 0.78) 55%,
    rgba(255, 255, 255, 0.86) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    0 32px 64px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  animation: subModalIn 360ms cubic-bezier(0.33, 1, 0.68, 1) both;
}
.sub-closing .sub-modal {
  animation: subModalOut 220ms cubic-bezier(0.32, 0, 0.67, 0) both;
}
@keyframes subModalIn {
  from { opacity: 0; transform: scale(0.92) translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes subModalOut {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: scale(0.94); }
}

.sub-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(29, 29, 31, 0.06);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.sub-close:hover { background: rgba(29, 29, 31, 0.12); color: var(--ink); }
.sub-close .icon { width: 20px; height: 20px; }

/* Coluna do plano */
.sub-plan {
  width: 360px;
  flex-shrink: 0;
  padding: 42px 36px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(var(--blue-rgb), 0.10), transparent 60%),
    linear-gradient(160deg, rgba(238, 246, 255, 0.9), rgba(245, 245, 247, 0.6));
  border-right: 1px solid var(--line);
}
.sub-plan-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.sub-plan-head img { width: 40px; height: 40px; object-fit: contain; }
.sub-plan-name { font-size: 19px; font-weight: 700; color: var(--ink); }

.sub-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1;
}
.sub-price-currency { font-size: 24px; font-weight: 700; color: var(--ink); }
.sub-price-value { font-size: 72px; font-weight: 800; letter-spacing: -2px; }
.sub-price-period { font-size: 17px; font-weight: 500; color: var(--muted); }
.sub-price-note {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.sub-benefits {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.sub-benefits li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.sub-benefits .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #ffffff;
  background: var(--green);
  border-radius: 50%;
  padding: 3px;
}
.sub-benefits .icon svg { width: 14px; height: 14px; }

.sub-secure {
  margin-top: auto;
  padding-top: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.sub-secure .icon { width: 17px; height: 17px; color: var(--green); }

/* Coluna do formulário */
.sub-form {
  flex: 1;
  min-width: 0;
  padding: 42px 40px;
  display: flex;
  flex-direction: column;
}
.sub-form-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 24px;
}
.sub-form-title .icon { width: 22px; height: 22px; color: var(--blue); }
.sub-form .login-field { background: #eef0f4; }

.sub-row {
  display: grid;
  /* As faixas podem encolher: sem minmax(0, …), o conteúdo do CVV
     preservava sua largura mínima e escapava do cartão em telas estreitas. */
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 14px;
}
.sub-row .login-field,
.sub-row .login-field input { min-width: 0; }

/* Toast flutuante: fixo no rodapé da página, à frente do conteúdo, sem empurrar
   o layout (não força scroll). */
.sub-error {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 600;
  width: max-content;
  max-width: min(460px, calc(100vw - 32px));
  margin: 0;
  padding: 14px 22px;
  border-radius: 16px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  background: #ffffff;
  border: 1px solid rgba(255, 82, 82, 0.28);
  color: rgba(214, 40, 40, 0.96);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.20), 0 0 0 1px rgba(255, 82, 82, 0.06);
  animation: subToastIn 340ms cubic-bezier(0.33, 1, 0.68, 1) both;
}
@keyframes subToastIn {
  from { opacity: 0; transform: translate(-50%, 18px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
html[data-theme="dark"] .sub-error {
  background: #2a2024;
  border-color: rgba(255, 92, 92, 0.42);
  color: rgba(255, 138, 138, 0.98);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

.sub-submit { margin-top: 22px; height: 58px; }
.sub-submit .icon { width: 18px; height: 18px; }
.sub-form .signup-terms { margin-top: 14px; }

/* Estado de sucesso */
.sub-modal-success { width: 480px; }
.sub-success {
  width: 100%;
  min-height: 100%;
  padding: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
/* textos + ícone centralizados verticalmente; o botão fica no rodapé */
.sub-success-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.sub-success-icon {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--green);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 30px rgba(19, 160, 101, 0.35);
  animation: subSuccessPop 480ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.sub-success-icon .icon { width: 44px; height: 44px; }
@keyframes subSuccessPop {
  from { opacity: 0; transform: scale(0.4); }
  to { opacity: 1; transform: scale(1); }
}
.sub-success-title {
  margin-top: 24px;
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
}
.sub-success-sub {
  margin-top: 10px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
}
.sub-success .big-btn { width: 100%; margin-top: 24px; height: 56px; }

/* Mobile: colunas empilhadas */
@media (max-width: 860px) {
  .sub-overlay { padding: 14px; }
  .sub-modal { flex-direction: column; border-radius: 26px; }
  .sub-plan {
    width: 100%;
    padding: 30px 26px 24px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .sub-price-value { font-size: 54px; }
  .sub-benefits { margin-top: 20px; gap: 10px; }
  .sub-secure { padding-top: 20px; }
  .sub-form { padding: 26px 22px 30px; }
  .sub-success { padding: 44px 26px; }
}

/* Tema escuro */
html[data-theme="dark"] .sub-modal {
  background: linear-gradient(135deg, rgba(38, 38, 42, 0.94), rgba(28, 28, 32, 0.92));
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .sub-plan {
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(var(--blue-rgb), 0.16), transparent 60%),
    linear-gradient(160deg, rgba(40, 44, 52, 0.7), rgba(30, 30, 34, 0.5));
  border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .sub-plan-name,
html[data-theme="dark"] .sub-benefits li,
html[data-theme="dark"] .sub-form-title,
html[data-theme="dark"] .sub-price-currency,
html[data-theme="dark"] .sub-success-title { color: rgba(255, 255, 255, 0.92); }
html[data-theme="dark"] .sub-price-note,
html[data-theme="dark"] .sub-price-period,
html[data-theme="dark"] .sub-secure,
html[data-theme="dark"] .sub-success-sub { color: rgba(255, 255, 255, 0.55); }
html[data-theme="dark"] .sub-form .login-field { background: rgba(255, 255, 255, 0.07); }
html[data-theme="dark"] .sub-close {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}

/* ---------- Página de planos (assinatura) ---------- */

/* saída animada da tela de login rumo aos planos */
.login-page.page-exit .login-content,
.login-page.page-exit .side-glass {
  animation: loginPageOut 280ms ease-in both;
}
@keyframes loginPageOut {
  to { opacity: 0; transform: scale(0.97); }
}

/* saída das páginas de planos e personalização (fade + leve zoom) */
.plans-page.page-exit,
.personalize-page.page-exit {
  animation: onboardPageOut 300ms ease-in both;
  pointer-events: none;
}
@keyframes onboardPageOut {
  to { opacity: 0; transform: scale(0.98); }
}

.plans-page {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 28px 64px;
}
.plans-topbar {
  width: 100%;
  max-width: 1280px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: authFadeIn 500ms ease-out both;
}
.plans-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 500;
}
.plans-brand img { width: 32px; height: 32px; object-fit: contain; }

.plans-hero {
  text-align: center;
  margin: 40px 0 38px;
  animation: plansHeroIn 620ms cubic-bezier(0.33, 1, 0.68, 1) both;
  transition: opacity .34s ease, transform .34s ease;
}
.plans-hero.hero-exit { opacity: 0; transform: translateY(-16px); }
@keyframes plansHeroIn {
  from { opacity: 0; transform: translateY(-18px); }
  to { opacity: 1; transform: none; }
}
.plans-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(var(--blue-rgb), 0.10);
  border: 1px solid rgba(var(--blue-rgb), 0.22);
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.plans-badge .icon { width: 16px; height: 16px; }
.plans-title {
  margin: 20px 0 12px;
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -1px;
}
.plans-sub {
  margin: 0 auto;
  max-width: 600px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}
.plans-sub b { color: var(--ink); }

.plans-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  width: 100%;
  max-width: 1280px;
  align-items: stretch;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px 26px 26px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 18px 38px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  animation: planCardIn 560ms cubic-bezier(0.33, 1, 0.68, 1) both;
  transition: opacity .38s ease, transform .38s ease, filter .25s ease;
}
@keyframes planCardIn {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* plano em destaque (Inicial) */
.plan-featured {
  border: 2px solid var(--blue);
  box-shadow:
    0 24px 52px rgba(var(--blue-rgb), 0.22),
    0 0 0 6px rgba(var(--blue-rgb), 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  z-index: 1;
}

/* demais planos: acinzentados e apagados */
.plan-muted {
  filter: grayscale(1);
  opacity: 0.55;
}
.plan-muted:hover { opacity: 0.72; }

/* saída dos cards quando o plano é escolhido */
.plan-card.plan-exit {
  opacity: 0;
  transform: translateY(38px) scale(0.94);
  pointer-events: none;
}
.plan-card.plan-zoom-out {
  opacity: 0;
  transform: scale(1.06);
  pointer-events: none;
}

.plan-tag {
  position: absolute;
  top: -13px;
  left: 24px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #e3e3e6;
  color: var(--muted);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.10);
}
.plan-tag-hot {
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(var(--blue-rgb), 0.35);
}

.plan-name { font-size: 21px; font-weight: 800; color: var(--ink); }
.plan-desc {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  min-height: 58px;
}
.plan-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 18px 0 20px;
  line-height: 1;
}
.plan-currency { font-size: 16px; font-weight: 700; color: var(--ink); }
.plan-value { font-size: 42px; font-weight: 800; letter-spacing: -1px; color: var(--ink); }
.plan-period { font-size: 14px; font-weight: 500; color: var(--muted); }

.plan-benefits {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-benefits li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
}
.plan-benefits .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #ffffff;
  background: var(--green);
  border-radius: 50%;
  padding: 3px;
}
.plan-benefits .icon svg { width: 12px; height: 12px; }
.plan-muted .plan-benefits .icon { background: #9a9aa0; }

.plan-cta { margin-top: auto; height: 52px; font-size: 14px; }
/* Botão secundário "Desfrutar 7 dias grátis" no card preto do plano em destaque */
.plan-trial-cta {
  margin-top: 10px;
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-family: var(--apple-font);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.2px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.plan-trial-cta .icon { display: inline-flex; }
.plan-trial-cta .icon svg { width: 16px; height: 16px; fill: currentColor; }
.plan-trial-cta:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.34); }
.plan-trial-cta:active { transform: scale(0.98); }
.plan-trial-cta:disabled { opacity: 0.55; cursor: default; }
.plan-soon {
  margin-top: auto;
  padding: 15px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border: 1.5px dashed var(--line);
  border-radius: 14px;
}

/* Checkout embutido na página (reaproveita o painel .sub-modal) */
.plans-checkout {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 36px;
}
.sub-modal.sub-inpage {
  position: relative;
  max-height: none;
}
.sub-price-cents { font-size: 30px; font-weight: 800; letter-spacing: 0; }
.sub-plan-tag {
  position: static;
  align-self: flex-start;
  margin: -10px 0 18px;
}

/* Responsivo */
@media (max-width: 1180px) {
  .plans-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .plans-page { padding: 20px 16px 48px; }
  .plans-grid { grid-template-columns: 1fr; }
  .plans-title { font-size: 32px; }
  .plans-hero { margin: 28px 0 30px; }
  .plans-sub { font-size: 14.5px; }
  .plan-desc { min-height: 0; }
  .plans-checkout { margin-top: 24px; }
}

/* Tema escuro */
html[data-theme="dark"] .plan-card {
  background: rgba(38, 38, 42, 0.82);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .plan-featured {
  border-color: var(--blue);
  box-shadow: 0 24px 52px rgba(var(--blue-rgb), 0.30), 0 0 0 6px rgba(var(--blue-rgb), 0.10);
}
html[data-theme="dark"] .plan-name,
html[data-theme="dark"] .plan-currency,
html[data-theme="dark"] .plan-value,
html[data-theme="dark"] .plan-benefits li { color: rgba(255, 255, 255, 0.92); }
html[data-theme="dark"] .plan-desc,
html[data-theme="dark"] .plan-period,
html[data-theme="dark"] .plans-sub,
html[data-theme="dark"] .plan-soon { color: rgba(255, 255, 255, 0.55); }
html[data-theme="dark"] .plans-sub b { color: rgba(255, 255, 255, 0.92); }
html[data-theme="dark"] .plan-tag { background: #3a3a40; color: rgba(255, 255, 255, 0.6); }
html[data-theme="dark"] .plan-tag-hot { background: var(--blue); color: #ffffff; }

/* ---------- Planos v31: mesma tela da oferta de lançamento ---------- */
.plans-page {
  min-height: var(--app-height);
  padding: 34px 24px 28px;
  background:
    radial-gradient(circle at 4% 18%, rgba(223, 245, 235, 0.74), transparent 25%),
    radial-gradient(circle at 96% 10%, rgba(232, 226, 255, 0.78), transparent 27%),
    radial-gradient(circle at 84% 92%, rgba(220, 236, 255, 0.72), transparent 28%),
    #fbfbfa;
  color: #111111;
}

.plans-topbar { display: none; }

.plans-back-float {
  position: absolute;
  top: 26px;
  left: 28px;
  right: auto;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 0;
  border-radius: 999px;
  color: #555555;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.plans-back-float:hover { background: rgba(17, 17, 17, 0.06); color: #111111; }
.plans-back-float .icon { width: 16px; height: 16px; }

.plans-hero {
  margin: 16px 0 32px;
}
.plans-hero-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  cursor: default;
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), filter 240ms ease;
}
.plans-hero-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.plans-hero-icon-dark { display: none !important; }
html[data-theme="dark"] .plans-hero-icon-light { display: none !important; }
html[data-theme="dark"] .plans-hero-icon-dark { display: block !important; }
@media (hover: hover) and (pointer: fine) {
  .plans-hero-icon:hover {
    transform: translateY(-6px);
    filter: drop-shadow(0 14px 20px rgba(30, 30, 30, 0.16));
  }
}
.plans-title,
.plans-title.grad-text {
  margin: 0 0 18px;
  color: #111111;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: initial;
  font-size: clamp(42px, 5vw, 76px);
  line-height: 0.91;
  font-weight: 750;
  letter-spacing: -0.075em;
  /* O tracking apertado também encolhe o espaço: sem isto as palavras grudam
     ("Assinee continue"), e no escuro, com letra clara, fica ainda pior. */
  word-spacing: 0.1em;
}
.plans-sub {
  max-width: 760px;
  color: #626262;
  font-size: clamp(14px, 1.35vw, 18px);
  line-height: 1.5;
  letter-spacing: -0.02em;
}
.plans-sub b { color: #1b1b1b; }

/* A página acompanha o tema; somente o ícone é trocado entre claro e escuro. */
html[data-theme="dark"] .plans-page .plans-back-float { color: rgba(255, 255, 255, 0.62); }
html[data-theme="dark"] .plans-page .plans-back-float:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .plans-page .plans-title,
html[data-theme="dark"] .plans-page .plans-title.grad-text { color: #f5f5f7; }
html[data-theme="dark"] .plans-page .plans-sub { color: rgba(255, 255, 255, 0.58); }
html[data-theme="dark"] .plans-page .plans-sub b { color: rgba(255, 255, 255, 0.92); }
/* Período ativo: o bundle pinta o fundo com var(--ink), que no escuro vira
   quase branco, e o texto com branco fixo, e o "Mensal" sumia. */
html[data-theme="dark"] .pps-btn.active { background: #f5f5f7; color: #111111; }
/* "Disponível em breve" herdava o fundo cinza-claro do tema claro. */
html[data-theme="dark"] .plans-page .plan-soon {
  border-color: rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.55);
}

.plans-grid {
  width: min(1450px, 100%);
  max-width: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  transition: none;
}
.plan-card {
  min-height: 560px;
  padding: 28px 26px 26px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 26px 72px rgba(39, 45, 52, 0.09);
  animation: planCardIn 560ms cubic-bezier(0.33, 1, 0.68, 1) both;
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 280ms ease;
}
.plan-card.plan-featured {
  border: 1.5px solid #161616;
  color: #ffffff;
  background: #101010 !important;
  box-shadow: 0 32px 80px rgba(12, 12, 12, 0.22);
}
.plan-card.plan-muted {
  filter: none;
  opacity: 1;
}
@media (hover: hover) and (pointer: fine) {
  .plan-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 22px 48px rgba(28, 33, 38, 0.14), 0 46px 96px rgba(28, 33, 38, 0.08);
  }
  .plan-card.plan-featured:hover {
    box-shadow: 0 24px 52px rgba(0, 0, 0, 0.28), 0 48px 100px rgba(0, 0, 0, 0.14);
  }
}
.plan-number {
  margin-bottom: 16px;
  color: #a4a4a4;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.plan-name { color: #111111; font-size: 28px; font-weight: 700; letter-spacing: -0.05em; }
.plan-desc { min-height: 52px; margin-top: 10px; color: #626262; font-size: 14px; line-height: 1.45; }
.plan-price { margin: 22px 0 24px; }
.plan-currency { color: #111111; font-size: 16px; }
.plan-value { color: #111111; font-size: clamp(42px, 4vw, 60px); font-weight: 800; letter-spacing: -0.08em; }
.plan-period { color: #777777; font-size: 14px; }
.plan-benefits { gap: 11px; }
.plan-benefits li { color: #2d2d2d; font-size: 14px; line-height: 1.3; }
.plan-featured .plan-number { color: rgba(255, 255, 255, 0.42); }
.plan-featured .plan-name { color: #ffffff; }
.plan-featured .plan-desc,
.plan-featured .plan-period { color: rgba(255, 255, 255, 0.66); }
.plan-featured .plan-currency,
.plan-featured .plan-value { color: #ffffff; }
.plan-featured .plan-benefits li { color: rgba(255, 255, 255, 0.92); }
.plan-featured .plan-tag-hot {
  color: #ffffff;
  border: 1px solid #3a3a3a;
  background: #191919;
}
.plan-featured .plan-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #111111 !important;
  background: #ffffff !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.24);
}
.plan-cta span { font-size: 20px; font-weight: 400; line-height: 1; }
.plan-soon {
  padding: 15px;
  border: 1px solid rgba(17,17,17,.10);
  border-radius: 15px;
  color: #858585;
  background: rgba(247,247,245,.62);
  text-align: center;
  font-size: 13px;
  font-weight: 500;
}

/* Saída dos planos e entrada do checkout após escolher a assinatura. */
.plans-hero.hero-exit {
  animation: plansHeroLeaveTop 500ms cubic-bezier(0.32, 0, 0.67, 0) both;
}
.plan-card.plan-exit,
.plan-card.plan-zoom-out {
  pointer-events: none;
  transition: none;
  will-change: transform, opacity;
}
.plan-card.plan-exit {
  animation: planExitToTop 520ms cubic-bezier(0.5, 0, 0.75, 0.35) both;
}
.plan-card.plan-zoom-out {
  animation: selectedPlanExitToTop 460ms cubic-bezier(0.32, 0, 0.67, 0) both;
}
.plan-card.plan-return {
  animation: planReturnFromTop 460ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes plansHeroLeaveTop {
  to { opacity: 0; transform: translateY(-150px); filter: blur(3px); }
}
@keyframes planExitToTop {
  0% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  60% { opacity: 0.55; }
  100% { opacity: 0; transform: translate3d(0, -125%, 0) scale(0.96); filter: blur(4px); }
}
@keyframes selectedPlanExitToTop {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translate3d(0, -115%, 0) scale(1.015); }
}
@keyframes planReturnFromTop {
  from { opacity: 0; transform: translate3d(0, -115%, 0) scale(0.985); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
.plan-cta-exit {
  pointer-events: none;
  animation: planCtaDisappear 220ms cubic-bezier(0.32, 0, 0.67, 0) both;
}
@keyframes planCtaDisappear {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(18px) scale(0.88); }
}
.plans-checkout {
  flex: 1;
  min-height: 0;
  align-items: center;
  margin-top: 0;
  padding: 38px 0;
}
.plans-checkout .sub-modal.sub-inpage {
  width: min(1040px, 100%);
  min-height: 560px;
}
.plans-checkout.checkout-enter .sub-modal.sub-inpage {
  animation: checkoutCardRise 500ms cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform, opacity;
}
.plans-checkout.checkout-leave .sub-modal.sub-inpage {
  animation: checkoutCardLeave 360ms cubic-bezier(0.32, 0, 0.67, 0) both;
  will-change: transform, opacity;
}
.plans-grid.checkout-active {
  width: min(1180px, 100%);
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
}
.plans-grid.checkout-active .plan-card.plan-featured {
  grid-column: 1;
  grid-row: 1;
  /* Card preto entra deslizando da esquerda em direção ao centro. */
  animation: featuredSlideToCenter 660ms cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform;
}
@keyframes featuredSlideToCenter {
  from { transform: translateX(-110px); }
  to { transform: translateX(0); }
}
.plans-grid.checkout-active .plans-checkout {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: stretch;
}
.plans-grid.checkout-active .plans-checkout .sub-modal.sub-inpage {
  width: 100%;
  min-height: 100%;
  max-height: none;
}
.checkout-plan-icon-only > img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.plans-grid.checkout-active .checkout-plan-icon-only {
  box-sizing: border-box;
  width: 160px;
  padding: 42px 20px;
  align-items: center;
}
.sub-store-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -6px 0 8px;
  padding: 11px 12px 11px 14px;
  border: 1px solid rgba(17, 17, 17, 0.09);
  border-radius: 16px;
  background: rgba(246, 247, 249, 0.88);
}
.sub-store-copy { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.sub-store-copy strong { color: #252525; font-size: 13px; font-weight: 700; }
.sub-store-copy span { color: #8a8a8a; font-size: 11.5px; line-height: 1.25; }
.sub-store-stepper {
  display: inline-grid;
  grid-template-columns: 30px 30px 30px;
  align-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 11px;
  background: #ffffff;
}
.sub-store-stepper button {
  width: 30px;
  height: 30px;
  border: 0;
  color: #202020;
  background: transparent;
  font-size: 19px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.sub-store-stepper button:hover:not(:disabled) { color: #ffffff; background: #151515; }
.sub-store-stepper button:disabled { color: #c5c5c5; cursor: default; }
.sub-store-stepper output {
  display: grid;
  height: 30px;
  place-items: center;
  border-inline: 1px solid rgba(17, 17, 17, 0.08);
  color: #151515;
  font-size: 13px;
  font-weight: 750;
}
.sub-store-total {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  margin: 0 1px 13px;
  color: #767676;
  font-size: 11.5px;
}
.number-change-up { animation: subscriptionNumberUp 300ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.number-change-down { animation: subscriptionNumberDown 300ms cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes subscriptionNumberUp {
  from { opacity: 0.35; transform: translateY(8px) scale(0.82); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes subscriptionNumberDown {
  from { opacity: 0.35; transform: translateY(-8px) scale(0.82); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes checkoutCardRise {
  from { opacity: 0; transform: translate3d(0, 72px, 0) scale(0.98); }
  72% { opacity: 1; transform: translate3d(0, -5px, 0) scale(1); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes checkoutCardLeave {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translate3d(0, 56px, 0) scale(0.98); }
}
@media (prefers-reduced-motion: reduce) {
  .plans-hero.hero-exit,
  .plan-card.plan-exit,
  .plan-card.plan-zoom-out,
  .plan-card.plan-return,
  .plan-cta-exit,
  .plans-grid.checkout-active .plan-card.plan-featured,
  .plans-checkout.checkout-enter .sub-modal.sub-inpage,
  .plans-checkout.checkout-leave .sub-modal.sub-inpage { animation: none; }
}

@media (max-width: 1180px) {
  .plans-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plans-grid.checkout-active { width: min(920px, 100%); grid-template-columns: minmax(290px, 0.82fr) minmax(0, 1.18fr); }
}
@media (max-width: 680px) {
  .plans-page { padding: 24px 14px 40px; }
  .plans-back-float { top: 12px; left: 12px; right: auto; }
  .plans-hero { margin: 24px 0 28px; }
  .plans-title { font-size: 42px; }
  .plans-grid { grid-template-columns: 1fr; width: 100% !important; max-width: 100% !important; }
  .plans-grid.checkout-active {
    /* minmax(0, ...) impede que o conteúdo interno aumente a coluna além
       do viewport — o comportamento que fazia o formulário sair à direita. */
    grid-template-columns: minmax(0, 1fr);
    /* Mantém o checkout na largura confortável de um telefone mesmo quando a
       janela móvel é aberta em uma tela maior (ou com escala reduzida). */
    width: min(430px, calc(100% - 24px)) !important;
    max-width: min(430px, calc(100% - 24px)) !important;
    margin: 0 auto !important;
    box-sizing: border-box;
  }
  .plans-grid.checkout-active .plans-checkout {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-sizing: border-box;
    min-width: 0;
  }
  .sub-store-picker { align-items: flex-start; }
  .plan-card { min-height: 0; padding: 24px 22px 22px; }
  .plan-desc { min-height: 0; }

  /* Ajustes no checkout mobile para reorganizar a página e evitar scroll excessivo */
  .plans-page:has(.plans-grid.checkout-active) {
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    padding: 24px 0 40px !important;
  }
  .plans-page:has(.plans-grid.checkout-active) .plans-hero {
    margin: 12px 0 16px;
  }
  .plans-page:has(.plans-grid.checkout-active) .plans-sub {
    display: none !important;
  }
  .plans-page:has(.plans-grid.checkout-active) .plans-hero-icon {
    display: block !important;
    width: 38px;
    height: 38px;
    margin: 0 auto 8px;
  }
  .plans-page:has(.plans-grid.checkout-active) .plans-title {
    font-size: 26px;
    margin: 0;
  }

  .plans-grid.checkout-active .plan-card.plan-featured {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: auto;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto 12px !important;
    padding: 12px 18px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    animation: none;
    box-sizing: border-box;
  }
  .plans-grid.checkout-active .plan-card.plan-featured .plan-tag,
  .plans-grid.checkout-active .plan-card.plan-featured .plan-number,
  .plans-grid.checkout-active .plan-card.plan-featured .plan-desc,
  .plans-grid.checkout-active .plan-card.plan-featured .plan-benefits,
  .plans-grid.checkout-active .plan-card.plan-featured .plan-cta {
    display: none !important;
  }
  .plans-grid.checkout-active .plan-card.plan-featured .plan-name {
    font-size: 16px;
    margin: 0;
    font-weight: 700;
  }
  .plans-grid.checkout-active .plan-card.plan-featured .plan-price {
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 2px;
  }
  .plans-grid.checkout-active .plan-card.plan-featured .plan-currency {
    font-size: 11px;
  }
  .plans-grid.checkout-active .plan-card.plan-featured .plan-value {
    font-size: 20px;
    letter-spacing: -0.04em;
  }
  .plans-grid.checkout-active .plan-card.plan-featured .plan-period {
    font-size: 11px;
  }

  .plans-grid.checkout-active .checkout-plan-icon-only {
    display: none !important;
  }
  .plans-grid.checkout-active .plans-checkout {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-sizing: border-box;
  }
  .plans-grid.checkout-active .sub-modal.sub-inpage {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    min-height: auto;
    border-radius: 22px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    min-width: 0;
  }
  .plans-grid.checkout-active .sub-form {
    padding: 18px 16px 20px;
    width: 100%;
    box-sizing: border-box;
  }
}

/* ---------- Onboarding: personalizar o sistema (ícone) ---------- */
.personalize-page {
  position: relative;
  overflow: hidden;
  min-height: var(--app-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.personalize-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: personalizeIn 620ms cubic-bezier(0.33, 1, 0.68, 1) both;
}
@keyframes personalizeIn {
  from { opacity: 0; transform: translateY(22px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.personalize-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.personalize-title {
  margin: 0 0 12px;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.08;
  text-align: center;
}
.personalize-sub {
  margin: 0;
  max-width: 460px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}
/* aviso exibido quando o usuário assina para mais de uma loja */
.personalize-multi-note {
  margin: 16px auto 0;
  max-width: 460px;
  padding: 12px 18px;
  border-radius: 16px;
  background: rgba(0, 113, 227, 0.08);
  border: 1px solid rgba(0, 113, 227, 0.20);
  color: var(--blue);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}

.personalize-card {
  margin-top: 34px;
  width: 100%;
  padding: 40px 36px 30px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 24px 52px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.icon-dropzone {
  width: 168px;
  height: 168px;
  border-radius: 34px;
  border: 2px dashed rgba(0, 113, 227, 0.38);
  background: rgba(0, 113, 227, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .18s, background .18s, transform .18s, box-shadow .18s;
  outline: none;
}
.icon-dropzone:hover,
.icon-dropzone:focus-visible {
  border-color: var(--blue);
  background: rgba(0, 113, 227, 0.09);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 113, 227, 0.18);
}
.icon-dropzone.dragover {
  border-color: var(--blue);
  background: rgba(0, 113, 227, 0.14);
  transform: scale(1.03);
}
.icon-dropzone.has-icon {
  border-style: solid;
  border-color: rgba(0, 113, 227, 0.28);
  background: #ffffff;
}
.icon-dropzone-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  color: var(--blue);
  pointer-events: none;
}
.icon-placeholder .icon { width: 40px; height: 40px; opacity: 0.9; }
.icon-placeholder span {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--muted);
}
.icon-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: iconPreviewIn 360ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes iconPreviewIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.icon-hint {
  margin-top: 16px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  transition: color .18s;
}
.icon-hint-error { color: rgba(214, 40, 40, 0.96); font-weight: 600; }

.personalize-done { width: 100%; margin-top: 26px; height: 56px; }
.personalize-done:disabled { filter: opacity(0.5); cursor: not-allowed; }
.personalize-done .icon { width: 18px; height: 18px; }
.personalize-skip { margin-top: 14px; }

@media (max-width: 560px) {
  .personalize-title { font-size: 30px; }
  .personalize-sub { font-size: 14.5px; }
  .personalize-card { margin-top: 26px; padding: 30px 22px 24px; }
  .icon-dropzone { width: 148px; height: 148px; }
}

/* Tema escuro */
html[data-theme="dark"] .personalize-card {
  background: rgba(38, 38, 42, 0.82);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .personalize-sub,
html[data-theme="dark"] .icon-hint,
html[data-theme="dark"] .icon-placeholder span { color: rgba(255, 255, 255, 0.55); }
html[data-theme="dark"] .personalize-multi-note {
  background: rgba(0, 113, 227, 0.16);
  border-color: rgba(0, 113, 227, 0.34);
  color: var(--blue-soft);
}
html[data-theme="dark"] .icon-dropzone { background: rgba(0, 113, 227, 0.12); }
html[data-theme="dark"] .icon-dropzone.has-icon { background: rgba(255, 255, 255, 0.06); }

/* ---------- Passo de nome (transição in-place na tela de personalização) ---------- */
.personalize-head.head-out { animation: pHeadOut 260ms ease-in both; }
.personalize-head.head-in { animation: pHeadIn 500ms cubic-bezier(0.33, 1, 0.68, 1) both; }
@keyframes pHeadOut { to { opacity: 0; transform: translateY(-14px); } }
@keyframes pHeadIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.fade-out-actions { animation: pFadeOut 240ms ease-in both; pointer-events: none; }
@keyframes pFadeOut { to { opacity: 0; transform: translateY(10px); } }

/* ícone travado: vira só uma imagem estática (sem hover/upload) */
.icon-dropzone.icon-locked {
  cursor: default;
  pointer-events: none;
  border-style: solid;
  border-color: rgba(0, 113, 227, 0.28);
  background: #ffffff;
}

.name-field-wrap {
  width: 100%;
  margin-top: 24px;
  animation: pNameIn 500ms cubic-bezier(0.33, 1, 0.68, 1) both;
}
@keyframes pNameIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.name-field { width: 100%; }
.name-progress { opacity: 0.62; font-weight: 500; }

html[data-theme="dark"] .icon-dropzone.icon-locked { background: rgba(255, 255, 255, 0.06); }

/* Botão Voltar do onboarding (topo esquerdo) */
.onboard-back {
  position: absolute;
  top: 26px;
  left: 28px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px 9px 10px;
  border-radius: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--blue);
  font-weight: 500;
  font-size: 14px;
  font-family: inherit;
  transition: background .15s;
  animation: authFadeIn 500ms ease-out both;
}
.onboard-back:hover { background: rgba(0, 113, 227, 0.08); }
.onboard-back .icon { width: 18px; height: 18px; }

/* Sucesso em página própria (ao voltar do passo de personalização) */
.success-standalone {
  width: 480px;
  max-width: 100%;
  min-height: 420px;
}

@media (max-width: 560px) {
  .onboard-back { top: 16px; left: 14px; }
}

/* Botão secundário "Personalizar depois" na tela de assinatura confirmada */
.sub-success .sub-later {
  margin-top: 14px;
  align-self: center;
  font-size: 14px;
}

/* =========================================================================
   Central de Relatórios — cards e modal no tema do sistema
   ========================================================================= */
.rep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.rep-card {
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  padding: 0;
  font-family: inherit;
  background: #ffffff;
  border: 1px solid rgba(29, 29, 31, 0.10);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.rep-card:hover { transform: translateY(-2px); box-shadow: 0 18px 32px rgba(0, 0, 0, 0.10); }
.rep-card:active { transform: translateY(0); }

.rep-card-banner {
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(var(--blue-rgb), 0.12), rgba(19, 160, 101, 0.12));
  color: var(--blue);
}
.rep-card-banner .icon { width: 38px; height: 38px; }

.rep-card-body {
  padding: 13px 14px 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.rep-card-title { color: #1d1d1f; font-size: 14px; font-weight: 600; }
.rep-card-desc {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rep-card-access {
  margin-top: auto;
  padding-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 600;
}
.rep-card-access .icon { width: 16px; height: 16px; }

.rep-modal-hero { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.rep-modal-ic {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(var(--blue-rgb), 0.14), rgba(19, 160, 101, 0.14));
  color: var(--blue);
}
.rep-modal-ic .icon { width: 24px; height: 24px; }
.rep-modal-hero p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

.rep-modal-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 26px 18px;
  border-radius: 18px;
  background: var(--card-soft);
  border: 1px dashed rgba(29, 29, 31, 0.16);
}
.rep-modal-empty .icon { width: 34px; height: 34px; color: var(--blue-soft); }
.rep-modal-empty b { font-size: 13.5px; color: #1d1d1f; }
.rep-modal-empty span { font-size: 12px; color: var(--muted); max-width: 320px; }

/* Dark mode */
html[data-theme="dark"] .rep-card {
  background: #181b22;
  border-color: rgba(255, 255, 255, 0.12);
}
html[data-theme="dark"] .rep-card-title { color: #f5f5f7; }
html[data-theme="dark"] .rep-card-banner {
  background: linear-gradient(135deg, rgba(94, 168, 255, 0.16), rgba(45, 210, 150, 0.14));
  color: #5ea8ff;
}
html[data-theme="dark"] .rep-card-access { color: #5ea8ff; }
html[data-theme="dark"] .rep-modal-ic {
  color: #5ea8ff;
  background: linear-gradient(135deg, rgba(94, 168, 255, 0.18), rgba(45, 210, 150, 0.16));
}
html[data-theme="dark"] .rep-modal-empty {
  background: #0e1015;
  border-color: rgba(255, 255, 255, 0.14);
}
html[data-theme="dark"] .rep-modal-empty b { color: #f5f5f7; }

/* ---------- Popup de relatório (dialog escuro/cinza, igual ao Filtros) ---------- */
.stats-modal-card.rel-report-dialog {
  width: min(760px, 100%);
  max-height: min(88vh, 880px);
}
.rel-report-dialog .stats-modal-body {
  padding: 14px 18px 18px;
  overflow-y: auto;
}
.rel-report-dialog .stats-modal-foot {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--pop-border);
}

.rel-report-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
@media (max-width: 768px) {
  .rel-report-top {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 10px;
  }
}
.rel-report-desc { color: var(--pop-muted); font-size: 12px; line-height: 1.4; flex: 1; }
.rel-period-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--pop-surface-alt);
  border: 1px solid var(--pop-border);
  color: var(--pop-ink);
  border-radius: 14px;
  padding: 6px 12px 6px 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.rel-period-btn:hover { background: var(--pop-hover); }
.rel-period-btn .prod-btn-chip {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: var(--pop-hover);
  border-radius: 9px;
}
.rel-period-btn .prod-btn-chip .icon { width: 15px; height: 15px; }

.rel-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.rel-kpi {
  background: var(--pop-surface-alt);
  border: 1px solid var(--pop-border);
  border-radius: 16px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.rel-kpi span { color: var(--pop-muted); font-size: 11.5px; }
.rel-kpi strong { color: var(--pop-ink); font-size: 18px; font-weight: 600; }
.rel-kpi em { color: var(--pop-muted); font-size: 11px; font-style: normal; }
.rel-kpi.accent {
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.28), rgba(19, 160, 101, 0.20));
  border-color: rgba(94, 168, 255, 0.32);
}

.rel-sec { color: var(--pop-ink); font-size: 13px; font-weight: 600; margin: 16px 0 8px; }

.rel-table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--pop-border); }
.rel-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rel-table th {
  text-align: left;
  color: var(--pop-muted);
  font-weight: 600;
  padding: 9px 12px;
  background: var(--pop-surface-alt);
  white-space: nowrap;
}
.rel-table td { color: var(--pop-ink); padding: 9px 12px; border-top: 1px solid var(--pop-border-soft); white-space: nowrap; }
.rel-table th.r, .rel-table td.r { text-align: right; }
.rel-table tbody tr:hover td { background: var(--pop-hover); }

.rel-rank { display: flex; flex-direction: column; gap: 10px; }
.rel-rank-row { display: flex; flex-direction: column; gap: 5px; }
.rel-rank-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.rel-rank-top span { color: var(--pop-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-rank-top b { color: var(--pop-ink); white-space: nowrap; }
.rel-rank-bar { height: 7px; border-radius: 5px; background: var(--pop-surface-alt); overflow: hidden; }
.rel-rank-bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #0071e3, #13a065); }

.rel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 30px 16px;
  color: var(--pop-muted);
  font-size: 12.5px;
}
.rel-empty .icon { width: 26px; height: 26px; color: var(--pop-muted); }
.rel-note { color: var(--pop-muted); font-size: 11.5px; line-height: 1.45; margin: 12px 0 0; }
.rel-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--pop-muted); font-size: 13px; }

/* O tema novo neutraliza .stats-modal-danger de propósito: no PDV essa classe é
   "Cancelar", ação neutra. Aqui não — o "Fechar" é a saída da tela e foi pedido
   para continuar vermelho e ocupando a largura toda. Precisa de 4 classes para
   bater a regra neutra de .stats-modal-card.pos-dialog .stats-modal-danger.
   Os tokens --pop-danger dão o mesmo #ff6c6c no escuro e um vermelho legível
   no claro, em vez do fundo escuro fixo que a versão antiga usava. */
.stats-modal-card.pos-dialog.rel-report-dialog .stats-modal-danger,
.stats-modal-card.pos-dialog.stats-cash-split-dialog .stats-modal-danger {
  width: 100%;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--pop-danger-border);
  background: var(--pop-danger-bg);
  color: var(--pop-danger);
}
.stats-modal-card.pos-dialog.rel-report-dialog .stats-modal-danger:hover,
.stats-modal-card.pos-dialog.stats-cash-split-dialog .stats-modal-danger:hover {
  background: var(--pop-danger-bg);
  border-color: var(--pop-danger);
}

/* No escuro a regra neutra vem prefixada por html[data-theme="dark"], o que a
   deixa mais específica que a de cima — sem repetir o prefixo aqui, o Fechar
   voltava a ficar cinza justamente no tema em que a tela é usada. */
html[data-theme="dark"] .stats-modal-card.pos-dialog.rel-report-dialog .stats-modal-danger,
html[data-theme="dark"] .stats-modal-card.pos-dialog.stats-cash-split-dialog .stats-modal-danger {
  border-color: var(--pop-danger-border);
  background: var(--pop-danger-bg);
  color: var(--pop-danger);
}
html[data-theme="dark"] .stats-modal-card.pos-dialog.rel-report-dialog .stats-modal-danger:hover,
html[data-theme="dark"] .stats-modal-card.pos-dialog.stats-cash-split-dialog .stats-modal-danger:hover {
  background: var(--pop-danger-bg);
  border-color: var(--pop-danger);
}

/* ---- PROD IMAGE SUGGESTIONS & SEARCH ---- */

.prod-product-dialog .prod-image-search {
  flex: 1;
}

.prod-product-dialog .prod-image-search-wrapper input {
  padding-right: 38px !important;
}

.prod-product-dialog .prod-image-suggestions-container {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding: 12px 4px;
  margin: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.prod-product-dialog .prod-image-suggestions-container::-webkit-scrollbar {
  height: 5px;
}

.prod-product-dialog .prod-image-suggestions-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.prod-product-dialog .prod-image-suggestions-container::-webkit-scrollbar-track {
  background: transparent;
}

.prod-image-suggestion-card {
  flex: 0 0 76px;
  width: 76px;
  height: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 12px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.prod-image-suggestion-card img {
  width: 100%;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.2);
}

.prod-image-suggestion-error-fallback {
  display: none;
  width: 100%;
  height: 56px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.3);
}

.prod-image-suggestion-card.error img {
  display: none;
}

.prod-image-suggestion-card.error .prod-image-suggestion-error-fallback {
  display: flex;
}

.prod-image-suggestion-name {
  font-size: 10px;
  color: #a1a1a6;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  text-align: center;
  transition: color 0.2s ease;
}

.prod-image-suggestion-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.prod-image-suggestion-card:hover .prod-image-suggestion-name {
  color: #f5f5f7;
}

.prod-image-suggestion-card.selected {
  background: rgba(0, 113, 227, 0.15);
  border-color: #0071e3;
  box-shadow: 0 0 10px rgba(0, 113, 227, 0.4);
}

.prod-image-suggestion-card.selected img {
  transform: scale(0.96);
}

.prod-image-suggestion-card.selected .prod-image-suggestion-name {
  color: #0071e3;
  font-weight: 600;
}

.prod-image-suggestions-loading,
.prod-image-suggestions-empty {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.45);
  padding: 16px;
  text-align: center;
  width: 100%;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.prod-product-dialog .prod-image-url-collapsible {
  margin-top: 10px !important;
  animation: prodFadeInDown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.prod-toggle-url-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: #0071e3;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 12px;
  margin-top: 6px;
  border-radius: 8px;
  transition: all 0.2s ease;
  align-self: flex-start;
}

.prod-toggle-url-btn:hover {
  background: rgba(0, 113, 227, 0.1);
}

.prod-toggle-url-btn .icon {
  width: 16px;
  height: 16px;
}

@keyframes prodFadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.prod-product-dialog .prod-search-icon-inside .icon {
  width: 20px !important;
  height: 20px !important;
  color: rgba(255, 255, 255, 0.4) !important;
}

.prod-image-suggestions-loading {
  animation: prodPulse 1.5s infinite ease-in-out;
}

@keyframes prodPulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* ---- Cadastro de produto em página (Produtos > Novo) ----
   Reaproveita .prod-product-dialog para herdar o visual do popup; estas regras
   ficam no fim do arquivo para vencer os !important do modo modal por ordem. */
/* Sem backdrop escurecido atrás, o vidro translúcido do popup lavaria sobre o
   fundo claro da página — aqui o card é opaco. */
.prod-form-page {
  /* Sem trava de largura: ocupa a faixa inteira, igual ao card de OS/NF-e.
     O tema claro do formulário já existe em ~7496; o bloco escuro logo abaixo
     dele está restrito a :not(.prod-form-page). */
  width: 100%;
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(29, 29, 31, 0.06) !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.05) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  color-scheme: light !important;
}

/* As sugestões de imagem são escuras globalmente (13586+), não via
   .prod-product-dialog — então precisam ser clareadas à mão. */
.prod-form-page .prod-image-suggestion-card {
  background: #f7f7f8;
  border: 1px solid rgba(29, 29, 31, 0.10);
}

.prod-form-page .prod-image-suggestion-card:hover {
  background: #ededee;
  border-color: rgba(29, 29, 31, 0.20);
}

.prod-form-page .prod-image-suggestion-name {
  color: #6e6e73;
}

.prod-form-page .prod-image-suggestion-card:hover .prod-image-suggestion-name {
  color: #1d1d1f;
}

.prod-form-page .prod-image-suggestions-empty,
.prod-form-page .prod-image-suggestions-loading {
  color: #8f8f93 !important;
}

.prod-form-page .prod-form-empty-label {
  color: rgba(255, 255, 255, 0.40);
}

/* O popup prende o formulário num viewport de 62vh e desliza as abas dentro
   dele; na página o conteúdo cresce e quem rola é o main. */
.prod-form-page .prod-form-main {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

/* Formulário único: some o carrossel horizontal de abas do popup. */
.prod-form-page .prod-form-panels-wrapper {
  display: block !important;
  height: auto !important;
  transform: none !important;
  transition: none !important;
}

.prod-form-page .prod-form-panel {
  flex: none !important;
  width: 100% !important;
  height: auto !important;
  overflow: visible !important;
}

.prod-form-page .prod-form-side {
  position: sticky !important;
  top: 12px !important;
  overflow: visible !important;
}

/* ---- Cards e botões no estilo da página de OS/NF-e ----
   O cadastro de produto usa .stats-modal-field, que aninha um input com caixa
   própria dentro do card; a OS usa .notas-page-field — card único, rótulo
   pequeno em cima e input transparente. Aqui o primeiro imita o segundo. */
.prod-form-page .stats-modal-field,
.prod-form-page .prod-product-id-field {
  min-height: 50px !important;
  justify-content: center !important;
  gap: 2px !important;
  padding: 8px 12px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(29, 29, 31, 0.06) !important;
  background: #f5f5f7 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70) !important;
}

.prod-form-page .stats-modal-field span,
.prod-form-page .prod-product-id-field span {
  padding-left: 0 !important;
  margin-bottom: 0 !important;
  color: #5e5e62 !important;
  font-size: 11px !important;
  line-height: 1.05 !important;
  font-weight: 300 !important;
}

.prod-form-page .stats-modal-field input,
.prod-form-page .stats-modal-field select,
.prod-form-page .stats-modal-field textarea,
.prod-form-page .prod-product-id-field input {
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #111113 !important;
  font-size: 14px !important;
  font-weight: 300 !important;
  line-height: 1.12 !important;
}

.prod-form-page .stats-modal-field textarea {
  min-height: 68px !important;
  padding: 2px 0 !important;
  line-height: 1.35 !important;
  resize: vertical !important;
}

.prod-form-page .stats-modal-field input::placeholder,
.prod-form-page .stats-modal-field textarea::placeholder,
.prod-form-page .prod-product-id-field input::placeholder {
  color: #8f8f93 !important;
  font-size: 14px !important;
}

/* Pickers (Categoria, Fornecedor, Marca, Unidade, Origem) viram o mesmo card. */
.prod-form-page .prod-picker-btn,
.prod-form-page .stats-filter-field {
  min-height: 50px !important;
  height: auto !important;
  padding: 0 !important;
  border-radius: 12px !important;
  border: 1px solid rgba(29, 29, 31, 0.06) !important;
  background: #f5f5f7 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70) !important;
}

.prod-form-page .prod-picker-inner {
  height: 48px !important;
  padding: 0 12px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
}

.prod-form-page .prod-picker-inner:has(.prod-btn-chip) {
  padding-left: 6px !important;
}

.prod-form-page .prod-picker-btn:hover .prod-picker-inner {
  background: rgba(29, 29, 31, 0.04) !important;
}

.prod-form-page .prod-picker-btn .prod-btn-chip {
  flex: 0 0 28px !important;
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  height: 28px !important;
  border-radius: 8px !important;
}

.prod-form-page .prod-picker-btn .prod-btn-label,
.prod-form-page .stats-filter-field > span:not(.icon) {
  font-size: 14px !important;
}

/* Botões viram a pílula .notas-page-add-btn da OS. Precisa de 0,3,0 para vencer
   `.prod-product-dialog .prod-image-row .prod-tool-btn`, que é !important. */
.prod-form-page .prod-image-row .prod-tool-btn,
.prod-form-page .prod-form-panel .prod-tool-btn {
  /* Exatamente a altura do card ao lado: o .stats-modal-field tem min-height 50
     e o conteúdo cabe nela. Com stretch o botão esticava além do card. */
  min-height: 50px !important;
  height: 50px !important;
  align-self: flex-end !important;
  gap: 8px !important;
  padding: 0 16px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(29, 29, 31, 0.06) !important;
  background: #f5f5f7 !important;
  box-shadow: none !important;
  color: #111113 !important;
  font-size: 13px !important;
}

.prod-form-page .prod-tool-btn .prod-btn-chip {
  flex: 0 0 16px !important;
  width: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  height: 16px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
}

.prod-form-page .prod-tool-btn .prod-btn-chip .icon {
  width: 16px !important;
  height: 16px !important;
}

/* ---- Resultados da busca de imagens ----
   O container virou coluna (cabeçalho + grade); quem rola/quebra é a grade. */
.prod-image-suggestions-container {
  flex-direction: column !important;
  gap: 8px !important;
  overflow-x: hidden !important;
}

.prod-sugg-head {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #6e6e73;
  font-size: 12px;
}

/* .icon não tem tamanho por padrão — sem isto o SVG estoura. */
.prod-sugg-head .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.prod-sugg-head strong {
  font-weight: 400;
}

.prod-sugg-provider {
  align-self: flex-start;
  color: #0071e3;
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
}

.prod-sugg-provider:hover {
  text-decoration: underline;
}

.prod-sugg-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

/* No popup o espaço é curto: a grade segue em faixa horizontal. */
.prod-product-dialog:not(.prod-form-page) .prod-sugg-head {
  color: #a1a1a6;
}

/* Na página sobra largura: a grade quebra linha e mostra tudo de uma vez. */
.prod-form-page .prod-sugg-grid {
  flex-wrap: wrap;
  overflow-x: visible;
  max-height: 430px;
  overflow-y: auto;
}

/* Miniaturas de sugestão maiores. */
.prod-form-page .prod-image-suggestion-card {
  flex: 0 0 132px !important;
  width: 132px !important;
  height: auto !important;
  gap: 6px !important;
  padding: 6px !important;
  border-radius: 14px !important;
}

.prod-form-page .prod-image-suggestion-card img,
.prod-form-page .prod-image-suggestion-error-fallback {
  height: 116px !important;
  border-radius: 10px !important;
}

.prod-form-page .prod-image-suggestion-name {
  font-size: 11.5px !important;
}

.prod-form-page .prod-image-suggestions-container {
  scrollbar-color: rgba(29, 29, 31, 0.18) transparent !important;
}

.prod-form-page .prod-image-suggestions-container::-webkit-scrollbar-thumb {
  background: rgba(29, 29, 31, 0.18) !important;
}

/* ---- Chaves liga/desliga ----
   O .prod-toggle-row não tem card: é só um space-between. No popup estreito o
   rótulo e a chave ficavam perto; no card de largura total iam parar em pontas
   opostas, sem dar para parear. Aqui viram um card contido, como na OS. */
/* "Cadastro ativo" fica logo após o card de estoque inicial/mínimo — mais
   respiro aqui do que o padrão entre seções. */
.prod-form-page .prod-stock-edit-row + .prod-toggle-row {
  margin-top: 20px;
}

.prod-form-page .prod-toggle-row {
  min-height: 50px;
  /* Abraça o conteúdo: o space-between herdado jogava o rótulo numa ponta e a
     chave na outra, por mais estreito que fosse o card. */
  width: fit-content;
  max-width: 100%;
  justify-content: flex-start;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(29, 29, 31, 0.06);
  background: #f5f5f7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70);
}

.prod-form-page .prod-toggle-row span {
  color: #111113;
  font-size: 14px;
}

/* Desligado desenhava o botão preto (7745) — lia como um borrão escuro em vez
   de uma chave. Cinza com botão branco à esquerda, verde à direita: padrão iOS. */
.prod-form-page .prod-switch {
  background: #e2e2e5;
  border-color: rgba(29, 29, 31, 0.12);
}

.prod-form-page .prod-switch::after {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}

.prod-form-page .prod-switch.on {
  background: #13a065;
  border-color: #13a065;
}

@media (max-width: 760px) {
  .prod-form-page {
    width: 100%;
  }
  .prod-form-page .prod-form-side {
    position: static !important;
  }
  .prod-form-page .prod-toggle-row {
    width: 100%;
    justify-content: space-between;
  }
}

/* ---- Cadastro de produto em página: tema escuro ----
   A página reutiliza o formulário claro do modal e, por isso, precisa
   restabelecer a paleta escura depois das regras específicas de .prod-form-page. */
html[data-theme="dark"] .prod-form-page {
  background: rgba(18, 19, 23, 0.96) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.30) !important;
  color: #f5f5f7 !important;
  color-scheme: dark !important;
}

html[data-theme="dark"] .prod-form-page h1,
html[data-theme="dark"] .prod-form-page h2,
html[data-theme="dark"] .prod-form-page .prod-form-section {
  color: #f5f5f7 !important;
}

html[data-theme="dark"] .prod-form-page .stats-modal-field,
html[data-theme="dark"] .prod-form-page .prod-product-id-field,
html[data-theme="dark"] .prod-form-page .prod-picker-btn,
html[data-theme="dark"] .prod-form-page .stats-filter-field,
html[data-theme="dark"] .prod-form-page .prod-toggle-row,
html[data-theme="dark"] .prod-form-page .prod-image-row .prod-tool-btn,
html[data-theme="dark"] .prod-form-page .prod-form-panel .prod-tool-btn {
  background: #1c1e24 !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
}

html[data-theme="dark"] .prod-form-page .prod-picker-btn:hover,
html[data-theme="dark"] .prod-form-page .stats-filter-field:hover,
html[data-theme="dark"] .prod-form-page .prod-image-row .prod-tool-btn:hover,
html[data-theme="dark"] .prod-form-page .prod-form-panel .prod-tool-btn:hover {
  background: #24272f !important;
}

html[data-theme="dark"] .prod-form-page .prod-image-row .prod-tool-btn,
html[data-theme="dark"] .prod-form-page .prod-form-panel .prod-tool-btn {
  color: #f5f5f7 !important;
}

html[data-theme="dark"] .prod-form-page .prod-picker-inner,
html[data-theme="dark"] .prod-form-page .prod-picker-btn:hover .prod-picker-inner {
  background: transparent !important;
  border-color: transparent !important;
}

html[data-theme="dark"] .prod-form-page .stats-modal-field span,
html[data-theme="dark"] .prod-form-page .prod-product-id-field span {
  color: #a4a7ae !important;
}

html[data-theme="dark"] .prod-form-page .stats-modal-field input,
html[data-theme="dark"] .prod-form-page .stats-modal-field select,
html[data-theme="dark"] .prod-form-page .stats-modal-field textarea,
html[data-theme="dark"] .prod-form-page .prod-product-id-field input {
  color: #f5f5f7 !important;
  caret-color: #5ea8ff !important;
}

html[data-theme="dark"] .prod-form-page .stats-modal-field input::placeholder,
html[data-theme="dark"] .prod-form-page .stats-modal-field textarea::placeholder,
html[data-theme="dark"] .prod-form-page .prod-product-id-field input::placeholder {
  color: rgba(255, 255, 255, 0.48) !important;
}

html[data-theme="dark"] .prod-form-page .prod-picker-btn .prod-btn-label,
html[data-theme="dark"] .prod-form-page .stats-filter-field > span:not(.icon),
html[data-theme="dark"] .prod-form-page .stats-filter-field.has-value > span:not(.icon) {
  color: #f5f5f7 !important;
}

html[data-theme="dark"] .prod-form-page .prod-picker-btn.empty .prod-btn-label,
html[data-theme="dark"] .prod-form-page .stats-filter-field.empty > span:not(.icon) {
  color: rgba(255, 255, 255, 0.48) !important;
}

html[data-theme="dark"] .prod-form-page .prod-picker-btn .prod-btn-chip,
html[data-theme="dark"] .prod-form-page .prod-tool-btn .prod-btn-chip {
  background: #111318 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] .prod-form-page .prod-picker-btn .prod-btn-chip .icon,
html[data-theme="dark"] .prod-form-page .prod-tool-btn .prod-btn-chip .icon,
html[data-theme="dark"] .prod-form-page .prod-search-icon-inside .icon {
  color: #5ea8ff !important;
}

html[data-theme="dark"] .prod-form-page .prod-picker-chevron,
html[data-theme="dark"] .prod-form-page .stats-filter-field .icon {
  color: #737780 !important;
}

html[data-theme="dark"] .prod-form-page .prod-form-preview-box {
  background: #0b0d11 !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
}

html[data-theme="dark"] .prod-form-page .prod-form-preview-label,
html[data-theme="dark"] .prod-form-page .prod-sugg-head {
  color: #a4a7ae !important;
}

html[data-theme="dark"] .prod-form-page .prod-toggle-row span {
  color: #f5f5f7 !important;
}

html[data-theme="dark"] .prod-form-page .prod-switch {
  background: #3a3d45 !important;
  border-color: rgba(255, 255, 255, 0.13) !important;
}

html[data-theme="dark"] .prod-form-page .prod-switch::after {
  background: #ffffff !important;
}

html[data-theme="dark"] .prod-form-page .prod-switch.on {
  background: #13a065 !important;
  border-color: #13a065 !important;
}

html[data-theme="dark"] .prod-form-page .prod-image-suggestion-card {
  background: #181b22 !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
}

html[data-theme="dark"] .prod-form-page .prod-image-suggestion-card:hover {
  background: #24272f !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}

html[data-theme="dark"] .prod-form-page .prod-image-suggestion-name {
  color: #a4a7ae !important;
}

html[data-theme="dark"] .prod-form-page .prod-image-suggestion-card:hover .prod-image-suggestion-name {
  color: #f5f5f7 !important;
}

html[data-theme="dark"] .prod-form-page .prod-image-suggestion-card.selected {
  background: rgba(0, 113, 227, 0.18) !important;
  border-color: #2997ff !important;
}

html[data-theme="dark"] .prod-form-page .prod-image-suggestion-card.selected .prod-image-suggestion-name {
  color: #5ea8ff !important;
}

html[data-theme="dark"] .prod-form-page .prod-image-suggestions-empty,
html[data-theme="dark"] .prod-form-page .prod-image-suggestions-loading {
  color: rgba(255, 255, 255, 0.58) !important;
  background: #15171c !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
}

html[data-theme="dark"] .prod-form-page .prod-image-suggestions-container {
  scrollbar-color: rgba(255, 255, 255, 0.20) transparent !important;
}

html[data-theme="dark"] .prod-form-page .prod-image-suggestions-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.20) !important;
}

html[data-theme="dark"] .prod-form-page .prod-sugg-provider {
  color: #2997ff !important;
}

html[data-theme="dark"] .prod-form-page .prod-stock-moves-panel {
  background: #15171c !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
}

html[data-theme="dark"] .prod-form-page .prod-stock-moves-head {
  background: #1f2229 !important;
  color: #f5f5f7 !important;
}

html[data-theme="dark"] .prod-form-page .prod-stock-move-row {
  color: #f5f5f7 !important;
  border-top-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] .prod-form-page .prod-stock-moves-empty {
  color: #a4a7ae !important;
}

/* Na página, centraliza a lupa pelo card completo (rótulo + campo), não apenas
   pela linha interna do input. O popup mantém o alinhamento compacto original. */
.prod-form-page .prod-image-search {
  position: relative;
}

.prod-form-page .prod-image-search-wrapper {
  position: static !important;
}

.prod-form-page .prod-search-icon-inside {
  top: 50% !important;
  right: 12px !important;
  width: 20px;
  height: 20px;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
  justify-content: center;
  transform: translateY(-50%) !important;
}

/* Novo onboarding multi-loja: nomes, imagens e organização do hub.
   Era um carrossel de 680px com setas: os cards das pontas ficavam cortados e
   loja nova podia nascer escondida atrás de uma seta. Virou GRADE — no desktop
   ela usa a faixa larga e os cards ficam maiores; no celular vira lista de uma
   coluna, com a imagem ao lado do campo de nome, que é o que se digita aqui. */
.stores-board {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: planCardIn .6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* O passo das lojas é o único do onboarding que pode ficar mais alto que a
   tela (20 lojas, ou o celular em coluna). `.personalize-page` centraliza com
   overflow:hidden, o que CORTA o excesso em vez de rolar; aqui ele rola, e o
   `margin:auto` do filho mantém a centralização enquanto couber. */
.personalize-page.stores-page {
  /* Altura fixa (e não só min-height) para a própria página virar o container
     de rolagem: é o que mantém as bolhas de fundo recortadas e faz o botão
     "Concluir" grudar no rodapé no celular. */
  height: var(--app-height);
  overflow-x: hidden;
  overflow-y: auto;
  align-items: flex-start;
  /* Espaço para o "Voltar", que fica absoluto no topo: com a página rolando a
     partir do topo, sem isto o título nasce embaixo dele. */
  padding: 76px 24px 44px;
}

.personalize-page.stores-page .personalize-content { margin: auto; }

.personalize-content.personalize-wide { max-width: min(1160px, 100%); }

.stores-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding: 2px 4px 8px;
}

.stores-toolbar .stores-magic {
  margin-left: auto;
}

.stores-progress {
  color: var(--muted);
  font: 600 13.5px var(--apple-font);
}

.stores-progress b {
  color: var(--ink);
}

.stores-magic {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: 600 13px var(--apple-font);
  cursor: pointer;
  transition: border-color .18s ease, opacity .18s ease;
}

.stores-magic:hover {
  border-color: var(--ink);
}

.stores-magic:disabled {
  opacity: .55;
  cursor: default;
}

.stores-magic .icon {
  display: inline-flex;
}

.stores-magic .icon svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* Colunas entre 200px e 260px, sempre centradas: uma loja só não vira um card
   de 1000px de largura, e vinte lojas quebram em linhas em vez de sumirem na
   rolagem lateral. Com a faixa de 1160px cabem quatro por linha — o caso mais
   comum aqui (as lojas que já existem mais a comprada) fica em uma linha só. */
.stores-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 260px));
  justify-content: center;
  gap: 16px;
  padding: 4px 0 2px;
}

.stores-list .store-row {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 214px;
  padding: 32px 16px 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  animation: planCardIn .5s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.stores-list .store-row:focus-within {
  border-color: var(--ink);
  box-shadow: 0 12px 30px var(--shadow);
  transform: translateY(-2px);
}

.stores-list .store-row.row-done {
  border-color: rgba(19, 160, 101, 0.45);
}

.store-avatar {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: 22px;
  background: var(--card-soft);
  cursor: pointer;
  transition: border-color .18s ease, transform .12s ease, opacity .18s ease;
}

.store-avatar:hover {
  border-color: var(--ink);
  transform: scale(1.05);
}

.store-avatar:disabled {
  opacity: .65;
  cursor: default;
  transform: none;
}

.store-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-avatar .icon svg {
  width: 28px;
  height: 28px;
  fill: var(--muted);
}

.store-avatar .store-avatar-edit {
  position: absolute;
  inset: auto 0 0;
  height: 18px;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font: 700 8.5px/18px var(--apple-font);
  text-align: center;
  letter-spacing: .05em;
  opacity: 0;
  transition: opacity .15s ease;
}

.store-avatar:hover .store-avatar-edit {
  opacity: 1;
}

@media (hover: none) {
  .store-avatar:not(:disabled) .store-avatar-edit { opacity: 1; }
}

.store-row .store-num {
  position: absolute;
  top: 12px;
  left: 14px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--card-soft);
  color: var(--muted);
  font: 700 11.5px var(--apple-font);
}

.store-row input {
  width: 100%;
  padding: 6px 2px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 600 15.5px var(--apple-font);
  text-align: center;
}

.store-row input::placeholder {
  color: rgba(110, 110, 115, .55);
  font-weight: 500;
}

.store-row .store-check {
  position: absolute;
  top: 12px;
  right: 14px;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .2s ease, transform .2s ease;
}

.store-row.row-done .store-check {
  opacity: 1;
  transform: scale(1);
}

.store-row .store-check svg {
  width: 20px;
  height: 20px;
  fill: var(--green);
}

/* Loja já existente (upgrade do teste): travada e marcada como "já feita". */
.stores-list .store-row.store-locked {
  border-color: rgba(19, 160, 101, 0.42);
  background: rgba(19, 160, 101, 0.05);
  padding-bottom: 36px;
}
.stores-list .store-row.store-locked input {
  color: var(--muted);
  cursor: default;
}
.stores-list .store-row.store-locked .store-avatar {
  cursor: default;
  opacity: 0.9;
}
.store-locked-badge {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font: 700 9px var(--apple-font);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--green, #13a065);
  background: rgba(19, 160, 101, 0.12);
  border: 1px solid rgba(19, 160, 101, 0.30);
  padding: 4px 10px;
  border-radius: 999px;
}

.stores-list .store-row.store-new {
  border-color: rgba(0, 122, 255, 0.38);
  background: rgba(0, 122, 255, 0.045);
  padding-bottom: 36px;
}

.store-locked-badge.store-new-badge {
  color: #007aff;
  background: rgba(0, 122, 255, 0.10);
  border-color: rgba(0, 122, 255, 0.28);
}

.stores-hint {
  padding-top: 4px;
  color: var(--muted);
  font: 500 13px var(--apple-font);
  text-align: center;
}

.stores-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
}

/* Numa faixa de 1080px o botão inteiro atravessando a tela fica desproporcional
   — ele mantém a largura de um botão e fica centrado. */
.stores-actions .personalize-done {
  width: min(420px, 100%);
  margin-inline: auto;
}

/* Celular e telas estreitas: a grade vira lista de uma coluna e cada loja vira
   uma linha — imagem à esquerda, campo de nome ocupando o resto. O campo é o
   maior alvo da linha porque digitar o nome é o que se faz aqui. */
@media (max-width: 720px) {
  .personalize-page.stores-page {
    padding: 62px 16px 18px;
  }

  .stores-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .stores-list .store-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "avatar input check"
      "avatar badge check";
    align-items: center;
    gap: 2px 14px;
    min-height: 0;
    padding: 12px 14px;
    border-radius: 18px;
    text-align: left;
  }

  .stores-list .store-row.store-locked,
  .stores-list .store-row.store-new {
    padding-bottom: 12px;
  }

  .stores-list .store-row .store-num {
    display: none;
  }

  .stores-list .store-row .store-avatar {
    grid-area: avatar;
    width: 58px;
    height: 58px;
    border-radius: 16px;
  }

  .stores-list .store-row .store-avatar .icon svg {
    width: 22px;
    height: 22px;
  }

  .stores-list .store-row .store-avatar .store-avatar-edit {
    height: 15px;
    font: 700 7.5px/15px var(--apple-font);
    letter-spacing: .04em;
  }

  /* 16px é o mínimo que evita o zoom automático do iOS ao focar o campo. */
  .stores-list .store-row input {
    grid-area: input;
    padding: 0;
    font-size: 16px;
    text-align: left;
  }

  .stores-list .store-row .store-check {
    position: static;
    grid-area: check;
    display: grid;
    place-items: center;
    width: 22px;
  }

  .stores-list .store-row .store-locked-badge {
    position: static;
    grid-area: badge;
    justify-self: start;
    transform: none;
  }

  /* Com quatro ou mais lojas o botão sai da tela: ele acompanha a rolagem
     colado no rodapé, sem esconder a linha que está sendo preenchida. */
  .stores-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-inline: -6px;
    padding: 10px 6px calc(8px + env(safe-area-inset-bottom));
    border-radius: 18px;
    background: color-mix(in srgb, var(--card) 76%, transparent);
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
  }

  .stores-actions .personalize-done {
    width: 100%;
    margin-top: 6px;
  }
}

/* Passo "o que o seu sistema vai usar": camada por cima do quadro de lojas
   (voltar só remove a camada, o que já foi digitado continua lá embaixo). */
.personalize-page.onboard-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  height: 100%;
  animation: personalizeIn 420ms cubic-bezier(0.33, 1, 0.68, 1) both;
}

/* Três cards de 320px + os vãos: sem isto a barra de cima (contador e "Ligar
   todas") ficava mais larga que a grade e as pontas não batiam. */
.personalize-content.tabs-content { max-width: min(1004px, 100%); }

.tabs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 320px));
  justify-content: center;
  gap: 12px;
  padding: 4px 0 2px;
}

.tab-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  text-align: left;
  cursor: pointer;
  animation: planCardIn .45s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
}

.tab-card:hover { border-color: var(--ink); }
.tab-card:active { transform: scale(0.99); }
.tab-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.tab-card-ic {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(0, 122, 255, 0.10);
  color: #007aff;
}

.tab-card-ic .icon svg { width: 20px; height: 20px; fill: currentColor; }

.tab-card-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tab-card-title { color: var(--ink); font: 700 14.5px var(--apple-font); }
.tab-card-sub { color: var(--muted); font: 500 12px var(--apple-font); line-height: 1.35; }

.tab-card-switch {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: var(--blue, #0071e3);
  transition: background .18s ease;
}

.tab-card-switch > span {
  position: absolute;
  top: 3px;
  left: 19px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: left .18s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Desligada: o card inteiro esmaece, para a leitura ser "o que está ligado". */
.tab-card.off { background: var(--card-soft); }
.tab-card.off .tab-card-ic { background: rgba(110, 110, 115, .12); color: var(--muted); }
.tab-card.off .tab-card-title { color: var(--muted); }
.tab-card.off .tab-card-switch { background: rgba(110, 110, 115, .35); }
.tab-card.off .tab-card-switch > span { left: 3px; }
/* Página que a criação nunca desliga (SYSTEM_TABS_ALWAYS_ON): selo no lugar
   do interruptor e nenhum retorno de clique. */
.tab-card.is-locked { cursor: default; }
.tab-card.is-locked:hover { border-color: var(--line); }
.tab-card.is-locked:active { transform: none; }
.tab-card-lock {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.10);
  color: #007aff;
  font: 700 11px var(--apple-font);
}
.tab-card-lock .icon { width: 12px; height: 12px; }

@media (max-width: 720px) {
  .tabs-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .tab-card {
    padding: 12px 14px;
    border-radius: 16px;
  }
}

/* Resgate da compra paga que nunca virou sistema ("já paguei e não recebi").
   Vive na tela de login, antes de existir conta, então usa o pop-up do
   onboarding (.proto-modal) e os campos da própria tela de login. */
.login-claim-link {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.login-claim-link:hover { color: var(--ink); }

.claim-fields {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
}

.claim-fields .big-btn { margin-top: 16px; }

.claim-feedback {
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid rgba(229, 72, 77, .28);
  border-radius: 13px;
  background: rgba(229, 72, 77, .09);
  color: #c0392b;
  font: 600 13px/1.45 var(--apple-font);
}

html[data-theme="dark"] .claim-feedback { color: #ff9c90; }

.claim-feedback.claim-feedback-ok {
  border-color: rgba(19, 160, 101, .30);
  background: rgba(19, 160, 101, .10);
  color: var(--green, #13a065);
}

/* Comprovante do fim do onboarding. É a única coisa que o cliente leva da
   compra — não há e-mail transacional no projeto —, então ele precisa salvar
   ou mandar para si mesmo daqui. O @media print no fim recorta só a folha. */
.receipt-sheet {
  width: 100%;
  margin-top: 4px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 18px 40px var(--shadow);
  text-align: left;
  animation: planCardIn .5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.receipt-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}

.receipt-head img { width: 38px; height: 38px; border-radius: 11px; object-fit: cover; }
.receipt-head div { display: flex; flex-direction: column; }
.receipt-head b { color: var(--ink); font: 700 15px var(--apple-font); }
.receipt-head span { color: var(--muted); font: 500 12px var(--apple-font); }

.receipt-rows { display: flex; flex-direction: column; padding: 6px 0 2px; }

.receipt-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.receipt-row:last-child { border-bottom: 0; }
.receipt-label { flex: none; color: var(--muted); font: 600 12.5px var(--apple-font); }
.receipt-value { color: var(--ink); font: 700 13.5px var(--apple-font); text-align: right; overflow-wrap: anywhere; }
.receipt-note { margin: 12px 0 0; color: var(--muted); font: 500 11.5px/1.5 var(--apple-font); }

.receipt-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 20px;
}

.receipt-actions .big-btn { width: min(420px, 100%); margin: 0 auto; }
.receipt-secondary { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.receipt-secondary .stores-magic { padding: 10px 16px; }

@media print {
  body * { visibility: hidden !important; }
  .receipt-sheet, .receipt-sheet * { visibility: visible !important; }
  .receipt-sheet {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    border: 0;
    box-shadow: none;
    animation: none;
  }
  .orb { display: none !important; }
}

.proto-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 998;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: protoFadeIn .25s ease both;
}

@keyframes protoFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.proto-modal {
  width: min(480px, 100%);
  padding: 26px 24px 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .35);
  font-family: var(--apple-font);
  animation: planCardIn .45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.proto-modal-title {
  color: var(--ink);
  font: 700 21px/1.2 var(--apple-font);
  letter-spacing: -.02em;
}

.proto-modal-sub {
  margin-top: 8px;
  color: var(--muted);
  font: 500 13.5px/1.5 var(--apple-font);
}

.proto-modal-sub b {
  color: var(--ink);
}

.stores-leave-note {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(217, 140, 30, .28);
  border-radius: 15px;
  background: rgba(245, 166, 35, .1);
  color: var(--ink);
}

.stores-leave-note p {
  margin: 0;
  font: 500 13.5px/1.5 var(--apple-font);
}

.stores-leave-note-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(245, 166, 35, .16);
  color: #b86b08;
}

.stores-leave-note-icon svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.stores-leave-ack {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card-soft);
  color: var(--ink);
  font: 600 13px/1.4 var(--apple-font);
  cursor: pointer;
}

.stores-leave-ack input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--ink);
}

.stores-leave-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.stores-leave-actions button {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  font: 700 13px var(--apple-font);
  cursor: pointer;
}

.stores-leave-stay {
  background: var(--card-soft);
  color: var(--ink);
}

.stores-leave-confirm {
  background: var(--ink);
  color: var(--card);
}

.stores-leave-confirm:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.proto-modal-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.proto-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card-soft);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease;
}

.proto-option:hover,
.proto-option:focus-visible {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.proto-option .proto-option-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.proto-option .proto-option-icon svg {
  width: 20px;
  height: 20px;
  fill: var(--ink);
}

.proto-option .proto-option-text strong {
  display: block;
  color: var(--ink);
  font: 650 14.5px var(--apple-font);
}

.proto-option .proto-option-text span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font: 500 12.5px/1.45 var(--apple-font);
}

.proto-modal-cancel {
  display: block;
  margin: 14px auto 0;
  padding: 6px 10px;
  border: 0;
  background: none;
  color: var(--muted);
  font: 600 13px var(--apple-font);
  cursor: pointer;
}

.proto-modal-cancel:hover {
  color: var(--ink);
}

@media (max-width: 640px) {
  .stores-toolbar {
    align-items: center;
    padding-inline: 2px;
  }

  .stores-magic {
    padding-inline: 12px;
    white-space: nowrap;
  }

  .stores-hint {
    padding-inline: 10px;
    line-height: 1.45;
  }

  .proto-modal {
    padding: 22px 18px 17px;
    border-radius: 20px;
  }

  .stores-leave-actions {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------------------
   CRM local / envio de WhatsApp pelo sistema (config → CRM local)
   Usa as variáveis de tema, então acompanha claro e escuro sozinho.
--------------------------------------------------------------------------- */
.config-local-crm {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
  padding: 4px 2px 28px;
}

/* .icon svg é width:100% neste projeto, então o tamanho vem sempre do
   contexto — sem isto os ícones esticam e tomam a tela inteira. */
.config-local-crm .icon { width: 18px; height: 18px; }
.config-local-crm-hero-icon .icon { width: 21px; height: 21px; }
.config-local-crm-url-button .icon,
.config-local-crm-arrow .icon { width: 15px; height: 15px; }

.config-local-crm-hero,
.config-local-crm-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  padding: 18px;
}

.config-local-crm-hero-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.config-local-crm-hero-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--card-soft);
  color: var(--accent-blue);
}

.config-local-crm-hero-copy h2 {
  margin: 0;
  font: 700 17px/1.3 var(--apple-font);
  color: var(--ink);
}

.config-local-crm-hero-copy p,
.config-local-crm-hint {
  margin: 3px 0 0;
  font: 500 13px/1.5 var(--apple-font);
  color: var(--muted);
}

.config-local-crm-hint {
  margin-bottom: 12px;
}

.config-local-crm-panel h3 {
  margin: 0 0 12px;
  font: 700 14px/1.3 var(--apple-font);
  color: var(--ink);
}

.config-local-crm-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.config-local-crm-info-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--card-soft);
  color: var(--accent-blue);
}

.config-local-crm-info-copy {
  display: block;
  min-width: 0;
}

.config-local-crm-info-copy span {
  display: block;
  font: 500 11px/1.3 var(--apple-font);
  color: var(--muted);
}

.config-local-crm-info-copy b {
  display: block;
  font: 600 12.5px/1.35 var(--apple-font);
  color: var(--ink);
}

.config-local-crm-action {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--card-soft);
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}

.config-local-crm-action:hover {
  border-color: var(--accent-blue);
}

.config-local-crm-action:active {
  transform: scale(.99);
}

.config-local-crm-action:disabled {
  opacity: .55;
  cursor: default;
}

.config-local-crm-action.primary {
  background: var(--accent-blue);
  border-color: transparent;
  color: #fff;
}

.config-local-crm-action.primary .config-local-crm-action-copy span {
  color: rgba(255, 255, 255, .8);
}

.config-local-crm-action-copy {
  display: block;
  min-width: 0;
  flex: 1;
}

.config-local-crm-action-copy b {
  display: block;
  font: 600 13.5px/1.35 var(--apple-font);
}

.config-local-crm-action-copy span {
  display: block;
  margin-top: 1px;
  font: 500 12px/1.4 var(--apple-font);
  color: var(--muted);
}

.config-local-crm-arrow {
  flex: 0 0 auto;
  color: var(--muted);
}

.config-local-crm-manual {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.config-local-crm-urls {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.config-local-crm-url {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--card-soft);
}

.config-local-crm-url-copy {
  flex: 1;
  min-width: 0;
}

.config-local-crm-url-copy span {
  display: block;
  font: 500 11px/1.3 var(--apple-font);
  color: var(--muted);
}

.config-local-crm-url-copy code {
  display: block;
  font: 600 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.config-local-crm-url-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
}

.config-local-crm-url-button:hover {
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}

.config-local-crm-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.config-local-crm-step {
  display: flex;
  gap: 11px;
}

.config-local-crm-step-number {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: #fff;
  font: 700 12px var(--apple-font);
}

.config-local-crm-step-copy h4 {
  margin: 2px 0 0;
  font: 600 13.5px/1.3 var(--apple-font);
  color: var(--ink);
}

.config-local-crm-step-copy p {
  margin: 2px 0 0;
  font: 500 12.5px/1.45 var(--apple-font);
  color: var(--muted);
}

.config-local-crm-field {
  display: block;
  margin: 0 0 12px;
}

.config-local-crm-field span {
  display: block;
  margin-bottom: 5px;
  font: 600 12px/1.3 var(--apple-font);
  color: var(--muted);
}

.config-local-crm-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card-soft);
  color: var(--ink);
  font: 500 13.5px var(--apple-font);
}

.config-local-crm-field input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.config-local-crm-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--card-soft);
  font: 600 12.5px/1.4 var(--apple-font);
  color: var(--ink);
}

.config-local-crm-status::before {
  content: '';
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.config-local-crm-status[data-tone="online"]::before { background: #13a065; }
.config-local-crm-status[data-tone="warn"]::before { background: #e8a33d; }
.config-local-crm-status[data-tone="offline"]::before { background: #d9534f; }
.config-local-crm-status[data-tone="checking"]::before { background: var(--accent-blue); }

/* ---------------------------------------------------------------------------
   CRM local do RDX Gestao
--------------------------------------------------------------------------- */
.config-fin-crm {
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 4px 2px 40px;
}

#config-local-crm-wrapper { width: 100%; }

.config-fin-crm-hero {
  min-height: 154px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(circle at 88% 12%, rgba(0, 113, 227, .16), transparent 31%),
    linear-gradient(135deg, #fff 0%, #f2f7fd 100%);
  box-shadow: 0 22px 42px rgba(0, 0, 0, .075);
}

.config-fin-crm-hero::after {
  content: '';
  position: absolute;
  right: -82px;
  bottom: -118px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(0, 113, 227, .16);
  border-radius: 50%;
}

.config-fin-crm-hero-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.config-fin-crm-hero-icon {
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: #1d1d20;
  color: #fff;
  box-shadow: 0 16px 30px rgba(29, 29, 31, .18);
}

.config-fin-crm-hero-icon .icon,
.config-fin-crm-hero-icon svg {
  width: 30px;
  height: 30px;
}

.config-fin-crm-eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--accent-blue);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.config-fin-crm-hero h2 {
  margin: 0;
  color: #1d1d1f;
  font-size: 24px;
  line-height: 1.08;
  font-weight: 600;
}

.config-fin-crm-hero p {
  max-width: 590px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
}

.config-fin-crm-status {
  min-width: 210px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  z-index: 1;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
  text-align: center;
}

.config-fin-crm-status i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #a4a7ae;
}

.config-fin-crm-status.checking i { animation: configFinCrmPulse 1.1s ease-in-out infinite; }
.config-fin-crm-status.online { color: var(--accent-blue); border-color: rgba(0, 113, 227, .24); }
.config-fin-crm-status.online i { background: var(--accent-blue); box-shadow: 0 0 0 5px rgba(0, 113, 227, .11); }
.config-fin-crm-status.ready { color: #b7791f; border-color: rgba(229, 132, 61, .28); }
.config-fin-crm-status.ready i { background: #e5843d; }
.config-fin-crm-status.offline i { background: #a4a7ae; }

@keyframes configFinCrmPulse {
  50% { opacity: .32; transform: scale(.76); }
}

.config-fin-crm-route {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(24px, 80px) minmax(110px, 1fr) minmax(24px, 80px) minmax(110px, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 10px;
}

.config-fin-crm-route span {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .82);
  color: var(--ink);
  font-size: 12px;
}

.config-fin-crm-route span b {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #1d1d20;
  color: #fff;
  font-size: 10px;
}

.config-fin-crm-route > i {
  height: 1px;
  background: linear-gradient(90deg, rgba(29, 29, 31, .12), rgba(0, 113, 227, .48));
}

.config-fin-crm-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--card);
  box-shadow: 0 22px 42px rgba(0, 0, 0, .075);
}

.config-fin-crm-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.config-fin-crm-section-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 12px;
  background: var(--card-soft);
  color: var(--ink);
}

.config-fin-crm-section-icon .icon,
.config-fin-crm-section-icon svg {
  width: 17px;
  height: 17px;
}

.config-fin-crm-section-title h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  font-weight: 500;
}

.config-fin-crm-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.48;
}

.config-fin-crm-note > .icon,
.config-fin-crm-note svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin-top: 1px;
}

.config-fin-crm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.config-fin-crm-field > span {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.config-fin-crm-input-wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  position: relative;
}

.config-fin-crm-input-wrapper input {
  width: 100%;
  min-height: 44px;
  padding: 10px 46px 10px 13px;
  border: 1px solid transparent;
  border-radius: 13px;
  outline: none;
  background: var(--field);
  color: var(--ink);
  font: 500 14px var(--apple-font);
}

.config-fin-crm-input-wrapper input:focus { border-color: var(--accent-blue); }

.config-fin-crm-token-toggle {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.config-fin-crm-token-toggle:hover { background: rgba(0, 0, 0, .06); color: var(--ink); }
.config-fin-crm-token-toggle .icon,
.config-fin-crm-token-toggle svg { width: 18px; height: 18px; }

.config-fin-crm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.config-fin-crm-actions.bottom { margin-top: 0; }

.config-fin-crm-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 13px;
  font: 500 13.5px var(--apple-font);
  cursor: pointer;
  transition: filter .15s ease, background .15s ease, transform .15s ease;
  text-decoration: none;
}

.config-fin-crm-btn .icon,
.config-fin-crm-btn svg { width: 17px; height: 17px; }
.config-fin-crm-btn.primary { background: #1d1d20; color: #fff; }
.config-fin-crm-btn.primary:hover { filter: brightness(.92); transform: translateY(-1px); }
.config-fin-crm-btn.ghost { border-color: var(--line); background: transparent; color: var(--ink); }
.config-fin-crm-btn.ghost:hover { background: var(--card-soft); }
.config-fin-crm-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.config-fin-crm-qr-box:empty { display: none; }
.config-fin-crm-qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card-soft);
  text-align: center;
}

.config-fin-crm-qr-img {
  width: min(260px, 100%);
  height: auto;
  padding: 10px;
  border-radius: 16px;
  background: #fff;
}

.config-fin-crm-qr-msg {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.config-fin-crm-qr-msg.ok { color: var(--accent-blue); font-weight: 600; }

html[data-theme="dark"] .config-fin-crm-hero {
  border-color: var(--line);
  background: #15171c;
  box-shadow: 0 22px 42px rgba(0, 0, 0, .40);
}

html[data-theme="dark"] .config-fin-crm-hero-icon { background: #f5f5f7; color: #15171c; }
html[data-theme="dark"] .config-fin-crm-hero h2 { color: var(--ink); }
html[data-theme="dark"] .config-fin-crm-status,
html[data-theme="dark"] .config-fin-crm-route span { background: #24272e; border-color: #343740; }
html[data-theme="dark"] .config-fin-crm-route span b { background: #f5f5f7; color: #15171c; }
html[data-theme="dark"] .config-fin-crm-card { box-shadow: 0 22px 42px rgba(0, 0, 0, .40); }
html[data-theme="dark"] .config-fin-crm-btn.primary { background: #f5f5f7; color: #15171c; }
html[data-theme="dark"] .config-fin-crm-token-toggle:hover { background: rgba(255, 255, 255, .08); }

@media (max-width: 940px) {
  .config-fin-crm-hero { align-items: flex-start; flex-direction: column; }
  .config-fin-crm-status { width: 100%; }
  .config-fin-crm-route { grid-template-columns: 1fr; padding: 0; }
  .config-fin-crm-route > i {
    width: 1px;
    height: 16px;
    justify-self: center;
    background: linear-gradient(rgba(29, 29, 31, .12), rgba(0, 113, 227, .48));
  }
}

@media (max-width: 600px) {
  .config-fin-crm-hero { padding: 19px; border-radius: 24px; }
  .config-fin-crm-hero-copy { align-items: flex-start; }
  .config-fin-crm-hero-icon { width: 48px; height: 48px; flex-basis: 48px; border-radius: 16px; }
  .config-fin-crm-hero-icon .icon,
  .config-fin-crm-hero-icon svg { width: 23px; height: 23px; }
  .config-fin-crm-hero h2 { font-size: 20px; }
  .config-fin-crm-card { padding: 16px; border-radius: 24px; }
  .config-fin-crm-section-title h2 { font-size: 19px; }
  .config-fin-crm-actions .config-fin-crm-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .config-fin-crm-status.checking i { animation: none; }
}

/* ---------------------------------------------------------------------------
   Histórico do cliente (análise rápida do vendedor, aba Crediário)
--------------------------------------------------------------------------- */
.sim-cpf-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fin-history-btn { white-space: nowrap; }

.client-hist-dialog { max-width: 560px; width: min(560px, calc(100vw - 32px)); }
.client-hist { display: flex; flex-direction: column; gap: 14px; }

.client-hist-loading,
.client-hist-empty {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 28px 16px; color: var(--muted); font: 600 13.5px var(--apple-font);
}
.client-hist-loading .icon svg { width: 18px; height: 18px; fill: var(--muted); }

.client-hist-verdict {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line);
}
.client-hist-verdict-icon {
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: 12px;
  margin: 0; line-height: 0;
}
.client-hist-verdict-icon > .icon { display: block; width: 22px; height: 22px; margin: 0; line-height: 0; }
.client-hist-verdict-icon > .icon svg { width: 100%; height: 100%; fill: currentColor; display: block; }
.client-hist-verdict > div > strong { display: block; font: 700 15px var(--apple-font); color: var(--ink); }
.client-hist-verdict > div > span { display: block; margin-top: 2px; font: 500 12.5px/1.45 var(--apple-font); color: var(--muted); }
.client-hist-verdict.emdia { background: rgba(19,160,101,.10); border-color: rgba(19,160,101,.35); }
.client-hist-verdict.emdia .client-hist-verdict-icon { background: rgba(19,160,101,.16); color: #13a065; }
.client-hist-verdict.aberta { background: rgba(232,163,61,.12); border-color: rgba(232,163,61,.38); }
.client-hist-verdict.aberta .client-hist-verdict-icon { background: rgba(232,163,61,.18); color: #b7791f; }
.client-hist-verdict.atraso { background: rgba(229,72,77,.10); border-color: rgba(229,72,77,.36); }
.client-hist-verdict.atraso .client-hist-verdict-icon { background: rgba(229,72,77,.16); color: #e5484d; }
.client-hist-verdict.novo { background: var(--card-soft); }
.client-hist-verdict.novo .client-hist-verdict-icon { background: rgba(0,0,0,.06); color: var(--muted); }

.client-hist-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.client-hist-tile {
  padding: 11px 12px; border-radius: 12px; background: var(--card-soft); border: 1px solid var(--line);
}
.client-hist-tile span { display: block; font: 600 11px var(--apple-font); color: var(--muted); }
.client-hist-tile strong { display: block; margin-top: 3px; font: 700 15px var(--apple-font); color: var(--ink); }
.client-hist-tile.warn strong { color: #b7791f; }
.client-hist-tile.bad strong { color: #e5484d; }
.client-hist-tile.good strong { color: #13a065; }

.client-hist-note { display: flex; align-items: center; gap: 7px; margin: 0; font: 500 12.5px var(--apple-font); color: var(--muted); }
.client-hist-note .icon svg { width: 14px; height: 14px; fill: currentColor; }

.client-hist-list { display: flex; flex-direction: column; gap: 8px; }
.client-hist-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 11px; background: var(--card-soft); border: 1px solid var(--line);
}
.client-hist-row-main { flex: 1 1 auto; min-width: 0; }
.client-hist-row-main strong { display: block; font: 600 13px var(--apple-font); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-hist-row-main span { display: block; margin-top: 1px; font: 500 11.5px var(--apple-font); color: var(--muted); }
.client-hist-row-value { flex: 0 0 auto; font: 700 13px var(--apple-font); color: var(--ink); }
.client-hist-badge { flex: 0 0 auto; padding: 3px 9px; border-radius: 999px; font: 700 11px var(--apple-font); }
.client-hist-badge.quitada { background: rgba(19,160,101,.14); color: #13a065; }
.client-hist-badge.aberta { background: rgba(232,163,61,.16); color: #b7791f; }
.client-hist-badge.atraso { background: rgba(229,72,77,.14); color: #e5484d; }

@media (max-width: 520px) {
  .client-hist-tiles { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------------------------------------------------------------------
   Nova/Editar Compra em página — mesma moldura de Produtos > Novo
--------------------------------------------------------------------------- */
.prod-purchase-form-page {
  width: 100%;
  gap: 18px;
  overflow: hidden;
}

.prod-purchase-form-page .pu-page-heading {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding-bottom: 4px;
}

.prod-purchase-form-page h4 {
  color: #111113;
  font-weight: 500 !important;
}

.prod-purchase-form-page .pu-field-wrap {
  min-height: 50px;
  justify-content: center;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(29, 29, 31, 0.06);
  background: #f5f5f7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70);
}

.prod-purchase-form-page .pu-field-wrap .pu-label {
  margin: 0;
  color: #5e5e62;
  font-size: 11px;
  line-height: 1.05;
  font-weight: 300;
}

.prod-purchase-form-page .pu-field-wrap > .prod-input {
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #111113 !important;
  font-size: 14px !important;
  line-height: 1.12 !important;
  font-weight: 300 !important;
}

.prod-purchase-form-page .pu-card {
  border-color: rgba(29, 29, 31, 0.06);
  background: #f5f5f7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70);
}

.prod-purchase-form-page .pu-products-card,
.prod-purchase-form-page .pu-payments-card {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(29, 29, 31, 0.18) transparent;
}

.prod-purchase-form-page .pu-products-table {
  min-width: 1180px;
}

.prod-purchase-form-page .pu-payments-table {
  min-width: 560px;
}

.prod-purchase-form-page .pu-table-head,
.prod-purchase-form-page #pu-lines-empty,
.prod-purchase-form-page #pu-payments-empty {
  color: #6e6e73 !important;
  font-weight: 300;
}

.prod-purchase-form-page .pu-card .prod-input {
  border: 1px solid rgba(29, 29, 31, 0.08) !important;
  background: #ffffff !important;
  color: #111113 !important;
  box-shadow: none !important;
  font-weight: 300 !important;
}

.prod-purchase-form-page .pu-card .prod-input::placeholder {
  color: #8f8f93 !important;
}

.prod-purchase-form-page .pu-card .prod-icon-btn {
  border-color: rgba(29, 29, 31, 0.08) !important;
  background: #ffffff !important;
}

.prod-purchase-form-page .pu-card [data-remove-line],
.prod-purchase-form-page .pu-card [data-remove-payment] {
  color: #d9413a !important;
}

.prod-purchase-form-page .pl-total,
.prod-purchase-form-page .pu-totals-wrap b,
.prod-purchase-form-page .pu-total-final span,
.prod-purchase-form-page .pu-total-final b {
  color: #111113 !important;
}

.prod-purchase-form-page .pu-totals-wrap {
  align-self: stretch;
  justify-content: center;
  min-height: 100%;
  margin-left: 0;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(29, 29, 31, 0.06);
  background: #f5f5f7;
  color: #6e6e73;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70);
}

.prod-purchase-form-page .pu-total-final {
  border-top-color: rgba(29, 29, 31, 0.09) !important;
}

.prod-purchase-form-page .pu-import-xml,
.prod-purchase-form-page #pu-add-line,
.prod-purchase-form-page #pu-add-payment {
  min-height: 42px !important;
  height: 42px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(29, 29, 31, 0.06) !important;
  background: #f5f5f7 !important;
  color: #111113 !important;
  box-shadow: none !important;
  cursor: pointer;
}

.prod-purchase-form-page .pu-page-actions {
  margin-top: 2px;
}

.prod-purchase-form-page .pu-page-save-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.prod-purchase-form-page .pu-page-save-group .notas-page-save {
  width: auto;
  gap: 7px;
  padding: 0 18px;
}

.prod-purchase-form-page .pu-page-draft {
  border: 1px solid rgba(29, 29, 31, 0.08);
  background: transparent;
}

.prod-purchase-form-page .pu-page-save {
  background: #f5f5f7;
}

.prod-purchase-form-page .pu-page-save-group .prod-btn-chip,
.prod-purchase-form-page .pu-import-xml .prod-btn-chip,
.prod-purchase-form-page #pu-add-line .prod-btn-chip,
.prod-purchase-form-page #pu-add-payment .prod-btn-chip {
  width: 16px !important;
  height: 16px !important;
  flex: 0 0 16px !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
}

.prod-purchase-form-page .pu-page-save-group .icon,
.prod-purchase-form-page .pu-import-xml .icon,
.prod-purchase-form-page #pu-add-line .icon,
.prod-purchase-form-page #pu-add-payment .icon {
  width: 16px !important;
  height: 16px !important;
}

html[data-theme="dark"] .prod-purchase-form-page h4,
html[data-theme="dark"] .prod-purchase-form-page .pl-total,
html[data-theme="dark"] .prod-purchase-form-page .pu-totals-wrap b,
html[data-theme="dark"] .prod-purchase-form-page .pu-total-final span,
html[data-theme="dark"] .prod-purchase-form-page .pu-total-final b {
  color: #f5f5f7 !important;
}

html[data-theme="dark"] .prod-purchase-form-page .pu-table-head,
html[data-theme="dark"] .prod-purchase-form-page .pu-totals-wrap,
html[data-theme="dark"] .prod-purchase-form-page #pu-lines-empty,
html[data-theme="dark"] .prod-purchase-form-page #pu-payments-empty {
  color: #a4a7ae !important;
}

html[data-theme="dark"] .prod-purchase-form-page .pu-field-wrap,
html[data-theme="dark"] .prod-purchase-form-page .pu-card,
html[data-theme="dark"] .prod-purchase-form-page .pu-totals-wrap,
html[data-theme="dark"] .prod-purchase-form-page .pu-import-xml,
html[data-theme="dark"] .prod-purchase-form-page #pu-add-line,
html[data-theme="dark"] .prod-purchase-form-page #pu-add-payment {
  border-color: rgba(255, 255, 255, 0.09) !important;
  background: #1c1e24 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
  color: #f5f5f7 !important;
}

html[data-theme="dark"] .prod-purchase-form-page .pu-field-wrap .pu-label {
  color: #a4a7ae !important;
}

html[data-theme="dark"] .prod-purchase-form-page .pu-field-wrap > .prod-input {
  color: #f5f5f7 !important;
  caret-color: #5ea8ff !important;
}

html[data-theme="dark"] .prod-purchase-form-page .pu-card .prod-input,
html[data-theme="dark"] .prod-purchase-form-page .pu-card .prod-icon-btn {
  border-color: rgba(255, 255, 255, 0.08) !important;
  background: #111318 !important;
  color: #f5f5f7 !important;
}

html[data-theme="dark"] .prod-purchase-form-page .pu-total-final {
  border-top-color: rgba(255, 255, 255, 0.10) !important;
}

html[data-theme="dark"] .prod-purchase-form-page .pu-page-draft,
html[data-theme="dark"] .prod-purchase-form-page .pu-page-save {
  border-color: rgba(255, 255, 255, 0.09);
  background: #1c1e24;
  color: #f5f5f7;
}

@media (max-width: 980px) {
  .prod-purchase-form-page .pu-info-grid,
  .prod-purchase-form-page .pu-payments-summary {
    grid-template-columns: 1fr !important;
  }

  .prod-purchase-form-page .pu-page-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .prod-purchase-form-page .pu-import-xml {
    width: 100%;
  }

  .prod-purchase-form-page .pu-page-save-group {
    width: 100%;
    flex-direction: column;
  }

  .prod-purchase-form-page .pu-page-save-group .notas-page-save {
    width: 100%;
  }
}

/* ---------- Pop-ups compactos — padrão exato do RDX Project Control ---------- */

.stats-modal-root.rdx-project-popover-root {
  z-index: 100002;
  display: block;
  padding: 0;
  pointer-events: none;
}

/* Cadastro rápido aberto sobre os seletores de categoria, marca e fornecedor. */
.stats-modal-root.catalog-entity-dialog-root,
.stats-modal-root.catalog-supplier-dialog-root {
  z-index: 100006;
}

.stats-modal-root.catalog-entity-dialog-root .stats-modal-backdrop,
.stats-modal-root.catalog-supplier-dialog-root .stats-modal-backdrop {
  display: block;
  pointer-events: auto;
  background: rgba(5, 7, 12, 0.42);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
}

.stats-modal-root.system-alert-root.rdx-project-popover-root {
  z-index: 100010;
}

.rdx-project-popover-root .stats-modal-backdrop {
  display: none;
}

.stats-modal-root.system-alert-root.rdx-project-popover-root .stats-modal-backdrop {
  z-index: 0;
  display: block;
  pointer-events: auto;
  background: rgba(5, 7, 12, 0.42);
  -webkit-backdrop-filter: blur(14px) saturate(115%);
  backdrop-filter: blur(14px) saturate(115%);
}

.stats-modal-card.rdx-project-popover {
  position: fixed;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: min(272px, calc(100vw - 26px));
  max-height: calc(100dvh - 26px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(29, 29, 31, 0.09);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
  color: #1d1d1f;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  animation: rdxProjectPopoverCenteredIn 180ms ease-out both;
}

.stats-modal-card.rdx-project-popover.stats-filter-dialog {
  width: min(288px, calc(100vw - 26px));
}

.stats-modal-card.rdx-project-popover.system-alert-dialog {
  width: min(420px, calc(100vw - 32px));
  border-radius: 20px;
}

.stats-modal-card.rdx-project-popover.is-trigger-anchored {
  top: var(--rdx-popover-top);
  left: var(--rdx-popover-left);
  transform: none;
  animation-name: rdxProjectPopoverIn;
}

/* Alertas do sistema preservam o card do tema novo, mas continuam modais e
   centralizados como no comportamento anterior. */
.stats-modal-card.rdx-project-popover.system-alert-dialog.is-trigger-anchored {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-name: rdxProjectPopoverCenteredIn;
}

@keyframes rdxProjectPopoverIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes rdxProjectPopoverCenteredIn {
  from { opacity: 0; transform: translate(-50%, calc(-50% - 4px)) scale(0.98); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

.rdx-project-popover .stats-modal-head,
.rdx-project-popover.stats-period-dialog .stats-modal-head,
.rdx-project-popover.stats-filter-dialog .stats-modal-head,
.rdx-project-popover.stats-option-dialog .stats-modal-head {
  min-height: 45px;
  margin: 0;
  padding: 0 10px 0 14px;
  gap: 10px;
  border-bottom: 1px solid rgba(29, 29, 31, 0.09);
}

.rdx-project-popover .stats-modal-head h3,
.rdx-project-popover.stats-period-dialog .stats-modal-head h3,
.rdx-project-popover.stats-filter-dialog .stats-modal-head h3,
.rdx-project-popover.stats-option-dialog .stats-modal-head h3 {
  color: #1d1d1f;
  font-family: var(--apple-font);
  font-size: 10.4px;
  font-weight: 500;
  line-height: 1.2;
}

.rdx-project-popover .stats-modal-close,
.rdx-project-popover.stats-period-dialog .stats-modal-close,
.rdx-project-popover.stats-filter-dialog .stats-modal-close,
.rdx-project-popover.stats-option-dialog .stats-modal-close {
  width: 20px;
  height: 20px;
  display: inline-flex !important;
  flex: 0 0 20px;
  border: 1px solid rgba(29, 29, 31, 0.07);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.76);
  color: #0071e3;
  transition: transform 120ms ease, background 160ms ease;
}

.rdx-project-popover .stats-modal-close:hover {
  background: #ffffff;
}

.rdx-project-popover .stats-modal-close:active {
  transform: scale(0.94);
}

.rdx-project-popover .stats-modal-close .icon {
  width: 12px;
  height: 12px;
}

.rdx-project-popover .stats-modal-body,
.rdx-project-popover.stats-period-dialog .stats-modal-body,
.rdx-project-popover.stats-filter-dialog .stats-modal-body,
.rdx-project-popover.stats-option-dialog .stats-modal-body {
  min-height: 0;
  max-height: calc(100dvh - 92px);
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.rdx-project-popover .system-alert-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 3px 2px;
}

.rdx-project-popover .system-alert-message-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  border: 1px solid rgba(0, 113, 227, 0.12);
  border-radius: 10px;
  background: rgba(0, 113, 227, 0.07);
  color: #0071e3;
}

.rdx-project-popover .system-alert-message-icon .icon {
  width: 16px;
  height: 16px;
}

.rdx-project-popover .system-alert-message p {
  min-width: 0;
  margin: 2px 0 0;
  color: #1d1d1f;
  font-family: var(--apple-font);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.42;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.stats-modal-card.rdx-project-popover.system-alert-dialog .stats-modal-head {
  min-height: 56px;
  padding: 0 14px 0 18px;
}

.stats-modal-card.rdx-project-popover.system-alert-dialog .stats-modal-head h3 {
  font-size: 13.5px;
}

.stats-modal-card.rdx-project-popover.system-alert-dialog .stats-modal-close {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
  border-radius: 8px;
}

.stats-modal-card.rdx-project-popover.system-alert-dialog .stats-modal-close .icon {
  width: 15px;
  height: 15px;
}

.stats-modal-card.rdx-project-popover.system-alert-dialog .stats-modal-body {
  padding: 14px;
}

.stats-modal-card.rdx-project-popover.system-alert-dialog .system-alert-message {
  gap: 14px;
  padding: 3px 2px;
}

.stats-modal-card.rdx-project-popover.system-alert-dialog .system-alert-message-icon {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  border-radius: 13px;
}

.stats-modal-card.rdx-project-popover.system-alert-dialog .system-alert-message-icon .icon {
  width: 20px;
  height: 20px;
}

.stats-modal-card.rdx-project-popover.system-alert-dialog .system-alert-message p {
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.45;
}

.stats-modal-card.rdx-project-popover.system-alert-dialog .stats-modal-foot {
  padding: 12px;
}

.stats-modal-card.rdx-project-popover.system-alert-dialog .stats-modal-primary {
  height: 46px;
  border-radius: 13px;
  font-size: 13.5px;
}

.rdx-project-popover .stats-period-choice-list,
.rdx-project-popover .stats-option-list {
  gap: 0;
}

.rdx-project-popover .stats-period-choice-list > .stats-period-choice {
  width: 100%;
  min-height: 56px;
  height: auto;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #1d1d1f;
  text-align: left;
  transition: background 160ms ease, transform 120ms ease;
}

.rdx-project-popover .stats-period-choice-list > .stats-period-choice:hover,
.rdx-project-popover .stats-period-choice-list > .stats-period-choice.selected,
.rdx-project-popover .stats-period-choice-list > .stats-period-choice.is-selected {
  background: #f5f5f7;
  border-color: transparent;
  color: #1d1d1f;
}

.rdx-project-popover .stats-period-choice-list > .stats-period-choice:active {
  transform: scale(0.985);
}

.rdx-project-popover-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  border: 1px solid rgba(29, 29, 31, 0.07);
  border-radius: 10px;
  background: #ffffff;
  color: #6e6e73;
  font-style: normal;
}

.rdx-project-popover-icon .icon {
  width: 15px;
  height: 15px;
}

.rdx-project-popover-copy {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.rdx-project-popover-copy strong {
  overflow: hidden;
  color: #1d1d1f;
  font-family: var(--apple-font);
  font-size: 9.6px;
  font-weight: 500;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rdx-project-popover-copy small {
  overflow: hidden;
  color: #6e6e73;
  font-family: var(--apple-font);
  font-size: 8px;
  font-weight: 300;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rdx-project-popover-check {
  width: 14px;
  height: 14px;
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 14px;
  color: #13a065;
}

.rdx-project-popover-check .icon {
  width: 12px;
  height: 12px;
}

.rdx-project-popover .stats-period-choice.selected .rdx-project-popover-check,
.rdx-project-popover .stats-period-choice.is-selected .rdx-project-popover-check {
  display: inline-flex;
}

.rdx-project-popover .stats-filter-field,
.rdx-project-popover .stats-option-tile,
.rdx-project-popover .stats-modal-field,
.rdx-project-popover .stats-modal-clear {
  border-color: rgba(29, 29, 31, 0.09);
  background: #f8f8fa;
  color: #1d1d1f;
}

.rdx-project-popover .stats-filter-field,
.rdx-project-popover .stats-option-tile {
  min-height: 44px;
  margin-top: 0;
  border-radius: 10px;
}

.stats-modal-card.rdx-project-popover.stats-filter-dialog .vendas-payment-field {
  margin-top: 6px;
}

.rdx-project-popover .stats-filter-field + .stats-filter-field,
.rdx-project-popover .stats-option-tile + .stats-option-tile {
  margin-top: 6px;
}

.rdx-project-popover .stats-filter-field:hover,
.rdx-project-popover .stats-option-tile:hover {
  background: #f5f5f7;
}

.rdx-project-popover .notas-filter-selects {
  grid-template-columns: 1fr;
  gap: 6px;
}

.rdx-project-popover .notas-filter-title {
  margin: 10px 2px 6px;
  color: #6e6e73;
  font-size: 10.4px;
  font-weight: 500;
}

.rdx-project-popover .notas-status-grid {
  gap: 6px;
}

.rdx-project-popover .notas-status-chip {
  min-height: 32px;
  padding: 0 9px;
  border-color: rgba(29, 29, 31, 0.09);
  border-radius: 10px;
  background: #f8f8fa;
  color: #1d1d1f;
  font-size: 9.6px;
  font-weight: 400;
}

.rdx-project-popover .notas-status-chip:hover {
  background: #f5f5f7;
}

.rdx-project-popover .notas-status-chip.selected {
  border-color: #1d1d1f;
  background: #1d1d1f;
  color: #ffffff;
}

.rdx-project-popover .cred-interest-choice.selected {
  background: #f5f5f7;
}

.rdx-project-popover .cred-interest-choice.selected .icon {
  color: #13a065;
}

.rdx-project-popover .stats-filter-field > span:not(.icon),
.rdx-project-popover .stats-option-tile > span:not(.icon) {
  color: #1d1d1f;
  font-size: 10.4px;
  font-weight: 400;
}

.rdx-project-popover .stats-filter-field.empty > span:not(.icon),
.rdx-project-popover .stats-modal-field span,
.rdx-project-popover .stats-modal-clear {
  color: #6e6e73;
}

.rdx-project-popover .stats-modal-field {
  min-height: 40px;
  margin-top: 6px;
  padding: 0 9px;
  border-radius: 10px;
}

/* Filtros com ícone mantêm uma única linha também no mobile. */
.rdx-project-popover.stats-filter-dialog .stats-modal-field:has(> .icon + input) {
  flex-direction: row;
  align-items: center;
}

.rdx-project-popover.stats-filter-dialog .stats-modal-field:has(> .icon + input) > .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.rdx-project-popover.stats-filter-dialog .stats-modal-field:has(> .icon + input) > input {
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  padding: 0;
}

.rdx-project-popover .stats-modal-field input,
.rdx-project-popover .stats-modal-field select,
.rdx-project-popover .stats-modal-field textarea {
  color: #1d1d1f;
  color-scheme: light;
  font-size: 10.4px;
}

.rdx-project-popover .stats-modal-foot,
.rdx-project-popover.stats-period-dialog .stats-modal-foot,
.rdx-project-popover.stats-filter-dialog .stats-modal-foot,
.rdx-project-popover.stats-option-dialog .stats-modal-foot {
  min-height: 0;
  margin: 0;
  padding: 8px;
  gap: 7px;
  border-top: 1px solid rgba(29, 29, 31, 0.09);
  background: #fafafd;
}

.rdx-project-popover .stats-modal-primary,
.rdx-project-popover .stats-modal-secondary,
.rdx-project-popover .stats-modal-danger,
.rdx-project-popover.stats-period-dialog .stats-modal-primary,
.rdx-project-popover.stats-filter-dialog .stats-modal-primary {
  width: 100%;
  height: 35px;
  border-radius: 10px;
  font-size: 9.6px;
  font-weight: 500;
}

.rdx-project-popover .stats-modal-primary,
.rdx-project-popover.stats-period-dialog .stats-modal-primary,
.rdx-project-popover.stats-filter-dialog .stats-modal-primary {
  border: 1px solid #1d1d1f;
  background: #1d1d1f;
  color: #ffffff;
}

.rdx-project-popover .stats-modal-danger {
  border: 1px solid rgba(255, 59, 48, 0.18);
  background: rgba(255, 59, 48, 0.06);
  color: #d70015;
}

.rdx-project-popover .stats-modal-primary .icon,
.rdx-project-popover .stats-modal-secondary .icon,
.rdx-project-popover .stats-modal-danger .icon {
  width: 13px;
  height: 13px;
}

html[data-theme="dark"] .stats-modal-card.rdx-project-popover {
  border-color: #343740;
  background: #15171c;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.32);
  color: #f5f5f7;
}

html[data-theme="dark"] .rdx-project-popover .stats-modal-head,
html[data-theme="dark"] .rdx-project-popover .stats-modal-foot {
  border-color: rgba(255, 255, 255, 0.10);
  background: #15171c;
}

html[data-theme="dark"] .rdx-project-popover .stats-modal-head h3,
html[data-theme="dark"] .rdx-project-popover .stats-period-choice-list > .stats-period-choice,
html[data-theme="dark"] .rdx-project-popover .rdx-project-popover-copy strong,
html[data-theme="dark"] .rdx-project-popover .stats-filter-field > span:not(.icon),
html[data-theme="dark"] .rdx-project-popover .stats-option-tile > span:not(.icon) {
  color: #f5f5f7;
}

html[data-theme="dark"] .rdx-project-popover .stats-modal-close,
html[data-theme="dark"] .rdx-project-popover .rdx-project-popover-icon,
html[data-theme="dark"] .rdx-project-popover .stats-filter-field,
html[data-theme="dark"] .rdx-project-popover .stats-option-tile,
html[data-theme="dark"] .rdx-project-popover .stats-modal-field,
html[data-theme="dark"] .rdx-project-popover .stats-modal-clear {
  border-color: #343740;
  background: #181b22;
  color: #f5f5f7;
}

html[data-theme="dark"] .rdx-project-popover .notas-filter-title {
  color: #a4a7ae;
}

html[data-theme="dark"] .rdx-project-popover .notas-status-chip {
  border-color: #343740;
  background: #181b22;
  color: #f5f5f7;
}

html[data-theme="dark"] .rdx-project-popover .notas-status-chip:hover {
  background: #24272e;
}

html[data-theme="dark"] .rdx-project-popover .notas-status-chip.selected {
  border-color: #f5f5f7;
  background: #f5f5f7;
  color: #1d1d1f;
}

html[data-theme="dark"] .rdx-project-popover .stats-period-choice-list > .stats-period-choice:hover,
html[data-theme="dark"] .rdx-project-popover .stats-period-choice-list > .stats-period-choice.selected,
html[data-theme="dark"] .rdx-project-popover .stats-period-choice-list > .stats-period-choice.is-selected,
html[data-theme="dark"] .rdx-project-popover .stats-filter-field:hover,
html[data-theme="dark"] .rdx-project-popover .stats-option-tile:hover {
  background: #24272e;
  color: #f5f5f7;
}

html[data-theme="dark"] .rdx-project-popover .cred-interest-choice.selected {
  background: #24272e;
}

html[data-theme="dark"] .rdx-project-popover .cred-interest-choice.selected .icon {
  color: #69ffb4;
}

html[data-theme="dark"] .rdx-project-popover .rdx-project-popover-copy small,
html[data-theme="dark"] .rdx-project-popover .stats-filter-field.empty > span:not(.icon),
html[data-theme="dark"] .rdx-project-popover .stats-modal-field span,
html[data-theme="dark"] .rdx-project-popover .stats-modal-clear {
  color: #a4a7ae;
}

html[data-theme="dark"] .rdx-project-popover .system-alert-message p {
  color: #f5f5f7;
}

html[data-theme="dark"] .rdx-project-popover .system-alert-message-icon {
  border-color: rgba(94, 168, 255, 0.22);
  background: rgba(94, 168, 255, 0.10);
  color: #5ea8ff;
}

html[data-theme="dark"] .rdx-project-popover .stats-modal-field input,
html[data-theme="dark"] .rdx-project-popover .stats-modal-field select,
html[data-theme="dark"] .rdx-project-popover .stats-modal-field textarea {
  color: #f5f5f7;
  color-scheme: dark;
}

/* A seta da lista de conversas usa o mesmo pop-up compacto oficial. O menu
   ganha altura suficiente para as opções específicas de grupo e contato sem
   transformar a lateral num painel flutuante próprio. */
.stats-modal-card.rdx-project-popover.crm-chat-actions-dialog {
  width: min(300px, calc(100vw - 26px));
}

.rdx-project-popover.crm-chat-actions-dialog .stats-modal-head h3 {
  font-size: 12px;
  font-weight: 650;
}

.rdx-project-popover.crm-chat-actions-dialog .stats-modal-body {
  padding: 6px;
}

.rdx-project-popover.crm-chat-actions-dialog .crm-chat-action-list {
  max-height: min(510px, calc(100dvh - 78px));
  overflow-y: auto;
}

.rdx-project-popover.crm-chat-actions-dialog .stats-option-tile {
  min-height: 40px;
  height: 40px;
  margin: 0;
  border: 0;
  background: transparent;
}

.rdx-project-popover.crm-chat-actions-dialog .stats-option-tile + .stats-option-tile {
  margin-top: 1px;
}

.rdx-project-popover.crm-chat-actions-dialog .stats-option-tile.section-start {
  margin-top: 8px;
  border-top: 1px solid rgba(29, 29, 31, 0.09);
  border-radius: 0 0 10px 10px;
}

html[data-theme="dark"] .rdx-project-popover.crm-chat-actions-dialog .stats-option-tile.section-start {
  border-top-color: rgba(255, 255, 255, 0.09);
}

/* Reações do CRM reutilizam o pop-up compacto oficial. Só o conteúdo interno
   ganha a leitura de participantes do WhatsApp; posição, fechamento externo e
   acompanhamento da rolagem continuam a cargo do shell global. */
.stats-modal-card.rdx-project-popover.crm-reactions-dialog {
  width: min(340px, calc(100vw - 26px));
}

.rdx-project-popover.crm-reactions-dialog .stats-modal-head h3 {
  font-size: 12px;
  font-weight: 650;
}

.rdx-project-popover.crm-reactions-dialog .stats-modal-body {
  padding: 0;
}

.crm-reaction-summary {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  padding: 8px 12px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(29, 29, 31, 0.09);
}

.crm-reaction-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(10, 118, 223, 0.22);
  border-radius: 999px;
  background: rgba(10, 118, 223, 0.08);
  color: #1d1d1f;
}

.crm-reaction-summary-chip b {
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
}

.crm-reaction-summary-chip small {
  color: #0071e3;
  font-size: 10px;
  font-weight: 700;
}

.crm-reaction-list {
  max-height: min(330px, calc(100dvh - 122px));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.crm-reaction-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 13px;
  box-sizing: border-box;
}

.crm-reaction-row + .crm-reaction-row {
  border-top: 1px solid rgba(29, 29, 31, 0.07);
}

.crm-reaction-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #e8eef5;
  color: #45627f;
  font-size: 10px;
  font-weight: 750;
}

.crm-reaction-avatar.is-self {
  background: rgba(10, 118, 223, 0.12);
  color: #0071e3;
}

.crm-reaction-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.crm-reaction-person {
  display: block;
  min-width: 0;
  flex: 1;
}

.crm-reaction-person strong,
.crm-reaction-person small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-reaction-person strong {
  color: #1d1d1f;
  font-size: 12px;
  font-weight: 650;
}

.crm-reaction-person small {
  margin-top: 3px;
  color: #777b83;
  font-size: 10px;
}

.crm-reaction-emoji {
  flex: 0 0 auto;
  font-size: 24px;
  line-height: 1;
}

html[data-theme="dark"] .crm-reaction-summary,
html[data-theme="dark"] .crm-reaction-row + .crm-reaction-row {
  border-color: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .crm-reaction-summary-chip {
  border-color: rgba(91, 168, 243, 0.28);
  background: rgba(91, 168, 243, 0.11);
  color: #f5f5f7;
}

html[data-theme="dark"] .crm-reaction-summary-chip small,
html[data-theme="dark"] .crm-reaction-avatar.is-self {
  color: #5ba8f3;
}

html[data-theme="dark"] .crm-reaction-avatar {
  background: #242933;
  color: #c6d2df;
}

html[data-theme="dark"] .crm-reaction-avatar.is-self {
  background: rgba(91, 168, 243, 0.14);
}

html[data-theme="dark"] .crm-reaction-person strong {
  color: #f5f5f7;
}

html[data-theme="dark"] .crm-reaction-person small {
  color: #a4a7ae;
}

@media (max-width: 680px) {
  .stats-modal-card.rdx-project-popover,
  .stats-modal-card.rdx-project-popover.is-trigger-anchored {
    top: 50%;
    left: 50%;
    width: min(340px, calc(100vw - 24px));
    max-height: calc(var(--app-height) - 24px);
    border-radius: 20px;
    transform: translate(-50%, -50%);
    animation-name: rdxProjectPopoverCenteredIn;
  }

  .stats-modal-card.rdx-project-popover.stats-filter-dialog {
    width: min(360px, calc(100vw - 24px));
  }

  .rdx-project-popover .stats-modal-head,
  .rdx-project-popover.stats-period-dialog .stats-modal-head,
  .rdx-project-popover.stats-filter-dialog .stats-modal-head,
  .rdx-project-popover.stats-option-dialog .stats-modal-head {
    min-height: 56px;
    padding: 0 13px 0 18px;
  }

  .rdx-project-popover .stats-modal-head h3,
  .rdx-project-popover.stats-period-dialog .stats-modal-head h3,
  .rdx-project-popover.stats-filter-dialog .stats-modal-head h3,
  .rdx-project-popover.stats-option-dialog .stats-modal-head h3 {
    font-size: 13px;
  }

  .rdx-project-popover .stats-modal-close,
  .rdx-project-popover.stats-period-dialog .stats-modal-close,
  .rdx-project-popover.stats-filter-dialog .stats-modal-close,
  .rdx-project-popover.stats-option-dialog .stats-modal-close {
    width: 25px;
    height: 25px;
    flex-basis: 25px;
    border-radius: 8px;
  }

  .rdx-project-popover .stats-modal-close .icon {
    width: 15px;
    height: 15px;
  }

  .rdx-project-popover .stats-modal-body,
  .rdx-project-popover.stats-period-dialog .stats-modal-body,
  .rdx-project-popover.stats-filter-dialog .stats-modal-body,
  .rdx-project-popover.stats-option-dialog .stats-modal-body {
    max-height: calc(var(--app-height) - 114px);
    padding: 10px;
  }

  .rdx-project-popover .system-alert-message {
    gap: 12px;
    padding: 4px 3px;
  }

  .rdx-project-popover .system-alert-message-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 12px;
  }

  .rdx-project-popover .system-alert-message-icon .icon {
    width: 19px;
    height: 19px;
  }

  .rdx-project-popover .system-alert-message p {
    margin-top: 3px;
    font-size: 13px;
  }

  .rdx-project-popover .stats-period-choice-list > .stats-period-choice {
    min-height: 70px;
    padding: 11px 12px;
    gap: 12px;
    border-radius: 14px;
  }

  .rdx-project-popover-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 12px;
  }

  .rdx-project-popover-icon .icon {
    width: 19px;
    height: 19px;
  }

  .rdx-project-popover-copy strong {
    font-size: 12px;
  }

  .rdx-project-popover-copy small {
    font-size: 10px;
  }

  .rdx-project-popover-check {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }

  .rdx-project-popover-check .icon {
    width: 15px;
    height: 15px;
  }

  .rdx-project-popover .stats-filter-field,
  .rdx-project-popover .stats-option-tile {
    min-height: 52px;
    border-radius: 12px;
  }

  .rdx-project-popover .stats-filter-field > span:not(.icon),
  .rdx-project-popover .stats-option-tile > span:not(.icon) {
    font-size: 13px;
  }

  .rdx-project-popover .notas-filter-title {
    font-size: 12px;
  }

  .rdx-project-popover .notas-status-chip {
    min-height: 38px;
    padding: 0 11px;
    border-radius: 12px;
    font-size: 12px;
  }

  .rdx-project-popover .stats-modal-field {
    min-height: 49px;
    padding: 0 11px;
    border-radius: 13px;
  }

  .rdx-project-popover .stats-modal-field input,
  .rdx-project-popover .stats-modal-field select,
  .rdx-project-popover .stats-modal-field textarea {
    font-size: 13px;
  }

  .rdx-project-popover .stats-modal-foot,
  .rdx-project-popover.stats-period-dialog .stats-modal-foot,
  .rdx-project-popover.stats-filter-dialog .stats-modal-foot,
  .rdx-project-popover.stats-option-dialog .stats-modal-foot {
    padding: 10px;
    gap: 9px;
  }

  .rdx-project-popover .stats-modal-primary,
  .rdx-project-popover .stats-modal-secondary,
  .rdx-project-popover .stats-modal-danger,
  .rdx-project-popover.stats-period-dialog .stats-modal-primary,
  .rdx-project-popover.stats-filter-dialog .stats-modal-primary {
    height: 42px;
    border-radius: 13px;
    font-size: 12px;
  }
}

.rdx-project-popover.client-filter-dialog .client-filter-tile {
  flex: 0 0 auto;
  height: auto;
  margin: 0;
}

.rdx-project-popover.client-filter-dialog .client-filter-tile.selected,
.rdx-project-popover.client-filter-dialog .client-filter-tile.selected:hover {
  border-color: #1d1d1f;
  background: #1d1d1f;
  color: #ffffff;
}

.rdx-project-popover.client-filter-dialog .client-filter-tile.selected > span:not(.icon),
.rdx-project-popover.client-filter-dialog .client-filter-tile.selected > .icon {
  color: inherit;
}

html[data-theme="dark"] .rdx-project-popover.client-filter-dialog .client-filter-tile.selected,
html[data-theme="dark"] .rdx-project-popover.client-filter-dialog .client-filter-tile.selected:hover {
  border-color: #f5f5f7;
  background: #f5f5f7;
  color: #1d1d1f;
}

/* Conteúdos que pertenciam ao antigo pop-up escuro.
   Corrige somente o tema claro e preserva integralmente o tema escuro. */
html:not([data-theme="dark"]) .rdx-project-popover .prod-action-item {
  border-color: transparent;
  background: transparent;
  color: #1d1d1f;
  transition: background 160ms ease, transform 120ms ease;
}

html:not([data-theme="dark"]) .rdx-project-popover .prod-action-item:hover {
  background: #f5f5f7;
}

html:not([data-theme="dark"]) .rdx-project-popover .prod-action-item:active {
  transform: scale(0.985);
}

html:not([data-theme="dark"]) .rdx-project-popover .prod-action-item.danger,
html:not([data-theme="dark"]) .rdx-project-popover .stats-option-tile.danger,
html:not([data-theme="dark"]) .rdx-project-popover .stats-option-tile.danger .icon {
  color: #d70015;
}

html:not([data-theme="dark"]) .rdx-project-popover .stats-option-tile .icon {
  color: #6e6e73;
}

/* As ações do Caixa nasceram no diálogo escuro e ainda forçam texto
   branco. Dentro do pop-up compacto claro, restaura superfície e contraste. */
html:not([data-theme="dark"]) .rdx-project-popover .cash-action-list button {
  border-color: rgba(29, 29, 31, 0.09);
  background: #f8f8fa;
  color: #1d1d1f;
}

html:not([data-theme="dark"]) .rdx-project-popover .cash-action-list button:hover {
  background: #f5f5f7;
}

html:not([data-theme="dark"]) .rdx-project-popover .cash-action-list .icon {
  color: #6e6e73;
}

/* O diálogo-base de Filtro é escuro por padrão e tem um seletor mais
   específico. No pop-up compacto claro, restaura a cor legível das opções. */
html:not([data-theme="dark"]) .rdx-project-popover.stats-filter-dialog
  .stats-filter-field.has-value > span:not(.icon) {
  color: #1d1d1f;
}

html:not([data-theme="dark"]) .rdx-project-popover .os-note {
  color: #6e6e73;
}

html:not([data-theme="dark"]) .rdx-project-popover .stats-option-search-wrapper {
  border-bottom-color: rgba(29, 29, 31, 0.09);
}

html:not([data-theme="dark"]) .rdx-project-popover .stats-option-search-card {
  border-color: rgba(29, 29, 31, 0.09);
  background: #f8f8fa;
}

html:not([data-theme="dark"]) .rdx-project-popover .stats-option-search-card:focus-within {
  border-color: #0071e3;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.08);
}

html:not([data-theme="dark"]) .rdx-project-popover .stats-option-search-card .icon {
  color: #6e6e73;
}

html:not([data-theme="dark"]) .rdx-project-popover .stats-option-search-input {
  color: #1d1d1f;
  caret-color: #0071e3;
}

html:not([data-theme="dark"]) .rdx-project-popover .stats-option-search-input::placeholder {
  color: #8e8e93;
}

html:not([data-theme="dark"]) .rdx-project-popover .stats-modal-add {
  background: transparent !important;
  color: #55555a !important;
}

html:not([data-theme="dark"]) .rdx-project-popover .stats-modal-add:hover {
  background: #f5f5f7 !important;
  color: #1d1d1f !important;
}

html:not([data-theme="dark"]) .rdx-project-popover .stats-filter-field .icon {
  color: #8e8e93;
}

html:not([data-theme="dark"]) .rdx-project-popover .prod-toggle-row span {
  color: #1d1d1f;
}

html:not([data-theme="dark"]) .rdx-project-popover .prod-switch {
  border-color: rgba(29, 29, 31, 0.12);
  background: #e2e2e5;
}

html:not([data-theme="dark"]) .rdx-project-popover .prod-switch::after {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}

html:not([data-theme="dark"]) .rdx-project-popover .prod-switch.on {
  border-color: #13a065;
  background: #13a065;
}

html:not([data-theme="dark"]) .rdx-project-popover .prod-chip-toggle {
  border-color: rgba(29, 29, 31, 0.10);
  background: #f5f5f7;
  color: #6e6e73;
}

html:not([data-theme="dark"]) .rdx-project-popover .prod-chip-toggle:hover {
  background: #eeeeef;
  color: #1d1d1f;
}

html:not([data-theme="dark"]) .rdx-project-popover .prod-chip-toggle.active {
  border-color: rgba(19, 160, 101, 0.30);
  background: rgba(19, 160, 101, 0.12);
  color: #137a50;
}

/* Botão e transição de tema trazidos do RDX Project Control. */
.theme-toggle {
  border: 1px solid transparent;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 120ms ease;
}

.theme-toggle:active {
  transform: scale(0.94);
}

html[data-theme="dark"] .theme-toggle {
  border-color: rgba(94, 168, 255, 0.72);
  background: #181b22;
  color: #5ea8ff;
}

html[data-theme="dark"] .theme-toggle:hover {
  border-color: #5ea8ff;
  background: #24272e;
}

/* A troca de tema anima uma captura única do viewport. Antes, `body *` fazia
   cada card, SVG, imagem e sombra transicionar separadamente — Produtos e o
   PDV podiam multiplicar isso por milhares de nós. */
html.is-theme-transitioning body {
  pointer-events: none;
}

::view-transition-image-pair(root) {
  isolation: auto;
}

::view-transition-old(root) {
  animation: rdx-theme-surface-out 220ms cubic-bezier(0.4, 0, 0.2, 1) both;
  mix-blend-mode: normal;
}

::view-transition-new(root) {
  animation: rdx-theme-surface-in 220ms cubic-bezier(0.4, 0, 0.2, 1) both;
  mix-blend-mode: normal;
}

@keyframes rdx-theme-surface-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes rdx-theme-surface-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.01ms !important;
  }
}

/* Painel Início — gráficos e cards inspirados no RDX Project Control. */
.home-panel-heading {
  min-width: 0;
  margin-bottom: 12px;
  padding: 2px 2px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.home-panel-heading > div {
  min-width: 0;
}

.home-panel-kicker {
  display: block;
  color: #0071e3;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.095em;
  text-transform: uppercase;
}

.home-panel-heading h2 {
  margin: 5px 0 0;
  color: #1d1d1f;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.35px;
}

.home-panel-caption,
.home-panel-count {
  flex: 0 0 auto;
  color: #6e6e73;
  font-size: 11.5px;
  font-weight: 400;
}

.home-panel-caption {
  padding-top: 18px;
}

.home-panel-count {
  padding: 7px 11px;
  border: 1px solid rgba(29, 29, 31, 0.10);
  border-radius: 999px;
  background: #f5f5f7;
}

.home-payment-layout {
  min-height: 286px;
  padding: 10px 8px 2px;
  display: grid;
  grid-template-columns: minmax(190px, 0.82fr) minmax(270px, 1.18fr);
  align-items: center;
  gap: clamp(24px, 4vw, 58px);
}

.home-payment-donut {
  width: min(100%, 260px);
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-payment-donut svg {
  width: min(100%, 220px);
  aspect-ratio: 1;
  overflow: visible;
  transform: rotate(-90deg);
}

.home-payment-donut circle {
  fill: none;
  stroke-width: 13;
  transition: stroke-width 150ms ease, opacity 150ms ease;
}

.home-payment-donut circle:not(.home-payment-donut-base):hover {
  stroke-width: 17;
}

.home-payment-donut-base {
  stroke: #eeeef1;
}

.home-payment-donut > div {
  width: 100%;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.home-payment-donut strong {
  color: #1d1d1f;
  font-size: clamp(20px, 2vw, 27px);
  font-weight: 500;
  line-height: 1.08;
  white-space: nowrap;
}

.home-payment-donut span {
  margin-top: 6px;
  color: #8e8e93;
  font-size: 11.5px;
  font-weight: 400;
}

.home-payment-legend {
  min-width: 0;
}

.home-payment-legend-row {
  width: 100%;
  min-height: 58px;
  padding: 12px 0;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(29, 29, 31, 0.09);
}

.home-payment-legend-row > i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.home-payment-legend-row > span {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #1d1d1f;
  font-size: 13px;
  font-weight: 400;
}

.home-payment-legend-row small {
  color: #8e8e93;
  font-size: 11.5px;
  font-weight: 400;
}

.home-payment-legend-row strong {
  color: #1d1d1f;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.home-sales-chart-card .bars {
  height: auto;
  padding: 0;
  display: block;
}

.home-chart-legend {
  min-height: 28px;
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  color: #6e6e73;
  font-size: 11.5px;
}

.home-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.home-chart-legend i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.home-chart-legend .is-sales {
  background: #0071e3;
}

.home-chart-legend .is-profit {
  background: #13a065;
}

.home-bars-stage {
  position: relative;
  height: 210px;
  margin-top: 4px;
}

.home-bars-grid {
  position: absolute;
  inset: 8px 4px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.home-bars-grid i {
  width: 100%;
  border-top: 1px solid rgba(29, 29, 31, 0.08);
}

.home-bars-groups {
  position: absolute;
  inset: 8px 0 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.home-sales-chart-card .bar-group {
  min-width: 0;
  padding: 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.home-sales-chart-card .bar-group > div {
  width: 100%;
  height: 170px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(4px, 0.7vw, 9px);
}

.home-sales-chart-card .bar-group span {
  width: clamp(10px, 1.1vw, 16px);
  min-height: 3px;
  display: block;
  border-radius: 5px 5px 2px 2px;
  transition: filter 150ms ease, transform 150ms ease;
}

.home-sales-chart-card .bar-group:hover span {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.home-sales-chart-card .bar-sales {
  background: #0071e3;
}

.home-sales-chart-card .bar-profit {
  background: #13a065;
}

.home-sales-chart-card .bar-group small {
  color: #8e8e93;
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
}

.home-operations-card {
  padding: 20px;
}

.home-operations-summary {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-operation-metric {
  min-width: 0;
  min-height: 112px;
  padding: 15px;
  border: 1px solid rgba(29, 29, 31, 0.09);
  border-radius: 17px;
  background: #f8f8fa;
}

.home-operation-metric > span,
.home-operation-metric > small {
  display: block;
  color: #8e8e93;
  font-size: 11.5px;
  font-weight: 400;
}

.home-operation-metric > strong {
  min-width: 0;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1d1d1f;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
}

.home-operation-metric > small {
  margin-top: 8px;
  overflow: hidden;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-operation-status::before {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #8e8e93;
  content: "";
}

.home-operation-status.is-open::before {
  background: #13a065;
}

.home-operation-status.is-closed::before {
  background: #ff9f0a;
}

.home-activity-list {
  margin-top: 16px;
  padding-top: 2px;
}

.home-activity-row {
  min-width: 0;
  min-height: 66px;
  padding: 11px 4px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid rgba(29, 29, 31, 0.09);
}

.home-activity-row > i {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: rgba(0, 113, 227, 0.09);
  color: #0071e3;
}

.home-activity-row.is-closed > i {
  background: rgba(255, 159, 10, 0.10);
  color: #b76b00;
}

.home-activity-row > i .icon {
  width: 16px;
  height: 16px;
}

.home-activity-row > span {
  min-width: 0;
  flex: 1;
}

.home-activity-row strong,
.home-activity-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-activity-row strong {
  color: #1d1d1f;
  font-size: 13px;
  font-weight: 500;
}

.home-activity-row small,
.home-activity-row > em {
  color: #8e8e93;
  font-size: 11px;
  font-weight: 400;
}

.home-activity-row small {
  margin-top: 4px;
}

.home-activity-row > em {
  flex: 0 0 auto;
  font-style: normal;
}

.home-activity-empty {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8e8e93;
  font-size: 12px;
  text-align: center;
}

html[data-theme="dark"] .home-panel-heading h2,
html[data-theme="dark"] .home-payment-donut strong,
html[data-theme="dark"] .home-payment-legend-row > span,
html[data-theme="dark"] .home-payment-legend-row strong,
html[data-theme="dark"] .home-operation-metric > strong,
html[data-theme="dark"] .home-activity-row strong {
  color: #f5f5f7;
}

html[data-theme="dark"] .home-panel-kicker {
  color: #5ea8ff;
}

html[data-theme="dark"] .home-panel-caption,
html[data-theme="dark"] .home-payment-donut span,
html[data-theme="dark"] .home-payment-legend-row small,
html[data-theme="dark"] .home-operation-metric > span,
html[data-theme="dark"] .home-operation-metric > small,
html[data-theme="dark"] .home-activity-row small,
html[data-theme="dark"] .home-activity-row > em,
html[data-theme="dark"] .home-activity-empty,
html[data-theme="dark"] .home-chart-legend,
html[data-theme="dark"] .home-sales-chart-card .bar-group small {
  color: #a4a7ae;
}

html[data-theme="dark"] .home-panel-count,
html[data-theme="dark"] .home-operation-metric {
  border-color: rgba(255, 255, 255, 0.11);
  background: #181b22;
}

html[data-theme="dark"] .home-panel-count {
  color: #f5f5f7;
}

html[data-theme="dark"] .home-payment-donut-base {
  stroke: #343740;
}

html[data-theme="dark"] .home-payment-legend-row,
html[data-theme="dark"] .home-activity-row {
  border-color: rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] .home-bars-grid i {
  border-color: rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] .home-activity-row > i {
  background: rgba(94, 168, 255, 0.15);
  color: #5ea8ff;
}

html[data-theme="dark"] .home-activity-row.is-closed > i {
  background: rgba(255, 159, 10, 0.14);
  color: #ffb84d;
}

@media (max-width: 680px) {
  .home-panel-heading {
    gap: 10px;
  }

  .home-panel-heading h2 {
    font-size: 20px;
  }

  .home-panel-caption {
    display: none;
  }

  .home-payment-layout {
    min-height: 0;
    padding: 10px 0 0;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .home-payment-donut {
    width: min(220px, 76vw);
  }

  .home-payment-donut svg {
    width: min(190px, 70vw);
  }

  .home-payment-legend-row {
    min-height: 52px;
  }

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

  .home-operation-metric {
    min-height: 96px;
  }

  .home-bars-stage {
    height: 190px;
  }

  .home-sales-chart-card .bar-group > div {
    height: 150px;
    gap: 3px;
  }

  .home-sales-chart-card .bar-group {
    padding: 0 1px;
  }

  .home-sales-chart-card .bar-group span {
    width: min(11px, 3vw);
  }

  .home-sales-chart-card .bar-group small {
    font-size: 9.5px;
  }
}

/* Estatísticas — mesma linguagem de gráficos e cards do Project Control. */
.stats-project-control .stats-project-panel {
  padding: 20px;
  border-radius: 28px;
}

.stats-project-heading {
  min-width: 0;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.stats-project-heading > div {
  min-width: 0;
}

.stats-project-kicker {
  display: block;
  color: #0071e3;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.095em;
  text-transform: uppercase;
}

.stats-project-heading h2 {
  margin: 5px 0 0;
  color: #1d1d1f;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.3px;
}

.stats-project-metrics {
  gap: 10px;
}

.stats-project-metrics .stats-metric {
  position: relative;
  min-height: 112px;
  padding: 17px;
  border-color: rgba(29, 29, 31, 0.08);
  border-radius: 17px;
  background: #f8f8fa;
}

.stats-project-metrics .stats-metric::after {
  position: absolute;
  top: 17px;
  right: 17px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--metric-accent);
  content: "";
}

.stats-project-metrics .stats-metric span {
  max-width: calc(100% - 20px);
  color: #8e8e93;
  font-size: 11.5px;
  font-weight: 400;
}

.stats-project-metrics .stats-metric strong {
  margin-top: 18px;
  color: #1d1d1f;
  font-size: clamp(20px, 2vw, 27px);
  font-weight: 500;
  letter-spacing: -0.45px;
}

.stats-project-progress-list {
  gap: 0;
}

.stats-project-progress-list .stats-progress-row {
  padding: 14px 2px;
  border: 0;
  border-bottom: 1px solid rgba(29, 29, 31, 0.09);
  border-radius: 0;
  background: transparent;
}

.stats-project-progress-list .stats-progress-row:first-child {
  padding-top: 4px;
}

.stats-project-progress-list .stats-progress-row strong,
.stats-project-progress-list .stats-progress-row b {
  font-size: 12.5px;
  font-weight: 500;
}

.stats-project-progress-list .stats-progress-row strong {
  color: #1d1d1f;
}

.stats-project-progress-list .stats-progress-row > span {
  height: 7px;
  margin-top: 10px;
  background: #eeeef1;
}

.stats-project-progress-list .stats-progress-row i {
  background: var(--c);
}

.stats-project-donut-layout {
  min-height: 286px;
  padding: 6px 2px 0;
  display: grid;
  grid-template-columns: minmax(190px, 0.82fr) minmax(250px, 1.18fr);
  align-items: center;
  gap: clamp(22px, 3vw, 48px);
}

.stats-project-donut {
  width: min(100%, 260px);
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stats-project-donut svg {
  width: min(100%, 220px);
  aspect-ratio: 1;
  overflow: visible;
  transform: rotate(-90deg);
}

.stats-project-donut circle {
  fill: none;
  stroke-width: 13;
  transition: stroke-width 150ms ease, opacity 150ms ease;
}

.stats-project-donut circle:not(.stats-project-donut-base):hover {
  stroke-width: 17;
}

.stats-project-donut-base {
  stroke: #eeeef1;
}

.stats-project-donut > div {
  width: 100%;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stats-project-donut strong {
  max-width: 100%;
  color: #1d1d1f;
  font-size: clamp(17px, 1.8vw, 24px);
  font-weight: 500;
  line-height: 1.08;
  white-space: nowrap;
}

.stats-project-donut span {
  margin-top: 6px;
  color: #8e8e93;
  font-size: 11px;
  font-weight: 400;
}

.stats-project-legend {
  min-width: 0;
}

.stats-project-legend-row {
  width: 100%;
  min-height: 54px;
  padding: 11px 0;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid rgba(29, 29, 31, 0.09);
}

.stats-project-legend-row > i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.stats-project-legend-row > span {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  overflow: hidden;
  color: #1d1d1f;
  font-size: 12.5px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-project-legend-row small {
  flex: 0 0 auto;
  color: #8e8e93;
  font-size: 11px;
  font-weight: 400;
}

.stats-project-legend-row strong {
  max-width: 130px;
  overflow: hidden;
  color: #1d1d1f;
  font-size: 12.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-project-chart-legend {
  margin: 0 2px 10px;
  justify-content: flex-end;
  color: #6e6e73;
  font-size: 11.5px;
  font-weight: 400;
}

.stats-project-chart-legend .blue {
  background: #0071e3;
}

.stats-project-chart-legend .green {
  background: #13a065;
}

.stats-project-bars-stage {
  position: relative;
  height: 250px;
}

.stats-project-bars-grid {
  position: absolute;
  inset: 10px 6px 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.stats-project-bars-grid i {
  width: 100%;
  border-top: 1px solid rgba(29, 29, 31, 0.08);
}

.stats-project-bars-stage .stats-bars {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  height: 250px;
  padding: 0 6px;
}

.stats-project-bars-stage .stats-bar-day span {
  border-radius: 5px 5px 2px 2px;
  transition: filter 150ms ease, transform 150ms ease;
}

.stats-project-bars-stage .stats-bar-day:hover span {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.stats-project-bars-stage .stats-bar-day .sales {
  background: #0071e3;
}

.stats-project-bars-stage .stats-bar-day .profit {
  background: #13a065;
}

.stats-project-bars-stage .stats-bar-day small {
  color: #8e8e93;
  font-size: 10.5px;
  font-weight: 400;
}

.stats-project-line-chart {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.stats-project-line-chart .stats-project-line-grid {
  fill: none;
  stroke: rgba(29, 29, 31, 0.08);
  stroke-width: 1;
}

.stats-project-line-chart .stats-project-line-fill {
  fill: url("#statsProjectLineFill");
}

.stats-project-line-chart polyline {
  stroke-width: 3;
}

.stats-project-line-chart circle {
  fill: #ffffff;
  stroke: #0071e3;
  stroke-width: 3;
}

.stats-project-control .stats-table {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.stats-project-control .stats-table th {
  background: #f8f8fa;
}

.stats-project-control .stats-table th,
.stats-project-control .stats-table td {
  padding: 13px 14px;
  border-color: rgba(29, 29, 31, 0.09);
}

.stats-project-control .stats-empty {
  border-color: rgba(29, 29, 31, 0.08);
  background: #f8f8fa;
  font-weight: 400;
}

html[data-theme="dark"] .stats-project-heading h2,
html[data-theme="dark"] .stats-project-metrics .stats-metric strong,
html[data-theme="dark"] .stats-project-progress-list .stats-progress-row strong,
html[data-theme="dark"] .stats-project-progress-list .stats-progress-row b,
html[data-theme="dark"] .stats-project-donut strong,
html[data-theme="dark"] .stats-project-legend-row > span,
html[data-theme="dark"] .stats-project-legend-row strong {
  color: #f5f5f7;
}

html[data-theme="dark"] .stats-project-kicker {
  color: #5ea8ff;
}

html[data-theme="dark"] .stats-project-metrics .stats-metric span,
html[data-theme="dark"] .stats-project-donut span,
html[data-theme="dark"] .stats-project-legend-row small,
html[data-theme="dark"] .stats-project-chart-legend,
html[data-theme="dark"] .stats-project-bars-stage .stats-bar-day small {
  color: #a4a7ae;
}

html[data-theme="dark"] .stats-project-metrics .stats-metric {
  border-color: rgba(255, 255, 255, 0.10);
  background: #181b22;
}

html[data-theme="dark"] .stats-project-progress-list .stats-progress-row {
  border-color: rgba(255, 255, 255, 0.10);
  background: transparent;
}

html[data-theme="dark"] .stats-project-progress-list .stats-progress-row > span,
html[data-theme="dark"] .stats-project-donut-base {
  background: #343740;
  stroke: #343740;
}

html[data-theme="dark"] .stats-project-legend-row {
  border-color: rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] .stats-project-bars-grid i,
html[data-theme="dark"] .stats-project-line-chart .stats-project-line-grid {
  border-color: rgba(255, 255, 255, 0.10);
  stroke: rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] .stats-project-line-chart {
  border: 0;
  background: transparent;
}

html[data-theme="dark"] .stats-project-line-chart circle {
  fill: #111318;
  stroke: #5ea8ff;
}

html[data-theme="dark"] .stats-project-control .stats-table {
  background: transparent;
}

html[data-theme="dark"] .stats-project-control .stats-table th {
  background: #181b22;
}

html[data-theme="dark"] .stats-project-control .stats-empty {
  border-color: rgba(255, 255, 255, 0.10);
  background: #181b22;
}

@media (max-width: 680px) {
  .stats-project-control .stats-project-panel {
    padding: 16px;
    border-radius: 24px;
  }

  .stats-project-heading {
    margin-bottom: 14px;
  }

  .stats-project-heading h2 {
    font-size: 19px;
  }

  .stats-project-donut-layout {
    min-height: 0;
    padding-top: 4px;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .stats-project-donut {
    width: min(220px, 76vw);
  }

  .stats-project-donut svg {
    width: min(190px, 68vw);
  }

  .stats-project-legend-row {
    min-height: 50px;
  }

  .stats-project-metrics .stats-metric {
    min-height: 94px;
  }

  .stats-project-bars-stage,
  .stats-project-bars-stage .stats-bars {
    height: 230px;
  }
}

/* Vídeos de ajuda — modal persistente no novo padrão visual. */
.stats-modal-root.is-persistent .stats-modal-backdrop {
  cursor: default;
}

.stats-modal-card.help-video-dialog {
  width: min(480px, calc(100vw - 26px));
  max-height: calc(100dvh - 26px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(29, 29, 31, 0.09);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
  color: #1d1d1f;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.help-video-dialog .stats-modal-head {
  min-height: 45px;
  margin: 0;
  padding: 0 10px 0 14px;
  gap: 10px;
  border-bottom: 1px solid rgba(29, 29, 31, 0.09);
}

.help-video-dialog .stats-modal-head h3 {
  color: #1d1d1f;
  font-family: var(--apple-font);
  font-size: 10.4px;
  font-weight: 500;
  line-height: 1.2;
}

.help-video-dialog .stats-modal-close {
  width: 20px;
  height: 20px;
  display: inline-flex;
  flex: 0 0 20px;
  border: 1px solid rgba(29, 29, 31, 0.07);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.76);
  color: #0071e3;
  transition: transform 120ms ease, background 160ms ease;
}

.help-video-dialog .stats-modal-close:hover {
  background: #ffffff;
}

.help-video-dialog .stats-modal-close:active {
  transform: scale(0.94);
}

.help-video-dialog .stats-modal-close .icon {
  width: 12px;
  height: 12px;
}

.help-video-dialog .stats-modal-body {
  padding: 8px;
  overflow: hidden;
}

.help-video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(29, 29, 31, 0.09);
  border-radius: 11px;
  background: #000000;
}

.help-video-frame iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

html[data-theme="dark"] .stats-modal-card.help-video-dialog {
  border-color: #343740;
  background: #15171c;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.46);
  color: #f5f5f7;
}

html[data-theme="dark"] .help-video-dialog .stats-modal-head {
  border-bottom-color: rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] .help-video-dialog .stats-modal-head h3 {
  color: #f5f5f7;
}

html[data-theme="dark"] .help-video-dialog .stats-modal-close {
  border-color: #343740;
  background: #181b22;
  color: #5ea8ff;
}

html[data-theme="dark"] .help-video-dialog .stats-modal-close:hover {
  background: #24272e;
}

@media (max-width: 680px) {
  .stats-modal-root.help-video-modal-root {
    padding: 12px;
  }

  .stats-modal-card.help-video-dialog {
    width: min(420px, calc(100vw - 24px));
    max-height: calc(var(--app-height) - 24px);
    border-radius: 20px;
  }

  .help-video-dialog .stats-modal-head {
    min-height: 56px;
    padding: 0 13px 0 18px;
  }

  .help-video-dialog .stats-modal-head h3 {
    font-size: 13px;
  }

  .help-video-dialog .stats-modal-close {
    width: 25px;
    height: 25px;
    flex-basis: 25px;
    border-radius: 8px;
  }

  .help-video-dialog .stats-modal-close .icon {
    width: 15px;
    height: 15px;
  }

  .help-video-dialog .stats-modal-body {
    padding: 10px;
  }

  .help-video-frame {
    border-radius: 13px;
  }
}

/* =====================================================================
   Aba Vender (PDV) — pop-ups no tema compacto do RDX Project Control.
   Mesma paleta, bordas, tipografia e botões do pop-up de Produtos >
   Opções; cada diálogo mantém a largura que já tinha (Pagamento 680px,
   Finalizar venda 540px, prompts 400px…) e continua centralizado com
   backdrop. Claro por padrão, escuro em html[data-theme="dark"].
   ===================================================================== */

.stats-modal-card.pos-dialog,
.stats-modal-card.pos-item-edit-dialog,
.stats-modal-card.password-reset-dialog {
  --pop-surface: #ffffff;
  --pop-surface-alt: #f8f8fa;
  --pop-hover: #f5f5f7;
  --pop-foot: #fafafd;
  --pop-border: rgba(29, 29, 31, 0.09);
  --pop-border-soft: rgba(29, 29, 31, 0.07);
  --pop-ink: #1d1d1f;
  --pop-muted: #6e6e73;
  --pop-accent: #0071e3;
  --pop-accent-soft: rgba(0, 113, 227, 0.08);
  --pop-close-ink: #0071e3;
  --pop-success: #13a065;
  --pop-danger: #d70015;
  --pop-danger-bg: rgba(255, 59, 48, 0.06);
  --pop-danger-border: rgba(255, 59, 48, 0.18);
  --pop-primary-bg: #1d1d1f;
  --pop-primary-ink: #ffffff;
  --pop-shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
}

html[data-theme="dark"] .stats-modal-card.pos-dialog,
html[data-theme="dark"] .stats-modal-card.pos-item-edit-dialog,
html[data-theme="dark"] .stats-modal-card.password-reset-dialog {
  --pop-surface: #15171c;
  --pop-surface-alt: #181b22;
  --pop-hover: #24272e;
  --pop-foot: #15171c;
  --pop-border: #343740;
  --pop-border-soft: #343740;
  --pop-ink: #f5f5f7;
  --pop-muted: #a4a7ae;
  --pop-accent: #5ea8ff;
  --pop-accent-soft: rgba(94, 168, 255, 0.14);
  --pop-close-ink: #f5f5f7;
  --pop-success: #69ffb4;
  --pop-danger: #ff6c6c;
  --pop-danger-bg: rgba(255, 108, 108, 0.10);
  --pop-danger-border: rgba(255, 108, 108, 0.24);
  --pop-primary-bg: #f5f5f7;
  --pop-primary-ink: #111318;
  --pop-shadow: 0 18px 34px rgba(0, 0, 0, 0.32);
}

/* Os tokens antigos do .pos-dialog (que forçavam escuro) passam a apontar
   para a paleta do tema — todo conteúdo que usa var(--ink)/var(--muted)/
   var(--card-soft) acompanha sem precisar de regra própria. */
.stats-modal-card.pos-dialog {
  --ink: var(--pop-ink);
  --muted: var(--pop-muted);
  --line: var(--pop-border);
  --card: var(--pop-surface);
  --card-soft: var(--pop-surface-alt);
  --card-hover: var(--pop-hover);
  --field: var(--pop-surface-alt);
  --green: var(--pop-success);
  --blue-rgb: 0, 113, 227;
  --blue-soft: var(--pop-border);
  --shadow: rgba(0, 0, 0, 0.08);
  color-scheme: light;
}

html[data-theme="dark"] .stats-modal-card.pos-dialog {
  --blue-rgb: 94, 168, 255;
  --shadow: rgba(0, 0, 0, 0.40);
  color-scheme: dark;
}

/* ---------- card ---------- */
.stats-modal-card.pos-dialog,
.stats-modal-card.pos-item-edit-dialog {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--pop-border);
  border-radius: 20px;
  background: var(--pop-surface);
  box-shadow: var(--pop-shadow);
  color: var(--pop-ink);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

/* ---------- cabeçalho ---------- */
.stats-modal-card.pos-dialog .stats-modal-head,
.stats-modal-card.pos-item-edit-dialog .stats-modal-head {
  min-height: 56px;
  margin: 0;
  padding: 0 13px 0 18px;
  gap: 10px;
  border-bottom: 1px solid var(--pop-border);
}

.stats-modal-card.pos-dialog .stats-modal-head h3,
.stats-modal-card.pos-item-edit-dialog .stats-modal-head h3 {
  color: var(--pop-ink);
  font-family: var(--apple-font);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
}

.stats-modal-card.pos-dialog .stats-modal-close,
.stats-modal-card.pos-item-edit-dialog .stats-modal-close,
.stats-modal-card.password-reset-dialog .stats-modal-close {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border: 1px solid var(--pop-border-soft);
  border-radius: 8px;
  background: var(--pop-surface);
  color: var(--pop-close-ink);
  transition: transform 120ms ease, background 160ms ease;
}

.stats-modal-card.pos-dialog .stats-modal-close:hover,
.stats-modal-card.pos-item-edit-dialog .stats-modal-close:hover,
.stats-modal-card.password-reset-dialog .stats-modal-close:hover {
  background: var(--pop-hover);
}

.stats-modal-card.pos-dialog .stats-modal-close:active,
.stats-modal-card.pos-item-edit-dialog .stats-modal-close:active,
.stats-modal-card.password-reset-dialog .stats-modal-close:active {
  transform: scale(0.94);
}

.stats-modal-card.pos-dialog .stats-modal-close .icon,
.stats-modal-card.pos-item-edit-dialog .stats-modal-close .icon,
.stats-modal-card.password-reset-dialog .stats-modal-close .icon {
  width: 15px;
  height: 15px;
}

/* ---------- corpo e rodapé ---------- */
.stats-modal-card.pos-dialog .stats-modal-body,
.stats-modal-card.pos-item-edit-dialog .stats-modal-body {
  padding: 14px 16px 12px;
  overflow: auto;
  overscroll-behavior: contain;
}

.stats-modal-card.pos-dialog .stats-modal-foot,
.stats-modal-card.pos-item-edit-dialog .stats-modal-foot {
  margin: 0;
  padding: 12px 16px 14px;
  gap: 9px;
  border-top: 1px solid var(--pop-border);
  background: var(--pop-foot);
}

.stats-modal-card.pos-dialog .pos-dialog-sub {
  color: var(--pop-muted);
  font-weight: 400;
  font-size: 13px;
}

/* ---------- botões ---------- */
.stats-modal-card.pos-dialog .stats-modal-primary,
.stats-modal-card.pos-dialog .stats-modal-secondary,
.stats-modal-card.pos-dialog .stats-modal-danger,
.stats-modal-card.pos-item-edit-dialog .stats-modal-primary,
.stats-modal-card.pos-item-edit-dialog .stats-modal-secondary,
.stats-modal-card.pos-item-edit-dialog .stats-modal-danger {
  height: 42px;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 500;
}

.stats-modal-card.pos-dialog .stats-modal-primary,
.stats-modal-card.pos-item-edit-dialog .stats-modal-primary {
  border: 1px solid var(--pop-primary-bg);
  background: var(--pop-primary-bg);
  color: var(--pop-primary-ink);
}

.stats-modal-card.pos-dialog .stats-modal-primary:hover,
.stats-modal-card.pos-item-edit-dialog .stats-modal-primary:hover {
  opacity: 0.88;
}

.stats-modal-card.pos-dialog .stats-modal-secondary,
.stats-modal-card.pos-item-edit-dialog .stats-modal-secondary {
  border: 1px solid var(--pop-border);
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog .stats-modal-secondary:hover,
.stats-modal-card.pos-item-edit-dialog .stats-modal-secondary:hover {
  background: var(--pop-hover);
}

/* No PDV, .stats-modal-danger é o botão de "Cancelar"/"Sem cliente" — ação
   neutra, não destrutiva. Fica com a superfície secundária do tema; o
   vermelho do tema sobra para o que realmente remove (Remover item). */
.stats-modal-card.pos-dialog .stats-modal-danger,
.stats-modal-card.pos-item-edit-dialog .stats-modal-danger {
  border: 1px solid var(--pop-border);
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog .stats-modal-danger:hover,
.stats-modal-card.pos-item-edit-dialog .stats-modal-danger:hover {
  background: var(--pop-hover);
}

/* Pagamento: a ação principal ocupa a primeira linha inteira; as duas
   saídas ficam abaixo, com Cancelar à esquerda e Salvar condicional à direita. */
.stats-modal-card.pos-dialog.pos-pay-dialog .stats-modal-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.stats-modal-card.pos-dialog.pos-pay-dialog #pos-pay-confirm {
  order: 1;
  flex: 0 0 100%;
  width: 100%;
}

.stats-modal-card.pos-dialog.pos-pay-dialog [data-cancel] {
  order: 2;
  flex: 0 0 calc(50% - 4.5px);
  width: calc(50% - 4.5px);
  border-color: var(--pop-danger-border);
  background: var(--pop-danger-bg);
  color: var(--pop-danger);
}

.stats-modal-card.pos-dialog.pos-pay-dialog [data-cancel]:hover {
  border-color: var(--pop-danger-border);
  background: var(--pop-danger-bg);
  color: var(--pop-danger);
  opacity: 0.84;
}

.stats-modal-card.pos-dialog.pos-pay-dialog .pos-pay-save-conditional {
  order: 3;
  flex: 0 0 calc(50% - 4.5px);
  width: calc(50% - 4.5px);
  border-color: var(--pop-border);
  background: #ffffff;
  color: var(--pop-ink);
}

/* Sem Salvar condicional, as duas ações ocupam uma linha: sair à esquerda,
   continuar à direita. Com a opção disponível, vale o layout acima. */
.stats-modal-card.pos-dialog.pos-pay-dialog .stats-modal-foot:not(:has(.pos-pay-save-conditional)) [data-cancel] {
  order: 1;
}

.stats-modal-card.pos-dialog.pos-pay-dialog .stats-modal-foot:not(:has(.pos-pay-save-conditional)) #pos-pay-confirm {
  order: 2;
  flex: 0 0 calc(50% - 4.5px);
  width: calc(50% - 4.5px);
}

.stats-modal-card.pos-dialog.pos-pay-dialog .pos-pay-save-conditional:hover {
  border-color: var(--pop-border);
  background: var(--pop-hover);
}

html[data-theme="dark"] .stats-modal-card.pos-dialog.pos-pay-dialog .pos-pay-save-conditional {
  border-color: var(--pop-border);
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}

html[data-theme="dark"] .stats-modal-card.pos-dialog.pos-pay-dialog [data-cancel].stats-modal-danger,
html[data-theme="dark"] .stats-modal-card.pos-dialog.pos-pay-dialog [data-cancel].stats-modal-danger:hover {
  border-color: var(--pop-danger-border);
  background: var(--pop-danger-bg);
  color: var(--pop-danger);
}

/* O "Remover" nasceu como link sem fundo (padding-left: 0). Com a pílula do
   tema, o padding volta a ser simétrico para o ícone e o texto ficarem
   centrados dentro do botão. */
.stats-modal-card.pos-item-edit-dialog .stats-modal-danger.pos-item-edit-remove {
  padding: 0 16px;
  border-color: var(--pop-danger-border);
  background: var(--pop-danger-bg);
  color: var(--pop-danger);
}

.stats-modal-card.pos-item-edit-dialog .stats-modal-danger.pos-item-edit-remove:hover {
  background: var(--pop-danger-bg);
  opacity: 0.85;
}

.stats-modal-card.pos-dialog .stats-modal-primary .icon,
.stats-modal-card.pos-dialog .stats-modal-secondary .icon,
.stats-modal-card.pos-dialog .stats-modal-danger .icon {
  width: 13px;
  height: 13px;
}

.stats-modal-card.pos-dialog .pos-footer-btn {
  font-weight: 500;
  font-size: 12px;
  border-radius: 13px;
}

/* ---------- campos ---------- */
.stats-modal-card.pos-dialog .stats-modal-field {
  min-height: 49px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid var(--pop-border);
  border-radius: 13px;
  background: var(--pop-surface-alt);
}

.stats-modal-card.pos-dialog .stats-modal-field span {
  color: var(--pop-muted);
  font-size: 13px;
}

.stats-modal-card.pos-dialog .stats-modal-field input,
.stats-modal-card.pos-dialog .stats-modal-field select,
.stats-modal-card.pos-dialog .stats-modal-field textarea {
  color: var(--pop-ink);
  font-size: 13px;
}

.stats-modal-card.pos-dialog .stats-modal-field input::placeholder,
.stats-modal-card.pos-dialog .stats-modal-field textarea::placeholder {
  color: var(--pop-muted);
}

/* Campo com textarea (Observações): rótulo em cima e caixa ocupando a
   largura toda, em vez do texto brigar com o label na mesma linha. */
.stats-modal-card.pos-dialog .stats-modal-field:has(textarea) {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 10px 12px;
}

.stats-modal-card.pos-dialog .stats-modal-field:has(textarea) span {
  font-size: 12px;
}

.stats-modal-card.pos-dialog .stats-modal-field textarea {
  width: 100%;
  min-height: 32px;
  resize: none;
}

.stats-modal-card.pos-dialog .pos-search {
  border: 1px solid var(--pop-border);
  border-radius: 13px;
  background: var(--pop-surface-alt);
}

.stats-modal-card.pos-dialog .pos-search input {
  color: var(--pop-ink);
  font-size: 13px;
}

.stats-modal-card.pos-dialog .pos-search-ic {
  color: var(--pop-muted);
}

.stats-modal-card.pos-dialog .pos-step-btn,
.stats-modal-card.pos-dialog .pos-stepper input {
  border: 1px solid var(--pop-border);
  border-radius: 13px;
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog .pos-step-btn:hover {
  background: var(--pop-hover);
}

/* Atalhos de % do "Desconto geral" (antes forçados em branco por um
   <style> inline no app; agora seguem o tema). */
.stats-modal-card.pos-dialog .pos-discount-btn-grid .os-ed-outline-btn {
  height: 42px;
  border: 1px solid var(--pop-border);
  border-radius: 13px;
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
  font-weight: 500;
  font-size: 12px;
}

.stats-modal-card.pos-dialog .pos-discount-btn-grid .os-ed-outline-btn:hover {
  background: var(--pop-hover);
}

/* ---------- listas e linhas ---------- */
.stats-modal-card.pos-dialog .pos-picker-item,
.stats-modal-card.pos-dialog .pos-client-btn {
  border: 1px solid var(--pop-border);
  border-radius: 13px;
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
  font-weight: 400;
}

.stats-modal-card.pos-dialog .pos-picker-item:hover,
.stats-modal-card.pos-dialog .pos-client-btn:hover,
.stats-modal-card.pos-dialog .pos-option-row:hover,
.stats-modal-card.pos-dialog .pos-option-row:active {
  background: var(--pop-hover);
}

.stats-modal-card.pos-dialog .pos-picker-item.selected {
  border-color: var(--pop-accent);
  background: var(--pop-accent-soft);
}

.stats-modal-card.pos-dialog .pos-picker-item-left b {
  font-weight: 500;
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog .pos-opt-label {
  color: var(--pop-ink);
  font-size: 13px;
}

.stats-modal-card.pos-dialog .pos-review-row,
.stats-modal-card.pos-dialog .pos-review-pay {
  border: 1px solid var(--pop-border);
  border-radius: 13px;
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog .pos-review-row:hover {
  background: var(--pop-hover);
}

.stats-modal-card.pos-dialog .pos-review-row b,
.stats-modal-card.pos-dialog .pos-review-pay b,
.stats-modal-card.pos-dialog .pos-pay-line-info b,
.stats-modal-card.pos-dialog .pos-pay-line-val {
  font-weight: 500;
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog .pos-review-row small,
.stats-modal-card.pos-dialog .pos-pay-remaining-label,
.stats-modal-card.pos-dialog .pos-pay-caption,
.stats-modal-card.pos-dialog .pos-pay-empty,
.stats-modal-card.pos-dialog .pos-pay-line-info span {
  color: var(--pop-muted);
  font-weight: 400;
}

.stats-modal-card.pos-dialog .pos-pay-remaining strong {
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog .pos-pay-change {
  color: var(--pop-success);
  font-weight: 500;
}

/* ---------- formas de pagamento ---------- */
.stats-modal-card.pos-dialog .pos-pay-method {
  border: 1px solid var(--pop-border);
  border-radius: 13px;
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
  font-weight: 500;
  font-size: 12px;
}

.stats-modal-card.pos-dialog .pos-pay-method:not(.active):hover {
  border-color: var(--pop-border);
  background: var(--pop-hover);
}

.stats-modal-card.pos-dialog .pos-pay-method.active {
  border-color: var(--pop-accent);
  background: var(--pop-accent-soft);
  color: var(--pop-accent);
  box-shadow: none;
}

.stats-modal-card.pos-dialog .pos-pay-method.active .icon {
  color: var(--pop-accent);
}

/* ---------- carrinho dentro do "Resumo" (mobile) ---------- */
.stats-modal-card.pos-dialog .pos-ghost-btn,
.stats-modal-card.pos-dialog .pos-finalize-btn,
.stats-modal-card.pos-dialog .pos-qty-btn {
  border: 1px solid var(--pop-border);
  border-radius: 13px;
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
  font-weight: 500;
}

.stats-modal-card.pos-dialog .pos-ghost-btn:hover,
.stats-modal-card.pos-dialog .pos-finalize-btn:hover,
.stats-modal-card.pos-dialog .pos-qty-btn:hover {
  border-color: var(--pop-border);
  background: var(--pop-hover);
}

.stats-modal-card.pos-dialog .pos-cart-info b,
.stats-modal-card.pos-dialog .pos-total-line.big span {
  font-weight: 500;
}

/* ---------- pós-venda ---------- */
/* Os dois botões secundários dividem a linha: mantém o gap de 8px que a
   largura calc(50% - 4px) deles pressupõe. */
.stats-modal-card.pos-dialog.pos-post-dialog .stats-modal-foot {
  gap: 8px;
}

.stats-modal-card.pos-dialog.pos-post-dialog .pos-dialog-sub {
  color: var(--pop-muted);
}

.stats-modal-card.pos-dialog.pos-post-dialog .pos-dialog-sub b {
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.pos-post-dialog .stats-modal-secondary {
  border: 1px solid var(--pop-border);
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.pos-post-dialog .stats-modal-secondary:hover {
  background: var(--pop-hover);
}

/* ---------- "Novo cliente" aberto pelo PDV ---------- */
.stats-modal-card.pos-dialog.client-form-dialog {
  border-color: var(--pop-border);
  border-radius: 20px;
  background: var(--pop-surface);
}

.stats-modal-card.pos-dialog.client-form-dialog .stats-modal-head,
.stats-modal-card.pos-dialog.client-form-dialog .stats-modal-foot {
  border-color: var(--pop-border);
}

.stats-modal-card.pos-dialog.client-form-dialog .stats-modal-head h3 {
  color: var(--pop-ink);
  font-size: 13px;
  font-weight: 500;
}

.stats-modal-card.pos-dialog.client-form-dialog .stats-modal-field {
  border-color: var(--pop-border);
  background: var(--pop-surface-alt);
}

.stats-modal-card.pos-dialog.client-form-dialog .stats-modal-field span {
  color: var(--pop-muted);
}

.stats-modal-card.pos-dialog.client-form-dialog .stats-modal-field input,
.stats-modal-card.pos-dialog.client-form-dialog .stats-modal-field select,
.stats-modal-card.pos-dialog.client-form-dialog .stats-modal-field textarea {
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.client-form-dialog .stats-modal-field input::placeholder,
.stats-modal-card.pos-dialog.client-form-dialog .stats-modal-field textarea::placeholder {
  color: var(--pop-muted);
}

.stats-modal-card.pos-dialog.client-form-dialog .client-form-toggle {
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.client-form-dialog .client-form-toggle > .icon {
  color: var(--pop-muted);
}

.stats-modal-card.pos-dialog.client-form-dialog .client-form-switch {
  background: var(--pop-border);
}

.stats-modal-card.pos-dialog.client-form-dialog .client-form-switch i {
  background: var(--pop-surface);
}

.stats-modal-card.pos-dialog.client-form-dialog .client-form-toggle.on .client-form-switch {
  background: var(--pop-accent);
}

/* As opções de crediário e pessoa jurídica usam o toggle compartilhado
   de Produtos. No tema claro, sobrescreve a paleta branca do componente-base
   somente dentro do formulário de cliente. */
html:not([data-theme="dark"]) .stats-modal-card.pos-dialog.client-form-dialog
  .prod-toggle-row > span {
  color: var(--pop-ink);
}

html:not([data-theme="dark"]) .stats-modal-card.pos-dialog.client-form-dialog
  .prod-switch {
  border-color: rgba(29, 29, 31, 0.12);
  background: #e2e2e5;
}

html:not([data-theme="dark"]) .stats-modal-card.pos-dialog.client-form-dialog
  .prod-switch::after {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}

html:not([data-theme="dark"]) .stats-modal-card.pos-dialog.client-form-dialog
  .prod-switch.on {
  border-color: var(--pop-success);
  background: var(--pop-success);
}

.stats-modal-card.pos-dialog.client-form-dialog .client-section-toggle {
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.client-form-dialog .client-section-toggle .icon,
.stats-modal-card.pos-dialog.client-form-dialog .client-cep-status,
.stats-modal-card.pos-dialog.client-form-dialog .client-validation {
  color: var(--pop-muted);
}

.stats-modal-card.pos-dialog.client-form-dialog .client-form-field-error {
  border-color: var(--pop-danger);
  box-shadow: 0 0 0 2px var(--pop-danger-bg);
}

.stats-modal-card.pos-dialog.client-form-dialog .client-form-field-error span {
  color: var(--pop-danger);
}

/* ---------- telas estreitas ---------- */
@media (max-width: 680px) {
  .stats-modal-card.pos-dialog,
  .stats-modal-card.pos-item-edit-dialog {
    border-radius: 18px;
  }

  .stats-modal-card.pos-dialog .stats-modal-body,
  .stats-modal-card.pos-item-edit-dialog .stats-modal-body {
    padding: 12px 13px 10px;
  }

  .stats-modal-card.pos-dialog .stats-modal-foot,
  .stats-modal-card.pos-item-edit-dialog .stats-modal-foot {
    padding: 10px 13px 12px;
  }
}

/* ---------- tema escuro: regras antigas com html[data-theme="dark"] têm
   especificidade maior, então os mesmos valores são repetidos aqui (os
   tokens --pop-* já resolvem para a paleta escura). ---------- */
html[data-theme="dark"] .stats-modal-card.pos-dialog,
html[data-theme="dark"] .stats-modal-card.pos-item-edit-dialog {
  border-color: var(--pop-border);
  background: var(--pop-surface);
  box-shadow: var(--pop-shadow);
  color: var(--pop-ink);
}

html[data-theme="dark"] .stats-modal-card.pos-dialog .stats-modal-head,
html[data-theme="dark"] .stats-modal-card.pos-item-edit-dialog .stats-modal-head,
html[data-theme="dark"] .stats-modal-card.pos-dialog .stats-modal-foot,
html[data-theme="dark"] .stats-modal-card.pos-item-edit-dialog .stats-modal-foot {
  border-color: var(--pop-border);
  background: var(--pop-foot);
}

html[data-theme="dark"] .stats-modal-card.pos-dialog .stats-modal-head h3,
html[data-theme="dark"] .stats-modal-card.pos-item-edit-dialog .stats-modal-head h3 {
  color: var(--pop-ink);
}

html[data-theme="dark"] .stats-modal-card.pos-dialog .stats-modal-close,
html[data-theme="dark"] .stats-modal-card.pos-item-edit-dialog .stats-modal-close,
html[data-theme="dark"] .stats-modal-card.password-reset-dialog .stats-modal-close {
  border-color: var(--pop-border-soft);
  background: var(--pop-surface-alt);
  color: var(--pop-close-ink);
}

html[data-theme="dark"] .stats-modal-card.pos-dialog .stats-modal-primary,
html[data-theme="dark"] .stats-modal-card.pos-item-edit-dialog .stats-modal-primary,
html[data-theme="dark"] .stats-modal-card.pos-item-edit-dialog .stats-modal-primary:hover {
  border-color: var(--pop-primary-bg);
  background: var(--pop-primary-bg);
  color: var(--pop-primary-ink);
}

html[data-theme="dark"] .stats-modal-card.pos-dialog .stats-modal-secondary,
html[data-theme="dark"] .stats-modal-card.pos-dialog .stats-modal-danger,
html[data-theme="dark"] .stats-modal-card.pos-item-edit-dialog .stats-modal-secondary,
html[data-theme="dark"] .stats-modal-card.pos-item-edit-dialog .stats-modal-danger {
  border-color: var(--pop-border);
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}

html[data-theme="dark"] .stats-modal-card.pos-dialog .stats-modal-secondary:hover,
html[data-theme="dark"] .stats-modal-card.pos-dialog .stats-modal-danger:hover,
html[data-theme="dark"] .stats-modal-card.pos-item-edit-dialog .stats-modal-cancel:hover {
  background: var(--pop-hover);
}

html[data-theme="dark"] .stats-modal-card.pos-item-edit-dialog .stats-modal-danger.pos-item-edit-remove {
  border-color: var(--pop-danger-border);
  background: var(--pop-danger-bg);
  color: var(--pop-danger);
}

html[data-theme="dark"] .stats-modal-card.pos-dialog .stats-modal-field,
html[data-theme="dark"] .stats-modal-card.pos-dialog .pos-search,
html[data-theme="dark"] .stats-modal-card.pos-dialog .pos-step-btn,
html[data-theme="dark"] .stats-modal-card.pos-dialog .pos-stepper input,
html[data-theme="dark"] .stats-modal-card.pos-dialog .pos-picker-item,
html[data-theme="dark"] .stats-modal-card.pos-dialog .pos-client-btn,
html[data-theme="dark"] .stats-modal-card.pos-dialog .pos-review-row,
html[data-theme="dark"] .stats-modal-card.pos-dialog .pos-review-pay,
html[data-theme="dark"] .stats-modal-card.pos-dialog .pos-pay-method,
html[data-theme="dark"] .stats-modal-card.pos-dialog .pos-ghost-btn,
html[data-theme="dark"] .stats-modal-card.pos-dialog .pos-finalize-btn,
html[data-theme="dark"] .stats-modal-card.pos-dialog .pos-qty-btn,
html[data-theme="dark"] .stats-modal-card.pos-dialog .pos-discount-btn-grid .os-ed-outline-btn,
html[data-theme="dark"] .stats-modal-card.pos-item-edit-dialog .pos-item-edit-field {
  border-color: var(--pop-border);
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}

html[data-theme="dark"] .stats-modal-card.pos-dialog .stats-modal-field input,
html[data-theme="dark"] .stats-modal-card.pos-dialog .stats-modal-field select,
html[data-theme="dark"] .stats-modal-card.pos-dialog .stats-modal-field textarea,
html[data-theme="dark"] .stats-modal-card.pos-dialog .pos-search input {
  color: var(--pop-ink);
}

html[data-theme="dark"] .stats-modal-card.pos-dialog .stats-modal-field span,
html[data-theme="dark"] .stats-modal-card.pos-dialog .pos-search-ic,
html[data-theme="dark"] .stats-modal-card.pos-dialog .pos-dialog-sub,
html[data-theme="dark"] .stats-modal-card.pos-dialog .pos-review-row small,
html[data-theme="dark"] .stats-modal-card.pos-dialog .pos-pay-caption,
html[data-theme="dark"] .stats-modal-card.pos-dialog .pos-pay-remaining-label {
  color: var(--pop-muted);
}

html[data-theme="dark"] .stats-modal-card.pos-dialog .pos-picker-item.selected,
html[data-theme="dark"] .stats-modal-card.pos-dialog .pos-pay-method.active {
  border-color: var(--pop-accent);
  background: var(--pop-accent-soft);
}

html[data-theme="dark"] .stats-modal-card.pos-dialog .pos-pay-method.active,
html[data-theme="dark"] .stats-modal-card.pos-dialog .pos-pay-method.active .icon {
  color: var(--pop-accent);
}

html[data-theme="dark"] .stats-modal-card.pos-dialog.client-form-dialog .stats-modal-field span,
html[data-theme="dark"] .stats-modal-card.pos-dialog.client-form-dialog .client-form-toggle > .icon {
  color: var(--pop-muted);
}

html[data-theme="dark"] .stats-modal-card.pos-dialog.client-form-dialog .stats-modal-field input,
html[data-theme="dark"] .stats-modal-card.pos-dialog.client-form-dialog .stats-modal-field textarea,
html[data-theme="dark"] .stats-modal-card.pos-dialog.client-form-dialog .client-form-toggle {
  color: var(--pop-ink);
}

/* ---------- Contas a receber > contas do cliente ----------
   Mantém a estrutura do fluxo e herda a paleta claro/escuro dos novos
   pop-ups (.pos-dialog), sem cores escuras fixas no conteúdo interno. */
.stats-modal-card.pos-dialog.cr-cust-dialog {
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-tabs {
  border-bottom-color: var(--pop-border);
}

.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-tab {
  color: var(--pop-muted);
}

.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-tab:hover {
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-tab.active {
  border-bottom-color: var(--pop-accent);
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-summary,
.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-name,
.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-receive,
.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-thead,
.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-row {
  border-color: var(--pop-border);
  background: var(--pop-surface-alt);
}

.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-summary .cr-metric span,
.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-row .c-conta > small {
  color: var(--pop-muted);
}

.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-summary .cr-metric b,
.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-name,
.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-row .c-conta > b,
.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-row .c-num,
.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-row .c-mid {
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-value {
  border-color: var(--pop-border);
  background: var(--pop-surface);
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-value:focus-within {
  border-color: var(--pop-accent);
  box-shadow: 0 0 0 2px var(--pop-accent-soft);
}

.stats-modal-card.pos-dialog.cr-cust-dialog .cr-pay-input {
  color: var(--pop-accent);
}

.stats-modal-card.pos-dialog.cr-cust-dialog .cr-pay-input::placeholder {
  color: var(--pop-muted);
}

.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-receber {
  border-color: var(--pop-primary-bg);
  background: var(--pop-primary-bg);
  color: var(--pop-primary-ink);
}

.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-receber:hover {
  background: var(--pop-primary-bg);
  opacity: 0.88;
}

.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-receber:disabled {
  cursor: default;
  opacity: 0.5;
}

.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-actbtns button {
  border-color: var(--pop-border);
  background: var(--pop-surface);
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-actbtns button:hover,
.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-row:hover {
  border-color: var(--pop-border);
  background: var(--pop-hover);
}

.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-actbtns .icon {
  color: var(--pop-accent);
}

.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-thead > span {
  color: var(--pop-muted);
}

.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-row .cp-actbtn {
  color: var(--pop-muted);
}

.stats-modal-card.pos-dialog.cr-cust-dialog .cr-cust-row .cp-actbtn:hover {
  background: var(--pop-hover);
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.cr-cust-dialog .cp-check {
  accent-color: var(--pop-accent);
}

.stats-modal-card.pos-dialog.cr-cust-dialog .stats-modal-foot .stats-modal-secondary {
  border-color: var(--pop-border);
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.cr-cust-dialog .stats-modal-foot .stats-modal-secondary:hover {
  background: var(--pop-hover);
}

/* Estado fiscal da linha e selo usam a mesma semântica. */
.vendas-row.notas-fiscal-row {
  --nota-status-accent: #ed8b00;
  --nota-status-border: rgba(237, 139, 0, 0.32);
  --nota-status-surface: #fff7e8;
  --nota-status-surface-hover: #ffefcf;
  background: var(--nota-status-surface);
  border-color: var(--nota-status-border);
  box-shadow: none;
  align-items: center;
  transition: background 140ms ease, border-color 140ms ease;
}

.vendas-row.notas-fiscal-row:hover {
  background: var(--nota-status-surface-hover);
}

.vendas-row.notas-fiscal-row--authorized {
  --nota-status-accent: #168a52;
  --nota-status-border: rgba(22, 138, 82, 0.28);
  --nota-status-surface: #edf9f2;
  --nota-status-surface-hover: #e3f5eb;
}

.vendas-row.notas-fiscal-row--rejected {
  --nota-status-accent: #df3140;
  --nota-status-border: rgba(223, 49, 64, 0.27);
  --nota-status-surface: #fff1f2;
  --nota-status-surface-hover: #ffe7e9;
}

.vendas-row.notas-fiscal-row--pending {
  --nota-status-accent: #ed8b00;
  --nota-status-border: rgba(237, 139, 0, 0.32);
  --nota-status-surface: #fff7e8;
  --nota-status-surface-hover: #ffefcf;
}

.notas-fiscal-row .notas-fiscal-badge.ok {
  color: #0f7543;
  background: rgba(22, 138, 82, 0.12);
  border-color: rgba(22, 138, 82, 0.32);
}

.notas-fiscal-row .notas-fiscal-badge.danger {
  color: #c92334;
  background: rgba(223, 49, 64, 0.10);
  border-color: rgba(223, 49, 64, 0.30);
}

.notas-fiscal-row .notas-fiscal-badge.pending {
  color: #a75a00;
  background: rgba(237, 139, 0, 0.14);
  border-color: rgba(237, 139, 0, 0.36);
}

.notas-fiscal-row .vendas-status {
  align-self: stretch;
  justify-content: center;
}

.notas-fiscal-row .notas-fiscal-badge {
  margin-inline: auto;
}

.notas-fiscal-row .notas-row-action {
  width: 38px;
  flex-basis: 38px;
  align-self: center;
}

html[data-theme="dark"] .vendas-row.notas-fiscal-row {
  background: var(--nota-status-surface);
  border-color: var(--nota-status-border);
  box-shadow: none;
}

html[data-theme="dark"] .vendas-row.notas-fiscal-row:hover {
  background: var(--nota-status-surface-hover);
}

html[data-theme="dark"] .vendas-row.notas-fiscal-row--authorized {
  --nota-status-accent: #43d38c;
  --nota-status-border: rgba(67, 211, 140, 0.30);
  --nota-status-surface: rgba(31, 139, 88, 0.18);
  --nota-status-surface-hover: rgba(31, 139, 88, 0.25);
}

html[data-theme="dark"] .vendas-row.notas-fiscal-row--rejected {
  --nota-status-accent: #ff666f;
  --nota-status-border: rgba(255, 102, 111, 0.30);
  --nota-status-surface: rgba(196, 45, 57, 0.17);
  --nota-status-surface-hover: rgba(196, 45, 57, 0.24);
}

html[data-theme="dark"] .vendas-row.notas-fiscal-row--pending {
  --nota-status-accent: #ffad33;
  --nota-status-border: rgba(255, 173, 51, 0.32);
  --nota-status-surface: rgba(192, 112, 0, 0.18);
  --nota-status-surface-hover: rgba(192, 112, 0, 0.25);
}

html[data-theme="dark"] .notas-fiscal-row .notas-fiscal-badge.ok {
  color: #6ce7aa;
  background: rgba(67, 211, 140, 0.14);
  border-color: rgba(67, 211, 140, 0.34);
}

html[data-theme="dark"] .notas-fiscal-row .notas-fiscal-badge.danger {
  color: #ff8a91;
  background: rgba(255, 102, 111, 0.14);
  border-color: rgba(255, 102, 111, 0.34);
}

html[data-theme="dark"] .notas-fiscal-row .notas-fiscal-badge.pending {
  color: #ffc261;
  background: rgba(255, 173, 51, 0.16);
  border-color: rgba(255, 173, 51, 0.38);
}

/* Crediário: seletor de vários produtos com quantidade por item. */
.cred-products-dialog { width: min(680px, calc(100vw - 32px)); }
.cred-products-dialog .stats-modal-foot {
  display: grid;
  grid-template-columns: auto auto minmax(210px, 1fr);
  align-items: center;
  justify-content: stretch;
  gap: 10px;
  flex-wrap: nowrap;
}
.cred-products-dialog .stats-modal-foot > button { width: auto; margin: 0; }
.cred-products-dialog .stats-modal-foot > [data-cancel] { min-width: 110px; padding-inline: 14px; }
.cred-products-dialog .stats-modal-foot > [data-no-product] { min-width: 145px; padding-inline: 14px; }
.cred-products-dialog [data-confirm-products] { min-width: 210px; padding-inline: 16px; }
.cred-products-dialog [data-confirm-products]:disabled { opacity: 0.45; cursor: default; }
.cred-product-item { cursor: default; }
.cred-product-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; cursor: pointer; }
.cred-product-copy span { color: var(--muted); font-size: 11px; font-weight: 650; }
.cred-product-qty { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.cred-product-qty button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(29, 29, 31, 0.12);
  border-radius: 10px;
  background: rgba(29, 29, 31, 0.06);
  color: var(--ink);
  cursor: pointer;
}
.cred-product-qty button:disabled { opacity: 0.32; cursor: default; }
.cred-product-qty button .icon { width: 15px; height: 15px; }
.cred-product-qty strong { min-width: 24px; text-align: center; color: var(--ink); font-size: 14px; }
html[data-theme="dark"] .cred-product-copy span { color: var(--pop-muted); }
html[data-theme="dark"] .cred-product-qty button {
  border-color: var(--pop-line);
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}
html[data-theme="dark"] .cred-product-qty strong { color: var(--pop-ink); }

@media (max-width: 640px) {
  .cred-products-dialog .pos-picker-item { align-items: flex-start; }
  .cred-product-qty { align-self: center; }
  .cred-products-dialog .stats-modal-foot {
    grid-template-columns: 0.72fr 1fr 1.48fr;
    gap: 6px;
  }
  .cred-products-dialog .stats-modal-foot > button,
  .cred-products-dialog .stats-modal-foot > [data-cancel],
  .cred-products-dialog .stats-modal-foot > [data-no-product],
  .cred-products-dialog [data-confirm-products] {
    width: 100%;
    min-width: 0;
    height: 46px;
    padding-inline: 6px;
    font-size: 11.5px;
    line-height: 1.1;
    white-space: normal;
  }
}

/* Formulário completo de fornecedor no mesmo padrão dos cadastros rápidos.
   Os tokens --pop-* mantêm o cartão branco no claro e escuro no tema escuro. */
.stats-modal-card.pos-dialog.catalog-supplier-dialog {
  width: min(480px, calc(100vw - 32px)) !important;
  max-height: min(760px, calc(100dvh - 32px));
}

.stats-modal-card.pos-dialog.catalog-supplier-dialog .stats-modal-body {
  background: var(--pop-surface);
}

.stats-modal-card.pos-dialog.catalog-supplier-dialog .stats-modal-foot {
  display: flex;
}

.stats-modal-card.pos-dialog.catalog-supplier-dialog .stats-modal-foot > button {
  width: auto;
  flex: 1 1 0;
}

.stats-modal-card.pos-dialog.catalog-supplier-dialog .prod-inline-toggle .prod-toggle-row {
  width: 100%;
  min-height: 49px;
  margin: 8px 0 0;
  padding: 0 2px;
}

.stats-modal-card.pos-dialog.catalog-supplier-dialog .stats-modal-body > .prod-toggle-row {
  min-height: 49px;
  margin: 8px 0 0;
  padding: 0 2px;
}

.stats-modal-card.pos-dialog.catalog-supplier-dialog .prod-toggle-row > span {
  color: var(--pop-ink);
}

html:not([data-theme="dark"]) .stats-modal-card.pos-dialog.catalog-supplier-dialog .prod-switch {
  border-color: rgba(29, 29, 31, 0.12);
  background: #e2e2e5;
}

html:not([data-theme="dark"]) .stats-modal-card.pos-dialog.catalog-supplier-dialog .prod-switch::after {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}

html:not([data-theme="dark"]) .stats-modal-card.pos-dialog.catalog-supplier-dialog .prod-switch.on {
  border-color: var(--pop-success);
  background: var(--pop-success);
}

@media (max-width: 640px) {
  .stats-modal-card.pos-dialog.catalog-supplier-dialog {
    width: min(480px, calc(100vw - 24px)) !important;
    max-height: calc(var(--app-height) - 24px);
  }
}

/* ---------- Caixa > Fechamento ----------
   Mantém a tabela e a operação originais, substituindo somente as cores
   fixas do diálogo antigo pelos tokens claro/escuro dos novos pop-ups. */
.stats-modal-card.pos-dialog.cash-close-dialog {
  width: min(920px, 100%) !important;
  border-color: var(--pop-border) !important;
  background: var(--pop-surface) !important;
  color: var(--pop-ink) !important;
}

.stats-modal-card.pos-dialog.cash-close-dialog .stats-modal-head,
.stats-modal-card.pos-dialog.cash-close-dialog .stats-modal-foot {
  border-color: var(--pop-border) !important;
  background: var(--pop-foot) !important;
}

.stats-modal-card.pos-dialog.cash-close-dialog .stats-modal-head h3 {
  color: var(--pop-ink) !important;
  font-weight: 500 !important;
}

.stats-modal-card.pos-dialog.cash-close-dialog .stats-modal-close {
  border-color: var(--pop-border-soft) !important;
  background: var(--pop-surface-alt) !important;
  color: var(--pop-close-ink) !important;
}

.stats-modal-card.pos-dialog.cash-close-dialog .stats-modal-close:hover {
  background: var(--pop-hover) !important;
}

.stats-modal-card.pos-dialog.cash-close-dialog .cash-dialog-sub {
  color: var(--pop-muted) !important;
}

.stats-modal-card.pos-dialog.cash-close-dialog .cash-close-table {
  gap: 0;
  overflow: hidden;
  padding: 0 12px;
  border: 1px solid var(--pop-border);
  border-radius: 14px;
  background: var(--pop-surface-alt);
}

.stats-modal-card.pos-dialog.cash-close-dialog .cash-close-head {
  min-height: 38px;
  color: var(--pop-muted) !important;
}

.stats-modal-card.pos-dialog.cash-close-dialog .cash-close-row,
.stats-modal-card.pos-dialog.cash-close-dialog .cash-close-total {
  min-height: 52px;
  border-top-color: var(--pop-border) !important;
  color: var(--pop-ink) !important;
}

.stats-modal-card.pos-dialog.cash-close-dialog .cash-close-row input {
  border-color: var(--pop-border) !important;
  background: var(--pop-surface) !important;
  color: var(--pop-ink) !important;
  box-shadow: none !important;
}

.stats-modal-card.pos-dialog.cash-close-dialog .cash-close-row input::placeholder {
  color: var(--pop-muted) !important;
}

.stats-modal-card.pos-dialog.cash-close-dialog .cash-close-row strong,
.stats-modal-card.pos-dialog.cash-close-dialog .cash-close-total strong {
  color: var(--pop-ink) !important;
}

.stats-modal-card.pos-dialog.cash-close-dialog .cash-close-row strong.positive,
.stats-modal-card.pos-dialog.cash-close-dialog .cash-close-total strong.positive {
  color: var(--pop-success) !important;
}

.stats-modal-card.pos-dialog.cash-close-dialog .cash-close-row strong.negative,
.stats-modal-card.pos-dialog.cash-close-dialog .cash-close-total strong.negative {
  color: var(--pop-danger) !important;
}

.stats-modal-card.pos-dialog.cash-close-dialog .cash-autofill {
  color: var(--pop-accent) !important;
}

.stats-modal-card.pos-dialog.cash-close-dialog .cash-autofill:hover {
  color: var(--pop-ink) !important;
}

.stats-modal-card.pos-dialog.cash-close-dialog .stats-modal-field {
  border-color: var(--pop-border) !important;
  border-radius: 13px !important;
  background: var(--pop-surface-alt) !important;
}

.stats-modal-card.pos-dialog.cash-close-dialog .stats-modal-field span {
  color: var(--pop-muted) !important;
  font-weight: 400 !important;
}

.stats-modal-card.pos-dialog.cash-close-dialog .stats-modal-field textarea {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--pop-ink) !important;
}

.stats-modal-card.pos-dialog.cash-close-dialog .stats-modal-danger {
  border-color: var(--pop-border) !important;
  background: var(--pop-surface-alt) !important;
  color: var(--pop-ink) !important;
}

.stats-modal-card.pos-dialog.cash-close-dialog .stats-modal-danger:hover {
  background: var(--pop-hover) !important;
}

.stats-modal-card.pos-dialog.cash-close-dialog .stats-modal-primary {
  border-color: var(--pop-primary-bg) !important;
  background: var(--pop-primary-bg) !important;
  color: var(--pop-primary-ink) !important;
}

.stats-modal-card.pos-dialog.cash-close-dialog .stats-modal-primary:hover {
  opacity: 0.88;
}

/* Produtos: Promoção e Alterar estoque usam o mesmo pop-up claro e compacto
   das Opções. O escopo evita mudar os demais stats-filter-dialog. */
.stats-modal-card.rdx-project-popover.prod-stock-dialog {
  width: min(360px, calc(100vw - 26px));
}

.stats-modal-card.rdx-project-popover.prod-promotion-dialog {
  width: min(440px, calc(100vw - 26px));
}

.rdx-project-popover.prod-stock-dialog .prod-seg,
.rdx-project-popover.prod-promotion-dialog .prod-seg {
  border-color: rgba(29, 29, 31, 0.09);
  background: #f5f5f7;
}

.rdx-project-popover.prod-stock-dialog .prod-seg-btn,
.rdx-project-popover.prod-promotion-dialog .prod-seg-btn {
  color: #6e6e73;
}

.rdx-project-popover.prod-stock-dialog .prod-seg-btn.active,
.rdx-project-popover.prod-promotion-dialog .prod-seg-btn.active {
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.07);
}

.rdx-project-popover.prod-stock-dialog .prod-stock-preview {
  color: #1d1d1f;
}

.rdx-project-popover.prod-stock-dialog .prod-stock-preview.danger {
  color: #d70015;
}

.prod-stock-store-choice {
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(29, 29, 31, 0.09);
  border-radius: 12px;
  background: #f8f8fa;
  color: #1d1d1f;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, transform 120ms ease;
}

.prod-stock-store-choice:hover {
  background: #f0f0f2;
}

.prod-stock-store-choice:active {
  transform: scale(0.985);
}

.prod-promotion-unit-seg {
  width: 100%;
  height: 48px;
  box-sizing: border-box;
  display: flex;
  margin: 8px 0;
  padding: 4px;
}

.prod-promotion-unit-seg .prod-seg-btn {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.prod-promotion-icon-toggle {
  margin-top: 8px;
}

.prod-promotion-preview {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(29, 29, 31, 0.09);
  border-radius: 14px;
  background: #f8f8fa;
  pointer-events: none;
}

.prod-promotion-preview-label {
  display: block;
  margin-bottom: 8px;
  color: #6e6e73;
  font-size: 11px;
}

.prod-promotion-preview-banner {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  background: #84d693;
  color: #111111;
  font-size: 11px;
  font-weight: 700;
}

.prod-promotion-preview-copy {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prod-promotion-preview-timer {
  padding: 2px 6px;
  border-radius: 10px;
  background: #ffffff;
}

.prod-promotion-preview-card {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 16px;
  background: #84d693;
  color: #111111;
  font-size: 10px;
  font-weight: 700;
}

html[data-theme="dark"] .rdx-project-popover.prod-stock-dialog .prod-seg,
html[data-theme="dark"] .rdx-project-popover.prod-promotion-dialog .prod-seg {
  border-color: rgba(255, 255, 255, 0.12);
  background: #20232a;
}

html[data-theme="dark"] .rdx-project-popover.prod-stock-dialog .prod-seg-btn,
html[data-theme="dark"] .rdx-project-popover.prod-promotion-dialog .prod-seg-btn {
  color: #a4a7ae;
}

html[data-theme="dark"] .rdx-project-popover.prod-stock-dialog .prod-seg-btn.active,
html[data-theme="dark"] .rdx-project-popover.prod-promotion-dialog .prod-seg-btn.active {
  background: #111318;
  color: #f5f5f7;
  box-shadow: none;
}

html[data-theme="dark"] .rdx-project-popover.prod-stock-dialog .prod-stock-preview {
  color: #f5f5f7;
}

html[data-theme="dark"] .rdx-project-popover.prod-stock-dialog .prod-stock-preview.danger {
  color: #ff6c6c;
}

html[data-theme="dark"] .prod-stock-store-choice,
html[data-theme="dark"] .prod-promotion-preview {
  border-color: rgba(255, 255, 255, 0.10);
  background: #20232a;
  color: #f5f5f7;
}

html[data-theme="dark"] .prod-stock-store-choice:hover {
  background: #292c34;
}

html[data-theme="dark"] .prod-promotion-preview-label {
  color: #a4a7ae;
}

@media (max-width: 680px) {
  .stats-modal-card.rdx-project-popover.prod-stock-dialog,
  .stats-modal-card.rdx-project-popover.prod-promotion-dialog {
    width: min(100%, calc(100vw - 24px));
  }
}

/* Produtos: o atalho que abre Editar/Promoção/Estoque acompanha o tema
   atual sem alterar os demais prod-icon-btn usados pelo sistema. */
.prod-actions-trigger {
  width: 38px;
  height: 38px;
  border-color: rgba(0, 113, 227, 0.16);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.94);
  color: #0071e3;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.prod-actions-trigger:hover {
  border-color: rgba(0, 113, 227, 0.28);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.10);
  transform: translateY(-1px);
}

.prod-actions-trigger:active {
  transform: scale(0.95);
}

.prod-actions-trigger:focus-visible {
  outline: 2px solid rgba(0, 113, 227, 0.42);
  outline-offset: 2px;
}

.prod-actions-trigger .icon {
  width: 18px;
  height: 18px;
}

html[data-theme="dark"] .prod-actions-trigger {
  border-color: rgba(94, 168, 255, 0.26);
  background: #0e1015;
  color: #5ea8ff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .prod-actions-trigger:hover {
  border-color: rgba(94, 168, 255, 0.46);
  background: #24272e;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.30);
}

/* No tema escuro, preço e estoque normal usam o mesmo contraste secundário
   da listagem. Estoque zerado continua vermelho pelas regras existentes. */
html[data-theme="dark"] .prod-card-meta,
html[data-theme="dark"] .prod-row-meta {
  color: #a4a7ae;
}

html[data-theme="dark"] .prod-card-meta .prod-stock-label:not(.is-empty),
html[data-theme="dark"] .prod-row-meta .prod-stock-label:not(.is-empty) {
  color: #a4a7ae;
}

html[data-theme="dark"] .prod-card-meta > .promo,
html[data-theme="dark"] .prod-row-meta > .promo,
html[data-theme="dark"] .prod-card-promo {
  color: #e0ad5a;
}

@media (prefers-reduced-motion: reduce) {
  .prod-actions-trigger {
    transition: none;
  }
}

/* Produtos: ações compactas das tabelas de Categorias, Marcas,
   Fornecedores e Compras seguem o mesmo acabamento do atalho do produto. */
.prod-row-actions .prod-icon-btn,
.prod-row-actions.plain-icons .prod-icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.94);
  color: #0071e3;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.prod-row-actions .prod-icon-btn:hover,
.prod-row-actions.plain-icons .prod-icon-btn:hover {
  border-color: rgba(0, 113, 227, 0.28);
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.09);
  transform: translateY(-1px);
}

.prod-row-actions .prod-icon-btn:active,
.prod-row-actions.plain-icons .prod-icon-btn:active {
  transform: scale(0.95);
}

.prod-row-actions .prod-icon-btn:focus-visible,
.prod-row-actions.plain-icons .prod-icon-btn:focus-visible {
  outline: 2px solid rgba(0, 113, 227, 0.42);
  outline-offset: 2px;
}

.prod-row-actions .prod-icon-btn.danger,
.prod-row-actions.plain-icons .prod-icon-btn.danger {
  border-color: rgba(215, 0, 21, 0.14);
  color: #d70015;
}

html[data-theme="dark"] .prod-row-actions .prod-icon-btn,
html[data-theme="dark"] .prod-row-actions.plain-icons .prod-icon-btn {
  border-color: rgba(94, 168, 255, 0.24);
  background: #0e1015;
  color: #5ea8ff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .prod-row-actions .prod-icon-btn:hover,
html[data-theme="dark"] .prod-row-actions.plain-icons .prod-icon-btn:hover {
  border-color: rgba(94, 168, 255, 0.44);
  background: #24272e;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .prod-row-actions .prod-icon-btn.danger,
html[data-theme="dark"] .prod-row-actions.plain-icons .prod-icon-btn.danger {
  border-color: rgba(255, 108, 108, 0.24);
  color: #ff6c6c;
}

@media (prefers-reduced-motion: reduce) {
  .prod-row-actions .prod-icon-btn,
  .prod-row-actions.plain-icons .prod-icon-btn {
    transition: none;
  }
}

/* Menu mobile: o botão de três barras usa o mesmo acabamento dos novos
   atalhos de ação em todas as páginas, sem mudar a abertura da lateral. */
@media (max-width: 940px) {
  .home-mobile-menu {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid rgba(0, 113, 227, 0.16);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.94);
    color: #0071e3;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
  }

  .home-mobile-menu:hover {
    border-color: rgba(0, 113, 227, 0.28);
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.10);
    transform: translateY(-1px);
  }

  .home-mobile-menu:active {
    transform: scale(0.95);
  }

  .home-mobile-menu:focus-visible {
    outline: 2px solid rgba(0, 113, 227, 0.42);
    outline-offset: 2px;
  }

  .home-mobile-menu .icon {
    width: 18px;
    height: 18px;
  }

  /* Cabeçalho mobile compartilhado: mesma geometria do shell da Financeira.
     O wrapper da linha deixa de criar uma linha separada, e o grid posiciona
     menu, título e subtítulo como um único bloco em todas as páginas principais. */
  .stats-page > .stats-header,
  .cash-page > .cash-header {
    align-items: stretch;
    margin: 0 0 12px;
    padding: 0;
  }

  .stats-page > .stats-header > .stats-title-block,
  .cash-page > .cash-header > .cash-title-block {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 12px;
    align-items: center;
    width: 100%;
  }

  .stats-page > .stats-header .stats-mobile-title-row,
  .cash-page > .cash-header .cash-mobile-title-row {
    display: contents;
  }

  .stats-page > .stats-header .stats-mobile-title-row > .home-mobile-menu,
  .cash-page > .cash-header .cash-mobile-title-row > .home-mobile-menu {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: center;
  }

  .stats-page > .stats-header .stats-mobile-title-row > :is(h1, h2),
  .cash-page > .cash-header .cash-mobile-title-row > :is(h1, h2) {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .stats-page > .stats-header > .stats-title-block > p,
  .cash-page > .cash-header > .cash-title-block > p {
    grid-column: 2;
    grid-row: 2;
    margin-top: 9px;
    line-height: 1.22;
  }

  .cash-page > .cash-header > .cash-title-block {
    box-shadow: none;
  }

  /* Nas páginas internas de Configurações o Voltar basta: ele leva de volta ao
     menu, que é onde o botão de três barras vive. O menu sai daqui e o título
     encosta na seta. */
  .stats-page > .stats-header > .stats-title-block:has(.config-back) {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .stats-page > .stats-header > .stats-title-block:has(.config-back) .config-back {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: center;
  }

  .stats-page > .stats-header > .stats-title-block:has(.config-back) .home-mobile-menu {
    display: none;
  }

  .stats-page > .stats-header > .stats-title-block:has(.config-back) .stats-mobile-title-row > :is(h1, h2),
  .stats-page > .stats-header > .stats-title-block:has(.config-back) > p {
    grid-column: 2;
  }

  /* Crediário mantém a ação de voltar, usando a mesma geometria dos cabeçalhos mobile. */
  .crediario-overlay .cred-overlay-back-top {
    display: none;
  }

  .crediario-overlay .cred-overlay-page {
    margin-top: 0;
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .crediario-overlay .cred-overlay-header {
    align-items: stretch;
    gap: 0;
    margin: 0 0 12px;
  }
}

html[data-theme="dark"] .home-mobile-menu {
  border-color: rgba(94, 168, 255, 0.26);
  background: #0e1015;
  color: #5ea8ff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .home-mobile-menu:hover {
  border-color: rgba(94, 168, 255, 0.46);
  background: #24272e;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.30);
}

@media (prefers-reduced-motion: reduce) {
  .home-mobile-menu {
    transition: none;
  }
}

/* Clientes: ações superiores, filtros, editar/excluir e atalhos mobile
   usam o mesmo sistema visual dos novos botões do RDX. */
.clients-desktop-controls .prod-tool-btn,
.clients-desktop-controls .prod-btn-new {
  border-color: rgba(0, 113, 227, 0.16);
  background: rgba(255, 255, 255, 0.94);
  color: #0071e3;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.clients-desktop-controls .clients-birthday-action {
  border-color: rgba(0, 113, 227, 0.16) !important;
  color: #0071e3 !important;
}

.clients-desktop-controls .prod-btn-chip,
.clients-desktop-controls .prod-btn-chip .icon,
.clients-desktop-controls .clients-birthday-action .prod-btn-chip {
  color: #0071e3;
}

.clients-desktop-controls .prod-tool-btn:hover,
.clients-desktop-controls .prod-btn-new:hover {
  border-color: rgba(0, 113, 227, 0.28);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.10);
  transform: translateY(-1px);
}

.clients-desktop-controls .prod-tool-btn:active,
.clients-desktop-controls .prod-btn-new:active {
  transform: scale(0.97);
}

.clients-desktop-controls .prod-tool-btn:focus-visible,
.clients-desktop-controls .prod-btn-new:focus-visible,
.client-filter-chip:focus-visible,
.client-icon-action:focus-visible,
.clients-mobile-filter:focus-visible,
.clients-mobile-birthday:focus-visible {
  outline: 2px solid rgba(0, 113, 227, 0.42);
  outline-offset: 2px;
}

.client-filter-chip {
  border-color: rgba(0, 113, 227, 0.14);
  background: rgba(255, 255, 255, 0.94);
  color: #4175a8;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.client-filter-chip.active {
  border-color: rgba(0, 113, 227, 0.34);
  background: rgba(0, 113, 227, 0.09);
  color: #0071e3;
  box-shadow: 0 6px 14px rgba(0, 113, 227, 0.10);
}

.client-filter-chip:hover {
  border-color: rgba(0, 113, 227, 0.26);
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.client-icon-action {
  width: 38px;
  height: 38px;
  border-color: rgba(0, 113, 227, 0.16);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.94);
  color: #0071e3;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.client-icon-action:hover {
  border-color: rgba(0, 113, 227, 0.28);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.10);
}

.client-icon-action.danger {
  border-color: rgba(215, 0, 21, 0.14);
  color: #d70015;
}

.clients-mobile-filter,
.clients-mobile-birthday {
  border-color: rgba(0, 113, 227, 0.16);
  background: rgba(255, 255, 255, 0.94);
  color: #0071e3;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.clients-mobile-filter:active,
.clients-mobile-birthday:active {
  transform: scale(0.95);
}

html[data-theme="dark"] .clients-desktop-controls .prod-tool-btn,
html[data-theme="dark"] .clients-desktop-controls .prod-btn-new,
html[data-theme="dark"] .client-icon-action,
html[data-theme="dark"] .clients-mobile-filter,
html[data-theme="dark"] .clients-mobile-birthday {
  border-color: rgba(94, 168, 255, 0.26);
  background: #0e1015;
  color: #5ea8ff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .clients-desktop-controls .clients-birthday-action {
  border-color: rgba(94, 168, 255, 0.26) !important;
  color: #5ea8ff !important;
}

html[data-theme="dark"] .clients-desktop-controls .prod-btn-chip,
html[data-theme="dark"] .clients-desktop-controls .prod-btn-chip .icon,
html[data-theme="dark"] .clients-desktop-controls .clients-birthday-action .prod-btn-chip {
  color: #5ea8ff;
}

html[data-theme="dark"] .client-filter-chip {
  border-color: rgba(94, 168, 255, 0.20);
  background: #181b22;
  color: #a4a7ae;
}

html[data-theme="dark"] .client-filter-chip.active {
  border-color: rgba(94, 168, 255, 0.42);
  background: rgba(94, 168, 255, 0.13);
  color: #5ea8ff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .clients-desktop-controls .prod-tool-btn:hover,
html[data-theme="dark"] .clients-desktop-controls .prod-btn-new:hover,
html[data-theme="dark"] .client-icon-action:hover,
html[data-theme="dark"] .clients-mobile-filter:hover,
html[data-theme="dark"] .clients-mobile-birthday:hover {
  border-color: rgba(94, 168, 255, 0.46);
  background: #24272e;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.30);
}

html[data-theme="dark"] .client-icon-action.danger {
  border-color: rgba(255, 108, 108, 0.24);
  color: #ff6c6c;
}

@media (prefers-reduced-motion: reduce) {
  .clients-desktop-controls .prod-tool-btn,
  .clients-desktop-controls .prod-btn-new,
  .client-filter-chip,
  .client-icon-action,
  .clients-mobile-filter,
  .clients-mobile-birthday {
    transition: none;
  }
}

/* Outras abas: barras de ação de Produtos/Estoque, Vendas, O.S.,
   Financeiro e Notas seguem o mesmo botão contornado azul de Clientes. */
.prod-toolbar .prod-tool-btn,
.prod-toolbar .prod-btn-new,
.vendas-toolbar .vendas-pill:not(.cp-pay-btn) {
  border-color: rgba(0, 113, 227, 0.16);
  background: rgba(255, 255, 255, 0.94);
  color: #0071e3;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.prod-toolbar .prod-btn-chip,
.prod-toolbar .prod-btn-chip .icon,
.vendas-toolbar .vendas-pill:not(.cp-pay-btn) .icon,
.vendas-toolbar .vendas-pill.primary:not(.cp-pay-btn) .icon {
  color: #0071e3;
}

.prod-toolbar .prod-tool-btn:hover,
.prod-toolbar .prod-btn-new:hover,
.vendas-toolbar .vendas-pill:not(.cp-pay-btn):hover {
  border-color: rgba(0, 113, 227, 0.28);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.10);
  transform: translateY(-1px);
}

.prod-toolbar .prod-tool-btn:active,
.prod-toolbar .prod-btn-new:active,
.vendas-toolbar .vendas-pill:not(.cp-pay-btn):active {
  transform: scale(0.97);
}

.prod-toolbar .prod-tool-btn:focus-visible,
.prod-toolbar .prod-btn-new:focus-visible,
.vendas-toolbar .vendas-pill:focus-visible,
.vendas-tabs .vendas-tab:focus-visible,
.cp-statusrow .cp-statuspill:focus-visible,
.os-menu-btn:focus-visible,
.cp-actbtn:focus-visible,
.notas-row-action:focus-visible {
  outline: 2px solid rgba(0, 113, 227, 0.42);
  outline-offset: 2px;
}

.vendas-toolbar .vendas-pill.active:not(.cp-pay-btn) {
  border-color: rgba(0, 113, 227, 0.34);
  background: rgba(0, 113, 227, 0.09);
  color: #0071e3;
  box-shadow: 0 6px 14px rgba(0, 113, 227, 0.10);
}

/* Filtros de situação mantêm a seleção visível sem virar botão
   primário de pagamento ou conclusão. */
.vendas-tabs .vendas-tab,
.cp-statusrow .cp-statuspill {
  border-color: rgba(0, 113, 227, 0.14);
  background: rgba(255, 255, 255, 0.94);
  color: #4175a8;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 120ms ease;
}

.vendas-tabs .vendas-tab.active,
.cp-statusrow .cp-statuspill.active {
  border-color: rgba(0, 113, 227, 0.34);
  background: rgba(0, 113, 227, 0.09);
  color: #0071e3;
  box-shadow: 0 6px 14px rgba(0, 113, 227, 0.10);
}

.vendas-tabs .vendas-tab:hover,
.cp-statusrow .cp-statuspill:hover {
  border-color: rgba(0, 113, 227, 0.26);
  background: #ffffff;
  transform: translateY(-1px);
}

/* Opções por linha em O.S., Financeiro e Notas acompanham os botões
   compactos já aplicados em Produtos e Clientes. */
.os-menu-btn,
.cp-actbtn,
.notas-row-action {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.94);
  color: #0071e3;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.os-menu-btn:hover,
.cp-actbtn:hover,
.notas-row-action:hover {
  border-color: rgba(0, 113, 227, 0.28);
  background: #ffffff;
  color: #0071e3;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.09);
  transform: translateY(-1px);
}

.os-menu-btn:active,
.cp-actbtn:active,
.notas-row-action:active {
  transform: scale(0.95);
}

html[data-theme="dark"] .prod-toolbar .prod-tool-btn,
html[data-theme="dark"] .prod-toolbar .prod-btn-new,
html[data-theme="dark"] .vendas-toolbar .vendas-pill:not(.cp-pay-btn),
html[data-theme="dark"] .os-menu-btn,
html[data-theme="dark"] .cp-actbtn,
html[data-theme="dark"] .notas-row-action {
  border-color: rgba(94, 168, 255, 0.26);
  background: #0e1015;
  color: #5ea8ff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .prod-toolbar .prod-btn-chip,
html[data-theme="dark"] .prod-toolbar .prod-btn-chip .icon,
html[data-theme="dark"] .vendas-toolbar .vendas-pill:not(.cp-pay-btn) .icon {
  color: #5ea8ff;
}

html[data-theme="dark"] .vendas-tabs .vendas-tab,
html[data-theme="dark"] .cp-statusrow .cp-statuspill {
  border-color: rgba(94, 168, 255, 0.20);
  background: #181b22;
  color: #a4a7ae;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.20);
}

html[data-theme="dark"] .vendas-toolbar .vendas-pill.active:not(.cp-pay-btn),
html[data-theme="dark"] .vendas-tabs .vendas-tab.active,
html[data-theme="dark"] .cp-statusrow .cp-statuspill.active {
  border-color: rgba(94, 168, 255, 0.42);
  background: rgba(94, 168, 255, 0.13);
  color: #5ea8ff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .prod-toolbar .prod-tool-btn:hover,
html[data-theme="dark"] .prod-toolbar .prod-btn-new:hover,
html[data-theme="dark"] .vendas-toolbar .vendas-pill:not(.cp-pay-btn):hover,
html[data-theme="dark"] .vendas-tabs .vendas-tab:hover,
html[data-theme="dark"] .cp-statusrow .cp-statuspill:hover,
html[data-theme="dark"] .os-menu-btn:hover,
html[data-theme="dark"] .cp-actbtn:hover,
html[data-theme="dark"] .notas-row-action:hover {
  border-color: rgba(94, 168, 255, 0.46);
  background: #24272e;
  color: #5ea8ff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.30);
}

@media (prefers-reduced-motion: reduce) {
  .prod-toolbar .prod-tool-btn,
  .prod-toolbar .prod-btn-new,
  .vendas-toolbar .vendas-pill,
  .vendas-tabs .vendas-tab,
  .cp-statusrow .cp-statuspill,
  .os-menu-btn,
  .cp-actbtn,
  .notas-row-action {
    transition: none;
  }
}

/* Pesquisas das páginas principais e campos de acesso compartilham a mesma
   superfície. Buscas internas de formulários, seletores e pop-ups ficam à parte. */
.stats-page .prod-search,
.stats-page .vendas-search,
.login-page .login-panel .login-field,
.password-reset-dialog .login-field,
.reset-password-field {
  border-color: rgba(0, 113, 227, 0.16);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.stats-page .prod-search:hover,
.stats-page .vendas-search:hover,
.login-page .login-panel .login-field:hover,
.password-reset-dialog .login-field:hover,
.reset-password-field:hover {
  border-color: rgba(0, 113, 227, 0.24);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.09);
}

.stats-page .prod-search:focus-within,
.stats-page .vendas-search:focus-within,
.login-page .login-panel .login-field:focus-within,
.password-reset-dialog .login-field:focus-within,
.reset-password-field:focus-within {
  border-color: rgba(0, 113, 227, 0.42);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.09), 0 8px 18px rgba(0, 0, 0, 0.09);
}

.stats-page .prod-search .icon,
.stats-page .vendas-search .icon {
  color: #0071e3;
}

.stats-page .prod-search input,
.stats-page .vendas-search input {
  color: #1d1d1f;
  caret-color: #0071e3;
}

.stats-page .prod-search input::placeholder,
.stats-page .vendas-search input::placeholder {
  color: #6e6e73;
}

html[data-theme="dark"] .stats-page .prod-search,
html[data-theme="dark"] .stats-page .vendas-search,
html[data-theme="dark"] .login-page .login-panel .login-field,
html[data-theme="dark"] .password-reset-dialog .login-field,
html[data-theme="dark"] .reset-password-field {
  border-color: rgba(94, 168, 255, 0.26);
  background: #0e1015;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .stats-page .prod-search:hover,
html[data-theme="dark"] .stats-page .vendas-search:hover,
html[data-theme="dark"] .login-page .login-panel .login-field:hover,
html[data-theme="dark"] .password-reset-dialog .login-field:hover,
html[data-theme="dark"] .reset-password-field:hover {
  border-color: rgba(94, 168, 255, 0.38);
  background: #181b22;
}

html[data-theme="dark"] .stats-page .prod-search:focus-within,
html[data-theme="dark"] .stats-page .vendas-search:focus-within,
html[data-theme="dark"] .login-page .login-panel .login-field:focus-within,
html[data-theme="dark"] .password-reset-dialog .login-field:focus-within,
html[data-theme="dark"] .reset-password-field:focus-within {
  border-color: rgba(94, 168, 255, 0.56);
  background: #181b22;
  box-shadow: 0 0 0 3px rgba(94, 168, 255, 0.12), 0 8px 18px rgba(0, 0, 0, 0.30);
}

html[data-theme="dark"] .stats-page .prod-search .icon,
html[data-theme="dark"] .stats-page .vendas-search .icon {
  color: #5ea8ff;
}

html[data-theme="dark"] .stats-page .prod-search input,
html[data-theme="dark"] .stats-page .vendas-search input {
  color: #f5f5f7;
  caret-color: #5ea8ff;
}

html[data-theme="dark"] .stats-page .prod-search input::placeholder,
html[data-theme="dark"] .stats-page .vendas-search input::placeholder {
  color: #8f939c;
}

@media (prefers-reduced-motion: reduce) {
  .stats-page .prod-search,
  .stats-page .vendas-search {
    transition: none;
  }
}

/* Subabas de Produtos: Categorias, Marcas, Mov. Estoque, Fornecedores e
   Compras recebem painel, tabela e controles no novo tema. */
.prod-page .prod-subtabs .stats-tab {
  border-color: rgba(0, 113, 227, 0.14);
  background: rgba(255, 255, 255, 0.94);
  color: #4175a8;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.prod-page .prod-subtabs .stats-tab > span {
  border-color: rgba(0, 113, 227, 0.12);
  background: #ffffff;
  color: #0071e3;
}

.prod-page .prod-subtabs .stats-tab.active {
  border-color: rgba(0, 113, 227, 0.34);
  background: rgba(0, 113, 227, 0.09);
  color: #0071e3;
  box-shadow: 0 8px 18px rgba(0, 113, 227, 0.10);
}

.prod-page .prod-subtabs .stats-tab.active > span {
  border-color: rgba(0, 113, 227, 0.18);
  background: rgba(0, 113, 227, 0.10);
  color: #0071e3;
}

.prod-page .prod-subtabs .stats-tab:hover {
  border-color: rgba(0, 113, 227, 0.26);
  background: #ffffff;
}

.prod-page .prod-subtabs .stats-tab:focus-visible {
  outline: 2px solid rgba(0, 113, 227, 0.42);
  outline-offset: 2px;
}

.prod-page #produtos-body .prod-toolbar-actions .prod-seg {
  border-color: rgba(0, 113, 227, 0.14);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.prod-page #produtos-body .prod-toolbar-actions .prod-seg-btn {
  color: #4175a8;
}

.prod-page #produtos-body .prod-toolbar-actions .prod-seg-btn.active {
  background: rgba(0, 113, 227, 0.10);
  color: #0071e3;
  box-shadow: 0 4px 10px rgba(0, 113, 227, 0.10);
}

.prod-page #produtos-body .prod-panel {
  border: 1px solid rgba(0, 113, 227, 0.12);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.07);
}

.prod-page #produtos-body .stats-table-wrap {
  border: 1px solid rgba(0, 113, 227, 0.12);
  border-radius: 18px;
  background: #ffffff;
}

.prod-page #produtos-body .stats-table {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.prod-page #produtos-body .stats-table th {
  border-bottom-color: rgba(0, 113, 227, 0.14);
  background: rgba(0, 113, 227, 0.055);
  color: #315f8e;
}

.prod-page #produtos-body .stats-table td {
  border-bottom-color: rgba(0, 113, 227, 0.09);
  color: #596675;
}

.prod-page #produtos-body .stats-table td.empty {
  text-align: center;
  vertical-align: middle;
}

.prod-page #produtos-body .stats-table td.empty > .rdx-loading {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
}

.prod-page #produtos-body .prod-simple-table td {
  border-bottom-color: rgba(0, 113, 227, 0.09) !important;
}

.prod-page #produtos-body .stats-table tbody tr {
  background: rgba(255, 255, 255, 0.76);
  transition: background 160ms ease;
}

.prod-page #produtos-body .stats-table tbody tr:hover {
  background: rgba(0, 113, 227, 0.045);
}

.prod-page #produtos-body .stats-table tbody td:first-child {
  color: #1d1d1f;
  font-weight: 400;
}

html[data-theme="dark"] .prod-page .prod-subtabs .stats-tab {
  border-color: rgba(94, 168, 255, 0.20);
  background: #181b22;
  color: #a4a7ae;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .prod-page .prod-subtabs .stats-tab > span {
  border-color: rgba(94, 168, 255, 0.18);
  background: #0e1015;
  color: #5ea8ff;
}

html[data-theme="dark"] .prod-page .prod-subtabs .stats-tab.active {
  border-color: rgba(94, 168, 255, 0.42);
  background: rgba(94, 168, 255, 0.13);
  color: #5ea8ff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .prod-page .prod-subtabs .stats-tab.active > span {
  border-color: rgba(94, 168, 255, 0.26);
  background: rgba(94, 168, 255, 0.12);
  color: #5ea8ff;
}

html[data-theme="dark"] .prod-page .prod-subtabs .stats-tab:hover {
  border-color: rgba(94, 168, 255, 0.38);
  background: #24272e;
}

html[data-theme="dark"] .prod-page #produtos-body .prod-toolbar-actions .prod-seg {
  border-color: rgba(94, 168, 255, 0.20);
  background: #0e1015;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .prod-page #produtos-body .prod-toolbar-actions .prod-seg-btn {
  color: #a4a7ae;
}

html[data-theme="dark"] .prod-page #produtos-body .prod-toolbar-actions .prod-seg-btn.active {
  background: rgba(94, 168, 255, 0.13);
  color: #5ea8ff;
  box-shadow: none;
}

html[data-theme="dark"] .prod-page #produtos-body .prod-panel {
  border-color: rgba(94, 168, 255, 0.18);
  background: #111318;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .prod-page #produtos-body .stats-table-wrap {
  border-color: rgba(94, 168, 255, 0.18);
  background: #181b22;
}

html[data-theme="dark"] .prod-page #produtos-body .stats-table {
  background: transparent;
}

html[data-theme="dark"] .prod-page #produtos-body .stats-table th {
  border-bottom-color: rgba(94, 168, 255, 0.20);
  background: #0e1015;
  color: #8fc2ff;
}

html[data-theme="dark"] .prod-page #produtos-body .stats-table td,
html[data-theme="dark"] .prod-page #produtos-body .prod-simple-table td {
  border-bottom-color: rgba(94, 168, 255, 0.11) !important;
  color: #aeb2bb;
}

html[data-theme="dark"] .prod-page #produtos-body .stats-table tbody tr {
  background: #181b22;
}

html[data-theme="dark"] .prod-page #produtos-body .stats-table tbody tr:hover {
  background: #20242b;
}

html[data-theme="dark"] .prod-page #produtos-body .stats-table tbody td:first-child {
  color: #f5f5f7;
}

@media (prefers-reduced-motion: reduce) {
  .prod-page .prod-subtabs .stats-tab,
  .prod-page #produtos-body .stats-table tbody tr {
    transition: none;
  }
}

/* ===================== Vendas: lista no tema atual ===================== */
.vendas-page #vendas-list-wrap {
  overflow: hidden;
  border: 1px solid rgba(0, 113, 227, 0.12);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.055);
}

.vendas-page #vendas-list-wrap .vendas-thead {
  margin: 0;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: 0;
  background: rgba(0, 113, 227, 0.055);
}

.vendas-page #vendas-list-wrap .vendas-thead > span {
  color: #315f8e;
}

.vendas-page #vendas-list-wrap .vendas-list {
  gap: 0;
}

.vendas-page #vendas-list-wrap .vendas-row {
  border: 0;
  border-bottom: 1px solid rgba(0, 113, 227, 0.09);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: none;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.vendas-page #vendas-list-wrap .vendas-row:last-child {
  border-bottom: 0;
}

.vendas-page #vendas-list-wrap .vendas-row:hover {
  background: rgba(0, 113, 227, 0.045);
  box-shadow: inset 3px 0 0 rgba(0, 113, 227, 0.40);
}

.vendas-page #vendas-list-wrap .vendas-row:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid rgba(0, 113, 227, 0.42);
  outline-offset: -2px;
}

.vendas-page #vendas-list-wrap .vendas-row.vendas-row-pending {
  background: rgba(255, 149, 0, 0.12);
  box-shadow: inset 3px 0 0 rgba(255, 149, 0, 0.55);
}

.vendas-page #vendas-list-wrap .vendas-row.vendas-row-pending:hover {
  background: rgba(255, 149, 0, 0.17);
}

.vendas-page #vendas-list-wrap .vendas-row:has(.vendas-badge.conditional) {
  background: rgba(115, 87, 216, 0.09);
  border-bottom-color: rgba(115, 87, 216, 0.16);
  box-shadow: inset 3px 0 0 rgba(115, 87, 216, 0.42);
}

.vendas-page #vendas-list-wrap .vendas-row:has(.vendas-badge.conditional):hover {
  background: rgba(115, 87, 216, 0.14);
  box-shadow: inset 3px 0 0 rgba(115, 87, 216, 0.58);
}

.vendas-page #vendas-list-wrap .vendas-row:has(.vendas-badge.conditional) .vendas-col .cl,
.vendas-page #vendas-list-wrap .vendas-row:has(.vendas-badge.conditional) .vendas-status .cl {
  color: #756d8a;
}

.vendas-page #vendas-list-wrap .vendas-row:has(.vendas-badge.conditional) .vendas-col .cv,
.vendas-page #vendas-list-wrap .vendas-row:has(.vendas-badge.conditional) .vendas-col .cv.vendas-val-conditional {
  color: #34284f;
}

.vendas-page #vendas-list-wrap .vendas-row:has(.vendas-badge.conditional) .vendas-badge.conditional {
  color: #7357d8;
  background: rgba(255, 255, 255, 0.58);
  border-color: rgba(115, 87, 216, 0.28);
}

.vendas-page #vendas-list-wrap .vendas-empty {
  padding: 44px 20px;
}

.vendas-page #vendas-list-wrap .vendas-load-more {
  display: flex;
  width: 100%;
  min-height: 64px;
  border-top: 1px solid rgba(0, 113, 227, 0.14);
  background: rgba(0, 113, 227, 0.055);
}

.vendas-page #vendas-list-wrap .vendas-load-more-btn {
  display: flex;
  width: 100%;
  min-height: 64px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 0;
  background: transparent;
  color: #315f8e;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.vendas-page #vendas-list-wrap .vendas-load-more-btn:hover {
  background: rgba(0, 113, 227, 0.045);
  color: #164f87;
}

.vendas-page #vendas-list-wrap .vendas-load-more-btn:active {
  background: rgba(0, 113, 227, 0.08);
}

.vendas-page #vendas-list-wrap .vendas-load-more-btn:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid rgba(0, 113, 227, 0.42);
  outline-offset: -2px;
}

.vendas-page #vendas-list-wrap .vendas-load-more-btn:disabled {
  cursor: wait;
}

.vendas-page #vendas-list-wrap .vendas-load-more-spinner {
  width: 22px;
  height: 22px;
  border-width: 2.5px;
}

html[data-theme="dark"] .vendas-page #vendas-list-wrap {
  border-color: rgba(94, 168, 255, 0.18);
  background: #181b22;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-thead {
  border-bottom-color: rgba(94, 168, 255, 0.20);
  background: #0e1015;
}

html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-thead > span {
  color: #8fc2ff;
}

html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-load-more {
  border-top-color: rgba(94, 168, 255, 0.20);
  background: #0e1015;
}

html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-load-more-btn {
  color: #8fc2ff;
}

html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-load-more-btn:hover {
  background: #12151c;
  color: #b8d9ff;
}

html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-load-more-btn:active {
  background: #20242b;
}

html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-row {
  border-bottom-color: rgba(94, 168, 255, 0.11);
  background: #181b22;
}

html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-row:hover {
  background: #20242b;
  box-shadow: inset 3px 0 0 rgba(94, 168, 255, 0.48);
}

html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-row.vendas-row-pending {
  background: rgba(255, 159, 10, 0.13);
  box-shadow: inset 3px 0 0 rgba(255, 159, 10, 0.58);
}

html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-row.vendas-row-pending:hover {
  background: rgba(255, 159, 10, 0.19);
}

html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-col .cv {
  color: #f5f5f7;
}

html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-col .cv.vendas-val-ok {
  color: #4fe39a;
}

html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-col .cv.vendas-val-cancel {
  color: #ff6c6c;
}

html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-col .cv.vendas-val-pending {
  color: #ffb340;
}

html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-col .cl,
html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-status .cl,
html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-empty {
  color: #aeb2bb;
}

html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-row:has(.vendas-badge.conditional) {
  background: rgba(142, 119, 255, 0.13);
  border-bottom-color: rgba(183, 167, 255, 0.17);
  box-shadow: inset 3px 0 0 rgba(183, 167, 255, 0.48);
}

html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-row:has(.vendas-badge.conditional):hover {
  background: rgba(142, 119, 255, 0.18);
  box-shadow: inset 3px 0 0 rgba(193, 180, 255, 0.62);
}

html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-row:has(.vendas-badge.conditional) .vendas-col .cl,
html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-row:has(.vendas-badge.conditional) .vendas-status .cl {
  color: #aaa0c4;
}

html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-row:has(.vendas-badge.conditional) .vendas-col .cv,
html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-row:has(.vendas-badge.conditional) .vendas-col .cv.vendas-val-conditional {
  color: #f5f2ff;
}

html[data-theme="dark"] .vendas-page #vendas-list-wrap .vendas-row:has(.vendas-badge.conditional) .vendas-badge.conditional {
  color: #d4c9ff;
  background: rgba(142, 119, 255, 0.18);
  border-color: rgba(183, 167, 255, 0.34);
}

@media (prefers-reduced-motion: reduce) {
  .vendas-page #vendas-list-wrap .vendas-row,
  .vendas-page #vendas-list-wrap .vendas-load-more-btn {
    transition: none;
  }
}

/* ===================== Vendas: indicadores no tema atual ===================== */
.vendas-page .vendas-stats {
  gap: 12px;
}

.vendas-page .vendas-stat {
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.05);
}

.vendas-page .vendas-stat .k {
  color: #4175a8;
  font-weight: 400;
  white-space: nowrap;
}

.vendas-page .vendas-stat .v {
  color: #1d1d1f;
  font-weight: 500;
}

html[data-theme="dark"] .vendas-page .vendas-stat {
  border-color: rgba(94, 168, 255, 0.18);
  background: #181b22;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .vendas-page .vendas-stat .k {
  color: #8fc2ff;
}

html[data-theme="dark"] .vendas-page .vendas-stat .v {
  color: #f5f5f7;
}

@media (max-width: 640px) {
  .vendas-page .vendas-stats {
    gap: 6px;
  }

  .vendas-page .vendas-stat {
    padding: 10px 8px;
    border-radius: 14px;
    box-shadow: 0 7px 16px rgba(0, 0, 0, 0.045);
  }

  .vendas-page .vendas-stat .k {
    font-size: clamp(8.5px, 2.7vw, 10px);
    letter-spacing: -0.01em;
    white-space: nowrap;
  }

  .vendas-page .vendas-stat .v {
    margin-top: 5px;
    font-size: clamp(12.5px, 3.8vw, 15px);
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  html[data-theme="dark"] .vendas-page .vendas-stat {
    box-shadow: 0 9px 18px rgba(0, 0, 0, 0.22);
  }
}

/* ===================== Clientes: lista no tema atual ===================== */
.clients-page .clients-list-head {
  margin: 0;
  border: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: 18px 18px 0 0;
  background: rgba(0, 113, 227, 0.055);
  color: #315f8e;
}

.clients-page .clients-desktop-list {
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(0, 113, 227, 0.12);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.055);
}

.clients-page .client-row {
  border: 0;
  border-bottom: 1px solid rgba(0, 113, 227, 0.09);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.76);
  transition: background 160ms ease;
}

.clients-page .client-row:last-child {
  border-bottom: 0;
}

.clients-page .client-row:hover {
  background: rgba(0, 113, 227, 0.045);
}

.clients-page .client-avatar {
  border-color: rgba(0, 113, 227, 0.14);
  background: rgba(0, 113, 227, 0.055);
  color: #0071e3;
}

.clients-page .clients-desktop-list .stats-empty,
.clients-page .clients-mobile-list .stats-empty {
  margin: 0;
  padding: 44px 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.clients-page .clients-mobile-list {
  overflow: hidden;
  border: 1px solid rgba(0, 113, 227, 0.12);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.055);
}

.clients-page .client-mobile-row,
.clients-page .client-mobile-row.first,
.clients-page .client-mobile-row.last,
.clients-page .client-mobile-row.first.last {
  border: 0;
  border-bottom: 1px solid rgba(0, 113, 227, 0.09);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.76);
  transition: background 160ms ease;
}

.clients-page .client-mobile-row.last,
.clients-page .client-mobile-row.first.last {
  border-bottom: 0;
}

.clients-page .client-mobile-row:hover {
  background: rgba(0, 113, 227, 0.045);
}

.clients-page .client-mobile-row:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid rgba(0, 113, 227, 0.42);
  outline-offset: -2px;
}

.clients-page .clients-load-more {
  min-height: 64px;
  display: flex;
  align-items: stretch;
  border-top: 1px solid rgba(0, 113, 227, 0.14);
  background: rgba(0, 113, 227, 0.055);
}

.clients-page .clients-load-more-btn {
  width: 100%;
  min-height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #315f8e;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.clients-page .clients-load-more-btn:hover {
  background: rgba(0, 113, 227, 0.045);
}

.clients-page .clients-load-more-btn:focus-visible {
  outline: 2px solid rgba(0, 113, 227, 0.42);
  outline-offset: -2px;
}

.clients-page .clients-load-more-btn:disabled {
  cursor: wait;
}

.clients-page .clients-load-more-spinner {
  width: 22px;
  height: 22px;
}

.os-page .os-load-more {
  min-height: 64px;
  display: flex;
  align-items: stretch;
  border-top: 1px solid rgba(0, 113, 227, 0.14);
  background: rgba(0, 113, 227, 0.055);
}

.os-page .os-load-more-btn {
  width: 100%;
  min-height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #315f8e;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.os-page .os-load-more-btn:hover {
  background: rgba(0, 113, 227, 0.045);
}

.os-page .os-load-more-btn:focus-visible {
  outline: 2px solid rgba(0, 113, 227, 0.42);
  outline-offset: -2px;
}

.os-page .os-load-more-btn:disabled {
  cursor: wait;
}

.os-page .os-load-more-spinner {
  width: 22px;
  height: 22px;
}

html[data-theme="dark"] .clients-page .clients-list-head {
  border-color: rgba(94, 168, 255, 0.20);
  background: #0e1015;
  color: #8fc2ff;
}

html[data-theme="dark"] .clients-page .clients-desktop-list,
html[data-theme="dark"] .clients-page .clients-mobile-list {
  border-color: rgba(94, 168, 255, 0.18);
  background: #181b22;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .clients-page .clients-load-more {
  border-top-color: rgba(94, 168, 255, 0.18);
  background: #0e1015;
}

html[data-theme="dark"] .clients-page .clients-load-more-btn {
  color: #8fc2ff;
}

html[data-theme="dark"] .clients-page .clients-load-more-btn:hover {
  background: #20242b;
}

html[data-theme="dark"] .os-page .os-load-more {
  border-top-color: rgba(94, 168, 255, 0.18);
  background: #0e1015;
}

html[data-theme="dark"] .os-page .os-load-more-btn {
  color: #8fc2ff;
}

html[data-theme="dark"] .os-page .os-load-more-btn:hover {
  background: #20242b;
}

html[data-theme="dark"] .clients-page .client-row,
html[data-theme="dark"] .clients-page .client-mobile-row,
html[data-theme="dark"] .clients-page .client-mobile-row.first,
html[data-theme="dark"] .clients-page .client-mobile-row.last,
html[data-theme="dark"] .clients-page .client-mobile-row.first.last {
  border-bottom-color: rgba(94, 168, 255, 0.11);
  background: #181b22;
}

html[data-theme="dark"] .clients-page .client-row:hover,
html[data-theme="dark"] .clients-page .client-mobile-row:hover {
  background: #20242b;
}

html[data-theme="dark"] .clients-page .client-avatar {
  border-color: rgba(94, 168, 255, 0.22);
  background: #0e1015;
  color: #5ea8ff;
}

html[data-theme="dark"] .clients-page .client-main strong,
html[data-theme="dark"] .clients-page .client-mobile-name {
  color: #f5f5f7;
}

html[data-theme="dark"] .clients-page .client-main span,
html[data-theme="dark"] .clients-page .client-mobile-name small,
html[data-theme="dark"] .clients-page .client-mobile-chevron,
html[data-theme="dark"] .clients-page .clients-desktop-list .stats-empty,
html[data-theme="dark"] .clients-page .clients-mobile-list .stats-empty {
  color: #aeb2bb;
}

@media (prefers-reduced-motion: reduce) {
  .clients-page .client-row,
  .clients-page .client-mobile-row,
  .clients-page .clients-load-more-btn,
  .os-page .os-load-more-btn {
    transition: none;
  }
}

/* ===================== Notas Fiscais: cards e lista no tema atual ===================== */
.notas-page #notas-stats {
  gap: 12px;
}

.notas-page #notas-stats .vendas-stat {
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.05);
}

.notas-page #notas-stats .vendas-stat .k {
  color: #4175a8;
  font-weight: 400;
  white-space: nowrap;
}

.notas-page #notas-stats .vendas-stat .v {
  color: #1d1d1f;
  font-weight: 500;
  white-space: nowrap;
}

.notas-page .notas-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.notas-page .notas-table-scroll > .vendas-thead {
  margin: 0;
  border: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: 18px 18px 0 0;
  background: rgba(0, 113, 227, 0.055);
}

.notas-page .notas-table-scroll > .vendas-thead > span {
  color: #315f8e;
}

.notas-page #notas-list-wrap {
  overflow: hidden;
  border: 1px solid rgba(0, 113, 227, 0.12);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.055);
}

.notas-page #notas-list-wrap .vendas-list {
  gap: 0;
}

.notas-page #notas-list-wrap .vendas-row.notas-fiscal-row {
  border: 0;
  border-bottom: 1px solid rgba(0, 113, 227, 0.09);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: none;
  transition: background 160ms ease;
}

.notas-page #notas-list-wrap .vendas-row.notas-fiscal-row:last-child {
  border-bottom: 0;
}

.notas-page #notas-list-wrap .vendas-row.notas-fiscal-row:hover {
  background: rgba(0, 113, 227, 0.045);
}

.notas-page #notas-list-wrap .vendas-row.notas-fiscal-row:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid rgba(0, 113, 227, 0.42);
  outline-offset: -2px;
}

.notas-page #notas-list-wrap .vendas-empty {
  margin: 0;
  padding: 44px 20px !important;
  background: transparent;
}

html[data-theme="dark"] .notas-page #notas-stats .vendas-stat {
  border-color: rgba(94, 168, 255, 0.18);
  background: #181b22;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .notas-page #notas-stats .vendas-stat .k {
  color: #8fc2ff;
}

html[data-theme="dark"] .notas-page #notas-stats .vendas-stat .v {
  color: #f5f5f7;
}

html[data-theme="dark"] .notas-page .notas-table-scroll > .vendas-thead {
  border-color: rgba(94, 168, 255, 0.20);
  background: #0e1015;
}

html[data-theme="dark"] .notas-page .notas-table-scroll > .vendas-thead > span {
  color: #8fc2ff;
}

html[data-theme="dark"] .notas-page #notas-list-wrap {
  border-color: rgba(94, 168, 255, 0.18);
  background: #181b22;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .notas-page #notas-list-wrap .vendas-row.notas-fiscal-row {
  border-bottom-color: rgba(94, 168, 255, 0.11);
  background: #181b22;
}

html[data-theme="dark"] .notas-page #notas-list-wrap .vendas-row.notas-fiscal-row:hover {
  background: #20242b;
}

html[data-theme="dark"] .notas-page #notas-list-wrap .vendas-col .cv {
  color: #f5f5f7;
}

html[data-theme="dark"] .notas-page #notas-list-wrap .vendas-empty {
  color: #aeb2bb !important;
}

@media (max-width: 640px) {
  .notas-page .notas-table-scroll > .vendas-thead,
  .notas-page .notas-table-scroll > #notas-list-wrap {
    min-width: 720px;
  }

  .notas-page #notas-stats {
    gap: 6px;
  }

  .notas-page #notas-stats .vendas-stat {
    padding: 10px 8px;
    border-radius: 14px;
    box-shadow: 0 7px 16px rgba(0, 0, 0, 0.045);
  }

  .notas-page #notas-stats .vendas-stat .k {
    font-size: clamp(8px, 2.5vw, 10px);
    letter-spacing: -0.015em;
    white-space: nowrap;
  }

  .notas-page #notas-stats .vendas-stat .v {
    margin-top: 5px;
    font-size: clamp(12px, 3.7vw, 15px);
  }

  html[data-theme="dark"] .notas-page #notas-stats .vendas-stat {
    box-shadow: 0 9px 18px rgba(0, 0, 0, 0.22);
  }
}

@media (prefers-reduced-motion: reduce) {
  .notas-page #notas-list-wrap .vendas-row.notas-fiscal-row {
    transition: none;
  }
}

/* ===================== Ordem de Serviço: cards e listas no tema atual ===================== */
.os-page #os-panel-body .os-stats {
  gap: 12px;
}

.os-page #os-panel-body .os-stat {
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.05);
}

.os-page #os-panel-body .os-stat span {
  color: #4175a8;
  font-weight: 400;
  white-space: nowrap;
}

.os-page #os-panel-body .os-stat b {
  color: #1d1d1f;
  font-weight: 500;
}

.os-page #os-panel-body .os-scroll {
  overflow-x: auto;
  border: 1px solid rgba(0, 113, 227, 0.12);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.055);
}

.os-page #os-panel-body .os-thead {
  margin: 0;
  border: 0;
  border-bottom: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: 0;
  background: rgba(0, 113, 227, 0.055);
}

.os-page #os-panel-body .os-thead .os-c {
  color: #315f8e;
}

.os-page #os-panel-body .os-rows {
  gap: 0;
}

.os-page #os-panel-body .os-row,
.os-page #os-panel-body .os-row.canceled,
.os-page #os-panel-body .os-row.draft {
  border: 0;
  border-bottom: 1px solid rgba(0, 113, 227, 0.09);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.76);
  transition: background 160ms ease;
}

/* Rascunho precisa continuar reconhecível mesmo no painel contínuo. A regra
   compartilhada acima neutralizava o fundo laranja da O.S. após recarregar. */
.os-page #os-panel-body .os-row.draft {
  background: rgba(255, 149, 0, 0.10);
  box-shadow: inset 4px 0 0 rgba(221, 119, 0, 0.72);
}

.os-page #os-panel-body .os-row:last-child {
  border-bottom: 0;
}

.os-page #os-panel-body .os-row.clickable-row:hover,
.os-page #os-panel-body .os-row.draft.clickable-row:hover,
.os-page #os-panel-body .os-svc-row:hover {
  border-color: rgba(0, 113, 227, 0.09);
  background: rgba(0, 113, 227, 0.045);
}

/* Última O.S. mexida. Vem depois das regras de rascunho/cancelada de propósito:
   a barra azul manda na linha, para o operador achar onde parou. */
.os-page #os-panel-body .os-row.os-last-touched,
.os-page #os-panel-body .os-row.draft.os-last-touched,
.os-page #os-panel-body .os-row.canceled.os-last-touched {
  background: rgba(0, 113, 227, 0.10);
  box-shadow: inset 4px 0 0 rgba(0, 113, 227, 0.85);
}

.os-page #os-panel-body .os-row.os-last-touched.clickable-row:hover,
.os-page #os-panel-body .os-row.draft.os-last-touched.clickable-row:hover {
  background: rgba(0, 113, 227, 0.155);
}

.os-page #os-panel-body .os-rows .vendas-empty {
  margin: 0;
  padding: 44px 20px;
  background: transparent;
}

html[data-theme="dark"] .os-page #os-panel-body .os-stat {
  border-color: rgba(94, 168, 255, 0.18);
  background: #181b22;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .os-page #os-panel-body .os-stat span {
  color: #8fc2ff;
}

html[data-theme="dark"] .os-page #os-panel-body .os-stat b {
  color: #f5f5f7;
}

html[data-theme="dark"] .os-page #os-panel-body .os-scroll {
  border-color: rgba(94, 168, 255, 0.18);
  background: #181b22;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .os-page #os-panel-body .os-thead {
  border-bottom-color: rgba(94, 168, 255, 0.20);
  background: #0e1015;
}

html[data-theme="dark"] .os-page #os-panel-body .os-thead .os-c {
  color: #8fc2ff;
}

html[data-theme="dark"] .os-page #os-panel-body .os-row,
html[data-theme="dark"] .os-page #os-panel-body .os-row.canceled,
html[data-theme="dark"] .os-page #os-panel-body .os-row.draft {
  border-bottom-color: rgba(94, 168, 255, 0.11);
  background: #181b22;
}

html[data-theme="dark"] .os-page #os-panel-body .os-row.draft {
  background: rgba(255, 149, 0, 0.13);
  box-shadow: inset 4px 0 0 rgba(255, 179, 64, 0.72);
}

html[data-theme="dark"] .os-page #os-panel-body .os-row.clickable-row:hover,
html[data-theme="dark"] .os-page #os-panel-body .os-row.draft.clickable-row:hover,
html[data-theme="dark"] .os-page #os-panel-body .os-svc-row:hover {
  border-color: rgba(94, 168, 255, 0.11);
  background: #20242b;
}

html[data-theme="dark"] .os-page #os-panel-body .os-row.os-last-touched,
html[data-theme="dark"] .os-page #os-panel-body .os-row.draft.os-last-touched,
html[data-theme="dark"] .os-page #os-panel-body .os-row.canceled.os-last-touched {
  background: rgba(10, 132, 255, 0.18);
  box-shadow: inset 4px 0 0 rgba(94, 168, 255, 0.9);
}

html[data-theme="dark"] .os-page #os-panel-body .os-row.os-last-touched.clickable-row:hover,
html[data-theme="dark"] .os-page #os-panel-body .os-row.draft.os-last-touched.clickable-row:hover {
  background: rgba(10, 132, 255, 0.25);
}

html[data-theme="dark"] .os-page #os-panel-body .os-row .os-c {
  color: #f5f5f7;
}

html[data-theme="dark"] .os-page #os-panel-body .os-rows .vendas-empty {
  color: #aeb2bb;
}

@media (max-width: 640px) {
  .os-page #os-panel-body .os-stat {
    padding: 11px 12px;
    border-radius: 14px;
    box-shadow: 0 7px 16px rgba(0, 0, 0, 0.045);
  }

  html[data-theme="dark"] .os-page #os-panel-body .os-stat {
    box-shadow: 0 9px 18px rgba(0, 0, 0, 0.22);
  }
}

@media (prefers-reduced-motion: reduce) {
  .os-page #os-panel-body .os-row {
    transition: none;
  }
}

/* ===================== Contas a Pagar: resumo e listas no tema atual ===================== */
.cp-page #cp-summary.cp-summary {
  border: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.05);
}

.cp-page #cp-summary .cp-sum-left span,
.cp-page #cp-summary .cp-sum-sel span {
  color: #4175a8;
  font-weight: 400;
}

.cp-page #cp-summary .cp-sum-left b,
.cp-page #cp-summary .cp-sum-sel b {
  color: #1d1d1f;
  font-weight: 500;
}

.cp-page #cp-summary .cp-sum-hint {
  color: #6f89a4;
}

.cp-page #cp-list,
.cp-page #cp-cat-list {
  overflow-x: auto;
  padding-bottom: 0;
  border: 1px solid rgba(0, 113, 227, 0.12);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.055);
}

.cp-page #cp-list .cp-thead,
.cp-page #cp-cat-list .cp-thead {
  margin: 0;
  border: 0;
  border-bottom: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: 0;
  background: rgba(0, 113, 227, 0.055);
}

.cp-page #cp-list .cp-thead > span,
.cp-page #cp-cat-list .cp-thead > span {
  color: #315f8e;
}

.cp-page #cp-list .cp-rows,
.cp-page #cp-cat-list .cp-rows {
  gap: 0;
}

.cp-page #cp-list .cp-row,
.cp-page #cp-cat-list .cp-row {
  border: 0;
  border-bottom: 1px solid rgba(0, 113, 227, 0.09);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.76);
  transition: background 160ms ease;
}

.cp-page #cp-list .cp-row:last-child,
.cp-page #cp-cat-list .cp-row:last-child {
  border-bottom: 0;
}

.cp-page #cp-list .cp-row:hover,
.cp-page #cp-cat-list .cp-row:hover {
  background: rgba(0, 113, 227, 0.045);
}

.cp-page #cp-list .vendas-empty,
.cp-page #cp-cat-list .vendas-empty {
  margin: 0;
  padding: 44px 20px;
  background: transparent;
}

html[data-theme="dark"] .cp-page #cp-summary.cp-summary {
  border-color: rgba(94, 168, 255, 0.18);
  background: #181b22;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .cp-page #cp-summary .cp-sum-left span,
html[data-theme="dark"] .cp-page #cp-summary .cp-sum-sel span {
  color: #8fc2ff;
}

html[data-theme="dark"] .cp-page #cp-summary .cp-sum-left b,
html[data-theme="dark"] .cp-page #cp-summary .cp-sum-sel b {
  color: #f5f5f7;
}

html[data-theme="dark"] .cp-page #cp-summary .cp-sum-hint {
  color: #aeb2bb;
}

html[data-theme="dark"] .cp-page #cp-list,
html[data-theme="dark"] .cp-page #cp-cat-list {
  border-color: rgba(94, 168, 255, 0.18);
  background: #181b22;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .cp-page #cp-list .cp-thead,
html[data-theme="dark"] .cp-page #cp-cat-list .cp-thead {
  border-bottom-color: rgba(94, 168, 255, 0.20);
  background: #0e1015;
}

html[data-theme="dark"] .cp-page #cp-list .cp-thead > span,
html[data-theme="dark"] .cp-page #cp-cat-list .cp-thead > span {
  color: #8fc2ff;
}

html[data-theme="dark"] .cp-page #cp-list .cp-row,
html[data-theme="dark"] .cp-page #cp-cat-list .cp-row {
  border-bottom-color: rgba(94, 168, 255, 0.11);
  background: #181b22;
}

html[data-theme="dark"] .cp-page #cp-list .cp-row:hover,
html[data-theme="dark"] .cp-page #cp-cat-list .cp-row:hover {
  background: #20242b;
}

html[data-theme="dark"] .cp-page #cp-list .cp-c-acc > b,
html[data-theme="dark"] .cp-page #cp-list .cp-c-num.strong,
html[data-theme="dark"] .cp-page #cp-cat-list .cp-cat-name b {
  color: #f5f5f7;
}

html[data-theme="dark"] .cp-page #cp-list .cp-c-acc > small,
html[data-theme="dark"] .cp-page #cp-list .cp-c-num,
html[data-theme="dark"] .cp-page #cp-list .cp-c-mid,
html[data-theme="dark"] .cp-page #cp-list .vendas-empty,
html[data-theme="dark"] .cp-page #cp-cat-list .vendas-empty {
  color: #aeb2bb;
}

@media (max-width: 640px) {
  .cp-page #cp-summary.cp-summary {
    padding: 11px 12px;
    border-radius: 14px;
    box-shadow: 0 7px 16px rgba(0, 0, 0, 0.045);
  }

  html[data-theme="dark"] .cp-page #cp-summary.cp-summary {
    box-shadow: 0 9px 18px rgba(0, 0, 0, 0.22);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cp-page #cp-list .cp-row,
  .cp-page #cp-cat-list .cp-row {
    transition: none;
  }
}

/* ===================== Contas a Receber: resumo e lista no tema atual ===================== */
.cp-page #cr-summary.cr-summary {
  border: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.05);
}

.cp-page #cr-summary .cr-metric {
  min-width: 0;
}

.cp-page #cr-summary .cr-metric span {
  color: #4175a8;
  font-weight: 400;
  white-space: nowrap;
}

.cp-page #cr-summary .cr-metric b {
  color: #1d1d1f;
  font-weight: 500;
  white-space: nowrap;
}

.cp-page #cr-list {
  overflow-x: auto;
  padding-bottom: 0;
  border: 1px solid rgba(0, 113, 227, 0.12);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.055);
}

.cp-page #cr-list .cp-thead {
  margin: 0;
  border: 0;
  border-bottom: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: 0;
  background: rgba(0, 113, 227, 0.055);
}

.cp-page #cr-list .cp-thead > span {
  color: #315f8e;
}

.cp-page #cr-list .cp-rows {
  gap: 0;
}

.cp-page #cr-list .cp-row {
  border: 0;
  border-bottom: 1px solid rgba(0, 113, 227, 0.09);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.76);
  transition: background 160ms ease;
}

.cp-page #cr-list .cp-row:last-child {
  border-bottom: 0;
}

.cp-page #cr-list .cp-row:hover {
  background: rgba(0, 113, 227, 0.045);
}

.cp-page #cr-list .cp-row:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid rgba(0, 113, 227, 0.42);
  outline-offset: -2px;
}

.cp-page #cr-list .vendas-empty {
  margin: 0;
  padding: 44px 20px;
  background: transparent;
}

html[data-theme="dark"] .cp-page #cr-summary.cr-summary {
  border-color: rgba(94, 168, 255, 0.18);
  background: #181b22;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .cp-page #cr-summary .cr-metric span {
  color: #8fc2ff;
}

html[data-theme="dark"] .cp-page #cr-summary .cr-metric b {
  color: #f5f5f7;
}

html[data-theme="dark"] .cp-page #cr-list {
  border-color: rgba(94, 168, 255, 0.18);
  background: #181b22;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .cp-page #cr-list .cp-thead {
  border-bottom-color: rgba(94, 168, 255, 0.20);
  background: #0e1015;
}

html[data-theme="dark"] .cp-page #cr-list .cp-thead > span {
  color: #8fc2ff;
}

html[data-theme="dark"] .cp-page #cr-list .cp-row {
  border-bottom-color: rgba(94, 168, 255, 0.11);
  background: #181b22;
}

html[data-theme="dark"] .cp-page #cr-list .cp-row:hover {
  background: #20242b;
}

html[data-theme="dark"] .cp-page #cr-list .cr-c-cli > b,
html[data-theme="dark"] .cp-page #cr-list .cr-c-num.strong {
  color: #f5f5f7;
}

html[data-theme="dark"] .cp-page #cr-list .cr-c-cli > small,
html[data-theme="dark"] .cp-page #cr-list .cr-c-due,
html[data-theme="dark"] .cp-page #cr-list .cr-c-num,
html[data-theme="dark"] .cp-page #cr-list .vendas-empty {
  color: #aeb2bb;
}

/* Precisa do mesmo `#cr-list` da regra acima: sem o id, a cor cinza dela vence
   por especificidade e o vencido fica igual aos outros no tema escuro. */
html[data-theme="dark"] .cp-page #cr-list .cr-c-due.overdue {
  color: #ff8a8a;
}

@media (max-width: 640px) {
  .cp-page #cr-summary.cr-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 10px 8px;
    border-radius: 14px;
    box-shadow: 0 7px 16px rgba(0, 0, 0, 0.045);
  }

  .cp-page #cr-summary .cr-metric span {
    font-size: clamp(8px, 2.4vw, 10px);
    letter-spacing: -0.015em;
  }

  .cp-page #cr-summary .cr-metric b {
    margin-top: 5px;
    font-size: clamp(12px, 3.7vw, 15px);
  }

  html[data-theme="dark"] .cp-page #cr-summary.cr-summary {
    box-shadow: 0 9px 18px rgba(0, 0, 0, 0.22);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cp-page #cr-list .cp-row {
    transition: none;
  }
}

/* ===================== Pedidos: cards e lista no tema atual ===================== */
.pedidos-page #pedidos-stats {
  gap: 12px;
}

.pedidos-page #pedidos-stats .vendas-stat {
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.05);
}

.pedidos-page #pedidos-stats .vendas-stat .k {
  color: #4175a8;
  font-weight: 400;
  white-space: nowrap;
}

.pedidos-page #pedidos-stats .vendas-stat .v {
  color: #1d1d1f;
  font-weight: 500;
  white-space: nowrap;
}

.pedidos-page .pedidos-panel > .pedidos-thead {
  margin: 0;
  border: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: 18px 18px 0 0;
  background: rgba(0, 113, 227, 0.055);
}

.pedidos-page .pedidos-panel > .pedidos-thead > span {
  color: #315f8e;
}

.pedidos-page #pedidos-list-wrap {
  overflow: hidden;
  border: 1px solid rgba(0, 113, 227, 0.12);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.055);
}

.pedidos-page #pedidos-list-wrap .pedidos-list {
  gap: 0;
}

.pedidos-page #pedidos-list-wrap .pedidos-row {
  margin-bottom: 0;
  border: 0;
  border-bottom: 1px solid rgba(0, 113, 227, 0.09);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: none;
  transition: background 160ms ease;
}

.pedidos-page #pedidos-list-wrap .pedidos-row:last-child {
  border-bottom: 0;
}

.pedidos-page #pedidos-list-wrap .pedidos-row:hover {
  background: rgba(0, 113, 227, 0.045);
}

.pedidos-page #pedidos-list-wrap .pedidos-empty,
.pedidos-page #pedidos-list-wrap .vendas-empty {
  margin: 0;
  padding: 44px 20px;
  background: transparent;
}

html[data-theme="dark"] .pedidos-page #pedidos-stats .vendas-stat {
  border-color: rgba(94, 168, 255, 0.18);
  background: #181b22;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .pedidos-page #pedidos-stats .vendas-stat .k {
  color: #8fc2ff;
}

html[data-theme="dark"] .pedidos-page #pedidos-stats .vendas-stat .v {
  color: #f5f5f7;
}

html[data-theme="dark"] .pedidos-page .pedidos-panel > .pedidos-thead {
  border-color: rgba(94, 168, 255, 0.20);
  background: #0e1015;
}

html[data-theme="dark"] .pedidos-page .pedidos-panel > .pedidos-thead > span {
  color: #8fc2ff;
}

html[data-theme="dark"] .pedidos-page #pedidos-list-wrap {
  border-color: rgba(94, 168, 255, 0.18);
  background: #181b22;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .pedidos-page #pedidos-list-wrap .pedidos-row {
  border-bottom-color: rgba(94, 168, 255, 0.11);
  background: #181b22;
}

html[data-theme="dark"] .pedidos-page #pedidos-list-wrap .pedidos-row:hover {
  background: #20242b;
}

html[data-theme="dark"] .pedidos-page #pedidos-list-wrap .pedidos-row .vendas-col .cv {
  color: #f5f5f7;
}

html[data-theme="dark"] .pedidos-page #pedidos-list-wrap .pedidos-row .vendas-col .cl,
html[data-theme="dark"] .pedidos-page #pedidos-list-wrap .pedidos-empty,
html[data-theme="dark"] .pedidos-page #pedidos-list-wrap .vendas-empty {
  color: #aeb2bb;
}

@media (max-width: 980px) {
  .pedidos-page #pedidos-list-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .pedidos-page #pedidos-list-wrap .pedidos-list {
    gap: 12px;
  }

  .pedidos-page #pedidos-list-wrap .pedidos-row {
    border: 1px solid rgba(0, 113, 227, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 9px 22px rgba(0, 0, 0, 0.05);
  }

  .pedidos-page #pedidos-list-wrap .pedidos-row:last-child {
    border-bottom: 1px solid rgba(0, 113, 227, 0.12);
  }

  .pedidos-page #pedidos-list-wrap .pedidos-empty,
  .pedidos-page #pedidos-list-wrap .vendas-empty {
    border: 1px solid rgba(0, 113, 227, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 9px 22px rgba(0, 0, 0, 0.05);
  }

  html[data-theme="dark"] .pedidos-page #pedidos-list-wrap {
    background: transparent;
    box-shadow: none;
  }

  html[data-theme="dark"] .pedidos-page #pedidos-list-wrap .pedidos-row,
  html[data-theme="dark"] .pedidos-page #pedidos-list-wrap .pedidos-row:last-child,
  html[data-theme="dark"] .pedidos-page #pedidos-list-wrap .pedidos-empty,
  html[data-theme="dark"] .pedidos-page #pedidos-list-wrap .vendas-empty {
    border-color: rgba(94, 168, 255, 0.18);
    background: #181b22;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
  }
}

@media (max-width: 640px) {
  .pedidos-page #pedidos-stats {
    gap: 6px;
  }

  .pedidos-page #pedidos-stats .vendas-stat {
    padding: 10px 8px;
    border-radius: 14px;
    box-shadow: 0 7px 16px rgba(0, 0, 0, 0.045);
  }

  .pedidos-page #pedidos-stats .vendas-stat .k {
    font-size: clamp(8px, 2.5vw, 10px);
    letter-spacing: -0.015em;
  }

  .pedidos-page #pedidos-stats .vendas-stat .v {
    margin-top: 5px;
    font-size: clamp(12px, 3.7vw, 15px);
  }

  html[data-theme="dark"] .pedidos-page #pedidos-stats .vendas-stat {
    box-shadow: 0 9px 18px rgba(0, 0, 0, 0.22);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pedidos-page #pedidos-list-wrap .pedidos-row {
    transition: none;
  }
}

/* ===================== Subabas: tema unificado =====================
   Mantém o mesmo componente visual em Produtos, O.S., Contas a Pagar,
   Estatísticas, Relatórios e Crediário sem interferir nos filtros menores. */
.stats-page .stats-tabs .stats-tab,
.crediario-overlay .stats-tabs .stats-tab {
  border: 1px solid rgba(0, 113, 227, 0.16);
  background: rgba(255, 255, 255, 0.94);
  color: #4175a8;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.stats-page .stats-tabs .stats-tab > span,
.crediario-overlay .stats-tabs .stats-tab > span {
  border-color: rgba(0, 113, 227, 0.14);
  background: #ffffff;
  color: #0071e3;
}

.stats-page .stats-tabs .stats-tab:hover,
.crediario-overlay .stats-tabs .stats-tab:hover {
  border-color: rgba(0, 113, 227, 0.28);
  background: #ffffff;
  color: #0071e3;
}

.stats-page .stats-tabs .stats-tab.active,
.stats-page .stats-tabs .stats-tab.active:hover,
.crediario-overlay .stats-tabs .stats-tab.active,
.crediario-overlay .stats-tabs .stats-tab.active:hover {
  border-color: rgba(0, 113, 227, 0.36);
  background: rgba(0, 113, 227, 0.10);
  color: #0071e3;
  box-shadow: 0 8px 18px rgba(0, 113, 227, 0.10);
}

.stats-page .stats-tabs .stats-tab.active > span,
.crediario-overlay .stats-tabs .stats-tab.active > span {
  border-color: rgba(0, 113, 227, 0.22);
  background: rgba(0, 113, 227, 0.12);
  color: #0071e3;
}

.stats-page .stats-tabs .stats-tab:focus-visible,
.crediario-overlay .stats-tabs .stats-tab:focus-visible {
  outline: 2px solid rgba(0, 113, 227, 0.42);
  outline-offset: 2px;
}

html[data-theme="dark"] .stats-page .stats-tabs .stats-tab,
html[data-theme="dark"] .crediario-overlay .stats-tabs .stats-tab {
  border-color: rgba(94, 168, 255, 0.20);
  background: #181b22;
  color: #a9c7e6;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .stats-page .stats-tabs .stats-tab > span,
html[data-theme="dark"] .crediario-overlay .stats-tabs .stats-tab > span {
  border-color: rgba(94, 168, 255, 0.18);
  background: #0e1015;
  color: #5ea8ff;
}

html[data-theme="dark"] .stats-page .stats-tabs .stats-tab:hover,
html[data-theme="dark"] .crediario-overlay .stats-tabs .stats-tab:hover {
  border-color: rgba(94, 168, 255, 0.38);
  background: #24272e;
  color: #8fc2ff;
}

html[data-theme="dark"] .stats-page .stats-tabs .stats-tab.active,
html[data-theme="dark"] .stats-page .stats-tabs .stats-tab.active:hover,
html[data-theme="dark"] .crediario-overlay .stats-tabs .stats-tab.active,
html[data-theme="dark"] .crediario-overlay .stats-tabs .stats-tab.active:hover {
  border-color: rgba(94, 168, 255, 0.44);
  background: rgba(94, 168, 255, 0.14);
  color: #5ea8ff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .stats-page .stats-tabs .stats-tab.active > span,
html[data-theme="dark"] .crediario-overlay .stats-tabs .stats-tab.active > span {
  border-color: rgba(94, 168, 255, 0.28);
  background: rgba(94, 168, 255, 0.14);
  color: #5ea8ff;
}

@media (max-width: 640px) {
  .stats-page .stats-tabs .stats-tab,
  .crediario-overlay .stats-tabs .stats-tab {
    box-shadow: 0 5px 13px rgba(0, 0, 0, 0.055);
  }

  .stats-page .stats-tabs .stats-tab.active,
  .crediario-overlay .stats-tabs .stats-tab.active {
    box-shadow: 0 6px 15px rgba(0, 113, 227, 0.10);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stats-page .stats-tabs .stats-tab,
  .stats-page .stats-tabs .stats-tab > span,
  .crediario-overlay .stats-tabs .stats-tab,
  .crediario-overlay .stats-tabs .stats-tab > span {
    transition: none;
  }
}

/* ===================== Pedidos: detalhes no tema atual =====================
   Mantém a estrutura e as ações do pedido, mas usa a mesma paleta clara/
   escura e o mesmo acabamento compacto dos pop-ups novos do sistema. */
.stats-modal-card.pos-dialog.pedidos-detail-dialog {
  width: min(860px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  border-radius: 20px;
  background: var(--pop-surface);
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.pedidos-detail-dialog .stats-modal-body {
  padding: 16px;
}

.stats-modal-card.pos-dialog.pedidos-detail-dialog .pedido-detail-title strong,
.stats-modal-card.pos-dialog.pedidos-detail-dialog .pedido-detail-section h4 {
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.pedidos-detail-dialog .pedido-detail-title > div > span,
.stats-modal-card.pos-dialog.pedidos-detail-dialog .pedido-detail-stats span,
.stats-modal-card.pos-dialog.pedidos-detail-dialog .pedido-detail-line span,
.stats-modal-card.pos-dialog.pedidos-detail-dialog .pedido-detail-empty {
  color: var(--pop-muted);
}

.stats-modal-card.pos-dialog.pedidos-detail-dialog .pedido-detail-stats > div,
.stats-modal-card.pos-dialog.pedidos-detail-dialog .pedido-detail-line,
.stats-modal-card.pos-dialog.pedidos-detail-dialog .pedido-detail-item {
  border-color: var(--pop-border);
  background: var(--pop-surface-alt);
  border-radius: 14px;
}

.stats-modal-card.pos-dialog.pedidos-detail-dialog .pedido-detail-stats .icon {
  color: var(--pop-accent);
}

.stats-modal-card.pos-dialog.pedidos-detail-dialog .pedido-detail-stats b,
.stats-modal-card.pos-dialog.pedidos-detail-dialog .pedido-detail-line b,
.stats-modal-card.pos-dialog.pedidos-detail-dialog .pedido-detail-item span,
.stats-modal-card.pos-dialog.pedidos-detail-dialog .pedido-detail-item b {
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.pedidos-detail-dialog .pedido-action-btn.solid {
  border-color: var(--pop-primary-bg);
  background: var(--pop-primary-bg);
  color: var(--pop-primary-ink);
}

.stats-modal-card.pos-dialog.pedidos-detail-dialog .pedido-action-btn.dark {
  border-color: var(--pop-border);
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.pedidos-detail-dialog .pedido-action-state {
  border-color: var(--pop-border);
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.pedidos-detail-dialog .pedido-action-state.blue {
  border-color: color-mix(in srgb, var(--pop-accent) 26%, transparent);
  background: var(--pop-accent-soft);
  color: var(--pop-accent);
}

@media (max-width: 640px) {
  .stats-modal-card.pos-dialog.pedidos-detail-dialog {
    max-height: calc(var(--app-height) - 28px);
  }
}

/* ================= Compras: detalhes no tema atual =================
   Resumo operacional um pouco mais largo, com a chave fiscal protegida
   contra estouro e a mesma paleta clara/escura dos pop-ups novos. */
.stats-modal-card.pos-dialog.purchase-detail-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: min(720px, calc(var(--app-height, 100vh) - 32px));
  background: var(--pop-surface);
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.purchase-detail-dialog .stats-modal-body {
  padding: 18px;
}

.purchase-detail-dialog .purchase-detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.purchase-detail-dialog .purchase-detail-grid > div {
  min-width: 0;
  min-height: 74px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 13px 14px;
  border: 1px solid var(--pop-border);
  border-radius: 14px;
  background: var(--pop-surface-alt);
}

.purchase-detail-dialog .purchase-detail-grid .purchase-detail-supplier {
  grid-column: span 2;
}

.purchase-detail-dialog .purchase-detail-grid .purchase-detail-access {
  grid-column: 1 / -1;
  min-height: 68px;
  background: var(--pop-accent-soft);
}

.purchase-detail-dialog .purchase-detail-grid span {
  display: block;
  margin: 0 0 6px;
  color: var(--pop-muted);
  font-family: var(--apple-font);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 500;
}

.purchase-detail-dialog .purchase-detail-grid b {
  display: block;
  min-width: 0;
  color: var(--pop-ink);
  font-family: var(--apple-font);
  font-size: 14px;
  line-height: 1.38;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.purchase-detail-dialog .purchase-detail-grid .purchase-detail-access b {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  letter-spacing: 0.015em;
  user-select: text;
}

.purchase-detail-dialog .purchase-detail-status {
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid var(--pop-border);
  border-radius: 999px;
  background: var(--pop-surface);
}

.purchase-detail-dialog .purchase-detail-status.is-success {
  color: var(--pop-success);
}

.purchase-detail-dialog .purchase-detail-status.is-pending {
  color: var(--pop-accent);
}

.purchase-detail-dialog .purchase-detail-status.is-danger {
  border-color: var(--pop-danger-border);
  background: var(--pop-danger-bg);
  color: var(--pop-danger);
}

.purchase-detail-dialog .purchase-detail-total {
  font-size: 16px !important;
  font-weight: 600 !important;
}

.stats-modal-card.pos-dialog.purchase-detail-dialog .stats-modal-foot > button {
  min-width: 132px;
}

@media (max-width: 640px) {
  .stats-modal-card.pos-dialog.purchase-detail-dialog {
    width: min(100%, calc(100vw - 24px));
    max-height: calc(var(--app-height, 100vh) - 24px);
  }

  .stats-modal-card.pos-dialog.purchase-detail-dialog .stats-modal-body {
    padding: 14px;
  }

  .purchase-detail-dialog .purchase-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .purchase-detail-dialog .purchase-detail-grid .purchase-detail-supplier,
  .purchase-detail-dialog .purchase-detail-grid .purchase-detail-access {
    grid-column: 1 / -1;
  }
}

@media (max-width: 430px) {
  .purchase-detail-dialog .purchase-detail-grid {
    grid-template-columns: 1fr;
  }

  .purchase-detail-dialog .purchase-detail-grid > div,
  .purchase-detail-dialog .purchase-detail-grid .purchase-detail-supplier,
  .purchase-detail-dialog .purchase-detail-grid .purchase-detail-access {
    grid-column: 1;
  }
}

/* NF-e de devolução de compra */
.purchase-return-dialog .stats-modal-body {
  display: grid;
  gap: 16px;
}

.purchase-return-intro,
.notas-return-banner,
.notas-return-item-reference {
  display: grid;
  gap: 7px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent, #22c55e) 32%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent, #22c55e) 8%, transparent);
}

.purchase-return-intro p,
.notas-return-banner span,
.notas-return-item-reference span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.purchase-return-upload {
  justify-self: start;
}

.purchase-return-validation {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.09);
  color: var(--text);
}

.purchase-return-validation span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.purchase-return-validation.is-error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.purchase-return-items {
  display: grid;
  gap: 8px;
  max-height: 330px;
  overflow: auto;
}

.purchase-return-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 112px;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.purchase-return-row > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.purchase-return-row small {
  color: var(--muted);
}

.purchase-return-row input[type="number"] {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--input-bg, transparent);
  color: var(--text);
}

.notas-return-banner {
  margin-bottom: 18px;
}

.notas-return-confirmation {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(245, 158, 11, 0.42);
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.09);
  cursor: pointer;
}

.notas-return-confirmation > span {
  display: grid;
  gap: 4px;
}

.notas-return-confirmation small {
  color: var(--muted);
  line-height: 1.4;
}

.notas-return-item-reference {
  margin-bottom: 14px;
}

@media (max-width: 640px) {
  .purchase-return-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .purchase-return-row input[type="number"] {
    grid-column: 2;
  }
}


/* =====================================================================
   Ordem de Serviço — pop-ups no tema novo (RDX Project Control).
   Os cards passaram a carregar .pos-dialog, então card, cabeçalho,
   rodapé, botões e .stats-modal-field já vêm prontos do bloco do PDV.
   Aqui ficam só as peças próprias da O.S. (seletor da linha, picker do
   catálogo, checklist, eventos e o texto do confirmar), que ainda
   estavam presas às cores fixas do pop-up escuro antigo. Tudo sai dos
   tokens --pop-*, então claro e escuro acompanham sozinhos.
   ===================================================================== */

/* ---------- seletor de item e chave Ativo (.stats-filter-field) ---------- */

.stats-modal-card.pos-dialog .os-line-picker,
.stats-modal-card.pos-dialog .os-svc-form .stats-filter-field {
  min-height: 48px;
  border: 1px solid var(--pop-border);
  border-radius: 13px;
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog .os-line-picker:hover,
.stats-modal-card.pos-dialog .os-svc-form .stats-filter-field:hover {
  background: var(--pop-hover);
}

.stats-modal-card.pos-dialog .os-line-picker > span:not(.icon),
.stats-modal-card.pos-dialog .os-svc-form .stats-filter-field > span:not(.icon) {
  color: var(--pop-ink);
  font-size: 13px;
  font-weight: 400;
}

.stats-modal-card.pos-dialog .os-line-picker.empty > span:not(.icon) {
  color: var(--pop-muted);
}

.stats-modal-card.pos-dialog .os-line-picker > .icon {
  color: var(--pop-muted);
}

.stats-modal-card.pos-dialog .os-line-picker > .icon:first-child {
  color: var(--pop-accent);
}

/* A chave "Ativo" segue o botão primário do tema (preta no claro, clara no
   escuro) em vez do verde antigo — o verde ficava como um aviso de status. */

.stats-modal-card.pos-dialog .os-svc-form .cp-recdot.on {
  background: var(--pop-primary-bg);
}

.stats-modal-card.pos-dialog .os-svc-form .cp-recdot.on::after {
  background: var(--pop-primary-ink);
}

/* ---------- picker do catálogo ---------- */

.stats-modal-card.pos-dialog .os-pick-search-wrap {
  border-color: var(--pop-border);
  background: var(--pop-surface-alt);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.stats-modal-card.pos-dialog .os-pick-search-wrap:focus-within {
  border-color: var(--pop-accent);
  background: var(--pop-surface);
  box-shadow: 0 0 0 3px var(--pop-accent-soft);
}

.stats-modal-card.pos-dialog .os-pick-search-wrap .icon {
  color: var(--pop-muted);
}

.stats-modal-card.pos-dialog .os-pick-search-wrap input {
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog .os-pick-search-wrap input::placeholder,
.stats-modal-card.pos-dialog .os-pick-empty {
  color: var(--pop-muted);
}

.stats-modal-card.pos-dialog.os-pick-dialog .stats-option-tile {
  height: 48px;
  border: 1px solid var(--pop-border);
  border-radius: 13px;
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.os-pick-dialog .stats-option-tile:hover,
.stats-modal-card.pos-dialog.os-pick-dialog .stats-option-tile:active {
  background: var(--pop-hover);
}

.stats-modal-card.pos-dialog.os-pick-dialog .stats-option-tile > span:not(.icon) {
  color: var(--pop-ink);
  font-size: 13px;
  font-weight: 400;
}

.stats-modal-card.pos-dialog.os-pick-dialog .stats-option-tile .icon {
  color: var(--pop-muted);
}

.stats-modal-card.pos-dialog .os-pick-tile .os-pick-price {
  color: var(--pop-ink);
}

/* ---------- checklist ---------- */

.stats-modal-card.pos-dialog .stats-period-choice {
  border: 1px solid var(--pop-border);
  border-radius: 13px;
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
  font-size: 13px;
  font-weight: 400;
}

.stats-modal-card.pos-dialog .stats-period-choice:hover {
  background: var(--pop-hover);
}

.stats-modal-card.pos-dialog .stats-period-choice.selected {
  border-color: var(--pop-accent);
  background: var(--pop-accent-soft);
  color: var(--pop-ink);
}

/* O item marcado já fica no azul de seleção do tema; o check verde antigo
   destoava dentro da linha azul. */
.stats-modal-card.pos-dialog .os-checklist-choice .icon {
  color: var(--pop-accent);
}

/* ---------- eventos e nota informativa ---------- */

.stats-modal-card.pos-dialog .os-event {
  border-color: var(--pop-border);
  background: var(--pop-surface-alt);
}

.stats-modal-card.pos-dialog .os-event b {
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog .os-event span,
.stats-modal-card.pos-dialog .os-note {
  color: var(--pop-muted);
}

/* ---------- excluir serviço (link discreto do rodapé do formulário) ---------- */

.stats-modal-card.pos-dialog .os-svc-form .stats-modal-clear {
  color: var(--pop-danger);
}

/* ---------- confirmação destrutiva ---------- */

.stats-modal-card.pos-dialog .prod-confirm-text {
  color: var(--pop-ink);
  font-size: 13.5px;
  line-height: 1.45;
}

.stats-modal-card.purchase-new-products-dialog.is-multiple {
  width: min(460px, 100%);
}

.purchase-new-products-summary {
  margin-bottom: 11px;
  text-align: left;
}

.purchase-new-products-summary strong {
  color: var(--pop-ink);
  font-weight: 600;
}

.purchase-new-products-list {
  max-height: min(280px, 42vh);
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  border: 1px solid var(--pop-border);
  border-radius: 13px;
  background: var(--pop-surface-alt);
}

.purchase-new-products-list li {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  color: var(--pop-ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

.purchase-new-products-list li + li {
  border-top: 1px solid var(--pop-border-soft);
}

.purchase-new-products-list li > .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--pop-muted);
}

.purchase-new-products-list li > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stats-modal-card.pos-dialog .stats-modal-primary.prod-danger-btn {
  border: 1px solid var(--pop-danger-border) !important;
  background: var(--pop-danger-bg) !important;
  color: var(--pop-danger) !important;
}

.stats-modal-card.pos-dialog .stats-modal-primary.prod-danger-btn:hover {
  background: var(--pop-danger-bg) !important;
  opacity: 0.85;
}


/* =====================================================================
   Produtos — pop-ups no tema novo (RDX Project Control).
   Exportar para lojas (produtos e lojas), Baixar XML, NF-e de devolução
   de compra e as confirmações passaram a carregar .pos-dialog, então
   card, cabeçalho, rodapé e campos já vêm do tema. Aqui ficam só as
   peças próprias da aba, que estavam escritas em branco fixo — agora
   saem dos tokens --pop-*, e claro/escuro acompanham sozinhos.
   ===================================================================== */

/* ---------- Exportar para lojas · seleção de produtos ---------- */

.stats-modal-card.pos-dialog .prod-export-subtitle {
  color: var(--pop-muted);
  font-size: 12.5px;
  font-weight: 400;
}

.stats-modal-card.pos-dialog .prod-export-product {
  border: 1px solid var(--pop-border);
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog .prod-export-product:hover {
  background: var(--pop-hover);
}

.stats-modal-card.pos-dialog .prod-export-product.selected {
  border-color: var(--pop-accent);
  background: var(--pop-accent-soft);
}

.stats-modal-card.pos-dialog .prod-export-product-image {
  background: var(--pop-hover);
  color: var(--pop-muted);
}

.stats-modal-card.pos-dialog .prod-export-product-copy b {
  color: var(--pop-ink);
  font-size: 13.5px;
  font-weight: 500;
}

.stats-modal-card.pos-dialog .prod-export-product-copy small {
  color: var(--pop-muted);
  font-weight: 400;
}

.stats-modal-card.pos-dialog .prod-export-check {
  border: 2px solid var(--pop-border);
  color: var(--pop-accent);
}

.stats-modal-card.pos-dialog .prod-export-product.selected .prod-export-check {
  border-color: var(--pop-accent);
  background: var(--pop-accent-soft);
}

.stats-modal-card.pos-dialog .prod-export-empty {
  color: var(--pop-muted);
  font-weight: 400;
}

.stats-modal-card.pos-dialog .prod-export-empty.danger {
  color: var(--pop-danger);
}

.stats-modal-card.pos-dialog .prod-export-button,
.stats-modal-card.pos-dialog .prod-export-store-cancel {
  border: 1px solid var(--pop-border);
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
  font-weight: 500;
}

.stats-modal-card.pos-dialog .prod-export-button:hover,
.stats-modal-card.pos-dialog .prod-export-store-cancel:hover {
  background: var(--pop-hover);
}

/* Concluir é a ação principal: mesmo preto do Confirmar dos outros pop-ups. */
.stats-modal-card.pos-dialog .prod-export-button.primary {
  border-color: transparent;
  background: var(--pop-primary-bg);
  color: var(--pop-primary-ink);
}

.stats-modal-card.pos-dialog .prod-export-button.primary:hover {
  background: var(--pop-primary-bg);
  opacity: 0.9;
}

.stats-modal-card.pos-dialog .prod-export-cancel {
  color: var(--pop-muted);
  font-weight: 400;
}

/* ---------- Exportar para lojas · escolha da loja ---------- */

.stats-modal-card.pos-dialog .prod-export-store {
  border: 1px solid var(--pop-border);
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
  font-weight: 400;
}

.stats-modal-card.pos-dialog .prod-export-store:hover {
  background: var(--pop-hover);
}

.stats-modal-card.pos-dialog .prod-export-store .icon {
  color: var(--pop-accent);
}

/* ---------- Baixar XML e NF-e de devolução ---------- */

.stats-modal-card.pos-dialog .prod-input {
  border: 1px solid var(--pop-border);
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog .prod-input::placeholder {
  color: var(--pop-muted);
}

.stats-modal-card.pos-dialog .prod-input:focus {
  border-color: var(--pop-accent);
  background: var(--pop-surface);
  outline: none;
  box-shadow: 0 0 0 3px var(--pop-accent-soft);
}

/* As regras antigas de .prod-purchase-dialog fixam branco com !important. */
.stats-modal-card.pos-dialog.prod-purchase-dialog .prod-tool-btn {
  border: 1px solid var(--pop-border) !important;
  background: var(--pop-surface-alt) !important;
  color: var(--pop-ink) !important;
  box-shadow: none;
}

.stats-modal-card.pos-dialog.prod-purchase-dialog .prod-tool-btn:hover {
  background: var(--pop-hover) !important;
}

.stats-modal-card.pos-dialog.prod-purchase-dialog .prod-btn-chip {
  border-color: var(--pop-border);
  background: var(--pop-surface) !important;
}

.stats-modal-card.pos-dialog.prod-purchase-dialog .prod-btn-chip .icon {
  color: var(--pop-accent) !important;
}

.stats-modal-card.pos-dialog .purchase-return-validation {
  background: var(--pop-accent-soft);
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog .purchase-return-validation span {
  color: var(--pop-muted);
}

.stats-modal-card.pos-dialog .purchase-return-validation.is-error {
  background: var(--pop-danger-bg);
  color: var(--pop-danger);
}

.stats-modal-card.pos-dialog .purchase-return-row input[type="number"] {
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}


/* =====================================================================
   Vender (PDV) — cadastro de produto e "Produto avulso" no tema novo.
   O bloco antigo `.prod-product-dialog:not(.prod-form-page)` força vidro
   escuro com !important para o pop-up do formulário; ele também pegava o
   "Produto avulso", que já era .pos-dialog — daí o card meio preto com
   rodapé branco e o botão Adicionar invisível. Aqui a regra é: quando o
   card também é .pos-dialog, quem manda são os tokens --pop-*. A página
   (.prod-form-page) e o cadastro de Lojas não são tocados.
   ===================================================================== */

.stats-modal-card.pos-dialog.prod-product-dialog {
  background: var(--pop-surface) !important;
  border: 1px solid var(--pop-border) !important;
  box-shadow: var(--pop-shadow) !important;
  color: var(--pop-ink) !important;
  color-scheme: light !important;
}

html[data-theme="dark"] .stats-modal-card.pos-dialog.prod-product-dialog {
  color-scheme: dark !important;
}

.stats-modal-card.pos-dialog.prod-product-dialog .stats-modal-head {
  border-bottom-color: var(--pop-border) !important;
}

.stats-modal-card.pos-dialog.prod-product-dialog .stats-modal-head h3 {
  color: var(--pop-ink) !important;
}

.stats-modal-card.pos-dialog.prod-product-dialog .stats-modal-close {
  color: var(--pop-close-ink) !important;
}

.stats-modal-card.pos-dialog.prod-product-dialog .stats-modal-close:hover {
  background: var(--pop-hover) !important;
}

/* ---------- abas Cadastro / Estoque ---------- */

.stats-modal-card.pos-dialog.prod-product-dialog .prod-seg {
  background: var(--pop-surface-alt) !important;
  border-color: var(--pop-border) !important;
}

.stats-modal-card.pos-dialog.prod-product-dialog .prod-seg-btn {
  color: var(--pop-muted) !important;
}

/* A aba ativa continua azul com texto branco — empatava em especificidade
   com a regra acima e perdia por ordem, ficando cinza sobre azul. */
.stats-modal-card.pos-dialog.prod-product-dialog .prod-seg-btn.active {
  color: #ffffff !important;
}

/* ---------- campos ---------- */

.stats-modal-card.pos-dialog.prod-product-dialog .stats-modal-field,
.stats-modal-card.pos-dialog.prod-product-dialog .prod-product-id-field {
  border: 1px solid var(--pop-border) !important;
}

.stats-modal-card.pos-dialog.prod-product-dialog .stats-modal-field span,
.stats-modal-card.pos-dialog.prod-product-dialog .prod-product-id-field span,
.stats-modal-card.pos-dialog.prod-product-dialog .prod-toggle-row span,
.stats-modal-card.pos-dialog.prod-product-dialog .prod-sugg-head {
  color: var(--pop-muted) !important;
}

.stats-modal-card.pos-dialog.prod-product-dialog .stats-modal-field input,
.stats-modal-card.pos-dialog.prod-product-dialog .stats-modal-field textarea,
.stats-modal-card.pos-dialog.prod-product-dialog .stats-modal-field select,
.stats-modal-card.pos-dialog.prod-product-dialog .prod-product-id-field input {
  background: var(--pop-surface-alt) !important;
  border: 1px solid var(--pop-border) !important;
  color: var(--pop-ink) !important;
}

.stats-modal-card.pos-dialog.prod-product-dialog .stats-modal-field input::placeholder,
.stats-modal-card.pos-dialog.prod-product-dialog .stats-modal-field textarea::placeholder,
.stats-modal-card.pos-dialog.prod-product-dialog .prod-product-id-field input::placeholder {
  color: var(--pop-muted) !important;
}

.stats-modal-card.pos-dialog.prod-product-dialog .stats-filter-field,
.stats-modal-card.pos-dialog.prod-product-dialog .prod-picker-inner {
  background: var(--pop-surface-alt) !important;
  border: 1px solid var(--pop-border) !important;
}

.stats-modal-card.pos-dialog.prod-product-dialog .stats-filter-field:hover,
.stats-modal-card.pos-dialog.prod-product-dialog .prod-picker-btn:hover .prod-picker-inner {
  background: var(--pop-hover) !important;
}

.stats-modal-card.pos-dialog.prod-product-dialog .prod-picker-btn .prod-btn-label,
.stats-modal-card.pos-dialog.prod-product-dialog .stats-filter-field > span:not(.icon) {
  color: var(--pop-ink) !important;
}

.stats-modal-card.pos-dialog.prod-product-dialog .prod-picker-btn.empty .prod-btn-label,
.stats-modal-card.pos-dialog.prod-product-dialog .stats-filter-field.empty > span:not(.icon) {
  color: var(--pop-muted) !important;
}

/* ---------- títulos de seção, imagem e ferramentas ---------- */

.stats-modal-card.pos-dialog.prod-product-dialog .prod-form-section {
  color: var(--pop-ink) !important;
}

.stats-modal-card.pos-dialog.prod-product-dialog .prod-form-preview-box {
  background: var(--pop-surface-alt) !important;
  border: 1px solid var(--pop-border) !important;
}

.stats-modal-card.pos-dialog.prod-product-dialog .prod-form-preview-box .icon,
.stats-modal-card.pos-dialog.prod-product-dialog .prod-form-empty-label,
.stats-modal-card.pos-dialog.prod-product-dialog .prod-form-uploading,
.stats-modal-card.pos-dialog.prod-product-dialog .prod-form-preview-label {
  color: var(--pop-muted) !important;
}

.stats-modal-card.pos-dialog.prod-product-dialog .prod-tool-btn {
  background: var(--pop-surface-alt) !important;
  border: 1px solid var(--pop-border) !important;
  color: var(--pop-ink) !important;
  box-shadow: none;
}

.stats-modal-card.pos-dialog.prod-product-dialog .prod-tool-btn:hover {
  background: var(--pop-hover) !important;
}

.stats-modal-card.pos-dialog.prod-product-dialog .prod-btn-chip {
  border-color: var(--pop-border);
  background: var(--pop-surface) !important;
}

.stats-modal-card.pos-dialog.prod-product-dialog .prod-btn-chip .icon {
  color: var(--pop-accent) !important;
}

.stats-modal-card.pos-dialog.prod-product-dialog .prod-toggle-url-btn {
  color: var(--pop-accent) !important;
}

/* ---------- painel de movimentações ---------- */

.stats-modal-card.pos-dialog.prod-product-dialog .prod-stock-moves-panel {
  background: var(--pop-surface-alt) !important;
  border: 1px solid var(--pop-border) !important;
}

.stats-modal-card.pos-dialog.prod-product-dialog .prod-stock-moves-head {
  background: var(--pop-hover) !important;
  color: var(--pop-ink) !important;
}

.stats-modal-card.pos-dialog.prod-product-dialog .prod-stock-move-row {
  color: var(--pop-ink) !important;
  border-top: 1px solid var(--pop-border) !important;
}

/* ---------- botões do rodapé ---------- */

.stats-modal-card.pos-dialog.prod-product-dialog .stats-modal-primary {
  border: 1px solid transparent !important;
  background: var(--pop-primary-bg) !important;
  color: var(--pop-primary-ink) !important;
}

.stats-modal-card.pos-dialog.prod-product-dialog .stats-modal-primary:hover {
  background: var(--pop-primary-bg) !important;
  opacity: 0.9;
}

.stats-modal-card.pos-dialog.prod-product-dialog .stats-modal-danger {
  border: 1px solid var(--pop-danger-border) !important;
  background: var(--pop-danger-bg) !important;
  color: var(--pop-danger) !important;
}

.stats-modal-card.pos-dialog.prod-product-dialog .stats-modal-danger:hover {
  background: var(--pop-danger-bg) !important;
  opacity: 0.85;
}

/* Caixa — linha "Total de saídas" (despesas + retiradas somadas). O seletor
   repete o escopo do tema escuro porque `html[data-theme="dark"]
   .cash-summary-lines b` tem especificidade maior que a classe sozinha. */
.cash-summary-lines .cash-out-line b,
html[data-theme="dark"] .cash-summary-lines .cash-out-line b {
  color: #ef4444;
}

/* ---------- Seletor de loja — carrossel do hub sobre a tela desfocada -------
   Antes era um card de vidro escuro cravado (bloco "Seletor de loja (vidro)"
   mais acima). Aquele bloco continua no arquivo porque `.store-row` também
   veste a lista de Lojas das Configurações; aqui o pop-up deixa de ser card e
   passa a ser o mesmo carrossel do hub, flutuando sobre a tela desfocada. */
.store-select-root .stats-modal-backdrop {
  background: rgba(248, 249, 251, 0.42);
  -webkit-backdrop-filter: blur(26px) saturate(125%);
  backdrop-filter: blur(26px) saturate(125%);
}

html[data-theme="dark"] .store-select-root .stats-modal-backdrop {
  background: rgba(10, 10, 12, 0.52);
}

/* O tema escuro pinta .stats-modal-card num seletor mais específico que o
   nosso, e o card voltava a aparecer como uma faixa clara atrás do carrossel. */
html[data-theme="dark"] .stats-modal-card.store-select-dialog {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.stats-modal-card.store-select-dialog {
  width: min(1248px, 100%);
  max-height: min(680px, calc(100vh - 48px));
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

/* Rótulo discreto no lugar do cabeçalho de card, alinhado ao primeiro card. */
.store-select-dialog .stats-modal-head {
  margin: 0;
  padding: 0 52px 2px;
  border: 0;
}

.store-select-dialog .stats-modal-head h3 {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

.store-select-dialog .stats-modal-close {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.store-select-dialog .stats-modal-close:hover {
  background: rgba(29, 29, 31, 0.06);
  color: var(--ink);
}

html[data-theme="dark"] .store-select-dialog .stats-modal-close:hover {
  background: rgba(255, 255, 255, 0.10);
}

.store-select-dialog .stats-modal-body {
  flex: 0 1 auto;
  min-height: 0;
  padding: 0;
  overflow: visible;
}

.store-select-carousel { margin: 0 auto; }

/* As setas do hub são posicionadas por ID (#hub-scroll-left/right), então as
   daqui precisam da própria regra. Elas encostam na borda do pop-up (e não a
   12px como no hub) para os três cards de 360px caberem sem estourar em tela
   de 1280 — abaixo disso o carrossel rola, que é o comportamento esperado. */
.store-select-carousel .hub-cards {
  padding-left: 52px;
  padding-right: 52px;
}

.store-select-carousel .hub-scroll-control#store-select-scroll-left { left: 0; }
.store-select-carousel .hub-scroll-control#store-select-scroll-right { right: 0; }

/* O hub esfuma as pontas com um degradê da cor da página; aqui não há cor fixa
   (o fundo é a tela desfocada), então o esmaecimento vira máscara — funciona
   igual no claro e no escuro. Só com rolagem: sem ela nada passa por baixo. */
.store-select-carousel .hub-cards.is-overflowing {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 56px, #000 calc(100% - 56px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 56px, #000 calc(100% - 56px), transparent 100%);
}

/* As bordas esfumadas do hub são pintadas com a cor da PÁGINA do hub; sobre o
   desfoque elas virariam duas faixas claras soltas no meio da tela. */
.store-select-carousel::before,
.store-select-carousel::after { display: none; }

/* Sombra neutra e curta: o destaque azul fica dentro do card, sem halo na lista. */
.store-select-card:hover,
.store-select-card.is-active {
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.store-select-card.is-active {
  border-color: var(--blue);
  background: rgba(0, 113, 227, 0.06);
}

.store-select-card.is-active .hc-chevron { color: var(--blue); }

.store-select-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 12px;
  color: var(--muted);
  font-weight: 500;
}

.store-select-status .icon { width: 18px; height: 18px; color: var(--muted); }

@media (max-width: 680px) {
  .stats-modal-card.store-select-dialog { width: min(720px, 100%); }
  .store-select-dialog .stats-modal-head { padding: 0 4px 10px; }
  .store-select-carousel .hub-cards { padding-left: 0; padding-right: 0; }
  /* Empilhado na vertical, a máscara horizontal cortaria as laterais dos cards. */
  .store-select-carousel .hub-cards.is-overflowing {
    -webkit-mask-image: none;
    mask-image: none;
  }
  /* A área rolável precisa acomodar a sombra do último card. As margens
     compensam o respiro sem deslocar nem estreitar os cards. */
  .store-select-dialog .stats-modal-body {
    overflow: auto;
    padding: 8px 16px 28px;
    margin: -8px -12px -24px;
  }
}

/* ---------------------------------------------------------------------------
   Editar vendedor — página inteira (Configurações > Lojas)
   Mesma moldura de Produtos > Novo (.prod-form-page): os campos, as chaves e o
   tema escuro já vêm de lá. Aqui só entram o cabeçalho de identidade, a grade
   de permissões em colunas e o respiro dos blocos.
   --------------------------------------------------------------------------- */
.lojas-seller-form-page .prod-form-shell {
  display: block;
}

.lojas-seller-form-page .prod-form-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lojas-seller-form-page .lojas-page-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(29, 29, 31, 0.06);
  background: #f5f5f7;
}

.lojas-seller-form-page .lojas-page-identity-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
}

.lojas-seller-form-page .lojas-page-identity-icon .icon {
  width: 20px;
  height: 20px;
}

.lojas-seller-form-page .lojas-page-identity-name {
  font-size: 16px;
  font-weight: 600;
  color: #111113;
  letter-spacing: -0.01em;
}

.lojas-seller-form-page .lojas-page-identity-sub {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 400;
  color: #6e6e73;
}

.lojas-seller-form-page .lojas-page-hint {
  font-size: 12px;
  font-weight: 400;
  color: #6e6e73;
  line-height: 1.4;
}

.lojas-seller-form-page .lojas-page-toggle-row {
  display: flex;
}

/* Olho de mostrar/ocultar senha, encaixado no canto direito do card. */
.lojas-seller-form-page .lojas-page-field-reveal {
  position: relative;
}

.lojas-seller-form-page .lojas-page-field-reveal input {
  padding-right: 34px !important;
}

.lojas-seller-form-page .lojas-page-eye {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #6e6e73;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.lojas-seller-form-page .lojas-page-eye:hover {
  background: rgba(29, 29, 31, 0.07);
  color: #111113;
}

.lojas-seller-form-page .lojas-page-eye .icon {
  width: 18px;
  height: 18px;
}

html[data-theme="dark"] .lojas-seller-form-page .lojas-page-eye {
  color: rgba(245, 245, 247, 0.60);
}

html[data-theme="dark"] .lojas-seller-form-page .lojas-page-eye:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #f5f5f7;
}

.lojas-seller-form-page .stats-modal-field[readonly],
.lojas-seller-form-page .stats-modal-field input[readonly] {
  opacity: 0.72;
  cursor: default;
}

html[data-theme="dark"] .lojas-seller-form-page .lojas-page-identity {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .lojas-seller-form-page .lojas-page-identity-name {
  color: #f5f5f7;
}

html[data-theme="dark"] .lojas-seller-form-page .lojas-page-identity-sub,
html[data-theme="dark"] .lojas-seller-form-page .lojas-page-hint {
  color: rgba(245, 245, 247, 0.62);
}

/* ---------------------------------------------------------------------------
   Pop-ups de Lojas no tema novo (Editar meta, Editar meta diária, Mover)
   São a forma ANCORADA do tema: abrem colados no botão clicado, como o
   "Enviar documentos" do Financeiro. O `pos-dialog` no cardClass entra só
   pelos tokens --pop-*; o desenho do card é daqui, com especificidade acima
   de `.stats-modal-card.pos-dialog` para vencer o fundo escuro dele.
   --------------------------------------------------------------------------- */
.stats-modal-card.rdx-project-popover.lojas-popover-dialog {
  width: min(360px, calc(100vw - 26px));
  max-height: min(560px, calc(100dvh - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--pop-border);
  border-radius: 20px;
  background: var(--pop-surface);
  color: var(--pop-ink);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
}

.rdx-project-popover.lojas-popover-dialog .stats-modal-head {
  min-height: 52px;
  margin: 0;
  padding: 13px 14px 13px 18px;
  border-bottom: 1px solid var(--pop-border);
}

.rdx-project-popover.lojas-popover-dialog .stats-modal-head h3 {
  color: var(--pop-ink);
  font-size: 16px;
  font-weight: 500;
}

.rdx-project-popover.lojas-popover-dialog .stats-modal-close {
  display: inline-flex;
  border: 1px solid var(--pop-border);
  background: var(--pop-surface-alt);
  color: var(--pop-muted);
}

.rdx-project-popover.lojas-popover-dialog .stats-modal-close:hover {
  background: var(--pop-hover);
  color: var(--pop-ink);
}

.rdx-project-popover.lojas-popover-dialog .stats-modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  overflow-y: auto;
}

/* Campo: um cartão só — rótulo pequeno em cima, input transparente embaixo.
   O par caixa-dentro-de-caixa vinha das regras de cadastro de produto, que
   este card não carrega mais. */
.rdx-project-popover.lojas-popover-dialog .stats-modal-field {
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* A base é `align-items: center`, feita para o campo em linha; em coluna ela
     centraliza rótulo e valor no meio do cartão. */
  align-items: stretch;
  text-align: left;
  gap: 2px;
  min-height: 52px;
  margin: 0;
  padding: 8px 13px;
  border: 1px solid var(--pop-border);
  border-radius: 13px;
  background: var(--pop-surface-alt);
}

.rdx-project-popover.lojas-popover-dialog .stats-modal-field span {
  margin: 0;
  padding: 0;
  color: var(--pop-muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.05;
}

.rdx-project-popover.lojas-popover-dialog .stats-modal-field input {
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--pop-ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.15;
}

.rdx-project-popover.lojas-popover-dialog .stats-modal-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin: 0;
  padding: 12px 16px 15px;
  border-top: 1px solid var(--pop-border);
  background: var(--pop-foot);
}

.rdx-project-popover.lojas-popover-dialog .stats-modal-foot > button {
  width: 100%;
  min-width: 0;
  height: 42px;
  margin: 0;
  padding: 0 14px;
  border-radius: 13px;
  box-shadow: none;
  font-size: 13px;
  font-weight: 500;
}

.rdx-project-popover.lojas-popover-dialog .stats-modal-secondary {
  border: 1px solid var(--pop-border);
  background: var(--pop-surface);
  color: var(--pop-ink);
}

.rdx-project-popover.lojas-popover-dialog .stats-modal-secondary:hover {
  background: var(--pop-hover);
}

.rdx-project-popover.lojas-popover-dialog .stats-modal-primary {
  border: 1px solid var(--pop-primary-bg);
  background: var(--pop-primary-bg);
  color: var(--pop-primary-ink);
}

.rdx-project-popover.lojas-popover-dialog .stats-modal-foot .icon,
.rdx-project-popover.lojas-popover-dialog .stats-modal-foot svg {
  position: static;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

/* Lista de lojas do "Mover vendedor". A seleção era rgba(255,255,255,.15)
   chumbada no style inline, que sumia no tema claro. */
.rdx-project-popover.lojas-popover-dialog .stats-option-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* A lista rola, mas sem barra à mostra — o mesmo tratamento do carrossel do
   hub. O recorte de altura vinha de um style inline; mora aqui agora. */
.rdx-project-popover.lojas-popover-dialog .lojas-store-list {
  margin-top: 12px;
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.rdx-project-popover.lojas-popover-dialog .lojas-store-list::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.rdx-project-popover.lojas-popover-dialog .lojas-store-tile {
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--pop-border) !important;
  border-radius: 13px !important;
  background: var(--pop-surface-alt) !important;
  color: var(--pop-ink) !important;
  font-size: 14px;
  font-weight: 500;
}

.rdx-project-popover.lojas-popover-dialog .lojas-store-tile:hover {
  background: var(--pop-hover) !important;
}

.rdx-project-popover.lojas-popover-dialog .lojas-store-tile > span:not(.icon) {
  color: var(--pop-ink) !important;
  font-size: 14px;
  font-weight: 500;
}

.rdx-project-popover.lojas-popover-dialog .lojas-store-tile.selected {
  background: var(--pop-accent-soft) !important;
  border-color: var(--pop-accent) !important;
}

.rdx-project-popover.lojas-popover-dialog .lojas-store-tile.selected > span:not(.icon),
.rdx-project-popover.lojas-popover-dialog .lojas-store-tile .icon {
  color: var(--pop-accent) !important;
}

/* Estatísticas › Caixa — composição das entradas e saídas por forma de
   pagamento. Dois blocos dentro do mesmo card, cada um com o subtotal ao lado
   do rótulo, para bater com "Total Entradas" e "Total Saídas" do card de cima. */
.stats-cash-split {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stats-cash-split-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.stats-cash-split-head b {
  color: #1d1d1f;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

html[data-theme="dark"] .stats-cash-split-head b {
  color: #f5f5f7;
}

/* A linha da composição vira botão: mesma barra, seta na ponta e o pop-up com
   os lançamentos que formaram o valor. */
.stats-cash-split-row {
  width: 100%;
  margin: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.stats-cash-split-row:hover:not(:disabled) {
  border-color: rgba(0, 113, 227, 0.38);
  background: #eef4fd;
}

.stats-cash-split-row:active:not(:disabled) {
  transform: scale(0.995);
}

.stats-cash-split-row:disabled {
  cursor: default;
}

.stats-cash-split-go {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  color: rgba(29, 29, 31, 0.34);
}

.stats-cash-split-go .icon {
  width: 17px;
  height: 17px;
}

.stats-cash-split-row:hover:not(:disabled) .stats-cash-split-go {
  color: var(--accent-blue, #0071e3);
}

.stats-cash-split-row:disabled .stats-cash-split-go {
  opacity: 0.35;
}

/* O pop-up da lista usa os tokens --pop-* do tema novo (.pos-dialog); fora dele
   os fallbacks valem para o tema claro. */
.stats-modal-card.stats-cash-split-dialog {
  width: min(680px, 100%);
}

.stats-cash-split-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--pop-border, rgba(29, 29, 31, 0.10));
}

.stats-cash-split-total span {
  color: var(--pop-muted, #6e6e73);
  font-size: 13px;
  font-weight: 400;
}

.stats-cash-split-total b {
  color: var(--pop-ink, #1d1d1f);
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
}

.stats-cash-split-note {
  margin: 12px 0 0;
  color: var(--pop-muted, #6e6e73);
  font-size: 12px;
  font-weight: 400;
}

html[data-theme="dark"] .stats-cash-split-row:hover:not(:disabled) {
  border-color: rgba(94, 168, 255, 0.42);
  background: #1b1f27;
}

html[data-theme="dark"] .stats-cash-split-go {
  color: rgba(245, 245, 247, 0.38);
}

html[data-theme="dark"] .stats-cash-split-row:hover:not(:disabled) .stats-cash-split-go {
  color: #5ea8ff;
}

/* =====================================================================
   Caixa — pop-ups no modelo claro/escuro atual e detalhe de lançamentos.
   Mantém o shell centralizado e usa os mesmos tokens --pop-* do PDV.
   ===================================================================== */

.cash-movement-row[data-cash-view-order],
.cash-movement-row[data-cash-view-manual] {
  cursor: pointer;
  border-radius: 14px;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.cash-movement-row[data-cash-view-order]:hover,
.cash-movement-row[data-cash-view-manual]:hover {
  background: rgba(0, 113, 227, 0.055);
}

.cash-movement-row[data-cash-view-order]:focus-visible,
.cash-movement-row[data-cash-view-manual]:focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: -2px;
}

.cash-movement-row.inflow > strong {
  color: #13a065;
}

/* Lançamento que entrou neste caixa depois de ele ter sido fechado. O selo fica
   na terceira linha porque o título da movimentação é cortado com reticências. */
.cash-movement-row.retro {
  border-radius: 14px;
  background: rgba(255, 149, 0, 0.09);
  box-shadow: inset 0 0 0 1px rgba(255, 149, 0, 0.32);
}
.cash-movement-row.retro[data-cash-view-order]:hover,
.cash-movement-row.retro[data-cash-view-manual]:hover {
  background: rgba(255, 149, 0, 0.15);
}
.cash-movement-retro-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  padding: 2px 8px;
  border: 1px solid rgba(255, 149, 0, 0.40);
  border-radius: 999px;
  color: #b85f00;
  background: rgba(255, 149, 0, 0.14);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.5;
}
.cash-movement-retro-tag svg { width: 12px; height: 12px; fill: currentColor; }
html[data-theme="dark"] .cash-movement-row.retro {
  background: rgba(255, 159, 10, 0.085);
  box-shadow: inset 0 0 0 1px rgba(255, 159, 10, 0.28);
}
html[data-theme="dark"] .cash-movement-row.retro[data-cash-view-order]:hover,
html[data-theme="dark"] .cash-movement-row.retro[data-cash-view-manual]:hover {
  background: rgba(255, 159, 10, 0.14);
}
html[data-theme="dark"] .cash-movement-retro-tag {
  color: #ffb340;
  border-color: rgba(255, 159, 10, 0.38);
  background: rgba(255, 159, 10, 0.16);
}

html[data-theme="dark"] .cash-movement-row[data-cash-view-order]:hover,
html[data-theme="dark"] .cash-movement-row[data-cash-view-manual]:hover {
  background: rgba(94, 168, 255, 0.09);
}

html[data-theme="dark"] .cash-movement-row.inflow > strong {
  color: #69ffb4;
}

.stats-modal-card.pos-dialog.cash-option-dialog,
.stats-modal-card.pos-dialog.cash-manual-dialog,
.stats-modal-card.pos-dialog.cash-opening-dialog,
.stats-modal-card.pos-dialog.cash-retro-dialog,
.stats-modal-card.pos-dialog.cash-entry-detail-dialog,
.stats-modal-card.pos-dialog.cash-entry-delete-dialog,
.stats-modal-card.pos-dialog.cash-sale-detail-dialog {
  border-color: var(--pop-border) !important;
  background: var(--pop-surface) !important;
  color: var(--pop-ink) !important;
}

.stats-modal-card.pos-dialog.cash-option-dialog {
  width: min(380px, calc(100vw - 32px));
}

.stats-modal-card.pos-dialog.cash-option-dialog .stats-modal-close {
  display: inline-flex !important;
}

.stats-modal-card.pos-dialog.cash-option-dialog .cash-action-list {
  gap: 7px;
}

.stats-modal-card.pos-dialog.cash-option-dialog .cash-action-list button {
  min-height: 50px;
  height: auto;
  padding: 10px 13px;
  border: 1px solid var(--pop-border);
  border-radius: 13px;
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
  font-size: 13px;
  font-weight: 500;
  transition: background 160ms ease, border-color 160ms ease;
}

.stats-modal-card.pos-dialog.cash-option-dialog .cash-action-list button:hover {
  border-color: color-mix(in srgb, var(--pop-accent) 28%, var(--pop-border));
  background: var(--pop-hover);
}

.stats-modal-card.pos-dialog.cash-option-dialog .cash-action-list .icon {
  color: var(--pop-accent);
}

.stats-modal-card.pos-dialog.cash-manual-dialog,
.stats-modal-card.pos-dialog.cash-opening-dialog {
  width: min(420px, calc(100vw - 32px));
}

.stats-modal-card.pos-dialog.cash-manual-dialog .stats-modal-field,
.stats-modal-card.pos-dialog.cash-opening-dialog .stats-modal-field {
  border: 1px solid var(--pop-border) !important;
  border-radius: 13px !important;
  background: var(--pop-surface-alt) !important;
}

.stats-modal-card.pos-dialog.cash-manual-dialog .stats-modal-field span,
.stats-modal-card.pos-dialog.cash-opening-dialog .stats-modal-field span {
  color: var(--pop-muted) !important;
  font-weight: 400;
}

.stats-modal-card.pos-dialog.cash-manual-dialog .stats-modal-field input,
.stats-modal-card.pos-dialog.cash-manual-dialog .stats-modal-field textarea,
.stats-modal-card.pos-dialog.cash-opening-dialog .stats-modal-field input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--pop-ink) !important;
}

.stats-modal-card.pos-dialog.cash-manual-dialog .stats-filter-field {
  border: 1px solid var(--pop-border);
  border-radius: 13px;
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.cash-manual-dialog .stats-filter-field:hover {
  background: var(--pop-hover);
}

.stats-modal-card.pos-dialog.cash-manual-dialog .stats-filter-field > span:not(.icon),
.stats-modal-card.pos-dialog.cash-manual-dialog .stats-filter-field strong {
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.cash-manual-dialog .stats-filter-field .icon {
  color: var(--pop-accent);
}

.stats-modal-card.pos-dialog.cash-manual-dialog > .stats-modal-head,
.stats-modal-card.pos-dialog.cash-manual-dialog > .stats-modal-body,
.stats-modal-card.pos-dialog.cash-manual-dialog > .stats-modal-foot,
.stats-modal-card.pos-dialog.cash-entry-delete-dialog > .stats-modal-head,
.stats-modal-card.pos-dialog.cash-entry-delete-dialog > .stats-modal-body,
.stats-modal-card.pos-dialog.cash-entry-delete-dialog > .stats-modal-foot {
  transition: opacity 150ms ease, filter 150ms ease;
}

.stats-modal-card.pos-dialog.cash-manual-dialog.is-saving > .stats-modal-head,
.stats-modal-card.pos-dialog.cash-manual-dialog.is-saving > .stats-modal-body,
.stats-modal-card.pos-dialog.cash-manual-dialog.is-saving > .stats-modal-foot,
.stats-modal-card.pos-dialog.cash-entry-delete-dialog.is-saving > .stats-modal-head,
.stats-modal-card.pos-dialog.cash-entry-delete-dialog.is-saving > .stats-modal-body,
.stats-modal-card.pos-dialog.cash-entry-delete-dialog.is-saving > .stats-modal-foot {
  opacity: 0.14;
  filter: blur(1px);
  pointer-events: none;
  user-select: none;
}

.cash-dialog-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background: color-mix(in srgb, var(--pop-surface) 88%, transparent);
  color: var(--pop-ink);
  cursor: wait;
}

.cash-dialog-loading .rdx-loading .spinner {
  border-top-color: var(--pop-accent);
}

.cash-dialog-loading .rdx-loading-text {
  color: var(--pop-muted);
  font-size: 12px;
  font-weight: 500;
}

.stats-modal-card.pos-dialog.cash-manual-dialog .stats-modal-foot,
.stats-modal-card.pos-dialog.cash-opening-dialog .stats-modal-foot,
.stats-modal-card.pos-dialog.cash-retro-dialog .stats-modal-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.stats-modal-card.pos-dialog.cash-manual-dialog .stats-modal-foot > button,
.stats-modal-card.pos-dialog.cash-opening-dialog .stats-modal-foot > button,
.stats-modal-card.pos-dialog.cash-retro-dialog .stats-modal-foot > button {
  width: 100%;
  min-width: 0;
}

.stats-modal-card.pos-dialog.cash-retro-dialog .stats-modal-body,
.stats-modal-card.pos-dialog.cash-retro-dialog .stats-modal-body p {
  color: var(--pop-ink) !important;
}

.stats-modal-card.pos-dialog.cash-retro-dialog .stats-modal-foot {
  border-color: var(--pop-border);
  background: var(--pop-foot);
}

.stats-modal-card.pos-dialog.cash-retro-dialog .stats-modal-danger {
  border-color: var(--pop-border) !important;
  background: var(--pop-surface-alt) !important;
  color: var(--pop-ink) !important;
}

.stats-modal-card.pos-dialog.cash-retro-dialog .stats-modal-primary {
  border-color: var(--pop-primary-bg) !important;
  background: var(--pop-primary-bg) !important;
  color: var(--pop-primary-ink) !important;
}

/* O detalhe de venda já existia; estas regras removem as cores escuras fixas
   do modelo anterior sem alterar seu conteúdo ou comportamento. */
.stats-modal-card.pos-dialog.cash-sale-detail-dialog {
  width: min(520px, calc(100vw - 32px));
  border-radius: 20px;
  box-shadow: var(--pop-shadow);
}

.stats-modal-card.pos-dialog.cash-sale-detail-dialog .stats-modal-head {
  border-color: var(--pop-border);
}

.stats-modal-card.pos-dialog.cash-sale-detail-dialog .stats-modal-head h3,
.stats-modal-card.pos-dialog.cash-sale-detail-dialog .cash-sale-section h4,
.stats-modal-card.pos-dialog.cash-sale-detail-dialog .cash-sale-seller b,
.stats-modal-card.pos-dialog.cash-sale-detail-dialog .cash-sale-item span,
.stats-modal-card.pos-dialog.cash-sale-detail-dialog .cash-sale-item b,
.stats-modal-card.pos-dialog.cash-sale-detail-dialog .cash-sale-client b,
.stats-modal-card.pos-dialog.cash-sale-detail-dialog .cash-sale-payment b,
.stats-modal-card.pos-dialog.cash-sale-detail-dialog .cash-sale-total b {
  color: var(--pop-ink) !important;
}

.stats-modal-card.pos-dialog.cash-sale-detail-dialog .stats-modal-head h3 {
  font-size: 13px;
  font-weight: 500;
}

.stats-modal-card.pos-dialog.cash-sale-detail-dialog .stats-modal-head h3 .icon,
.stats-modal-card.pos-dialog.cash-sale-detail-dialog .cash-sale-seller .icon {
  color: var(--pop-accent);
}

.stats-modal-card.pos-dialog.cash-sale-detail-dialog .stats-modal-close {
  width: 25px;
  height: 25px;
  border: 1px solid var(--pop-border-soft);
  border-radius: 8px;
  background: var(--pop-surface-alt);
  color: var(--pop-close-ink) !important;
}

.stats-modal-card.pos-dialog.cash-sale-detail-dialog .cash-sale-seller,
.stats-modal-card.pos-dialog.cash-sale-detail-dialog .cash-sale-item,
.stats-modal-card.pos-dialog.cash-sale-detail-dialog .cash-sale-notes p {
  border-color: var(--pop-border);
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.cash-sale-detail-dialog .cash-sale-client span,
.stats-modal-card.pos-dialog.cash-sale-detail-dialog .cash-sale-payment span,
.stats-modal-card.pos-dialog.cash-sale-detail-dialog .cash-sale-total span,
.stats-modal-card.pos-dialog.cash-sale-detail-dialog .cash-sale-item.muted span,
.stats-modal-card.pos-dialog.cash-sale-detail-dialog .cash-sale-item.muted b {
  color: var(--pop-muted) !important;
}

.stats-modal-card.pos-dialog.cash-sale-detail-dialog .cash-sale-notes p {
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.cash-sale-detail-dialog .cash-sale-total {
  border-color: var(--pop-border);
}

.stats-modal-card.pos-dialog.cash-entry-detail-dialog {
  width: min(470px, calc(100vw - 32px));
}

.cash-entry-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cash-entry-detail-amount {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--pop-border);
  border-radius: 15px;
  background: var(--pop-surface-alt);
}

.cash-entry-detail-amount.in {
  border-color: color-mix(in srgb, var(--pop-success) 24%, var(--pop-border));
  background: color-mix(in srgb, var(--pop-success) 7%, var(--pop-surface));
}

.cash-entry-detail-amount.out {
  border-color: var(--pop-danger-border);
  background: var(--pop-danger-bg);
}

.cash-entry-detail-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: var(--pop-surface);
  color: var(--pop-success);
}

.cash-entry-detail-amount.out .cash-entry-detail-icon {
  color: var(--pop-danger);
}

.cash-entry-detail-icon .icon {
  width: 19px;
  height: 19px;
}

.cash-entry-detail-amount > span:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cash-entry-detail-amount small {
  color: var(--pop-muted);
  font-size: 11px;
  font-weight: 500;
}

.cash-entry-detail-amount strong {
  color: var(--pop-ink);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cash-entry-detail-amount.out strong {
  color: var(--pop-danger);
}

.cash-entry-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.cash-entry-detail-grid > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 55px;
  padding: 9px 11px;
  border: 1px solid var(--pop-border);
  border-radius: 13px;
  background: var(--pop-surface-alt);
}

.cash-entry-detail-grid > div.wide {
  grid-column: 1 / -1;
}

.cash-entry-detail-grid span {
  color: var(--pop-muted);
  font-size: 10.5px;
  font-weight: 400;
}

.cash-entry-detail-grid b {
  color: var(--pop-ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.cash-entry-detail-notes b {
  white-space: pre-wrap;
}

.cash-entry-detail-lock {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 10px 11px;
  border: 1px solid var(--pop-border);
  border-radius: 12px;
  background: var(--pop-surface-alt);
  color: var(--pop-muted);
  font-size: 11.5px;
  line-height: 1.4;
}

.cash-entry-detail-lock .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: var(--pop-accent);
}

.stats-modal-card.pos-dialog.cash-entry-detail-dialog .stats-modal-foot,
.stats-modal-card.pos-dialog.cash-entry-delete-dialog .stats-modal-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.stats-modal-card.pos-dialog.cash-entry-detail-dialog .stats-modal-foot > button,
.stats-modal-card.pos-dialog.cash-entry-delete-dialog .stats-modal-foot > button {
  width: 100%;
  min-width: 0;
}

.stats-modal-card.pos-dialog .cash-entry-delete-button {
  border-color: var(--pop-danger-border) !important;
  background: var(--pop-danger-bg) !important;
  color: var(--pop-danger) !important;
}

.stats-modal-card.pos-dialog .cash-entry-delete-button:hover {
  border-color: var(--pop-danger-border) !important;
  background: var(--pop-danger-bg) !important;
  color: var(--pop-danger) !important;
  opacity: 0.82;
}

.stats-modal-card.pos-dialog .cash-entry-delete-button:disabled,
.stats-modal-card.pos-dialog.cash-manual-dialog [data-modal-apply]:disabled {
  cursor: wait;
  opacity: 0.58;
}

.stats-modal-card.pos-dialog.cash-entry-delete-dialog {
  width: min(420px, calc(100vw - 32px));
}

.cash-entry-delete-confirm {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 6px 11px;
  align-items: start;
}

.cash-entry-delete-confirm-icon {
  grid-row: 1 / span 2;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--pop-danger-border);
  background: var(--pop-danger-bg);
  color: var(--pop-danger);
}

.cash-entry-delete-confirm-icon .icon {
  width: 18px;
  height: 18px;
}

.cash-entry-delete-confirm p,
.cash-entry-delete-confirm small {
  margin: 0;
}

.cash-entry-delete-confirm p {
  color: var(--pop-ink);
  font-size: 13px;
  line-height: 1.45;
}

.cash-entry-delete-confirm small {
  color: var(--pop-muted);
  font-size: 11.5px;
  line-height: 1.4;
}

@media (max-width: 520px) {
  .cash-entry-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cash-entry-detail-grid > div.wide {
    grid-column: auto;
  }

  .stats-modal-card.pos-dialog.cash-entry-detail-dialog .stats-modal-foot,
  .stats-modal-card.pos-dialog.cash-entry-delete-dialog .stats-modal-foot {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cash-movement-row[data-cash-view-order],
  .cash-movement-row[data-cash-view-manual],
  .stats-modal-card.pos-dialog.cash-manual-dialog > .stats-modal-head,
  .stats-modal-card.pos-dialog.cash-manual-dialog > .stats-modal-body,
  .stats-modal-card.pos-dialog.cash-manual-dialog > .stats-modal-foot,
  .stats-modal-card.pos-dialog.cash-entry-delete-dialog > .stats-modal-head,
  .stats-modal-card.pos-dialog.cash-entry-delete-dialog > .stats-modal-body,
  .stats-modal-card.pos-dialog.cash-entry-delete-dialog > .stats-modal-foot {
    transition: none;
  }
}

/* Mantém a geometria do avaliador acima das regras genéricas de popups que
   aparecem mais tarde no bundle legado. */
.stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog {
  width: min(940px, calc(100vw - 36px));
  max-height: min(880px, calc(100svh - 28px));
}

.stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog > .stats-modal-body {
  padding: 0;
}

.stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog > .stats-modal-foot {
  grid-template-columns: repeat(4, minmax(0, auto));
  justify-content: end;
}

@media (max-width: 900px) {
  .stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog > .stats-modal-foot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog > .stats-modal-foot {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Avaliação aberta por Ferramentas: segue o mesmo padrão estrutural do
   Crediário. A camada nasce fora do shell escalado, ocupa o viewport inteiro
   (inclusive a área da sidebar) e entra pela lateral direita. */
.trade-in-page-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Mesmo fundo do Crediário: a camada é o papel de parede e a página é o
     card com o degradê. */
  background: #f5f5f7;
}

.trade-in-page-overlay.trade-in-evaluation-entering {
  animation: crediarioOverlaySlideIn 450ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform;
}

/* Sair pela lateral direita, com o mesmo tempo e a mesma curva do Crediário. */
.trade-in-page-overlay.trade-in-evaluation-leave {
  animation: crediarioOverlaySlideOut 350ms cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  will-change: transform;
}

.notas-editor-screen.trade-in-evaluation-screen {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  background: transparent;
}

.notas-editor-form.trade-in-evaluation-page {
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  gap: 0;
  padding: 22px 24px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f7 50%, #eff8f4 100%);
  box-shadow: none;
}

.trade-in-page-header {
  flex: 0 0 auto;
  justify-content: space-between;
}

.trade-in-page-header > .trade-in-page-heading {
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
}

.trade-in-page-heading > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trade-in-page-header > .home-top-actions {
  position: static;
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.trade-in-page-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  margin-inline: -24px;
  border-top: 0;
  border-radius: 0;
}

.trade-in-page-body > .trade-in-layout {
  width: 100%;
  flex: 1 1 auto;
  height: auto;
  min-height: 520px;
}

.trade-in-page-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 0;
}

.trade-in-page-footer .stats-modal-danger,
.trade-in-page-footer .stats-modal-secondary,
.trade-in-page-footer .stats-modal-primary {
  width: auto;
  min-width: 170px;
  height: 44px;
  flex: 0 0 auto;
}

.trade-in-evaluation-page .trade-in-field > label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.trade-in-evaluation-page .trade-in-form > .notas-page-field.notas-select {
  min-height: 48px;
  margin-top: 19px;
}

.trade-in-evaluation-page .trade-in-form > .notas-page-field.notas-select > span:first-child {
  position: absolute;
  left: 0;
  bottom: calc(100% + 7px);
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
  font-weight: 850;
}

.trade-in-optional {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.trade-in-evaluation-page .trade-in-field input,
.trade-in-evaluation-page .trade-in-field select,
.trade-in-evaluation-page .trade-in-field textarea {
  min-height: 48px;
  border-color: rgba(29, 29, 31, 0.06);
  border-radius: 14px;
  background: #f5f5f7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70);
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.trade-in-evaluation-page .trade-in-field input:hover:not(:focus),
.trade-in-evaluation-page .trade-in-field select:hover:not(:focus),
.trade-in-evaluation-page .trade-in-field textarea:hover:not(:focus) {
  border-color: color-mix(in srgb, var(--ink) 22%, var(--line));
}

.trade-in-evaluation-page .trade-in-field input:focus,
.trade-in-evaluation-page .trade-in-field select:focus,
.trade-in-evaluation-page .trade-in-field textarea:focus {
  border-color: var(--blue);
  background: #f5f5f7;
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), .12);
}

.trade-in-evaluation-page .trade-in-field textarea {
  min-height: 82px;
  overflow-y: hidden;
  resize: none;
  line-height: 1.5;
}

html[data-theme="dark"] .trade-in-page-overlay,
html[data-theme="dark"] .notas-editor-screen.trade-in-evaluation-screen,
html[data-theme="dark"] .notas-editor-form.trade-in-evaluation-page {
  border: 0;
  box-shadow: none;
}
html[data-theme="dark"] .trade-in-page-overlay { background: #07080a; }
html[data-theme="dark"] .notas-editor-screen.trade-in-evaluation-screen { background: transparent; }
html[data-theme="dark"] .notas-editor-form.trade-in-evaluation-page {
  background: linear-gradient(135deg, #06070a 0%, #0e1117 50%, #07140f 100%);
}

html[data-theme="dark"] .trade-in-evaluation-page .trade-in-field input,
html[data-theme="dark"] .trade-in-evaluation-page .trade-in-field select,
html[data-theme="dark"] .trade-in-evaluation-page .trade-in-field textarea,
html[data-theme="dark"] .trade-in-evaluation-page .trade-in-field input:focus,
html[data-theme="dark"] .trade-in-evaluation-page .trade-in-field select:focus,
html[data-theme="dark"] .trade-in-evaluation-page .trade-in-field textarea:focus {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

html[data-theme="dark"] .trade-in-evaluation-page .trade-in-field input,
html[data-theme="dark"] .trade-in-evaluation-page .trade-in-field select,
html[data-theme="dark"] .trade-in-evaluation-page .trade-in-field textarea {
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .trade-in-evaluation-page .trade-in-field input:focus,
html[data-theme="dark"] .trade-in-evaluation-page .trade-in-field select:focus,
html[data-theme="dark"] .trade-in-evaluation-page .trade-in-field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), .16);
}

/* A avaliação vive fora do shell escalado para conseguir cobrir a sidebar.
   No desktop, devolve somente o conteúdo dessa página à lupa de 80% usada
   pelo Crediário, sem alterar o tamanho do overlay nem do restante do app. */
@media (min-width: 941px) {
  .trade-in-page-overlay .trade-in-evaluation-page {
    width: 100%;
    min-height: 125vh;
    min-height: 125dvh;
    zoom: 0.8;
  }
}

@media (max-width: 940px) {
  .notas-editor-form.trade-in-evaluation-page {
    padding: 16px 14px calc(18px + var(--safe-bottom));
  }

  .trade-in-page-body {
    margin-inline: -14px;
  }
}

@media (max-width: 900px) {
  .trade-in-page-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trade-in-page-footer .stats-modal-danger,
  .trade-in-page-footer .stats-modal-secondary,
  .trade-in-page-footer .stats-modal-primary {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .trade-in-page-header > .trade-in-page-heading { align-items: flex-start; }
  .trade-in-page-footer { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .trade-in-page-overlay.trade-in-evaluation-entering,
  .trade-in-page-overlay.trade-in-evaluation-leave {
    animation: none !important;
  }
}

/* Crediário — todos os diálogos reutilizam o tema novo de pop-up do sistema.
   Este bloco trata apenas os campos e conteúdos próprios desta página; card,
   cabeçalho, rodapé e ações continuam centralizados no tema de .pos-dialog. */
.stats-modal-card.pos-dialog.crediario-dialog .sim-field {
  gap: 6px;
  color: var(--pop-muted);
  font-family: var(--apple-font);
  font-size: 12px;
  font-weight: 400;
}

.stats-modal-card.pos-dialog.crediario-dialog .sim-field > span {
  color: var(--pop-muted);
  font-weight: 400;
}

.stats-modal-card.pos-dialog.crediario-dialog .sim-picker-btn {
  min-height: 49px;
  border: 1px solid var(--pop-border);
  border-radius: 13px;
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
  font-size: 13px;
  font-weight: 400;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.stats-modal-card.pos-dialog.crediario-dialog .sim-picker-btn:hover {
  border-color: var(--pop-border);
  background: var(--pop-hover);
}

.stats-modal-card.pos-dialog.crediario-dialog .sim-picker-btn:focus-visible,
.stats-modal-card.pos-dialog.crediario-dialog .sim-picker-btn[aria-expanded="true"] {
  border-color: var(--pop-accent);
  box-shadow: 0 0 0 3px var(--pop-accent-soft);
}

.stats-modal-card.pos-dialog.crediario-dialog .sim-picker-ic {
  color: var(--pop-muted);
}

.stats-modal-card.pos-dialog.crediario-dialog.fin-contract-send-dialog .fin-contract-send-summary,
.stats-modal-card.pos-dialog.crediario-dialog.fin-contract-send-dialog .fin-contract-link-preview {
  border-color: var(--pop-border);
  background: var(--pop-surface-alt);
}

.stats-modal-card.pos-dialog.crediario-dialog.fin-contract-send-dialog .fin-contract-send-summary strong,
.stats-modal-card.pos-dialog.crediario-dialog.fin-contract-send-dialog .fin-contract-link-preview code {
  color: var(--pop-ink);
}

.stats-modal-card.pos-dialog.crediario-dialog.fin-contract-send-dialog .fin-contract-send-summary span,
.stats-modal-card.pos-dialog.crediario-dialog.fin-contract-send-dialog .fin-contract-link-preview span,
.stats-modal-card.pos-dialog.crediario-dialog.fin-contract-send-dialog .fin-contract-send-note {
  color: var(--pop-muted);
}

.stats-modal-card.pos-dialog.crediario-dialog.rdx-project-popover.fin-seller-upload-dialog {
  border-color: var(--pop-border);
  background: var(--pop-surface);
  color: var(--pop-ink);
  box-shadow: var(--pop-shadow);
}

.stats-modal-card.pos-dialog.crediario-dialog.rdx-project-popover.fin-seller-upload-dialog .stats-modal-head,
.stats-modal-card.pos-dialog.crediario-dialog.rdx-project-popover.fin-seller-upload-dialog .stats-modal-foot {
  border-color: var(--pop-border);
  background: var(--pop-surface);
}

@media (max-width: 640px) {
  .stats-modal-card.pos-dialog.crediario-dialog .sim-picker-btn {
    min-height: 52px;
  }
}

/* ---------------------------------------------------------------------------
   Checkout — card do plano como RESUMO DO PEDIDO
   O card preto deixa de listar benefícios e passa a mostrar o que está sendo
   comprado: cobrança, lojas (com o seletor, que saiu do formulário), preço por
   loja e total. Regras depois do bloco responsivo original de propósito: as
   compactações de mobile do card de plano não valem para o resumo.
--------------------------------------------------------------------------- */
.plan-card.plan-featured.checkout-summary {
  display: flex;
  flex-direction: column;
  padding: 26px 24px 24px;
}
.co-sum-plan { display: flex; flex-direction: column; gap: 6px; }
.co-sum-plan-tag {
  color: rgba(255, 255, 255, 0.48);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.co-sum-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.co-sum-eyebrow .icon { width: 15px; height: 15px; color: rgba(255, 255, 255, 0.45); }
.co-sum-eyebrow .icon svg { width: 15px; height: 15px; }
.checkout-summary .plan-name { font-size: 26px; line-height: 1.1; }
.co-sum-desc {
  min-height: 0;
  margin: 9px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 13.5px;
  line-height: 1.45;
}
.co-sum-rows {
  margin-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
}
.co-sum-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
}
.co-sum-key {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-weight: 600;
}
.co-sum-key .icon { width: 16px; height: 16px; flex: 0 0 auto; color: rgba(255, 255, 255, 0.42); }
.co-sum-key .icon svg { width: 16px; height: 16px; }
.co-sum-val {
  color: #ffffff;
  font-size: 14px;
  font-weight: 750;
  text-align: right;
  white-space: nowrap;
}

/* Seletor de lojas dentro do card escuro: o estilo claro do formulário não serve. */
.checkout-summary .sub-store-stepper {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
}
.checkout-summary .sub-store-stepper button { color: rgba(255, 255, 255, 0.92); }
.checkout-summary .sub-store-stepper button:hover:not(:disabled) { color: #111111; background: #ffffff; }
.checkout-summary .sub-store-stepper button:disabled { color: rgba(255, 255, 255, 0.28); }
.checkout-summary .sub-store-stepper output {
  border-inline-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}
.checkout-summary .sub-store-badge {
  display: inline-grid;
  flex: 0 0 auto;
  height: 30px;
  min-width: 30px;
  place-items: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  font-size: 13px;
  font-weight: 750;
}
.checkout-summary .sub-store-badge output { font: inherit; }

/* O que já vem no plano: enche o corpo do card sem virar lista de vitrine. */
.co-sum-included { margin-top: 20px; }
.co-sum-eyebrow-sm { margin-bottom: 11px; font-size: 10px; }
.co-sum-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.co-sum-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  line-height: 1.3;
}
.co-sum-list .icon {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #111111;
  background: rgba(255, 255, 255, 0.9);
}
.co-sum-list .icon svg { width: 11px; height: 11px; }

/* Total: colado no rodapé do card, seja qual for a altura da coluna. */
.co-sum-total {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  padding-top: 22px;
}
.co-sum-total-key {
  padding-bottom: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.checkout-summary .plan-price {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin: 0;
}
.checkout-summary .plan-value { font-size: clamp(34px, 3.1vw, 46px); }
.checkout-summary .plan-currency { font-size: 15px; }
.checkout-summary .plan-period { font-size: 13px; }
.co-sum-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 11.5px;
  line-height: 1.35;
}
.co-sum-note .icon { width: 14px; height: 14px; flex: 0 0 auto; }
.co-sum-note .icon svg { width: 14px; height: 14px; }

/* Entrada escalonada do resumo (o card já está deslizando para o centro). */
.checkout-summary > * {
  animation: coSumIn 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.checkout-summary > *:nth-child(2) { animation-delay: 50ms; }
.checkout-summary > *:nth-child(3) { animation-delay: 90ms; }
.checkout-summary > *:nth-child(4) { animation-delay: 130ms; }
.checkout-summary > *:nth-child(5) { animation-delay: 170ms; }
.checkout-summary > *:nth-child(6) { animation-delay: 210ms; }
.checkout-summary > *:nth-child(7) { animation-delay: 250ms; }
.checkout-summary > *:nth-child(8) { animation-delay: 290ms; }
@keyframes coSumIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .checkout-summary > * { animation: none; }
}

@media (max-width: 680px) {
  /* No celular o resumo continua em coluna (o card de plano vira linha), só que
     curto: cabeçalho, lojas e total. O período já está no seletor acima. */
  .plans-grid.checkout-active .plan-card.plan-featured.checkout-summary {
    display: block;
    padding: 14px 16px 16px;
    margin-bottom: 12px !important;
  }
  .checkout-summary .co-sum-plan-tag,
  .checkout-summary .co-sum-eyebrow,
  .checkout-summary .co-sum-desc,
  .checkout-summary .co-sum-note,
  .checkout-summary .co-sum-included { display: none !important; }
  .plans-grid.checkout-active .plan-card.plan-featured.checkout-summary .plan-name {
    font-size: 17px;
    font-weight: 700;
  }
  .checkout-summary .co-sum-rows { margin-top: 10px; }
  .checkout-summary .co-sum-row { min-height: 42px; padding: 5px 0; }
  .checkout-summary .co-sum-row:first-child { display: none; }
  .checkout-summary .co-sum-total { padding-top: 12px; }
  .checkout-summary .co-sum-total-key { padding-bottom: 6px; font-size: 10px; }
  .plans-grid.checkout-active .plan-card.plan-featured.checkout-summary .plan-price {
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 2px;
  }
  .plans-grid.checkout-active .plan-card.plan-featured.checkout-summary .plan-value {
    font-size: 26px;
    letter-spacing: -0.05em;
  }
  .plans-grid.checkout-active .plan-card.plan-featured.checkout-summary .plan-currency { font-size: 12px; }
  .plans-grid.checkout-active .plan-card.plan-featured.checkout-summary .plan-period { font-size: 12px; }
}

/* ---------------------------------------------------------------------------
   Resumo do pedido como faixa fixa à direita
   O card deixa a coluna do grid e vira um painel colado na borda direita, de
   cima a baixo. O formulário fica sozinho no miolo e a página ganha um recuo
   do tamanho da faixa para nada passar por baixo dela.
--------------------------------------------------------------------------- */
/* Abaixo de 901px a faixa comeria a largura do formulário, então nessa faixa
   valem o layout de duas colunas e, no celular, o empilhado. */
@media (min-width: 901px) {
  .plans-page:has(.checkout-summary) {
    --co-rail: clamp(320px, 27vw, 420px);
    padding-right: calc(var(--co-rail) + 28px);
  }
  .plans-grid.checkout-active .plan-card.plan-featured.checkout-summary {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    width: var(--co-rail, 400px);
    box-sizing: border-box;
    margin: 0;
    padding: 44px 34px;
    justify-content: center;
    /* safe center evita que o topo fique inalcançável quando a janela é baixa
       demais para o conteúdo; navegadores sem suporte ficam no center acima. */
    justify-content: safe center;
    overflow-y: auto;
    border: 0;
    border-radius: 0;
    box-shadow: -26px 0 64px rgba(10, 10, 12, 0.26);
    animation: coRailIn 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .plans-grid.checkout-active .plan-card.plan-featured.checkout-summary:hover {
    transform: none;
    box-shadow: -26px 0 64px rgba(10, 10, 12, 0.26);
  }
  /* Fora do grid, o total não precisa mais ser empurrado para o rodapé: o
     conteúdo inteiro fica centrado na faixa. */
  /* Na faixa estreita o rótulo e o preço lado a lado quebravam a linha; em
     coluna o total cabe em qualquer largura. */
  .checkout-summary .co-sum-total {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-top: 26px;
  }
  .checkout-summary .co-sum-total-key { padding-bottom: 0; }
  .checkout-summary .plan-value { font-size: clamp(34px, 2.7vw, 46px); }

  /* Sem o card na coluna 1, o formulário assume a linha inteira. */
  .plans-grid.checkout-active {
    width: min(860px, 100%);
    grid-template-columns: minmax(0, 1fr);
  }
  .plans-grid.checkout-active .plans-checkout { grid-column: 1; grid-row: 1; }
}
@keyframes coRailIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .plans-grid.checkout-active .plan-card.plan-featured.checkout-summary { animation: none; }
}

/* ---------------------------------------------------------------------------
   Planos ⇄ checkout numa View Transition (runPlansViewTransition)
   Antes o card preto ficava parado, sumia e a faixa entrava pela direita; o
   título pulava de tamanho. Agora o card vira a faixa (e volta), o título e o
   ícone encolhem no lugar, os outros cards sobem e o formulário desce. Os
   nomes só existem com a classe no <html>, durante a transição.
--------------------------------------------------------------------------- */
html.plans-vt .plans-hero-icon { view-transition-name: plans-icon; }
/* O h1 ocupa a largura do hero, que muda entre as telas; capturado assim, o
   texto antigo e o novo saíam em escalas diferentes e o título duplicava.
   Do tamanho do texto, as duas capturas se sobrepõem. */
html.plans-vt .plans-title {
  view-transition-name: plans-title;
  width: fit-content;
  margin-inline: auto;
}
html.plans-vt .plans-grid .plan-card.plan-featured { view-transition-name: plan-featured; }
html.plans-vt-go .plans-grid > .plan-card:not(.plan-featured):nth-child(2) { view-transition-name: plan-card-2; }
html.plans-vt-go .plans-grid > .plan-card:not(.plan-featured):nth-child(3) { view-transition-name: plan-card-3; }
html.plans-vt-go .plans-grid > .plan-card:not(.plan-featured):nth-child(4) { view-transition-name: plan-card-4; }
html.plans-vt-back .plans-grid .plans-checkout { view-transition-name: plans-checkout; }
/* Criação do sistema: a faixa preta passa do passo do ramo para o de nome e
   foto no lugar (renderSegmentStep ⇄ renderIdentityStep). */
html.plans-vt .seg-rail { view-transition-name: onboard-rail; }
/* No Chrome do Mac o vidro fosco (backdrop-filter) de um elemento capturado
   ficava pintado no lugar antigo depois que o card já tinha saído: sobravam
   retângulos borrados por cima do formulário até a transição acabar. Sem o
   filtro só durante a transição, a captura é o card e mais nada. */
html.plans-vt .plans-grid .plan-card,
html.plans-vt .plans-grid .sub-modal.sub-inpage {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

::view-transition-group(plan-featured),
::view-transition-group(plans-title),
::view-transition-group(plans-icon),
::view-transition-group(onboard-rail) {
  animation-duration: 640ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
/* O card e a faixa têm proporções muito diferentes, então as duas capturas
   não se cobrem no meio do caminho. O fundo preto do par mantém a caixa
   sólida, e a mistura normal (não a aditiva) não clareia o preto. */
::view-transition-image-pair(plan-featured) {
  background: #101010;
  border-radius: 30px;
}
::view-transition-old(plan-featured),
::view-transition-new(plan-featured) { mix-blend-mode: normal; }
/* A caixa já percorre ~70% do trajeto em 160ms; as trocas de conteúdo
   acompanham isso para ela não ficar um bloco vazio no meio do caminho. */
::view-transition-old(plan-featured) { animation: plansVtFadeOut 170ms ease-out both; }
::view-transition-new(plan-featured) { animation: plansVtFadeIn 360ms ease-out 100ms both; }
/* O canto acompanha a forma: card de plano 30px; resumo 16px no celular e
   faixa reta a partir de 768px (regras 901+ e 768–900). */
html.plans-vt::view-transition-image-pair(plan-featured) { --plans-vt-summary-corner: 16px; }
@media (min-width: 768px) {
  html.plans-vt::view-transition-image-pair(plan-featured) { --plans-vt-summary-corner: 0px; }
}
html.plans-vt-go::view-transition-image-pair(plan-featured) {
  animation: plansVtCornerToSummary 640ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
html.plans-vt-back::view-transition-image-pair(plan-featured) {
  animation: plansVtCornerToCard 640ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
::view-transition-old(plan-card-2),
::view-transition-old(plan-card-3),
::view-transition-old(plan-card-4) {
  /* Saem rápido e sem desfoque: o formulário nasce embaixo deles, e com a
     curva lenta + blur eles ficavam como vidro fosco por cima dos campos. */
  animation: plansVtCardUp 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
::view-transition-old(plan-card-3) { animation-delay: 25ms; }
::view-transition-old(plan-card-4) { animation-delay: 50ms; }
::view-transition-old(plans-checkout) {
  animation: plansVtFormDown 320ms cubic-bezier(0.32, 0, 0.67, 0) both;
}
@keyframes plansVtFadeOut { to { opacity: 0; } }
@keyframes plansVtFadeIn { from { opacity: 0; } }
@keyframes plansVtCornerToSummary { from { border-radius: 30px; } to { border-radius: var(--plans-vt-summary-corner); } }
@keyframes plansVtCornerToCard { from { border-radius: var(--plans-vt-summary-corner); } to { border-radius: 30px; } }
@keyframes plansVtCardUp {
  to { opacity: 0; transform: translateY(-56px) scale(0.97); }
}
@keyframes plansVtFormDown {
  to { opacity: 0; transform: translateY(48px) scale(0.98); }
}
/* Entre os passos da criação o título troca de texto, e o cruzamento padrão
   deixava os dois encavalados no meio do caminho: o antigo sai rápido e o
   novo entra logo depois. */
html.plans-vt-step::view-transition-old(plans-title) { animation: plansVtFadeOut 160ms ease-out both; }
html.plans-vt-step::view-transition-new(plans-title) { animation: plansVtFadeIn 320ms ease-out 140ms both; }
/* A faixa preta de um passo para o outro (ramo ⇄ nome e foto): a antiga
   fica inteira por baixo e a nova desce por cima como uma cortina, então
   nenhum quadro fica transparente. Antes um fundo preto fixo no par segurava
   a faixa sólida — e, quando o destino não tinha faixa (o quadro de lojas),
   esse fundo ficava sozinho na tela até a transição acabar. */
html.plans-vt-step::view-transition-old(onboard-rail) { animation: none; }
html.plans-vt-step::view-transition-new(onboard-rail) {
  animation: plansVtRailWipe 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* Só um lado tem faixa (ramo ⇄ quadro de lojas): ela sai pela direita, ou
   entra por ela na volta, como o resumo do checkout. O ícone do topo também
   só existe de um lado e não espera a transição inteira para sumir. */
html.plans-vt-step::view-transition-old(onboard-rail):only-child {
  animation: plansVtRailOut 340ms cubic-bezier(0.32, 0, 0.67, 0) both;
}
html.plans-vt-step::view-transition-new(onboard-rail):only-child {
  animation: coRailIn 480ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
html.plans-vt-step::view-transition-old(plans-icon):only-child { animation: plansVtFadeOut 200ms ease-out both; }
html.plans-vt-step::view-transition-new(plans-icon):only-child { animation: plansVtFadeIn 300ms ease-out 100ms both; }
@keyframes plansVtRailWipe {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 0 0); }
}
@keyframes plansVtRailOut {
  to { transform: translateX(100%); }
}

/* ---------------------------------------------------------------------------
   Criação do sistema: o ramo da loja (seg-*) e o nome e a foto (idn-*)
   Mesmo desenho da tela de planos e do checkout: a .plans-page, o mesmo
   topo e a faixa preta fixa à direita — aqui ela lista as páginas do sistema
   (ramo) e mostra a prévia ao vivo (nome e foto). Nada aqui usa
   backdrop-filter: com ele, a View Transition entre os passos deixava
   retângulos borrados na tela no Chrome do Mac.
--------------------------------------------------------------------------- */
.plans-page.seg-page {
  --seg-rail: clamp(320px, 27vw, 420px);
  padding-bottom: 40px;
}
.seg-hero { margin: 8px 0 28px; }
.seg-page .plans-title { font-size: clamp(36px, 4.2vw, 64px); }
.seg-page .plans-sub { max-width: 620px; }

.seg-grid {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.seg-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 190px;
  padding: 20px 20px 18px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 22px 56px rgba(39, 45, 52, 0.08);
  color: #111111;
  font: inherit;
  text-align: left;
  cursor: pointer;
  animation: planCardIn 560ms cubic-bezier(0.33, 1, 0.68, 1) both;
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 280ms ease,
    background 220ms ease, border-color 220ms ease, color 220ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .seg-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 48px rgba(28, 33, 38, 0.14), 0 46px 96px rgba(28, 33, 38, 0.08);
  }
}
.seg-card:focus-visible { outline: 3px solid rgba(var(--blue-rgb), 0.45); outline-offset: 3px; }
.seg-card-top {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.seg-card-ic {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: #111111;
  color: #ffffff;
  transition: background 220ms ease, color 220ms ease;
}
.seg-card-ic .icon { width: 23px; height: 23px; }
.seg-card-check {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  box-sizing: border-box;
  border: 1.5px solid rgba(17, 17, 17, 0.16);
  border-radius: 50%;
  color: transparent;
  transition: background 220ms ease, border-color 220ms ease, color 220ms ease, transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.seg-card-check .icon { width: 16px; height: 16px; }
.seg-card-name { font-size: 17px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
.seg-card-desc { color: #6b6b6b; font-size: 13px; line-height: 1.4; }
.seg-card-foot {
  margin-top: auto;
  padding-top: 10px;
  color: #8a8a8a;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.seg-card.is-on {
  border-color: #101010;
  background: #101010;
  color: #ffffff;
  box-shadow: 0 26px 60px rgba(12, 12, 12, 0.24);
}
.seg-card.is-on .seg-card-ic { background: #ffffff; color: #111111; }
.seg-card.is-on .seg-card-check {
  border-color: #ffffff;
  background: #ffffff;
  color: #111111;
  transform: scale(1.08);
}
.seg-card.is-on .seg-card-desc { color: rgba(255, 255, 255, 0.66); }
.seg-card.is-on .seg-card-foot { color: rgba(255, 255, 255, 0.5); }
/* No escuro o card escolhido inverte, como a pílula do período em Planos:
   preto sobre cards cinza-escuros quase não se distinguia. */
html[data-theme="dark"] .seg-card {
  border-color: rgba(255, 255, 255, 0.10);
  background: rgba(38, 38, 42, 0.82);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.92);
}
html[data-theme="dark"] .seg-card-ic { background: rgba(255, 255, 255, 0.10); color: #ffffff; }
html[data-theme="dark"] .seg-card-check { border-color: rgba(255, 255, 255, 0.22); }
html[data-theme="dark"] .seg-card-desc { color: rgba(255, 255, 255, 0.55); }
html[data-theme="dark"] .seg-card-foot { color: rgba(255, 255, 255, 0.42); }
html[data-theme="dark"] .seg-card.is-on {
  border-color: #f5f5f7;
  background: #f5f5f7;
  color: #111111;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .seg-card.is-on .seg-card-ic { background: #111111; color: #ffffff; }
html[data-theme="dark"] .seg-card.is-on .seg-card-check { border-color: #111111; background: #111111; color: #ffffff; }
html[data-theme="dark"] .seg-card.is-on .seg-card-desc { color: #5f5f5f; }
html[data-theme="dark"] .seg-card.is-on .seg-card-foot { color: #8a8a8a; }

/* A faixa preta: no celular fica embaixo do conteúdo; a partir de 768px vira
   a coluna fixa da direita, igual ao resumo do checkout. */
.seg-rail {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: min(560px, 100%);
  margin-top: 22px;
  padding: 26px 22px 22px;
  border-radius: 26px;
  background: #101010;
  color: #ffffff;
  box-shadow: 0 26px 60px rgba(12, 12, 12, 0.24);
}
@media (min-width: 768px) {
  .plans-page.seg-page { padding-right: calc(var(--seg-rail) + 28px); }
  .seg-rail {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    width: var(--seg-rail);
    margin: 0;
    padding: 40px 30px 28px;
    overflow: hidden;
    border-radius: 0;
    box-shadow: -26px 0 64px rgba(10, 10, 12, 0.26);
    animation: coRailIn 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}
.seg-rail-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.seg-rail-eyebrow .icon { width: 15px; height: 15px; }
.seg-rail-name { font-size: 26px; font-weight: 700; letter-spacing: -0.05em; line-height: 1.1; }
.seg-rail-name.seg-swap { animation: segNameIn 360ms cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes segNameIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.seg-rail-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.seg-rail-desc {
  min-height: 38px;
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  line-height: 1.45;
}
.seg-rail-count {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 20px 0 8px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}
.seg-rail-count span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.seg-rail-count b { font-size: 13px; }
/* A lista rola sozinha numa janela baixa; o Continuar fica sempre à vista. */
.seg-tabs {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 2px;
  margin: 0 -8px;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  transition: opacity 220ms ease;
}
.plans-page.seg-page:not(.has-segment) .seg-tabs { opacity: 0.4; }
.seg-tab {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 5px 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.seg-tab:hover:not(:disabled) { background: rgba(255, 255, 255, 0.07); }
.seg-tab:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.6); outline-offset: -2px; }
.seg-tab:disabled { cursor: default; }
.seg-tab-ic {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 160ms ease;
}
.seg-tab-ic .icon { width: 15px; height: 15px; }
.seg-tab-label { flex: 1; min-width: 0; }
.seg-tab-switch {
  position: relative;
  flex: 0 0 auto;
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  transition: background 180ms ease;
}
.seg-tab-switch > span {
  position: absolute;
  top: 3px;
  left: 15px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #101010;
  transition: left 180ms ease, background 180ms ease;
}
.seg-tab.off { color: rgba(255, 255, 255, 0.36); }
.seg-tab.off .seg-tab-ic { background: rgba(255, 255, 255, 0.04); }
.seg-tab.off .seg-tab-label { text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.25); }
.seg-tab.off .seg-tab-switch { background: rgba(255, 255, 255, 0.16); }
.seg-tab.off .seg-tab-switch > span { left: 3px; background: rgba(255, 255, 255, 0.55); }
.seg-tab.is-locked { cursor: default; }
.seg-tab.is-locked:hover { background: transparent; }
.seg-tab-lock {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.78);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.seg-tab-lock .icon { width: 11px; height: 11px; }
.seg-rail-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 11.5px;
  line-height: 1.45;
}
.seg-rail-note .icon { width: 14px; height: 14px; margin-top: 1px; }
.seg-rail-cta.big-btn {
  flex: 0 0 auto;
  height: 54px;
  margin-top: 16px;
  border-radius: 16px;
  color: #111111;
  background: #ffffff;
  font-weight: 650;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.34);
}
.seg-rail-cta.big-btn .icon { color: #111111; }
.seg-rail-cta.big-btn:hover:not(:disabled) { filter: brightness(0.94); }
.seg-rail-cta.big-btn:disabled { opacity: 0.35; box-shadow: none; cursor: default; }

/* Nome e foto: o cartão do formulário à esquerda (a mesma superfície do
   "Dados do pagamento") e a prévia ao vivo na faixa. */
.idn-page .plans-title { font-size: clamp(34px, 3.8vw, 56px); }
.idn-card {
  box-sizing: border-box;
  width: min(560px, 100%);
  padding: 28px 28px 24px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.84) 55%, rgba(255, 255, 255, 0.9) 100%);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: checkoutCardRise 500ms cubic-bezier(0.22, 1, 0.36, 1) 80ms both;
}
.idn-card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  color: #111111;
  font-size: 16px;
  font-weight: 700;
}
.idn-card-title .icon { width: 20px; height: 20px; color: var(--blue); }
.idn-photo {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px;
  border: 1.5px dashed rgba(17, 17, 17, 0.18);
  border-radius: 22px;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}
.idn-photo:hover,
.idn-photo.dragover { border-color: var(--blue); background: rgba(var(--blue-rgb), 0.05); }
.idn-photo:focus-visible { outline: 3px solid rgba(var(--blue-rgb), 0.4); outline-offset: 2px; }
.idn-photo.has-photo { border-style: solid; border-color: rgba(17, 17, 17, 0.08); }
.idn-photo.is-disabled { pointer-events: none; opacity: 0.6; }
/* A mesma foto aparece aqui e na prévia da faixa (.idn-prev-logo): os dois
   quadros têm o mesmo tamanho e o mesmo canto, para ela não parecer outra. */
.idn-photo-frame {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 112px;
  height: 112px;
  overflow: hidden;
  border-radius: 30px;
  background: #f1f1ef;
  color: #9a9a9a;
}
.idn-photo-empty .icon { width: 34px; height: 34px; }
.idn-photo-img { position: absolute; inset: 0; display: none; width: 100%; height: 100%; object-fit: cover; }
.idn-photo.has-photo .idn-photo-img { display: block; }
.idn-photo.has-photo .idn-photo-empty { display: none; }
.idn-photo-text { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.idn-photo-text b { color: #111111; font-size: 15px; }
.idn-photo-hint { color: #8a8a8a; font-size: 12.5px; line-height: 1.4; }
.idn-photo-hint.is-error { color: #d93025; }
.idn-field { display: block; margin-top: 18px; }
.idn-field-label { display: block; margin: 0 0 8px 2px; color: #555555; font-size: 12.5px; font-weight: 650; }
.idn-name-field input { font-size: 16px; }
.idn-card-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 14px 2px 0;
  color: #8a8a8a;
  font-size: 12px;
  line-height: 1.45;
}
.idn-card-note .icon { width: 14px; height: 14px; margin-top: 1px; }
html[data-theme="dark"] .idn-card {
  border-color: rgba(255, 255, 255, 0.10);
  background: linear-gradient(135deg, rgba(38, 38, 42, 0.96), rgba(28, 28, 32, 0.94));
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .idn-card-title,
html[data-theme="dark"] .idn-photo-text b { color: rgba(255, 255, 255, 0.92); }
html[data-theme="dark"] .idn-photo { border-color: rgba(255, 255, 255, 0.18); }
html[data-theme="dark"] .idn-photo.has-photo { border-color: rgba(255, 255, 255, 0.10); }
html[data-theme="dark"] .idn-photo-frame { background: rgba(255, 255, 255, 0.07); color: rgba(255, 255, 255, 0.5); }
html[data-theme="dark"] .idn-field-label { color: rgba(255, 255, 255, 0.6); }
html[data-theme="dark"] .idn-card .login-field { background: rgba(255, 255, 255, 0.07); }
html[data-theme="dark"] .idn-photo-hint,
html[data-theme="dark"] .idn-card-note { color: rgba(255, 255, 255, 0.45); }
/* No escuro o --blue vira cinza-claro (#a4a7ae) e o .btn-login seguia com
   texto branco fixo: "Entrar no sistema" do comprovante, o "Concluir" do
   quadro de lojas e o "Personalizar meu sistema" mal se liam. O token certo
   para texto sobre o --blue já existe. */
html[data-theme="dark"] .personalize-page .btn-login,
html[data-theme="dark"] .sub-success .btn-login { color: var(--blue-ink); }

@media (min-width: 768px) {
  .idn-rail { justify-content: center; justify-content: safe center; overflow-y: auto; }
}
.idn-prev { display: flex; flex-direction: column; align-items: center; padding: 6px 0 24px; text-align: center; }
.idn-prev-logo {
  position: relative;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  overflow: hidden;
  border-radius: 30px;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 0 64px rgba(var(--blue-rgb), 0.32), 0 22px 50px rgba(0, 0, 0, 0.5);
}
/* Presa ao quadro como a do formulário (.idn-photo-img). Como item de grid,
   o height: 100% não valia: uma foto em pé ficava 112x149, encostada no topo
   e cortada só embaixo, e aparecia enquadrada diferente nos dois lugares. */
.idn-prev-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Sem foto, o ícone do RDX: ele é desenhado para caber com folga, não colado. */
.idn-rail:not(.has-photo) .idn-prev-logo img { box-sizing: border-box; padding: 20px; object-fit: contain; }
.idn-prev-logo.is-pop { animation: idnLogoPop 560ms cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes idnLogoPop {
  0% { transform: scale(0.8); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.idn-rail.is-building .idn-prev-logo { animation: idnBuilding 1200ms ease-in-out infinite; }
@keyframes idnBuilding { 50% { transform: scale(0.94); opacity: 0.8; } }
.idn-prev-name {
  max-width: 100%;
  margin-top: 18px;
  color: #ffffff;
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -0.05em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.idn-prev-name.is-default { color: rgba(255, 255, 255, 0.45); }
.idn-prev-seg { margin-top: 8px; color: rgba(255, 255, 255, 0.5); font-size: 12.5px; }
.idn-mini {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}
.idn-mini-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.idn-mini-logo { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px; background: #ffffff; object-fit: cover; }
.idn-rail:not(.has-photo) .idn-mini-logo { box-sizing: border-box; padding: 5px; object-fit: contain; }
.idn-mini-name { min-width: 0; overflow: hidden; font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.idn-mini-nav { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.idn-mini-nav li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12.5px;
}
.idn-mini-nav li .icon { width: 15px; height: 15px; }
.idn-mini-nav li.is-active { background: rgba(255, 255, 255, 0.10); color: #ffffff; }
.idn-mini-nav li.idn-mini-more { padding-left: 33px; color: rgba(255, 255, 255, 0.38); }

/* Celular: dois cards por linha e a faixa como um cartão no fim da página. */
@media (max-width: 560px) {
  .seg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .seg-card { min-height: 0; padding: 16px 14px 14px; border-radius: 22px; }
  .seg-card-ic { width: 40px; height: 40px; border-radius: 13px; }
  .seg-card-name { font-size: 15px; }
  .seg-card-desc { font-size: 12px; }
  .idn-card { padding: 22px 18px 20px; border-radius: 26px; }
  .idn-photo { gap: 14px; padding: 12px; }
  .idn-photo-frame,
  .idn-prev-logo { width: 96px; height: 96px; border-radius: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .seg-card,
  .seg-rail,
  .idn-card,
  .seg-rail-name.seg-swap,
  .idn-prev-logo.is-pop,
  .idn-rail.is-building .idn-prev-logo { animation: none; }
}

/* ---------------------------------------------------------------------------
   Checkout em uma tela só
   Com a faixa à direita, o miolo passa a caber na janela: o cabeçalho encolhe
   e o formulário fica centrado na altura que sobra, em vez de vazar por baixo
   (a .plans-page tem overflow:hidden, então o excesso era cortado, não rolado).
--------------------------------------------------------------------------- */
@media (min-width: 901px) {
  .plans-page:has(.checkout-summary) {
    height: var(--app-height);
    min-height: var(--app-height);
    padding-top: 18px;
    padding-bottom: 18px;
    /* A .plans-page nasce com overflow:hidden, que CORTAVA o que não coubesse.
       Aqui o que sobra rola. Como tudo cabe, a barra nem aparece — e a sombra
       do formulário fica inteira, coisa que um overflow na coluna comia. */
    overflow-x: hidden;
    overflow-y: auto;
  }
  /* Com a página rolável, as bolas de fundo (que ficam de propósito para fora
     das bordas) passavam a contar como conteúdo e criavam uma barra de rolagem
     de alguns pixels com nada dentro. Fixas, elas não contam. */
  .plans-page:has(.checkout-summary) .orb { position: fixed; }
  .plans-page:has(.checkout-summary) .plans-hero { margin: 2px 0 12px; }
  .plans-page:has(.checkout-summary) .plans-hero-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
  }
  .plans-page:has(.checkout-summary) .plans-title {
    margin: 0;
    font-size: clamp(28px, 2.9vw, 40px);
  }
  /* A oferta e o preço já estão na faixa da direita; aqui a linha só ocupava
     altura e empurrava o formulário para fora da tela. */
  .plans-page:has(.checkout-summary) .plans-sub { display: none; }

  .plans-grid.checkout-active {
    flex: 1;
    min-height: 0;
    align-content: center;
    /* safe center: numa janela baixa demais o topo do formulário continua
       alcançável em vez de ficar cortado acima da área visível. */
    align-content: safe center;
    /* Nada de overflow aqui: qualquer valor diferente de visible recorta a
       sombra do card nas quatro bordas da coluna. */
    overflow: visible;
  }
  .plans-grid.checkout-active .plans-checkout {
    align-items: center;
    min-height: 0;
  }
  .plans-grid.checkout-active .plans-checkout .sub-modal.sub-inpage { min-height: 0; }
  .plans-grid.checkout-active .sub-form { padding: 30px 34px; }
}

/* Telas baixas (notebook): o formulário aperta o próprio respiro para caber
   inteiro, em vez de a coluna do meio precisar rolar. */
@media (min-width: 901px) and (max-height: 880px) {
  .plans-grid.checkout-active .sub-form { padding: 24px 32px; }
  .plans-grid.checkout-active .sub-form-title { margin-bottom: 14px; }
  .plans-grid.checkout-active .sub-form .field-gap { height: 10px; }
  .plans-grid.checkout-active .sub-submit { margin-top: 14px; height: 52px; }
  .plans-grid.checkout-active .sub-form .signup-terms { margin-top: 10px; }
}

/* ---------------------------------------------------------------------------
   Comportamento do texto no cartão branco do checkout
--------------------------------------------------------------------------- */
/* Campo estreito decepava a palavra na borda; agora corta com reticências. */
.sub-form .login-field input { text-overflow: ellipsis; }
/* O título quebra em linhas parelhas em vez de deixar uma palavra sozinha. */
.sub-form-title {
  line-height: 1.3;
  text-wrap: balance;
}
/* O texto do Pix era miúdo demais para o tanto que explica. */
.sub-form .sub-pix-intro {
  font-size: 13px;
  line-height: 1.55;
  text-wrap: pretty;
}
.sub-form .signup-terms { text-wrap: pretty; }

/* ---------------------------------------------------------------------------
   Sem seletor de período dentro do checkout
   O período é escolhido na tela de planos e o checkout abre já com ele; a faixa
   preta mostra qual é, na linha "Cobrança". O seletor continua na tela de
   planos e na tela de renovação, onde ele é a única forma de escolher — por
   isso a regra depende do .checkout-summary, que só o fluxo "Assinar" cria.
--------------------------------------------------------------------------- */
.plans-page:has(.checkout-summary) .plans-period-switch { display: none; }

/* ---------------------------------------------------------------------------
   Pagamento dentro do card preto
   Os dois métodos e o botão de pagar saíram do formulário branco e vivem no
   resumo, logo abaixo do total. O formulário ficou só com os campos.
--------------------------------------------------------------------------- */
.co-sum-pay { margin-top: 24px; }
/* Cartão e Pix sempre lado a lado, em duas colunas iguais. */
.checkout-summary .sub-pay-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 10px;
}
.checkout-summary .sub-pay-method {
  min-height: 42px;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.6);
}
.checkout-summary .sub-pay-method:hover { color: rgba(255, 255, 255, 0.88); }
.checkout-summary .sub-pay-method.active {
  border-color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}
/* Botão preto sobre card preto sumiria: no resumo ele inverte. */
.checkout-summary .sub-submit {
  height: 52px;
  margin-top: 0;
  border-radius: 16px;
  color: #111111;
  background: #ffffff;
  font-weight: 650;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.34);
}
.checkout-summary .sub-submit .icon { color: #111111; }
.checkout-summary .sub-submit:hover:not(:disabled) { filter: brightness(0.94); }

/* Só a ação do método ativo aparece. Quem diz qual é o painel escondido lá no
   formulário, então a regra lê o [hidden] dele em vez de duplicar estado. */
.plans-page:has(.checkout-summary):has(#sub-card-area[hidden]) #sub-submit { display: none; }
.plans-page:has(.checkout-summary):has(#sub-pix-area[hidden]) #sub-pix-generate { display: none; }

@media (max-width: 680px) {
  /* No celular o card preto desce para baixo do formulário: com o botão de
     pagar dentro dele, deixá-lo em cima faria preencher os campos e ter que
     voltar para pagar. */
  .plans-grid.checkout-active .plans-checkout { grid-row: 1; }
  .plans-grid.checkout-active .plan-card.plan-featured.checkout-summary {
    grid-row: 2;
    margin: 12px auto 0 !important;
  }
  .checkout-summary .co-sum-pay { margin-top: 14px; }
  .checkout-summary .sub-submit { height: 50px; }
}

/* Comparação compacta dos nomes na compra, com a foto do cadastro. */
.stats-modal-card.rdx-project-popover.purchase-name-dialog {
  width: min(440px, calc(100vw - 32px));
}
.purchase-name-dialog .purchase-name-intro,
.purchase-name-dialog .purchase-name-note,
.purchase-name-dialog .purchase-name-error {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #6e6e73;
}
.purchase-name-dialog .purchase-name-intro { margin-bottom: 12px; color: #1d1d1f; }
.purchase-name-dialog .purchase-name-list { max-height: 44dvh; overflow-y: auto; overscroll-behavior: contain; }
.purchase-name-dialog .purchase-name-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; }
.purchase-name-dialog .purchase-name-item:first-child { padding-top: 0; }
.purchase-name-dialog .purchase-name-item + .purchase-name-item { border-top: 1px solid rgba(29, 29, 31, 0.09); }
.purchase-name-dialog .purchase-name-photo {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
  border: 1px solid rgba(0, 113, 227, 0.12);
  border-radius: 12px;
  background: rgba(0, 113, 227, 0.07);
  color: #0071e3;
  box-sizing: border-box;
}
.purchase-name-dialog .purchase-name-photo img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 7px; }
.purchase-name-dialog .purchase-name-photo img[hidden] { display: none; }
.purchase-name-dialog .purchase-name-photo-fallback { display: none; }
.purchase-name-dialog .purchase-name-photo.is-empty .purchase-name-photo-fallback { display: inline-flex; }
.purchase-name-dialog .purchase-name-photo-fallback .icon { width: 21px; height: 21px; }
.purchase-name-dialog .purchase-name-comparison { min-width: 0; flex: 1; display: grid; gap: 5px; }
.purchase-name-dialog .purchase-name-comparison small { display: block; margin-bottom: 1px; font-size: 10px; line-height: 1.3; font-weight: 400; color: #6e6e73; }
.purchase-name-dialog .purchase-name-comparison span,
.purchase-name-dialog .purchase-name-comparison strong { display: block; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.purchase-name-dialog .purchase-name-before span { color: #6e6e73; }
.purchase-name-dialog .purchase-name-after strong { color: #1d1d1f; font-weight: 600; }
.purchase-name-dialog .purchase-name-note { margin-top: 8px; font-size: 11px; }
.purchase-name-dialog .purchase-name-error { margin-top: 10px; color: #d70015; }
.purchase-name-dialog .purchase-name-error[hidden] { display: none; }
.stats-modal-card.rdx-project-popover.purchase-name-dialog .stats-modal-foot > button { height: 40px; font-size: 12px; border-radius: 12px; }
html[data-theme="dark"] .purchase-name-dialog .purchase-name-intro,
html[data-theme="dark"] .purchase-name-dialog .purchase-name-after strong { color: #f5f5f7; }
html[data-theme="dark"] .purchase-name-dialog .purchase-name-comparison small,
html[data-theme="dark"] .purchase-name-dialog .purchase-name-before span,
html[data-theme="dark"] .purchase-name-dialog .purchase-name-note { color: #a4a7ae; }
html[data-theme="dark"] .purchase-name-dialog .purchase-name-item + .purchase-name-item { border-color: rgba(255, 255, 255, 0.10); }

/* Escolha de cadastro da compra: mesma estrutura do aviso de vínculo. */
.stats-modal-card.rdx-project-popover.purchase-product-match-dialog {
  width: min(500px, calc(100vw - 32px));
}
.stats-modal-card.rdx-project-popover.purchase-product-match-dialog .stats-modal-body { padding: 16px; }
.purchase-product-match-dialog .purchase-name-intro { margin-bottom: 12px; }
.purchase-product-match-dialog .purchase-product-source {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
  padding: 0 2px 10px;
  border-bottom: 1px solid rgba(29, 29, 31, 0.09);
}
.purchase-product-match-dialog .purchase-product-source small,
.purchase-product-match-dialog .purchase-product-choice-copy small {
  color: #6e6e73;
  font-size: 10px;
  line-height: 1.35;
}
.purchase-product-match-dialog .purchase-product-source > span {
  color: #1d1d1f;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.purchase-product-match-dialog .purchase-product-choice-list { max-height: min(48dvh, 360px); }
.purchase-product-match-dialog .purchase-product-choice {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  margin: 0;
  padding: 10px 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #1d1d1f;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.purchase-product-match-dialog .purchase-product-choice + .purchase-product-choice { margin-top: 4px; }
.purchase-product-match-dialog .purchase-product-choice:hover { background: rgba(29, 29, 31, 0.05); }
.purchase-product-match-dialog .purchase-product-choice.is-selected {
  border-color: rgba(0, 113, 227, 0.48);
  background: rgba(0, 113, 227, 0.09);
}
.purchase-product-match-dialog .purchase-product-choice:focus-visible { outline: 2px solid #0071e3; outline-offset: 1px; }
.purchase-product-match-dialog .purchase-product-choice-copy { min-width: 0; flex: 1; display: grid; gap: 3px; }
.purchase-product-match-dialog .purchase-product-choice-copy strong {
  color: #1d1d1f;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.purchase-product-match-dialog .purchase-product-choice-price {
  flex: 0 0 auto;
  color: #1d1d1f;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.purchase-product-match-dialog .purchase-name-note { margin-top: 10px; }
.purchase-product-match-dialog [data-purchase-product-confirm]:disabled { opacity: 0.45; cursor: not-allowed; }
html[data-theme="dark"] .purchase-product-match-dialog .purchase-product-source { border-color: rgba(255, 255, 255, 0.10); }
html[data-theme="dark"] .purchase-product-match-dialog .purchase-product-source small,
html[data-theme="dark"] .purchase-product-match-dialog .purchase-product-choice-copy small { color: #a4a7ae; }
html[data-theme="dark"] .purchase-product-match-dialog .purchase-product-source > span,
html[data-theme="dark"] .purchase-product-match-dialog .purchase-product-choice-copy strong,
html[data-theme="dark"] .purchase-product-match-dialog .purchase-product-choice-price { color: #f5f5f7; }
html[data-theme="dark"] .purchase-product-match-dialog .purchase-product-choice:hover { background: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .purchase-product-match-dialog .purchase-product-choice.is-selected {
  border-color: rgba(93, 168, 255, 0.52);
  background: rgba(0, 113, 227, 0.17);
}
@media (max-width: 520px) {
  .purchase-product-match-dialog .purchase-product-choice { flex-wrap: wrap; gap: 8px; }
  .purchase-product-match-dialog .purchase-product-choice-price { margin-left: 68px; }
}

/* Busca de produto da loja na compra ("Produto existente"): card largo e cada
   resultado como cartão do tema novo, só com os tokens --pop-*. */
.stats-modal-card.pos-dialog.purchase-catalog-dialog {
  width: min(680px, calc(100vw - 32px));
}
.stats-modal-card.pos-dialog.purchase-catalog-dialog .stats-modal-body > .prod-confirm-text {
  margin: 0 0 14px;
  text-align: left;
}
.purchase-catalog-dialog .stats-option-list {
  max-height: min(56dvh, 520px);
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 2px;
}
.purchase-catalog-dialog .stats-option-list > .prod-confirm-text { margin: 12px 0; text-align: center; }
.purchase-catalog-dialog .purchase-catalog-card {
  width: 100%;
  min-height: 80px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 10px 16px 10px 10px;
  border: 1px solid var(--pop-border);
  border-radius: 14px;
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}
.purchase-catalog-dialog .purchase-catalog-card:hover { background: var(--pop-hover); }
.purchase-catalog-dialog .purchase-catalog-card:focus-visible { outline: 2px solid var(--pop-accent); outline-offset: 1px; }
.purchase-catalog-dialog .purchase-catalog-photo {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
  border: 1px solid var(--pop-border);
  border-radius: 12px;
  background: var(--pop-surface);
  color: var(--pop-muted);
  box-sizing: border-box;
}
.purchase-catalog-dialog .purchase-catalog-photo img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.purchase-catalog-dialog .purchase-catalog-photo img[hidden] { display: none; }
.purchase-catalog-dialog .purchase-catalog-photo-fallback { display: none; }
.purchase-catalog-dialog .purchase-catalog-photo.is-empty .purchase-catalog-photo-fallback { display: inline-flex; }
.purchase-catalog-dialog .purchase-catalog-photo-fallback .icon { width: 22px; height: 22px; }
.purchase-catalog-dialog .purchase-catalog-copy { min-width: 0; display: grid; justify-items: start; gap: 4px; }
.purchase-catalog-dialog .purchase-catalog-copy strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--pop-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.purchase-catalog-dialog .purchase-catalog-copy small,
.purchase-catalog-dialog .purchase-catalog-values small {
  color: var(--pop-muted);
  font-size: 12px;
  line-height: 1.3;
}
.purchase-catalog-dialog .purchase-catalog-copy small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.purchase-catalog-dialog .purchase-catalog-stock {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--pop-accent-soft);
  color: var(--pop-accent);
  font-size: 11px;
  font-weight: 600;
}
.purchase-catalog-dialog .purchase-catalog-stock.is-empty { background: var(--pop-danger-bg); color: var(--pop-danger); }
.purchase-catalog-dialog .purchase-catalog-values { display: grid; justify-items: end; gap: 4px; white-space: nowrap; }
.purchase-catalog-dialog .purchase-catalog-values b { color: var(--pop-ink); font-size: 15px; font-weight: 600; }
@media (max-width: 520px) {
  .purchase-catalog-dialog .purchase-catalog-card { grid-template-columns: 48px minmax(0, 1fr); gap: 10px 12px; }
  .purchase-catalog-dialog .purchase-catalog-photo { width: 48px; height: 48px; }
  .purchase-catalog-dialog .purchase-catalog-values { grid-column: 2; justify-items: start; }
}

/* As opções da conta de WhatsApp precisam de espaço de leitura e controles
   próprios; o modal de filtros compacto não é adequado para seis ajustes. */
.stats-modal-card.crm-profile-settings-dialog,
html[data-theme="dark"] .stats-modal-card.crm-profile-settings-dialog {
  width: min(540px, 100%);
  max-height: min(730px, calc(100dvh - 48px));
  padding: 0;
  overflow: hidden;
  border: 1px solid #3a404b;
  border-radius: 22px;
  background: #1b1f26;
  color: #f5f7fa;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.46);
}
.crm-profile-settings-dialog .stats-modal-head {
  flex: 0 0 auto;
  margin: 0;
  padding: 20px 24px 18px;
  border-bottom: 1px solid #343a44;
}
.crm-profile-settings-dialog .stats-modal-head h3,
html[data-theme="dark"] .crm-profile-settings-dialog .stats-modal-head h3 {
  color: #f5f7fa;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.crm-profile-settings-dialog .stats-modal-close,
html[data-theme="dark"] .crm-profile-settings-dialog .stats-modal-close {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid #3b424e;
  background: #252a33;
  color: #b8bec9;
}
.crm-profile-settings-dialog .stats-modal-close:hover { background: #303745; color: #fff; }
.crm-profile-settings-dialog .stats-modal-close:focus-visible { outline: 2px solid #74b7ff; outline-offset: 2px; }
.crm-profile-settings-dialog .stats-modal-body {
  min-height: 0;
  padding: 0 24px 20px;
  overflow-y: auto;
  scrollbar-color: #4b5360 transparent;
}
.crm-profile-settings-copy { padding: 20px 0 17px; }
.crm-profile-settings-copy strong {
  display: block;
  color: #f5f7fa;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.3;
}
.crm-profile-settings-copy p {
  margin: 5px 0 0;
  color: #b4bbc6;
  font-size: 13px;
  line-height: 1.45;
}
.crm-profile-settings-form { display: grid; gap: 17px; }
.crm-profile-settings-section h4 {
  margin: 0 0 9px;
  color: #d8dde5;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}
.crm-profile-settings-list {
  overflow: hidden;
  border: 1px solid #39414c;
  border-radius: 14px;
  background: #232832;
}
.crm-profile-settings-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 62px;
  padding: 11px 16px;
  cursor: pointer;
  transition: background 160ms ease;
}
.crm-profile-settings-option + .crm-profile-settings-option { border-top: 1px solid #343b46; }
.crm-profile-settings-option:hover { background: #2a303b; }
.crm-profile-settings-option-copy { min-width: 0; }
.crm-profile-settings-option strong,
.crm-profile-settings-option small { display: block; }
.crm-profile-settings-option strong {
  color: #f0f3f7;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}
.crm-profile-settings-option small {
  margin-top: 3px;
  color: #aeb6c2;
  font-size: 12px;
  line-height: 1.35;
}
.crm-profile-settings-option input[type="checkbox"] {
  appearance: none;
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 42px;
  margin: 0;
  border: 1px solid #68717e;
  border-radius: 99px;
  background: #454c57;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}
.crm-profile-settings-option input[type="checkbox"]::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transition: transform 160ms ease;
}
.crm-profile-settings-option input[type="checkbox"]:checked {
  border-color: #5ba9f6;
  background: #348cf0;
}
.crm-profile-settings-option input[type="checkbox"]:checked::before { transform: translateX(18px); }
.crm-profile-settings-option input[type="checkbox"]:focus-visible { outline: 2px solid #99ccff; outline-offset: 3px; }
.crm-profile-settings-option input[type="checkbox"]:disabled { cursor: wait; opacity: 0.7; }
.crm-profile-settings-error {
  margin: 0;
  padding: 11px 12px;
  border: 1px solid rgba(255, 117, 117, 0.35);
  border-radius: 10px;
  background: rgba(255, 117, 117, 0.10);
  color: #ffb4b4;
  font-size: 12px;
  line-height: 1.4;
}
.crm-profile-settings-error[hidden] { display: none; }
.crm-profile-settings-dialog .stats-modal-foot {
  flex: 0 0 auto;
  margin: 0;
  padding: 15px 24px;
  gap: 10px;
  border-top: 1px solid #343a44;
  background: #1b1f26;
}
.crm-profile-settings-dialog .stats-modal-secondary,
.crm-profile-settings-dialog .stats-modal-primary {
  width: auto;
  height: 42px;
  padding: 0 18px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
}
.crm-profile-settings-dialog .stats-modal-secondary,
html[data-theme="dark"] .crm-profile-settings-dialog .stats-modal-secondary {
  border: 1px solid #424a56;
  background: #252b35;
  color: #e6eaf0;
}
.crm-profile-settings-dialog .stats-modal-secondary:hover { background: #303745; }
.crm-profile-settings-dialog .stats-modal-primary,
html[data-theme="dark"] .crm-profile-settings-dialog .stats-modal-primary {
  min-width: 182px;
  border: 1px solid #4ca0f5;
  background: #348cf0;
  color: #fff;
}
.crm-profile-settings-dialog .stats-modal-primary:hover { background: #4b9df4; }
.crm-profile-settings-dialog .stats-modal-primary:disabled { opacity: 0.55; cursor: wait; }
.crm-profile-settings-dialog .stats-modal-secondary:focus-visible,
.crm-profile-settings-dialog .stats-modal-primary:focus-visible { outline: 2px solid #99ccff; outline-offset: 2px; }
@media (max-width: 620px) {
  .stats-modal-card.crm-profile-settings-dialog,
  html[data-theme="dark"] .stats-modal-card.crm-profile-settings-dialog {
    width: min(540px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
  }
  .crm-profile-settings-dialog .stats-modal-head { padding: 17px 18px 15px; }
  .crm-profile-settings-dialog .stats-modal-body { padding: 0 18px 18px; }
  .crm-profile-settings-dialog .stats-modal-foot { padding: 13px 18px; }
  .crm-profile-settings-option { gap: 12px; padding: 10px 12px; }
  .crm-profile-settings-dialog .stats-modal-secondary,
  .crm-profile-settings-dialog .stats-modal-primary { min-width: 0; padding: 0 12px; }
  .crm-profile-settings-dialog .stats-modal-primary { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .crm-profile-settings-option,
  .crm-profile-settings-option input[type="checkbox"],
  .crm-profile-settings-option input[type="checkbox"]::before { transition: none; }
}

/* Avaliar aparelho usa a mesma estrutura de página do Crediário. As regras
   antigas do avaliador permanecem para o diálogo aberto dentro do PDV. */
.trade-in-page-overlay {
  padding: max(16px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left));
}
.trade-in-page-overlay .trade-in-evaluation-page {
  gap: 0;
  min-height: calc(100% - 52px);
  margin: 52px 0 0;
  padding: 20px 20px 24px;
  border-radius: 34px 34px 0 0;
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f7 50%, #eff8f4 100%);
  overflow: visible;
}
.trade-in-page-overlay .home-top-actions.crediario-top-actions { background: transparent; }
.trade-in-page-overlay .trade-in-page-header {
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}
.trade-in-page-overlay .trade-in-evaluation-panel {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}
.trade-in-page-overlay .trade-in-page-body {
  flex: 1 0 auto;
  display: flex;
  min-height: 0;
  margin: 0;
  padding: 0 20px 18px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.trade-in-page-overlay .trade-in-page-body > .trade-in-layout {
  flex: 1 0 auto;
  width: 100%;
  min-height: 0;
  gap: 18px;
}
.trade-in-page-overlay .trade-in-form { padding: 18px 0 0; }
.trade-in-page-overlay .trade-in-offer {
  margin-top: 18px;
  border-radius: 22px;
}
.trade-in-page-overlay .trade-in-page-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 0 20px 20px;
}
.trade-in-page-loading {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
.trade-in-page-retry {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
}
.trade-in-page-retry p {
  max-width: 540px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
html[data-theme="dark"] .trade-in-page-overlay .trade-in-evaluation-page {
  background: linear-gradient(135deg, #06070a 0%, #0e1117 50%, #07140f 100%);
}
@media (min-width: 941px) {
  .trade-in-page-overlay .trade-in-evaluation-page {
    width: 100%;
    /* O zoom reduz a página a 80%; 125dvh compensa essa escala para o
       painel branco alcançar a base da janela. */
    min-height: calc(125dvh - 72px);
    zoom: 0.8;
  }
}
@media (max-width: 940px) {
  .trade-in-page-overlay .cred-overlay-back-top { display: none; }
  .trade-in-page-overlay .trade-in-evaluation-page {
    min-height: calc(100dvh - max(16px, env(safe-area-inset-top)));
    margin-top: 0;
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .trade-in-page-overlay .trade-in-page-header {
    align-items: stretch;
    gap: 0;
    margin: 0 0 12px;
  }
  .trade-in-page-overlay .trade-in-page-header .home-title-block {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
  }
  .trade-in-page-overlay .trade-in-layout { grid-template-columns: minmax(0, 1fr); }
  .trade-in-page-overlay .trade-in-offer { min-height: 280px; margin-top: 0; }
  .trade-in-page-overlay .trade-in-page-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .trade-in-page-overlay .trade-in-page-footer .stats-modal-secondary,
  .trade-in-page-overlay .trade-in-page-footer .stats-modal-primary {
    width: 100%;
    min-width: 0;
  }
}
@media (max-width: 640px) {
  .trade-in-page-overlay { padding: 0; }
  .trade-in-page-overlay .trade-in-evaluation-page {
    min-height: 100dvh;
    margin-top: 0;
    padding: max(12px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
    border-radius: 0;
  }
  .trade-in-page-overlay .trade-in-page-header .home-badge { display: none; }
  .trade-in-page-overlay .trade-in-page-body { padding: 0 20px 20px; }
  .trade-in-page-overlay .trade-in-page-footer { padding: 0 20px 20px; }
}
@media (max-width: 560px) {
  .trade-in-page-overlay .trade-in-page-footer { grid-template-columns: minmax(0, 1fr); }
}

/* Crediário e Avaliar aparelho ocupam a tela toda no mobile. A página do
   sistema fica parada atrás; a camada continua rolando sem uma barra extra. */
@media (max-width: 940px) {
  html:has(body > .crediario-overlay),
  html:has(body > .trade-in-page-overlay),
  body:has(> .crediario-overlay),
  body:has(> .trade-in-page-overlay) {
    overflow: hidden !important;
  }

  html:has(body > .crediario-overlay) .main,
  html:has(body > .trade-in-page-overlay) .main {
    overflow-y: hidden !important;
  }

  .crediario-overlay,
  .trade-in-page-overlay {
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior-y: contain;
  }

  .crediario-overlay::-webkit-scrollbar,
  .trade-in-page-overlay::-webkit-scrollbar {
    display: none;
  }
}

/* O avaliador aberto no PDV usa os mesmos campos e o card de oferta da aba
   Avaliar aparelho, mantendo o pop-up e suas ações próprias. */
.stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog {
  border-radius: 26px;
}
.stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog > .stats-modal-head {
  min-height: 70px;
  padding: 16px 20px 12px;
  border-bottom: 0;
  background: var(--pop-surface);
}
.stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog > .stats-modal-head h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 500;
}
.stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog > .stats-modal-head h3 > .icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 12px;
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}
.stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog > .stats-modal-head h3 > .icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog > .stats-modal-body {
  padding: 0 20px 0;
}
.stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog .trade-in-layout {
  min-height: 0;
  gap: 18px;
}
.stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog .trade-in-form {
  padding: 16px 0 20px;
}
.stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog .trade-in-offer {
  min-height: 340px;
  margin: 0 0 18px;
  border-radius: 22px;
}
.stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog .trade-in-form > .notas-page-field.notas-select {
  min-height: 48px;
  margin-top: 19px;
}
.stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog .trade-in-form > .notas-page-field.notas-select > span:first-child {
  position: absolute;
  left: 0;
  bottom: calc(100% + 7px);
  color: var(--pop-ink);
  font-size: 12px;
  line-height: 1;
  font-weight: 850;
}
.stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog .trade-in-field input,
.stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog .trade-in-field select,
.stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog .trade-in-field textarea {
  min-height: 48px;
  border: 1px solid var(--pop-border-soft);
  border-radius: 14px;
  background: var(--pop-surface-alt);
  box-shadow: none;
}
.stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog .trade-in-field textarea {
  min-height: 82px;
  border-color: rgba(29, 29, 31, 0.06);
  background: #f5f5f7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70);
  overflow-y: hidden;
  resize: none;
  line-height: 1.5;
}
.stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog .trade-in-field textarea:focus {
  border-color: var(--blue);
  background: #f5f5f7;
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), .12);
}
html[data-theme="dark"] .stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog .trade-in-field textarea {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}
html[data-theme="dark"] .stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog .trade-in-field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), .16);
}
.stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog > .stats-modal-foot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 20px 20px;
  border-top: 0;
  background: var(--pop-surface);
}
.stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog > .stats-modal-foot > button {
  width: 100%;
  min-width: 0;
}
@media (max-width: 900px) {
  .stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog .trade-in-form {
    padding-bottom: 4px;
  }
}
@media (max-width: 560px) {
  .stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog > .stats-modal-body {
    padding: 0 14px;
  }
  .stats-modal-card.stats-filter-dialog.pos-dialog.trade-in-dialog > .stats-modal-foot {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px 14px 16px;
  }
}

/* Busca de produto da compra XML: o card do PDV é claro, enquanto o campo
   compartilhado usa branco por padrão. Limite o contraste a este diálogo. */
html:not([data-theme="dark"]) .stats-modal-card.pos-dialog.stats-option-dialog:has([data-purchase-catalog-results]) .stats-option-search-wrapper {
  border-bottom-color: rgba(29, 29, 31, 0.09);
}
html:not([data-theme="dark"]) .stats-modal-card.pos-dialog.stats-option-dialog:has([data-purchase-catalog-results]) .stats-option-search-card {
  border-color: rgba(29, 29, 31, 0.18);
  background: #f8f8fa;
}
html:not([data-theme="dark"]) .stats-modal-card.pos-dialog.stats-option-dialog:has([data-purchase-catalog-results]) .stats-option-search-card:focus-within {
  border-color: #0071e3;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.09);
}
html:not([data-theme="dark"]) .stats-modal-card.pos-dialog.stats-option-dialog:has([data-purchase-catalog-results]) .stats-option-search-card .icon {
  color: #6e6e73;
}
html:not([data-theme="dark"]) .stats-modal-card.pos-dialog.stats-option-dialog:has([data-purchase-catalog-results]) .stats-option-search-input {
  color: #1d1d1f;
  caret-color: #0071e3;
  color-scheme: light;
}
html:not([data-theme="dark"]) .stats-modal-card.pos-dialog.stats-option-dialog:has([data-purchase-catalog-results]) .stats-option-search-input::placeholder {
  color: #77777d;
  opacity: 1;
}
html:not([data-theme="dark"]) .stats-modal-card.pos-dialog.stats-option-dialog:has([data-purchase-catalog-results]) .stats-option-tile {
  border-color: rgba(29, 29, 31, 0.10);
  background: #f8f8fa;
  color: #1d1d1f;
}
html:not([data-theme="dark"]) .stats-modal-card.pos-dialog.stats-option-dialog:has([data-purchase-catalog-results]) .stats-option-tile:hover,
html:not([data-theme="dark"]) .stats-modal-card.pos-dialog.stats-option-dialog:has([data-purchase-catalog-results]) .stats-option-tile:focus-visible {
  background: #f0f0f3;
}
html:not([data-theme="dark"]) .stats-modal-card.pos-dialog.stats-option-dialog:has([data-purchase-catalog-results]) .stats-option-tile > span:not(.icon),
html:not([data-theme="dark"]) .stats-modal-card.pos-dialog.stats-option-dialog:has([data-purchase-catalog-results]) .stats-option-tile .os-pick-price {
  color: #1d1d1f;
}
html:not([data-theme="dark"]) .stats-modal-card.pos-dialog.stats-option-dialog:has([data-purchase-catalog-results]) .stats-option-tile small {
  color: #6e6e73;
}
.crm-profile-dialog-copy{margin:0 0 16px;color:#545963;font-size:14px;line-height:1.5}
.crm-profile-dialog-copy strong{color:#1d1d1f}
html[data-theme="dark"] .crm-profile-dialog-copy{color:#a4a7ae}
html[data-theme="dark"] .crm-profile-dialog-copy strong{color:#f5f5f7}
.crm-profile-dialog-error{margin:10px 0 0;color:#e66b6b;font-size:13px}
.crm-profile-delete-confirm{background:#b53238!important;color:#fff!important}
.crm-profile-actions-list .stats-option-tile.danger,.crm-profile-actions-list .stats-option-tile.danger .icon{color:#df666b}

/* =====================================================================
   RDX Relaciona (relaciona_v1.js) — painel de relacionamento na aba
   Clientes, diálogos da jornada/campanha/regras e o aviso de envio.
   Página: tokens da página (--card, --ink, --muted…). Diálogos: tokens
   --pop-* do tema novo. Cores de grupo via .tone-* (--tone/--tone-soft).
   ===================================================================== */

.rel-host[hidden],
.clients-database[hidden],
.clients-page .clients-hero[hidden],
.clients-page .clients-panel[hidden] {
  display: none !important;
}

/* Clientes no desenho de Produtos: hero, sub-abas embaixo dele e o conteúdo
   direto na página (sem o painel branco em volta da busca e dos botões). */
.clients-page .clients-subtabs .stats-tab {
  border-color: rgba(0, 113, 227, 0.14);
  background: rgba(255, 255, 255, 0.94);
  color: #4175a8;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.clients-page .clients-subtabs .stats-tab > span {
  border-color: rgba(0, 113, 227, 0.12);
  background: #ffffff;
  color: #0071e3;
}

.clients-page .clients-subtabs .stats-tab.active {
  border-color: rgba(0, 113, 227, 0.34);
  background: rgba(0, 113, 227, 0.09);
  color: #0071e3;
  box-shadow: 0 8px 18px rgba(0, 113, 227, 0.10);
}

.clients-page .clients-subtabs .stats-tab.active > span {
  border-color: rgba(0, 113, 227, 0.18);
  background: rgba(0, 113, 227, 0.10);
  color: #0071e3;
}

.clients-page .clients-subtabs .stats-tab:hover {
  border-color: rgba(0, 113, 227, 0.26);
  background: #ffffff;
}

.clients-page .clients-subtabs .stats-tab:focus-visible {
  outline: 2px solid rgba(0, 113, 227, 0.42);
  outline-offset: 2px;
}

html[data-theme="dark"] .clients-page .clients-subtabs .stats-tab {
  border-color: rgba(94, 168, 255, 0.20);
  background: #181b22;
  color: #a4a7ae;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .clients-page .clients-subtabs .stats-tab > span {
  border-color: rgba(94, 168, 255, 0.18);
  background: #0e1015;
  color: #5ea8ff;
}

html[data-theme="dark"] .clients-page .clients-subtabs .stats-tab.active {
  border-color: rgba(94, 168, 255, 0.42);
  background: rgba(94, 168, 255, 0.13);
  color: #5ea8ff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .clients-page .clients-subtabs .stats-tab.active > span {
  border-color: rgba(94, 168, 255, 0.26);
  background: rgba(94, 168, 255, 0.12);
  color: #5ea8ff;
}

html[data-theme="dark"] .clients-page .clients-subtabs .stats-tab:hover {
  border-color: rgba(94, 168, 255, 0.38);
  background: #24272e;
}

.clients-page .clients-panel,
html[data-theme="dark"] .clients-page .clients-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.rel-host {
  display: block;
}

.clients-database { color: var(--ink); }
.client-db-toolbar, .client-db-controls, .client-db-row, .client-db-actions, .client-db-person { display: flex; align-items: center; }
.client-db-toolbar { justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.client-db-toolbar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.client-db-toolbar h2 { margin: 0 0 4px; font-size: 22px; }
.client-db-toolbar p, .client-db-form p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.client-db-controls { flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.client-db-controls .prod-search { flex: 1 1 280px; min-width: 220px; }
.client-db-controls [data-leads-count] { margin-left: auto; color: var(--muted); font-size: 12px; }
.client-db-filter, .client-db-actions button { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 11px; min-height: 36px; padding: 0 12px; font: inherit; font-size: 12px; cursor: pointer; }
.client-db-filter.active { border-color: #0071e3; color: #0071e3; background: rgba(0,113,227,.10); }
.client-db-list { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--card); }
.client-db-row { gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.client-db-row:last-child { border-bottom: 0; }
.client-db-person { flex: 1 1 280px; min-width: 0; gap: 10px; }
.client-db-person > .icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 11px; background: rgba(0,113,227,.1); color: #0071e3; }
.client-db-person strong, .client-db-person small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-db-person strong { font-size: 13px; }
.client-db-person small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.client-db-consent { color: var(--muted); font-size: 12px; }
.client-db-consent.is-ok { color: #13a065; }
.client-db-actions { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.client-db-actions button { display: inline-flex; align-items: center; gap: 5px; }
.client-db-actions button .icon svg { width: 15px; height: 15px; }
.client-db-actions button:disabled { opacity: .4; cursor: not-allowed; }
.client-db-form { display: grid; gap: 14px; }
.client-db-optin { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; cursor: pointer; }
.client-db-optin input { width: 17px; height: 17px; margin-top: 1px; accent-color: #0071e3; }
@media (max-width: 780px) { .client-db-toolbar, .client-db-row { align-items: stretch; flex-direction: column; } .client-db-actions { justify-content: flex-start; } .client-db-controls [data-leads-count] { width: 100%; } }

.rel-root,
.rel-dialog,
.rel-runner {
  --rel-green: #13a065;
  --rel-green-soft: rgba(19, 160, 101, 0.11);
  --rel-amber: #c26f00;
  --rel-amber-soft: rgba(255, 159, 10, 0.14);
  --rel-red: #d70015;
  --rel-red-soft: rgba(255, 59, 48, 0.10);
  --rel-blue: #0071e3;
  --rel-blue-soft: rgba(0, 113, 227, 0.09);
  --rel-violet: #7a3fe0;
  --rel-violet-soft: rgba(122, 63, 224, 0.10);
  --rel-gold: #a26700;
  --rel-gold-soft: rgba(214, 158, 0, 0.15);
  --rel-teal: #08858a;
  --rel-teal-soft: rgba(8, 133, 138, 0.10);
  --rel-pink: #d6336c;
  --rel-pink-soft: rgba(214, 51, 108, 0.10);
  --rel-slate: #6e6e73;
  --rel-slate-soft: rgba(110, 110, 115, 0.11);
}

html[data-theme="dark"] :is(.rel-root, .rel-dialog, .rel-runner) {
  --rel-green: #4fe39a;
  --rel-green-soft: rgba(79, 227, 154, 0.14);
  --rel-amber: #ffbe55;
  --rel-amber-soft: rgba(255, 190, 85, 0.15);
  --rel-red: #ff6c6c;
  --rel-red-soft: rgba(255, 108, 108, 0.14);
  --rel-blue: #5ea8ff;
  --rel-blue-soft: rgba(94, 168, 255, 0.15);
  --rel-violet: #b38cff;
  --rel-violet-soft: rgba(179, 140, 255, 0.15);
  --rel-gold: #f3c35a;
  --rel-gold-soft: rgba(243, 195, 90, 0.15);
  --rel-teal: #4fd8d8;
  --rel-teal-soft: rgba(79, 216, 216, 0.13);
  --rel-pink: #ff7aa8;
  --rel-pink-soft: rgba(255, 122, 168, 0.14);
  --rel-slate: #a4a7ae;
  --rel-slate-soft: rgba(255, 255, 255, 0.09);
}

:is(.rel-root, .rel-dialog) .tone-green { --tone: var(--rel-green); --tone-soft: var(--rel-green-soft); }
:is(.rel-root, .rel-dialog) .tone-amber { --tone: var(--rel-amber); --tone-soft: var(--rel-amber-soft); }
:is(.rel-root, .rel-dialog) .tone-red { --tone: var(--rel-red); --tone-soft: var(--rel-red-soft); }
:is(.rel-root, .rel-dialog) .tone-blue { --tone: var(--rel-blue); --tone-soft: var(--rel-blue-soft); }
:is(.rel-root, .rel-dialog) .tone-violet { --tone: var(--rel-violet); --tone-soft: var(--rel-violet-soft); }
:is(.rel-root, .rel-dialog) .tone-gold { --tone: var(--rel-gold); --tone-soft: var(--rel-gold-soft); }
:is(.rel-root, .rel-dialog) .tone-teal { --tone: var(--rel-teal); --tone-soft: var(--rel-teal-soft); }
:is(.rel-root, .rel-dialog) .tone-pink { --tone: var(--rel-pink); --tone-soft: var(--rel-pink-soft); }
:is(.rel-root, .rel-dialog) :is(.tone-slate, .tone-muted) { --tone: var(--rel-slate); --tone-soft: var(--rel-slate-soft); }

:is(.rel-root, .rel-dialog, .rel-runner) .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

:is(.rel-root, .rel-dialog, .rel-runner) .icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ---------- estrutura ---------- */

.rel-root {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  color: var(--ink);
}

.rel-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.rel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.rel-views {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: 16px;
  background: var(--field);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.rel-view-btn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.rel-view-btn.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.rel-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rel-updated {
  font-size: 12px;
  color: var(--muted);
}

.rel-tool-btn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.rel-tool-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.rel-btn {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-soft);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease;
}

.rel-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.rel-btn.primary {
  border-color: transparent;
  background: #1d1d1f;
  color: #ffffff;
}

html[data-theme="dark"] .rel-btn.primary {
  background: #f5f5f7;
  color: #111318;
}

.rel-btn:disabled {
  opacity: 0.42;
  cursor: default;
}

.rel-section-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 6px 2px 0;
}

.rel-section-head.row {
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.rel-section-head h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.rel-section-head p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.rel-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 44px 20px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--card);
  color: var(--muted);
  text-align: center;
}

.rel-state > .icon svg {
  width: 28px;
  height: 28px;
}

.rel-state strong {
  color: var(--ink);
  font-size: 16px;
}

.rel-state p {
  max-width: 480px;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
}

.rel-state.small {
  padding: 28px 16px;
  border: 0;
  background: transparent;
}

.rel-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.rel-note .icon {
  margin-top: 1px;
}

.rel-foot-note {
  margin: 0;
  font-size: 12px;
  text-align: center;
  color: var(--muted);
}

/* ---------- visão geral ---------- */

/* Cartão claro: o único cartão escuro da página é o hero de Clientes. */
.rel-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  align-items: center;
  gap: 20px;
  padding: 24px;
  border: 1px solid rgba(0, 113, 227, 0.12);
  border-radius: 26px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.055);
}

html[data-theme="dark"] .rel-hero-card {
  border-color: rgba(94, 168, 255, 0.18);
  background: #111318;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.rel-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--rel-blue);
}

.rel-hero-count {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 10px 0 8px;
}

.rel-hero-count strong {
  font-size: 56px;
  line-height: 1;
  font-weight: 760;
  letter-spacing: -0.035em;
}

.rel-hero-count span {
  font-size: 18px;
  font-weight: 620;
  color: var(--ink);
}

.rel-hero-main p {
  max-width: 540px;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.rel-ident {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  --ring-track: var(--field);
  --ring-hole: var(--card);
}

.rel-ident.is-compact {
  border-color: var(--line);
  background: var(--card-soft);
  --ring-hole: var(--card-soft);
}

html[data-theme="dark"] .rel-ident.is-compact {
  border-color: rgba(255, 255, 255, 0.10);
  background: #181b22;
  --ring-hole: #181b22;
}

.rel-ident > .icon {
  opacity: 0.55;
}

.rel-ring {
  --p: 0;
  width: 64px;
  height: 64px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--tone) calc(var(--p) * 1%), var(--ring-track) 0);
}

.rel-ring b {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ring-hole);
  font-size: 14px;
  font-weight: 750;
}

.rel-ident-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rel-ident-copy strong {
  font-size: 14.5px;
}

.rel-ident-copy small {
  font-size: 12.5px;
  opacity: 0.72;
}

.rel-ident-copy em {
  margin-top: 2px;
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
  line-height: 1.35;
  color: var(--tone);
}

.rel-opps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 12px;
}

.rel-opp {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 190px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.04);
}

.rel-opp.is-empty {
  opacity: 0.55;
  box-shadow: none;
}

.rel-opp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rel-opp-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--tone-soft);
  color: var(--tone);
}

.rel-opp-icon .icon svg {
  width: 19px;
  height: 19px;
}

.rel-opp-count {
  font-size: 30px;
  font-weight: 760;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.rel-opp h4 {
  margin: 4px 0 0;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.rel-opp p {
  flex: 1;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--muted);
}

.rel-opp-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.rel-opp-actions .rel-btn {
  flex: 1;
  padding: 0 10px;
}

.rel-health {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--card);
}

.rel-dist {
  display: flex;
  gap: 2px;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--field);
}

.rel-dist-seg {
  min-width: 0;
  background: var(--tone);
}

.rel-dist-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.rel-legend {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.rel-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tone);
}

.rel-legend b {
  font-weight: 750;
}

.rel-legend small {
  color: var(--muted);
}

.rel-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
  gap: 10px;
}

.rel-kpi {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: var(--card-soft);
  color: var(--ink);
  font: inherit;
  text-align: left;
}

button.rel-kpi {
  cursor: pointer;
  transition: border-color 160ms ease, transform 140ms ease;
}

button.rel-kpi:hover {
  border-color: var(--line);
}

.rel-kpi > span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.rel-kpi > strong {
  font-size: 22px;
  font-weight: 760;
  letter-spacing: -0.01em;
}

.rel-kpi > small {
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--muted);
}

.rel-of {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

html[data-theme="dark"] .rel-opp,
html[data-theme="dark"] .rel-health,
html[data-theme="dark"] .rel-camp,
html[data-theme="dark"] .rel-state:not(.small),
html[data-theme="dark"] .rel-camp-kpis .rel-kpi,
html[data-theme="dark"] .rel-ident:not(.is-compact) {
  border-color: rgba(255, 255, 255, 0.12);
  background: #111318;
}

html[data-theme="dark"] .rel-kpi,
html[data-theme="dark"] .rel-camp-stats span {
  background: #181b22;
}

/* ---------- clientes ---------- */

.rel-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rel-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.rel-chip-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.rel-chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.rel-chip-group-label {
  margin-right: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.rel-chip {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 620;
  white-space: nowrap;
  cursor: pointer;
}

.rel-chip.active {
  border-color: transparent;
  background: #1d1d1f;
  color: #ffffff;
}

html[data-theme="dark"] .rel-root .rel-chip.active {
  background: #f5f5f7;
  color: #111318;
}

.rel-chip-count {
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--field);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.rel-chip.active .rel-chip-count {
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
}

html[data-theme="dark"] .rel-root .rel-chip.active .rel-chip-count {
  background: rgba(0, 0, 0, 0.12);
}

/* Filtros da aba Campanha: o próprio .client-filter-chip do Cadastro, só com
   o contador dentro. */
.rel-filter-chip {
  gap: 7px;
}

.rel-filter-chip .rel-chip-count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.08);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: #4175a8;
}

.rel-filter-chip.active .rel-chip-count {
  background: rgba(0, 113, 227, 0.14);
  color: #0071e3;
}

html[data-theme="dark"] .rel-filter-chip .rel-chip-count {
  background: rgba(94, 168, 255, 0.12);
  color: #8fc2ff;
}

html[data-theme="dark"] .rel-filter-chip.active .rel-chip-count {
  background: rgba(94, 168, 255, 0.20);
  color: #5ea8ff;
}

.rel-active-filter {
  align-self: flex-start;
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 5px 0 12px;
  border-radius: 999px;
  background: var(--rel-blue-soft);
  color: var(--rel-blue);
  font-size: 13px;
  font-weight: 650;
}

.rel-active-filter button {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.rel-list-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.rel-search {
  flex: 1 1 260px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--field);
  color: var(--muted);
}

.rel-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

/* Botão "Ordenar": abre o seletor de opções do sistema (openOptionPickerDialog). */
.rel-sort-btn {
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 12px;
  border: 0;
  border-radius: 12px;
  background: var(--field);
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.rel-sort-btn b {
  font-size: 13.5px;
  font-weight: 620;
  color: var(--ink);
}

.rel-sort-btn .icon svg {
  width: 16px;
  height: 16px;
  transform: rotate(90deg);
}

.rel-sort-btn:focus-visible {
  outline: 2px solid rgba(0, 113, 227, 0.42);
  outline-offset: 2px;
}

/* Opção atual no seletor do sistema (marcada pelo pickOption do app). */
.rdx-project-popover .stats-option-tile.is-current,
.stats-option-dialog .stats-option-tile.is-current {
  justify-content: space-between;
}

.rdx-project-popover .stats-option-tile.is-current > span:not(.icon),
.stats-option-dialog .stats-option-tile.is-current > span:not(.icon) {
  font-weight: 600;
}

.stats-option-tile.is-current > .icon,
html:not([data-theme="dark"]) .rdx-project-popover .stats-option-tile.is-current > .icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: #0071e3;
}

.stats-option-tile.is-current > .icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

html[data-theme="dark"] .stats-option-tile.is-current > .icon,
html[data-theme="dark"] .rdx-project-popover .stats-option-tile.is-current > .icon {
  color: #5ea8ff;
}

.rel-list {
  display: flex;
  flex-direction: column;
}

.rel-list-head,
.rel-row {
  display: grid;
  grid-template-columns: minmax(220px, 2.2fr) minmax(170px, 1.6fr) minmax(90px, 1fr) minmax(60px, 0.55fr) minmax(100px, 1fr);
  align-items: center;
  gap: 12px;
}

.rel-list-head {
  padding: 12px 14px;
  border: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: 18px 18px 0 0;
  background: rgba(0, 113, 227, 0.055);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #315f8e;
}

.rel-list-rows {
  overflow: hidden;
  border: 1px solid rgba(0, 113, 227, 0.12);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.055);
}

.rel-list-rows .rel-row:last-child {
  border-bottom: 0;
}

html[data-theme="dark"] .rel-list-head {
  border-color: rgba(94, 168, 255, 0.20);
  background: #0e1015;
  color: #8fc2ff;
}

html[data-theme="dark"] .rel-list-rows {
  border-color: rgba(94, 168, 255, 0.18);
  background: #181b22;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.rel-row {
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease;
}

.rel-row:hover {
  background: var(--card-soft);
}

.rel-row-person {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.rel-avatar {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--tone-soft);
  color: var(--tone);
  font-size: 12.5px;
  font-weight: 760;
}

.rel-avatar.lg {
  width: 52px;
  height: 52px;
  border-radius: 17px;
  font-size: 17px;
}

.rel-row-name {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.rel-row-name strong,
.rel-row-name small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rel-row-name strong {
  font-size: 14px;
  font-weight: 650;
}

.rel-row-name small {
  font-size: 12px;
  color: var(--muted);
}

.rel-row-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.rel-badge {
  height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--tone-soft);
  color: var(--tone);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.rel-row-cell {
  font-size: 13.5px;
}

.rel-row-cell.strong {
  font-weight: 700;
}

.rel-list-count {
  margin: 10px 0 0;
  font-size: 12px;
  text-align: center;
  color: var(--muted);
}

/* ---------- campanhas ---------- */

.rel-camp-kpis .rel-kpi {
  border-color: var(--line);
  background: var(--card);
}

.rel-camps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.rel-camp {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
}

.rel-camp header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.rel-camp header strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
}

.rel-camp header small {
  font-size: 12px;
  color: var(--muted);
}

.rel-camp-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rel-camp-stats span {
  min-width: 84px;
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--card-soft);
  font-size: 11.5px;
  color: var(--muted);
}

.rel-camp-stats b {
  font-size: 15px;
  font-weight: 750;
  color: var(--ink);
}

.rel-camp-stats .bad b {
  color: var(--rel-red);
}

.rel-camp footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- aviso flutuante do envio ---------- */

.rel-runner {
  position: fixed;
  right: 20px;
  bottom: calc(20px + var(--safe-bottom, 0px));
  z-index: 900;
  width: min(390px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  border-radius: 20px;
  background: #1d1d1f;
  color: #ffffff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  font-size: 13px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.rel-runner[data-positioned="true"] {
  right: auto;
  bottom: auto;
  width: min(var(--runner-drag-width, 390px), calc(100vw - 16px));
}

.rel-runner[data-dragging="true"] {
  cursor: grabbing;
}

html[data-theme="dark"] .rel-runner {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #1b1e25;
}

.rel-runner-icon {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(37, 211, 102, 0.18);
  color: #25d366;
}

.rel-runner[data-state="paused"] .rel-runner-icon {
  background: rgba(255, 190, 85, 0.18);
  color: #ffbe55;
}

.rel-runner-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rel-runner-copy strong {
  overflow: hidden;
  font-size: 13.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rel-runner-copy small {
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.72);
}

.rel-runner-bar {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.rel-runner-bar i {
  display: block;
  height: 100%;
  background: #25d366;
  transition: width 400ms ease;
}

.rel-runner-actions {
  display: flex;
  gap: 6px;
}

.rel-runner-actions button {
  height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: #ffffff;
  color: #1d1d1f;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.rel-runner-actions button.ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* ---------- diálogos (tema novo: tokens --pop-*) ---------- */

.stats-modal-card.pos-dialog.rel-dialog {
  width: min(640px, calc(100vw - 24px));
  max-width: none;
}

.stats-modal-card.pos-dialog.rel-journey-dialog,
.stats-modal-card.pos-dialog.rel-campaign-dialog,
.stats-modal-card.pos-dialog.rel-settings-dialog {
  width: min(700px, calc(100vw - 24px));
}

.stats-modal-card.pos-dialog.rel-audience-dialog,
.stats-modal-card.pos-dialog.rel-detail-dialog {
  width: min(580px, calc(100vw - 24px));
}

/* Largo e sem rolagem: tabela e gráfico lado a lado cabem em ~500px de altura. */
.stats-modal-card.pos-dialog.rel-ident-dialog {
  width: min(980px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
}

.rel-dialog .stats-modal-foot {
  flex-wrap: wrap;
}

.rel-dialog .stats-modal-foot > button {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  white-space: nowrap;
}

.rel-dialog :is(strong, b) {
  font-weight: 700;
}

/* Até 940px o app estica o rodapé dos pop-ups; os botões acompanham. */
@media (max-width: 940px) {
  .rel-dialog .stats-modal-foot > button {
    flex: 1 1 auto;
    justify-content: center;
  }
}

.rel-dialog-lead {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--pop-muted);
}

.rel-dialog-sub {
  margin: 18px 0 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pop-muted);
}

.rel-dialog-empty {
  margin: 0;
  font-size: 13px;
  color: var(--pop-muted);
}

.rel-dialog .rel-chip {
  border-color: var(--pop-border);
  color: var(--pop-ink);
}

.rel-dialog .rel-chip.active {
  border-color: transparent;
  background: var(--pop-primary-bg);
  color: var(--pop-primary-ink);
}

.rel-dialog .rel-btn {
  border-color: var(--pop-border);
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
}

.rel-dialog .rel-btn.ai {
  margin-left: auto;
  color: var(--rel-violet);
}

.rel-dialog .rel-btn.ai .icon svg {
  fill: currentColor;
}

.rel-table {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--pop-border);
  border-radius: 14px;
}

.rel-table-head,
.rel-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 0.6fr 1fr 1fr;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--pop-ink);
}

.rel-table-head {
  background: var(--pop-surface-alt);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pop-muted);
}

.rel-table-row + .rel-table-row {
  border-top: 1px solid var(--pop-border-soft);
}

.rel-table-row span:first-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rel-mini-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--pop-hover);
}

.rel-mini-bar i {
  display: block;
  height: 100%;
  background: var(--pop-accent);
}

.rel-id-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.rel-id-block .rel-dialog-sub {
  margin-top: 4px;
}

/* Gráfico mês a mês: uma série, colunas finas a partir do zero, ponta
   arredondada só em cima, grade de 1px e detalhe no hover/foco. */
.rel-mchart {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-rows: 206px auto;
  column-gap: 8px;
  row-gap: 8px;
  padding: 14px 14px 12px 8px;
  border: 1px solid var(--pop-border);
  border-radius: 14px;
}

.rel-mchart-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  margin: -7px 0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--pop-muted);
}

.rel-mchart-plot {
  position: relative;
  display: flex;
  align-items: stretch;
  height: 206px;
}

.rel-mchart-grid {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.rel-mchart-grid i {
  display: block;
  height: 1px;
  background: var(--pop-border-soft);
}

.rel-mchart-grid i:last-child {
  background: var(--pop-border);
}

.rel-mcol {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  outline: none;
  cursor: default;
}

.rel-mcol-top {
  position: relative;
  display: flex;
  justify-content: center;
}

.rel-mcol-value {
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--pop-muted);
}

.rel-mcol.is-current .rel-mcol-value {
  color: var(--pop-ink);
}

.rel-mcol-bar {
  width: 24px;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  background: rgba(0, 113, 227, 0.34);
  transition: background 140ms ease;
}

.rel-mcol.is-current .rel-mcol-bar,
.rel-mcol:hover .rel-mcol-bar,
.rel-mcol:focus-visible .rel-mcol-bar {
  background: var(--pop-accent);
}

html[data-theme="dark"] .rel-mcol-bar {
  background: rgba(94, 168, 255, 0.36);
}

.rel-mcol-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  z-index: 2;
  width: max-content;
  max-width: 190px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--pop-primary-bg);
  color: var(--pop-primary-ink);
  box-shadow: var(--pop-shadow);
  font-size: 12px;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  /* --tip-shift empurra o balão para dentro do gráfico perto das bordas
     (calculado pelo relaciona_v1.js). Vai na margem, fora da transição, para
     o balão já nascer no lugar certo. */
  margin-left: var(--tip-shift, 0px);
  transform: translate(-50%, 4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.rel-mcol-tip strong {
  font-size: 12px;
  color: inherit;
}

.rel-mcol:hover .rel-mcol-tip,
.rel-mcol:focus-visible .rel-mcol-tip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.rel-mchart-x {
  grid-column: 2;
  display: flex;
}

.rel-mchart-x span {
  flex: 1 1 0;
  min-width: 0;
  font-size: 11.5px;
  text-align: center;
  white-space: nowrap;
  color: var(--pop-muted);
}

.rel-mchart-x span.is-current {
  font-weight: 700;
  color: var(--pop-ink);
}

.rel-j-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.rel-j-head strong {
  display: block;
  font-size: 18px;
  color: var(--pop-ink);
}

.rel-j-head small {
  font-size: 12.5px;
  color: var(--pop-muted);
}

.rel-j-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.rel-j-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.rel-j-tile {
  padding: 11px 12px;
  border: 1px solid var(--pop-border-soft);
  border-radius: 14px;
  background: var(--pop-surface-alt);
}

.rel-j-tile span {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--pop-muted);
}

.rel-j-tile strong {
  font-size: 16px;
  color: var(--pop-ink);
}

.rel-j-facts {
  display: flex;
  flex-direction: column;
  margin: 14px 0 0;
  overflow: hidden;
  border: 1px solid var(--pop-border-soft);
  border-radius: 14px;
}

.rel-j-fact {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
}

.rel-j-fact + .rel-j-fact {
  border-top: 1px solid var(--pop-border-soft);
}

.rel-j-fact dt {
  font-weight: 600;
  color: var(--pop-muted);
}

.rel-j-fact dd {
  margin: 0;
  color: var(--pop-ink);
}

.rel-next {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--tone);
}

.rel-timeline {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rel-t-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 8px 0;
}

.rel-t-item::before {
  content: '';
  position: absolute;
  top: 42px;
  bottom: -8px;
  left: 15px;
  width: 2px;
  background: var(--pop-border-soft);
}

.rel-t-item:last-child::before {
  display: none;
}

.rel-t-dot {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--pop-border-soft);
  border-radius: 11px;
  background: var(--pop-surface-alt);
  color: var(--pop-muted);
}

.rel-t-item.is-send .rel-t-dot {
  color: #1faa59;
}

.rel-t-item.is-returned .rel-t-dot {
  color: var(--pop-success);
}

.rel-t-item strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--pop-ink);
}

.rel-t-item strong em {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(19, 160, 101, 0.12);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  color: var(--pop-success);
}

.rel-t-item small {
  font-size: 12px;
  color: var(--pop-muted);
}

.rel-t-item p {
  margin: 3px 0 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--pop-ink);
}

.rel-t-empty {
  padding: 8px 0;
  font-size: 13px;
  color: var(--pop-muted);
}

.rel-c-strategies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Estratégias da campanha: o mesmo botão dos filtros (client-filter-chip). */
.rel-c-strategies .client-filter-chip {
  height: 34px;
  padding: 0 13px;
}

/* Seletor "Enviar por qual CRM?" (dois ou mais CRMs visíveis na loja). */
.stats-modal-card.pos-dialog.rel-crm-dialog {
  width: min(480px, calc(100vw - 24px));
}

.rel-crm-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rel-crm-opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--pop-border);
  border-radius: 14px;
  background: var(--pop-surface);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.rel-crm-opt:hover {
  background: var(--pop-hover);
}

.rel-crm-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rel-crm-opt:has(input:checked) {
  border-color: rgba(0, 113, 227, 0.45);
  background: var(--pop-accent-soft);
}

html[data-theme="dark"] .rel-crm-opt:has(input:checked) {
  border-color: rgba(94, 168, 255, 0.50);
}

.rel-crm-opt:has(input:focus-visible) {
  outline: 2px solid rgba(0, 113, 227, 0.42);
  outline-offset: 2px;
}

.rel-crm-avatar {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.14);
  color: #1faa59;
}

.rel-crm-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rel-crm-avatar .icon svg {
  width: 20px;
  height: 20px;
}

.rel-crm-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rel-crm-copy strong {
  overflow: hidden;
  font-size: 14px;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--pop-ink);
}

.rel-crm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.rel-crm-check {
  width: 22px;
  height: 22px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--pop-border);
  border-radius: 50%;
  color: transparent;
}

.rel-crm-check .icon svg {
  width: 14px;
  height: 14px;
}

.rel-crm-opt:has(input:checked) .rel-crm-check {
  border-color: var(--pop-accent);
  background: var(--pop-accent);
  color: #ffffff;
}

html[data-theme="dark"] .rel-crm-opt:has(input:checked) .rel-crm-check {
  color: #111318;
}

.rel-c-hint {
  margin: 8px 0 12px;
  font-size: 12.5px;
  color: var(--pop-muted);
}

.rel-c-field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--pop-muted);
}

.rel-c-field textarea {
  width: 100%;
  min-height: 72px;
  box-sizing: border-box;
  padding: 12px;
  overflow: hidden;
  resize: none;
  border: 1px solid var(--pop-border);
  border-radius: 14px;
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
}

.rel-referral-config {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--pop-border);
  border-radius: 14px;
  background: var(--pop-surface-alt);
}

.rel-referral-config[hidden] {
  display: none !important;
}

.rel-referral-config > .rel-c-hint {
  grid-column: 1 / -1;
  margin: 0;
}

.rel-referral-config .rel-c-field input {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid var(--pop-border);
  border-radius: 10px;
  background: var(--pop-surface);
  color: var(--pop-ink);
  font: inherit;
  font-size: 13px;
}

.rel-referral-details {
  margin-top: 12px;
  color: var(--pop-ink);
}

.rel-referral-details summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.rel-referral-details .rel-camp-stats {
  margin-top: 10px;
}

@media (max-width: 600px) {
  .rel-referral-config { grid-template-columns: 1fr; }
}

.rel-c-tokens {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--pop-muted);
}

.rel-token {
  height: 28px;
  padding: 0 9px;
  border: 1px dashed var(--pop-border);
  border-radius: 9px;
  background: transparent;
  color: var(--pop-accent);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* Imagem da campanha (opcional): vai com a mensagem como legenda. */
.rel-c-media {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 12px;
}

.rel-c-media > small {
  font-size: 12px;
  color: var(--pop-muted);
}

.rel-c-media-busy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--pop-muted);
}

.rel-c-media-busy .spinner {
  width: 16px;
  height: 16px;
}

.rel-c-media-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--pop-border);
  border-radius: 14px;
  background: var(--pop-surface-alt);
}

.rel-c-media-card img {
  width: 52px;
  height: 52px;
  flex: none;
  object-fit: cover;
  border-radius: 10px;
}

.rel-c-media-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rel-c-media-copy strong {
  overflow: hidden;
  font-size: 13.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--pop-ink);
}

.rel-c-media-copy small {
  font-size: 12px;
  color: var(--pop-muted);
}

.rel-link.danger {
  color: var(--pop-danger);
}

.rel-bubble-img {
  display: block;
  width: 100%;
  max-width: 320px;
  max-height: 320px;
  margin: 0 0 8px;
  object-fit: cover;
  border-radius: 8px;
}

.rel-bubble-img[hidden] {
  display: none;
}

/* Balão com imagem, como no WhatsApp: largura da foto (até 340px), a imagem
   inteira no balão, sem corte lateral, e a legenda embaixo na mesma largura. */
.rel-bubble.has-media {
  width: min(340px, 100%);
  max-width: 100%;
  padding: 3px 3px 7px;
}

.rel-bubble.has-media .rel-bubble-img {
  width: 100%;
  max-width: none;
  height: auto;
  max-height: 520px;
  margin: 0 0 7px;
  object-fit: cover;
  border-radius: 9px 9px 4px 4px;
}

.rel-bubble.has-media > span {
  display: block;
  padding: 0 8px;
}

.rel-camp-thumb {
  width: 44px;
  height: 44px;
  flex: none;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.rel-camp header .rel-camp-title {
  flex: 1;
  min-width: 0;
}

.rel-c-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 14px 14px;
  border-radius: 16px;
  background: #efeae2;
}

html[data-theme="dark"] .rel-c-preview {
  background: #0b141a;
}

.rel-c-preview-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #667781;
}

.rel-bubble {
  align-self: flex-end;
  max-width: 92%;
  padding: 9px 12px;
  border-radius: 12px 12px 4px 12px;
  background: #d9fdd3;
  color: #111b21;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

html[data-theme="dark"] .rel-bubble {
  background: #005c4b;
  color: #e9edef;
}

.rel-c-recipients,
.rel-detail-list {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--pop-border);
  border-radius: 16px;
}

.rel-c-rhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--pop-surface-alt);
  font-size: 13px;
  color: var(--pop-ink);
}

.rel-c-rhead > span {
  font-size: 12.5px;
  color: var(--pop-muted);
}

.rel-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--pop-accent);
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
}

.rel-c-rlist {
  max-height: 240px;
  overflow: auto;
}

.rel-detail-list.rel-c-rlist {
  max-height: 320px;
}

.rel-c-rcpt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-top: 1px solid var(--pop-border-soft);
  cursor: pointer;
}

.rel-detail-list .rel-c-rcpt:first-child {
  border-top: 0;
}

.rel-c-rcpt input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--pop-accent);
}

.rel-c-rcpt.is-disabled {
  opacity: 0.55;
  cursor: default;
}

.rel-c-rname {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.rel-c-rname strong {
  overflow: hidden;
  font-size: 13.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--pop-ink);
}

.rel-c-rname small {
  font-size: 12px;
  color: var(--pop-muted);
}

.rel-c-rcpt em {
  font-size: 11.5px;
  font-style: normal;
  font-weight: 650;
  white-space: nowrap;
  color: var(--pop-muted);
}

.rel-c-summary,
.rel-c-block {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--pop-muted);
}

.rel-c-summary:empty {
  display: none;
}

.rel-c-summary.is-warning,
.rel-c-block {
  color: var(--pop-danger);
}

.rel-c-block {
  padding: 10px 12px;
  border: 1px solid var(--pop-danger-border);
  border-radius: 12px;
  background: var(--pop-danger-bg);
}

.rel-aud-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rel-aud {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--pop-border-soft);
  border-radius: 14px;
  background: var(--pop-surface);
  color: var(--pop-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.rel-aud:hover:not(:disabled) {
  background: var(--pop-hover);
}

.rel-aud:disabled {
  opacity: 0.45;
  cursor: default;
}

.rel-aud-icon {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--tone-soft);
  color: var(--tone);
}

.rel-aud-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.rel-aud-copy strong {
  font-size: 13.5px;
}

.rel-aud-copy small {
  font-size: 12px;
  color: var(--pop-muted);
}

.rel-aud > b {
  font-size: 16px;
}

.rel-s-section {
  padding: 14px 0;
  border-top: 1px solid var(--pop-border-soft);
}

.rel-s-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.rel-s-section h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--pop-ink);
}

.rel-s-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.rel-s-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.rel-s-field > span:first-child,
.rel-s-label {
  font-size: 12px;
  font-weight: 650;
  color: var(--pop-muted);
}

.rel-s-label {
  margin: 14px 0 6px;
}

.rel-s-input {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--pop-border);
  border-radius: 12px;
  background: var(--pop-surface-alt);
}

.rel-s-input input {
  width: 64px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--pop-ink);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
}

.rel-s-input em {
  overflow: hidden;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--pop-muted);
}

.rel-s-field.wide {
  margin-top: 12px;
}

.rel-s-field.wide input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--pop-border);
  border-radius: 12px;
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
  font: inherit;
  font-size: 13.5px;
}

.rel-s-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rel-s-cats small {
  font-size: 12.5px;
  color: var(--pop-muted);
}

/* ---------- telas estreitas ---------- */

@media (max-width: 900px) {
  .rel-hero-card {
    grid-template-columns: minmax(0, 1fr);
    padding: 22px;
  }
}

@media (max-width: 760px) {
  .rel-root {
    gap: 14px;
  }

  .rel-views {
    width: 100%;
  }

  .rel-view-btn {
    flex: 1 1 0;
    justify-content: center;
    padding: 0 6px;
    font-size: 13px;
  }

  .rel-toolbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .rel-updated {
    margin-right: auto;
  }

  .rel-tool-btn span {
    display: none;
  }

  .rel-hero-count strong {
    font-size: 44px;
  }

  .rel-hero-count span {
    font-size: 16px;
  }

  .rel-opps {
    grid-template-columns: minmax(0, 1fr);
  }

  .rel-opp {
    min-height: 0;
  }

  .rel-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rel-health {
    padding: 14px;
    border-radius: 22px;
  }

  .rel-list-tools .rel-btn {
    width: 100%;
  }

  .rel-list-head {
    display: none;
  }

  .rel-list-rows {
    border-top: 1px solid rgba(0, 113, 227, 0.12);
    border-radius: 18px;
  }

  .rel-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "person total"
      "badges badges"
      "last count";
    row-gap: 6px;
    padding: 12px 14px;
  }

  .rel-row-person { grid-area: person; }
  .rel-row-badges { grid-area: badges; }
  .rel-row-cell.is-total { grid-area: total; text-align: right; }
  .rel-row-cell.is-last { grid-area: last; font-size: 12.5px; color: var(--muted); }
  .rel-row-cell.is-count { grid-area: count; font-size: 12.5px; color: var(--muted); text-align: right; }
  .rel-row-cell.is-last::before { content: 'Última compra: '; }
  .rel-row-cell.is-count::before { content: 'Compras: '; }

  .rel-camps {
    grid-template-columns: minmax(0, 1fr);
  }

  .rel-j-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rel-j-fact {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .rel-s-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .rel-id-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .rel-runner {
    right: 16px;
    left: 16px;
    width: auto;
  }
}

@media (max-width: 400px) {
  .rel-view-btn .icon {
    display: none;
  }
}

/* Busca e "Ordenar" da aba Campanha: mesma caixa da pesquisa de Produtos
   (.stats-page .prod-search). */
.stats-page .rel-search,
.stats-page .rel-sort-btn {
  height: 44px;
  border: 1px solid rgba(0, 113, 227, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.stats-page .rel-search {
  padding: 0 14px;
}

.stats-page .rel-search:hover,
.stats-page .rel-sort-btn:hover {
  border-color: rgba(0, 113, 227, 0.24);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.09);
}

.stats-page .rel-search:focus-within,
.stats-page .rel-sort-btn:focus-visible {
  border-color: rgba(0, 113, 227, 0.42);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.09), 0 8px 18px rgba(0, 0, 0, 0.09);
  outline: none;
}

.stats-page .rel-search .icon,
.stats-page .rel-sort-btn .icon {
  color: #0071e3;
}

.stats-page .rel-search input {
  color: #1d1d1f;
  caret-color: #0071e3;
  font-size: 13px;
  font-weight: 300;
}

.stats-page .rel-search input::placeholder {
  color: #6e6e73;
}

.stats-page .rel-sort-btn span {
  font-size: 13px;
  font-weight: 300;
  color: #6e6e73;
}

.stats-page .rel-sort-btn b {
  font-size: 13px;
  font-weight: 600;
  color: #1d1d1f;
}

html[data-theme="dark"] .stats-page .rel-search,
html[data-theme="dark"] .stats-page .rel-sort-btn {
  border-color: rgba(94, 168, 255, 0.26);
  background: #0e1015;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .stats-page .rel-search:hover,
html[data-theme="dark"] .stats-page .rel-sort-btn:hover {
  border-color: rgba(94, 168, 255, 0.38);
  background: #181b22;
}

html[data-theme="dark"] .stats-page .rel-search:focus-within,
html[data-theme="dark"] .stats-page .rel-sort-btn:focus-visible {
  border-color: rgba(94, 168, 255, 0.56);
  background: #181b22;
  box-shadow: 0 0 0 3px rgba(94, 168, 255, 0.12), 0 8px 18px rgba(0, 0, 0, 0.30);
}

html[data-theme="dark"] .stats-page .rel-search .icon,
html[data-theme="dark"] .stats-page .rel-sort-btn .icon {
  color: #5ea8ff;
}

html[data-theme="dark"] .stats-page .rel-search input,
html[data-theme="dark"] .stats-page .rel-sort-btn b {
  color: #f5f5f7;
}

html[data-theme="dark"] .stats-page .rel-search input::placeholder,
html[data-theme="dark"] .stats-page .rel-sort-btn span {
  color: #a4a7ae;
}

/* Aba Contatos: contato que não é cliente não abre ficha. */
.rel-row.is-static {
  cursor: default;
}

.rel-row.is-static:hover {
  background: transparent;
}

.rel-db-list .rel-list-head,
.rel-db-list .rel-row {
  grid-template-columns: minmax(200px, 2fr) minmax(160px, 1.3fr) minmax(90px, .7fr) minmax(100px, .8fr) auto;
}

.rel-db-action .rel-btn {
  white-space: nowrap;
}

@media (max-width: 760px) {
  .rel-db-list .rel-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "person action" "badges badges" "birthday last";
  }

  .rel-db-list .rel-db-action { grid-area: action; }
  .rel-db-list .rel-db-birthday { grid-area: birthday; }
  .rel-db-list .rel-db-last { grid-area: last; text-align: right; }
  .rel-db-list .rel-db-birthday::before { content: 'Aniversário: '; }
  .rel-db-list .rel-db-last::before { content: 'Último envio: '; }
}

.rel-crm-chip .rel-chip-count {
  font-weight: 600;
}

/* Filtros no celular: rótulo em cima e uma linha só por faixa, rolando para
   o lado — sem botão sobrando sozinho na linha de baixo. */
@media (max-width: 760px) {
  .rel-filters {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 12px;
  }

  .rel-chip-group {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
  }

  .rel-chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 2px 2px 8px;
    margin: 0 -2px -6px;
  }

  .rel-chip-row::-webkit-scrollbar {
    display: none;
  }

  .rel-chip-row .client-filter-chip {
    flex: 0 0 auto;
    height: 34px;
    padding: 0 12px;
    white-space: nowrap;
  }
}

/* Regras da promoção dentro do popup existente. */
.prod-promotion-rule-note,
.prod-promotion-rule-preview {
  margin: 4px 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: #6e6e73;
}
.prod-promotion-rule-preview { margin: 10px 0 0; }
html[data-theme="dark"] .prod-promotion-rule-note,
html[data-theme="dark"] .prod-promotion-rule-preview { color: #a1a1a6; }

/* Escolhas da promoção: o mesmo seletor e pop-up de opções do sistema. */
.prod-promotion-dialog .prod-promotion-picker {
  width: 100%;
  padding-top: 8px;
  padding-bottom: 8px;
  text-align: left;
  cursor: pointer;
}
.prod-promotion-dialog .prod-promotion-picker > span:first-child {
  max-width: 48%;
}
.rdx-project-popover.prod-promotion-dialog .prod-promotion-picker > .sim-picker-val {
  flex: 1;
  min-width: 0;
  color: inherit;
  font-size: 10.4px;
}
.prod-promotion-dialog .prod-promotion-picker > .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}
.prod-promotion-dialog .prod-promotion-picker:focus-visible,
.prod-promotion-dialog .prod-promotion-picker[aria-expanded="true"] {
  outline: 2px solid #5ea8ff;
  outline-offset: 1px;
}
@media (max-width: 680px) {
  .rdx-project-popover.prod-promotion-dialog .prod-promotion-picker > .sim-picker-val {
    font-size: 13px;
  }
}

/* ---------- Validade por lote (produtos) ----------
   Aviso no card/linha da lista, resumo + tabela de lotes no cadastro, grade
   das chaves de funções e o pop-up que pergunta o lote em toda entrada. */
.prod-card-expiry {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.8px;
  font-weight: 500;
  line-height: 1.3;
}
.prod-card-expiry .icon { width: 12px; height: 12px; flex: 0 0 12px; }
.prod-card-expiry .icon svg { width: 100%; height: 100%; fill: currentColor; }
.prod-card-expiry.is-expired { color: #d70015; }
.prod-card-expiry.is-soon { color: #b7791f; }
.prod-card-expiry.is-ok { color: #13804f; font-weight: 400; }
.prod-card-expiry.is-missing { color: #6e6e73; font-weight: 400; }
html[data-theme="dark"] .prod-card-expiry.is-expired { color: #ff6961; }
html[data-theme="dark"] .prod-card-expiry.is-soon { color: #e0ad5a; }
html[data-theme="dark"] .prod-card-expiry.is-ok { color: #30d158; }
html[data-theme="dark"] .prod-card-expiry.is-missing { color: #a4a7ae; }

/* Chaves de funções: duas colunas alinhadas linha a linha. */
.prod-switch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin-bottom: 4px;
}
.prod-switch-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.prod-switch-grid .prod-toggle-row,
.prod-form-page .prod-switch-grid .prod-toggle-row {
  width: 100%;
  max-width: none;
  min-height: 50px;
  margin: 0;
  justify-content: space-between;
  box-sizing: border-box;
}
@media (max-width: 760px) {
  .prod-switch-grid { grid-template-columns: 1fr; gap: 12px; }
}

.prod-expiry-section[hidden] { display: none !important; }
.prod-expiry-section { margin-top: 6px; }
.prod-expiry-lots { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

/* Selo de situação (lista de lotes e pop-up) */
.xl-status {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.xl-status.is-expired { background: rgba(255, 59, 48, 0.12); color: #d70015; }
.xl-status.is-soon { background: rgba(255, 159, 10, 0.15); color: #a8650a; }
.xl-status.is-ok { background: rgba(52, 199, 89, 0.15); color: #13804f; }
.xl-status.is-new { background: rgba(0, 122, 255, 0.12); color: #0a66d6; }
html[data-theme="dark"] .xl-status.is-expired { background: rgba(255, 69, 58, 0.18); color: #ff6961; }
html[data-theme="dark"] .xl-status.is-soon { background: rgba(255, 179, 64, 0.18); color: #f0b45a; }
html[data-theme="dark"] .xl-status.is-ok { background: rgba(48, 209, 88, 0.16); color: #30d158; }
html[data-theme="dark"] .xl-status.is-new { background: rgba(94, 168, 255, 0.18); color: #5ea8ff; }

/* Resumo */
.pl-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pl-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(29, 29, 31, 0.08);
  background: #ffffff;
  min-width: 0;
}
.pl-stat small { font-size: 11.5px; color: #6e6e73; }
.pl-stat b { font-size: 16px; font-weight: 600; color: #1d1d1f; font-variant-numeric: tabular-nums; }
.pl-stat.is-missing b,
.pl-stat.is-soon b { color: #a8650a; }
.pl-stat.is-expired b { color: #d70015; }
.pl-stat.is-ok b { color: #13804f; }

/* Unidades sem data */
.pl-missing {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 159, 10, 0.35);
  background: rgba(255, 159, 10, 0.08);
}
.pl-missing-icon { color: #b7791f; display: inline-flex; }
.pl-missing-icon .icon { width: 20px; height: 20px; }
.pl-missing-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pl-missing-copy b { font-size: 14px; color: #1d1d1f; }
.pl-missing-copy span { font-size: 12.5px; color: #6e6e73; }
.pl-fill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: #1d1d1f;
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.pl-fill .icon { width: 16px; height: 16px; }

/* Tabela de lotes */
.pl-table {
  border-radius: 14px;
  border: 1px solid rgba(29, 29, 31, 0.08);
  background: #ffffff;
  overflow: hidden;
}
.pl-row {
  display: grid;
  grid-template-columns: 96px minmax(100px, 1fr) 110px minmax(150px, 1.3fr) 104px;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 8px 14px;
  color: #1d1d1f;
  font-size: 13px;
}
.pl-row + .pl-row { border-top: 1px solid rgba(29, 29, 31, 0.07); }
.pl-head { min-height: 36px; background: #f0f0f2; font-size: 11.5px; font-weight: 700; }
.pl-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.pl-dot { width: 8px; height: 8px; border-radius: 50%; background: #c7c7cc; flex: none; }
.pl-row.is-expired .pl-dot { background: #ff3b30; }
.pl-row.is-soon .pl-dot { background: #ff9f0a; }
.pl-row.is-ok .pl-dot { background: #34c759; }
.pl-date,
.pl-qty { font-weight: 600; font-variant-numeric: tabular-nums; }
.pl-actions { justify-self: end; }
.pl-link {
  border: 0;
  border-radius: 8px;
  padding: 6px 8px;
  background: transparent;
  color: #0a66d6;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.pl-link:hover { background: rgba(0, 122, 255, 0.08); }
.pl-date-input {
  height: 34px;
  width: 100%;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(29, 29, 31, 0.14);
  background: #f5f5f7;
  color: inherit;
  font: inherit;
  box-sizing: border-box;
}
.pl-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed rgba(29, 29, 31, 0.16);
  color: #6e6e73;
  font-size: 13px;
}
.pl-empty .icon { width: 18px; height: 18px; flex: none; }

html[data-theme="dark"] .pl-stat,
html[data-theme="dark"] .pl-table {
  background: #15171c;
  border-color: rgba(255, 255, 255, 0.09);
}
html[data-theme="dark"] .pl-stat small,
html[data-theme="dark"] .pl-missing-copy span,
html[data-theme="dark"] .pl-empty { color: #a4a7ae; }
html[data-theme="dark"] .pl-stat b,
html[data-theme="dark"] .pl-missing-copy b,
html[data-theme="dark"] .pl-row { color: #f5f5f7; }
html[data-theme="dark"] .pl-stat.is-missing b,
html[data-theme="dark"] .pl-stat.is-soon b { color: #f0b45a; }
html[data-theme="dark"] .pl-stat.is-expired b { color: #ff6961; }
html[data-theme="dark"] .pl-stat.is-ok b { color: #30d158; }
html[data-theme="dark"] .pl-head { background: #1f2229; }
html[data-theme="dark"] .pl-row + .pl-row { border-top-color: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .pl-missing { background: rgba(255, 179, 64, 0.08); border-color: rgba(255, 179, 64, 0.30); }
html[data-theme="dark"] .pl-missing-icon { color: #f0b45a; }
html[data-theme="dark"] .pl-fill { background: #f5f5f7; color: #111113; }
html[data-theme="dark"] .pl-link { color: #5ea8ff; }
html[data-theme="dark"] .pl-date-input { background: #1f2229; border-color: rgba(255, 255, 255, 0.14); color-scheme: dark; }
html[data-theme="dark"] .pl-empty { border-color: rgba(255, 255, 255, 0.16); }

/* Cadastro aberto como pop-up (botão "+" do PDV): tokens do tema novo. */
.stats-modal-card.pos-dialog.prod-product-dialog .pl-stat,
.stats-modal-card.pos-dialog.prod-product-dialog .pl-table {
  background: var(--pop-surface-alt);
  border-color: var(--pop-border);
}
.stats-modal-card.pos-dialog.prod-product-dialog .pl-row,
.stats-modal-card.pos-dialog.prod-product-dialog .pl-stat b { color: var(--pop-ink); }
.stats-modal-card.pos-dialog.prod-product-dialog .pl-head { background: var(--pop-hover); }

@media (max-width: 760px) {
  .pl-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-head { display: none; }
  .pl-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .pl-date,
  .pl-status { justify-self: end; }
  .pl-actions { grid-column: 1 / -1; justify-self: start; margin-left: -8px; }
  .pl-missing { flex-wrap: wrap; }
  .pl-fill { width: 100%; justify-content: center; }
}

/* ---------- Pop-up "Entrada no estoque" (lote existente ou novo) ---------- */
/* O .prod-simple-dialog crava 400px com !important; este seletor é mais específico. */
.stats-modal-card.pos-dialog.prod-expiry-entry-dialog { width: min(560px, calc(100vw - 32px)) !important; }
.xl-root { display: flex; flex-direction: column; gap: 14px; }
.xl-root .icon { width: 18px; height: 18px; }
.xl-root .icon svg { width: 100%; height: 100%; fill: currentColor; }
.xl-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--pop-border);
  background: var(--pop-surface-alt);
}
.xl-head-qty {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 3px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(52, 199, 89, 0.15);
  color: #13804f;
}
.xl-head-qty b { font-size: 22px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.xl-head-qty span { font-size: 12px; font-weight: 600; }
.xl-head-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.xl-head-copy strong { font-size: 14.5px; color: var(--pop-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xl-head-copy span { font-size: 13px; color: var(--pop-muted); }
.xl-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.xl-mode {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1.5px solid var(--pop-border);
  background: var(--pop-surface);
  color: var(--pop-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}
.xl-mode.is-active {
  border-color: var(--pop-accent);
  background: color-mix(in srgb, var(--pop-accent) 9%, var(--pop-surface));
}
.xl-mode:disabled { opacity: .45; cursor: not-allowed; }
.xl-mode-icon {
  width: 34px;
  height: 34px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--pop-surface-alt);
  color: var(--pop-accent);
}
.xl-mode-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.xl-mode-copy b { font-size: 13.5px; font-weight: 600; }
.xl-mode-copy small { font-size: 12px; color: var(--pop-muted); }
.xl-lot-list { display: flex; flex-direction: column; gap: 8px; max-height: 290px; overflow-y: auto; }
.xl-lot {
  display: grid;
  grid-template-columns: 20px 112px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--pop-border);
  background: var(--pop-surface);
  color: var(--pop-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.xl-lot.is-picked { border-color: var(--pop-accent); background: color-mix(in srgb, var(--pop-accent) 7%, var(--pop-surface)); }
.xl-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--pop-border); box-sizing: border-box; }
.xl-lot.is-picked .xl-radio { border: 5px solid var(--pop-accent); }
.xl-lot-col small { display: block; font-size: 11px; color: var(--pop-muted); }
.xl-lot-col b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.xl-foot-note {
  margin: 10px 2px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--pop-muted);
}
.xl-foot-note b { color: var(--pop-ink); }
.xl-field { display: flex; flex-direction: column; gap: 6px; }
.xl-field > span { font-size: 12.5px; font-weight: 600; color: var(--pop-muted); }
.xl-input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--pop-border);
  background: var(--pop-surface-alt);
  color: var(--pop-ink);
  font: inherit;
  font-size: 14px;
  box-sizing: border-box;
}
html[data-theme="dark"] .xl-input { color-scheme: dark; }
.xl-link {
  align-self: flex-start;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--pop-accent);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.xl-split-head,
.xl-split-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 156px 80px 40px;
  align-items: center;
  gap: 8px;
}
.xl-split-head { margin-bottom: 6px; padding: 0 4px; font-size: 11.5px; font-weight: 600; color: var(--pop-muted); }
.xl-split-list { display: flex; flex-direction: column; gap: 8px; }
.xl-split-date { padding: 0 4px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--pop-ink); }
.xl-icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--pop-border);
  background: var(--pop-surface-alt);
  color: var(--pop-danger);
  cursor: pointer;
}
.xl-icon-btn:disabled { opacity: .35; cursor: default; }
.xl-add {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px dashed var(--pop-border);
  background: transparent;
  color: var(--pop-ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.xl-ok { display: inline-flex; align-items: center; gap: 4px; color: #13804f; font-weight: 600; }
.xl-ok .icon { width: 14px; height: 14px; }
.xl-off { color: var(--pop-danger); font-weight: 600; }
html[data-theme="dark"] .xl-head-qty { background: rgba(48, 209, 88, 0.16); color: #30d158; }
html[data-theme="dark"] .xl-ok { color: #30d158; }
@media (max-width: 560px) {
  .xl-modes { grid-template-columns: 1fr; }
  .xl-lot { grid-template-columns: 20px minmax(0, 1fr) minmax(0, 1fr); }
  .xl-lot .xl-status { grid-column: 2 / -1; justify-self: start; }
  .xl-split-head { display: none; }
  .xl-split-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ---------- Central de notificações (sino do topo) ---------- */
.notif-bell {
  position: relative;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background-color 160ms ease, transform 120ms ease;
}
.notif-bell:hover { background: rgba(110, 110, 115, 0.10); }
.notif-bell:active { transform: scale(0.94); }
.notif-bell .icon { width: 18px; height: 18px; }
.notif-bell .icon svg { width: 100%; height: 100%; fill: currentColor; }
.notif-bell.has-notifications .icon { animation: notifBellRing 900ms ease 1; transform-origin: 50% 10%; }
.notif-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid #ffffff;
  background: #ff3b30;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  box-sizing: border-box;
}
.notif-badge[hidden] { display: none; }
html[data-theme="dark"] .notif-badge { border-color: #0e1117; background: #ff453a; }
html[data-theme="dark"] .notif-bell:hover { background: rgba(255, 255, 255, 0.08); }

@keyframes notifBellRing {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(14deg); }
  40% { transform: rotate(-11deg); }
  60% { transform: rotate(7deg); }
  80% { transform: rotate(-4deg); }
}

/* No celular a barra do topo some; o sino fica na linha do título. */
.notif-bell-mobile { display: none; }
@media (max-width: 940px) {
  .notif-bell-mobile {
    display: inline-flex;
    width: 36px;
    height: 36px;
    margin-left: auto;
    color: #1d1d1f;
  }
  html[data-theme="dark"] .notif-bell-mobile { color: #f5f5f7; }
}

/* Painel */
.stats-modal-card.rdx-project-popover.notif-panel-dialog {
  width: min(380px, calc(100vw - 26px));
}
.notif-panel-dialog .stats-modal-body { padding: 8px; }
.notif-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: min(60vh, 460px);
  overflow-y: auto;
}
.notif-item {
  display: flex;
  align-items: stretch;
  border-radius: 12px;
}
.notif-item:hover { background: rgba(110, 110, 115, 0.08); }
.notif-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 6px 10px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.notif-item-icon {
  width: 30px;
  height: 30px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
}
.notif-item-icon .icon { width: 16px; height: 16px; }
.notif-item-icon .icon svg { width: 100%; height: 100%; fill: currentColor; }
.notif-item.is-danger .notif-item-icon { background: rgba(255, 59, 48, 0.12); color: #d70015; }
.notif-item.is-warn .notif-item-icon { background: rgba(255, 159, 10, 0.14); color: #b7791f; }
.notif-item.is-info .notif-item-icon { background: rgba(0, 122, 255, 0.12); color: #0a66d6; }
.notif-item-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.notif-item-copy small { font-size: 10.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: #6e6e73; }
.notif-item-copy b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-item-copy span { font-size: 12px; color: #48484a; }
.notif-item-dismiss {
  width: 30px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #8e8e93;
  cursor: pointer;
  opacity: .55;
}
.notif-item:hover .notif-item-dismiss,
.notif-item-dismiss:focus-visible { opacity: 1; }
.notif-item-dismiss .icon { width: 14px; height: 14px; }
.notif-item-dismiss .icon svg { width: 100%; height: 100%; fill: currentColor; }
.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 12px;
  color: #6e6e73;
  font-size: 13px;
  text-align: center;
}
.notif-empty .icon { width: 26px; height: 26px; opacity: .5; }
.notif-empty .icon svg { width: 100%; height: 100%; fill: currentColor; }
.notif-panel-dialog .stats-modal-foot:has(> .notif-clear[hidden]) { display: none; }
.notif-clear[hidden] { display: none !important; }

html[data-theme="dark"] .notif-item:hover { background: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .notif-item.is-danger .notif-item-icon { background: rgba(255, 69, 58, 0.16); color: #ff6961; }
html[data-theme="dark"] .notif-item.is-warn .notif-item-icon { background: rgba(255, 179, 64, 0.16); color: #e0ad5a; }
html[data-theme="dark"] .notif-item.is-info .notif-item-icon { background: rgba(94, 168, 255, 0.16); color: #5ea8ff; }
html[data-theme="dark"] .notif-item-copy small,
html[data-theme="dark"] .notif-empty { color: #a4a7ae; }
html[data-theme="dark"] .notif-item-copy span { color: #d1d1d6; }

@media (prefers-reduced-motion: reduce) {
  .notif-bell.has-notifications .icon { animation: none; }
}

/* Cabeçalho mobile em grade (menu | título): suporte e sino dividem a 3ª
   coluna, na linha do título, um em cada ponta. Antes os dois ocupavam a mesma
   célula e ficavam um sobre o outro. Os 4px entre eles dão o mesmo espaço
   entre os ícones da barra do computador. O subtítulo passa por baixo deles
   para não quebrar em mais linhas. */
@media (max-width: 940px) {
  .stats-page > .stats-header > .stats-title-block:has(.notif-bell-mobile),
  .cash-page > .cash-header > .cash-title-block:has(.notif-bell-mobile) {
    grid-template-columns: 38px minmax(0, 1fr) 76px;
  }
  .stats-page > .stats-header > .stats-title-block:has(.config-back):has(.notif-bell-mobile) {
    grid-template-columns: 40px minmax(0, 1fr) 76px;
  }
  .stats-page > .stats-header > .stats-title-block:has(.notif-bell-mobile) > p,
  .cash-page > .cash-header > .cash-title-block:has(.notif-bell-mobile) > p {
    grid-column: 2 / -1;
  }
  .stats-page > .stats-header .stats-mobile-title-row > .notif-bell-mobile,
  .cash-page > .cash-header .cash-mobile-title-row > .notif-bell-mobile {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    justify-self: end;
    margin-left: 0;
  }
  .stats-page > .stats-header .stats-mobile-title-row > .support-wa-button.notif-bell-mobile,
  .cash-page > .cash-header .cash-mobile-title-row > .support-wa-button.notif-bell-mobile {
    justify-self: start;
  }
}
/* Vendedor não tem sino: o suporte fica sozinho numa coluna de 36px e o
   título recupera o espaço. */
@media (max-width: 940px) {
  .stats-page > .stats-header > .stats-title-block:has(.notif-bell-mobile):not(:has([data-notif-bell])),
  .cash-page > .cash-header > .cash-title-block:has(.notif-bell-mobile):not(:has([data-notif-bell])) {
    grid-template-columns: 38px minmax(0, 1fr) 36px;
  }
  .stats-page > .stats-header > .stats-title-block:has(.config-back):has(.notif-bell-mobile):not(:has([data-notif-bell])) {
    grid-template-columns: 40px minmax(0, 1fr) 36px;
  }
}
/* iPhone SE e mini (375px): com os dois ícones, "Configurações" em 29px
   passava da coluna do título e encostava no WhatsApp. */
@media (max-width: 380px) {
  .stats-page > .stats-header > .stats-title-block:has([data-notif-bell]) :is(h1, h2),
  .cash-page > .cash-header > .cash-title-block:has([data-notif-bell]) :is(h1, h2) {
    font-size: 27px;
  }
}

/* Cadastro de produto em página, no celular: a foto aparece na seção Imagem
   em vez de na coluna lateral, que ia parar no fim da página. */
.prod-form-preview-inline { display: none; }
@media (max-width: 760px) {
  .prod-form-page .prod-form-preview-box.prod-form-preview-inline {
    display: flex;
    width: min(240px, 100%);
    max-width: 240px;
    aspect-ratio: 1 / 1;
    height: auto;
    margin: 0 auto 12px;
  }
  .prod-form-page .prod-form-side { display: none !important; }
}

/* Início no celular: entre 601 e 940px o cabeçalho é uma linha flex e a placa
   do título encolhia até o fim do texto, deixando o sino no meio da tela. As
   outras abas já esticam a placa (.stats-title-block tem width: 100%). */
@media (max-width: 940px) {
  .home-page > .home-header > .home-title-block {
    flex: 1 1 auto;
    width: 100%;
  }
}

/* Vendas no celular, tema claro: o degradê do fundo se estica pela altura da
   página. Com poucas vendas a página fica curta, o topo cai no cinza do meio
   do degradê e a placa branca do título ganha uma borda em volta. Com a altura
   do degradê fixa, o topo fica igual ao de Clientes, que é sempre longa. */
@media (max-width: 940px) {
  html:not([data-theme="dark"]) .vendas-page {
    background-size: 100% max(100%, 3200px);
    background-repeat: no-repeat;
  }
}

/* Abas do topo das páginas (Produtos, Estatísticas, Relatórios, Clientes, O.S., Contas a pagar)
   no celular: a rolagem vai de borda a borda da tela em vez de parar no recuo da página, e a
   sombra das abas (0 6px 16px) não é cortada. A folga em volta é devolvida pela margem negativa,
   então as abas ficam no mesmo lugar. As do Crediário são um cartão e ficam como estão. */
@media (max-width: 940px) {
  .stats-page .stats-tabs:not(.crediario-section-tabs) {
    height: auto;
    margin: 7px -14px -17px;
    padding: 10px 14px 22px;
  }
  .stats-page .stats-tabs.cp-maintabs { margin-bottom: -3px; }
}

/* Vendas e Notas fiscais no celular: a busca na linha inteira e os botões numa grade 2 × 2 de
   mesma largura (com 3 botões, o último ocupa a linha toda), em vez de quebrarem em linhas
   tortas. Os filtros de situação de Vendas ficam numa linha só, dividindo a largura. */
@media (max-width: 940px) {
  .vendas-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .vendas-toolbar .vendas-search { grid-column: 1 / -1; }
  .vendas-toolbar .vendas-pill { min-width: 0; justify-content: center; }
  .vendas-toolbar .vendas-pill > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .vendas-toolbar .vendas-pill:last-child:nth-child(even) { grid-column: 1 / -1; }
  .vendas-page .vendas-tabs { flex-wrap: nowrap; }
  .vendas-page .vendas-tabs .vendas-tab {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* iPad em pé (941–1180 px): sem o celular de prévia, as duas colunas não cabem —
   o título cortava e o card vazava pela direita. Fica só o card, centralizado. */
@media (min-width: 941px) and (max-width: 1180px) and (orientation: portrait) {
  .side-glass, .brand-side, .login-divider { display: none; }
  .login-content { justify-content: center; padding: 40px; zoom: 1; }
  .panel-side { flex: 0 1 588px; }
  .login-panel { width: 100%; max-width: 588px; translate: none; }
}

/* Login: a mesma marca, superfícies e contraste da escolha de lojas.
   O mobile tem apresentação própria, sem o painel de altura inteira. */
.auth-mobile-welcome,
.login-mobile-title,
.login-input-label { display: none; }

.login-auth-panel .login-recovery-link { justify-content: flex-end; }
.login-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.login-auth-divider::before,
.login-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.login-social-options { display: grid; gap: 10px; }
.login-social-options .big-btn {
  height: 52px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  color: var(--ink);
}
.login-social-options .big-btn:hover:not(:disabled) { background: var(--card-soft); }
.login-social-options .btn-apple > svg { width: 19px; height: 22px; flex-shrink: 0; }
.login-create-account {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}
.login-create-account .link-btn { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.login-page button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

@media (max-width: 940px) {
  .login-page {
    zoom: 1;
    align-items: stretch;
    background: linear-gradient(145deg, #ffffff 0%, #f5f5f7 58%, #eff8f4 100%);
  }
  .login-page > .orb,
  .login-page > .side-glass { display: none; }
  .login-page .login-content {
    max-width: 460px;
    min-height: var(--app-height);
    padding: calc(28px + var(--safe-top)) 20px calc(28px + var(--safe-bottom));
    gap: 22px;
    justify-content: flex-start;
    align-items: stretch;
    zoom: 1;
  }
  .login-page .panel-side { flex: 0 0 auto; min-height: 0; display: block; }
  .auth-mobile-welcome { display: block; margin: 0 4px; }
  .auth-mobile-brand { display: flex; align-items: center; gap: 10px; }
  .auth-mobile-brand img { width: 36px; height: 36px; object-fit: contain; }
  .auth-mobile-brand > div { font-size: 27px; font-weight: 500; letter-spacing: -0.04em; }
  .auth-mobile-brand > div > span { font-size: 0.75em; font-weight: 400; letter-spacing: -0.02em; }
  .auth-mobile-welcome h1 {
    max-width: 320px;
    margin: 18px 0 8px;
    color: var(--ink);
    font-size: clamp(27px, 7.5vw, 32px);
    line-height: 1.12;
    letter-spacing: -0.035em;
    font-weight: 500;
    text-wrap: balance;
  }
  .auth-mobile-welcome p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; font-weight: 400; }
  .login-page .login-panel {
    width: 100%;
    min-height: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: var(--card);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06), 0 2px 6px rgba(15, 23, 42, 0.025);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .login-page .login-panel::before,
  .login-page .login-panel .panel-head { display: none; }
  .login-mobile-title { display: block; margin: 0 0 18px; color: var(--ink); font-size: 20px; line-height: 1.25; font-weight: 500; letter-spacing: -0.025em; }
  .login-input-label { display: block; margin: 0 0 7px; color: var(--muted); font-size: 12px; line-height: 1; font-weight: 500; }
  .login-page .login-field { height: 50px; border-radius: 14px; background: var(--card-soft); }
  .login-page .login-field:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(var(--blue-rgb), 0.08); }
  .login-page .login-field > .icon { width: 19px; height: 19px; margin: 0 13px; color: var(--muted); }
  .login-page .login-field input { font-size: 16px; font-weight: 400; }
  .login-page .login-field .eye-btn { width: 46px; height: 48px; }
  .login-page .field-gap { height: 14px; }
  .login-auth-panel .login-recovery-link { margin-top: 3px; }
  .login-auth-panel .login-recovery-link .link-btn { min-height: 36px; padding-right: 0; font-size: 12px; }
  .login-page .big-btn { height: 50px; font-size: 14px; border-radius: 14px; }
  .login-page .btn-login { margin-top: 8px; background: var(--ink); color: var(--card); }
  .login-auth-divider { margin: 16px 0; }
  .login-create-account { margin-top: 16px; font-size: 12px; }
  .login-create-account .link-btn { min-height: 36px; font-size: 12px; }
  .login-page.is-signup .login-content { justify-content: flex-start; }
  html[data-theme="dark"] .login-page { background: linear-gradient(145deg, #07080a 0%, #0e1117 65%, #0c1b18 100%); }
  html[data-theme="dark"] .auth-mobile-brand img { filter: invert(1); }
  html[data-theme="dark"] .login-page .login-panel { background: var(--card); border-color: var(--line); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22); }
}

@media (max-width: 380px), (max-width: 940px) and (max-height: 720px) {
  .login-page .login-content { padding-top: calc(20px + var(--safe-top)); padding-bottom: calc(20px + var(--safe-bottom)); gap: 18px; }
  .auth-mobile-welcome h1 { margin-top: 12px; font-size: 27px; }
  .login-page .login-panel { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-content.animate-in .brand-side,
  .login-content.animate-in .login-divider,
  .login-content.animate-in .panel-side,
  .login-panel.panel-swap,
  .login-panel.panel-swap-out { animation: none; }
  .login-page .orb { animation: none; }
}

/* Recuperação de senha: card sobre o login com o campo no tema de Produtos. */
.password-reset-root .stats-modal-backdrop {
  background: rgba(29, 29, 31, 0.24);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.stats-modal-card.password-reset-dialog,
html[data-theme="dark"] .stats-modal-card.password-reset-dialog {
  width: min(420px, 100%);
  max-height: calc(var(--app-height) - var(--safe-top) - var(--safe-bottom) - 40px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.16);
}
.password-reset-dialog .stats-modal-head { margin: 0 0 14px; padding: 0; border: 0; }
.password-reset-dialog .stats-modal-head h3 { font-size: 22px; font-weight: 500; letter-spacing: -0.025em; }
.password-reset-dialog .stats-modal-body { max-height: none; padding: 0; overflow: auto; }
.password-reset-copy { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.6; font-weight: 400; }
.password-reset-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.password-reset-dialog .login-field { height: 52px; border-radius: 14px; }
.password-reset-dialog .login-field input { font-size: 16px; }
.password-reset-dialog .feedback { text-align: left; font-size: 13px; line-height: 1.6; }
.password-reset-lock {
  margin: 16px 0 0;
  padding: 13px 14px;
  border: 1px solid rgba(229, 72, 77, 0.22);
  border-radius: 14px;
  background: rgba(229, 72, 77, 0.07);
  color: #b72d34;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
}
html[data-theme="dark"] .password-reset-lock { color: #ff9c90; }
.password-reset-dialog .big-btn { height: 52px; margin-top: 20px; border-radius: 14px; background: var(--ink); color: var(--card); }
.password-reset-dialog button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.password-reset-dialog input:disabled { cursor: not-allowed; opacity: 0.6; }

/* Página de nova senha: mesma escala, campos e card da entrada mobile. */
.reset-page { background: linear-gradient(145deg, #ffffff 0%, #f5f5f7 58%, #eff8f4 100%); }
.reset-shell {
  width: 100%;
  max-width: 460px;
  min-height: var(--app-height);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  margin: 0 auto;
  padding: calc(28px + var(--safe-top)) 20px calc(28px + var(--safe-bottom));
}
.reset-brand { display: flex; align-items: center; gap: 10px; margin: 0 4px; color: var(--ink); text-decoration: none; }
.reset-brand img { width: 36px; height: 36px; object-fit: contain; }
.reset-brand > span { font-size: 27px; font-weight: 500; letter-spacing: -0.04em; }
.reset-brand small { font-size: 0.75em; font-weight: 400; letter-spacing: -0.02em; }
.reset-card { padding: 26px 22px; border: 1px solid var(--line); border-radius: 26px; background: var(--card); box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06), 0 2px 6px rgba(15, 23, 42, 0.025); }
.reset-card h1 { margin: 0 0 12px; font-size: 28px; line-height: 1.15; letter-spacing: -0.035em; font-weight: 500; }
.reset-copy, .reset-status p { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.6; font-weight: 400; }
.reset-account { display: flex; align-items: center; gap: 10px; margin: 0 0 24px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); background: var(--card-soft); font-size: 13px; line-height: 1.5; }
.reset-account svg { width: 17px; height: 17px; flex: 0 0 17px; fill: currentColor; }
.reset-account span { min-width: 0; overflow-wrap: anywhere; }
.reset-label { display: block; margin: 18px 0 8px; color: var(--muted); font-size: 13px; }
.reset-password-field { height: 52px; border-radius: 14px; }
.reset-password-field input { font-size: 16px; font-weight: 400; }
.reset-password-field .eye-btn { width: 46px; height: 50px; }
.reset-password-field .eye-btn svg { width: 21px; height: 21px; fill: currentColor; }
.reset-primary { height: 52px; margin-top: 24px; border-radius: 14px; background: var(--ink); color: var(--card); text-decoration: none; }
.reset-security, .reset-footer { margin: 18px 0 0; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.6; font-weight: 400; }
.reset-footer { margin: 0; }
.reset-feedback { text-align: left; font-size: 13px; line-height: 1.5; }
.reset-status { padding: 20px 0; text-align: center; }
.reset-status .spinner { display: inline-block; margin-bottom: 20px; }
.reset-status h1 { font-size: 22px; }
.reset-status p { margin-bottom: 0; }
.reset-result-icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 24px; border-radius: 18px; background: rgba(19, 160, 101, 0.1); color: var(--green); }
.reset-result-icon svg { width: 30px; height: 30px; fill: currentColor; }
.reset-result-muted { color: var(--muted); background: var(--card-soft); }
.reset-page :is(a, button):focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
html[data-theme="dark"] .reset-page { background: linear-gradient(145deg, #07080a 0%, #0e1117 65%, #0c1b18 100%); }
html[data-theme="dark"] .reset-brand img { filter: invert(1); }
html[data-theme="dark"] .reset-card { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22); }
@media (max-width: 940px) { .reset-shell { justify-content: flex-start; } }

/* ---------------------------------------------------------------------------
   Garantia estendida
   Planos no cadastro do produto, escolha no "Editar Produto" do PDV e a
   sub-linha da garantia no carrinho, presa ao aparelho.
   --------------------------------------------------------------------------- */
.prod-warranty { display: flex; flex-direction: column; gap: 10px; }
.prod-warranty-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: stretch;
}
.prod-warranty-row .stats-modal-field { margin: 0; }
.prod-warranty-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 59, 48, 0.18);
  border-radius: 12px;
  background: rgba(255, 59, 48, 0.06);
  color: #d70015;
  cursor: pointer;
}
.prod-warranty-remove .icon { width: 18px; height: 18px; }
.prod-warranty-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed rgba(29, 29, 31, 0.16);
  color: #6e6e73;
  font-size: 13px;
}
.prod-warranty-empty .icon { width: 18px; height: 18px; flex: none; }
.prod-warranty-add { align-self: flex-start; }
html[data-theme="dark"] .prod-warranty-empty { color: #a4a7ae; border-color: rgba(255, 255, 255, 0.16); }
html[data-theme="dark"] .prod-warranty-remove { color: #ff6961; border-color: rgba(255, 105, 97, 0.30); background: rgba(255, 105, 97, 0.10); }
@media (max-width: 640px) {
  .prod-warranty-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; }
  .prod-warranty-row label:nth-child(2) { grid-column: 1 / -1; grid-row: 1; }
}

.pos-item-edit-warranty {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(29, 29, 31, 0.10);
}
.pos-item-edit-warranty-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: #1d1d1f;
  font-size: 14px;
  font-weight: 600;
}
.pos-item-edit-warranty-head .icon { width: 17px; height: 17px; color: #0071e3; }
.pos-item-edit-warranty-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}
.pos-warranty-choice {
  min-height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 12px;
  background: #f5f5f7;
  color: #1d1d1f;
  font: inherit;
  cursor: pointer;
}
.pos-warranty-choice b { font-size: 14px; font-weight: 600; }
.pos-warranty-choice small { font-size: 12px; color: #6e6e73; font-variant-numeric: tabular-nums; }
.pos-warranty-choice.is-selected {
  border-color: #0071e3;
  background: rgba(0, 113, 227, 0.08);
  box-shadow: inset 0 0 0 1px #0071e3;
}
.pos-warranty-choice.is-selected small { color: #0071e3; }
html[data-theme="dark"] .pos-item-edit-warranty { border-color: rgba(255, 255, 255, 0.10); }
html[data-theme="dark"] .pos-item-edit-warranty-head { color: #f5f5f7; }
html[data-theme="dark"] .pos-item-edit-warranty-head .icon { color: #5ea8ff; }
html[data-theme="dark"] .pos-warranty-choice { background: #1f2229; border-color: rgba(255, 255, 255, 0.09); color: #f5f5f7; }
html[data-theme="dark"] .pos-warranty-choice small { color: #a4a7ae; }
html[data-theme="dark"] .pos-warranty-choice.is-selected { border-color: #5ea8ff; background: rgba(94, 168, 255, 0.14); box-shadow: inset 0 0 0 1px #5ea8ff; }
html[data-theme="dark"] .pos-warranty-choice.is-selected small { color: #5ea8ff; }

/* Aparelho + garantia formam um bloco só: a garantia cola embaixo do aparelho
   (anula o gap da lista), os dois dividem borda, cantos e o realce do hover, e a
   garantia vira uma linha baixa com o traço saindo do nome do aparelho. */
.pos-cart-row:has(+ .pos-cart-row.is-warranty) {
  border-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding-bottom: 2px;
}
.pos-cart-row.is-warranty {
  position: relative;
  margin-top: -8px;
  padding: 3px 6px 7px 26px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.pos-cart-row.is-warranty::before {
  content: '';
  position: absolute;
  left: 11px;
  top: -2px;
  height: 14px;
  width: 9px;
  border: 0 solid var(--line);
  border-width: 0 0 1.5px 1.5px;
  border-bottom-left-radius: 5px;
}
.pos-cart-row[data-edit-item]:has(+ .pos-cart-row.is-warranty:hover),
.pos-cart-row[data-mb-edit-item]:has(+ .pos-cart-row.is-warranty:hover),
.pos-cart-row[data-edit-item]:hover + .pos-cart-row.is-warranty,
.pos-cart-row[data-mb-edit-item]:hover + .pos-cart-row.is-warranty { background: var(--card-soft); }
.pos-cart-row.is-warranty .pos-cart-info {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.pos-cart-row.is-warranty .pos-cart-info b {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}
.pos-cart-row.is-warranty .pos-cart-info b span { overflow: hidden; text-overflow: ellipsis; }
.pos-cart-row.is-warranty .pos-cart-info > span {
  margin-left: auto;
  white-space: nowrap;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.pos-cart-row.is-warranty .pos-cart-info b .icon { width: 14px; height: 14px; flex: none; color: #0071e3; }
html[data-theme="dark"] .pos-cart-row.is-warranty .pos-cart-info b .icon { color: #5ea8ff; }
/* A garantia não tem botões próprios: a quantidade segue a do aparelho, e
   tirar a garantia é escolher "Sem garantia" ao tocar no aparelho. O preço
   vai até a borda direita, embaixo da lixeira do aparelho. */
.pos-cart-row.is-warranty .pos-qty-btn,
.pos-cart-row.is-warranty .pos-remove-btn { display: none; }
.pos-cart-row.is-warranty .pos-cart-info { padding-right: 4px; }

/* Ações da O.S.: as ações de perigo (Cancelar O.S., Estornar do caixa, Estornar
   do estoque) usam o cartão claro do system_cards e só o rótulo e a seta em
   vermelho. A regra geral do popover compacto pintava o rótulo de preto por cima
   do vermelho do botão, e só a seta saía vermelha. */
html:not([data-theme="dark"]) .rdx-project-popover .stats-option-tile.danger[data-os-action] > span:not(.icon),
html:not([data-theme="dark"]) .rdx-project-popover .stats-option-tile.danger[data-os-action] .icon {
  color: #d70015;
}
html[data-theme="dark"] .rdx-project-popover .stats-option-tile.danger[data-os-action] > span:not(.icon),
html[data-theme="dark"] .rdx-project-popover .stats-option-tile.danger[data-os-action] .icon {
  color: #ff6c6c;
}

/* ---------- Suporte pelo WhatsApp (ao lado do sino) ---------- */
/* O suporte usa o mesmo botão do sino. No celular os dois dividem a linha do
   título, e só o primeiro empurra o par para a direita. */
.notif-bell-mobile + .notif-bell-mobile { margin-left: 0; }
/* Na linha flex da Início (gap de 12px) o par fica a 4px, como nas outras abas. */
.home-mobile-title-row > .notif-bell-mobile + .notif-bell-mobile { margin-left: -8px; }
.stats-modal-card.rdx-project-popover.support-wa-dialog { width: min(380px, calc(100vw - 26px)); }
.support-wa-dialog .support-wa-note {
  margin: 0 2px 10px;
  color: var(--rdx-surface-muted, #6e6e73);
  font-size: 12px;
  line-height: 1.45;
}
.support-wa-dialog .support-wa-note b {
  color: var(--rdx-surface-ink, #1d1d1f);
  font-weight: 500;
  white-space: nowrap;
}
.stats-modal-card.support-wa-dialog .stats-modal-field.support-wa-field {
  min-height: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  margin-top: 0;
  padding: 10px 12px 4px;
}
.stats-modal-card.support-wa-dialog .support-wa-field > span {
  color: var(--rdx-surface-muted, #6e6e73);
  font-size: 11px;
  font-weight: 500;
}
.stats-modal-card.support-wa-dialog .support-wa-field textarea {
  width: 100%;
  min-height: 112px;
  padding: 4px 0 8px;
  resize: none;
  color: var(--rdx-surface-ink, #1d1d1f);
  color-scheme: light;
  font-size: 13px;
  line-height: 1.45;
}
html[data-theme="dark"] .stats-modal-card.support-wa-dialog .support-wa-field textarea { color-scheme: dark; }
.stats-modal-card.support-wa-dialog .support-wa-send { width: 100%; }
.stats-modal-card.support-wa-dialog .support-wa-send:disabled { opacity: 0.38; cursor: not-allowed; }

/* Filtros em popover: o campo de seleção logo antes de uma linha com chave
   (ex.: "Origem" → "Com estoque baixo" em Produtos) ficava sem espaço nenhum,
   porque só o par campo + campo ganhava margem. Iguala tudo a 8px. */
.rdx-project-popover.stats-filter-dialog .stats-filter-field + .stats-filter-field,
.rdx-project-popover.stats-filter-dialog .stats-filter-field + .prod-toggle-row,
.rdx-project-popover.stats-filter-dialog .stats-filter-field + .cp-cost-seg,
.rdx-project-popover.stats-filter-dialog .prod-toggle-row + .stats-filter-field {
  margin-top: 8px;
}

.cp-due-custom { display: grid; gap: 8px; margin-top: 0; }
.cp-due-custom .stats-modal-field { gap: 10px; justify-content: space-between; }
