:root {
  --bg: #f4f5f7; --surface: #fff; --text: #1f2937; --muted: #6b7280; --line: #e5e7eb;
  --brand: #3b5bdb; --brand-dark: #2f4ab8; --ok: #2f9e44; --warn: #e8590c; --err: #c92a2a;
  --radius: 8px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); line-height: 1.5; }
a { color: var(--brand); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 .75rem; }
.muted, .hint { color: var(--muted); font-size: .9rem; }
.hint { display: block; margin-top: .25rem; }

/* Público (login etc.) */
body.guest { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.guest-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: var(--radius); padding: 2rem; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.brand { font-weight: 700; color: var(--brand); font-size: 1.15rem; margin-bottom: 1.25rem; }
.brand span { color: var(--muted); font-weight: 400; font-size: .85rem; }

/* Autenticado */
.topbar { display: flex; align-items: center; gap: 1.5rem; background: var(--surface); border-bottom: 1px solid var(--line); padding: .75rem 1.5rem; flex-wrap: wrap; }
.topbar .brand { margin: 0; }
.topbar nav { display: flex; gap: 1rem; flex: 1; }
.topbar nav a { text-decoration: none; color: var(--text); }
.topbar nav a:hover { color: var(--brand); }
.topbar .user { display: flex; gap: 1rem; align-items: center; font-size: .9rem; color: var(--muted); }
.container { max-width: 1080px; margin: 0 auto; padding: 1.5rem; }

/* Formulários */
.form { display: grid; gap: 1rem; }
.form.narrow { max-width: 460px; }
.form label { display: grid; gap: .35rem; font-weight: 500; }
.form label.radio { display: flex; gap: .5rem; font-weight: 400; align-items: center; }
input[type=text], input[type=email], input[type=password] { width: 100%; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
input:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.btn { background: var(--brand); color: #fff; border: 0; border-radius: 6px; padding: .65rem 1rem; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--brand-dark); }
button.link { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; padding: 0; }
form.inline { display: inline; }
.field-error { color: var(--err); font-size: .85rem; font-weight: 400; }

/* Mensagens */
.alert { padding: .75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: .95rem; }
.alert-success { background: #ebfbee; color: #2b8a3e; }
.alert-info { background: #e7f5ff; color: #1864ab; }
.alert-error { background: #fff5f5; color: var(--err); }

/* Painel */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.card { background: var(--surface); border-radius: var(--radius); padding: 1rem 1.25rem; display: grid; }
.card strong { font-size: 1.6rem; }
.card span { color: var(--muted); font-size: .9rem; }
.checklist { list-style: none; padding: 0; display: grid; gap: .5rem; }
.checklist li { background: var(--surface); border-radius: 6px; padding: .6rem .9rem; }
.checklist li.ok { color: var(--ok); }
.checklist li.pending { color: var(--warn); }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; font-size: .92rem; }
.table th, .table td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
.table th { background: #f8f9fa; font-weight: 600; }
.badge { background: #e7f5ff; color: #1864ab; border-radius: 999px; padding: .1rem .55rem; font-size: .8rem; }

/* Etapa 3 — telas de gestão */
h3 { font-size: 1rem; margin: 0 0 .5rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters input[type=text] { flex: 1; min-width: 220px; }
select, textarea, input[type=number], input[type=date] { width: 100%; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; }
.filters select { width: auto; }
.btn-secondary { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn-secondary:hover { background: #edf2ff; }
.btn-danger { background: var(--err); }
.btn-danger:hover { background: #a61e1e; }
.btn-small { padding: .3rem .6rem; font-size: .85rem; }
a.btn { display: inline-block; text-decoration: none; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-top: 1rem; }
.box { background: var(--surface); border-radius: var(--radius); padding: 1rem 1.25rem; }
.inline-form { display: flex; gap: .5rem; max-width: 640px; }
.inline-form input { flex: 1; }
.pill { display: inline-block; border-radius: 999px; padding: .1rem .55rem; font-size: .78rem; background: #f1f3f5; color: #495057; vertical-align: middle; }
.pill-ok { background: #ebfbee; color: #2b8a3e; }
.pill-info { background: #e7f5ff; color: #1864ab; }
.pill-warn { background: #fff4e6; color: #d9480f; }
.pill-off { background: #fff5f5; color: var(--err); }
.support-banner { background: #fff4e6; color: #862e00; padding: .6rem 1.5rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; border-bottom: 1px solid #ffd8a8; }
code.copy { display: block; margin-top: .5rem; padding: .5rem; background: #fff; border: 1px dashed var(--line); word-break: break-all; user-select: all; }
.table.kv th { width: 160px; }
.table code { white-space: pre-wrap; word-break: break-word; }

/* Etapa 4 — painel da empresa */
.breadcrumb { font-size: .9rem; color: var(--muted); margin: 0 0 .5rem; }
.tabs { display: flex; gap: 1rem; border-bottom: 1px solid var(--line); padding-bottom: .5rem; }
.tabs a { text-decoration: none; color: var(--muted); }
.tabs a.active { color: var(--brand); font-weight: 600; }
.steps li { margin-bottom: .4rem; }
.table.tree td[class^="depth-"] { white-space: nowrap; }
.depth-1 { padding-left: 1.5rem !important; } .depth-2 { padding-left: 3rem !important; } .depth-3 { padding-left: 4.5rem !important; }
.depth-4 { padding-left: 6rem !important; } .depth-5 { padding-left: 7.5rem !important; } .depth-6 { padding-left: 9rem !important; }
tr.inactive td { opacity: .55; }
.role-row { align-items: center; margin-bottom: .5rem; max-width: 760px; }
.role-row .radio { white-space: nowrap; }
fieldset { border: 1px solid var(--line); border-radius: 6px; padding: .75rem 1rem; display: grid; gap: .4rem; }
legend { font-weight: 600; padding: 0 .3rem; }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.form .radio span { font-weight: 400; }

/* Etapa 5 — convites e questionário */
.invite-form { margin-bottom: 1rem; }
.actions-cell { white-space: nowrap; }
.actions-cell form { margin-left: .5rem; }
details summary { cursor: pointer; color: var(--brand); display: inline; }
body.test { background: var(--bg); }
.test-head { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.test-main { max-width: 720px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.terms { background: var(--surface); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.scale-legend { font-weight: 600; }
.btn-large { padding: .85rem 1.5rem; font-size: 1.05rem; }
.progress-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; color: var(--muted); font-size: .9rem; }
.progress-row progress { flex: 1; height: .6rem; accent-color: var(--brand); }
.question { background: var(--surface); border-radius: var(--radius); padding: 1.5rem; }
.statement { font-size: 1.3rem; line-height: 1.45; margin: 0 0 1.5rem; }
.likert { display: grid; gap: .6rem; }
.likert-option { display: flex; align-items: center; gap: .75rem; border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; cursor: pointer; }
.likert-option:hover { border-color: var(--brand); }
.likert-option input { width: 1.15rem; height: 1.15rem; accent-color: var(--brand); }
.likert-option:has(input:checked) { border-color: var(--brand); background: #edf2ff; }
.question-nav { display: flex; justify-content: space-between; margin-top: 1.5rem; }
.center { text-align: center; }
@media (min-width: 720px) { .likert { grid-template-columns: repeat(5, 1fr); } .likert-option { flex-direction: column; text-align: center; } }

/* Etapa 6 — resultado */
.table.scores meter { width: 100%; height: 1rem; }
.meter-col { width: 45%; }
