/* ============================================================
   AAULO Votos — sistema visual
   Linguagem de ferramenta (referência: solartecnica): fonte do sistema,
   pesos 600/500/400, base 14px, bordas de 1px, raios pequenos. O vermelho
   da AAULO é acento — botão principal, foco e opção escolhida —, nunca fundo.
   Tema escuro desenhado (não invertido). Sem framework.
   ============================================================ */

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  color-scheme: light;
  --ink-50:  #f8fafc;
  --ink-100: #f1f5f9;
  --ink-200: #e2e8f0;
  --ink-300: #cbd5e1;
  --ink-400: #94a3b8;
  --ink-500: #64748b;
  --ink-600: #475569;
  --ink-700: #334155;
  --ink-800: #1e293b;
  --ink-900: #0f172a;

  --bg:       var(--ink-50);
  --surface:  #ffffff;
  /* Um passo a partir de `surface`: cabeçalho de tabela, linha sob o rato.
     Afasta-se do cartão em cada tema (no claro escurece, no escuro clareia). */
  --elevated: #f8fafc;
  --border:   var(--ink-200);
  --border-strong: var(--ink-300);
  --text:     var(--ink-900);
  --muted:    var(--ink-600);
  --soft:     var(--ink-500);

  --brand:       #c8102e;
  --brand-hover: #a50e26;
  --brand-text:  #b00e28;
  --brand-50:    #fff1f2;
  --brand-200:   #fecdd3;
  /* Acessibilidade (medido): foco, opção escolhida e bordas de campos com >= 3:1 */
  --focus:        #c8102e;
  --choice-on:    var(--brand);
  --field-border: var(--ink-500);

  --ok:   #047857; --ok-bg:   #ecfdf5; --ok-ring:   #a7f3d0;
  --warn: #b45309; --warn-bg: #fffbeb; --warn-ring: #fde68a;
  --err:  #b91c1c; --err-bg:  #fef2f2; --err-ring:  #fecaca;
  --info: #1d4ed8; --info-bg: #eff6ff; --info-ring: #bfdbfe;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  --r-sm: 6px; --r-md: 8px; --r-lg: 10px;
  --shadow-pop: 0 10px 30px -10px rgb(15 23 42 / .25), 0 0 0 1px var(--border);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --gutter: 16px;
}
@media (min-width: 768px) { :root { --gutter: 24px; } }

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink-50:  #0f141c;
    --ink-100: #1a2230;
    --ink-200: #2b3546;
    --ink-300: #3a4558;
    --ink-400: #7a8698;
    --ink-500: #94a1b5;
    --ink-600: #adb8c9;
    --ink-700: #c3ccd9;
    --ink-800: #dfe5ee;
    --ink-900: #f1f5f9;
    --surface:  #161d29;
    --elevated: #1d2534;
    --brand-text: #fb7185;
    --brand-50:   rgb(244 63 94 / .10);
    --brand-200:  rgb(244 63 94 / .35);
    --focus:        #fb7185;
    --choice-on:    #fb7185;
    --field-border: var(--ink-400);
    --ok:   #4ade80; --ok-bg:   rgb(34 197 94 / .10);  --ok-ring:   rgb(34 197 94 / .30);
    --warn: #fbbf24; --warn-bg: rgb(245 158 11 / .10); --warn-ring: rgb(245 158 11 / .30);
    --err:  #f87171; --err-bg:  rgb(239 68 68 / .10);  --err-ring:  rgb(239 68 68 / .30);
    --info: #93c5fd; --info-bg: rgb(59 130 246 / .10); --info-ring: rgb(59 130 246 / .30);
    --shadow-pop: 0 16px 40px -12px rgb(0 0 0 / .7), 0 0 0 1px var(--border);
  }
}

