/* ==========================================================================
   CoderDraw — design system (loja + admin + portal da loja)
   --------------------------------------------------------------------------
   Um CSS só, sem framework: tokens -> base -> layout -> componentes ->
   utilitários. Neutro moderno: escala de cinza + UM acento (laranja-laser),
   usado só pra ação principal de cada tela, foco e estado ativo.

   Regras da casa:
   - Cor só por token (var(--...)). Nada de hex solto nos templates.
   - Um único botão .btn-primary por tela/bloco: o próximo passo óbvio.
   - Toque: todo controle interativo tem no mínimo 40px de altura
     (44px no celular) — WCAG 2.5.8 / guia de toque iOS/Android.
   - Foco sempre visível (:focus-visible com anel de acento).
   - Mobile-first: estilos base são do celular; @media (min-width) amplia.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("/static/cd/fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* Neutros (zinc) */
  --gray-0: #ffffff;
  --gray-25: #fcfcfc;
  --gray-50: #fafafa;
  --gray-100: #f4f4f5;
  --gray-150: #ececee;
  --gray-200: #e4e4e7;
  --gray-300: #d4d4d8;
  --gray-400: #a1a1aa;
  --gray-500: #71717a;
  --gray-600: #52525b;
  --gray-700: #3f3f46;
  --gray-800: #27272a;
  --gray-900: #18181b;
  --gray-950: #09090b;

  /* Acento — laranja-laser. 700 é o tom de botão: branco por cima dá
     contraste 5.2:1 (AA pra texto normal). */
  --accent-50: #fff4ed;
  --accent-100: #ffe6d5;
  --accent-200: #fdc9a9;
  --accent-500: #f26a1b;
  --accent-600: #e0520c;
  --accent-700: #c2410c;
  --accent-800: #9a3412;

  /* Semânticas (fundo suave + texto/borda), todas AA sobre o próprio fundo */
  --success-bg: #ecfdf3; --success-border: #abefc6; --success-fg: #067647;
  --warning-bg: #fffaeb; --warning-border: #fedf89; --warning-fg: #b54708;
  --danger-bg: #fef3f2;  --danger-border: #fecdca;  --danger-fg: #b42318;
  --info-bg: #eff8ff;    --info-border: #b2ddff;    --info-fg: #175cd3;
  --neutral-bg: var(--gray-100); --neutral-border: var(--gray-200); --neutral-fg: var(--gray-700);

  /* Papéis */
  --bg: var(--gray-0);
  --bg-subtle: var(--gray-50);
  --bg-muted: var(--gray-100);
  --surface: var(--gray-0);
  --text: var(--gray-900);
  --text-muted: var(--gray-600);
  --text-subtle: var(--gray-500);
  --border: var(--gray-200);
  --border-strong: var(--gray-300);
  --primary: var(--accent-700);
  --primary-hover: var(--accent-800);
  --primary-fg: #ffffff;
  --ink: var(--gray-900);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent-500) 35%, transparent);

  /* Tipografia — escala ~1.2, rem relativo ao 16px do navegador
     (respeita o zoom/tamanho de fonte que o usuário escolheu). */
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);

  /* Espaço (4px) */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-5: 1.25rem;
  --s-6: 1.5rem; --s-8: 2rem; --s-10: 2.5rem; --s-12: 3rem; --s-16: 4rem; --s-20: 5rem;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-full: 999px;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 6px 16px -4px rgba(16, 24, 40, 0.10), 0 2px 6px -2px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 16px 32px -8px rgba(16, 24, 40, 0.16), 0 4px 8px -4px rgba(16, 24, 40, 0.06);

  --container: 1200px;
  --header-h: 64px;
  --control-h: 44px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}
@media (min-width: 768px) {
  :root { --control-h: 40px; }
}

