/* =====================================================================
   Kary — estilos globais
   Todas as cores, fontes, espaçamentos e raios vêm dos tokens abaixo.
   O modo noturno redefine apenas os tokens (não é uma inversão de cores).
   ===================================================================== */

/* ---------- Fonte Inter (servida localmente; a CSP só permite fontes do próprio sistema) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/inter-latin-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/inter-latin-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/inter-latin-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/inter-latin-700.woff2") format("woff2"); }

/* ---------- Tokens: modo claro (experiência principal) ---------- */
:root {
  color-scheme: light;

  /* Marca */
  --brand: #E1262D;            /* vermelho Kary: identidade e ações principais */
  --brand-hover: #C91D24;      /* vermelho escuro: hover e destaques */
  --brand-text: #C91D24;       /* vermelho para texto sobre fundo claro (contraste AA) */
  --brand-soft: rgba(225, 38, 45, .08);
  --brand-ring: rgba(225, 38, 45, .28);
  --brand-orange: #FF6A00;     /* só em detalhes pontuais */
  --on-brand: #FFFFFF;
  --brand-panel: #111827;
  --blue: #3B82F6; --green: #16A34A; --amber: #F59E0B; --purple: #8B5CF6;
  --info: #1D4ED8; --info-soft: #EFF6FF; --info-line: #93B4EE;
  --analysis: #6D28D9; --analysis-soft: #F5F3FF;
  --whatsapp: #157347; --whatsapp-hover: #105C38;


  /* Superfícies e texto */
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --surface-3: #E2E8F0;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #626D7F;
  --line: #E2E8F0;
  --line-strong: #CBD5E1;

  /* Semântica (separada da identidade) */
  --pos: #15803D;
  --pos-soft: #ECFDF3;
  --neg: #B42318;
  --neg-soft: #FEF3F2;
  --warn: #B45309;
  --warn-soft: #FFF8EB;

  /* Gráficos (paleta validada para daltonismo nos dois temas) */
  --chart-revenue: #3B82F6;
  --chart-profit: #0D9488;
  --chart-grid: #EFEFF1;
  --chart-hover: rgba(11, 11, 11, .04);

  /* Sombras e profundidade */
  --shadow-sm: 0 1px 2px rgba(16, 16, 20, .04), 0 1px 3px rgba(16, 16, 20, .03);
  --shadow-md: 0 8px 24px rgba(16, 16, 20, .10), 0 2px 6px rgba(16, 16, 20, .05);
  --card-highlight: 0 0 0 0 transparent;

  /* Tipografia */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-xs: .75rem;
  --fs-sm: .8125rem;
  --fs-md: .9375rem;
  --fs-lg: 1.0625rem;
  --fs-xl: 1.5rem;
  --fs-num: 1.75rem;

  /* Espaçamentos e raios */
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.25rem; --s6: 1.5rem; --s8: 2rem;
  --radius: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;

  /* Layout */
  --sidebar: 248px;
  --sidebar-collapsed: 72px;
  --topbar: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  font-size: 16px;
}

/* ---------- Tokens: modo noturno (premium, não invertido) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --info: #93C5FD; --info-soft: #172A44; --info-line: #3B6491;
  --analysis: #C4B5FD; --analysis-soft: #302747;
  --whatsapp: #167449; --whatsapp-hover: #105C38;

  --brand-text: #FDA4A9;
  --brand-soft: rgba(225, 38, 45, .15);
  --brand-ring: rgba(225, 38, 45, .38);

  --bg: #111827;
  --surface: #202733;
  --surface-2: #273142;
  --surface-3: #303949;
  --ink: #F8FAFC;
  --ink-2: #CBD5E1;
  --muted: #A7B0C0;
  --line: #303949;
  --line-strong: #4B5563;

  --pos: #4ADE80;
  --pos-soft: rgba(74, 222, 128, .12);
  --neg: #FCA5A5;
  --neg-soft: rgba(248, 113, 113, .13);
  --warn: #FBBF24;
  --warn-soft: rgba(251, 191, 36, .12);

  --chart-grid: #303949;
  --chart-hover: rgba(255, 255, 255, .05);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .4);
  --card-highlight: inset 0 1px 0 rgba(255, 255, 255, .035);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* "hidden" sempre esconde, mesmo em elementos com display próprio */
html, body { margin: 0; }
html { overflow-x: hidden; }
body {
  overflow-x: clip; /* "clip" não cria contêiner de rolagem, então a barra fixa (sticky) funciona */
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-md)/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1 { font-size: var(--fs-xl); font-weight: 700; margin: 0; letter-spacing: -0.025em; line-height: 1.2; }
h2 { font-size: var(--fs-lg); font-weight: 600; margin: 0 0 var(--s3); letter-spacing: -0.015em; }
h3 { font-size: var(--fs-md); font-weight: 600; margin: 0 0 var(--s2); }
a { color: var(--brand-text); text-underline-offset: 2px; }
p { margin: 0 0 var(--s2); }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.cap::first-letter { text-transform: uppercase; }
.up { color: var(--pos); font-weight: 600; }
.down { color: var(--neg); font-weight: 600; }
.warn { color: var(--warn); font-weight: 600; }
.num-text { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
::selection { background: var(--brand-soft); }

/* Transição suave ao trocar de tema (só durante a troca, para não pesar no resto) */
html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after {
  transition: background-color .25s ease, border-color .25s ease, color .2s ease, fill .25s ease !important;
}

/* ---------- Logo (símbolo + nome) ---------- */
.logo { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; min-width: 0; }
.logo-symbol { display: block; width: 30px; height: 30px; flex: none; }
.logo-word { font-weight: 700; font-size: 1.3rem; letter-spacing: -0.035em; line-height: 1; }
.logo .for-dark { display: none; }
:root[data-theme="dark"] .logo .for-light { display: none; }
:root[data-theme="dark"] .logo .for-dark { display: block; }

/* ---------- Menu lateral ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40;
  display: flex; flex-direction: column; gap: var(--s2);
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 0 var(--s3) var(--s3);
  transition: width .2s var(--ease), transform .2s var(--ease);
  overflow: hidden;
}
.sb-head { height: var(--topbar); display: flex; align-items: center; padding: 0 var(--s2); flex: none; }
.sb-store {
  margin: 0 var(--s1) var(--s1); padding: .5rem .7rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none;
}
.sb-store::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-orange); margin-right: .5rem; vertical-align: middle; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overflow-x: hidden; flex: 1; padding-bottom: var(--s2); }
.nav-label {
  font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  padding: var(--s5) .75rem var(--s2); white-space: nowrap;
}
.sb-nav .nav-label:first-child { padding-top: var(--s2); }
.sb-nav a, .sb-collapse {
  display: flex; align-items: center; gap: .75rem; position: relative;
  padding: .55rem .75rem; border-radius: var(--radius-sm);
  color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: var(--fs-md); white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.sb-nav a .ico { color: var(--muted); transition: color .15s ease; }
.sb-nav a:hover, .sb-collapse:hover { background: var(--surface-2); color: var(--ink); }
.sb-nav a:hover .ico { color: var(--ink-2); }
.sb-nav a.active { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.sb-nav a.active .ico { color: var(--brand); }
.sb-nav a.active::before {
  content: ""; position: absolute; left: calc(-1 * var(--s3)); top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--brand);
}
.sb-foot { border-top: 1px solid var(--line); padding-top: var(--s2); flex: none; }
.sb-collapse { width: 100%; background: none; border: 0; font: inherit; color: var(--muted); cursor: pointer; }
.sb-collapse .ico { transition: transform .2s var(--ease); }

/* Menu recolhido (só no desktop): mostra o símbolo e os ícones */
@media (min-width: 761px) {
  :root[data-sidebar="collapsed"] { --sidebar: var(--sidebar-collapsed); }
  :root[data-sidebar="collapsed"] .sidebar .logo-word,
  :root[data-sidebar="collapsed"] .sidebar .sb-store,
  :root[data-sidebar="collapsed"] .sidebar .nav-label,
  :root[data-sidebar="collapsed"] .sidebar .sb-nav a span,
  :root[data-sidebar="collapsed"] .sidebar .sb-collapse span { display: none; }
  :root[data-sidebar="collapsed"] .sidebar .sb-head { justify-content: center; padding: 0; }
  :root[data-sidebar="collapsed"] .sidebar .sb-nav a,
  :root[data-sidebar="collapsed"] .sidebar .sb-collapse { justify-content: center; padding: .65rem 0; }
  :root[data-sidebar="collapsed"] .sidebar .sb-nav { padding-top: var(--s2); }
  :root[data-sidebar="collapsed"] .sidebar .sb-collapse .ico { transform: scaleX(-1); }
}

/* ---------- Cabeçalho ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar); margin-left: var(--sidebar);
  display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s8);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  transition: margin-left .2s var(--ease);
}
.page-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
#page-title { font-weight: 700; font-size: var(--fs-lg); letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#page-context { font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#page-context:empty { display: none; }
#page-context::first-letter { text-transform: uppercase; }
.topbar .spacer { flex: 1; }
.menu-toggle { display: none !important; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface-2); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
/* Botão principal "Nova venda": flutuante no canto inferior direito, com o degradê do ícone da Kary */
.fab-sell {
  position: fixed; right: var(--s8); bottom: calc(var(--s8) + env(safe-area-inset-bottom, 0px)); z-index: 35;
  display: inline-flex; align-items: center; gap: .85rem; height: 68px; padding: 0 1.9rem 0 .75rem; border-radius: 999px;
  background: linear-gradient(135deg, #FF5A14 0%, #FF1F1F 45%, #D80F0F 100%); color: #fff; text-decoration: none;
  box-shadow: 0 10px 28px rgba(255, 31, 31, .42), 0 2px 6px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s ease;
}
.fab-sell:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(255, 31, 31, .5), 0 3px 8px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .25); filter: saturate(1.08); }
.fab-sell:active { transform: translateY(0) scale(.98); }
.fab-sell:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.fab-ico { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .2); flex: none; }
.fab-ico .ico { width: 28px; height: 28px; stroke-width: 2.6; }
.fab-text { display: flex; flex-direction: column; line-height: 1.15; }
.fab-text strong { font-size: 1.1875rem; font-weight: 700; letter-spacing: -0.015em; }
.fab-text small { font-size: var(--fs-xs); font-weight: 500; opacity: .85; }
:root[data-theme="dark"] .fab-sell:focus-visible { outline-color: #fff; }
body[data-page="vender"] .fab-sell { display: none; } /* na venda, a ação principal é "Finalizar venda" */
body[data-page="vender"] .toasts { bottom: 7.5rem; }

/* Perfil */
.profile { position: relative; }
.profile-btn {
  display: inline-flex; align-items: center; gap: .5rem; height: 40px; padding: 0 .5rem 0 .25rem;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 500; cursor: pointer; transition: border-color .15s ease, background-color .15s ease;
}
.profile-btn:hover, .profile-btn[aria-expanded="true"] { border-color: var(--line-strong); background: var(--surface-2); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--ink); color: var(--surface); font-weight: 700; font-size: var(--fs-sm); letter-spacing: .02em;
}
.profile-name { max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--fs-sm); }
.profile-btn .chevron { width: 16px; height: 16px; color: var(--muted); transition: transform .15s ease; }
.profile-btn[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); padding: var(--s2); display: flex; flex-direction: column;
  animation: pop .14s var(--ease);
}
.menu[hidden] { display: none; }
.menu-head { display: flex; flex-direction: column; padding: .5rem .65rem .65rem; border-bottom: 1px solid var(--line); margin-bottom: var(--s1); }
.menu-head strong { font-weight: 600; }
.menu-head span { font-size: var(--fs-sm); color: var(--muted); }
.menu a, .menu button {
  display: flex; align-items: center; gap: .6rem; padding: .55rem .65rem; border-radius: var(--radius-sm);
  color: var(--ink-2); text-decoration: none; font: inherit; font-size: var(--fs-md); background: none; border: 0; cursor: pointer; text-align: left;
}
.menu a:hover, .menu button:hover, .menu a:focus-visible, .menu button:focus-visible { background: var(--surface-2); color: var(--ink); outline: none; }
.menu .ico { width: 18px; height: 18px; color: var(--muted); }
.menu .danger, .menu .danger .ico { color: var(--neg); }
.scrim { display: none; }

