/*
 * Design system Liquid Glass — Revvo (identidade: azul-marinho #0B1220, vermelho #E30613, cinzas #6B7280/#E5E7EB).
 * Um arquivo só (sem build). Ordem: fonte → tokens (claro/escuro) → base → componentes → layouts.
 * Regras do efeito (planejamento, seção 5):
 *  - vidro só em superfícies que flutuam; no máximo duas camadas sobrepostas;
 *  - texto sempre sobre base opaca o bastante para contraste AA;
 *  - sem backdrop-filter, ou com prefers-reduced-transparency → superfície sólida;
 *  - prefers-reduced-motion → só mudança de opacidade.
 */

/* ---------- Fonte ---------- */
@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-latin-wght.woff") format("woff");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens: tema claro (padrão) ---------- */
:root {
  color-scheme: light;
  --bg-base: #f3f4f6;
  --bg-gradient: radial-gradient(circle at 12% 18%, rgb(11 18 32 / 0.10), transparent 42%),
    radial-gradient(circle at 88% 82%, rgb(227 6 19 / 0.09), transparent 45%);
  --surface-glass: rgb(255 255 255 / 0.68);
  --surface-glass-strong: rgb(255 255 255 / 0.84);
  --surface-solid: #ffffff;
  --surface-sunken: #e5e7eb;
  --border-glass: rgb(255 255 255 / 0.6);
  --border-subtle: rgb(11 18 32 / 0.12);
  --highlight: linear-gradient(180deg, rgb(255 255 255 / 0.7), rgb(255 255 255 / 0) 40%);
  --text: #0b1220;
  --text-muted: #555c69; /* cinza de apoio da marca (#6B7280) escurecido: ≥ 5:1 sobre o fundo e o cinza das abas */
  /* Revvo: vermelho #E30613 nas ações (texto branco a 4,9:1); azul-marinho #0B1220 dá a solidez da marca */
  --primary: #e30613;
  --primary-hover: #b8050f;
  --primary-fg: #ffffff;
  --link: #c0050f; /* vermelho da marca um tom abaixo: ≥ 5:1 em texto corrido sobre o fundo */
  --accent: #0b1220;
  --accent-fg: #ffffff;
  --navy: #0b1220;
  /* Marca (avatar, logotipo, botão central): fixo nos dois temas, texto branco ≥ 4,9:1 */
  --brand-gradient: linear-gradient(135deg, #e30613, #9f0410);
  --brand-navy: linear-gradient(135deg, #1b2740, #0b1220);
  --success: #15803d;
  --warning: #b45309;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-fg: #ffffff;
  --focus: #0b1220;
  --shadow-float: 0 1px 2px rgb(15 23 42 / 0.06), 0 8px 24px rgb(15 23 42 / 0.10);
  --scrim: rgb(15 23 42 / 0.45);

  /* Status (fundo claro + texto escuro passam AA nos dois temas) */
  --status-draft-bg: #e2e8f0;      --status-draft-fg: #334155;
  --status-available-bg: #dcfce7;  --status-available-fg: #166534;
  --status-reserved-bg: #fef3c7;   --status-reserved-fg: #92400e;
  --status-sold-bg: #dbeafe;       --status-sold-fg: #1e40af;
  --status-archived-bg: #f1f5f9;   --status-archived-fg: #475569;
  --status-info-bg: #e6e9f0;       --status-info-fg: #1b2740;
  --status-danger-bg: #fee2e2;     --status-danger-fg: #991b1b;

  --blur-sm: 8px;
  --blur-md: 16px;
  --blur-lg: 24px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-6: 24px; --space-8: 32px; --space-12: 48px; --space-16: 64px;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --text-xs: 12px; --text-sm: 14px; --text-md: 16px; --text-lg: 18px; --text-xl: 20px;
  --text-2xl: 24px; --text-3xl: 30px; --text-4xl: 36px; --text-5xl: 48px;
  --dur-micro: 150ms;
  --dur-enter: 220ms;
  --dur-panel: 320ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --sidebar-width: 248px;
  --sidebar-collapsed: 76px;
  --bottomnav-height: 64px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-gradient), var(--bg-base);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; }
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
p { margin: 0; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; display: block; }
code, kbd, .mono { font-family: var(--font-mono); font-size: 0.92em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: rgb(227 6 19 / 0.22); }
[hidden] { display: none !important; }
.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 100;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  background: var(--surface-solid); color: var(--text); font-weight: 600;
}
.skip-link:focus { top: var(--space-4); }
.stack { display: grid; gap: var(--space-4); }
.stack-sm { display: grid; gap: var(--space-2); }
.stack-lg { display: grid; gap: var(--space-8); }
.row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.grid-cards { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }

