:root {
    --brand: #0096c7;
    --brand-dark: #0077a0;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f1f5f9;
    --card: #ffffff;
    --danger-bg: #fef2f2;
    --danger: #b91c1c;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: var(--ink);
    color: #fff;
}
.topbar a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; font-size: 18px; }
.brand span { color: var(--brand); font-weight: 500; }
.topbar nav { display: flex; gap: 16px; align-items: center; font-size: 14px; }
.topbar .who { color: #cbd5e1; }

.container { max-width: 960px; margin: 32px auto; padding: 0 16px; }

h1 { margin: 0 0 4px; font-size: 26px; }
h2 { margin: 0 0 8px; font-size: 18px; }
.muted { color: var(--muted); margin-top: 0; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 24px;
    margin-top: 20px;
}
.card.narrow { max-width: 420px; margin: 48px auto; }

form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
input {
    font: inherit;
    font-weight: 400;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}
input:focus { outline: 2px solid var(--brand); border-color: var(--brand); }

button {
    font: inherit;
    font-weight: 600;
    padding: 11px;
    border: 0;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    cursor: pointer;
}
button:hover { background: var(--brand-dark); }

.alert {
    background: var(--danger-bg);
    color: var(--danger);
    padding: 10px 12px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 14px;
}

/* ---- Etapa 2: clientes ---- */
a { color: var(--brand-dark); }
.small { font-size: 13px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }

.button {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}
.button:hover { background: var(--brand-dark); }
button.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); align-self: flex-start; padding: 10px 16px; }
button.secondary:hover { background: var(--bg); }
form button[type=submit]:not(.secondary) { align-self: flex-start; padding: 11px 24px; }
.card.narrow form button[type=submit] { align-self: stretch; }