/* ---------- Conteúdo ---------- */
.content { margin-left: var(--sidebar); padding: var(--s6) var(--s8) 7.5rem; /* espaço para o botão "Nova venda" */ outline: none; transition: margin-left .2s var(--ease); }
.content > div { max-width: 1320px; }

/* O título da página aparece no cabeçalho; no conteúdo fica só para leitores de tela. */
.page-head { display: flex; align-items: center; justify-content: flex-end; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.page-head h1, .page-head > div > p { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.page-head:not(:has(.btn, button)) { margin: 0; }
.page-head p { margin: 0; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3) var(--s4); flex-wrap: wrap; margin-bottom: var(--s3); }
.section-head h2 { margin: 0; }
.section-head .muted { margin: 0; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm), var(--card-highlight);
}
.card-pad { padding: var(--s5); }
.block { margin-bottom: var(--s8); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6); }
.cols > .block { min-width: 0; }

/* Entrada suave dos blocos ao abrir uma tela */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.content .card, .content .table-wrap, .content .figures { animation: rise .28s var(--ease) both; }
.kpis > .card:nth-child(2) { animation-delay: .03s; }
.kpis > .card:nth-child(3) { animation-delay: .06s; }
.kpis > .card:nth-child(4) { animation-delay: .09s; }

/* Esqueleto de carregamento */
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }
.skeleton { display: flex; flex-direction: column; gap: var(--s5); }
.sk { border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2) 0, var(--surface-3) 50%, var(--surface-2) 100%) 0 0 / 800px 100%; animation: shimmer 1.2s linear infinite; }
.sk-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s4); }
.sk-card { height: 132px; }
.sk-wide { height: 300px; }
.sk-line { height: 14px; width: 40%; border-radius: 6px; }

