:root {
  --bg: #f8fafc;
  --fg: #0f172a;
  --card: #ffffff;
  --accent: #2563eb;
}
:root[data-theme="dark"] {
  --bg: #0b1220;
  --fg: #e2e8f0;
  --card: #111827;
  --accent: #60a5fa;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: var(--bg); color: var(--fg); }
.topbar { display: flex; justify-content: space-between; padding: 12px 16px; background: var(--card); border-bottom: 1px solid #cbd5e1; position: sticky; top: 0; }
.brand { text-decoration: none; color: var(--fg); font-weight: 700; }
.container { max-width: 1200px; margin: 16px auto; padding: 0 12px; }
.card { background: var(--card); padding: 16px; border-radius: 12px; margin-bottom: 14px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.narrow { max-width: 460px; margin: 0 auto; }
.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { display: block; margin: 8px 0; }
input, select, button { width: 100%; padding: 8px; margin-top: 4px; border-radius: 8px; border: 1px solid #94a3b8; }
.btn { background: var(--accent); color: white; text-decoration: none; display: inline-block; width: auto; padding: 8px 14px; border: none; border-radius: 8px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.flash { padding: 10px; border-radius: 8px; margin-bottom: 8px; }
.flash.success { background: #dcfce7; color: #166534; }
.flash.error { background: #fee2e2; color: #991b1b; }
.check { display: inline-flex; width: 49%; }
.check-vertical {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  padding: 6px 2px;
}
.check-name { line-height: 1.25; }
input.check-box {
  width: 20px;
  height: 20px;
  margin-top: 14px;
  border-radius: 4px;
}
fieldset { border-radius: 10px; margin: 10px 0; }
.sociogram { max-width: 100%; border-radius: 12px; border: 1px solid #cbd5e1; }
.table-wrap { overflow-x: auto; }
.summary-table { border-collapse: collapse; width: 100%; min-width: 700px; }
.summary-table th, .summary-table td { border: 1px solid #cbd5e1; padding: 8px; text-align: left; }
.summary-table th { background: #e2e8f0; }
@media (max-width: 720px) {
  .grid.two { grid-template-columns: 1fr; }
  .check { width: 100%; }
}

.legend-note { font-size: 0.95rem; color: #334155; margin: 10px 0; }