select, textarea {
    font: inherit;
    font-weight: 400;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
textarea { resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.card.flush { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
td a { font-weight: 600; text-decoration: none; }
.empty { padding: 24px; color: var(--muted); margin: 0; }

.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #e0f2fe; color: #075985; font-size: 12px; font-weight: 600; white-space: nowrap; }
.notice { background: #ecfdf5; color: #047857; padding: 10px 12px; border-radius: 8px; margin-top: 12px; font-size: 14px; }
.card.success { border-color: #6ee7b7; }
.card.success textarea { width: 100%; margin: 8px 0 12px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

.steps { list-style: none; padding: 0; margin: 12px 0 0; display: flex; gap: 8px; flex-wrap: wrap; counter-reset: step; }
.steps li { counter-increment: step; flex: 1 1 140px; padding: 10px 12px; border-radius: 8px; background: var(--bg); color: var(--muted); font-size: 14px; }
.steps li::before { content: counter(step) ". "; font-weight: 700; }
.steps li.done { background: #e0f2fe; color: #075985; }
.steps li.done::before { content: "✓ "; }
.steps li.current { background: var(--brand); color: #fff; font-weight: 600; }

@media (max-width: 640px) {
    .grid-2 { grid-template-columns: 1fr; }
    .topbar { padding: 14px 16px; }
}

/* ---- Área de membros ---- */
.topbar nav a { color: #e2e8f0; }
.topbar nav a:hover { color: #fff; }
.hint { font-weight: 400; font-size: 13px; color: var(--muted); }
label.short { max-width: 260px; }
.kind-switch { display: flex; gap: 20px; flex-wrap: wrap; }
.kind-switch label { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.table-title { padding: 16px 16px 0; }
td.icon { width: 36px; font-size: 18px; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline; margin: 0 0 0 12px; }
button.link { background: none; padding: 0; color: var(--brand-dark); font-weight: 600; font-size: 14px; }
button.link:hover { background: none; text-decoration: underline; }
button.link.danger { color: var(--danger); }

.section-title { margin: 32px 0 0; font-size: 20px; }
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.content-grid .card { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.content-item h3 { margin: 0; font-size: 16px; }
.content-item p { margin: 0; }
.content-item .button { align-self: flex-start; margin-top: auto; }
.button .light { font-weight: 400; opacity: .85; font-size: 13px; }
.video { position: relative; padding-top: 56.25%; border-radius: 8px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 640px) {
    .topbar { flex-wrap: wrap; gap: 8px; }
    .topbar nav { gap: 12px; flex-wrap: wrap; }
    td.actions form { display: block; margin: 6px 0 0; }
}

[hidden] { display: none !important; }

/* ---- Raio-X e brief ---- */
.progress { list-style: none; padding: 0; margin: 20px 0 0; display: flex; gap: 6px; flex-wrap: wrap; }
.progress a { display: block; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 13px; text-decoration: none; color: var(--muted); }
.progress li.current a { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.question { display: flex; flex-direction: column; gap: 6px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.question:last-of-type { border-bottom: 0; }
.qnum { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #e0f2fe; color: #075985; font-size: 12px; margin-right: 4px; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--muted); font-size: 13px; cursor: pointer; }
.form-nav { display: flex; gap: 12px; justify-content: flex-end; }
.form-nav button { align-self: auto !important; }
.summary { margin: 8px 0 0; }
.summary dt { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 14px; }
.summary dd { margin: 4px 0 0; white-space: normal; }
.tag.warn { background: #fef2f2; color: var(--danger); }
.tag.pending { background: #fef3c7; color: #92400e; }
details summary { cursor: pointer; font-weight: 600; color: var(--brand-dark); margin-top: 8px; }
.block-title { margin: 20px 0 0; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; }
.hidden-source { display: none; }
.steps-howto { background: var(--bg); border-radius: 8px; padding: 12px 14px; margin: 12px 0; font-size: 14px; }
.steps-howto p { margin: 0 0 4px; }
#brief form { margin-top: 20px; }
.question > label:first-child { flex-direction: row; align-items: flex-start; gap: 6px; }
.qnum { flex-shrink: 0; }

/* ---- Campanha ---- */
.delay { font-size: 12px; font-weight: 600; color: #075985; background: #e0f2fe; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.sequence { padding-left: 0; list-style: none; counter-reset: seq; margin: 8px 0 0; }
.sequence li { counter-increment: seq; border-left: 3px solid var(--line); padding: 4px 0 4px 14px; margin-bottom: 14px; }
.sequence li p { margin: 6px 0 0; }
.seq-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seq-head strong::before { content: counter(seq) ". "; }
.flow { margin: 8px 0 0; }
.flow > div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.flow > div:last-child { border-bottom: 0; }
.flow dt { font-weight: 600; font-size: 14px; }
.flow dd { margin: 4px 0 0; }
.changed { background: #fffbeb; border-radius: 6px; }
.sequence li.changed { border-left-color: #f59e0b; }
.flow > div.changed { padding-left: 10px; padding-right: 10px; }
.client-comment { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 10px 12px; margin: 12px 0; font-size: 14px; }
.rows { display: flex; flex-direction: column; gap: 14px; margin: 10px 0; }
.row-edit { display: flex; flex-direction: column; gap: 6px; padding: 12px; background: var(--bg); border-radius: 8px; }
.row-fields { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-fields input[type=text] { flex: 1 1 220px; }
label.inline { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; font-size: 13px; }
label.inline input { width: 80px; }
.tag.status-rascunho { background: var(--bg); color: var(--muted); }
.tag.status-enviada { background: #e0f2fe; color: #075985; }
.tag.status-aprovada { background: #ecfdf5; color: #047857; }
.tag.status-ajustes_pedidos { background: #fef3c7; color: #92400e; }
.card.highlight { border-color: var(--brand); box-shadow: 0 0 0 3px #e0f2fe; }
code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 13px; }

/* ---- Métricas ---- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
table.metrics { font-size: 13px; }
table.metrics th { white-space: nowrap; font-size: 11px; }
table.metrics td.num { text-align: right; white-space: nowrap; }
table.metrics tr.total td { font-weight: 700; background: var(--bg); border-top: 2px solid var(--line); }
.rate { display: inline-block; padding: 1px 7px; border-radius: 999px; font-weight: 600; font-size: 12px; }
.rate-ruim { background: #fef2f2; color: var(--danger); }
.rate-regular { background: #fef3c7; color: #92400e; }
.rate-bom { background: #e0f2fe; color: #075985; }
.rate-ótimo { background: #ecfdf5; color: #047857; }
.below { color: #b45309; margin-left: 4px; cursor: help; }
.legend .rate { margin-right: 4px; }
@media (max-width: 640px) { .grid-3 { grid-template-columns: 1fr 1fr; } }

button.armed { background: var(--danger) !important; color: #fff !important; padding: 4px 10px !important; border-radius: 6px; }
