/* Base C21 — camada classless própria (substitui o pico.classless.min.css,
   fase 5 do redesign, frente 1). Reset + estilos de ELEMENTOS NUS: tipografia,
   links, listas, tabelas, formulários, article/details. Sem seletor de classe
   aqui dentro (as classes do painel — .card, .tile, .navlink, etc. — vivem em
   painel.css).

   Carregado ANTES de painel.css (ver base.html/login.html): os tokens
   (--fundo-pagina, --texto-principal, --acento-default, --espaco-*, --raio-*,
   --font-ui, --font-num, --shadow) são definidos em painel.css, mas como a
   resolução de custom properties do CSS é dinâmica (feita à pintura, não à
   leitura do ficheiro), a ordem de carga não impede este ficheiro de os usar —
   importa apenas para que painel.css vença em empates de especificidade
   quando as duas folhas mexem no mesmo elemento (ex.: body).

   Zero-CDN: sem @import, sem tipos de letra remotos, sem URLs externos. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  color: var(--texto-principal);
  background: var(--fundo-pagina);
}

img, svg, video { max-width: 100%; display: block; }

/* ---------- tipografia ---------- */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .6em;
  font-weight: 640;
  letter-spacing: -.01em;
  line-height: 1.25;
  color: var(--texto-principal);
}
h1 { font-size: 1.7rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
h5, h6 { font-size: .9rem; }

p { margin: 0 0 1em; }
small { font-size: .85em; color: var(--texto-suave); }
strong, b { font-weight: 640; }

hr { border: none; border-top: 1px solid var(--linha-default); margin: var(--espaco-xl) 0; }
blockquote {
  margin: 0 0 1em;
  padding: var(--espaco-sm) var(--espaco-lg);
  border-left: 3px solid var(--linha-default);
  color: var(--texto-suave);
}
code, kbd, pre {
  font-family: var(--font-num);
  font-size: .9em;
  background: var(--fundo-superficie-2);
  border-radius: var(--raio-sm);
}
code, kbd { padding: .15em .4em; }
pre { padding: var(--espaco-md); overflow-x: auto; margin: 0 0 1em; }
pre code { padding: 0; background: none; }
mark {
  background: var(--acento-suave);
  color: var(--acento-default);
  padding: .05em .4em;
  border-radius: var(--raio-sm);
  font-weight: 600;
}

/* ---------- links ---------- */
a {
  color: var(--acento-default);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ---------- listas ---------- */
ul, ol { margin: 0 0 1em; padding-left: 1.4em; }
li { margin-bottom: .3em; }

/* ---------- details/summary ---------- */
details { margin: 0 0 var(--espaco-md); }
summary { cursor: pointer; font-weight: 600; color: var(--texto-principal); }

/* ---------- article (cartão genérico das páginas ainda não redesenhadas) ---- */
article {
  background: var(--fundo-superficie);
  border: 1px solid var(--linha-default);
  border-radius: var(--raio-lg);
  box-shadow: var(--shadow);
  padding: var(--espaco-xl);
  margin: 0 0 var(--espaco-lg);
}
article > header {
  margin: calc(var(--espaco-xl) * -1) calc(var(--espaco-xl) * -1) var(--espaco-lg);
  padding: var(--espaco-md) var(--espaco-xl);
  border-bottom: 1px solid var(--linha-suave);
  font-weight: 620;
}
article > footer {
  margin: var(--espaco-lg) calc(var(--espaco-xl) * -1) calc(var(--espaco-xl) * -1);
  padding: var(--espaco-md) var(--espaco-xl);
  border-top: 1px solid var(--linha-suave);
}

/* ---------- tabelas nuas ---------- */
table { width: 100%; border-collapse: collapse; margin: 0 0 1em; font-size: 14px; }
thead th { text-align: left; font-weight: 620; color: var(--texto-suave); border-bottom: 1px solid var(--linha-default); padding: 8px 10px; }
tbody td { padding: 8px 10px; border-bottom: 1px solid var(--linha-suave); }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- formulários ---------- */
label {
  display: block;
  margin: 0 0 var(--espaco-xs);
  font-size: 13.5px;
  font-weight: 550;
  color: var(--texto-principal);
}
label input, label select, label textarea { margin-top: var(--espaco-xs); }
/* Checkbox/radio: o rótulo embrulha o campo ("<label><input type=checkbox> Ativa</label>",
   padrão herdado do Pico e usado em várias páginas) — fica em linha, não em bloco. */
label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
  display: flex;
  align-items: center;
  gap: .45em;
  font-weight: 500;
}
label:has(> input[type="checkbox"]) input,
label:has(> input[type="radio"]) input { margin-top: 0; }

input, select, textarea {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 14.5px;
  color: var(--texto-principal);
  background: var(--fundo-superficie);
  border: 1px solid var(--linha-default);
  border-radius: var(--raio-sm);
  padding: 10px 13px;
  margin: 0 0 var(--espaco-md);
  transition: border-color .12s, box-shadow .12s;
}
input[type="checkbox"], input[type="radio"] {
  display: inline-block;
  width: auto;
  margin: 0;
  accent-color: var(--acento-default);
}
/* Interruptor (Gestão → Agendamentos usa <input type="checkbox" role="switch">):
   pílula deslizante em vez do quadrado nativo, como o Pico dava. */
input[type="checkbox"][role="switch"] {
  appearance: none;
  width: 2.25em;
  height: 1.25em;
  border: 1px solid var(--linha-default);
  border-radius: var(--raio-pilula);
  background: var(--fundo-superficie-2);
  position: relative;
  cursor: pointer;
  vertical-align: middle;
  transition: background .12s, border-color .12s;
}
input[type="checkbox"][role="switch"]::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: calc(1.25em - 4px);
  height: calc(1.25em - 4px);
  border-radius: 50%;
  background: var(--texto-tenue);
  transition: transform .12s, background .12s;
}
input[type="checkbox"][role="switch"]:checked {
  background: var(--acento-default);
  border-color: var(--acento-default);
}
input[type="checkbox"][role="switch"]:checked::before {
  transform: translateX(1em);
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--acento-default);
  box-shadow: 0 0 0 3px var(--acento-suave);
}
textarea { min-height: 90px; resize: vertical; }
select { appearance: auto; cursor: pointer; }
input::placeholder, textarea::placeholder { color: var(--texto-tenue); }
input:disabled, select:disabled, textarea:disabled { opacity: .6; cursor: not-allowed; }

