/* =====================================================================
   Pulso Analytics — sistema visual
   Assinatura: a linha de pulso em gradiente índigo → ciano.
   ===================================================================== */
@font-face { font-family: "Plex"; src: url(vendor/fonts/ibm-plex-sans-latin-300-normal.woff2) format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Plex"; src: url(vendor/fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url(vendor/fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url(vendor/fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex"; src: url(vendor/fonts/ibm-plex-sans-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --plane: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #f7f8fd;
  --ink: #12142b;
  --ink-2: #4e5273;
  --muted: #868aa6;
  --line: #e6e8f2;
  --line-strong: #cfd3e4;
  --indigo: #4f46e5;
  --indigo-ink: #3d35c9;
  --cyan: #06b6d4;
  --accent: var(--indigo);
  --accent-wash: #eef0ff;
  --grad: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  --grad-soft: linear-gradient(135deg, rgba(79,70,229,.14), rgba(6,182,212,.14));
  --cmp: #a3a8c3;
  --good: #15803d;
  --good-dot: #22c55e;
  --bad: #dc2652;
  --warn: #b45309;
  --night: #0b0d1f;
  --night-2: #141738;
  --night-ink: #c9cdea;
  --night-ink-strong: #ffffff;
  --night-line: rgba(255, 255, 255, .08);
  --shadow: 0 1px 2px rgba(18, 20, 43, .04), 0 8px 24px -12px rgba(18, 20, 43, .12);
  --shadow-lg: 0 24px 60px -24px rgba(18, 20, 43, .35);
  --focus: 0 0 0 3px rgba(79, 70, 229, .35);
  --r-xl: 18px;
  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 7px;
  --font: "Plex", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --plane: #0b0d1f; --surface: #141738; --surface-2: #1a1e47; --ink: #eceef9; --ink-2: #aeb3d3; --muted: #7f85ab;
    --line: #242956; --line-strong: #343a6e; --accent: #7c74ff; --indigo-ink: #a5a0ff; --accent-wash: #22265a; --cmp: #6b7199;
    --good: #4ade80; --bad: #fb7185; --warn: #fbbf24; --night: #06071a; --night-2: #0f1130;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
    --grad-soft: linear-gradient(135deg, rgba(124,116,255,.18), rgba(6,182,212,.14));
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --plane: #0b0d1f; --surface: #141738; --surface-2: #1a1e47; --ink: #eceef9; --ink-2: #aeb3d3; --muted: #7f85ab;
  --line: #242956; --line-strong: #343a6e; --accent: #7c74ff; --indigo-ink: #a5a0ff; --accent-wash: #22265a; --cmp: #6b7199;
  --good: #4ade80; --bad: #fb7185; --warn: #fbbf24; --night: #06071a; --night-2: #0f1130;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
  --grad-soft: linear-gradient(135deg, rgba(124,116,255,.18), rgba(6,182,212,.14));
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--plane); color: var(--ink); font: 400 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--indigo-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.015em; }
h1 { font-size: 24px; line-height: 1.2; }
h2 { font-size: 15px; }
h3 { font-size: 13px; font-weight: 500; color: var(--ink-2); }
code, pre { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
[hidden] { display: none !important; }
.right { text-align: right; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- marca ---------- */
.mark { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--grad); box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .6); flex: none; }
.mark svg { width: 22px; height: 12px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pulse-line { fill: none; stroke: url(#pulseGrad); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- moldura ---------- */
body.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
body.app::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(900px 420px at 18% -8%, rgba(79, 70, 229, .14), transparent 60%), radial-gradient(700px 360px at 95% 0%, rgba(6, 182, 212, .12), transparent 60%); }
.side { position: sticky; top: 0; height: 100vh; z-index: 1; display: flex; flex-direction: column; padding: 22px 16px; background: var(--night); color: var(--night-ink); }
.side::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(500px 300px at -20% 110%, rgba(6,182,212,.22), transparent 60%), radial-gradient(400px 260px at 110% -10%, rgba(79,70,229,.35), transparent 60%); }
.side > * { position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--night-ink-strong); font-weight: 600; font-size: 15px; padding: 2px 6px 24px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: auto; }
.side nav a { color: var(--night-ink); padding: 8px 12px; border-radius: var(--r-md); font-weight: 500; }
.side nav a:hover { background: var(--night-line); text-decoration: none; color: var(--night-ink-strong); }
.side nav a.on { background: linear-gradient(90deg, rgba(79,70,229,.45), rgba(6,182,212,.18)); color: var(--night-ink-strong); }
.side-sites { display: flex; flex-direction: column; gap: 1px; margin: 4px 0 10px 14px; padding-left: 10px; border-left: 1px solid var(--night-line); }
.side-sites a { font-size: 13px; padding: 6px 10px !important; font-weight: 400 !important; }
.side-group { margin: 20px 12px 6px; font-size: 12px; color: #8088b8; }
.side-foot { border-top: 1px solid var(--night-line); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.who { display: flex; flex-direction: column; padding: 4px 12px; color: var(--night-ink-strong); }
.who span { font-size: 12px; color: #8088b8; }
.who:hover { text-decoration: none; }
.side-actions { display: flex; gap: 14px; padding: 0 12px; font-size: 13px; }
.side-actions a, .side-actions .link { color: var(--night-ink); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.attrib { padding: 2px 12px 0; font-size: 11px; color: #6a7199; }
.attrib a { color: inherit; text-decoration: underline; }
.side-toggle { display: none; }
.main { position: relative; z-index: 1; padding: 30px 36px 72px; min-width: 0; max-width: 1200px; }
.main.wide { max-width: 1500px; }

@media (max-width: 860px) {
  body.app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 16px; }
  .brand { padding: 4px 0; flex: 1; }
  .side-toggle { display: inline-block; background: none; border: 1px solid var(--night-line); color: var(--night-ink-strong); border-radius: var(--r-sm); padding: 6px 12px; font: inherit; }
  .side nav, .side-foot { display: none; width: 100%; }
  .side.open nav, .side.open .side-foot { display: flex; }
  .main { padding: 20px 16px 48px; }
}

/* ---------- elementos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 500 14px/1 var(--font); padding: 10px 16px; border-radius: var(--r-md); cursor: pointer; white-space: nowrap; transition: transform .12s ease, box-shadow .12s ease; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 20px -8px rgba(79, 70, 229, .7); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: currentColor; background: transparent; }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: progress; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.panel { background: var(--surface); border-radius: var(--r-xl); padding: 24px; box-shadow: var(--shadow); }
.panel h2 { margin-bottom: 14px; }
.panel.narrow { max-width: 580px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }

.flash { padding: 11px 16px; border-radius: var(--r-md); margin-bottom: 18px; background: var(--accent-wash); color: var(--ink); border-left: 3px solid var(--accent); }
.flash.error { border-left-color: var(--bad); }
.form-error { color: var(--bad); margin: 0 0 12px; }

.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 13px; color: var(--ink-2); }
.form label small { font-weight: 400; color: var(--muted); }
input, select { font: 14px var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 9px 12px; min-height: 40px; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
fieldset { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
legend { padding: 0 6px; font-weight: 500; font-size: 13px; color: var(--ink-2); }
.form label.radio, .form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); }
.form label.check small { color: var(--muted); }
.danger-zone { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

.table-wrap { background: var(--surface); border-radius: var(--r-lg); overflow-x: auto; box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; font-size: 13px; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }

.empty { background: var(--surface); border-radius: var(--r-xl); padding: 56px 24px; text-align: center; box-shadow: var(--shadow); }
.empty h2 { font-size: 18px; margin-bottom: 6px; }
.empty p { color: var(--ink-2); margin: 0 0 18px; }

/* ---------- login / primeiro acesso ---------- */
body.bare { min-height: 100vh; background: var(--night); color: var(--ink); }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 44px 52px; color: #fff;
  background: radial-gradient(900px 600px at 10% 10%, rgba(79,70,229,.75), transparent 60%), radial-gradient(800px 520px at 95% 90%, rgba(6,182,212,.55), transparent 60%), var(--night); }
.auth-hero::before { content: ""; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ccircle cx='1' cy='1' r='1' fill='rgba(255,255,255,0.07)'/%3E%3C/svg%3E"); }
.auth-hero > * { position: relative; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 16px; }
.auth-hero h1 { font-size: clamp(30px, 3.6vw, 46px); font-weight: 600; line-height: 1.08; letter-spacing: -.03em; max-width: 14ch; margin: 0 0 14px; }
.auth-hero p { font-size: 16px; line-height: 1.55; color: rgba(255,255,255,.78); max-width: 46ch; margin: 0; }
.auth-wave { width: 100%; max-width: 560px; height: 150px; margin: 28px 0 10px; }
.auth-figs { display: flex; gap: 36px; margin-top: 18px; }
.auth-figs b { display: block; font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.auth-figs span { font-size: 12px; color: rgba(255,255,255,.7); }
.auth-foot { font-size: 12px; color: rgba(255,255,255,.55); }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth { width: 100%; max-width: 380px; }
.auth h2 { font-size: 24px; letter-spacing: -.02em; margin-bottom: 6px; }
.auth .lead { color: var(--ink-2); margin: 0 0 22px; }
.auth .form { margin-top: 20px; }
.auth .btn { margin-top: 6px; padding: 12px 16px; font-size: 15px; }
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { padding: 28px 24px; min-height: 280px; }
  .auth-hero h1 { font-size: 28px; }
  .auth-wave, .auth-figs, .auth-foot { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .auth-wave .pulse-line { stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: draw 2.2s cubic-bezier(.4,0,.2,1) .2s forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}

/* ---------- instalação ---------- */
.install-status { border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; margin-bottom: 20px; background: var(--surface-2); }
.install-status.ok { background: linear-gradient(90deg, rgba(34,197,94,.14), transparent); }
.install-status.ok strong::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good-dot); margin-right: 8px; vertical-align: 1px; }
.install-status span { color: var(--ink-2); font-size: 13px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 22px; }
.steps h3 { color: var(--ink); font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.steps p { margin: 4px 0; }
.code-row code, .code-block pre { display: block; background: var(--night); color: #dfe3ff; border-radius: var(--r-md); padding: 12px 14px; overflow-x: auto; margin: 6px 0; white-space: pre; }
.code-block { position: relative; }
.code-block .btn { position: absolute; top: 8px; right: 8px; }
.code-block pre { padding-right: 130px; }

/* teste de instalação */
.diag { margin-top: 20px; }
.diag-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.diag-head h2 { margin-bottom: 2px; }
.diag-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.diag-list:empty { display: none; }
.diag-item { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: start; background: var(--surface-2); border-radius: var(--r-md); padding: 11px 12px; }
.diag-item p { margin: 2px 0 0; color: var(--ink-2); font-size: 13px; }
.diag-item .diag-fix { color: var(--ink); }
.diag-badge { font-size: 12px; font-weight: 600; text-align: center; padding: 3px 0; border-radius: 999px; border: 1px solid currentColor; }
.diag-item.ok .diag-badge { color: var(--good); }
.diag-item.warn .diag-badge { color: var(--warn); }
.diag-item.fail .diag-badge { color: var(--bad); }
.diag-item.fail { box-shadow: inset 3px 0 0 var(--bad); }
.diag-item.pending .diag-badge { color: var(--muted); }
.live-feed { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.live-feed-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.live-feed-head h3 { color: var(--ink); font-size: 14px; font-weight: 600; }
.live-dot-sm { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good-dot); margin-right: 4px; vertical-align: 1px; }
.table.feed td, .table.feed th { padding: 8px 12px; font-size: 13px; white-space: nowrap; }
.table.feed .feed-path { white-space: normal; word-break: break-all; min-width: 160px; }

/* ---------- lista de sites ---------- */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.site-tile { position: relative; overflow: hidden; background: var(--surface); border-radius: var(--r-xl); padding: 20px 20px 10px; color: var(--ink); display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.site-tile::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--grad); }
.site-tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.site-tile-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.site-tile-head strong { font-size: 16px; }
.site-domain { color: var(--muted); font-size: 13px; }
.site-figs { display: flex; gap: 28px; margin-top: 16px; }
.site-figs b { display: block; font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.site-figs span { font-size: 12px; color: var(--muted); }
.spark { height: 60px; margin-top: 6px; }
.live-pill { font-size: 12px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); padding: 3px 10px; border-radius: 999px; }
.live-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good-dot); }

/* ---------- dashboard ---------- */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.dash-title .domain { color: var(--muted); }
.dash-actions { display: flex; gap: 8px; }

.controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; padding: 12px 16px; background: var(--surface); border-radius: var(--r-lg); position: sticky; top: 10px; z-index: 5; box-shadow: var(--shadow); }
.ctl { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.ctl select { min-width: 150px; min-height: 36px; padding: 6px 10px; }
.ctl-dates { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.ctl-dates input { min-height: 36px; padding: 6px 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; justify-content: flex-end; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-wash); color: var(--ink); border-radius: 999px; padding: 5px 6px 5px 12px; font-size: 13px; max-width: 360px; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { border: 0; background: transparent; color: var(--ink-2); cursor: pointer; width: 22px; height: 22px; border-radius: 50%; font-size: 15px; line-height: 1; }
.chip button:hover { background: var(--surface); }
.range-note { color: var(--muted); font-size: 13px; margin: 12px 4px 16px; min-height: 20px; }

/* faixa ao vivo — o elemento de assinatura */
.pulse { border: 1px solid var(--night-line); position: relative; overflow: hidden; display: grid; grid-template-columns: 240px minmax(0, 1fr) minmax(0, 340px); gap: 24px; align-items: stretch; color: #eef0ff; border-radius: var(--r-xl); padding: 22px 26px; margin-bottom: 18px;
  background: radial-gradient(700px 300px at 0% 0%, rgba(79,70,229,.55), transparent 60%), radial-gradient(600px 300px at 100% 100%, rgba(6,182,212,.35), transparent 60%), var(--night); box-shadow: var(--shadow-lg); }
.pulse > * { position: relative; min-width: 0; }
.pulse-now { display: flex; flex-direction: column; justify-content: center; }
.pulse-now .big { display: flex; align-items: center; gap: 12px; }
.pulse-now b { font-size: 54px; font-weight: 600; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; background: linear-gradient(90deg, #fff, #a5f3fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pulse-now span { color: #c9cdea; }
.pulse-now small { color: #8088b8; font-size: 12px; margin-top: 4px; }
.pulse-30 { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--night-line); font-size: 13px; color: #c9cdea; }
.pulse-30 b { font-size: 18px; font-weight: 600; color: #fff; margin-right: 4px; background: none; -webkit-text-fill-color: #fff; letter-spacing: -.01em; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #34d399; position: relative; flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .live-dot::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid #34d399; animation: ping 2s ease-out infinite; }
}
@keyframes ping { from { transform: scale(.5); opacity: .9; } to { transform: scale(1.7); opacity: 0; } }
.pulse-chart { min-height: 130px; }
.pulse-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; font-size: 13px; }
.pulse-lists > div { min-width: 0; overflow: hidden; }
.pulse-lists h3 { color: #8088b8; font-weight: 500; font-size: 12px; margin-bottom: 8px; }
.pulse-lists ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.pulse-lists li { display: flex; justify-content: space-between; gap: 8px; }
.pulse-lists li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #e3e6fb; }
.pulse-lists li b { font-weight: 500; font-variant-numeric: tabular-nums; color: #a5f3fc; }
@media (max-width: 1100px) { .pulse { grid-template-columns: 200px minmax(0, 1fr); } .pulse-lists { grid-column: 1 / -1; } }
@media (max-width: 640px) { .pulse { grid-template-columns: 1fr; } }

/* indicadores */
.kpis { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.kpi { all: unset; box-sizing: border-box; cursor: pointer; position: relative; background: var(--surface); border-radius: var(--r-lg); padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 5px; min-width: 0; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.kpi::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .15s ease; }
.kpi:hover { transform: translateY(-1px); }
.kpi:focus-visible { box-shadow: var(--focus); }
.kpi[aria-selected="true"]::before { opacity: 1; }
.kpi[aria-selected="true"] { background: linear-gradient(var(--surface), var(--surface)) padding-box; }
.kpi .k-label { font-size: 12.5px; color: var(--ink-2); }
.kpi .k-value { font-size: 26px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; white-space: nowrap; }
.kpi .k-delta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.delta-up { color: var(--good); }
.delta-down { color: var(--bad); }
.k-prev { color: var(--muted); }
.kpi[data-static] { cursor: default; }
@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.main-chart { background: var(--surface); border-radius: var(--r-xl); padding: 18px 20px 8px; margin-bottom: 18px; box-shadow: var(--shadow); }
.main-chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; background: var(--grad); vertical-align: middle; margin-right: 6px; }
.legend i.cmp { background: none; border-top: 2px dashed var(--cmp); height: 0; }
.chart { height: 330px; }

/* blocos */
.widgets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.widget { background: var(--surface); border-radius: var(--r-xl); display: flex; flex-direction: column; min-width: 0; box-shadow: var(--shadow); }
.widget.full { grid-column: 1 / -1; }
@media (max-width: 1000px) { .widgets { grid-template-columns: 1fr; } }
.w-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 18px 0; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; background: var(--surface-2); padding: 3px; border-radius: 999px; }
.tab { all: unset; cursor: pointer; font-size: 12.5px; color: var(--ink-2); padding: 5px 11px; border-radius: 999px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: var(--shadow); }
.tab:focus-visible { box-shadow: var(--focus); }
.w-body { padding: 12px 18px 6px; flex: 1; min-height: 120px; }
.w-foot { display: flex; justify-content: space-between; padding: 6px 18px 14px; font-size: 13px; }
.w-foot button { all: unset; cursor: pointer; color: var(--indigo-ink); }
.w-foot button:hover { text-decoration: underline; }
.w-empty { color: var(--muted); padding: 28px 0; text-align: center; }
.w-error { color: var(--bad); padding: 20px 0; }

.rows { width: 100%; border-collapse: collapse; font-size: 13px; }
.rows th { font-weight: 500; color: var(--muted); text-align: right; padding: 4px 0 8px 12px; white-space: nowrap; font-size: 12px; }
.rows th:first-child { text-align: left; padding-left: 0; }
.rows td { padding: 0 0 0 12px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; height: 34px; }
.rows td.lbl { text-align: left; padding: 0; width: 100%; max-width: 0; position: relative; }
.rows .bar { position: absolute; inset: 4px auto 4px 0; background: var(--grad-soft); border-radius: 6px; }
.rows .lbl-in { position: relative; display: flex; align-items: center; gap: 6px; padding: 0 10px; overflow: hidden; }
.rows .lbl-in span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .lbl-in small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.rows tr.click { cursor: pointer; }
.rows tr.click:hover .bar { filter: saturate(1.6); }
.rows .d { font-size: 12px; min-width: 52px; display: inline-block; }
.rows a.ext { color: var(--muted); padding: 0 2px; }

.heat { height: 300px; }
.vitals-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1200px) { .vitals-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.vital { background: var(--surface-2); border-radius: var(--r-lg); padding: 12px 14px; }
.vital .v-name { font-size: 12px; color: var(--ink-2); }
.vital .v-val { font-size: 24px; font-weight: 600; letter-spacing: -.03em; }
.vital .v-state { font-size: 12px; display: inline-flex; align-items: center; gap: 5px; }
.vital .v-state::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.v-good { color: var(--good); } .v-ni { color: var(--warn); } .v-poor { color: var(--bad); }
.dist { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin-top: 8px; gap: 2px; }
.dist i { display: block; height: 100%; }
.dist .g { background: #22c55e; } .dist .n { background: #f59e0b; } .dist .p { background: #ef4444; }
.vitals-sub { margin-top: 14px; }

/* diálogos */
.dlg { border: 0; border-radius: 18px; padding: 0; width: min(460px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.dlg.wide { width: min(880px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(11, 13, 31, .6); backdrop-filter: blur(4px); }
.dlg form { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.dlg label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.dlg-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.more-body { max-height: 60vh; overflow: auto; }
.custom-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.custom-list li { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: var(--r-md); padding: 8px 10px; cursor: grab; }
.custom-list li.dragging { opacity: .5; }
.custom-list li .grip { color: var(--muted); letter-spacing: -2px; }
.custom-list li label { flex-direction: row; align-items: center; gap: 8px; flex: 1; color: var(--ink); font-weight: 400; }
.custom-list li select { min-height: 30px; padding: 4px 8px; font-size: 13px; }
.custom-list li .mv { all: unset; cursor: pointer; padding: 2px 6px; color: var(--ink-2); border-radius: 4px; }
.custom-list li .mv:focus-visible { box-shadow: var(--focus); }

@media (max-width: 640px) {
  .rows .opt { display: none; }
  .vitals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-actions { width: 100%; }
  .ctl, .ctl select { width: 100%; }
  .chart { height: 260px; }
}
body.app, .main { overflow-x: clip; }
#pdf-stage { position: fixed; left: -10000px; top: 0; width: 1000px; }
.loading { opacity: .55; transition: opacity .2s; }
