/* Sistema de Pauta e Votação — estilos compartilhados.
   Sem fontes ou CDNs externos: funciona offline. As cores vêm de /tema.css (configuráveis). */
:root {
  /* valores padrão; /tema.css (carregado depois) os substitui conforme as Configurações */
  --primary: #16283f; --ink: #0e1927; --ink-2: #16283f; --ink-3: #324256; --ink-4: #495769;
  --brass: #b8913a; --brass-soft: #e4d5b4; --brass-dk: #53411a;
  --sim: #2f9a63; --sim-bg: #e6f3ec; --sim-deep: #173b37; --sim-tx: #7ec09e;
  --nao: #cc4a40; --nao-bg: #f9e9e8; --nao-deep: #3f262e; --nao-tx: #df8f89;
  --abs: #6f88ab; --abs-bg: #eef1f5; --abs-deep: #273649; --abs-tx: #a6b5cb;

  --bg: #f2f4f8; --card: #ffffff; --line: #e3e7ee; --line-2: #cfd6e1;
  --text: #121a29; --muted: #5b6577; --warn-bg: #fff4d9;
  --radius: 12px; --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 6px 20px rgba(16,24,40,.06);
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: var(--sans);   /* visual moderno: um só tipo de letra, números tabulares */
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); background: var(--bg); color: var(--text); line-height: 1.5;
  font-feature-settings: "tnum" 1, "cv11" 1; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--sans); font-weight: 750; margin: 0 0 .45em; line-height: 1.2; letter-spacing: -.015em; }
h1 { font-size: 1.65rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .7em; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.stack > * + * { margin-top: .8rem; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1.05rem; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--card); cursor: pointer; font-weight: 600; min-height: 40px; text-decoration: none; color: var(--text);
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; }
.btn:hover { border-color: #9aa6b8; background: #f8f9fc; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.btn.primary:hover { background: var(--ink-3); border-color: var(--ink-3); }
.btn.brass { background: var(--brass); border-color: var(--brass); color: #fff; }
.btn.sim { background: var(--sim); border-color: var(--sim); color: #fff; }
.btn.nao { background: var(--nao); border-color: var(--nao); color: #fff; }
.btn.abs { background: var(--abs); border-color: var(--abs); color: #fff; }
.btn.sim:hover, .btn.nao:hover, .btn.abs:hover, .btn.brass:hover { filter: brightness(1.07); background: inherit; }
.btn.danger { color: var(--nao); border-color: color-mix(in srgb, var(--nao) 35%, white); background: #fff; }
.btn.sm { padding: .25rem .7rem; min-height: 32px; font-size: .85rem; border-radius: 8px; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.lg { min-height: 52px; font-size: 1.05rem; padding: .7rem 1.4rem; }

/* formulários */
label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: .25rem; color: #2a3446; }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=number], input[type=email], input[type=tel], select, textarea {
  width: 100%; padding: .55rem .75rem; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; min-height: 42px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: 3px solid color-mix(in srgb, var(--brass) 35%, transparent); outline-offset: 0; }
input[type=color] { width: 56px; height: 42px; padding: 3px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; cursor: pointer; }
textarea { min-height: 90px; resize: vertical; }
.field { margin-bottom: .8rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; margin-bottom: .7rem; }
.check input { margin-top: .25rem; width: 18px; height: 18px; accent-color: var(--primary); }

/* cartões e etiquetas */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.badge { display: inline-flex; align-items: center; padding: .12rem .65rem; border-radius: 99px; font-size: .76rem; font-weight: 700; background: #e8ebf1; color: #3b4658; white-space: nowrap; }
.badge.aprovada, .badge.sim { background: var(--sim-bg); color: color-mix(in srgb, var(--sim) 70%, black); }
.badge.reprovada, .badge.nao { background: var(--nao-bg); color: color-mix(in srgb, var(--nao) 75%, black); }
.badge.empate, .badge.abs { background: var(--abs-bg); color: color-mix(in srgb, var(--abs) 65%, black); }
.badge.em_votacao { background: var(--primary); color: #fff; }
.badge.em_discussao { background: var(--brass-soft); color: var(--brass-dk); }
.badge.aberta { background: var(--sim-bg); color: color-mix(in srgb, var(--sim) 70%, black); }
.badge.agendada { background: var(--abs-bg); color: color-mix(in srgb, var(--abs) 65%, black); }
.badge.pres, .tag-pres { background: linear-gradient(180deg, #e3c06a, #c19a3e); color: #2a1f06; border: 1px solid #a88230; }
.tag-pres { display: inline-flex; align-items: center; padding: 0 .55em; border-radius: 99px; font-size: .78em; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; vertical-align: middle; margin-left: .35em; line-height: 1.5; }

/* avatar */
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--ink-3); color: #fff; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 700; flex: none; overflow: hidden; box-shadow: 0 0 0 2px rgba(255,255,255,.12); }
.avatar.lg { width: 72px; height: 72px; font-size: 1.5rem; }
.brasao { height: 44px; width: auto; max-width: 70px; object-fit: contain; flex: none; filter: drop-shadow(0 1px 3px rgba(0,0,0,.35)); }

/* barra de topo compartilhada (admin, vereador) */
.topo { background: linear-gradient(135deg, var(--ink-2), var(--ink)); color: #fff; box-shadow: 0 2px 14px rgba(0,0,0,.18); position: relative; }
.topo::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--brass), transparent 75%); }

/* toast e diálogo */
#toasts { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; z-index: 99; }
.toast { background: var(--ink); color: #fff; padding: .75rem 1.05rem; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.28); max-width: 340px; border-left: 4px solid var(--brass); }
.toast.erro { background: #8f2a22; border-left-color: #ffb4ab; }
dialog { border: 0; border-radius: 20px; padding: 0; width: min(640px, 94vw); max-height: 92vh; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
dialog::backdrop { background: rgba(8,14,24,.6); backdrop-filter: blur(3px); }
dialog .dlg-h { padding: 1.05rem 1.3rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
dialog .dlg-h h2 { margin: 0; }
dialog .dlg-b { padding: 1.3rem; overflow: auto; max-height: calc(92vh - 140px); }
dialog .dlg-f { padding: .95rem 1.3rem; border-top: 1px solid var(--line); display: flex; gap: .6rem; justify-content: flex-end; background: #f8f9fc; border-radius: 0 0 20px 20px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .65rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .76rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:last-child td { border-bottom: 0; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* faixa de modo treinamento */
.faixa-treino { position: sticky; top: 0; z-index: 60; background: #b45309; color: #fff; text-align: center; font-weight: 800; padding: .35rem .8rem; font-size: .9rem; letter-spacing: .02em; }
.faixa-treino.hidden { display: none; }
.emenda-ind { margin-left: 1.4rem; border-left: 3px solid var(--brass, #b8893a); padding-left: .6rem; }
.badge.destaque { background: #fde68a; color: #78350f; }
details.aus { margin-top: .7rem; border-top: 1px solid var(--line, #d9dee8); padding-top: .5rem; }
details.aus > summary { cursor: pointer; font-weight: 700; padding: .25rem 0; }

/* dentro da janela flutuante: o painel já oferece Fechar / Nova aba */
.embutido button[onclick="window.close()"], .embutido [data-voltar] { display: none !important; }
.embutido body { padding-top: .6rem; }
