/* ==========================================================
   Camisetas UMADEPRESP — estilo base (líder + painel)
   Base neutra (vale para todos os anos).
   A cor de destaque (--brand) é trocada por edição.
   ========================================================== */
:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --ink: #14171f;
  --ink-2: #3a4050;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-2: #d1d5db;
  --brand: #1f3a68;
  --brand-ink: #ffffff;
  --brand-soft: #e8eef8;
  --ok: #217a4b;
  --ok-soft: #e3f3ea;
  --warn: #a8640b;
  --warn-soft: #fbf0dc;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --info: #2457a6;
  --info-soft: #e5eefb;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .05), 0 6px 20px rgba(17, 24, 39, .06);
  --shadow-lg: 0 20px 50px rgba(17, 24, 39, .18);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
a { color: var(--brand); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
.num, .money { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- logo (PNG branco usado como máscara, pinta em qualquer cor) */
.logo-um {
  display: inline-block; width: 44px; aspect-ratio: 480 / 266;
  background: currentColor;
  -webkit-mask: url(../img/logo-um.png) center / contain no-repeat;
  mask: url(../img/logo-um.png) center / contain no-repeat;
  flex: none;
}
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.marca .logo-um { color: var(--brand); }
.marca b { display: block; font-size: 14px; font-weight: 800; letter-spacing: .06em; }
.marca span { display: block; font-size: 12px; color: var(--muted); }

/* ---------- botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font-weight: 700; font-size: 15px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.bad { background: var(--surface); border-color: #efc2bd; color: var(--bad); }
.btn.bad:hover { background: var(--bad-soft); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(17, 24, 39, .05); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn.wa { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent; background: transparent;
  display: inline-grid; place-items: center; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: rgba(17, 24, 39, .06); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- formulários */
.campo { display: grid; gap: 6px; margin-bottom: 14px; }
.campo > label, .rotulo { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.campo .dica { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.input.money-in { font-size: 20px; font-weight: 800; }
.linha2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

/* ---------- cartões e blocos */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-h h3 { font-size: 15px; }
.sec-t { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 26px 2px 10px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.pill.plain::before { display: none; }

.alerta { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; font-size: 14px; }
.alerta svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.alerta.warn { background: var(--warn-soft); color: #6e430a; }
.alerta.bad { background: var(--bad-soft); color: #7a1a12; }
.alerta.info { background: var(--info-soft); color: #1d3f78; }
.alerta.ok { background: var(--ok-soft); color: #175a37; }

.barra { height: 10px; background: rgba(17, 24, 39, .08); border-radius: 99px; overflow: hidden; display: flex; }
.barra > i { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .5s; }
.barra > i.analise { background: repeating-linear-gradient(45deg, #e0a948, #e0a948 4px, #ecc27a 4px, #ecc27a 8px); border-radius: 0 99px 99px 0; }

.vazio { text-align: center; padding: 34px 20px; color: var(--muted); }
.vazio svg { width: 42px; height: 42px; margin: 0 auto 10px; color: var(--line-2); }
.vazio h4 { color: var(--ink); margin-bottom: 6px; font-size: 16px; }

/* ---------- tabelas */
.tabela-wrap { overflow-x: auto; }
table.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela th { text-align: left; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.tabela td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela .r { text-align: right; }
.tabela .c { text-align: center; }
.tabela tbody tr.click { cursor: pointer; }
.tabela tbody tr.click:hover td { background: var(--surface-2); }
.tabela tfoot td { font-weight: 800; background: var(--surface-2); border-top: 2px solid var(--line-2); }

/* grade (matriz de tamanhos) */
.matriz th, .matriz td { text-align: center; }
.matriz th:first-child, .matriz td:first-child { text-align: left; }
.matriz td.zero { color: var(--line-2); }

/* ---------- modal */
dialog.modal {
  border: 0; padding: 0; border-radius: 18px; width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px); box-shadow: var(--shadow-lg); background: var(--surface); color: var(--ink);
}
dialog.modal.largo { width: min(980px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(15, 18, 28, .5); backdrop-filter: blur(2px); }
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 12px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-h h3 { font-size: 17px; }
.modal-b { padding: 18px 20px; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); flex-wrap: wrap; }

/* ---------- toast */
.toasts { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 9999; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 600; animation: toastIn .25s ease; display: flex; gap: 10px; align-items: center; }
.toast.ok { background: #175a37; }
.toast.bad { background: #8f1c13; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* camiseta ilustrada */
.camiseta { width: 48px; height: 48px; flex: none; }

/* ---------- impressão */
#area-impressao { display: none; }
@media print {
  body > *:not(#area-impressao) { display: none !important; }
  #area-impressao { display: block !important; color: #000; font-size: 12px; }
  .folha { page-break-after: always; padding: 6mm 2mm; }
  .folha:last-child { page-break-after: auto; }
  .folha h1 { font-size: 20px; margin-bottom: 4px; }
  .folha .tabela th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .folha .tabela td, .folha .tabela th { padding: 6px 8px; border-bottom: 1px solid #bbb; }
  .folha .cab { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 12px; }
  .folha .logo-um { color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .folha .assin { margin-top: 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
  .folha .assin div { border-top: 1px solid #000; padding-top: 4px; text-align: center; }
  @page { margin: 12mm; }
}
