/* ==========================================================================
   FixFlow — sistema de design
   1. Tokens (tema escuro e claro)   6. Tabelas e listas
   2. Base                           7. Sobreposições (modal, gaveta, menus)
   3. Estrutura do workspace         8. Componentes de página
   4. Botões                         9. Autenticação e páginas públicas
   5. Formulários                   10. Site (landing)
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Manrope", "DM Sans", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "Cascadia Mono", monospace;

  --brand: #0a78f5;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px;
  --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px; --s-20: 80px; --s-24: 96px;
  --r-sm: 6px; --r-md: 9px; --r-lg: 12px; --r-xl: 18px; --r-full: 999px;
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14px; --fs-md: 15px; --fs-lg: 17px; --fs-xl: 20px; --fs-2xl: 26px;
  --sidebar-w: 248px; --sidebar-w-collapsed: 68px; --topbar-h: 60px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: 120ms; --t-med: 200ms;
  color-scheme: dark;

  /* Escuro (padrão) */
  --bg: #0a0c11;
  --bg-sunken: #07090d;
  --surface: #10131a;
  --surface-2: #151923;
  --surface-hover: #1a1f2b;
  --border: #1f2532;
  --border-strong: #2c3445;
  --text: #eef1f6;
  --text-2: #a3acbd;
  --text-3: #6f7a8e;
  --accent: #0b6ce8;
  --accent-hover: #2a82f7;
  --accent-text: #5aa2ff;
  --accent-soft: rgba(42, 130, 247, .14);
  --accent-ring: rgba(42, 130, 247, .45);
  --on-accent: #ffffff;
  --green: #2fbf71; --green-soft: rgba(47, 191, 113, .13);
  --red: #f0605a; --red-soft: rgba(240, 96, 90, .13); --red-strong: #d9423b;
  --amber: #f1a93a; --amber-soft: rgba(241, 169, 58, .14);
  --violet: #9d8cff; --violet-soft: rgba(157, 140, 255, .14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
  --scrim: rgba(3, 5, 9, .62);
  --skeleton: linear-gradient(90deg, #151923 0%, #1c2230 50%, #151923 100%);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6f8;
  --bg-sunken: #eceef2;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-hover: #f1f3f7;
  --border: #e3e6ec;
  --border-strong: #cfd4de;
  --text: #0e1320;
  --text-2: #4b5468;
  --text-3: #7a8396;
  --accent: #0a66dc;
  --accent-hover: #0857bd;
  --accent-text: #0a5fcf;
  --accent-soft: rgba(10, 102, 220, .09);
  --accent-ring: rgba(10, 102, 220, .35);
  --green: #138a4f; --green-soft: rgba(19, 138, 79, .1);
  --red: #c8352f; --red-soft: rgba(200, 53, 47, .09); --red-strong: #b42d27;
  --amber: #a8650b; --amber-soft: rgba(214, 140, 26, .13);
  --violet: #6750d6; --violet-soft: rgba(103, 80, 214, .1);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, .08);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, .16);
  --scrim: rgba(15, 20, 32, .38);
  --skeleton: linear-gradient(90deg, #eef0f4 0%, #f7f8fa 50%, #eef0f4 100%);
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-base)/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.is-locked { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 700; letter-spacing: -.015em; line-height: 1.2; color: var(--text); }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
[hidden] { display: none !important; }
.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; }
.num, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: .92em; letter-spacing: -.01em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.positive { color: var(--green); }
.negative { color: var(--red); }
.nowrap { white-space: nowrap; }
.eyebrow { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
i[data-lucide], svg.lucide { width: 16px; height: 16px; flex: none; stroke-width: 1.9; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: #0b0d12; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.brand__mark svg { width: 20px; height: 20px; }

/* 3. Estrutura do workspace ----------------------------------------------- */
.app-shell { min-height: 100vh; }
body.is-public .sidebar, body.is-public .topbar, body.is-public .sidebar-scrim { display: none; }
body.is-app .main { margin-left: var(--sidebar-w); transition: margin-left var(--t-med) var(--ease); }
body.is-app.sidebar-collapsed .main { margin-left: var(--sidebar-w-collapsed); }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: width var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.sidebar__head { height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; padding: 0 var(--s-4); border-bottom: 1px solid var(--border); }
.sidebar .sidebar__toggle { display: inline-flex; }
.sidebar .sidebar__close { display: none; }
.ws-chip { margin: var(--s-3) var(--s-3) var(--s-1); padding: 10px; display: flex; align-items: center; gap: 10px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.ws-chip__avatar { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 12px; flex: none; }
.ws-chip__text { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.ws-chip__text strong { font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-chip__text small { color: var(--text-3); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { flex: 1; overflow-y: auto; padding: var(--s-2) var(--s-3) var(--s-4); scrollbar-width: thin; }
.nav__section { margin: var(--s-4) var(--s-2) var(--s-1); font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.nav__item {
  position: relative; display: flex; align-items: center; gap: 11px;
  height: 36px; padding: 0 10px; margin: 1px 0;
  border-radius: var(--r-md); color: var(--text-2); font-weight: 500; font-size: var(--fs-base);
  white-space: nowrap; text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav__item:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.nav__item.is-active { background: var(--accent-soft); color: var(--text); }
.nav__item.is-active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent-hover); }
.nav__item.is-active i, .nav__item.is-active svg { color: var(--accent-text); }
.nav__label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav__badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-full); background: var(--surface-2); border: 1px solid var(--border); font-size: 11px; font-weight: 600; display: grid; place-items: center; color: var(--text-2); }
.nav__badge--alert { background: var(--red-soft); border-color: transparent; color: var(--red); }
.sidebar__foot { padding: var(--s-3); border-top: 1px solid var(--border); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
.plan-callout { padding: var(--s-3); border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); display: grid; gap: 6px; }
.plan-callout strong { font-size: var(--fs-sm); }
.plan-callout p { font-size: var(--fs-xs); color: var(--text-2); }
.user-row { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.user-row__button { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; border: 0; background: none; border-radius: var(--r-md); cursor: pointer; text-align: left; }
.user-row__button:hover { background: var(--surface-hover); }
.user-row__text { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.user-row__text strong { font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-row__text small { font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, #1b56c9, #0b2f73); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }

/* Sidebar recolhida (desktop) */
body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .sidebar .brand span:not(.brand__mark),
body.sidebar-collapsed .ws-chip__text,
body.sidebar-collapsed .nav__label,
body.sidebar-collapsed .nav__badge,
body.sidebar-collapsed .nav__section,
body.sidebar-collapsed .plan-callout,
body.sidebar-collapsed .user-row__text,
body.sidebar-collapsed .user-row > .btn { display: none; }
body.sidebar-collapsed .sidebar__head { padding: 0; justify-content: center; }
body.sidebar-collapsed .sidebar__head .brand { display: none; }
body.sidebar-collapsed .ws-chip { justify-content: center; padding: 8px 0; margin-inline: 10px; }
body.sidebar-collapsed .nav { padding-inline: 10px; }
body.sidebar-collapsed .nav__item { justify-content: center; padding: 0; }
body.sidebar-collapsed .nav__item.is-active::before { left: -10px; }
body.sidebar-collapsed .nav__section { height: 1px; margin: var(--s-3) 6px; background: var(--border); font-size: 0; }
body.sidebar-collapsed .user-row { justify-content: center; }
body.sidebar-collapsed .user-row__button { flex: none; padding: 4px; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: var(--s-3);
  padding: 0 var(--s-6);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .topbar__menu { display: none; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--fs-sm); color: var(--text-3); }
.crumbs strong { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.topbar__spacer { flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: var(--s-2); }
.global-search { position: relative; width: min(340px, 34vw); }
.global-search .input { padding-left: 34px; height: 36px; background: var(--surface); }
.global-search > i, .global-search > svg { position: absolute; left: 11px; top: 10px; color: var(--text-3); pointer-events: none; }
.global-search kbd { position: absolute; right: 8px; top: 8px; font: 500 11px var(--font-mono); color: var(--text-3); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; background: var(--surface-2); }
.icon-dot { position: absolute; top: 5px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--r-full); background: var(--red-strong); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }

.content { padding: var(--s-6) var(--s-6) var(--s-16); max-width: 1440px; margin: 0 auto; }
body.is-public .content { padding: 0; max-width: none; }
.content:focus { outline: none; }
.sidebar-scrim { position: fixed; inset: 0; z-index: 35; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity var(--t-med); }

/* 4. Botões ---------------------------------------------------------------- */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--text); --btn-border: var(--border-strong);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--r-md);
  border: 1px solid var(--btn-border); background: var(--btn-bg); color: var(--btn-fg);
  font: 600 var(--fs-sm)/1 var(--font-sans); white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.btn:hover { text-decoration: none; background: var(--surface-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn--primary { --btn-bg: var(--accent); --btn-fg: var(--on-accent); --btn-border: transparent; box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, var(--shadow-sm); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--secondary { --btn-bg: var(--surface); }
.btn--ghost { --btn-bg: transparent; --btn-border: transparent; color: var(--text-2); }
.btn--ghost:hover { color: var(--text); }
.btn--danger { --btn-bg: var(--red-strong); --btn-fg: #fff; --btn-border: transparent; }
.btn--danger:hover { background: #c4352e; }
.btn--danger-ghost { --btn-bg: transparent; --btn-border: transparent; color: var(--red); }
.btn--danger-ghost:hover { background: var(--red-soft); }
.btn--sm { height: 30px; padding: 0 10px; font-size: var(--fs-xs); border-radius: 7px; }
.btn--lg { height: 44px; padding: 0 20px; font-size: var(--fs-md); border-radius: var(--r-lg); }
.btn--block { width: 100%; }
.btn--icon { width: 36px; padding: 0; position: relative; }
.btn--icon.btn--sm { width: 30px; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--btn-fg) var(--btn-fg) transparent transparent; animation: spin .7s linear infinite; }
.link-button { border: 0; background: none; padding: 0; color: var(--accent-text); font-weight: 600; cursor: pointer; }
.link-button:hover { text-decoration: underline; text-underline-offset: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 5. Formulários ----------------------------------------------------------- */
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--surface-2); color: var(--text);
  font: 400 var(--fs-base)/1.4 var(--font-sans);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
:root[data-theme="light"] .input, :root[data-theme="light"] .select, :root[data-theme="light"] .textarea { background-color: #fff; }
.textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a93a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; cursor: pointer; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent-hover); box-shadow: 0 0 0 3px var(--accent-soft); }
.input:disabled, .select:disabled, .textarea:disabled { opacity: .6; cursor: not-allowed; }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
input[type="date"].input { color-scheme: inherit; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group__prefix { position: absolute; left: 12px; color: var(--text-3); font-size: var(--fs-sm); pointer-events: none; }
.input-group__prefix + .input { padding-left: 38px; }
.input-group__suffix { position: absolute; right: 12px; color: var(--text-3); font-size: var(--fs-sm); pointer-events: none; }

.field { display: grid; gap: 6px; min-width: 0; }
.field__label { font-size: var(--fs-sm); font-weight: 600; color: var(--text); display: flex; gap: 6px; align-items: baseline; }
.field__label small { font-weight: 400; color: var(--text-3); }
.field__hint { font-size: var(--fs-xs); color: var(--text-3); }
.field__error { font-size: var(--fs-xs); color: var(--red); font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.form-section { display: grid; gap: var(--s-4); }
.form-section + .form-section { padding-top: var(--s-5); border-top: 1px solid var(--border); }
.form-section__title { font-size: var(--fs-md); }
.form-alert { padding: 10px 12px; border-radius: var(--r-md); background: var(--red-soft); color: var(--red); font-size: var(--fs-sm); font-weight: 500; display: flex; gap: 8px; align-items: flex-start; }
.form-alert--info { background: var(--accent-soft); color: var(--accent-text); }
.form-alert--warning { background: var(--amber-soft); color: var(--amber); }
.form-alert--success { background: var(--green-soft); color: var(--green); }
.form-alert .link-button { color: inherit; text-decoration: underline; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--fs-sm); color: var(--text-2); }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); }
.segmented button { height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; white-space: nowrap; }
.segmented button:hover { color: var(--text); }
.segmented button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }

/* Itens de pedido (vendas e compras) */
.line-items { display: grid; gap: var(--s-2); }
.line-item { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(80px, .8fr) minmax(110px, 1fr) minmax(90px, .9fr) 32px; gap: var(--s-2); align-items: start; }
.line-item__total { height: 38px; display: flex; align-items: center; justify-content: flex-end; font-weight: 600; font-variant-numeric: tabular-nums; }
.line-items__head { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(80px, .8fr) minmax(110px, 1fr) minmax(90px, .9fr) 32px; gap: var(--s-2); font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.line-items__head span:nth-child(4) { text-align: right; }
.totals { margin-left: auto; width: min(320px, 100%); display: grid; gap: 6px; font-size: var(--fs-sm); }
.totals div { display: flex; justify-content: space-between; gap: var(--s-4); color: var(--text-2); }
.totals div strong { color: var(--text); font-variant-numeric: tabular-nums; }
.totals .totals__grand { padding-top: 8px; border-top: 1px solid var(--border); font-size: var(--fs-md); color: var(--text); }

/* 6. Tabelas e listas ------------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border); }
.card__head--plain { border-bottom: 0; padding-bottom: 0; }
.card__title { font-size: var(--fs-md); font-weight: 700; }
.card__sub { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }
.card__body { padding: var(--s-5); }
.card__foot { padding: var(--s-3) var(--s-5); border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); }
.toolbar .search { position: relative; flex: 1 1 220px; max-width: 360px; }
.toolbar .search .input { padding-left: 34px; height: 36px; }
.toolbar .search > i, .toolbar .search > svg { position: absolute; left: 11px; top: 10px; color: var(--text-3); pointer-events: none; }
.toolbar .select { width: auto; height: 36px; min-width: 150px; }
.toolbar__spacer { flex: 1; }
.selection-bar { display: flex; align-items: center; gap: var(--s-3); padding: 8px var(--s-4); background: var(--accent-soft); border-bottom: 1px solid var(--border); font-size: var(--fs-sm); font-weight: 600; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
.table th { position: sticky; top: 0; padding: 10px var(--s-4); text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.table th button:hover { color: var(--text); }
.table td { padding: 12px var(--s-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--surface-hover); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.is-clickable { cursor: pointer; }
.table .col-check { width: 44px; padding-right: 0; }
.table .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.table .align-right { text-align: right; }
.table .cell-main { display: grid; gap: 2px; min-width: 0; }
.table .cell-main strong { font-weight: 600; color: var(--text); }
.table .cell-main small { color: var(--text-3); font-size: var(--fs-xs); }
.table td.is-muted { color: var(--text-3); }
.row-actions { display: inline-flex; gap: 2px; opacity: .7; transition: opacity var(--t-fast); }
tr:hover .row-actions, .row-actions:focus-within { opacity: 1; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text-2); }
.pager__buttons { display: flex; gap: var(--s-1); }

.list { display: grid; }
.list-row { display: flex; align-items: center; gap: var(--s-3); padding: 12px var(--s-5); border-bottom: 1px solid var(--border); min-width: 0; text-decoration: none; color: inherit; }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover, button.list-row:hover { background: var(--surface-hover); text-decoration: none; }
button.list-row { width: 100%; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; cursor: pointer; }
.list-row__main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.list-row__main strong { font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row__main small { color: var(--text-3); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row__meta { text-align: right; font-size: var(--fs-sm); display: grid; gap: 2px; justify-items: end; }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--r-full); font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge--plain::before { display: none; }
.badge--blue { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.badge--green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge--red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.badge--amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.badge--violet { background: var(--violet-soft); color: var(--violet); border-color: transparent; }

.empty { display: grid; justify-items: center; gap: var(--s-2); padding: var(--s-12) var(--s-6); text-align: center; }
.empty__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); margin-bottom: var(--s-2); }
.empty__icon i, .empty__icon svg { width: 20px; height: 20px; }
.empty h3 { font-size: var(--fs-md); }
.empty p { max-width: 380px; color: var(--text-2); font-size: var(--fs-sm); }
.empty .btn { margin-top: var(--s-3); }
.empty--compact { padding: var(--s-8) var(--s-4); }

.skeleton { display: block; border-radius: 6px; background: var(--skeleton); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; }
.skeleton-rows { display: grid; gap: 14px; padding: var(--s-5); }
.skeleton-rows .skeleton { height: 14px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.error-state { display: grid; justify-items: center; gap: var(--s-2); padding: var(--s-10) var(--s-6); text-align: center; }
.error-state p { color: var(--text-2); max-width: 420px; }

/* 7. Sobreposições --------------------------------------------------------- */
.overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: var(--s-4); background: var(--scrim); animation: fade-in var(--t-med) var(--ease); }
.modal { width: min(560px, 100%); min-width: 0; max-width: 100%; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); animation: pop-in var(--t-med) var(--ease); }
.modal--lg { width: min(820px, 100%); }
.modal--sm { width: min(440px, 100%); }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); padding: var(--s-5) var(--s-6) var(--s-4); }
.modal__head h2 { font-size: var(--fs-xl); }
.modal__head p { color: var(--text-2); font-size: var(--fs-sm); margin-top: 4px; }
.modal__body { padding: 0 var(--s-6) var(--s-5); overflow-y: auto; display: grid; gap: var(--s-4); }
.modal__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-2); padding: var(--s-4) var(--s-6); border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.modal__foot--split { justify-content: space-between; }
.overlay--drawer { place-items: stretch end; padding: 0; }
.drawer { width: min(560px, 100vw); min-width: 0; max-width: 100vw; height: 100%; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: slide-in var(--t-med) var(--ease); }
.drawer--wide { width: min(720px, 100vw); }
.drawer__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); padding: var(--s-5) var(--s-6); border-bottom: 1px solid var(--border); }
.drawer__head h2 { font-size: var(--fs-xl); overflow-wrap: anywhere; }
.drawer__body { flex: 1; overflow-y: auto; padding: var(--s-5) var(--s-6) var(--s-8); display: grid; gap: var(--s-6); align-content: start; }
.drawer__foot { display: flex; gap: var(--s-2); justify-content: flex-end; flex-wrap: wrap; padding: var(--s-4) var(--s-6); border-top: 1px solid var(--border); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }

.popover { position: absolute; z-index: 60; top: calc(100% + 8px); right: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 6px; animation: pop-in var(--t-fast) var(--ease); }
.popover--wide { width: min(400px, calc(100vw - 24px)); padding: 0; }
.popover--left { left: 0; right: auto; }
.popover__head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.popover__head strong { font-size: var(--fs-sm); }
.popover__scroll { max-height: min(460px, 70vh); overflow-y: auto; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 7px; background: none; color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; text-align: left; cursor: pointer; text-decoration: none; }
.menu-item:hover, .menu-item.is-focused { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.menu-item--danger { color: var(--red); }
.menu-sep { height: 1px; margin: 6px 4px; background: var(--border); }
.menu-label { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }

.notice { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); width: 100%; border-left: 0; border-right: 0; border-top: 0; background: none; text-align: left; cursor: pointer; color: inherit; }
.notice:hover { background: var(--surface-hover); }
.notice:last-child { border-bottom: 0; }
.notice__dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; flex: none; background: var(--text-3); }
.notice--danger .notice__dot { background: var(--red); }
.notice--warning .notice__dot { background: var(--amber); }
.notice--info .notice__dot { background: var(--accent-hover); }
.notice.is-read { opacity: .62; }
.notice__text { display: grid; gap: 2px; min-width: 0; }
.notice__text strong { font-size: var(--fs-sm); }
.notice__text span { font-size: var(--fs-xs); color: var(--text-2); }