/* ---------- Vidro ---------- */
.glass, .glass-card, .glass-panel {
  position: relative;
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(var(--blur-md)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(140%);
}
.glass::before, .glass-card::before, .glass-panel::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--highlight); pointer-events: none;
}
.glass-strong, .glass-card.is-strong, .glass-panel { background: var(--surface-glass-strong); }
.glass-card { padding: var(--space-6); }
.glass-panel { padding: var(--space-6); border-radius: var(--radius-xl); }
.glass-card > *, .glass-panel > * { position: relative; }
/* Menu aberto dentro de um cartão fica acima dos cartões seguintes. */
.glass-card:has([aria-expanded="true"]), .glass-panel:has([aria-expanded="true"]) { z-index: 10; }
.glass-card.is-interactive {
  transition: transform var(--dur-micro) var(--ease), box-shadow var(--dur-micro) var(--ease);
  cursor: pointer;
}
.glass-card.is-interactive:hover { transform: translateY(-2px); box-shadow: var(--shadow-float), 0 12px 32px rgb(15 23 42 / 0.12); }
.surface-solid { background: var(--surface-solid); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .glass-card, .glass-panel, .sidebar, .bottomnav, .topbar, .dialog, .menu, .toast { background: var(--surface-solid); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass, .glass-card, .glass-panel, .sidebar, .bottomnav, .topbar, .dialog, .menu, .toast {
    background: var(--surface-solid); backdrop-filter: none; -webkit-backdrop-filter: none;
  }
}

/* ---------- Botões ---------- */
.btn {
  --btn-bg: var(--primary); --btn-fg: var(--primary-fg); --btn-border: transparent; --btn-hover: var(--primary-hover);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-4);
  border: 1px solid var(--btn-border); border-radius: var(--radius-md);
  background: var(--btn-bg); color: var(--btn-fg);
  font: inherit; font-weight: 600; font-size: var(--text-sm); line-height: 1; text-decoration: none;
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: background-color var(--dur-micro) var(--ease), transform var(--dur-micro) var(--ease), box-shadow var(--dur-micro) var(--ease);
}
.btn:hover { background: var(--btn-hover); }
.btn:active { transform: scale(0.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.is-loading { color: transparent; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--btn-fg); border-right-color: transparent; animation: spin 0.8s linear infinite;
}
.btn-secondary { --btn-bg: var(--surface-solid); --btn-fg: var(--text); --btn-border: var(--border-subtle); --btn-hover: var(--surface-sunken); }
.btn-glass {
  --btn-bg: var(--surface-glass); --btn-fg: var(--text); --btn-border: var(--border-glass); --btn-hover: var(--surface-glass-strong);
  backdrop-filter: blur(var(--blur-sm)); -webkit-backdrop-filter: blur(var(--blur-sm));
}
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--text); --btn-hover: rgb(100 116 139 / 0.14); }
.btn-danger { --btn-bg: var(--danger); --btn-fg: var(--danger-fg); --btn-hover: var(--danger-hover); }
.btn-sm { min-height: 44px; padding: 0 var(--space-3); font-size: var(--text-xs); }
.btn-lg { min-height: 48px; padding: 0 var(--space-6); font-size: var(--text-md); }
.btn-xl { min-height: 52px; padding: 0 var(--space-6); font-size: var(--text-md); width: 100%; }
.btn-icon { min-width: 44px; padding: 0; }
.btn svg, .icon { width: 20px; height: 20px; flex: none; }

/* ---------- Formulários ---------- */
.field { display: grid; gap: var(--space-1); align-content: start; }
.field > label, .label { font-weight: 500; font-size: var(--text-sm); }
.field-help { font-size: var(--text-sm); color: var(--text-muted); }
.field-error { font-size: var(--text-sm); color: var(--danger); min-height: 0; }
.field-error:empty { display: none; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  background: var(--surface-solid); color: var(--text); font: inherit;
  transition: border-color var(--dur-micro) var(--ease), box-shadow var(--dur-micro) var(--ease);
}
.textarea { min-height: 96px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-muted); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-color: var(--focus); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-sunken); color: var(--text-muted); cursor: not-allowed; }
.input-affix { position: relative; display: flex; align-items: center; }
.input-affix > .affix { position: absolute; color: var(--text-muted); font-size: var(--text-sm); pointer-events: none; }
.input-affix > .affix-start { left: 12px; }
.input-affix > .affix-end { right: 12px; }
.input-affix > .affix-start + .input { padding-left: 40px; }
.input-affix > .input:has(+ .affix-end) { padding-right: 44px; }
.input.num { text-align: right; }
.select { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.check { display: inline-flex; align-items: center; gap: var(--space-3); min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); }
.radio-group { display: grid; gap: var(--space-1); border: 0; padding: 0; margin: 0; }
.radio-group legend { font-weight: 500; font-size: var(--text-sm); margin-bottom: var(--space-1); padding: 0; }
.switch { display: inline-flex; align-items: center; gap: var(--space-3); min-height: 44px; cursor: pointer; }
.switch input {
  appearance: none; margin: 0; position: relative; width: 44px; height: 26px; border-radius: 999px;
  background: var(--text-muted); cursor: pointer; transition: background-color var(--dur-micro) var(--ease); flex: none;
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.3); transition: transform var(--dur-micro) var(--ease);
}
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(18px); }

/* ---------- Badges, avatar, skeleton, spinner ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: var(--text-xs); font-weight: 600; white-space: nowrap;
  background: var(--status-draft-bg); color: var(--status-draft-fg);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge[data-status="draft"] { background: var(--status-draft-bg); color: var(--status-draft-fg); }
.badge[data-status="available"], .badge[data-status="won"], .badge[data-tone="success"] { background: var(--status-available-bg); color: var(--status-available-fg); }
.badge[data-status="reserved"], .badge[data-status="negotiation"], .badge[data-status="proposal_sent"], .badge[data-tone="warning"] { background: var(--status-reserved-bg); color: var(--status-reserved-fg); }
.badge[data-status="sold"], .badge[data-status="contacted"], .badge[data-status="qualified"], .badge[data-status="visit_scheduled"] { background: var(--status-sold-bg); color: var(--status-sold-fg); }
.badge[data-status="archived"] { background: var(--status-archived-bg); color: var(--status-archived-fg); }
.badge[data-status="new"], .badge[data-tone="info"] { background: var(--status-info-bg); color: var(--status-info-fg); }
.badge[data-status="lost"], .badge[data-tone="danger"] { background: var(--status-danger-bg); color: var(--status-danger-fg); }
.avatar {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: var(--brand-gradient); color: #fff;
  font-weight: 600; font-size: var(--text-sm); overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface-sunken) 25%, rgb(148 163 184 / 0.25) 50%, var(--surface-sunken) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton-text { height: 14px; }
.skeleton-title { height: 22px; width: 60%; }
.spinner {
  display: inline-block; width: 24px; height: 24px; border-radius: 50%;
  border: 3px solid rgb(100 116 139 / 0.3); border-top-color: var(--primary); animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Estados vazios e de erro ---------- */