/* ---------- Indicadores (KPIs) ---------- */
.kpi-group { margin-bottom: var(--s6); }
.kpi-group > h2 {
  font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  margin-bottom: var(--s3); display: flex; justify-content: space-between; gap: var(--s4); align-items: baseline;
}
.kpi-group > h2 a { font-size: var(--fs-sm); font-weight: 500; text-transform: none; letter-spacing: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
.kpis.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi {
  position: relative; padding: var(--s5); display: flex; flex-direction: column; gap: .35rem; min-width: 0;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s var(--ease);
}
.kpi:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.kpi .label { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.kpi-icon {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.kpi-icon .ico { width: 18px; height: 18px; }
.kpi.main .kpi-icon { background: var(--pos-soft); color: var(--pos); border: 0; }
.kpi .value { font-size: var(--fs-num); font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.15; overflow-wrap: anywhere; margin-top: .15rem; }
.kpi .value small { font-size: var(--fs-md); font-weight: 600; letter-spacing: -0.01em; color: var(--muted); }
.kpi .sub { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.kpi .flag { font-size: var(--fs-sm); color: var(--warn); font-weight: 500; }
.kpi .stock-line { font-size: var(--fs-sm); font-weight: 500; }
.kpi .kpi-link { font-size: var(--fs-sm); font-weight: 600; text-decoration: none; margin-top: auto; padding-top: .2rem; }
.kpi .kpi-link:hover { text-decoration: underline; }

/* Variação: pílula com seta + contexto */
.delta-line { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .45rem; font-size: var(--fs-sm); }
.delta {
  display: inline-flex; align-items: center; gap: .2rem; padding: .1rem .45rem; border-radius: 999px;
  font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.delta.up { color: var(--pos); background: var(--pos-soft); }
.delta.down { color: var(--neg); background: var(--neg-soft); }
.delta.flat { color: var(--muted); background: var(--surface-2); }
.delta-line .ctx { color: var(--muted); }
.delta-none { font-size: var(--fs-sm); color: var(--muted); }
.footnote { font-size: var(--fs-sm); color: var(--muted); margin: var(--s2) 0 0; }

/* Faixa de números (tela de produtos parados) */
.figures {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: var(--s6);
  box-shadow: var(--shadow-sm), var(--card-highlight);
}
.figures > div { padding: var(--s4) var(--s5); display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.figures > div + div { border-left: 1px solid var(--line); }
.figures .label { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.figures strong { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.025em; }
.figures .muted { font-size: var(--fs-sm); }

/* ---------- Metas ---------- */
.goal { margin-top: .25rem; display: flex; flex-direction: column; gap: .35rem; }
.goal-track { position: relative; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: visible; }
.goal-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-orange)); max-width: 100%; transition: width .5s var(--ease); }
.goal.reached .goal-fill { background: var(--pos); }
.goal-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 1px; opacity: .55; }
.goal-text { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.goal-text strong { color: var(--ink); font-weight: 600; }
.goal.reached .goal-text strong { color: var(--pos); }

/* ---------- Atenção ---------- */
.count-badge { font-size: var(--fs-xs); font-weight: 700; min-width: 22px; height: 22px; padding: 0 .45rem; border-radius: 999px; display: inline-grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.attention { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.attention > li {
  position: relative; display: grid; grid-template-columns: 92px 1fr auto; gap: .25rem var(--s4);
  padding: var(--s4) var(--s5); align-items: center; transition: background-color .15s ease;
}
.attention > li:hover { background: var(--surface-2); }
.attention > li + li { border-top: 1px solid var(--line); }
.alert-cover { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.alert-cover:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.attention .a-products a, .attention .a-tiers a { position: relative; z-index: 2; }
.prio {
  justify-self: start; align-self: start; margin-top: .1rem; font-size: var(--fs-xs); font-weight: 600; padding: .15rem .55rem; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap;
}
.lvl-high .prio { background: var(--neg-soft); color: var(--neg); border-color: transparent; }
.lvl-medium .prio { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.attention .a-body { min-width: 0; }
.attention .a-title { font-weight: 600; }
.attention .a-text { color: var(--muted); font-size: var(--fs-sm); margin: .1rem 0 0; }
.attention .a-text strong { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.attention .a-products { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
.attention .a-products a, .chip {
  font-size: var(--fs-xs); font-weight: 500; padding: .15rem .6rem; border-radius: 999px; border: 1px solid var(--line-strong);
  color: var(--ink-2); text-decoration: none; background: var(--surface); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: border-color .15s ease, color .15s ease;
}
.attention .a-products a:hover { border-color: var(--brand); color: var(--brand-text); }
.attention .a-tiers { display: flex; flex-wrap: wrap; gap: .3rem var(--s4); font-size: var(--fs-sm); margin-top: .35rem; }
.attention .a-tiers a { color: var(--ink-2); }
.attention .a-action { white-space: nowrap; pointer-events: none; }
.attention > li:hover .a-action { border-color: var(--brand); color: var(--brand-text); }
.all-good { display: flex; gap: .6rem; align-items: center; padding: var(--s4) var(--s5); margin: 0; }
.all-good::before { content: "✓"; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--pos-soft); color: var(--pos); font-weight: 700; flex: none; }

/* ---------- Dashboard: grades, cartões clicáveis, metas, resumo ---------- */
.dash-grid { display: grid; gap: var(--s4); margin-bottom: var(--s8); }
.dash-grid.main { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: stretch; }
.dash-grid.secondary { grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); margin-bottom: 0; }

.kpis + .goal-strip { margin-top: var(--s4); }
.content .kpis { margin-bottom: 0; }
.kpi-click { cursor: pointer; }
.kpi-click:hover { border-color: var(--line-strong); }
.kpi-cover { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.kpi-cover:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.kpi .tip, .kpi .flag, .kpi-foot .tip { position: relative; z-index: 2; }
.kpi .value.is-empty { color: var(--muted); }
.kpi-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; margin-top: auto; padding-top: .35rem; min-height: 1.75rem; }
.kpi-foot .meta { font-size: var(--fs-sm); color: var(--muted); }
.kpi-foot .meta-link { font-size: var(--fs-sm); color: var(--brand-text); font-weight: 600; }
.kpi .label { display: inline-flex; align-items: center; gap: .35rem; }
.kpi .flag { display: inline-flex; align-items: center; gap: .3rem; }

/* Ajuda (?) com explicação curta */
.tip {
  position: relative; width: 16px; height: 16px; border-radius: 50%; padding: 0; margin-left: .2rem;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted);
  font: 600 10px/1 var(--font); cursor: help; display: inline-grid; place-items: center; vertical-align: middle;
}
.tip:hover, .tip:focus-visible { color: var(--ink); border-color: var(--muted); outline: none; }
.tip::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translate(-50%, 4px);
  width: max-content; max-width: 240px; padding: .5rem .65rem; border-radius: var(--radius-sm);
  background: var(--ink); color: var(--surface); font: 500 var(--fs-xs)/1.45 var(--font); text-align: left; white-space: normal;
  opacity: 0; pointer-events: none; transition: opacity .12s ease, transform .12s ease; z-index: 30; box-shadow: var(--shadow-md);
}
.tip:hover::after, .tip:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }

/* Metas */
.goal-strip { display: flex; align-items: center; gap: var(--s3) var(--s6); padding: var(--s4) var(--s5); margin-bottom: var(--s6); flex-wrap: wrap; }
.goal-item { flex: 1 1 260px; display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.goal-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.goal-label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.goal-nums { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.goal-nums strong { color: var(--ink); font-weight: 700; }
.goal-item.reached .goal-fill { background: var(--pos); }
.goal-item.reached .goal-text strong { color: var(--pos); }
.goal-edit { font-size: var(--fs-sm); font-weight: 600; text-decoration: none; white-space: nowrap; }
.goal-edit:hover { text-decoration: underline; }
.goal-empty p { margin: 0; flex: 1; color: var(--ink-2); }
.goal-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.goal-ico .ico { width: 18px; height: 18px; }

/* Gráfico do dashboard */
.chart-sub { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s3) var(--s5); flex-wrap: wrap; margin-bottom: var(--s3); }
.chart-totals .tt-main { gap: .1rem; }
.chart-totals .tt-main strong { font-size: 1.5rem; }
.chart-empty { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: var(--s3); }
.chart-empty p { margin: 0; }

/* Resumo da Kary */
.kary-summary { padding: var(--s5); display: flex; flex-direction: column; }
.kary-summary h2 { display: flex; align-items: center; gap: .5rem; font-size: var(--fs-lg); margin-bottom: var(--s4); }
.ks-logo { width: 18px; height: 18px; }
.kary-summary ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.kary-summary li { display: grid; grid-template-columns: 22px 1fr; gap: .6rem; align-items: start; font-size: var(--fs-md); line-height: 1.45; color: var(--ink-2); }
.kary-summary li + li { padding-top: var(--s3); border-top: 1px solid var(--line); }
.ks-dot { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: .7rem; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.tone-up .ks-dot { background: var(--pos-soft); color: var(--pos); }
.tone-down .ks-dot { background: var(--neg-soft); color: var(--neg); }
.tone-warn .ks-dot { background: var(--warn-soft); color: var(--warn); }
.kary-summary li a { font-weight: 600; text-decoration: none; }
.kary-summary li a:hover { text-decoration: underline; }
.soft-empty { color: var(--muted); display: flex; flex-direction: column; align-items: flex-start; gap: var(--s3); margin: 0; }
.soft-empty p { margin: 0; }

/* Indicadores secundários */
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; padding: var(--s2); gap: 2px; align-content: center; }
.mini-stat {
  display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--radius-md);
  color: inherit; text-decoration: none; transition: background-color .15s ease;
}
.mini-stat:hover { background: var(--surface-2); }
.mini-stat .kpi-icon { width: 30px; height: 30px; }
.ms-body { display: flex; flex-direction: column; min-width: 0; gap: .1rem; }
.ms-label { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.ms-value { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ms-foot { font-size: var(--fs-sm); color: var(--muted); }
.ms-foot .delta-line { font-size: var(--fs-xs); }
.ms-foot .delta { font-size: var(--fs-xs); }
.top-products { padding: var(--s4) var(--s5); }
.tp-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--s2); }
.tp-head h3 { margin: 0; }
.tp-head a { font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }
.top-products ol { list-style: none; margin: 0; padding: 0; counter-reset: tp; }
.top-products li { counter-increment: tp; display: grid; grid-template-columns: 1.5rem 1fr auto; grid-template-areas: "n name qty" "n bar bar"; gap: .2rem var(--s2); padding: .45rem 0; align-items: center; }
.top-products li + li { border-top: 1px solid var(--line); }
.top-products li::before { content: counter(tp); grid-area: n; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
.tp-name { grid-area: name; color: var(--ink); text-decoration: none; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-name:hover { color: var(--brand-text); }
.tp-qty { grid-area: qty; font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.tp-bar { grid-area: bar; height: 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.tp-bar .hb-fill { display: block; height: 100%; width: 0; background: var(--chart-revenue); border-radius: 999px; transition: width .5s var(--ease); }

/* Colunas: dias da semana e horários */
.chart-card h3 { margin-bottom: .25rem; }
.pattern-lead { color: var(--ink-2); font-size: var(--fs-sm); margin-bottom: var(--s4); }
.pattern-lead strong { color: var(--ink); }
.col-chart { display: flex; align-items: stretch; gap: 4px; height: 190px; padding-top: 4px; }
.col-chart.with-values { padding-top: 0; }
.cc-col { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; border-radius: 6px; outline: none; cursor: default; }
.cc-plot { flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-height: 0; }
.cc-col:hover, .cc-col:focus-visible { background: var(--chart-hover); }
.cc-col:focus-visible { box-shadow: 0 0 0 2px var(--brand); }
.cc-bar { display: block; width: min(100%, 36px); height: 0; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--chart-revenue) 38%, var(--surface)); transition: height .5s var(--ease); }
.cc-col.top .cc-bar { background: var(--chart-revenue); }
.cc-val { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cc-col.top .cc-val { color: var(--ink); }
.cc-lab { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; border-top: 1px solid var(--line); width: 100%; text-align: center; padding-top: 4px; }
.cols > *, .col-chart { min-width: 0; }
@media (max-width: 760px) {
  .col-chart { gap: 2px; height: 160px; }
  .col-chart.dense .cc-col:nth-child(even) .cc-lab { color: transparent; }
  .col-chart.dense .cc-val { display: none; }
  .col-chart.dense .cc-lab { font-size: 9.5px; letter-spacing: -0.03em; overflow: visible; }
}
.cc-col::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translate(-50%, 4px);
  width: max-content; max-width: 220px; padding: .5rem .65rem; border-radius: var(--radius-sm); z-index: 30;
  background: var(--ink); color: var(--surface); font: 500 var(--fs-xs)/1.45 var(--font); white-space: normal;
  opacity: 0; pointer-events: none; transition: opacity .12s ease, transform .12s ease; box-shadow: var(--shadow-md);
}
.cc-col:hover::after, .cc-col:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.cc-col:first-child::after { left: 0; transform: translate(0, 4px); }
.cc-col:first-child:hover::after, .cc-col:first-child:focus-visible::after { transform: none; }
.cc-col:last-child::after { left: auto; right: 0; transform: translate(0, 4px); }
.cc-col:last-child:hover::after, .cc-col:last-child:focus-visible::after { transform: none; }
details.table-view .cols { margin-top: var(--s3); }

/* Primeiro uso */
.onboarding { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s5); margin-bottom: var(--s5); flex-wrap: wrap; border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.onboarding h2 { margin: 0 0 .2rem; }
.onboarding p { margin: 0; }

/* Dica do menu recolhido */
.sb-tip {
  position: fixed; z-index: 60; transform: translateY(-50%); padding: .35rem .6rem; border-radius: var(--radius-sm);
  background: var(--ink); color: var(--surface); font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; pointer-events: none;
  box-shadow: var(--shadow-md);
}
.sb-tip[hidden] { display: none; }

/* Navegação inferior (celular) */
.bottom-nav { display: none; }

/* ---------- Controles segmentados e abas ---------- */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-md); flex-wrap: wrap; }
.seg button, .seg a {
  font: inherit; font-size: var(--fs-sm); font-weight: 500; padding: .38rem .8rem; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.seg button:hover, .seg a:hover { color: var(--ink); }
.seg .active, .seg [aria-pressed="true"], .seg [aria-selected="true"] {
  background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
}

.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--line); margin-bottom: var(--s5); flex-wrap: wrap; }
.tabs.small { margin-bottom: var(--s3); }
.tab {
  padding: .6rem .9rem; text-decoration: none; color: var(--muted); border: 0; border-bottom: 2px solid transparent;
  margin-bottom: -1px; font: inherit; font-weight: 500; background: none; cursor: pointer; transition: color .15s ease, border-color .15s ease;
}
.tab:hover { color: var(--ink); }
.tab.active, .tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }

/* ---------- Gráficos ---------- */
.chart-card { padding: var(--s5); }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s2) var(--s5); flex-wrap: wrap; margin-bottom: var(--s3); }
.chart-head h2 { margin: 0; }
.chart-totals { display: flex; gap: var(--s2) var(--s6); flex-wrap: wrap; }
.chart-totals div { display: flex; flex-direction: column; }
.chart-totals span { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.chart-totals strong { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.legend { display: flex; gap: var(--s4); font-size: var(--fs-sm); color: var(--muted); align-items: center; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.key-bar { width: 10px; height: 10px; border-radius: 3px; background: var(--chart-revenue); }
.key-line { width: 16px; height: 2px; background: var(--chart-profit); position: relative; }
.key-line::after { content: ""; position: absolute; left: 5px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--chart-profit); }
.chart { position: relative; width: 100%; height: 300px; transition: opacity .2s ease; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart svg:focus { outline: none; }
.chart svg:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 4px; }
.chart.loading { opacity: .45; }
.c-grid { stroke: var(--chart-grid); stroke-width: 1; }
.c-zero { stroke: var(--line-strong); stroke-width: 1; }
.c-tick { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.c-bar { fill: var(--chart-revenue); }
.c-bar.partial { fill-opacity: .45; }
.c-line { fill: none; stroke: var(--chart-profit); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.c-dot { fill: var(--chart-profit); stroke: var(--surface); stroke-width: 2; }
.c-band { fill: transparent; }
.c-band.on { fill: var(--chart-hover); }
.c-cross { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.c-tip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 180px; max-width: 260px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); padding: .6rem .75rem; font-size: var(--fs-sm);
}
.c-tip .t-date { color: var(--muted); margin-bottom: .35rem; font-weight: 500; }
.c-tip .t-date::first-letter { text-transform: uppercase; }
.c-tip .t-row { display: flex; align-items: center; gap: .6rem; justify-content: space-between; padding: .05rem 0; }
.c-tip .t-row strong { font-variant-numeric: tabular-nums; font-weight: 700; }
.c-tip .t-key { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); }
.c-tip .t-key i { display: inline-block; width: 12px; height: 2px; }
.c-tip .t-key i.rev { height: 8px; width: 8px; border-radius: 2px; background: var(--chart-revenue); }
.c-tip .t-key i.pro { background: var(--chart-profit); }
.c-tip .t-note { color: var(--warn); margin-top: .35rem; }
.chart-empty { display: grid; place-items: center; height: 100%; color: var(--muted); text-align: center; padding: var(--s4); border: 1px dashed var(--line-strong); border-radius: var(--radius-md); }
details.table-view { margin-top: var(--s3); }
details.table-view summary { cursor: pointer; color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
details.table-view summary:hover { color: var(--ink); }
details.table-view .table-wrap { margin-top: var(--s3); }

/* Barras horizontais de produtos */
.product-views { margin-top: var(--s3); }
.hbars { list-style: none; margin: 0; padding: 0; }
.hbars li { padding: .65rem 0; }
.hbars li + li { border-top: 1px solid var(--line); }
.hbars .hb-top { display: flex; justify-content: space-between; gap: var(--s4); align-items: baseline; }
.hbars .hb-name { font-weight: 500; overflow-wrap: anywhere; }
.hbars .hb-name a { color: inherit; text-decoration: none; }
.hbars .hb-name a:hover { color: var(--brand-text); text-decoration: underline; }
.hbars .hb-val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbars .hb-meta { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.hbars .hb-track { height: 6px; background: var(--surface-3); border-radius: 999px; margin: .4rem 0 .25rem; overflow: hidden; }
.hbars .hb-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--chart-revenue); transition: width .5s var(--ease); }
.hbars.profit .hb-fill { background: var(--chart-profit); }
.hbars.neutral .hb-fill { background: var(--muted); opacity: .55; }
.hbars.neg .hb-fill { background: var(--neg); opacity: .75; }
.empty-state { color: var(--muted); padding: var(--s5) var(--s1); text-align: center; }

/* ---------- Tabelas ---------- */
.table-wrap {
  overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm), var(--card-highlight);
}
.block > table, .dialog table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: .75rem var(--s4); text-align: left; vertical-align: top; }
th {
  font-size: var(--fs-xs); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2);
}
.table-wrap thead th:first-child { border-top-left-radius: var(--radius); }
.table-wrap thead th:last-child { border-top-right-radius: var(--radius); }
tbody tr + tr td { border-top: 1px solid var(--line); }
tbody tr:hover td { background: var(--surface-2); }
td a { color: inherit; text-decoration: none; font-weight: 500; }
td a:hover { color: var(--brand-text); text-decoration: underline; }
tfoot td { border-top: 1px solid var(--line-strong); font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.empty { text-align: center; color: var(--muted); padding: 2rem; }
tbody tr:hover td.empty { background: none; }
tr.cancelled td { color: var(--muted); }
tr.cancelled td:nth-child(2) { text-decoration: line-through; }
tr.faint td { color: var(--muted); }
.truncate { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .link + .link { margin-left: .75rem; }
.bar-col { width: 30%; min-width: 90px; }
.bar { display: block; height: 6px; width: 0; background: var(--chart-revenue); border-radius: 999px; margin-top: .55rem; }

/* Paginação */
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--muted); flex-wrap: wrap; }
.pager-btns { display: flex; gap: var(--s2); }