/* ── Base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
img, svg { display: block; max-width: 100%; }
input, button, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1 { font-size: 1.5rem; line-height: 1.25; font-weight: 600; letter-spacing: -.015em; text-wrap: balance; }
h2 { font-size: 1rem; line-height: 1.4; font-weight: 600; }
h3 { font-size: .875rem; font-weight: 600; }
.h2 { font-size: 1.125rem; font-weight: 600; }
p { max-width: 72ch; }
strong { font-weight: 600; }
code { font-family: var(--mono); font-size: .9em; }
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
::selection { background: color-mix(in srgb, var(--brand) 25%, transparent); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); font-size: .925em; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.eyebrow { font-size: 12px; font-weight: 500; color: var(--soft); }
ul.stack { list-style: none; padding: 0; }
.stack--tight { --stack: .35rem; }
ol.stack { padding-left: 1.1rem; }
.stack > * + * { margin-top: var(--stack, .75rem); }
.row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.row--between { justify-content: space-between; align-items: flex-start; gap: 1rem; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { text-align: center; }
.center p { margin-inline: auto; }
.nowrap { white-space: nowrap; }
.align-end { align-self: end; }

/* Scrollbars finas no tom do tema */
.table-wrap, .menu__list, .code-block {
  scrollbar-width: thin;
  scrollbar-color: var(--ink-400) transparent;
}
.table-wrap::-webkit-scrollbar { height: 8px; width: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--ink-400); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }

/* ── Movimento: orienta, não decora ─────────────────────────── */
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop-in  { from { opacity: 0; transform: scale(.97) translateY(4px); } to { opacity: 1; transform: none; } }
.page > .wrap, .auth__panel { animation: fade-up .3s var(--ease) both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── Estrutura ──────────────────────────────────────────────── */
.wrap { width: 100%; max-width: 1080px; margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: calc(640px + 2 * var(--gutter)); }
.page { flex: 1 0 auto; padding-block: 1.75rem 3rem; }
@media (min-width: 768px) { .page { padding-block: 2.5rem 4rem; } }

.topbar { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar__inner { display: flex; align-items: center; gap: 1rem; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 600; font-size: 14px; }
.brand:hover { text-decoration: none; }
.brand img { height: 26px; width: auto; }
.brand__name span { color: var(--soft); font-weight: 500; }
.topnav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.topnav form { display: contents; }
.topnav a, .topnav button {
  display: inline-flex; align-items: center; gap: .4rem; height: 32px; padding: 0 .65rem;
  border: 0; border-radius: var(--r-sm); background: none;
  font-size: 13px; font-weight: 500; color: var(--muted); transition: background .15s, color .15s;
}
.topnav a:hover, .topnav button:hover { background: var(--ink-100); color: var(--text); text-decoration: none; }
.topnav a[aria-current="page"] { color: var(--text); background: var(--ink-100); }
.topnav .hide-sm { display: none; }
@media (min-width: 720px) { .topnav .hide-sm { display: inline-flex; } }
.who { display: none; font-size: 12px; color: var(--soft); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 .5rem 0 .75rem; border-left: 1px solid var(--border); margin-left: .25rem; }
@media (min-width: 900px) { .who { display: block; } }
@media (max-width: 479px) {
  .topnav a span, .topnav button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .topnav a, .topnav button { padding: 0 .5rem; }
}

/* Navegação do admin: separadores com sublinhado */
.admin-strip { background: var(--surface); border-bottom: 1px solid var(--border); }
.admin-strip .wrap { display: flex; gap: 1.25rem; overflow-x: auto; scrollbar-width: none; }
.admin-strip a { display: inline-flex; align-items: center; gap: .4rem; padding: .7rem 0; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; }
.admin-strip a:hover { color: var(--text); text-decoration: none; }
.admin-strip a[aria-current="page"] { color: var(--text); border-bottom-color: var(--brand); }
.admin-strip .tag { display: none; }

.footer { margin-top: auto; border-top: 1px solid var(--border); background: var(--surface); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; padding-block: 1.25rem; font-size: 12px; color: var(--soft); }
.footer__brand { display: flex; align-items: center; gap: .6rem; }
.footer__brand img { height: 22px; width: auto; }
.footer__brand strong { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.footer__brand small { display: block; font-size: 12px; }
.footer__links { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.footer a { color: var(--soft); }
.footer a:hover { color: var(--text); }

/* ── Botões ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  height: 36px; padding: 0 .9rem; border-radius: var(--r-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--elevated); border-color: var(--ink-400); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { background: var(--ink-100); border-color: transparent; color: var(--text); }
.btn--danger { color: var(--err); }
.btn--danger:hover { background: var(--err-bg); border-color: var(--err-ring); }
.btn--block { width: 100%; }
.btn--lg { height: 44px; padding: 0 1.25rem; font-size: 14px; }
.btn--sm { height: 30px; padding: 0 .65rem; font-size: 12px; }
.back { display: inline-flex; align-items: center; gap: .35rem; font-size: 13px; font-weight: 500; color: var(--soft); margin-bottom: 1.25rem; }
.back:hover { color: var(--text); text-decoration: none; }

/* ── Cartões ────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.card__body { padding: 1.25rem; }
@media (min-width: 640px) { .card__body { padding: 1.5rem; } }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .85rem 1.25rem; border-bottom: 1px solid var(--border); }
@media (min-width: 640px) { .card__head { padding-inline: 1.5rem; } }
.card__head h2 { font-size: 14px; }
.card--flat { background: var(--elevated); }
.card--narrow { max-width: 400px; margin-inline: auto; }

/* ── Badges: anel, não ponto ────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; height: 22px; padding: 0 .5rem;
  border-radius: var(--r-sm); background: var(--ink-100); color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--border);
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge .icon { width: 12px; height: 12px; }
.badge--live  { background: var(--ok-bg);   color: var(--ok);   box-shadow: inset 0 0 0 1px var(--ok-ring); }
.badge--brand { background: var(--brand-50); color: var(--brand-text); box-shadow: inset 0 0 0 1px var(--brand-200); }
.badge--warn  { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-ring); }
.badge--info  { background: var(--info-bg); color: var(--info); box-shadow: inset 0 0 0 1px var(--info-ring); }

/* ── Alertas ────────────────────────────────────────────────── */
.alert { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .9rem; border-radius: var(--r-md); font-size: 13px; box-shadow: inset 0 0 0 1px var(--border); background: var(--elevated); }
.alert .icon { margin-top: 1px; }
.alert > div { color: var(--text); }
.alert--error { background: var(--err-bg);  box-shadow: inset 0 0 0 1px var(--err-ring);  color: var(--err); }
.alert--ok    { background: var(--ok-bg);   box-shadow: inset 0 0 0 1px var(--ok-ring);   color: var(--ok); }
.alert--warn  { background: var(--warn-bg); box-shadow: inset 0 0 0 1px var(--warn-ring); color: var(--warn); }
.alert--info  { background: var(--info-bg); box-shadow: inset 0 0 0 1px var(--info-ring); color: var(--info); }

/* ── Formulários ────────────────────────────────────────────── */
.field { display: grid; gap: .35rem; }
.field > label, .label { font-size: 13px; font-weight: 500; }
.hint { font-size: 12px; color: var(--soft); }
.field-error { font-size: 12px; color: var(--err); }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 .75rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--field-border); border-radius: var(--r-sm);
  font-size: 14px; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 88px; padding: .55rem .75rem; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--ink-400); }
.input[aria-invalid="true"] { border-color: var(--err); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
@media (max-width: 767px) { .input, .select, .textarea { font-size: 16px; } } /* sem zoom no iOS */
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: 13px; }
.check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.form-grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } }

/* ── Entrada ────────────────────────────────────────────────── */
.auth { flex: 1 0 auto; display: grid; place-items: center; padding: 3rem var(--gutter); }
.auth__panel { width: 100%; max-width: 380px; }
.auth__logo { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: 15px; margin-bottom: 1.75rem; }
.auth__logo img { height: 32px; width: auto; }
.auth__points { list-style: none; padding: 0; margin-top: 1.25rem; display: grid; gap: .5rem; font-size: 12px; color: var(--soft); }
.auth__points li { display: flex; gap: .5rem; align-items: flex-start; }
.auth__points .icon { width: 14px; height: 14px; margin-top: 2px; }

