/* Gemenon · Hoax Hunter Saúde — azul e branco, na linha do Conta Azul */
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:opsz,wght@6..12,400;6..12,600;6..12,700;6..12,800&display=swap');

:root {
  --brand: #1488d8;        /* faixa lateral */
  --brand-600: #0b6cc4;    /* ações primárias */
  --brand-700: #08569e;
  --brand-50: #e8f3fc;
  --ink: #1c2b3a;
  --muted: #5f7186;
  --line: #d9e2ec;
  --bg: #eef3f8;
  --card: #ffffff;
  --ok: #1f9d55;   --ok-50: #e7f6ee;
  --mid: #b98100;  --mid-50: #fdf4dc;
  --high: #d9601a; --high-50: #fdeee4;
  --imp: #c62828;  --imp-50: #fde8e8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 42, 67, .06), 0 2px 8px rgba(16, 42, 67, .05);
  font-family: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; font-weight: 800; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 800; margin: 0 0 .75rem; }
h3 { font-size: 1rem; font-weight: 700; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }
:focus-visible { outline: 3px solid #7cc0f5; outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* ---------- moldura ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; height: 60px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 1rem; padding: 0 1.25rem;
}
.logo { display: flex; align-items: baseline; gap: .4rem; font-weight: 800; font-size: 1.35rem; color: var(--brand-600); letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo .tag { font-size: .78rem; font-weight: 700; color: var(--brand-600); }
.topbar .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: .6rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-600); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.who .name { font-weight: 700; line-height: 1.1; }
.who .role { font-size: .8rem; color: var(--brand-600); }
.layout { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - 60px); }
.side { background: var(--brand); padding: .75rem .6rem; }
.side a {
  display: block; color: #fff; font-weight: 600; padding: .55rem .8rem; border-radius: 8px; margin-bottom: 2px;
}
.side a:hover { background: rgba(255, 255, 255, .14); text-decoration: none; }
.side a.active { background: #fff; color: var(--brand-700); }
.side .group { color: rgba(255, 255, 255, .7); font-size: .78rem; font-weight: 700; margin: 1rem .8rem .35rem; }
main.content { padding: 1.5rem 1.75rem 3rem; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); }