/* Badges de status */
.tag {
  display: inline-flex; align-items: center; gap: .35rem; font-size: var(--fs-xs); padding: .15rem .55rem; border-radius: 999px;
  background: var(--pos-soft); color: var(--pos); font-weight: 600; white-space: nowrap;
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.down { background: var(--neg-soft); color: var(--neg); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.neutral { background: var(--surface-2); color: var(--muted); }

.summary-line { margin: var(--s1) 0 var(--s3); color: var(--ink-2); }

/* ---------- Formulários ---------- */
label { display: flex; flex-direction: column; gap: .35rem; font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); }
.label { font-size: var(--fs-sm); font-weight: 500; display: block; margin-bottom: .35rem; color: var(--ink-2); }
input, select, textarea {
  font: inherit; font-size: var(--fs-md); color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: .55rem .75rem; min-height: 42px; width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
input:disabled { background: var(--surface-2); color: var(--muted); }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); box-shadow: none; }
.big-input { font-size: 1.125rem; padding: .75rem .95rem; min-height: 52px; }

.filters { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-end; margin-bottom: var(--s4); }
.filters label { min-width: 150px; }
.filters .grow { flex: 1 1 240px; }
.period-bar { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); align-items: flex-end; margin-bottom: var(--s3); }
.period-bar .filters { margin: 0; }
.period-bar .filters label { min-width: 140px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }

