/* ==========================================================================
   GM Painel — interface administrativa
   Sidebar escura + conteúdo sempre claro. Tipografia: Plus Jakarta Sans (OFL, hospedada no painel).
   Gráficos: ApexCharts 4.7.0 (MIT), hospedado em assets/vendor/apexcharts.
   ========================================================================== */

@font-face { font-family: "Plus Jakarta Sans"; src: url("../fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("../fonts/plus-jakarta-sans-latin.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
    /* marca (DNA do site) */
    --brand: #1d5bd8; --brand-600: #1849ad; --brand-700: #143b8c; --brand-soft: #eef3fd; --brand-ring: rgba(29, 91, 216, .16);
    --gold: #c19a4b; --gold-soft: #faf5ea; --navy: #0b1424; --navy-2: #111d31;
    /* neutros */
    --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f9fafb; --surface-3: #f2f4f7;
    --text: #101828; --text-2: #344054; --muted: #667085; --faint: #98a2b3; --line: #eaecf0; --line-2: #d0d5dd;
    /* estados */
    --success: #067647; --success-soft: #ecfdf3; --danger: #d92d20; --danger-soft: #fef3f2;
    --warning: #b54708; --warning-soft: #fffaeb; --info: #1d5bd8; --info-soft: #eef3fd;
    /* forma */
    --radius: 14px; --radius-sm: 10px; --radius-xs: 8px;
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
    --shadow: 0 4px 8px -2px rgba(16, 24, 40, .07), 0 2px 4px -2px rgba(16, 24, 40, .04);
    --shadow-lg: 0 20px 24px -4px rgba(16, 24, 40, .1), 0 8px 8px -4px rgba(16, 24, 40, .04);
    --ease: cubic-bezier(.22, 1, .36, 1);
    --sb-w: 264px; --top-h: 64px;
    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-display: var(--font);
    color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 16px); }
body { margin: 0; font: 400 14px/1.55 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "cv11", "ss01"; }
a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-600); }
h1, h2, h3 { font-family: var(--font-display); color: var(--text); margin: 0 0 .4em; letter-spacing: -.022em; line-height: 1.25; }
h1 { font-size: 1.625rem; font-weight: 700; }
h2 { font-size: 1.02rem; font-weight: 650; letter-spacing: -.012em; }
h3 { font-size: .94rem; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
img, video { max-width: 100%; display: block; }
svg:not(.apex svg) { width: 18px; height: 18px; flex-shrink: 0; } /* ícones; os SVGs do ApexCharts têm tamanho próprio */
code { font: .84em/1.4 ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, monospace; background: var(--surface-3); padding: 1px 6px; border-radius: 6px; color: var(--text-2); }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
button { font: inherit; color: inherit; }
::selection { background: var(--brand-soft); color: var(--brand-700); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small, small { font-size: .82rem; }
.center { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 300; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
.ico-inline { width: 1em; height: 1em; vertical-align: -2px; }
.stack { display: grid; gap: 16px; }
.stack-lg { display: grid; gap: 24px; align-content: start; }

/* ---------- Layout: sidebar escura ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 60; width: var(--sb-w); display: flex; flex-direction: column; color: #a7b3c5;
    background: radial-gradient(120% 60% at 0% 0%, #13233d 0%, transparent 60%), linear-gradient(180deg, var(--navy-2), var(--navy));
    border-right: 1px solid rgba(255, 255, 255, .04); transition: width .3s var(--ease), transform .3s var(--ease); }
.sb-brand { display: flex; align-items: center; gap: 12px; padding: 16px 20px; min-height: var(--top-h); color: #fff; }
.sb-brand:hover { color: #fff; }
.sb-logo { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 11px; font: 800 .92rem/1 var(--font-display); letter-spacing: -.02em;
    color: var(--navy); background: linear-gradient(140deg, #ecd6a4, var(--gold)); box-shadow: 0 8px 18px -8px rgba(193, 154, 75, .8), inset 0 1px 0 rgba(255, 255, 255, .45); }
.sb-logo.lg { width: 56px; height: 56px; font-size: 1.3rem; border-radius: 16px; }
.sb-brand-text { display: flex; flex-direction: column; line-height: 1.2; white-space: nowrap; overflow: hidden; }
.sb-brand-text strong { font-weight: 700; letter-spacing: -.01em; }
.sb-brand-text small { color: #7d8ba1; font-size: .74rem; }
.sb-nav { flex: 1; overflow-y: auto; padding: 4px 12px 20px; scrollbar-width: thin; scrollbar-color: #24344c transparent; }
.sb-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sb-group { margin: 20px 10px 8px; font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: #5f6f88; white-space: nowrap; }
.sb-link { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 9px; color: #a7b3c5; font-weight: 500; font-size: .9rem; white-space: nowrap; transition: background-color .15s, color .15s; }
.sb-link svg { width: 18px; height: 18px; opacity: .75; transition: opacity .15s; }
.sb-link:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.sb-link:hover svg { opacity: 1; }
.sb-link.active { background: rgba(255, 255, 255, .08); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); }
.sb-link.active svg { opacity: 1; color: #e2c78e; }
.sb-link.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.sb-link span { overflow: hidden; text-overflow: ellipsis; }
.sb-count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 99px; background: rgba(255, 255, 255, .1); color: #fff; font-size: .7rem; font-weight: 600; text-align: center; line-height: 19px; }
.sb-count.danger { background: #e5484d; }
.sb-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .06); }
.sb-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(9, 14, 24, .5); backdrop-filter: blur(2px); }

body.sb-collapsed { --sb-w: 76px; }
body.sb-collapsed .sb-brand-text, body.sb-collapsed .sb-group, body.sb-collapsed .sb-link span { display: none; }
body.sb-collapsed .sb-link { justify-content: center; }
body.sb-collapsed .sb-count { position: absolute; top: 2px; right: 4px; min-width: 16px; line-height: 15px; font-size: .62rem; }

/* ---------- Layout: conteúdo claro ---------- */
.shell { margin-left: var(--sb-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .3s var(--ease); }
.topbar { position: sticky; top: 0; z-index: 40; height: var(--top-h); display: flex; align-items: center; gap: 14px; padding: 0 32px;
    background: rgba(255, 255, 255, .86); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line); }
.main { width: 100%; max-width: 1400px; margin: 0 auto; padding: 32px 32px 72px; display: grid; gap: 24px; align-content: start; animation: fadein .35s var(--ease); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.global-search { position: relative; flex: 1; max-width: 480px; display: flex; align-items: center; }
.global-search > svg { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--faint); pointer-events: none; }
.global-search input { height: 40px; padding-left: 38px; padding-right: 40px; background: var(--surface-2); border-color: var(--line); border-radius: 10px; }
.global-search input:focus { background: var(--surface); }
.global-search kbd { position: absolute; right: 10px; font: 600 .7rem var(--font); color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 0 6px; background: var(--surface); }
.search-pop { position: absolute; top: calc(100% + 8px); left: 0; right: 0; max-height: 420px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; animation: pop .2s var(--ease); }
.search-pop .sp-group { padding: 8px 10px 4px; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.search-pop a { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.search-pop a small { color: var(--muted); }
.search-pop a:hover, .search-pop a.active { background: var(--surface-3); }
.search-pop .sp-empty { padding: 14px; color: var(--muted); text-align: center; }

.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 99px; cursor: pointer; border: 1px solid transparent; transition: background-color .15s, border-color .15s; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--surface-2); border-color: var(--line); }
.user-menu summary > svg { width: 16px; height: 16px; color: var(--muted); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(140deg, #2f6ae6, var(--brand-700)); color: #fff; font: 700 .78rem var(--font-display); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta strong { font-size: .85rem; font-weight: 600; }
.user-meta small { color: var(--muted); font-size: .74rem; }
.user-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; animation: pop .2s var(--ease); }
.user-pop a, .user-pop button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text-2); background: none; border: 0; cursor: pointer; text-align: left; font-weight: 500; }
.user-pop a:hover, .user-pop button:hover { background: var(--surface-3); color: var(--text); }
.user-pop svg { width: 17px; height: 17px; color: var(--muted); }
.user-pop form { margin: 0; border-top: 1px solid var(--line); padding-top: 4px; margin-top: 4px; }

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-xs); }
.card > h2:first-child { margin-bottom: 16px; }
.table-card { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.panel-head p { margin: 2px 0 0; }
.panel-head.pad { padding: 20px 24px 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.page-title { display: flex; gap: 12px; align-items: flex-start; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-actions form { margin: 0; }
.section-title { font-size: 1rem; margin: 8px 0 -8px; }
.small-title { font: 600 .7rem var(--font); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 16px 0 8px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); margin-bottom: -12px; flex-wrap: wrap; }
.breadcrumb svg { width: 14px; height: 14px; color: var(--faint); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px 15px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: .875rem; cursor: pointer; line-height: 1.2; white-space: nowrap;
    background: var(--surface-3); color: var(--text-2); transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s; text-decoration: none; letter-spacing: -.005em; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand-600); box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn-primary:hover { background: var(--brand-600); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--text-2); box-shadow: var(--shadow-xs); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-2); }