.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 6px; max-height: 420px; overflow-y: auto; min-width: 300px; }
.search-results .menu-item small { margin-left: auto; color: var(--text-3); font-size: 11px; }
.search-results .menu-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toasts { position: fixed; z-index: 100; right: var(--s-5); bottom: var(--s-5); display: grid; gap: var(--s-2); width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); font-size: var(--fs-sm); animation: pop-in var(--t-med) var(--ease); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: all var(--t-med); }
.toast > i, .toast > svg { margin-top: 2px; }
.toast--success > i, .toast--success > svg { color: var(--green); }
.toast--error > i, .toast--error > svg { color: var(--red); }
.toast--info > i, .toast--info > svg { color: var(--accent-text); }
.toast__text { flex: 1; }
.toast .link-button { font-size: var(--fs-sm); }

/* 8. Componentes de página ------------------------------------------------- */
.page { display: grid; gap: var(--s-5); animation: page-in var(--t-med) var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.page-head h1 { font-size: var(--fs-2xl); margin-top: 4px; }
.page-head__sub { color: var(--text-2); margin-top: 6px; max-width: 640px; }
.page-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s-3); }
.stat { position: relative; padding: var(--s-4) var(--s-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); display: grid; gap: 6px; min-width: 0; box-shadow: var(--shadow-sm); }
a.stat:hover, button.stat:hover { border-color: var(--border-strong); text-decoration: none; }
button.stat { text-align: left; cursor: pointer; font: inherit; color: inherit; }
.stat__label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }
.stat__label i, .stat__label svg { color: var(--text-3); }
.stat__value { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat__hint { font-size: var(--fs-xs); color: var(--text-3); }
.stat--danger .stat__value { color: var(--red); }
.stat--success .stat__value { color: var(--green); }
.stat.is-active { border-color: var(--accent-hover); box-shadow: 0 0 0 1px var(--accent-hover); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--s-4); align-items: start; }
.stack { display: grid; gap: var(--s-4); }
.banner { display: flex; align-items: center; gap: var(--s-4); padding: var(--s-4) var(--s-5); border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.banner__icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.banner__text { flex: 1; min-width: 220px; display: grid; gap: 2px; }
.banner__text strong { font-size: var(--fs-md); }
.banner__text p { color: var(--text-2); font-size: var(--fs-sm); }
.banner--warning .banner__icon { background: var(--amber-soft); color: var(--amber); }

.progress { height: 6px; border-radius: var(--r-full); background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--accent-hover); transition: width .5s var(--ease); }
.progress--danger > span { background: var(--red); }
.progress--warning > span { background: var(--amber); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px var(--s-5); font-size: var(--fs-sm); }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.section-title { font-size: var(--fs-md); margin-bottom: var(--s-3); display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); }