/* --------------------------------------------------------------- base -- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
  overflow-x: clip;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
input, button, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5, h6 { margin: 0; line-height: 1.2; font-weight: 650; letter-spacing: -0.015em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary); }
:focus-visible { outline: 2px solid var(--accent-600); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-100); }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s-6) 0; }
code { font-family: var(--font-mono); font-size: 0.875em; background: var(--bg-muted); padding: 0.1em 0.35em; border-radius: 4px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--s-4); top: -100px; z-index: 1000;
  background: var(--ink); color: #fff; padding: var(--s-2) var(--s-4); border-radius: var(--radius-sm);
}
.skip-link:focus { top: var(--s-4); color: #fff; }

.icon { flex-shrink: 0; }

/* ------------------------------------------------------------- layout -- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--s-4); }
@media (min-width: 768px) { .container { padding-inline: var(--s-6); } }
.container-narrow { max-width: 720px; }
.container-xs { max-width: 460px; }

.stack { display: flex; flex-direction: column; gap: var(--stack-gap, var(--s-4)); }
.stack-xs { --stack-gap: var(--s-1); } .stack-sm { --stack-gap: var(--s-2); } .stack-md { --stack-gap: var(--s-3); }
.stack-lg { --stack-gap: var(--s-6); } .stack-xl { --stack-gap: var(--s-8); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster-gap, var(--s-2)); }
.cluster-lg { --cluster-gap: var(--s-4); }
.spread { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); }
.grid { display: grid; gap: var(--grid-gap, var(--s-4)); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.section { padding-block: var(--s-12); }
@media (min-width: 768px) { .section { padding-block: var(--s-16); } }
.section-sm { padding-block: var(--s-8); }
.section-muted { background: var(--bg-subtle); border-block: 1px solid var(--border); }

/* --------------------------------------------------------- tipografia -- */
.display { font-size: var(--text-4xl); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.h1 { font-size: var(--text-3xl); letter-spacing: -0.025em; }
.h2 { font-size: var(--text-2xl); letter-spacing: -0.02em; }
.h3 { font-size: var(--text-xl); }
.h4 { font-size: var(--text-lg); }
.lead { font-size: var(--text-lg); color: var(--text-muted); line-height: 1.6; }
.eyebrow { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-subtle); }
.text-sm { font-size: var(--text-sm); } .text-xs { font-size: var(--text-xs); } .text-lg { font-size: var(--text-lg); }
.text-muted { color: var(--text-muted); } .text-subtle { color: var(--text-subtle); }
.text-danger { color: var(--danger-fg); } .text-success { color: var(--success-fg); }
.fw-500 { font-weight: 500; } .fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.tabular { font-variant-numeric: tabular-nums; }
.price { font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.link { color: var(--primary); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--primary) 40%, transparent); font-weight: 500; }
.link:hover { color: var(--primary-hover); text-decoration-color: currentColor; }
.prose p + p { margin-top: var(--s-3); }

/* ------------------------------------------------------------ botões -- */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--text); --btn-border: var(--border-strong); --btn-hover: var(--bg-muted);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--control-h); padding: 0 var(--s-4);
  font-size: var(--text-sm); font-weight: 600; line-height: 1; white-space: nowrap;
  color: var(--btn-fg); background: var(--btn-bg); border: 1px solid var(--btn-border); border-radius: var(--radius-sm);
  text-decoration: none; cursor: pointer; user-select: none;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  box-shadow: var(--shadow-xs);
}
.btn:hover { background: var(--btn-hover); color: var(--btn-fg); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-primary { --btn-bg: var(--primary); --btn-fg: var(--primary-fg); --btn-border: var(--primary); --btn-hover: var(--primary-hover); }
.btn-dark { --btn-bg: var(--ink); --btn-fg: #fff; --btn-border: var(--ink); --btn-hover: var(--gray-700); }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; --btn-hover: var(--bg-muted); box-shadow: none; }
.btn-danger { --btn-bg: var(--surface); --btn-fg: var(--danger-fg); --btn-border: var(--danger-border); --btn-hover: var(--danger-bg); }
.btn-sm { min-height: 34px; padding: 0 var(--s-3); font-size: var(--text-sm); }
@media (max-width: 767px) { .btn-sm { min-height: 40px; } }
.btn-lg { min-height: 52px; padding: 0 var(--s-6); font-size: var(--text-base); border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-icon { padding: 0; width: var(--control-h); }
.btn .spinner { display: none; }
.btn.htmx-request .spinner, .btn.is-loading .spinner { display: inline-block; }
.btn.htmx-request, .btn.is-loading { pointer-events: none; opacity: 0.85; }

.spinner {
  width: 1em; height: 1em; border-radius: 50%; display: inline-block;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite; vertical-align: -0.125em;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------- formulário -- */
.field { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.field + .field { margin-top: var(--s-4); }
.label { font-size: var(--text-sm); font-weight: 550; color: var(--text); display: inline-flex; align-items: center; gap: var(--s-1); }
.label .optional { font-weight: 400; color: var(--text-subtle); }
.hint { font-size: var(--text-xs); color: var(--text-subtle); line-height: 1.45; }
.input, .select, .textarea {
  width: 100%; min-height: var(--control-h); padding: 0 var(--s-3);
  font-size: 16px; /* 16px no celular evita o zoom automático do iOS ao focar */
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
@media (min-width: 768px) { .input, .select, .textarea { font-size: var(--text-sm); } }
.textarea { padding: var(--s-2) var(--s-3); min-height: 96px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: var(--s-8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.input::placeholder, .textarea::placeholder { color: var(--gray-400); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--gray-400); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent-600); box-shadow: var(--focus-ring); }
.input:disabled, .select:disabled { background: var(--bg-muted); color: var(--text-subtle); }
.input-sm { min-height: 36px; width: 6rem; }
.input-group { display: flex; gap: var(--s-2); }
.input-group > .input { flex: 1 1 auto; min-width: 0; }
.form-grid { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
.form-grid > .field + .field { margin-top: 0; }
@media (min-width: 640px) {
  .form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid-3 { grid-template-columns: 2fr 1fr 1fr; }
  .span-2 { grid-column: span 2; }
}
.form-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-6); }
.fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s-4); margin: 0; }
.fieldset + .fieldset { margin-top: var(--s-3); }
.fieldset legend { padding: 0 var(--s-1); font-weight: 600; font-size: var(--text-sm); }

.check { display: inline-flex; align-items: flex-start; gap: var(--s-2); cursor: pointer; font-size: var(--text-sm); min-height: 24px; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent-700); flex-shrink: 0; cursor: pointer; }
.check-card {
  display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-4);
  border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.check-card:hover { border-color: var(--gray-400); }
.check-card:has(input:checked) { border-color: var(--accent-600); background: var(--accent-50); }
.check-card input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent-700); }