/* ── Cabeçalho de página ────────────────────────────────────── */
.page-head { margin-bottom: 1.5rem; }
.page-head h1 { margin-top: .35rem; }
.page-head p { margin-top: .35rem; color: var(--muted); }
.section-title { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--soft); margin: 2rem 0 .65rem; }

/* ── Listas de votações ─────────────────────────────────────── */
.vote-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.vote-item { display: flex; gap: 1rem; align-items: center; padding: .9rem 1.25rem; color: inherit; border-top: 1px solid var(--border); transition: background .15s; }
.vote-item:first-child { border-top: 0; }
a.vote-item:hover { background: var(--elevated); text-decoration: none; }
.vote-item__main { flex: 1; min-width: 0; }
.vote-item__title { font-weight: 500; font-size: 14px; }
.vote-item__meta { font-size: 12px; color: var(--soft); margin-top: .15rem; display: flex; flex-wrap: wrap; gap: .15rem .6rem; align-items: center; }
.vote-item__meta .icon { width: 12px; height: 12px; }
.vote-item__cta { flex: none; }
.vote-item .bar { margin-top: .5rem; max-width: 320px; }
@media (max-width: 559px) { .vote-item { flex-direction: column; align-items: stretch; } .vote-item__cta .btn { width: 100%; } }

.empty { text-align: center; padding: 2rem 1.25rem; border: 1px dashed var(--border-strong); border-radius: var(--r-lg); color: var(--soft); font-size: 13px; }
.empty .icon { width: 20px; height: 20px; margin: 0 auto .5rem; }
.empty strong { display: block; color: var(--text); font-weight: 500; font-size: 14px; }

/* ── Boletim ────────────────────────────────────────────────── */
.ballot { border: 0; padding: 0; display: grid; gap: .5rem; min-width: 0; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice__box {
  display: flex; gap: .75rem; align-items: center; min-height: 52px; padding: .75rem 1rem;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.choice__box:hover { border-color: var(--ink-400); }
.choice__dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--field-border); flex: none; display: grid; place-items: center; background: var(--surface); }
.choice__dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--choice-on); transform: scale(0); transition: transform .15s var(--ease); }
.choice__label { font-size: 15px; font-weight: 500; line-height: 1.35; }
.choice__desc { display: block; font-size: 13px; color: var(--soft); font-weight: 400; }
.choice input:checked + .choice__box { border-color: var(--choice-on); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--choice-on); }
.choice input:checked + .choice__box .choice__dot { border-color: var(--choice-on); }
.choice input:checked + .choice__box .choice__dot::after { transform: scale(1); }
.choice input:focus-visible + .choice__box { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice--blank .choice__label { color: var(--muted); font-weight: 400; font-size: 14px; }
.ballot--yesno { grid-template-columns: 1fr 1fr; }
.ballot--yesno .choice__box { min-height: 64px; justify-content: center; }
.ballot--yesno .choice__label { font-size: 16px; }
.ballot--yesno .choice--blank { grid-column: 1 / -1; }
.ballot--yesno .choice--blank .choice__box { min-height: 44px; }
.ballot-or { display: flex; align-items: center; gap: .75rem; font-size: 12px; color: var(--soft); margin: .25rem 0; }
.ballot-or::before, .ballot-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.more { margin-top: .35rem; font-size: 13px; }
.more summary { cursor: pointer; color: var(--muted); font-weight: 500; list-style: none; display: inline-flex; align-items: center; gap: .25rem; }
.more summary::-webkit-details-marker { display: none; }
.more summary .icon { width: 14px; height: 14px; transition: transform .15s; }
.more[open] summary .icon { transform: rotate(90deg); }
.more__body { margin-top: .5rem; padding: .75rem; border-radius: var(--r-md); background: var(--elevated); white-space: pre-line; color: var(--muted); }
.more__body img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--r-sm); margin-bottom: .5rem; }
.secret-note { display: flex; gap: .4rem; align-items: center; justify-content: center; font-size: 12px; color: var(--soft); margin-top: .9rem; text-align: center; }
.secret-note .icon { width: 14px; height: 14px; }