fieldset {
  border: 1px solid var(--linha-default);
  border-radius: var(--raio-md);
  padding: var(--espaco-md) var(--espaco-lg);
  margin: 0 0 var(--espaco-md);
}
legend { padding: 0 .4em; font-weight: 620; font-size: 13px; color: var(--texto-suave); }

/* ---------- botões (default e primário) ---------- */
button, [role="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  font: inherit;
  font-size: 14px;
  font-weight: 620;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--acento-default);
  border-radius: var(--raio-pilula);
  padding: 10px 18px;
  background: var(--acento-default);
  color: var(--acento-contraste);
  transition: background .12s, border-color .12s, opacity .12s;
}
button:hover, [role="button"]:hover { opacity: .92; text-decoration: none; }
button:disabled, [role="button"][aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* Secundário: superfície com borda --linha-default, radius --raio-sm (não pílula). */
button.secondary, [role="button"].secondary {
  background: var(--fundo-superficie);
  color: var(--texto-principal);
  border-color: var(--linha-default);
  border-radius: var(--raio-sm);
}
button.secondary:hover, [role="button"].secondary:hover { background: var(--fundo-superficie-2); opacity: 1; }

/* Outline (usado sempre junto de .secondary nesta base de código): sem fundo. */
button.outline, [role="button"].outline {
  background: transparent;
  color: var(--acento-default);
}
button.secondary.outline, [role="button"].secondary.outline {
  background: transparent;
  color: var(--texto-suave);
  border-color: var(--linha-default);
}
button.secondary.outline:hover, [role="button"].secondary.outline:hover { background: var(--fundo-superficie-2); color: var(--texto-principal); }