/* Controle segmentado: radio nativo (semântica e teclado de graça). */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--bg-muted); border-radius: var(--radius-sm); border: 1px solid var(--border); max-width: 100%; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.segmented label, .segmented .seg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-1);
  min-height: 34px; padding: 0 var(--s-3); border-radius: 4px; border: 0; background: transparent;
  font-size: var(--text-sm); font-weight: 500; color: var(--text-muted); cursor: pointer; white-space: nowrap;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.segmented label:hover, .segmented .seg-btn:hover { color: var(--text); }
.segmented input:checked + label, .segmented .seg-btn[aria-pressed="true"], .segmented .seg-btn.is-active {
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600;
}
.segmented input:focus-visible + label { box-shadow: var(--focus-ring); }
.segmented-block { display: flex; width: 100%; }
.segmented-block label, .segmented-block .seg-btn { flex: 1 1 0; }

.color-input { width: 44px; height: 40px; padding: 3px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }

/* -------------------------------------------------------------- card -- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); min-width: 0; }
.card-body { padding: var(--s-5); }
@media (min-width: 768px) { .card-body { padding: var(--s-6); } }
.card-header { padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
@media (min-width: 768px) { .card-header { padding: var(--s-4) var(--s-6); } }
.card-title { font-size: var(--text-base); font-weight: 650; }
.card-subtitle { font-size: var(--text-sm); color: var(--text-muted); margin-top: 2px; }
.card-footer { padding: var(--s-4) var(--s-5); border-top: 1px solid var(--border); background: var(--bg-subtle); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card-flush .card-body { padding: 0; }
.stack-cards > .card + .card { margin-top: var(--s-4); }

/* ------------------------------------------------------------ badges -- */
.badge {
  --b-bg: var(--neutral-bg); --b-fg: var(--neutral-fg); --b-border: var(--neutral-border);
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; min-height: 22px;
  font-size: var(--text-xs); font-weight: 600; line-height: 1.2; white-space: nowrap;
  color: var(--b-fg); background: var(--b-bg); border: 1px solid var(--b-border); border-radius: var(--radius-full);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.badge-plain::before { display: none; }
.badge-success { --b-bg: var(--success-bg); --b-fg: var(--success-fg); --b-border: var(--success-border); }
.badge-warning { --b-bg: var(--warning-bg); --b-fg: var(--warning-fg); --b-border: var(--warning-border); }
.badge-danger { --b-bg: var(--danger-bg); --b-fg: var(--danger-fg); --b-border: var(--danger-border); }
.badge-info { --b-bg: var(--info-bg); --b-fg: var(--info-fg); --b-border: var(--info-border); }
.badge-accent { --b-bg: var(--accent-50); --b-fg: var(--accent-800); --b-border: var(--accent-200); }

/* ------------------------------------------------------------ alertas -- */
.alert {
  --a-bg: var(--info-bg); --a-fg: var(--info-fg); --a-border: var(--info-border);
  display: flex; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--radius);
  background: var(--a-bg); border: 1px solid var(--a-border); color: var(--text); font-size: var(--text-sm);
}
.alert > .icon { color: var(--a-fg); margin-top: 2px; }
.alert-title { font-weight: 600; color: var(--a-fg); }
.alert-body { flex: 1; min-width: 0; }
.alert-close { margin-left: auto; background: none; border: 0; padding: 2px; color: var(--text-subtle); align-self: flex-start; }
.alert-success { --a-bg: var(--success-bg); --a-fg: var(--success-fg); --a-border: var(--success-border); }
.alert-warning { --a-bg: var(--warning-bg); --a-fg: var(--warning-fg); --a-border: var(--warning-border); }
.alert-danger { --a-bg: var(--danger-bg); --a-fg: var(--danger-fg); --a-border: var(--danger-border); }
.alert-neutral { --a-bg: var(--bg-subtle); --a-fg: var(--text-muted); --a-border: var(--border); }

/* -------------------------------------------------------------- abas -- */
.tabs { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-3);
  min-height: 44px; margin-bottom: -1px; white-space: nowrap;
  font-size: var(--text-sm); font-weight: 550; color: var(--text-muted);
  background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent-600); }
