/* 2D Endpoint Protection — identidade visual da 2D (azul da marca, Inter/sistema), claro e escuro automáticos. Sem CDN. */
:root {
  --pri: #2563eb; --pri-h: #1d4ed8; --on-pri: #fff; --pri-soft: #e9effd; --th-bg: #183f96; --th-tx: #fff;
  --bg: #f8fafc; --card: #fff; --card2: #f1f5f9; --bd: #e2e8f0; --bd2: #cbd5e1;
  --txt: #0f172a; --txt2: #475569; --mut: #526071;
  --ok: #0b825a; --ok-bg: #e2f7f0; --warn: #92400e; --warn-bg: #fef3c7; --orange: #b45309; --orange-bg: #ffedd5;
  --bad: #b91c1c; --bad-bg: #fee2e2; --info: #0e7490; --info-bg: #cffafe;
  --f-protected: #10b981; --f-attention: #f59e0b; --f-vulnerable: #f97316; --f-critical: #dc2626; --f-empty: #cbd5e1;
  --raio: .5rem; --sombra: 0 1px 3px rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
  --fonte: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --pri: #3b82f6; --pri-h: #60a5fa; --on-pri: #0b1220; --pri-soft: #1e2a4a; --th-bg: #263449; --th-tx: #f1f5f9;
    --bg: #0f172a; --card: #1e293b; --card2: #273449; --bd: #334155; --bd2: #475569;
    --txt: #f1f5f9; --txt2: #cbd5e1; --mut: #a3b1c4;
    --ok: #34d399; --ok-bg: #0f3d31; --warn: #fbbf24; --warn-bg: #45330a; --orange: #fb923c; --orange-bg: #43200b;
    --bad: #f87171; --bad-bg: #4a1818; --info: #22d3ee; --info-bg: #0c3a46;
    --f-empty: #475569; --sombra: 0 1px 3px rgb(0 0 0 / .5);
  }
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: var(--fonte); background: var(--bg); color: var(--txt); line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--pri); }
a:hover { color: var(--pri-h); }
:focus-visible { outline: 3px solid var(--pri); outline-offset: 2px; border-radius: 2px; }
h1 { font-size: 1.5rem; margin: .25rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; }
.muted { color: var(--mut); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); font-size: .9em; }
.wrap { overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--pri); color: var(--on-pri); padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; }