.dialog { margin: auto; border: 0; padding: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); width: min(420px, calc(100vw - 2 * var(--gutter))); }
.dialog::backdrop { background: rgb(15 23 42 / .5); }
.dialog[open] { animation: pop-in .2s var(--ease); }
.dialog__body { padding: 1.25rem 1.25rem 1rem; }
.dialog__body h2 { font-size: 16px; }
.dialog__choice { margin: .85rem 0; padding: .75rem 1rem; border-radius: var(--r-md); background: var(--elevated); box-shadow: inset 0 0 0 1px var(--border); font-size: 15px; font-weight: 600; }
.dialog__actions { display: flex; flex-direction: column-reverse; gap: .5rem; padding: 0 1.25rem 1.25rem; }
@media (min-width: 480px) { .dialog__actions { flex-direction: row; justify-content: flex-end; } }

/* ── Recibo ─────────────────────────────────────────────────── */
.receipt-ok { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok-ring); margin-bottom: .75rem; }
.receipt-ok .icon { width: 18px; height: 18px; }
.ticket { border: 1px solid var(--border); border-radius: var(--r-md); padding: .9rem 1rem; background: var(--elevated); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.ticket__code { font-family: var(--mono); font-size: 17px; font-weight: 600; letter-spacing: .06em; word-break: break-all; }
.dl { display: grid; grid-template-columns: auto 1fr; font-size: 13px; }
.dl dt, .dl dd { padding: .55rem 0; border-top: 1px solid var(--border); }
.dl dt:first-of-type, .dl dd:first-of-type { border-top: 0; }
.dl dt { color: var(--soft); padding-right: 1rem; }
.dl dd { margin: 0; text-align: right; font-weight: 500; }

/* ── Números e resultados ───────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: .9rem 1.1rem; }
.stat__value { font-size: 1.375rem; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.3; }
.stat__label { font-size: 12px; color: var(--soft); }
.stat__value--muted { color: var(--soft); font-size: 1rem; font-weight: 500; line-height: 1.9; }
.result { padding: .85rem 0; border-top: 1px solid var(--border); }
.result:first-child { border-top: 0; padding-top: 0; }
.result:last-child { padding-bottom: 0; }
.result__head { display: flex; align-items: baseline; gap: 1rem; justify-content: space-between; }
.result__label { font-weight: 500; font-size: 14px; }
.result__pct { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.result__votes { font-size: 12px; color: var(--soft); text-align: right; }
.bar { height: 6px; background: var(--ink-100); border-radius: 999px; overflow: hidden; margin-top: .5rem; }
.bar > span { display: block; height: 100%; width: var(--w, 0%); background: var(--ink-400); border-radius: inherit; transition: width .7s var(--ease); }
.result--win .bar > span { background: var(--brand); }
.result--blank .result__label { color: var(--muted); font-weight: 400; }
.sealed { text-align: center; padding: 1.75rem 1rem; }
.sealed .icon { width: 20px; height: 20px; margin: 0 auto .6rem; color: var(--soft); }
.hash { font-family: var(--mono); font-size: 12px; word-break: break-all; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: .5rem .65rem; }
.hash--lg { font-size: 18px; letter-spacing: .08em; text-align: center; padding: .75rem; }

/* ── Tabelas ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 12px; font-weight: 500; letter-spacing: .03em; text-transform: uppercase; color: var(--soft); padding: .6rem 1rem; background: var(--elevated); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .65rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--elevated); }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions form { display: inline; }

/* ── Admin ──────────────────────────────────────────────────── */
.option-row { display: grid; gap: .5rem; padding: .85rem; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--elevated); }
.option-row__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.menu { position: relative; }
.menu__list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 210px; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-pop); padding: .3rem; animation: pop-in .15s var(--ease); }
.menu__list a { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; border-radius: var(--r-sm); color: var(--text); font-size: 13px; }
.menu__list a:hover { background: var(--ink-100); text-decoration: none; }
.pager { display: flex; justify-content: center; align-items: center; gap: .35rem; margin-top: 1rem; flex-wrap: wrap; }
.dropzone { border: 1px dashed var(--border-strong); border-radius: var(--r-md); padding: 1rem; background: var(--elevated); }
.dropzone input[type=file] { max-width: 100%; font-size: 13px; }
.code-block { font-family: var(--mono); font-size: 12px; background: var(--elevated); border: 1px solid var(--border); border-radius: var(--r-sm); padding: .65rem .8rem; overflow-x: auto; white-space: pre; }