.timeline { display: grid; gap: 0; }
.timeline__item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding-bottom: var(--s-4); position: relative; }
.timeline__item::before { content: ""; position: absolute; left: 13px; top: 26px; bottom: 0; width: 1px; background: var(--border); }
.timeline__item:last-child::before { display: none; }
.timeline__icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.timeline__icon i, .timeline__icon svg { width: 13px; height: 13px; }
.timeline__body { display: grid; gap: 2px; padding-top: 4px; min-width: 0; }
.timeline__body strong { font-size: var(--fs-sm); font-weight: 500; }
.timeline__body small { color: var(--text-3); font-size: var(--fs-xs); }
.timeline__comment { margin-top: 4px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); font-size: var(--fs-sm); white-space: pre-wrap; overflow-wrap: anywhere; }

/* Gráficos: paleta categórica validada (azul / laranja) em cada tema. */
:root { --series-1: #3987e5; --series-2: #d95926; }
:root[data-theme="light"] { --series-1: #2a78d6; --series-2: #eb6834; }
.chart-box { width: 100%; min-height: 220px; }
.chart { display: block; overflow: visible; }
.chart text { fill: var(--text-3); font: 500 11px var(--font-sans); font-variant-numeric: tabular-nums; }
.chart .grid line { stroke: var(--border); stroke-width: 1; }
.chart .series-1 { fill: var(--series-1); }
.chart .series-2 { fill: var(--series-2); }
.chart rect.hit { fill: transparent; cursor: default; outline: none; }
.chart g.col.is-hover rect.hit, .chart rect.hit:focus-visible { fill: var(--surface-hover); fill-opacity: .55; }
.chart g.col path { pointer-events: none; }
.chart g.col.is-hover path { filter: brightness(1.12); }
.legend { display: flex; gap: var(--s-4); font-size: var(--fs-xs); color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.swatch.series-1, .swatch-line.series-1 { background: var(--series-1); }
.swatch.series-2, .swatch-line.series-2 { background: var(--series-2); }
.swatch-line { width: 12px; height: 2px; border-radius: 2px; display: inline-block; }
.chart-table summary { cursor: pointer; font-size: var(--fs-xs); color: var(--text-2); font-weight: 600; margin-top: var(--s-3); }
.chart-table .table { margin-top: var(--s-2); }

/* Prévia de recurso pago no painel (ex.: gráfico do Free): barras decorativas
   desfocadas com uma chamada para upgrade por cima. */
.dash-teaser__body { position: relative; min-height: 240px; overflow: hidden; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.dash-teaser__chart { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 14px; padding: var(--s-5) var(--s-6) var(--s-8); filter: blur(3px) saturate(.7); opacity: .5; }
.dash-teaser__chart span { flex: 1; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, var(--series-1), var(--accent-soft)); }
.dash-teaser__overlay { position: relative; z-index: 1; display: grid; justify-items: center; gap: 8px; text-align: center; padding: var(--s-8) var(--s-6); background: linear-gradient(180deg, transparent, var(--surface) 55%); }
.dash-teaser__overlay .empty__icon { background: var(--accent-soft); color: var(--accent-text); }
.dash-teaser__overlay h3 { font-size: var(--fs-md); }
.dash-teaser__overlay p { max-width: 360px; color: var(--text-2); font-size: var(--fs-sm); }
.dash-teaser__overlay .btn { margin-top: 4px; }
.chart-tooltip { position: fixed; z-index: 90; pointer-events: none; padding: 8px 10px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-md); font-size: var(--fs-xs); display: grid; gap: 2px; }
.bars-h { display: grid; gap: 12px; }
.bars-h__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: var(--fs-sm); }
.bars-h__row .progress { grid-column: 1 / -1; }

.plan-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
.plan-card { position: relative; display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); }
.plan-card--featured { border-color: var(--accent-hover); box-shadow: 0 0 0 1px var(--accent-hover), var(--shadow-md); }
.plan-card__tag { position: absolute; top: -11px; left: var(--s-6); height: 22px; padding: 0 10px; border-radius: var(--r-full); background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; letter-spacing: .02em; }
.plan-card__price { font-family: var(--font-display); font-size: 32px; font-weight: 800; letter-spacing: -.03em; }
.plan-card__price small { font-size: var(--fs-sm); color: var(--text-3); font-weight: 500; letter-spacing: 0; }
.plan-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: var(--fs-sm); color: var(--text-2); flex: 1; }
.plan-card li { display: flex; gap: 10px; align-items: flex-start; }
.plan-card li i, .plan-card li svg { color: var(--accent-text); margin-top: 2px; }
.usage-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s-4); }
.usage { display: grid; gap: 6px; font-size: var(--fs-sm); }
.usage__top { display: flex; justify-content: space-between; gap: 8px; color: var(--text-2); }
.usage__top strong { color: var(--text); font-variant-numeric: tabular-nums; }