.tab:focus-visible { outline: none; box-shadow: inset var(--focus-ring); border-radius: 4px 4px 0 0; }
.tab .count { font-size: var(--text-xs); background: var(--bg-muted); color: var(--text-muted); border-radius: var(--radius-full); padding: 1px 7px; }
.tab-panel { padding-top: var(--s-5); }
.card .tabs { padding-inline: var(--s-3); }
@media (min-width: 768px) { .card .tabs { padding-inline: var(--s-4); } }

/* --------------------------------------------------------------- tabela -- */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th {
  text-align: left; font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.02em; color: var(--text-subtle);
  padding: var(--s-3) var(--s-4); background: var(--bg-subtle); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.1s var(--ease); }
.table tbody tr:hover { background: var(--bg-subtle); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.table .muted-row { opacity: 0.6; }
.row-link { color: inherit; text-decoration: none; font-weight: 600; }
.row-link:hover { color: var(--primary); }
.cell-title { font-weight: 600; color: var(--text); }
.cell-sub { font-size: var(--text-xs); color: var(--text-subtle); }

/* Tabela que vira lista de cartões no celular — cada <td data-label="...">
   mostra o próprio rótulo. Nada de rolagem horizontal escondida. */
@media (max-width: 767px) {
  .table-responsive thead { display: none; }
  .table-responsive, .table-responsive tbody, .table-responsive tr, .table-responsive td { display: block; width: 100%; }
  .table-responsive tr { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); }
  .table-responsive tr:last-child { border-bottom: 0; }
  .table-responsive td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: var(--s-3); text-align: right; }
  .table-responsive td::before { content: attr(data-label); color: var(--text-subtle); font-size: var(--text-xs); font-weight: 500; text-align: left; flex-shrink: 0; }
  .table-responsive td[data-label=""]::before, .table-responsive td:not([data-label])::before { content: none; }
  .table-responsive td.cell-primary { font-size: var(--text-base); padding-bottom: var(--s-2); justify-content: flex-start; text-align: left; }
  .table-responsive td.cell-primary::before { content: none; }
  .table-responsive td.actions { justify-content: flex-start; padding-top: var(--s-2); }
  .table-responsive td.actions .btn { flex: 1; }
  .table-responsive tbody tr:hover { background: transparent; }
}

/* Lista de definições (dados de cliente, resumo) */
.dl { display: grid; grid-template-columns: 1fr; gap: var(--s-1) var(--s-4); font-size: var(--text-sm); margin: 0; }
.dl dt { color: var(--text-subtle); }
.dl dd { margin: 0 0 var(--s-2); color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
@media (min-width: 640px) {
  .dl { grid-template-columns: minmax(120px, max-content) 1fr; }
  .dl dd { margin: 0; }
}
.summary-row { display: flex; justify-content: space-between; gap: var(--s-4); font-size: var(--text-sm); padding: var(--s-2) 0; }
.summary-row + .summary-row { border-top: 1px dashed var(--border); }
.summary-row dt { color: var(--text-muted); } .summary-row dd { margin: 0; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.summary-total { font-size: var(--text-lg); font-weight: 700; }
.summary-total dt { color: var(--text); }

/* ------------------------------------------------------ estatísticas -- */
.stat { padding: var(--s-4) var(--s-5); }
.stat-label { font-size: var(--text-sm); color: var(--text-muted); display: flex; align-items: center; gap: var(--s-2); }
.stat-value { font-size: var(--text-3xl); font-weight: 700; letter-spacing: -0.025em; margin-top: var(--s-1); font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-sub { font-size: var(--text-xs); color: var(--text-subtle); margin-top: var(--s-1); }
.stat-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--bg-muted); color: var(--text-muted); }

.bar-list { display: flex; flex-direction: column; gap: var(--s-3); }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-1) var(--s-3); font-size: var(--text-sm); align-items: center; }
.bar-track { grid-column: 1 / -1; height: 6px; background: var(--bg-muted); border-radius: var(--radius-full); overflow: hidden; }
.bar-fill { height: 100%; background: var(--gray-700); border-radius: inherit; }

/* ---------------------------------------------------------- vazio -- */
.empty { text-align: center; padding: var(--s-12) var(--s-6); color: var(--text-muted); }
.empty .icon { margin: 0 auto var(--s-3); color: var(--gray-400); }
.empty-title { font-weight: 600; color: var(--text); margin-bottom: var(--s-1); }

/* ---------------------------------------------------------- tooltip -- */
.tip { position: relative; display: inline-flex; color: var(--gray-400); cursor: help; }
.tip:hover, .tip:focus-visible { color: var(--text-muted); }
.tip-text {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: min(280px, 80vw); padding: var(--s-2) var(--s-3);
  background: var(--gray-900); color: #fff; font-size: var(--text-xs); font-weight: 400; line-height: 1.45; text-align: left;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transition: opacity 0.15s var(--ease); pointer-events: none; z-index: 2000;
}
.tip:hover .tip-text, .tip:focus-visible .tip-text, .tip:focus-within .tip-text { opacity: 1; visibility: visible; }

