/* Pré-análise GMN · Logium — identidade do site logium.com.br (escuro, laranja, Montserrat) */
:root {
  --bg: #0d0d0e; --surface: #151413; --surface2: #1c1b19; --line: #2a2826; --line2: #36332f;
  --ink: #f4f1ec; --soft: #a39e96; --muted: #8a857d;
  --accent: #ff6a1a; --accent-ink: #140a04; --accent-soft: rgba(255,106,26,.12);
  --good: #34a05f; --mid: #e3a82b; --bad: #dc4b36; --manual: #a39e96;
  --ok: var(--good); --warn: var(--mid);
  --display: "Montserrat", system-ui, sans-serif; --hand: "Kalam", cursive; --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--display); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0 0 8px; letter-spacing: -.01em; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 21px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 10px; }
.sub { color: var(--soft); margin: 0 0 14px; }
.small { font-size: 13px; color: var(--soft); }
.hand { font-family: var(--hand); color: var(--accent); }
code { background: var(--surface2); padding: 1px 6px; border-radius: 6px; font-size: 13px; }

/* topo */
.topbar { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; gap: 18px; padding: 10px 22px;
  background: rgba(13,13,14,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; flex-shrink: 0; }
.brand-owl { width: 34px; height: 38px; object-fit: contain; }
.brand-txt { display: flex; flex-direction: column; line-height: 1; }
.brand-logo { height: 20px; width: auto; }
.brand-txt small { font-size: 11px; font-weight: 600; color: var(--soft); margin-top: 5px; letter-spacing: .02em; }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--soft); font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 999px; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--surface2); text-decoration: none; }
.nav a.on { color: var(--accent-ink); background: var(--accent); }

.container { max-width: 1080px; margin: 0 auto; padding: 22px 20px 60px; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; }

