/* Painel VPS — ver STYLE_GUIDE.md. Seções na mesma ordem do guia. */

/* 2–4. Tokens ---------------------------------------------------------------- */
@font-face { font-family: "Inter"; src: url("/static/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/static/fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  color-scheme: dark;
  /* fundo e vidro */
  --bg: #070b16; --bg-2: #0b1122;
  --glass: rgba(255, 255, 255, .045); --glass-2: rgba(255, 255, 255, .075); --glass-3: rgba(255, 255, 255, .11);
  --glass-line: rgba(255, 255, 255, .09); --glass-line-2: rgba(255, 255, 255, .16);
  --blur: blur(20px) saturate(150%);
  --surface: rgba(16, 22, 40, .72); --surface-2: rgba(255, 255, 255, .07); --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .15);
  --text: #edf0f7; --text-2: #c2c8d6; --muted: #929bb0;
  /* ação principal */
  --accent: #9fadff; --accent-2: #bba6ff; --accent-ink: #0c1028; --accent-soft: rgba(159, 173, 255, .14);
  /* estados (paleta de status validada) */
  --ok: #22b65a; --warn: #fab219; --bad: #ec5b5b; --off: #6b7489; --bad-soft: rgba(236, 91, 91, .13);
  /* séries dos gráficos — slots fixos por projeto (validados no fundo escuro) */
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; --c6: #008300; --c7: #9085e9;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --fs-h1: 26px; --fs-h2: 17px; --fs-body: 15px; --fs-small: 13px; --fs-code: 13px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r: 16px; --r-sm: 10px;
  --shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 24px 60px -32px rgba(0, 0, 0, .9);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font: 400 var(--fs-body)/1.6 var(--sans);
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1 { font-size: var(--fs-h1); font-weight: 600; line-height: 1.3; letter-spacing: -.015em; margin: 0; }
h2 { font-size: var(--fs-h2); font-weight: 600; line-height: 1.35; letter-spacing: -.01em; margin: 0; }
h3 { font-size: var(--fs-body); font-weight: 600; margin: 0; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: var(--fs-code); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-small); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }

/* 5. Navegação ---------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.shell > div { min-width: 0; }
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: var(--s4);
  padding: var(--s5) var(--s3); background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 var(--s2); font-weight: 600; font-size: 16px; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.find { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 38px; padding: 0 10px; border: 1px solid var(--line-2);
  border-radius: var(--r-sm); background: var(--bg); color: var(--muted); cursor: pointer; text-align: left; }
.find:hover { color: var(--text-2); border-color: #454b55; }
.find kbd { margin-left: auto; }
kbd { font: 500 11px var(--sans); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 5px; color: var(--muted); white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 12px; font-weight: 500; color: var(--muted); padding: var(--s4) 10px var(--s1); }
.nav a { position: relative; display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 500; transition: background .15s var(--ease), color .15s var(--ease); }
.nav a svg { color: var(--muted); }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { background: var(--surface-2); color: var(--text); }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav a.on svg { color: var(--accent); }
.nav .count { margin-left: auto; min-width: 20px; text-align: center; font-size: 12px; font-weight: 600; line-height: 20px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: var(--s3); border-top: 1px solid var(--line); }
.side-foot form { margin: 0; }
.side-foot .nav-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 10px; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--muted); cursor: pointer; font-weight: 500; }
.side-foot .nav-btn:hover { background: var(--surface-2); color: var(--text); }

.top { display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding: 0 var(--s6); border-bottom: 1px solid var(--line); }
.top.no-crumbs { display: none; }
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: var(--fs-small); color: var(--muted); min-width: 0; }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--line-2); }
.crumbs [aria-current] { color: var(--text-2); }
.top .menu-btn { display: none; }
.main { padding: var(--s6) var(--s6) 80px; max-width: 1200px; width: 100%; }

/* Cabeçalho da página */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.page-head .desc { color: var(--text-2); margin-top: 6px; max-width: 68ch; }
.page-head .meta { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; margin-top: 10px; color: var(--muted); font-size: var(--fs-small); }
.page-head .actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.section { margin-top: var(--s6); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); flex-wrap: wrap; }
.section-head .muted { font-size: var(--fs-small); }

/* Abas */
.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--line); margin-bottom: var(--s5); overflow-x: auto; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; color: var(--muted); font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs .n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 6. Componentes --------------------------------------------------------------- */
/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); cursor: pointer; white-space: nowrap; font-weight: 500;
  transition: background .15s var(--ease), border-color .15s var(--ease); touch-action: manipulation; }