/* --------------------------------------------------------- disclosure -- */
.disclosure > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary .chev { transition: transform 0.2s var(--ease); color: var(--text-subtle); }
.disclosure[open] > summary .chev { transform: rotate(180deg); }

/* -------------------------------------------------------- breadcrumb -- */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1); font-size: var(--text-sm); color: var(--text-subtle); }
.breadcrumb a { text-decoration: none; color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .icon { color: var(--gray-300); }
.breadcrumb [aria-current] { color: var(--text); font-weight: 500; }

/* ------------------------------------------------------------ steps -- */
.steps { list-style: none; display: flex; flex-direction: column; gap: var(--s-2); }
.step { display: flex; align-items: center; gap: var(--s-3); font-size: var(--text-sm); color: var(--text-subtle); }
.step-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--border-strong); background: var(--surface); flex-shrink: 0; font-size: 11px; font-weight: 600; }
.step.is-done { color: var(--text-muted); }
.step.is-done .step-dot { background: var(--success-fg); border-color: var(--success-fg); color: #fff; }
.step.is-active { color: var(--text); font-weight: 600; }
.step.is-active .step-dot { border-color: var(--accent-600); color: var(--accent-700); }
.step.is-active .step-dot .spinner { width: 12px; height: 12px; border-width: 1.5px; }

/* Linha do tempo horizontal (status do pedido) */
.timeline { list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; }
.timeline li { position: relative; text-align: center; font-size: var(--text-xs); color: var(--text-subtle); padding-top: 30px; }
.timeline li::before { content: ""; position: absolute; top: 10px; left: 0; right: 0; height: 2px; background: var(--border); }
.timeline li:first-child::before { left: 50%; } .timeline li:last-child::before { right: 50%; }
.timeline li::after { content: ""; position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }
.timeline li.is-done { color: var(--text-muted); }
.timeline li.is-done::before { background: var(--success-fg); }
/* conector do passo atual: verde só na metade que vem do passo anterior */
.timeline li.is-current::before { background: linear-gradient(to right, var(--success-fg) 50%, var(--border) 50%); }
.timeline li.is-current:first-child::before { background: var(--border); }
.timeline li.is-done::after { background: var(--success-fg); border-color: var(--success-fg); }
.timeline li.is-current { color: var(--text); font-weight: 600; }
.timeline li.is-current::after { border-color: var(--accent-600); background: var(--accent-100); box-shadow: 0 0 0 4px var(--accent-50); }

/* ========================================================================
   LOJA
   ======================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 900; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--border);
}
.site-header .container { height: 100%; display: flex; align-items: center; gap: var(--s-4); }
.brand { display: inline-flex; align-items: center; gap: var(--s-2); text-decoration: none; color: var(--text); font-weight: 700; font-size: var(--text-lg); letter-spacing: -0.03em; }
.brand:hover { color: var(--text); }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--ink); color: #fff; display: grid; place-items: center; }
.brand-mark .icon { color: var(--accent-500); }
.site-nav { display: none; margin-left: auto; gap: var(--s-1); align-items: center; }
.site-nav a { text-decoration: none; padding: var(--s-2) var(--s-3); border-radius: var(--radius-sm); font-size: var(--text-sm); font-weight: 500; color: var(--text-muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); background: var(--bg-muted); }
.header-end { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }
@media (min-width: 900px) {
  .site-nav { display: flex; }
  .header-end { margin-left: var(--s-2); }
  .nav-toggle { display: none; }
}

.lang-menu { position: relative; }
.lang-menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 var(--s-3); border-radius: var(--radius-sm); font-size: var(--text-sm); font-weight: 500; color: var(--text-muted); cursor: pointer; }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu > summary:hover { background: var(--bg-muted); color: var(--text); }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; z-index: 950;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: var(--s-1);
}
.menu-pop a { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) var(--s-3); border-radius: var(--radius-sm); text-decoration: none; font-size: var(--text-sm); }
.menu-pop a:hover { background: var(--bg-muted); color: var(--text); }
.menu-pop a[aria-current="true"] { font-weight: 600; }

/* Gaveta (menu mobile da loja e sidebar do admin no celular) */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(9, 9, 11, 0.45); z-index: 990; opacity: 0; visibility: hidden; transition: opacity 0.2s var(--ease); }
.drawer {
  position: fixed; inset: 0 auto 0 0; width: min(320px, 86vw); z-index: 1000; background: var(--surface);
  transform: translateX(-100%); transition: transform 0.25s var(--ease); display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); visibility: hidden;
}
body.drawer-open { overflow: hidden; }
body.drawer-open .drawer { transform: none; visibility: visible; }
body.drawer-open .drawer-backdrop { opacity: 1; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--s-4); height: var(--header-h); border-bottom: 1px solid var(--border); }
.drawer-body { padding: var(--s-3); overflow-y: auto; flex: 1; }
.drawer-nav a { display: flex; align-items: center; gap: var(--s-3); min-height: 48px; padding: 0 var(--s-3); border-radius: var(--radius-sm); text-decoration: none; font-weight: 500; }
.drawer-nav a:hover, .drawer-nav a[aria-current="page"] { background: var(--bg-muted); color: var(--text); }