/* cartões */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; margin-bottom: 18px; }
.card > h2:first-child { margin-top: 0; }
.tag { display: inline-block; background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(255,106,26,.35); font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface2); color: var(--soft); border: 1px solid var(--line2); vertical-align: middle; }
.badge.ok { background: rgba(52,160,95,.15); color: #6fd497; border-color: rgba(52,160,95,.4); }
.badge.warn { background: rgba(227,168,43,.14); color: #f0c56a; border-color: rgba(227,168,43,.4); }
.badge.bad { background: rgba(220,75,54,.15); color: #f08a78; border-color: rgba(220,75,54,.4); }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.pill.ok { background: rgba(52,160,95,.15); color: #6fd497; }
.pill.parcial { background: rgba(227,168,43,.14); color: #f0c56a; }
.pill.falta { background: rgba(220,75,54,.15); color: #f08a78; }
.notice { background: var(--accent-soft); border: 1px solid rgba(255,106,26,.3); border-radius: 10px; padding: 10px 14px; font-size: 14px; margin: 12px 0; }
.error { background: rgba(220,75,54,.12); border: 1px solid rgba(220,75,54,.45); color: #f6a597; border-radius: 10px; padding: 10px 14px; margin: 10px 0; font-size: 14px; }
.ok-msg { color: #6fd497; }
.up { color: #6fd497; } .down { color: #f08a78; }

/* formulários */
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.grow { flex: 1; min-width: 200px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--soft); }
input, select, textarea { font: 500 15px var(--display); color: var(--ink); background: var(--surface2); border: 1px solid var(--line2); border-radius: 10px;
  padding: 11px 12px; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; line-height: 1.45; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); padding: 0; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 700 14px var(--display); padding: 11px 18px; border-radius: 10px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none !important; white-space: nowrap; }
button:hover, .btn:hover { filter: brightness(1.08); }
button:disabled { opacity: .5; cursor: default; filter: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); filter: none; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-danger { background: transparent; color: #f08a78; border-color: rgba(220,75,54,.5); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* busca */
.results { display: flex; flex-direction: column; gap: 10px; }
.result { display: flex; flex-direction: column; gap: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; color: var(--ink); }
.result:hover { border-color: var(--accent); text-decoration: none; }

/* números */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 14px 0; }
.stat { background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.stat b { font-size: 26px; font-weight: 800; }
.stat span { font-size: 13px; color: var(--soft); }

/* saúde */
.health-head { display: flex; align-items: center; gap: 36px; flex-wrap: wrap; }
.gauge { width: 270px; max-width: 100%; height: auto; }
.level-counts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 17px; font-weight: 600; }
.level-counts li { display: flex; align-items: center; gap: 12px; }
.level-counts .dot { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font: 700 14px var(--mono); color: #fff; }
.level-counts .bad { color: #f08a78; } .level-counts .bad .dot { background: var(--bad); }
.level-counts .mid { color: #f0c56a; } .level-counts .mid .dot { background: var(--mid); color: #2a1d00; }
.level-counts .good { color: #6fd497; } .level-counts .good .dot { background: var(--good); }
.level-counts .manual .dot { background: transparent; border: 2px solid var(--mid); color: var(--ink); }
.hitem { display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.hitem:last-child { border-bottom: 0; }
.hicon { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; margin-top: 2px; }
.hicon.good { background: var(--good); } .hicon.mid { background: var(--mid); color: #2a1d00; } .hicon.bad { background: var(--bad); }
.hicon.manual { background: transparent; border: 2px solid var(--mid); color: var(--mid); }
.hwhy { font-size: 13px; color: var(--soft); margin: 2px 0 6px; }
.hdetail { margin: 0 0 4px; }
.htip { font-size: 13px; font-style: italic; color: var(--soft); margin: 0 0 6px; }
.manual-tag { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--mid); border: 1px solid rgba(227,168,43,.5); border-radius: 999px; padding: 1px 7px; vertical-align: middle; }
.manual-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 4px; cursor: pointer; }
.hbar { position: relative; margin-top: 22px; max-width: 980px; }
.hbar-mark { position: absolute; top: -20px; transform: translateX(-50%); font: 600 11px var(--mono); color: var(--soft); display: flex; flex-direction: column; align-items: center; line-height: 1; }
.hbar-mark span { margin-bottom: 1px; }
.hbar-track { display: grid; grid-template-columns: 1fr 1fr 1fr; border-radius: 3px; overflow: hidden; }
.hbar-track span { font-size: 10px; text-align: center; color: #fff; padding: 1px 0; font-weight: 600; }
.hbar-track .bad { background: var(--bad); } .hbar-track .mid { background: var(--mid); color: #2a1d00; } .hbar-track .good { background: var(--good); }

/* tabelas */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px -4px 0; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--soft); font-weight: 700; padding: 10px 10px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.me td { background: var(--accent-soft); }
tr.me td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.bar-track { background: var(--surface2); border-radius: 999px; height: 9px; overflow: hidden; flex: 1; min-width: 60px; }
.bar { background: var(--accent); height: 100%; border-radius: 999px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 12px; }

/* mapa */
.map { width: 100%; border-radius: 12px; border: 1px solid var(--line); margin: 12px 0; z-index: 1; background: #222; }
.mk { width: 30px; height: 30px; border-radius: 50%; color: #fff; font: 700 12px/26px var(--display); text-align: center; border: 2px solid rgba(255,255,255,.85);
  box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.mk-target { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,106,26,.45); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--soft); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.leaflet-container { font-family: var(--display); }
.leaflet-tooltip { font-family: var(--display); font-size: 13px; }

/* grades */
.squares { display: grid; gap: 4px; width: 280px; max-width: 100%; }
.sq { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 6px; font: 700 13px var(--mono); color: #fff; }
.sq.good { background: var(--good); } .sq.mid { background: var(--mid); color: #2a1d00; } .sq.bad { background: var(--bad); }
.region-head { display: flex; gap: 32px; align-items: center; flex-wrap: wrap; margin: 16px 0; }
.grid-summary { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.grid-summary div { display: flex; gap: 8px; }
.grid-summary dt { color: var(--soft); } .grid-summary dd { margin: 0; font-weight: 700; }
.cmp-grids { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 10px; }
.cmp-grid { background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.cmp-grid.me { border-color: var(--accent); }
.cmp-grid .squares { width: 100%; }
.cmp-grid dl { display: flex; justify-content: space-between; margin: 0; font-size: 12px; }
.cmp-grid dt { color: var(--soft); } .cmp-grid dd { margin: 0; font-weight: 700; }
.compare .plano { background: var(--accent-soft); border: 1px solid rgba(255,106,26,.3); border-radius: 12px; padding: 14px 18px; margin: 12px 0 18px; }
.compare .plano ol { margin: 6px 0 8px; padding-left: 20px; }
.cmp-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.cmp-status { font-weight: 700; white-space: nowrap; }
.cmp-status.frente { color: #6fd497; } .cmp-status.igual { color: var(--soft); } .cmp-status.atras { color: #f08a78; }

/* volume */
.volume-month { display: flex; gap: 14px; flex-wrap: wrap; }
.volume-month > div, .volume-week { background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; min-width: 190px; }
.volume-month b { font-size: 30px; font-weight: 800; color: var(--accent); }
.volume-weeks { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.volume-week b { font-size: 22px; font-weight: 800; }
.volume-week .up, .volume-week .down { font-size: 12px; font-weight: 600; }

/* avaliações */
.reviews { display: flex; flex-direction: column; gap: 12px; }
.review { background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.review .stars { color: var(--good); letter-spacing: 1px; }
.owner { margin-top: 8px; background: var(--bg); border-radius: 8px; padding: 8px 12px; font-size: 13px; color: var(--soft); }
.owner strong { color: var(--ink); }
.monthbars { display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.monthbars > div { flex: 1; text-align: center; display: flex; flex-direction: column; justify-content: flex-end; }
.monthbars .mb { background: var(--accent); border-radius: 4px 4px 0 0; }
.queue-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.queue-tabs button { background: var(--surface); color: var(--soft); border-color: var(--line2); }
.queue-tabs button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.queue-tabs .badge { margin-left: 4px; }

/* proposta e simulação */
.service-group { margin-top: 14px; }
.service-line { display: grid; grid-template-columns: 50px 1fr 2fr 130px auto; gap: 10px; align-items: end; margin-bottom: 12px; }
.term-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface2); border: 1px solid var(--line2); border-radius: 999px; padding: 5px 6px 5px 12px; font-size: 13px; }
.term-chip button { padding: 0 7px; font-size: 14px; background: transparent; color: var(--soft); border: 0; }
.sim-totals { display: flex; gap: 14px; flex-wrap: wrap; }
.sim-totals > div { background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: flex; flex-direction: column; min-width: 200px; }
.sim-totals b { font-size: 22px; }
.proposal-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 3px solid var(--accent); padding-bottom: 14px; margin-bottom: 8px; }
.proposal h2 { margin-top: 24px; font-size: 18px; }
.prop-brand { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.prop-brand img { height: 34px; }

/* relatório */
.report .rpage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 26px; margin-bottom: 18px; }
.rhead { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--soft); border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 18px; }
.rhead .rbrand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); }
.rhead .rbrand img { height: 22px; }
.rtitle { color: var(--accent); }
.rfoot { margin-top: 20px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--soft); display: flex; justify-content: space-between; }

/* card de avaliação */
.review-card { width: 360px; max-width: 100%; margin: 8px auto 40px; border-radius: 18px; overflow: hidden; background: #f7f4ef; text-align: center; color: #1a1a1a;
  box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.review-card-top { background: var(--card); color: var(--card-fg); padding: 22px 20px 18px; }
.review-card-stars { font-size: 26px; letter-spacing: 4px; color: var(--card-stars); }
.review-card-headline { font: 800 24px/1.15 var(--display); margin-top: 4px; }
.review-card-body { padding: 20px 24px 24px; }
.review-card-body svg, .review-card-body img { width: 220px; height: 220px; display: block; margin: 0 auto; }
.review-card-msg { font-size: 15px; margin: 12px 0 6px; }
.review-card-cta { font-size: 12px; color: #57524a; margin: 0; }
.review-card-name { font: 800 17px var(--display); margin: 14px 0 0; padding-top: 12px; border-top: 2px solid var(--card-stars); }
.swatch { width: 34px; height: 34px; padding: 0; border-radius: 50%; border-width: 3px; }
.swatch[aria-pressed=true] { outline: 2px solid var(--ink); outline-offset: 2px; }

/* login */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(ellipse at top, rgba(255,106,26,.16), transparent 60%), var(--bg); }
.login { width: 100%; max-width: 400px; }
.login-top { text-align: center; margin-bottom: 22px; }
.login-owl { width: 80px; height: 90px; object-fit: contain; }
.login-logo { display: block; height: 30px; margin: 14px auto 10px; }
.login-top h1 { font-size: 30px; } .login-top h1 span { color: var(--accent); }
.login-top .hand { font-size: 19px; margin: 0; }
.login-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; display: flex; flex-direction: column; gap: 14px; }

.print-only { display: none; }

@media (max-width: 760px) {
  body { font-size: 15px; }
  .topbar { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px 8px; }
  .nav { margin-left: 0; }
  .container { padding: 16px 12px 50px; }
  .card, .report .rpage { padding: 16px; border-radius: 12px; }
  h1 { font-size: 23px; } h2 { font-size: 19px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 12px; } .stat b { font-size: 21px; } .stat span { font-size: 12px; }
  .health-head { gap: 16px; justify-content: center; }
  .gauge { width: 230px; }
  .grid2 { grid-template-columns: 1fr; }
  .row > button, .row > .btn { flex: 1 1 auto; }
  .actions .btn, .actions button { flex: 1 1 calc(50% - 8px); }
  .service-line { grid-template-columns: 40px 1fr; }
  .service-line .f-desc, .service-line .f-price, .service-line .f-del { grid-column: 2; }
  .hbar-mark { font-size: 10px; }
  .volume-month > div { min-width: 0; flex: 1; }
}

@media print {
  :root { --bg: #fff; --surface: #fff; --surface2: #f6f4f1; --line: #e4e0da; --line2: #d6d1c9; --ink: #16140f; --soft: #5f5a52; --muted: #6f6a62; --accent-soft: #fff1e8; }
  body { background: #fff; color: var(--ink); font-size: 12.5px; }
  .no-print, .topbar { display: none !important; }
  .print-only { display: block; }
  .container { max-width: none; padding: 0; }
  .card, .report .rpage { border: 0; padding: 0 0 8px; margin: 0 0 14px; break-inside: auto; }
  .report .rpage { break-after: page; }
  .report .rpage:last-child { break-after: auto; }
  .hitem { break-inside: avoid; padding: 10px 0; }
  .level-counts .bad, .badge.bad, .pill.falta, .cmp-status.atras, .down { color: #b3321f; }
  .level-counts .mid, .badge.warn, .pill.parcial { color: #9a6a00; }
  .level-counts .good, .badge.ok, .pill.ok, .cmp-status.frente, .up { color: #1f7a45; }
  .stat, .volume-week, .volume-month > div, .sim-totals > div { border-color: #e4e0da; }
  .map { break-inside: avoid; }
  a { color: var(--ink); }
  .review-card { box-shadow: none; border: 1px solid #ccc; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