.btn:hover { background: #252a30; border-color: #474d57; }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: 14px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: #f0d083; }
.btn.danger { background: transparent; border-color: rgba(236, 111, 120, .45); color: #f3a2a8; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }

/* Estado */
.state { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.state .sub { color: var(--muted); font-size: var(--fs-small); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--off); flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.off { background: var(--off); }

/* Link de item */
.item-link { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; color: var(--text); font-weight: 500; }
.item-link svg { color: var(--muted); }
.item-link > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.item-link:hover > span { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--muted); }
a.item-link:hover svg { color: var(--accent); }
.item-link.plain { color: var(--text-2); font-weight: 400; }
.items { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.link { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--accent); }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

/* Cartões e listas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); }
.card.flush { padding: 0; overflow: hidden; }
.grid { display: grid; gap: var(--s4); }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.rows > li { border-bottom: 1px solid var(--line); }
.rows > li:last-child { border-bottom: 0; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--s4); padding: 14px var(--s5); min-height: 60px; }
a.row:hover { background: var(--surface-2); }
.row .title { font-weight: 600; }
.row .sub { color: var(--muted); font-size: var(--fs-small); margin-top: 2px; }
.row .chev { color: var(--muted); }
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px var(--s4); margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 10px 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }

/* Avisos */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px var(--s4); margin-bottom: var(--s4); border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2); }
.notice svg { margin-top: 3px; color: var(--muted); }
.notice.bad { background: var(--bad-soft); border-color: rgba(236, 111, 120, .3); color: #f6c9cd; }
.notice.bad svg { color: var(--bad); }
.notice a { color: inherit; }
.empty { padding: var(--s6); text-align: center; color: var(--muted); }

/* Tabelas */
.tbl-wrap { position: relative; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 12px var(--s4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { font-size: var(--fs-small); font-weight: 500; color: var(--muted); white-space: nowrap; }
.tbl th a:hover { color: var(--text); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: rgba(255, 255, 255, .015); }
.tbl td.end { text-align: right; width: 1%; white-space: nowrap; }
.tbl td .sub { color: var(--muted); font-size: var(--fs-small); margin-top: 2px; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl.data td.cell { font-family: var(--mono); font-size: 12.5px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl tr.is-bad td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.null { color: var(--off); font-style: italic; }
.toolbar { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin-bottom: var(--s3); }
.toolbar .grow { flex: 1; min-width: 220px; }

/* Menu "Ações" */
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu[open] > summary { background: var(--surface-2); border-color: #474d57; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 200px; padding: 6px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .8); }
.menu-pop .menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 10px; border: 0; border-radius: 6px;
  background: none; color: var(--text); cursor: pointer; text-align: left; white-space: nowrap; }
.menu-pop .menu-item:hover { background: #2a2f36; }
.menu-pop .menu-item svg { color: var(--muted); }
.menu-pop .menu-item.danger { color: #f3a2a8; }
.menu-pop .menu-item.danger svg { color: var(--bad); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line-2); margin: 6px 0; }

/* Formulários */
input[type=text], input[type=password], input[type=search], textarea, select {
  width: 100%; min-height: 40px; padding: 8px 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg); color: var(--text);
  transition: border-color .15s var(--ease); }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { font: var(--fs-code)/1.6 var(--mono); resize: vertical; }
textarea.sql { min-height: 200px; }
.lbl { display: block; font-size: var(--fs-small); font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.hint { font-size: var(--fs-small); color: var(--muted); margin-top: 6px; }
.field { margin-bottom: var(--s5); }
.check { display: inline-flex; gap: 8px; align-items: center; color: var(--text-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.pw-eye:hover { color: var(--text); background: var(--surface-2); }

/* Mapa de ligações */
.flows { display: flex; flex-direction: column; }
.flow { display: grid; grid-template-columns: minmax(0, 1.2fr) 28px minmax(0, 1fr) 28px minmax(0, .7fr); align-items: center; gap: var(--s2);
  padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.flow:last-child { border-bottom: 0; }
.flow-head { padding-top: 10px; padding-bottom: 10px; font-size: var(--fs-small); color: var(--muted); }
.flow .from { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.flow .from .addr { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.flow .from .addr a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow .from .addr a:hover { text-decoration: underline; text-underline-offset: 3px; }
.flow .path { font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.flow .arrow { color: var(--line-2); justify-self: center; }
.flow .to .sub, .flow .from .sub { color: var(--muted); font-size: var(--fs-small); }

/* Domínios */
.domain { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--s4); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.domain:last-child { border-bottom: 0; }
.domain:target { background: var(--accent-soft); }
.domain .name { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.domain .name a { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.domain .name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.route { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 28px; }
.route .path { font-family: var(--mono); font-size: 12.5px; color: var(--muted); min-width: 150px; }
.route .arrow { color: var(--line-2); }

/* Resumo de recursos */
.gauges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.gauge { padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.gauge .k { color: var(--muted); font-size: var(--fs-small); }
.gauge .v { font-size: 20px; font-weight: 600; margin: 2px 0 8px; font-variant-numeric: tabular-nums; }
.gauge .v small { font-size: var(--fs-small); color: var(--muted); font-weight: 400; }
.meter { display: block; width: 100%; height: 6px; border: 0; border-radius: 3px; background: var(--surface-2); overflow: hidden; appearance: none; }
.meter::-webkit-meter-bar { background: var(--surface-2); border: 0; border-radius: 3px; }
.meter::-webkit-meter-optimum-value { background: var(--ok); }
.meter::-webkit-meter-suboptimum-value { background: var(--warn); }
.meter::-webkit-meter-even-less-good-value { background: var(--bad); }
.meter:-moz-meter-optimum::-moz-meter-bar { background: var(--ok); }
.meter:-moz-meter-sub-optimum::-moz-meter-bar { background: var(--warn); }
.meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: var(--bad); }

.status-line { display: flex; align-items: center; gap: 12px; }
.status-line .dot { width: 10px; height: 10px; }
.attention { list-style: none; margin: var(--s4) 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.attention a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--bad-soft); color: #f6c9cd; }
.attention a:hover { background: rgba(236, 111, 120, .16); }

/* Números da limpeza */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); margin-bottom: var(--s5); }
.stat { padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.stat .k { color: var(--muted); font-size: var(--fs-small); }
.stat .v { font-size: 24px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .s { color: var(--muted); font-size: var(--fs-small); }
.bulkbar { position: sticky; bottom: 16px; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  margin-top: var(--s4); padding: 10px 10px 10px var(--s4); border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line-2);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .8); }

/* Logs e código */
.out { margin: 0; padding: 14px var(--s4); max-height: 600px; overflow: auto; background: #0c0e11; border: 1px solid var(--line); border-radius: var(--r);
  font: 12.5px/1.65 var(--mono); color: #d0d5dc; white-space: pre-wrap; overflow-wrap: anywhere; }
.out.is-bad { border-color: rgba(236, 111, 120, .5); }
.out mark { background: var(--accent-soft); color: var(--accent); }
details.more { margin-top: var(--s3); }
details.more > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--muted); font-size: 14px; padding: 6px 0; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "›"; display: inline-block; transition: transform .15s var(--ease); font-size: 16px; }
details.more[open] > summary::before { transform: rotate(90deg); }
details.more > summary:hover { color: var(--text); }

/* Janela de senha, busca e avisos flutuantes */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 14vh 16px 16px; background: rgba(6, 7, 9, .7); }
.modal-box { width: min(480px, 100%); background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .9);
  animation: pop .18s var(--ease); overflow: hidden; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.modal-body { padding: var(--s5); }
.modal-body h2 { margin-bottom: 6px; }
.modal-desc { color: var(--text-2); margin-bottom: var(--s4); }
.modal-target { margin-bottom: var(--s4); }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s5); }
.modal-box.is-danger #pw-ok { background: var(--bad); border-color: var(--bad); color: #210608; }
.pw-err { color: var(--bad); font-size: 14px; margin-top: 8px; }
.res-status { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: var(--s3); }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 12px var(--s4); border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input { border: 0; background: none; min-height: 32px; padding: 0; font-size: 16px; box-shadow: none !important; }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.palette-list li a { display: flex; align-items: baseline; gap: 12px; padding: 9px 12px; border-radius: 8px; }
.palette-list li a .n { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-list li a .t { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.palette-list li a .d { font-size: var(--fs-small); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-list li a.on, .palette-list li a:hover { background: var(--surface-2); }
.palette-list .muted { padding: 10px 12px; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 70; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 420px; padding: 12px var(--s4); border-radius: var(--r); background: var(--surface-2);
  border: 1px solid var(--line-2); box-shadow: 0 16px 40px -14px rgba(0, 0, 0, .9); animation: pop .2s var(--ease); }

/* Login */
.login-body { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: var(--s4); padding: var(--s6) var(--s5); background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; }
.login-card .brand { padding: 0; font-size: 18px; }
.login-card .desc { color: var(--text-2); }
.login-card .btn { min-height: 44px; }

/* Responsivo */
@media (max-width: 960px) {
  .flow { grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr); }
  .flow .db, .flow .arrow.second, .flow-head .db { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 50; transform: translateX(-100%); transition: transform .2s var(--ease); }
  body.nav-open .side { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .6); }
  .top { padding: 0 var(--s4); }
  .top.no-crumbs { display: flex; }
  .top .menu-btn { display: inline-flex; }
  .main { padding: var(--s5) var(--s4) 60px; }
  .grid.c2, .gauges, .stats { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .flow { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .flow .arrow { display: none; }
  .flow-head { display: none; }
  .domain { grid-template-columns: minmax(0, 1fr); }
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row .hide-sm { display: none; }
  .plain-list li { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.gap-b { margin-bottom: var(--s3); }
.modal-foot.spread { justify-content: space-between; align-items: center; }

.quiet-link:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--muted); }

/* ============================================================== v4 · vidro e painéis */
body::before { content: ""; position: fixed; inset: -10%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 35% at 12% 8%, rgba(92, 112, 255, .30), transparent 70%),
    radial-gradient(35% 30% at 88% 12%, rgba(170, 110, 255, .22), transparent 70%),
    radial-gradient(45% 40% at 70% 95%, rgba(25, 158, 140, .20), transparent 70%),
    radial-gradient(30% 30% at 5% 90%, rgba(57, 135, 229, .16), transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg)); }
.glass, .card, .tbl-wrap, .rows, .gauge, .stat, .notice, .modal-box, .menu-pop, .toast, .login-card, .kpi, .panel {
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--r); box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.modal-box, .menu-pop { background: rgba(20, 26, 46, .86); }
.side { background: rgba(8, 12, 26, .55); border-right: 1px solid var(--glass-line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.top { background: transparent; border-bottom: 0; }
.tbl th { color: var(--muted); }
.tbl td, .tbl th { border-bottom-color: var(--line); }
.tbl tbody tr:hover td { background: rgba(255, 255, 255, .025); }
.out { background: rgba(3, 6, 14, .7); border-color: var(--glass-line); }
input[type=text], input[type=password], input[type=search], textarea, select { background: rgba(3, 6, 14, .55); border-color: var(--glass-line-2); }
.btn { background: var(--glass-2); border-color: var(--glass-line-2); }
.btn:hover { background: var(--glass-3); border-color: rgba(255, 255, 255, .24); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: var(--accent-ink);
  box-shadow: 0 8px 24px -10px rgba(159, 173, 255, .7); }
.btn.primary:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.btn.danger { border-color: rgba(236, 91, 91, .5); color: #ffb3b3; background: rgba(236, 91, 91, .06); }
.brand-mark { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); }
.nav a.on, .nav a:hover, .side-foot .nav-btn:hover, .side-foot .nav-btn.on { background: var(--glass-2); }
.nav a.on::before { background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(34, 182, 90, .16); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(236, 91, 91, .18); }
.dot.warn { background: var(--warn); }

/* projetos no menu */
.nav .proj { min-height: 34px; font-weight: 500; font-size: 14px; }
.nav .proj .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.nav .proj .st { margin-left: auto; }
.nav .proj .dot { width: 7px; height: 7px; box-shadow: none; }
details.nav-more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--muted); padding: var(--s4) 10px var(--s1); }
details.nav-more > summary::-webkit-details-marker { display: none; }
details.nav-more > summary svg { transition: transform .15s var(--ease); }
details.nav-more[open] > summary svg { transform: rotate(180deg); }

/* cor de cada projeto / série */
.sw.c1, .key.c1 { background: var(--c1); } .sw.c2, .key.c2 { background: var(--c2); } .sw.c3, .key.c3 { background: var(--c3); }
.sw.c4, .key.c4 { background: var(--c4); } .sw.c5, .key.c5 { background: var(--c5); } .sw.c6, .key.c6 { background: var(--c6); }
.sw.c7, .key.c7 { background: var(--c7); } .key.free { background: rgba(255, 255, 255, .12); }
svg .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
svg .area { stroke: none; opacity: .18; } svg .area.soft { opacity: .14; }
svg .c1 { stroke: var(--c1); fill: var(--c1); } svg .c2 { stroke: var(--c2); fill: var(--c2); } svg .c3 { stroke: var(--c3); fill: var(--c3); }
svg .c4 { stroke: var(--c4); fill: var(--c4); } svg .c5 { stroke: var(--c5); fill: var(--c5); } svg .c6 { stroke: var(--c6); fill: var(--c6); }
svg .c7 { stroke: var(--c7); fill: var(--c7); } svg .free { fill: rgba(255, 255, 255, .10); }
svg path.line.c1, svg path.line.c2, svg path.line.c3, svg path.line.c4, svg path.line.c5, svg path.line.c6, svg path.line.c7 { fill: none; }
svg .bar { stroke: none; } svg .track { fill: rgba(255, 255, 255, .06); }
svg .pt { stroke: #0b1122; stroke-width: 2; }
svg .grid { stroke: rgba(255, 255, 255, .07); stroke-width: 1; }
svg .axis { fill: var(--muted); font: 500 11px var(--sans); }
svg .dlabel { fill: var(--text-2); font: 600 11.5px var(--sans); }
svg .guide { stroke: rgba(255, 255, 255, .35); stroke-width: 1; stroke-dasharray: 3 3; }
svg .hit { fill: transparent; cursor: crosshair; }
.spark { display: block; width: 100%; height: 40px; }
.spark.empty line { stroke: rgba(255, 255, 255, .12); stroke-dasharray: 3 4; }
.tchart { display: block; width: 100%; height: auto; }
.tip { position: fixed; z-index: 80; pointer-events: none; padding: 7px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 500;
  background: rgba(14, 19, 36, .92); border: 1px solid var(--glass-line-2); box-shadow: 0 10px 30px -10px #000; white-space: nowrap; }

/* painel: indicadores e blocos */
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s4); }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.kpi { padding: var(--s4) var(--s5) var(--s3); display: flex; flex-direction: column; gap: 4px; min-width: 0; position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--accent), transparent); opacity: .6; }
.kpi .k { color: var(--muted); font-size: var(--fs-small); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 30px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi .s { color: var(--muted); font-size: var(--fs-small); }
.panel { padding: var(--s5); min-width: 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.panel-head p { color: var(--muted); font-size: var(--fs-small); margin-top: 2px; }
.legend { list-style: none; margin: var(--s3) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--fs-small); color: var(--text-2); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.stack { display: block; width: 100%; height: 18px; border-radius: 6px; overflow: hidden; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.4fr) auto; align-items: center; gap: var(--s3); font-size: 14px; }
.hbar-l { display: flex; flex-direction: column; min-width: 0; }
.hbar-l a, .hbar-l span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-l a:hover { text-decoration: underline; text-underline-offset: 3px; }
.hbar-l .sub { color: var(--muted); font-size: 12px; }
.hbar-s { display: block; width: 100%; height: 10px; }
.hbar-v { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 13px; white-space: nowrap; min-width: 64px; text-align: right; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.hero h1 { font-size: 30px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--glass-line); font-size: 13px; color: var(--text-2); }
.chip b { color: var(--text); font-weight: 600; }

/* cartões de projeto */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: var(--s4); }
.pcard { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5); position: relative; overflow: hidden; transition: transform .2s var(--ease), border-color .2s var(--ease); }
a.pcard:hover { transform: translateY(-2px); border-color: var(--glass-line-2); }
.pcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; }
.pcard.c1::before { background: var(--c1); } .pcard.c2::before { background: var(--c2); } .pcard.c3::before { background: var(--c3); }
.pcard.c4::before { background: var(--c4); } .pcard.c5::before { background: var(--c5); } .pcard.c6::before { background: var(--c6); } .pcard.c7::before { background: var(--c7); }
.pcard .glow { position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; filter: blur(40px); opacity: .25; }
.pcard.c1 .glow { background: var(--c1); } .pcard.c2 .glow { background: var(--c2); } .pcard.c3 .glow { background: var(--c3); }
.pcard.c4 .glow { background: var(--c4); } .pcard.c5 .glow { background: var(--c5); } .pcard.c6 .glow { background: var(--c6); } .pcard.c7 .glow { background: var(--c7); }
.pcard .ph { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pcard h3 { font-size: 17px; font-weight: 600; }
.pcard .pd { color: var(--muted); font-size: var(--fs-small); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
.pcard .nums div { display: flex; flex-direction: column; }
.pcard .nums b { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.pcard .nums span { font-size: 12px; color: var(--muted); }

/* cabeçalho do projeto */
.proj-head { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.proj-head .badge-sys { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; }
.badge-sys.c1 { background: linear-gradient(135deg, var(--c1), #6ea8f0); } .badge-sys.c2 { background: linear-gradient(135deg, var(--c2), #f08a5d); }
.badge-sys.c3 { background: linear-gradient(135deg, var(--c3), #43c497); } .badge-sys.c4 { background: linear-gradient(135deg, var(--c4), #e6ad3a); }
.badge-sys.c5 { background: linear-gradient(135deg, var(--c5), #ea7ba3); } .badge-sys.c6 { background: linear-gradient(135deg, var(--c6), #3aae3a); }
.badge-sys.c7 { background: linear-gradient(135deg, var(--c7), #b3abf2); }
.proj-head .ph-t { flex: 1; min-width: 240px; }
.proj-head .desc { color: var(--text-2); margin-top: 4px; max-width: 75ch; }

/* limpeza */
.clean-item { display: grid; grid-template-columns: auto minmax(0, 1.4fr) minmax(0, 1.6fr) auto; gap: var(--s4); align-items: center; padding: 14px var(--s5); border-bottom: 1px solid var(--line); }
.clean-item:last-child { border-bottom: 0; }
.clean-item .what { min-width: 0; }
.clean-item .what .sub, .clean-item .why .sub { color: var(--muted); font-size: 12.5px; }
.clean-item .size { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; font-weight: 600; }
.clean-item input { width: 18px; height: 18px; accent-color: var(--accent); }
.confirm-list { list-style: none; margin: 0 0 var(--s4); padding: 0; max-height: 220px; overflow: auto; border: 1px solid var(--glass-line); border-radius: var(--r-sm); }
.confirm-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.confirm-list li:last-child { border-bottom: 0; }
.confirm-list li span:last-child { color: var(--muted); white-space: nowrap; }
.safe-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-sm); background: rgba(34, 182, 90, .1); color: #bfeccf; font-size: 13.5px; margin-bottom: var(--s4); }
.bulkbar { background: rgba(20, 26, 46, .9); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-color: var(--glass-line-2); }

@media (max-width: 1100px) {
  .span-3 { grid-column: span 6; } .span-4, .span-5, .span-7, .span-8 { grid-column: span 12; } .span-6 { grid-column: span 12; }
}
@media (max-width: 860px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
  .dash > * { grid-column: auto !important; }
  .hbar { grid-template-columns: minmax(0, 1fr) auto; }
  .hbar-s { grid-column: 1 / -1; grid-row: 2; }
  .clean-item { grid-template-columns: auto minmax(0, 1fr) auto; }
  .clean-item .why { grid-column: 2 / -1; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .card, .tbl-wrap, .rows, .kpi, .panel, .notice, .stat { background: rgba(18, 24, 44, .92); }
}
svg rect.bar, svg path.area { stroke: none; }
svg circle.pt { stroke: #0b1122; }

.panel .flows { background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 0; margin: 0 calc(-1 * var(--s5)); }
.panel .flows .flow { padding-left: var(--s5); padding-right: var(--s5); }
.panel .flows .flow:last-child { border-bottom: 0; }
.panel .flows .flow-head { border-top: 1px solid var(--line); }
.spark-empty { height: 40px; display: flex; align-items: flex-end; font-size: 12px; color: var(--muted); border-bottom: 1px dashed rgba(255,255,255,.12); padding-bottom: 4px; }

/* ======================================================================
   v5 · vidro líquido (estilo Apple), barra superior flutuante e Dock
   ====================================================================== */
:root {
  --bg: #05070d; --bg-2: #080c18;
  --lg-fill: linear-gradient(150deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .035) 45%, rgba(255, 255, 255, .06));
  --lg-blur: blur(28px) saturate(185%);
  --lg-edge: rgba(255, 255, 255, .16);
  --lg-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -1px 0 rgba(255, 255, 255, .05), 0 2px 4px rgba(0, 0, 0, .25), 0 30px 70px -30px rgba(0, 0, 0, .85);
  --accent: #6d8dff; --accent-2: #a77bff; --accent-ink: #ffffff;
  --btn-grad: linear-gradient(135deg, #2f5cf0, #7a45f0);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --r: 22px; --r-sm: 14px;
  --fs-h1: 34px;
}
body { background: var(--bg); }
body::before { display: none; }

/* fundo: brilhos em movimento lento + grade técnica */
.bg-mesh { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: radial-gradient(120% 80% at 50% 0%, #0b1226, var(--bg) 70%); }
.bg-mesh i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(90px); opacity: .45; will-change: transform; }
.bg-mesh .b1 { background: #2f5cf0; top: -18vmax; left: -10vmax; animation: drift1 38s ease-in-out infinite alternate; }
.bg-mesh .b2 { background: #8b45f0; top: -12vmax; right: -14vmax; opacity: .35; animation: drift2 44s ease-in-out infinite alternate; }
.bg-mesh .b3 { background: #0ea5b7; bottom: -22vmax; right: 8vmax; opacity: .28; animation: drift3 50s ease-in-out infinite alternate; }
.bg-mesh .b4 { background: #d9468f; bottom: -26vmax; left: -6vmax; opacity: .16; animation: drift1 56s ease-in-out infinite alternate-reverse; }
.bg-mesh .grid-lines { position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 56px 56px; -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000, transparent); mask-image: radial-gradient(70% 60% at 50% 30%, #000, transparent); }
@keyframes drift1 { to { transform: translate(14vmax, 10vmax) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-12vmax, 14vmax) scale(.9); } }
@keyframes drift3 { to { transform: translate(-16vmax, -10vmax) scale(1.15); } }

/* vidro líquido: preenchimento, borda especular e luz que segue o cursor */
.lg, .glass, .card, .rows, .kpi, .panel, .stat, .notice, .modal-box, .menu-pop, .toast, .login-card, .pcard {
  position: relative; background: var(--lg-fill); border: 1px solid transparent; border-radius: var(--r);
  -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur); box-shadow: var(--lg-shadow); isolation: isolate; }
.lg::before, .glass::before, .card::before, .rows::before, .kpi::before, .panel::before, .stat::before, .modal-box::before, .menu-pop::before, .login-card::before, .pcard::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 1;
  background: linear-gradient(140deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .08) 28%, rgba(255, 255, 255, .02) 60%, rgba(255, 255, 255, .22));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; height: auto; }
.kpi::after, .panel::after, .pcard::after, .card::after, .glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0; opacity: 0; transition: opacity .35s ease;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, -30%), rgba(255, 255, 255, .09), transparent 45%); height: auto; }
.kpi:hover::after, .panel:hover::after, .pcard:hover::after, .card:hover::after, .glass:hover::after { opacity: 1; }
.kpi > *, .panel > *, .pcard > *, .card > *, .glass > * { position: relative; z-index: 2; }
.tbl-wrap { background: var(--lg-fill); border: 1px solid var(--lg-edge); border-radius: var(--r); -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 30px 70px -30px rgba(0, 0, 0, .85); }
.modal-box, .menu-pop { background: linear-gradient(150deg, rgba(40, 48, 80, .78), rgba(18, 22, 40, .86)); }
.notice.bad { background: linear-gradient(150deg, rgba(236, 91, 91, .18), rgba(236, 91, 91, .07)); }
.pcard .glow { opacity: .35; }
.pcard { border-top: 0; }
.pcard .strip { position: absolute; inset: 0 0 auto 0; height: 3px; border-radius: var(--r) var(--r) 0 0; z-index: 2; }

/* layout sem menu lateral */
.shell { display: block; }
.main { max-width: 1240px; margin: 0 auto; padding: 108px var(--s6) 150px; }
.top, .side { display: none !important; }

/* barra superior flutuante */
.topbar { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 40; width: min(1240px, calc(100% - 28px));
  display: flex; align-items: center; gap: var(--s3); padding: 8px 8px 8px 14px; border-radius: 999px; }
.topbar .brand { display: flex; align-items: center; gap: 10px; padding: 0; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--btn-grad);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 6px 18px -6px rgba(90, 100, 255, .9); }
.seg { display: flex; align-items: center; gap: 2px; padding: 4px; margin: 0 auto; border-radius: 999px; background: rgba(0, 0, 0, .25);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35), inset 0 -1px 0 rgba(255, 255, 255, .05); }
.seg > a, .seg > details > summary { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 16px; border-radius: 999px;
  color: var(--text-2); font-weight: 550; font-size: 14px; white-space: nowrap; cursor: pointer; list-style: none;
  transition: background .25s ease, color .2s ease, transform .35s var(--spring); }
.seg > details > summary::-webkit-details-marker { display: none; }
.seg > a:hover, .seg > details > summary:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.seg > a.on, .seg > details > summary.on { color: #fff; background: linear-gradient(150deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 14px -6px rgba(0, 0, 0, .6); }
.seg > a:active, .seg > details > summary:active { transform: scale(.94); }
.seg .count { min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; font-size: 11px; text-align: center; background: var(--bad); color: #fff; }
.seg-more .menu-pop { left: 0; right: auto; top: calc(100% + 10px); min-width: 230px; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.pill-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; border: 0; cursor: pointer; list-style: none;
  color: var(--text-2); background: rgba(255, 255, 255, .07); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); font-weight: 500;
  transition: background .2s ease, transform .35s var(--spring); }
.pill-btn::-webkit-details-marker { display: none; }
.pill-btn:hover { background: rgba(255, 255, 255, .12); color: var(--text); }
.pill-btn:active { transform: scale(.92); }
.pill-btn.icon { width: 38px; padding: 0; justify-content: center; }
.pill-btn kbd { border-color: rgba(255, 255, 255, .15); }
.menu-toggle { display: none; }
.menu-note { padding: 6px 10px 2px; font-size: 12px; color: var(--muted); max-width: 230px; white-space: normal; }
.menu-pop a.menu-item { text-decoration: none; }
.live { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  letter-spacing: .02em; color: #9ef0c0; background: rgba(34, 182, 90, .12); box-shadow: inset 0 0 0 1px rgba(34, 182, 90, .25); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: #34d27a; box-shadow: 0 0 0 0 rgba(52, 210, 122, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(52, 210, 122, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 210, 122, 0); } }

/* Dock */
.dock { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 40; display: flex; align-items: flex-end; gap: 10px;
  padding: 10px 14px; border-radius: 28px; max-width: calc(100% - 24px); }
.dock-item { position: relative; display: grid; place-items: center; width: 52px; height: 52px; transform-origin: 50% 100%;
  transition: transform .25s var(--spring); }
.dock-item::after { content: attr(data-label); position: absolute; bottom: calc(100% + 14px); left: 50%; transform: translateX(-50%) translateY(4px);
  padding: 5px 10px; border-radius: 9px; font-size: 12.5px; font-weight: 550; white-space: nowrap; color: var(--text); opacity: 0; pointer-events: none;
  background: rgba(30, 36, 60, .92); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 8px 24px -8px #000; transition: opacity .15s ease, transform .2s ease; }
.dock-item:hover::after, .dock-item:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.app-icon { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 16px; letter-spacing: -.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -2px 6px rgba(0, 0, 0, .25), 0 10px 22px -10px rgba(0, 0, 0, .9); position: relative; overflow: hidden; }
.app-icon::before { content: ""; position: absolute; inset: 0 0 50% 0; background: linear-gradient(180deg, rgba(255, 255, 255, .35), transparent); border-radius: inherit; }
.app-icon.c1 { background: linear-gradient(160deg, #6ea8f0, #2a6fd0); } .app-icon.c2 { background: linear-gradient(160deg, #f08a5d, #c24a1a); }
.app-icon.c3 { background: linear-gradient(160deg, #43c497, #127a56); } .app-icon.c4 { background: linear-gradient(160deg, #f0b94a, #b07400); }
.app-icon.c5 { background: linear-gradient(160deg, #ec86ab, #b93a6a); } .app-icon.c6 { background: linear-gradient(160deg, #3fbf3f, #006b00); }
.app-icon.c7 { background: linear-gradient(160deg, #b3abf2, #6f62d8); }
.app-icon.trash { background: linear-gradient(160deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, .08)); color: var(--text); }
.app-icon .i { width: 22px; height: 22px; }
.dock-dot { position: absolute; bottom: -7px; width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, .25); }
.dock-dot.ok { background: rgba(255, 255, 255, .75); } .dock-dot.bad { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.dock-item.on .app-icon { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 0 2px rgba(255, 255, 255, .55), 0 10px 26px -8px rgba(0, 0, 0, .9); }
.dock-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px rgba(5, 7, 13, .8); }
.dock-sep { width: 1px; height: 44px; margin: 0 4px 4px; background: rgba(255, 255, 255, .18); }

/* tipografia estilo Apple */
h1 { font-size: var(--fs-h1); font-weight: 700; letter-spacing: -.028em; }
.hero h1 { font-size: 38px; }
h2 { letter-spacing: -.015em; }
.crumbs { margin-bottom: var(--s4); font-size: 13px; }
.crumbs .sep { color: var(--muted); }

/* botões com efeito mola */
.btn { border-radius: 999px; transition: background .2s ease, border-color .2s ease, transform .35s var(--spring), box-shadow .2s ease;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn:hover { transform: translateY(-1px); background: rgba(255, 255, 255, .13); }
.btn:active { transform: scale(.95); transition-duration: .08s; }
.btn.primary { background: var(--btn-grad); color: #fff; border: 0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 10px 26px -10px rgba(90, 100, 255, .95); }
.btn.primary:hover { filter: brightness(1.1); background: var(--btn-grad); }
.btn.danger { background: rgba(236, 91, 91, .1); border-color: rgba(236, 91, 91, .45); }
.modal-box.is-danger #pw-ok { background: linear-gradient(135deg, #e04646, #b52a4a); color: #fff; }
.tabs { border-bottom: 0; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(0, 0, 0, .25); width: fit-content; max-width: 100%;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35), inset 0 -1px 0 rgba(255, 255, 255, .05); }
.tabs a { border-radius: 999px; border-bottom: 0; margin: 0; padding: 7px 14px; transition: background .25s ease, color .2s ease, transform .35s var(--spring); }
.tabs a.on { color: #fff; background: linear-gradient(150deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .07)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 14px -6px rgba(0, 0, 0, .6); }
.tabs a:active { transform: scale(.94); }
input[type=text], input[type=password], input[type=search], textarea, select { border-radius: 12px; background: rgba(0, 0, 0, .3); border-color: rgba(255, 255, 255, .12); }

/* indicadores e anéis */
.kpi { padding: var(--s5); }
.kpi .v { font-size: 34px; font-weight: 700; letter-spacing: -.03em; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--s4); margin-bottom: var(--s4); }
.ring-card { display: grid; grid-template-columns: 180px minmax(0, 1fr); align-items: center; gap: var(--s5); padding: var(--s5) var(--s6); }
.rings { width: 180px; height: 180px; filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .5)); }
.rings .ring-t { fill: none; stroke-width: 13; opacity: .18; }
.rings .ring-p { fill: none; stroke-width: 13; stroke-linecap: round; }
.rings .c1 { stroke: #4d97f5; } .rings .c3 { stroke: #22c58a; } .rings .c2 { stroke: #f06a33; }
.ring-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s4); }
.ring-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.ring-legend .key { width: 12px; height: 12px; border-radius: 50%; }
.ring-legend .key.c1 { background: #4d97f5; } .ring-legend .key.c3 { background: #22c58a; } .ring-legend .key.c2 { background: #f06a33; }
.ring-legend .lbl2 { color: var(--text-2); }
.ring-legend .lbl2 small { display: block; color: var(--muted); font-size: 12px; }
.ring-legend b { font-size: 26px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.status-card { padding: var(--s5) var(--s6); display: flex; flex-direction: column; justify-content: center; gap: var(--s3); }
.status-card .big { font-size: 30px; font-weight: 700; letter-spacing: -.03em; display: flex; align-items: center; gap: 12px; }
.status-card .big .dot { width: 12px; height: 12px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); margin-top: var(--s2); }
.mini-stats div { padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, .22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.mini-stats b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: 12px; color: var(--muted); }

@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .live { display: none; }
}
@media (max-width: 860px) {
  .main { padding: 88px var(--s4) 130px; }
  .topbar { top: 10px; padding: 6px 6px 6px 12px; }
  .topbar .brand-t { display: none; }
  .menu-toggle { display: inline-flex; }
  .hide-sm { display: none; }
  .seg { display: none; position: fixed; top: 64px; left: 12px; right: 12px; flex-direction: column; align-items: stretch; padding: 8px; border-radius: 20px;
    background: linear-gradient(150deg, rgba(40, 48, 80, .92), rgba(18, 22, 40, .95)); -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur);
    box-shadow: var(--lg-shadow); }
  body.seg-open .seg { display: flex; }
  .seg > a, .seg > details > summary { height: 44px; justify-content: flex-start; }
  .seg-more .menu-pop { position: static; box-shadow: none; background: rgba(0, 0, 0, .25); margin-top: 4px; }
  .dock { gap: 6px; padding: 8px 10px; border-radius: 22px; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .dock-item, .app-icon { width: 44px; height: 44px; } .app-icon { border-radius: 13px; font-size: 14px; }
  .dock-item::after { display: none; }
  .dock-sep { height: 36px; }
  .ring-card { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .mini-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
  .tabs { width: 100%; border-radius: 16px; }
  .hero h1 { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) { .bg-mesh i, .pulse { animation: none !important; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .lg, .glass, .card, .rows, .kpi, .panel, .stat, .pcard, .tbl-wrap, .topbar, .dock { background: rgba(20, 26, 48, .94); }
}
/* v5 · simplicidade: cartão de projeto enxuto e "Mais detalhes" */
.pcard { gap: var(--s4); }
.pcard .ph { justify-content: flex-start; gap: 12px; }
.pcard .ph h3 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-icon.sm { width: 38px; height: 38px; border-radius: 11px; font-size: 13px; flex: none; }
details.more-block > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-radius: 999px;
  background: rgba(255, 255, 255, .05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); transition: background .2s ease, transform .35s var(--spring); }
details.more-block > summary::-webkit-details-marker { display: none; }
details.more-block > summary span:first-child { font-weight: 600; }
details.more-block > summary .muted { flex: 1; }
details.more-block > summary:hover { background: rgba(255, 255, 255, .09); }
details.more-block > summary:active { transform: scale(.98); }
details.more-block > summary svg { transition: transform .25s ease; }
details.more-block[open] > summary svg { transform: rotate(180deg); }
details.more-block[open] > .dash { margin-top: var(--s4); animation: pop .25s ease; }
.status-card .attention { margin: 0; }
@media (max-width: 860px) { details.more-block > summary .muted { display: none; } }
.app-icon.lgi { width: 56px; height: 56px; border-radius: 16px; font-size: 18px; flex: none; }

.bulkbar { bottom: 104px; border-radius: 999px; padding-left: 22px; }
@media (max-width: 860px) {
  .mini-stats b { font-size: 17px; }
  .mini-stats div { padding: 10px; }
  .status-card, .ring-card { padding: var(--s5); }
  .status-card .big { font-size: 24px; }
  .bulkbar { bottom: 92px; }
}

/* progresso de tarefas longas */
.prog-head { display: flex; align-items: center; gap: 12px; margin-bottom: var(--s3); }
.prog-head .spinner { width: 18px; height: 18px; color: var(--accent); }
.prog-head.done .spinner { display: none; }
.prog-count { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.prog-count b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
progress.prog-bar { display: block; width: 100%; height: 10px; border: 0; border-radius: 999px; overflow: hidden; -webkit-appearance: none; appearance: none; background: rgba(255, 255, 255, .08); }
progress.prog-bar::-webkit-progress-bar { background: rgba(255, 255, 255, .08); border-radius: 999px; }
progress.prog-bar::-webkit-progress-value { background: var(--btn-grad); border-radius: 999px; transition: width .4s ease; }
progress.prog-bar::-moz-progress-bar { background: var(--btn-grad); border-radius: 999px; }
.prog-now { margin: 10px 0 8px; color: var(--text-2); font-size: 14px; min-height: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog-log { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; border-radius: 12px; background: rgba(0, 0, 0, .25); }
.prog-log:empty { display: none; }
.prog-log li { display: flex; gap: 8px; align-items: flex-start; padding: 7px 12px; font-size: 13px; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.prog-log li:last-child { border-bottom: 0; }
.prog-log li .dot { margin-top: 6px; }
.job-pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; border: 0; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: #dfe4ff; background: rgba(109, 141, 255, .18); box-shadow: inset 0 0 0 1px rgba(109, 141, 255, .35); }
.job-pill .spinner { width: 12px; height: 12px; }
.job-pill.done { background: rgba(34, 182, 90, .16); box-shadow: inset 0 0 0 1px rgba(34, 182, 90, .35); color: #b9f0cf; }
.job-pill.done .spinner { display: none; }
