:root {
  --bg: #f5f6f4;
  --surface: #ffffff;
  --surface-2: #f7f8f6;
  --border: #e5e7e3;
  --text: #111827;
  --text-2: #4b5563;
  --muted: #8a8f98;
  --top: #16181d;
  --top-text: #f3f4f6;
  --green: #15a86b;
  --green-dark: #2f9e62;
  --green-light: #a8e0bf;
  --red: #dc3f3f;
  --red-light: #f5b8b8;
  --amber: #c98500;
  --blue: #2a78d6;
  --accent: #16181d;
  --accent-text: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1114; --surface: #171a1f; --surface-2: #1d2127; --border: #2a2f37;
    --text: #f3f4f6; --text-2: #c3c7cf; --muted: #8b919c; --top: #0b0c0f;
    --green: #2fc084; --green-dark: #2a9a5e; --green-light: #1f5e3f; --red: #ef6b6b; --red-light: #6b2a2a;
    --accent: #f3f4f6; --accent-text: #111827; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1114; --surface: #171a1f; --surface-2: #1d2127; --border: #2a2f37;
  --text: #f3f4f6; --text-2: #c3c7cf; --muted: #8b919c; --top: #0b0c0f;
  --green: #2fc084; --green-dark: #2a9a5e; --green-light: #1f5e3f; --red: #ef6b6b; --red-light: #6b2a2a;
  --accent: #f3f4f6; --accent-text: #111827; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- topo */
.topbar {
  background: var(--top); color: var(--top-text); height: 60px; display: flex; align-items: center;
  padding: 0 24px; gap: 18px; position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 700; font-size: 19px; letter-spacing: -.3px; display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand svg { color: var(--green); }
.carteira-nome { font-size: 15px; font-weight: 500; opacity: .9; padding-left: 16px; border-left: 1px solid #ffffff22; }
.topbar .spacer { flex: 1; }
.icon-btn {
  background: transparent; border: 0; color: var(--top-text); width: 36px; height: 36px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; opacity: .85;
}
.icon-btn:hover { background: #ffffff14; opacity: 1; }

.tabs {
  background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center;
  gap: 4px; padding: 0 24px; overflow-x: auto; position: sticky; top: 60px; z-index: 19;
}
.tabs a {
  text-decoration: none; color: var(--text-2); padding: 16px 10px 14px; display: inline-flex; gap: 7px;
  align-items: center; border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500;
}
.tabs a:hover { color: var(--text); }
.tabs a.ativo { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.tabs .spacer { flex: 1; }
.tabs .btn { margin: 8px 0; }

main { padding: 24px; max-width: 1440px; margin: 0 auto; }
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.3px; }
h2 { font-size: 17px; margin: 0; font-weight: 600; letter-spacing: -.2px; }
.sub { color: var(--muted); margin: 0 0 20px; }

/* ---------------------------------------------------------------- botões / forms */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; padding: 9px 14px; font-weight: 600;
  font-size: 13.5px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; text-decoration: none; white-space: nowrap; font-family: inherit;
}
.btn:hover { border-color: var(--muted); }
.btn.primario { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.verde { background: var(--green); border-color: var(--green); color: #fff; }
.btn.perigo { color: var(--red); }
.btn.peq { padding: 5px 9px; font-size: 12.5px; font-weight: 500; }
.btn-link { background: none; border: 0; color: var(--text-2); cursor: pointer; padding: 4px 6px; font: inherit; text-decoration: underline; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; align-items: end; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; min-width: 0; width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--green); outline-offset: -1px; border-color: transparent; }
.lbl { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.seg label { color: var(--text-2); }
label.check { flex-direction: row; align-items: center; gap: 6px; }
label.check input { width: 16px; height: 16px; padding: 0; accent-color: var(--green); flex: none; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg input { display: none; }
.seg label { padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 13px; flex-direction: row; }
.seg input:checked + label.c { background: var(--green); color: #fff; }
.seg input:checked + label.v { background: var(--red); color: #fff; }

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi .rot { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 500; }
.kpi .rot .ic { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); }
.kpi .valor { font-size: 26px; font-weight: 600; letter-spacing: -.6px; line-height: 1.2; }
.kpi .valor.pos { color: var(--green); }
.kpi .valor.neg { color: var(--red); }
.kpi .detalhe { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.kpi .detalhe b { display: block; color: var(--text); font-weight: 500; font-size: 13.5px; }
.pill { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); vertical-align: middle; }
.pill.pos { color: var(--green); } .pill.neg { color: var(--red); }
.pos { color: var(--green); } .neg { color: var(--red); }
.muted { color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-2b { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.chart-box { position: relative; height: 320px; }
.chart-box.baixo { height: 260px; }

.legenda { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.legenda i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.donut-wrap { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(150px, .9fr); gap: 16px; align-items: center; }
.donut { position: relative; height: 260px; }
.donut-centro { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-centro span { color: var(--muted); font-size: 12.5px; }
.donut-centro b { font-size: 17px; font-weight: 600; }
.donut-leg { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.donut-leg li { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; cursor: default; }
.donut-leg li i { width: 11px; height: 11px; border-radius: 3px; }
.donut-leg li span.v { color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- filtros */
.filtro { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.filtro select { width: auto; padding: 7px 10px; font-size: 13px; }
.toggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.toggle button { border: 0; background: transparent; padding: 5px 10px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 12.5px; color: var(--text-2); }
.toggle button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }

/* ---------------------------------------------------------------- tabelas */
.tabela-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .3px; padding: 10px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; cursor: default; }
th.sort { cursor: pointer; user-select: none; }
th.sort:hover { color: var(--text); }
td { padding: 11px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.r, th.r { text-align: right; }
.tk { font-weight: 700; }
.tk small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
tfoot td { font-weight: 600; border-top: 1px solid var(--border); }
.acoes { display: flex; gap: 4px; justify-content: flex-end; }
.acoes form { margin: 0; }

.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; letter-spacing: .2px; }
.b-compra { background: #e3f6ec; color: #11794d; }
.b-venda { background: #fde8e8; color: #b42323; }
.b-avaliar { background: #e3f6ec; color: #11794d; }
.b-manter { background: #e6effb; color: #1c5cab; }
.b-aguardar { background: #fff3d6; color: #8a5a00; }
.b-neutro { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.b-atualizar { background: #fde8e8; color: #b42323; }
.b-encerrada { background: var(--surface-2); color: var(--muted); }
:root[data-theme="dark"] .b-compra, :root[data-theme="dark"] .b-avaliar { background: #11392a; color: #6ee0a8; }
:root[data-theme="dark"] .b-venda, :root[data-theme="dark"] .b-atualizar { background: #3d1a1a; color: #f59a9a; }
:root[data-theme="dark"] .b-manter { background: #16294a; color: #8cb8f0; }
:root[data-theme="dark"] .b-aguardar { background: #3a2c0c; color: #f0c56a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .b-compra, :root:not([data-theme="light"]) .b-avaliar { background: #11392a; color: #6ee0a8; }
  :root:not([data-theme="light"]) .b-venda, :root:not([data-theme="light"]) .b-atualizar { background: #3d1a1a; color: #f59a9a; }
  :root:not([data-theme="light"]) .b-manter { background: #16294a; color: #8cb8f0; }
  :root:not([data-theme="light"]) .b-aguardar { background: #3a2c0c; color: #f0c56a; }
}

.barra { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; min-width: 70px; border: 1px solid var(--border); }
.barra i { display: block; height: 100%; background: var(--blue); border-radius: 3px; }
.barra.estourou i { background: var(--amber); }

/* ---------------------------------------------------------------- mensagens */
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); }
.flash.ok { border-color: #9fdcbc; background: #effaf4; color: #11794d; }
.flash.erro { border-color: #f3b4b4; background: #fdf0f0; color: #b42323; }
.flash.aviso { border-color: #f0d18a; background: #fff8e6; color: #7a5200; }
:root[data-theme="dark"] .flash.ok { background: #11261c; } :root[data-theme="dark"] .flash.erro { background: #2a1414; } :root[data-theme="dark"] .flash.aviso { background: #2a220e; }

.alerta { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 10px; background: #fff8e6; border: 1px solid #f0d18a; color: #7a5200; margin-bottom: 16px; font-size: 13px; flex-wrap: wrap; }
:root[data-theme="dark"] .alerta { background: #2a220e; border-color: #5c4712; color: #f0c56a; }

.mini-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.mini-kpis .card { padding: 14px 16px; }
.mini-kpis .rot { color: var(--muted); font-size: 12.5px; }
.mini-kpis .v { font-size: 19px; font-weight: 600; margin-top: 2px; }

.meta-barra { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin-top: 6px; border: 1px solid var(--border); }
.meta-barra i { display: block; height: 100%; background: var(--green); }

.vazio { text-align: center; padding: 40px 20px; color: var(--muted); }

/* ocultar valores */
body.oculto .sens { filter: blur(7px); user-select: none; }

/* ---------------------------------------------------------------- responsivo */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-2b { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  main { padding: 16px; }
  .topbar { padding: 0 16px; gap: 10px; }
  .carteira-nome { display: none; }
  .tabs { padding: 0 8px; }
  .kpis { grid-template-columns: 1fr; }
  .kpi .valor { font-size: 23px; }
  .donut-wrap { grid-template-columns: 1fr; }
  .chart-box { height: 260px; }
  .tabs .spacer, .tabs .btn { display: none; }
}

/* ---------------------------------------------------------------- v2: status auto-cotação */
.auto-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: #c9ccd2; padding: 5px 10px;
  border-radius: 99px; background: #ffffff10; white-space: nowrap; }
.auto-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #8a8f98; display: inline-block; }
.auto-chip.on .dot { background: #2fc084; box-shadow: 0 0 0 3px #2fc08433; animation: pulso 2s infinite; }
.auto-chip.idle .dot { background: #8cb8f0; }
.auto-chip.warn .dot { background: #f0c56a; }
.auto-chip.off { opacity: .7; }
@keyframes pulso { 50% { box-shadow: 0 0 0 6px #2fc08400; } }
@media (max-width: 900px) { .auto-chip span { display: none; } }

/* status de lançamentos */
.b-pendente { background: #fff3d6; color: #8a5a00; }
.b-executada { background: #e3f6ec; color: #11794d; }
.b-cancelada { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.b-noprec { background: #e3f6ec; color: #11794d; }
.b-perto { background: #fff3d6; color: #8a5a00; }
.b-acima { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.b-alta { background: #fde8e8; color: #b42323; }
.b-media { background: #e6effb; color: #1c5cab; }
.b-baixa { background: var(--surface-2); color: var(--muted); }
:root[data-theme="dark"] .b-pendente, :root[data-theme="dark"] .b-perto { background: #3a2c0c; color: #f0c56a; }
:root[data-theme="dark"] .b-executada, :root[data-theme="dark"] .b-noprec { background: #11392a; color: #6ee0a8; }
:root[data-theme="dark"] .b-alta { background: #3d1a1a; color: #f59a9a; }
:root[data-theme="dark"] .b-media { background: #16294a; color: #8cb8f0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .b-pendente, :root:not([data-theme="light"]) .b-perto { background: #3a2c0c; color: #f0c56a; }
  :root:not([data-theme="light"]) .b-executada, :root:not([data-theme="light"]) .b-noprec { background: #11392a; color: #6ee0a8; }
  :root:not([data-theme="light"]) .b-alta { background: #3d1a1a; color: #f59a9a; }
  :root:not([data-theme="light"]) .b-media { background: #16294a; color: #8cb8f0; }
}
tr.linha-cancelada td { opacity: .55; }
tr.linha-pendente td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.seg input:checked + label.p { background: var(--amber); color: #fff; }
.seg input:checked + label.e { background: var(--green); color: #fff; }

.pend-lista { display: flex; flex-direction: column; gap: 10px; }
.pend-item { display: grid; grid-template-columns: minmax(150px, 1.2fr) minmax(200px, 1.4fr) minmax(360px, 3fr); gap: 14px;
  align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.pend-item .info { font-size: 12.5px; color: var(--text-2); }
.pend-item form.conf { display: flex; gap: 6px; align-items: end; flex-wrap: wrap; justify-content: flex-end; margin: 0; }
.pend-item form.conf label { font-size: 11px; }
.pend-item form.conf input { width: 110px; padding: 6px 8px; }
.pend-item form.conf input[type=date] { width: 140px; }
@media (max-width: 1000px) { .pend-item { grid-template-columns: 1fr; } .pend-item form.conf { justify-content: flex-start; } }

/* ---------------------------------------------------------------- radar */
.radar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.rcard { display: flex; flex-direction: column; gap: 12px; padding: 18px; position: relative; }
.rcard.noprec { border-color: #9fdcbc; box-shadow: 0 0 0 1px #9fdcbc inset, var(--shadow); }
.rcard .topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.rcard .tk { font-size: 17px; }
.rcard .tk small { max-width: 190px; }
.rcard .preco { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rcard .preco b { font-size: 26px; font-weight: 600; letter-spacing: -.5px; }
.rcard .spark { height: 58px; position: relative; }
.rcard .linhas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; font-size: 12.5px; }
.rcard .linhas div { display: flex; flex-direction: column; color: var(--muted); }
.rcard .linhas div b { color: var(--text); font-weight: 500; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.rcard .nota { font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.rcard .botoes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.rcard .botoes .btn { flex: 1; justify-content: center; }
.faixa52 { position: relative; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--red-light), var(--surface-2), var(--green-light)); border: 1px solid var(--border); margin: 6px 0 2px; }
.faixa52 i { position: absolute; top: -4px; width: 3px; height: 12px; background: var(--text); border-radius: 2px; transform: translateX(-1px); }
.faixa52-rot { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dist { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; border: 1px solid var(--border); }
.dist i { display: block; height: 100%; border-radius: 3px; }
.btn.rico { background: #ff5a00; border-color: #ff5a00; color: #fff; }
.btn.rico:hover { filter: brightness(1.05); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #16181d; color: #fff; padding: 10px 16px;
  border-radius: 10px; font-size: 13px; z-index: 50; box-shadow: 0 6px 24px #0004; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.on { opacity: 1; }
details.add summary { cursor: pointer; list-style: none; }
details.add summary::-webkit-details-marker { display: none; }
.alerta.ok { background: #effaf4; border-color: #9fdcbc; color: #11794d; }
:root[data-theme="dark"] .alerta.ok { background: #11261c; border-color: #1f5e3f; color: #6ee0a8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .alerta.ok { background: #11261c; border-color: #1f5e3f; color: #6ee0a8; }
  :root:not([data-theme="light"]) .alerta { background: #2a220e; border-color: #5c4712; color: #f0c56a; } }

/* ---------------------------------------------------------------- v3: autenticação / admin */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-wrap { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 16px; }
.auth-marca { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; justify-content: center; }
.auth-card { padding: 28px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .btn { justify-content: center; padding: 11px; }
.auth-rodape { text-align: center; font-size: 12px; }
.codigo-otp { font-size: 22px; letter-spacing: 6px; text-align: center; font-variant-numeric: tabular-nums; }
.qr-box { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 6px 0 14px; }
#qr { width: 180px; height: 180px; background: #fff; border-radius: 10px; border: 1px solid var(--border); padding: 4px; flex: none; }
#qr svg { width: 100%; height: 100%; display: block; }
.chave-totp { font-size: 13px; background: var(--surface-2); padding: 4px 8px; border-radius: 6px; display: inline-block; margin: 4px 0; word-break: break-all; }
.passos { padding-left: 18px; margin: 8px 0; color: var(--text-2); }
.codigos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.codigos code { background: var(--surface-2); border: 1px solid var(--border); padding: 8px; border-radius: 8px; text-align: center; font-size: 14px; letter-spacing: .5px; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; color: var(--top-text);
  padding: 5px 8px; border-radius: 8px; font-size: 13px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: #ffffff14; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.user-menu .menu { position: absolute; right: 0; top: 42px; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 10px 30px #0003; min-width: 220px; padding: 6px; z-index: 40; }
.user-menu .menu a, .user-menu .menu button { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 6px; text-decoration: none;
  background: none; border: 0; font: inherit; color: inherit; cursor: pointer; }
.user-menu .menu a:hover, .user-menu .menu button:hover { background: var(--surface-2); }
.user-menu .menu .cab { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; font-size: 12.5px; }
.b-perfil-usuario { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.b-perfil-admin { background: #e6effb; color: #1c5cab; }
.b-perfil-sysadmin { background: #efe9fb; color: #4a3aa7; }
.b-ok { background: #e3f6ec; color: #11794d; }
.b-falha { background: #fde8e8; color: #b42323; }
.b-negado { background: #fff3d6; color: #8a5a00; }
:root[data-theme="dark"] .b-perfil-admin { background: #16294a; color: #8cb8f0; }
:root[data-theme="dark"] .b-perfil-sysadmin { background: #2a2350; color: #b5acf2; }
:root[data-theme="dark"] .b-ok { background: #11392a; color: #6ee0a8; }
:root[data-theme="dark"] .b-falha { background: #3d1a1a; color: #f59a9a; }
:root[data-theme="dark"] .b-negado { background: #3a2c0c; color: #f0c56a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .b-perfil-admin { background: #16294a; color: #8cb8f0; }
  :root:not([data-theme="light"]) .b-perfil-sysadmin { background: #2a2350; color: #b5acf2; }
  :root:not([data-theme="light"]) .b-ok { background: #11392a; color: #6ee0a8; }
  :root:not([data-theme="light"]) .b-falha { background: #3d1a1a; color: #f59a9a; }
  :root:not([data-theme="light"]) .b-negado { background: #3a2c0c; color: #f0c56a; }
}
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; }
.admin-nav a { padding: 7px 12px; border-radius: 8px; text-decoration: none; color: var(--text-2); border: 1px solid var(--border); background: var(--surface); font-weight: 500; }
.admin-nav a.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.etapas { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.etapas li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; font-size: 13px; }
.etapas li .st { font-weight: 700; }
.etapas li.ok .st { color: var(--green); } .etapas li.falha .st { color: var(--red); } .etapas li.aviso .st { color: var(--amber); }
pre.log { background: #0f1114; color: #d7dae0; padding: 12px; border-radius: 8px; font-size: 12px; max-height: 360px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
@media print { .auth-rodape, .btn { display: none; } }
.rodape { text-align: center; font-size: 12px; padding: 0 0 24px; }
.qtd-resumo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.qtd-resumo .v { font-size: 22px; font-weight: 600; margin: 2px 0; }
.qtd-resumo .rot { font-size: 12.5px; }
@media (max-width: 800px) { .qtd-resumo { grid-template-columns: 1fr; } }