.state { display: grid; justify-items: center; text-align: center; gap: var(--space-3); padding: var(--space-12) var(--space-6); }
.state .state-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: var(--radius-lg); background: rgb(227 6 19 / 0.10); color: var(--primary); }
.state.is-error .state-icon { background: rgb(220 38 38 / 0.12); color: var(--danger); }
.state .state-icon svg { width: 28px; height: 28px; }
.state p { max-width: 42ch; color: var(--text-muted); }

/* ---------- Cabeçalho de página ---------- */
.page-header { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: flex-end; justify-content: space-between; margin-bottom: var(--space-6); }
.page-header .breadcrumbs { display: flex; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-muted); margin-bottom: var(--space-1); list-style: none; padding: 0; margin-top: 0; }
.page-header .breadcrumbs li + li::before { content: "/"; margin-right: var(--space-2); }
.page-header .breadcrumbs a { color: var(--text-muted); }
.page-header h1 { font-size: var(--text-3xl); }
.page-header .description { color: var(--text-muted); margin-top: var(--space-1); }

/* ---------- Abas ---------- */
.tabs [role="tablist"] { display: flex; gap: var(--space-1); padding: var(--space-1); border-radius: var(--radius-md); background: var(--surface-sunken); overflow-x: auto; }
.tabs [role="tab"] {
  min-height: 44px; padding: 0 var(--space-4); border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted); font: inherit; font-weight: 500; font-size: var(--text-sm); cursor: pointer; white-space: nowrap;
}
.tabs [role="tab"][aria-selected="true"] { background: var(--surface-solid); color: var(--text); box-shadow: 0 1px 2px rgb(15 23 42 / 0.12); }
.tabs [role="tabpanel"] { padding-top: var(--space-4); }

/* ---------- Diálogo, gaveta, menu, popover, dica ---------- */
.dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0;
  border: 1px solid var(--border-glass); border-radius: var(--radius-xl);
  background: var(--surface-glass-strong); color: var(--text); box-shadow: var(--shadow-float);
  backdrop-filter: blur(var(--blur-lg)); -webkit-backdrop-filter: blur(var(--blur-lg));
}
.dialog::backdrop { background: var(--scrim); }
.dialog[open] { animation: dialog-in var(--dur-enter) var(--ease); }
.dialog-body { padding: var(--space-6); display: grid; gap: var(--space-4); overflow: auto; }
.dialog-actions { display: flex; flex-wrap: wrap-reverse; justify-content: flex-end; gap: var(--space-3); }
.sheet { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(420px, 100vw); border-radius: var(--radius-xl) 0 0 var(--radius-xl); }
.sheet[open] { animation: sheet-in var(--dur-panel) var(--ease); }
@media (max-width: 639px) {
  .sheet { inset: auto 0 0 0; margin: 0; width: 100vw; max-width: 100vw; height: auto; max-height: 85dvh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .sheet[open] { animation: sheet-up var(--dur-panel) var(--ease); }
}
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes sheet-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.menu-wrap { position: relative; display: inline-block; }
.menu, .popover {
  position: absolute; z-index: 40; top: calc(100% + 6px); right: 0; min-width: 200px; padding: var(--space-1);
  border: 1px solid var(--border-glass); border-radius: var(--radius-md);
  background: var(--surface-glass-strong); box-shadow: var(--shadow-float);
  backdrop-filter: blur(var(--blur-md)); -webkit-backdrop-filter: blur(var(--blur-md));
}
.popover { padding: var(--space-4); width: 280px; }
.menu [role="menuitem"], .menu [role="menuitemradio"] {
  display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: 44px; padding: 0 var(--space-3);
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text); font: inherit; font-size: var(--text-sm);
  text-align: left; text-decoration: none; cursor: pointer;
}
.menu [role="menuitem"]:hover, .menu [role="menuitem"]:focus-visible,
.menu [role="menuitemradio"]:hover, .menu [role="menuitemradio"]:focus-visible { background: rgb(100 116 139 / 0.14); outline-offset: -2px; }
.menu [role="menuitemradio"][aria-checked="true"]::after { content: "✓"; margin-left: auto; color: var(--primary); font-weight: 700; }
.menu [data-danger] { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--border-subtle); margin: var(--space-1) 0; }
.tooltip-wrap { position: relative; display: inline-flex; }
.tooltip {
  position: absolute; z-index: 50; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  padding: 6px 10px; border-radius: var(--radius-sm); background: #0f172a; color: #f1f5f9;
  font-size: var(--text-xs); white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity var(--dur-micro) var(--ease);
}
.tooltip-wrap:hover .tooltip, .tooltip-wrap:focus-within .tooltip { opacity: 1; }

