/* =========================================================
   AFAGU Treinamento - Design System
   Cores da marca: vermelho (coração), azul (mapa), amarelo (nome)
   ========================================================= */
:root {
  --red: #d7141e;
  --red-2: #ff3b47;
  --blue: #1e5bd6;
  --blue-2: #3d7bff;
  --navy: #0b1f4b;
  --navy-2: #13306e;
  --yellow: #f5c518;
  --green: #16a34a;
  --amber: #f59e0b;
  --danger: #dc2626;

  --bg: #f3f6fc;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, #e3ecff 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, #ffe9ea 0%, transparent 55%), #f3f6fc;
  --surface: #ffffff;
  --surface-2: #f6f8fd;
  --surface-3: #eef2fa;
  --text: #0e1a36;
  --text-2: #3b4a6b;
  --muted: #6b7a99;
  --line: #e2e8f4;
  --shadow: 0 1px 2px rgba(14, 26, 54, .05), 0 8px 24px rgba(14, 26, 54, .07);
  --shadow-lg: 0 20px 50px rgba(11, 31, 75, .18);
  --ring: 0 0 0 3px rgba(30, 91, 214, .25);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar: 268px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070d1f;
    --bg-grad: radial-gradient(1000px 600px at 100% -10%, rgba(30, 91, 214, .22) 0%, transparent 60%), radial-gradient(800px 500px at -10% 110%, rgba(215, 20, 30, .14) 0%, transparent 55%), #070d1f;
    --surface: #0f1830;
    --surface-2: #131e3a;
    --surface-3: #1a2747;
    --text: #e8eeff;
    --text-2: #b8c4e3;
    --muted: #8391b5;
    --line: #22305a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #070d1f;
  --bg-grad: radial-gradient(1000px 600px at 100% -10%, rgba(30, 91, 214, .22) 0%, transparent 60%), radial-gradient(800px 500px at -10% 110%, rgba(215, 20, 30, .14) 0%, transparent 55%), #070d1f;
  --surface: #0f1830;
  --surface-2: #131e3a;
  --surface-3: #1a2747;
  --text: #e8eeff;
  --text-2: #b8c4e3;
  --muted: #8391b5;
  --line: #22305a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
a { color: var(--blue-2); }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 16px; height: 16px; }
.ico.lg { width: 26px; height: 26px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Splash ---------- */
.splash { min-height: 100vh; display: grid; place-content: center; gap: 22px; justify-items: center; background: var(--navy); }
.splash img { animation: pulse 1.6s ease-in-out infinite; }
.splash-bar { width: 140px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.15); overflow: hidden; }
.splash-bar span { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, var(--red), var(--yellow)); animation: load 1.1s ease-in-out infinite; border-radius: 4px; }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { position: relative; overflow: hidden; background: linear-gradient(150deg, var(--navy) 0%, #0f2c6b 55%, #1a3f94 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art::before, .login-art::after { content: ''; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; }
.login-art::before { width: 420px; height: 420px; background: var(--red); right: -120px; top: -80px; }
.login-art::after { width: 360px; height: 360px; background: var(--yellow); left: -140px; bottom: -120px; opacity: .25; }
.login-art > * { position: relative; z-index: 1; }
.login-art .marca { display: flex; align-items: center; gap: 14px; font-weight: 800; letter-spacing: .02em; }
.login-art .marca img { width: 52px; }
.login-art h1 { font-size: clamp(30px, 4vw, 48px); font-weight: 800; max-width: 520px; }
.login-art h1 em { font-style: normal; background: linear-gradient(90deg, var(--yellow), #ffd95a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-art p { color: #c7d4f5; max-width: 460px; font-size: 16px; }
.lema { display: flex; gap: 10px; flex-wrap: wrap; }
.lema span { padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); font-weight: 700; font-size: 13px; backdrop-filter: blur(6px); }
.login-form { display: grid; place-content: center; padding: 40px 24px; }
.login-card { width: min(400px, 100%); }
.login-card h2 { font-size: 28px; font-weight: 800; }
.login-card .sub { color: var(--muted); margin-bottom: 26px; }

/* ---------- Formulários ---------- */
.campo { display: grid; gap: 6px; margin-bottom: 14px; }
.campo label { font-weight: 600; font-size: 13px; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px;
  transition: border-color .15s, box-shadow .15s; outline: none;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue); box-shadow: var(--ring); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 11px 18px; font-weight: 700; font-size: 14px; transition: transform .12s, box-shadow .2s, background .2s, opacity .2s; text-decoration: none; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--blue) 0%, #2f6df0 100%); color: #fff; box-shadow: 0 6px 18px rgba(30, 91, 214, .35); }
.btn-primary:hover { box-shadow: 0 10px 26px rgba(30, 91, 214, .45); }
.btn-red { background: linear-gradient(135deg, var(--red) 0%, #f0303b 100%); color: #fff; box-shadow: 0 6px 18px rgba(215, 20, 30, .35); }
.btn-ghost { background: var(--surface-3); color: var(--text); }
.btn-ghost:hover { background: var(--line); }
.btn-outline { background: transparent; border: 1.5px solid var(--line); color: var(--text); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 12px; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px; display: flex; flex-direction: column; gap: 6px; background: linear-gradient(180deg, var(--navy) 0%, #0d2459 100%); color: #dfe7ff; }
.sidebar .marca { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; }
.sidebar .marca img { width: 42px; }
.sidebar .marca b { display: block; font-size: 17px; color: #fff; letter-spacing: .01em; }
.sidebar .marca small { color: #9fb2e6; font-size: 12px; }
.nav-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #7f93c9; padding: 14px 12px 6px; font-weight: 700; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: #c9d5f7; text-decoration: none; font-weight: 600; font-size: 14px; position: relative; transition: background .15s, color .15s; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.ativo { background: linear-gradient(90deg, rgba(61,123,255,.35), rgba(61,123,255,.08)); color: #fff; }
.nav-item.ativo::before { content: ''; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--yellow); }
.nav-item .badge { margin-left: auto; }
.sidebar .rodape { margin-top: auto; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.06); display: flex; align-items: center; gap: 10px; }
.sidebar .rodape .nome { font-weight: 700; color: #fff; font-size: 13px; line-height: 1.2; }
.sidebar .rodape small { color: #9fb2e6; font-size: 11px; }
.main { min-width: 0; padding: 28px 32px 60px; }
.topo { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.topo h1 { font-size: 26px; font-weight: 800; margin: 0; }
.topo .sub { color: var(--muted); font-size: 14px; }
.topo-acoes { display: flex; gap: 8px; align-items: center; }
.mobile-top, .bottom-nav { display: none; }

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card-tit { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-tit h3 { margin: 0; font-size: 16px; font-weight: 800; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: grid; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.b { font-weight: 700; }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 14px; flex: none; background: linear-gradient(135deg, var(--blue), #6d28d9); }
.avatar.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 20px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.red { background: rgba(220, 38, 38, .12); color: #ef4444; }
.badge.green { background: rgba(22, 163, 74, .12); color: #16a34a; }
.badge.amber { background: rgba(245, 158, 11, .15); color: #d97706; }
.badge.blue { background: rgba(30, 91, 214, .12); color: var(--blue-2); }
.badge.yellow { background: var(--yellow); color: #3b2f00; }
.badge.purple { background: rgba(124, 58, 237, .12); color: #8b5cf6; }
.badge.solid { background: var(--red); color: #fff; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.verde { background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.18); }
.dot.amarelo { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.18); }
.dot.vermelho { background: #ef4444; box-shadow: 0 0 0 4px rgba(239,68,68,.18); animation: blink 1.6s infinite; }
@keyframes blink { 50% { box-shadow: 0 0 0 7px rgba(239,68,68,.05); } }
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; position: relative; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--blue), var(--blue-2)); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.bar .esperado { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .45; border-radius: 2px; }
.vazio { text-align: center; padding: 36px 20px; color: var(--muted); }
.vazio .ico { width: 44px; height: 44px; margin: 0 auto 10px; opacity: .5; }
.sep { height: 1px; background: var(--line); margin: 16px 0; border: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 13px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13px; }
.chip.ativo { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .chip.ativo { background: var(--blue); border-color: var(--blue); }

/* KPI */
.kpi { padding: 18px; position: relative; overflow: hidden; }
.kpi .rot { color: var(--muted); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .val { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin-top: 4px; }
.kpi .val small { font-size: 14px; color: var(--muted); font-weight: 600; }
.kpi .ic { position: absolute; right: 14px; top: 14px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }

/* ---------- Hero do cobrador ---------- */
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: 26px; color: #fff; background: linear-gradient(135deg, var(--navy) 0%, #12357f 60%, #1b4bb3 100%); box-shadow: var(--shadow-lg); }
.hero::before { content: ''; position: absolute; width: 320px; height: 320px; border-radius: 50%; right: -90px; top: -120px; background: radial-gradient(circle, rgba(215,20,30,.75), transparent 70%); }
.hero::after { content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%; left: 30%; bottom: -170px; background: radial-gradient(circle, rgba(245,197,24,.45), transparent 70%); }
.hero > * { position: relative; z-index: 1; }
.hero h2 { font-size: 26px; font-weight: 800; margin: 0 0 4px; }
.hero .sub { color: #c7d4f5; }
.hero-grid { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; margin-top: 18px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hero-stat { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14); border-radius: 16px; padding: 12px 14px; backdrop-filter: blur(8px); }
.hero-stat .v { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.hero-stat .r { font-size: 12px; color: #b9c8ef; font-weight: 600; }
.nivel-bar { margin-top: 14px; }
.nivel-bar .bar { background: rgba(255,255,255,.15); height: 10px; }
.nivel-bar .bar > span { background: linear-gradient(90deg, var(--yellow), #ffe17a); }
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .c b { font-size: 34px; font-weight: 800; line-height: 1; }
.ring .c small { font-size: 11.5px; color: #c7d4f5; font-weight: 600; }

/* Linha do tempo de 90 dias */
.jornada { margin-top: 44px; }
.jornada .trilho { position: relative; height: 10px; border-radius: 99px; background: rgba(255,255,255,.14); }
.jornada .trilho > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, var(--red), var(--yellow)); }
.jornada .marco { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 22px; height: 22px; border-radius: 50%; background: var(--navy); border: 3px solid rgba(255,255,255,.5); display: grid; place-items: center; }
.jornada .marco.ok { background: var(--yellow); border-color: #fff; color: var(--navy); }
.jornada .marco .ico { width: 11px; height: 11px; stroke-width: 3.5; }
.jornada .voce { position: absolute; top: -34px; transform: translateX(-50%); background: #fff; color: var(--navy); font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 8px; white-space: nowrap; }
.jornada .voce::after { content: ''; position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%) rotate(45deg); width: 8px; height: 8px; background: #fff; }
.jornada .rotulos { display: flex; justify-content: space-between; margin-top: 10px; font-size: 11.5px; color: #c7d4f5; font-weight: 600; }

/* ---------- Mapa da trilha ---------- */
.mapa { position: relative; display: grid; gap: 4px; padding: 10px 0; }
.etapa { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 16px; align-items: center; position: relative; text-decoration: none; color: inherit; }
.etapa:not(:last-child)::after { content: ''; position: absolute; left: 35px; top: calc(50% + 40px); height: calc(100% - 76px); width: 3px; background: repeating-linear-gradient(180deg, var(--line) 0 6px, transparent 6px 12px); }
.etapa.feito:not(:last-child)::after { background: linear-gradient(180deg, var(--green), var(--green)); }
.no { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; color: #fff; position: relative; box-shadow: 0 10px 22px -8px var(--cor, var(--blue)); background: linear-gradient(140deg, var(--cor, var(--blue)), color-mix(in srgb, var(--cor, var(--blue)) 70%, #000)); transition: transform .2s; }
.etapa:hover .no { transform: translateY(-3px) rotate(-3deg); }
.no .ico { width: 30px; height: 30px; }
.etapa.bloq .no { background: var(--surface-3); color: var(--muted); box-shadow: none; }
.no .selo { position: absolute; right: -6px; bottom: -6px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--green); border: 3px solid var(--surface); }
.no .selo .ico { width: 13px; height: 13px; stroke-width: 3.5; }
.no .selo.lock { background: var(--muted); }
.no .selo.upd { background: var(--yellow); color: #3b2f00; }
.no svg.prog { position: absolute; inset: -7px; width: 86px; height: 86px; transform: rotate(-90deg); }
.etapa-card { padding: 16px 18px; margin: 10px 0; display: grid; gap: 6px; transition: border-color .2s, transform .2s; }
.etapa:hover .etapa-card { border-color: color-mix(in srgb, var(--cor, var(--blue)) 50%, var(--line)); }
.etapa-card h3 { font-size: 16px; margin: 0; font-weight: 800; }
.etapa-card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.etapa-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 4px; }

/* ---------- Módulo ---------- */
.mod-hero { border-radius: 24px; padding: 26px; color: #fff; position: relative; overflow: hidden; background: linear-gradient(135deg, var(--cor, var(--blue)) 0%, color-mix(in srgb, var(--cor, var(--blue)) 55%, #0b1f4b) 100%); box-shadow: var(--shadow-lg); margin-bottom: 20px; }
.mod-hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,255,255,.12); }
.mod-hero .ico-big { width: 58px; height: 58px; border-radius: 18px; background: rgba(255,255,255,.18); display: grid; place-items: center; margin-bottom: 14px; }
.mod-hero .ico-big .ico { width: 30px; height: 30px; }
.mod-hero h1 { font-size: 28px; font-weight: 800; margin: 0 0 6px; }
.mod-hero p { margin: 0; opacity: .88; max-width: 640px; }
.mod-hero .bar { background: rgba(255,255,255,.22); margin-top: 18px; }
.mod-hero .bar > span { background: #fff; }
.voltar { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.bloco { margin-bottom: 18px; scroll-margin-top: 80px; }
.bloco-cab { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.bloco-cab .num { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--surface-3); color: var(--text-2); flex: none; }
.bloco.visto .bloco-cab .num { background: var(--green); color: #fff; }
.bloco-cab h2 { font-size: 18px; font-weight: 800; margin: 0; flex: 1; }
.aviso-upd { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--yellow) 18%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--yellow) 60%, transparent); margin-bottom: 12px; font-size: 14px; }
.aviso-upd .ico { color: #b58a00; }
.mod-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; }
.fab { position: fixed; right: 24px; bottom: 24px; z-index: 30; border-radius: 999px; padding: 14px 20px; box-shadow: 0 12px 30px rgba(215,20,30,.4); }

/* Markdown */
.md { color: var(--text); }
.md h1 { font-size: 22px; font-weight: 800; margin: 4px 0 12px; }
.md h2 { font-size: 18px; font-weight: 800; margin: 20px 0 10px; }
.md h3 { font-size: 16px; font-weight: 700; margin: 16px 0 8px; }
.md p { margin: 0 0 12px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 22px; }
.md li { margin: 4px 0; }
.md li::marker { color: var(--blue-2); font-weight: 700; }
.md strong { font-weight: 800; }
.md .call { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; margin: 14px 0; background: color-mix(in srgb, var(--blue) 9%, var(--surface)); border-left: 4px solid var(--blue); }
.md .call.warn { background: color-mix(in srgb, var(--red) 8%, var(--surface)); border-left-color: var(--red); }
.md .call.tip { background: color-mix(in srgb, var(--green) 9%, var(--surface)); border-left-color: var(--green); }
.md .call .ico { margin-top: 2px; color: var(--blue-2); }
.md .call.warn .ico { color: var(--red); }
.md .call.tip .ico { color: var(--green); }
.md .call p:last-child { margin-bottom: 0; }

/* Cards de conteúdo */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ccard { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 16px; position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.ccard::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--cor, var(--blue)); }
.ccard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ccard h4 { margin: 4px 0 2px; font-size: 15px; font-weight: 800; color: var(--cor, var(--text)); }
.ccard .st { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.ccard .tx { font-size: 13.5px; margin-top: 10px; color: var(--text-2); display: none; }
.ccard.aberto .tx { display: block; animation: fade .25s; }
.ccard .mais { position: absolute; right: 12px; top: 14px; color: var(--muted); transition: transform .2s; }
.ccard.aberto .mais { transform: rotate(45deg); }
@keyframes fade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Passos */
.passos { display: grid; gap: 0; counter-reset: p; }
.passo { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; position: relative; padding-bottom: 18px; }
.passo:not(:last-child)::before { content: ''; position: absolute; left: 19px; top: 40px; bottom: 0; width: 2px; background: var(--line); }
.passo .n { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--cor, var(--blue)), color-mix(in srgb, var(--cor, var(--blue)) 65%, #000)); }
.passo h4 { margin: 8px 0 4px; font-size: 15px; font-weight: 800; }
.passo p { margin: 0; color: var(--text-2); font-size: 14px; }
.passo img { margin-top: 10px; max-height: 360px; border-radius: 14px; border: 1px solid var(--line); cursor: zoom-in; }

/* Tabela */
.tabela-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); }
table.tab { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tab th { text-align: left; padding: 12px 14px; background: var(--navy); color: #fff; font-weight: 700; font-size: 13px; }
table.tab td { padding: 12px 14px; border-top: 1px solid var(--line); }
table.tab tr:nth-child(even) td { background: var(--surface-2); }
table.tab.destaque td:last-child { font-weight: 800; color: var(--green); font-size: 16px; }

/* Mídia */
.galeria { display: grid; gap: 12px; }
.galeria figure { margin: 0; }
.galeria img { border-radius: 14px; border: 1px solid var(--line); cursor: zoom-in; margin: 0 auto; max-height: 560px; }
.galeria figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; text-align: center; }
.video-box { display: grid; place-items: center; background: #000; border-radius: 18px; overflow: hidden; }
.video-box video { max-height: 70vh; width: auto; }
.video-box.horiz video { width: 100%; max-height: none; }
.video-box iframe { width: 100%; aspect-ratio: 16/9; border: 0; }
.arquivos { display: grid; gap: 10px; }
.arq { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); text-decoration: none; color: inherit; transition: border-color .2s, transform .2s; }
.arq:hover { border-color: var(--blue); transform: translateX(3px); }
.arq .tipo { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 11px; color: #fff; flex: none; }
.arq .tipo.pdf { background: #dc2626; } .arq .tipo.xlsx { background: #16a34a; } .arq .tipo.docx { background: #2563eb; } .arq .tipo.img { background: #7c3aed; } .arq .tipo.mp4 { background: #db2777; } .arq .tipo.outro { background: #64748b; }
.arq .info { flex: 1; min-width: 0; }
.arq .info b { display: block; }
.arq .info small { color: var(--muted); }

/* Quiz e situação */
.quiz-box { border-radius: 20px; padding: 22px; background: linear-gradient(160deg, color-mix(in srgb, var(--blue) 8%, var(--surface)), var(--surface)); border: 1.5px solid color-mix(in srgb, var(--blue) 25%, var(--line)); }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.quiz-dots { display: flex; gap: 6px; }
.quiz-dots span { width: 26px; height: 6px; border-radius: 6px; background: var(--line); transition: background .3s; }
.quiz-dots span.on { background: var(--blue); }
.quiz-dots span.ok { background: var(--green); } .quiz-dots span.err { background: var(--danger); }
.quiz-p { font-size: 18px; font-weight: 800; margin: 6px 0 16px; }
.opcoes { display: grid; gap: 10px; }
.opcao { text-align: left; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); font-weight: 600; display: flex; gap: 12px; align-items: center; transition: border-color .15s, background .15s, transform .12s; }
.opcao:hover:not(:disabled) { border-color: var(--blue); transform: translateX(3px); }
.opcao .letra { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-3); display: grid; place-items: center; font-weight: 800; flex: none; font-size: 13px; }
.opcao.sel { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 8%, var(--surface)); }
.opcao.sel .letra { background: var(--blue); color: #fff; }
.opcao.certa { border-color: var(--green); background: color-mix(in srgb, var(--green) 10%, var(--surface)); }
.opcao.certa .letra { background: var(--green); color: #fff; }
.opcao.errada { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.opcao.errada .letra { background: var(--danger); color: #fff; }
.opcao:disabled { cursor: default; }
.explica { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 14px; animation: fade .3s; }
.resultado { text-align: center; padding: 10px 0; }
.resultado .nota { font-size: 56px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.resultado .nota.ok { color: var(--green); } .resultado .nota.no { color: var(--danger); }
.situ { border-radius: 20px; padding: 22px; background: linear-gradient(160deg, color-mix(in srgb, var(--amber) 10%, var(--surface)), var(--surface)); border: 1.5px solid color-mix(in srgb, var(--amber) 35%, var(--line)); }
.situ .tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #d97706; margin-bottom: 10px; }
.situ .cen { font-size: 16px; font-weight: 600; margin-bottom: 8px; }

/* Conquistas */
.medalhas { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.medalha { text-align: center; padding: 18px 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); }
.medalha .m { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #ffd84d, #f59e0b); color: #5a3d00; box-shadow: 0 8px 20px rgba(245,158,11,.35), inset 0 -4px 0 rgba(0,0,0,.12); }
.medalha.off { opacity: .45; filter: grayscale(1); }
.medalha.off .m { box-shadow: none; }
.medalha b { display: block; font-size: 13.5px; }
.medalha small { color: var(--muted); font-size: 12px; }
.barras { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.barras .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.barras .b span { width: 100%; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--blue-2), var(--blue)); min-height: 3px; transition: height .6s; }
.barras .b.zero span { background: var(--surface-3); }
.barras .b small { font-size: 10px; color: var(--muted); }

/* Dúvidas */
.duvida { padding: 16px; }
.duvida .q { font-weight: 600; margin: 8px 0; }
.resp { margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border-left: 3px solid var(--blue); }
.resp.minha { border-left-color: var(--red); }
.resp .quem { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }

/* Equipe */
.lista-equipe { display: grid; gap: 10px; }
.membro { display: grid; grid-template-columns: auto minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 16px; text-decoration: none; color: inherit; transition: border-color .2s, transform .15s; }
.membro:hover { border-color: var(--blue); transform: translateY(-1px); }
.membro .nm b { display: block; }
.membro .nm small { color: var(--muted); font-size: 12.5px; }
.alerta { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); text-decoration: none; color: inherit; }
.alerta .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.alerta.red .ic { background: rgba(220,38,38,.12); color: #ef4444; }
.alerta.amber .ic { background: rgba(245,158,11,.15); color: #d97706; }
.alerta.blue .ic { background: rgba(30,91,214,.12); color: var(--blue-2); }
.timeline { display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; position: relative; }
.tl:not(:last-child)::before { content: ''; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.tl .pt { width: 22px; height: 22px; border-radius: 50%; background: var(--blue); border: 4px solid var(--surface); box-shadow: 0 0 0 2px var(--blue); margin-top: 2px; }
.tl .pt.d45 { background: var(--amber); box-shadow: 0 0 0 2px var(--amber); }
.tl .pt.d90 { background: var(--green); box-shadow: 0 0 0 2px var(--green); }
.estrelas { display: inline-flex; gap: 2px; color: var(--yellow); }
.estrelas .ico { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.estrelas .off { color: var(--line); }
.star-pick { display: flex; gap: 4px; }
.star-pick button { background: none; border: 0; padding: 2px; color: var(--line); }
.star-pick button.on { color: var(--yellow); }
.star-pick .ico { width: 28px; height: 28px; fill: currentColor; stroke: none; }

/* Gestores (painel master) */
.gestor-card { display: grid; gap: 14px; align-content: start; min-width: 0; }
.grid-gestores { grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.score { width: 70px; height: 70px; position: relative; flex: none; }
.score svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 19px; font-weight: 800; }
.metricas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.metrica { background: var(--surface-2); border-radius: 12px; padding: 10px; min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.metrica .v { font-weight: 800; font-size: 17px; }
.metrica .r { font-size: 11.5px; color: var(--muted); font-weight: 600; line-height: 1.3; }

/* Editor */
.ed-lista { display: grid; gap: 10px; }
.ed-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-decoration: none; color: inherit; }
.ed-item:hover { border-color: var(--blue); }
.ed-tipo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--blue-2); flex: none; }
.ed-rep { border: 1.5px dashed var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; background: var(--surface-2); position: relative; }
.ed-rep .acoes-rep { position: absolute; right: 10px; top: 10px; display: flex; gap: 4px; }
.toolbar { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px; border: 1.5px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; background: var(--surface-2); }
.toolbar + .textarea { border-radius: 0 0 12px 12px; }
.toolbar button { border: 0; background: transparent; padding: 6px 10px; border-radius: 8px; font-weight: 700; font-size: 13px; }
.toolbar button:hover { background: var(--line); }
.preview { border: 1.5px dashed var(--line); border-radius: 14px; padding: 16px; background: var(--surface); }
.upload { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.upload .nome { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.tabela-ed input { min-width: 120px; }
.estrutura-mod { border-left: 4px solid var(--cor, var(--blue)); }
.bloco-linha { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); margin-top: 8px; flex-wrap: wrap; }
.perfis-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.perfis-pick label { font-size: 12px; padding: 4px 9px; border-radius: 999px; border: 1.5px solid var(--line); cursor: pointer; font-weight: 600; }
.perfis-pick input { display: none; }
.perfis-pick input:checked + span { color: var(--blue-2); }
.perfis-pick label:has(input:checked) { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--surface)); }
table.lista { width: 100%; border-collapse: collapse; font-size: 14px; }
table.lista th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 10px 12px; text-transform: uppercase; letter-spacing: .05em; }
table.lista td { padding: 12px; border-top: 1px solid var(--line); }
table.lista tr:hover td { background: var(--surface-2); }

/* Modal, toast, lightbox */
.modal-fundo { position: fixed; inset: 0; z-index: 100; background: rgba(5, 12, 32, .55); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fadeIn .2s; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 24px; animation: up .25s cubic-bezier(.2,.8,.2,1); }
.modal.largo { width: min(820px, 100%); }
.modal-cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-cab h3 { margin: 0; font-size: 19px; font-weight: 800; }
.modal-acoes { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes up { from { opacity: 0; transform: translateY(16px) scale(.98); } }
#toasts { position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast { padding: 13px 16px; border-radius: 14px; background: var(--navy); color: #fff; font-weight: 600; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; animation: up .25s; font-size: 14px; }
.toast.erro { background: var(--danger); }
.toast.ok { background: #15803d; }
.lightbox { position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,.88); display: grid; place-items: center; padding: 20px; cursor: zoom-out; animation: fadeIn .2s; }
.lightbox img { max-height: 92vh; border-radius: 12px; }
.senha-temp { font-family: ui-monospace, Consolas, monospace; font-size: 22px; font-weight: 800; letter-spacing: .1em; padding: 14px; text-align: center; border-radius: 14px; background: var(--surface-3); user-select: all; }
canvas.confete { position: fixed; inset: 0; pointer-events: none; z-index: 300; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .membro { grid-template-columns: auto minmax(0, 1fr) auto; }
  .membro .col-prog, .membro .col-extra { display: none; }
}
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 28px 22px; min-height: 280px; gap: 20px; }
  .login-art h1 { font-size: 28px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 76px 16px 100px; }
  .mobile-top { display: flex; position: fixed; top: 0; left: 0; right: 0; z-index: 40; height: 60px; padding: 0 16px; align-items: center; justify-content: space-between; background: color-mix(in srgb, var(--navy) 94%, transparent); backdrop-filter: blur(12px); color: #fff; }
  .mobile-top .marca { display: flex; align-items: center; gap: 10px; font-weight: 800; }
  .mobile-top img { width: 32px; }
  .bottom-nav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a { display: grid; justify-items: center; gap: 3px; padding: 6px 2px; text-decoration: none; color: var(--muted); font-size: 10.5px; font-weight: 700; border-radius: 12px; position: relative; }
  .bottom-nav a.ativo { color: var(--blue-2); }
  .bottom-nav a.ativo .ico { transform: translateY(-1px); }
  .bottom-nav .badge { position: absolute; top: 2px; right: 18%; padding: 1px 6px; font-size: 10px; }
  .topo h1 { font-size: 22px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .hero { padding: 20px; border-radius: 20px; }
  .hero-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .hero-stats { width: 100%; }
  .hero h2 { font-size: 22px; }
  .fab { right: 16px; bottom: 84px; padding: 12px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .metricas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mod-hero h1 { font-size: 23px; }
  .etapa { grid-template-columns: 60px minmax(0, 1fr); gap: 12px; }
  .no { width: 60px; height: 60px; border-radius: 18px; }
  .no svg.prog { width: 74px; height: 74px; }
  .etapa:not(:last-child)::after { left: 29px; top: calc(50% + 34px); height: calc(100% - 64px); }
  .esconde-mob { display: none !important; }
}
@media (max-width: 420px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi .val { font-size: 24px; }
  .kpi .ic { display: none; }
  .hero-stat .v { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
