/* ===== Tokens ===== */
:root {
  color-scheme: light;
  --page: #f3f6fb; --surface: #ffffff; --surface-2: #f7f9fd;
  --ink: #0e1a2b; --ink-2: #44546a; --ink-3: #5f7089;
  --line: #e2e9f3; --line-2: #edf1f8; --grid: #e6ecf5; --track: #e8eef8;
  --accent: #1565c0; --accent-2: #42a5f5; --accent-soft: #e8f1fc; --on-accent: #ffffff;
  --good: #0a7a3a; --good-bg: #e2f4e9; --bad: #c62828; --bad-bg: #fdeaea; --warn: #9a5a00; --warn-bg: #fff2d6;
  --nps-p: #2a78d6; --nps-n: #a8b3c2; --nps-d: #c62828;
  --funnel-1: #86b6ef; --funnel-2: #5598e7; --funnel-3: #2a78d6; --funnel-4: #1c5cab; --funnel-5: #104281;
  --hero: linear-gradient(135deg, #0a3a8a 0%, #1565c0 52%, #3197ec 100%);
  --shadow-1: 0 1px 2px rgba(15, 40, 90, .05), 0 8px 24px rgba(15, 40, 90, .06);
  --shadow-2: 0 2px 6px rgba(15, 40, 90, .08), 0 18px 40px rgba(15, 40, 90, .14);
  --glass: rgba(255, 255, 255, .78);
  --radius: 18px; --radius-sm: 11px;
  --ease: cubic-bezier(.22, .8, .24, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0a111f; --surface: #111b2e; --surface-2: #16223a;
    --ink: #e8eefc; --ink-2: #b5c1d9; --ink-3: #8fa0bd;
    --line: #22304b; --line-2: #1a2740; --grid: #22304b; --track: #1d2a44;
    --accent: #64b5f6; --accent-2: #42a5f5; --accent-soft: rgba(100, 181, 246, .14); --on-accent: #06203f;
    --good: #5fd38d; --good-bg: rgba(95, 211, 141, .14); --bad: #ff8a80; --bad-bg: rgba(255, 138, 128, .14); --warn: #f6b955; --warn-bg: rgba(246, 185, 85, .14);
    --nps-p: #5598e7; --nps-n: #6b7a94; --nps-d: #ff8a80;
    --funnel-1: #86b6ef; --funnel-2: #5598e7; --funnel-3: #3987e5; --funnel-4: #2a78d6; --funnel-5: #256abf;
    --hero: linear-gradient(135deg, #0b2a63 0%, #114a99 55%, #1f74c9 100%);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 40px rgba(0, 0, 0, .45);
    --glass: rgba(17, 27, 46, .78);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0a111f; --surface: #111b2e; --surface-2: #16223a;
  --ink: #e8eefc; --ink-2: #b5c1d9; --ink-3: #8fa0bd;
  --line: #22304b; --line-2: #1a2740; --grid: #22304b; --track: #1d2a44;
  --accent: #64b5f6; --accent-2: #42a5f5; --accent-soft: rgba(100, 181, 246, .14); --on-accent: #06203f;
  --good: #5fd38d; --good-bg: rgba(95, 211, 141, .14); --bad: #ff8a80; --bad-bg: rgba(255, 138, 128, .14); --warn: #f6b955; --warn-bg: rgba(246, 185, 85, .14);
  --nps-p: #5598e7; --nps-n: #6b7a94; --nps-d: #ff8a80;
  --funnel-1: #86b6ef; --funnel-2: #5598e7; --funnel-3: #3987e5; --funnel-4: #2a78d6; --funnel-5: #256abf;
  --hero: linear-gradient(135deg, #0b2a63 0%, #114a99 55%, #1f74c9 100%);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 40px rgba(0, 0, 0, .45);
  --glass: rgba(17, 27, 46, .78);
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h, 60px) + 58px); }
body { margin: 0; font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--page); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased; transition: background .3s, color .3s; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; cursor: pointer; color: inherit; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 14px; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }

/* ===== Animations ===== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.94); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes float { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(24px, -30px, 0) scale(1.08); } }
@keyframes indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.in { opacity: 1; transform: none; }

/* ===== Topbar ===== */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--glass); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .logo { width: 36px; height: 36px; border-radius: 11px; background: var(--hero); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; box-shadow: 0 4px 12px rgba(21, 101, 192, .35); }
.brand .titles { min-width: 0; }
.brand .name { font-weight: 700; letter-spacing: -.01em; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .sub { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spacer { flex: 1; }
.updated { display: none; }
.container { max-width: 1240px; margin: 0 auto; padding: 18px 16px 64px; }
#progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; overflow: hidden; opacity: 0; transition: opacity .2s; pointer-events: none; }
#progress::before { content: ''; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--accent-2), var(--accent)); animation: indeterminate 1.1s ease-in-out infinite; }
#progress.on { opacity: 1; }

/* ===== Buttons & inputs ===== */
.btn { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 11px; padding: 8px 14px; font-weight: 550; font-size: 14px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .18s, border-color .18s, transform .18s var(--ease), box-shadow .18s; }
.btn:hover { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.primary { background: var(--hero); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(21, 101, 192, .35); }
.btn.primary:hover { box-shadow: 0 8px 22px rgba(21, 101, 192, .45); filter: brightness(1.06); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn.icon { width: 38px; height: 38px; padding: 0; border-radius: 50%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; }
input[type=password], input[type=date], input[type=text], input[type=search], select { font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); transition: border-color .18s, box-shadow .18s; }
input:focus, select:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 25%, transparent); outline: none; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2371829b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input[type=date] { color-scheme: inherit; }

/* ===== Cards ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 20px; transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .25s; }
.card h2 { font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.card .sub { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.section { margin-top: 22px; }
.section > .card > .head { margin-bottom: 16px; }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }
.grid.kpis { grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 24px; }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid .wide { grid-column: 1 / -1; }
.error { color: var(--bad); font-size: 13.5px; min-height: 18px; }
.banner { background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; margin-top: 14px; animation: fadeUp .5s var(--ease) both; }
.alert { background: var(--bad-bg); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); border-radius: 12px; padding: 14px 16px; margin-top: 16px; font-size: 14px; animation: pop .35s var(--ease) both; }

/* ===== Auth (login) ===== */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { .auth { grid-template-columns: 1.1fr 1fr; } }
.auth-brand { position: relative; overflow: hidden; background: var(--hero); color: #fff; padding: 36px 32px; display: none; flex-direction: column; justify-content: space-between; }
@media (min-width: 900px) { .auth-brand { display: flex; padding: 56px; } }
.auth-brand h2 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; letter-spacing: -.03em; max-width: 14ch; position: relative; z-index: 1; }
.auth-brand p { opacity: .85; max-width: 38ch; margin-top: 16px; position: relative; z-index: 1; }
.auth-brand .mark { display: flex; align-items: center; gap: 12px; font-weight: 700; position: relative; z-index: 1; }
.auth-brand .mark .logo { width: 38px; height: 38px; border-radius: 12px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; backdrop-filter: blur(6px); }
.auth-brand ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; position: relative; z-index: 1; }
.auth-brand li { display: flex; gap: 10px; align-items: center; font-size: 14.5px; opacity: .92; }
.auth-brand li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #8fd0ff; box-shadow: 0 0 0 4px rgba(143, 208, 255, .2); flex: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(50px); opacity: .5; animation: float 14s ease-in-out infinite; }
.blob.b1 { width: 340px; height: 340px; background: #59b4ff; top: -90px; right: -60px; }
.blob.b2 { width: 280px; height: 280px; background: #7a6cff; bottom: -80px; left: -40px; animation-delay: -5s; }
.blob.b3 { width: 200px; height: 200px; background: #26d0ce; bottom: 30%; right: 12%; animation-delay: -9s; opacity: .35; }
.auth-panel { display: grid; place-items: center; padding: 24px 16px; background: var(--page); position: relative; }
.auth-card { width: 100%; max-width: 400px; animation: fadeUp .7s var(--ease) both; }
.auth-card .logo-m { width: 52px; height: 52px; border-radius: 15px; background: var(--hero); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 20px; margin-bottom: 20px; box-shadow: 0 8px 22px rgba(21, 101, 192, .35); }
@media (min-width: 900px) { .auth-card .logo-m { display: none; } }
.auth-card h1 { font-size: 26px; letter-spacing: -.03em; }
.auth-card form { margin-top: 26px; display: grid; gap: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding: 12px 44px 12px 14px; font-size: 15px; }
.pw-wrap .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; color: var(--ink-3); border-radius: 8px; display: grid; place-items: center; }
.pw-wrap .eye:hover { background: var(--accent-soft); color: var(--accent); }
.pw-wrap .eye svg { width: 19px; height: 19px; }
.shake { animation: shake .45s; }
.btn.block { width: 100%; padding: 12px; font-size: 15px; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.theme-fab { position: absolute; top: 14px; right: 14px; }

/* ===== Filters ===== */
.filters { padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg-btn { border: 0; background: transparent; padding: 7px 13px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); transition: background .2s, color .2s, box-shadow .2s; }
.seg-btn:hover { color: var(--accent); }
.seg-btn[aria-pressed=true] { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(15, 40, 90, .15), 0 0 0 1px var(--line); }
.custom-panel { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; width: 100%; padding-top: 12px; border-top: 1px dashed var(--line); animation: fadeUp .35s var(--ease) both; }
.period-note { font-size: 13px; color: var(--ink-3); width: 100%; }

/* ===== Section nav ===== */
.subnav { position: sticky; top: var(--topbar-h, 60px); z-index: 20; margin: 14px -16px 0; padding: 8px 16px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { flex: none; text-decoration: none; color: var(--ink-2); font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; transition: background .2s, color .2s; }
.subnav a:hover { background: var(--accent-soft); color: var(--accent); }
.subnav a.active { background: var(--accent); color: var(--on-accent); }

/* ===== Hero / diagnóstico ===== */
.hero { padding: 0; overflow: hidden; display: grid; grid-template-columns: 1fr; }
@media (min-width: 960px) { .hero { grid-template-columns: 350px 1fr; } }
.hero-main { background: var(--hero); color: #fff; padding: 26px 26px 96px; position: relative; overflow: hidden; min-height: 240px; }
.hero-main::after { content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%; right: -90px; bottom: -110px; background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 70%); }
.hero-main .eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; font-weight: 600; }
.hero-main .big { font-size: 36px; font-weight: 750; letter-spacing: -.035em; margin: 8px 0 2px; line-height: 1.1; }
.hero-main .lbl { opacity: .85; font-size: 14px; }
.hero-main .chip { display: inline-flex; gap: 4px; align-items: center; margin-top: 14px; font-size: 13px; font-weight: 650; padding: 4px 11px; border-radius: 999px; background: rgba(255, 255, 255, .18); backdrop-filter: blur(4px); }
.hero-main .chip.up::before { content: '↑'; } .hero-main .chip.down::before { content: '↓'; }
.hero-main .spark { position: absolute; left: 26px; right: 26px; bottom: 16px; width: calc(100% - 52px); height: 78px; z-index: 1; }
.hero-main .spark path { stroke: #fff; stroke-width: 1; opacity: .9; }
.hero-side { padding: 24px; display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .hero-side { grid-template-columns: 1.3fr 1fr; } }
.hero h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 10px; font-weight: 700; }
.hero p.text { font-size: 14px; color: var(--ink-2); }
.actions { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 12px; }
.actions li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); transition: transform .2s var(--ease), border-color .2s; }
.actions li:hover { transform: translateX(3px); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.actions .n { width: 28px; height: 28px; border-radius: 9px; background: var(--hero); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.actions b { font-size: 14px; display: block; }
.actions p { font-size: 13px; color: var(--ink-2); margin-top: 1px; }
.ind { padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.ind:last-child { border-bottom: 0; }
.ind .row { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.ind .ok { color: var(--good); font-weight: 650; } .ind .off { color: var(--warn); font-weight: 650; }
.meter { height: 5px; border-radius: 99px; background: var(--track); margin-top: 6px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--good); transition: width 1s var(--ease); }
.meter i.off { background: var(--warn); }

/* ===== KPI ===== */
.kpi { padding: 18px; position: relative; overflow: hidden; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.kpi .label { font-size: 13px; color: var(--ink-2); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 28px; font-weight: 720; letter-spacing: -.03em; margin-top: 8px; line-height: 1.1; }
.kpi .note { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.kpi .spark { position: absolute; right: 14px; top: 12px; width: 84px; height: 30px; opacity: .95; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.delta .vs { font-weight: 550; opacity: .85; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 650; margin-top: 10px; padding: 3px 9px; border-radius: 999px; }
.delta.good { color: var(--good); background: var(--good-bg); } .delta.bad { color: var(--bad); background: var(--bad-bg); }
.delta.flat { color: var(--ink-2); background: var(--line-2); }
.tip { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; cursor: help; position: relative; margin-left: 4px; }
.tip[data-tip]:hover::after, .tip[data-tip]:focus::after { content: attr(data-tip); position: absolute; left: 50%; top: 22px; transform: translateX(-30%); width: 230px; background: var(--ink); color: var(--surface); padding: 8px 10px; border-radius: 9px; font-size: 12px; font-weight: 450; line-height: 1.4; z-index: 40; text-align: left; box-shadow: var(--shadow-2); }

/* ===== Funil ===== */
.funnel { display: grid; max-width: 780px; margin: 0 auto; }
.f-step { display: grid; justify-items: center; }
.f-shape { width: 100%; height: 58px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 18px; opacity: 0; transform: scaleY(.6) scaleX(.85); transition: opacity .55s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 110ms); }
.in .f-shape { opacity: 1; transform: none; }
.f-shape.dark { color: #0e1a2b; }
.f-label { font-size: 13px; color: var(--ink-2); margin: 5px 0 2px; }
.f-conv { font-size: 12.5px; font-weight: 650; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 11px; margin: 6px 0; }

/* ===== Charts ===== */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .axis-label { fill: var(--ink-3); font-size: 10.5px; font-family: inherit; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; transition: stroke-dashoffset 1.3s var(--ease); }
.chart .area { stroke: none; opacity: 0; transition: opacity .9s .5s; }
.chart.drawn .area { opacity: 1; }
.chart .stop-a { stop-color: var(--accent); stop-opacity: .3; } .chart .stop-b { stop-color: var(--accent); stop-opacity: 0; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2.5; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-title { font-size: 13.5px; font-weight: 650; margin-bottom: 6px; }
.tooltip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); border-radius: 10px; padding: 8px 11px; font-size: 12.5px; z-index: 10; white-space: nowrap; transform: translate(-50%, -115%); animation: pop .15s var(--ease) both; }
.tooltip b { font-size: 14.5px; display: block; }

/* ===== Tables & bars ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th.r, td.r { text-align: right; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover td { background: var(--accent-soft); }
.bar-row { display: grid; grid-template-columns: 150px 1fr 100px; gap: 10px; align-items: center; margin: 9px 0; font-size: 13.5px; }
.bar-track { background: var(--track); border-radius: 6px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 0 6px 6px 0; transition: width 1s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.bar-fill.alt { background: var(--accent-2); }
.nps-stack { display: flex; height: 24px; border-radius: 8px; overflow: hidden; gap: 2px; margin: 12px 0; }
.nps-stack div { min-width: 2px; width: 0; transition: width 1s var(--ease); }
.nps-p { background: var(--nps-p); } .nps-n { background: var(--nps-n); } .nps-d { background: var(--nps-d); }
.nps-score { font-size: 38px; font-weight: 750; letter-spacing: -.03em; display: flex; align-items: center; gap: 10px; }
.pill { display: inline-block; padding: 2px 11px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--accent-soft); color: var(--accent); }
.pill.LOW { background: var(--good-bg); color: var(--good); } .pill.MEDIUM { background: var(--warn-bg); color: var(--warn); } .pill.HIGH { background: var(--bad-bg); color: var(--bad); }
.stat { padding: 2px 0; }
.stat .v { font-size: 24px; font-weight: 720; letter-spacing: -.025em; }
.stat .l { font-size: 12.5px; color: var(--ink-3); }
.life { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.life > div { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--surface-2); transition: transform .2s var(--ease), box-shadow .2s; }
.life > div:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); }
.life .v { font-size: 26px; font-weight: 720; letter-spacing: -.02em; }
.mech-legend { margin-top: 12px; font-size: 12.5px; color: var(--ink-2); display: grid; gap: 5px; }
.toggle { background: none; border: 0; color: var(--accent); font-size: 13px; padding: 0; text-decoration: underline; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; }

/* ===== Skeleton ===== */
.skel { position: relative; overflow: hidden; background: var(--track); border-radius: 12px; }
.skel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); transform: translateX(-100%); animation: shimmer 1.3s infinite; }
:root[data-theme="dark"] .skel::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .07), transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .skel::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .07), transparent); } }
.skel.h1 { height: 220px; border-radius: var(--radius); } .skel.h2 { height: 118px; border-radius: var(--radius); } .skel.h3 { height: 300px; border-radius: var(--radius); }
.loading .content { opacity: .55; transition: opacity .2s; pointer-events: none; }