/* ---------- Avisos (toast) ---------- */
.toasts {
  position: fixed; z-index: 60; right: var(--space-4); bottom: var(--space-4);
  display: grid; gap: var(--space-2); width: min(380px, calc(100vw - 32px));
}
.toast {
  display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4);
  border: 1px solid var(--border-glass); border-left: 4px solid var(--primary); border-radius: var(--radius-md);
  background: var(--surface-glass-strong); color: var(--text); box-shadow: var(--shadow-float);
  backdrop-filter: blur(var(--blur-md)); -webkit-backdrop-filter: blur(var(--blur-md));
  animation: toast-in var(--dur-enter) var(--ease);
}
.toast[data-tone="success"] { border-left-color: var(--success); }
.toast[data-tone="error"] { border-left-color: var(--danger); }
.toast .toast-text { flex: 1; font-size: var(--text-sm); }
.toast .toast-title { font-weight: 600; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 1023px) { .toasts { bottom: calc(var(--bottomnav-height) + env(safe-area-inset-bottom) + var(--space-3)); left: 50%; right: auto; transform: translateX(-50%); } }

/* ---------- Etapas (stepper) ---------- */
.stepper { display: flex; gap: var(--space-2); list-style: none; padding: 0; margin: 0 0 var(--space-6); counter-reset: step; }
.stepper li { flex: 1; display: grid; gap: var(--space-2); font-size: var(--text-xs); color: var(--text-muted); counter-increment: step; }
.stepper li::before { content: ""; height: 4px; border-radius: 999px; background: var(--surface-sunken); }
.stepper li[data-state="done"]::before, .stepper li[data-state="current"]::before { background: var(--primary); }
.stepper li[data-state="current"] { color: var(--text); font-weight: 600; }
.stepper .step-label::before { content: counter(step) ". "; }

/* ---------- Layout de autenticação ---------- */
.auth-layout { display: grid; place-items: center; min-height: 100dvh; padding: var(--space-6) var(--space-4); }
.auth-layout .glass-panel { width: min(100%, 440px); display: grid; gap: var(--space-6); }
.brand { display: flex; align-items: center; gap: var(--space-3); min-height: 44px; font-weight: 600; color: var(--text); text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--brand-navy); color: #fff; flex: none; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.08); }
.brand-mark img, .brand-mark svg { width: 62%; height: auto; }
.brand-revvo { display: block; height: 26px; width: auto; }
.powered { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--text-muted); margin: var(--space-2) 0 0; padding: 0 var(--space-3); }
.powered img { height: 12px; width: auto; }
.logo-claro { display: block; }
.brand-mark > svg { width: 20px; height: 20px; }
.form { display: grid; gap: var(--space-4); }
.status { font-size: var(--text-sm); font-weight: 500; }
.status:empty { display: none; }
.status[data-state="ok"] { color: var(--success); }
.status[data-state="error"] { color: var(--danger); }
.alert { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: var(--text-sm); background: var(--status-info-bg); color: var(--status-info-fg); }
.alert[data-tone="error"] { background: var(--status-danger-bg); color: var(--status-danger-fg); }
.alert[data-tone="success"] { background: var(--status-available-bg); color: var(--status-available-fg); }
.alert:empty { display: none; }

