:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --text: #17202e;
  --muted: #5b6678;
  --border: #dbe1ea;
  --primary: #1747a6;
  --primary-ink: #ffffff;
  --primary-soft: #e3ebfb;
  --ok: #157a46;
  --ok-soft: #dcf3e6;
  --warn: #a15c00;
  --warn-soft: #fdf0d9;
  --bad: #b42318;
  --bad-soft: #fde4e1;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 10px;
  --side: 240px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e131b;
    --surface: #161d28;
    --surface-2: #1d2634;
    --text: #e6ebf2;
    --muted: #9aa6b8;
    --border: #2a3546;
    --primary: #6f9cf5;
    --primary-ink: #0b1220;
    --primary-soft: #1d2b47;
    --ok: #4cc488;
    --ok-soft: #12321f;
    --warn: #f0b354;
    --warn-soft: #3a2a10;
    --bad: #f27a6e;
    --bad-soft: #3d1714;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
small, .muted { color: var(--muted); }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 4px; font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.2rem 0; }

/* layout */
.app { display: flex; min-height: 100vh; }
.side {
  width: var(--side); flex: 0 0 var(--side); background: var(--surface); border-right: 1px solid var(--border);
  padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: block; font-weight: 700; font-size: 1.05rem; color: var(--text); padding: 4px 10px 2px; }