/* ===== Master ===== */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.summary .card { display: flex; gap: 14px; align-items: center; }
.summary .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.summary .ico svg { width: 22px; height: 22px; }
.summary .v { font-size: 30px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; }
.tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.tools input[type=search] { flex: 1; min-width: 200px; max-width: 380px; padding-left: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371829b' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 12px center; }
.client-row td { vertical-align: middle; }
.client-row { animation: fadeUp .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.who { display: flex; align-items: center; gap: 12px; }
.avatar { width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; flex: none; font-size: 14px; }
.badge { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 999px; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.on { background: var(--good-bg); color: var(--good); } .badge.off { background: var(--line-2); color: var(--ink-2); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.modal-back { position: fixed; inset: 0; background: rgba(8, 16, 32, .55); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; z-index: 80; animation: fadeUp .25s ease both; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px; max-width: 470px; width: 100%; box-shadow: var(--shadow-2); animation: pop .3s var(--ease) both; }
.modal h2 { font-size: 19px; margin-bottom: 8px; letter-spacing: -.02em; }
.pw { display: block; margin: 16px 0; padding: 16px; background: var(--accent-soft); border-radius: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 17px; word-break: break-all; user-select: all; border: 1px dashed var(--accent-2); color: var(--ink); }
.modal .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 90; }
.toast { background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-2); animation: fadeUp .35s var(--ease) both; }
.toast.bad { background: var(--bad); color: #fff; }

@media (max-width: 640px) {
  .brand .name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.2; font-size: 15px; }
  .topbar-inner { gap: 8px; padding: 8px 12px; }
  .topbar-inner .btn:not(.icon) { padding: 6px 10px; font-size: 13px; }
  .bar-row { grid-template-columns: 96px 1fr 76px; }
  .kpi .value { font-size: 25px; }
  .hero-main .big { font-size: 33px; }
  .kpi .spark { width: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; } .f-shape { opacity: 1; transform: none; }
}
.muted-w { opacity: .7; position: relative; z-index: 1; }

/* ===== Logo LP Mídias ===== */
.logo-mark { width: 40px; height: 40px; border-radius: 12px; background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; box-shadow: 0 0 0 1px var(--line), 0 4px 12px rgba(21, 101, 192, .18); }
.logo-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo-chip { display: inline-grid; place-items: center; background: #fff; border-radius: 16px; padding: 9px 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.logo-chip img { height: 46px; width: auto; display: block; }
.auth-brand .mark { flex-direction: column; align-items: flex-start; gap: 12px; }
.mark-txt { opacity: .88; font-weight: 600; font-size: 14px; letter-spacing: .02em; }
.logo-wide { height: 42px; width: auto; display: block; margin-bottom: 22px; background: #fff; border-radius: 12px; padding: 6px 12px; box-shadow: 0 0 0 1px var(--line), var(--shadow-1); }
@media (min-width: 900px) { .logo-wide { display: none; } }

/* ===== Extras ===== */
.updated-m { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); margin: 0 2px 10px; }
.updated-m::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-bg); flex: none; }
.updated-m:empty { display: none; }
.updated-m b { color: var(--ink-2); font-weight: 650; }
.updated-m.stale { color: var(--warn); }
.updated-m.stale::before { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.updated-m .late { font-weight: 700; margin-left: 4px; }
.kpi-cap { display: none; }
.chart svg { touch-action: pan-y; }
.seg.mini { width: auto; }
.seg.mini .seg-btn { padding: 5px 12px; font-size: 13px; }
.head .seg { align-self: center; }
.table-scroll { max-height: 340px; overflow-y: auto; border: 1px solid var(--line-2); border-radius: 12px; margin-top: 10px; }
.table-scroll th { position: sticky; top: 0; background: var(--surface); }

/* ===== Mobile ===== */
@media (max-width: 640px) {
  html { scroll-padding-top: calc(var(--topbar-h, 60px) + 52px); }
  .container { padding: 12px 12px 56px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); padding-bottom: max(56px, env(safe-area-inset-bottom)); }
  .topbar-inner { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .subnav { margin-left: -12px; margin-right: -12px; padding: 7px 12px; -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); mask-image: linear-gradient(90deg, #000 90%, transparent); }
  .subnav a { padding: 8px 14px; }
  .card { padding: 16px; border-radius: 16px; }
  .card.hero { padding: 0; }
  .section { margin-top: 16px; }
  .btn { min-height: 40px; }
  select, input[type=date], input[type=text], input[type=password], input[type=search] { font-size: 16px; }
  .filters { padding: 12px; gap: 10px; }
  .filters .seg { display: flex; flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .filters .seg::-webkit-scrollbar { display: none; }
  .filters .seg-btn { flex: 1 0 auto; min-height: 40px; }
  #month, #customToggle { flex: 1 1 0; min-width: 0; min-height: 44px; }
  .custom-panel input[type=date] { flex: 1 1 130px; min-width: 0; }
  .custom-panel .btn { width: 100%; }
  .grid.kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .label { font-size: 12.5px; }
  .kpi .value, .stat .v { white-space: nowrap; }
  .kpi .value { font-size: clamp(15px, 4.7vw, 20px); }
  .kpi .value.long, .stat .v.long { font-size: clamp(13px, 4vw, 17px); }
  .kpi .value.xlong, .stat .v.xlong { font-size: clamp(12px, 3.5vw, 15px); }
  .kpi .note { font-size: 11.5px; }
  .kpi .spark { display: none; }
  .kpi:hover { transform: none; }
  .delta { font-size: 12px; padding: 3px 8px; }
  .delta .vs { display: none; }
  .kpi-cap { display: block; margin: 0 2px 8px; }
  .stat .v { font-size: clamp(15px, 4.7vw, 20px); }
  .hero-main { padding: 20px 20px 84px; min-height: 0; }
  .hero-main .spark { height: 62px; bottom: 14px; }
  .hero-side { padding: 18px; gap: 18px; }
  .actions li:hover { transform: none; }
  .grid.two { gap: 20px; }
  .grid.three { gap: 18px; }
  .life { grid-template-columns: 1fr 1fr; gap: 10px; }
  .life .v { font-size: 22px; }
  .funnel .f-shape { height: 50px; font-size: 16px; }
  .tooltip { font-size: 12px; }
  /* tabelas empilhadas: cada linha vira um cartão em 2 colunas (rótulo em cima, valor embaixo) */
  table.stack thead { display: none; }
  table.stack, table.stack tbody { display: block; width: 100%; }
  table.stack tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; background: var(--surface-2); }
  table.stack td { display: block; border: 0; padding: 0; text-align: left; min-width: 0; font-size: 14px; }
  table.stack td::before { content: attr(data-label); display: block; color: var(--ink-3); font-size: 11.5px; font-weight: 500; margin-bottom: 1px; white-space: nowrap; }
  table.stack td:first-child { grid-column: 1 / -1; font-size: 15px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
  table.stack td:first-child::before, table.stack td.act::before { content: none; }
  table.stack td.wide, table.stack td.act { grid-column: 1 / -1; }
  table.stack td.act { padding-top: 4px; }
  table.stack tbody tr:hover td { background: none; }
  .row-actions .btn { flex: 1 1 calc(50% - 6px); }
  /* modais como "bottom sheet" */
  .modal-back { align-items: end; padding: 0; }
  .modal { max-width: none; border-radius: 22px 22px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); animation: fadeUp .3s var(--ease) both; }
  .modal .row .btn { flex: 1; }
  .toasts { bottom: calc(18px + env(safe-area-inset-bottom)); width: calc(100% - 24px); }
  .toast { text-align: center; }
  .summary { grid-template-columns: 1fr 1fr; gap: 10px; }
  .summary .card { flex-direction: column; align-items: flex-start; gap: 10px; }
  .summary .card:last-child { grid-column: 1 / -1; flex-direction: row; align-items: center; }
  .tools input[type=search] { max-width: none; }
  .auth-panel { padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); align-items: start; padding-top: 12vh; }
}

details.names { margin-top: 4px; }
details.names ul { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); max-height: 180px; overflow-y: auto; }
details.names li { margin: 2px 0; }

/* ===== Grupos de lojas ===== */
.stores { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.store { display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit; }
.store:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.store .go { color: var(--accent); font-weight: 650; font-size: 13.5px; margin-top: auto; }
.store-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.store-kpis .v { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.store-kpis .delta { margin-top: 4px; }
.store-switch { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.store-switch label { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.store-switch select { flex: 1; min-width: 0; max-width: 460px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mini-chip { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.check-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: grid; gap: 2px; }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; font-size: 14px; cursor: pointer; }
.check:hover { background: var(--accent-soft); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.field input[type=text] { width: 100%; }
@media (max-width: 640px) { .store-kpis .v { font-size: 16px; } .store-switch select { max-width: none; } }

/* ===== Master: separação com/sem senha ===== */
.tools .seg { margin-left: auto; }
tr.group-head td { background: var(--surface-2); font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); padding: 10px 12px; border-bottom: 1px solid var(--line); }
tr.group-head .count { margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); font-size: 12px; }
tr.group-head.ok td { color: var(--good); } tr.group-head.ok .count { background: var(--good-bg); color: var(--good); }
tr.group-head.no td { color: var(--warn); } tr.group-head.no .count { background: var(--warn-bg); color: var(--warn); }
.data-info { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.data-info.stale { color: var(--warn); font-weight: 600; }
.mech-legend .detail p { margin: 6px 0 0; }
.mech-legend .detail { margin: 4px 0 8px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; }
@media (max-width: 640px) {
  .tools .seg { margin-left: 0; width: 100%; display: flex; overflow-x: auto; scrollbar-width: none; }
  .tools .seg-btn { flex: 1 0 auto; }
  table.stack tr.group-head { display: block; border: 0; background: none; padding: 4px 2px 0; margin: 6px 0 8px; }
  table.stack tr.group-head td { display: block; border: 0; padding: 0; background: none; font-size: 12.5px; }
  table.stack tr.group-head td::before { content: none; }
}