/* ---------- AppShell ---------- */
.app { min-height: 100dvh; }
.sidebar {
  position: fixed; z-index: 30; inset: var(--space-3) auto var(--space-3) var(--space-3); width: var(--sidebar-width);
  display: none; flex-direction: column; gap: var(--space-4); padding: var(--space-4);
  border: 1px solid var(--border-glass); border-radius: var(--radius-xl);
  background: var(--surface-glass); box-shadow: var(--shadow-float);
  backdrop-filter: blur(var(--blur-lg)) saturate(140%); -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(140%);
  transition: width var(--dur-panel) var(--ease);
}
.nav { display: grid; gap: var(--space-1); list-style: none; margin: 0; padding: 0; }
.nav a {
  display: flex; align-items: center; gap: var(--space-3); min-height: 44px; padding: 0 var(--space-3);
  border-radius: var(--radius-md); color: var(--text); text-decoration: none; font-weight: 500; font-size: var(--text-sm);
}
.nav a:hover { background: rgb(100 116 139 / 0.14); }
.nav a[aria-current="page"] { background: var(--primary); color: var(--primary-fg); }
.sidebar-footer { margin-top: auto; display: grid; gap: var(--space-2); }
.sidebar-toggle { align-self: flex-end; }
.app.is-collapsed .sidebar { width: var(--sidebar-collapsed); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 44px; }
.sidebar-head .brand { min-width: 0; color: var(--text); text-decoration: none; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer .btn { width: 100%; justify-content: flex-start; }
.user-button { min-height: 52px; padding: 0 var(--space-2); text-align: left; }
.user-text { display: grid; min-width: 0; line-height: 1.3; }
.user-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-weight: 400; font-size: var(--text-xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-wrap.menu-up { display: block; }
.menu-up > .menu { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; width: 100%; }
/* Recolhida: rótulos saem da tela, mas continuam como nome acessível. */
.app.is-collapsed .sidebar .powered { display: none; }
.app.is-collapsed .sidebar .nav-label, .app.is-collapsed .sidebar .brand-name, .app.is-collapsed .sidebar .user-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.app.is-collapsed .sidebar .nav a, .app.is-collapsed .sidebar-footer .btn { justify-content: center; padding: 0; }
.app.is-collapsed .sidebar-head { flex-direction: column; }
.app.is-collapsed .sidebar-toggle svg { transform: scaleX(-1); }
.app.is-collapsed .menu-up > .menu { width: 220px; left: calc(100% + 8px); bottom: 0; }
.topbar .brand { color: var(--text); text-decoration: none; min-width: 0; }
.topbar-actions { gap: var(--space-1); flex-wrap: nowrap; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  min-height: 56px; padding: var(--space-2) var(--space-4); padding-top: calc(var(--space-2) + env(safe-area-inset-top));
  border-bottom: 1px solid var(--border-glass); background: var(--surface-glass);
  backdrop-filter: blur(var(--blur-lg)); -webkit-backdrop-filter: blur(var(--blur-lg));
}
.main { padding: var(--space-6) var(--space-4) calc(var(--bottomnav-height) + env(safe-area-inset-bottom) + var(--space-8)); max-width: 1200px; margin: 0 auto; }
.bottomnav {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(var(--cols, 5), 1fr); align-items: center;
  height: calc(var(--bottomnav-height) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--border-glass); background: var(--surface-glass-strong);
  backdrop-filter: blur(var(--blur-lg)) saturate(140%); -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(140%);
}
.bottomnav a {
  display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 52px;
  color: var(--text-muted); text-decoration: none; font-size: 11px; font-weight: 500;
}
.bottomnav a[aria-current="page"] { color: var(--primary); }
.bottomnav a.is-primary { color: var(--primary-fg); }
.bottomnav a.is-primary .fab {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin-top: -20px;
  background: var(--brand-gradient); box-shadow: var(--shadow-float); color: #fff;
}
.bottomnav a.is-primary .nav-label { color: var(--text-muted); }
@media (min-width: 1024px) {
  .sidebar { display: flex; }
  .topbar, .bottomnav { display: none; }
  .main { margin-left: calc(var(--sidebar-width) + var(--space-3)); padding: var(--space-8); max-width: none; transition: margin-left var(--dur-panel) var(--ease); }
  .app.is-collapsed .main { margin-left: calc(var(--sidebar-collapsed) + var(--space-3)); }
}

/* ---------- Site público (esqueleto, Fase 4) ---------- */
.site-header, .site-footer { padding: var(--space-4); }
.site-header { display: flex; justify-content: space-between; align-items: center; }
.site-footer { color: var(--text-muted); font-size: var(--text-sm); text-align: center; }

/* ---------- Vitrine do design system ---------- */
.ds-swatches { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.ds-swatch { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border-subtle); background: var(--surface-solid); }
.ds-swatch .chip { height: 56px; }
.ds-swatch .meta { padding: var(--space-2) var(--space-3); font-size: var(--text-xs); overflow-wrap: anywhere; }
.ds-type > * + * { margin-top: var(--space-2); }
.ds-section h2 { margin-bottom: var(--space-4); }

/* ---------- Movimento reduzido: só opacidade ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .btn, .glass-card.is-interactive, .switch input::after, .sidebar, .main { transition-property: opacity, background-color, color !important; }
  .btn:active, .glass-card.is-interactive:hover { transform: none; }
  .dialog[open], .sheet[open], .toast { animation: fade-in var(--dur-enter) linear !important; animation-duration: var(--dur-enter) !important; }
  .skeleton { animation: none; }
  .spinner, .btn.is-loading::after { animation: pulse 1.2s ease-in-out infinite !important; animation-duration: 1.2s !important; animation-iteration-count: infinite !important; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 50% { opacity: 0.4; } }

.auth-noscript { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; padding: var(--space-4); text-align: center; background: var(--surface-solid); }

/* Amostras de cor da vitrine */
.ds-swatch .chip[data-token="bg-base"] { background: var(--bg-base); }
.ds-swatch .chip[data-token="surface-solid"] { background: var(--surface-solid); }
.ds-swatch .chip[data-token="surface-sunken"] { background: var(--surface-sunken); }
.ds-swatch .chip[data-token="surface-glass"] { background: var(--surface-glass); }
.ds-swatch .chip[data-token="text"] { background: var(--text); }
.ds-swatch .chip[data-token="text-muted"] { background: var(--text-muted); }
.ds-swatch .chip[data-token="primary"] { background: var(--primary); }
.ds-swatch .chip[data-token="accent"] { background: var(--accent); }
.ds-swatch .chip[data-token="success"] { background: var(--success); }
.ds-swatch .chip[data-token="warning"] { background: var(--warning); }
.ds-swatch .chip[data-token="danger"] { background: var(--danger); }
.ds-swatch .chip[data-token="focus"] { background: var(--focus); }
.ds-t48 { font-size: var(--text-5xl); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.ds-t30 { font-size: var(--text-3xl); font-weight: 600; letter-spacing: -0.01em; }
.ds-t20 { font-size: var(--text-xl); font-weight: 600; }
.ds-t14 { font-size: var(--text-sm); }
.ds-w80 { width: 80%; }
@media (max-width: 639px) { .ds-t48 { font-size: var(--text-4xl); } }

/* ---------- Listas (equipe, lojas) ---------- */
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list-item { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: var(--space-3) 0; flex-wrap: wrap; }
.list-item + .list-item { border-top: 1px solid var(--border-subtle); }
.list-title { font-weight: 600; }
.member { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 44px; grid-template-areas: "av info badge menu"; column-gap: var(--space-3); }
.member > .avatar { grid-area: av; }
.member-info { grid-area: info; display: grid; min-width: 0; line-height: 1.35; }
.member-info > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member > .badge { grid-area: badge; }
.member > .menu-wrap { grid-area: menu; }
.member-email, .member-meta { font-size: var(--text-sm); }
@media (max-width: 639px) {
  .member { grid-template-columns: auto minmax(0, 1fr) 44px; grid-template-areas: "av info menu" "av badge menu"; row-gap: var(--space-2); }
  .member > .badge { justify-self: start; }
}

/* ---------- Configurações: cores ---------- */
.color-field { display: flex; gap: var(--space-2); align-items: center; }
.color-picker { flex: none; width: 48px; height: 44px; padding: 2px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-solid); cursor: pointer; }
.brand-preview {
  display: grid; place-items: center; min-height: 44px; padding: 0 var(--space-4); border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--previa-1, #2563eb), var(--previa-2, #7c3aed)); color: #fff; font-weight: 600; font-size: var(--text-sm);
}
.form-actions { justify-content: flex-end; }
@media (max-width: 639px) { .form-actions .btn { width: 100%; } }

/* ---------- Páginas de erro (fora do painel) ---------- */
.error-code { font-size: var(--text-5xl); font-weight: 700; letter-spacing: -0.02em; line-height: 1; color: var(--primary); }

/* ---------- Estoque ---------- */
.chips { display: flex; gap: var(--space-2); overflow-x: auto; padding-bottom: 2px; }
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-4);
  border: 1px solid var(--border-subtle); border-radius: 999px; background: var(--surface-solid); color: var(--text);
  font: inherit; font-size: var(--text-sm); font-weight: 500; white-space: nowrap; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.chip-count { font-size: var(--text-xs); opacity: 0.85; }
.toolbar { display: grid; gap: var(--space-2); grid-template-columns: 1fr auto auto; align-items: center; }
.toolbar .field { margin: 0; }
@media (max-width: 639px) { .toolbar { grid-template-columns: 1fr 1fr; } .toolbar-search { grid-column: 1 / -1; } }
.grid-2 { display: grid; gap: var(--space-3); grid-template-columns: 1fr 1fr; }
.vehicle-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.vehicle-grid-full { grid-column: 1 / -1; }
.vehicle-card { border-radius: var(--radius-lg); background: var(--surface-solid); border: 1px solid var(--border-subtle); overflow: hidden; box-shadow: var(--shadow-float); }
.vehicle-card-link { display: block; color: var(--text); text-decoration: none; height: 100%; }
.vehicle-card-link:focus-visible { outline-offset: -2px; border-radius: var(--radius-lg); }
.vehicle-card-media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-sunken); }
.vehicle-card-media img { width: 100%; height: 100%; object-fit: cover; }
.vehicle-card-media .badge { position: absolute; top: var(--space-2); left: var(--space-2); }
.vehicle-card-nophoto { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: var(--space-1); color: var(--text-muted); font-size: var(--text-sm); }
.vehicle-card-body { padding: var(--space-3) var(--space-4) var(--space-4); display: grid; gap: 2px; }
.vehicle-card-title { font-size: var(--text-md); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vehicle-card-meta, .vehicle-card-photos { font-size: var(--text-sm); }
.vehicle-card-price { font-size: var(--text-lg); font-weight: 700; margin-top: var(--space-1); }
.vehicle-card-price s { font-size: var(--text-sm); font-weight: 400; }
.pager { justify-content: center; }
.stat-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { display: grid; gap: 2px; padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface-solid); border: 1px solid var(--border-subtle); color: var(--text); text-decoration: none; }
.stat-value { font-size: var(--text-3xl); font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--text-muted); font-size: var(--text-sm); }
.features { border: 0; padding: 0; margin: 0; display: grid; gap: var(--space-3); }
.features legend { font-weight: 600; margin-bottom: var(--space-2); padding: 0; }
.features-list { display: grid; gap: 0 var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.file-button { position: relative; }
.file-button:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.photo-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.photo-item { display: grid; gap: var(--space-2); }
.photo-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-md); background: var(--surface-sunken); }
.photo-actions { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.photo-actions .btn { min-width: 44px; }
.photo-actions [aria-pressed="true"] { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.photo-empty { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--space-2); padding: var(--space-6); justify-content: center; border: 1px dashed var(--border-subtle); border-radius: var(--radius-md); }
.btn-danger-text { color: var(--danger); }
.review { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 280px) 1fr; align-items: start; }
@media (max-width: 639px) { .review { grid-template-columns: 1fr; } }
.review-cover { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-md); }
.review-list { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); margin: 0; }
.review-list dt { color: var(--text-muted); font-size: var(--text-sm); }
.review-list dd { margin: 0; }
.detail-head { display: grid; gap: var(--space-6); grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 899px) { .detail-head { grid-template-columns: 1fr; } }
.detail-cover { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg); background: var(--surface-sunken); }
.detail-price { font-size: var(--text-3xl); font-weight: 700; }
.history { list-style: none; margin: 0; padding: 0; display: grid; }
.history li { display: grid; gap: 2px; padding: var(--space-3) 0; border-top: 1px solid var(--border-subtle); }
.history li:first-child { border-top: 0; }