.brand small { display: block; font-weight: 400; font-size: .78rem; }
.countdown {
  margin: 14px 6px 16px; padding: 10px 12px; border-radius: var(--radius); background: var(--primary-soft); color: var(--text);
}
.countdown b { font-size: 1.5rem; color: var(--primary); display: block; line-height: 1.1; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.ativo { background: var(--primary-soft); color: var(--primary); }
.nav .grupo { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 10px 4px; }
.nav svg { width: 18px; height: 18px; flex: none; }
.main { flex: 1; min-width: 0; padding: 26px 32px 60px; max-width: 1180px; }
.topbar { display: none; }
@media (max-width: 860px) {
  .app { display: block; }
  .side { position: fixed; z-index: 30; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .side.aberta { transform: none; }
  .topbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; padding: 10px 16px;
    background: var(--surface); border-bottom: 1px solid var(--border);
  }
  .topbar button { background: none; border: 0; color: var(--text); padding: 4px; }
  .topbar strong { white-space: nowrap; }
  .topbar .dias { margin-left: auto; font-size: .85rem; color: var(--muted); }
  .main { padding: 18px 16px 60px; }
}

/* componentes */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.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)); }
@media (max-width: 980px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .g2, .g3 { grid-template-columns: 1fr; } .g4 { grid-template-columns: 1fr 1fr; } }
.stat .rot { color: var(--muted); font-size: .82rem; }
.stat .val { font-size: 1.7rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: .8rem; color: var(--muted); }
.cab { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cab h1 { margin: 0; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none !important; min-height: 38px;
}
.btn:hover { background: var(--surface-2); }
.btn.pri { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn.pri:hover { filter: brightness(1.08); }
.btn.peq { padding: 4px 10px; min-height: 30px; font-size: .85rem; }
.btn.perigo { color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.tag {
  display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .75rem; font-weight: 600;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
}
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.alerta { background: var(--warn-soft); color: var(--warn); }
.tag.ruim { background: var(--bad-soft); color: var(--bad); }
.tag.pri { background: var(--primary-soft); color: var(--primary); }
.ok-t { color: var(--ok); } .alerta-t { color: var(--warn); } .ruim-t { color: var(--bad); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }

.barra { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.barra > i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.barra.ok > i { background: var(--ok); } .barra.alerta > i { background: var(--warn); } .barra.ruim > i { background: var(--bad); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tabela-wrap { overflow-x: auto; }

.alerta-box { padding: 12px 14px; border-radius: 8px; background: var(--warn-soft); color: var(--text); border-left: 4px solid var(--warn); }
.info-box { padding: 12px 14px; border-radius: 8px; background: var(--primary-soft); border-left: 4px solid var(--primary); }
.msgs { list-style: none; padding: 0; margin: 0 0 16px; }
.msgs li { padding: 10px 14px; border-radius: 8px; background: var(--primary-soft); margin-bottom: 8px; }
.msgs li.success { background: var(--ok-soft); } .msgs li.warning { background: var(--warn-soft); } .msgs li.error { background: var(--bad-soft); }

/* formulários */
label { font-weight: 600; font-size: .88rem; display: block; margin-bottom: 4px; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  color: var(--text); font: inherit; min-height: 38px;
}
textarea { min-height: 90px; resize: vertical; }
.campo { margin-bottom: 14px; }
.campo .helptext, .campo .help { font-size: .8rem; color: var(--muted); display: block; margin-top: 3px; }
.errorlist { color: var(--bad); margin: 4px 0; padding-left: 18px; font-size: .85rem; }
.filtros { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)) auto; gap: 10px; align-items: end; }
@media (max-width: 860px) { .filtros { grid-template-columns: 1fr 1fr; } }
.checks ul, ul.checks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks label, .radio label { font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.radio ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }

/* questões */
.questao .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; align-items: center; }
.enunciado { font-size: 1rem; }
.enunciado blockquote { margin: .6em 0; padding: .6em 1em; border-left: 3px solid var(--border); background: var(--surface-2); border-radius: 0 8px 8px 0; }
.enunciado table, .md table { margin: .6em 0; font-size: .92rem; }
.alts { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.alt {
  display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; background: var(--surface); font-weight: 400; margin: 0;
}
.alt:hover { background: var(--surface-2); }
.alt input { position: absolute; opacity: 0; pointer-events: none; }
.alt .letra {
  flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--border); display: grid;
  place-items: center; font-weight: 700; font-size: .85rem;
}
.alt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.alt:has(input:checked) .letra { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.alt:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.alt.certa { border-color: var(--ok); background: var(--ok-soft); }
.alt.certa .letra { background: var(--ok); color: #fff; border-color: var(--ok); }
.alt.errada { border-color: var(--bad); background: var(--bad-soft); }
.alt.errada .letra { background: var(--bad); color: #fff; border-color: var(--bad); }
.alt.riscada .txt { text-decoration: line-through; opacity: .5; }
.alt .riscar { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .8rem; padding: 2px 4px; }
.alt p { margin: 0; }
.comentario { margin-top: 16px; padding: 14px 16px; border-radius: 8px; background: var(--surface-2); }
.veredito { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }

/* simulado */
.sim-bar {
  position: sticky; top: 0; z-index: 15; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; box-shadow: var(--shadow);
}
@media (max-width: 860px) { .sim-bar { top: 53px; } }
.relogio { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.relogio.fim { color: var(--bad); }
.mapa { display: flex; flex-wrap: wrap; gap: 4px; }
.mapa a {
  width: 30px; height: 28px; display: grid; place-items: center; border-radius: 6px; font-size: .75rem; font-weight: 600;
  background: var(--surface-2); color: var(--muted); text-decoration: none;
}
.mapa a.resp { background: var(--primary); color: var(--primary-ink); }
.mapa a.certa { background: var(--ok); color: #fff; } .mapa a.errada { background: var(--bad); color: #fff; }
.secao-sim { margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--border); }
.num-q { font-weight: 700; color: var(--muted); }

/* resumos */
.md h3 { margin-top: 1.2em; }
.md table { border: 1px solid var(--border); }
.md th, .md td { border: 1px solid var(--border); }
.md ul, .md ol { padding-left: 1.3em; }
.md li { margin: .2em 0; }
.md p:has(strong:only-child) { margin-bottom: .3em; }
details.topico { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 10px; }
details.topico > summary { cursor: pointer; padding: 12px 16px; display: flex; gap: 10px; align-items: center; list-style: none; }
details.topico > summary::-webkit-details-marker { display: none; }
details.topico[open] > summary { border-bottom: 1px solid var(--border); }
details.topico .corpo { padding: 4px 18px 16px; }

/* cronograma */
.semana { margin-bottom: 18px; }
.semana h3 { font-size: .9rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dias { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.dia { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--surface); }
.dia.hoje { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.dia.passado { opacity: .6; }
.dia .data { font-weight: 700; font-size: .85rem; margin-bottom: 6px; display: flex; justify-content: space-between; }
.dia ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 5px; }
.dia li { font-size: .82rem; display: flex; gap: 6px; align-items: flex-start; line-height: 1.35; }
.dia li.feito { text-decoration: line-through; color: var(--muted); }
.dia.simulado { background: var(--primary-soft); }
.dia.revisao { background: var(--warn-soft); }

/* verticalizado */
.vert td:first-child { width: 36px; }
.vert input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); }
.vert tr.feito td.tit { color: var(--muted); text-decoration: line-through; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 400px; }
.login h1 { font-size: 1.3rem; }

svg.grafico { width: 100%; height: auto; display: block; }
svg.grafico text { fill: var(--muted); font-size: 11px; }
svg.grafico .linha { fill: none; stroke: var(--primary); stroke-width: 2.5; }
svg.grafico .pt { fill: var(--primary); }
svg.grafico .corte { stroke: var(--ok); stroke-dasharray: 4 4; stroke-width: 1.5; }
svg.grafico .grade { stroke: var(--border); stroke-width: 1; }

@media print {
  .side, .topbar, .sim-bar, .btn { display: none !important; }
  .main { padding: 0; }
  .card { box-shadow: none; }
}

/* visão executiva */
.prio { padding: 12px 0; border-bottom: 1px solid var(--border); }
.prio:last-child { border-bottom: 0; padding-bottom: 0; }
.motivos { margin: 6px 0 8px; padding-left: 18px; font-size: .88rem; color: var(--muted); }
.txt-pri { color: var(--text); }
.acoes { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.acoes li { padding-left: 4px; }
.acoes li > span { margin-right: 8px; }
.meta-bar { position: relative; }
.meta-bar .marca { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text); opacity: .55; border-radius: 1px; }
.mapa-prio td { vertical-align: middle; }
.mapa-prio td.num { white-space: nowrap; }
