:root {
  --ink: #0a0f18;
  --ink-soft: #0f1724;
  --surface: #131d2c;
  --surface-2: #192538;
  --surface-3: #213047;
  --line: rgba(190, 209, 231, .13);
  --line-strong: rgba(190, 209, 231, .22);
  --text: #f2f5f8;
  --muted: #9cabbc;
  --quiet: #6f8094;
  --accent: #72d6b5;
  --accent-deep: #249a78;
  --violet: #9a8dff;
  --warning: #e5bd6b;
  --danger: #f07979;
  --info: #70b7e8;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--text);
  font-family: "Aptos", "Segoe UI Variable", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background:
    radial-gradient(circle at 14% 5%, rgba(114, 214, 181, .13), transparent 24%),
    linear-gradient(180deg, #101927 0%, #0b121d 100%);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 3px 8px 25px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #07120f;
  background: linear-gradient(145deg, #98ead0, #4dbb98);
  box-shadow: 0 9px 28px rgba(77, 187, 152, .22);
  font-weight: 800;
  letter-spacing: -.06em;
}
.brand strong { display: block; font-size: .98rem; letter-spacing: .02em; }
.brand small { display: block; color: var(--muted); font-size: .7rem; }
.nav-label {
  margin: 17px 10px 8px;
  color: var(--quiet);
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.nav { display: grid; gap: 4px; }
.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 43px;
  padding: 0 11px;
  border-radius: 11px;
  color: #b7c3d1;
  border: 1px solid transparent;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, .035); }
.nav-link.active {
  color: #eafff8;
  background: linear-gradient(90deg, rgba(114, 214, 181, .14), rgba(114, 214, 181, .04));
  border-color: rgba(114, 214, 181, .19);
}
.nav-main { display: flex; align-items: center; gap: 10px; }
.nav-icon {
  width: 22px;
  color: var(--quiet);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.nav-link.active .nav-icon { color: var(--accent); }
.nav-count {
  min-width: 23px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #07120f;
  background: var(--accent);
  text-align: center;
  font-size: .72rem;
  font-weight: 800;
}
.sidebar-foot {
  margin-top: auto;
  padding: 15px 10px 2px;
  color: var(--quiet);
  font-size: .72rem;
  border-top: 1px solid var(--line);
}
.main-column { min-width: 0; }
.topbar {
  min-height: 74px;
  padding: 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(10, 15, 24, .88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 8;
}
.top-context { display: flex; align-items: center; gap: 12px; }
.system-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(114, 214, 181, .1);
}
.system-pulse.paused { background: var(--danger); box-shadow: 0 0 0 5px rgba(240, 121, 121, .1); }
.top-context strong { font-size: .86rem; }
.top-context span { color: var(--muted); font-size: .77rem; }
.user-area { display: flex; align-items: center; gap: 12px; }
.user-chip {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--accent);
  font-size: .8rem;
  font-weight: 800;
}
.logout-form { margin: 0; }
.link-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px;
}
.link-button:hover { color: var(--text); }
.content {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 34px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
}
.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(1.75rem, 2.6vw, 2.65rem); line-height: 1.08; letter-spacing: -.035em; }
h2 { font-size: 1.03rem; letter-spacing: -.01em; }
h3 { font-size: .9rem; }
.lead { color: var(--muted); margin: 0; max-width: 720px; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; }
.grid { display: grid; gap: 16px; }
.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.metric {
  min-height: 142px;
  padding: 20px;
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(30, 44, 65, .88), rgba(18, 28, 43, .95));
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.metric::after {
  content: "";
  position: absolute;
  width: 84px;
  height: 84px;
  right: -28px;
  bottom: -38px;
  border-radius: 50%;
  background: var(--metric-color, var(--accent));
  opacity: .08;
}
.metric-label { color: var(--muted); font-size: .77rem; }
.metric-value { display: block; margin-top: 11px; font-size: 2rem; font-weight: 750; letter-spacing: -.05em; }
.metric-note { margin-top: 6px; color: var(--quiet); font-size: .73rem; }
.metric.warning { --metric-color: var(--warning); }
.metric.danger { --metric-color: var(--danger); }
.metric.info { --metric-color: var(--info); }
.panel {
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(24, 36, 54, .95), rgba(16, 25, 38, .96));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .025) inset;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.panel-head h2 { margin: 0; }
.panel-head p { margin: 3px 0 0; color: var(--muted); font-size: .78rem; }
.dashboard-grid { grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); }
.stack { display: grid; gap: 16px; }
.status-list { display: grid; gap: 10px; }
.status-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 42px;
  gap: 12px;
  align-items: center;
  font-size: .8rem;
}
.status-track { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .055); overflow: hidden; }
.status-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); }
.status-number { text-align: right; color: var(--muted); }
.activity { display: grid; gap: 2px; }
.activity-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.activity-row:last-child { border-bottom: 0; }
.activity-dot { width: 7px; height: 7px; margin-top: 7px; border-radius: 50%; background: var(--accent); }
.activity-title { font-size: .82rem; }
.activity-meta { color: var(--quiet); font-size: .7rem; }
.empty { padding: 28px; color: var(--muted); text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
.alert {
  display: flex;
  gap: 10px;
  padding: 13px 15px;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: .82rem;
}
.alert.ok { color: #baf5df; background: rgba(43, 150, 113, .12); border-color: rgba(114, 214, 181, .2); }
.alert.warn { color: #f3d99f; background: rgba(191, 140, 47, .12); border-color: rgba(229, 189, 107, .2); }
.alert.bad { color: #ffc1c1; background: rgba(190, 70, 70, .13); border-color: rgba(240, 121, 121, .2); }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.badge.verde, .badge.validado, .badge.processado, .badge.concluida { color: #aaf1d7; background: rgba(46, 166, 126, .16); }
.badge.amarelo, .badge.rotina, .badge.pendente, .badge.aprovado { color: #f2d495; background: rgba(197, 147, 57, .16); }
.badge.vermelho, .badge.fatal, .badge.falhou, .badge.dead_letter { color: #ffb3b3; background: rgba(207, 75, 75, .17); }
.badge.informativo, .badge.reservado, .badge.monitorado { color: #aad8f7; background: rgba(67, 145, 199, .17); }
.badge.configurado { color: #aaf1d7; background: rgba(46, 166, 126, .16); }
.badge.restrito { color: #d0c8ff; background: rgba(123, 103, 225, .18); }
.btn, button.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #06120e;
  background: var(--accent);
  font-weight: 750;
  font-size: .79rem;
}
.btn:hover { filter: brightness(1.05); }
.btn.secondary { color: var(--text); background: var(--surface-3); border-color: var(--line); }
.btn.ghost { color: var(--muted); background: transparent; border-color: var(--line); }
.btn.danger { color: #fff; background: #b84c51; }
.btn.warning { color: #191104; background: var(--warning); }
.form-field { display: grid; gap: 7px; margin-bottom: 14px; }
.form-field label { color: var(--muted); font-size: .76rem; font-weight: 650; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(5, 10, 17, .48);
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}
input:focus, textarea:focus { border-color: rgba(114, 214, 181, .58); box-shadow: 0 0 0 3px rgba(114, 214, 181, .08); }
textarea { resize: vertical; min-height: 150px; }
.search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .78rem; }
th { color: var(--quiet); font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 800; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
tbody tr:hover { background: rgba(255, 255, 255, .018); }
.code { color: #a6b5c6; font-family: "Cascadia Code", Consolas, monospace; font-size: .69rem; word-break: break-all; }
.preview {
  margin: 0;
  padding: 17px;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(4, 8, 14, .58);
  color: #dbe4ee;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: .76rem;
  max-height: 420px;
  overflow: auto;
}
/* M9: a linha mais recente da ficha do processo, para o olho achar sozinho. */
tbody tr.destaque { background: rgba(120, 170, 255, .07); }
tbody tr.destaque td { border-left: 2px solid var(--line-strong); }
.approval-card { display: grid; gap: 13px; }
.approval-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hash-line { padding: 10px 12px; border-radius: 9px; background: rgba(255, 255, 255, .025); }
.divider { height: 1px; margin: 19px 0; background: var(--line); }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(235px, 1fr));
  gap: 13px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.kanban-column { min-height: 460px; padding: 12px; border-radius: 15px; background: rgba(12, 19, 30, .7); border: 1px solid var(--line); }
.kanban-head { display: flex; justify-content: space-between; align-items: center; padding: 3px 3px 12px; }
.kanban-title { color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.kanban-count { color: var(--quiet); font-size: .7rem; }
.kanban-card { padding: 13px; margin-bottom: 9px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.kanban-card h3 { margin-bottom: 6px; }
.kanban-card p { margin-bottom: 8px; color: var(--muted); font-size: .72rem; }

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, .85fr) minmax(480px, 1.15fr);
  background: #080d15;
}
.login-brand {
  padding: clamp(38px, 7vw, 94px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 18% 16%, rgba(114, 214, 181, .16), transparent 30%),
    linear-gradient(160deg, #132032 0%, #0b121d 78%);
}
.login-brand h1 { max-width: 610px; font-size: clamp(2.3rem, 5vw, 5rem); }
.login-brand p { max-width: 520px; color: var(--muted); }
.login-note { color: var(--quiet); font-size: .72rem; }
.login-form-wrap { padding: 32px; display: grid; place-items: center; }
.login-card { width: min(440px, 100%); padding: 31px; border: 1px solid var(--line); border-radius: 22px; background: rgba(19, 29, 44, .8); box-shadow: var(--shadow); }
.login-card h2 { margin-bottom: 7px; font-size: 1.5rem; }
.login-card .lead { margin-bottom: 24px; }
.login-card .btn { width: 100%; }

.integration-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.integration-card { min-height: 150px; }
.integration-card p { color: var(--muted); font-size: .78rem; }
.safety-note { color: var(--warning); font-size: .74rem; }
.autonomy-card h2 { margin: 12px 0 4px; }
.autonomy-card .preview { max-height: 620px; }
.autonomy-notes { margin-top: 17px; }
.autonomy-notes ul, .source-list { margin: 7px 0 0; padding-left: 20px; color: var(--muted); }
.source-list li, .autonomy-notes li { margin-bottom: 7px; }
.source-list a { color: var(--accent); }
.source-list span { color: var(--quiet); font-size: .75rem; }

@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .integration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .shell { grid-template-columns: minmax(0, 1fr); width: 100%; max-width: 100vw; }
  .sidebar {
    position: static;
    width: 100%;
    min-width: 0;
    max-width: 100vw;
    height: auto;
    padding: 16px;
    overflow: hidden;
  }
  .main-column { width: 100%; min-width: 0; }
  .metric { min-width: 0; overflow: hidden; }
  .brand { padding-bottom: 12px; }
  .nav-label, .sidebar-foot { display: none; }
  .nav-stack {
    display: flex;
    width: 100%;
    max-width: 100%;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 4px;
    overscroll-behavior-inline: contain;
  }
  .nav-stack .nav { display: contents; }
  .nav-link { flex: 0 0 auto; min-height: 38px; justify-content: center; padding: 0 12px; }
  .nav-main { gap: 5px; }
  .nav-icon { display: none; }
  .topbar { position: static; padding: 0 18px; min-height: 62px; }
  .content { padding: 22px 16px 34px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .two-columns, .integration-grid { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-brand { min-height: 310px; padding: 35px 24px; }
  .login-brand h1 { font-size: 2.35rem; }
  .status-row { grid-template-columns: 110px minmax(0, 1fr) 32px; }
}

@media (max-width: 480px) {
  .metrics { grid-template-columns: 1fr; }
  .metric { min-height: 118px; }
  .search-form { grid-template-columns: 1fr; }
  .user-chip { display: none; }
}

progress {
  width: 100%;
  height: 7px;
  border: 0;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255, 255, 255, .055);
}
progress::-webkit-progress-bar { background: rgba(255, 255, 255, .055); }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--accent-deep), var(--accent)); }
progress::-moz-progress-bar { background: linear-gradient(90deg, var(--accent-deep), var(--accent)); }

.decision-form {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) auto;
  align-items: end;
  gap: 7px;
  margin-bottom: 9px;
}
.decision-form label { grid-column: 1 / -1; }
.decision-form input { min-width: 84px; padding: 8px 9px; }
.decision-form .btn { min-height: 36px; padding: 0 11px; }
details { margin-top: 8px; color: var(--muted); }
details summary { cursor: pointer; color: var(--accent); }
details ul { margin: 8px 0; padding-left: 18px; }

/* Onda 1 do LPMS: nucleo cadastral, tarefas e importador. */
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(5, 10, 17, .48);
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}
select:focus { border-color: rgba(114, 214, 181, .58); box-shadow: 0 0 0 3px rgba(114, 214, 181, .08); }
.filtros {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  align-items: center;
  gap: 9px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0 16px;
}
.form-grid .actions { grid-column: 1 / -1; margin-top: 6px; }
.form-field span { color: var(--muted); font-size: .76rem; font-weight: 650; }
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .78rem;
}
.form-check input { width: auto; }
.sublinks { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.sublink {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: .76rem;
  font-weight: 650;
}
.sublink:hover { color: var(--text); border-color: var(--line-strong); }
.sublink.active { color: #eafff8; border-color: rgba(114, 214, 181, .35); background: rgba(114, 214, 181, .1); }
.badge.ativo, .badge.aberta, .badge.alta { color: #ffe0a8; border-color: rgba(229, 189, 107, .32); background: rgba(229, 189, 107, .12); }
.badge.a_confirmar, .badge.suspenso, .badge.media { color: #cfd9e6; border-color: var(--line-strong); background: rgba(255, 255, 255, .045); }
.badge.encerrado, .badge.inativo, .badge.feita, .badge.cancelada, .badge.baixa { color: var(--quiet); border-color: var(--line); background: rgba(255, 255, 255, .028); }

/* Onda 2 do LPMS: funil kanban, checklist de fase e GED. */
.kanban { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.kanban-column.kanban-column-alvo { border-color: rgba(114, 214, 181, .45); background: rgba(114, 214, 181, .06); }
.kanban-column.kanban-column-ocupada { opacity: .6; }
.kanban-card { cursor: grab; }
.kanban-card:active { cursor: grabbing; }
.kanban-card h3 { font-size: .86rem; }
.kanban-card .decision-form { margin-top: 9px; margin-bottom: 0; grid-template-columns: minmax(0, 1fr); }
.kanban-card .form-field { margin-bottom: 8px; }
.checklist-item { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checklist-item:last-child { border-bottom: 0; }
.checklist-item .item-nome { flex: 1 1 220px; }
.checklist-item form { display: inline-flex; gap: 6px; }
.checklist-item .btn { min-height: 32px; padding: 0 10px; font-size: .72rem; }
.badge.pendente { color: #ffe0a8; border-color: rgba(229, 189, 107, .32); background: rgba(229, 189, 107, .12); }
.badge.ok { color: #bff2dd; border-color: rgba(114, 214, 181, .32); background: rgba(114, 214, 181, .1); }
.badge.nao_aplicavel { color: var(--quiet); border-color: var(--line); background: rgba(255, 255, 255, .028); }

/* Onda 3 do LPMS: agenda integrada (mes, semana, conflitos). */
.agenda-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.agenda-grade { table-layout: fixed; width: 100%; }
.agenda-grade th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.agenda-celula { vertical-align: top; height: 96px; border: 1px solid var(--line); padding: 6px; }
.agenda-celula.fora-do-mes { opacity: .45; }
.agenda-celula.agenda-hoje { border-color: rgba(114, 214, 181, .45); background: rgba(114, 214, 181, .05); }
.agenda-dia { display: block; font-size: .76rem; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.agenda-chip {
  display: block;
  margin-bottom: 4px;
  padding: 4px 7px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  font-size: .72rem;
  line-height: 1.25;
  color: var(--text);
  overflow-wrap: anywhere;
}
.agenda-hora { font-weight: 700; margin-right: 4px; color: var(--accent); }
.agenda-chip.origem-google_principal { border-color: rgba(114, 214, 181, .38); background: rgba(114, 214, 181, .1); }
.agenda-chip.origem-google_prazos { border-color: rgba(229, 189, 107, .38); background: rgba(229, 189, 107, .12); }
.agenda-chip.origem-prazo_validado { border-color: rgba(229, 133, 133, .38); background: rgba(229, 133, 133, .12); }
.agenda-chip.origem-interno { border-color: var(--line-strong); background: rgba(255, 255, 255, .045); }
.agenda-chip.provisorio { color: var(--quiet); border-style: dashed; border-color: var(--line); background: transparent; }
.badge.origem-google_principal, .badge.sincronizado { color: #bff2dd; border-color: rgba(114, 214, 181, .32); background: rgba(114, 214, 181, .1); }
.badge.origem-google_prazos, .badge.pendente_push { color: #ffe0a8; border-color: rgba(229, 189, 107, .32); background: rgba(229, 189, 107, .12); }
.badge.origem-prazo_validado, .badge.conflito, .badge.erro { color: #ffc9c9; border-color: rgba(229, 133, 133, .32); background: rgba(229, 133, 133, .12); }
.badge.origem-interno, .badge.local_apenas, .badge.confirmado { color: var(--quiet); border-color: var(--line); background: rgba(255, 255, 255, .028); }
.acao-inline { display: inline-flex; }
.conflito {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.conflito:last-child { border-bottom: 0; }
.conflito-lado h3 { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.conflito-acoes { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.ficha { display: grid; grid-template-columns: minmax(120px, 210px) minmax(0, 1fr); gap: 8px 16px; }
.ficha dt { color: var(--muted); font-size: .76rem; font-weight: 650; }
.ficha dd { margin: 0; }

/* Onda 4 do LPMS: financeiro de honorários (assinatura e parcelas). */
.badge.assinado, .badge.paga { color: #bff2dd; border-color: rgba(114, 214, 181, .32); background: rgba(114, 214, 181, .1); }
.badge.enviado, .badge.aberta { color: #ffe0a8; border-color: rgba(229, 189, 107, .32); background: rgba(229, 189, 107, .12); }
.badge.atrasada { color: #ffc9c9; border-color: rgba(229, 133, 133, .32); background: rgba(229, 133, 133, .12); }
.badge.rascunho, .badge.cancelado { color: var(--quiet); border-color: var(--line); background: rgba(255, 255, 255, .028); }
.decision-form input[type="date"], .decision-form input[name="valor"], .decision-form input[name="motivo"] { min-width: 0; }

/* Onda 5 do LPMS: CRM (propostas) e alertas operacionais. */
.badge.aceita { color: #bff2dd; border-color: rgba(114, 214, 181, .32); background: rgba(114, 214, 181, .1); }
.badge.enviada, .badge.reconhecido { color: #ffe0a8; border-color: rgba(229, 189, 107, .32); background: rgba(229, 189, 107, .12); }
.badge.aberto { color: #ffc9c9; border-color: rgba(229, 133, 133, .32); background: rgba(229, 133, 133, .12); }
.badge.recusada, .badge.expirada, .badge.resolvido { color: var(--quiet); border-color: var(--line); background: rgba(255, 255, 255, .028); }

/* Onda 6: home de gestao. Grade responsiva com auto-fit, sem JS. */
.boas-vindas {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.boas-vindas h1 { margin-bottom: 4px; }
.contadores { display: flex; flex-wrap: wrap; gap: 10px; }
.contador {
  min-width: 118px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .028);
  display: grid;
  gap: 2px;
}
.contador:hover { border-color: var(--line-strong); }
.contador strong { font-size: 1.5rem; font-weight: 750; letter-spacing: -.04em; }
.contador span { color: var(--muted); font-size: .72rem; }
.contador.urgente { border-color: rgba(240, 121, 121, .38); background: rgba(190, 70, 70, .1); }
.contador.urgente strong { color: #ffc1c1; }

.bloco { margin-bottom: 20px; }
.bloco-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.bloco-head h2 { margin: 0; }
.bloco-head p { margin: 3px 0 0; color: var(--muted); font-size: .78rem; }

.criticos { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.critico {
  display: grid;
  gap: 5px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid rgba(240, 121, 121, .35);
  border-left: 4px solid var(--danger);
  background: linear-gradient(150deg, rgba(190, 70, 70, .14), rgba(18, 28, 43, .95));
}
.critico:hover { border-color: rgba(240, 121, 121, .6); }
.critico-valor { font-size: 2.3rem; font-weight: 750; letter-spacing: -.05em; color: #ffc1c1; }
.critico-rotulo { color: var(--text); font-size: .8rem; }

.saude { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.saude-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .025);
}
.saude-card strong { font-size: 1.35rem; font-weight: 720; letter-spacing: -.04em; }
.saude-card span { color: var(--muted); font-size: .72rem; }
.saude-card.ok { border-color: rgba(114, 214, 181, .24); }
.saude-card.ok strong { color: #aaf1d7; }
.saude-card.atencao { border-color: rgba(229, 189, 107, .32); background: rgba(197, 147, 57, .1); }
.saude-card.atencao strong { color: #f2d495; }
.saude-card.ruim { border-color: rgba(240, 121, 121, .34); background: rgba(190, 70, 70, .1); }
.saude-card.ruim strong { color: #ffb3b3; }

.placar { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.placar-item {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(155deg, rgba(30, 44, 65, .88), rgba(18, 28, 43, .95));
  display: grid;
  gap: 4px;
}
.placar-rotulo { color: var(--muted); font-size: .75rem; }
.placar-valor { font-size: 1.6rem; font-weight: 740; letter-spacing: -.045em; }
.placar-valor.pequeno { font-size: 1.02rem; letter-spacing: -.01em; }
.placar-nota { color: var(--quiet); font-size: .72rem; }

.resumo-ia {
  margin: 0;
  padding: 18px 20px;
  max-height: 460px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(10, 16, 25, .6);
  font-family: inherit;
  font-size: .85rem;
  line-height: 1.6;
}

.metas { display: grid; gap: 12px; }
.meta-linha {
  display: grid;
  grid-template-columns: minmax(140px, 210px) minmax(0, 240px) minmax(0, 1fr) 56px;
  gap: 14px;
  align-items: center;
  font-size: .82rem;
}
.meta-rotulo { color: var(--text); }
.meta-numero { color: var(--muted); }
.meta-percentual { color: var(--muted); text-align: right; }

@media (max-width: 780px) {
  .boas-vindas { flex-direction: column; align-items: flex-start; }
  .contadores { width: 100%; }
  .contador { flex: 1 1 30%; min-width: 0; }
  .meta-linha { grid-template-columns: minmax(0, 1fr) auto; }
  .meta-linha progress { grid-column: 1 / -1; }
}

/* Telas de intake (M1) e de analises de contrato (M2).
   Semaforo de risco e situacao das capturas e analises. Sem cor nova: as
   variaveis sao as mesmas ja usadas pelos demais badges do painel. */
.badge.alto { color: #ffc9c9; border-color: rgba(229, 133, 133, .32); background: rgba(229, 133, 133, .12); }
.badge.medio { color: #ffe0a8; border-color: rgba(229, 189, 107, .32); background: rgba(229, 189, 107, .12); }
.badge.baixo { color: #bff2dd; border-color: rgba(114, 214, 181, .32); background: rgba(114, 214, 181, .1); }
.badge.capturado, .badge.analisado { color: #ffe0a8; border-color: rgba(229, 189, 107, .32); background: rgba(229, 189, 107, .12); }
.badge.triado, .badge.revisado { color: #bff2dd; border-color: rgba(114, 214, 181, .32); background: rgba(114, 214, 181, .1); }
.badge.descartado { color: var(--quiet); border-color: var(--line); background: rgba(255, 255, 255, .028); }