/* ---------- App instalável (Fase 3) ---------- */
.offline-banner {
  position: fixed; z-index: 70; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + var(--space-2));
  max-width: calc(100vw - 32px); padding: var(--space-2) var(--space-4); border-radius: 999px;
  background: #0f172a; color: #f8fafc; font-size: var(--text-sm); font-weight: 500; box-shadow: var(--shadow-float);
}
@media (display-mode: standalone) { .topbar { padding-top: calc(var(--space-2) + env(safe-area-inset-top)); } }

/* ---------- CRM (Fase 6) ---------- */
.crm-toolbar { grid-template-columns: 1fr auto auto; }
@media (max-width: 639px) { .crm-toolbar { grid-template-columns: 1fr; } }
.board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: var(--space-3);
  overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--space-2); align-items: start;
}
@media (max-width: 639px) { .board { grid-auto-columns: 86%; } }
.board-col { scroll-snap-align: start; display: grid; gap: var(--space-2); align-content: start; min-width: 0; }
.board-col-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 0 var(--space-1); }
.board-col-head h2 { font-size: var(--text-md); }
.board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.board-empty { padding: var(--space-4); border: 1px dashed var(--border-subtle); border-radius: var(--radius-md); text-align: center; font-size: var(--text-sm); }
.lead-card { display: grid; gap: var(--space-1); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  background: var(--surface-solid); border: 1px solid var(--border-subtle); color: var(--text); text-decoration: none; min-height: 44px; }
.lead-card:hover { border-color: var(--primary); }
.lead-card-name { font-weight: 600; }
.lead-card-meta { font-size: var(--text-sm); color: var(--text-muted); }
.lead-card-due { font-size: var(--text-xs); font-weight: 600; }
.lead-card-due[data-late="true"] { color: var(--danger); }
.lead-layout { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 899px) { .lead-layout { grid-template-columns: 1fr; } .lead-layout > :last-child { order: -1; } }
.crm-section-head { justify-content: space-between; }
.crm-data { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-2) var(--space-4); margin: 0; }
.crm-data dt { color: var(--text-muted); }
.crm-data dd { margin: 0; overflow-wrap: anywhere; }
.chip-radios { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip-radios .chip { position: relative; }
.chip-radios .chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip-radios .chip:has(input:checked) { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.chip-radios .chip:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.task-item { justify-content: space-between; }
.task-item[data-late="true"] .task-when { color: var(--danger); font-weight: 600; }
.crm-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.task-item a.list-title { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Artes (Fase 5) ---------- */
.art-layout { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 899px) { .art-layout { grid-template-columns: 1fr; } }
.art-preview { display: grid; place-items: center; padding: var(--space-3); position: sticky; top: var(--space-4); }
@media (max-width: 899px) { .art-preview { position: static; } }
.art-preview canvas { display: block; width: auto; max-width: 100%; max-height: 72vh; height: auto; border-radius: var(--radius-md); box-shadow: var(--shadow-md, 0 8px 24px rgb(15 23 42 / 0.18)); }
.art-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: var(--space-2); }
.art-photo { position: relative; display: block; border-radius: var(--radius-md); overflow: hidden; border: 2px solid transparent; cursor: pointer; min-height: 44px; }
.art-photo input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.art-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.art-photo:has(input:checked) { border-color: var(--primary); }
.art-photo:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.art-done { justify-content: space-between; }
.art-done a { display: inline-flex; align-items: center; min-height: 44px; }
.logo-preview { max-height: 72px; max-width: 220px; object-fit: contain; padding: var(--space-2); border-radius: var(--radius-md); background: #fff; border: 1px solid var(--border-subtle); }

/* ---------- Resultados no Início ---------- */
a.stat:hover { border-color: var(--primary); }
.stat.skeleton { min-height: 92px; }
.stat[data-tone] { border-left-width: 6px; }
.stat[data-tone="warning"] { border-left-color: var(--warning, #F59E0B); }
.stat[data-tone="danger"] { border-left-color: var(--danger); }
.stat-value { font-size: clamp(22px, 4vw, var(--text-3xl)); }
.dash-charts { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.bar { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); font-size: var(--text-sm); }
.bar-label { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-fill { height: 12px; border-radius: 999px; background: var(--surface-sunken); position: relative; overflow: hidden; }
.bar-fill::after { content: ""; position: absolute; inset: 0; width: calc(var(--v, 0) * 100%); min-width: 4px; border-radius: inherit; background: var(--brand-gradient); }
.bar-value { font-weight: 600; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th, .table td { text-align: left; padding: var(--space-3) var(--space-2); border-top: 1px solid var(--border-subtle); }
.table thead th { border-top: 0; color: var(--text-muted); font-weight: 500; }
.table .num { text-align: right; }

/* ---------- Banners do site ---------- */
.banner-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.banner-item { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr) auto; gap: var(--space-4); align-items: center; padding: var(--space-3); }
@media (max-width: 767px) { .banner-item { grid-template-columns: 1fr; } }
.banner-item img { width: 100%; aspect-ratio: 16 / 5; object-fit: cover; border-radius: var(--radius-md); background: var(--surface-sunken); display: block; }
.banner-item[data-ativo="false"] img { opacity: 0.45; }
.banner-info a { display: inline-flex; align-items: center; min-height: 44px; justify-self: start; }
.banner-info { display: grid; gap: 2px; min-width: 0; }
.banner-info .muted { overflow-wrap: anywhere; }
.banner-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }

/* ---------- Plataforma (superadmin) ---------- */
.store-list { gap: var(--space-3); }
.store-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: var(--space-4); }
.store-item + .store-item { border-top: 0; }
@media (max-width: 767px) { .store-item { grid-template-columns: 1fr; } }
.store-head { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.store-meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); font-size: var(--text-sm); color: var(--text-muted); }
.store-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }
.store-item[data-situacao="suspensa"] .store-head strong { color: var(--text-muted); }

/* Textos prontos para divulgar (WhatsApp/Instagram) */
.share-text { min-height: 220px; font-family: inherit; line-height: 1.45; white-space: pre-wrap; }
.share-text-curto { min-height: 140px; }

/* Cores da arte (estúdio) */
.art-colors { border: 0; padding: 0; margin: 0; display: grid; gap: 12px; }
.art-colors legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.art-color-pickers { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.art-color { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.art-color input[type="color"] { inline-size: 44px; block-size: 44px; padding: 0; border: 1px solid var(--border); border-radius: 12px; background: none; cursor: pointer; }
.art-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
.art-color input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 9px; }
.art-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.art-swatch { inline-size: 44px; block-size: 44px; border-radius: 50%; border: 2px solid var(--border); padding: 0; cursor: pointer; background: linear-gradient(135deg, var(--a) 0 50%, var(--b) 50% 100%); }
.art-swatch[aria-pressed="true"] { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg, #fff), 0 0 0 4px var(--text); }
.art-swatch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Financeiro e desempenho (D35) ---------- */
.finance-filter { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); align-items: end; justify-content: space-between; }
.finance-dates { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: end; }
.finance-dates .field { margin: 0; }
.finance-dates .input { min-height: 44px; }
.stat-hint { color: var(--text-muted); font-size: var(--text-xs); }
.stat-value.is-negative, .num.is-negative { color: var(--danger); }
.money-flow { display: grid; gap: var(--space-2); margin: 0; }
.money-flow div { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-2) 0; border-top: 1px solid var(--border-subtle); }
.money-flow div:first-child { border-top: 0; }
.money-flow dt { color: var(--text-muted); }
.money-flow dd { margin: 0; font-weight: 600; }
.money-flow .is-total { border-top: 2px solid var(--text); font-size: var(--text-lg); }
.table td a { color: inherit; }
.table td.num, .table th.num { white-space: nowrap; }
.table tfoot th, .table tfoot td { font-weight: 700; border-top: 2px solid var(--border-subtle); }
.month-nav { display: flex; align-items: center; gap: var(--space-2); }
.month-nav-label { font-size: var(--text-xl); min-width: 12ch; text-align: center; margin: 0; }
.people-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); }
.person-card { display: grid; gap: var(--space-4); align-content: start; }
.person-head { display: flex; align-items: center; gap: var(--space-3); }
.person-head h3 { font-size: var(--text-lg); margin: 0; }
.person-head .muted { font-size: var(--text-sm); }
.person-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3) var(--space-2); margin: 0; }
.person-stats div { display: grid; gap: 2px; }
.person-stats dt { color: var(--text-muted); font-size: var(--text-xs); }
.person-stats dd { margin: 0; font-weight: 700; font-size: var(--text-md); }
.goal { display: grid; gap: var(--space-1); }
.goal-head { display: flex; justify-content: space-between; gap: var(--space-2); font-size: var(--text-sm); }
.goal-head span:last-child { color: var(--text-muted); }
.goal-bar { height: 10px; border-radius: 999px; background: var(--surface-sunken); position: relative; overflow: hidden; }
.goal-bar::after { content: ""; position: absolute; inset: 0; width: calc(min(var(--v, 0), 1) * 100%); border-radius: inherit; background: var(--brand-gradient); }
.goal-bar[data-done="true"]::after { background: var(--success); }
.goal-bar .goal-pace { position: absolute; top: -2px; bottom: -2px; width: 2px; left: calc(var(--p, 0) * 100%); background: var(--text); opacity: 0.55; z-index: 1; }
.tips { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.tips li { display: flex; gap: var(--space-2); align-items: flex-start; font-size: var(--text-sm); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--status-info-bg); color: var(--status-info-fg); }
.tips li[data-tone="danger"] { background: var(--status-danger-bg); color: var(--status-danger-fg); }
.tips li[data-tone="warning"] { background: var(--status-reserved-bg); color: var(--status-reserved-fg); }
.tips li[data-tone="success"] { background: var(--status-available-bg); color: var(--status-available-fg); }
.dialog-wide { width: min(720px, calc(100vw - 32px)); }
.goals-table .input { min-height: 44px; min-width: 0; width: 100%; }
.goals-table td:nth-child(2) { width: 7.5em; }
.goals-table td:nth-child(3) { width: 12em; }
.expense-form { display: grid; gap: var(--space-3); grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; }
@media (max-width: 899px) { .expense-form { grid-template-columns: 1fr 1fr; } .expense-form .field-desc { grid-column: 1 / -1; } }
.expense-form .field { margin: 0; }
.expense-list { list-style: none; margin: 0; padding: 0; display: grid; }
.expense-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; gap: var(--space-3); align-items: center; padding: var(--space-2) 0; border-top: 1px solid var(--border-subtle); }
.expense-list li:first-child { border-top: 0; }
.expense-list .muted { font-size: var(--text-sm); }
.expense-form [data-form-status] { grid-column: 1 / -1; }