.danger-zone { border-color: color-mix(in srgb, var(--red) 40%, var(--border)); }
.danger-zone .card__title { color: var(--red); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-4) 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.setting-row:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-row:first-child { padding-top: 0; }
.setting-row__text { display: grid; gap: 2px; max-width: 560px; }
.setting-row__text strong { font-size: var(--fs-sm); }
.setting-row__text p { font-size: var(--fs-xs); color: var(--text-2); }
.tabs { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs button { height: 40px; padding: 0 var(--s-3); border: 0; background: none; color: var(--text-2); font-weight: 600; font-size: var(--fs-sm); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.is-active { color: var(--text); border-bottom-color: var(--accent-hover); }
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s-3); }
.report-tile { display: grid; gap: 6px; padding: var(--s-4); text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-lg); cursor: pointer; color: inherit; }
.report-tile:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.report-tile.is-active { border-color: var(--accent-hover); box-shadow: 0 0 0 1px var(--accent-hover); }
.report-tile:disabled { cursor: not-allowed; opacity: .6; }
.report-tile:disabled:hover { background: var(--surface); border-color: var(--border); }
.report-tile strong { font-size: var(--fs-sm); }
.report-tile span { font-size: var(--fs-xs); color: var(--text-2); }
.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.help-article h3 { font-size: var(--fs-md); margin-bottom: var(--s-2); }
.help-article ol, .help-article ul { margin: 0; padding-left: 18px; color: var(--text-2); font-size: var(--fs-sm); display: grid; gap: 6px; }