/* ── Espaço ─────────────────────────────────────────────────── */
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: .75rem; } .mt-3 { margin-top: 1.25rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: .75rem; } .mb-3 { margin-bottom: 1.25rem; } .mb-4 { margin-bottom: 2rem; }
.gap-sm { gap: .4rem; }
.grid-2 { display: grid; gap: .75rem; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* Campos de ficheiro com o botão no estilo da casa */
input[type=file] { font-size: 13px; color: var(--muted); max-width: 100%; }
input[type=file].input { height: auto; padding: .35rem; }
input[type=file]::file-selector-button {
  margin-right: .75rem; height: 30px; padding: 0 .75rem; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--elevated); color: var(--text); font: inherit; font-weight: 500;
}
input[type=file]::file-selector-button:hover { border-color: var(--ink-400); }
/* Valores longos (impressões digitais) num cartão de número */
.stat__value.mono { font-size: 14px; font-weight: 500; line-height: 1.9; word-break: break-all; letter-spacing: .02em; }

/* ── Página de entrada: dois painéis ────────────────────────────
   Painel da marca em vermelho AAULO à esquerda, formulário à direita.
   Mesma tipografia sóbria do resto (600 máx.); a cor faz o trabalho. */
.split { flex: 1 0 auto; display: grid; min-height: 100dvh; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.split__brand {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: 1.5rem;
  padding: 1.5rem var(--gutter) 1.75rem;
  color: #fff;
  /* Ardósia escura como no desenho original, com luz vermelha da AAULO a nascer do canto */
  background:
    radial-gradient(120% 80% at 0% 100%, rgb(200 16 46 / .55) 0%, rgb(200 16 46 / .18) 35%, transparent 65%),
    radial-gradient(70% 50% at 100% 0%, rgb(56 76 120 / .45) 0%, transparent 70%),
    linear-gradient(160deg, #0f172a 0%, #0b1120 55%, #120a14 100%);
}
.split__brand::before { /* grelha de pontos que se desvanece para baixo */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgb(255 255 255 / .10) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 75%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 75%);
}
.split__brand::after { /* escudo em marca de água, cortado pelo canto */
  content: ""; position: absolute; z-index: -1; right: -90px; bottom: -110px; width: 420px; height: 460px;
  background: url("../img/escudo-mono.svg") no-repeat center / contain; opacity: .05;
}
@media (min-width: 900px) { .split__brand { padding: 2.5rem 3rem; justify-content: space-between; box-shadow: inset -1px 0 0 rgb(255 255 255 / .06); } }
.split__logo { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: 15px; }
.split__logo img { height: 32px; width: auto; }
.split__intro h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; max-width: 18ch; }
@media (min-width: 900px) { .split__intro h1 { font-size: 2rem; } }
.split__intro p { margin-top: .5rem; color: #94a3b8; font-size: 14px; }
.split__points { display: none; list-style: none; padding: 0; gap: 1rem; max-width: 380px; }
@media (min-width: 900px) { .split__points { display: grid; } }
.split__points li { display: flex; gap: .75rem; align-items: flex-start; }
.split__points .icon {
  width: 32px; height: 32px; padding: 8px; flex: none; border-radius: var(--r-md);
  color: #fda4af; background: rgb(255 255 255 / .05); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .10);
}
.split__points strong { display: block; font-size: 14px; font-weight: 600; }
.split__points span { display: block; font-size: 13px; color: #94a3b8; }
.split__form { display: flex; align-items: center; justify-content: center; padding: 2.5rem var(--gutter) 3rem; background: var(--surface); }
.split__panel { width: 100%; max-width: 360px; animation: fade-up .3s var(--ease) both; }
.split__links { display: flex; gap: .5rem; margin-top: 2rem; }
.split__links a { color: var(--soft); }
.split__links a:hover { color: var(--text); }

/* ── Verificações (apuramento, ata, painel do dia) ─────────── */
.checks { list-style: none; padding: 0; display: grid; gap: .5rem; }
.checks__item { display: flex; gap: .6rem; align-items: flex-start; font-size: 13px; }
.checks__item > div { display: grid; gap: .1rem; }
.checks__item .icon { margin-top: 2px; }
.checks__item--ok .icon { color: var(--ok); }
.checks__item--bad .icon { color: var(--err); }
.checks__item--bad strong { color: var(--err); }
.checks__item--na .icon { color: var(--soft); }

/* ── Ata (imprimível) ───────────────────────────────────────── */
.ata .table tbody th { font-weight: 500; text-align: left; width: 45%; text-transform: none; letter-spacing: 0; white-space: normal; background: none; font-size: 13px; color: var(--muted); }
.ata__lines { display: grid; gap: 1.6rem; margin-top: 1.25rem; }
.ata__lines span { border-bottom: 1px solid var(--border-strong); height: 1px; }
.ata__signs { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 3rem; font-size: 12px; color: var(--muted); text-align: center; }
.ata__signs span { display: block; border-top: 1px solid var(--text); margin-bottom: .35rem; }
@media print {
  :root { color-scheme: light; }
  body { background: #fff !important; color: #000; }
  .topbar, .admin-strip, .footer, .no-print, .sr-only { display: none !important; }
  .card { border: 0; box-shadow: none; break-inside: avoid; }
  .page { padding: 0; }
  a { color: inherit; text-decoration: none; }
}

/* ── "Saltar para o conteúdo" visível ao receber foco (WCAG 2.4.7) ── */
html { scroll-padding-top: 64px; } /* o cabeçalho fixo não tapa o elemento focado (2.4.11) */
.sr-only:focus { position: fixed; top: 8px; left: 8px; width: auto; height: auto; padding: .5rem .75rem; margin: 0;
  clip: auto; overflow: visible; white-space: normal; z-index: 100; background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm); box-shadow: var(--shadow-pop); }

/* Campo + botão na mesma linha (pesquisas): o .input tem width:100% e empurrava o botão */
.row > .input.grow { width: auto; flex: 1 1 220px; }
/* Números dentro de um cartão: cabem lado a lado */
.card .stats { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
/* Ata: hashes e detalhes da auditoria quebram dentro do cartão; datas numa linha */
.ata .table { table-layout: auto; }
.ata .table td { overflow-wrap: anywhere; }
.ata .mono { word-break: break-all; }
.ata .table td.num { white-space: nowrap; }
.ata .table td.ata__who { white-space: nowrap; overflow-wrap: normal; }
/* Ata no telemóvel: cada linha da cronologia é um bloco (quando · quem, depois o quê) */
@media (max-width: 639px) {
  .ata__timeline thead { display: none; }
  .ata__timeline tr { display: grid; grid-template-columns: auto 1fr; gap: .1rem .75rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
  .ata__timeline td { display: block; border: 0 !important; padding: 0 1rem !important; }
  .ata__timeline td:nth-child(2) { grid-column: 1 / -1; order: 3; }
  .ata__timeline td.ata__who { text-align: right; color: var(--soft); }
}
/* Tabelas no telemóvel: colunas e ações secundárias saem (ficam no "Gerir") */
@media (max-width: 559px) { .hide-narrow { display: none !important; } }