/* ---------- Botões ---------- */
.btn {
  position: relative; font: inherit; font-size: var(--fs-md); font-weight: 600; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 42px; padding: .5rem 1.05rem; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.btn:hover { border-color: var(--muted); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); box-shadow: 0 1px 2px rgba(255, 31, 31, .25); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.danger { background: var(--surface); border-color: var(--neg); color: var(--neg); }
.btn.danger:hover { background: var(--neg-soft); }
.btn.big { min-height: 50px; padding: .65rem 1.4rem; font-size: 1.0625rem; }
.btn.block { width: 100%; }
.btn.sm { min-height: 34px; min-width: 34px; padding: 0 .55rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.is-loading { color: transparent !important; pointer-events: none; opacity: 1; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--ink); border-right-color: transparent; animation: spin .7s linear infinite;
}
.btn.primary.is-loading::after, .btn.danger.is-loading::after { border-color: #fff; border-right-color: transparent; }
.btn.danger.is-loading::after { border-color: var(--neg); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-text); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-weight: 500; }
.link:hover { text-decoration-thickness: 2px; }
.link.danger { color: var(--neg); }
td .link { color: var(--ink-2); text-decoration: none; }
td .link:hover { color: var(--brand-text); text-decoration: underline; }
td .link.danger { color: var(--neg); }
.actions { display: flex; justify-content: flex-end; gap: var(--s3); margin-top: var(--s4); flex-wrap: wrap; }
.form-error { color: var(--neg); margin: var(--s2) 0; font-size: var(--fs-sm); font-weight: 500; }
.notice { background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); padding: var(--s3) var(--s4); border-radius: var(--radius-sm); color: var(--ink); }
.notice code { display: block; background: var(--surface); padding: .45rem .65rem; margin: var(--s2) 0; border-radius: 6px; }
.info { background: var(--surface-2); border: 1px solid var(--line); padding: .65rem .9rem; border-radius: var(--radius-sm); font-size: var(--fs-sm); color: var(--ink-2); }

/* ---------- Tela de venda ---------- */
.sell { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(0, 1.15fr); gap: var(--s6); align-items: start; }
.sell-side { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.results { list-style: none; margin: var(--s1) 0 var(--s2); padding: var(--s1); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); max-height: 420px; overflow-y: auto; box-shadow: var(--shadow-sm); }
.results:empty { display: none; }
.results li { display: flex; justify-content: space-between; gap: var(--s3); padding: .65rem .75rem; cursor: pointer; border-radius: var(--radius-sm); }
.results li:hover, .results li.hl { background: var(--brand-soft); }
.results li.nostock { color: var(--muted); }
.results li.empty { cursor: default; color: var(--muted); }
.sell-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); padding: var(--s4) var(--s5) var(--s3); }
.sell-card-head h2 { margin: 0; font-size: var(--fs-md); }
.sell-cart { overflow: hidden; }
.cart-scroll { overflow-x: auto; border-top: 1px solid var(--line); }
.sell-cart table th:first-child, .sell-cart table td:first-child { padding-left: var(--s5); }
.qty-col { width: 150px; }
.qty { display: flex; gap: .25rem; align-items: center; }
.qty input { width: 64px; text-align: center; padding: .3rem; min-height: 34px; }
td.qty-col input[type=number] { max-width: 110px; }
.money-input { max-width: 130px; text-align: right; }
.sell-lines { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3) var(--s5) var(--s4); border-top: 1px solid var(--line); }
.sell-line { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); font-variant-numeric: tabular-nums; }
.sell-line label { flex-direction: row; align-items: center; gap: var(--s2); }
.sell-line input { width: 130px; text-align: right; }

/* Campo de leitura de código de barras */
.scan-field { padding: var(--s4); border-width: 1.5px; transition: border-color .2s ease, box-shadow .2s ease; }
.scan-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.scan-field.flash-ok { border-color: var(--pos); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pos) 25%, transparent); }
.scan-field.flash-bad { border-color: var(--neg); box-shadow: 0 0 0 4px color-mix(in srgb, var(--neg) 25%, transparent); }
.scan-label { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); margin-bottom: var(--s2); }
.scan-label label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.scan-mode { font-size: var(--fs-xs); font-weight: 600; color: var(--pos); display: inline-flex; align-items: center; gap: .35rem; }
.scan-mode::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.scan-row { display: flex; align-items: stretch; gap: var(--s2); }
.scan-ico { display: grid; place-items: center; width: 30px; flex: none; color: var(--brand); }
.scan-ico .ico { width: 28px; height: 28px; }
.scan-input {
  flex: 1; min-width: 0; min-height: 56px; font-size: 1.2rem; font-weight: 600; letter-spacing: .02em;
  font-variant-numeric: tabular-nums; border-width: 1.5px;
}
.scan-input::placeholder { font-weight: 400; letter-spacing: 0; font-size: .95rem; }
.scan-input { padding-left: .75rem; padding-right: .5rem; }
.scan-cam { min-height: 56px; padding: 0 .8rem; gap: .35rem; }
.scan-cam .ico { width: 22px; height: 22px; }
.scan-feedback { min-height: 1.5rem; margin-top: var(--s2); font-size: var(--fs-sm); font-weight: 600; display: flex; flex-wrap: wrap; gap: .25rem .6rem; align-items: center; }
.scan-feedback.ok { color: var(--pos); }
.scan-feedback.bad { color: var(--neg); }
.scan-feedback .link { font-size: var(--fs-sm); }
.sell-cart tr.just-added td { animation: added 1.2s ease-out; }
@keyframes added { from { background: color-mix(in srgb, var(--pos) 18%, transparent); } to { background: transparent; } }

/* Produtos: cadastro pelo código de barras e ajudas do formulário */
.register-scan { margin-bottom: var(--s5); max-width: 760px; }
.register-scan .muted { margin: var(--s1) 0 0; }
.register-scan:not(:focus-within) .scan-mode { display: none; } /* "Pronto para ler" só com o campo focado */
.margin-hint { margin: -.25rem 0 0; font-size: var(--fs-sm); font-weight: 600; min-height: 1.25rem; }
.margin-hint.ok { color: var(--pos); }
.margin-hint.bad { color: var(--neg); }
.margin-hint.muted { color: var(--muted); font-weight: 500; }
.margin-hint:empty { display: none; }
.form-error-box { margin: 0; padding: .6rem .8rem; border-radius: var(--radius-sm); background: var(--neg-soft); border: 1px solid color-mix(in srgb, var(--neg) 30%, transparent); }

/* ---------- Venda: layout limpo ---------- */
.sell-top { margin-bottom: var(--s4); }
.sell-top .scan-field { position: relative; }
.sell-top .results { position: absolute; left: var(--s4); right: var(--s4); top: calc(var(--s4) + 60px); z-index: 20; box-shadow: var(--shadow-md); }
.scan-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); min-height: 1.5rem; margin-top: var(--s2); }
.scan-foot .scan-feedback { margin: 0; }
.sell-help { margin: var(--s2) 0 0; }
kbd { font: 600 .75rem var(--font); padding: .05rem .35rem; border-radius: 4px; border: 1px solid var(--line-strong); background: var(--surface-2); }
.sell-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: var(--s4); align-items: start; }
.cart-empty { text-align: center; padding: var(--s8) var(--s4) !important; color: var(--muted); }
.cart-empty strong { display: block; color: var(--ink); font-size: var(--fs-lg); margin-bottom: .2rem; }
.cart-empty-ico { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); margin-bottom: var(--s3); }
.cart-empty-ico .ico { width: 30px; height: 30px; }
tbody tr:hover td.cart-empty { background: none; }
.sell-cart .pname { display: block; font-weight: 600; }
.pmeta { display: block; font-size: var(--fs-xs); color: var(--muted); font-weight: 400; margin-top: .1rem; }
.sell-cart td { vertical-align: middle; }
.add-discount { align-self: flex-start; font-size: var(--fs-sm); text-decoration: none; }
.add-discount:hover { text-decoration: underline; }

/* ---------- Produtos: layout limpo ---------- */
.scan-strip { display: flex; gap: var(--s4); align-items: flex-start; padding: var(--s4) var(--s5); margin-bottom: var(--s4); border-width: 1.5px; border-style: dashed; border-color: color-mix(in srgb, var(--brand) 35%, var(--line-strong)); transition: border-color .2s ease, box-shadow .2s ease; }
.scan-strip:focus-within { border-style: solid; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.scan-strip.flash-ok { border-style: solid; border-color: var(--pos); }
.scan-strip.flash-bad { border-style: solid; border-color: var(--neg); }
.scan-strip > .scan-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); margin-top: .1rem; }
.scan-strip-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s2); }
.scan-strip-main > label { display: block; font-size: var(--fs-md); font-weight: 500; color: var(--ink-2); }
.scan-strip .scan-input { min-height: 46px; font-size: 1rem; }
.scan-strip .scan-cam { min-height: 46px; }
.scan-strip .scan-feedback { margin: 0; min-height: 0; }
.list-toolbar { display: flex; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.list-toolbar .search-box { flex: 1 1 320px; }
.list-toolbar select { width: auto; min-width: 200px; }
.filter-chips { margin-bottom: var(--s4); max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }
.products-table td { vertical-align: middle; }
.products-table .pname { font-weight: 600; display: block; }
tr.clickable { cursor: pointer; }
.products-table .row-actions { display: flex; gap: var(--s2); justify-content: flex-end; align-items: center; }
.row-menu { position: relative; }
.row-menu > summary { list-style: none; cursor: pointer; font-size: 1.1rem; line-height: 1; width: 34px; padding: 0; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 210px; padding: var(--s1);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; animation: pop .12s var(--ease);
}
.row-menu-pop button, .row-menu-pop a {
  display: block; text-align: left; padding: .55rem .7rem; border-radius: var(--radius-sm); border: 0; background: none;
  font: inherit; font-size: var(--fs-sm); color: var(--ink-2); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.row-menu-pop button:hover, .row-menu-pop a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.row-menu-pop .danger { color: var(--neg); }

/* Formulários em blocos */
dialog.wide { width: min(680px, calc(100vw - 2rem)); }
.price-input { font-size: 1.15rem; font-weight: 600; }
.form-group { border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--s3) var(--s4) var(--s4); margin: 0; display: flex; flex-direction: column; gap: var(--s3); }
.form-group legend { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); padding: 0 .35rem; }
.form-more { border-top: 1px solid var(--line); padding-top: var(--s3); }
.form-more summary { cursor: pointer; font-weight: 600; font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: var(--s3); }
.form-more:not([open]) summary { margin-bottom: 0; }