.btn-danger { background: var(--danger); color: #fff; box-shadow: var(--shadow-xs); }
.btn-danger:hover { filter: brightness(1.06); color: #fff; }
.btn-danger-ghost { background: var(--surface); border-color: #fecdca; color: var(--danger); box-shadow: var(--shadow-xs); }
.btn-danger-ghost:hover { background: var(--danger-soft); color: var(--danger); }
.btn-link { background: none; border: 0; color: var(--brand); padding: 6px 8px; min-height: 0; }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: .8rem; border-radius: 8px; }
.btn-lg { min-height: 44px; padding: 11px 20px; font-size: .95rem; }
.btn-block { width: 100%; }
.btn.disabled { opacity: .45; pointer-events: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; transition: background-color .15s, color .15s; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: .74rem; font-weight: 600; line-height: 1.6; white-space: nowrap;
    background: var(--surface-3); color: var(--text-2); box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .06); }
.badge-success { background: var(--success-soft); color: var(--success); box-shadow: inset 0 0 0 1px #abefc6; }
.badge-danger { background: var(--danger-soft); color: var(--danger); box-shadow: inset 0 0 0 1px #fecdca; }
.badge-warning { background: var(--warning-soft); color: var(--warning); box-shadow: inset 0 0 0 1px #fedf89; }
.badge-info { background: var(--info-soft); color: var(--info); box-shadow: inset 0 0 0 1px #c7d7fe; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.dot-on { background: #17b26a; box-shadow: 0 0 0 3px var(--success-soft); }
.swatch { display: inline-block; width: 22px; height: 22px; border-radius: 7px; border: 1px solid var(--line); }
.stars { color: #f5b301; letter-spacing: 1px; }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .06); }
.thumb-video, .thumb-yt { background: var(--navy); color: #fff; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid; margin: 0; animation: fadein .3s var(--ease); font-size: .88rem; }
.alert-success { background: var(--success-soft); border-color: #abefc6; color: var(--success); }
.alert-error { background: var(--danger-soft); border-color: #fecdca; color: #b42318; }
.alert-warn { background: var(--warning-soft); border-color: #fedf89; color: var(--warning); }
.alert-info { background: var(--info-soft); border-color: #c7d7fe; color: var(--text-2); }
.note { background: var(--warning-soft); border: 1px solid #fedf89; padding: 10px 12px; border-radius: 10px; font-size: .86rem; color: var(--warning); }

.alerts-list { display: grid; gap: 8px; }
.alert-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text); transition: border-color .2s, box-shadow .2s; }
.alert-item:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); color: var(--text); }
.alert-item .go { margin-left: auto; color: var(--faint); }
.alert-item.alert-danger svg:first-child { color: var(--danger); }
.alert-item.alert-warning svg:first-child { color: #dc6803; }
.alert-item.alert-info svg:first-child { color: var(--info); }

/* ---------- Indicadores e gráficos ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.stat { position: relative; display: flex; flex-direction: column; gap: 6px; color: var(--text); padding: 20px 22px; transition: border-color .2s, box-shadow .2s; }
a.stat:hover { border-color: var(--line-2); box-shadow: var(--shadow); color: var(--text); }
.stat-label { font-size: .82rem; font-weight: 550; color: var(--muted); letter-spacing: 0; text-transform: none; }
.stat-value { font: 700 1.75rem/1.15 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--text); }
.stat-value.sm { font-size: 1.15rem; }
.stat small { color: var(--muted); font-size: .8rem; }
.stats-sm .stat { padding: 16px 20px; }
.stats-sm .stat-value { font-size: 1.3rem; }
.delta { display: inline-flex; align-items: center; gap: 2px; padding: 1px 7px; border-radius: 99px; font-weight: 600; font-size: .74rem; margin-right: 4px; }
.delta.up { color: var(--success); background: var(--success-soft); }
.delta.down { color: var(--danger); background: var(--danger-soft); }
.meter { display: block; height: 6px; border-radius: 9px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.meter span { display: block; height: 100%; background: var(--brand); border-radius: 9px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; }

/* ApexCharts (Chart.php gera <div data-apex>; o admin.js monta o gráfico) */
.apex { width: 100%; min-height: 120px; }
.apex-spark { min-height: 52px; margin: 8px -8px -10px; }
.stat:has(.apex-spark) { padding-bottom: 12px; }
.apex-empty { display: grid; place-items: center; min-height: 140px; color: var(--faint); font-size: .86rem; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-2); }
.apexcharts-tooltip.apexcharts-theme-light { border: 1px solid var(--line) !important; border-radius: 10px !important; box-shadow: var(--shadow-lg) !important; font-family: var(--font) !important; }
.apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title { background: var(--surface-2) !important; border-bottom: 1px solid var(--line) !important; font-weight: 600; }
.apexcharts-xaxistooltip { display: none; }
.apexcharts-legend-text { color: var(--text-2) !important; }
.funnel-legend { display: grid; gap: 4px; margin-top: 4px; font-size: .8rem; color: var(--muted); }
.status-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.status-list a { display: flex; justify-content: space-between; align-items: center; padding: 9px 10px; border-radius: 9px; color: var(--text-2); }
.status-list a:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Tabelas ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px; }
.toolbar select, .toolbar input[type=date] { width: auto; min-width: 150px; }
.search-input { position: relative; flex: 1; min-width: 220px; display: flex; align-items: center; }
.search-input svg { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--faint); }
.search-input input { padding-left: 38px; }
.inline-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th { text-align: left; font-size: .75rem; font-weight: 600; letter-spacing: .01em; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--text-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr[data-href] { cursor: pointer; }
.table tr.is-muted td { opacity: .55; }
.table .num { text-align: right; color: var(--text); }
.table td strong, .table td .row-title { color: var(--text); }
.col-check { width: 40px; }
.col-thumb { width: 64px; }
.col-drag { width: 36px; }
.col-actions { text-align: right; white-space: nowrap; }
.col-actions form { display: inline; }
.row-title { font-weight: 600; color: var(--text); }
.row-title:hover { color: var(--brand); }
.th-sort { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.th-sort::after { content: "↕"; opacity: .35; font-size: .9em; }
.th-sort.is-asc::after { content: "↑"; opacity: 1; color: var(--brand); }
.th-sort.is-desc::after { content: "↓"; opacity: 1; color: var(--brand); }
.bulk-bar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--brand-soft); border-bottom: 1px solid #c7d7fe; animation: fadein .2s; }
.bulk-bar span { margin-right: auto; font-size: .86rem; color: var(--brand-700); font-weight: 600; }
.drag-handle { cursor: grab; color: var(--faint); display: inline-grid; place-items: center; padding: 4px; border-radius: 6px; }
.drag-handle:hover { background: var(--surface-3); color: var(--text); }
tr.dragging { opacity: .4; }
tr.drag-over td { box-shadow: inset 0 2px 0 var(--brand); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--muted); font-size: .86rem; padding: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font-size: .82rem; font-weight: 550; transition: .15s; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--text); border-color: var(--text); color: #fff; }
table.mini { font-size: .78rem; border-collapse: collapse; margin-top: 6px; }
table.mini th, table.mini td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; max-width: 260px; overflow-wrap: anywhere; }

/* ---------- Formulários ---------- */
label { font-weight: 550; font-size: .84rem; color: var(--text-2); }
input, select, textarea { font: inherit; font-size: .9rem; width: 100%; min-height: 40px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs);
    transition: border-color .15s, box-shadow .2s var(--ease); }
input:hover, select:hover, textarea:hover { border-color: #b9c0cc; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: #84a6ef; box-shadow: var(--shadow-xs), 0 0 0 4px var(--brand-ring); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; min-height: 0; padding: 0; accent-color: var(--brand); cursor: pointer; box-shadow: none; }
input[type=color] { width: 46px; height: 38px; padding: 3px; }
select { appearance: none; padding-right: 34px; cursor: pointer;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") right 10px center/16px no-repeat; }
textarea.code { font: .84rem/1.5 ui-monospace, Consolas, monospace; }
/* campo "lista" (um item por linha) + prévia ao vivo */
.lines-field { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.lines-field textarea { line-height: 1.7; min-height: 220px; resize: vertical; }
.lines-preview { padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--line-2); background: #fff; position: sticky; top: 80px; }
.lines-preview-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.lines-preview-title { display: block; font-size: .92rem; margin-bottom: 8px; color: var(--text); }
.lines-preview ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lines-preview li { position: relative; padding-left: 16px; font-size: .84rem; line-height: 1.45; color: var(--text-2); }
.lines-preview li::before { content: ""; position: absolute; left: 3px; top: .58em; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); }
.lines-preview li.is-hidden-item { opacity: .45; }
.lines-more { display: inline-block; margin-top: 8px; font-size: .8rem; font-weight: 600; color: var(--brand); }
@media (max-width: 900px) { .lines-field { grid-template-columns: 1fr; } .lines-preview { position: static; } }
.form-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.col-full { grid-column: span 6; }
.col-half { grid-column: span 3; }
.col-third { grid-column: span 2; }
.req { color: var(--danger); }
.hint { color: var(--muted); font-size: .78rem; font-weight: 400; }
.ie-group { display: grid; gap: 8px; padding: 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.ie-group .switch { padding: 0; }
.ie-group input:disabled { cursor: not-allowed; }
.field-error { color: var(--danger); font-size: .8rem; font-weight: 600; animation: fadein .2s; }
.has-error input, .has-error select, .has-error textarea, .has-error .editor { border-color: var(--danger); }
.readonly { padding: 9px 12px; border-radius: 9px; background: var(--surface-2); border: 1px dashed var(--line-2); min-height: 39px; overflow-wrap: anywhere; }
.readonly.multiline { white-space: normal; line-height: 1.6; }
.input-affix { display: flex; align-items: stretch; }
.input-affix > span { display: grid; place-items: center; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--line-2); border-right: 0; border-radius: 10px 0 0 10px; color: var(--muted); font-weight: 550; font-size: .85rem; }
.input-affix input { border-radius: 0 10px 10px 0; }
.input-pass { position: relative; display: flex; }
.input-pass input { padding-right: 42px; }
.input-pass .icon-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.color-input { display: flex; align-items: center; gap: 10px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check.sm { font-size: .82rem; }
.check-group { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.chip.chip-sm { padding: 2px 9px; font-size: .76rem; }
.list-notice { margin-bottom: 14px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; color: var(--text); padding: 6px 0; }
.switch input[type=checkbox] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { position: relative; width: 38px; height: 22px; border-radius: 99px; background: var(--line-2); transition: background-color .2s; flex-shrink: 0; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s var(--ease); }
.switch input:checked + .switch-ui { background: var(--brand); }
.switch input:checked + .switch-ui::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.switch input:disabled + .switch-ui { opacity: .5; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }
.inline-form .field { flex: 1; min-width: 200px; }
.otp { font: 700 1.5rem/1 ui-monospace, Consolas, monospace; letter-spacing: .4em; text-align: center; max-width: 220px; }

.resource-form { display: grid; gap: 16px; }
.form-actions { position: sticky; bottom: 16px; z-index: 20; display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 12px 16px; margin: 0 -2px;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.form-actions [data-dirty-label] { margin-right: auto; display: inline-flex; gap: 6px; align-items: center; color: var(--warning); }

.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; margin-bottom: -6px; }
.tab { position: relative; padding: 11px 14px; color: var(--muted); font-weight: 600; white-space: nowrap; font-size: .875rem; transition: color .15s; }
.tab::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); transform: scaleX(0); transition: transform .25s var(--ease); }
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); }
.tab.active::after { transform: scaleX(1); }
.tab.has-error { color: var(--danger); }
.tab-count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--surface-3); font-size: .72rem; text-align: center; color: var(--text-2); }
.tab-panel { animation: fadein .25s var(--ease); }

/* upload de arquivo */
.upload { display: flex; gap: 14px; align-items: center; padding: 10px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--surface-2); transition: border-color .15s, background-color .15s; }
.upload.is-over { border-color: var(--brand); background: var(--brand-soft); }
.upload-preview { width: 96px; height: 72px; border-radius: 9px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); flex-shrink: 0; }
.upload-preview img, .upload-preview video { width: 100%; height: 100%; object-fit: cover; }
.upload-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.upload-body small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px; margin-bottom: 16px; border: 2px dashed var(--line-2); border-radius: var(--radius); text-align: center; color: var(--muted); transition: .2s; cursor: pointer; }
.dropzone svg { width: 28px; height: 28px; color: var(--brand); }
.dropzone p { margin: 0; color: var(--text-2); }
.dropzone .link { color: var(--brand); cursor: pointer; font-weight: 600; }
.dropzone.is-over { border-color: var(--brand); background: var(--brand-soft); transform: scale(1.01); }
.dropzone.is-uploading { opacity: .6; pointer-events: none; }
.dropzone.is-busy svg { animation: up-bob 1s ease-in-out infinite; }
@keyframes up-bob { 50% { transform: translateY(-4px); } }
.upload { cursor: pointer; }
.upload:hover { border-color: var(--brand); }
.upload.is-over, .dropzone.is-over { border-color: var(--brand); border-style: solid; background: var(--brand-soft); box-shadow: 0 0 0 4px var(--brand-ring); }
.upload.is-picked { border-style: solid; border-color: color-mix(in srgb, var(--brand) 45%, var(--line-2)); }
.upload-limit { white-space: normal !important; }

