/* =========================================================
   DARE - Design System (herdado da plataforma AFAGU)
   Tokens da marca (trocados pelo scripts/novo_projeto.py):
     --navy   cor escura principal (menu lateral, cabeçalho de tabela, splash)
     --blue   cor de ação (botões, links, foco)
     --red    cor de destaque e alerta (badges, botão vermelho)
     --yellow acento (marcador do menu ativo, destaque de título)
   Todo o resto deriva desses tokens com color-mix.
   ========================================================= */
:root {
  --red: #d7141e;
  --red-2: color-mix(in srgb, var(--red) 75%, #fff);
  --blue: #1e5bd6;
  --blue-2: color-mix(in srgb, var(--blue) 78%, #fff);
  --navy: #0b1f4b;
  --navy-2: color-mix(in srgb, var(--navy) 80%, var(--blue));
  --yellow: #f5c518;
  --green: #16a34a;
  --amber: #f59e0b;
  --danger: #dc2626;

  --bg: #f3f6fc;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--blue) 12%, #fff) 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, color-mix(in srgb, var(--red) 9%, #fff) 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 color-mix(in srgb, var(--blue) 25%, transparent);
  --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%, color-mix(in srgb, var(--blue) 22%, transparent) 0%, transparent 60%), radial-gradient(800px 500px at -10% 110%, color-mix(in srgb, var(--red) 14%, transparent) 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%, color-mix(in srgb, var(--blue) 22%, transparent) 0%, transparent 60%), radial-gradient(800px 500px at -10% 110%, color-mix(in srgb, var(--red) 14%, transparent) 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%, color-mix(in srgb, var(--navy) 80%, var(--blue)) 55%, color-mix(in srgb, var(--navy) 55%, var(--blue)) 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), color-mix(in srgb, var(--yellow) 70%, #fff)); -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%, color-mix(in srgb, var(--blue) 82%, #fff) 100%); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--blue) 35%, transparent); }
.btn-primary:hover { box-shadow: 0 10px 26px color-mix(in srgb, var(--blue) 45%, transparent); }
.btn-red { background: linear-gradient(135deg, var(--red) 0%, color-mix(in srgb, var(--red) 82%, #fff) 100%); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--red) 35%, transparent); }
.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%, color-mix(in srgb, var(--navy) 85%, #000) 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, color-mix(in srgb, var(--blue-2) 35%, transparent), color-mix(in srgb, var(--blue-2) 8%, transparent)); 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: color-mix(in srgb, var(--blue) 12%, transparent); 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; padding-right: 54px; line-height: 1.35; min-height: 34px; }
.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; }


/* 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; }

/* 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)); }
}
@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; }
  .form-grid { grid-template-columns: 1fr; }
  .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; }
  .kpi .rot { padding-right: 0; min-height: 0; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Busca em tabelas e listas longas */
.busca-bloco { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.busca-bloco input { flex: 1; min-width: 0; border: 0; background: none; color: inherit; font: inherit; outline: none; }
.busca-bloco:focus-within { border-color: var(--blue); }
.tabela-wrap.longa { max-height: 560px; overflow-y: auto; }
.tabela-wrap.longa thead th { position: sticky; top: 0; z-index: 1; }
.tab td:first-child { min-width: 180px; }
.tab td:not(:first-child) { white-space: nowrap; }
.tab td.longo { white-space: normal; min-width: 220px; }
[hidden] { display: none !important; }


/* Olhinho da senha */
.senha-wrap { position: relative; }
.senha-wrap .input { padding-right: 46px; width: 100%; }
.senha-olho { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.senha-olho:hover, .senha-olho:focus-visible { background: var(--surface-3); color: var(--text); }


/* Conteúdo extenso: abrir e recolher (tabelas, listas de arquivos e textos longos) */
.bloco-cab .rec-tog { margin-left: auto; flex: none; gap: 6px; }
.rec-tog svg, .rec-pe svg, .rec-resumo .btn svg { transition: transform .2s; }
.recolhivel:not(.recolhido) .rec-tog svg, .recolhivel:not(.recolhido) .rec-pe svg { transform: rotate(180deg); }
.recolhivel .rec-fechar { display: none; }
.recolhivel:not(.recolhido) .rec-abrir { display: none; }
.recolhivel:not(.recolhido) .rec-fechar { display: inline; }
.recolhido[data-modo="lista"] .rec-corpo, .recolhido[data-modo="lista"] .rec-pe, .recolhido[data-modo="lista"] .rec-tog { display: none; }
.recolhivel:not(.recolhido) .rec-resumo { display: none; }
.rec-resumo { width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: left; font: inherit; cursor: pointer; box-shadow: var(--shadow); transition: border-color .2s, transform .15s; }
.rec-resumo:hover { border-color: var(--blue); transform: translateY(-1px); }
.rec-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); }
.rec-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rec-txt small { color: var(--muted); font-size: 13px; }
.rec-resumo .btn { flex: none; pointer-events: none; }
.recolhido[data-modo="previa"] .rec-corpo { max-height: 300px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.rec-pe { display: flex; justify-content: center; margin-top: 10px; }
.recolhido[data-modo="previa"] .rec-pe { margin-top: -6px; position: relative; }
.recolhivel:not(.recolhido) .rec-pe .btn { opacity: .85; }


/* ---------- Extras do modelo ---------- */
.avatar.xl { width: 84px; height: 84px; border-radius: 22px; font-size: 30px; }
.lista-linha { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.lista-linha:first-child { border-top: 0; }
.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); }

/* =================== DARE =================== */
a.lista-linha { color: inherit; text-decoration: none; }
a.lista-linha:hover { background: var(--surface-2); border-radius: 12px; }
.num-acao { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); font-weight: 800; color: var(--text-2); }
.ic-dare { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.ic-dare.enc { background: var(--surface-3); color: var(--muted); }
.acao-linha.bloqueada .num-acao { background: var(--red); color: #fff; }
.acao-linha.validada .num-acao, .acao-linha.concluida .num-acao { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.abas { margin: 4px 0 16px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
.abas .chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; color: inherit; }
.abas .chip.ativo { color: #fff; }

/* Faixa de conexão (sem internet / registros guardados) */
.faixa-rede { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 13.5px; font-weight: 600; }
.faixa-rede span { flex: 1; }
.faixa-rede.off { background: rgba(245, 158, 11, .16); color: #b45309; }
.faixa-rede.pend { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue-2); }
.faixa-rede.erro { background: rgba(220, 38, 38, .12); color: #dc2626; }
.faixa-rede .btn { background: var(--surface); }

/* Formulários da DARE */
.cart-linha { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.pessoas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 14px; max-height: 300px; overflow: auto; margin-top: 10px; }
.check.pessoa { padding: 6px 8px; border-radius: 10px; align-items: flex-start; }
.check.pessoa:hover { background: var(--surface-2); }
.check.pessoa[hidden] { display: none; }
.lev-form .input { min-width: 90px; padding: 8px 10px; }
.lev-form td:first-child { font-weight: 600; font-size: 13px; }
.destaque-dia { border: 2px solid color-mix(in srgb, var(--red) 35%, transparent); }
.call.bloqueio { border-left: 4px solid var(--red); }

/* Linha do tempo (histórico permanente) */
.timeline { position: relative; display: grid; gap: 14px; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
.tl-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); position: relative; z-index: 1; border: 3px solid var(--surface); }
.tl-item.bloqueio .tl-ic { background: var(--red); color: #fff; }
.tl-item.desbloqueio .tl-ic, .tl-item.validada .tl-ic { background: var(--green); color: #fff; }
.tl-item.evidencia .tl-ic { background: color-mix(in srgb, var(--blue) 18%, transparent); color: var(--blue); }

/* Evidências */
.evid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.evid { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.evid img { width: 100%; height: 120px; object-fit: cover; cursor: zoom-in; display: block; }
.evid .tiny { padding: 8px; }
.evid-pdf { height: 120px; display: grid; place-items: center; align-content: center; gap: 4px; color: var(--red); font-weight: 800; text-decoration: none; }

.aviso.novo b { color: var(--blue-2); }

@media (max-width: 860px) {
  .cart-linha { grid-template-columns: 1fr auto; }
  .cart-linha select { grid-column: 1 / 2; }
  .pessoas-grid { grid-template-columns: 1fr; }
}

/* Dossiê: impressão / salvar em PDF */
.dossie h2 { margin: 6px 0; } .dossie h3 { margin: 22px 0 8px; font-size: 16px; }
.dossie table.tab { font-size: 12.5px; } .dossie table.tab td, .dossie table.tab th { padding: 7px 9px; white-space: normal; }
@media print {
  .sidebar, .mobile-top, .bottom-nav, .nao-imprime, #faixa-rede, #toasts { display: none !important; }
  .shell { display: block !important; } .main { padding: 0 !important; margin: 0 !important; }
  body { background: #fff !important; color: #000 !important; }
  .card { box-shadow: none !important; border: 0 !important; }
  table.tab th { background: #0b1f4b !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .badge { border: 1px solid #ccc; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tl-item { break-inside: avoid; } tr { break-inside: avoid; }
}
.grid > * { min-width: 0; }
.barras small { white-space: nowrap; }
.stack > *, .card { min-width: 0; }