/* Atalhos do painel inicial */
.quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.qa {
  display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; min-width: 0;
  transition: border-color .15s ease, transform .15s var(--ease), box-shadow .15s ease;
}
.qa:hover { border-color: var(--brand); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.qa > .ico { width: 22px; height: 22px; color: var(--brand); flex: none; }
.qa span { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.qa strong { font-weight: 600; font-size: var(--fs-md); }
.qa small { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qa-main { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }

/* Estoque: painel */
.stock-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); margin-bottom: var(--s5); }
.ss { padding: var(--s4) var(--s5); display: flex; flex-direction: column; gap: .15rem; color: inherit; text-decoration: none; min-width: 0; }
a.ss:hover { border-color: var(--line-strong); }
.ss span { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.ss strong { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.ss small { font-size: var(--fs-xs); color: var(--muted); }
.ss.is-bad strong { color: var(--neg); }
.ss.is-warn strong { color: var(--warn); }
.stock-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.stock-table .pname { font-weight: 600; }
.stock-table td { vertical-align: middle; }
.stock-qty { font-size: 1.1rem; font-weight: 700; }
.actions-col { text-align: right; width: 1%; white-space: nowrap; }
.stock-actions { display: inline-flex; gap: var(--s2); flex-wrap: nowrap; justify-content: flex-end; }
.stock-actions .btn.sm { min-height: 34px; padding: 0 .7rem; font-size: var(--fs-sm); }
.btn.act-in { color: var(--pos); border-color: color-mix(in srgb, var(--pos) 45%, var(--line-strong)); }
.btn.act-in:hover { background: var(--pos-soft); border-color: var(--pos); }
.btn.act-out { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 45%, var(--line-strong)); }
.btn.act-out:hover { background: var(--neg-soft); border-color: var(--neg); }
.product-strip { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: var(--s3) var(--s5); margin-bottom: var(--s4); }
.product-strip > div:first-child { display: flex; flex-direction: column; }

/* Fornecedores */
.supplier-card { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: var(--s5); padding: var(--s5); margin-bottom: var(--s6); }
.supplier-card h2 { margin-bottom: var(--s2); }
.sc-notes { margin-top: var(--s3); padding: .6rem .8rem; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-sm); }
.sc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.sc-stats div { display: flex; flex-direction: column; padding: var(--s3); border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--line); }
.sc-stats span { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }
.sc-stats strong { font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.contact-cell { font-size: var(--fs-sm); color: var(--ink-2); }
.contact-cell span { display: block; }
.supplier-filter { margin-bottom: var(--s4); max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }

/* Campo com botão ao lado (código de barras no cadastro, busca de produtos, localizar no estoque) */
.input-with-btn { display: flex; gap: var(--s2); align-items: stretch; }
.input-with-btn input { flex: 1; min-width: 0; }
.input-with-btn .icon-btn { width: 42px; height: auto; min-height: 42px; flex: none; }
.icon-text .ico { width: 20px; height: 20px; }
.locate { padding: var(--s4) var(--s5); margin: var(--s3) 0 var(--s5); }
.locate .muted { margin: var(--s2) 0 0; }

/* Leitor pela câmera */
.scan-dialog { width: min(520px, calc(100vw - 1.5rem)); }
.scan-box { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); }
.scan-head { display: flex; justify-content: space-between; align-items: center; }
.scan-head h2 { margin: 0; font-size: 1.15rem; }
.scan-head .icon-btn { font-size: 1.3rem; }
.scan-view { position: relative; width: 100%; min-height: 240px; border-radius: var(--radius-md); overflow: hidden; background: #0B0B0B; display: grid; place-items: center; }
.scan-view video { display: block; width: 100% !important; height: auto !important; }
.scan-wait { color: #A1A1AA; margin: 0; }
.scan-status { margin: 0; font-weight: 600; min-height: 1.5rem; color: var(--ink-2); }
.scan-status.ok { color: var(--pos); }
.scan-status.bad { color: var(--neg); }
.scan-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.scan-cont { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }

/* Linha de total (telas de compra e reposição) */
.sell-total { display: flex; justify-content: space-between; align-items: baseline; padding: var(--s4) 0 0; border-top: 1px solid var(--line-strong); margin-top: var(--s4); }
.sell-total span { font-weight: 600; color: var(--ink-2); }
.sell-total strong { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.035em; }

/* Forma de pagamento */
.pay { padding-bottom: var(--s4); }
.pay-methods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); padding: 0 var(--s5); }
.pay-opt { position: relative; display: block; }
.pay-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pay-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; min-height: 78px; padding: .6rem .4rem;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); color: var(--ink-2);
  font-size: var(--fs-sm); font-weight: 600; text-align: center; line-height: 1.2; cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.pay-tile .ico { width: 24px; height: 24px; color: var(--muted); }
.pay-opt:hover .pay-tile { border-color: var(--muted); }
.pay-opt input:checked + .pay-tile { border-color: var(--brand); background: var(--brand-soft); color: var(--ink); }
.pay-opt input:checked + .pay-tile .ico { color: var(--brand); }
.pay-opt input:focus-visible + .pay-tile { outline: 2px solid var(--brand); outline-offset: 2px; }
.pay-detail { padding: var(--s4) var(--s5) 0; }
.pay-detail p { margin: 0; }
.big-money { max-width: 220px; font-size: 1.25rem; font-weight: 600; min-height: 50px; }
.cash-quick { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.chip-btn {
  font: inherit; font-size: var(--fs-sm); font-weight: 600; padding: .45rem .8rem; min-height: 38px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.chip-btn:hover { border-color: var(--brand); }
.change-line { margin-top: var(--s3) !important; font-size: var(--fs-lg); color: var(--ink-2); }
.change-line strong { color: var(--pos); font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.change-line.bad { color: var(--neg); font-size: var(--fs-sm); font-weight: 600; }

/* Barra de fechamento: fixa no rodapé da tela de venda, com o botão principal grande */
.checkout-bar {
  position: fixed; left: var(--sidebar); right: 0; bottom: 0; z-index: 25;
  display: flex; align-items: center; gap: var(--s4) var(--s6); flex-wrap: wrap;
  padding: var(--s3) var(--s8) calc(var(--s3) + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0, 0, 0, .06);
  transition: left .2s var(--ease);
}
.co-total, .co-change { display: flex; flex-direction: column; line-height: 1.15; }
.co-label { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.co-total strong { font-size: 2rem; font-weight: 700; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.co-sub { font-size: var(--fs-sm); color: var(--muted); }
.co-change strong { font-size: 1.5rem; font-weight: 700; color: var(--pos); font-variant-numeric: tabular-nums; }
.co-actions { margin-left: auto; display: flex; gap: var(--s3); align-items: center; }
.co-actions #clear { min-height: 56px; }
.co-finish { min-height: 56px; min-width: 260px; font-size: 1.125rem; padding: 0 1.75rem; border-radius: var(--radius-md); }
.co-finish .ico { width: 22px; height: 22px; stroke-width: 2.4; }
body[data-page="vender"] .content { padding-bottom: 8rem; }
.del-col { width: 1%; }
.del-btn { width: 34px; height: 34px; font-size: 1.15rem; line-height: 1; color: var(--muted); }
.del-btn:hover { color: var(--neg); border-color: var(--neg); }

/* Vendas: resumo por forma de pagamento (fechamento do caixa) */
.pay-summary { padding: var(--s4) var(--s5) var(--s5); margin-bottom: var(--s5); }
.ps-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2) var(--s4); flex-wrap: wrap; margin-bottom: var(--s3); }
.ps-head h2 { margin: 0; font-size: var(--fs-md); }
.ps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s2); }
.ps-item {
  display: flex; flex-direction: column; gap: .1rem; padding: var(--s3) var(--s4); border-radius: var(--radius-md);
  border: 1px solid var(--line); background: var(--surface-2); color: inherit; text-decoration: none; min-height: 84px;
  transition: border-color .15s ease;
}
a.ps-item:hover { border-color: var(--line-strong); }
.ps-item.active { border-color: var(--brand); background: var(--brand-soft); }
.ps-item strong { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ps-label { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.ps-meta { font-size: var(--fs-xs); color: var(--muted); }
.ps-total { background: var(--surface); border-style: dashed; }
.pay-info { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s6); margin: 0; padding: var(--s3) 0 0; }
.pay-info div { display: flex; flex-direction: column; }
.pay-info dt { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.pay-info dd { margin: 0; font-weight: 600; }
td.nowrap { white-space: nowrap; }

/* ---------- Configurações ---------- */
.settings { max-width: 680px; display: flex; flex-direction: column; gap: var(--s5); }
.settings fieldset {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: var(--s5); margin: 0;
  display: flex; flex-direction: column; gap: var(--s4); box-shadow: var(--shadow-sm), var(--card-highlight);
}
.settings legend { float: left; width: 100%; font-weight: 600; font-size: var(--fs-lg); padding: 0; margin-bottom: var(--s1); color: var(--ink); letter-spacing: -0.01em; }
.settings .hint { font-size: var(--fs-sm); color: var(--muted); font-weight: 400; }
.settings .confirm { border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }

/* ---------- Diálogo e avisos ---------- */
dialog {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 0; width: min(560px, calc(100vw - 2rem));
  color: var(--ink); background: var(--surface); box-shadow: var(--shadow-md);
}
dialog[open] { animation: pop .16s var(--ease); }
dialog::backdrop { background: rgba(5, 5, 5, .55); }
.dialog { padding: var(--s6); display: flex; flex-direction: column; gap: var(--s3); }
.dialog h2 { font-size: 1.25rem; font-weight: 700; margin: 0; }
.dialog-body { display: flex; flex-direction: column; gap: var(--s3); max-height: 65vh; overflow-y: auto; }

.toasts { position: fixed; right: var(--s4); bottom: 7rem; /* acima do botão "Nova venda" */ display: flex; flex-direction: column; gap: var(--s2); z-index: 100; max-width: min(420px, calc(100vw - 2rem)); }
.toast {
  display: flex; align-items: flex-start; gap: .6rem; padding: .8rem 1rem; border-radius: var(--radius-md);
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-md);
  font-weight: 500; animation: pop .18s var(--ease);
}
.toast::before { content: "✓"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none; font-size: .75rem; font-weight: 700; background: var(--pos-soft); color: var(--pos); }
.toast.error::before { content: "!"; background: var(--neg-soft); color: var(--neg); }
.toast.error { border-color: color-mix(in srgb, var(--neg) 35%, var(--line)); }

/* ---------- Login ---------- */
.login-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.login-brand {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 3rem; background: var(--brand-panel); color: var(--on-brand);
}
.login-brand::after {
  content: ""; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 31, 31, .35), rgba(255, 106, 0, .12) 45%, transparent 70%);
}
.login-brand .logo { color: #fff; }
.logo-lg .logo-symbol { width: 44px; height: 44px; }
.logo-lg .logo-word { font-size: 1.75rem; }
.login-pitch { position: relative; z-index: 1; max-width: 460px; }
.login-kicker { color: #FF6A00; font-weight: 600; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .1em; margin-bottom: var(--s3); }
.login-pitch h2 { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; margin-bottom: var(--s5); color: #fff; }
.login-pitch ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--s3); color: #D4D4D8; }
.login-pitch li { display: flex; gap: .6rem; align-items: center; }
.login-pitch li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); flex: none; }
.login-box { align-self: center; justify-self: center; width: min(400px, 100%); padding: var(--s8) var(--s5); }
.login-box h1 { font-size: 1.75rem; }
.login-box > .muted { margin: var(--s1) 0 0; }
.login-box form { display: flex; flex-direction: column; gap: var(--s4); margin-top: var(--s6); }
.login-box .notice { margin-top: var(--s4); }
.login-mobile-logo { display: none; margin-bottom: var(--s6); }
.login-foot { margin-top: var(--s8); text-align: center; }