/* arrastando arquivos sobre a página: destaca todos os lugares que recebem arquivo */
body.is-file-drag [data-upload], body.is-file-drag [data-dropzone] { border-color: var(--brand); border-style: dashed; background: var(--brand-soft); }
body.is-file-drag [data-upload] *, body.is-file-drag [data-dropzone] * { pointer-events: none; }
.drop-hint { position: fixed; left: 50%; top: 14px; z-index: 300; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px;
    background: var(--brand); color: #fff; font-weight: 600; font-size: .88rem; box-shadow: 0 10px 30px -8px rgba(29, 91, 216, .6); pointer-events: none; animation: drop-in .2s ease-out; }
.drop-hint.is-off { background: var(--text-2); box-shadow: none; }
@keyframes drop-in { from { opacity: 0; transform: translate(-50%, -8px); } }

/* cadastro novo: arquivos aguardando o salvamento automático */
.pending-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-700); font-size: .86rem; font-weight: 550; }
.pending-bar span { flex: 1; min-width: 200px; }

/* fila do envio em lote */
.upq { list-style: none; margin: -6px 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.upq-item { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 0; }
.upq-thumb { width: 52px; height: 52px; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: var(--surface-3); }
.upq-thumb img, .upq-thumb video { width: 100%; height: 100%; object-fit: cover; }
.upq-body { display: grid; gap: 3px; min-width: 0; flex: 1; }
.upq-body b { font-size: .82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upq-body small { font-size: .75rem; color: var(--muted); line-height: 1.35; }
.upq-bar { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.upq-bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.upq-item[data-state="done"] { border-color: color-mix(in srgb, var(--success) 40%, var(--line)); }
.upq-item[data-state="done"] .upq-bar i { width: 100% !important; background: var(--success); }
.upq-item[data-state="done"] small { color: var(--success); }
.upq-item[data-state="error"] { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: color-mix(in srgb, var(--danger) 5%, var(--surface)); cursor: pointer; }
.upq-item[data-state="error"] small { color: var(--danger); }
.upq-item[data-state="error"] .upq-bar { display: none; }
.upq-item[data-state="error"]::after { content: "×"; margin-left: auto; color: var(--muted); font-size: 1.1rem; padding: 0 4px; }

/* editor visual */
.editor { border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--surface); }
.editor:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.editor-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.editor-bar button { border: 0; background: none; padding: 5px 9px; border-radius: 6px; cursor: pointer; font-size: .82rem; color: var(--text-2); display: inline-flex; align-items: center; }
.editor-bar button:hover, .editor-bar button.active { background: var(--surface-3); color: var(--text); }
.editor-bar svg { width: 15px; height: 15px; }
.editor-bar .sep { width: 1px; background: var(--line-2); margin: 3px 4px; }
.editor-area { min-height: 220px; max-height: 560px; overflow-y: auto; padding: 14px 16px; outline: none; }
.editor-area:empty::before { content: "Escreva aqui…"; color: var(--muted); }
.editor-source { border: 0; border-radius: 0; min-height: 220px; font: .84rem/1.5 ui-monospace, Consolas, monospace; }
.prose h2 { font-size: 1.25rem; margin: 1em 0 .4em; }
.prose h3 { font-size: 1.05rem; margin: 1em 0 .3em; }
.prose p { margin: 0 0 .8em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose blockquote { border-left: 3px solid var(--gold); margin: 1em 0; padding: .4em 1em; background: var(--surface-2); border-radius: 0 8px 8px 0; }
.prose img { border-radius: 8px; }

/* ---------- Telas específicas ---------- */
.empty-state { text-align: center; padding: 48px 20px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.empty-state.sm { padding: 24px; }
.empty-state.big { padding: 80px 20px; }
.empty-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--brand-soft); color: var(--brand); margin-bottom: 10px; }
.empty-icon svg { width: 28px; height: 28px; }
.error-code { font: 800 3.4rem/1 var(--font-display); color: var(--line-2); margin: 0; }

.kv { display: grid; gap: 10px; margin: 0 0 12px; }
.kv.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kv dt { font-size: .76rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kv dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.plain { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.plain-ol { margin: 0; padding-left: 1.2em; color: var(--text-2); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; display: grid; gap: 12px; }
.timeline li { position: relative; padding-left: 20px; font-size: .88rem; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 16px; bottom: -14px; width: 1px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.tl-dot { position: absolute; left: 0; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.tl-ok, .tl-done { background: var(--success); }
.tl-erro, .tl-failed { background: var(--danger); }
.tl-pendente, .tl-pending, .tl-executando, .tl-running { background: var(--info); }
details.log summary { cursor: pointer; color: var(--muted); font-size: .8rem; margin-top: 6px; }
details.log pre, .code-block { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font: .78rem/1.5 ui-monospace, Consolas, monospace; max-height: 420px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; }

.progress-steps { list-style: none; margin: 0; padding: 14px 18px; display: flex; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.progress-steps li { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: .86rem; white-space: nowrap; }
.progress-steps li span { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); flex-shrink: 0; }
.progress-steps li + li::before { content: ""; flex: 1; height: 2px; background: var(--line); margin: 0 10px; min-width: 16px; }
.progress-steps li.done { color: var(--text); }
.progress-steps li.done span { background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12 4 4 8-8' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center/12px no-repeat; border-color: var(--success); }
.progress-steps li.done + li.done::before, .progress-steps li.done + li.current::before { background: var(--success); }
.progress-steps li.current span { box-shadow: 0 0 0 4px var(--success-soft); }
.order-items { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 12px; }
.order-items li { display: grid; grid-template-columns: 52px 1fr auto auto; gap: 14px; align-items: center; }
.order-items img, .order-items .thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.order-items li > div { display: flex; flex-direction: column; min-width: 0; }
.totals { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.totals .total { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.totals .total dt, .totals .total dd { font: 800 1.2rem var(--font-display); color: var(--text); }
.actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.action-box { display: grid; gap: 10px; align-content: start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.action-box h3 { display: flex; align-items: center; gap: 8px; margin: 0; }
.action-box p { margin: 0; }
.action-box .btn { justify-self: start; }
address { font-style: normal; line-height: 1.6; color: var(--text-2); margin-bottom: 10px; }
.asaas-result { margin-top: 10px; font-size: .84rem; }
/* Conciliação manual ASAAS: "Conciliar agora" no pedido e janela "Conciliar pagamentos" na lista */
.sync-hint { margin: 8px 0 0; }
.sync-result { margin-top: 10px; display: grid; gap: 8px; justify-items: start; }
.sync-result .spinner, [data-sync] .spinner, .rec-modal .spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: syncspin .7s linear infinite; vertical-align: -1px; }
@keyframes syncspin { to { transform: rotate(360deg); } }
.modal.rec-modal { width: min(600px, calc(100vw - 32px)); max-width: none; }
.rec-modal[open] .adj { animation: pop .25s var(--ease); }
.rec-modal .adj-icon svg { width: 20px; height: 20px; }
.rec-modal .field-label { font-weight: 600; font-size: .86rem; color: var(--text-2); margin: 0 0 8px; padding: 0; }
.rec-modal [data-rec-step] { display: grid; gap: 14px; }
.rec-modal [data-rec-step][hidden] { display: none; }
.rec-options { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.rec-option { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.rec-option:hover { border-color: var(--line-2); }
.rec-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.rec-option input { flex: none; margin: 0; accent-color: var(--brand); }
.rec-option span { display: grid; gap: 2px; flex: 1; min-width: 0; }
.rec-option small { color: var(--muted); font-size: .8rem; line-height: 1.4; }
.rec-count { flex: none; min-width: 42px; padding: 4px 10px; border-radius: 99px; background: var(--surface-3); text-align: center; font-variant-numeric: tabular-nums; font-size: .9rem; }
.rec-option:has(input:checked) .rec-count { background: var(--brand); color: #fff; }
.rec-note { margin: 0; }
.rec-progress { display: grid; gap: 8px; }
.rec-progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rec-progress-num { font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 600; font-size: .9rem; }
.rec-bar { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.rec-bar span { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--brand); transition: width .35s var(--ease); }
.rec-bar.is-error span { background: var(--danger); }
.rec-current { margin: 0; min-height: 1.3em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rec-stat { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.rec-stat b { font: 700 1.3rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.rec-stat span { color: var(--muted); font-size: .76rem; }
.rec-stat.is-changed b { color: var(--success); }
.rec-stat.is-error b { color: var(--danger); }
.rec-log-wrap .field-label { margin-bottom: 6px; }
.rec-log { list-style: none; margin: 0; padding: 0; max-height: 200px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.rec-log li { padding: 8px 12px; font-size: .82rem; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline; }
.rec-log li + li { border-top: 1px solid var(--line); }
.rec-log-empty { display: block !important; }
.rec-log-item.is-changed code { color: var(--success); }
.rec-log-item.is-error code { color: var(--danger); }
.rec-log-item.is-error span { color: #b42318; }
@media (max-width: 520px) { .rec-stats { grid-template-columns: 1fr; } .rec-stat { grid-template-columns: auto 1fr; align-items: baseline; gap: 10px; } }
@media (prefers-reduced-motion: reduce) { .sync-result .spinner, [data-sync] .spinner, .rec-modal .spinner { animation-duration: 2.4s; } .rec-bar span { transition: none; } }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.danger-zone h2 { color: var(--danger); }
.subdomain-box { display: grid; gap: 14px; }
.subdomain-url { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); flex-wrap: wrap; }
.subdomain-url > svg { color: var(--brand); }
.subdomain-url code { font-size: .92rem; background: none; padding: 0; color: var(--text); }
.reply-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.reply-card { display: flex; gap: 12px; align-items: center; padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); color: var(--text); transition: transform .2s var(--ease), box-shadow .2s; }
.reply-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--text); }
.reply-card svg { width: 26px; height: 26px; color: var(--brand); }
.reply-card span { display: flex; flex-direction: column; }
.reply-card.whats svg { color: #1fae5b; }
.result-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; color: var(--text); }
.result-row span { margin-left: auto; }
.result-row:hover { border-color: var(--brand); color: var(--text); }
.perm-table td, .perm-table th { padding: 9px 12px; }
.status-line { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.status-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--surface-3); }
.status-icon.ok { background: var(--success-soft); color: var(--success); }
.status-icon svg { width: 24px; height: 24px; }
.steps-list { margin: 0; padding-left: 1.3em; display: grid; gap: 18px; }
.steps-list li::marker { font-weight: 800; color: var(--brand); }
.secret-box { display: flex; gap: 10px; align-items: center; margin: 10px 0 6px; flex-wrap: wrap; }
.secret-box code { font-size: 1.05rem; letter-spacing: .08em; padding: 8px 12px; }
.sim-lines { display: grid; gap: 8px; }
.sim-line { display: grid; grid-template-columns: 1fr 80px auto; gap: 8px; align-items: center; }
.sim-price { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--success-soft); margin: 10px 0; }
.sim-price strong { font: 800 1.6rem var(--font-display); color: var(--success); }
/* parcelamento */
.input-affix-end > span { order: 2; border: 1px solid var(--line-2); border-left: 0; border-radius: 0 9px 9px 0; }
.input-affix-end input { border-radius: 9px 0 0 9px; max-width: 110px; }
.table-compact td, .table-compact th { padding: 7px 12px; }
.table tr.has-error td { background: var(--danger-soft, transparent); }
.plain-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
/* registro recém-salvo (volta para a listagem) */
@keyframes saved-flash { 0%, 35% { background: #eef3fd; box-shadow: inset 3px 0 0 var(--brand); } 100% { background: transparent; box-shadow: inset 3px 0 0 transparent; } }
.row-saved, .row-saved td { animation: saved-flash 2.6s var(--ease) both; }

/* frete: árvore */
.rt-explain { display: grid; gap: 8px; padding: 16px 20px; }
.rt-explain p { margin: 0; }
.rt-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--text-2); }
.rt-steps span { padding: 3px 10px; border-radius: 99px; background: var(--surface-3); }
.rt-steps span:first-child { background: var(--brand-soft); color: var(--brand); }
.rt-steps svg { width: 14px; height: 14px; color: var(--faint); }
.rt-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.rt-search { flex: 1 1 280px; max-width: 520px; }
.rt-tree { display: grid; gap: 6px; padding: 12px; }
.rt-node { border-radius: 12px; }
.rt-node + .rt-node { border-top: 1px solid var(--line); border-radius: 0; padding-top: 6px; }
.rt-head { display: flex; align-items: flex-start; gap: 12px; padding: 10px 10px; border-radius: 10px; list-style: none; }
summary.rt-head { cursor: pointer; }
summary.rt-head::-webkit-details-marker { display: none; }
summary.rt-head:hover { background: var(--surface-2); }
.rt-head h2, .rt-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.rt-head p { margin: 2px 0 0; }
.rt-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-3); color: var(--muted); flex-shrink: 0; }
.rt-icon svg { width: 16px; height: 16px; transition: transform .2s var(--ease); }
details[open] > summary .rt-icon svg { transform: rotate(90deg); }
.rt-root > .rt-head .rt-icon { background: var(--brand-soft); color: var(--brand); }
.rt-children { margin: 2px 0 8px 23px; padding-left: 22px; border-left: 1px dashed var(--line-2); display: grid; gap: 4px; }
.rt-root > .rt-group, .rt-root > .rt-empty { margin-left: 50px; }
.rt-group-label { margin: 10px 0 4px; font-size: .74rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.rt-group-label code { text-transform: none; letter-spacing: 0; }
.rt-group { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 6px; transition: opacity .2s; }
.rt-group.is-saving { opacity: .6; }
.rt-rule { display: grid; grid-template-columns: 28px minmax(0, 2.2fr) minmax(0, 1.6fr) minmax(0, .9fr) auto auto; align-items: center; gap: 12px;
    padding: 10px 10px 10px 6px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); transition: border-color .15s, box-shadow .15s, opacity .15s; }
.rt-rule:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.rt-rule.is-inactive { opacity: .62; }
.rt-rule.is-dragging { opacity: .5; border-style: dashed; border-color: var(--brand); box-shadow: none; }
.rt-handle { display: grid; place-items: center; width: 28px; height: 32px; border: 0; border-radius: 7px; background: none; color: var(--faint); cursor: grab; }
.rt-handle:hover, .rt-handle:focus-visible { background: var(--surface-3); color: var(--text); }
.rt-handle:active { cursor: grabbing; }
.rt-handle.is-static { cursor: default; }
.rt-main { display: grid; gap: 1px; min-width: 0; color: var(--text); }
.rt-main strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-main small { color: var(--muted); }
.rt-main:hover strong { color: var(--brand); }
.rt-price, .rt-days { display: grid; gap: 1px; font-size: .86rem; font-variant-numeric: tabular-nums; color: var(--text-2); }
.rt-city { margin-top: 2px; }
.rt-inherit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 4px; font-size: .84rem; }
.rt-uf-chip { padding: 2px 9px; font-size: .76rem; cursor: default; }
.rt-empty { margin: 4px 0 10px; color: var(--muted); font-size: .86rem; }
/* Frete por cubagem + reajuste em % (contrato §3) */
.rt-rule { grid-template-columns: 28px minmax(0, 2.2fr) minmax(0, 1.6fr) minmax(0, .9fr) auto auto auto; }
.rt-cubic { font-weight: 650; color: var(--text); }
.rt-head > .rt-adjust { margin-left: auto; flex-shrink: 0; align-self: center; }
.rt-adjust { gap: 6px; }
.rt-pct, .rt-adjust-icon span { font-weight: 800; font-size: .9rem; line-height: 1; }
.rt-pct { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-size: .78rem; }
.rt-adjust-icon { color: var(--muted); }
.rt-adjust-icon:hover { color: var(--brand); background: var(--brand-soft); }
.rt-group-label .rt-adjust { margin-left: 8px; padding: 2px 10px; text-transform: none; letter-spacing: 0; vertical-align: middle; }

.modal.adj-modal { width: min(720px, calc(100vw - 32px)); max-width: none; }
.adj { display: flex; flex-direction: column; max-height: min(760px, calc(100vh - 48px)); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
.adj-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px 16px 22px; border-bottom: 1px solid var(--line); }
.adj-head h2 { margin: 0; font-size: 1.15rem; }
.adj-head p { margin: 2px 0 0; }
.adj-head .icon-btn { margin-left: auto; }
.adj-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 1.15rem; flex-shrink: 0; }
.adj-body { padding: 18px 22px; display: grid; gap: 16px; overflow: auto; }
.adj-pct { display: grid; gap: 6px; }
.adj-pct-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.adj-input input { max-width: 120px; font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.adj-input.is-invalid input, .adj-input.is-invalid > span { border-color: var(--danger); }
.adj-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.adj-quick .chip { cursor: pointer; font-variant-numeric: tabular-nums; }
.adj-quick .chip:hover { border-color: var(--brand); color: var(--brand); }
.adj-cascade { align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.adj-cascade .switch-label { display: grid; gap: 2px; }
.adj-cascade .switch-label small { font-weight: 450; font-size: .8rem; }
.adj-preview { display: grid; gap: 8px; }
.adj-preview-head { display: grid; gap: 2px; }
.adj-table-wrap { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.adj-table { margin: 0; }
.adj-table thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 1; }
.adj-table td small { display: block; }
.adj-table tr.is-inactive { opacity: .6; }
.adj-arrow { width: 24px; text-align: center; font-weight: 700; }
.adj-arrow.up { color: var(--warning); }
.adj-arrow.down { color: var(--success); }
.adj-modal.is-loading .adj-table-wrap { opacity: .55; transition: opacity .2s; }
.adj-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface-2); }

.ship-model .field-label { font-weight: 550; font-size: .84rem; color: var(--text-2); }
.model-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.model-card { position: relative; cursor: pointer; }
.model-card input { position: absolute; opacity: 0; }
.model-card > span { display: grid; gap: 3px; height: 100%; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: 12px; transition: border-color .15s, background-color .15s, box-shadow .15s; }
.model-card strong { color: var(--text); font-size: .92rem; }
.model-card small { color: var(--muted); font-weight: 450; line-height: 1.4; }
.model-card:hover > span { border-color: var(--text-2); }
.model-card input:checked + span { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-ring); }
.model-card input:focus-visible + span { outline: 3px solid var(--brand-ring); outline-offset: 2px; }

/* Home: números do topo (settings.hero_stats) — editor + prévia escura igual à faixa do site */
.hs { display: grid; gap: 14px; }
.hs-edit { display: grid; gap: 10px; min-width: 0; }
.hs-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.hs-item { grid-template-columns: auto minmax(0, 1fr) auto; }
.hs-item.is-empty { border-style: dashed; opacity: .75; }
.hs-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); font-weight: 750; font-size: .8rem; }
.hs-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; min-width: 0; }
.hs-f { display: grid; gap: 3px; font-size: .74rem; min-width: 0; }
.hs-f-value input { font-weight: 750; font-variant-numeric: tabular-nums; }
.hs-f-value input[readonly] { background: var(--surface-2); color: var(--muted); }
.hs-f-text, .hs-auto { grid-column: 1 / -1; }
.hs-auto { font-size: .8rem; }
.hs-preview { padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--line-2); background: var(--surface); }
.hs-band { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); border-radius: 14px; overflow: hidden;
    background: radial-gradient(120% 140% at 0% 0%, #1b2b45 0%, #0b1424 60%); border: 1px solid rgba(255, 255, 255, .09); }
.hs-band > div { padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hs-band > div + div { border-left: 1px solid rgba(255, 255, 255, .08); }
.hs-band strong { color: #fff; font-size: 1.35rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hs-band strong em { font-style: normal; color: #e2c78e; }
.hs-band span { font-size: .78rem; color: #95a7c0; line-height: 1.35; }
.hs-empty { grid-column: 1 / -1; margin: 0; padding: 18px; color: #c8d3e3; font-size: .85rem; text-align: center; }
.hs-tip { margin: 8px 0 0; }
@media (max-width: 760px) {
    .hs-band { grid-template-columns: 1fr 1fr; }
    .hs-band > div:nth-child(3) { border-left: 0; }
    .hs-band > div:nth-child(n+3) { border-top: 1px solid rgba(255, 255, 255, .08); }
}

/* Home: cartões flutuantes (settings.hero_floats) — editor em 2 posições + miniatura do topo do site */
.hf { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) minmax(260px, 380px); align-items: start; }
.hf > .cards-actions { grid-column: 1; }
.hf-preview { grid-column: 2; grid-row: 1 / span 2; }
.hf-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hf-item { grid-template-columns: auto minmax(0, 1fr); }
.hf-item .vcard-body { display: grid; gap: 8px; min-width: 0; }
.hf-item.is-off { opacity: .6; border-style: dashed; }
.hf-item.is-bad { border-color: var(--danger, #d14343); }
.hf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hf-stage { padding: 18px 22px 10px 18px; border-radius: 12px; background: radial-gradient(120% 140% at 0% 0%, #1b2b45 0%, #0b1424 60%); }
.hf-visual { position: relative; aspect-ratio: 1 / 1.02; }
.hf-main, .hf-second { position: absolute; object-fit: cover; border: 1px solid rgba(255, 255, 255, .1); }
.hf-main { inset: 0 0 14% 12%; width: 88%; height: 86%; border-radius: 14px; }
.hf-ph { background: #22324c; }
.hf-second { width: 44%; aspect-ratio: 1; left: 0; bottom: 0; border: 4px solid #0b1424; border-radius: 12px; }
.hf-float { position: absolute; display: flex; gap: 7px; align-items: center; max-width: 72%; padding: 7px 10px 7px 7px; border-radius: 10px; background: #fff; color: #0f1d2e; box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .55); }
.hf-float[hidden] { display: none; }
.hf-float .ico { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: #e8f0fb; color: #1f5fbf; }
.hf-float .ico svg { width: 15px; height: 15px; }
.hf-float strong { display: block; font-size: .72rem; line-height: 1.15; overflow-wrap: anywhere; }
.hf-float small { display: block; color: #66758a; font-size: .6rem; line-height: 1.2; }
.hf-float.f1 { top: 8%; left: 0; }
.hf-float.f2 { right: -4%; bottom: 22%; }
.hf-float.f2 .ico { background: #f7efdc; color: #b08a3e; }
.hf-float.is-bad { outline: 2px dashed var(--danger, #d14343); }
@media (max-width: 900px) {
    .hf { grid-template-columns: 1fr; }
    .hf-preview { grid-column: 1; grid-row: auto; }
    .hf-stage { max-width: 380px; }
}

.rt-missing { padding: 12px 16px; border-color: #fedf89; background: var(--warning-soft); }
.rt-missing summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--warning); list-style: none; }
.rt-missing summary::-webkit-details-marker { display: none; }
.rt-missing.is-urgent { border-color: var(--warning); }
.rt-missing-list { margin: 10px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; font-size: .86rem; }
/* versão do produto: medidas da embalagem (C × L × A) com a cubagem ao vivo */
.dims { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2); }
.dims-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.dims-in { display: grid; gap: 4px; flex: 1 1 120px; min-width: 0; font-size: .78rem; font-weight: 600; color: var(--muted); }
.dims-in .input-affix input { max-width: none; width: 100%; min-width: 0; font-variant-numeric: tabular-nums; }
.dims-x { padding-bottom: 10px; color: var(--muted); font-weight: 500; }
.dims-out { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: .86rem; font-variant-numeric: tabular-nums; background: var(--success-soft); color: var(--success); }
.dims-out strong { color: inherit; }
.dims-out svg { width: 16px; height: 16px; flex-shrink: 0; }
.dims[data-tone="warn"] .dims-out { background: var(--warning-soft); color: var(--warning); }
.dims[data-tone="tip"] .dims-out { background: var(--info-soft); color: var(--info); }
.dims[data-tone="off"] .dims-out { background: var(--surface); color: var(--muted); }
.has-error .dims { border-color: var(--danger); }
@media (max-width: 520px) { .dims-x { display: none; } .dims-in { flex-basis: 100%; } }
input.flash { box-shadow: 0 0 0 3px var(--brand-ring); border-color: var(--brand); transition: box-shadow .3s; }

@media (max-width: 900px) {
    .rt-rule { grid-template-columns: 28px minmax(0, 1fr) auto; }
    .rt-head > .rt-adjust { padding: 4px 8px; }
    .rt-adjust-text { display: none; }
    .rt-price, .rt-days { grid-column: 2; }
    .rt-badge { grid-column: 3; grid-row: 1; }
    .rt-rule > .icon-btn { display: none; }
    .rt-children { margin-left: 10px; padding-left: 12px; }
}

/* frete: cidade (combobox IBGE) */
.cp { position: relative; }
.cp-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 300px; overflow-y: auto; margin: 0; padding: 6px; list-style: none;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); animation: pop .15s var(--ease); }
.cp-list li[role="option"] { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--text-2); }
.cp-list li[role="option"]:hover, .cp-list li[aria-selected="true"] { background: var(--brand-soft); color: var(--text); }
.cp-list mark { background: none; color: var(--brand); font-weight: 700; }
.cp-list code { font-size: .78rem; background: var(--surface-3); }
.cp-msg { padding: 10px; color: var(--muted); font-size: .84rem; }
.cp.is-valid input { border-color: #75e0a7; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m5 12 5 5 9-10' fill='none' stroke='%23067647' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center/16px no-repeat var(--surface); }
input.cp-code { background: var(--surface-2); color: var(--text-2); font-variant-numeric: tabular-nums; cursor: default; }

/* acessos ao site */
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.link-btn:hover { text-decoration-color: currentColor; }
.acc-head { margin-bottom: 14px; }

/* barra de ferramentas */
.acc-toolbar { display: grid; gap: 10px; padding: 12px; box-shadow: var(--shadow); }
.acc-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.acc-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.acc-quick-lbl { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.fm > *, .fm-body > *, .fm-panels, .fm-panel, .fm-field { min-width: 0; }
.acc-toolbar .btn { height: 40px; }
.acc-period { gap: 8px; font-weight: 650; }
.acc-period .chev { width: 14px; height: 14px; opacity: .6; transition: transform .2s var(--ease); }
.period-pop[open] .acc-period .chev { transform: rotate(180deg); }
.acc-search { flex: 1 1 220px; min-width: 180px; position: relative; display: flex; align-items: center; }
.acc-search svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.acc-search input { width: 100%; height: 40px; padding-left: 36px; border-radius: 10px; }
.seg-control { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.seg-control a { padding: 6px 12px; border-radius: 8px; font-size: .84rem; font-weight: 600; color: var(--text-2); white-space: nowrap; transition: background-color .15s, color .15s; }
.seg-control a:hover { color: var(--text); }
.seg-control a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.acc-select select { height: 40px; border-radius: 10px; min-width: 170px; }
.toggle-chip { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); font-size: .86rem; font-weight: 600; color: var(--text-2); white-space: nowrap; transition: .15s; }
.toggle-chip svg { width: 15px; height: 15px; opacity: .35; }
.toggle-chip:hover { border-color: var(--brand); color: var(--brand); }
.toggle-chip.active { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.toggle-chip.active svg { opacity: 1; }
.acc-advanced { gap: 8px; flex-shrink: 0; }
.count-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #fff; color: var(--brand); font-size: .74rem; font-weight: 800; }
.acc-active { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 12px 2px 4px; }
.chip-filter { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, transparent); color: var(--text); }
.chip-filter > span[aria-hidden] { font-size: 1.05rem; line-height: 1; opacity: .55; }
.chip-filter:hover > span[aria-hidden] { opacity: 1; color: var(--danger); }
.acc-tabs { margin: 14px 0; }

/* popover de período */
.popover { position: relative; }
.popover > summary { list-style: none; }
.popover > summary::-webkit-details-marker { display: none; }
.popover-box { position: absolute; left: 0; top: calc(100% + 8px); z-index: 40; width: 320px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 10px; display: grid; gap: 10px; animation: pop .2s var(--ease); }
.period-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.period-preset { padding: 8px 10px; border-radius: 8px; font-size: .86rem; color: var(--text-2); font-weight: 550; }
.period-preset:hover { background: var(--surface-2); color: var(--text); }
.period-preset.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.period-custom { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.date-range { display: flex; align-items: center; gap: 6px; }
.date-range input { flex: 1; min-width: 0; }
.date-range span { color: var(--muted); font-size: .82rem; }
.btn-block { width: 100%; justify-content: center; }

/* janela de filtros avançados */
.modal.fmodal { width: min(1060px, calc(100vw - 32px)); max-width: none; height: min(740px, calc(100vh - 48px)); max-height: none; }
.fmodal[open] .fm { animation: pop .25s var(--ease); }
.fm { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
.fm-head { display: flex; align-items: center; gap: 16px; padding: 16px 18px 16px 22px; border-bottom: 1px solid var(--line); }
.fm-head h2 { margin: 0; font-size: 1.15rem; }
.fm-head p { margin: 2px 0 0; }
.fm-search { margin-left: auto; position: relative; display: flex; align-items: center; width: min(360px, 45%); }
.fm-search svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--muted); }
.fm-search input { width: 100%; height: 40px; padding: 0 40px 0 36px; border-radius: 10px; background: var(--surface-2); }
.fm-search kbd { position: absolute; right: 10px; font: 600 .72rem var(--font); color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; background: var(--surface); }
.fm-body { display: grid; grid-template-columns: 232px 1fr; min-height: 0; }
.fm-nav { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-right: 1px solid var(--line); background: var(--surface-2); overflow-y: auto; }
.fm-nav button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); font: 600 .9rem var(--font); text-align: left; cursor: pointer; transition: background-color .15s, color .15s; }
.fm-nav button svg { width: 17px; height: 17px; opacity: .7; flex-shrink: 0; }
.fm-nav button span { flex: 1; }
.fm-nav button:hover { background: var(--surface-3); color: var(--text); }
.fm-nav button[aria-selected="true"] { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.fm-nav button[aria-selected="true"] svg { opacity: 1; }
.fm-nav button:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.fm-nav .fm-nav-seg { margin-top: auto; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; padding-top: 14px; }
.fm-count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--brand); color: #fff; font-size: .74rem; display: inline-grid; place-items: center; }
.fm-count-muted { background: var(--surface-3); color: var(--text-2); }
.fm-body.is-searching .fm-nav button { opacity: .45; }
.fm-panels { overflow-y: auto; padding: 6px 26px 26px; overscroll-behavior: contain; scroll-padding-top: 12px; }
.fm-panel { display: grid; gap: 4px; }
.fm-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 0 8px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.fm-panel-head h3 { margin: 0; font-size: 1.05rem; }
.fm-panel-head p { margin: 2px 0 0; }
.fm-panel-head .link-btn { white-space: nowrap; }
.fm-body.is-searching .fm-panel-head .link-btn { display: none; }
.fm-field { padding: 14px 0; border-top: 1px solid var(--line); }
.fm-panel-head + .fm-field { border-top: 0; }
.fm-label { font-weight: 700; font-size: .88rem; margin-bottom: 10px; color: var(--text); }
.fm-hint { margin: 8px 0 0; color: var(--muted); font-size: .8rem; }
.fm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fm-chips.is-long:not(.is-expanded) { max-height: 112px; overflow: hidden; mask-image: linear-gradient(#000 70%, transparent); }
.fm-more { margin-top: 6px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-size: .85rem; font-weight: 550; color: var(--text-2); cursor: pointer; user-select: none; transition: background-color .12s, border-color .12s, color .12s; }
.opt span:hover { border-color: var(--brand); color: var(--text); }
.opt input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.opt input[type="checkbox"]:checked + span::before { content: ""; width: 12px; height: 12px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12l5 5L20 7' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12l5 5L20 7' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.fm-input input, .fm-path input { width: 100%; height: 40px; border-radius: 10px; }
.fm-input { max-width: 420px; }
.fm-path { display: flex; gap: 8px; max-width: 560px; }
.fm-path select { width: 160px; flex-shrink: 0; height: 40px; border-radius: 10px; }
.fm-utm { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.fm-utm-field { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--surface); }
.fm-utm-field span { display: grid; place-items: center; padding: 0 10px; background: var(--surface-2); font: 600 .78rem var(--font); color: var(--muted); border-right: 1px solid var(--line); }
.fm-utm-field input { border: 0; border-radius: 0; min-width: 0; flex: 1; height: 38px; }
.fm-utm-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.fm-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fm-range-lbl { color: var(--muted); font-size: .84rem; }
.fm-range select { height: 40px; border-radius: 10px; width: 92px; }
.fm-unit { display: inline-flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--surface); }
.fm-unit input { width: 110px; border: 0; border-radius: 0; height: 38px; }
.fm-unit span { display: grid; place-items: center; padding: 0 10px; background: var(--surface-2); color: var(--muted); font-size: .8rem; border-left: 1px solid var(--line); }
.fm-unit:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.fm-switch { padding: 0; }
.fm-save { padding: 14px; border: 1px dashed var(--line-2); border-radius: 12px; background: var(--surface-2); margin: 6px 0 14px; }
.fm-save-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fm-save-row input { flex: 1 1 220px; height: 40px; border-radius: 10px; }
.fm-seg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fm-seg-list li { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 4px 6px 4px 4px; transition: border-color .15s; }
.fm-seg-list li:hover { border-color: var(--brand); }
.fm-seg-apply { flex: 1; display: grid; gap: 2px; padding: 8px 10px; border-radius: 9px; color: var(--text); }
.fm-seg-apply small { overflow-wrap: anywhere; }
.fm-empty { display: grid; place-items: center; gap: 8px; padding: 60px 20px; color: var(--muted); text-align: center; }
.fm-empty svg { width: 34px; height: 34px; opacity: .4; }
.fm-foot { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface-2); }
.fm-status { margin-left: auto; font-size: .86rem; color: var(--text-2); }
.fm-status [data-fm-total] { font-weight: 800; color: var(--text); }
.fm-apply { min-width: 220px; justify-content: center; }
.fmodal.is-empty-result .fm-apply { background: var(--warning); border-color: var(--warning); }
@media (max-width: 780px) {
    .modal.fmodal { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; }
    .fm { border-radius: 0; border: 0; }
    .fm-head { flex-wrap: wrap; padding: 14px 14px 12px; }
    .fm-search { order: 3; width: 100%; margin: 0; }
    .fm-head .icon-btn { margin-left: auto; }
    .fm-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
    .fm-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; scrollbar-width: none; }
    .fm-nav button { width: auto; white-space: nowrap; padding: 8px 12px; }
    .fm-nav .fm-nav-seg { margin: 0; border: 0; padding-top: 8px; border-radius: 10px; }
    .fm-panels { padding: 0 16px 20px; }
    .fm-foot { flex-wrap: wrap; }
    .fm-status { order: -1; width: 100%; margin: 0; text-align: center; }
    .fm-foot .btn { flex: 1; }
    .fm-apply { min-width: 0; }
    .acc-row { flex-wrap: wrap; }
    .acc-row .period-pop { flex: 1; }
    .acc-row .acc-period { width: 100%; justify-content: flex-start; }
    .acc-search { order: 3; flex-basis: 100%; }
    .acc-advanced { flex: 1; justify-content: center; }
    .acc-quick-lbl { width: 100%; }
    .fm-unit input { width: 72px; }
    .fm-range { gap: 6px; }
    .popover-box { width: min(320px, calc(100vw - 32px)); }
    .seg-control { width: 100%; }
    .seg-control a { flex: 1; text-align: center; padding: 6px 4px; }
    .acc-select, .acc-select select { flex: 1; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .fmodal[open] .fm, .popover-box { animation: none; }
}
.share { display: inline-block; width: 46px; height: 5px; border-radius: 3px; background: var(--surface-3, var(--line)); vertical-align: middle; margin-left: 6px; overflow: hidden; }
.share span { display: block; height: 100%; background: var(--brand); }
.pivot td a { font-weight: 600; }
.pivot-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.pivot-form .field { flex: 1 1 200px; margin: 0; }
.heatmap { border-collapse: separate; border-spacing: 2px; font-size: .74rem; width: 100%; min-width: 640px; }
.heatmap th { color: var(--muted); font-weight: 600; padding: 2px 4px; text-align: center; }
.heatmap tbody th { text-align: left; }
.heatmap td { height: 26px; text-align: center; border-radius: 4px; background: color-mix(in srgb, var(--brand) calc(var(--heat, 0) * 100%), var(--surface-2)); }
.heatmap td a { display: block; color: inherit; font-weight: 600; }
.heatmap td[style*="--heat: 0;"], .heatmap td[style="--heat: 0"] { color: var(--muted); }
.table.compare td.best { font-weight: 800; color: var(--success); }
.raw-table td, .raw-table th { white-space: normal; vertical-align: top; }
.raw-table .ua { max-width: 260px; overflow-wrap: anywhere; color: var(--muted); }
.nowrap { white-space: nowrap; }

/* parceiros */
.stats-sm .stat-value { font-size: 1.3rem; }
.partner-switch { max-width: 260px; }
.journeys { display: grid; gap: 8px; }
.journey { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.journey[open] { background: var(--surface-2); }
.journey summary { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 10px 14px; cursor: pointer; }
.journey .j-when { font-weight: 700; font-variant-numeric: tabular-nums; }
.journey .j-meta { color: var(--muted); font-size: .86rem; }
.journey .j-landing { font-family: var(--font-mono, monospace); font-size: .82rem; color: var(--text-2); overflow-wrap: anywhere; }
.journey > p { padding: 0 14px 12px; margin: 0; }
.j-steps { list-style: none; margin: 0; padding: 4px 14px 12px; display: grid; gap: 4px; border-top: 1px solid var(--line); }
.j-steps li { display: grid; grid-template-columns: 70px 1fr auto; gap: 10px; align-items: baseline; padding: 5px 0; font-size: .88rem; }
.j-steps time { color: var(--muted); font-variant-numeric: tabular-nums; }
.j-steps .j-event span { color: var(--brand); font-weight: 600; }
.j-steps .j-event span::before { content: "CF  "; font-size: .7em; vertical-align: middle; }
.partner-links { display: grid; gap: 8px; }
.partner-link { display: grid; grid-template-columns: 170px 1fr auto; gap: 10px; align-items: center; }
.partner-link code { overflow-wrap: anywhere; font-size: .82rem; }
@media (max-width: 720px) {
    .partner-link, .j-steps li { grid-template-columns: 1fr; }
}
.inst-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 20px; align-items: start; }
.inst-preview { position: sticky; top: 16px; display: grid; gap: 12px; }
.inst-preview .chips { margin-top: 8px; }
.inst-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .88rem; font-variant-numeric: tabular-nums; }
.inst-options li { padding: 7px 10px; border-radius: 8px; background: var(--surface-2); }
.inst-options li.is-free { background: var(--success-soft); color: var(--success); font-weight: 600; }
.inst-fees { margin-top: 14px; }
.inst-fees summary { cursor: pointer; font-weight: 600; margin-bottom: 10px; }
.table tr.is-muted input { opacity: .5; }
.inst-rules { display: grid; gap: 10px; margin-bottom: 12px; }
.inst-rule { display: grid; grid-template-columns: 1.3fr .9fr 1fr 1.2fr auto auto; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.inst-rule .field { margin: 0; }
.inst-rule-active { padding-bottom: 9px; white-space: nowrap; }
@media (max-width: 1100px) {
    .inst-layout { grid-template-columns: 1fr; }
    .inst-preview { position: static; }
}
@media (max-width: 720px) {
    .inst-rule { grid-template-columns: 1fr 1fr; }
}
.period { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.period input { width: auto; }

/* ---------- Toasts e modal ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; background: var(--navy); color: #fff; box-shadow: var(--shadow-lg); font-size: .9rem; animation: toastin .4s var(--ease) both; }
.toast svg { margin-top: 1px; }
.toast-success svg { color: #3fca88; }
.toast-error { background: #a3192c; }
.toast.is-leaving { animation: toastout .3s var(--ease) both; }
.modal { border: 0; padding: 0; background: transparent; max-width: calc(100vw - 32px); }
.modal::backdrop { background: rgba(16, 24, 40, .45); backdrop-filter: blur(4px); }
.modal[open] .modal-box { animation: pop .25s var(--ease); }
.modal-box { width: 440px; max-width: 100%; background: var(--surface); color: var(--text); border-radius: 18px; padding: 24px; box-shadow: var(--shadow-lg); display: grid; gap: 10px; border: 1px solid var(--line); }
.modal-box h2 { margin: 0; font-size: 1.15rem; }
.modal-box p { margin: 0; color: var(--text-2); }
.modal-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--danger-soft); color: var(--danger); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* ---------- Login ---------- */
body.auth { background: var(--bg); }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { position: relative; overflow: hidden; background: var(--navy); color: #b9c6d9; display: grid; place-items: center; padding: 48px; isolation: isolate; }
.auth-art::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 60% at 90% 10%, rgba(29, 91, 216, .5), transparent 70%), radial-gradient(50% 50% at 10% 90%, rgba(193, 154, 75, .25), transparent 70%); }
.auth-art::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px); background-size: 48px 48px; }
.auth-art-inner { max-width: 420px; animation: fadein .8s var(--ease); }
.auth-art h2 { color: #fff; font-size: 2rem; margin: 22px 0 10px; }
.auth-art ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.auth-art li { display: flex; gap: 10px; align-items: center; }
.auth-art li svg { color: #e2c78e; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); display: grid; gap: 14px; animation: rise .5s var(--ease); }
.auth-card h1 { font-size: 1.5rem; margin: 0; }
.auth-card form .field span { font-weight: 600; font-size: .86rem; color: var(--text-2); }
.auth-card form label.field { gap: 6px; }
.auth-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.auth-icon svg { width: 26px; height: 26px; }
.auth-foot { margin-top: 18px; color: var(--muted); font-size: .8rem; }

/* ---------- Animações ---------- */
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes toastin { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateX(30px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Responsivo ---------- */
@media (max-width: 1180px) {
    .grid-main { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1023px) {
    .sidebar { transform: translateX(-100%); width: 272px; }
    body.sb-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
    body.sb-collapsed { --sb-w: 256px; }
    body.sb-collapsed .sb-brand-text, body.sb-collapsed .sb-group, body.sb-collapsed .sb-link span { display: initial; }
    .shell { margin-left: 0; }
    .user-meta { display: none; }
    .main { padding: 18px 16px 64px; }
    .topbar { padding: 0 12px; }
}
@media (max-width: 760px) {
    .grid-2, .grid-3, .kv.cols-2 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .col-full, .col-half, .col-third { grid-column: auto; }
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-art { display: none; }
    .global-search kbd { display: none; }
    h1 { font-size: 1.35rem; }
    .order-items li { grid-template-columns: 44px 1fr; }
    .order-items li > .num { grid-column: 2; text-align: left; }
    .form-actions { flex-wrap: wrap; }
    .stat-value { font-size: 1.35rem; }
}
.field-bool { justify-content: flex-end; padding-bottom: 4px; }
@media (max-width: 760px) { .chart .lbl { display: none; } }

/* ---------- Textos editáveis das páginas (sobre, produtos, soluções · contrato §3.2) ---------- */
.form-heading { padding-top: 6px; border-top: 1px solid var(--line); gap: 2px; }
.form-grid > .form-heading:first-child { border-top: 0; padding-top: 0; }
.form-heading h3 { margin: 0; }
.form-heading p { margin: 0; }
.field [data-restore] { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; text-decoration: none; }
.field [data-restore] svg { width: 13px; height: 13px; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.rot180 { transform: rotate(180deg); }

/* Prévia ao vivo, com as cores do site */
.site-preview { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 10px; background: var(--surface-2); }
.site-preview-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 2px 4px 10px; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.site-preview-head > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.site-preview-head svg { width: 14px; height: 14px; }
.site-preview-head .muted { font-weight: 500; letter-spacing: 0; text-transform: none; }
.sp-hero, .sp-cta { position: relative; overflow: hidden; isolation: isolate; border-radius: 12px; padding: 28px 26px; background: #060f1c; color: #aebdd2; }
.sp-hero::after, .sp-cta::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(50% 80% at 85% 0%, rgba(29, 91, 216, .35), transparent 70%), radial-gradient(40% 60% at 0% 100%, rgba(193, 154, 75, .14), transparent 70%); }
.sp-hero-image::after { background: linear-gradient(100deg, rgba(6, 15, 28, .97) 25%, rgba(6, 15, 28, .7) 65%, rgba(6, 15, 28, .45)); }
.sp-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .28; z-index: -2; }
.sp-eyebrow { display: flex; align-items: center; gap: .6em; margin: 0 0 10px; font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #e2c78e; }
.sp-eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--gold), #e2c78e); }
.sp-h1 { margin: 0 0 10px; max-width: 720px; color: #fff; font-size: 1.6rem; font-weight: 750; line-height: 1.15; letter-spacing: -.025em; }
.sp-h2 { margin: 0 0 8px; max-width: 560px; color: #fff; font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.sp-lead { margin: 0; max-width: 620px; font-size: .9rem; line-height: 1.55; color: #aebdd2; }
.sp-crumb { margin: 0 0 12px; font-size: .78rem; color: #8a9cb6; }
.sp-btn { display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; padding: 9px 16px; border-radius: 999px; background: #25d366; color: #fff; font-size: .82rem; font-weight: 700; }
.sp-btn svg { width: 15px; height: 15px; }
.sp-btn-glass { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); }
.sp-note { margin: 10px 0 0; font-size: .74rem; color: #8a9cb6; }
.site-preview .is-empty { display: none; }
.sp-crumb .is-empty { display: inline; }

/* Cartões de valores */
.cards-field { display: grid; gap: 10px; }
.vcard-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 10px; }
.vcard { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-xs); }
.vcard-icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--brand-soft); color: var(--brand); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.vcard-icon-btn:hover, .vcard-icon-btn[aria-expanded="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.vcard-icon-btn svg { width: 22px; height: 22px; }
.vcard-body { display: grid; gap: 6px; min-width: 0; }
.vcard-body input[data-k="title"] { font-weight: 650; }
.vcard-body textarea { resize: vertical; min-height: 58px; }
.vcard-tools { display: flex; flex-direction: column; gap: 2px; }
.vcard-tools .icon-btn:disabled { opacity: .3; cursor: default; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-xs); background: var(--surface-2); animation: fadein .15s; }
.icon-grid button { display: grid; place-items: center; height: 36px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-grid button:hover { background: var(--surface); border-color: var(--line-2); }
.icon-grid button.is-on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.cards-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cards-actions .muted { margin-left: auto; }
.cards-empty { margin: 0; padding: 14px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); text-align: center; }
@media (max-width: 640px) { .sp-hero, .sp-cta { padding: 22px 18px; } .sp-h1 { font-size: 1.3rem; } .vcard { gap: 8px; padding: 10px; } .vcard-icon-btn { width: 38px; height: 38px; } .vcard-body textarea { min-height: 96px; } }

/* Destaques da compra do produto (products.trust_items) */
.trust-field { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.trust-edit { display: grid; gap: 10px; min-width: 0; }
.trust-items { grid-template-columns: 1fr; }
.trust-items .vcard { align-items: center; }
.trust-items .vcard-body input[data-k="text"] { font-weight: 500; }
.vcard.is-payment { background: var(--surface-2); border-style: dashed; }
.vcard-icon-btn.is-static { cursor: default; box-shadow: none !important; border-color: var(--line) !important; }
.vcard-title { display: flex; align-items: center; gap: 8px; font-size: .88rem; }
.vcard-text { margin: 0; font-size: .84rem; color: var(--text-2); }
.trust-preview { background: #f5f7fb; }
.trust-preview-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.trust-preview-list li { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: #fff; font-size: .8rem; line-height: 1.4; color: var(--text-2); box-shadow: var(--shadow-xs); }
.trust-preview-list li svg { width: 17px; height: 17px; margin-top: 1px; color: var(--brand); }
.trust-preview-list li.is-empty-note { grid-column: 1 / -1; justify-content: center; background: transparent; box-shadow: none; color: var(--muted); border: 1px dashed var(--line-2); }
@media (max-width: 900px) { .trust-field { grid-template-columns: 1fr; } .trust-preview { position: static; } }
@media (max-width: 640px) { .trust-preview-list { grid-template-columns: 1fr; } }
.trust-preview-list li::before { content: none; }
.trust-preview .trust-preview-list li { padding: 10px 12px; }
.trust-items .vcard-tools { flex-direction: row; }
@media (max-width: 640px) { .trust-items .vcard { grid-template-columns: auto minmax(0, 1fr); } .trust-items .vcard-tools { grid-column: 1 / -1; justify-content: flex-end; margin-top: -4px; } }

/* ---------- E-mails (cPanel) ---------- */
.mail-app { display: grid; gap: 16px; }
.mail-toolbar { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.mail-toolbar select { width: auto; min-width: 200px; }
.mail-search { position: relative; flex: 1; min-width: 200px; max-width: 360px; margin: 0; }
.mail-search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.mail-search input { padding-left: 36px; }
.mail-table td { vertical-align: middle; }
.mail-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mail-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; text-transform: uppercase; flex-shrink: 0; }
.mail-who strong { display: block; color: var(--text); word-break: break-all; }
.mail-who small { color: var(--muted); }
.mail-who .icon-btn { opacity: 0; transition: opacity .15s; }
.mail-table tr:hover .mail-who .icon-btn, .mail-who .icon-btn:focus-visible { opacity: 1; }
.mail-usage { min-width: 170px; }
.mail-usage small { color: var(--muted); font-variant-numeric: tabular-nums; }
.mail-usage .meter.warn span { background: var(--warning); }
.mail-usage .meter.full span { background: var(--danger); }
.mail-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.mail-table tr.is-new { animation: mailflash 1.8s var(--ease); }
@keyframes mailflash { from { background: var(--brand-soft); } to { background: transparent; } }

.modal.mail-modal { width: min(560px, calc(100vw - 32px)); max-width: none; }
.mail-modal[open] .adj { animation: pop .25s var(--ease); }
.mail-modal .adj-icon svg { width: 20px; height: 20px; }
.mail-modal .field-label { font-weight: 600; font-size: .86rem; color: var(--text-2); }
.mail-modal .adj-foot { align-items: center; }
.mail-modal .adj-foot > div { display: flex; gap: 8px; }
.mail-foot-msg { margin-right: auto; color: var(--danger); font-size: .84rem; font-weight: 550; }
.mail-foot-msg.is-ok { color: var(--success); }
.mail-address { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.mail-address:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.mail-address.is-invalid { border-color: var(--danger); }
.mail-address input, .mail-address select { border: 0; border-radius: 0; box-shadow: none !important; min-width: 0; }
.mail-address input { flex: 1; }
.mail-address select { width: auto; flex-shrink: 1; background-color: var(--surface-2); }
.mail-at { display: grid; place-items: center; padding: 0 4px 0 8px; color: var(--muted); font-weight: 700; }
.mail-domain-fixed { display: flex; align-items: center; padding: 0 14px 0 4px; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.pass-row { display: flex; gap: 6px; align-items: center; }
.pass-row input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .02em; }
.pass-row input.is-invalid { border-color: var(--danger); }
.pass-meter { height: 5px; border-radius: 9px; background: var(--surface-3); overflow: hidden; }
.pass-meter span { display: block; height: 100%; width: 0; border-radius: 9px; background: var(--danger); transition: width .3s var(--ease), background-color .3s; }
.pass-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--muted); }
.pass-rules li::before { content: "○"; margin-right: 6px; }
.pass-rules li.ok { color: var(--success); }
.pass-rules li.ok::before { content: "✓"; }
.chip-radios { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-radio { position: relative; cursor: pointer; margin: 0; }
.chip-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-radio span { display: inline-flex; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font-size: .84rem; font-weight: 550; transition: .15s; }
.chip-radio:hover span { border-color: var(--brand); color: var(--brand); }
.chip-radio input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.chip-radio input:focus-visible + span { outline: 3px solid var(--brand-ring); outline-offset: 2px; }
.chip-radio input:disabled + span { opacity: .45; cursor: not-allowed; }
.mail-preview { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line-2); color: var(--text-2); font-size: .86rem; }
.mail-preview:empty { display: none; }
.mail-done-head { display: flex; gap: 12px; align-items: flex-start; }
.mail-done-head p { margin: 2px 0 0; }
.mail-done-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--success-soft); color: var(--success); flex-shrink: 0; animation: pop .35s var(--ease); }
.mail-done-icon svg { width: 20px; height: 20px; }
.mail-creds { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-size: .88rem; }
.mail-creds dt { color: var(--muted); }
.mail-creds dd { margin: 0; color: var(--text); font-weight: 550; word-break: break-all; }
.mail-tabs { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.mail-tab { display: inline-flex; align-items: center; gap: 7px; padding: 12px 12px 10px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; margin-bottom: -1px; }
.mail-tab svg { width: 16px; height: 16px; }
.mail-tab:hover { color: var(--text); }
.mail-tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }
.mail-tab.is-danger.is-active { color: var(--danger); border-bottom-color: var(--danger); }
.mail-panel-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.mail-danger { display: flex; gap: 12px; padding: 14px; border-radius: 12px; background: var(--danger-soft); border: 1px solid #fecdca; color: var(--danger); }
.mail-danger svg { width: 22px; height: 22px; flex-shrink: 0; }
.mail-danger strong { color: #b42318; }
.mail-danger p { margin: 4px 0 0; }
.mail-app.is-busy .mail-table { opacity: .6; transition: opacity .2s; }
@media (max-width: 720px) {
    .mail-table, .mail-table tbody { display: block; width: 100%; }
    .mail-table thead { display: none; }
    .mail-usage { min-width: 0; }
    .mail-search { min-width: 0; max-width: none; }
    .mail-table tr { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
    .mail-table td { padding: 0; border: 0; }
    .mail-actions { justify-content: flex-start; }
    .mail-who .icon-btn { opacity: 1; }
    .pass-row { flex-wrap: wrap; }
    .pass-row input { flex-basis: 100%; }
}
.mail-app .spinner, .mail-modal .spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: mailspin .7s linear infinite; vertical-align: -2px; }
@keyframes mailspin { to { transform: rotate(360deg); } }

/* ---------- Configurações → Mídias do topo (imagem, vídeo ou os dois por espaço) */
.hm { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.hm-slot { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-xs); }
.hm-slot.is-empty { border-style: dashed; }
.hm-head { display: flex; align-items: center; gap: 12px; }
.hm-head strong { display: block; }
.hm-head small { display: block; font-size: .8rem; }
/* miniatura do layout: o retângulo destacado é o espaço deste cartão */
.hm-mock { position: relative; flex-shrink: 0; width: 46px; height: 40px; }
.hm-mock i { position: absolute; border-radius: 4px; background: var(--surface-3); border: 1px solid var(--line-2); }
.hm-mock i:first-child { inset: 0 0 18% 16%; }
.hm-mock i:last-child { width: 46%; height: 52%; left: 0; bottom: 0; }
.hm-mock-main i:first-child, .hm-mock-second i:last-child { background: var(--brand-soft); border-color: var(--brand); }
.hm-field { display: flex; flex-direction: column; gap: 6px; }
.hm-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .86rem; }
.hm-label svg { width: 15px; height: 15px; color: var(--muted); }
.hm-result { margin: 0; padding: 8px 10px; border-radius: 8px; font-size: .84rem; background: var(--success-soft); color: var(--success); }
.hm-result[data-tone="tip"] { background: var(--info-soft); color: var(--info); }
.hm-result[data-tone="warn"] { background: var(--warning-soft); color: var(--warning); }
.hm-result[data-tone="off"] { background: var(--surface-2); color: var(--muted); }
.hm-tips { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; line-height: 1.5; }
.hm-tips svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; }

/* ---------- Configurações → Frete: peso cubado (parâmetros + simulação ao vivo) */
.cw { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cw-params { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.cw-step { display: flex; gap: 12px; padding: 14px; }
.cw-step + .cw-step { border-top: 1px solid var(--line); }
.cw-n { display: grid; place-items: center; flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: .78rem; font-weight: 700; }
.cw-body { display: grid; gap: 6px; min-width: 0; flex: 1; }
.cw-body > label:not(.switch) { font-weight: 600; }
.cw-body .switch { padding: 0; }
.cw-formula { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.cw-formula input { width: 110px; font-weight: 700; }
.cw-short { max-width: 200px; }
.cw-short input { max-width: none; width: 100%; min-width: 0; }
.cw-round { display: grid; gap: 10px; padding-top: 4px; animation: fadein .2s; }
.cw-inline { display: flex; align-items: center; gap: 8px; font-weight: 500 !important; }
.cw-modes { display: flex; flex-wrap: wrap; gap: 8px; }
.cw-mode { flex: 1 1 160px; display: flex; gap: 8px; align-items: flex-start; padding: 10px; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; }
.cw-mode:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.cw-mode input { margin-top: 3px; }
.cw-mode span { display: grid; gap: 2px; }
.cw-mode small { color: var(--muted); font-size: .78rem; }
.cw-sim { position: sticky; top: 80px; display: grid; gap: 10px; padding: 14px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--surface-2); }
.cw-sim-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cw-sample select { width: 100%; }
.cw-sim-in { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.cw-sim-in label { display: grid; gap: 3px; font-size: .74rem; font-weight: 600; color: var(--muted); }
.cw-sim-in input { min-width: 0; width: 100%; padding-left: 8px; padding-right: 6px; }
.cw-trace { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: .84rem; font-variant-numeric: tabular-nums; }
.cw-trace b { color: var(--text); }
.cw-result { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--success-soft); color: var(--success); font-weight: 600; }
.cw-result strong { font: 800 1.35rem var(--font-display); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .cw { grid-template-columns: 1fr; } .cw-sim { position: static; } }
@media (max-width: 480px) { .cw-sim-in { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Configurações → Frete: fórmula do frete (editor + simulação) */
.ff { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ff-edit { display: grid; gap: 8px; min-width: 0; }
.ff-label { font-weight: 600; }
.ff-input { font: 600 .95rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; resize: vertical; min-height: 64px; }
.ff-input.ff-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.ff-status { margin: 0; font-size: .84rem; font-weight: 600; }
.ff-status[data-tone="ok"] { color: var(--success); }
.ff-status[data-tone="error"] { color: var(--danger); }
.ff-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ff-chip { padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--surface); font: 600 .8rem ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--brand); cursor: pointer; }
.ff-chip:hover { border-color: var(--brand); background: var(--brand-soft); }
.ff-chip.ff-op { color: var(--text-2); }
.ff-sep { width: 1px; height: 18px; background: var(--line-2); margin: 0 2px; }
.ff-reset { margin-left: auto; }
.ff-help summary { cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--brand); }
.ff-help dl { display: grid; gap: 4px; margin: 8px 0; font-size: .84rem; }
.ff-help dl div { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }
.ff-help dd { margin: 0; color: var(--text-2); }
.ff-sim { display: grid; gap: 10px; padding: 14px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--surface-2); }
.ff-sim-in { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 8px; }
.ff-sim-in label { display: grid; gap: 3px; font-size: .74rem; font-weight: 600; color: var(--muted); }
.ff-sim-in input { min-width: 0; width: 100%; }
@media (max-width: 900px) { .ff { grid-template-columns: 1fr; } }
/* Configurações → Frete: limite da transportadora */
.fmax { display: grid; gap: 8px; }
.fmax-field { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.fmax-field label { margin: 0; }
.fmax-effect { margin: 0; font-size: .82rem; color: var(--muted); }
.fmax-effect[data-tone="ok"] { color: var(--success); }
.fmax-effect[data-tone="error"] { color: var(--danger); }
.fmax input.ff-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

/* Simulador de frete: detalhe do cálculo (mesmo passo a passo do site) */
.sim-detail { margin-top: 16px; display: grid; gap: 14px; }
.sim-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.sim-detail-head h2 { margin: 0; }
.sim-detail-head p { margin: 2px 0 0; }
.sim-detail-total { font: 800 1.5rem var(--font-display); color: var(--success); font-variant-numeric: tabular-nums; }
.sim-detail-total.is-off { color: var(--warning); }
.sim-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: none; }
.sim-steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 7px 0; position: relative; font-size: .9rem; color: var(--text-2); overflow-wrap: anywhere; }
.sim-steps li:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: -6px; width: 2px; background: var(--line); }
.sim-step-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); font: 700 .74rem var(--font); color: var(--muted); position: relative; z-index: 1; }
.sim-steps li.is-last { color: var(--text); font-weight: 600; }
.sim-steps li.is-last .sim-step-n { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.sim-block { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 14px; background: var(--surface); }
.sim-block > summary { cursor: pointer; padding: 12px 0; font-weight: 700; list-style-position: inside; }
.sim-block[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.sim-block > .table-wrap, .sim-block > p { margin-bottom: 14px; }
.sim-formula { display: grid; gap: 6px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); margin-bottom: 12px; }
.sim-formula code { font-size: .92rem; white-space: pre-wrap; overflow-wrap: anywhere; background: none; padding: 0; }
.sim-formula p { margin: 0; }
.sim-formula-final { font-size: 1rem; }
.sim-formula-final strong { color: var(--success); font-size: 1.1rem; }
.sim-vars { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.sim-vars > div { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.sim-vars code { font-size: .78rem; color: var(--muted); background: none; padding: 0; }
.sim-vars strong { font-variant-numeric: tabular-nums; }
.sim-winner { font-weight: 600; }

