:root {
    --brand-cyan: #18a9e5;
    --brand-lime: #b7d42f;
    --brand-violet: #7e2cff;
    --ink: #132238;
    --muted: #64748b;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --border: rgba(19, 34, 56, 0.08);
    --warn: #b45309;
    --danger: #dc2626;
    --ok: #15803d;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--ink);
    background: linear-gradient(180deg, #fdfefe, #f5f9ff 55%, #f7f8fc 100%);
    line-height: 1.6;
}
.hidden { display: none !important; }

/* Overlay perfil */
.overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(19, 34, 56, 0.55);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}
.overlay-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 2rem;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 24px 60px rgba(19, 34, 56, 0.2);
    text-align: center;
}
.overlay-card h2 { margin: 0 0 0.5rem; font-size: 1.5rem; }
.overlay-card p { color: var(--muted); margin: 0 0 1.5rem; }
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.role-btn {
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 1rem 0.75rem;
    background: var(--surface-soft);
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
    font-size: 0.95rem;
}
.role-btn:hover, .role-btn.active {
    border-color: var(--brand-violet);
    transform: translateY(-2px);
    background: #f3eeff;
}
.role-btn strong { display: block; margin-bottom: 0.25rem; }
.role-btn small { color: var(--muted); font-size: 0.8rem; }

.app-shell { max-width: 1100px; margin: 0 auto; padding: 1rem 1.25rem 3rem; }
.topbar {
    display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.brand h1 {
    margin: 0; font-size: 1.25rem;
    color: var(--brand-violet);
}
.brand small { color: var(--muted); }
.topbar-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.search-wrap { position: relative; }
.search-wrap input {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.5rem 1rem 0.5rem 2.25rem;
    width: 220px;
    font-size: 0.9rem;
}
.search-wrap::before {
    content: "⌕"; position: absolute; left: 0.85rem; top: 50%;
    transform: translateY(-50%); color: var(--muted);
}
.chip {
    border: none; border-radius: 999px; padding: 0.35rem 0.85rem;
    font-size: 0.82rem; cursor: pointer; background: var(--surface-soft);
}
.chip.active { background: var(--brand-violet); color: white; }

.tabs { display: flex; gap: 0.35rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tab {
    border: 1px solid var(--border); background: var(--surface);
    border-radius: 10px; padding: 0.55rem 1rem; cursor: pointer;
    font-size: 0.9rem; font-weight: 600;
}
.tab.active { background: var(--brand-cyan); color: white; border-color: var(--brand-cyan); }

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.panel h2 { margin: 0 0 0.75rem; font-size: 1.35rem; }
.panel h3 { margin: 1.25rem 0 0.5rem; font-size: 1.05rem; color: var(--brand-violet); }

.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.guide-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.1rem;
    cursor: pointer;
    background: var(--surface-soft);
    transition: transform 0.15s, box-shadow 0.15s;
}
.guide-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(19,34,56,0.08); }
.guide-card .icon { font-size: 1.75rem; margin-bottom: 0.5rem; }
.guide-card h4 { margin: 0 0 0.35rem; }
.guide-card p { margin: 0; font-size: 0.88rem; color: var(--muted); }

/* Wizard */
.wizard { max-width: 640px; }
.wizard-progress {
    height: 6px; background: var(--surface-soft);
    border-radius: 999px; overflow: hidden; margin-bottom: 1.25rem;
}
.wizard-progress-bar {
    height: 100%; background: linear-gradient(90deg, var(--brand-violet), var(--brand-cyan));
    transition: width 0.3s;
}
.wizard-step { min-height: 180px; }
.wizard-nav { display: flex; justify-content: space-between; margin-top: 1.5rem; }
.btn {
    border: none; border-radius: 10px; padding: 0.6rem 1.2rem;
    font-weight: 600; cursor: pointer; font-size: 0.9rem;
}
.btn-primary { background: var(--brand-violet); color: white; }
.btn-secondary { background: var(--surface-soft); color: var(--ink); border: 1px solid var(--border); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Assistente suporte */
.assist-options { display: flex; flex-direction: column; gap: 0.5rem; }
.assist-btn {
    text-align: left; border: 1px solid var(--border);
    border-radius: 10px; padding: 0.85rem 1rem;
    background: var(--surface-soft); cursor: pointer;
    font-size: 0.92rem;
}
.assist-btn:hover { border-color: var(--brand-cyan); background: #eef6ff; }
.assist-result {
    background: #f0fdf4; border: 1px solid #bbf7d0;
    border-radius: 12px; padding: 1rem; margin-top: 1rem;
}
.assist-result.warn { background: #fffbeb; border-color: #fde68a; }
.assist-result.danger { background: #fef2f2; border-color: #fecaca; }

/* Checklist */
.checklist label {
    display: flex; align-items: flex-start; gap: 0.65rem;
    padding: 0.6rem 0; border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.checklist input { margin-top: 0.25rem; accent-color: var(--brand-violet); }
.checklist .done { text-decoration: line-through; color: var(--muted); }
.progress-ring-text { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.75rem; }

/* Accordion conteúdo */
.accordion-item { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 0.5rem; overflow: hidden; }
.accordion-head {
    padding: 0.85rem 1rem; cursor: pointer; font-weight: 600;
    background: var(--surface-soft); display: flex; justify-content: space-between;
}
.accordion-body { padding: 0 1rem; max-height: 0; overflow: hidden; transition: max-height 0.3s, padding 0.3s; }
.accordion-item.open .accordion-body { padding: 0.75rem 1rem 1rem; max-height: 2000px; }
.accordion-item.open .accordion-head { background: #eef6ff; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 0.75rem 0; }
th, td { border: 1px solid var(--border); padding: 0.55rem 0.7rem; text-align: left; vertical-align: top; }
th { background: var(--surface-soft); }
code { background: #eef2ff; padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.88em; }
.callout { border-left: 4px solid var(--brand-cyan); background: #eef6ff; padding: 0.75rem 1rem; border-radius: 0 8px 8px 0; margin: 0.75rem 0; font-size: 0.92rem; }
mark { background: #fef08a; padding: 0 0.15rem; }

@media (max-width: 700px) {
    .role-grid { grid-template-columns: 1fr; }
    .search-wrap input { width: 100%; }
    .topbar { flex-direction: column; align-items: stretch; }
}