/* ---------- Telas menores ---------- */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sell-grid { grid-template-columns: minmax(0, 1fr) minmax(280px, .9fr); }
  .quick-actions, .stock-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid.main, .dash-grid.secondary { grid-template-columns: 1fr; }
  .sk-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .cols, .sell { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-mobile-logo { display: inline-flex; }
}
@media (max-width: 760px) {
  :root { --topbar: 58px; }
  .topbar { margin-left: 0; padding: 0 var(--s3); gap: var(--s2); }
  .menu-toggle { display: inline-grid !important; }
  .fab-sell { display: none; } /* no celular, "Nova venda" fica no centro da barra inferior */
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line); padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom, 0px));
  }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .3rem 0; min-height: 48px; justify-content: center;
    color: var(--muted); text-decoration: none; font: 500 .6875rem var(--font); background: none; border: 0; cursor: pointer;
  }
  .bottom-nav a.active { color: var(--brand-text); }
  .bottom-nav a.active .ico { stroke-width: 2.1; }
  .bn-fab {
    width: 62px; height: 62px; margin-top: -30px; border-radius: 50%; display: grid; place-items: center; color: #fff;
    background: linear-gradient(135deg, #FF5A14 0%, #FF1F1F 45%, #D80F0F 100%);
    box-shadow: 0 8px 22px rgba(255, 31, 31, .45), 0 0 0 4px var(--surface);
  }
  .bn-fab .ico { width: 30px; height: 30px; stroke-width: 2.6; }
  .bottom-nav .bn-sell { color: var(--brand-text); font-weight: 700; }
  .content { padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px)) !important; }
  .toasts { bottom: calc(5rem + env(safe-area-inset-bottom, 0px)); }
  .mini-stats { grid-template-columns: 1fr; }
  body[data-page="vender"] .bottom-nav { display: none; } /* a barra de fechamento ocupa o rodapé */
  body[data-page="vender"] .content { padding-bottom: 11rem !important; }
  .checkout-bar { left: 0; padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom, 0px)); gap: var(--s2) var(--s4); }
  .co-total strong { font-size: 1.6rem; }
  .co-actions { width: 100%; margin-left: 0; }
  .co-actions #clear { min-height: 54px; }
  .co-finish { flex: 1; min-width: 0; min-height: 54px; }
  .pay-methods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sell-grid { grid-template-columns: 1fr; }
  .scan-strip > .scan-ico { display: none; }
  .scan-strip { padding: var(--s4); }
  .list-toolbar select { width: 100%; }
  .products-table th:nth-child(2), .products-table td:nth-child(2) { display: none; } /* preço fica no formulário */
  .stock-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
  .supplier-card { grid-template-columns: 1fr; }
  .stock-actions { flex-wrap: wrap; }
  .stock-actions .btn.sm { padding: 0 .55rem; }
  .scan-ico { display: none; }
  .scan-input::placeholder { font-size: .84rem; }
  .scan-cam span, .icon-text span { display: none; }
  .scan-cam { padding: 0 .85rem; }
  .sell-cart .qty-col { width: auto; }
  .sell-cart .qty { gap: 3px; }
  .sell-cart .qty .btn.sm { min-height: 36px; height: 36px; min-width: 32px; width: 32px; padding: 0; }
  .sell-cart .qty input { width: 40px; min-height: 36px; height: 36px; padding: 0; }
  .sell-cart th, .sell-cart td { padding-left: .4rem; padding-right: .4rem; }
  .sell-cart .del-btn { width: 32px; height: 32px; }
  .sell-cart table th:first-child, .sell-cart table td:first-child { padding-left: var(--s4); }
  .pay-tile { min-height: 64px; flex-direction: row; }
  .attention > li { grid-template-columns: 1fr; padding: var(--s4); }
  .attention .a-action { justify-self: start; }
  .goal-edit { width: 100%; }
  .profile-name, .profile-btn .chevron { display: none; }
  .profile-btn { padding: 0 3px; }
  #page-context { display: none; }
  .sidebar { width: 272px; transform: translateX(-100%); box-shadow: var(--shadow-md); }
  .sidebar.open { transform: none; }
  .sb-foot { display: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(5, 5, 5, .45); z-index: 35; }
  .scrim[hidden] { display: none; }
  .content { margin-left: 0; padding: var(--s4) var(--s4) 3rem; }
  .kpis, .kpis.two { gap: var(--s3); }
  .kpi { padding: var(--s4); }
  .kpi .value { font-size: 1.35rem; }
  .kpi .sub { display: none; }
  .kpi-icon { width: 30px; height: 30px; }
  .figures > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .row2 { grid-template-columns: 1fr; }
  .filters label { min-width: 0; flex: 1 1 140px; }
  .truncate { max-width: 160px; }
  th, td { padding: .6rem .65rem; }
  .chart { height: 240px; }
  .btn, input, select { min-height: 44px; } /* alvos de toque confortáveis */
  .sk-wide { height: 220px; }
}
@media (max-width: 480px) {
  .kpi .kpi-icon { display: none; }
  .kpi .label { font-size: var(--fs-xs); }
  .kpi-foot .meta { font-size: var(--fs-xs); }
}
@media (max-width: 380px) {
  .kpis, .kpis.two { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Logo da loja (plano Premium) e aviso de assinatura ---- */
.store-logo { display: block; max-width: 100%; max-height: 52px; object-fit: contain; margin: 0 auto .4rem; border-radius: 6px; }
.sb-store:has(.store-logo:not([hidden])) { white-space: normal; text-align: center; }
.sb-store:has(.store-logo:not([hidden]))::before { display: none; }
:root[data-sidebar="collapsed"] .store-logo { display: none; }
.billing-banner { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap;
  margin: var(--s3) var(--s4) 0; padding: .7rem 1rem; border-radius: var(--radius-sm); background: var(--warn-soft);
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); color: var(--ink); font-size: var(--fs-sm); }
@media (min-width: 901px) { .billing-banner { margin-left: calc(var(--sidebar) + var(--s4)); } }
:root[data-sidebar="collapsed"] .billing-banner { margin-left: calc(var(--sidebar-collapsed) + var(--s4)); }
.report-brand { display: flex; align-items: center; gap: var(--s3); }
.report-brand img { max-height: 44px; max-width: 160px; object-fit: contain; }
.report-brand .rb-store { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.logo-field { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.logo-preview { width: 160px; height: 72px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted); font-size: var(--fs-xs); overflow: hidden; }
.logo-preview img { width: auto; height: auto; max-width: 152px; max-height: 64px; object-fit: contain; }
.settings + .settings { margin-top: var(--s5); }
.logo-field label.btn { flex-direction: row; cursor: pointer; }
.logo-field label.btn:focus-within { box-shadow: 0 0 0 3px var(--brand-ring); }
.premium-tag { display: inline-block; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--brand-text); background: var(--brand-soft); padding: .1rem .5rem; border-radius: 999px; margin-left: .4rem; vertical-align: middle; }

/* ---- Impressão (relatórios): só o conteúdo, com a marca da loja ---- */
@media print {
  .sidebar, .topbar, .fab-sell, .bottom-nav, .toasts, .billing-banner, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .content { margin: 0 !important; padding: 0 !important; }
  .card { box-shadow: none !important; break-inside: avoid; }
}

/* ---- Fase comercial: teste grátis e recursos Premium ---- */
.billing-banner.urgent { background: var(--neg-soft); border-color: color-mix(in srgb, var(--neg) 30%, transparent); }
.upsell { display: grid; gap: var(--s2); justify-items: start; margin-block: var(--s4); border: 1px dashed color-mix(in srgb, var(--brand) 40%, transparent); }
.upsell h2 { margin: 0; }
.upsell p { margin: 0; }
.sb-nav a.is-premium::after { content: "★"; flex: none; margin-left: auto; color: var(--brand); font-size: .8rem; }
:root[data-sidebar="collapsed"] .sb-nav a.is-premium::after { display: none; }
.whats-solid { background: #1FAF54; border-color: #1FAF54; color: #fff; }
.whats-solid:hover { background: #178F44; border-color: #178F44; }

/* Toda a área dos campos nativos de data/hora abre o seletor. */
input:is([type="date"],[type="datetime-local"],[type="month"],[type="week"],[type="time"]):not(:disabled):not([readonly]) { cursor: pointer; }

/* ---- Evolução de UX do PDV ---- */
/* No painel, "Nova venda" já é o primeiro atalho: o botão flutuante não cobre o conteúdo. */
body[data-page="inicio"] .fab-sell { display: none; }
.kpi .partial-tag { display: inline-block; margin-left: .5rem; padding: .1rem .45rem; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: var(--fs-xs); font-weight: 600; vertical-align: middle; letter-spacing: 0; }
.kpi.is-partial .value { color: var(--ink-2); }

/* Venda: maquininha escolhida e tela de conclusão. */
.pay-terminal { margin-top: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.pay-terminal select { width: 100%; }
.terminal-note { margin: 0; min-height: 1.2em; }
.terminal-note .warn { color: var(--warn); }
.sale-done-dialog { width: min(420px, calc(100vw - 2rem)); }
.sale-done-dialog .dialog > h2 { text-align: center; }
.sale-done { display: flex; flex-direction: column; align-items: center; gap: var(--s1); text-align: center; }
.sale-done p { margin: 0; }
.sale-done-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--pos-soft); color: var(--pos); font-size: 28px; font-weight: 700; margin-bottom: var(--s2); }
.sale-done-total { font-size: 2rem; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.sale-done-change { font-size: var(--fs-lg); }
.sale-done .link { margin-top: var(--s2); }
.sale-done-dialog .actions { justify-content: stretch; }
.sale-done-dialog .actions .btn { flex: 1; min-height: 48px; }

/* Recibo do PDV: tela e impressão (58 mm, 80 mm e A4) pelo navegador. */
.receipt-tools { display: flex; gap: var(--s3); align-items: flex-end; flex-wrap: wrap; }
.receipt-tools label { flex: 1; min-width: 160px; }
.pdv-receipt { width: min(300px, 100%); margin: var(--s2) auto 0; padding: var(--s4); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); font-size: var(--fs-sm); color: var(--ink); background: var(--surface); }
.pdv-receipt header { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; margin-bottom: var(--s3); }
.pdv-receipt .pr-store { font-size: var(--fs-lg); overflow-wrap: anywhere; }
.pdv-receipt .pr-cancelled { text-align: center; font-weight: 700; color: var(--neg); border: 1px solid var(--neg); padding: 2px; }
.pdv-receipt table { width: 100%; border: 0; border-collapse: collapse; background: transparent; }
.pdv-receipt th, .pdv-receipt td { padding: 4px 0; border-bottom: 1px dashed var(--line); text-align: left; font-size: inherit; background: transparent; text-transform: none; letter-spacing: 0; color: inherit; vertical-align: top; }
.pdv-receipt td small { display: block; color: var(--muted); }
.pdv-receipt .num { text-align: right; white-space: nowrap; }
.pdv-receipt dl { margin: var(--s3) 0; display: grid; gap: 2px; }
.pdv-receipt dl > div { display: flex; justify-content: space-between; gap: var(--s3); }
.pdv-receipt dd { margin: 0; text-align: right; }
.pdv-receipt .pr-total { font-weight: 700; font-size: 1.15em; }
.pdv-receipt footer { font-size: .85em; color: var(--muted); text-align: center; border-top: 1px dashed var(--line); padding-top: var(--s2); }
@media print {
  @page { size: auto; margin: 0; }
  body.pdv-printing { background: #fff !important; }
  body.pdv-printing > :not(dialog.receipt-dialog) { display: none !important; }
  body.pdv-printing dialog.receipt-dialog { display: block !important; position: static !important; margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; width: auto !important; max-width: none !important; max-height: none !important; background: #fff !important; animation: none !important; overflow: visible !important; }
  body.pdv-printing dialog::backdrop { background: transparent; }
  body.pdv-printing .dialog { padding: 0 !important; }
  body.pdv-printing .dialog > h2, body.pdv-printing .actions, body.pdv-printing .no-print, body.pdv-printing .form-error { display: none !important; }
  body.pdv-printing .dialog-body { max-height: none !important; overflow: visible !important; }
  body.pdv-printing .pdv-receipt { border: 0; border-radius: 0; color: #000 !important; background: #fff !important; margin: 0; }
  body.pdv-printing .pdv-receipt * { color: #000 !important; }
  body.pdv-print-58 .pdv-receipt { width: 54mm; padding: 2mm; font-size: 10.5px; }
  body.pdv-print-80 .pdv-receipt { width: 76mm; padding: 2mm; font-size: 12px; }
  body.pdv-print-a4 .pdv-receipt { width: 180mm; padding: 15mm; font-size: 14px; }
}

/* Maquininhas. */
.kpis.kpis-compact { margin-bottom: var(--s5); }
.kpis.kpis-compact .kpi .value { font-size: 1.5rem; }
.terminals-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; margin-bottom: var(--s5); }
.terminals-grid h2, .card-pad > h2 { font-size: var(--fs-lg); margin: 0 0 var(--s3); }
.terminal-list, .rate-list, .receivable-list { list-style: none; margin: 0; padding: 0; }
.terminal-list li, .rate-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.terminal-list li:last-child, .rate-list li:last-child { border-bottom: 0; }
.terminal-list small, .rate-list small { display: block; color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.terminal-actions { display: flex; gap: var(--s2); flex-shrink: 0; }
.cmp-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); align-items: end; }
.cmp-form .btn { grid-column: 1 / -1; }
#cmp-result { margin-top: var(--s4); }
.cmp-table { width: 100%; }
.cmp-table td small { display: block; color: var(--muted); }
.cmp-table tr.is-best td { background: var(--pos-soft); }
.cmp-table .tag { margin: 4px 4px 0 0; display: inline-block; }
.receivable-list li { display: grid; grid-template-columns: 120px 1fr auto; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--line); align-items: center; }
@media (max-width: 860px) { .terminals-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .cmp-form { grid-template-columns: 1fr; } .terminal-list li { flex-wrap: wrap; } }
.login-forgot { margin: var(--s3) 0 0; text-align: center; font-size: var(--fs-sm); }
.login-forgot a { color: var(--brand-text); font-weight: 600; }
.notice.ok { background: var(--pos-soft); color: var(--pos); border: 1px solid color-mix(in srgb, var(--pos) 30%, transparent); padding: var(--s3); border-radius: var(--radius-md); }

/* Semântica dos produtos: destaque pequeno, superfícies neutras. */
.kpi.tone-positive .kpi-icon{color:var(--pos);background:var(--pos-soft);border:0}
.kpi.tone-info .kpi-icon{color:var(--info);background:var(--info-soft);border:0}
.kpi.tone-analysis .kpi-icon{color:var(--analysis);background:var(--analysis-soft);border:0}
nav a[href="#/relatorios"].active .ico{color:var(--analysis)}
.sell-total strong{color:var(--ink)}