.site-footer { border-top: 1px solid var(--border); background: var(--bg-subtle); padding-block: var(--s-10) var(--s-8); font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--s-16); }
.footer-grid { display: grid; gap: var(--s-8); grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-title { font-weight: 600; color: var(--text); margin-bottom: var(--s-3); font-size: var(--text-sm); }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: var(--s-2); }
.footer-links a { text-decoration: none; }
.footer-bottom { margin-top: var(--s-8); padding-top: var(--s-6); border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3); font-size: var(--text-xs); color: var(--text-subtle); }

/* Hero */
.hero { padding-block: var(--s-10) var(--s-12); overflow: hidden; }
.hero-grid { display: grid; gap: var(--s-10); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 900px) { .hero { padding-block: var(--s-16) var(--s-20); } .hero-grid { grid-template-columns: 1.05fr 1fr; } }
.hero-media { position: relative; aspect-ratio: 1; max-width: 520px; width: 100%; margin-inline: auto; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.hero-media img { width: 100%; height: 100%; object-fit: contain; }
.hero-points { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); font-size: var(--text-sm); color: var(--text-muted); }
.hero-points li { display: inline-flex; align-items: center; gap: var(--s-2); }
.hero-points .icon { color: var(--success-fg); }

.how-step { padding: var(--s-6); }
.how-num { width: 36px; height: 36px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 700; margin-bottom: var(--s-4); }

/* Card de produto */
.product-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--border); transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease); }
.product-card:hover { color: inherit; box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-2px); }
.product-card-media { position: relative; aspect-ratio: 1; background: var(--bg-subtle); overflow: hidden; border-bottom: 1px solid var(--border); }
.product-card-media img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.4s var(--ease); }
.product-card:hover .product-card-media img { transform: scale(1.03); }
.product-card-media .badge { position: absolute; top: var(--s-3); left: var(--s-3); }
.product-card-body { padding: var(--s-4) var(--s-5) var(--s-5); display: flex; flex-direction: column; gap: var(--s-1); }
.product-card-name { font-weight: 650; font-size: var(--text-lg); }
.product-card-meta { font-size: var(--text-sm); color: var(--text-muted); }
.product-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: var(--s-3); }
.product-card.is-disabled { opacity: 0.6; pointer-events: none; }

/* Página de produto — configurador */
.configurator { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr); padding-block: var(--s-6) var(--s-12); }
@media (min-width: 1024px) {
  .configurator { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-10); padding-block: var(--s-8) var(--s-16); }
  .configurator-preview { position: sticky; top: calc(var(--header-h) + var(--s-6)); align-self: start; }
}
.preview-frame { position: relative; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 1; display: grid; place-items: center; }
.preview-frame > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; } /* placa é 120x140: cover (e height:100% em grid) cortava a cidade */
.preview-tag { position: absolute; top: var(--s-3); left: var(--s-3); }
.preview-caption { font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--s-3); display: flex; gap: var(--s-2); align-items: flex-start; }
.preview-caption .icon { margin-top: 3px; color: var(--text-subtle); }
.preview-progress { width: 100%; height: 100%; padding: var(--s-8); display: flex; flex-direction: column; justify-content: center; gap: var(--s-4); }
.preview-progress-title { font-weight: 650; display: flex; align-items: center; gap: var(--s-2); }
.preview-progress-detail { font-size: var(--text-xs); color: var(--text-subtle); font-style: italic; }
.preview-error { width: 100%; height: 100%; padding: var(--s-8); display: flex; align-items: center; justify-content: center; }

.config-head .eyebrow { margin-bottom: var(--s-2); }
.config-head .lead { font-size: var(--text-base); margin-top: var(--s-2); }
.config-price { display: flex; align-items: baseline; gap: var(--s-2); margin-top: var(--s-4); }
.config-section { padding-top: var(--s-6); margin-top: var(--s-6); border-top: 1px solid var(--border); }
.config-section-title { display: flex; align-items: center; gap: var(--s-3); font-size: var(--text-base); font-weight: 650; margin-bottom: var(--s-4); }
.config-section-num { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: var(--text-xs); font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }

.map-box { position: relative; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; isolation: isolate; }
#pin-map { height: 320px; width: 100%; background: var(--bg-muted); }
@media (min-width: 768px) { #pin-map { height: 380px; } }
.map-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); margin-top: var(--s-3); }
.map-meta { font-size: var(--text-sm); color: var(--text-muted); display: inline-flex; align-items: center; gap: var(--s-1); }
.search-status { font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--s-2); min-height: 1.4em; }
.search-alternatives { font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--s-1); display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); align-items: center; }
.search-alternatives a { color: var(--primary); }

.option-row + .option-row { margin-top: var(--s-4); }
.option-row .label { margin-bottom: var(--s-2); }

.poi-list { list-style: none; display: flex; flex-direction: column; gap: var(--s-1); max-height: 240px; overflow-y: auto; margin-top: var(--s-2); }
.poi-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding: var(--s-2) var(--s-3); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: var(--text-sm); }
.poi-list li .input { min-height: 36px; }

.buy-box { margin-top: var(--s-6); padding: var(--s-5); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-subtle); }
.buy-box-actions { display: grid; gap: var(--s-2); grid-template-columns: 1fr; margin-top: var(--s-4); }
@media (min-width: 480px) { .buy-box-actions { grid-template-columns: 1fr 1fr; } }
.buy-box-note { font-size: var(--text-xs); color: var(--text-subtle); margin-top: var(--s-3); display: flex; gap: var(--s-2); }

/* Barra de ação fixa no celular — o "Gerar prévia" sempre ao alcance do polegar */
.mobile-cta {
  position: fixed; inset: auto 0 0 0; z-index: 800; display: flex; gap: var(--s-2); align-items: center;
  padding: var(--s-3) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border); box-shadow: 0 -8px 24px -12px rgba(16, 24, 40, 0.18);
  transform: translateY(110%); transition: transform 0.25s var(--ease);
}
.mobile-cta.is-visible { transform: none; }
.mobile-cta .btn { flex: 1; }
.mobile-cta-price { font-weight: 700; font-variant-numeric: tabular-nums; padding-right: var(--s-2); }
@media (min-width: 1024px) { .mobile-cta { display: none; } }
body.has-mobile-cta .site-footer { padding-bottom: calc(var(--s-20) + env(safe-area-inset-bottom)); }

/* Checkout */
.checkout { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr); padding-block: var(--s-6) var(--s-12); }
@media (min-width: 900px) {
  .checkout { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s-10); }
  .checkout-summary { position: sticky; top: calc(var(--header-h) + var(--s-6)); align-self: start; }
}
.qty { display: inline-flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.qty button { width: 44px; border: 0; background: var(--surface); display: grid; place-items: center; color: var(--text-muted); }
.qty button:hover { background: var(--bg-muted); color: var(--text); }
.qty input { width: 56px; text-align: center; border: 0; border-inline: 1px solid var(--border); min-height: var(--control-h); font-size: 16px; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input:focus { outline: none; box-shadow: inset var(--focus-ring); }

.page-head { padding-block: var(--s-8) var(--s-2); }
.page-head .breadcrumb { margin-bottom: var(--s-3); }

/* ========================================================================
   ADMIN / PORTAL DA LOJA
   ======================================================================== */
.app { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); background: var(--bg-subtle); }
@media (min-width: 1024px) { .app { grid-template-columns: 248px minmax(0, 1fr); } }
.sidebar { display: none; }
@media (min-width: 1024px) {
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--border); }
}
.sidebar-head { height: var(--header-h); display: flex; align-items: center; padding: 0 var(--s-5); border-bottom: 1px solid var(--border); }
.sidebar-context { padding: var(--s-4) var(--s-5) var(--s-2); }
.sidebar-context .eyebrow { margin-bottom: 2px; }
.sidebar-context-name { font-weight: 600; font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: var(--s-2) var(--s-3); }
.side-nav a, .side-nav button {
  display: flex; align-items: center; gap: var(--s-3); min-height: 40px; padding: 0 var(--s-3); width: 100%;
  border-radius: var(--radius-sm); border: 0; background: none; text-decoration: none; text-align: left;
  font-size: var(--text-sm); font-weight: 500; color: var(--text-muted);
}
.side-nav a:hover, .side-nav button:hover { background: var(--bg-muted); color: var(--text); }
.side-nav a[aria-current="page"] { background: var(--bg-muted); color: var(--text); font-weight: 600; }
.side-nav a[aria-current="page"] .icon { color: var(--accent-700); }
.side-nav .icon { color: var(--text-subtle); }
.sidebar-foot { margin-top: auto; padding: var(--s-3); border-top: 1px solid var(--border); }

.app-main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 900; height: var(--header-h); display: flex; align-items: center; gap: var(--s-3); padding: 0 var(--s-4); background: var(--surface); border-bottom: 1px solid var(--border); }
@media (min-width: 1024px) { .topbar { display: none; } }
.app-content { padding: var(--s-5) var(--s-4) var(--s-12); width: 100%; max-width: 1280px; }
@media (min-width: 768px) { .app-content { padding: var(--s-8) var(--s-8) var(--s-16); } }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-6); }
.page-header .breadcrumb { margin-bottom: var(--s-2); width: 100%; }
.page-title { font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.02em; }
.page-desc { color: var(--text-muted); font-size: var(--text-sm); margin-top: var(--s-1); max-width: 70ch; }
.page-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-2); font-size: var(--text-sm); color: var(--text-muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }

.detail-grid { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .detail-grid { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }

.filters { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); }
.filters .input { max-width: 280px; }
@media (max-width: 639px) { .filters .input, .filters .select { max-width: none; flex: 1 1 100%; } }
.chip-group { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 var(--s-3); border-radius: var(--radius-full); border: 1px solid var(--border); background: var(--surface); text-decoration: none; font-size: var(--text-sm); font-weight: 500; color: var(--text-muted); }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .count { font-size: var(--text-xs); opacity: 0.75; font-variant-numeric: tabular-nums; }

.file-row { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) 0; }
.file-row + .file-row { border-top: 1px solid var(--border); }
.file-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--bg-muted); color: var(--text-muted); flex-shrink: 0; }
.file-name { font-weight: 550; font-size: var(--text-sm); overflow-wrap: anywhere; }
.file-meta { font-size: var(--text-xs); color: var(--text-subtle); }

.mockup-thumb { width: 100%; max-width: 320px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-subtle); }

/* Auth (admin/loja) */
.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--s-6) var(--s-4); background: var(--bg-subtle); }
.auth-card { width: 100%; max-width: 400px; }
.auth-brand { display: flex; justify-content: center; margin-bottom: var(--s-6); }

/* ------------------------------------------------------- utilitários -- */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: var(--s-1); } .mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); } .mt-6 { margin-top: var(--s-6); } .mt-8 { margin-top: var(--s-8); }
.mb-2 { margin-bottom: var(--s-2); } .mb-3 { margin-bottom: var(--s-3); } .mb-4 { margin-bottom: var(--s-4); } .mb-6 { margin-bottom: var(--s-6); }
.w-full { width: 100%; }
.text-center { text-align: center; } .text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.divider { height: 1px; background: var(--border); margin-block: var(--s-4); }
@media (max-width: 639px) { .hide-sm { display: none !important; } }
@media (min-width: 640px) { .show-sm-only { display: none !important; } }
.segmented .seg-btn:disabled { cursor: default; opacity: 1; }
.option-row .label { display: flex; }
.search-status:empty { min-height: 0; margin: 0; }
/* Celular/tablet: a coluna de decisão (status + próxima ação) vem primeiro */
@media (max-width: 1099px) { .detail-grid > aside { order: -1; } }
/* Muitas opções com rótulo longo: grade 2 colunas em vez de quebrar torto */
.segmented-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
.segmented-grid label { white-space: normal; text-align: center; line-height: 1.25; padding: 6px var(--s-2); min-height: 40px; }
.field > .qty { align-self: flex-start; }
.timeline li.is-current:last-child::before { background: var(--success-fg); }

/* Faixas de quantidade (página do produto e checkout) */
.tier-options { border: 0; padding: 0; margin-inline: 0; display: grid; gap: var(--s-2); }
.tier-options legend { padding: 0; margin-bottom: var(--s-2); }
.tier-option { align-items: center; padding: var(--s-3) var(--s-4); background: var(--surface); }
.tier-option-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tier-option-name { font-weight: 600; display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.tier-option-meta { font-size: var(--text-xs); color: var(--text-muted); }
.tier-save { color: var(--success-fg); font-weight: 600; }
.tier-option-total { font-weight: 700; white-space: nowrap; }
.tier-chips { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-top: var(--s-2); }
.tier-chips .chip { cursor: pointer; }
.tier-chips .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.tier-nudge { font-size: var(--text-xs); color: var(--success-fg); margin-top: var(--s-2); }

/* Prévia aprovada no resumo do checkout */
.approved-preview { margin: 0 0 var(--s-2); }
.approved-preview img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); }
.approved-preview figcaption { display: flex; gap: 6px; align-items: center; margin-top: var(--s-2); }

/* Dashboard: prévias por hora */
.traffic-bars { display: flex; align-items: flex-end; gap: 3px; height: 64px; }
.traffic-bars span { flex: 1 1 0; min-height: 2px; background: var(--accent-600); border-radius: 2px 2px 0 0; opacity: 0.85; }

/* Política de privacidade */
.privacy h2 { font-size: var(--text-lg); font-weight: 650; margin: var(--s-6) 0 var(--s-2); }
.privacy ul { padding-left: 1.2em; display: grid; gap: var(--s-2); }
.privacy a { color: var(--accent-700); }

/* Parâmetros por camada (presets/loja) */
.layer-settings { display: grid; gap: var(--s-3); }
.layer-fieldset legend { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: baseline; }
.layer-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.layer-grid .field { justify-content: flex-end; }
.layer-grid .input { width: 100%; }