/* ---------- blocos ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.35rem; margin-bottom: 1.25rem; }
.card > h2:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 1.25rem; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.25rem; text-align: center; }
.kpi .v { font-size: 1.6rem; font-weight: 800; color: var(--brand-700); }
.kpi .v.ok { color: var(--ok); } .kpi .v.bad { color: var(--imp); }
.kpi .l { font-weight: 700; }

.flash { background: var(--brand-50); border: 1px solid #b9dbf6; color: var(--brand-700); border-radius: 8px; padding: .7rem 1rem; margin-bottom: 1rem; overflow-wrap: anywhere; }
.alert { border-radius: 8px; padding: .7rem 1rem; margin-bottom: 1rem; }
.alert.err { background: var(--imp-50); color: var(--imp); border: 1px solid #f5c2c2; }
.alert.warn { background: var(--mid-50); color: #7a5600; border: 1px solid #f1dc9c; }
.alert.info { background: var(--brand-50); color: var(--brand-700); border: 1px solid #b9dbf6; }

/* ---------- tabelas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .82rem; color: var(--muted); font-weight: 700; padding: .55rem .6rem; border-bottom: 2px solid var(--line); white-space: nowrap; }
td { padding: .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.off td { color: var(--muted); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.center, th.center { text-align: center; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }

/* ---------- formulários ---------- */
label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .3rem; }
.field { margin-bottom: 1rem; }
.hint { font-size: .82rem; color: var(--muted); margin-top: .25rem; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=tel], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #c3cfdb; border-radius: 8px; padding: .55rem .7rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand-600); outline: 3px solid #cfe6fa; outline-offset: 0; }
textarea { min-height: 90px; resize: vertical; }
textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; min-height: 110px; }
.row { display: grid; gap: 0 1rem; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.c2 { grid-column: span 2; } .c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; }
.c6 { grid-column: span 6; } .c8 { grid-column: span 8; } .c9 { grid-column: span 9; } .c12 { grid-column: span 12; }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
legend { font-weight: 800; font-size: 1rem; margin-bottom: .6rem; padding: 0; }
.choice { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .5rem; }
.choice label { display: flex; gap: .55rem; align-items: center; font-weight: 600; border: 1px solid var(--line); border-radius: 8px; padding: .6rem .75rem; cursor: pointer; margin: 0; }
.choice label:has(input:checked) { border-color: var(--brand-600); background: var(--brand-50); }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 600; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .5rem; }
.form-section { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: .5rem; }
.form-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.inline { display: inline; margin: 0; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 700; font-size: .92rem;
  background: var(--brand-600); color: #fff; border: 1px solid var(--brand-600); border-radius: 8px; padding: .55rem 1rem; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--brand-700); border-color: var(--brand-700); text-decoration: none; }
.btn-ghost { background: #fff; color: var(--brand-600); border-color: #b9cfe4; }
.btn-ghost:hover { background: var(--brand-50); color: var(--brand-700); }
.btn-danger { background: #fff; color: var(--imp); border-color: #f0b9b9; }
.btn-danger:hover { background: var(--imp-50); border-color: var(--imp); color: var(--imp); }
.btn-sm { padding: .3rem .65rem; font-size: .82rem; }
.btn-big { padding: .8rem 1.4rem; font-size: 1rem; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }

/* liga/desliga dos endpoints */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; border-radius: 99px; background: #c5d1dd; border: 0; cursor: pointer; padding: 0; vertical-align: middle; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch.on { background: var(--ok); }
.switch.on::after { left: 23px; }
.switch:disabled { opacity: .25; cursor: not-allowed; }
.na { color: #b8c4d0; }

/* ---------- selos ---------- */
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: .12rem .55rem; border-radius: 99px; background: #e9eef4; color: var(--muted); white-space: nowrap; }
.b-blue { background: var(--brand-50); color: var(--brand-700); }
.b-ok { background: var(--ok-50); color: var(--ok); }
.b-mid { background: var(--mid-50); color: #8a6100; }
.b-high { background: var(--high-50); color: var(--high); }
.b-imp { background: var(--imp-50); color: var(--imp); }
.st-sucesso, .st-manual_concluido { background: var(--ok-50); color: var(--ok); }
.st-erro { background: var(--imp-50); color: var(--imp); }
.st-pendente, .st-executando { background: var(--brand-50); color: var(--brand-700); }
.st-manual_pendente { background: var(--mid-50); color: #8a6100; }
.lv-baixo { background: var(--ok-50); color: var(--ok); }
.lv-medio { background: var(--mid-50); color: #8a6100; }
.lv-alto { background: var(--high-50); color: var(--high); }
.lv-impeditivo { background: var(--imp-50); color: var(--imp); }
.fd { display: inline-grid; place-items: center; min-width: 28px; height: 24px; border-radius: 6px; font-weight: 800; font-size: .8rem; padding: 0 .3rem; background: #e9eef4; color: var(--muted); }
.fd-R { background: var(--ok-50); color: var(--ok); } .fd-A { background: var(--mid-50); color: #8a6100; }
.fd-I { background: var(--imp-50); color: var(--imp); }

/* ---------- trilha do workflow (elemento de assinatura) ---------- */
.track { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: .25rem 0 1.5rem; position: relative; }
.track .stop { position: relative; text-align: center; padding-top: 34px; font-size: .82rem; font-weight: 700; color: var(--muted); }
.track .stop::before { content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 4px; background: #d3dde8; }
.track .stop:first-child::before { display: none; }
.track .stop .dot { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 4px solid #d3dde8; z-index: 1; }
.track .stop.done { color: var(--ink); }
.track .stop.done::before, .track .stop.current::before { background: var(--brand-600); }
.track .stop.done .dot { background: var(--brand-600); border-color: var(--brand-600); }
.track .stop.done .dot::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.track .stop.current { color: var(--brand-700); }
.track .stop.current .dot { border-color: var(--brand-600); box-shadow: 0 0 0 5px #cfe6fa; }
.track .when { display: block; font-weight: 400; font-size: .74rem; color: var(--muted); margin-top: .1rem; }

/* ---------- resultado por avaliado ---------- */
.subject { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; background: #fff; }
.subject > summary { list-style: none; cursor: pointer; padding: .9rem 1.1rem; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.subject > summary::-webkit-details-marker { display: none; }
.subject > summary::before { content: "›"; font-size: 1.3rem; font-weight: 800; color: var(--brand-600); transition: transform .15s; width: 12px; }
.subject[open] > summary::before { transform: rotate(90deg); }
.subject > summary .t { font-weight: 800; }
.subject > summary .counts { margin-left: auto; display: flex; gap: .35rem; flex-wrap: wrap; }
.subject .body { padding: 0 1.1rem 1.1rem; }
.kv { display: grid; grid-template-columns: 220px 1fr; gap: .25rem 1rem; font-size: .9rem; margin-bottom: 1rem; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
pre.data { background: #f5f8fb; border: 1px solid var(--line); border-radius: 8px; padding: .6rem .75rem; font-size: .78rem; max-height: 280px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: .4rem 0 0; }
details.mini > summary { cursor: pointer; color: var(--brand-600); font-weight: 700; font-size: .82rem; }
.check-row:target td { background: #fff9e3; }

/* medidor de risco JEV: 4 colunas de probabilidade */
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; align-items: end; height: 120px; margin: .5rem 0 .3rem; }
.meter .col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.meter .bar { width: 100%; border-radius: 6px 6px 0 0; min-height: 3px; }
.meter .pct { font-weight: 800; font-size: .82rem; margin-bottom: .2rem; }
.meter .col:nth-child(1) .bar { background: var(--ok); }
.meter .col:nth-child(2) .bar { background: #e5ac10; }
.meter .col:nth-child(3) .bar { background: var(--high); }
.meter .col:nth-child(4) .bar { background: var(--imp); }
.meter-labels { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; text-align: center; font-size: .78rem; font-weight: 700; color: var(--muted); border-top: 2px solid var(--line); padding-top: .3rem; }
.score-box { display: grid; grid-template-columns: 260px 1fr; gap: 1.5rem; align-items: start; }
.big-level { font-size: 1.35rem; font-weight: 800; padding: .3rem .8rem; border-radius: 8px; display: inline-block; }

/* editor do advogado */
.editor-bar { display: flex; gap: .3rem; border: 1px solid #c3cfdb; border-bottom: 0; border-radius: 8px 8px 0 0; padding: .35rem; background: #f5f8fb; }
.editor-bar button { font: inherit; font-weight: 700; border: 1px solid transparent; background: transparent; border-radius: 6px; padding: .25rem .6rem; cursor: pointer; }
.editor-bar button:hover { background: #fff; border-color: var(--line); }
.editor { min-height: 260px; border: 1px solid #c3cfdb; border-radius: 0 0 8px 8px; padding: .8rem 1rem; background: #fff; line-height: 1.6; }
.editor:focus { outline: 3px solid #cfe6fa; border-color: var(--brand-600); }
.analysis-print { line-height: 1.65; }

/* ---------- telas sem login ---------- */
body.bare { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: linear-gradient(180deg, var(--brand) 0 38vh, var(--bg) 38vh); }
.bare-card { background: #fff; border-radius: 14px; box-shadow: 0 10px 40px rgba(8, 86, 158, .18); padding: 2rem 2.1rem; width: 100%; max-width: 420px; }
.bare-card .logo { margin-bottom: 1.25rem; }
.bare-card h1 { font-size: 1.3rem; }
.qr { display: block; width: 200px; height: 200px; margin: .5rem auto 1rem; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 8px; }
.secret { font-family: ui-monospace, Menlo, monospace; background: #f5f8fb; border: 1px dashed #b9cfe4; padding: .45rem .6rem; border-radius: 6px; text-align: center; font-size: .92rem; letter-spacing: .04em; }
.otp-input { font-size: 1.6rem !important; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }
.total-line { display: flex; justify-content: space-between; font-weight: 700; padding: .35rem 0; }
.total-line.grand { font-size: 1.35rem; font-weight: 800; color: var(--brand-700); border-top: 2px solid var(--line); margin-top: .4rem; padding-top: .6rem; }

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .side { display: flex; overflow-x: auto; gap: .25rem; padding: .5rem; }
  .side a { white-space: nowrap; margin: 0; }
  .side .group { display: none; }
  .g2, .g3, .g4, .score-box { grid-template-columns: 1fr; }
  .row > * { grid-column: span 12; }
  .kv { grid-template-columns: 1fr; }
  .track { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 1rem; }
  main.content { padding: 1rem; }
  .who .name, .who .role { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .topbar, .side, .actions, .no-print { display: none !important; }
  .layout { display: block; } body { background: #fff; } .card { box-shadow: none; border: 1px solid var(--line); }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