/* Carregamento inicial */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot__mark { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #0b0d12; animation: breathe 1.4s ease-in-out infinite; }
.boot__mark svg { width: 28px; height: 28px; }
@keyframes breathe { 50% { opacity: .55; transform: scale(.96); } }

/* 9. Autenticação e páginas públicas -------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); background: var(--bg); }
.auth__panel { display: flex; flex-direction: column; padding: var(--s-8) clamp(24px, 6vw, 88px); }
.auth__top { display: flex; justify-content: space-between; align-items: center; }
.auth__form { width: min(400px, 100%); margin: auto; padding: var(--s-10) 0; display: grid; gap: var(--s-5); }
.auth__form h1 { font-size: 28px; }
.auth__form > p { color: var(--text-2); }
.auth__form form { display: grid; gap: var(--s-4); }
.auth__switch { font-size: var(--fs-sm); color: var(--text-2); text-align: center; }
.auth__aside { position: relative; overflow: hidden; background: #070a10; color: #e9eef7; padding: clamp(32px, 5vw, 72px); display: flex; flex-direction: column; justify-content: center; gap: var(--s-6); border-left: 1px solid #141a26; }
.auth__aside::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 380px at 85% 15%, rgba(10, 120, 245, .22), transparent 70%); pointer-events: none; }
.auth__aside > * { position: relative; }
.auth__aside h2 { color: #fff; font-size: clamp(24px, 2.6vw, 34px); max-width: 520px; }
.auth__aside p { color: #9aa6ba; max-width: 480px; }
.auth__points { display: grid; gap: var(--s-3); margin: 0; padding: 0; list-style: none; }
.auth__points li { display: flex; gap: 12px; align-items: flex-start; color: #c9d3e3; font-size: var(--fs-md); }
.auth__points li i, .auth__points li svg { color: #5aa2ff; margin-top: 3px; }
.password-field { position: relative; }
.password-field .input { padding-right: 42px; }
.password-field button { position: absolute; right: 4px; top: 4px; }
.consent { font-size: var(--fs-sm); color: var(--text-2); align-items: flex-start; }
.consent input { margin-top: 2px; }
.sessions-choice { display: grid; gap: var(--s-2); }
.sessions-choice label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); cursor: pointer; font-size: var(--fs-sm); }
.sessions-choice label:has(input:checked) { border-color: var(--accent-hover); background: var(--accent-soft); }

.public-page { min-height: 100vh; background: var(--bg); }
.public-bar { position: sticky; top: 0; z-index: 20; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: 0 clamp(16px, 4vw, 40px); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.doc { width: min(780px, 100%); margin: 0 auto; padding: var(--s-12) var(--s-4) var(--s-20); display: grid; gap: var(--s-6); }
.doc h1 { font-size: clamp(28px, 4vw, 40px); }
.doc__intro { font-size: var(--fs-lg); color: var(--text-2); }
.doc__meta { font-size: var(--fs-sm); color: var(--text-3); }
.doc__toc { padding: var(--s-5); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.doc__toc ol { margin: var(--s-3) 0 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text-2); font-size: var(--fs-sm); columns: 2; }
.doc section { display: grid; gap: var(--s-2); scroll-margin-top: 80px; }
.doc section h2 { font-size: var(--fs-xl); }
.doc section p { color: var(--text-2); line-height: 1.7; }
.state-page { min-height: 100vh; display: grid; place-items: center; padding: var(--s-6); }
.state-card { width: min(520px, 100%); display: grid; gap: var(--s-4); justify-items: center; text-align: center; padding: var(--s-10) var(--s-8); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-md); }
.state-card h1 { font-size: 24px; }
.state-card p { color: var(--text-2); }
.state-card__icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.state-card__icon i, .state-card__icon svg { width: 24px; height: 24px; }

/* 10. Site (landing) — identidade fixa em azul e preto --------------------- */
.site {
  --site-bg: #06080c; --site-surface: #0d1118; --site-surface-2: #121722; --site-border: #1a2130; --site-border-strong: #273042;
  --site-text: #f2f5fa; --site-text-2: #a2adbf; --site-text-3: #6c7789; --site-accent: #2a82f7; --site-accent-text: #6aaeff;
  background: var(--site-bg); color: var(--site-text); font-size: var(--fs-md); min-height: 100vh; overflow-x: clip;
}
.site h1, .site h2, .site h3 { color: var(--site-text); }
.site .btn { --btn-bg: var(--site-surface); --btn-fg: var(--site-text); --btn-border: var(--site-border-strong); }
.site .btn:hover { background: var(--site-surface-2); }
.site .btn--primary { --btn-bg: #0b6ce8; --btn-fg: #fff; --btn-border: transparent; }
.site .btn--primary:hover { background: #2a82f7; }
.site .btn--ghost { --btn-bg: transparent; --btn-border: transparent; color: var(--site-text-2); }
.site .btn--ghost:hover { color: var(--site-text); background: rgba(255, 255, 255, .05); }
.site .brand { color: var(--site-text); }
.site-wrap { width: min(1180px, 100%); margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }
.site-nav { position: sticky; top: 0; z-index: 30; transition: background var(--t-med), border-color var(--t-med); border-bottom: 1px solid transparent; }
.site-nav.is-scrolled { background: rgba(6, 8, 12, .82); backdrop-filter: blur(12px); border-bottom-color: var(--site-border); }
.site-nav .site-wrap { height: 68px; display: flex; align-items: center; gap: var(--s-8); }
.site-nav__links { display: flex; gap: var(--s-6); margin-right: auto; }
.site-nav__links a { color: var(--site-text-2); font-size: var(--fs-sm); font-weight: 500; }
.site-nav__links a:hover { color: var(--site-text); text-decoration: none; }
.site-nav__actions { display: flex; gap: var(--s-2); align-items: center; }
.site-nav__menu { display: none; }
.site-mobile-menu { display: none; }

.hero { position: relative; padding: clamp(48px, 8vw, 96px) 0 0; }
.hero::before { content: ""; position: absolute; inset: -68px 0 auto; height: 760px; background: radial-gradient(700px 420px at 50% 0%, rgba(11, 108, 232, .2), transparent 70%); pointer-events: none; }
.hero::after { content: ""; position: absolute; inset: -68px 0 auto; height: 760px; background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(ellipse 60% 55% at 50% 20%, #000 30%, transparent 75%); pointer-events: none; }
.hero__inner { position: relative; z-index: 1; display: grid; justify-items: center; text-align: center; gap: var(--s-6); }
.hero__pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 6px; border-radius: var(--r-full); border: 1px solid var(--site-border-strong); background: rgba(13, 17, 24, .7); font-size: var(--fs-sm); color: var(--site-text-2); }
.hero__pill b { height: 20px; padding: 0 8px; border-radius: var(--r-full); background: rgba(42, 130, 247, .16); color: var(--site-accent-text); font-size: 11px; display: grid; place-items: center; letter-spacing: .02em; }
.hero h1 { font-size: clamp(36px, 6.2vw, 68px); line-height: 1.04; letter-spacing: -.035em; max-width: 920px; font-weight: 800; }
.hero h1 .typed { color: var(--site-accent-text); white-space: nowrap; }
.hero h1 .typed-caret { display: inline-block; width: 3px; height: .86em; margin-left: 4px; vertical-align: -0.06em; background: var(--site-accent-text); animation: caret 1s steps(1) infinite; border-radius: 2px; }
@keyframes caret { 50% { opacity: 0; } }
.hero__lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--site-text-2); max-width: 680px; line-height: 1.6; }
.hero__cta { display: flex; gap: var(--s-3); flex-wrap: wrap; justify-content: center; }
.hero__notes { display: flex; gap: var(--s-5); flex-wrap: wrap; justify-content: center; font-size: var(--fs-sm); color: var(--site-text-3); }
.hero__notes span { display: inline-flex; align-items: center; gap: 6px; }
.hero__notes i, .hero__notes svg { color: var(--site-accent-text); }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* Demonstração do workspace no hero (ilustrativa, construída em HTML) */
.showcase { position: relative; z-index: 1; margin: clamp(40px, 6vw, 72px) auto 0; width: min(1120px, 100%); perspective: 1600px; }
.showcase__frame { border-radius: 16px; border: 1px solid var(--site-border-strong); background: #0b0e14; box-shadow: 0 40px 120px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .03) inset; overflow: hidden; transform: rotateX(8deg); transform-origin: 50% 0; transition: transform 1s var(--ease); }
.showcase.is-visible .showcase__frame { transform: none; }
.showcase__bar { height: 36px; display: flex; align-items: center; gap: 6px; padding: 0 14px; border-bottom: 1px solid var(--site-border); background: #0d1118; }
.showcase__bar i { width: 10px; height: 10px; border-radius: 50%; background: #232a38; }
.showcase__bar span { margin: 0 auto; height: 20px; padding: 0 40px; border-radius: 6px; background: #121722; color: var(--site-text-3); font-size: 11px; display: grid; place-items: center; }
.showcase__app { display: grid; grid-template-columns: 196px 1fr; min-height: 440px; text-align: left; }
.sc-side { border-right: 1px solid var(--site-border); padding: 14px 10px; display: grid; align-content: start; gap: 3px; background: #0d1118; }
.sc-side .brand { font-size: 14px; margin: 0 6px 14px; }
.sc-side .brand__mark { width: 22px; height: 22px; border-radius: 6px; }
.sc-side .brand__mark svg { width: 15px; height: 15px; }
.sc-nav { display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 9px; border-radius: 7px; font-size: 12.5px; color: var(--site-text-3); }
.sc-nav svg, .sc-nav i { width: 14px; height: 14px; }
.sc-nav.is-active { background: rgba(42, 130, 247, .13); color: var(--site-text); }
.sc-nav.is-active svg { color: var(--site-accent-text); }
.sc-main { padding: 18px 20px; display: grid; gap: 14px; align-content: start; background: #0a0c11; }
.sc-head { display: flex; justify-content: space-between; align-items: center; }
.sc-head strong { font: 700 16px var(--font-display); }
.sc-head small { display: block; color: var(--site-text-3); font-size: 11.5px; }
.sc-btn { height: 28px; padding: 0 12px; border-radius: 7px; background: #0b6ce8; color: #fff; font-size: 11.5px; font-weight: 600; display: grid; place-items: center; }
.sc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.sc-stat { padding: 11px 12px; border-radius: 10px; border: 1px solid var(--site-border); background: #0d1118; display: grid; gap: 3px; }
.sc-stat span { font-size: 10.5px; color: var(--site-text-3); font-weight: 600; }
.sc-stat strong { font: 700 17px var(--font-display); font-variant-numeric: tabular-nums; }
.sc-stat em { font-style: normal; font-size: 10.5px; color: #4fd18b; }
.sc-stat em.down { color: #f0605a; }
.sc-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 10px; }
.sc-card { border-radius: 10px; border: 1px solid var(--site-border); background: #0d1118; padding: 12px; display: grid; gap: 10px; align-content: start; }
.sc-card > strong { font-size: 12px; }
.sc-chart { display: flex; align-items: flex-end; gap: 10px; height: 118px; padding-top: 6px; border-bottom: 1px solid var(--site-border); }
.sc-chart div { flex: 1; display: flex; gap: 3px; align-items: flex-end; height: 100%; }
.sc-chart b { flex: 1; border-radius: 3px 3px 0 0; background: #2a82f7; transform-origin: bottom; animation: grow 1s var(--ease) both; }
.sc-chart b + b { background: #2a3345; }
@keyframes grow { from { transform: scaleY(0); } }
.sc-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; padding: 6px 0; border-bottom: 1px solid var(--site-border); }
.sc-row:last-child { border-bottom: 0; }
.sc-row span:first-child { flex: 1; min-width: 0; color: var(--site-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-row .sc-tag { flex: none; }
.sc-tag { height: 18px; padding: 0 7px; border-radius: 99px; font-size: 10px; font-weight: 600; display: grid; place-items: center; }
.sc-tag--amber { background: rgba(241, 169, 58, .14); color: #f1a93a; }
.sc-tag--red { background: rgba(240, 96, 90, .14); color: #f0605a; }
.sc-tag--blue { background: rgba(42, 130, 247, .14); color: #6aaeff; }
.sc-tag--green { background: rgba(47, 191, 113, .14); color: #4fd18b; }
.showcase__fade { position: absolute; left: 0; right: 0; bottom: -2px; height: 140px; background: linear-gradient(transparent, var(--site-bg)); pointer-events: none; }

.site-section { padding: clamp(64px, 9vw, 112px) 0; position: relative; }
.site-section--line { border-top: 1px solid var(--site-border); }
.section-head { display: grid; gap: var(--s-3); max-width: 680px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head--center { margin-inline: auto; text-align: center; justify-items: center; }
.section-head .eyebrow { color: var(--site-accent-text); }
.section-head h2 { font-size: clamp(28px, 3.6vw, 42px); letter-spacing: -.03em; line-height: 1.1; }
.section-head p { color: var(--site-text-2); font-size: var(--fs-lg); line-height: 1.6; }

.pains { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--site-border); border: 1px solid var(--site-border); border-radius: 16px; overflow: hidden; }
.pain { background: var(--site-bg); padding: clamp(24px, 3vw, 36px); display: grid; gap: var(--s-3); align-content: start; }
.pain__icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(42, 130, 247, .12); color: var(--site-accent-text); }
.pain h3 { font-size: 19px; }
.pain p { color: var(--site-text-2); line-height: 1.6; font-size: var(--fs-md); }
.pain small { color: var(--site-text-3); font-size: var(--fs-sm); text-decoration: line-through; text-decoration-color: rgba(240, 96, 90, .6); }

.modules { display: grid; grid-template-columns: 300px 1fr; gap: clamp(20px, 3vw, 40px); align-items: start; }
.modules__list { display: grid; gap: 4px; }
.module-tab { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid transparent; border-radius: 12px; background: none; color: var(--site-text-2); text-align: left; cursor: pointer; font-weight: 600; font-size: var(--fs-md); transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast); }
.module-tab:hover { color: var(--site-text); background: rgba(255, 255, 255, .03); }
.module-tab.is-active { color: var(--site-text); background: var(--site-surface); border-color: var(--site-border-strong); }
.module-tab.is-active svg { color: var(--site-accent-text); }
.module-panel { border: 1px solid var(--site-border-strong); border-radius: 18px; background: var(--site-surface); overflow: hidden; display: grid; grid-template-columns: 1fr 1.1fr; min-height: 380px; }
.module-panel__text { padding: clamp(24px, 3vw, 36px); display: grid; gap: var(--s-4); align-content: start; }
.module-panel__text h3 { font-size: 24px; letter-spacing: -.02em; }
.module-panel__text p { color: var(--site-text-2); line-height: 1.6; }
.module-panel__text ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: var(--fs-sm); color: var(--site-text-2); }
.module-panel__text li { display: flex; gap: 10px; }
.module-panel__text li svg, .module-panel__text li i { color: var(--site-accent-text); margin-top: 2px; }
.module-panel__visual { background: #0a0d13; border-left: 1px solid var(--site-border); padding: clamp(18px, 2.5vw, 28px); display: grid; align-content: center; gap: 10px; }
.mini-table { border: 1px solid var(--site-border); border-radius: 10px; overflow: hidden; background: #0d1118; }
.mini-table div { display: grid; grid-template-columns: 1.6fr 1fr .9fr; gap: 8px; padding: 9px 12px; font-size: 12px; border-bottom: 1px solid var(--site-border); align-items: center; }
.mini-table div:last-child { border-bottom: 0; }
.mini-table div:first-child { font-size: 10.5px; color: var(--site-text-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; background: #0f141c; }
.mini-table span:nth-child(2) { color: var(--site-text-2); }
.mini-table span:last-child { justify-self: end; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5); counter-reset: step; }
.step { position: relative; padding: var(--s-6); border-radius: 16px; border: 1px solid var(--site-border); background: linear-gradient(180deg, var(--site-surface), var(--site-bg)); display: grid; gap: var(--s-3); align-content: start; }
.step::before { counter-increment: step; content: "0" counter(step); font: 700 13px var(--font-mono); color: var(--site-accent-text); }
.step h3 { font-size: 19px; }
.step p { color: var(--site-text-2); line-height: 1.6; }

.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--site-border); border-radius: 16px; overflow: hidden; background: var(--site-surface); }
.flow__node { position: relative; padding: var(--s-6) var(--s-5); display: grid; gap: 8px; align-content: start; border-right: 1px solid var(--site-border); }
.flow__node:last-child { border-right: 0; }
.flow__node:not(:last-child)::after { content: ""; position: absolute; right: -7px; top: 34px; width: 12px; height: 12px; background: var(--site-surface); border-top: 1px solid var(--site-border-strong); border-right: 1px solid var(--site-border-strong); transform: rotate(45deg); z-index: 1; }
.flow__node span { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(42, 130, 247, .12); color: var(--site-accent-text); }
.flow__node strong { font-size: var(--fs-md); }
.flow__node p { color: var(--site-text-2); font-size: var(--fs-sm); line-height: 1.55; }

.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.trust__item { display: grid; gap: var(--s-2); padding: var(--s-5); border-radius: 14px; border: 1px solid var(--site-border); align-content: start; }
.trust__item svg, .trust__item i { color: var(--site-accent-text); width: 20px; height: 20px; }
.trust__item strong { font-size: var(--fs-md); }
.trust__item p { color: var(--site-text-2); font-size: var(--fs-sm); line-height: 1.55; }

.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); align-items: stretch; }
.price { position: relative; display: flex; flex-direction: column; gap: var(--s-5); padding: var(--s-8) var(--s-6); border-radius: 18px; border: 1px solid var(--site-border); background: var(--site-surface); }
.price--featured { border-color: #2a82f7; box-shadow: 0 0 0 1px #2a82f7, 0 30px 80px rgba(11, 108, 232, .18); }
.price__tag { position: absolute; top: -12px; left: 24px; height: 24px; padding: 0 10px; border-radius: 99px; background: #0b6ce8; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.price__name { font: 700 var(--fs-md) var(--font-display); }
.price__desc { color: var(--site-text-2); font-size: var(--fs-sm); margin-top: 4px; }
.price__value { font: 800 40px/1 var(--font-display); letter-spacing: -.035em; }
.price__value small { font: 500 var(--fs-sm) var(--font-sans); color: var(--site-text-3); letter-spacing: 0; }
.price ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: var(--fs-sm); color: var(--site-text-2); flex: 1; }
.price li { display: flex; gap: 10px; align-items: flex-start; }
.price li svg, .price li i { color: var(--site-accent-text); margin-top: 2px; }
.pricing__note { margin-top: var(--s-5); text-align: center; color: var(--site-text-3); font-size: var(--fs-sm); }

.faq { width: min(820px, 100%); margin: 0 auto; display: grid; }
.faq details { border-bottom: 1px solid var(--site-border); }
.faq summary { list-style: none; display: flex; justify-content: space-between; gap: var(--s-4); align-items: center; padding: var(--s-5) 0; cursor: pointer; font-weight: 600; font-size: var(--fs-lg); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg, .faq summary i { transition: transform var(--t-med) var(--ease); color: var(--site-text-3); }
.faq details[open] summary svg { transform: rotate(45deg); }
.faq details p { padding: 0 0 var(--s-5); color: var(--site-text-2); line-height: 1.7; max-width: 720px; }

.cta-final { position: relative; overflow: hidden; border-radius: 22px; border: 1px solid var(--site-border-strong); padding: clamp(40px, 6vw, 72px); text-align: center; display: grid; gap: var(--s-5); justify-items: center; background: radial-gradient(520px 260px at 50% 0%, rgba(11, 108, 232, .25), transparent 70%), var(--site-surface); }
.cta-final h2 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -.03em; max-width: 720px; }
.cta-final p { color: var(--site-text-2); max-width: 560px; font-size: var(--fs-lg); }

.site-footer { border-top: 1px solid var(--site-border); padding: var(--s-16) 0 var(--s-10); margin-top: var(--s-16); }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--s-8); }
.site-footer p { color: var(--site-text-3); font-size: var(--fs-sm); margin-top: var(--s-3); max-width: 280px; line-height: 1.6; }
.site-footer h4 { font-size: var(--fs-sm); margin-bottom: var(--s-3); color: var(--site-text); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer a { color: var(--site-text-2); font-size: var(--fs-sm); }
.site-footer a:hover { color: var(--site-text); }
.site-footer__bottom { margin-top: var(--s-12); padding-top: var(--s-6); border-top: 1px solid var(--site-border); display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; color: var(--site-text-3); font-size: var(--fs-xs); }

/* Responsividade ----------------------------------------------------------- */
@media (max-width: 1200px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .plan-cards { grid-template-columns: repeat(3, minmax(240px, 1fr)); overflow-x: auto; }
}

@media (max-width: 1024px) {
  body.is-app .main, body.is-app.sidebar-collapsed .main { margin-left: 0; }
  .sidebar, body.sidebar-collapsed .sidebar { width: min(300px, 86vw); transform: translateX(-102%); box-shadow: var(--shadow-lg); }
  body.sidebar-collapsed .sidebar .brand span:not(.brand__mark), body.sidebar-collapsed .ws-chip__text, body.sidebar-collapsed .nav__label, body.sidebar-collapsed .nav__badge, body.sidebar-collapsed .plan-callout, body.sidebar-collapsed .user-row__text, body.sidebar-collapsed .user-row > .btn { display: revert; }
  body.sidebar-collapsed .nav__section { height: auto; background: none; font-size: 11px; margin: var(--s-4) var(--s-2) var(--s-1); }
  body.sidebar-collapsed .nav__item { justify-content: flex-start; padding: 0 10px; }
  body.sidebar-collapsed .sidebar__head { padding: 0 var(--s-4); justify-content: space-between; }
  body.sidebar-collapsed .sidebar__head .brand { display: inline-flex; }
  body.sidebar-collapsed .ws-chip { justify-content: flex-start; padding: 10px; margin: var(--s-3) var(--s-3) var(--s-1); }
  body.sidebar-collapsed .user-row__button { flex: 1; }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .sidebar .sidebar__toggle { display: none; }
  .sidebar .sidebar__close { display: inline-flex; }
  .topbar .topbar__menu { display: inline-flex; }
  .topbar { padding: 0 var(--s-4); }
  .content { padding: var(--s-5) var(--s-4) var(--s-12); }
  .global-search { width: auto; flex: 1; max-width: 360px; }
  .global-search kbd { display: none; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modules { grid-template-columns: 1fr; }
  .modules__list { grid-template-columns: repeat(4, 1fr); }
  .module-tab { justify-content: center; font-size: var(--fs-sm); padding: 10px; }
  .module-panel { grid-template-columns: 1fr; }
  .module-panel__visual { border-left: 0; border-top: 1px solid var(--site-border); }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .flow__node:nth-child(2) { border-right: 0; }
  .flow__node:nth-child(-n + 2) { border-bottom: 1px solid var(--site-border); }
  .flow__node:nth-child(2)::after { display: none; }
  .auth { grid-template-columns: 1fr; }
  .auth__aside { display: none; }
  .help-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .site-nav__links, .site-nav__actions .btn--ghost:not(.site-nav__menu) { display: none; }
  .site-nav__menu { display: inline-grid; }
  .site-nav .site-wrap { gap: var(--s-3); justify-content: space-between; }
  .site-nav__actions { margin-left: auto; }
  .site-mobile-menu { display: grid; position: fixed; inset: 68px 0 auto; z-index: 29; padding: var(--s-4); background: rgba(6, 8, 12, .97); border-bottom: 1px solid var(--site-border); gap: 4px; }
  .site-mobile-menu[hidden] { display: none !important; }
  .site-mobile-menu a { padding: 12px; border-radius: 10px; color: var(--site-text); font-weight: 600; }
  .pains, .steps, .trust, .pricing { grid-template-columns: 1fr; }
  .pricing { max-width: 460px; margin: 0 auto; }
  .showcase__app { grid-template-columns: 1fr; min-height: 0; }
  .sc-side { display: none; }
  .sc-stats { grid-template-columns: repeat(2, 1fr); }
  .sc-grid { grid-template-columns: 1fr; }
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .site-footer__grid > div:first-child { grid-column: 1 / -1; }
  .modules__list { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .plan-cards { grid-template-columns: minmax(0, 1fr); overflow: visible; }
  .doc__toc ol { columns: 1; }
}

@media (max-width: 720px) {
  .global-search { display: none; }
  .crumbs span, .crumbs > i, .crumbs > svg { display: none; }
  .page-head { align-items: stretch; }
  .page-head h1 { font-size: 22px; }
  .page-actions { width: 100%; }
  .page-actions > .btn--primary { flex: 1; }
  .form-grid, .form-grid--3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .modal { max-height: calc(100vh - 16px); border-radius: var(--r-xl) var(--r-xl) 0 0; align-self: end; width: 100%; }
  .overlay { padding: 0; place-items: end stretch; }
  .overlay--drawer { place-items: stretch; }
  .modal__head, .modal__body, .modal__foot { padding-left: var(--s-4); padding-right: var(--s-4); }
  .modal__foot { border-radius: 0; }
  .modal__foot .btn { flex: 1 1 auto; }
  .modal__foot .btn--primary { flex-basis: 100%; order: -1; }
  .drawer__head, .drawer__body, .drawer__foot { padding-left: var(--s-4); padding-right: var(--s-4); }
  .toolbar .search { max-width: none; flex-basis: 100%; }
  .toolbar .select, .toolbar > .input { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .toolbar [data-custom] { flex-basis: 100%; }
  .toasts { right: 16px; left: 16px; width: auto; bottom: 16px; }

  /* Tabelas viram cartões empilhados no celular */
  .table--cards thead { display: none; }
  .table--cards, .table--cards tbody, .table--cards tr, .table--cards td { display: block; width: 100%; }
  .table--cards tr { position: relative; padding: 12px var(--s-4); border-bottom: 1px solid var(--border); }
  .table--cards tbody tr:last-child { border-bottom: 0; }
  .table--cards td { padding: 3px 0; border: 0; display: flex; justify-content: space-between; gap: var(--s-3); text-align: right; }
  .table--cards td::before { content: attr(data-label); color: var(--text-3); font-size: var(--fs-xs); font-weight: 600; text-align: left; flex: none; }
  .table--cards td.cell-primary { display: block; text-align: left; padding: 0 40px 6px 0; }
  .table--cards td.cell-primary::before, .table--cards td.col-actions::before, .table--cards td.col-check::before { display: none; }
  .table--cards td.col-check { position: absolute; left: auto; right: var(--s-4); top: 12px; width: auto; padding: 0; }
  .table--cards tr:has(td.col-check) td.cell-primary { padding-right: 32px; }
  .table--cards td.col-actions { justify-content: flex-end; padding-top: 8px; width: 100%; }
  .table--cards .row-actions { opacity: 1; }
  .line-items__head { display: none; }
  .line-item { grid-template-columns: 1fr 1fr; padding: var(--s-3); border: 1px solid var(--border); border-radius: var(--r-md); }
  .line-item > :first-child { grid-column: 1 / -1; }
  .line-item__total { justify-content: flex-start; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .hero__notes { gap: var(--s-3); }
  .flow { grid-template-columns: 1fr; }
  .flow__node { border-right: 0 !important; border-bottom: 1px solid var(--site-border); }
  .flow__node:last-child { border-bottom: 0; }
  .flow__node::after { display: none; }
  .auth__panel { padding: var(--s-5) var(--s-4); }
}

@media (max-width: 420px) {
  .stat { padding: var(--s-3) var(--s-4); }
  .stat__value { font-size: 19px; }
  .stat__hint { font-size: 11px; }
  .hero h1 .typed { white-space: normal; }
  .site-footer__grid { grid-template-columns: 1fr; }
  .modules__list { grid-template-columns: 1fr 1fr; }
  .module-tab span { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .showcase__frame { transform: none; }
  .hero h1 .typed-caret { display: none; }
}

@media print {
  .sidebar, .topbar, .page-actions, .toolbar, .pager, .row-actions { display: none !important; }
  body.is-app .main { margin: 0; }
  .card { box-shadow: none; }
}

/* Conexão, instalação e privacidade ----------------------------------------- */
.boot__status { max-width: 360px; min-height: 40px; font-size: var(--fs-sm); line-height: 1.5; }
.net-status {
  position: fixed; z-index: 110; top: 12px; left: 50%; transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 32px)); padding: 8px 14px; border-radius: var(--r-full);
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-md);
  color: var(--text); font-size: var(--fs-sm); text-align: center;
}

/* Canto direito: nas telas de login e cadastro fica sobre o painel ilustrativo,
   não sobre o formulário. O body ganha um respiro do tamanho do banner para que
   nenhum conteúdo fique preso atrás dele. */
body.has-privacy-banner { padding-bottom: var(--privacy-banner-space, 0px); }
.privacy-banner {
  position: fixed; z-index: 70; right: var(--s-5); bottom: var(--s-5); width: min(440px, calc(100vw - 32px));
  display: grid; gap: var(--s-3); padding: var(--s-5); border-radius: var(--r-xl);
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); color: var(--text);
  animation: pop-in var(--t-med) var(--ease);
}
.privacy-banner h2 { font-size: var(--fs-lg); }
.privacy-banner p { margin-top: 6px; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.55; }
.privacy-banner__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.privacy-banner__actions .btn { flex: 1 1 auto; justify-content: center; }

.privacy-form { display: grid; gap: var(--s-4); }
.privacy-category { display: grid; gap: var(--s-3); padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-2); }
.privacy-category__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-4); }
.privacy-category__head h3 { font-size: var(--fs-md); }
.privacy-category__head p { margin-top: 4px; font-size: var(--fs-sm); }
.privacy-inventory { display: grid; gap: var(--s-2); }
.privacy-inventory__item { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text-2); }
.privacy-inventory__item strong { color: var(--text); font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; overflow-wrap: anywhere; }
.privacy-inventory__item .faint { font-size: var(--fs-xs); }
.privacy-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); font-size: var(--fs-sm); color: var(--text-2); }
.privacy-facts li { display: flex; gap: 8px; align-items: flex-start; }
.privacy-facts svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--accent-text); }
.privacy-record { font-size: var(--fs-xs); }

.switch { position: relative; flex: none; display: inline-block; width: 40px; height: 22px; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: var(--r-full); background: var(--border-strong); transition: background var(--t-fast); pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform var(--t-fast) var(--ease); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent-ring); outline-offset: 2px; }

.install-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.55; }
.site-mobile-menu__install { padding: 12px; border: 0; border-radius: 10px; background: none; color: var(--site-text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.site-mobile-menu__install svg { width: 18px; height: 18px; }

@media (max-width: 720px) {
  .privacy-banner { left: 16px; right: 16px; bottom: 16px; width: auto; padding: var(--s-4); }
  .privacy-banner__actions { display: grid; }
  .privacy-category__head { flex-wrap: wrap; }
}
