/* LudoLex — extensões sobre o design system FlexAdmin.
   Nunca sobrescreve tokens do template; apenas complementa. */

/* Avatar fallback com iniciais (usuários sem foto) */
.ludolex-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bs-primary, #4f6df5);
  color: #fff;
  font-weight: 700;
  font-family: var(--heading-font);
  text-transform: uppercase;
}

/* Botões de logout dentro de <form> mantendo o visual de link do template */
.ludolex-logout-btn {
  background: none;
  border: 0;
  padding: 0;
  width: 100%;
  text-align: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.mobile-menu-item-form {
  display: contents;
}

.ludolex-messages {
  margin-bottom: 1rem;
}

/* Alpine.js: esconde elementos x-cloak até o framework inicializar */
[x-cloak] {
  display: none !important;
}

/* === Identidade LudoLex + Lia (chat de triagem) ========================== */
/* Paleta do design: teal #0ea5a4, hover #0b8583, claro #22d3ce, bolha #eef6f6 */

.intake-page .brand-word {
  font-family: var(--heading-font);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.015em;
  color: #0f172a;
}

.intake-step-seg {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: #e2e8f0;
}

.intake-step-seg.filled {
  background: #0ea5a4;
}

.lia-strip {
  background: #f6fbfb;
  border-bottom: 1px solid #eef2f6;
  border-radius: var(--bs-card-border-radius, 0.75rem) var(--bs-card-border-radius, 0.75rem) 0 0;
}

.lia-avatar {
  border-radius: 50%;
  display: block;
}

.lia-presence {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22d3ce;
  border: 2px solid #f6fbfb;
}

.lia-presence.off {
  background: #cbd5e1;
}

.lia-seal {
  color: #64748b;
  background: #f6fbfb;
  border: 1px solid #dcefee;
  border-radius: 999px;
  padding: 6px 14px;
}

.btn-human {
  border: 1px solid #cbe9e8;
  border-radius: 999px;
  color: #0b8583;
  font-weight: 600;
  background: #ffffff;
}

.btn-human:hover:not(:disabled) {
  background: #f0fafa;
  border-color: #9fd9d7;
  color: #0b8583;
}

.intake-chat-body {
  height: min(70vh, 720px);
  min-height: 460px;
}

.intake-page .chat-bubble {
  padding: 11px 15px;
  font-size: 14px;
  line-height: 1.55;
}

.intake-page .chat-bubble-agent {
  background: #eef6f6;
  color: #0f172a;
  border-radius: 14px 14px 14px 4px;
}

/* #0b7c7b: contraste 4,6:1 com branco (WCAG AA) */
.intake-page .chat-bubble-user {
  background: #0b7c7b;
  color: #ffffff;
  border-radius: 14px 14px 4px 14px;
}

.intake-done {
  background: #f6fbfb;
  border: 1px solid #dcefee;
  border-radius: 14px;
  color: #475569;
  text-align: left;
}

.intake-page .chat-input {
  border-radius: 999px;
  padding-left: 18px;
  min-height: 44px;
}

.intake-page .btn-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #0ea5a4;
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.intake-page .btn-send:hover:not(:disabled) {
  background: #0b8583;
  color: #ffffff;
}

.intake-page .btn-send:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  opacity: 1;
}

.intake-page .btn-clip {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #c9e2e1;
  background: #ffffff;
  color: #0b8583;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.intake-page .btn-clip:hover:not(:disabled) {
  background: #f0fafa;
  border-color: #9fd9d7;
}

.intake-page .btn-clip:disabled {
  color: #94a3b8;
  border-color: #e2e8f0;
}

.lia-avatar-sm {
  width: 30px;
  height: 30px;
}

.lia-avatar-hidden {
  visibility: hidden;
}

/* --- Cartões no fluxo do chat (D-032): formulário, qualificação, bem-estar --- */

/* alinha com as bolhas da Lia (avatar 30px + gap 8px) */
.intake-inline-card {
  margin-left: 38px;
}

.intake-card {
  background: #ffffff;
  border: 1px solid #c9e2e1;
  border-radius: 14px;
  padding: 16px;
}

.intake-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.intake-field label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.intake-field label .opt {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.intake-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d5e3e2;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  color: #0f172a;
  background: #ffffff;
}

.intake-field input:focus {
  outline: none;
  border-color: #0ea5a4;
  box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.18);
}

/* campos preenchidos pelo navegador ficam verdes — "só conferir" */
.intake-field input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #eef8f5 inset;
  -webkit-text-fill-color: #0f172a;
}

.intake-field input:autofill {
  box-shadow: 0 0 0 1000px #eef8f5 inset;
}

.intake-card-btn {
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 12px;
  background: #0ea5a4;
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
}

.intake-card-btn:hover:not(:disabled) {
  background: #0b8583;
  color: #ffffff;
}

.intake-card-btn:disabled {
  background: #cbd5e1;
  color: #ffffff;
  opacity: 1;
}

.intake-card-hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 12px;
  color: #7c8ea3;
}

.intake-form-error {
  color: #b91c1c;
  font-size: 13px;
  margin: 0 0 8px;
}

.intake-qgroup {
  border: 0;
  padding: 0;
  margin: 0 0 12px;
  min-width: 0;
}

.intake-qgroup legend {
  float: none;
  width: auto;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 6px;
}

.intake-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.intake-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #c9d8ec;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.intake-chip:hover:not(:disabled) {
  background: #f6fbfb;
  border-color: #9fd9d7;
  color: #0f172a;
}

.intake-chip:disabled {
  opacity: 0.6;
  cursor: default;
}

.intake-chip.selected {
  background: #e6f5f5;
  border-color: #0ea5a4;
  color: #0b6665;
  font-weight: 600;
}

.intake-chip-primary {
  border-color: #0ea5a4;
  color: #0b8583;
  font-weight: 600;
}

.intake-chip-help,
.intake-chip-help:hover {
  background: #b45309;
  border-color: #b45309;
  color: #ffffff;
  font-weight: 600;
}

.intake-chips-hint {
  width: 100%;
  font-size: 12px;
  color: #7c8ea3;
  margin-top: 6px;
}

.intake-checkin {
  background: #fdf9f3;
  border: 1px solid #f0e2c8;
  border-radius: 14px;
  padding: 14px 16px;
}

.intake-checkin-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fdebc8;
  color: #b45309;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.intake-checkin-title {
  font-weight: 700;
  color: #0f172a;
  font-size: 14px;
}

.intake-checkin-note {
  font-size: 12px;
  color: #7c5a2b;
  margin-top: 10px;
}

.intake-pause-link {
  color: #0b8583;
  font-weight: 600;
  text-decoration: none;
}

.intake-pause-note {
  background: #f6fbfb;
  border: 1px solid #dcefee;
  border-radius: 12px;
  padding: 8px 12px;
  color: #475569;
}

/* Alvos de toque ≥ 44px no celular */
@media (max-width: 575.98px) {
  .intake-inline-card {
    margin-left: 0;
  }

  .intake-chip {
    min-height: 44px;
    padding: 10px 14px;
  }
}

/* ---------------------------------------------------------------------------
   Fase 6 — Análise Financeira: badges de proveniência e heatmap
   ------------------------------------------------------------------------ */

/* Proveniência do dado (Seção 0.4): a interface SEMPRE diferencia */
.badge-source-parsed {
  background: #e6f5f5;
  color: #0b6665;
  border: 1px solid #0ea5a4;
  font-size: 0.65rem;
  letter-spacing: 0.02em;
}

.badge-source-ai-labeled {
  background: #fff7e6;
  color: #8a5a00;
  border: 1px solid #e0a800;
  font-size: 0.65rem;
  letter-spacing: 0.02em;
}

.badge-source-ai-generated {
  background: #f3e8ff;
  color: #5b21b6;
  border: 1px solid #8b5cf6;
  font-size: 0.65rem;
  letter-spacing: 0.02em;
}

/* D-025: prováveis apostas fora do cadastro — valor PARSED, classificação por indício */
.badge-source-likely {
  background: #fff1e6;
  color: #9a3412;
  border: 1px solid #f97316;
  font-size: 0.65rem;
  letter-spacing: 0.02em;
}

/* D-028: afirmação obtida por pesquisa web, sempre com URL citada */
.badge-source-web {
  background: #e0f2fe;
  color: #0c4a6e;
  border: 1px solid #0284c7;
  font-size: 0.65rem;
  letter-spacing: 0.02em;
}

/* D-028: modal da análise aprofundada (Alpine, sem depender do JS do Bootstrap) */
.deep-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.deep-modal {
  width: 600px;
  max-width: 100%;
  max-height: 92vh;
  overflow: auto;
  margin: 0;
}

.deep-level {
  display: block;
  border: 1px solid var(--border-color, #dde5f1);
  border-radius: var(--radius-md, 0.5rem);
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
}

.deep-level.active {
  border-color: var(--accent-color, #0ea5a4);
  background: var(--sidebar-hover-bg, rgba(14, 165, 164, 0.1));
}

.deep-level input {
  margin-right: 8px;
}

.deep-estimate {
  border: 1px solid var(--warning-color, #d97706);
  background: var(--warning-color-light, #ffedd5);
  border-radius: var(--radius-md, 0.5rem);
  padding: 10px 12px;
}

/* D-019: transcrito pela IA de documento escaneado e conferido em Python */
.badge-source-ai-extracted {
  background: #e8f1ff;
  color: #1e40af;
  border: 1px solid #3b82f6;
  font-size: 0.65rem;
  letter-spacing: 0.02em;
}

/* Heatmap dia × faixa de hora (grade CSS — Chart.js não tem heatmap nativo) */
.heatmap-grid {
  display: grid;
  grid-template-columns: 42px repeat(8, 1fr);
  gap: 3px;
  font-size: 0.7rem;
}

.heatmap-col-label,
.heatmap-row-label {
  color: var(--bs-secondary-color, #6c757d);
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.heatmap-row-label {
  justify-content: flex-end;
  padding-right: 4px;
}

.heatmap-cell {
  aspect-ratio: 2 / 1;
  min-height: 22px;
  border-radius: 4px;
  background: rgba(14, 165, 164, calc(0.08 + var(--heat, 0) * 0.85));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.heatmap-cell[style="--heat: 0"],
.heatmap-cell[style="--heat: 0.0"] {
  color: transparent;
}

.table-warning-subtle {
  background: rgba(224, 168, 0, 0.07);
}

.insight-critico summary {
  color: #b02a37;
}

/* ---------------------------------------------------------------------------
   Painel "Análise Financeira" — KPIs, navegação por seção, gráficos, fila,
   filtros e insights. Só variáveis do tema (modo escuro preservado).
   ------------------------------------------------------------------------ */

.analysis-page .page-header {
  margin-bottom: var(--spacing-md);
}

.analysis-page .page-header .blank-subtitle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0;
}

/* Navegação por seções: pílulas que acompanham a rolagem */
.analysis-nav {
  position: sticky;
  top: calc(var(--header-height, 64px) + 8px);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
  margin-bottom: var(--spacing-lg);
  background: color-mix(in srgb, var(--surface-color, #fff) 90%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color, #dde5f1);
  border-radius: var(--radius-full, 999px);
  box-shadow: var(--shadow-sm);
}

.analysis-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full, 999px);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted-color, #5f6e83);
  text-decoration: none;
  transition: background var(--transition-fast, 150ms), color var(--transition-fast, 150ms);
}

.analysis-nav a:hover {
  background: var(--sidebar-hover-bg, rgba(14, 165, 164, 0.1));
  color: var(--accent-color, #0ea5a4);
}

.analysis-nav a.active {
  background: var(--accent-color, #0ea5a4);
  color: #ffffff;
}

.analysis-nav a .badge {
  font-size: 0.65rem;
}

.analysis-section {
  scroll-margin-top: calc(var(--header-height, 64px) + 68px);
  margin-bottom: var(--spacing-lg);
}

.analysis-section-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 var(--spacing-md);
  font-family: var(--heading-font);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--heading-color);
}

.analysis-section-title .icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sidebar-hover-bg, rgba(14, 165, 164, 0.1));
  color: var(--accent-color, #0ea5a4);
  font-size: 1rem;
}

.analysis-section-title small {
  font-family: var(--default-font);
  font-weight: 500;
  color: var(--muted-color);
  font-size: 0.8125rem;
}

.analysis-section-title .ms-auto {
  margin-left: auto;
}

/* KPIs */
.kpi-card {
  position: relative;
  overflow: hidden;
  height: 100%;
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--kpi-accent, var(--accent-color, #0ea5a4));
}

.kpi-card .card-body {
  padding: var(--spacing-md) var(--spacing-lg);
}

.kpi-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.kpi-label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  color: var(--muted-color);
}

.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--kpi-accent, var(--accent-color)) 12%, transparent);
  color: var(--kpi-accent, var(--accent-color));
  font-size: 1.05rem;
  flex-shrink: 0;
}

.kpi-value {
  font-family: var(--heading-font);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--heading-color);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  margin-top: 6px;
}

.kpi-value.accent {
  color: var(--kpi-accent, var(--accent-color));
}

.kpi-meta {
  font-size: 0.78rem;
  color: var(--muted-color);
  margin-top: 4px;
}

.kpi-meta strong {
  color: var(--default-color);
  font-weight: 600;
}

.kpi-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.kpi-split div {
  font-size: 0.75rem;
  color: var(--muted-color);
}

.kpi-split strong {
  display: block;
  font-size: 0.95rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-family: var(--heading-font);
}

.kpi-danger {
  --kpi-accent: #dc2626;
}

.kpi-warning {
  --kpi-accent: #ea580c;
}

.kpi-teal {
  --kpi-accent: #0ea5a4;
}

.kpi-slate {
  --kpi-accent: #475569;
}

/* Gráficos com altura fixa (Chart.js em maintainAspectRatio: false) */
.chart-box {
  position: relative;
  height: 300px;
}

.chart-box.tall {
  height: 340px;
}

.chart-box.short {
  height: 250px;
}

.chart-hint {
  font-size: 0.75rem;
  color: var(--muted-color);
  margin-top: 8px;
}

/* Tabelas: números alinhados e cabeçalho pegajoso com fundo do tema */
.analysis-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-color);
  font-weight: 600;
  white-space: nowrap;
}

.analysis-table td {
  font-size: 0.8125rem;
  vertical-align: middle;
}

.analysis-table .num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}

.analysis-table thead.sticky-top th {
  background: var(--surface-color, #fff);
  box-shadow: inset 0 -1px 0 var(--border-color);
}

.table-scroll {
  max-height: 60vh;
  overflow: auto;
}

.tx-in {
  color: var(--success-color, #16a34a);
}

.tx-out {
  color: var(--danger-color, #dc2626);
}

/* Barra de filtros das transações */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter-bar .form-control,
.filter-bar .form-select {
  min-height: 34px;
}

.filter-bar .input-icon {
  position: relative;
}

.filter-bar .input-icon i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-color);
  font-size: 0.85rem;
  pointer-events: none;
}

.filter-bar .input-icon input {
  padding-left: 30px;
}

/* ------------------------------------------------------------------ */
/* Estúdio de documentos — editor da peça + assistente de redação (D-031) */
/* ------------------------------------------------------------------ */
.studio-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 1299px) {
  .studio-editor-layout {
    grid-template-columns: 1fr;
  }
}

.studio-statusbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--muted-color);
  margin-bottom: 8px;
}

.studio-save-state.is-error {
  color: var(--danger-color);
}

.studio-toolbar.ql-toolbar.ql-snow {
  position: sticky;
  top: calc(var(--header-height) + 8px);
  z-index: 20;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 6px 8px;
}

.studio-toolbar .ql-formats button i {
  font-size: 1rem;
  line-height: 1;
  color: var(--default-color);
}

.studio-page-wrap {
  /* ancora dos popovers de lacuna e de trecho da IA */
  position: relative;
  background: var(--background-color);
  padding: 20px 8px 48px;
  border-radius: var(--radius-lg);
  margin-top: 12px;
}

.studio-page {
  background: #fff;
  color: #111;
  width: 100%;
  max-width: 21cm;
  min-height: 29.7cm;
  margin: 0 auto;
  padding: 2.5cm 2.5cm 3cm;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
}

.studio-page .ql-container.ql-snow {
  border: none;
  font-family: "Times New Roman", Georgia, serif;
  font-size: 12pt;
}

/* a folha é "papel" nos dois temas — o FlexAdmin pinta .ql-editor no tema escuro */
.studio-page .ql-editor,
[data-theme="dark"] .studio-page .ql-editor {
  padding: 0;
  min-height: 24cm;
  line-height: 1.6;
  background: #fff;
  color: #111;
}

.studio-page .ql-editor.ql-blank::before {
  left: 0;
  color: #9aa4b2;
  font-style: normal;
}

.studio-page .ql-editor h1 {
  font-size: 14pt;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  margin: 0 0 18pt;
}

.studio-page .ql-editor h2 {
  font-size: 12pt;
  font-weight: 700;
  margin: 16pt 0 6pt;
}

.studio-page .ql-editor h3 {
  font-size: 12pt;
  font-style: italic;
  margin: 12pt 0 6pt;
}

.studio-page .ql-editor p {
  margin: 0 0 8pt;
  text-align: justify;
}

.studio-page .ql-editor blockquote {
  margin: 8pt 0 8pt 1.5cm;
  border-left: 3px solid #cbd5e1;
  padding-left: 12px;
  font-style: italic;
}

.studio-page .ql-editor mark.ai-draft,
.chat-suggestion-preview mark.ai-draft {
  background: #fff3a8;
  padding: 0 2px;
  border-bottom: 2px solid #e0a800;
}

/* rótulos do Quill em PT-BR */
.ql-snow .ql-picker.ql-header .ql-picker-label::before,
.ql-snow .ql-picker.ql-header .ql-picker-item::before {
  content: "Texto";
}

.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before {
  content: "Título";
}

.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
  content: "Seção";
}

.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
  content: "Subseção";
}

.ql-snow .ql-tooltip::before {
  content: "Abrir:";
}

.ql-snow .ql-tooltip[data-mode="link"]::before {
  content: "Endereço:";
}

.ql-snow .ql-tooltip a.ql-action::after {
  content: "Editar";
}

.ql-snow .ql-tooltip.ql-editing a.ql-action::after {
  content: "Salvar";
}

.ql-snow .ql-tooltip a.ql-remove::before {
  content: "Remover";
}

[data-theme="dark"] .ql-snow .ql-stroke {
  stroke: var(--default-color);
}

[data-theme="dark"] .ql-snow .ql-fill {
  fill: var(--default-color);
}

[data-theme="dark"] .ql-snow .ql-picker,
[data-theme="dark"] .ql-snow .ql-picker-options {
  color: var(--default-color);
  background: var(--card-bg);
}

/* painel lateral */
.studio-panel {
  position: sticky;
  top: calc(var(--header-height) + 8px);
  max-height: calc(100vh - var(--header-height) - 24px);
  display: flex;
  flex-direction: column;
  margin: 0;
}

.studio-panel-body {
  overflow: auto;
  min-height: 0;
}

.studio-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.studio-quick-actions .btn {
  font-size: 0.75rem;
}

.studio-compose textarea {
  resize: vertical;
}

.assistant-scroll {
  min-height: 160px;
}

.assistant-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-bubble {
  border-radius: var(--radius-md);
  padding: 8px 10px;
  font-size: 0.84rem;
}

.chat-user {
  background: var(--sidebar-hover-bg, rgba(14, 165, 164, 0.1));
  align-self: flex-end;
  max-width: 94%;
}

.chat-assistant {
  background: var(--table-header-bg, #edf3fb);
  border: 1px solid var(--border-color);
}

.chat-error {
  background: var(--warning-color-light, #fff7e6);
}

.chat-text p:last-child {
  margin-bottom: 0;
}

.chat-suggestion {
  border: 1px dashed var(--border-color-dark, #c4d2e6);
  border-radius: var(--radius-md);
  padding: 8px;
  margin-top: 8px;
  background: var(--card-bg);
}

.chat-suggestion-preview {
  font-family: "Times New Roman", Georgia, serif;
  font-size: 0.85rem;
  max-height: 200px;
  overflow: auto;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 243, 168, 0.35);
}

.chat-suggestion-preview p:last-child {
  margin-bottom: 0;
}

.chat-warning {
  color: var(--warning-color);
  font-size: 0.78rem;
  margin-top: 6px;
}

.studio-facts .btn {
  white-space: normal;
}

/* Filtro ao vivo: a tabela esmaece enquanto o HTMX busca o novo recorte */
#analysis-transactions .table-scroll {
  transition: opacity 0.15s ease;
}

#analysis-transactions.htmx-request .table-scroll {
  opacity: 0.45;
}

/* Upload (dropzone) */
.dropzone {
  border: 2px dashed var(--border-color-dark, #c4d2e6);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--background-color, #f4f7fb);
  transition: border-color var(--transition-fast, 150ms), background var(--transition-fast, 150ms);
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--accent-color);
  background: var(--sidebar-hover-bg, rgba(14, 165, 164, 0.08));
}

.dropzone i {
  font-size: 1.7rem;
  color: var(--accent-color);
}

.dropzone-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
}

.dropzone-files span {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.75rem;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Fila de documentos */
.doc-name {
  font-weight: 600;
  color: var(--heading-color);
  word-break: break-word;
}

.doc-meta {
  font-size: 0.75rem;
  color: var(--muted-color);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-done {
  background: var(--success-color-light, #dcfce7);
  color: #15803d;
}

.status-review {
  background: var(--warning-color-light, #ffedd5);
  color: #b45309;
}

.status-active {
  background: var(--info-color-light, #e0f2fe);
  color: #0369a1;
}

.status-error {
  background: var(--danger-color-light, #fee2e2);
  color: #b91c1c;
}

.status-queued {
  background: var(--border-color-light, #eef3fa);
  color: var(--muted-color);
}

.queue-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.75rem;
  color: var(--muted-color);
}

.queue-counts b {
  color: var(--default-color);
}

/* Insights */
.insight {
  border: 1px solid var(--border-color);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--surface-color);
}

.insight-critico {
  border-left-color: var(--danger-color, #dc2626);
}

.insight-atencao {
  border-left-color: var(--warning-color, #d97706);
}

.insight-info {
  border-left-color: var(--info-color, #0284c7);
}

.insight summary {
  cursor: pointer;
  list-style: none;
}

/* D-029: insight descartado pelo advogado fica visível, porém apagado */
.insight-discarded {
  opacity: 0.6;
  border-left-color: var(--light-color, #8ea0b8);
}

.insight summary::-webkit-details-marker {
  display: none;
}

.insight summary .chev {
  margin-left: auto;
  color: var(--light-color);
  transition: transform var(--transition-fast, 150ms);
}

.insight[open] summary .chev {
  transform: rotate(90deg);
}

/* Fila de confirmação de operadoras */
.match-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 8px;
}

/* Resumo executivo */
.summary-body p {
  margin-bottom: 0.75rem;
}

.summary-scope-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-color);
  font-weight: 600;
}

/* Legenda de escala do heatmap */
.heat-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--muted-color);
  margin-top: 10px;
}

.heat-legend .bar {
  flex: 0 0 120px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(14, 165, 164, 0.08), rgba(14, 165, 164, 0.93));
}

/* Legenda de proveniência (<details> no cabeçalho — abre sem JS) */
.provenance-details {
  position: relative;
  display: inline-block;
}

.provenance-details summary {
  list-style: none;
  cursor: pointer;
  color: var(--accent-color, #0ea5a4);
  font-size: 0.875rem;
}

.provenance-details summary::-webkit-details-marker {
  display: none;
}

.provenance-details summary:hover {
  text-decoration: underline;
}

.provenance-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 20;
  width: 360px;
  max-width: 90vw;
  padding: 12px 14px;
  background: var(--surface-color, #fff);
  border: 1px solid var(--border-color, #dde5f1);
  border-radius: var(--radius-lg, 0.75rem);
}

.provenance-menu .row-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 5px 0;
  font-size: 0.78rem;
  color: var(--default-color);
}

.provenance-menu .row-item .badge {
  flex-shrink: 0;
  margin-top: 1px;
}

/* Estados vazios */
.empty-state {
  text-align: center;
  padding: 28px 16px;
  color: var(--muted-color);
  font-size: 0.875rem;
}

.empty-state i {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 6px;
  color: var(--light-color);
}

/* Cláusulas de contrato */
.clause-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.clause-card blockquote {
  border-left: 3px solid var(--border-color-dark, #c4d2e6);
  padding-left: 10px;
  margin: 6px 0;
}

/* ---------------------------------------------------------------------------
   Estúdio de documentos — catálogo de modelos, conferência e revisão (D-035)

   Prefixo `model-` e não `catalog-`: os catálogos configuráveis da Controladoria
   já usam `.catalog-grid` e `.catalog-card` mais adiante neste arquivo, com
   colunas de 200px. Como aquela definição vem depois, era ela que vencia aqui —
   o estúdio ganhava seis trilhas estreitas e cada grupo de dois ou três modelos
   deixava metade da linha vazia. Dois componentes diferentes, dois nomes.
   ------------------------------------------------------------------------ */

.model-group + .model-group {
  margin-top: var(--spacing-lg);
}

.model-group-title {
  font-family: var(--heading-font);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-color);
  margin-bottom: 8px;
}

/* Três colunas nesta largura: o catálogo tem 14 modelos em grupos de 3, 2, 3,
   3, 1 e 2, e com três trilhas metade dos grupos preenche a linha exatamente.
   `auto-fill` mantém a largura do card igual entre os grupos — com `auto-fit`,
   o grupo de um modelo viraria um card de 1300px. */
.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.model-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg, 0.75rem);
  background: var(--card-bg);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--transition-fast, 150ms), box-shadow var(--transition-fast, 150ms);
}

.model-card:hover {
  border-color: var(--accent-color);
  box-shadow: var(--shadow-sm);
  color: inherit;
}

.model-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.model-badge {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-color);
}

.model-card-title {
  font-family: var(--heading-font);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--heading-color);
  line-height: 1.3;
}

.model-card-text {
  font-size: 0.78rem;
  color: var(--muted-color);
  margin: 0;
  flex-grow: 1;
}

.model-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--muted-color);
}

.model-cta {
  color: var(--accent-color);
  font-weight: 600;
  white-space: nowrap;
}

/* Painel de revisão */
.review-block + .review-block {
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-color-light, #eef3fa);
}

.review-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.review-title {
  font-family: var(--heading-font);
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--heading-color);
}

.review-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.review-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.review-pill.sev-critico {
  background: #fee2e2;
  color: #b91c1c;
}

.review-pill.sev-atencao {
  background: #fef3c7;
  color: #92400e;
}

.review-pill.sev-info {
  background: #e2e8f0;
  color: #475569;
}

.review-pill.sev-ok {
  background: #dcfce7;
  color: #166534;
}

.review-pill.sev-off {
  background: #f1f5f9;
  color: #64748b;
}

.review-finding {
  padding: 8px 10px;
  margin-bottom: 6px;
  border: 1px solid var(--border-color-light, #eef3fa);
  border-left: 3px solid var(--border-color-dark, #c4d2e6);
  border-radius: var(--radius-md, 0.5rem);
  background: var(--card-bg);
}

.review-finding.sev-critico {
  border-left-color: #dc2626;
}

.review-finding.sev-atencao {
  border-left-color: #ea580c;
}

.review-finding.sev-info {
  border-left-color: #94a3b8;
}

.review-finding.decision-aplicado,
.review-finding.decision-dispensado {
  opacity: 0.62;
}

.review-finding-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.review-finding-title {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--heading-color);
}

.review-finding-text {
  font-size: 0.78rem;
  color: var(--default-color);
  margin: 0 0 4px;
}

.review-suggestion {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: var(--radius-sm, 0.35rem);
  background: rgba(255, 243, 168, 0.35);
}

.review-suggestion-text {
  font-size: 0.78rem;
  font-family: "Times New Roman", Georgia, serif;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.review-actions .btn {
  font-size: 0.72rem;
}

.review-ok {
  font-size: 0.8rem;
  color: #15803d;
  padding: 6px 0;
}

.review-running {
  font-size: 0.8rem;
  color: var(--muted-color);
  padding: 8px 0;
}

.review-meta,
.review-summary {
  font-size: 0.78rem;
  color: var(--muted-color);
  margin-bottom: 6px;
}

.review-summary {
  color: var(--default-color);
}

.review-sub {
  margin-top: 8px;
  font-size: 0.78rem;
}

.review-sub h6 {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted-color);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.review-confirm {
  border: 1px solid #fde68a;
  background: #fffbeb;
  border-radius: var(--radius-md, 0.5rem);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.review-focus {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
}

.clause-group {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-color);
  margin: 10px 0 6px;
}

/* ---------------------------------------------------------------------------
   Dashboard (D-034): resumo acionável, KPIs com estado, "Atenção agora",
   funil em barras, vazios colapsados, equipe e aniversariantes.
   ------------------------------------------------------------------------ */

.dash-subtitle {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted-color);
}

.dash-late {
  color: #b91c1c;
  font-weight: 700;
}

.dash-section-title {
  margin: 0 0 10px;
  font-family: var(--heading-font);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-color);
}

a.kpi-card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: box-shadow var(--transition-fast, 150ms), transform var(--transition-fast, 150ms);
}

a.kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md, 0 8px 20px rgba(15, 23, 42, 0.08));
}

.kpi-card.kpi-alert {
  --kpi-accent: #dc2626;
  border-color: #fecaca;
}

.kpi-value.neutral {
  color: #94a3b8;
}

.kpi-value small {
  margin-left: 6px;
  font-family: var(--default-font);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted-color);
}

.kpi-meta.ok {
  color: #15803d;
}

.kpi-meta.warn {
  color: #b91c1c;
}

/* Atenção agora */
.attn-card {
  border-color: #fecaca;
}

.attn-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
}

.attn-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.attn-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color-light, #eef3fa);
}

.attn-row:last-child {
  border-bottom: 0;
}

.attn-form,
.attn-row.done {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  margin: 0;
}

.attn-row.done {
  grid-template-columns: 24px minmax(0, 1fr);
  opacity: 0.75;
}

.attn-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: 0;
  cursor: pointer;
}

.attn-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #16a34a;
  cursor: pointer;
}

.attn-check.done {
  color: #16a34a;
  font-size: 1.1rem;
}

.attn-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.attn-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 600;
  color: var(--heading-color);
  text-decoration: none;
}

.attn-context {
  font-size: 0.75rem;
  color: var(--muted-color);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.attn-late,
.attn-today {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.attn-late {
  background: #fee2e2;
  color: #b91c1c;
}

.attn-today {
  background: #e6f5f5;
  color: #0b6665;
}

.attn-points {
  font-size: 0.78rem;
  color: var(--muted-color);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.attn-footer {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 0.8rem;
}

.attn-footer.pending {
  background: #f8fafc;
  border-color: var(--border-color);
  color: var(--muted-color);
}

@media (max-width: 575.98px) {
  .attn-form {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .attn-late,
  .attn-today,
  .attn-points,
  .attn-btn {
    grid-column: 2;
    justify-self: start;
  }
}

/* Funil de leads em barras (CSS puro). Prefixo `dash-` porque Relatórios (D-045)
   tem um funil próprio, com outra estrutura: lá `.funnel-bar` é a própria barra
   com nome e contagem dentro, e as regras de lá venciam por vir depois — a
   trilha daqui ficava com 96px e a barra vazava dela (D-058). */
.dash-funnel-row {
  display: grid;
  grid-template-columns: minmax(96px, 30%) 1fr 36px;
  gap: 10px;
  align-items: center;
  padding: 5px 0;
}

.dash-funnel-label {
  text-align: right;
  font-size: 0.8rem;
  color: var(--default-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-funnel-track {
  height: 10px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--border-color-light, #eef3fa);
  overflow: hidden;
}

.dash-funnel-bar {
  height: 100%;
  min-width: 2px;
  border-radius: 999px;
}

.dash-funnel-count {
  text-align: right;
  font-family: var(--heading-font);
  font-variant-numeric: tabular-nums;
}

.dash-funnel-insight {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.8rem;
}

/* Rail: vazios colapsados em uma linha */
.rail-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  font-size: 0.82rem;
  color: var(--muted-color);
  border-bottom: 1px dashed var(--border-color-light, #eef3fa);
}

.rail-empty:last-child {
  border-bottom: 0;
}

.rail-empty i {
  color: #16a34a;
}

/* Equipe */
.team-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
}

.team-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--heading-font);
  font-size: 0.8rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #475569;
}

.team-avatar.leader {
  background: #0ea5a4;
  color: #ffffff;
}

.team-name {
  font-size: 0.85rem;
  color: var(--default-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-track {
  height: 6px;
  margin-top: 4px;
  border-radius: 999px;
  background: #f1f5f9;
  overflow: hidden;
}

.team-bar {
  height: 100%;
  border-radius: 999px;
  background: #0ea5a4;
}

.team-points {
  text-align: right;
  font-family: var(--heading-font);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.team-note,
.bday-note {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--muted-color);
}

/* Aniversariantes */
.bday-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-color-light, #eef3fa);
}

.bday-row:last-of-type {
  border-bottom: 0;
}

.bday-badge {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.72rem;
  white-space: nowrap;
}

.bday-badge.today {
  background: #e6f5f5;
  color: #0b6665;
}

/* ---------------------------------------------------------------------------
   Funil de leads (D-036): card sem redundância, idade em 3 faixas, filtros em
   pílulas, colunas paginadas e descarte colapsado.
   ------------------------------------------------------------------------ */

/* Grade de viabilidade: mesma linguagem no card, no dossiê e na ficha da pessoa */
.grade-badge {
  display: inline-block;
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.grade-badge.grade-a {
  background: #dcfce7;
  color: #15803d;
}

.grade-badge.grade-b {
  background: #e0f2fe;
  color: #0369a1;
}

.grade-badge.grade-c {
  background: #fef3c7;
  color: #92400e;
}

.grade-badge.grade-d {
  background: #fee2e2;
  color: #b91c1c;
}

/* Idade na etapa: 3 faixas em vez do binário do SLA — 5d e 13d não gritam igual */
.age-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.age-badge i {
  font-size: 0.72rem;
}

.age-badge.age-ok {
  background: #f1f5f9;
  color: #526175;
}

.age-badge.age-warn {
  background: #fef3c7;
  color: #92400e;
}

.age-badge.age-crit {
  background: #fee2e2;
  color: #b91c1c;
}

/* --- Barra de filtros: pílulas numa linha, sem botão de submissão -------- */
.lead-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.lead-search {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lead-search i {
  position: absolute;
  left: 11px;
  color: var(--muted-color);
  font-size: 0.85rem;
  pointer-events: none;
}

.lead-search input {
  width: 240px;
  height: 34px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface-color);
  color: var(--default-color);
  font-size: 0.82rem;
}

.lead-search input:focus {
  border-color: var(--accent-color);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.14);
}

.grade-pills {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface-color);
}

.grade-pills-label {
  margin-right: 2px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-color);
}

.grade-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  opacity: 0.5;
  transition: opacity var(--transition-fast, 150ms), border-color var(--transition-fast, 150ms);
}

.grade-pill:hover,
.grade-pill.is-active {
  opacity: 1;
}

.grade-pill.is-active {
  border-color: currentcolor;
}

.grade-pill.grade-a {
  background: #dcfce7;
  color: #15803d;
}

.grade-pill.grade-b {
  background: #e0f2fe;
  color: #0369a1;
}

.grade-pill.grade-c {
  background: #fef3c7;
  color: #92400e;
}

.grade-pill.grade-d {
  background: #fee2e2;
  color: #b91c1c;
}

.lead-filter-select {
  height: 34px;
  max-width: 200px;
  padding: 0 10px 0 14px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface-color);
  color: var(--default-color);
  font-size: 0.82rem;
  cursor: pointer;
}

.lead-filter-select:focus {
  border-color: var(--accent-color);
  outline: 0;
}

/* "Sem responsável" deixa de ser texto morto: o chip é o atalho para os órfãos */
.lead-orphan-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid #fcd34d;
  border-radius: 999px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.79rem;
  text-decoration: none;
  white-space: nowrap;
}

.lead-orphan-chip:hover,
.lead-orphan-chip.is-active {
  border-color: #f59e0b;
  background: #fef3c7;
  color: #92400e;
}

.lead-filters-note {
  font-size: 0.74rem;
  color: var(--muted-color);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.filter-chips-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-color);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface-color);
  color: var(--default-color);
  font-size: 0.76rem;
  text-decoration: none;
}

.filter-chip:hover {
  border-color: #fca5a5;
  color: #b91c1c;
}

.filter-chip-clear {
  font-size: 0.74rem;
  color: var(--muted-color);
  text-decoration: underline;
}

.view-toggle {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface-color);
}

.view-toggle a {
  padding: 5px 16px;
  border-radius: 999px;
  color: var(--muted-color);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.view-toggle a.is-active {
  background: var(--accent-color);
  color: #ffffff;
}

/* --- Esteira e colunas --------------------------------------------------- */
.lead-board {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}

.lead-column {
  display: flex;
  flex: 0 0 305px;
  flex-direction: column;
  width: 305px;
  max-height: 820px;
  border: 1px solid #e0e8f3;
  border-radius: 14px;
  background: #eef2f8;
  scroll-snap-align: start;
}

.lead-column.is-collapsed {
  flex: 0 0 200px;
  width: 200px;
}

/* O cabeçalho não rola: só o corpo tem overflow */
.lead-column-head {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 7px;
  padding: 11px 12px 9px;
  border-bottom: 2px solid var(--stage-color, #cbd5e1);
}

.lead-stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--stage-color, #cbd5e1);
}

.lead-column-name {
  margin: 0;
  overflow: hidden;
  font-family: var(--heading-font);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--default-color);
}

.lead-column-count {
  padding: 1px 8px;
  border-radius: 999px;
  background: #ffffff;
  color: #526175;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.lead-stalled {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

.lead-column-menu {
  margin-left: auto;
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--muted-color);
  line-height: 1;
  cursor: pointer;
}

.lead-stalled + .lead-column-menu {
  margin-left: 0;
}

.lead-column-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  min-height: 90px;
  padding: 10px;
  overflow-y: auto;
}

.lead-column.is-collapsed .lead-column-body {
  min-height: 0;
  padding: 6px 10px 0;
}

.lead-column-empty {
  margin: 0;
  padding: 14px 0;
  text-align: center;
  font-size: 0.76rem;
  color: var(--muted-color);
}

.lead-more {
  flex-shrink: 0;
  margin: 0 10px 10px;
  padding: 7px 0;
  border: 1px dashed #c9d6e8;
  border-radius: 9px;
  text-align: center;
  font-size: 0.76rem;
  color: #526175;
  text-decoration: none;
}

.lead-more:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.lead-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding-top: 4px;
  font-size: 0.74rem;
  color: var(--muted-color);
}

.lead-legend-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lead-legend-hint {
  margin-left: auto;
}

/* --- Card: 1 linha de título, 1 de meta, 1 de rodapé --------------------- */
.lead-card {
  padding: 10px 12px;
  border: 1px solid #e3eaf4;
  border-radius: 12px;
  background: #ffffff;
  cursor: grab;
  transition: box-shadow var(--transition-fast, 150ms), border-color var(--transition-fast, 150ms);
}

.lead-card:hover {
  border-color: #c9d6e8;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.lead-card.is-dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.lead-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.lead-card-title {
  overflow: hidden;
  font-family: var(--heading-font);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--default-color);
  text-decoration: none;
}

/* Contraste 5,19:1 sobre branco — placeholder legível, não cinza fraco */
.lead-card-title.is-unnamed {
  color: #5f6e83;
  font-weight: 500;
  font-style: italic;
}

.lead-card-title:hover {
  color: var(--accent-color);
}

.lead-card-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 5px 0 9px;
  overflow: hidden;
  font-size: 0.73rem;
  white-space: nowrap;
  color: var(--muted-color);
}

.lead-card-source {
  overflow: hidden;
  text-overflow: ellipsis;
}

.lead-card-dot {
  opacity: 0.5;
}

.lead-card-phone {
  font-variant-numeric: tabular-nums;
}

.lead-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lead-card-actions {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
}

.lead-owner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  font-size: 0.74rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #526175;
}

.lead-owner-avatar {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #0ea5a4;
  color: #ffffff;
  font-family: var(--heading-font);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
}

.lead-owner-empty {
  font-style: italic;
  opacity: 0.75;
}

/* Botão que transforma "sem responsável" em ação de um toque */
.lead-assign {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border: 1px dashed #f59e0b;
  border-radius: 999px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.lead-assign:hover {
  border-style: solid;
  background: #fef3c7;
}

.lead-call {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface-color);
  color: #526175;
  font-size: 0.76rem;
  text-decoration: none;
}

.lead-call:hover {
  border-color: var(--accent-color);
  background: #e6f5f5;
  color: #0b7c7b;
}

.lead-dropzone.is-dragover {
  border: 2px dashed #0ea5a4;
  border-radius: 10px;
  background: rgba(14, 165, 164, 0.06);
}

/* Etapa na visão Lista, com a mesma cor do topo da coluna */
.stage-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface-color);
  font-size: 0.74rem;
  white-space: nowrap;
}

.stage-chip::before {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--stage-color, #cbd5e1);
  content: "";
}

@media (max-width: 640px) {
  .lead-column,
  .lead-column.is-collapsed {
    flex-basis: 86vw;
    width: 86vw;
  }

  .lead-search input {
    width: 100%;
  }
}

/* Popover de atribuição: um só no documento, reposicionado no clique */
.assign-popover {
  position: absolute;
  z-index: 1080;
  display: none;
  min-width: 190px;
  padding: 5px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--surface-color);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14);
}

.assign-popover.is-open {
  display: block;
}

.assign-option {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--default-color);
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}

.assign-option:hover {
  background: #e6f5f5;
  color: #0b7c7b;
}

.assign-option.is-me {
  font-weight: 700;
}

.assign-option.is-me + .assign-option {
  border-top: 1px solid var(--border-color-light);
  margin-top: 3px;
  padding-top: 9px;
}

/* ---------------------------------------------------------------------------
   Clientes e pessoas (D-037): tabela densa, filtros em pílulas, duplicatas.
   Prefixos próprios porque o main.css do FlexAdmin já tem componentes de
   tabela e de filtro — colidir com eles anula largura e altura em silêncio.
   ------------------------------------------------------------------------ */

.people-subtitle {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted-color);
}

/* --- Barra de filtros ---------------------------------------------------- */
.people-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.people-search {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.people-search i {
  position: absolute;
  left: 11px;
  color: var(--muted-color);
  font-size: 0.85rem;
  pointer-events: none;
}

.people-search input {
  width: 268px;
  height: 34px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface-color);
  color: var(--default-color);
  font-size: 0.82rem;
}

.people-search input:focus {
  border-color: var(--accent-color);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.14);
}

.pill-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface-color);
}

.pill-filter {
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--muted-color);
  font-size: 0.79rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.pill-filter b {
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
}

.pill-filter:hover {
  color: var(--accent-color);
}

.pill-filter.is-active {
  background: var(--accent-color);
  color: #ffffff;
}

.pill-filter.is-active b {
  opacity: 0.85;
}

.people-filter-select {
  height: 34px;
  max-width: 200px;
  padding: 0 10px 0 14px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface-color);
  color: var(--default-color);
  font-size: 0.82rem;
  cursor: pointer;
}

.people-filter-select:focus {
  border-color: var(--accent-color);
  outline: 0;
}

.chip-warn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid #fcd34d;
  border-radius: 999px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.79rem;
  text-decoration: none;
  white-space: nowrap;
}

.chip-warn b {
  font-variant-numeric: tabular-nums;
}

.chip-warn:hover,
.chip-warn.is-active {
  border-color: #f59e0b;
  background: #fef3c7;
  color: #92400e;
}

.people-filters-note {
  font-size: 0.74rem;
  color: var(--muted-color);
}

/* --- Tabela densa em grid ------------------------------------------------ */
.data-table {
  display: block;
  overflow-x: auto;
}

.data-table-head,
.data-table-row {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) 150px 160px 150px 130px 130px 120px;
  align-items: center;
  gap: 12px;
  min-width: 940px;
  padding: 0 16px;
}

.data-table-head {
  height: 40px;
  border-bottom: 1px solid var(--border-color);
  background: #edf3fb;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #526175;
}

.data-table-head a.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}

.data-table-head a.th-sort:hover,
.data-table-head a.th-sort.is-active {
  color: var(--accent-color);
}

.data-table-row {
  height: 56px;
  border-bottom: 1px solid var(--border-color-light);
  font-size: 0.8rem;
}

.data-table-row:last-of-type {
  border-bottom: 0;
}

.data-table-row:hover {
  background: #f7faff;
}

.data-table-empty {
  padding: 44px 16px;
  text-align: center;
  color: var(--muted-color);
}

.data-table-empty p {
  margin-bottom: 12px;
}

/* --- Célula do nome ------------------------------------------------------ */
.cell-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cell-name-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.avatar-initial {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-family: var(--heading-font);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.avatar-cliente {
  background: #e6f5f5;
  color: #0b6665;
}

.avatar-parte_contraria {
  background: #fee2e2;
  color: #b91c1c;
}

.avatar-terceiro {
  background: #eef2f7;
  color: #475569;
}

.person-name {
  overflow: hidden;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--default-color);
  text-decoration: none;
}

.person-name:hover {
  color: var(--accent-color);
}

.person-context {
  overflow: hidden;
  font-size: 0.72rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted-color);
}

/* --- Tipo ---------------------------------------------------------------- */
.badge-kind {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-kind-cliente {
  border-color: #9ad4d3;
  background: #e6f5f5;
  color: #0b6665;
}

.badge-kind-parte {
  border-color: #fca5a5;
  background: #fee2e2;
  color: #b91c1c;
}

.badge-kind-terceiro {
  border-color: #cbd5e1;
  background: #eef2f7;
  color: #475569;
}

/* --- Documento, telefone, cidade, origem -------------------------------- */
.cell-doc,
.cell-phone,
.cell-city,
.cell-origin {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.doc-value,
.cell-phone {
  font-variant-numeric: tabular-nums;
}

.cell-origin i {
  margin-right: 5px;
  color: var(--muted-color);
}

.cell-empty {
  color: var(--muted-color);
}

/* Botão que transforma o travessão inerte num campo preenchível */
.inline-fill-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border: 1px dashed #f59e0b;
  border-radius: 999px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.inline-fill-btn:hover {
  border-style: solid;
  background: #fef3c7;
}

.inline-fill-editor {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.inline-fill-editor input {
  width: 118px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--accent-color);
  border-radius: 7px;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

.inline-fill-editor input.is-invalid {
  border-color: #dc2626;
}

.inline-fill-ok {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 7px;
  background: var(--accent-color);
  color: #ffffff;
  cursor: pointer;
}

.inline-fill-error {
  display: block;
  font-size: 0.68rem;
  line-height: 1.3;
  color: #b91c1c;
  white-space: normal;
}

/* --- Ações --------------------------------------------------------------- */
.cell-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.row-action {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface-color);
  color: #526175;
  font-size: 0.8rem;
  text-decoration: none;
}

.row-action:hover {
  border-color: var(--accent-color);
  background: #e6f5f5;
  color: #0b7c7b;
}

/* --- Legenda ------------------------------------------------------------- */
.people-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding-top: 10px;
  font-size: 0.74rem;
  color: var(--muted-color);
}

.people-legend-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.people-legend-note {
  margin-left: auto;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.legend-cliente {
  background: #0b6665;
}

.legend-parte {
  background: #b91c1c;
}

.legend-terceiro {
  background: #475569;
}

@media (max-width: 720px) {
  .people-search input {
    width: 100%;
  }

  .people-legend-note {
    margin-left: 0;
  }
}

/* Rodapé de paginação compartilhado (D-037): intervalo, tamanho e navegação */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color-light);
  font-size: 0.78rem;
  color: var(--muted-color);
}

.pager-range {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-variant-numeric: tabular-nums;
}

.pager-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pager-select {
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  background: var(--surface-color);
  color: var(--default-color);
  font-size: 0.76rem;
  cursor: pointer;
}

.pager-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.page-number,
.page-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface-color);
  color: #526175;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.page-number:hover,
.page-step:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.page-number.is-active {
  border-color: var(--accent-color);
  background: var(--accent-color);
  color: #ffffff;
  font-weight: 700;
}

.page-step.is-disabled {
  opacity: 0.4;
  cursor: default;
}

.page-gap {
  padding: 0 2px;
  color: var(--muted-color);
}

/* --- Duplicatas: faixa de qualidade, chip na linha e painel de unificação --- */
.quality-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 16px;
  border: 1px solid #fcd34d;
  border-radius: 14px;
  background: #fffbeb;
}

.quality-banner-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #fef3c7;
  color: #b45309;
}

.quality-banner-text {
  flex: 1 1 auto;
  min-width: 0;
}

.quality-banner-title {
  margin: 0 0 2px;
  font-family: var(--heading-font);
  font-size: 0.86rem;
  font-weight: 600;
  color: #78350f;
}

.quality-banner-hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #92400e;
}

.quality-banner-actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-quality-primary,
.btn-quality-ghost {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.79rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.btn-quality-primary {
  border: 1px solid #b45309;
  background: #b45309;
  color: #ffffff;
}

.btn-quality-primary:hover {
  background: #92400e;
  color: #ffffff;
}

.btn-quality-ghost {
  border: 1px solid #fcd34d;
  background: transparent;
  color: #92400e;
}

.btn-quality-ghost:hover {
  background: #fef3c7;
  color: #78350f;
}

.data-table-row.is-duplicate {
  background: rgba(224, 168, 0, 0.05);
}

.data-table-row.is-duplicate:hover {
  background: rgba(224, 168, 0, 0.09);
}

.person-name-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.dup-chip {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border: 1px solid #fcd34d;
  border-radius: 999px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.68rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.dup-chip:hover {
  border-color: #f59e0b;
  background: #fef3c7;
  color: #78350f;
}

/* --- Painel de unificação ------------------------------------------------ */
.merge-card {
  margin-bottom: 14px;
  padding: 16px;
}

.merge-card-head {
  margin-bottom: 12px;
}

.merge-card-title {
  margin: 0 0 2px;
  font-family: var(--heading-font);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--default-color);
}

.merge-card-hint {
  font-size: 0.78rem;
  color: var(--muted-color);
}

.merge-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.merge-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 11px;
  cursor: pointer;
}

.merge-option:hover {
  border-color: var(--accent-color);
  background: #f7fbfb;
}

.merge-option.is-suggested {
  border-color: #9ad4d3;
  background: #f6fbfb;
}

.merge-option input {
  margin-top: 4px;
}

.merge-option-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.merge-option-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--default-color);
}

.merge-suggested-tag {
  padding: 1px 8px;
  border-radius: 999px;
  background: #e6f5f5;
  color: #0b6665;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
}

.merge-option-facts {
  font-size: 0.75rem;
  color: #5f6e83;
}

.merge-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

@media (max-width: 720px) {
  .quality-banner {
    flex-wrap: wrap;
  }
}

.merge-option-keep {
  flex-shrink: 0;
  margin-top: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5f6e83;
}

/* ---------------------------------------------------------------------------
   Processos (D-038): prazo com escala, partes com cor, fase em progresso.
   ------------------------------------------------------------------------ */

.case-subtitle {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted-color);
}

/* --- KPIs ---------------------------------------------------------------- */
.case-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.contingency-bar {
  display: flex;
  gap: 2px;
  height: 6px;
  margin-top: 8px;
  border-radius: 999px;
  overflow: hidden;
}

.contingency-seg {
  flex-grow: 0;
  flex-shrink: 0;
  flex-basis: var(--seg-size, 0%);
  min-width: 0;
}

.contingency-seg-provavel {
  background: #15803d;
}

.contingency-seg-possivel {
  background: #eab308;
}

.contingency-seg-remota {
  background: #94a3b8;
}

/* --- Barra de filtros ---------------------------------------------------- */
.case-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.case-search {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.case-search i {
  position: absolute;
  left: 11px;
  color: var(--muted-color);
  font-size: 0.85rem;
  pointer-events: none;
}

.case-search input {
  width: 272px;
  height: 34px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface-color);
  color: var(--default-color);
  font-size: 0.82rem;
}

.case-search input:focus {
  border-color: var(--accent-color);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.14);
}

.case-filter-select {
  height: 34px;
  max-width: 200px;
  padding: 0 10px 0 14px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface-color);
  color: var(--default-color);
  font-size: 0.82rem;
  cursor: pointer;
}

.case-filter-select:focus {
  border-color: var(--accent-color);
  outline: 0;
}

.chip-deadline,
.chip-unread {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.79rem;
  text-decoration: none;
  white-space: nowrap;
}

.chip-deadline b,
.chip-unread b {
  font-variant-numeric: tabular-nums;
}

.chip-deadline {
  border: 1px solid #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.chip-deadline:hover,
.chip-deadline.is-active {
  border-color: #dc2626;
  background: #fee2e2;
  color: #b91c1c;
}

.chip-unread {
  border: 1px solid #9ad4d3;
  background: #f2fbfb;
  color: #0b6665;
}

.chip-unread:hover,
.chip-unread.is-active {
  border-color: var(--accent-color);
  background: #e6f5f5;
  color: #0b6665;
}

.case-filters-note {
  font-size: 0.74rem;
  color: var(--muted-color);
}

/* --- Grid da tabela ------------------------------------------------------ */
.case-row {
  grid-template-columns:
    minmax(0, 1.55fr) minmax(0, 1.25fr) 150px 118px minmax(0, 1.5fr) 120px 96px;
  min-width: 1120px;
}

.data-table-row.case-row {
  height: auto;
  min-height: 76px;
  padding-top: 10px;
  padding-bottom: 10px;
  align-items: start;
}

.data-table-row.case-row.is-urgent {
  background: rgba(220, 38, 38, 0.04);
}

.data-table-row.case-row.is-urgent:hover {
  background: rgba(220, 38, 38, 0.08);
}

/* --- Processo ------------------------------------------------------------ */
.cell-case,
.cell-parties,
.cell-phase,
.cell-deadline,
.cell-movement,
.cell-value {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.case-number-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.case-number {
  overflow: hidden;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #0b7c7b;
  text-decoration: none;
}

.case-number:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

.unread-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent-color);
}

.case-group {
  overflow: hidden;
  font-size: 0.78rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--default-color);
}

.case-forum {
  overflow: hidden;
  font-size: 0.72rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #5f6e83;
}

/* --- Partes -------------------------------------------------------------- */
.party-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  font-size: 0.78rem;
  white-space: nowrap;
}

.party-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 999px;
}

.party-client {
  background: #0ea5a4;
}

.party-opposing {
  background: #b91c1c;
}

.party-name {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--default-color);
  text-decoration: none;
}

a.party-name:hover {
  color: var(--accent-color);
}

.party-more {
  flex-shrink: 0;
  padding: 0 5px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 0.68rem;
  font-weight: 700;
}

.party-lawyer {
  gap: 5px;
  color: #5f6e83;
}

.avatar-lawyer {
  width: 20px;
  height: 20px;
  background: #e6f5f5;
  color: #0b6665;
  font-size: 0.6rem;
}

/* --- Fase e situação ----------------------------------------------------- */
.phase-name {
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--default-color);
}

.phase-progress {
  display: flex;
  gap: 3px;
  width: 100%;
}

.phase-seg {
  flex: 1 1 0;
  height: 4px;
  border-radius: 999px;
  background: #e3eaf5;
}

.phase-seg.is-past {
  background: #9ad4d3;
}

.phase-seg.is-current {
  background: #0ea5a4;
}

.badge-status {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  padding: 2px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-status .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentcolor;
}

.badge-status-ativo {
  border-color: #9ad4d3;
  background: #e6f5f5;
  color: #0b6665;
}

.badge-status-suspenso {
  border-color: #fcd34d;
  background: #fef3c7;
  color: #92400e;
}

.badge-status-encerrado {
  border-color: #cbd5e1;
  background: #eef2f7;
  color: #475569;
}

/* --- Prazo --------------------------------------------------------------- */
.deadline-pill {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.deadline-pill--urgent {
  background: #fee2e2;
  color: #b91c1c;
}

.deadline-pill--warn {
  background: #fef3c7;
  color: #92400e;
}

.deadline-pill--calm {
  background: #f1f5f9;
  color: #526175;
}

.deadline-kind {
  overflow: hidden;
  font-size: 0.72rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #5f6e83;
}

/* #5f6e83: 5,19:1 sobre branco — "sem prazo" precisa ser lido, não adivinhado */
.deadline-none {
  font-size: 0.75rem;
  color: #5f6e83;
}

/* --- Movimentação -------------------------------------------------------- */
.movement-head {
  display: flex;
  align-items: center;
  gap: 7px;
}

.movement-date {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: #5f6e83;
}

.badge-source {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-source-tribunal {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-source-manual {
  background: #eef2f7;
  color: #475569;
}

.badge-source-ia {
  background: #f3e8ff;
  color: #6d28d9;
}

.movement-text {
  overflow: hidden;
  font-size: 0.76rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--default-color);
}

/* --- Valor e contingência ------------------------------------------------ */
.cell-value {
  align-items: flex-end;
  text-align: right;
}

.case-value {
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--default-color);
}

.contingency {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.contingency-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentcolor;
}

.contingency-provavel {
  color: #15803d;
}

.contingency-possivel {
  color: #a16207;
}

.contingency-remota {
  color: #64748b;
}

/* --- Legenda ------------------------------------------------------------- */
.case-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding-top: 10px;
  font-size: 0.74rem;
  color: var(--muted-color);
}

.case-legend-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.case-legend-note {
  margin-left: auto;
}

@media (max-width: 720px) {
  .case-search input {
    width: 100%;
  }

  .case-legend-note {
    margin-left: 0;
  }
}

/* ---------------------------------------------------------------------------
   Documentos (D-039): três abas, fluxo do documento, risco da revisão,
   catálogo em cards e variáveis fora da área nobre.
   ------------------------------------------------------------------------ */

.docs-subtitle {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted-color);
}

.docs-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.kpi-card.kpi-review {
  --kpi-accent: #ea580c;

  border-color: #fed7aa;
}

.kpi-card.kpi-review .kpi-value {
  color: #c2410c;
}

.kpi-icon-warning {
  background: #fff7ed;
  color: #c2410c;
}

.kpi-icon-violet {
  background: #f3e8ff;
  color: #6d28d9;
}

/* --- Abas ---------------------------------------------------------------- */
.docs-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.docs-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface-color);
  color: var(--muted-color);
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
}

.docs-tab:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.docs-tab.is-active {
  border-color: var(--accent-color);
  background: var(--accent-color);
  color: #ffffff;
}

.docs-tab-count {
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.docs-tab.is-active .docs-tab-count {
  background: rgba(255, 255, 255, 0.24);
}

/* --- Filtros ------------------------------------------------------------- */
.docs-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.docs-search {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.docs-search i {
  position: absolute;
  left: 11px;
  color: var(--muted-color);
  font-size: 0.85rem;
  pointer-events: none;
}

.docs-search input {
  width: 250px;
  height: 34px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface-color);
  color: var(--default-color);
  font-size: 0.82rem;
}

.docs-search input:focus {
  border-color: var(--accent-color);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.14);
}

.docs-filter-select {
  height: 34px;
  max-width: 200px;
  padding: 0 10px 0 14px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface-color);
  color: var(--default-color);
  font-size: 0.82rem;
  cursor: pointer;
}

.chip-ai {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid #d8b4fe;
  border-radius: 999px;
  background: #faf5ff;
  color: #6d28d9;
  font-size: 0.79rem;
  text-decoration: none;
  white-space: nowrap;
}

.chip-ai:hover,
.chip-ai.is-active {
  border-color: #a855f7;
  background: #f3e8ff;
  color: #6d28d9;
}

.docs-filters-note {
  font-size: 0.74rem;
  color: var(--muted-color);
}

/* --- Tabela de documentos ------------------------------------------------ */
.docs-row {
  grid-template-columns: minmax(0, 1.9fr) minmax(0, 1.35fr) 190px 150px 130px 128px;
  min-width: 1080px;
}

.data-table-row.docs-row {
  height: auto;
  min-height: 62px;
  padding-top: 9px;
  padding-bottom: 9px;
  align-items: center;
}

.data-table-row.docs-row.is-review {
  background: rgba(234, 88, 12, 0.04);
}

.data-table-row.docs-row.is-review:hover {
  background: rgba(234, 88, 12, 0.08);
}

.cell-doc-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cell-doc-text,
.cell-doc-target,
.cell-doc-status,
.cell-doc-review,
.cell-doc-updated {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.doc-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #eef2f7;
  color: #475569;
  font-size: 0.9rem;
}

.doc-icon-lg {
  width: 36px;
  height: 36px;
}

.doc-icon-contrato_honorarios,
.doc-icon-acordo {
  background: #e6f5f5;
  color: #0b6665;
}

.doc-icon-notificacao,
.doc-icon-correspondencia {
  background: #fff7ed;
  color: #c2410c;
}

.doc-icon-peticao,
.doc-icon-requerimento_lgpd {
  background: #e0f2fe;
  color: #0369a1;
}

.doc-icon-procuracao {
  background: #f3e8ff;
  color: #6d28d9;
}

.doc-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.doc-title {
  overflow: hidden;
  font-size: 0.83rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--default-color);
  text-decoration: none;
}

.doc-title:hover {
  color: var(--accent-color);
}

.doc-version {
  flex-shrink: 0;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 0.66rem;
  font-weight: 700;
}

.doc-ai {
  flex-shrink: 0;
  color: #6d28d9;
}

.doc-category,
.doc-client,
.doc-updated-by {
  overflow: hidden;
  font-size: 0.72rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #5f6e83;
}

.doc-case-number {
  overflow: hidden;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.74rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #0b7c7b;
  text-decoration: none;
}

.doc-case-number:hover {
  text-decoration: underline;
}

.doc-updated-at {
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  color: var(--default-color);
}

/* --- Situação e fluxo ---------------------------------------------------- */
.doc-status-pill {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.doc-status-pill .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentcolor;
}

.doc-status-pill--rascunho {
  background: #eef2f7;
  color: #475569;
}

.doc-status-pill--revisao {
  background: #fff7ed;
  color: #c2410c;
}

.doc-status-pill--revisado {
  background: #e0f2fe;
  color: #0369a1;
}

.doc-status-pill--aprovado {
  background: #dcfce7;
  color: #15803d;
}

.status-progress {
  display: flex;
  gap: 3px;
  width: 100%;
  margin-top: 4px;
}

.status-seg {
  flex: 1 1 0;
  height: 4px;
  border-radius: 999px;
  background: #e3eaf5;
}

.status-seg.is-current.status-seg-rascunho {
  background: #475569;
}

.status-seg.is-current.status-seg-revisao {
  background: #ea580c;
}

.status-seg.is-current.status-seg-revisado {
  background: #0369a1;
}

.status-seg.is-current.status-seg-aprovado {
  background: #15803d;
}

/* --- Risco da revisão ---------------------------------------------------- */
.risk-pill {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.risk-pill--low {
  background: #dcfce7;
  color: #15803d;
}

.risk-pill--mid {
  background: #fef3c7;
  color: #92400e;
}

.risk-pill--high {
  background: #fee2e2;
  color: #b91c1c;
}

.risk-meta {
  font-size: 0.7rem;
  color: #5f6e83;
}

.review-cta {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border: 1px dashed var(--accent-color);
  border-radius: 999px;
  background: #f2fbfb;
  color: #0b6665;
  font-size: 0.71rem;
  font-weight: 600;
  text-decoration: none;
}

.review-cta:hover {
  border-style: solid;
  background: #e6f5f5;
  color: #0b6665;
}

.row-action.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.row-action-pdf:hover {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.row-action-docx:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #0369a1;
}

.row-action-form {
  display: contents;
}

/* --- Cards de modelo ----------------------------------------------------- */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.template-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--surface-color);
}

.template-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.template-card-title {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.template-name {
  font-family: var(--heading-font);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--default-color);
}

.template-category {
  font-size: 0.72rem;
  color: #5f6e83;
}

.template-description {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--default-color);
}

.template-usage {
  display: flex;
  gap: 7px;
  margin: 0;
  padding: 9px 11px;
  border-radius: 10px;
  background: #f6fbfb;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #0b6665;
}

.template-usage i {
  flex-shrink: 0;
  margin-top: 2px;
}

.template-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.template-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid var(--border-color-light);
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.68rem;
  white-space: nowrap;
}

.template-badge-points {
  border-color: #9ad4d3;
  background: #e6f5f5;
  color: #0b6665;
  font-weight: 700;
}

.template-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.template-usage-count {
  margin-left: auto;
  font-size: 0.68rem;
  text-align: right;
  color: #5f6e83;
}

.template-card-new {
  align-items: center;
  justify-content: center;
  border-style: dashed;
  background: #fbfdff;
  text-align: center;
  text-decoration: none;
}

.template-new-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #e6f5f5;
  color: #0b6665;
}

.template-new-title {
  font-family: var(--heading-font);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--default-color);
}

.template-new-hint {
  font-size: 0.76rem;
  color: #5f6e83;
}

/* --- Painel de variáveis ------------------------------------------------- */
.var-panel {
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--surface-color);
}

.var-panel-summary {
  padding: 12px 16px;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--default-color);
  cursor: pointer;
}

.var-panel-body {
  padding: 0 16px 16px;
}

.var-panel-hint {
  margin: 0 0 12px;
  font-size: 0.76rem;
  color: #5f6e83;
}

.var-panel-hint code {
  padding: 1px 5px;
  border-radius: 5px;
  background: #f6f9fd;
  color: #334155;
}

.var-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.var-group-title {
  margin: 0 0 7px;
  font-family: var(--heading-font);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted-color);
}

.var-chip {
  display: block;
  width: 100%;
  margin-bottom: 4px;
  padding: 4px 9px;
  border: 1px solid #e3eaf5;
  border-radius: 7px;
  background: #f6f9fd;
  color: #334155;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  text-align: left;
  cursor: pointer;
}

.var-chip:hover {
  border-color: var(--accent-color);
  color: #0b6665;
}

.var-chip.is-copied {
  border-color: #15803d;
  background: #dcfce7;
  color: #15803d;
}

/* Retorno do botão de copiar o link do pedido: o ícone já troca, a cor confirma. */
.row-action.is-copied {
  border-color: #15803d;
  color: #15803d;
}

.row-action.is-failed {
  border-color: #b45309;
  color: #b45309;
}

/* --- Pedidos ao cliente -------------------------------------------------- */
.requests-row {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.9fr) 170px 170px 120px;
  min-width: 1000px;
}

.data-table-row.requests-row {
  height: auto;
  min-height: 66px;
  padding-top: 10px;
  padding-bottom: 10px;
  align-items: center;
}

.data-table-row.requests-row.is-closed {
  opacity: 0.6;
}

.cell-request-target,
.cell-request-progress,
.cell-request-sent {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.request-name {
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--default-color);
}

.request-link,
.request-date,
.request-empty {
  font-size: 0.72rem;
  color: #5f6e83;
}

.cell-request-items {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.request-item-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border: 1px solid #fcd34d;
  border-radius: 999px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.7rem;
  white-space: nowrap;
}

.request-item-chip.is-received {
  border-color: #86efac;
  background: #dcfce7;
  color: #15803d;
}

.request-count {
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  color: var(--default-color);
}

.request-bar {
  display: block;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e3eaf5;
  overflow: hidden;
}

.request-bar-fill {
  display: block;
  width: var(--fill, 0%);
  height: 100%;
  border-radius: 999px;
  background: #f59e0b;
}

.request-bar-fill.is-complete {
  background: #15803d;
}

.request-state {
  font-size: 0.7rem;
  color: #5f6e83;
}

.request-state.is-late {
  color: #b91c1c;
  font-weight: 600;
}

.request-state.is-done {
  color: #15803d;
}

/* --- Legenda ------------------------------------------------------------- */
.docs-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding-top: 10px;
  font-size: 0.74rem;
  color: var(--muted-color);
}

.docs-legend-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 720px) {
  .docs-search input {
    width: 100%;
  }
}

/* Escolha do processo/lead na geração (D-039) — o fim do beco sem saída */
.target-template {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px 16px;
  border: 1px solid #9ad4d3;
  border-radius: 14px;
  background: #f6fbfb;
}

.target-template-text {
  display: flex;
  flex-direction: column;
}

.target-template-text span {
  font-size: 0.74rem;
  color: #5f6e83;
}

.target-template-change {
  margin-left: auto;
  font-size: 0.76rem;
  color: #0b7c7b;
}

.target-list {
  display: flex;
  flex-direction: column;
}

.target-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1.4fr) minmax(0, 1.2fr) 130px 20px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color-light);
  color: var(--default-color);
  font-size: 0.82rem;
  text-decoration: none;
}

.target-row:last-of-type {
  border-bottom: 0;
}

.target-row:hover {
  background: #f7faff;
}

.target-kind {
  justify-self: start;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.target-kind-case {
  background: #e0f2fe;
  color: #0369a1;
}

.target-kind-lead {
  background: #e6f5f5;
  color: #0b6665;
}

.target-label {
  overflow: hidden;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.target-person {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.target-state {
  font-size: 0.74rem;
  color: #5f6e83;
}

/* --- Sessão de triagem, leitura interna (D-040) --------------------------- */
/* O prefixo `session-` foi conferido contra o main.css do FlexAdmin: livre. */

.session-no-phone {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border: 1px dashed #d4b483;
  border-radius: 999px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.8rem;
  font-weight: 600;
}

.session-crisis-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1.5px solid #f87171;
  border-radius: 14px;
  background: #fef2f2;
  color: #7f1d1d;
  font-size: 0.86rem;
  line-height: 1.5;
}

.session-crisis-note i {
  flex: none;
  margin-top: 2px;
  color: #b91c1c;
  font-size: 1.1rem;
}

.session-facts {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 6px 12px;
  margin: 0;
  font-size: 0.85rem;
}

.session-facts dt {
  color: #5f6e83;
  font-weight: 600;
}

.session-facts dd {
  margin: 0;
  color: #1f2b3a;
  overflow-wrap: anywhere;
}

.session-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
}

.session-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.session-bubble-text {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.session-bubble-time {
  margin-top: 4px;
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.session-bubble--usuario {
  align-self: flex-end;
  background: #0ea5a4;
  color: #ffffff;
}

.session-bubble--usuario .session-bubble-time {
  color: #d7f5f4;
}

.session-bubble--agente {
  align-self: flex-start;
  background: #eef2f8;
  color: #1f2b3a;
}

.session-bubble--sistema {
  align-self: center;
  background: #fffbeb;
  border: 1px dashed #e3c993;
  color: #92400e;
  font-size: 0.78rem;
}

.session-bubble--agente .session-bubble-time,
.session-bubble--sistema .session-bubble-time {
  color: #5f6e83;
}

.session-empty {
  margin: 0;
  color: #5f6e83;
  font-size: 0.85rem;
}

/* --- Minhas tarefas (D-040) ---------------------------------------------- */
/* Os nomes foram conferidos contra o main.css do FlexAdmin, que já é dono de
   `.task-list`, `.task-item`, `.task-checkbox`, `.task-info`, `.task-title`,
   `.task-meta`, `.task-due` e de todo o `.kanban-*` com largura fixa. Por isso o
   bloco da linha é `.task-row` com filhos prefixados e o quadro é `.task-board`. */

.tasks-subtitle {
  margin: 4px 0 0;
  color: #5f6e83;
  font-size: 0.86rem;
}

.tasks-subtitle strong {
  color: #b91c1c;
}

/* Faixa de emergência ------------------------------------------------------ */

.emergency-banner {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 200px;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1.5px solid #f87171;
  border-radius: 14px;
  background: #fef2f2;
  box-shadow: 0 6px 18px rgba(185, 28, 28, 0.09);
}

.emergency-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 1.25rem;
}

.emergency-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #7f1d1d;
  font-size: 0.95rem;
}

.emergency-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dc2626;
  animation: emergency-pulse 1.8s ease-out infinite;
}

@keyframes emergency-pulse {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .emergency-dot { animation: none; }
}

.emergency-badge {
  padding: 3px 9px;
  border-radius: 999px;
  background: #b91c1c;
  color: #ffffff;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.emergency-text {
  margin: 6px 0 12px;
  color: #7f1d1d;
  font-size: 0.84rem;
  line-height: 1.5;
}

.emergency-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.btn-call {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 16px;
  border-radius: 10px;
  background: #b91c1c;
  color: #ffffff;
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
}

.btn-call:hover {
  background: #991b1b;
  color: #ffffff;
}

.btn-emergency {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  background: #ffffff;
  color: #991b1b;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn-emergency:hover {
  border-color: #b91c1c;
  background: #fff5f5;
  color: #7f1d1d;
}

.emergency-nophone {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 8px 14px;
  border: 1px dashed #fca5a5;
  border-radius: 10px;
  color: #991b1b;
  font-size: 0.82rem;
  font-weight: 600;
}

.emergency-aside {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}

.emergency-aside-label {
  color: #b91c1c;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.emergency-aside a {
  color: #0e7490;
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
}

.emergency-aside a:hover { text-decoration: underline; }

.emergency-aside-meta {
  color: #5f6e83;
  font-size: 0.72rem;
}

/* KPIs e barra de ferramentas ---------------------------------------------- */

.tasks-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.tasks-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.tasks-search {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-width: 240px;
  padding: 7px 12px;
  border: 1px solid #dde4ed;
  border-radius: 10px;
  background: #ffffff;
  color: #5f6e83;
}

.tasks-search input {
  width: 100%;
  border: 0;
  background: transparent;
  color: #1f2b3a;
  font-size: 0.83rem;
  outline: none;
}

.tasks-select {
  padding: 7px 12px;
  border: 1px solid #dde4ed;
  border-radius: 10px;
  background: #ffffff;
  color: #1f2b3a;
  font-size: 0.83rem;
}

.chip-fatal {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 7px 13px;
  border: 1px solid #fca5a5;
  border-radius: 999px;
  background: #ffffff;
  color: #b91c1c;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.chip-fatal b {
  padding: 0 6px;
  border-radius: 999px;
  background: #fee2e2;
  font-size: 0.72rem;
}

.chip-fatal:hover,
.chip-fatal.is-active {
  border-color: #b91c1c;
  background: #fef2f2;
  color: #7f1d1d;
}

.tasks-toolbar-note {
  margin-left: auto;
  color: #5f6e83;
  font-size: 0.74rem;
}

/* Lista agrupada ----------------------------------------------------------- */

.task-group-head {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid #eef2f8;
  background: #f8fafc;
  font-size: 0.82rem;
}

.task-group-head--atrasadas { background: #fef2f2; }

.task-group-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}

.task-group-head--atrasadas .task-group-dot { background: #dc2626; }
.task-group-head--hoje .task-group-dot { background: #d97706; }
.task-group-head--semana .task-group-dot { background: #0ea5a4; }

.task-group-label {
  color: #1f2b3a;
  font-weight: 700;
}

.task-group-head--atrasadas .task-group-label { color: #b91c1c; }

.task-group-count {
  padding: 1px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
}

.task-group-note {
  color: #5f6e83;
  font-size: 0.76rem;
}

.data-table-row.task-row {
  grid-template-columns: 24px minmax(0, 2.5fr) minmax(0, 1.4fr) 130px 118px 150px;
  align-items: center;
  min-height: 56px;
}

.data-table-head.task-row {
  grid-template-columns: 24px minmax(0, 2.5fr) minmax(0, 1.4fr) 130px 118px 150px;
}

.data-table-row.task-row.is-emergency {
  background: #fef2f2;
}

.data-table-row.task-row.is-emergency:hover {
  background: #fee6e6;
}

.task-row-check {
  width: 17px;
  height: 17px;
  padding: 0;
  border: 1.5px solid #cbd5e1;
  border-radius: 5px;
  background: #ffffff;
  cursor: pointer;
}

.task-row-check:hover {
  border-color: #0ea5a4;
  background: #ecfeff;
}

.task-row-title-line {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.task-row-title {
  overflow: hidden;
  color: #1f2b3a;
  font-size: 0.87rem;
  font-weight: 600;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row-title:hover { color: #0ea5a4; }

.fatal-badge {
  flex: none;
  padding: 1px 7px;
  border-radius: 5px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.chip-duplicates {
  display: inline-flex;
  flex: none;
  gap: 4px;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.68rem;
  font-weight: 600;
  text-decoration: none;
}

.task-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 3px;
  color: #5f6e83;
  font-size: 0.74rem;
}

.sla-chip {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.sla-chip--warn {
  background: #fef3c7;
  color: #92400e;
}

.sla-chip--expired {
  background: #fee2e2;
  color: #b91c1c;
}

.checklist-bar {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.checklist-track {
  display: block;
  width: 54px;
  height: 4px;
  border-radius: 999px;
  background: #e2e8f0;
}

.checklist-fill {
  display: block;
  width: var(--done, 0%);
  height: 100%;
  border-radius: 999px;
  background: #0ea5a4;
}

.checklist-count {
  color: #5f6e83;
  font-variant-numeric: tabular-nums;
}

.task-row-note {
  overflow: hidden;
  color: #5f6e83;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row-link {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow: hidden;
  color: #0e7490;
  font-size: 0.79rem;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row-link:hover { text-decoration: underline; }

.task-row-link.is-plain {
  color: #5f6e83;
}

.task-row-person {
  display: block;
  overflow: hidden;
  color: #5f6e83;
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row-person a {
  color: #5f6e83;
  text-decoration: none;
}

.task-row-person a:hover {
  color: #0e7490;
  text-decoration: underline;
}

.task-row-date {
  display: block;
  margin-top: 2px;
  color: #5f6e83;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.task-row-date.is-empty { font-style: italic; }

.priority-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 600;
}

.priority-pill--urgente {
  background: #fee2e2;
  color: #b91c1c;
}

.priority-pill--alta {
  background: #ffedd5;
  color: #9a3412;
}

.priority-pill--media {
  background: #e2e8f0;
  color: #475569;
}

.priority-pill--baixa {
  background: #f1f5f9;
  color: #5f6e83;
}

.task-row-points {
  display: block;
  margin-top: 3px;
  color: #5f6e83;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.btn-start {
  padding: 5px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-start:hover {
  border-color: #0ea5a4;
  color: #0e7490;
}

.running-pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 0.73rem;
  font-weight: 600;
  white-space: nowrap;
}

.running-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0284c7;
}

.task-empty-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  padding: 10px 18px;
  border-top: 1px solid #eef2f8;
  background: #f0fdf4;
  border-radius: 0 0 14px 14px;
}

.task-empty-item {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: #15803d;
  font-size: 0.78rem;
  font-weight: 600;
}

.task-empty-note {
  margin-left: auto;
  color: #5f6e83;
  font-size: 0.72rem;
}

.task-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 12px;
  color: #5f6e83;
  font-size: 0.75rem;
}

.task-legend-group {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

/* Kanban ------------------------------------------------------------------- */

.task-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.task-column {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: #eef2f8;
}

.task-column-head {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 2px solid var(--column-colour, #94a3b8);
}

.task-column-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--column-colour, #94a3b8);
}

.task-column-name {
  color: #1f2b3a;
  font-size: 0.85rem;
  font-weight: 700;
}

.task-column-note {
  color: #5f6e83;
  font-size: 0.72rem;
}

.task-column-count {
  margin-left: auto;
  padding: 1px 9px;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  font-size: 0.73rem;
  font-weight: 700;
}

.task-column-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 9px;
  min-height: 120px;
  padding: 12px;
}

.task-column-body.is-dragover {
  background: #e0f2fe;
  border-radius: 0 0 14px 14px;
}

.task-column-empty {
  margin: 0;
  color: #5f6e83;
  font-size: 0.78rem;
  font-style: italic;
}

.task-column-more {
  padding: 7px;
  border: 1px dashed #cbd5e1;
  border-radius: 9px;
  color: #0e7490;
  font-size: 0.76rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.task-column-more:hover {
  border-color: #0ea5a4;
  background: #ffffff;
}

.task-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px 13px;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  background: #ffffff;
  cursor: grab;
}

.task-card:hover {
  border-color: #0ea5a4;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.07);
}

.task-card.is-dragging { opacity: 0.5; }

.task-card.is-fatal {
  border-left: 3px solid #dc2626;
}

.task-card-top {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  justify-content: space-between;
}

.task-card-title {
  color: #1f2b3a;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}

.task-card-title:hover { color: #0ea5a4; }

.task-card-link {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  overflow: hidden;
  color: #5f6e83;
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-card-foot {
  display: flex;
  gap: 8px;
  align-items: center;
}

.task-card-points {
  color: #5f6e83;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.task-card-foot .avatar-initial {
  margin-left: auto;
}

.task-board-note {
  margin-top: 12px;
  color: #5f6e83;
  font-size: 0.75rem;
}

/* Aba Equipe --------------------------------------------------------------- */

.data-table-head.team-row,
.data-table-row.team-row {
  grid-template-columns: minmax(0, 2fr) 110px 90px 100px minmax(0, 1.4fr) 150px;
  align-items: center;
}

.data-table-row.team-row.is-overloaded {
  background: rgba(220, 38, 38, 0.04);
}

.cell-team-person {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.team-person-name {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #1f2b3a;
  font-size: 0.84rem;
  font-weight: 600;
}

.team-person-name small {
  color: #5f6e83;
  font-size: 0.71rem;
  font-weight: 500;
}

.cell-team-late,
.cell-team-today,
.cell-team-open {
  color: #1f2b3a;
  font-size: 0.88rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cell-team-late.is-late { color: #b91c1c; }

.cell-team-load {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.load-bar {
  display: block;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
}

.load-bar-fill {
  display: block;
  width: var(--load, 0%);
  height: 100%;
  border-radius: 999px;
}

.load-bar--ok { background: #16a34a; }
.load-bar--warn { background: #d97706; }
.load-bar--over { background: #dc2626; }

.load-bar-label {
  color: #5f6e83;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.btn-assign {
  padding: 4px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-assign:hover {
  border-color: #0ea5a4;
  color: #0e7490;
}

.team-diagnosis {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #e3c993;
  border-radius: 14px;
  background: #fffbeb;
}

.team-diagnosis i {
  color: #b45309;
  font-size: 1.05rem;
}

.team-diagnosis p {
  flex: 1;
  min-width: 260px;
  margin: 0;
  color: #78350f;
  font-size: 0.83rem;
  line-height: 1.5;
}

.team-footnote {
  margin-top: 12px;
  color: #5f6e83;
  font-size: 0.76rem;
}

.team-footnote a {
  color: #0e7490;
  font-weight: 600;
  text-decoration: none;
}

@media (max-width: 1200px) {
  .tasks-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .emergency-banner { grid-template-columns: 44px minmax(0, 1fr); }
  .emergency-aside { grid-column: 1 / -1; text-align: left; }
}

@media (max-width: 900px) {
  .task-board { grid-template-columns: 1fr; }
}

/* Linha já fechada: o visto substitui o botão, e a pílula diz o que aconteceu. */
.task-row-check.is-done {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 5px;
  background: #16a34a;
  color: #ffffff;
  font-size: 0.7rem;
}

.done-pill {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 0.73rem;
  font-weight: 600;
  white-space: nowrap;
}

.task-group-head--depois .task-group-dot {
  background: #94a3b8;
}

.session-subtitle {
  margin: 4px 0 0;
  color: #5f6e83;
  font-size: 0.86rem;
}

/* --- Audiências e perícias (D-041) ---------------------------------------- */
/* Prefixo `hearing-`/`prep-` conferido contra o main.css do FlexAdmin: livre.
   `.calendar-*` NÃO é livre — ver o bloco da agenda. */

.hearing-subtitle {
  margin: 4px 0 0;
  color: #5f6e83;
  font-size: 0.86rem;
}

.hearing-subtitle strong {
  color: #92400e;
}

.hearing-notice {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid #e3c993;
  border-radius: 14px;
  background: #fffbeb;
}

.hearing-notice-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: #fef3c7;
  color: #b45309;
  font-size: 1.1rem;
}

.hearing-notice-body strong {
  color: #78350f;
  font-size: 0.9rem;
}

.hearing-notice-body p {
  margin: 3px 0 0;
  color: #78350f;
  font-size: 0.81rem;
  line-height: 1.45;
}

.hearing-notice-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-record {
  padding: 8px 16px;
  border: 0;
  border-radius: 10px;
  background: #b45309;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-record:hover {
  background: #92400e;
}

.btn-fix-date {
  padding: 8px 15px;
  border: 1px solid #e3c993;
  border-radius: 10px;
  background: #ffffff;
  color: #92400e;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.btn-fix-date:hover {
  border-color: #b45309;
  color: #78350f;
}

.hearing-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.hearing-select {
  padding: 7px 12px;
  border: 1px solid #dde4ed;
  border-radius: 10px;
  background: #ffffff;
  color: #1f2b3a;
  font-size: 0.83rem;
}

.hearing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.hearing-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.hearing-card {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 150px;
  gap: 14px;
  padding: 14px 16px 14px 13px;
  border: 1px solid #e6ecf4;
  border-left: 4px solid #8b5cf6;
  border-radius: 14px;
  background: #ffffff;
}

.hearing-card--agendada { border-left-color: #8b5cf6; }
.hearing-card--realizada { border-left-color: #16a34a; }
.hearing-card--cancelada { border-left-color: #94a3b8; }
.hearing-card--redesignada { border-left-color: #f59e0b; }

.hearing-date-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 62px;
  border-radius: 11px;
  background: #f1f5f9;
  color: #475569;
}

.hearing-date-block--urgent { background: #fef3c7; color: #92400e; }
.hearing-date-block--warn { background: #ecfeff; color: #0e7490; }
.hearing-date-block--calm { background: #f1f5f9; color: #475569; }

.hearing-date-weekday,
.hearing-date-month {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.hearing-date-day {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
}

.hearing-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.hearing-line-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #1f2b3a;
  font-size: 0.95rem;
}

.hearing-pill {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.hearing-pill--mode { background: #e0f2fe; color: #075985; }
.hearing-pill--agendada { background: #ede9fe; color: #5b21b6; }
.hearing-pill--realizada { background: #dcfce7; color: #15803d; }
.hearing-pill--cancelada { background: #f1f5f9; color: #526175; }
.hearing-pill--redesignada { background: #ffedd5; color: #9a3412; }
.hearing-pill--pending { background: #fef3c7; color: #92400e; }
.hearing-pill--weekend { background: #fee2e2; color: #b91c1c; }

.hearing-line-case,
.hearing-line-place,
.hearing-line-lawyers {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  min-width: 0;
  color: #5f6e83;
  font-size: 0.79rem;
}

.hearing-cnj {
  color: #0e7490;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  text-decoration: none;
}

.hearing-cnj:hover { text-decoration: underline; }

.hearing-place {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hearing-place-action {
  padding: 1px 9px;
  border: 1px solid #dde4ed;
  border-radius: 999px;
  background: #ffffff;
  color: #0e7490;
  font-size: 0.7rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.hearing-place-action:hover {
  border-color: #0ea5a4;
  background: #f0fdfa;
}

.hearing-place-action.is-copied {
  border-color: #15803d;
  color: #15803d;
}

.hearing-no-lawyer {
  color: #92400e;
  font-style: italic;
}

.hearing-lawyer-name { color: #5f6e83; }

.hearing-aside {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: flex-end;
}

.hearing-actions {
  display: flex;
  gap: 5px;
}

.prep-progress {
  display: flex;
  gap: 6px;
  align-items: center;
}

.prep-track {
  display: block;
  width: 46px;
  height: 4px;
  border-radius: 999px;
  background: #e2e8f0;
}

.prep-fill {
  display: block;
  width: var(--done, 0%);
  height: 100%;
  border-radius: 999px;
  background: #0ea5a4;
}

.prep-count {
  color: #5f6e83;
  font-size: 0.71rem;
  font-variant-numeric: tabular-nums;
}

.hearing-empty {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  padding: 42px 24px;
  border: 1px solid #e6ecf4;
  border-radius: 14px;
  background: #ffffff;
  text-align: center;
}

.hearing-empty-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #f0fdfa;
  color: #0ea5a4;
  font-size: 1.25rem;
}

.hearing-empty h2 {
  margin: 0;
  color: #1f2b3a;
  font-size: 1.02rem;
  font-weight: 700;
}

.hearing-empty p {
  max-width: 460px;
  margin: 0;
  color: #5f6e83;
  font-size: 0.85rem;
  line-height: 1.5;
}

.hearing-empty-actions {
  display: flex;
  gap: 9px;
  margin-top: 4px;
}

.prep-panel {
  padding: 16px;
  border: 1px solid #e6ecf4;
  border-radius: 14px;
  background: #ffffff;
}

.prep-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.prep-head h2 {
  margin: 0;
  color: #1f2b3a;
  font-size: 0.98rem;
  font-weight: 700;
}

.prep-when {
  padding: 2px 9px;
  border-radius: 999px;
  background: #ede9fe;
  color: #5b21b6;
  font-size: 0.71rem;
  font-weight: 600;
}

.prep-context {
  margin: 10px 0 12px;
  color: #5f6e83;
  font-size: 0.81rem;
  line-height: 1.45;
}

.prep-checklist {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.prep-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 0.82rem;
}

.prep-toggle {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  padding: 0;
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  color: #ffffff;
  font-size: 0.65rem;
  cursor: pointer;
}

.prep-item.is-done .prep-toggle {
  border-color: #0ea5a4;
  background: #0ea5a4;
}

.prep-label {
  flex: 1;
  color: #1f2b3a;
  line-height: 1.4;
}

.prep-item.is-done .prep-label {
  color: #5f6e83;
  text-decoration: line-through;
}

.prep-task {
  flex: none;
  padding: 1px 8px;
  border: 1px solid #dde4ed;
  border-radius: 999px;
  background: #ffffff;
  color: #0e7490;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
}

.prep-task:hover {
  border-color: #0ea5a4;
  background: #f0fdfa;
}

.prep-empty,
.prep-note {
  margin: 12px 0 0;
  color: #5f6e83;
  font-size: 0.75rem;
  line-height: 1.45;
}

@media (max-width: 1200px) {
  .hearing-layout { grid-template-columns: minmax(0, 1fr); }
  .hearing-notice { grid-template-columns: 40px minmax(0, 1fr); }
  .hearing-notice-actions { grid-column: 1 / -1; }
}

@media (max-width: 780px) {
  .hearing-card { grid-template-columns: 62px minmax(0, 1fr); }
  .hearing-aside { grid-column: 2; align-items: flex-start; }
}

/* --- Agenda (D-041) -------------------------------------------------------- */
/* O bloco é `cal-*`, NÃO `calendar-*`: o main.css do FlexAdmin é dono de
   `.calendar-grid`, `.calendar-day`, `.calendar-day-header` e `.calendar-event`,
   e é justamente essa colisão que deixava as colunas de larguras diferentes —
   o `repeat(7,1fr)` inline vencia o `minmax(100px,1fr)` do tema, e `1fr` é
   `minmax(auto,1fr)`: sem `min-width:0` a célula cresce com o conteúdo.
   Aqui é `minmax(0,1fr)` com `overflow:hidden`. */

.agenda-subtitle {
  margin: 4px 0 0;
  color: #5f6e83;
  font-size: 0.86rem;
}

.agenda-subtitle strong { color: #b91c1c; }

.agenda-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: start;
}

.agenda-main { min-width: 0; }

.agenda-lawyer-form { display: inline-flex; }

.agenda-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #eef2f8;
}

.agenda-nav {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.agenda-nav-btn,
.agenda-nav-today {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid #dde4ed;
  border-radius: 8px;
  background: #ffffff;
  color: #475569;
  font-size: 0.79rem;
  font-weight: 600;
  text-decoration: none;
}

.agenda-nav-btn:hover,
.agenda-nav-today:hover {
  border-color: #0ea5a4;
  color: #0e7490;
}

.agenda-title {
  margin: 0;
  color: #1f2b3a;
  font-size: 1.05rem;
  font-weight: 700;
}

.agenda-views {
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  background: #eef2f8;
}

.agenda-view {
  padding: 4px 14px;
  border-radius: 999px;
  color: #5f6e83;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.agenda-view.is-active {
  background: #0ea5a4;
  color: #ffffff;
}

.agenda-legend {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-left: auto;
  color: #5f6e83;
  font-size: 0.74rem;
}

.agenda-legend-item {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.agenda-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot, #94a3b8);
}

.cal-head,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cal-head-cell {
  padding: 8px 6px;
  background: #edf3fb;
  color: #5f6e83;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: center;
}

.cal-grid--day { grid-template-columns: minmax(0, 1fr); }

.cal-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  min-height: 104px;
  padding: 6px;
  overflow: hidden;
  border-right: 1px solid #eef2f8;
  border-bottom: 1px solid #eef2f8;
  background: #ffffff;
}

.cal-grid--day .cal-cell { min-height: 320px; }

.cal-cell:nth-child(7n) { border-right: 0; }

.cal-cell--weekend { background: #fbfcfe; }

.cal-cell--outside { background: #fafcfe; }

.cal-cell--today { background: #f0fafa; }

.cal-cell-head {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 2px;
}

.cal-day-number {
  color: #1f2b3a;
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cal-cell--weekend .cal-day-number { font-weight: 700; }

.cal-cell--today .cal-day-number {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #0ea5a4;
  color: #ffffff;
}

.cal-today-label {
  color: #0e7490;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.cal-chip {
  display: flex;
  gap: 4px;
  align-items: center;
  min-width: 0;
  padding: 2px 6px;
  border-left: 3px solid #94a3b8;
  border-radius: 4px;
  font-size: 0.7rem;
  text-decoration: none;
}

.cal-chip i { flex: none; font-size: 0.66rem; }

.cal-chip-time {
  flex: none;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.cal-chip-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-chip--fatal {
  border-left-color: #dc2626;
  background: #fee2e2;
  color: #991b1b;
}

.cal-chip--prazo {
  border-left-color: #f59e0b;
  background: #fef3c7;
  color: #92400e;
}

.cal-chip--hearing {
  border-left-color: #8b5cf6;
  background: #ede9fe;
  color: #5b21b6;
}

.cal-chip--task {
  border-left-color: #0ea5a4;
  background: #ccfbf1;
  color: #115e59;
}

.cal-more {
  color: #5f6e83;
  font-size: 0.68rem;
  font-weight: 600;
  text-decoration: none;
}

.cal-more:hover { color: #0e7490; }

/* --- clicar no dia cria compromisso (D-056) ------------------------------ */

/* A area livre do dia e o gatilho, e fica **atras** dos chips: o clique no
   evento continua indo para o evento e o resto da celula convida a criar. */
.cal-cell-hit {
  position: absolute;
  inset: 0;
  z-index: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.cal-cell > .cal-chip,
.cal-cell > .cal-more {
  position: relative;
  z-index: 1;
}

.cal-cell-hit::after {
  content: "+";
  position: absolute;
  top: 5px;
  right: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 6px;
  background: var(--accent-color, #0ea5a4);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.cal-cell:hover .cal-cell-hit::after,
.cal-cell-hit:focus-visible::after {
  opacity: 1;
}

.cal-cell-hit:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: -2px;
}

.cal-daymenu {
  position: fixed;
  z-index: 1050;
  width: 272px;
  padding: 8px;
  border: 1px solid #e3eaf5;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
}

.cal-daymenu-head {
  margin: 2px 4px 6px;
  color: #6b7a90;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cal-daymenu-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 8px 9px;
  border-radius: 9px;
  color: #1f2b3a;
  text-decoration: none;
}

.cal-daymenu-item:hover {
  background: #f2fbfb;
  color: #0b6665;
}

.cal-daymenu-item > i {
  flex: none;
  margin-top: 2px;
  color: var(--accent-color);
  font-size: 0.9rem;
}

.cal-daymenu-title {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
}

.form-origin-note {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  max-width: 640px;
  margin: 8px 0 0;
  padding: 8px 11px;
  border-radius: 9px;
  background: #f2fbfb;
  color: #0b6665;
  font-size: 0.78rem;
  line-height: 1.45;
}

.form-origin-note > i {
  flex: none;
  margin-top: 2px;
}

.cal-daymenu-hint {
  display: block;
  color: #6b7a90;
  font-size: 0.72rem;
  line-height: 1.35;
}


.agenda-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 10px 16px;
  color: #5f6e83;
  font-size: 0.73rem;
}

.agenda-foot span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.agenda-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.agenda-side-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px;
}

.agenda-side-head h2 {
  margin: 0;
  color: #1f2b3a;
  font-size: 0.98rem;
  font-weight: 700;
}

.agenda-side-count {
  padding: 1px 9px;
  border-radius: 999px;
  background: #eef2f8;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
}

.upcoming-list {
  margin: 0;
  padding: 0 8px 10px;
  list-style: none;
}

.upcoming-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 8px;
  border-radius: 10px;
}

.upcoming-item.is-fatal { background: #fef2f2; }

.upcoming-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #1f2b3a;
  line-height: 1.05;
}

.upcoming-date strong { font-size: 1.02rem; }

.upcoming-date small {
  color: #5f6e83;
  font-size: 0.6rem;
  font-weight: 700;
}

.upcoming-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.upcoming-title {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow: hidden;
  color: #1f2b3a;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-title:hover { color: #0ea5a4; }

.upcoming-context {
  overflow: hidden;
  color: #5f6e83;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-empty {
  padding: 4px 8px 12px;
  color: #5f6e83;
  font-size: 0.81rem;
}

.agenda-layers { padding-bottom: 12px; }

.layer-toggle {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 6px 16px;
  cursor: pointer;
}

.layer-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.layer-switch {
  position: relative;
  flex: none;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.15s;
}

.layer-switch::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  content: "";
  transition: transform 0.15s;
}

.layer-toggle input:checked + .layer-switch { background: #0ea5a4; }

.layer-toggle input:checked + .layer-switch::after { transform: translateX(14px); }

.layer-toggle input:focus-visible + .layer-switch {
  outline: 2px solid #0ea5a4;
  outline-offset: 2px;
}

.layer-label {
  flex: 1;
  color: #1f2b3a;
  font-size: 0.82rem;
}

.layer-count {
  color: #5f6e83;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.layer-note {
  margin: 8px 16px 0;
  color: #5f6e83;
  font-size: 0.73rem;
  line-height: 1.45;
}

@media (max-width: 1200px) {
  .agenda-layout { grid-template-columns: minmax(0, 1fr); }
  .agenda-legend { margin-left: 0; }
}

/* --- Prazos (D-041) -------------------------------------------------------- */
/* A contagem regressiva reaproveita `.deadline-pill--urgent/--warn/--calm`
   (D-038), que já tem estas três cores — criar `.countdown--*` seria um segundo
   vocabulário para o mesmo componente. */

.deadlines-subtitle {
  margin: 4px 0 0;
  color: #5f6e83;
  font-size: 0.86rem;
}

.deadlines-subtitle strong { color: #b91c1c; }

.deadlines-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.deadlines-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.deadlines-search {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-width: 230px;
  padding: 7px 12px;
  border: 1px solid #dde4ed;
  border-radius: 10px;
  background: #ffffff;
  color: #5f6e83;
}

.deadlines-search input {
  width: 100%;
  border: 0;
  background: transparent;
  color: #1f2b3a;
  font-size: 0.83rem;
  outline: none;
}

.data-table-head.deadline-row,
.data-table-row.deadline-row {
  grid-template-columns:
    minmax(0, 1.6fr) minmax(0, 1.4fr) 130px minmax(0, 1.5fr) minmax(0, 1fr) 150px;
  align-items: center;
}

.data-table-row.deadline-row.is-urgent {
  background: rgba(220, 38, 38, 0.04);
}

.data-table-row.deadline-row.is-urgent:hover {
  background: rgba(220, 38, 38, 0.07);
}

.deadline-title-line {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.deadline-title {
  overflow: hidden;
  color: #1f2b3a;
  font-size: 0.87rem;
  font-weight: 600;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deadline-title:hover { color: #0ea5a4; }

.deadline-title-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 3px;
}

.legal-chip {
  padding: 1px 8px;
  border-radius: 5px;
  background: #e0f2fe;
  color: #075985;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.69rem;
}

.task-chip {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  color: #5f6e83;
  font-size: 0.71rem;
}

.task-chip.is-missing { color: #b45309; }

.cell-deadline-case {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.deadline-client {
  overflow: hidden;
  color: #5f6e83;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deadline-due-date {
  display: block;
  margin-top: 2px;
  color: #5f6e83;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.cell-deadline-chain {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chain-line {
  display: flex;
  gap: 5px;
  align-items: center;
  color: #475569;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.chain-line i { color: #94a3b8; font-size: 0.66rem; }

.chain-line strong { color: #1f2b3a; }

.chain-rule {
  color: #5f6e83;
  font-size: 0.71rem;
}

.cell-deadline-owner {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.deadline-owner-name {
  overflow: hidden;
  color: #1f2b3a;
  font-size: 0.79rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-fulfil {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid #86efac;
  border-radius: 8px;
  background: #f0fdf4;
  color: #15803d;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.btn-fulfil:hover {
  border-color: #16a34a;
  background: #dcfce7;
}

.deadline-closed {
  color: #5f6e83;
  font-size: 0.76rem;
  font-style: italic;
}

@media (max-width: 1200px) {
  .deadlines-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Variantes de cor do ícone de KPI.
   `.kpi-icon` lê `--kpi-accent` e cai no teal quando ninguém define — e era isso
   que acontecia: `danger`, `info`, `success` e `teal` eram usados em quatro telas
   sem existirem em CSS nenhum, então todos os ícones saíam da mesma cor. */

.kpi-icon-danger { --kpi-accent: #dc2626; }
.kpi-icon-info { --kpi-accent: #0284c7; }
.kpi-icon-success { --kpi-accent: #16a34a; }
.kpi-icon-teal { --kpi-accent: #0ea5a4; }

/* --- Produtividade (D-042) ------------------------------------------------- */

.prod-subtitle {
  margin: 4px 0 0;
  color: #5f6e83;
  font-size: 0.86rem;
}

.prod-filters {
  display: inline-flex;
  gap: 8px;
}

.prod-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.delta-pill {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  vertical-align: middle;
}

.delta-pill--up { background: #dcfce7; color: #15803d; }
.delta-pill--down { background: #fee2e2; color: #b91c1c; }

.goal-card--empty {
  border-style: dashed;
}

.goal-empty-title {
  margin: 4px 0 2px;
  color: #5f6e83;
  font-family: var(--heading-font);
  font-size: 1.05rem;
  font-weight: 600;
}

.goal-track,
.punctuality-bar {
  display: flex;
  width: 100%;
  height: 6px;
  margin: 7px 0 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.goal-fill {
  display: block;
  width: var(--done, 0%);
  height: 100%;
  border-radius: 999px;
  background: #8b5cf6;
}

.punctuality-seg {
  flex: var(--seg, 1);
  height: 100%;
}

.punctuality-seg--early { background: #16a34a; }
.punctuality-seg--ontime { background: #86efac; }
.punctuality-seg--late { background: #fca5a5; }

.goal-form {
  display: flex;
  gap: 7px;
  margin-top: 9px;
}

.goal-input {
  width: 88px;
  padding: 5px 9px;
  border: 1px solid #dde4ed;
  border-radius: 8px;
  color: #1f2b3a;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.btn-goal {
  flex: 1;
  padding: 5px 12px;
  border: 1px solid #0ea5a4;
  border-radius: 8px;
  background: #ffffff;
  color: #0e7490;
  font-size: 0.79rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-goal:hover {
  background: #f0fdfa;
}

.prod-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.prod-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  padding: 14px 16px 8px;
}

.prod-card-head h2 {
  margin: 0;
  color: #1f2b3a;
  font-size: 1rem;
  font-weight: 700;
}

.prod-card-note {
  color: #5f6e83;
  font-size: 0.76rem;
}

.prod-card-link {
  margin-left: auto;
  color: #0e7490;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.prod-card-link:hover { text-decoration: underline; }

.prod-legend {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-left: auto;
  color: #5f6e83;
  font-size: 0.73rem;
}

.prod-legend-item {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.legend-line,
.legend-dash,
.legend-bar {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
}

.legend-line { background: #0ea5a4; }
.legend-dash { background: repeating-linear-gradient(90deg, #94a3b8 0 4px, transparent 4px 7px); }
.legend-bar { height: 9px; width: 9px; border-radius: 2px; background: #c9e2e1; }

.prod-chart {
  height: 260px;
  padding: 0 16px;
}

.prod-chart-note {
  display: flex;
  gap: 6px;
  align-items: baseline;
  margin: 10px 16px 14px;
  color: #5f6e83;
  font-size: 0.74rem;
  line-height: 1.45;
}

.type-list {
  margin: 0;
  padding: 0 16px 6px;
  list-style: none;
}

.type-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 66px 78px;
  gap: 8px 10px;
  align-items: center;
  padding: 7px 0;
}

.type-name {
  display: flex;
  gap: 7px;
  align-items: center;
  overflow: hidden;
  color: #1f2b3a;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.type-points {
  color: #1f2b3a;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.type-tasks {
  color: #5f6e83;
  font-size: 0.74rem;
  text-align: right;
}

.type-bar {
  grid-column: 1 / -1;
  display: block;
  height: 5px;
  border-radius: 999px;
  background: #eef2f8;
}

.type-fill {
  display: block;
  width: var(--done, 0%);
  height: 100%;
  border-radius: 999px;
  background: #0ea5a4;
}

.type-empty {
  padding: 6px 0 12px;
  color: #5f6e83;
  font-size: 0.82rem;
}

.data-table-row.team-month-row {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.6fr) 110px 130px;
  align-items: center;
}

.cell-team-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.team-note {
  overflow: hidden;
  color: #5f6e83;
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-team-points {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.cell-team-points strong {
  color: #1f2b3a;
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
}

.cell-team-points small {
  color: #5f6e83;
  font-size: 0.71rem;
}

.cell-team-action {
  display: flex;
  justify-content: flex-end;
}

.rank-pill {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.72rem;
  font-weight: 700;
}

.credit-list {
  margin: 0;
  padding: 0 16px 6px;
  list-style: none;
}

.credit-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 104px 52px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f2f6fb;
}

.credit-row:last-of-type { border-bottom: 0; }

.credit-date {
  color: #5f6e83;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.credit-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.credit-title {
  overflow: hidden;
  color: #0e7490;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credit-title:hover { text-decoration: underline; }

.credit-link {
  overflow: hidden;
  color: #5f6e83;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.punctuality-pill {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.punctuality-pill--early { background: #dcfce7; color: #15803d; }
.punctuality-pill--on_time { background: #ecfdf5; color: #15803d; }
.punctuality-pill--late { background: #fee2e2; color: #b91c1c; }
.punctuality-pill--none { background: #f1f5f9; color: #5f6e83; }

.credit-points {
  color: #15803d;
  font-size: 0.86rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@media (max-width: 1200px) {
  .prod-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prod-layout { grid-template-columns: minmax(0, 1fr); }
}

/* --- Financeiro (D-043) ---------------------------------------------------- */
/* Todo valor monetário usa `.money`, com numeral tabular: sem isso a coluna de
   R$ dança conforme o dígito e a comparação vertical fica impossível. */

.money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.money.is-negative { color: #b91c1c; }

.fin-subtitle {
  margin: 4px 0 0;
  color: #5f6e83;
  font-size: 0.86rem;
}

.fin-subtitle strong { color: #b91c1c; }

.fin-tabs { margin-bottom: 14px; }

.fin-notice {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid #e3c993;
  border-radius: 14px;
  background: #fffbeb;
}

.fin-notice-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: #fef3c7;
  color: #b45309;
  font-size: 1.1rem;
}

.fin-notice-body strong {
  color: #78350f;
  font-size: 0.94rem;
}

.fin-notice-body p {
  margin: 5px 0 11px;
  color: #78350f;
  font-size: 0.83rem;
  line-height: 1.5;
}

.fin-notice-body form {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.fin-notice-success {
  margin-top: 10px !important;
  padding-top: 10px;
  border-top: 1px dashed #e3c993;
}

.btn-generate {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 8px 16px;
  border: 0;
  border-radius: 10px;
  background: #b45309;
  color: #ffffff;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-generate:hover { background: #92400e; }

.fin-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.account-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.account-list li {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 2px 0;
  color: #5f6e83;
  font-size: 0.76rem;
}

.account-list .money { margin-left: auto; }

.account-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
}

.account-dot--banco { background: #dc2626; }
.account-dot--caixa_interno { background: #0ea5a4; }
.account-dot--cartao { background: #8b5cf6; }

.chip-warn-inline {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.7rem;
  font-weight: 600;
}

.aging-bar {
  display: flex;
  width: 100%;
  height: 6px;
  margin: 7px 0 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #f1f5f9;
}

.aging-seg { flex: var(--seg, 1); height: 100%; }

.aging-seg--d30 { background: #fca5a5; }
.aging-seg--d60 { background: #dc2626; }
.aging-seg--d90 { background: #991b1b; }

.fin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.fin-chart { height: 250px; padding: 0 16px; }

.legend-bar--in { background: #86efac; }
.legend-bar--out { background: #fca5a5; }
.legend-line--dark { background: #0f172a; }

.collection-list,
.due-list,
.dre-list {
  margin: 0;
  padding: 0 16px 8px;
  list-style: none;
}

.collection-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 11px 10px;
  border-radius: 11px;
  background: #fef2f2;
}

.collection-card + .collection-card { margin-top: 9px; }

.collection-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.collection-name {
  overflow: hidden;
  color: #0e7490;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-name:hover { text-decoration: underline; }

.collection-context,
.collection-contact {
  display: flex;
  gap: 5px;
  align-items: center;
  overflow: hidden;
  color: #5f6e83;
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-contact.is-missing { color: #b91c1c; font-weight: 600; }

.collection-aside {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
}

.collection-aside .money { font-size: 0.9rem; font-weight: 700; }

.collection-actions {
  display: flex;
  gap: 5px;
  align-items: center;
}

.btn-register {
  padding: 3px 10px;
  border: 1px solid #dde4ed;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.btn-register:hover { border-color: #0ea5a4; color: #0e7490; }

.due-row {
  display: grid;
  grid-template-columns: 26px 44px minmax(0, 1fr) 110px 96px;
  gap: 10px;
  align-items: center;
  padding: 9px 8px;
  border-radius: 10px;
}

.due-row--overdue { background: rgba(220, 38, 38, 0.04); }

.due-arrow {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 0.72rem;
}

.due-arrow--receita { background: #dcfce7; color: #15803d; }
.due-arrow--despesa { background: #fee2e2; color: #b91c1c; }

.due-date {
  color: #5f6e83;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.due-date.is-overdue { color: #b91c1c; font-weight: 700; }

.due-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.due-description {
  overflow: hidden;
  color: #1f2b3a;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.due-context {
  color: #5f6e83;
  font-size: 0.72rem;
}

.due-row .money { text-align: right; }

.btn-settle {
  padding: 4px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.btn-settle:hover { border-color: #0ea5a4; color: #0e7490; }

.btn-settle.is-overdue {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.dre-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 120px;
  gap: 12px;
  align-items: center;
  padding: 7px 0;
}

.dre-label {
  overflow: hidden;
  color: #1f2b3a;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dre-track {
  display: flex;
  height: 6px;
  border-radius: 999px;
  background: #f1f5f9;
}

.dre-bar {
  display: block;
  width: var(--done, 0%);
  height: 100%;
  border-radius: 999px;
}

.dre-bar--in,
.dre-bar--total-in { background: #16a34a; }
.dre-bar--out,
.dre-bar--total-out { background: #fca5a5; }
.dre-bar--result { background: #dc2626; }

.dre-row--total-in,
.dre-row--total-out,
.dre-row--result {
  border-top: 1px solid #eef2f8;
}

.dre-row--total-in .dre-label,
.dre-row--total-out .dre-label,
.dre-row--result .dre-label {
  font-weight: 700;
}

.dre-row .money { text-align: right; }

.dre-row--result .money { font-size: 0.95rem; font-weight: 700; }

.transfer-warning {
  margin: 10px 0 0;
  color: #b91c1c;
  font-size: 0.79rem;
  font-weight: 600;
}

@media (max-width: 1200px) {
  .fin-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fin-layout { grid-template-columns: minmax(0, 1fr); }
}

/* --- Custos de IA (D-044) -------------------------------------------------- */

.usage-subtitle {
  margin: 4px 0 0;
  color: #5f6e83;
  font-size: 0.86rem;
}

.price-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  padding: 10px 0;
  border-top: 1px dashed #e3c993;
}

.price-inline-model {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 210px;
}

.price-inline-model code {
  color: #78350f;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  font-weight: 600;
}

.price-inline-model small {
  color: #92400e;
  font-size: 0.72rem;
}

.price-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.price-inline-form label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #78350f;
  font-size: 0.7rem;
  font-weight: 600;
}

.price-inline-form input {
  width: 96px;
  padding: 5px 8px;
  border: 1px solid #e3c993;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2b3a;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.price-inline-note,
.price-inline-help {
  color: #92400e;
  font-size: 0.74rem;
}

.price-inline-help { margin: 8px 0 0; }

.no-price {
  color: #92400e;
  font-size: 0.78rem;
  font-style: italic;
}

.no-price-badge {
  padding: 1px 7px;
  border-radius: 5px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.legacy-badge {
  padding: 1px 7px;
  border-radius: 5px;
  background: #f1f5f9;
  color: #526175;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.usage-chart { height: 240px; padding: 0 16px; }

.legend-dot-warn {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
}

.area-dot--triagem { --dot: #0ea5a4; }
.area-dot--analise { --dot: #8b5cf6; }
.area-dot--processos { --dot: #0284c7; }
.area-dot--chat_caso { --dot: #16a34a; }
.area-dot--aprofundada { --dot: #dc2626; }
.area-dot--documentos { --dot: #f59e0b; }

.type-fill.is-partial {
  background: repeating-linear-gradient(
    90deg,
    #0ea5a4 0 8px,
    #f59e0b 8px 12px
  );
}

.type-note {
  grid-column: 1 / -1;
  color: #92400e;
  font-size: 0.71rem;
}

.goal-fill.is-over { background: #dc2626; }

.token-stack {
  display: flex;
  width: 100%;
  height: 16px;
  margin: 4px 16px 12px;
  overflow: hidden;
  border-radius: 8px;
  background: #eef2f8;
}

.token-seg { flex: var(--seg, 1); height: 100%; }

.token-seg--fresh { background: #0ea5a4; }
.token-seg--cached { background: #7dd3d1; }
.token-seg--out { background: #0f172a; }

.token-legend {
  margin: 0;
  padding: 0 16px;
  list-style: none;
}

.token-legend li {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 3px 0;
  color: #5f6e83;
  font-size: 0.79rem;
}

.token-legend b {
  margin-left: auto;
  color: #1f2b3a;
}

.token-legend small { width: 42px; text-align: right; }

.token-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.model-list {
  margin: 0;
  padding: 0 16px 6px;
  list-style: none;
}

.model-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 96px 108px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f2f6fb;
}

.model-row:last-of-type { border-bottom: 0; }

.model-row--unpriced { background: #fffbeb; }

.model-name {
  display: flex;
  gap: 7px;
  align-items: center;
  overflow: hidden;
}

.model-name code {
  overflow: hidden;
  color: #1f2b3a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-cost,
.model-prices { text-align: right; }

.model-calls,
.model-prices {
  color: #5f6e83;
  font-size: 0.75rem;
}

.data-table-row.usage-person-row {
  grid-template-columns: minmax(0, 1.8fr) 110px 130px 120px;
  align-items: center;
}

.data-table-row.usage-person-row .money:not(:first-child) { text-align: right; }

.data-table-row.usage-person-row.is-top { background: #f0fdfa; }

.team-person-name a {
  color: #0e7490;
  text-decoration: none;
}

.team-person-name a:hover { text-decoration: underline; }

/* --- Relatórios & BI (D-045) ----------------------------------------------- */

.rep-subtitle {
  margin: 4px 0 0;
  color: #5f6e83;
  font-size: 0.86rem;
}

.rep-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.blocked-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.blocked-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px dashed #e3c993;
}

.blocked-title {
  color: #78350f;
  font-size: 0.84rem;
  font-weight: 600;
}

.blocked-cause {
  color: #92400e;
  font-size: 0.79rem;
  line-height: 1.45;
}

.blocked-ok {
  padding: 6px 14px;
  border: 1px solid #e3c993;
  border-radius: 9px;
  color: #92400e;
  font-size: 0.79rem;
  font-weight: 600;
}

/* Funil ---------------------------------------------------------------------- */

.funnel-list {
  margin: 0;
  padding: 4px 16px 8px;
  list-style: none;
}

.funnel-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 6px 10px;
  align-items: center;
  padding: 5px 0;
}

.funnel-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  width: var(--done, 100%);
  min-width: 130px;
  padding: 7px 12px;
  border-radius: 8px;
  background: #0ea5a4;
  color: #ffffff;
}

.funnel-name {
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funnel-count {
  font-size: 0.88rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.funnel-percent {
  color: #5f6e83;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.funnel-drop {
  grid-column: 1 / -1;
  padding-left: 12px;
  color: #5f6e83;
  font-size: 0.72rem;
}

.funnel-drop.is-worst {
  color: #92400e;
  font-weight: 600;
}

.discard-block {
  margin: 6px 16px 14px;
  padding: 12px 14px;
  border: 1px dashed #dde4ed;
  border-radius: 11px;
  background: #fafcfe;
}

.discard-block h3 {
  margin: 0 0 8px;
  color: #5f6e83;
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.discard-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.discard-list li {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  color: #1f2b3a;
  font-size: 0.81rem;
}

.discard-list b { font-variant-numeric: tabular-nums; }

.origin-rate.is-good { color: #15803d; }

.type-fill.is-bottleneck { background: #f59e0b; }

/* Carteira por fase ---------------------------------------------------------- */

.phase-list {
  margin: 0;
  padding: 4px 16px 10px;
  list-style: none;
}

.phase-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) 130px;
  gap: 12px;
  align-items: center;
  padding: 5px 0;
}

.phase-name {
  overflow: hidden;
  color: #1f2b3a;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phase-row.is-empty .phase-name { color: #5f6e83; }

.phase-bar {
  display: flex;
  align-items: center;
  height: 22px;
}

.phase-fill {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: var(--done, 0%);
  min-width: 26px;
  height: 100%;
  padding-right: 8px;
  border-radius: 6px;
  background: #0ea5a4;
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.phase-none {
  padding: 0 10px;
  border: 1px dashed #dde4ed;
  border-radius: 6px;
  color: #5f6e83;
  font-size: 0.73rem;
  font-style: italic;
  line-height: 22px;
}

.phase-value { text-align: right; }

/* Estoque, safra e desfecho -------------------------------------------------- */

.stock-chart { height: 240px; padding: 0 16px; }

.cohort-bar {
  grid-column: 1 / -1;
  display: flex;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f8;
}

.cohort-seg { flex: var(--seg, 0); height: 100%; }

.cohort-seg--active { background: #0ea5a4; }
.cohort-seg--closed { background: #cbd5e1; }

.outcome-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 4px 16px 0;
}

.outcome-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  border-radius: 11px;
  background: #f8fafc;
  color: #5f6e83;
  font-size: 0.76rem;
}

.outcome-cell b {
  color: #1f2b3a;
  font-family: var(--heading-font);
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
}

/* Carteira parada ------------------------------------------------------------ */

.stalled-list {
  margin: 0;
  padding: 4px 16px 10px;
  list-style: none;
}

.stalled-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1.4fr) minmax(0, 1fr) 30px 30px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f2f6fb;
}

.stalled-row:last-of-type { border-bottom: 0; }

.stalled-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #eef2f8;
  color: #5f6e83;
  font-size: 0.78rem;
}

.stalled-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stalled-name {
  overflow: hidden;
  color: #1f2b3a;
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stalled-name:hover { color: #0ea5a4; }

.stalled-context {
  overflow: hidden;
  color: #5f6e83;
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stalled-age {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stalled-track {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: #eef2f8;
}

.stalled-fill {
  display: block;
  width: var(--done, 0%);
  height: 100%;
  border-radius: 999px;
  background: #f59e0b;
}

.stalled-fill.is-late { background: #dc2626; }

.stalled-days {
  color: #5f6e83;
  font-size: 0.71rem;
  font-variant-numeric: tabular-nums;
}

/* Rentabilidade -------------------------------------------------------------- */

.data-table-head.profit-row,
.data-table-row.profit-row {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) 130px 130px 140px;
  align-items: center;
}

.data-table-row.profit-row .money { text-align: right; }

.profit-context {
  color: #5f6e83;
  font-size: 0.76rem;
}

@media (max-width: 1400px) {
  .rep-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1000px) {
  .rep-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blocked-row { grid-template-columns: minmax(0, 1fr); }
}

/* --- Controladoria (D-046) -------------------------------------------------- */

.ctrl-subtitle {
  margin: 4px 0 0;
  color: #5f6e83;
  font-size: 0.86rem;
}

.ctrl-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.kpi-card--critico { border-left: 3px solid #b91c1c; }
.kpi-card--money { border-left: 3px solid #c2410c; }
.kpi-card--recurring { border-left: 3px solid #0369a1; }
.kpi-card--closing { border-left: 3px solid #0ea5a4; }

.kpi-value small {
  color: #5f6e83;
  font-size: 0.9rem;
  font-weight: 500;
}

.sev-bar {
  display: flex;
  gap: 3px;
  height: 6px;
  margin-top: 10px;
}

.sev-seg { border-radius: 999px; }
.sev-seg--critico { background: #dc2626; }
.sev-seg--atencao { background: #ea580c; }
.sev-seg--info { background: #0369a1; }

.ctrl-track {
  display: block;
  height: 6px;
  margin-top: 10px;
  border-radius: 999px;
  background: #eef2f8;
}

.ctrl-fill {
  display: block;
  width: var(--done, 0%);
  height: 100%;
  border-radius: 999px;
  background: #0ea5a4;
}

.ctrl-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.ctrl-main,
.ctrl-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Fila de conferência --------------------------------------------------------- */

.finding-group-head {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px 16px;
  border-top: 1px solid #eef2f8;
  background: #fbfdff;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
}

.finding-group-head strong { font-size: 0.75rem; }

.finding-criterion {
  flex: 1;
  color: #5f6e83;
  font-size: 0.75rem;
  letter-spacing: 0;
  text-transform: none;
}

.finding-group-count {
  color: #5f6e83;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.severity-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.finding-group--critico { color: #b91c1c; }
.finding-group--critico .severity-dot { background: #b91c1c; }
.finding-group--atencao { color: #c2410c; }
.finding-group--atencao .severity-dot { background: #c2410c; }
.finding-group--info { color: #0369a1; }
.finding-group--info .severity-dot { background: #0369a1; }

.finding-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid #f2f6fb;
}

.finding-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.finding-row--critico .finding-icon { background: #fee2e2; color: #b91c1c; }
.finding-row--atencao .finding-icon { background: #ffedd5; color: #c2410c; }
.finding-row--info .finding-icon { background: #e0f2fe; color: #0369a1; }

.finding-body { min-width: 0; }

.finding-title {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin: 0 0 4px;
  color: #1f2b3a;
  font-family: var(--heading-font);
  font-size: 0.92rem;
  font-weight: 600;
}

.module-chip {
  padding: 2px 8px;
  border-radius: 6px;
  background: #eef2f8;
  color: #475569;
  font-family: var(--body-font);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.recurring-badge {
  padding: 2px 8px;
  border-radius: 6px;
  background: #fee2e2;
  color: #b91c1c;
  font-family: var(--body-font);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.finding-cause {
  margin: 0 0 7px;
  color: #475569;
  font-size: 0.82rem;
  line-height: 1.5;
}

.finding-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0;
  color: #5f6e83;
  font-size: 0.76rem;
}

.finding-meta .impact { font-weight: 600; }
.impact--money { color: #b91c1c; }
.impact--risk { color: #c2410c; }
.impact--ops { color: #5f6e83; }

.finding-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.btn-finding {
  display: inline-block;
  padding: 7px 14px;
  border: 0;
  border-radius: 9px;
  color: #ffffff;
  font-size: 0.79rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.btn-finding--critico { background: #dc2626; }
.btn-finding--atencao { background: #ffffff; border: 1px solid #ea580c; color: #c2410c; }
.btn-finding--info { background: #ffffff; border: 1px solid #cbd5e1; color: #0369a1; }
.btn-finding--neutral { background: #ffffff; border: 1px solid #cbd5e1; color: #475569; }

.finding-icons {
  display: flex;
  gap: 5px;
}

.finding-icons .row-action {
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid #e6ecf4;
  border-radius: 8px;
  background: #ffffff;
  color: #5f6e83;
}

.finding-form {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
}

.finding-form label {
  width: 100%;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 600;
}

.finding-form input[type="text"],
.finding-form select {
  flex: 1;
  min-width: 200px;
  padding: 6px 10px;
  border: 1px solid #dde4ed;
  border-radius: 8px;
  font-size: 0.81rem;
}

.ctrl-empty {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: 22px 16px;
  color: #5f6e83;
  font-size: 0.83rem;
}

/* Nao pode ser flex: os <strong> viram itens de flex e a nota quebra em
   colunas de 70px, ilegivel. O icone entra inline no fluxo do texto. */
.ctrl-note {
  display: block;
  color: #5f6e83;
  font-size: 0.77rem;
  line-height: 1.55;
}

.ctrl-note > .bi {
  margin-right: 6px;
}

.ctrl-note--inset {
  display: block;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
}

.ctrl-warn {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 9px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.78rem;
  line-height: 1.55;
}

/* Tarefas sem tipo ------------------------------------------------------------ */

.data-table-head.untyped-row,
.data-table-row.untyped-row {
  grid-template-columns: 32px minmax(0, 1.5fr) 200px 110px 110px;
  align-items: center;
}

.untyped-check { margin: 0; }

.untyped-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.untyped-title {
  overflow: hidden;
  color: #1f2b3a;
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.untyped-title:hover { color: #0ea5a4; }

.untyped-context {
  color: #5f6e83;
  font-size: 0.73rem;
}

.type-select {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #99e0de;
  border-radius: 8px;
  background: #f0fdfa;
  color: #0f766e;
  font-size: 0.78rem;
}

.points-move {
  color: #5f6e83;
  font-size: 0.79rem;
  font-variant-numeric: tabular-nums;
}

.points-move strong { color: #0f766e; }
.points-move--down strong { color: #c2410c; }

.untyped-status {
  color: #475569;
  font-size: 0.78rem;
}

/* Duplicatas ------------------------------------------------------------------ */

.ctrl-dup { border: 1px solid #fca5a5; }

.ctrl-dup .card-header { background: #fef2f2; }

.ctrl-dup .card-title {
  display: flex;
  gap: 9px;
  align-items: center;
  color: #b91c1c;
}

.ctrl-dup-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #fee2e2;
  font-size: 0.85rem;
}

.ctrl-dup-lead {
  margin: 0 0 10px;
  color: #475569;
  font-size: 0.81rem;
  line-height: 1.55;
}

.dup-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  padding: 9px 11px;
  border-radius: 10px;
  background: #fef2f2;
}

.dup-title {
  display: block;
  color: #1f2b3a;
  font-size: 0.82rem;
}

.dup-context {
  color: #5f6e83;
  font-size: 0.73rem;
}

.dup-count {
  padding: 2px 9px;
  border-radius: 7px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.dup-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* Checklist ------------------------------------------------------------------- */

.checklist {
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid #f2f6fb;
}

.checklist-item:last-child { border-bottom: 0; }

.checklist-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #dde4ed;
  border-radius: 7px;
  background: #ffffff;
  color: #94a3b8;
  font-size: 0.75rem;
}

.checklist-mark.is-done {
  border-color: #0ea5a4;
  background: #0ea5a4;
  color: #ffffff;
}

.checklist-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.checklist-label {
  color: #1f2b3a;
  font-size: 0.82rem;
  font-weight: 700;
}

.checklist-item.is-done .checklist-label {
  color: #5f6e83;
  font-weight: 500;
}

.checklist-note {
  color: #5f6e83;
  font-size: 0.74rem;
}

/* Carga e redistribuição ------------------------------------------------------ */

.load-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 130px;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #f2f6fb;
}

.load-row:last-of-type { border-bottom: 0; }

.load-row form {
  grid-column: 1 / -1;
  display: flex;
  gap: 7px;
  align-items: center;
}

.load-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.load-name {
  color: #1f2b3a;
  font-size: 0.83rem;
  font-weight: 600;
}

.load-counts {
  color: #5f6e83;
  font-size: 0.74rem;
}

.load-late {
  color: #b91c1c;
  font-weight: 600;
}

.load-gauge {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.load-bar {
  display: flex;
  gap: 2px;
  height: 5px;
}

.load-seg { border-radius: 999px; }
.load-seg--ok { background: #0ea5a4; }
.load-seg--late { background: #dc2626; }

.load-label { font-size: 0.72rem; }
.load-label--over { color: #b91c1c; font-weight: 600; }
.load-label--warn { color: #c2410c; }
.load-label--ok { color: #5f6e83; }

.load-target {
  flex: 1;
  padding: 5px 8px;
  border: 1px solid #dde4ed;
  border-radius: 8px;
  font-size: 0.78rem;
}

/* Trilha de auditoria --------------------------------------------------------- */

.data-table-head.trail-row,
.data-table-row.trail-row {
  grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1.4fr) 80px;
  align-items: center;
}

.data-table-row.audit-row--high { background: rgba(220, 38, 38, 0.035); }

.trail-when {
  color: #5f6e83;
  font-size: 0.77rem;
  font-variant-numeric: tabular-nums;
}

.trail-who {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #1f2b3a;
  font-size: 0.81rem;
}

.avatar-initial--system {
  background: #e2e8f0;
  color: #475569;
}

.trail-record {
  overflow: hidden;
  color: #475569;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk {
  padding: 2px 9px;
  border-radius: 7px;
  font-size: 0.71rem;
  font-weight: 600;
}

.risk--alto { background: #fee2e2; color: #b91c1c; }
.risk--medio { background: #fef3c7; color: #92400e; }

/* Itens de um achado ---------------------------------------------------------- */

.data-table-head.items-row,
.data-table-row.items-row {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) 140px;
  align-items: center;
}

.items-title {
  overflow: hidden;
  color: #1f2b3a;
  font-size: 0.83rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.items-context {
  color: #5f6e83;
  font-size: 0.77rem;
}

/* Badge do menu --------------------------------------------------------------- */

.nav-badge {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

@media (max-width: 1400px) {
  .ctrl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ctrl-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1000px) {
  .ctrl-kpis { grid-template-columns: minmax(0, 1fr); }
  .finding-row { grid-template-columns: 32px minmax(0, 1fr); }
  .finding-actions { grid-column: 2 / -1; align-items: flex-start; }
}

/* --- Equipe e Meu perfil (D-047) -------------------------------------------- */

.team-subtitle {
  margin: 4px 0 0;
  color: #5f6e83;
  font-size: 0.86rem;
}

.team-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.kpi-card--alert { border-left: 3px solid #ea580c; }

.kpi-value small {
  color: #5f6e83;
  font-size: 0.85rem;
  font-weight: 500;
}

.role-bar {
  display: flex;
  gap: 3px;
  height: 6px;
  margin-top: 10px;
}

.role-seg { border-radius: 999px; }
.role-seg--gestor { background: #0ea5a4; }
.role-seg--advogado { background: #6d28d9; }
.role-seg--controladoria { background: #0369a1; }
.role-seg--financeiro { background: #c2410c; }

.team-track {
  display: block;
  height: 6px;
  margin-top: 10px;
  border-radius: 999px;
  background: #eef2f8;
}

.team-fill {
  display: block;
  width: var(--done, 0%);
  height: 100%;
  border-radius: 999px;
  background: #0ea5a4;
}

.team-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.team-main,
.team-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.team-search {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid #dde4ed;
  border-radius: 10px;
  background: #ffffff;
  color: #5f6e83;
}

.team-search input {
  width: 220px;
  border: 0;
  outline: 0;
  font-size: 0.83rem;
}

.team-toggle {
  color: #5f6e83;
  font-size: 0.79rem;
  text-decoration: none;
}

.team-toggle.is-on { color: #0ea5a4; font-weight: 600; }

.team-note {
  margin: 10px 0 0;
  color: #5f6e83;
  font-size: 0.77rem;
  line-height: 1.55;
}

.team-empty {
  margin: 0;
  padding: 22px 16px;
  color: #5f6e83;
  font-size: 0.83rem;
}

/* Linha de membro -------------------------------------------------------------- */

.member-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1.5fr) 190px 150px 96px 92px;
  gap: 12px;
  align-items: center;
  padding: 13px 16px;
  border-top: 1px solid #f2f6fb;
}

.member-row--self { box-shadow: inset 3px 0 0 #0ea5a4; }

/* Inativo com fundo neutro, nunca `opacity`: opacidade reprova em contraste. */
.member-row--inactive { background: #fafcff; }
.member-row--inactive .member-name { color: #475569; }

.member-avatar { position: relative; }

.avatar-photo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-photo--lg,
.avatar-initial--lg {
  width: 44px;
  height: 44px;
  font-size: 0.88rem;
}

.avatar-photo--xl,
.avatar-initial--xl {
  width: 120px;
  height: 120px;
  font-size: 2rem;
}

.presence-dot {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 11px;
  height: 11px;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.presence-dot--online { background: #16a34a; }
.presence-dot--recent { background: #86efac; }
.presence-dot--idle { background: #f59e0b; }
.presence-dot--off { background: #94a3b8; }

.member-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.member-name {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: #1f2b3a;
  font-family: var(--heading-font);
  font-size: 0.9rem;
  font-weight: 600;
}

.member-badge {
  padding: 1px 7px;
  border-radius: 6px;
  font-family: var(--body-font);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.member-badge--self { background: #ccfbf1; color: #0f766e; }
.member-badge--pending { background: #fef3c7; color: #92400e; }
.member-badge--off { background: #e2e8f0; color: #475569; }

.member-meta {
  overflow: hidden;
  color: #5f6e83;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-oab { font-family: "JetBrains Mono", ui-monospace, monospace; }
.member-missing { color: #c2410c; font-weight: 600; }

.member-role {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.role-select {
  padding: 5px 8px;
  border: 1px solid #dde4ed;
  border-radius: 8px;
  background: #ffffff;
  font-size: 0.79rem;
  font-weight: 600;
}

.role-select--gestor { color: #0f766e; border-color: #99e0de; }
.role-select--advogado { color: #6d28d9; border-color: #d8c9f7; }
.role-select--controladoria { color: #0369a1; border-color: #bae0f5; }
.role-select--financeiro { color: #c2410c; border-color: #f7d3bd; }

.role-summary { color: #5f6e83; font-size: 0.71rem; }

.member-goal {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.member-goal-value {
  color: #1f2b3a;
  font-size: 0.79rem;
  font-variant-numeric: tabular-nums;
}

.goal-track {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: #eef2f8;
}

.goal-fill {
  display: block;
  width: var(--done, 0%);
  height: 100%;
  border-radius: 999px;
  background: #0ea5a4;
}

.goal-fill--done { background: #16a34a; }
.goal-fill--warn { background: #f59e0b; }

.member-goal-label { color: #5f6e83; font-size: 0.71rem; }

.access-label { font-size: 0.77rem; }
.access-label--online { color: #15803d; }
.access-label--recent { color: #5f6e83; }
.access-label--idle { color: #c2410c; }
.access-label--off { color: #5f6e83; }

.btn-member {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid #dde4ed;
  border-radius: 9px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.btn-member--primary { border-color: #0ea5a4; background: #0ea5a4; color: #ffffff; }
.btn-member--danger { border-color: #fca5a5; color: #b91c1c; }

.member-strip {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.78rem;
}

.member-strip--pending { background: #fffbeb; color: #92400e; }
.member-strip--off { background: #f1f5f9; color: #475569; }

/* Painel de edição -------------------------------------------------------------- */

.member-editor {
  grid-column: 1 / -1;
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
}

.editor-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 12px;
}

.editor-head span { color: #5f6e83; font-size: 0.76rem; }

.editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.editor-grid label,
.editor-goal label,
.editor-access label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 600;
}

.editor-grid input,
.editor-grid select,
.editor-goal input,
.editor-access select,
.profile-form input,
.profile-form select {
  padding: 7px 10px;
  border: 1px solid #dde4ed;
  border-radius: 9px;
  font-size: 0.83rem;
  font-weight: 400;
}

.field--email input { border-color: #e3c993; background: #fffbeb; }
.field--mono input { font-family: "JetBrains Mono", ui-monospace, monospace; }

.field-hint {
  color: #5f6e83;
  font-size: 0.71rem;
  font-weight: 400;
}

.field-error {
  color: #b91c1c;
  font-size: 0.73rem;
  font-weight: 600;
}

.editor-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.editor-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e6ecf4;
}

.editor-goal,
.editor-access {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.editor-check {
  flex-direction: row !important;
  gap: 7px;
  align-items: center;
  font-weight: 400;
}

.editor-warn {
  margin: 0;
  padding: 8px 10px;
  border-radius: 9px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.76rem;
}

/* Cobertura de papéis e matriz --------------------------------------------------- */

.coverage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f2f6fb;
}

.coverage-row:last-of-type { border-bottom: 0; }

.role-chip {
  padding: 2px 9px;
  border-radius: 7px;
  font-size: 0.73rem;
  font-weight: 600;
}

.role-chip--gestor { background: #ccfbf1; color: #0f766e; }
.role-chip--advogado { background: #ede9fe; color: #6d28d9; }
.role-chip--controladoria { background: #e0f2fe; color: #0369a1; }
.role-chip--financeiro { background: #ffedd5; color: #c2410c; }

.coverage-count {
  color: #5f6e83;
  font-size: 0.77rem;
  font-variant-numeric: tabular-nums;
}

.coverage-note { font-size: 0.74rem; text-align: right; }
.coverage-note--empty { color: #c2410c; font-weight: 700; }
.coverage-note--single { color: #c2410c; }

.perm-matrix { padding: 4px 16px 12px; }

.perm-head,
.perm-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(4, 40px);
  gap: 6px;
  align-items: center;
}

.perm-head { padding-bottom: 6px; border-bottom: 1px solid #eef2f8; }

.perm-role {
  overflow: hidden;
  color: #5f6e83;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.perm-row { padding: 5px 0; border-bottom: 1px solid #f8fafc; }

.perm-area {
  overflow: hidden;
  color: #1f2b3a;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.perm-cell { font-size: 0.85rem; text-align: center; }
.perm-cell--none { color: #c4d2e6; }
.perm-cell--read { color: #0369a1; }
.perm-cell--write { color: #0ea5a4; }

/* Meu perfil --------------------------------------------------------------------- */

.profile-form {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.profile-photo {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.profile-form .editor-actions { grid-column: 2; }

.profile-subhead {
  margin: 18px 0 8px;
  color: #1f2b3a;
  font-family: var(--heading-font);
  font-size: 0.86rem;
}

.session-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 92px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f2f6fb;
}

.session-key {
  color: #475569;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.76rem;
}

.session-when { color: #5f6e83; font-size: 0.77rem; }

.session-badge {
  padding: 2px 9px;
  border-radius: 7px;
  background: #ccfbf1;
  color: #0f766e;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.notif-head,
.notif-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 70px 110px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
}

.notif-head {
  border-bottom: 1px solid #eef2f8;
  color: #5f6e83;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.notif-head span:not(:first-child),
.notif-row > span:not(:first-child),
.notif-row .notif-toggle { text-align: center; }

.notif-row {
  border-bottom: 1px solid #f8fafc;
  color: #1f2b3a;
  font-size: 0.81rem;
}

.notif-fixed { color: #0ea5a4; }
.notif-off { color: #5f6e83; font-size: 0.72rem; font-style: italic; }
.notif-toggle { margin: 0; }

.profile-stats {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.profile-stats li {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid #f2f6fb;
  color: #5f6e83;
  font-size: 0.79rem;
}

.profile-stats b { color: #1f2b3a; font-variant-numeric: tabular-nums; }

.ical-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}

.ical-url {
  flex: 1;
  overflow: hidden;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-areas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.area-chip {
  padding: 3px 9px;
  border: 1px solid #e6ecf4;
  border-radius: 7px;
  color: #475569;
  font-size: 0.73rem;
}

@media (max-width: 1400px) {
  .team-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-grid { grid-template-columns: minmax(0, 1fr); }
  .member-row { grid-template-columns: 52px minmax(0, 1fr) 170px 130px; }
  .member-access, .member-actions { grid-column: 2 / -1; }
}

@media (max-width: 1000px) {
  .team-kpis { grid-template-columns: minmax(0, 1fr); }
  .editor-grid { grid-template-columns: minmax(0, 1fr); }
  .editor-split { grid-template-columns: minmax(0, 1fr); }
  .profile-form { grid-template-columns: minmax(0, 1fr); }
  .profile-form .editor-actions { grid-column: 1; }
}

/* --- Central de configurações (D-048) --------------------------------------- */

.set-subtitle {
  margin: 4px 0 0;
  color: #5f6e83;
  font-size: 0.86rem;
}

.set-search {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid #dde4ed;
  border-radius: 10px;
  background: #ffffff;
  color: #5f6e83;
}

.set-search input {
  width: 280px;
  border: 0;
  outline: 0;
  font-size: 0.83rem;
}

.set-pendings {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #fca5a5;
  border-radius: 14px;
  background: #fef2f2;
}

.set-pendings-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  color: #b91c1c;
  font-size: 0.86rem;
}

.set-pendings-head span {
  color: #92400e;
  font-size: 0.78rem;
}

.set-pendings-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.pending-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) minmax(0, 1.6fr) 110px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px dashed #fca5a5;
}

.pending-badge {
  padding: 2px 8px;
  border-radius: 7px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
  text-transform: uppercase;
}

.pending-badge--legal { background: #b91c1c; color: #ffffff; }
.pending-badge--high { background: #ffedd5; color: #c2410c; }
.pending-badge--medium { background: #fef3c7; color: #92400e; }

.pending-title { color: #1f2b3a; font-size: 0.83rem; font-weight: 600; }
.pending-effect { color: #7c2d12; font-size: 0.79rem; }

.pending-action {
  padding: 5px 11px;
  border: 1px solid #fca5a5;
  border-radius: 9px;
  background: #ffffff;
  color: #b91c1c;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.set-grid {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.settings-rail {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border: 1px solid #eef2f8;
  border-radius: 14px;
  background: #ffffff;
}

.settings-rail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 11px;
  border-radius: 10px;
  color: #475569;
  text-decoration: none;
}

.settings-rail-item:hover { background: #f8fafc; }
.settings-rail-item.is-active { background: #f0fdfa; color: #0f766e; }

.settings-rail-label {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 0.84rem;
  font-weight: 600;
}

.settings-rail-note {
  color: #5f6e83;
  font-size: 0.71rem;
  line-height: 1.4;
}

.rail-badge {
  margin-left: auto;
  padding: 0 7px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.rail-badge--legal { background: #b91c1c; }
.rail-badge--high { background: #ea580c; }
.rail-badge--medium { background: #d97706; }

.settings-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.set-two {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.set-note {
  margin: 12px 0 0;
  color: #5f6e83;
  font-size: 0.77rem;
  line-height: 1.55;
}

.set-note--inset {
  margin: 0;
  padding: 12px 16px;
  border-top: 1px solid #f2f6fb;
}

.set-empty {
  margin: 0;
  padding: 22px 16px;
  color: #5f6e83;
  font-size: 0.83rem;
}

.setting-key {
  padding: 1px 6px;
  border-radius: 5px;
  background: #f1f5f9;
  color: #5f6e83;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 400;
}

.is-dimmed { opacity: 0.35; }
.is-hit { box-shadow: 0 0 0 2px #99e0de; border-radius: 10px; }

/* Escritório --------------------------------------------------------------- */

.office-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.office-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.office-field--wide { grid-column: 1 / -1; }

.office-label {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: #475569;
  font-size: 0.79rem;
  font-weight: 600;
}

.office-tag {
  padding: 1px 7px;
  border-radius: 6px;
  background: #eef2f8;
  color: #475569;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.office-field input,
.set-field input,
.set-field textarea,
.set-field select {
  padding: 7px 10px;
  border: 1px solid #dde4ed;
  border-radius: 9px;
  font-size: 0.83rem;
}

.office-field--empty input { border-color: #fca5a5; background: #fef2f2; }
.office-field--warn input { border-color: #e3c993; background: #fffbeb; }

.office-state { font-size: 0.73rem; }
.office-state--empty { color: #b91c1c; font-weight: 600; }
.office-state--warn { color: #92400e; }
.office-state--ok { color: #15803d; }

.set-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.set-field--switch { flex-direction: column; }

/* Preview da peça ----------------------------------------------------------- */

.piece-preview .card-body { font-family: "JetBrains Mono", ui-monospace, monospace; }

.preview-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid #f2f6fb;
  font-size: 0.74rem;
}

.preview-label { color: #5f6e83; }
.preview-value { word-break: break-word; }

.preview-row--ok .preview-value { color: #15803d; }
.preview-row--warn .preview-value { color: #c2410c; }
.preview-row--default .preview-value { color: #92400e; }
.preview-row--empty .preview-value { color: #b91c1c; font-weight: 700; }

.preview-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  color: #5f6e83;
  font-family: var(--body-font);
  font-size: 0.71rem;
}

.preview-dot--ok { color: #16a34a; }
.preview-dot--warn { color: #ea580c; }
.preview-dot--default { color: #d97706; }
.preview-dot--empty { color: #dc2626; }

/* Versões do consentimento --------------------------------------------------- */

.version-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 110px 128px;
  gap: 12px;
  align-items: center;
  padding: 11px 16px;
  border-top: 1px solid #f2f6fb;
}

.version-row--current { background: #f0fdfa; }

.version-tag {
  padding: 3px 9px;
  border-radius: 7px;
  background: #eef2f8;
  color: #475569;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.74rem;
  text-align: center;
}

.version-row--current .version-tag { background: #ccfbf1; color: #0f766e; }

.version-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.version-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.78rem;
}

.version-flag {
  padding: 1px 7px;
  border-radius: 6px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.68rem;
  font-weight: 700;
}

.version-when { color: #5f6e83; font-size: 0.73rem; }

.version-text {
  overflow: hidden;
  color: #475569;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-count {
  color: #1f2b3a;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* Score --------------------------------------------------------------------- */

.weight-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 44px;
  gap: 12px;
  align-items: center;
  padding: 6px 0;
}

.weight-label {
  overflow: hidden;
  color: #1f2b3a;
  font-size: 0.81rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weight-track {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: #eef2f8;
}

.weight-fill {
  display: block;
  width: var(--done, 0%);
  height: 100%;
  border-radius: 999px;
  background: #0ea5a4;
}

.weight-value {
  color: #0f766e;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.grade-bar {
  display: flex;
  gap: 3px;
  height: 9px;
  margin-bottom: 12px;
}

.grade-seg { flex: 1; border-radius: 999px; }
.grade-seg--a { background: #0ea5a4; flex: 30; }
.grade-seg--b { background: #38bdf8; flex: 25; }
.grade-seg--c { background: #f59e0b; flex: 20; }
.grade-seg--d { background: #cbd5e1; flex: 25; }

.grade-row {
  display: grid;
  grid-template-columns: 32px 120px minmax(0, 1fr) 130px;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f2f6fb;
}

.grade-letter {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
}

.grade-letter--a { background: #0ea5a4; }
.grade-letter--b { background: #38bdf8; }
.grade-letter--c { background: #f59e0b; }
.grade-letter--d { background: #94a3b8; }

.grade-name { color: #1f2b3a; font-size: 0.82rem; font-weight: 600; }
.grade-action { color: #5f6e83; font-size: 0.79rem; }

.grade-threshold {
  color: #475569;
  font-size: 0.77rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.grade-sim {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 11px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.8rem;
  line-height: 1.6;
}

.grade-sim b { color: #0f766e; font-variant-numeric: tabular-nums; }

/* Catálogos ------------------------------------------------------------------ */

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.catalog-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px;
  border: 1px solid #e6ecf4;
  border-radius: 12px;
  color: #1f2b3a;
  text-decoration: none;
}

.catalog-card--warn { border-color: #e3c993; background: #fffbeb; }
.catalog-card--critical { border-color: #fca5a5; background: #fef2f2; }

.catalog-head {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.83rem;
  font-weight: 600;
}

.catalog-count {
  color: #0f766e;
  font-family: var(--heading-font);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}

.catalog-count small { color: #5f6e83; font-size: 0.72rem; }

.catalog-note { color: #92400e; font-size: 0.73rem; line-height: 1.45; }
.catalog-card--critical .catalog-note { color: #b91c1c; font-weight: 600; }

.catalog-provisional {
  margin-top: 2px;
  color: #5f6e83;
  font-size: 0.66rem;
  font-style: italic;
}

/* Integrações e histórico ---------------------------------------------------- */

.integration-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) 170px 150px;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f2f6fb;
}

.integration-dot { width: 10px; height: 10px; border-radius: 50%; }
.integration-dot--ok { background: #16a34a; }
.integration-dot--warn { background: #f59e0b; }
.integration-dot--off { background: #94a3b8; }

.integration-body { display: flex; flex-direction: column; }
.integration-name { color: #1f2b3a; font-size: 0.84rem; font-weight: 600; }
.integration-detail { color: #5f6e83; font-size: 0.75rem; }
.integration-last { color: #5f6e83; font-size: 0.75rem; }

.data-table-head.hist-row,
.data-table-row.hist-row {
  grid-template-columns: 96px minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1.4fr) 108px;
  align-items: center;
}

.hist-when { color: #5f6e83; font-size: 0.77rem; font-variant-numeric: tabular-nums; }
.hist-who { color: #1f2b3a; font-size: 0.8rem; }

.hist-param {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #1f2b3a;
  font-size: 0.8rem;
}

.hist-effect { display: flex; flex-direction: column; gap: 3px; }

.hist-area {
  align-self: flex-start;
  padding: 1px 7px;
  border-radius: 6px;
  background: #eef2f8;
  color: #475569;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
}

.hist-diff {
  overflow: hidden;
  color: #475569;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1400px) {
  .set-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-rail { position: static; flex-direction: row; flex-wrap: wrap; }
  .settings-rail-item { flex: 1 1 200px; }
  .set-two { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1000px) {
  .office-grid { grid-template-columns: minmax(0, 1fr); }
  .pending-row { grid-template-columns: 84px minmax(0, 1fr); }
}

/* --- Variáveis do documento no editor (D-049) ------------------------------- */

.var-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.var-summary {
  color: #5f6e83;
  font-size: 0.73rem;
  font-variant-numeric: tabular-nums;
}

.var-note {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 9px;
  background: #f8fafc;
  color: #5f6e83;
  font-size: 0.73rem;
  line-height: 1.5;
}

.var-note code {
  padding: 0 4px;
  border-radius: 4px;
  background: #eef2f8;
  color: #475569;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
}

.var-group + .var-group { margin-top: 10px; }

.var-group-head {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 5px 0;
  color: #475569;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.var-row {
  border-left: 3px solid #0ea5a4;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  width: 100%;
  margin-bottom: 4px;
  padding: 7px 9px;
  border: 1px solid #e6ecf4;
  border-radius: 9px;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
}

.var-row:hover:not(:disabled) { border-color: #99e0de; background: #f0fdfa; }
.var-row:disabled { cursor: not-allowed; }

.var-row--used { border-left: 3px solid #0ea5a4; }

/* Sem valor não é clicável: inserir vazio no meio da peça é pior que nada. */
.var-row--empty { background: #fafcff; cursor: default; }
.var-row--empty:hover { border-color: #e6ecf4; background: #fafcff; }

.var-path {
  display: flex;
  gap: 6px;
  align-items: center;
  color: #0f766e;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.71rem;
}

.var-flag {
  padding: 0 5px;
  border-radius: 5px;
  background: #ccfbf1;
  color: #0f766e;
  font-family: var(--body-font);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.var-label {
  color: #5f6e83;
  font-size: 0.71rem;
}

.var-value {
  overflow: hidden;
  color: #1f2b3a;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.var-row--empty .var-value { color: #c2410c; font-size: 0.75rem; }

/* --- Automações (D-050) ------------------------------------------------------ */

.wf-subtitle {
  margin: 4px 0 0;
  max-width: 62ch;
  color: #5f6e83;
  font-size: 0.84rem;
  line-height: 1.55;
}

.wf-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.wf-alerts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.wf-alert {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #fca5a5;
  border-radius: 13px;
  background: #fef2f2;
  color: #7c2d12;
  font-size: 0.81rem;
  line-height: 1.5;
}

.wf-alert-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #fee2e2;
  color: #b91c1c;
}

.wf-alert-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

.wf-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.wf-main,
.wf-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.btn-wf {
  display: inline-block;
  padding: 5px 11px;
  border: 1px solid #dde4ed;
  border-radius: 9px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  font-size: 0.77rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.btn-wf--danger { border-color: #dc2626; background: #dc2626; color: #ffffff; }

/* Card de automação ------------------------------------------------------------ */

.wf-card--problem { border-color: #e3c993; }
.wf-card--problem .wf-card-head { background: #fffbeb; }

.wf-card-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  gap: 11px;
  align-items: center;
}

.wf-card-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f0fdfa;
  color: #0f766e;
}

.wf-card-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wf-card-name {
  overflow: hidden;
  color: #1f2b3a;
  font-family: var(--heading-font);
  font-size: 0.93rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wf-card-stats {
  color: #5f6e83;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

.wf-toggle {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 5px 11px;
  border: 1px solid #dde4ed;
  border-radius: 999px;
  background: #ffffff;
  color: #5f6e83;
  cursor: pointer;
  font-size: 0.77rem;
  font-weight: 600;
}

.wf-toggle.is-on { border-color: #99e0de; background: #f0fdfa; color: #0f766e; }

.wf-toggle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.wf-toggle.is-on .wf-toggle-dot { background: #0ea5a4; }

.wf-card-actions { display: flex; gap: 6px; }

/* A espinha QUANDO → ENTÃO ------------------------------------------------------ */

.wf-spine {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wf-when,
.wf-arrow,
.wf-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

/* A borda esquerda é uma só em toda a espinha: base fixa e `min-width: 0`.
   Sem o min-width cada linha assume a largura do próprio texto ("no mesmo dia"
   contra "em 2 dias úteis") e a coluna fica torta de um passo para o outro. */
.wf-label-col {
  flex: 0 0 110px;
  min-width: 0;
  padding-top: 3px;
  color: #5f6e83;
  font-size: 0.74rem;
  text-align: right;
}

/* A borda ficava só nesta linha e empurrava o conteúdo dela 3px: as colunas de
   rótulo desalinhavam do resto da espinha. A marca teal virou um pseudo-elemento,
   que não ocupa espaço no fluxo. */
.wf-when {
  position: relative;
  padding: 10px 0;
}

.wf-when::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: -10px;
  width: 3px;
  border-radius: 999px;
  background: #0ea5a4;
}

.wf-when .wf-label-col {
  color: #0f766e;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wf-when-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.wf-when-text { color: #1f2b3a; font-size: 0.87rem; font-weight: 600; }

.wf-conditions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.wf-conditions-lead { color: #5f6e83; font-size: 0.77rem; }

.wf-chip {
  padding: 2px 9px;
  border-radius: 7px;
  background: #f0fdfa;
  color: #0f766e;
  font-size: 0.76rem;
}

.wf-chip--missing { background: #fee2e2; color: #b91c1c; font-weight: 600; }

.wf-arrow .wf-label-col { color: #94a3b8; }
.wf-arrow-text {
  color: #5f6e83;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wf-step-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid #e6ecf4;
  border-radius: 11px;
  background: #ffffff;
  flex: 1;
}

.wf-step--missing .wf-step-body { border-color: #fca5a5; background: #fef2f2; }

.wf-step-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.wf-step-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: #eef2f8;
  color: #475569;
  font-size: 0.76rem;
}

.wf-step-order {
  color: #5f6e83;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.wf-step-sentence { color: #1f2b3a; font-size: 0.85rem; }

.wf-step-tag {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 6px;
  background: #eef2f8;
  color: #475569;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.wf-step-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wf-detail {
  padding: 1px 8px;
  border-radius: 6px;
  background: #f8fafc;
  color: #5f6e83;
  font-size: 0.73rem;
}

.wf-detail--missing { background: #fee2e2; color: #b91c1c; }

.wf-card-foot {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  color: #5f6e83;
  font-size: 0.76rem;
}

.wf-empty {
  display: flex;
  gap: 12px;
  align-items: center;
  color: #5f6e83;
  font-size: 0.84rem;
}

.wf-empty p { margin: 0; max-width: 60ch; }
.wf-empty-note { margin: 0; padding: 20px 16px; color: #5f6e83; font-size: 0.82rem; }

.wf-note {
  margin: 10px 0 0;
  color: #5f6e83;
  font-size: 0.77rem;
  line-height: 1.55;
}

/* Receitas e gatilhos ----------------------------------------------------------- */

.wf-recipes { border: 1px dashed #cbd5e1; }

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.recipe-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  border: 1px solid #e6ecf4;
  border-radius: 12px;
  color: #1f2b3a;
  text-decoration: none;
}

.recipe-card:hover { border-color: #99e0de; background: #f0fdfa; }
.recipe-name { font-size: 0.85rem; font-weight: 600; }
.recipe-summary { color: #5f6e83; font-size: 0.76rem; line-height: 1.45; }

.recipe-benefit {
  align-self: flex-start;
  padding: 1px 8px;
  border-radius: 6px;
  background: #ccfbf1;
  color: #0f766e;
  font-size: 0.68rem;
  font-weight: 600;
}

.trigger-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid #f2f6fb;
}

.trigger-row:last-child { border-bottom: 0; }

.trigger-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #eef2f8;
  color: #475569;
  font-size: 0.8rem;
}

.trigger-body { display: flex; flex-direction: column; min-width: 0; }

.trigger-name {
  display: flex;
  gap: 7px;
  align-items: center;
  color: #1f2b3a;
  font-size: 0.81rem;
  font-weight: 600;
}

.trigger-flag {
  padding: 0 6px;
  border-radius: 5px;
  background: #ccfbf1;
  color: #0f766e;
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
}

.trigger-example { color: #5f6e83; font-size: 0.74rem; line-height: 1.4; }

/* Construtor -------------------------------------------------------------------- */

.wf-sentence {
  margin-bottom: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  background: #1f2b3a;
  color: #e2e8f0;
}

.wf-sentence-label {
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.wf-sentence-text {
  margin: 6px 0;
  color: #ffffff;
  font-family: var(--heading-font);
  font-size: 1rem;
  line-height: 1.6;
}

.wf-sentence-note { color: #94a3b8; font-size: 0.73rem; }

.trigger-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.trigger-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 11px;
  border: 1px solid #e6ecf4;
  border-radius: 11px;
  cursor: pointer;
}

.trigger-card:has(input:checked) { border-color: #0ea5a4; background: #f0fdfa; }
.trigger-card input { margin-bottom: 4px; }
.trigger-card-icon { color: #0f766e; font-size: 1rem; }
.trigger-card-name { color: #1f2b3a; font-size: 0.83rem; font-weight: 600; }
.trigger-card-example { color: #5f6e83; font-size: 0.73rem; line-height: 1.4; }

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.grade-chips { display: flex; gap: 7px; }

.grade-chip {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 5px 11px;
  border: 1px solid #dde4ed;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.8rem;
}

.grade-chip:has(input:checked) { border-color: #0ea5a4; background: #f0fdfa; color: #0f766e; }

.wf-escape { margin-top: 14px; }
.wf-escape summary { color: #5f6e83; cursor: pointer; font-size: 0.78rem; font-weight: 600; }
.wf-escape-note { margin: 8px 0; color: #5f6e83; font-size: 0.74rem; }

.step-list { display: flex; flex-direction: column; gap: 10px; }

.step-draft { display: flex; gap: 12px; align-items: flex-start; }

.step-draft-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid #e6ecf4;
  border-radius: 11px;
  background: #f8fafc;
}

.step-draft-head { display: flex; gap: 8px; align-items: center; }
.step-draft-head select { flex: 1; }

.step-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 9px;
}

.step-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: #475569;
  font-size: 0.74rem;
  font-weight: 600;
}

.step-field input,
.step-field select,
.step-draft select,
.step-draft input {
  padding: 5px 8px;
  border: 1px solid #dde4ed;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 400;
}

.step-field-note { color: #5f6e83; font-size: 0.76rem; font-weight: 400; }

.step-draft .wf-label-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.wf-save {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 0;
}

.wf-active {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #475569;
  font-size: 0.82rem;
}

.sim-examples {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #475569;
  font-size: 0.78rem;
}

/* Execuções ---------------------------------------------------------------------- */

.run-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.run-row,
.run-detail {
  padding: 11px 16px;
  border-top: 1px solid #f2f6fb;
}

.run-row { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 10px; }
.run-row--stuck { background: rgba(220, 38, 38, 0.035); }

.run-dot {
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border-radius: 50%;
  background: #94a3b8;
}

.run-dot--done { background: #16a34a; }
.run-dot--failed { background: #dc2626; }
.run-dot--running { background: #f59e0b; }
.run-dot--stuck { background: #dc2626; }

.run-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.run-head,
.run-detail-head {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.run-name { color: #1f2b3a; font-size: 0.83rem; font-weight: 600; }

.run-state {
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
}

.run-state--done { background: #dcfce7; color: #15803d; }
.run-state--failed,
.run-state--stuck { background: #fee2e2; color: #b91c1c; }
.run-state--running { background: #fef3c7; color: #92400e; }
.run-state--pending { background: #eef2f8; color: #475569; }

.run-sentence { margin: 6px 0; color: #475569; font-size: 0.81rem; line-height: 1.5; }
.run-when { margin-left: auto; color: #5f6e83; font-size: 0.74rem; }

.run-steps { margin: 0 0 8px; padding: 0; list-style: none; }

.run-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 5px 0;
}

.run-step-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #eef2f8;
  color: #475569;
  font-size: 0.72rem;
}

.run-step-text { color: #1f2b3a; font-size: 0.8rem; }
.run-step--never .run-step-text { color: #b91c1c; font-weight: 600; }
.run-step--never .run-step-icon { background: #fee2e2; color: #b91c1c; }

.run-technical summary { color: #5f6e83; cursor: pointer; font-size: 0.74rem; }

.run-technical-body {
  display: block;
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.71rem;
  word-break: break-all;
}

.run-technical-list {
  margin: 0;
  padding-left: 18px;
  color: #5f6e83;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
}

@media (max-width: 1400px) {
  .wf-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wf-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1000px) {
  .wf-kpis { grid-template-columns: minmax(0, 1fr); }
  .wf-alert { grid-template-columns: 28px minmax(0, 1fr); }
  .wf-label-col { flex: 0 0 76px; }
}

/* --- Lead da triagem (D-052) ------------------------------------------------- */

.lead-hero { margin-bottom: 16px; }

.lead-hero-body {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.lead-avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #6d28d9;
  color: #ffffff;
  font-family: var(--heading-font);
  font-size: 1.35rem;
  font-weight: 700;
}

.lead-identity { min-width: 0; }

.lead-name {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 6px;
  color: #0f1728;
  font-family: var(--heading-font);
  font-size: 1.5rem;
  font-weight: 700;
}

.grade-seal {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  padding: 3px 10px;
  border-radius: 8px;
  color: #ffffff;
}

.grade-seal b { font-family: var(--heading-font); font-size: 0.87rem; }
.grade-seal span { font-size: 0.72rem; font-variant-numeric: tabular-nums; opacity: .92; }

.grade-seal--a, .grade-seal--b { background: #0b8f8e; }
.grade-seal--c { background: #b45309; }
.grade-seal--d { background: #64748b; }

.lead-origin {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 2px 9px;
  border-radius: 7px;
  background: #f3e8ff;
  color: #5b21b6;
  font-family: var(--body-font);
  font-size: 0.72rem;
  font-weight: 600;
}

.sensitive-badge {
  padding: 2px 9px;
  border-radius: 7px;
  background: #f3e8ff;
  color: #5b21b6;
  font-family: var(--body-font);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.lead-contact,
.lead-when {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 4px;
  color: #5f6e83;
  font-size: 0.81rem;
}

.lead-contact i { margin-right: 5px; font-size: 0.7rem; }
.lead-missing { color: #c2410c; font-weight: 600; }

.lead-actions { display: flex; gap: 8px; align-items: flex-start; }

/* Faixa de decisão ------------------------------------------------------------- */

.decision-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 13px 20px;
  border-top: 1px solid #eef2f8;
  background: #f6f9fd;
}

.decision-label {
  color: #5f6e83;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.decision-form { display: flex; flex-wrap: wrap; gap: 8px; }

.btn-decision {
  padding: 8px 15px;
  border: 1px solid #dde4ed;
  border-radius: 10px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.btn-decision--accept { border-color: #0ea5a4; background: #0ea5a4; color: #ffffff; }
.btn-decision--evidence { border-color: #fdba74; color: #c2410c; }
.btn-decision--refuse { margin-left: auto; border-color: #fca5a5; color: #b91c1c; }

.decision-taken { color: #0f766e; font-size: 0.83rem; font-weight: 600; }

.decision-refuse,
.risk-contact,
.score-fix {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  padding: 14px 20px;
  border-top: 1px solid #eef2f8;
}

.decision-refuse label,
.risk-contact label,
.score-fix label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 600;
}

.decision-refuse input,
.decision-refuse select,
.risk-contact input,
.risk-contact select,
.score-fix input,
.score-fix select {
  min-width: 200px;
  padding: 7px 10px;
  border: 1px solid #dde4ed;
  border-radius: 9px;
  font-size: 0.83rem;
  font-weight: 400;
}

.score-fix-reason { flex: 1; }
.score-fix-reason input { width: 100%; }

/* Risco humano ----------------------------------------------------------------- */

.risk-banner {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid #fca5a5;
  border-radius: 14px;
  background: #fef2f2;
}

.risk-banner--atencao { border-color: #fcd34d; background: #fffbeb; }

.risk-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 1.1rem;
}

.risk-banner--atencao .risk-icon { background: #fef3c7; color: #92400e; }

.risk-headline {
  margin: 0 0 5px;
  color: #7f1d1d;
  font-family: var(--heading-font);
  font-size: 0.94rem;
  font-weight: 700;
}

.risk-banner--atencao .risk-headline { color: #78350f; }

.risk-text { margin: 0; color: #991b1b; font-size: 0.81rem; line-height: 1.55; }
.risk-banner--atencao .risk-text { color: #92400e; }

.risk-actions { display: flex; gap: 8px; }

.btn-risk {
  padding: 7px 13px;
  border: 1px solid #fca5a5;
  border-radius: 9px;
  background: #ffffff;
  color: #b91c1c;
  cursor: pointer;
  font-size: 0.79rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.btn-risk--call { background: #dc2626; border-color: #dc2626; color: #ffffff; }

.risk-contact { grid-column: 1 / -1; border-top-color: #fca5a5; }

/* Grade ------------------------------------------------------------------------ */

.lead-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.lead-main,
.lead-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.lead-empty {
  margin: 0;
  padding: 22px 18px;
  color: #5f6e83;
  font-size: 0.85rem;
  line-height: 1.6;
}

/* Fatos ------------------------------------------------------------------------ */

.fact-summary {
  padding: 14px 18px;
  border-bottom: 1px solid #eef2f8;
  background: #fbfdff;
}

.fact-summary p {
  margin: 8px 0 0;
  color: #3c4a5f;
  font-size: 0.83rem;
  line-height: 1.6;
}

.ai-badge {
  padding: 2px 9px;
  border-radius: 7px;
  background: #ede9fe;
  color: #5b21b6;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.fact-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 13px;
  padding: 15px 18px;
  border-bottom: 1px solid #f2f6fb;
}

.fact-row--urgencia { background: rgba(220, 38, 38, .03); }

.fact-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 0.88rem;
}

.fact-icon--sustenta { background: #e6f5f5; color: #0b6665; }
.fact-icon--urgencia { background: #fee2e2; color: #b91c1c; }
.fact-icon--prova { background: #e0f2fe; color: #0369a1; }

.fact-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 5px;
  color: #0f1728;
  font-family: var(--heading-font);
  font-size: 0.88rem;
  font-weight: 700;
}

.fact-kind {
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--body-font);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.fact-kind--sustenta { background: #e6f5f5; color: #0b6665; }
.fact-kind--urgencia { background: #fee2e2; color: #b91c1c; }
.fact-kind--prova { background: #e0f2fe; color: #0369a1; }

.fact-explanation {
  margin: 0 0 9px;
  color: #3c4a5f;
  font-size: 0.79rem;
  line-height: 1.6;
}

.fact-quote {
  margin: 0;
  padding: 9px 12px;
  border-left: 3px solid #0b6665;
  border-radius: 0 8px 8px 0;
  background: #f8fafc;
}

.fact-quote--urgencia { border-left-color: #b91c1c; }
.fact-quote--prova { border-left-color: #0369a1; }

.fact-quote-text {
  display: block;
  color: #1f2b3a;
  font-size: 0.78rem;
  font-style: italic;
  line-height: 1.55;
}

.fact-source {
  display: block;
  margin-top: 4px;
  color: #5f6e83;
  font-size: 0.68rem;
}

.fact-extra summary {
  padding: 12px 18px;
  color: #5f6e83;
  cursor: pointer;
  font-size: 0.79rem;
  font-weight: 600;
}

/* Auditoria da nota ------------------------------------------------------------ */

.score-audit--conflict { border-color: #fdba74; }
.score-audit--conflict .card-header { background: #fff7ed; }

.score-big {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 7px 13px;
  border-radius: 11px;
  color: #ffffff;
  font-family: var(--heading-font);
  font-size: 1.3rem;
  font-weight: 700;
}

.score-big small { font-family: var(--body-font); font-size: 0.66rem; font-weight: 500; }
.score-big--a, .score-big--b { background: #0b8f8e; }
.score-big--c { background: #b45309; }
.score-big--d { background: #64748b; }

.score-adjusted {
  margin: 0 0 10px;
  color: #92400e;
  font-size: 0.78rem;
  font-weight: 600;
}

.score-audit-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.4fr) 78px;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #f2f6fb;
}

.score-name { display: flex; flex-direction: column; color: #1f2b3a; font-size: 0.83rem; }
.score-reading { color: #5f6e83; font-size: 0.71rem; line-height: 1.4; }

.score-track { height: 7px; border-radius: 999px; background: #eef2f8; }

.score-fill {
  display: block;
  width: var(--done, 0%);
  height: 100%;
  border-radius: 999px;
  background: #0ea5a4;
}

.score-fill--partial { background: #f59e0b; }
.score-fill--empty { background: #cbd5e1; }
.score-fill--conflict { background: #dc2626; }

.score-value {
  color: #1f2b3a;
  font-size: 0.87rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-align: right;
}

.score-value small { color: #5f6e83; font-size: 0.72rem; font-weight: 500; }

.score-conflict {
  grid-column: 1 / -1;
  color: #b91c1c;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.5;
}

.score-alert {
  margin-top: 14px;
  padding: 13px 15px;
  border-radius: 11px;
  background: #fef2f2;
}

.score-alert p { margin: 0 0 6px; color: #7f1d1d; font-size: 0.82rem; line-height: 1.55; }
.score-alert-note { color: #991b1b !important; font-size: 0.75rem !important; }
.score-fix { padding: 12px 0 0; border-top-color: #fca5a5; }

/* Prova ------------------------------------------------------------------------ */

.evidence-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 18px;
  border-bottom: 1px solid #f2f6fb;
}

.evidence-row--tem_mas_corrigir,
.evidence-row--confirmado_sem_arquivo { background: #fffbeb; }
.evidence-row--falta { background: #fff7ed; }
.evidence-row--falta_critico { background: rgba(220, 38, 38, .04); }

.evidence-icon { font-size: 0.95rem; }
.evidence-row--tem .evidence-icon,
.evidence-row--tem_mas_corrigir .evidence-icon { color: #15803d; }
.evidence-row--confirmado_sem_arquivo .evidence-icon { color: #d97706; }
.evidence-row--falta .evidence-icon { color: #c2410c; }
.evidence-row--falta_critico .evidence-icon { color: #b91c1c; }

.evidence-body { display: flex; flex-direction: column; min-width: 0; }
.evidence-name { color: #1f2b3a; font-size: 0.83rem; font-weight: 600; }
.evidence-note { color: #5f6e83; font-size: 0.74rem; }

.evidence-action { display: flex; gap: 8px; align-items: center; }

.evidence-file {
  overflow: hidden;
  max-width: 200px;
  color: #0f766e;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-state { color: #5f6e83; font-size: 0.74rem; }

.btn-evidence {
  padding: 5px 11px;
  border: 1px solid #dde4ed;
  border-radius: 9px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

/* Conferir --------------------------------------------------------------------- */

.review-card { border-color: #fcd34d; }
.review-card .card-header { background: #fffbeb; }

.review-count {
  padding: 2px 10px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.review-flag { padding: 9px 0; border-bottom: 1px solid #f2f6fb; }
.review-flag:last-of-type { border-bottom: 0; }

.review-title { margin: 0 0 3px; color: #1f2b3a; font-size: 0.81rem; font-weight: 700; }
.review-title a { color: inherit; }
.review-why { margin: 0 0 3px; color: #3c4a5f; font-size: 0.76rem; line-height: 1.5; }
.review-where { margin: 0; color: #5f6e83; font-size: 0.73rem; }

.review-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  color: #5f6e83;
  font-size: 0.75rem;
  line-height: 1.55;
}

/* Blocos de resposta ------------------------------------------------------------ */

.answer-block { border-bottom: 1px solid #f2f6fb; }

/* O bloco sempre foi um `<details>`; o que faltava era dizê-lo. `display:flex`
   apaga o marcador nativo no Chrome, então a seta é nossa — e as duas linhas de
   `list-style` cobrem Firefox e Safari, que o mantêm. */
.answer-block summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  padding: 12px 18px;
  cursor: pointer;
  list-style: none;
  transition: background-color .12s ease;
}

.answer-block summary::-webkit-details-marker { display: none; }
.answer-block summary:hover { background: #f6f9fd; }

.answer-block summary:focus-visible {
  outline: 2px solid #0ea5a4;
  outline-offset: -2px;
  border-radius: 8px;
}

.answer-caret {
  flex-shrink: 0;
  align-self: center;
  color: #5f6e83;
  font-size: 0.72rem;
  transition: transform .15s ease;
}

.answer-block[open] > summary .answer-caret { transform: rotate(90deg); }
.answer-block[open] > summary { background: #f6f9fd; }

/* Promete o que há dentro: a linha deixa de parecer uma linha de tabela pronta. */
.answer-count {
  flex-shrink: 0;
  align-self: center;
  padding: 2px 8px;
  border: 1px solid #e3eaf5;
  border-radius: 999px;
  background: #fff;
  color: #5f6e83;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

.answer-block[open] > summary .answer-count { border-color: #99f6e4; color: #0f766e; }

.answer-card .card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.answer-toggle-all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 4px 10px;
  border: 1px solid #e3eaf5;
  border-radius: 999px;
  background: #fff;
  color: #5f6e83;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.answer-toggle-all:hover { border-color: #99f6e4; color: #0f766e; }

.answer-block-name {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #1f2b3a;
  font-size: 0.83rem;
  font-weight: 600;
}

.answer-block-summary {
  overflow: hidden;
  margin-left: auto;
  max-width: 48%;
  color: #5f6e83;
  font-size: 0.75rem;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.answer-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 7px 14px;
  padding: 4px 18px 16px;
}

.answer-label { color: #5f6e83; font-size: 0.78rem; }

.answer-value {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: #0f1728;
  font-size: 0.81rem;
  font-weight: 500;
}

.answer-value.is-relevant { font-weight: 700; }

.answer-badge {
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.answer-badge--tese { background: #dcfce7; color: #15803d; }
.answer-badge--conferir { background: #fef3c7; color: #92400e; }

.answer-blocked {
  margin: 0;
  padding: 4px 18px 16px;
  color: #5f6e83;
  font-size: 0.78rem;
  line-height: 1.55;
}

/* Tese ------------------------------------------------------------------------- */

.thesis-card { border-color: #99f6e4; }
.thesis-card .card-header { background: #f0fdfa; }

.thesis-statement {
  margin: 0 0 12px;
  color: #0f1728;
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1.6;
}

.thesis-pillars { margin: 0 0 12px; padding-left: 18px; }

.thesis-pillars li { margin-bottom: 7px; color: #1f2b3a; font-size: 0.79rem; }
.thesis-pillars span { display: block; color: #5f6e83; font-size: 0.73rem; }

.thesis-metrics {
  display: flex;
  gap: 18px;
  padding: 10px 0;
  border-top: 1px solid #f2f6fb;
  border-bottom: 1px solid #f2f6fb;
}

.thesis-metrics span { display: flex; flex-direction: column; color: #5f6e83; font-size: 0.72rem; }
.thesis-metrics b {
  color: #0f766e;
  font-family: var(--heading-font);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.thesis-note { margin: 10px 0; color: #5f6e83; font-size: 0.73rem; line-height: 1.55; }

/* Conversa e cronologias --------------------------------------------------------- */

.chat-metrics { display: flex; gap: 16px; margin-bottom: 12px; }
.chat-metrics span { display: flex; flex-direction: column; color: #5f6e83; font-size: 0.72rem; }
.chat-metrics b {
  color: #1f2b3a;
  font-family: var(--heading-font);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.chat-quote {
  padding: 11px 13px;
  border-left: 3px solid #0ea5a4;
  border-radius: 0 9px 9px 0;
  background: #f8fafc;
}

.chat-quote-label {
  color: #5f6e83;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.chat-quote p { margin: 5px 0 0; color: #1f2b3a; font-size: 0.79rem; font-style: italic; }
.chat-quote-when { color: #5f6e83; font-size: 0.7rem; }

.damage-list { margin: 0; padding: 8px 18px 14px 32px; }
.damage-list li { margin-bottom: 7px; }
.damage-when { display: block; color: #5f6e83; font-size: 0.71rem; }
.damage-what { color: #1f2b3a; font-size: 0.78rem; line-height: 1.5; }

.lead-timeline { margin: 0; padding: 10px 18px 16px; list-style: none; }

.timeline-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 12px;
}

.timeline-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: #94a3b8;
}

.timeline-item--stage .timeline-dot { background: #0ea5a4; }
.timeline-item--automation .timeline-dot { background: #6d28d9; }
.timeline-item--contact .timeline-dot { background: #16a34a; }
.timeline-item--problem .timeline-dot { background: #dc2626; }

.timeline-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.timeline-text { color: #1f2b3a; font-size: 0.79rem; }
.timeline-when { color: #5f6e83; font-size: 0.71rem; }

.timeline-problem {
  margin-top: 5px;
  padding: 8px 10px;
  border-radius: 9px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.74rem;
  line-height: 1.5;
}

@media (max-width: 1400px) {
  .lead-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1000px) {
  .lead-hero-body { grid-template-columns: 56px minmax(0, 1fr); }
  .lead-actions { grid-column: 1 / -1; }
  .answer-grid { grid-template-columns: minmax(0, 1fr); }
  .answer-block-summary { max-width: 100%; margin-left: 0; text-align: left; }
  .risk-banner { grid-template-columns: 40px minmax(0, 1fr); }
}


/* ==========================================================================
   D-053 — Editor de documento: lacuna nomeada, prontidão e painéis com estado
   Nomes com prefixo próprio: `.doc-title` e `.fact-row` já existem neste arquivo
   (lista de documentos e fatos do lead), daí `.doc-heading` e `.dossier-fact`.
   ========================================================================== */

.doc-heading {
  font-family: "Sora", system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}

.doc-headmeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin-top: 4px;
  font-size: 12px;
}

.doc-linkish {
  border: 0;
  background: none;
  padding: 0;
  color: #0f766e;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.doc-export--docx:hover { border-color: #1d4ed8; color: #1d4ed8; }
.doc-export--pdf:hover { border-color: #b91c1c; color: #b91c1c; }

/* --- barra de prontidão -------------------------------------------------- */

.doc-readiness {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(240px, 1fr) minmax(0, 2fr) auto;
  align-items: center;
  gap: 18px;
  padding: 12px 16px;
  margin-bottom: 14px;
  background: #f6f9fd;
  border: 1px solid #e3eaf5;
  border-radius: 14px;
}

@media (max-width: 991.98px) {
  .doc-readiness { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}

.doc-readiness__caption {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #64748b;
}

.doc-readiness__now {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.doc-readiness__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}

.doc-readiness__now--rascunho .doc-readiness__dot { background: #c2410c; }
.doc-readiness__now--em_revisao .doc-readiness__dot { background: #1d4ed8; }
.doc-readiness__now--revisado .doc-readiness__dot { background: #0ea5a4; }
.doc-readiness__now--aprovado .doc-readiness__dot { background: #15803d; }

/* Cada barra é a própria célula da grade, então o rótulo nunca desalinha dela. */
.doc-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.doc-flow__step { min-width: 0; }

.doc-flow__bar {
  display: block;
  height: 5px;
  border-radius: 3px;
  background: #e3eaf5;
}

.doc-flow__label {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-flow__step--done .doc-flow__bar { background: #99f6e4; }
.doc-flow__step--current .doc-flow__bar { background: #c2410c; }
.doc-flow__step--current .doc-flow__label { font-weight: 800; color: #9a3412; }

.doc-readiness__sentence {
  margin: 0 0 4px;
  font-size: 12.5px;
  color: #475569;
}

.doc-readiness__sentence.is-blocked { color: #b91c1c; font-weight: 700; }

.doc-readiness__why {
  margin: 0 0 8px;
  padding-left: 18px;
  font-size: 11.5px;
  color: #64748b;
}

/* D-073: aviso que não bloqueia (figura feita com dados que a análise já recalculou).
   Âmbar e sem marcador de lista: não é pendência, e não pode parecer uma. */
.doc-readiness__notice {
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  font-size: 11.5px;
  color: #b45309;
}

.doc-risk {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fef2f2;
  color: #b91c1c;
  cursor: pointer;
}

.doc-risk__label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.doc-risk__score { font-size: 20px; font-weight: 800; line-height: 1; }
.doc-risk__max { font-size: 11px; }

/* --- a lacuna no corpo do documento -------------------------------------- */

.studio-page .ql-editor .doc-gap,
.doc-gap {
  display: inline;
  padding: 0 3px;
  border-radius: 3px;
  /* Manrope no meio do Georgia: a lacuna não pode parecer texto do contrato. */
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  line-height: inherit;
  cursor: pointer;
  background: #f1f5f9;
  border-bottom: 2px solid #94a3b8;
  color: #475569;
}

.doc-gap--not_collected { background: #fef2f2; border-bottom: 2px solid #dc2626; color: #b91c1c; }
.doc-gap--office_config { background: #fff7ed; border-bottom: 2px solid #c2410c; color: #9a3412; }
.doc-gap--unbound { background: #eff6ff; border-bottom: 2px solid #1d4ed8; color: #1e40af; }
.doc-gap--unparsed { background: #eff6ff; border-bottom: 1px dashed #1d4ed8; color: #1e40af; }
.doc-gap--unknown { background: #fffbeb; border-bottom: 2px dotted #b45309; color: #78350f; }

/* --- popover da lacuna e do trecho da IA --------------------------------- */

.doc-pop {
  position: absolute;
  z-index: 30;
  width: 310px;
  max-width: calc(100% - 16px);
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e3eaf5;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .16);
  font-family: "Manrope", system-ui, sans-serif;
}

.doc-pop__head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.doc-pop__title { font-size: 13px; font-weight: 700; color: #1e293b; flex: 1; }
.doc-pop__why { margin: 0 0 10px; font-size: 11.5px; line-height: 1.45; color: #475569; }

/* --- trechos da IA no painel --------------------------------------------- */

.ai-block {
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fefce8;
  border-left: 3px solid #eab308;
  border-radius: 0 5px 5px 0;
}

.ai-block--done { background: #f6f9fd; border-left-color: #99f6e4; }

.ai-block__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.ai-block__tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #a16207;
}

.ai-block--done .ai-block__tag { color: #0f766e; }
.ai-block__actions { display: flex; gap: 5px; margin-left: auto; }
.ai-block__by { margin-left: auto; font-size: 11px; color: #64748b; }

.ai-block__text {
  margin: 0 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12.5px;
  line-height: 1.5;
  color: #334155;
  cursor: pointer;
}

.ai-block__cited { font-size: 11px; line-height: 1.5; color: #475569; }
.ai-block__cited--none { color: #92400e; }

.ai-block__fact {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: #0f766e;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* --- quebra por origem na aba Revisão ------------------------------------ */

.review-origin-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin-top: 6px;
  border-radius: 8px;
  background: #f6f9fd;
  font-size: 11.5px;
  color: #334155;
}

.review-origin-row__count {
  min-width: 22px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.review-origin-row__text { flex: 1; min-width: 0; }
.review-origin-row .btn { flex-shrink: 0; }
.review-origin-row--office_config { background: #fff7ed; color: #9a3412; }
.review-origin-row--not_collected { background: #fef2f2; color: #b91c1c; }
.review-origin-row--unbound { background: #eff6ff; color: #1e40af; }

/* --- 9 abas em grade 5×2 (a 10ª célula espera a aba de Análise) ---------- */

.studio-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  /* o .card-header do FlexAdmin é flex: sem isto a lista encolhe para o
     conteúdo e as células ficam com 58px num painel de 400 (gotcha 20) */
  width: 100%;
}

.studio-tabs .nav-item { min-width: 0; }

/* Icone em cima do rotulo: em colunas de ~67px, icone + texto + badge na mesma
   linha nao cabe, e "Assistente" virava "Assisten...". Empilhado, a celula inteira
   fica para a palavra. Com cinco colunas a mais longa, "Comentários", mede 61,9px:
   o recuo lateral de 3px deixava 61px e cortava a última letra (medido no Chrome). */
.studio-tabs .nav-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 100%;
  min-width: 0;
  padding: 5px 1px;
  overflow: hidden;
  line-height: 1.2;
}

.studio-tabs .nav-link > i { font-size: 13px; }

.studio-tabs__label {
  display: block;
  width: 100%;
  min-width: 0;
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studio-tabs .nav-link .badge {
  position: absolute;
  top: 2px;
  right: 3px;
  padding: 1px 4px;
  font-size: 8.5px;
  line-height: 1.3;
}

.studio-tabs .nav-link.is-disabled {
  color: #8a97a8;
  background: transparent;
  cursor: not-allowed;
}

/* --- cláusulas exigidas com estado --------------------------------------- */

.clause-required { list-style: none; margin: 0; padding: 0; }

.clause-required__count {
  float: right;
  font-size: 10.5px;
  font-weight: 700;
  color: #b91c1c;
}

.clause-required__item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 5px 0;
  font-size: 12px;
  line-height: 1.4;
  border-bottom: 1px solid #eef2f8;
}

.clause-required--ok { color: #334155; }
.clause-required--ok i { color: #0ea5a4; }
.clause-required--fail { color: #7f1d1d; }
.clause-required--fail i { color: #dc2626; }

.clause-required__reason {
  display: block;
  font-size: 10.5px;
  font-style: normal;
  color: #b91c1c;
}

/* --- variáveis: cinco causas, cinco cores -------------------------------- */

.var-row--unbound { border-left-color: #1d4ed8; }
.var-row--config { border-left-color: #ea580c; }
.var-row--empty { border-left-color: #dc2626; }
.var-row--partial { border-left-color: #f59e0b; }

.var-flag--unbound {
  background: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}

.var-cause { font-style: italic; font-size: 11.5px; }
.var-cause--unbound { color: #1e40af; }
.var-cause--config { color: #c2410c; }
.var-cause--empty { color: #b91c1c; }
.var-cause--partial { color: #92400e; }

/* --- fatos em três pesos -------------------------------------------------- */

.studio-facts { display: grid; gap: 5px; }

.dossier-fact {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 4px 10px;
  width: 100%;
  padding: 7px 9px;
  text-align: left;
  background: #fff;
  border: 1px solid #e3eaf5;
  border-radius: 9px;
  cursor: pointer;
}

.dossier-fact--strong { background: #f0fdfa; border-color: #99f6e4; }
.dossier-fact--unbound { background: #eff6ff; border-color: #bfdbfe; }

.dossier-fact--empty {
  background: #fafcff;
  color: #8a97a8;
  cursor: not-allowed;
}

.dossier-fact__label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #64748b;
  line-height: 1.5;
}

.dossier-fact--empty .dossier-fact__label { color: #94a3b8; }

.dossier-fact__value {
  font-size: 12px;
  line-height: 1.5;
  color: #1e293b;
  overflow-wrap: anywhere;
}

.dossier-fact--empty .dossier-fact__value { color: #8a97a8; }

.dossier-fact__tag {
  display: block;
  margin-top: 2px;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
  color: #0f766e;
}

.dossier-fact__tag--unbound { color: #1e40af; }

/* --- versões com o que mudou --------------------------------------------- */

.version-list { list-style: none; margin: 0; padding: 0; }

.version-item {
  padding: 8px 0;
  border-bottom: 1px solid #eef2f8;
}

.version-item--current { background: #f6f9fd; border-radius: 8px; padding: 8px 10px; }

.version-item__head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
}

.version-item__diff {
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.45;
  color: #475569;
}

.version-item__diff strong { color: #334155; }

/* --- ajuda do assistente, só no primeiro uso ----------------------------- */

.assistant-help {
  padding: 8px 10px;
  margin-bottom: 8px;
  background: #f6f9fd;
  border-radius: 9px;
  font-size: 11.5px;
  line-height: 1.5;
  color: #475569;
}

/* --- menus de inserção em destaque na barra ------------------------------ */

.studio-toolbar .ql-formats--insert button {
  border: 1px solid #99f6e4;
  background: #f0fdfa;
  border-radius: 7px;
}

@media (prefers-color-scheme: dark) {
  [data-theme="dark"] .doc-readiness { background: rgba(148, 163, 184, .08); border-color: rgba(148, 163, 184, .2); }
}


/* --- D-053: pedido de parecer ------------------------------------------- */

.opinion-ask {
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
}

.opinion-ask__head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #1e40af;
}

.opinion-ask__question {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.5;
  color: #1e293b;
}

.opinion-excerpt,
.opinion-public__excerpt {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-left: 3px solid #0ea5a4;
  background: #f0fdfa;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12.5px;
  line-height: 1.55;
  color: #334155;
  cursor: pointer;
}

.opinion-public__excerpt { font-size: 15px; cursor: auto; }

.opinion-verdicts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.opinion-verdict {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid #e3eaf5;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  color: #334155;
  cursor: pointer;
}

.opinion-verdict--aprovado:has(input:checked) { border-color: #86efac; background: #f0fdf4; color: #166534; }
.opinion-verdict--ajustes:has(input:checked) { border-color: #fed7aa; background: #fffbeb; color: #92400e; }
.opinion-verdict--reprovado:has(input:checked) { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }

.opinion-row {
  padding: 9px 11px;
  margin-bottom: 7px;
  border: 1px solid #e3eaf5;
  border-left-width: 3px;
  border-radius: 0 9px 9px 0;
  background: #fff;
}

.opinion-row--pending { border-left-color: #f59e0b; }
.opinion-row--ok { border-left-color: #15803d; }
.opinion-row--warn { border-left-color: #ea580c; }
.opinion-row--bad { border-left-color: #dc2626; }

.opinion-row__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.opinion-row__who { font-size: 12.5px; font-weight: 700; color: #1e293b; }
.opinion-row__question { margin: 0 0 4px; font-size: 12px; line-height: 1.45; color: #475569; }

.opinion-row__comment {
  margin: 5px 0 4px;
  padding: 7px 10px;
  background: #f6f9fd;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #334155;
}

.opinion-new { margin-top: 10px; }

.opinion-form {
  margin-top: 8px;
  padding: 11px 12px;
  background: #f6f9fd;
  border-radius: 11px;
}

.opinion-form__note {
  margin: 0 0 8px;
  font-size: 11px;
  line-height: 1.45;
  color: #5f6e83;
}

.opinion-form__excerpt {
  padding: 7px 9px;
  border-left: 3px solid #99f6e4;
  background: #f0fdfa;
  font-size: 11.5px;
  line-height: 1.5;
  color: #334155;
}

.opinion-public__label {
  margin: 14px 0 5px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #5f6e83;
}

.opinion-public__label:first-child { margin-top: 0; }
.opinion-public__question { margin: 0 0 4px; font-size: 15px; line-height: 1.5; color: #1e293b; }
.opinion-public__note { margin: 6px 0 12px; font-size: 12px; color: #5f6e83; }

.opinion-public__done {
  padding: 12px 14px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 11px;
  font-size: 13.5px;
  color: #166534;
}


/* --- D-071: comentários da equipe sobre trechos da peça ------------------ */

/* O realce não é um nó do documento: é pintado pelo navegador sobre faixas de
   texto (CSS Custom Highlight API). Por isso comentar nunca grava a peça. */
::highlight(doc-comment) { background-color: #ede9fe; }
::highlight(doc-comment-active) { background-color: #c4b5fd; }

.doc-comment-new { margin-bottom: 12px; }

.doc-comment-note,
.doc-comment-empty {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #5f6e83;
}

.doc-comment-form {
  margin-top: 8px;
  padding: 11px 12px;
  background: #f6f9fd;
  border-radius: 11px;
}

.doc-comment-form__quote,
.doc-comment-quote {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  padding: 6px 10px;
  border: 0;
  border-left: 3px solid #8b5cf6;
  background: #f5f3ff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12.5px;
  line-height: 1.5;
  text-align: left;
  color: #334155;
  overflow-wrap: anywhere;
}

button.doc-comment-quote { cursor: pointer; }
button.doc-comment-quote:hover { background: #ede9fe; }

.doc-comment-form__hint {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: #5f6e83;
}

.doc-comment-thread {
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid #e3eaf5;
  border-left: 3px solid #8b5cf6;
  border-radius: 0 9px 9px 0;
}

.doc-comment-thread--active { box-shadow: 0 0 0 2px #c4b5fd; }
.doc-comment-thread--resolved { border-left-color: #cbd5e1; background: #f8fafc; }

/* O aviso de órfão já está no cartão; quem o mostra é o JS, quando a citação não
   é mais encontrada no texto do editor. */
.doc-comment-orphan {
  display: none;
  margin: -2px 0 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: #9a3412;
}

.doc-comment-thread--orphan .doc-comment-orphan { display: block; }

.doc-comment { margin-bottom: 7px; }

.doc-comment--reply {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 2px solid #e3eaf5;
}

.doc-comment__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.doc-comment__who { font-size: 12.5px; font-weight: 700; color: #1e293b; }

.doc-comment__body {
  margin: 2px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: #334155;
  overflow-wrap: anywhere;
}

.doc-comment-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}

.doc-comment-resolved { margin-top: 12px; }

.doc-comment-resolved > summary {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
}


/* ==========================================================================
   D-054 — Tela do cliente: quem é, quanto vale, qual é o problema, o que houve
   ========================================================================== */

.person-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: #fff;
  border: 1px solid #e3eaf5;
  border-radius: 14px;
}

.person-hero__id { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }

.person-hero__avatar {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 19px;
  font-weight: 700;
}

.person-hero__name {
  margin: 0;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
}

.person-hero__badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }

.person-state {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  background: #f1f5f9;
  color: #475569;
}

.person-state--active { background: #f0fdfa; color: #0f766e; }
.person-state--debt { background: #fee2e2; color: #b91c1c; }
.person-state--merged { background: #ede9fe; color: #5b21b6; }
.person-state--off { background: #f1f5f9; color: #475569; }

.person-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 12px;
  color: #5f6e83;
}

.person-hero__meta i { margin-right: 5px; font-size: 11px; }

.person-doc {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
  color: #334155;
  background: none;
  padding: 0;
}

.person-hero__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.person-act--wa:hover { border-color: #16a34a; color: #15803d; }
.person-act--call:hover { border-color: #0ea5a4; color: #0f766e; }

/* --- faixas de alerta ---------------------------------------------------- */

.alert-band {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: 14px;
}

.alert-band--debt { background: #fef2f2; border: 1.5px solid #fca5a5; }
.alert-band--duplicate { background: #fff7ed; border: 1.5px solid #fdba74; }

.alert-band__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 17px;
}

.alert-band--debt .alert-band__icon { background: #fee2e2; color: #b91c1c; }
.alert-band--duplicate .alert-band__icon { background: #ffedd5; color: #9a3412; }

.alert-band__text { min-width: 0; flex: 1; }

.alert-band__title {
  margin: 0 0 3px;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
}

.alert-band--debt .alert-band__title { color: #7f1d1d; }
.alert-band--duplicate .alert-band__title { color: #7c2d12; }

.alert-band__body { margin: 0 0 8px; font-size: 12.5px; line-height: 1.5; }
.alert-band--debt .alert-band__body { color: #991b1b; }
.alert-band--duplicate .alert-band__body { color: #9a3412; }

.alert-band__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.alert-band__note { max-width: 340px; }

/* --- KPIs ---------------------------------------------------------------- */

.person-kpis { margin-bottom: 14px; }

/* --- ficha --------------------------------------------------------------- */

.field-count {
  padding: 2px 9px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 700;
}

.field-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 6px 12px;
  padding: 8px 16px;
  border-bottom: 1px solid #f2f6fb;
}

.field-row--missing { background: #fef7f7; }
.field-row--partial { background: #fffbeb; }

.field-row__label { font-size: 11.5px; color: #5f6e83; }
.field-row__value { font-size: 12.5px; color: #1f2b3a; overflow-wrap: anywhere; }
.field-row__value.is-mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; }
.field-row__empty { color: #b91c1c; font-style: italic; }

.field-row__why {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  font-style: normal;
  color: #b91c1c;
}

.field-row--partial .field-row__why { color: #92400e; }

.field-row__fix {
  align-self: center;
  padding: 2px 9px;
  border: 1px solid #fca5a5;
  border-radius: 999px;
  color: #b91c1c;
  font-size: 10.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.field-row--partial .field-row__fix { border-color: #fdba74; color: #9a3412; }
.field-foot { font-size: 11.5px; color: #78350f; background: #fffbeb; }

/* --- consentimento ------------------------------------------------------- */

.consent-card--warn { border-color: #fdba74; }
.consent-card--warn .card-header { background: #fff7ed; }
.consent-line { margin: 0 0 8px; font-size: 12.5px; color: #334155; }

.consent-version {
  padding: 1px 7px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
}

.consent-version.is-bad { background: #fee2e2; color: #b91c1c; }

.consent-problem {
  padding: 9px 11px;
  margin-bottom: 9px;
  border-radius: 9px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  font-size: 11.5px;
  line-height: 1.55;
  color: #7f1d1d;
}

.consent-rights { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }

/* --- régua de parcelas --------------------------------------------------- */

.installment-ruler { display: flex; gap: 3px; margin-bottom: 12px; }
.installment-seg { flex: 1; min-width: 0; text-align: center; }

.installment-seg__bar {
  display: block;
  height: 8px;
  border-radius: 3px;
  background: #e3eaf5;
}

.installment-seg--paid .installment-seg__bar { background: #15803d; }
.installment-seg--late .installment-seg__bar { background: #dc2626; }

.installment-seg__date {
  display: block;
  margin-top: 4px;
  font-size: 9.5px;
  color: #5f6e83;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.installment-totals { display: flex; gap: 24px; }
.installment-totals > div { display: flex; flex-direction: column; }
.installment-totals span:last-child { font-size: 11px; color: #5f6e83; }

.installment-total {
  font-family: "Sora", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #334155;
}

.installment-total--paid { color: #15803d; }
.installment-total--late { color: #b91c1c; }

/* --- processos ----------------------------------------------------------- */

.client-case {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #f2f6fb;
  font-size: 12.5px;
}

.client-case__icon { color: #5f6e83; }
.client-case__id code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11.5px; }

.client-case__tag {
  padding: 1px 7px;
  margin-left: 5px;
  border-radius: 999px;
  background: #ffedd5;
  color: #9a3412;
  font-size: 10px;
  font-weight: 700;
}

.client-case__group { display: block; font-size: 11px; color: #5f6e83; }
.client-case__phase, .client-case__value { font-size: 11.5px; color: #5f6e83; white-space: nowrap; }

.client-case__portal, .client-case__ged {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  white-space: nowrap;
  text-decoration: none;
}

/* --- leads duplicados ---------------------------------------------------- */

.card--warn { border-color: #fdba74; }
.card--warn > .card-header { background: #fff7ed; }

.lead-dup-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto auto auto;
  align-items: start;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #f2f6fb;
  font-size: 12.5px;
  cursor: pointer;
}

.lead-dup-row--primary { background: #f8fdfd; }
.lead-dup-row--conflict { background: rgba(220, 38, 38, .03); }
.lead-dup-row input { margin-top: 3px; accent-color: #0ea5a4; }

.lead-dup-row__why {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #5f6e83;
}

.lead-dup-row--conflict .lead-dup-row__why { color: #b91c1c; }

.lead-dup-tag {
  padding: 1px 7px;
  margin-left: 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.lead-dup-tag--ok { background: #dcfce7; color: #15803d; }
.lead-dup-row__stage, .lead-dup-row__when { font-size: 11.5px; color: #5f6e83; white-space: nowrap; }
.lead-dup-row__nograde { color: #c2410c; font-size: 11px; }

.lead-dup-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: #5f6e83;
}

.lead-dup-foot span { flex: 1; min-width: 220px; }

/* --- documentos ---------------------------------------------------------- */

.doc-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #f2f6fb;
  font-size: 12.5px;
}

.doc-row--warn { background: #fffbeb; }
.doc-row--draft { background: #fef7f7; }
.doc-row__icon { color: #5f6e83; }
.doc-row__meta { display: block; font-size: 11px; color: #5f6e83; }
.doc-row__note { display: block; font-size: 11px; color: #92400e; }
.doc-row--draft .doc-row__note { color: #b91c1c; }

.doc-row__tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: #f0fdfa;
  color: #0f766e;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.doc-row__tag--warn { background: #fef3c7; color: #92400e; }
.doc-row__tag--draft { background: #fee2e2; color: #b91c1c; }

@media (max-width: 767.98px) {
  .field-row, .client-case, .lead-dup-row, .doc-row { grid-template-columns: minmax(0, 1fr); }
  .installment-seg__date { display: none; }
}


/* ==========================================================================
   D-055 — Detalhe do processo: próximo prazo, saúde, valor e histórico
   ========================================================================== */

.case-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 12px;
  background: #fff;
  border: 1px solid #e3eaf5;
  border-radius: 14px;
}

.case-hero__id { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }

.case-hero__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 24px;
}

.case-hero--judicial .case-hero__badge { background: #eef6ff; color: #1d4ed8; }
.case-hero--predistribution .case-hero__badge { background: #f4f7fb; color: #5f6e83; }

.case-hero__text { min-width: 0; }

.case-hero__name {
  margin: 0;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.25;
}

/* Vinte dígitos em fonte de texto são impossíveis de conferir: mono, e os
   separadores em cinza para agrupar visualmente. */
.cnj-number {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1f2b3a;
}

.case-tag {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.case-tag--warn { background: #ffedd5; color: #9a3412; }

.case-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }

.case-chip {
  padding: 2px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
}

.case-chip--ativo { background: #f0fdfa; color: #0f766e; }
.case-chip--suspenso { background: #fffbeb; color: #92400e; }
.case-chip--encerrado { background: #f1f5f9; color: #475569; }
.case-chip--warn { background: #fef2f2; color: #b91c1c; }

.case-hero__actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* --- régua de fases ------------------------------------------------------ */

.phase-ruler-card {
  padding: 14px 18px;
  margin-bottom: 12px;
  background: #fff;
  border: 1px solid #e3eaf5;
  border-radius: 14px;
}

.phase-ruler { display: flex; align-items: flex-end; gap: 4px; }

.phase-block {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  text-align: center;
}

.phase-block__time {
  font-size: 10px;
  color: #5f6e83;
  min-height: 13px;
  white-space: nowrap;
  overflow: hidden;
}

.phase-block__bar { display: block; border-radius: 3px; background: #e3eaf5; }
.phase-block--past .phase-block__bar { background: #9ad4d3; }
.phase-block--current .phase-block__bar { background: #0b8f8e; }

.phase-block__name {
  margin-top: 5px;
  font-size: 10.5px;
  color: #5f6e83;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phase-block--current .phase-block__name { font-weight: 800; color: #0f766e; }
.phase-ruler__note { margin: 10px 0 0; font-size: 11.5px; color: #5f6e83; }

/* --- faixa de prazo em risco --------------------------------------------- */

.deadline-band {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
}

.deadline-band--atencao { background: #fffbeb; border-color: #fdba74; }

.deadline-band__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 17px;
}

.deadline-band--atencao .deadline-band__icon { background: #ffedd5; color: #9a3412; }
.deadline-band__text { min-width: 0; flex: 1; }

.deadline-band__title {
  margin: 0 0 5px;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
  color: #7f1d1d;
}

.deadline-band--atencao .deadline-band__title { color: #7c2d12; }

.deadline-band__why {
  margin: 0 0 9px;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.55;
  color: #991b1b;
}

.deadline-band--atencao .deadline-band__why { color: #9a3412; }
.deadline-band__actions { display: flex; flex-wrap: wrap; gap: 7px; }

.case-conflict-count {
  padding: 2px 9px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 700;
}

/* --- ficha: três categorias de ausência ---------------------------------- */

.field-row--conflict { background: #fef7f7; }
.field-row--notyet { background: #fafcff; }
.field-row__notyet { color: #5f6e83; font-style: italic; }
.field-row--conflict .field-row__why { color: #b91c1c; }
.field-row--notyet .field-row__why { color: #5f6e83; }
.field-row--conflict .field-row__fix { border-color: #fca5a5; color: #b91c1c; }

/* --- partes e representação ---------------------------------------------- */

.party-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 10px 16px;
  border-bottom: 1px solid #f2f6fb;
}

.party-row__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #f1f5f9;
  color: #475569;
  font-size: 14px;
}

.party-row--client .party-row__icon { background: #f0fdfa; color: #0f766e; }
.party-row--opposing .party-row__icon { background: #fff7ed; color: #9a3412; }
.party-row--opposing-warn .party-row__icon { background: #fef2f2; color: #b91c1c; }
.party-row--lawyer .party-row__icon { background: #ede9fe; color: #5b21b6; }

.party-row__text { min-width: 0; }

.party-row__role {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #5f6e83;
}

.party-row__name { display: block; font-size: 12.5px; font-weight: 600; color: #1f2b3a; }
.party-row__note { display: block; font-size: 11px; color: #b91c1c; }
.party-row--lawyer .party-row__note { color: #5f6e83; }

/* --- financeiro do caso -------------------------------------------------- */

.case-money { display: grid; gap: 5px; }
.case-money > div { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.case-money strong { font-variant-numeric: tabular-nums; color: #1f2b3a; }
.case-money strong.is-ok { color: #15803d; }
.case-money strong.is-gap { color: #b91c1c; }

.case-money__diagnosis {
  margin-top: 11px;
  padding: 11px 13px;
  border-radius: 11px;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.case-money__diagnosis p { margin: 0 0 9px; font-size: 11.5px; line-height: 1.55; color: #7f1d1d; }
.case-money__actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* --- o que precisa ser feito --------------------------------------------- */

.todo-row {
  display: grid;
  grid-template-columns: 68px 30px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 10px 16px;
  border-bottom: 1px solid #f2f6fb;
}

.todo-row--child { padding-left: 34px; background: #fafcff; }
.todo-row--critico { background: #fef7f7; }
.todo-row--atencao { background: #fffbeb; }

.todo-countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-right: 11px;
  border-right: 1px solid #e3eaf5;
}

.todo-countdown__value {
  font-family: "Sora", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #334155;
}

.todo-row--critico .todo-countdown__value { color: #b91c1c; }
.todo-row--atencao .todo-countdown__value { color: #9a3412; }

.todo-countdown__unit {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #5f6e83;
  text-align: center;
  line-height: 1.2;
}

.todo-row__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #f1f5f9;
  color: #475569;
  font-size: 13px;
}

.todo-row__text { min-width: 0; }
.todo-row__title { display: block; font-size: 13px; font-weight: 700; color: #1f2b3a; }
.todo-row__meta { display: block; font-size: 11.5px; color: #5f6e83; }

.todo-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.todo-tag--fatal { background: #fee2e2; color: #b91c1c; }
.todo-foot { font-size: 11.5px; color: #5f6e83; }

.todo-empty { padding: 22px 18px; text-align: center; }

.todo-empty__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 9px;
  border-radius: 13px;
  background: #f0fdfa;
  color: #0f766e;
  font-size: 20px;
}

.todo-empty__title { margin: 0 0 3px; font-size: 13.5px; font-weight: 700; color: #1f2b3a; }
.todo-empty__why { margin: 0 0 12px; font-size: 12px; color: #5f6e83; }

.todo-empty__step {
  display: block;
  padding: 9px 12px;
  margin-bottom: 6px;
  border: 1px solid #e3eaf5;
  border-radius: 10px;
  color: #1f2b3a;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
}

.todo-empty__step:hover { border-color: #99f6e4; color: #0f766e; }
.todo-empty__step em { display: block; font-size: 11px; font-style: normal; color: #5f6e83; }

/* --- andamentos ---------------------------------------------------------- */

.movement-row {
  display: grid;
  grid-template-columns: 62px 10px minmax(0, 1fr);
  gap: 11px;
  padding: 12px 16px;
  border-bottom: 1px solid #f2f6fb;
}

.movement-row__date { text-align: right; line-height: 1.25; }
.movement-row__date strong { display: block; font-size: 12px; color: #1f2b3a; }
.movement-row__date span { font-size: 10px; color: #5f6e83; }

.movement-row__dot {
  position: relative;
  display: block;
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: #cbd5e1;
}

.movement-row--latest .movement-row__dot { background: #0ea5a4; }
.movement-row__text { min-width: 0; }
.movement-row__head { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.movement-row__title { font-size: 12.5px; font-weight: 700; color: #1f2b3a; }
.movement-row__who { font-size: 11px; color: #5f6e83; }

.movement-source {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.movement-source--court { background: #dbeafe; color: #1e40af; }
.movement-source--manual { background: #f1f5f9; color: #475569; }

.movement-row__body {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.55;
  color: #475569;
}

.movement-row__summary {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 9px;
  background: #f6f9fd;
  font-size: 11.5px;
  line-height: 1.55;
  color: #334155;
}

/* --- peças e documentos --------------------------------------------------- */

.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }

.doc-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e3eaf5;
  border-radius: 11px;
}

.doc-card--pending { border-color: #fca5a5; background: #fef7f7; }
.doc-card--unlinked { border-color: #fdba74; background: #fffbeb; }

.doc-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #f1f5f9;
  color: #475569;
}

.doc-card__text { min-width: 0; }
.doc-card__name { display: block; font-size: 12.5px; font-weight: 600; color: #1f2b3a; }
.doc-card__meta { display: block; font-size: 11px; color: #5f6e83; }
.doc-card--pending .doc-card__meta { color: #b91c1c; }

@media (max-width: 767.98px) {
  .todo-row, .movement-row { grid-template-columns: minmax(0, 1fr); }
  .phase-block__name { font-size: 9px; }
}

/* --- formulário de processo (D-057) -------------------------------------- */

.case-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 306px;
  /* Área própria para os alertas: com `grid-template-areas`, um filho sem área
     vai para uma linha implícita **depois** de todas as nomeadas — a faixa do
     conflito apareceu 1.500px abaixo, no fim da página. */
  grid-template-areas: "topbar topbar" "alerts alerts" "body side";
  gap: 0 18px;
  align-items: start;
}

/* Barra grudada no topo do conteúdo: quem edita a primeira seção precisa ver
   como salvar sem rolar por três cartões. `fixed` ignoraria o menu lateral. */
.form-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  grid-area: topbar;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  margin-bottom: 14px;
  padding: 10px 16px;
  border: 1px solid var(--border-color-light);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
}

.form-crumb {
  display: flex;
  gap: 7px;
  align-items: center;
  margin: 0;
  color: #5f6e83;
  font-size: 0.82rem;
}

.form-crumb a {
  color: var(--accent-color);
  text-decoration: none;
}

.form-crumb a:hover {
  text-decoration: underline;
}

.form-crumb strong {
  color: #1f2b3a;
  font-weight: 600;
}

.form-topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.case-form-alerts {
  grid-area: alerts;
  min-width: 0;
}

.case-form-alerts:empty {
  display: none;
}

.case-form-body {
  grid-area: body;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.case-form-side {
  grid-area: side;
  min-width: 0;
}

.form-section {
  padding: 16px 18px 18px;
  border: 1px solid var(--border-color-light);
  border-radius: 14px;
  background: #ffffff;
}

.form-section-head {
  display: flex;
  gap: 11px;
  align-items: center;
  margin-bottom: 14px;
}

.form-section-head > div {
  flex: 1;
  min-width: 0;
}

.form-section-head h2 {
  margin: 0;
  color: #1f2b3a;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
}

.form-section-head p {
  margin: 1px 0 0;
  color: #5f6e83;
  font-size: 0.75rem;
}

.form-section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f0fdfa;
  color: #0b6665;
  font-size: 1.05rem;
}

.form-section-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 13px 14px;
}

.form-section-note {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  margin: 13px 0 0;
  padding-top: 11px;
  border-top: 1px solid var(--border-color-light);
  color: #5f6e83;
  font-size: 0.73rem;
  line-height: 1.5;
}

.form-section-note > i {
  flex: none;
  margin-top: 2px;
}

/* Largura pelo conteúdo, não pela ordem do model: a UF tinha um doze avos da
   linha para 27 opções e o juiz, dois, para nome completo com título. */
.case-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.case-field--2 { grid-column: span 2; }
.case-field--3 { grid-column: span 3; }
.case-field--4 { grid-column: span 4; }
.case-field--5 { grid-column: span 5; }
.case-field--6 { grid-column: span 6; }
.case-field--7 { grid-column: span 7; }
.case-field--8 { grid-column: span 8; }

.case-field-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}

.case-field-label {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  margin: 0;
  color: #1f2b3a;
  font-size: 0.79rem;
  font-weight: 600;
}

/* A chave do model: é o que permite achar o campo quando alguém pergunta. */
.field-key {
  flex: none;
  color: #5f6e83;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
}

.field-flag {
  padding: 1px 7px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.field-flag--req {
  background: #fef2f2;
  color: #b91c1c;
}

.field-flag--empty {
  background: #fffbeb;
  color: #92400e;
}

.field-consequence {
  margin: 0;
  color: #5f6e83;
  font-size: 10.5px;
  line-height: 1.45;
}

.field-consequence--warn {
  color: #c2410c;
}

.field-note {
  margin: 0;
  color: #5f6e83;
  font-size: 0.72rem;
  line-height: 1.45;
}

/* Alvo de toque confortável: o padrão do Bootstrap fica abaixo dele. */
.case-field .form-control,
.case-field .form-select {
  min-height: 42px;
  border-radius: 9px;
}

.case-field textarea.form-control {
  min-height: 82px;
}

.case-field input::placeholder,
.case-field textarea::placeholder {
  color: #5f6e83;
  font-style: italic;
}

.case-field input[name="number"] {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 15px;
  letter-spacing: 0.01em;
}

.type-toggle {
  display: flex;
  flex: none;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: #eef3fa;
}

.type-toggle-btn {
  padding: 5px 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #5f6e83;
  font-size: 0.76rem;
  font-weight: 600;
}

.type-toggle-btn.is-on {
  background: #ffffff;
  color: #0b6665;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.section-flag {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 0.7rem;
  font-weight: 600;
}

.radio-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.radio-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid var(--border-color-light);
  border-radius: 11px;
  background: #ffffff;
  cursor: pointer;
}

.radio-card--on {
  border-color: #0ea5a4;
  background: #f0fdfa;
}

.radio-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-card-top {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}

.radio-card-name {
  color: #1f2b3a;
  font-size: 12.5px;
  font-weight: 700;
}

.radio-card-percent {
  color: #0b6665;
  font-size: 11.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.radio-card-desc {
  color: #5f6e83;
  font-size: 10.5px;
  line-height: 1.4;
}

.money-input {
  position: relative;
}

.money-prefix {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: #5f6e83;
  font-size: 0.82rem;
  font-weight: 600;
}

.money-input .form-control {
  padding-left: 38px;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Faixa do conflito de ano: avisa e não bloqueia, e oferece as duas correções
   possíveis mais o registro da retificação. */
/* Passo sugerido para quem só lê a carteira: continua informando o que falta,
   sem prometer uma ação que a permissão recusa. */
.todo-empty__step.is-static {
  cursor: default;
  opacity: 0.75;
}

.conflict-band {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding: 13px 16px;
  border: 1px solid #fca5a5;
  border-radius: 14px;
  background: #fef7f7;
}

.conflict-band > i {
  flex: none;
  margin-top: 2px;
  color: #b91c1c;
  font-size: 1.05rem;
}

.conflict-body {
  flex: 1;
  min-width: 0;
}

.conflict-body h2 {
  margin: 0;
  color: #b91c1c;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
}

.conflict-body p {
  margin: 3px 0 10px;
  color: #7f1d1d;
  font-size: 0.79rem;
  line-height: 1.5;
}

.conflict-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar-count {
  color: #c2410c;
  font-size: 0.76rem;
  font-weight: 700;
}

.change-card {
  margin-bottom: 12px;
  padding: 13px 15px 8px;
  border-color: #fde68a;
}

.change-head,
.check-head,
.impact-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}

.change-head {
  margin: -13px -15px 10px;
  padding: 10px 15px;
  border-bottom: 1px solid #fde68a;
  border-radius: 14px 14px 0 0;
  background: #fff7ed;
}

.change-head h2 {
  margin: 0;
  color: #92400e;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
}

.change-count {
  padding: 1px 8px;
  border-radius: 999px;
  background: #f59e0b;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
}

.change-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color-light);
}

.change-row-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.change-field {
  color: #1f2b3a;
  font-size: 12px;
  font-weight: 700;
}

.change-undo {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--border-color-light);
  border-radius: 7px;
  background: #ffffff;
  color: #5f6e83;
  font-size: 0.72rem;
}

.change-undo:hover {
  border-color: #f59e0b;
  color: #92400e;
}

.change-diff {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 3px 0 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.5;
}

.change-diff s {
  color: #b91c1c;
}

.change-diff span {
  color: #15803d;
  font-weight: 600;
}

.change-effect {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin: 5px 0 0;
  color: #5f6e83;
  font-size: 10.5px;
  line-height: 1.45;
}

.change-effect > i {
  flex: none;
  margin-top: 1px;
}

.change-note {
  margin: 8px 0 6px;
  color: #5f6e83;
  font-size: 10.5px;
}

.check-card {
  margin-bottom: 12px;
  padding: 14px 16px 6px;
}

.check-head h2 {
  margin: 0 0 8px;
  color: #1f2b3a;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
}

.check-count {
  padding: 1px 8px;
  border-radius: 999px;
  background: #eef3fa;
  color: #5f6e83;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.check-count.is-open {
  background: #fff7ed;
  color: #c2410c;
}

.check-row {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 8px 0;
  border-top: 1px solid var(--border-color-light);
}

.check-row > i {
  flex: none;
  margin-top: 2px;
  font-size: 0.86rem;
}

.check-row--ok > i { color: #15803d; }
.check-row--warn > i { color: #c2410c; }
.check-row--critical > i { color: #b91c1c; }

.check-label {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  color: #1f2b3a;
  font-size: 0.78rem;
  font-weight: 600;
}

.check-blocking {
  padding: 0 7px;
  border-radius: 999px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 10px;
  font-weight: 700;
}

.check-note {
  display: block;
  color: #5f6e83;
  font-size: 0.72rem;
  line-height: 1.4;
}

.check-foot {
  margin: 8px 0 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color-light);
  color: #5f6e83;
  font-size: 10.5px;
  line-height: 1.45;
}

.impact-card {
  position: sticky;
  top: 82px;
  padding: 14px 16px 6px;
}

.impact-head h2 {
  margin: 0;
  color: #1f2b3a;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
}

.impact-head p {
  margin: 1px 0 10px;
  color: #5f6e83;
  font-size: 0.72rem;
}

.impact-row {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 8px 0;
  border-top: 1px solid var(--border-color-light);
}

.impact-row > i {
  flex: none;
  margin-top: 2px;
  color: var(--accent-color);
  font-size: 0.86rem;
}

.impact-where {
  display: block;
  color: #1f2b3a;
  font-size: 0.78rem;
  font-weight: 600;
}

.impact-what {
  display: block;
  color: #5f6e83;
  font-size: 0.72rem;
  line-height: 1.4;
}

/* --- busca com chips das partes (D-057, fase 3) --------------------------- */

.chip-select {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chip-search {
  position: relative;
}

.chip-search > i {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: #5f6e83;
  font-size: 0.82rem;
}

.chip-search .form-control {
  min-height: 38px;
  padding-left: 34px;
  border-radius: 9px;
}

.chip-options {
  position: absolute;
  top: 42px;
  z-index: 15;
  width: 100%;
  max-height: 246px;
  margin: 0;
  padding: 5px;
  overflow: auto;
  list-style: none;
  border: 1px solid var(--border-color-light);
  border-radius: 11px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.chip-option {
  display: flex;
  gap: 9px;
  align-items: center;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
}

.chip-option:hover {
  background: #f2fbfb;
}

.chip-option-name {
  display: block;
  color: #1f2b3a;
  font-size: 0.79rem;
  font-weight: 600;
}

.chip-option-note {
  display: block;
  color: #5f6e83;
  font-size: 0.71rem;
}

.chip-avatar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0ea5a4;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: flex-start;
}

.chip-select__item {
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: 100%;
  padding: 6px 9px;
  border: 1px solid #99f6e4;
  border-radius: 10px;
  background: #f0fdfa;
}

.chip-select__item--warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.chip-select__item--warn .chip-avatar {
  background: #d97706;
}

.chip-name {
  display: block;
  color: #1f2b3a;
  font-size: 12px;
  font-weight: 600;
}

.chip-note {
  display: block;
  color: #5f6e83;
  font-size: 10.5px;
}

.chip-select__item--warn .chip-note {
  color: #92400e;
}

.chip-drop {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #5f6e83;
}

.chip-drop:hover {
  background: rgba(15, 23, 42, 0.08);
  color: #b91c1c;
}

.chip-add {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 6px 11px;
  border: 1px dashed var(--border-color);
  border-radius: 10px;
  background: transparent;
  color: #5f6e83;
  font-size: 0.76rem;
  font-weight: 600;
}

.chip-add:hover {
  border-color: var(--accent-color);
  color: #0b6665;
}

.chip-new {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px 12px;
  border: 1px solid var(--border-color-light);
  border-radius: 11px;
  background: #f8fafc;
}

.chip-new-head {
  margin: 0;
  color: #1f2b3a;
  font-size: 0.78rem;
  font-weight: 600;
}

.chip-new .form-control {
  min-height: 36px;
  border-radius: 8px;
  font-size: 0.79rem;
}

.chip-new-error {
  margin: 0;
  color: #b91c1c;
  font-size: 0.73rem;
  font-weight: 600;
}

.chip-new-actions {
  display: flex;
  gap: 7px;
}

/* O `select` do Django continua no DOM porque é ele que vai no POST — some da
   vista, mas não do formulário. `display: none` num campo com `required`
   impediria o navegador de reportar o erro, então some por tamanho. */
.chip-native {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 1200px) {
  .case-form {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "topbar" "alerts" "body" "side";
  }

  .impact-card {
    position: static;
    margin-top: 14px;
  }
}

@media (max-width: 768px) {
  .form-section-grid > .case-field {
    grid-column: span 12;
  }

  .radio-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Formulário de tarefa (D-066) ---------------------------------------- */
/* Reaproveita o vocabulário do formulário de processo (.form-topbar, .case-field,
   .field-flag, .chip-*, .type-toggle, .precheck-row, .load-bar, .avatar-initial).
   O main.css do FlexAdmin é dono de .task-* sem sufixo (gotcha 20): tudo que nasce
   aqui começa por task-form-. O rail traz as suas próprias classes de cartão
   (.task-form-card) porque .side-card não existe neste arquivo. */

/* O bloco do formulário de processo define `.case-field--2` a `--8` e para aí: nenhuma
   das suas seções ocupa a linha inteira. As desta tela ocupam (título, os dois pickers,
   a nota de tarefa interna, o bloco de prazo fatal e as observações), e sem esta regra
   a célula caía no `span 1` implícito da grade — um doze avos da largura, com o campo
   espremido. O `@media (max-width: 768px)` acima colapsa `.form-section-grid >
   .case-field` para `span 12` com a mesma especificidade e vem antes no arquivo; como
   o valor aqui também é 12, a leitura estreita continua idêntica. */
.task-form .case-field--12 {
  grid-column: span 12;
}

.task-form .form-control,
.task-form .form-select {
  height: 42px;
  border-radius: 9px;
}

.task-form textarea.form-control {
  height: auto;
  min-height: 96px;
}

.task-form-shortcut-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-form-shortcut {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border: 1.5px solid #dde5f1;
  border-radius: 10px;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

.task-form-shortcut:hover {
  border-color: #0ea5a4;
}

.task-form-shortcut-name {
  display: block;
  color: #1c2635;
  font-size: 12.5px;
  font-weight: 700;
}

.task-form-shortcut-meta {
  display: block;
  color: #5f6e83;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.task-form-shortcut--peca { border-color: #bfdbfe; background: #eef6ff; color: #1e40af; }
.task-form-shortcut--ato { border-color: #fca5a5; background: #fef7f7; color: #b91c1c; }
.task-form-shortcut--analise { border-color: #ddd6fe; background: #faf8ff; color: #6d28d9; }
.task-form-shortcut--documento { border-color: #fed7aa; background: #fffbf5; color: #c2410c; }
.task-form-shortcut--contato { border-color: #99f6e4; background: #f8fdfd; color: #0b6665; }

.task-form-type-hint {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  margin-top: 6px;
  padding: 7px 10px;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  background: #f0fdfa;
  color: #155e5d;
  font-size: 10.5px;
  line-height: 1.55;
}

.task-form-points {
  display: flex;
  gap: 10px;
  align-items: center;
}

.task-form-points .form-control {
  width: 96px;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.task-form-points--locked .form-control {
  background: #f6f9fd;
  color: #0f1728;
}

.task-form-points-unit {
  color: #5f6e83;
  font-size: 12px;
}

.task-form-points-origin {
  margin-left: auto;
  padding: 2px 8px;
  border: 1px solid #99f6e4;
  border-radius: 6px;
  background: #f0fdfa;
  color: #0b6665;
  font-size: 10.5px;
  font-weight: 700;
}

.task-form-link-toggle {
  color: #0b6665;
  font-weight: 700;
}

.task-form-mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.task-form-link-card {
  display: flex;
  gap: 11px;
  align-items: center;
  margin-top: 4px;
  padding: 11px 13px;
  border: 1.5px solid #99f6e4;
  border-radius: 10px;
  background: #f8fdfd;
}

.task-form-link-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #e6f5f5;
  color: #0b6665;
  font-size: 14px;
}

.task-form-link-body {
  flex: 1;
  min-width: 0;
}

.task-form-link-name {
  display: block;
  color: #0f1728;
  font-size: 13px;
  font-weight: 600;
}

.task-form-link-note {
  display: block;
  margin-top: 2px;
  color: #5f6e83;
  font-size: 11.5px;
}

.task-form-deadline-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.task-form-deadline-chip {
  padding: 3px 9px;
  border: 1px solid #e3eaf5;
  border-radius: 7px;
  background: #ffffff;
  color: #3c4a5f;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.task-form-deadline-chip--suggested { border-color: #5eead4; }
.task-form-deadline-chip--on { border-color: #0ea5a4; background: #f0fdfa; color: #0b6665; }

/* `chosen` é o prazo de agora; `suggested` é o que o tipo propõe. Um chip pode ser
   os dois, e a marca do escolhido precisa vencer — por isso vem depois. */
.task-form-deadline-chip--chosen {
  border-color: #0b6665;
  background: #0b6665;
  color: #ffffff;
}

.task-form-deadline-note {
  margin: 6px 0 0;
  color: #5f6e83;
  font-size: 10.5px;
  line-height: 1.55;
}

.task-form-deadline-warn {
  display: block;
  color: #9a3412;
}

.task-form-deadline-warn a {
  color: #9a3412;
  font-weight: 700;
}

.task-form-priority-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.task-form-priority-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 11px;
  border: 1.5px solid #e3eaf5;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
}

.task-form-priority-card:hover {
  border-color: #0ea5a4;
}

.task-form-priority-card.is-on,
.task-form-priority-card:has(input:checked) {
  border-color: #0ea5a4;
  background: #f0fdfa;
}

.task-form-priority-card input {
  margin: 0;
}

.task-form-priority-name {
  color: #1c2635;
  font-size: 12.5px;
  font-weight: 700;
}

.task-form-priority-note {
  color: #5f6e83;
  font-size: 10.5px;
  line-height: 1.45;
}

.task-form-fatal {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1.5px solid #fca5a5;
  border-radius: 11px;
  background: #fef7f7;
  cursor: pointer;
}

.task-form-fatal-head {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #7f1d1d;
  font-size: 13px;
  font-weight: 700;
}

.task-form-fatal-text {
  display: block;
  margin-top: 5px;
  color: #991b1b;
  font-size: 11.5px;
  line-height: 1.6;
}

/* --- o rail ------------------------------------------------------------- */

.task-form-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.task-form-card {
  overflow: hidden;
  border: 1px solid var(--border-color-light);
  border-radius: 14px;
  background: #ffffff;
}

.task-form-card-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 16px 10px;
}

.task-form-card-head h2 {
  margin: 0;
  color: #1f2b3a;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
}

.task-form-assignees {
  display: flex;
  flex-direction: column;
}

.task-form-assignee {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--border-color-light);
  cursor: pointer;
}

.task-form-assignee:hover,
.task-form-assignee.is-on {
  background: #f7faff;
}

.task-form-assignee-body {
  flex: 1;
  min-width: 0;
}

.task-form-assignee-name {
  display: block;
  overflow: hidden;
  color: #1c2635;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.task-form-assignee-note {
  display: block;
  margin-top: 1px;
  color: #5f6e83;
  font-size: 10.5px;
}

.task-form-assignee--overload .task-form-assignee-note {
  color: #b91c1c;
}

.task-form-assignee--overload .avatar-initial {
  background: #fee2e2;
  color: #b91c1c;
}

.task-form-assignee-load {
  display: flex;
  flex: 0 0 62px;
  flex-direction: column;
  gap: 4px;
}

.task-form-assignee-load .load-bar-label {
  text-align: right;
}

.task-form-rail-note {
  margin: 0;
  padding: 11px 16px;
  background: #f6f9fd;
  color: #3c4a5f;
  font-size: 10.5px;
  line-height: 1.6;
}

.task-form-precheck {
  border-color: #fdba74;
}

.task-form-precheck .task-form-card-head {
  background: #fff7ed;
}

.task-form-precheck .precheck-rows {
  padding: 10px 12px 12px;
}

.task-form-precheck-count {
  color: #c2410c;
  font-size: 11.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* 10,5px é o piso de legibilidade do critério 24 — o selo estava em 9,5px. */
.task-form-blocking {
  padding: 1px 6px;
  border-radius: 5px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
}

/* Escopado no cartão: `.precheck-row` é redeclarado mais abaixo (bloco de Gerar documento)
   com a **abreviação** `border`, que zera a cor da borda esquerda com a mesma especificidade
   e, por vir depois, vence. Sem o `.task-form-precheck` na frente, as linhas de informação
   saíam com a borda padrão e a variante não pintava nada. */
.task-form-precheck .precheck-row--info { border-left-color: #5f6e83; }
.task-form-precheck .precheck-row--info .precheck-row-icon { color: #5f6e83; }

.task-form-effects {
  margin: 0;
  padding: 2px 16px 8px 32px;
}

.task-form-effects li {
  padding: 6px 0;
  border-top: 1px solid var(--border-color-light);
}

.task-form-effect-title {
  display: block;
  color: #1c2635;
  font-size: 12px;
  font-weight: 600;
}

.task-form-effect-detail {
  display: block;
  margin-top: 2px;
  color: #5f6e83;
  font-size: 10.5px;
  line-height: 1.5;
}

.task-form-another {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color-light);
  cursor: pointer;
}

@media (max-width: 768px) {
  .task-form-priority-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Formulário de prazo (D-067) ----------------------------------------- */
/* Reaproveita a moldura do formulário de processo/tarefa (.case-form, .form-topbar,
   .form-section*, .case-field*, .field-*, .chip-*, .precheck-row*, .load-bar*,
   .task-form-card*, .task-form-assignee*). `.due-*` já é do financeiro (gotcha 20):
   o destaque do vencimento chama-se .deadline-form-due, e a linha de outros prazos do
   processo usa o prefixo .other-deadline- (nenhum dos dois existe em frontend_template/).
   Tokens: Sora nos títulos e na data do vencimento, Manrope nos rótulos (herdado da
   página), JetBrains Mono no número do CNJ; teal #0ea5a4; raio 14px nos cards e 9px
   nos campos; campos com 42px de altura. */

.deadline-form .case-field--12 {
  grid-column: span 12;
}

.deadline-form .form-control,
.deadline-form .form-select {
  height: 42px;
  border-radius: 9px;
}

/* A barra do formulário de processo/tarefa já é `position: sticky` — aqui só o
   espaçamento entre a trilha de migalhas e as ações muda (a trilha desta tela é mais
   curta que a do processo). */
.deadline-form-topbar {
  gap: 12px;
}

.deadline-form-days {
  display: flex;
  gap: 9px;
}

.deadline-form-days input[name="days"] {
  flex: 0 0 88px;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.deadline-form-days select {
  flex: 1;
  min-width: 0;
}

.deadline-form-mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

.field-flag--info {
  background: #e6f5f5;
  color: #0b6665;
  cursor: help;
}

/* --- a faixa de aviso do catálogo de feriados vazio ---------------------- */

.holiday-alert-band {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 15px 18px;
  margin-bottom: 16px;
  border: 1.5px solid #fca5a5;
  border-radius: 14px;
  background: #fef2f2;
}

.holiday-alert-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 17px;
}

.holiday-alert-body {
  flex: 1;
  min-width: 0;
}

.holiday-alert-title {
  margin: 0;
  color: #7f1d1d;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 14.5px;
  font-weight: 700;
}

.holiday-alert-text {
  margin: 4px 0 0;
  color: #991b1b;
  font-size: 12.5px;
  line-height: 1.55;
}

.holiday-alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin-top: 12px;
}

.holiday-alert-note {
  color: #991b1b;
  font-size: 12px;
}

/* --- os chips do catálogo do CPC ------------------------------------------ */

.cpc-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cpc-chip {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  padding: 8px 12px;
  border: 1.5px solid #dbeafe;
  border-radius: 10px;
  background: #f7fafe;
  text-align: left;
  cursor: pointer;
}

.cpc-chip:hover,
.cpc-chip.is-on {
  border-color: #0ea5a4;
  background: #f0fdfa;
}

.cpc-chip--fatal {
  border-color: #fca5a5;
  background: #fef7f7;
}

.cpc-chip-days {
  color: #1e40af;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cpc-chip--fatal .cpc-chip-days {
  color: #b91c1c;
}

.cpc-chip.is-on .cpc-chip-days {
  color: #0b6665;
}

.cpc-chip-body {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.cpc-chip-name {
  color: #1c2635;
  font-size: 12.5px;
  font-weight: 700;
}

.cpc-chip-basis {
  color: #5f6e83;
  font-size: 10.5px;
}

.cpc-chip-flag {
  padding: 0 5px;
  border-radius: 4px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* --- o cartão do processo escolhido (chip picker) ------------------------ */

.deadline-form-case-card {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 11px 13px;
  border: 1.5px solid #99f6e4;
  border-radius: 10px;
  background: #f8fdfd;
}

.deadline-form-case-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #e6f5f5;
  color: #0b6665;
  font-size: 14px;
}

.deadline-form-case-body {
  flex: 1;
  min-width: 0;
}

.deadline-form-case-name {
  display: block;
  color: #0f1728;
  font-size: 13px;
  font-weight: 600;
}

.deadline-form-case-note {
  display: block;
  margin-top: 2px;
  color: #5f6e83;
  font-size: 11.5px;
}

/* --- o vencimento em destaque e a linha do tempo da contagem -------------- */

.deadline-form-due {
  overflow: hidden;
  border: 1.5px solid #99f6e4;
  border-radius: 13px;
  background: #f0fdfa;
}

.deadline-form-due--urgent {
  border-color: #fca5a5;
  background: #fef7f7;
}

.deadline-form-due--overdue {
  border-color: #fca5a5;
  background: #fee2e2;
}

.deadline-form-due-main {
  display: flex;
  align-items: stretch;
}

.deadline-form-due-result {
  flex: 1;
  min-width: 0;
  padding: 15px 18px;
}

.deadline-form-due-left {
  display: flex;
  flex: 0 0 168px;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 15px 16px;
  border-left: 1px solid #99f6e4;
  background: rgba(255, 255, 255, 0.5);
}

.deadline-form-due--urgent .deadline-form-due-left,
.deadline-form-due--overdue .deadline-form-due-left {
  border-left-color: #fca5a5;
}

.deadline-form-due-label {
  display: block;
  color: #0b6665;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.deadline-form-due--urgent .deadline-form-due-label,
.deadline-form-due--overdue .deadline-form-due-label {
  color: #b91c1c;
}

.deadline-form-due-date {
  display: inline-block;
  margin-top: 5px;
  color: #0b6665;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 31px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.deadline-form-due-weekday {
  margin-left: 11px;
  color: #0b6665;
  font-size: 14px;
  font-weight: 700;
}

.deadline-form-due--urgent .deadline-form-due-date,
.deadline-form-due--urgent .deadline-form-due-weekday,
.deadline-form-due--overdue .deadline-form-due-date,
.deadline-form-due--overdue .deadline-form-due-weekday {
  color: #7f1d1d;
}

.deadline-form-due-note {
  margin: 8px 0 0;
  color: #155e5d;
  font-size: 12.5px;
  line-height: 1.6;
}

.deadline-form-due--urgent .deadline-form-due-note,
.deadline-form-due--overdue .deadline-form-due-note {
  color: #991b1b;
}

.deadline-form-due-count {
  color: #0b6665;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.deadline-form-due--urgent .deadline-form-due-count,
.deadline-form-due--overdue .deadline-form-due-count {
  color: #7f1d1d;
}

.deadline-form-due-sub {
  color: #155e5d;
  font-size: 11px;
  line-height: 1.45;
}

.deadline-form-due-empty {
  margin: 0;
  padding: 15px 18px;
  color: #3c4a5f;
  font-size: 12.5px;
}

.count-timeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 11px 18px;
  list-style: none;
  border-top: 1px solid #99f6e4;
  background: rgba(255, 255, 255, 0.45);
}

.count-step {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid #e3eaf5;
  border-radius: 7px;
  background: #ffffff;
  color: #334155;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  cursor: help;
}

.count-step + .count-step::before {
  margin-right: 4px;
  /* O chevron carrega a ordem dos passos: abaixo de 4,5:1 ele some para quem
     enxerga pouco. #5f6e83 e o mesmo cinza do passo do marco que nao conta. */
  color: #5f6e83;
  content: "\203a";
}

.count-step i {
  font-size: 10.5px;
}

.count-step--neutral {
  color: #334155;
}

.count-step--skip {
  color: #5f6e83;
  background: #f6f9fd;
}

.count-step--first {
  border-color: #b8e3e2;
  background: #e6f5f5;
  color: #0b6665;
}

.count-step--skipped {
  border-color: #fed7aa;
  background: #fffbf5;
  color: #9a3412;
}

.count-step--extended {
  border-color: #fdba74;
  background: #fff7ed;
  color: #9a3412;
}

.count-step--due {
  border-color: #fca5a5;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
}

/* --- prazo fatal e a tarefa vinculada -------------------------------------- */

.fatal-block {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1.5px solid #fca5a5;
  border-radius: 11px;
  background: #fef7f7;
  cursor: pointer;
}

.fatal-block .form-check-input {
  margin-top: 3px;
}

.fatal-block-body {
  flex: 1;
  min-width: 0;
}

.fatal-block-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #7f1d1d;
  font-size: 13px;
  font-weight: 700;
}

.fatal-block-origin {
  padding: 0 6px;
  border-radius: 4px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.fatal-block-text {
  display: block;
  margin-top: 5px;
  color: #991b1b;
  font-size: 11.5px;
  line-height: 1.6;
}

/* O card e a celula da pagina: o `<select>` de tipo mora nela, fora do bloco que o
   rail troca fora de banda (trocado a cada tecla, o dropdown aberto fecharia). */
.linked-task-field {
  padding: 12px 14px;
  border: 1.5px solid #fdba74;
  border-radius: 11px;
  background: #fffbf5;
}

.linked-task-block {
  display: block;
}

.linked-task-head {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  color: #7c2d12;
  font-size: 13px;
  font-weight: 700;
}

.linked-task-text {
  margin: 6px 0 0;
  color: #9a3412;
  font-size: 11.5px;
  line-height: 1.6;
}

.linked-task-swap {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid #fed7aa;
  border-radius: 9px;
  background: #ffffff;
  color: #7c2d12;
  font-size: 11.5px;
  line-height: 1.6;
}

.linked-task-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin: 10px 0 0;
  color: #7c2d12;
  font-size: 11.5px;
  font-weight: 700;
}

.linked-task-pick .form-select {
  flex: 0 1 280px;
  height: 36px;
}

.linked-task-origin {
  margin: 8px 0 0;
  color: #9a3412;
  font-size: 11px;
  font-weight: 500;
}

/* --- o rail: carga da equipe e outros prazos do processo ------------------ */

.deadline-form-rail .task-form-card {
  margin-bottom: 16px;
}

.assignee-row--overload .task-form-assignee-note {
  color: #b91c1c;
}

.other-deadline-row {
  padding: 10px 16px;
  border-top: 1px solid var(--border-color-light);
}

.other-deadline-title {
  margin: 0;
  overflow: hidden;
  color: #1c2635;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.other-deadline-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0 0;
  color: #5f6e83;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.other-deadline-status {
  flex-shrink: 0;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.other-deadline-row--done .other-deadline-status {
  background: #dcfce7;
  color: #15803d;
}

.other-deadline-row--open .other-deadline-status,
.other-deadline-row--late .other-deadline-status {
  background: #fee2e2;
  color: #b91c1c;
}

.other-deadline-empty {
  margin: 0;
  padding: 12px 16px;
  color: #3c4a5f;
  font-size: 11.5px;
}

/* --- Formulário de audiência (D-068) ----------------------------------------- */
/* Reaproveita a moldura do processo/prazo (.case-form, .form-topbar, .form-section*,
   .case-field*, .field-*, .chip-*, .precheck-row*, .task-form-card*,
   .task-form-assignee*, .deadline-form-case-*, .prep-checklist/.prep-item/
   .prep-label/.prep-empty). Campos com 42px de altura e raio 9px, como no D-066/D-067.
   A cor do tipo de ato é dado do catálogo (`hearing_page.KIND_META`), nunca do CSS:
   não existem `--audiencia`/`--pericia`/... — só `var(--kind-colour)`, escrita inline
   pelo template a cada cartão. */

.hearing-form .case-field--12 {
  grid-column: span 12;
}

.hearing-form .form-control,
.hearing-form .form-select {
  height: 42px;
  border-radius: 9px;
}

.hearing-form textarea.form-control {
  height: auto;
  min-height: 90px;
}

.hearing-form-topbar {
  gap: 12px;
}

.field-flag--new {
  background: #eef2ff;
  color: #4338ca;
}

/* --- a faixa de conflito de agenda ------------------------------------------ */

.hearing-form-conflict {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 15px 18px;
  margin-bottom: 16px;
  border: 1.5px solid #fca5a5;
  border-radius: 14px;
  background: #fef2f2;
}

.hearing-form-conflict-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 17px;
}

.hearing-form-conflict-body {
  flex: 1;
  min-width: 0;
}

.hearing-form-conflict-title {
  margin: 0;
  color: #7f1d1d;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 14.5px;
  font-weight: 700;
}

.hearing-form-conflict-text {
  margin: 4px 0 0;
  color: #991b1b;
  font-size: 12.5px;
  line-height: 1.55;
}

.hearing-form-conflict-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin-top: 12px;
}

/* --- os cartões de tipo do ato ----------------------------------------------- */

.hearing-form-kinds {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.hearing-form-kind {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 12px 13px;
  border: 1.5px solid var(--border-color-light);
  border-left: 3px solid var(--kind-colour);
  border-radius: 11px;
  background: #ffffff;
  cursor: pointer;
}

/* Escondido, não removido: o rádio continua tabulável e é o que o navegador envia. */
.hearing-form-kind input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.hearing-form-kind.is-on {
  border-color: var(--kind-colour);
  background: color-mix(in srgb, var(--kind-colour) 12%, white);
}

.hearing-form-kind-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--kind-colour) 14%, white);
  color: var(--kind-colour);
  font-size: 1rem;
}

.hearing-form-kind-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hearing-form-kind-name {
  color: #1c2635;
  font-size: 12.5px;
  font-weight: 700;
}

.hearing-form-kind-note {
  color: #5f6e83;
  font-size: 10.5px;
  line-height: 1.4;
}

.hearing-form-kind-count {
  margin-top: 2px;
  color: var(--kind-colour);
  font-size: 10.5px;
  font-weight: 700;
}

/* --- duração e modalidade ----------------------------------------------------- */

.hearing-form-duration select {
  font-variant-numeric: tabular-nums;
}

.hearing-form-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.hearing-form-mode {
  position: relative;
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 9px 12px;
  border: 1.5px solid var(--border-color-light);
  border-radius: 11px;
  background: #ffffff;
  cursor: pointer;
}

.hearing-form-mode input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.hearing-form-mode.is-on {
  border-color: #0ea5a4;
  background: #f0fdfa;
}

.hearing-form-mode-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #eef3fa;
  color: #475569;
  font-size: 0.9rem;
}

.hearing-form-mode.is-on .hearing-form-mode-icon {
  background: #e6f5f5;
  color: #0b6665;
}

.hearing-form-mode-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hearing-form-mode-name {
  color: #1c2635;
  font-size: 12.5px;
  font-weight: 700;
}

.hearing-form-mode-note {
  color: #5f6e83;
  font-size: 10.5px;
}

/* --- o campo de local por modalidade ------------------------------------------ */

.hearing-form-location-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}

.hearing-form-location--presencial .hearing-form-location-head i {
  color: #0b6665;
}

.hearing-form-location--virtual .hearing-form-location-head i {
  color: #1e40af;
}

.hearing-form-origin {
  text-decoration: none;
}

.hearing-form-origin--novo {
  background: #fffbeb;
  color: #92400e;
}

.hearing-form-origin--novo:hover {
  background: #fef3c7;
}

.hearing-form-origin--da-comarca {
  background: #f0fdfa;
  color: #0b6665;
}

.hearing-form-origin--digitado {
  background: #eff6ff;
  color: #1e40af;
}

.hearing-form-origin--colar-aqui {
  background: #eef2ff;
  color: #4338ca;
}

/* --- o preparo do tipo escolhido (cartão teal, como o vinculado do D-067) ---- */

.hearing-form-prep {
  padding: 16px 18px;
  border: 1.5px solid #99f6e4;
  border-radius: 14px;
  background: #f8fdfd;
}

.hearing-form-prep .form-section-icon {
  background: #e6f5f5;
  color: #0b6665;
}

.hearing-form-offset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0b6665;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: help;
}

.hearing-form-offset-new {
  padding: 0 6px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hearing-form-prep-note {
  margin: 12px 0 0;
  padding-top: 11px;
  border-top: 1px solid #99f6e4;
  color: #155e5d;
  font-size: 11px;
  line-height: 1.6;
}

/* --- quem comparece: a agenda de cada advogado no horário -------------------- */

.hearing-form-attendee {
  position: relative;
}

.hearing-form-attendee.is-on {
  border-left: 3px solid #0ea5a4;
}

.hearing-form-attendee.hearing-form-attendee--conflict {
  border-left: 3px solid #b91c1c;
}

.hearing-form-attendee--conflict .task-form-assignee-note {
  color: #b91c1c;
}

.hearing-form-attendee-flag {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

/* --- o rail: a conferência já é `.precheck-row*`; aqui só o que agendar provoca */

.hearing-form-rail .task-form-card {
  margin-bottom: 16px;
}

.hearing-form-effects {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 12px 16px 14px;
  list-style: none;
}

.hearing-form-effect {
  padding-left: 12px;
  border-left: 2px solid #e3eaf5;
}

.hearing-form-effect-title {
  margin: 0;
  color: #1c2635;
  font-size: 12px;
  font-weight: 700;
}

.hearing-form-effect-detail {
  margin: 2px 0 0;
  color: #5f6e83;
  font-size: 10.5px;
  line-height: 1.5;
}

/* --- os desfechos novos na lista de audiências: Redesignada e Cancelada ------ */
/* `.btn-record` (Realizada) já é âmbar sólido; os dois novos precisam de tom
   próprio para não se confundir com ele nem entre si (critério 19). */

.btn-record--redesignada {
  border: 1px solid #fbbf24;
  background: #fffbeb;
  color: #92400e;
}

.btn-record--redesignada:hover {
  border-color: #b45309;
  background: #fef3c7;
}

.btn-record--cancelada {
  border: 1px solid #e3eaf5;
  background: #ffffff;
  color: #b91c1c;
}

.btn-record--cancelada:hover {
  border-color: #fca5a5;
  background: #fef2f2;
}

/* O rádio do cartão é invisível (`opacity: 0`): sem isto, tabular pelos tipos e pelas
   modalidades não mostrava onde o foco estava. `--kind-colour` só existe nos cartões de
   tipo; nas modalidades o valor cai no teal da paleta. */
.hearing-form-kind:focus-within,
.hearing-form-mode:focus-within {
  outline: 2px solid var(--kind-colour, #0ea5a4);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .hearing-form-kinds {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hearing-form-modes {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Lançamentos (D-069) -------------------------------------------------- */
/* Reaproveita o vocabulário dos formulários D-066/D-067/D-068 (.field-*, .precheck-row*,
   .money, .kpi-*, .pill-filter*) e a paleta já em uso no arquivo: teal #0ea5a4/#0b6665/
   #f0fdfa para receita e estados "ok"; âmbar #c2410c/#fff7ed/#fdba74 para despesa e
   "atenção"; vermelho #b91c1c/#dc2626/#fee2e2 só para atraso/crítico (nunca para
   "despesa", que não é erro); cinza #5f6e83/#eef3fa para neutro/"informativo". Campos
   com 42px de altura e raio 9px, cards com raio 14px, `minmax(0, 1fr)` em toda grade
   (nunca `1fr` cru). Nenhum texto de conteúdo no cinza-claro proibido (critério 22). */

.entry-form .form-control,
.entry-form .form-select {
  height: 42px;
  border-radius: 9px;
}

/* --- cabeçalho e KPIs ------------------------------------------------------ */

.entry-list-subtitle {
  margin: 2px 0 0;
  color: #5f6e83;
  font-size: 12.5px;
}

/* --- a lista: cabeçalho e linhas ------------------------------------------- */
/* `.entry-row` tem SEIS filhos (ícone de direção + descrição + vencimento + valor +
   situação + ação), mas `.entry-list-head` só declara CINCO células — o ícone não tem
   rótulo próprio, é parte visual da coluna "Lançamento". Em vez de forçar as duas grades
   a terem o mesmo número de faixas (o que empurraria "Lançamento" para a faixa estreita
   do ícone), as duas leem a MESMA cauda de faixas (108px/124px/128px/110px) e cada
   célula do cabeçalho é posicionada por `nth-child` na faixa que o dado correspondente
   ocupa na linha — sem isso "Vencimento" cairia sobre a coluna do valor. */
.entry-list-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 108px 124px 128px 110px;
  gap: 12px;
  padding: 0 14px 8px;
  color: #5f6e83;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.entry-list-head-cell:nth-child(1) { grid-column: 2; }
.entry-list-head-cell:nth-child(2) { grid-column: 3; }
.entry-list-head-cell:nth-child(3) { grid-column: 4; }
.entry-list-head-cell:nth-child(4) { grid-column: 5; }
.entry-list-head-cell:nth-child(5) { grid-column: 6; }

.entry-list {
  display: flex;
  flex-direction: column;
}

.entry-list-empty {
  margin: 0;
  padding: 24px 14px;
  color: #5f6e83;
  font-size: 12.5px;
  text-align: center;
}

.entry-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 108px 124px 128px 110px;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-top: 1px solid var(--border-color-light, #eef3fa);
}

.entry-row--overdue {
  border-radius: 8px;
  background: #fef7f7;
}

.entry-direction-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 0.95rem;
}

.entry-direction-icon--in {
  background: #e6f5f5;
  color: #0b6665;
}

.entry-direction-icon--out {
  background: #fff7ed;
  color: #c2410c;
}

.entry-row-main {
  min-width: 0;
}

.entry-row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  color: #1c2635;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-recurring {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 6px;
  background: #f6f9fd;
  color: #5f6e83;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.entry-row-subtitle {
  margin-top: 2px;
  overflow: hidden;
  color: #5f6e83;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-due {
  color: #3c4a5f;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.entry-due--late {
  color: #b91c1c;
  font-weight: 700;
}

.entry-due-note {
  display: block;
  margin-top: 1px;
  color: #5f6e83;
  font-size: 10.5px;
}

.entry-due--late .entry-due-note {
  color: #b91c1c;
}

.entry-amount {
  text-align: right;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.entry-amount--in { color: #0b6665; }
.entry-amount--out { color: #9a3412; }

.entry-row-status {
  display: flex;
  justify-content: center;
}

.entry-status-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.entry-status-pill--done { background: #dcfce7; color: #15803d; }
.entry-status-pill--due { background: #eef3fa; color: #475569; }
.entry-status-pill--late { background: #fee2e2; color: #b91c1c; }
.entry-status-pill--cancelled { background: #f1f5f9; color: #5f6e83; text-decoration: line-through; }

.entry-row-action {
  display: flex;
  justify-content: flex-end;
}

.entry-settle {
  padding: 6px 12px;
  border: 1.5px solid #99f6e4;
  border-radius: 8px;
  background: #ffffff;
  color: #0b6665;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.entry-settle:hover {
  border-color: #0ea5a4;
  background: #f0fdfa;
}

/* Critério 5: linha vencida pede um botão de baixa em estilo de alerta, não o convite
   discreto de quem só está "a vencer". */
.entry-settle--late {
  border-color: #fca5a5;
  background: #fee2e2;
  color: #b91c1c;
}

.entry-settle--late:hover {
  border-color: #dc2626;
  background: #fecaca;
}

/* --- rodapé de totais ------------------------------------------------------- */

.entry-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 10px;
  padding: 12px 14px 4px;
  border-top: 1px solid var(--border-color-light, #eef3fa);
}

.entry-footer-count {
  margin-right: auto;
  color: #5f6e83;
  font-size: 11.5px;
}

.entry-footer-cell {
  color: #5f6e83;
  font-size: 11.5px;
}

.entry-footer-in { color: #0b6665; }
.entry-footer-out { color: #9a3412; }

.entry-footer-balance {
  font-weight: 700;
}

.entry-footer-balance .money {
  font-size: 13px;
  font-weight: 800;
  color: #1c2635;
}

.entry-footer-balance .money.is-negative {
  color: #b91c1c;
}

/* --- a faixa do atraso ------------------------------------------------------ */

.entry-overdue-band {
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1.5px solid #fca5a5;
  border-radius: 14px;
  background: #fef2f2;
}

.entry-overdue-band-head {
  display: flex;
  gap: 11px;
  align-items: center;
}

.entry-overdue-band-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 1.15rem;
}

.entry-overdue-band-title {
  margin: 0;
  color: #7f1d1d;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.entry-overdue-band-body {
  margin: 8px 0 0;
  color: #991b1b;
  font-size: 12.5px;
  line-height: 1.55;
}

/* Cada grupo é um chip: `title` já carrega a lista de meses por extenso, então o texto
   visível pode ficar curto sem esconder informação (fica no atributo, lido no hover e
   por leitor de tela). */
.entry-overdue-band-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.entry-overdue-band-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 12px;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  background: #ffffff;
  cursor: help;
}

.entry-overdue-band-group-label {
  color: #7f1d1d;
  font-size: 11px;
  font-weight: 700;
}

.entry-overdue-band-group-total {
  color: #b91c1c;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.entry-overdue-band-group-months {
  color: #9a3412;
  font-size: 10px;
}

.entry-overdue-band-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
}

.entry-overdue-band-action {
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
}

.entry-overdue-band-action--ghost {
  border: 1px solid #fca5a5;
  color: #7f1d1d;
}

.entry-overdue-band-action--ghost:hover {
  background: #ffffff;
}

/* --- a baixa em lote (dentro da faixa) --------------------------------------- */

.entry-settle-box {
  flex: 1 1 260px;
}

/* `<details>`/`<summary>` nativos: o marcador padrão (triângulo do navegador) é
   escondido para o resumo ler como um botão sólido — é ele que abre o formulário. */
.entry-settle-box-summary {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 9px;
  background: #b91c1c;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.entry-settle-box-summary::-webkit-details-marker {
  display: none;
}

.entry-settle-box-summary:hover {
  background: #991b1b;
}

.entry-settle-box[open] .entry-settle-box-summary {
  border-radius: 9px 9px 0 0;
}

.entry-settle-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
  padding: 14px;
  border: 1px solid #fca5a5;
  border-radius: 0 9px 9px 9px;
  background: #ffffff;
}

.entry-settle-date {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 220px;
}

.entry-settle-date-label {
  color: #5f6e83;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.entry-settle-date input {
  height: 38px;
  padding: 0 10px;
  border: 1px solid #e3eaf5;
  border-radius: 8px;
}

.entry-settle-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry-settle-item {
  border: 1px solid #e3eaf5;
  border-radius: 8px;
}

.entry-settle-item-label {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  cursor: pointer;
}

.entry-settle-item-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #1c2635;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-settle-item-amount {
  flex: none;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.entry-settle-submit {
  align-self: flex-start;
  padding: 9px 16px;
  border: none;
  border-radius: 9px;
  background: #b91c1c;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
}

.entry-settle-submit:hover {
  background: #991b1b;
}

@media (min-width: 768px) {
  .entry-settle-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --- o formulário: passos e cartões de fluxo -------------------------------- */

.entry-form-step {
  padding: 14px 0;
  border-top: 1px solid var(--border-color-light, #eef3fa);
}

.entry-form-step:first-of-type {
  padding-top: 0;
  border-top: none;
}

.entry-form-step-title {
  margin: 0 0 10px;
  color: #1f2b3a;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
}

.entry-form-flows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.flow-card {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 12px 13px;
  border: 1.5px solid var(--border-color-light, #eef3fa);
  border-radius: 11px;
  background: #ffffff;
  cursor: pointer;
}

.flow-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* O rádio é invisível: sem isto, tabular pelos cartões de fluxo era andar às cegas
   (mesmo padrão dos cartões de tipo e modalidade do D-068). */
.flow-card:focus-within {
  outline: 2px solid #0ea5a4;
  outline-offset: 2px;
}

.flow-card--in.is-on { border-color: #0ea5a4; background: #f0fdfa; }
.flow-card--out.is-on { border-color: #c2410c; background: #fff7ed; }

.flow-card-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 1rem;
}

.flow-card--in .flow-card-icon { background: #e6f5f5; color: #0b6665; }
.flow-card--out .flow-card-icon { background: #fff7ed; color: #c2410c; }

.flow-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.flow-card-name {
  color: #1c2635;
  font-size: 12.5px;
  font-weight: 700;
}

.flow-card-note {
  color: #5f6e83;
  font-size: 10.5px;
  line-height: 1.4;
}

.entry-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.entry-form-field + .entry-form-field {
  margin-top: 12px;
}

/* Filho da grade de 2 colunas de `.entry-form-row`: sem `min-width: 0` o `<input
   type=date>` empurra a coluna e a segunda metade transborda. */
.entry-form-field--half {
  min-width: 0;
}

.entry-form-field-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
}

.entry-form-label {
  color: #3c4a5f;
  font-size: 11.5px;
  font-weight: 700;
}

.entry-form-settle {
  display: flex;
  gap: 9px;
  align-items: center;
  cursor: pointer;
}

.entry-form-settle-label {
  color: #1c2635;
  font-size: 12.5px;
  font-weight: 600;
}

/* `.entry-form-paid` some por `x-show`/`x-cloak` (Alpine), nunca por `display: … !important`
   escrito aqui (gotcha 4) — uma regra dessas venceria o `style="display: none"` que o
   Alpine escreve e o campo nunca reapareceria ao marcar "Realizado". */
.entry-form-paid {
  margin-top: 10px;
}

.entry-form-save {
  margin-top: 16px;
  height: 44px;
  border-radius: 10px;
  font-weight: 700;
}

/* --- onde cai no relatório: DRE ---------------------------------------------- */

.dre-hint {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  margin: 10px 0 0;
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.5;
}

.dre-hint--ok { background: #f0fdf4; color: #15803d; }
.dre-hint--atencao { background: #fff7ed; color: #9a3412; }
.dre-hint--critico { background: #fef2f2; color: #b91c1c; }
.dre-hint--info { background: #f6f9fd; color: #5f6e83; }

/* --- o saldo da conta --------------------------------------------------------- */

.entry-form-balance {
  margin: 6px 0 0;
  color: #5f6e83;
  font-size: 11px;
  line-height: 1.5;
}

.balance-warning {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  padding: 7px 10px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 600;
}

/* --- vínculo com a parcela do contrato ---------------------------------------- */

.entry-form-installments {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.installment-option {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 9px 12px;
  border: 1.5px solid var(--border-color-light, #eef3fa);
  border-radius: 9px;
  background: #ffffff;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.installment-option input {
  margin: 0;
}

.installment-option.is-on {
  border-color: #0ea5a4;
  background: #f0fdfa;
}

.installment-option--none {
  font-variant-numeric: normal;
}

.installment-option-label {
  color: #1c2635;
  font-size: 12px;
}

/* --- a pré-visualização da recorrência ----------------------------------------- */

.recurrence-preview {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-color-light, #eef3fa);
  border-radius: 11px;
  background: #f8fafc;
}

.recurrence-preview-title {
  margin: 0 0 8px;
  color: #1f2b3a;
  font-size: 12px;
  font-weight: 700;
}

.recurrence-preview-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 180px;
  overflow-y: auto;
}

.recurrence-preview-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px dashed #e3eaf5;
  font-size: 11.5px;
}

.recurrence-preview-date {
  color: #3c4a5f;
  font-variant-numeric: tabular-nums;
}

.recurrence-preview-amount {
  color: #1c2635;
  font-weight: 600;
}

.recurrence-preview-total {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid #e3eaf5;
  color: #1c2635;
  font-size: 12.5px;
  font-weight: 700;
}

.recurrence-preview-note {
  margin: 6px 0 0;
  color: #5f6e83;
  font-size: 10.5px;
  line-height: 1.5;
}

/* --- o rail: conferência e campos deste fluxo ---------------------------------- */

.entry-form-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.entry-form-card {
  overflow: hidden;
  border: 1px solid var(--border-color-light, #eef3fa);
  border-radius: 14px;
  background: #ffffff;
}

.entry-form-card-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 16px 10px;
}

.entry-form-card-head h3 {
  margin: 0;
  color: #1f2b3a;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
}

.entry-form-precheck {
  border-color: #fdba74;
}

.entry-form-precheck .entry-form-card-head {
  background: #fff7ed;
}

.entry-form-precheck .precheck-rows {
  padding: 10px 12px 12px;
}

.entry-form-precheck-count {
  color: #c2410c;
  font-size: 11.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* `.precheck-row--info` só tem regra global fora deste escopo em `.task-form-precheck`
   (D-066) — a conferência do financeiro também emite linha "informativa" (DRE sem
   categoria, saldo sem conta, parcela sem cliente/contrato, recorrência sem vencimento)
   e, sem esta, elas saíam sem cor de borda nem de ícone. */
.entry-form-precheck .precheck-row--info { border-left-color: #5f6e83; }
.entry-form-precheck .precheck-row--info .precheck-row-icon { color: #5f6e83; }

.entry-form-blocking {
  padding: 1px 6px;
  border-radius: 5px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.entry-form-fields {
  margin: 0;
  padding: 4px 16px 12px;
  list-style: none;
}

.entry-form-field-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 7px 0;
  border-top: 1px solid var(--border-color-light, #eef3fa);
}

.entry-form-field-row:first-child {
  border-top: none;
}

.entry-form-field-row--own {
  color: #0b6665;
}

.entry-form-field-name {
  flex: 1;
  min-width: 0;
  color: #3c4a5f;
  font-size: 12px;
}

.entry-form-optional {
  background: #f6f9fd;
  color: #5f6e83;
}

@media (max-width: 768px) {
  .entry-list-head {
    display: none;
  }

  .entry-row {
    grid-template-columns: 34px minmax(0, 1fr);
    row-gap: 6px;
  }

  .entry-due,
  .entry-amount,
  .entry-row-status,
  .entry-row-action {
    grid-column: 2;
  }

  .entry-row-status {
    justify-content: flex-start;
  }

  .entry-row-action {
    justify-content: flex-start;
  }

  .entry-amount {
    text-align: left;
  }

  .entry-form-flows,
  .entry-form-row {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* --- Detalhe da tarefa (D-070) --------------------------------------------- */
/* O invólucro é o mesmo para todo tipo; o que muda é o card do meio (§0 da spec).
   Paleta do protótipo, a mesma dos blocos anteriores: alerta #fef2f2/#fca5a5/#b91c1c,
   aviso #fff7ed/#fed7aa/#9a3412, IA #f3e8ff/#ddd6fe/#5b21b6, neutro #f6f9fd/#e3eaf5/
   #3c4a5f, ok #f0fdfa/#99f6e4/#0b6665, teal #0ea5a4/#0b6665. Texto #1c2635, apoio
   #5f6e83 — nenhum texto de conteúdo no cinza-claro proibido (critério 25). Sora nos
   títulos e no contador, JetBrains Mono no CNJ, `minmax(0, 1fr)` em toda grade.
   Os rótulos do contador são escritos em minúsculas no HTML e sobem aqui: a varredura
   de identificadores procura `[A-Z_]{6,}` no texto renderizado (critério 22).
   As classes dos cards das tarefas seguintes (`.work-tile`, `.fact-row*`, `.piece-row*`,
   `.gap-row*`, `.request-item`, `.request-instruction`) nascem já aqui, para o
   vocabulário de §5 valer desde a primeira tela. */

.task-detail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.task-detail-topbar {
  margin-bottom: 0;
}

/* --- cabeçalho: título gravado, leitura, selos e contador ------------------- */

.task-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 15px;
  padding: 16px 20px;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 8px 22px -12px rgba(2, 12, 27, 0.2);
}

.task-hero-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  color: var(--family-colour, #0b6665);
  background: color-mix(in srgb, var(--family-colour, #0b6665) 12%, #fff);
}

.task-hero-body {
  min-width: 0;
}

.task-hero-title {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.25;
  color: #0f1728;
}

.task-reading {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 6px 0 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  color: #0b6665;
}

.task-reading i {
  margin-top: 3px;
  font-size: 11px;
  flex-shrink: 0;
}

.task-hero-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
}

.task-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 7px;
  border: 1px solid #e3eaf5;
  background: #f6f9fd;
  color: #3c4a5f;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
}

.task-badge i {
  font-size: 9.5px;
}

.task-badge.tone-alert {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.task-badge.tone-warn {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.task-badge.tone-ia {
  background: #f3e8ff;
  border-color: #ddd6fe;
  color: #5b21b6;
}

.task-badge.tone-ok {
  background: #f0fdfa;
  border-color: #99f6e4;
  color: #0b6665;
}

.task-badge.tone-neutral {
  background: #f6f9fd;
  border-color: #e3eaf5;
  color: #3c4a5f;
}

/* Os selos de **estado** (situação, prioridade, prazo fatal, atenção) falam alto; os
   de **metadado** (tipo e origem) são referência, e ficam mais quietos. Cada modifier
   carrega uma diferença de verdade — regra vazia só para passar em teste de presença é
   dívida, não estilo. */

.task-badge--state,
.task-badge--priority {
  font-weight: 800;
}

.task-badge--type {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 500;
}

.task-badge--origin {
  font-style: italic;
  font-weight: 600;
}

.task-badge--fatal,
.task-badge--attention {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 800;
}

.task-deadline {
  flex-shrink: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.task-deadline-label {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.task-deadline-number {
  display: block;
  font-family: "Sora", sans-serif;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.task-deadline-date {
  display: block;
  font-family: "Sora", sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: #0b6665;
  font-variant-numeric: tabular-nums;
}

.task-deadline-unit {
  display: block;
  font-size: 11px;
  color: #5f6e83;
}

.task-deadline--late .task-deadline-label,
.task-deadline--late .task-deadline-number,
.task-deadline--fatal .task-deadline-label,
.task-deadline--fatal .task-deadline-number {
  color: #b91c1c;
}

.task-deadline--due .task-deadline-label,
.task-deadline--due .task-deadline-number {
  color: #0b6665;
}

.task-deadline--done .task-deadline-label {
  color: #0b6665;
}

.task-deadline--due.is-soon .task-deadline-label,
.task-deadline--due.is-soon .task-deadline-number {
  color: #c2410c;
}

.task-deadline--fatal.is-soon .task-deadline-number {
  text-shadow: 0 0 18px rgba(185, 28, 28, 0.25);
}

/* --- faixa de contexto ------------------------------------------------------ */

.task-context-band {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 20px;
  border-radius: 13px;
  border: 1px solid #e3eaf5;
  background: #f6f9fd;
}

.task-context-band i {
  margin-top: 2px;
  font-size: 14px;
  flex-shrink: 0;
}

.task-context-body {
  min-width: 0;
}

.task-context-title {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
}

.task-context-text {
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 1.6;
}

.task-context-band--alert {
  background: #fef2f2;
  border-color: #fca5a5;
}

.task-context-band--alert i,
.task-context-band--alert .task-context-title {
  color: #7f1d1d;
}

.task-context-band--alert .task-context-text {
  color: #991b1b;
}

.task-context-band--warn {
  background: #fffbf5;
  border-color: #fdba74;
}

.task-context-band--warn i,
.task-context-band--warn .task-context-title {
  color: #7c2d12;
}

.task-context-band--warn .task-context-text {
  color: #9a3412;
}

.task-context-band--info {
  background: #f6f9fd;
  border-color: #e3eaf5;
}

.task-context-band--info i,
.task-context-band--info .task-context-title {
  color: #1c2635;
}

.task-context-band--info .task-context-text {
  color: #3c4a5f;
}

/* --- a grade: card de trabalho à esquerda, ficha e "o que precisa" no rail --- */

.task-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}

.task-detail-main,
.task-detail-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* --- o card de trabalho ----------------------------------------------------- */

.work-card {
  background: #fff;
  border: 1.5px solid #e9eff8;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 20px -10px rgba(2, 12, 27, 0.18);
}

.work-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid #eef3fa;
}

.work-card-icon {
  width: 27px;
  height: 27px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  background: #f4f7fb;
  color: #5f6e83;
}

.work-card-heading {
  flex: 1;
  min-width: 0;
}

.work-card-title {
  display: block;
  font-family: "Sora", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #0f1728;
}

.work-card-note {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: #5f6e83;
}

.work-card-body {
  padding: 15px 18px;
}

.work-card--generic {
  border-color: #e3eaf5;
}

.work-card--analysis {
  border-color: #ddd6fe;
}

.work-card--analysis .work-card-head {
  background: #faf8ff;
  border-bottom-color: #ddd6fe;
}

.work-card--analysis .work-card-icon {
  background: #f3e8ff;
  color: #6d28d9;
}

.work-card--filing {
  border-color: #fca5a5;
}

.work-card--filing .work-card-head {
  background: #fef7f7;
  border-bottom-color: #fca5a5;
}

.work-card--filing .work-card-icon {
  background: #fee2e2;
  color: #b91c1c;
}

.work-card--document {
  border-color: #ddd6fe;
}

.work-card--document .work-card-icon {
  background: #f3e8ff;
  color: #6d28d9;
}

.work-card--request {
  border-color: #fdba74;
}

.work-card--request .work-card-head {
  background: #fffbf5;
  border-bottom-color: #fdba74;
}

.work-card--request .work-card-icon {
  background: #ffedd5;
  color: #c2410c;
}

.work-description {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: #1c2635;
}

.work-description.is-empty {
  color: #5f6e83;
  font-style: italic;
}

.work-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}

.work-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid #dde5f1;
  border-radius: 9px;
  background: #fff;
  text-decoration: none;
}

.work-link:hover {
  border-color: #0ea5a4;
}

.work-link i {
  font-size: 12px;
  color: #0b6665;
}

.work-link-body {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
}

.work-link-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #5f6e83;
}

.work-link-value {
  font-size: 12.5px;
  font-weight: 600;
  color: #0f1728;
  overflow-wrap: anywhere;
}

.work-link-value.is-mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
}

/* --- o registro do andamento ------------------------------------------------ */

.work-log {
  list-style: none;
  margin: 0 0 13px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.work-log-entry {
  border: 1px solid #eef3fa;
  border-left: 3px solid #0ea5a4;
  border-radius: 9px;
  background: #f8fdfd;
  padding: 9px 12px;
}

.work-log-meta {
  margin: 0;
  font-size: 10.5px;
  font-weight: 700;
  color: #0b6665;
  font-variant-numeric: tabular-nums;
}

.work-log-text {
  margin: 3px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: #1c2635;
}

/* `background` explícito: o tema escuro do FlexAdmin (`[data-theme=dark]`) declara
   `color-scheme: dark`, e um textarea sem fundo próprio herda o campo escuro do navegador —
   texto #1c2635 sobre cinza, ilegível (visto na conferência visual do D-070). */
.work-log-input {
  width: 100%;
  min-height: 72px;
  border: 1px solid #dde5f1;
  border-radius: 9px;
  padding: 11px 13px;
  background: #fff;
  font-size: 12.5px;
  line-height: 1.6;
  color: #1c2635;
}

.work-log-input::placeholder {
  color: #5f6e83;
  font-style: italic;
}

.work-log-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 11px;
}

/* --- o card âmbar "este tipo não tem card próprio" -------------------------- */

.work-note {
  border: 1.5px solid #fdba74;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.work-note-title {
  margin: 0;
  padding: 11px 15px;
  background: #fff7ed;
  border-bottom: 1px solid #fdba74;
  font-family: "Sora", sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: #7c2d12;
}

.work-note-body {
  margin: 0;
  padding: 13px 15px;
  font-size: 11.5px;
  line-height: 1.65;
  color: #9a3412;
}

/* --- a ficha lateral -------------------------------------------------------- */

.task-sheet {
  background: #fff;
  border: 1px solid #e9eff8;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 20px -10px rgba(2, 12, 27, 0.18);
}

.task-sheet-title {
  margin: 0;
  padding: 12px 15px;
  border-bottom: 1px solid #eef3fa;
  font-family: "Sora", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #0f1728;
}

/* `display: grid` é declarado aqui de propósito: `.field-row` nasceu no bloco do
   D-054 e a ficha não pode depender de um bloco vizinho para existir — quem
   mexesse lá quebraria esta tela sem saber. O colapso em telas estreitas repete o
   ponto de corte do D-054, senão esta regra, mais específica, venceria o dele. */

.task-sheet .field-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  padding: 9px 15px;
  align-items: start;
}

@media (max-width: 767.98px) {
  .task-sheet .field-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.task-sheet .field-row-label {
  font-size: 11px;
  line-height: 1.45;
  color: #5f6e83;
}

.task-sheet .field-row-body {
  min-width: 0;
}

.task-sheet .field-row-value {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  color: #1c2635;
  overflow-wrap: anywhere;
}

.task-sheet a.field-row-value {
  color: #0b6665;
  text-decoration: none;
}

.task-sheet .field-row-value.is-mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
}

.task-sheet .field-row-note {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.5;
  color: #5f6e83;
}

.task-sheet .field-row--ok {
  background: #f8fdfd;
}

.task-sheet .field-row--ok .field-row-value,
.task-sheet .field-row--ok .field-row-note {
  color: #0b6665;
  font-weight: 700;
}

.task-sheet .field-row--warn {
  background: #fffbf5;
}

.task-sheet .field-row--warn .field-row-value,
.task-sheet .field-row--warn .field-row-note {
  color: #9a3412;
  font-weight: 700;
}

.task-sheet .field-row--alert {
  background: #fef7f7;
}

.task-sheet .field-row--alert .field-row-value,
.task-sheet .field-row--alert .field-row-note {
  color: #b91c1c;
  font-weight: 700;
}

/* --- "o que este tipo precisa" (cartão teal) -------------------------------- */

.task-needs {
  border: 1.5px solid #99f6e4;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.task-needs-title {
  margin: 0;
  padding: 11px 15px;
  background: #f0fdfa;
  border-bottom: 1px solid #99f6e4;
  font-family: "Sora", sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: #0b6665;
}

.task-needs-body {
  margin: 0;
  padding: 13px 15px;
  font-size: 11.5px;
  line-height: 1.65;
  color: #3c4a5f;
}

/* --- o vocabulário dos cards das tarefas seguintes (§5) ---------------------- */
/* Declarado aqui de propósito: as classes de análise, juntada, documento e pedido
   nascem com o bloco para que o teste de presença de §5 valha desde a primeira
   tela — e para que nenhum card invente um segundo nome para a mesma peça.
   **Tudo escopado em `.work-card`** (gotcha 20): `.fact-row` já existe neste
   arquivo (bloco do dossiê do lead, `templates/crm/_lead_facts.html`), e uma
   regra solta aqui venceria a de lá por ordem de declaração e restilizaria a tela
   do lead sem que nenhum teste de HTML visse. Os nomes de modifier da spec
   (`--strong`, `--urgent`, …) ficam como estão; muda só o escopo. */

.work-card .work-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 13px;
}

.work-card .work-tile {
  border: 1px solid #e3eaf5;
  border-radius: 11px;
  background: #f6f9fd;
  padding: 11px 12px;
}

.work-card .work-tile-value {
  display: block;
  font-family: "Sora", sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: #1c2635;
}

.work-card .work-tile-label {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 700;
  color: #3c4a5f;
}

.work-card .work-tile-note {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  line-height: 1.5;
  color: #5f6e83;
}

.work-card .fact-row,
.work-card .piece-row,
.work-card .gap-row,
.work-card .request-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e3eaf5;
  border-radius: 10px;
  background: #fff;
  font-size: 12.5px;
  line-height: 1.55;
  color: #1c2635;
}

.work-card .fact-row--strong {
  border-color: #99f6e4;
  background: #f8fdfd;
}

.work-card .fact-row--urgent {
  border-color: #fca5a5;
  background: #fef7f7;
}

.work-card .piece-row--ok {
  border-color: #99f6e4;
}

.work-card .piece-row--fix {
  border-color: #fcd34d;
  background: #fffbeb;
}

.work-card .piece-row--draft {
  border-color: #fca5a5;
  background: #fef7f7;
}

.work-card .piece-row--missing {
  border-color: #fdba74;
  background: #fff7ed;
}

.work-card .gap-row--missing {
  border-color: #fca5a5;
  background: #fef7f7;
}

.work-card .gap-row--unbound {
  border-color: #bfdbfe;
  background: #f5f9ff;
}

.work-card .gap-row--office {
  border-color: #fdba74;
  background: #fff7ed;
}

.work-card .request-item {
  flex-direction: column;
}

.work-card .request-instruction {
  display: block;
  margin-top: 7px;
  padding: 8px 11px;
  border: 1px solid #99f6e4;
  border-radius: 9px;
  background: #f0fdfa;
  font-size: 11.5px;
  line-height: 1.55;
  color: #0b6665;
}

.work-card .request-instruction.is-missing {
  border-color: #fdba74;
  background: #fff7ed;
  color: #9a3412;
}

/* --- o card de Análise (§3.1) ------------------------------------------------ */
/* `.fact-title` e `.fact-kind` já existem neste arquivo (dossiê do lead), por isso
   as peças da linha de fato daqui carregam o infixo `-row-` **e** o escopo
   `.work-card` (gotcha 20): duas telas, dois desenhos, nenhum empate por ordem de
   declaração. */

.work-lead {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid #ddd6fe;
  border-radius: 12px;
  background: #faf9ff;
  text-decoration: none;
}

.work-lead:hover {
  border-color: #c4b5fd;
  background: #f5f3ff;
}

.work-lead-initials {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: #ede9fe;
  color: #5b21b6;
  font-family: "Sora", sans-serif;
  font-size: 12.5px;
  font-weight: 700;
}

.work-lead-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}

.work-lead-name {
  font-family: "Sora", sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: #1c2635;
}

.work-lead-context {
  margin-top: 2px;
  font-size: 11px;
  color: #5f6e83;
}

.work-grade {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: none;
  padding: 4px 11px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #ddd6fe;
}

.work-grade-letter {
  font-family: "Sora", sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  color: #5b21b6;
}

.work-grade-score {
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: #5f6e83;
}

.work-card .work-tile.tone-teal {
  border-color: #99f6e4;
  background: #f8fdfd;
}

.work-card .work-tile.tone-orange {
  border-color: #fdba74;
  background: #fff7ed;
}

.work-card .work-tile.tone-amber {
  border-color: #fcd34d;
  background: #fffbeb;
}

.work-facts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 15px;
}

.work-facts-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.work-facts-title {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: #1c2635;
}

.work-facts-more {
  font-size: 11.5px;
  font-weight: 600;
  color: #0b6665;
  text-decoration: none;
}

.work-facts-more:hover {
  text-decoration: underline;
}

.work-facts-empty {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: #5f6e83;
}

.work-card .fact-row-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}

.work-card .fact-row-title {
  font-weight: 700;
  color: #1c2635;
}

.work-card .fact-row-note {
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.55;
  color: #4a596d;
}

.work-card .fact-row-kind {
  flex: none;
  align-self: flex-start;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eef3fa;
  color: #3c4a5f;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.work-card .fact-row--strong .fact-row-kind {
  background: #e6f5f5;
  color: #0b6665;
}

.work-card .fact-row--urgent .fact-row-kind {
  background: #fee2e2;
  color: #b91c1c;
}

.work-decide {
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid #e3eaf5;
}

.work-decide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Formulário próprio (e não um `<details>` dentro do de cima): Enter numa caixa
   de texto envia o primeiro botão do formulário, e ali o primeiro é "Aceitar o
   caso". O espaçamento vem daqui para a separação visual continuar a mesma. */
.work-refuse-form {
  margin: 0;
}

.work-refuse {
  margin-top: 11px;
}

.work-refuse summary {
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
  color: #b91c1c;
}

.work-refuse-label {
  display: block;
  margin-top: 10px;
  margin-bottom: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: #3c4a5f;
}

.work-refuse-select,
.work-refuse-input {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #fff;
  color: #1c2635;
  font-size: 12.5px;
  line-height: 1.55;
}

.work-refuse-input::placeholder {
  color: #7a8799;
}

.work-refuse button {
  margin-top: 10px;
}

.work-decide-note {
  margin: 11px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: #5f6e83;
}

/* --- o card de Pedido ao cliente (§3.4) -------------------------------------- */
/* `.request-item` e `.request-instruction` já nasceram no topo deste bloco (§5); aqui
   vêm só as peças de dentro. Este arquivo JÁ É DONO de `.request-link`, `.request-date`,
   `.request-empty` e `.request-item-chip` (a lista de pedidos do módulo Documentos), por
   isso toda regra daqui é escopada em `.work-card` (gotcha 20): duas telas, dois
   desenhos, e o empate não se decide por ordem de declaração. */

.work-card .request-open {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid #99f6e4;
  border-radius: 12px;
  background: #f0fdfa;
  color: #0b6665;
}

.work-card .request-open > i {
  font-size: 17px;
}

.work-card .request-open-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.work-card .request-open-title {
  font-size: 12px;
  line-height: 1.55;
  color: #0b6665;
}

.work-card .request-open-link {
  font-size: 11.5px;
  color: #0e7490;
  text-decoration: underline;
  overflow-wrap: anywhere;
}

.work-card .request-form {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.work-card .request-item--outside {
  border-style: dashed;
  background: #fbfcfe;
}

.work-card .request-item-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}

.work-card .request-item-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
  min-width: 0;
  flex: 1 1 auto;
  cursor: pointer;
}

.work-card .request-item-check input {
  margin-top: 3px;
  accent-color: #0ea5a4;
}

.work-card .request-item-label {
  flex: 1 1 auto;
  min-width: 0;
  font-family: "Sora", "Manrope", sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: #1c2635;
}

.work-card .request-item-badge {
  flex: 0 0 auto;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid #e3eaf5;
  background: #f6f9fd;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #3c4a5f;
}

.work-card .request-item--outside .request-item-badge {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.work-card .request-item-why {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.6;
  color: #5f6e83;
}

.work-card .request-instruction-input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 8px 11px;
  border: 1px solid #fdba74;
  border-radius: 9px;
  background: #fff;
  color: #1c2635;
  font-size: 12px;
  line-height: 1.55;
}

.work-card .request-instruction-input::placeholder {
  color: #7a8799;
}

.work-card .request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 3px;
}

.work-card .request-note {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: #5f6e83;
}

.work-card .request-empty {
  margin: 0;
  padding: 12px 14px;
  border: 1px dashed #e3eaf5;
  border-radius: 11px;
  background: #f6f9fd;
  font-size: 12px;
  line-height: 1.6;
  color: #3c4a5f;
}

/* --- Juntada: as peças previstas (§3.2) ------------------------------------ */

.work-card .work-progress {
  flex: 0 0 auto;
  font-family: "Sora", sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: #0b6665;
  font-variant-numeric: tabular-nums;
}

/* Vermelho é estado, não decoração: só quando alguma peça impede o protocolo. */
.work-card .work-progress.is-blocked {
  color: #b91c1c;
}

/* A frase de quem vê o card e não pode acionar o alvo (D-058). Nome próprio
   porque `.work-note` já é a seção "este tipo não tem card próprio" do card
   genérico — dois significados para uma classe é o gotcha 20 de novo. */
.work-card .work-denied {
  margin: 10px 0 0;
  padding: 9px 12px;
  border: 1px dashed #e3eaf5;
  border-radius: 10px;
  background: #f6f9fd;
  font-size: 11.5px;
  line-height: 1.6;
  color: #3c4a5f;
}

.work-card .work-pieces,
.work-card .work-gaps {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.work-card .piece-row-body,
.work-card .gap-row-body {
  flex: 1 1 auto;
  min-width: 0;
}

.work-card .piece-row-title,
.work-card .gap-row-title {
  display: block;
  font-weight: 600;
  color: #1c2635;
  line-height: 1.4;
}

.work-card .piece-row-note,
.work-card .gap-row-note {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.5;
  color: #5f6e83;
}

.work-card .piece-row-file {
  flex: 0 0 auto;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  color: #3c4a5f;
}

.work-card .piece-row-form {
  flex: 0 0 auto;
  margin: 0;
}

.work-card .work-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 13px;
}

.work-card .work-decisive {
  margin: 9px 0 0;
  font-size: 11.5px;
  line-height: 1.65;
  color: #991b1b;
}

/* O lote indisponível continua clicável para não perder o `title` que explica
   por quê; o cursor e a opacidade é que dizem que ele ainda não fecha. */
.work-card .work-actions .btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* --- Documento: o modelo e as lacunas (§3.3) -------------------------------- */

.work-card .work-model {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e3eaf5;
  border-radius: 11px;
  background: #f6f9fd;
}

.work-card .work-model-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #f3e8ff;
  color: #6d28d9;
  font-size: 14px;
}

.work-card .work-model-body {
  flex: 1 1 auto;
  min-width: 0;
}

.work-card .work-model-name {
  display: block;
  font-family: "Sora", sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: #0f1728;
}

.work-card .work-model-note {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.6;
  color: #5f6e83;
}

.work-card .work-model-basis {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 220px;
  padding: 3px 9px;
  border: 1px solid #e3eaf5;
  border-radius: 6px;
  background: #fff;
  font-size: 10.5px;
  line-height: 1.45;
  color: #334155;
  cursor: help;
}

.work-card .work-gaps-title {
  margin: 14px 0 8px;
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #5f6e83;
}

.work-card .work-dependency {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 13px;
  border: 1px solid #fdba74;
  border-radius: 10px;
  background: #fffbf5;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  color: #9a3412;
  text-decoration: none;
}

.work-card .work-dependency:hover {
  background: #fff7ed;
}

.work-card .work-dependency-body {
  flex: 1 1 auto;
  min-width: 0;
}

.work-card .work-generate-note {
  flex: 1 1 200px;
  min-width: 0;
  font-size: 11px;
  line-height: 1.6;
  color: #5f6e83;
}

/* --- outras tarefas da mesma origem (R-14, §4.5) ---------------------------- */
/* Vive no rail, com a moldura da ficha. As linhas são `.work-sibling*` e ficam
   **escopadas** em `.task-siblings` pela mesma razão de `.fact-row` (gotcha 20):
   nome genérico solto neste arquivo é convite para restilizar a tela de outro. */

.task-siblings {
  background: #fff;
  border: 1px solid #e9eff8;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 20px -10px rgba(2, 12, 27, 0.18);
}

.task-siblings-title {
  margin: 0;
  padding: 12px 15px;
  border-bottom: 1px solid #eef3fa;
  font-family: "Sora", sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: #0f1728;
}

.task-siblings-rows {
  display: flex;
  flex-direction: column;
}

.task-siblings .work-sibling {
  display: grid;
  gap: 3px;
  padding: 10px 15px;
  border-bottom: 1px solid #f2f6fc;
  text-decoration: none;
}

.task-siblings .work-sibling:hover {
  background: #f8fbff;
}

/* Sem link (D-058): a linha continua, porque é ela que denuncia a automação
   repetida — só não é clicável, e o responsável ao lado diz a quem falar. */

.task-siblings .work-sibling.is-closed:hover {
  background: transparent;
}

.task-siblings .work-sibling.is-same-type {
  border-left: 3px solid #fdba74;
  padding-left: 12px;
  background: #fffbf5;
}

.task-siblings .work-sibling-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  color: #1c2635;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.task-siblings a.work-sibling-title {
  color: #0b6665;
}

.task-siblings .work-sibling-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 10.5px;
  line-height: 1.5;
  color: #5f6e83;
}

.task-siblings .work-sibling-status {
  font-weight: 700;
  color: #3c4a5f;
}

.task-siblings .work-sibling-assignee {
  overflow-wrap: anywhere;
}

.task-siblings .work-sibling-type {
  overflow-wrap: anywhere;
}

.task-siblings .work-sibling-due {
  font-variant-numeric: tabular-nums;
  color: #3c4a5f;
}

.task-siblings .work-sibling-due.is-empty {
  color: #5f6e83;
  font-style: italic;
}

.task-siblings-note {
  margin: 0;
  padding: 11px 15px;
  background: #f6f9fd;
  font-size: 10.5px;
  line-height: 1.6;
  color: #5f6e83;
}

@media (max-width: 992px) {
  .task-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-hero {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .task-deadline {
    grid-column: 1 / -1;
    text-align: left;
  }

  .work-card .work-tiles {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* === D-073: análise dentro do estúdio ====================================== */
/* A aba Análise do editor e a figura da peça. Prefixos `.studio-analysis-` e `.doc-figure`:
   o `.analysis-*` sem prefixo é da página de análise (gotcha 20). */

.ql-editor img.doc-figure {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 14px auto 4px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  cursor: default;
}

/* O `.studio-page .ql-editor p` justifica todo parágrafo e, mais específico, vencia o
   alinhamento do próprio Quill: o parágrafo centralizado (a legenda da figura; qualquer
   outro) aparecia justificado no editor e centralizado no PDF. Mesma especificidade,
   declarado depois. */
.ql-editor p.ql-align-center {
  text-align: center;
}

.ql-editor p.ql-align-right {
  text-align: right;
}

.studio-analysis {
  display: grid;
  gap: 14px;
  font-size: 12.5px;
}

.studio-analysis-flash {
  margin-bottom: 8px;
  padding: 6px 10px;
  border: 1px solid #99f6e4;
  border-radius: 6px;
  background: #f0fdfa;
  color: #0f766e;
  font-size: 12px;
}

.studio-analysis-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  color: #64748b;
  font-size: 11.5px;
}

.studio-analysis-note {
  padding: 6px 10px;
  border: 1px solid #fde68a;
  border-radius: 6px;
  background: #fffbeb;
  color: #92400e;
  font-size: 11.5px;
}

.studio-analysis-section {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.studio-analysis-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
}

.studio-analysis-count {
  padding: 0 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 10.5px;
  font-weight: 600;
}

.studio-analysis-hint {
  margin: 0;
  color: #64748b;
  font-size: 11.5px;
  line-height: 1.4;
}

.studio-analysis-item {
  min-width: 0;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}

.studio-analysis-item--critico {
  border-left-color: #dc2626;
}

.studio-analysis-item--atencao {
  border-left-color: #d97706;
}

.studio-analysis-item--info {
  border-left-color: #0ea5a4;
}

.studio-analysis-item--reading {
  margin-left: 14px;
  border-style: dashed;
}

.studio-analysis-item--suggested {
  border-left-color: #7c3aed;
  background: #faf5ff;
}

.studio-analysis-reason {
  margin: 6px 0 0;
  color: #334155;
  font-size: 12px;
  line-height: 1.4;
}

.studio-analysis-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.studio-analysis-item-head .btn {
  flex: 0 0 auto;
}

.studio-analysis-item-name {
  min-width: 0;
  font-weight: 600;
  color: #0f172a;
}

.studio-analysis-tags {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.studio-analysis-tag {
  padding: 1px 6px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 10.5px;
}

.studio-analysis-tag--critico {
  background: #fee2e2;
  color: #991b1b;
}

.studio-analysis-tag--atencao {
  background: #fef3c7;
  color: #92400e;
}

.studio-analysis-tag--info {
  background: #ccfbf1;
  color: #0f766e;
}

.studio-analysis-tag--muted {
  color: #64748b;
}

.studio-analysis-preview {
  max-height: 180px;
  margin-top: 6px;
  padding: 6px 8px;
  overflow: auto;
  border-radius: 4px;
  background: #f8fafc;
  font-family: "Times New Roman", Georgia, serif;
  font-size: 0.85rem;
}

.studio-analysis-preview p:last-child,
.studio-analysis-preview ul:last-child,
.studio-analysis-preview blockquote:last-child {
  margin-bottom: 0;
}

.studio-analysis-preview ul {
  padding-left: 18px;
}

.studio-analysis-preview blockquote {
  margin: 0 0 6px;
  padding-left: 8px;
  border-left: 2px solid #cbd5e1;
  font-style: italic;
}

.studio-analysis-chart {
  min-width: 0;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
}

.studio-analysis-chart--empty {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  background: #f8fafc;
  color: #64748b;
}

.studio-analysis-chart-preview {
  display: block;
  width: 100%;
  height: auto;
  min-height: 60px;
  margin-bottom: 6px;
  border-radius: 4px;
  background: #f8fafc;
}

.studio-analysis-figure {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #0ea5a4;
  border-radius: 6px;
  background: #fff;
}

.studio-analysis-figure--desatualizada {
  border-left-color: #d97706;
  background: #fffbeb;
}

.studio-analysis-figure--sem_dados {
  border-left-color: #94a3b8;
  background: #f8fafc;
}

.studio-analysis-figure-text {
  display: grid;
  min-width: 0;
}

.studio-analysis-figure-name {
  font-weight: 600;
  color: #0f172a;
}

.studio-analysis-figure-status {
  color: #64748b;
  font-size: 11px;
}

.studio-analysis-figure--desatualizada .studio-analysis-figure-status {
  color: #92400e;
}

.studio-analysis-actions {
  display: flex;
  gap: 5px;
  flex: 0 0 auto;
}

/* O aviso do editor mora na barra de ferramentas, que é fixa: fica à vista onde quer que
   a pessoa esteja no texto. */
.doc-figure-notice {
  flex-basis: 100%;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-md, 8px);
  background: rgba(245, 158, 11, 0.12);
  color: var(--text-color);
  font-size: 0.8125rem;
  line-height: 1.4;
}

/* === fim D-073 ================================================================ */

/* === Gerar documento (D-0XX) === */

.gen-target-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 6px 14px 6px 6px;
  border: 1px solid var(--border-color-light);
  border-radius: 999px;
  background: var(--card-bg);
}

.gen-target-icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e6f5f5;
  color: #0b6665;
  font-size: 0.92rem;
}

.gen-target-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.gen-target-text strong {
  font-family: "Sora", system-ui, sans-serif;
  font-size: 0.85rem;
  color: #1f2b3a;
}

.gen-target-text span {
  color: #5f6e83;
  font-size: 11px;
}

.gen-target-flag {
  padding: 2px 9px;
  border-radius: 999px;
  background: #fff7ed;
  color: #92400e;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.gen-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
}

.gen-search {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.gen-search i {
  position: absolute;
  left: 11px;
  color: var(--muted-color);
  font-size: 0.85rem;
  pointer-events: none;
}

.gen-search input {
  width: 260px;
  height: 34px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface-color);
  color: var(--default-color);
  font-size: 0.82rem;
}

.gen-search input:focus {
  border-color: var(--accent-color);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.14);
}

.gen-catalog {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tpl-group {
  padding: 16px 18px;
  border: 1px solid var(--border-color-light);
  border-radius: 14px;
  background: var(--card-bg);
}

.tpl-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.tpl-group-headline {
  min-width: 0;
}

.tpl-group-title {
  margin: 0;
  color: #1f2b3a;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
}

.tpl-group-subtitle {
  margin: 2px 0 0;
  color: #5f6e83;
  font-size: 11px;
}

.tpl-group-body {
  display: flex;
  flex-direction: column;
}

.tpl-group-icon,
.tpl-row-icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e6f5f5;
  color: #0b6665;
}

.tpl-group-icon {
  width: 34px;
  height: 34px;
  font-size: 1rem;
}

.tpl-row-icon {
  width: 30px;
  height: 30px;
  font-size: 0.88rem;
}

.tpl-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
}

.tpl-row + .tpl-row {
  border-top: 1px solid var(--border-color-light);
}

.tpl-row-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  gap: 6px;
}

.tpl-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tpl-row-name {
  margin: 0;
  color: #1f2b3a;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
}

.tpl-row-description {
  margin: 0;
  color: #5f6e83;
  font-size: 12px;
  line-height: 1.5;
}

.tpl-usage {
  margin: 0;
  padding: 7px 10px;
  border-radius: 8px;
  background: #f0fdfa;
  color: #0b6665;
  font-size: 11.5px;
  line-height: 1.5;
}

.tpl-usage strong {
  font-weight: 700;
}

.tpl-row-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 2px;
}

.tpl-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 3px 9px;
  overflow: hidden;
  border: 1px solid var(--border-color-light);
  border-radius: 999px;
  background: #f8fafc;
  color: #5f6e83;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tpl-chip i {
  flex: none;
  font-size: 0.78rem;
}

.tpl-row-actions {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 6px;
}

.tpl-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  /* 0.65rem (10.4px em raiz de 16px) ficava um décimo de pixel abaixo do piso
     de 10.5px — justo na variante `--internal`, cujo texto já é #5f6e83, o
     cinza no limite do contraste (Task 16). */
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.tpl-badge--ai {
  border: 1px solid #8b5cf6;
  background: #f3e8ff;
  color: #5b21b6;
}

.tpl-badge--sensitive {
  border: 1px solid #f59e0b;
  background: #fef3c7;
  color: #92400e;
}

.tpl-badge--internal {
  border: 1px solid var(--border-color);
  background: #eef3fa;
  color: #5f6e83;
}

.tpl-badge--urgent {
  border: 1px solid #fca5a5;
  background: #fee2e2;
  color: #b91c1c;
}

.gen-blank-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px dashed var(--border-color);
  border-radius: 14px;
  background: transparent;
  color: inherit;
  text-decoration: none;
}

.gen-blank-card:hover {
  border-color: var(--accent-color);
  color: inherit;
}

.gen-blank-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gen-blank-card-text strong {
  color: #1f2b3a;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 0.86rem;
}

.gen-blank-card-text span {
  color: #5f6e83;
  font-size: 11.5px;
}

@media (max-width: 768px) {
  .tpl-row {
    flex-wrap: wrap;
  }

  .tpl-row-chips {
    grid-template-columns: minmax(0, 1fr);
  }

  .tpl-row-actions {
    flex-direction: row;
    width: 100%;
  }

  .gen-search input {
    width: 100%;
  }
}

/* === Gerar documento — passo 2, o questionário (Task 5) === */

.gen-template-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  margin-left: 8px;
  padding: 5px 12px;
  border: 1px solid var(--border-color-light);
  border-radius: 999px;
  background: var(--card-bg);
  color: #5f6e83;
  font-size: 11px;
}

.gen-template-chip i {
  color: #0b6665;
}

.quest-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 13px 14px;
}

.quest-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.quest-field--4 { grid-column: span 4; }
.quest-field--6 { grid-column: span 6; }
.quest-field--12 { grid-column: span 12; }

.quest-field-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}

.quest-label {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  margin: 0;
  color: #1f2b3a;
  font-size: 0.79rem;
  font-weight: 600;
}

.quest-key {
  flex: none;
  color: #5f6e83;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
}

.quest-badge {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.quest-badge--required {
  background: #fef2f2;
  color: #b91c1c;
}

.quest-badge--source {
  background: #eff6ff;
  color: #1e40af;
}

.quest-help {
  margin: 4px 0 0;
  color: #5f6e83;
  font-size: 0.72rem;
  line-height: 1.45;
}

.quest-field .form-control,
.quest-field .form-select {
  min-height: 42px;
  border-radius: 9px;
}

.quest-field textarea.form-control {
  min-height: 76px;
}

.quest-radio-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quest-radio-card {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border: 1px solid var(--border-color-light);
  border-radius: 11px;
  background: #ffffff;
  color: #1f2b3a;
  font-size: 12.5px;
  cursor: pointer;
}

.quest-radio-card:has(input:checked) {
  border-color: #0ea5a4;
  background: #f0fdfa;
}

.quest-radio-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.quest-suffix-input {
  position: relative;
}

.quest-suffix {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: #5f6e83;
  font-size: 0.82rem;
  font-weight: 600;
}

.quest-suffix-input .form-control {
  padding-right: 34px;
  font-variant-numeric: tabular-nums;
}

.quest-empty {
  padding: 12px 14px;
  border: 1px dashed var(--border-color);
  border-radius: 12px;
  color: #5f6e83;
  font-size: 0.8rem;
  line-height: 1.55;
}

.quest-empty strong {
  color: #1f2b3a;
}

.quest-clauses {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.quest-clause {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1px solid var(--border-color-light);
  border-radius: 999px;
  background: #f8fafc;
  color: #5f6e83;
  font-size: 11px;
}

.quest-clause i {
  color: #0b6665;
  font-size: 0.78rem;
}

.quest-steps {
  margin: 0;
  padding-left: 18px;
  color: #5f6e83;
  font-size: 0.8rem;
  line-height: 1.7;
}

.quest-steps strong {
  color: #1f2b3a;
}

@media (max-width: 768px) {
  .quest-field--4,
  .quest-field--6 {
    grid-column: span 12;
  }
}

/* Task 7: card "Documento em branco" virou um <form>/<button> (POST para
   studio_blank) em vez de <a> — o wrapper some do layout para o botão herdar o
   mesmo lugar de flex item que a âncora tinha, e o botão reseta o estilo nativo. */
.gen-blank-card-wrap {
  display: contents;
}

button.gen-blank-card {
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

/* Task 9: faixa de prontidão do cadastro (D-053, §2.B) — cinco origens, cinco
   correções. Cor por origem: as três da especificação (missing/unbound/config) mais
   duas escolhidas para permanecer acima de 4,5:1 de contraste e distinguíveis das
   outras três (unparsed em roxo, unknown em cinza-ardósia — ambos já usados alhures
   no projeto: kpi-icon-violet e o texto de .review-origin-row). */
.readiness-band {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.readiness-band-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.readiness-band-icon {
  color: #c2410c;
  font-size: 1rem;
  margin-top: 2px;
}

.readiness-band-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: #1f2b3a;
}

.readiness-band-causes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gap-cause-card {
  flex: 1 1 230px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-color-light);
  border-left-width: 3px;
  border-radius: 10px;
  background: #ffffff;
}

.gap-cause-card__count {
  min-width: 28px;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
}

.gap-cause-card__body {
  flex: 1;
  min-width: 0;
}

.gap-cause-card__label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1f2b3a;
}

.gap-cause-card__detail {
  margin: 2px 0 0;
  font-size: 11px;
  color: #5f6e83;
  line-height: 1.4;
}

.gap-cause-card__action {
  flex-shrink: 0;
  align-self: center;
}

.gap-cause-card__action--info {
  font-size: 11px;
  font-weight: 600;
  color: #5f6e83;
  white-space: nowrap;
}

.gap-cause-card--missing { border-left-color: #dc2626; }
.gap-cause-card--missing .gap-cause-card__count { color: #dc2626; }

.gap-cause-card--unbound { border-left-color: #1d4ed8; }
.gap-cause-card--unbound .gap-cause-card__count { color: #1d4ed8; }

.gap-cause-card--config { border-left-color: #c2410c; }
.gap-cause-card--config .gap-cause-card__count { color: #c2410c; }

.gap-cause-card--unparsed { border-left-color: #6d28d9; }
.gap-cause-card--unparsed .gap-cause-card__count { color: #6d28d9; }

.gap-cause-card--unknown { border-left-color: #475569; }
.gap-cause-card--unknown .gap-cause-card__count { color: #475569; }

.readiness-band-ok {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #15803d;
}

/* Task 10: painel de contexto do cadastro (D-049, §2.E) — "o que o sistema já
   sabe", em grupos por namespace. Chave técnica só no cabeçalho do grupo e no
   `title` de cada linha (critério 24); cor por estado reaproveita a da faixa de
   prontidão (missing/config) e a do painel de variáveis do editor (partial), mais
   um teal calmo para `notyet` — informativo, não é um alerta. */
.ctx-group + .ctx-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color-light);
}

.ctx-group-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1f2b3a;
}

.ctx-group-key {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 400;
  color: #5f6e83;
}

.ctx-group-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: #5f6e83;
}

.ctx-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ctx-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 6px 10px;
  border: 1px solid var(--border-color-light);
  border-left-width: 3px;
  border-radius: 8px;
}

.ctx-row-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1f2b3a;
}

.ctx-row-value {
  font-size: 0.8rem;
  color: #33465e;
}

.ctx-row-note {
  font-size: 11px;
  color: #5f6e83;
}

.ctx-row-action {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  color: #0e7490;
  text-decoration: none;
}

.ctx-row-action:hover {
  text-decoration: underline;
}

.ctx-row-action--info {
  color: #5f6e83;
}

.ctx-row--ok { border-left-color: #15803d; }
.ctx-row--missing { border-left-color: #dc2626; }
.ctx-row--config { border-left-color: #c2410c; }
.ctx-row--partial { border-left-color: #f59e0b; }
.ctx-row--notyet { border-left-color: #0ea5a4; }

/* Task 11 (D-035, §2.H): a conferência do editor rodando um passo antes, sobre a
   peça que ainda não existe — card âmbar em `generate_step2.html`, antes do botão
   de gerar. Cores reaproveitam a paleta de `.ctx-row`/`.gap-cause-card` (mesmo
   crítico/atenção/ok em toda a tela de geração). */
.precheck-card {
  border: 1px solid var(--border-color-light, #eef3fa);
  border-left: 3px solid #c2410c;
  border-radius: var(--radius-md, 0.5rem);
  background: #fffbeb;
  padding: 12px 14px;
}

.precheck-card--ok {
  border-left-color: #15803d;
  background: #f0fdf4;
}

.precheck-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.precheck-head-icon {
  color: #92400e;
  font-size: 0.95rem;
}

.precheck-card--ok .precheck-head-icon {
  color: #15803d;
}

.precheck-head-title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1f2b3a;
}

.precheck-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.precheck-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border-color-light, #eef3fa);
  border-left-width: 3px;
  border-radius: 8px;
  background: var(--card-bg, #ffffff);
}

.precheck-row-icon {
  margin-top: 2px;
  font-size: 0.85rem;
}

.precheck-row-body {
  flex: 1;
  min-width: 0;
}

.precheck-row-title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1f2b3a;
}

.precheck-row-note {
  margin: 2px 0 0;
  font-size: 11px;
  color: #5f6e83;
  line-height: 1.4;
}

.precheck-row-action {
  flex-shrink: 0;
  align-self: center;
  font-size: 11px;
  white-space: nowrap;
}

.precheck-row-action--info {
  font-weight: 600;
  color: #5f6e83;
}

.precheck-row--critico { border-left-color: #dc2626; }
.precheck-row--critico .precheck-row-icon { color: #dc2626; }

.precheck-row--atencao { border-left-color: #c2410c; }
.precheck-row--atencao .precheck-row-icon { color: #c2410c; }

.precheck-row--ok { border-left-color: #15803d; }
.precheck-row--ok .precheck-row-icon { color: #15803d; }

.precheck-empty {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 0.8rem;
  color: #15803d;
}

.precheck-footer {
  margin: 8px 0 0;
  font-size: 10.5px;
  color: #5f6e83;
}

/* §4.2 (Task 12): modelo do catálogo sem o dado que citaria — card continua
   visível (não é erro, é um estado do alvo), só a ação de gerar é que sai. */
.tpl-row--unavailable .tpl-row-icon {
  background: #eef1f5;
  color: #5f6e83;
}

.tpl-unavailable-reason {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: #5f6e83;
  font-size: 11.5px;
  line-height: 1.4;
}

/* Task 13 (§2.C): "Faz sentido agora, neste caso" — até 4 modelos na sequência
   processual (proteger, formalizar, poderes, prova), nunca alfabética. */
.suggest-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.suggest-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.suggest-panel-icon {
  color: #1d4ed8;
  font-size: 1rem;
}

.suggest-panel-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: #1f2b3a;
}

.suggest-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.suggest-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-color-light);
  border-left-width: 3px;
  border-left-color: #1d4ed8;
  border-radius: 10px;
  background: #ffffff;
}

.suggest-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid #1d4ed8;
  background: #eef3fa;
  color: #1d4ed8;
}

.suggest-card-body {
  flex: 1 1 auto;
  min-width: 0;
}

.suggest-card-name {
  margin: 0 0 2px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1f2b3a;
}

.suggest-card-reason {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: #5f6e83;
}

.suggest-card-action {
  flex: 0 0 auto;
  align-self: center;
  white-space: nowrap;
}

/* Task 14 (D-053, §2.I): pré-visualização somente leitura da peça — a folha real
   com os valores de agora, cada lacuna colorida pela causa (mesmas cores de
   `.doc-gap--*`, o editor de verdade) e o trecho da IA como bloco à parte. Nada
   aqui é clicável: ao contrário de `.doc-gap`, é ensaio, não edição. */

.doc-preview-sheet {
  position: relative;
  max-height: 420px;
  overflow: hidden;
  padding: 28px 32px;
  background: #fffdf9;
  border: 1px solid var(--border-color, #dde5f1);
  border-radius: 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.7;
  color: #1f2b3a;
}

.doc-preview-sheet h1 {
  margin: 0 0 16px;
  font-size: 15px;
  text-align: center;
}

.doc-preview-sheet h2 {
  margin: 18px 0 8px;
  font-size: 13.5px;
}

.doc-preview-sheet p {
  margin: 0 0 10px;
}

.doc-preview-sheet-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72px;
  background: linear-gradient(to bottom, rgba(255, 253, 249, 0), #fffdf9);
  pointer-events: none;
}

.doc-preview-gap {
  display: inline;
  padding: 0 3px;
  border-radius: 3px;
  /* Manrope no meio do Georgia: a lacuna não pode parecer texto do contrato —
     mesma razão de `.doc-gap` no editor de verdade. */
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  line-height: inherit;
  cursor: default;
}

.doc-preview-gap--missing { background: #fef2f2; border-bottom: 2px solid #dc2626; color: #b91c1c; }
.doc-preview-gap--config { background: #fff7ed; border-bottom: 2px solid #c2410c; color: #9a3412; }

.doc-preview-ai {
  margin: 12px 0;
  padding: 10px 12px;
  background: #fefce8;
  border-left: 3px solid #eab308;
  border-radius: 0 5px 5px 0;
  font-family: "Manrope", system-ui, sans-serif;
}

.doc-preview-ai-label {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #a16207;
}

.doc-preview-ai-instruction {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #5f6e83;
}

.doc-preview-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
}

.doc-preview-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #5f6e83;
}

.doc-preview-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.doc-preview-legend-swatch--missing { background: #dc2626; }
.doc-preview-legend-swatch--unbound { background: #1d4ed8; }
.doc-preview-legend-swatch--config { background: #c2410c; }
.doc-preview-legend-swatch--unparsed { background: #6d28d9; }
.doc-preview-legend-swatch--unknown { background: #475569; }
.doc-preview-legend-swatch--ai { background: #eab308; }

/* Task 15 (§2.F): "Já gerados neste caso" — o que já existe para este alvo,
   antes de gerar mais um. Mesma família de card/linha de `.precheck-*`. */
.gen-generated-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gen-generated-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border-color-light, #eef3fa);
  border-left-width: 3px;
  border-left-color: #94a3b8;
  border-radius: 8px;
  background: var(--card-bg, #ffffff);
}

.gen-generated-row--danger {
  border-left-color: #dc2626;
  background: #fef2f2;
}

.gen-generated-icon {
  margin-top: 2px;
  font-size: 0.85rem;
  color: #5f6e83;
}

.gen-generated-row--danger .gen-generated-icon {
  color: #dc2626;
}

.gen-generated-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.gen-generated-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1f2b3a;
  text-decoration: none;
}

.gen-generated-title:hover {
  text-decoration: underline;
}

.gen-generated-meta {
  margin: 2px 0 0;
  font-size: 11px;
  color: #5f6e83;
  line-height: 1.4;
}

/* Pedido de documento na triagem (D-060) — o cartão que diz ONDE achar o arquivo.
   O cartão de envio já existia; faltava a instrução, e é ela que faz a diferença
   entre a pessoa achar o extrato e desistir. */
.intake-ask-title {
  font-family: var(--heading-font);
  font-size: 15px;
  font-weight: 700;
  color: #0b6665;
  margin: 0 0 6px;
}

.intake-ask-how {
  font-size: 15px;
  line-height: 1.6;
  color: #3c4a5f;
  margin: 0 0 4px;
}

.intake-ask-formats {
  font-size: 14px;
  color: #5f6e83;
  margin: 0 0 10px;
}

/* Cartão de saúde da triagem (D-060) — a frase que abre o bloco e a saída fácil.
   A pessoa está prestes a falar de doença para um site: ela precisa saber por
   que isso ajuda o caso dela, e ver que recusar é uma opção como outra qualquer. */
.intake-health-intro {
  font-size: 15px;
  line-height: 1.6;
  color: #155e5d;
  background: #f0fdfa;
  border: 1px solid #d6f2f1;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 12px;
}

/* Recusar não é a escolha "errada": marcada, ela fica sóbria em vez de teal. */
.intake-chip.intake-chip-quiet.selected {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

/* Encerramento com orientação (D-061) — a recusa entrega três caminhos reais.
   Quem sai da conversa tendo sido ajudado indica o escritório; quem sai
   recusado, não. */
.intake-guidance-paths {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
}

.intake-guidance-paths li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 15px;
  line-height: 1.6;
  color: #3c4a5f;
}

.intake-guidance-paths i {
  color: #0b6665;
  margin-top: 3px;
  flex-shrink: 0;
}

.intake-guidance-door {
  font-size: 14.5px;
  line-height: 1.6;
  color: #155e5d;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid #d6f2f1;
}

/* Cartão de campos tocáveis da triagem (D-062). O contador, a barra e o rodapé
   de pendências derivam todos da mesma lista de campos — no protótipo o único
   defeito foi um rodapé dizendo "só falta 1" com dois pendentes na tela. */
.chat-fieldset__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.chat-fieldset__count {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0b6665;
}

.chat-fieldset__progress {
  flex: 0 0 72px;
  height: 6px;
  border-radius: 99px;
  background: #e2e8f0;
  overflow: hidden;
}

.chat-fieldset__bar {
  display: block;
  height: 100%;
  background: #0b8f8e;
  transition: width 0.18s ease;
}

.chat-field legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-field__multi {
  font-size: 13px;
  font-weight: 600;
  color: #5f6e83;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 1px 9px;
}

.chat-field__done {
  color: #0b8f8e;
  margin-left: auto;
}

.chat-field-help {
  font-size: 13.5px;
  line-height: 1.55;
  color: #5f6e83;
  margin: 8px 0 0;
}

/* A pergunta do empréstimo é a com maior chance de resposta envergonhada: a nota
   diz por que responder ajuda a própria pessoa, e por isso não é cinza de rodapé. */
.chat-field-help--teal {
  color: #0b6665;
  font-weight: 600;
}

/* Alvo de toque real: 27px de altura visual não é um alvo de 44px. */
.intake-chip.chat-chip {
  min-height: 44px;
}

.intake-chip.chat-chip--blank.selected {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

.intake-field-other {
  margin-top: 8px;
  font-size: 15px;
}

.chat-fieldset__footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #5f6e83;
  margin-top: 4px;
}

/* Cartão "o que eu entendi" (D-062) — violeta para não se confundir com o
   cartão de campos, que é teal. Um é coletar, o outro é conferir. */
.chat-confirm {
  border: 1.5px solid #ddd6fe;
  background: #faf7ff;
}

.chat-confirm__headline {
  font-size: 15px;
  font-weight: 700;
  color: #4c1d95;
  margin: 0 0 12px;
}

.chat-confirm-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #e9e3fb;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #ffffff;
}

.chat-confirm-row--check {
  background: #fffbf5;
  border-color: #fed7aa;
}

.chat-confirm-row--ok i {
  color: #0b8f8e;
}

.chat-confirm-row--check i {
  color: #c2410c;
}

.chat-confirm-row__body {
  flex: 1;
  min-width: 0;
}

.chat-confirm-row__label {
  display: block;
  font-size: 13px;
  color: #5f6e83;
}

.chat-confirm-row__value {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #1c2635;
}

.chat-confirm-row--check .chat-confirm-row__value {
  color: #78350f;
}

.chat-confirm-row__ask {
  display: block;
  font-size: 14px;
  line-height: 1.55;
  color: #9a3412;
  margin-top: 4px;
}

.chat-confirm-row__fix {
  flex-shrink: 0;
  min-height: 44px;
}

/* === Arquivos do caso (GED) === */

.ged-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 991px) {
  .ged-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.file-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--body-color, #1c2635);
}

.file-group-header i {
  color: var(--muted-color);
}

.file-group-count {
  margin-left: auto;
  color: var(--muted-color);
  font-weight: 500;
}

/* Galeria de cartões (Task 2). A lista era uma linha por arquivo com o TEXTO
   INTEIRO de cada alerta despejado embaixo do nome -- três parágrafos para o
   mesmo arquivo quando havia três alertas. Aqui cada arquivo é um cartão, e o
   problema mais grave vira uma tarja de uma linha sobre a miniatura (o texto
   completo fica no `title`). Prefixo `ged-` porque o `main.css` do FlexAdmin já
   é dono dos nomes óbvios (gotcha 20). */
.ged-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 13px;
}

/* Sem `overflow: hidden` aqui: os dois menus do rodapé (categoria e "⋯") são
   dropdowns do Bootstrap posicionados DENTRO do cartão, e recortá-los deixaria
   as ações inalcançáveis. Quem recorta é `.ged-card-thumb`, que é o único que
   precisa (a miniatura sangra até a borda). */
.ged-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border-color, #e3e9f2);
  border-radius: var(--radius-md);
  background: #fff;
}

.ged-card--warn {
  border-color: #fdba74;
}

.ged-card--critical {
  border-color: #fca5a5;
}

.ged-card-thumb {
  position: relative;
  height: 104px;
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--border-color-light, #eef3fa);
}

.ged-card-open {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #5a6b80;
  font-size: 1.9rem;
  text-decoration: none;
}

.ged-card-open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Acima da miniatura, que é um link: sem `z-index` o clique na caixa abriria o
   arquivo em vez de selecioná-lo. */
.ged-card-check {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  background: #fff;
}

.ged-card-sensitive {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f3e8ff;
  border: 1px solid #ddd6fe;
  color: #5b21b6;
  font-size: 0.75rem;
  line-height: 1.5;
}

/* Uma linha, sempre: o resto do alerta está no `title`. */
.ged-card-strip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px 8px;
  color: #fff;
  font-size: 0.74rem;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ged-card-strip--critical {
  background: rgba(185, 28, 28, 0.88);
}

/* Mais escuro que o âmbar do plano (`rgba(194,65,12,.88)`): sobre miniatura
   clara aquele deixava o texto branco em 4,33:1, abaixo do mínimo de 4,5:1
   desta tela. Este dá 6,2:1 no pior caso (fundo branco) e escurece junto com a
   imagem. */
.ged-card-strip--warn {
  background: rgba(154, 52, 18, 0.92);
}

.ged-card-strip--muted {
  background: rgba(71, 85, 105, 0.85);
}

.ged-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  min-width: 0;
  flex: 1 1 auto;
}

/* Mono porque o que distingue dois arquivos do mesmo caso costuma ser o número
   no fim do nome (`extrato-08.pdf` x `extrato-09.pdf`). */
.ged-card-name {
  font-family: var(--font-mono, ui-monospace, "SFMono-Regular", Menlo, monospace);
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--body-color, #1c2635);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ged-card-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ged-card-cat {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
}

.ged-card-cat--ok {
  background: #e6f5f5;
  border: 1px solid #b8e3e2;
  color: #0b6665;
}

.ged-card-cat--bad {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.ged-card-size,
.ged-card-meta,
.ged-card-desc {
  font-size: 0.72rem;
  color: #5a6b80;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ged-card-analysis {
  text-decoration: none;
}

/* `flex-wrap` e botão que não encolhe (D-072): com o botão PDF são cinco ícones, e
   somados à correção nomeada ("Corrigir p/ Comprovante") passam da largura do cartão.
   Sem isto os dois primeiros — que são `<a>`, soltos na faixa — encolhiam para 15px e
   viravam um borrão; a correção é que desce para a linha de baixo. */
.ged-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-top: 1px solid var(--border-color-light, #eef3fa);
}

.ged-card-btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border: 1px solid var(--border-color, #e3e9f2);
  border-radius: var(--radius-sm, 6px);
  background: #fff;
  color: #3c4a5f;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
}

.ged-card-btn:hover {
  background: var(--border-color-light, #eef3fa);
  color: #1c2635;
}

.ged-card-cat-menu {
  min-width: 11rem;
  padding: 8px;
}

/* A correção nomeada fica à direita, longe dos quatro ícones: ela é a única
   ação do cartão que muda o arquivo sem confirmação de formulário. */
.ged-card-action,
.ged-card-action-form {
  margin-left: auto;
}

.ged-card-action {
  border: 1px solid #b8e3e2;
  border-radius: var(--radius-sm, 6px);
  background: #e6f5f5;
  color: #0b6665;
  padding: 2px 9px;
  font-size: 0.73rem;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.ged-card-action:hover {
  background: #d3ecec;
  color: #084a49;
}

.ged-gallery-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ged-gallery-hint {
  font-size: 0.75rem;
  color: #5a6b80;
}

/* Modo lista: o MESMO cartão vira linha -- nunca um segundo HTML por arquivo. */
.ged-gallery--list {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.ged-gallery--list .ged-card {
  flex-direction: row;
  align-items: stretch;
}

/* Altura FIXA, não `auto`: a miniatura é `height: 100%` e, num pai de altura
   automática, isso vira o tamanho natural da imagem -- um print de 3000px
   empurrando a linha inteira. */
.ged-gallery--list .ged-card-thumb {
  flex: 0 0 auto;
  width: 92px;
  height: 62px;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.ged-gallery--list .ged-card-open {
  font-size: 1.3rem;
}

.ged-gallery--list .ged-card-body {
  justify-content: center;
}

.ged-gallery--list .ged-card-foot {
  border-top: none;
  border-left: 1px solid var(--border-color-light, #eef3fa);
}

/* Barra de ações em lote (Task 8: recategorizar várias linhas de uma vez).
   `x-show="selectedCount > 0"` (Task 15a, `gedList()` em `_ged_list.html`) é
   quem decide se ela aparece -- nada aqui depende de `display` para isso, por
   isso o Alpine consegue esconder de verdade (gotcha 4: só um `!important`
   externo venceria `x-show`, e este bloco não tem nenhum). */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: var(--border-color-light, #eef3fa);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* As quatro ações do lote (Task 3). Prefixo `ged-` e não `.bulk-btn`: o
   `main.css` do FlexAdmin é dono dos nomes óbvios (gotcha 20). Botão e não
   link porque cada um envia o MESMO formulário com um `action` diferente --
   é o `<button name="action" value="...">` que carrega a escolha. */
.ged-bulk-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--border-color, #e3e9f2);
  border-radius: var(--radius-sm, 6px);
  background: #fff;
  color: var(--body-color, #1c2635);
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
}

.ged-bulk-btn:hover {
  border-color: #b9c6d8;
  background: #f7fafd;
}

/* Excluir é destrutiva na leitura do usuário (o arquivo some da tela), e a
   cor precisa dizer isso antes do `confirm`. */
.ged-bulk-btn--danger {
  color: #b42318;
  border-color: #f3c7c2;
}

.ged-bulk-btn--danger:hover {
  color: #8f1d13;
  border-color: #e0a59e;
  background: #fef4f3;
}

/* Caminhos gratuitos abríveis (D-061). Quem lê isto acabou de ouvir que a ação
   não compensa: a dica só ajuda se disser COMO fazer e levar até a porta certa. */
.intake-path summary {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 44px;
  padding: 6px 0;
  cursor: pointer;
  list-style: none;
  font-size: 15px;
  line-height: 1.6;
  color: #3c4a5f;
}

.intake-path summary::-webkit-details-marker {
  display: none;
}

.intake-path summary > i:first-child {
  color: #0b6665;
  margin-top: 4px;
  flex-shrink: 0;
}

.intake-path summary > span {
  flex: 1;
  min-width: 0;
}

.intake-path__chevron {
  color: #7c8ea3;
  margin-top: 5px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.intake-path[open] .intake-path__chevron {
  transform: rotate(180deg);
}

.intake-path__how {
  font-size: 14.5px;
  line-height: 1.65;
  color: #155e5d;
  margin: 2px 0 10px 26px;
}

.intake-path__cta {
  margin-left: 26px;
  min-height: 44px;
  text-decoration: none;
}

/* O nome do órgão é o que separa o site oficial de um que o imita — e quem lê
   esta tela é exatamente quem já foi enganado uma vez. */
.intake-path__source {
  font-size: 13px;
  color: #7c8ea3;
  margin: 8px 0 0 26px;
}

/* Envio em lote do GED (Task 12): a fila de arquivos escolhidos, cada um com
   categoria/descrição/sensibilidade próprias. Reaproveita `.dropzone` e
   `.dropzone-files` já existentes -- não redefinidos aqui. */
.ged-upload-summary {
  font-weight: 600;
}

.ged-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border-color, #e3e9f2);
}

.ged-upload-row--over {
  background: rgba(220, 53, 69, 0.06);
}

.ged-upload-row-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 220px;
  min-width: 0;
}

.ged-upload-row-name span:first-of-type {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ged-upload-row-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 2 1 320px;
}

.ged-upload-row-fields select,
.ged-upload-row-fields input[type="text"] {
  flex: 1 1 140px;
  min-width: 0;
}

.ged-upload-suggestion {
  font-size: 12px;
  color: var(--muted-color);
  flex-basis: 100%;
}

.ged-upload-remove {
  margin-left: auto;
  border: none;
  padding: 2px 6px;
  color: var(--muted-color);
}

/* Task 4: nota fixa sobre a extração automática de extratos -- contexto, não
   alerta (sem âmbar do card "Antes de enviar" acima). */
.ged-upload-note {
  color: var(--muted-color);
}

/* Card "Antes de enviar" (revisão da Task 12): âmbar quando há duplicata ou
   pendência, neutro quando a fila está limpa. */
.ged-upload-precheck {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 193, 7, 0.12);
  border: 1px solid rgba(255, 193, 7, 0.35);
}

.ged-upload-precheck--clear {
  background: rgba(25, 135, 84, 0.08);
  border-color: rgba(25, 135, 84, 0.3);
}

.ged-upload-precheck ul {
  padding-left: 20px;
  font-size: 13px;
}

/* Task 13/9 (D-7): painel "Quem acessou" -- equipe, automação e cliente nunca
   podem ler como o mesmo tipo de ator. A cor é o primeiro sinal (teal, cinza,
   violeta) e o selo é o segundo, para quem não distingue as três. */
.ged-log-item {
  /* `d-flex` do Bootstrap traz `display:!important` e venceria o `x-show` das
     linhas escondidas (gotcha 4) -- aqui o flex é da classe do bloco. */
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.ged-log-note {
  color: #5f6e83;
  font-size: 0.75rem;
}

.ged-log-icon {
  margin-top: 2px;
}

.ged-log-icon--team,
.ged-log-who--team {
  color: #0f766e;
}

.ged-log-icon--automation,
.ged-log-who--automation {
  color: #475569;
}

.ged-log-icon--client,
.ged-log-who--client {
  color: #6d28d9;
}

.ged-log-who {
  font-weight: 600;
}

.ged-log-what {
  color: #475569;
  font-size: 0.78rem;
  line-height: 1.4;
}

.ged-log-empty,
.ged-log-help {
  color: #5f6e83;
  font-size: 0.72rem;
  line-height: 1.45;
}

/* O selo diz o que a cor sozinha não prova; a frase inteira fica no `title`. */
.ged-log-seal {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  cursor: help;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: lowercase;
  vertical-align: middle;
}

.ged-log-seal--automation {
  background: #e2e8f0;
  color: #334155;
}

.ged-log-seal--client {
  background: #ede9fe;
  color: #5b21b6;
}

.ged-log-foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.ged-log-more {
  padding: 0;
  border: 0;
  background: none;
  color: #0f766e;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Critério 32: o que o portão de sensível tirou da galeria, dito na galeria. */
.ged-hidden-note {
  margin-bottom: 12px;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  background: #f1f5f9;
  color: #334155;
  font-size: 0.78rem;
}

/* Task 6: o cartão "A prova da tese". O vocabulário `.evidence-*` (logo acima,
   seção "Prova") continua sendo o da tela do lead (`crm/_lead_evidence.html`),
   que segue com a lista plana de cinco estados -- aqui a prova é agrupada por
   ESTADO, e misturar os dois faria uma mudança de cor numa tela mexer na outra.

   A cor de cada grupo vem de `ged_page.EVIDENCE_GROUP_SPECS` e chega inline em
   `--ged-ev-colour`; o fundo, a borda e os quatro segmentos da barra estão
   aqui. Mudou a cor lá, muda aqui. */
.ged-ev-bar {
  display: flex;
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #eef2f8;
}

.ged-ev-seg {
  width: var(--seg, 0);
}

.ged-ev-seg--temos,
.ged-ev-legend-dot--temos {
  background: #15803d;
}

.ged-ev-seg--conferir,
.ged-ev-legend-dot--conferir {
  background: #92400e;
}

.ged-ev-seg--prometido,
.ged-ev-legend-dot--prometido {
  background: #c2410c;
}

.ged-ev-seg--falta,
.ged-ev-legend-dot--falta {
  background: #b91c1c;
}

.ged-ev-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 15px;
  margin: 9px 0 14px;
  padding: 0;
  color: #5f6e83;
  font-size: 0.74rem;
  list-style: none;
}

.ged-ev-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ged-ev-legend b {
  color: #1f2b3a;
  font-variant-numeric: tabular-nums;
}

.ged-ev-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.ged-ev-group {
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid;
  border-radius: var(--radius-md);
}

.ged-ev-group--falta {
  border-color: #fecaca;
  background: #fef2f2;
}

.ged-ev-group--prometido {
  border-color: #fed7aa;
  background: #fff7ed;
}

.ged-ev-group--conferir {
  border-color: #fde68a;
  background: #fffbeb;
}

.ged-ev-group--temos {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.ged-ev-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 9px 14px;
  font-size: 0.8rem;
}

.ged-ev-group-label {
  color: var(--ged-ev-colour);
  font-weight: 700;
}

.ged-ev-group-count {
  padding: 1px 9px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ged-ev-colour);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.ged-ev-group-criterion {
  color: #5f6e83;
  font-size: 0.73rem;
  font-weight: 400;
}

/* `border-color: inherit` pega a cor da faixa: a linha divide o grupo sem
   precisar de um quinto par de cores só para a régua. */
.ged-ev-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px 14px;
  border-top: 1px solid;
  border-color: inherit;
}

.ged-ev-icon {
  color: var(--ged-ev-colour);
  font-size: 0.92rem;
  line-height: 1.5;
}

.ged-ev-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ged-ev-name {
  color: #1f2b3a;
  font-size: 0.83rem;
  font-weight: 600;
}

.ged-ev-seal {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 700;
  white-space: nowrap;
}

.ged-ev-seal--essential {
  background: #fee2e2;
  color: #991b1b;
}

.ged-ev-seal--doubtful {
  background: #fef3c7;
  color: #92400e;
}

.ged-ev-why {
  color: #5f6e83;
  font-size: 0.74rem;
  line-height: 1.45;
}

.ged-ev-file {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: #0f766e;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.71rem;
}

.ged-ev-file i {
  color: var(--ged-ev-colour);
}

.ged-ev-file-name {
  overflow: hidden;
  max-width: 230px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ged-ev-file--warn {
  color: #92400e;
}

.ged-ev-file-warn {
  font-weight: 700;
}

.ged-ev-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ged-ev-actions form {
  margin: 0;
}

.ged-ev-action {
  display: block;
  width: 100%;
  padding: 5px 11px;
  border: 1px solid #dde4ed;
  border-radius: 9px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.ged-ev-action:hover {
  border-color: #c3cedd;
  color: #1f2b3a;
}

.ged-ev-note {
  color: #5f6e83;
  font-size: 0.74rem;
  line-height: 1.5;
}

@media (max-width: 575px) {
  .ged-ev-row {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .ged-ev-actions {
    grid-column: 2;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .ged-ev-action {
    width: auto;
  }
}

/* "Pedir outro documento" (Task 8): chips de sugestão e o formulário do item */
/* livre. `ged-req-` e não `request-` -- `.request-bar`/`.request-item-chip`/ */
/* `.request-count` já são o vocabulário do cartão de progresso acima, e as */
/* duas coisas não compartilham forma nenhuma. */

.ged-req-note {
  color: #5f6e83;
  font-size: 0.78rem;
  line-height: 1.5;
}

.ged-req-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ged-req-chip {
  padding: 4px 11px;
  border: 1px solid #dde4ed;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.ged-req-chip:hover {
  border-color: #c3cedd;
  background: #f4f7fb;
  color: #1f2b3a;
}

/* Âmbar, o mesmo de `.ged-ev-seal--doubtful`: o chip que traz dado de saúde */
/* já marca a caixa "contém dado sensível", e a cor é o aviso de que ele faz */
/* isso antes de o advogado procurar a caixa. */
.ged-req-chip--sensitive {
  border-color: #fcd34d;
  background: #fef3c7;
  color: #92400e;
}

.ged-req-chip--sensitive:hover {
  border-color: #f0b429;
  background: #fde9a9;
  color: #7c3a06;
}

.ged-req-help {
  color: #5f6e83;
  font-size: 0.72rem;
  line-height: 1.45;
}

/* O selo do "como conseguir": a consequência de deixá-lo em branco fica no */
/* `title`, porque é uma frase inteira e o selo tem de caber ao lado do rótulo. */
.ged-req-seal {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  cursor: help;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: lowercase;
  vertical-align: middle;
}

/* `minmax(0, 1fr)` e não `1fr`: o `<select>` de categoria carrega o rótulo */
/* mais longo do catálogo e esticaria a própria coluna (gotcha 20). */
.ged-req-pair {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

@media (max-width: 575px) {
  .ged-req-pair {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- D-072: exportar em PDF ---------------------------------------------- */
/* Prefixo ged-pdf-: nada com esse nome nasce no main.css do FlexAdmin (gotcha 20). */

/* O botão PDF é um formulário (POST), e precisa ocupar a faixa de ações do cartão
   como os links vizinhos: sem margem e sem quebrar a linha. */
.ged-pdf-form {
  display: inline-flex;
  margin: 0;
}

/* A frase da barra de seleção quando há peça do estúdio marcada. */
.ged-pdf-note {
  flex-basis: 100%;
  font-size: 12px;
  color: #5a6b80;
}

/* O diálogo do PDF único. Fundo com classe própria e sem !important: é o x-show do
   Alpine que o esconde (gotcha 4). */
.ged-pdf-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
}

.ged-pdf-dialog {
  width: 560px;
  max-width: 100%;
  max-height: 92vh;
  margin: 0;
  overflow: auto;
}

.ged-pdf-lead {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #3c4a5f;
}

/* A lista rola sozinha: com trinta prints selecionados o nome e a categoria
   continuam à vista, sem rolar o diálogo inteiro. */
.ged-pdf-items {
  display: grid;
  gap: 6px;
  max-height: 38vh;
  margin: 0 0 12px;
  padding: 0;
  overflow: auto;
  list-style: none;
}

/* minmax(0, 1fr) e não 1fr: o nome comprido de um arquivo esticaria a coluna e
   empurraria os três botões para fora (gotcha 20). */
.ged-pdf-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--border-color, #e3e9f2);
  border-radius: var(--radius-sm, 6px);
  background: #fff;
}

.ged-pdf-item-order {
  font-size: 12px;
  font-weight: 600;
  color: #5a6b80;
  text-align: center;
}

.ged-pdf-item-name {
  overflow: hidden;
  font-size: 13px;
  color: #1c2635;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ged-pdf-item .ged-card-btn:disabled {
  cursor: default;
  opacity: 0.4;
}

.ged-pdf-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 10px;
}

.ged-pdf-fields label {
  display: grid;
  gap: 4px;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #3c4a5f;
}

.ged-pdf-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 575px) {
  .ged-pdf-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* === Portal do cliente (tela interna) ===================================== */
/* Prefixo `portal-` porque `main.css` do FlexAdmin já é dono dos nomes óbvios */
/* (`.card-*`, `.kanban-*`, `.calendar-*`, `.task-*`) e nenhum `portal-` nasce lá. */

.portal-two {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.portal-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.portal-subtitle {
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--muted-color, #5f6e83);
}

.portal-note {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--default-color);
}

.portal-hint {
  font-size: 15px;
  color: var(--muted-color, #5f6e83);
}

.portal-group {
  padding-top: 10px;
  border-top: 1px solid var(--border-color, #dde5f1);
}

.portal-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.portal-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--heading-color);
}

.portal-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 4px;
  padding: 10px 0;
  border-top: 1px dashed var(--border-color, #dde5f1);
}

.portal-group-title + .portal-item {
  border-top: 0;
}

.portal-item--locked {
  opacity: 0.85;
}

/* 38x22 — alvo de toque confortável; o switch do Bootstrap nasce menor. */
.portal-switch {
  padding-left: 0;
  min-height: 22px;
}

.portal-switch .form-check-input {
  width: 38px;
  height: 22px;
  margin: 0;
  cursor: pointer;
}

.portal-switch .form-check-input:disabled {
  cursor: not-allowed;
}

.portal-item-text {
  min-width: 0;
}

.portal-item-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--heading-color);
  cursor: pointer;
}

.portal-item-desc {
  margin: 2px 0 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--muted-color, #5f6e83);
}

.portal-badge {
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--border-color-light, #eef3fa);
  color: var(--muted-color, #5f6e83);
}

.portal-badge--padrao_ligado {
  background: var(--info-color-light, #e0f2fe);
  color: #0b5d82;
}

.portal-badge--recomendado {
  background: var(--success-color-light, #dcfce7);
  color: #14603a;
}

.portal-badge--cuidado {
  background: var(--warning-color-light, #ffedd5);
  color: #9a4a06;
}

.portal-badge--auto {
  background: var(--border-color-light, #eef3fa);
  color: #41526b;
}

.portal-warning {
  display: flex;
  gap: 6px;
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 1.45;
  color: #7a4708;
}

.portal-warning i {
  flex: none;
  margin-top: 3px;
}

.portal-warning--strong {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--warning-color, #d97706);
  background: var(--warning-color-light, #ffedd5);
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.portal-reset {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color, #dde5f1);
}

.portal-phase {
  padding: 12px 0;
  border-top: 1px dashed var(--border-color, #dde5f1);
}

.portal-phase:first-of-type {
  border-top: 0;
}

.portal-phase--current {
  padding-left: 10px;
  border-left: 3px solid var(--accent-color);
}

.portal-phase-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--heading-color);
}

.portal-default {
  margin: 4px 0 8px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--muted-color, #5f6e83);
}

.portal-field {
  display: block;
  margin-top: 8px;
}

.portal-field > span {
  display: block;
  margin-bottom: 3px;
  font-size: 15px;
  color: var(--muted-color, #5f6e83);
}

.portal-field input,
.portal-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--border-color, #dde5f1);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: var(--default-color);
  background: var(--surface-color, #fff);
}

.portal-defaults {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color, #dde5f1);
}

.portal-defaults > summary {
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: var(--heading-color);
}

.portal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.portal-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid var(--border-color, #dde5f1);
}

.portal-chip--done {
  color: #14603a;
  border-color: #9ad3b4;
  background: var(--success-color-light, #dcfce7);
}

.portal-chip--todo {
  color: #9a4a06;
  border-color: var(--warning-color, #d97706);
  background: var(--warning-color-light, #ffedd5);
}

.portal-instruction {
  padding: 10px 0;
  border-top: 1px dashed var(--border-color, #dde5f1);
}

.portal-instruction button {
  margin-top: 8px;
}

.portal-cred {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  margin: 0 0 14px;
  font-size: 15px;
}

.portal-cred dt {
  color: var(--muted-color, #5f6e83);
  font-weight: 500;
}

.portal-cred dd {
  margin: 0;
  color: var(--heading-color);
}

.portal-pw {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  margin-bottom: 14px;
  border-radius: 8px;
  border: 1px solid var(--accent-color);
  background: color-mix(in srgb, var(--accent-color) 8%, var(--surface-color, #fff));
}

.portal-pw-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--heading-color);
}

.portal-pw-value {
  font-size: 24px;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--heading-color);
}

.portal-wa {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 12px;
  text-decoration: none;
}

.portal-cred-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.portal-log {
  list-style: none;
  margin: 0;
  padding: 0;
}

.portal-log-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 8px 0;
  font-size: 15px;
  border-top: 1px dashed var(--border-color, #dde5f1);
}

.portal-log-row:first-child {
  border-top: 0;
}

.portal-log-when {
  color: var(--muted-color, #5f6e83);
  font-variant-numeric: tabular-nums;
}

.portal-log-what {
  font-weight: 600;
  color: var(--heading-color);
}

.portal-log-detail {
  color: var(--muted-color, #5f6e83);
}

.portal-movement {
  padding: 12px 0;
  border-top: 1px dashed var(--border-color, #dde5f1);
}

.portal-movement:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.portal-movement-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.portal-movement-date {
  font-weight: 600;
  color: var(--heading-color);
  font-variant-numeric: tabular-nums;
}

.portal-movement-content {
  margin: 0 0 8px;
  color: var(--muted-color, #5f6e83);
}

.portal-movement-hint {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--muted-color, #5f6e83);
}

.portal-movement-edit {
  margin-top: 8px;
}

.portal-public-text {
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  border: 1px solid var(--success-color, #16a34a);
  background: color-mix(in srgb, var(--success-color, #16a34a) 8%, var(--surface-color, #fff));
}

.portal-public-text-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #14603a;
}

.portal-public-text p {
  margin: 4px 0 0;
}

@media (max-width: 1100px) {
  .portal-two {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* === Portal do cliente — entradas na navegação (Task 10) ================= */

.portal-state {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.portal-state--ativo {
  background: #dcfce7;
  color: #15803d;
}

.portal-state--sem_acesso {
  background: #eef1f6;
  color: #5f6e83;
}

.portal-state--revogado {
  background: #fee2e2;
  color: #b91c1c;
}

.portal-dot {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: #5f6e83;
}