/* Estrutura */
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem 1rem; background: var(--th-bg); color: var(--th-tx); }
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--th-tx); text-decoration: none; font-weight: 700; }
.brand:hover { color: var(--th-tx); }
.topbar-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.topbar .who { font-size: .9rem; }
.topbar label { font-size: .85rem; margin-right: .35rem; }
.topbar select { max-width: 16rem; }
.tenant-picker { display: flex; align-items: center; }
.shell { flex: 1; display: block; width: 100%; }
.shell.has-nav { display: grid; grid-template-columns: 14.5rem 1fr; align-items: start; }
.sidenav { background: var(--card); border-right: 1px solid var(--bd); min-height: 100%; padding: .75rem 0; position: sticky; top: 0; }
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.sidenav a { display: block; padding: .55rem 1.25rem; color: var(--txt2); text-decoration: none; border-left: 4px solid transparent; }
.sidenav a:hover { background: var(--card2); color: var(--txt); }
.sidenav a[aria-current="page"] { border-left-color: var(--pri); background: var(--pri-soft); color: var(--txt); font-weight: 600; }
main { padding: 1.25rem 1.5rem 2rem; min-width: 0; max-width: 90rem; width: 100%; margin: 0 auto; }
main:focus { outline: none; }
.footer { text-align: center; color: var(--mut); font-size: .8rem; padding: 1rem; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.page-head h1, .page-head h2 { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* Cartões */
.card { background: var(--card); border: 1px solid var(--bd); border-radius: var(--raio); box-shadow: var(--sombra); padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.card.narrow, .auth-card { max-width: 30rem; margin-left: auto; margin-right: auto; }
.auth-card.wide { max-width: 38rem; }
.narrow-form { max-width: 44rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1rem; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + .card, .card + .grid-2 { margin-top: 1rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: .75rem; margin: 1rem 0; }
.kpi { background: var(--card); border: 1px solid var(--bd); border-radius: var(--raio); box-shadow: var(--sombra); padding: .8rem 1rem; display: flex; flex-direction: column; gap: .15rem; color: var(--txt); text-decoration: none; }
.kpi-link:hover { border-color: var(--pri); color: var(--txt); }
.kpi-label { font-size: .8rem; color: var(--mut); }
.kpi-value { font-size: 1.8rem; font-weight: 700; line-height: 1.2; }
.kpi-value.ok { color: var(--ok); } .kpi-value.bad { color: var(--bad); } .kpi-value.warn { color: var(--orange); }

/* Formulários */
.field { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .9rem; }
.field label, legend { font-weight: 600; font-size: .9rem; }
.req { color: var(--bad); }
input, select, textarea { font: inherit; color: var(--txt); background: var(--card); border: 1px solid var(--bd2); border-radius: var(--raio); padding: .5rem .65rem; min-height: 2.5rem; width: 100%; }
textarea { min-height: 4rem; resize: vertical; }
textarea.mono { font-family: var(--mono); font-size: .85rem; }
input[type=checkbox] { width: auto; min-height: 0; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--bad); }
.error { color: var(--bad); font-size: .85rem; margin: 0; }
.help { color: var(--mut); font-size: .8rem; margin: 0; }
.static { margin: 0; padding: .5rem 0; }
fieldset { border: 1px solid var(--bd); border-radius: var(--raio); margin: 0 0 .9rem; padding: .6rem .9rem; }
.check { display: flex; gap: .5rem; align-items: center; margin: .25rem 0; font-weight: 400; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; margin-bottom: 1rem; }
.filters .field { margin-bottom: 0; min-width: 9rem; flex: 0 1 14rem; }
.inline-form { display: inline; }
.cmd-form fieldset { background: var(--card2); }

/* Botões */
.btn { display: inline-block; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; background: var(--pri); color: var(--on-pri); border: 1px solid var(--pri); border-radius: var(--raio); padding: .5rem 1rem; min-height: 2.5rem; }
.btn:hover { background: var(--pri-h); color: var(--on-pri); border-color: var(--pri-h); }
.btn-secondary { background: var(--card); color: var(--pri); }
.btn-secondary:hover { background: var(--pri-soft); color: var(--pri-h); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: #991b1b; border-color: #991b1b; color: #fff; }
.btn-block { width: 100%; }
.btn-link { font: inherit; background: none; border: 0; color: var(--pri); text-decoration: underline; cursor: pointer; padding: .25rem; }
.danger-zone { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--bd); }
[hidden] { display: none !important; }

/* Alertas e selos */
.alert { border-radius: var(--raio); padding: .7rem 1rem; margin: 0 0 1rem; border: 1px solid; }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.alert-error { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.alert-warning { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: var(--info); }
.badge { display: inline-block; font-size: .78rem; font-weight: 600; padding: .1rem .55rem; border-radius: 999px; white-space: nowrap; }
.badge-protected { background: var(--ok-bg); color: var(--ok); }
.badge-attention { background: var(--warn-bg); color: var(--warn); }
.badge-vulnerable { background: var(--orange-bg); color: var(--orange); }
.badge-critical { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: var(--card2); color: var(--mut); border: 1px solid var(--bd); }
.ok-text { color: var(--ok); font-weight: 600; }
.empty { background: var(--card); border: 1px dashed var(--bd2); border-radius: var(--raio); padding: 1.5rem; text-align: center; color: var(--mut); }

/* Tabelas */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--bd); border-radius: var(--raio); box-shadow: var(--sombra); margin-bottom: .75rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--bd); vertical-align: top; }
thead th { background: var(--th-bg); color: var(--th-tx); font-weight: 600; white-space: nowrap; }
tbody th { font-weight: 600; }
tbody tr:hover { background: var(--card2); }
tbody tr:last-child > * { border-bottom: 0; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; color: var(--mut); font-size: .9rem; margin-bottom: 1rem; }
.pager-links { display: flex; align-items: center; gap: .75rem; }
.tabs, .seg { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid var(--bd); margin-bottom: 1rem; }
.seg { border: 0; margin: 0; }
.tabs a, .seg a { padding: .5rem .9rem; text-decoration: none; color: var(--txt2); border-bottom: 3px solid transparent; }
.tabs a[aria-current], .seg a[aria-current] { border-bottom-color: var(--pri); color: var(--txt); font-weight: 600; }

/* Listas e detalhes */
.props { display: grid; grid-template-columns: minmax(9rem, 14rem) 1fr; gap: .4rem 1rem; margin: 0; }
.props dt { color: var(--mut); font-size: .9rem; }
.props dd { margin: 0; overflow-wrap: anywhere; }
.plain { list-style: none; padding: 0; margin: 0 0 1rem; }
.plain li { padding: .3rem 0; }
.feed { list-style: none; margin: 0 0 .75rem; padding: 0; }
.feed li { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; padding: .45rem 0; border-bottom: 1px solid var(--bd); }
.findings { list-style: none; padding: 0; margin: 0; }
.findings li { padding: .5rem 0; border-bottom: 1px solid var(--bd); }
.findings p { margin: .2rem 0 0; color: var(--txt2); }
.big-score { font-size: 1.6rem; margin: 0; }
.code { background: var(--card2); border: 1px solid var(--bd); border-radius: var(--raio); padding: .75rem; overflow-x: auto; font-family: var(--mono); font-size: .82rem; margin: .5rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
details > summary { cursor: pointer; color: var(--pri); }

/* Login / MFA */
.auth-card { margin-top: 2rem; }
.steps { padding-left: 1.25rem; }
.qr-box { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; margin: 1rem 0; }
.qr { background: #fff; padding: .5rem; border: 1px solid var(--bd2); border-radius: var(--raio); }
.secret { font-family: var(--mono); font-size: 1.1rem; font-weight: 700; letter-spacing: .06em; background: var(--card2); border: 1px solid var(--bd); border-radius: var(--raio); padding: .6rem .9rem; overflow-wrap: anywhere; user-select: all; }
.codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .5rem; }
.codes li { font-family: var(--mono); font-size: 1.05rem; background: var(--card2); border: 1px solid var(--bd); border-radius: var(--raio); padding: .5rem .75rem; text-align: center; user-select: all; }

/* Gráficos SVG */
.chart { margin: 0; }
.chart svg { width: 100%; height: auto; display: block; }
.svg-label, .svg-value, .svg-axis { fill: var(--txt2); font-family: var(--fonte); font-size: 12px; }
.svg-value { fill: var(--txt); font-weight: 600; }
.grid { stroke: var(--bd); stroke-width: 1; }
.line { fill: none; stroke: var(--pri); stroke-width: 2; stroke-linejoin: round; }
.dot { stroke: var(--card); stroke-width: 1.5; }
.fill-protected { fill: var(--f-protected); background: var(--f-protected); }
.fill-attention { fill: var(--f-attention); background: var(--f-attention); }
.fill-vulnerable { fill: var(--f-vulnerable); background: var(--f-vulnerable); }
.fill-critical { fill: var(--f-critical); background: var(--f-critical); }
.fill-empty { fill: var(--f-empty); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; padding: 0; margin: .75rem 0 0; }
.swatch { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; margin-right: .4rem; }

@media (max-width: 52rem) {
  .shell.has-nav { display: block; }
  .sidenav { position: static; border-right: 0; border-bottom: 1px solid var(--bd); padding: 0; overflow-x: auto; }
  .sidenav ul { display: flex; white-space: nowrap; }
  .sidenav a { border-left: 0; border-bottom: 3px solid transparent; padding: .7rem 1rem; }
  .sidenav a[aria-current="page"] { border-bottom-color: var(--pri); }
  main { padding: 1rem; }
  .props { grid-template-columns: 1fr; }
  .props dt { margin-top: .5rem; }
}
@media print {
  .topbar, .sidenav, .footer, .actions, form { display: none !important; }
  .codes li { border: 1px solid #000; background: #fff; color: #000; }
}

.inline-list { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding: 0; margin: 0; }