/* Interessados (área da plataforma, D37) */
.interest-list { gap: var(--space-3); }
.interest-item { display: grid; gap: var(--space-3); grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
@media (max-width: 639px) { .interest-item { grid-template-columns: 1fr; } }
.interest-info { display: grid; gap: var(--space-1); min-width: 0; }
.interest-meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); font-size: var(--text-sm); color: var(--text-muted); }
.interest-contacts { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.interest-msg { margin: 0; font-size: var(--text-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
.interest-item .select { min-height: 44px; }

/* Logotipo da arte (D38): miniatura sobre xadrez para ver se some no fundo */
.art-logos { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.art-logo { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: var(--space-1) var(--space-3) var(--space-1) var(--space-1);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md); cursor: pointer; background: var(--surface-solid); font-size: var(--text-sm); }
.art-logo:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.art-logo:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.art-logo input { position: absolute; opacity: 0; pointer-events: none; }
.art-logo-preview { width: 64px; height: 36px; border-radius: 8px; display: grid; place-items: center; overflow: hidden; flex: none; font-weight: 700; color: var(--text-muted);
  background: repeating-conic-gradient(#9ca3af 0% 25%, #e5e7eb 0% 50%) 50% / 12px 12px; }
.art-logo-preview img { max-width: 90%; max-height: 80%; object-fit: contain; }
.logo-preview-xadrez { background: repeating-conic-gradient(#9ca3af 0% 25%, #e5e7eb 0% 50%) 50% / 14px 14px; }
