/* Componentes compartilhados entre a página da assembleia e o painel. */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: var(--font-size); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); line-height: var(--line-height);
  color: var(--ink); background: var(--background);
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.5rem, 4vw, 2rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--brand); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.pre { white-space: pre-line; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Estrutura */
.topbar { background: var(--brand); color: var(--on-brand); }
.topbar .inner { max-width: var(--content-width); margin: 0 auto; padding: 12px var(--space); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: .02em; color: inherit; text-decoration: none; }
.brand small { font-weight: 400; opacity: .85; margin-left: 6px; }
.topbar nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a, .topbar nav button { color: var(--on-brand); background: transparent; border: 0; padding: 6px 10px; border-radius: var(--radius-small); text-decoration: none; font: inherit; cursor: pointer; }
.topbar nav a[aria-current="page"], .topbar nav a:hover, .topbar nav button:hover { background: rgba(255, 255, 255, .15); }
.container { max-width: var(--content-width); margin: 0 auto; padding: var(--space); }
.narrow { max-width: 640px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: calc(var(--space) * 1.25); box-shadow: var(--shadow); margin-bottom: var(--space); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.grow { flex: 1 1 240px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px var(--space); }

/* Formulários */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field label { font-weight: 600; }
.field .hint { font-size: .85rem; color: var(--muted); }
input[type="text"], input[type="password"], input[type="search"], input[type="number"], input[type="datetime-local"], input[type="url"], input[inputmode], textarea, select {
  font: inherit; width: 100%; padding: 10px 12px; border: 1px solid #c9cccf; border-radius: var(--radius-small);
  background: var(--surface); color: var(--ink); min-height: 44px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: none; box-shadow: var(--focus); border-color: var(--brand); }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); background: var(--danger-soft); }
.field-error { color: var(--danger); font-size: .875rem; font-weight: 600; min-height: 0; }
.field-error:empty { display: none; }
.check { display: flex; gap: 8px; align-items: flex-start; }
.check input { width: 20px; height: 20px; margin-top: 2px; }

/* Botões */
.btn {
  font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 16px; border-radius: var(--radius-small); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; background: var(--brand); color: var(--on-brand);
}
.btn:hover { background: var(--brand-strong); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: #c9cccf; }
.btn.secondary:hover { background: var(--background); }
.btn.danger { background: var(--danger); }
.btn.ghost { background: transparent; color: var(--brand); padding-inline: 8px; }
.btn.small { min-height: 34px; padding: 6px 10px; font-size: .875rem; }
.btn.block { width: 100%; }

/* Avisos e selos */
.notice { border-radius: var(--radius-small); padding: 12px 14px; margin-bottom: var(--space); border: 1px solid transparent; }
.notice.info { background: var(--info-soft); color: var(--info); border-color: #c8d9f2; }
.notice.success { background: var(--success-soft); color: var(--success); border-color: #bfe3ca; }
.notice.warning { background: var(--warning-soft); color: var(--warning); border-color: #f1dc9c; }
.notice.error { background: var(--danger-soft); color: var(--danger); border-color: #f3c3bf; }
.badge { display: inline-block; font-size: .8rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--background); color: var(--muted); border: 1px solid var(--line); }
.badge.draft { background: var(--warning-soft); color: var(--warning); border-color: #f1dc9c; }
.badge.open { background: var(--success-soft); color: var(--success); border-color: #bfe3ca; }
.badge.closed { background: #eceeef; color: #3d4349; }
.badge.present { background: var(--success-soft); color: var(--success); border-color: #bfe3ca; }

/* Tabelas */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-small); }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .925rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--background); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.nowrap { white-space: nowrap; }

/* Estatísticas */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: var(--space); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat strong { display: block; font-size: 1.75rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .875rem; }

/* Resultados de votação */
.bar { height: 10px; background: var(--background); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.bar > span { display: block; height: 100%; background: var(--brand); width: 0; transition: width .3s; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-small); box-shadow: var(--shadow); z-index: 100; max-width: calc(100% - 32px); }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 24px var(--space); }
.row > select { width: auto; flex: 0 1 220px; }
