/* Componentes do simulador — complementam as utilities do Tailwind. */
:root {
  --bg: #1c1d22;
  --sidebar: #0f1030;
  --card: #25262c;
  --card-2: #2d2e35;
  --line: rgba(255, 255, 255, 0.07);
  --track: #17181d;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #5b5ce2;
  --pill: #6c6cf5;
  --magenta: #cf4fd8;
  --amber: #f5c142;
  --green: #3dba5d;
  --red: #f05252;
}

html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); }

/* ---------- sidebar ---------- */
.nav-item {
  display: block; width: 100%; text-align: left;
  padding: 3px 10px; border-radius: 4px;
  font-size: 13px; color: #cbd5e1; transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(108, 108, 245, .18); }
.nav-item.is-active { background: var(--pill); color: #fff; }
.nav-sub {
  display: block; width: 100%; text-align: left;
  padding: 2px 10px; border-radius: 4px;
  font-size: 15px; color: #cbd5e1; transition: background .15s;
}
.nav-sub:hover { background: rgba(108, 108, 245, .18); }
.nav-sub.is-active { background: var(--pill); color: #fff; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #1a1b40; border-radius: 8px; padding: 3px; gap: 3px; }
.seg button { font-size: 11px; padding: 6px 4px; border-radius: 6px; color: #cbd5e1; }
.seg button.is-active { background: var(--pill); color: #fff; }
.seg button.is-active[data-id="corrigido"] { background: var(--magenta); }

/* ---------- cards ---------- */
.card {
  background: var(--card); border-radius: 14px; padding: 16px 18px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset; min-width: 0;
}
.card-title { font-weight: 600; font-size: 15px; color: #f3f4f6; letter-spacing: .1px; }
.card-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.kpi-value { font-size: 22px; font-weight: 700; color: #f9fafb; white-space: nowrap; }
.kpi-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.kpi-spark { position: relative; height: 64px; flex: 1 1 55%; max-width: 60%; }
.spark-cap { font-size: 10px; color: #6b7280; text-align: right; margin-top: 2px; }
.chart-box { position: relative; width: 100%; }

.chip { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-top: 6px; background: #33343c; color: #cbd5e1; }
.chip:empty { display: none; }
.chip[data-state="up"] { background: rgba(207, 79, 216, .18); color: #f0a6f5; }
.chip[data-state="down"] { background: rgba(61, 186, 93, .18); color: #86e0a0; }

.tag { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: #33343c; color: #cbd5e1; vertical-align: middle; }
.tag-warn { background: rgba(245, 193, 66, .16); color: var(--amber); }
.tag-calc { background: rgba(91, 92, 226, .2); color: #a5a6ff; }
.tag-bad { background: rgba(240, 82, 82, .16); color: #fca5a5; }
.tag-ok { background: rgba(61, 186, 93, .16); color: #86e0a0; }

/* ---------- rings (participação) ---------- */
.ring {
  --p: 0; --c: var(--accent);
  width: 74px; height: 74px; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--track) 0);
  display: grid; place-items: center; position: relative;
}
.ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--card); }
.ring span { position: relative; font-size: 12px; font-weight: 600; color: #f3f4f6; }
.ring-label { font-size: 10px; color: #cbd5e1; text-align: center; line-height: 1.25; max-width: 90px; }

/* ---------- barras horizontais (detalhamento) ---------- */
.hbar-row { display: grid; grid-template-columns: minmax(90px, 46%) 1fr; align-items: center; gap: 10px; padding: 5px 0; }
.hbar-label { font-size: 11px; color: #cbd5e1; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar { height: 10px; border-radius: 999px; background: var(--accent); flex: none; transition: width .3s; }
.hbar-val { font-size: 11px; color: #e5e7eb; white-space: nowrap; }
.pick { display: block; width: 100%; text-align: left; padding: 3px 10px; border-radius: 4px; font-size: 13px; color: #cbd5e1; }
.pick:hover { background: rgba(108, 108, 245, .18); }
.pick.is-active { background: var(--pill); color: #fff; }

/* ---------- tabelas ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11px; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tfoot td, .tbl tr.total td { font-weight: 700; color: #f9fafb; background: rgba(255, 255, 255, .025); }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

[data-state="bad"] { color: #fca5a5 !important; }
[data-state="warn"] { color: var(--amber) !important; }
[data-state="ok"] { color: #86e0a0 !important; }
td[data-state="bad"], td[data-state="warn"] { font-weight: 700; }

/* ---------- entradas ---------- */
.in {
  background: #1b1c21; border: 1px solid #3a3b44; border-left: 3px solid var(--amber);
  border-radius: 6px; padding: 4px 8px; color: #f9fafb; font-size: 12px;
  font-variant-numeric: tabular-nums; outline: none;
}
.in:focus { border-color: var(--pill); border-left-color: var(--pill); }
.in:disabled { opacity: .45; border-left-color: #3a3b44; cursor: not-allowed; }
.in[type="number"] { text-align: right; }
.in-text { border-left-color: #3a3b44; }
select.in { padding-right: 4px; }

.shift {
  min-width: 46px; padding: 3px 6px; border-radius: 6px; font-size: 11px; font-weight: 600;
  border: 1px solid transparent; transition: transform .08s, filter .15s; user-select: none;
}
.shift:hover { filter: brightness(1.15); }
.shift:active { transform: scale(.94); }
.shift[data-v="T1"], .shift[data-v="M"] { background: rgba(91, 92, 226, .28); color: #c7c8ff; border-color: rgba(91, 92, 226, .6); }
.shift[data-v="T2"], .shift[data-v="T"] { background: rgba(207, 79, 216, .22); color: #f3b5f7; border-color: rgba(207, 79, 216, .55); }
.shift[data-v="Folga"], .shift[data-v="—"] { background: #1b1c21; color: #6b7280; border-color: #33343c; }

.btn { font-size: 12px; padding: 5px 10px; border-radius: 6px; background: #33343c; color: #e5e7eb; }
.btn:hover { background: #3d3e47; }
.btn-ghost { background: transparent; border: 1px solid #3a3b44; }
.icon-btn { width: 22px; height: 22px; border-radius: 6px; color: #9ca3af; line-height: 1; }
.icon-btn:hover { background: rgba(240, 82, 82, .18); color: #fca5a5; }

.switch { position: relative; width: 34px; height: 18px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #3a3b44; border-radius: 999px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--pill); }
.switch input:checked + span::before { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--pill); outline-offset: 2px; }

.banner { border-radius: 10px; padding: 10px 14px; font-size: 12px; }
.banner-corr { background: rgba(207, 79, 216, .12); border: 1px solid rgba(207, 79, 216, .35); color: #f3c4f6; }
.note { font-size: 11px; color: var(--muted); line-height: 1.5; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }

.status-pill { display: inline-block; font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 8px; }
.status-pill[data-state="ok"] { background: rgba(61, 186, 93, .15); }
.status-pill[data-state="bad"] { background: rgba(240, 82, 82, .14); }

.sev { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 2px 7px; border-radius: 4px; }
.sev-alta { background: rgba(240, 82, 82, .18); color: #fca5a5; }
.sev-media { background: rgba(245, 193, 66, .16); color: var(--amber); }
.sev-baixa { background: #33343c; color: #cbd5e1; }

section[id^="sec-"] { scroll-margin-top: 16px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
