/* ====================================================================
   Identidade visual — Ministério Público do Estado de São Paulo (MPSP)
   Paleta inspirada nos sistemas SISMP (ex.: Ficha de Antecedentes):
     - Header institucional (topo):  #282D35 (grafite)
     - Header sistema (faixa baixa): #172127 (grafite mais escuro)
     - Cor de destaque (verde MPSP): #0FA88E
     - Hover verde:                   #0E9075
     - Borda lateral do conteúdo:    5px #0FA88E
     - Texto sobre fundo escuro:     #f3f4f6 / #c9cace
     - Fundo página:                 #F5F5F5  / cartão #FFFFFF
   Fonte: Open Sans (com fallback Roboto / sistema)
   Observação: as classes `.pc-*` foram mantidas como aliases para evitar
   reescrita em massa dos templates — apenas a estética foi atualizada.
==================================================================== */

:root {
  --pc-bg-header: #eaeaea;        /* faixa do sistema (cinza-claro SISMP) */
  --pc-bg-nav: #ffffff;           /* nav branca */
  --pc-dourado: #0FA88E;          /* verde MPSP (faixa institucional) */
  --pc-dourado-hover: #0E9075;
  --mp-azul: #c41e1e;             /* vermelho MPSP (botões primários do sistema) */
  --mp-azul-hover: #a01818;
  --mp-azul-border: #8a1414;
  --mp-prateado: #8a939c;         /* prateado (detalhes / faixa do login) */
  --mp-bordo: #7a1a1a;            /* bordô (botão Entrar) */
  --mp-bordo-hover: #5e1212;
  --mp-bordo-border: #4a0e0e;
  --pc-text-claro: #444;          /* texto principal sobre cinza claro */
  --pc-text-subt: #888;
  --pc-page-bg: #F5F5F5;
  --pc-card-bg: #ffffff;
  --pc-border: #dcdcdc;
  --mp-verde: var(--pc-dourado);
  --mp-grafite: #282D35;
}

* { box-sizing: border-box; }
body {
  font-family: "Open Sans", "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  margin: 0;
  background: var(--pc-page-bg);
  color: #1f2937;
}
a { color: #0a7d68; text-decoration: none; }
a:hover { text-decoration: underline; }

/* -------- Topbar única estilo SISMP Digital: título à esquerda, logo + usuário à direita -------- */
.mp-topbar {
  background: #ffffff;
  padding: 8px 24px;
  min-height: 56px;
  position: relative;
  border-bottom: none;
  box-shadow: 0 2px 2px rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.2), 0 1px 5px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.mp-topbar__brand {
  color: #444; text-decoration: none;
  display: flex; align-items: center;
  min-width: 0;
}
.mp-topbar__brand:hover { text-decoration: none; }
.mp-topbar__brand h1 {
  font-size: 1.15em; margin: 0; padding: 0;
  font-weight: 400; color: #444;
  letter-spacing: -0.01em; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mp-topbar__direita {
  display: flex; align-items: center; gap: 1.2rem;
  flex-shrink: 0;
}
.mp-topbar__logo {
  display: inline-block;
  line-height: 0;
}
.mp-topbar__logo img {
  height: 24px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* -------- Topbar escura estilo Delegacia Digital (preto, logo grande à esquerda, título à direita) -------- */
.dd-topbar { background: #141414; color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; gap: 1rem; min-height: 92px; }
.dd-topbar__logo-link {
  display: inline-flex; align-items: center; gap: 14px;
  text-decoration: none;
}
.dd-topbar__brasao {
  height: 72px; width: auto; display: block; object-fit: contain;
  background: transparent;
  mix-blend-mode: screen;
}
.dd-topbar__logo-link:hover { text-decoration: none; }
.dd-topbar__logo {
  height: 72px;
  width: auto;
  display: block;
  object-fit: contain;
  background: transparent;
}
.dd-topbar__sigla {
  font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.08em;
  line-height: 1;
}
.dd-topbar__titulos {
  display: flex; flex-direction: column;
  align-items: flex-end;     /* texto à direita, igual Delegacia Digital */
  text-align: right;
  min-width: 0;
}
.dd-topbar__titulos h1 {
  margin: 0; padding: 0;
  font-size: 1.35rem; font-weight: 700; color: #fff;
  line-height: 1.15; letter-spacing: -0.01em;
  white-space: nowrap;
}
.dd-topbar__titulos h2 {
  margin: 0; padding: 0;
  font-size: 0.72rem; font-weight: 400; color: #d0d0d0;
  letter-spacing: 0.05em; line-height: 1.3;
  white-space: nowrap;
}

/* Faixa branca abaixo do header (toolbar), usuário à direita */
.dd-toolbar {
  background: #fff;
  border-bottom: 2px solid #f1f1f1;
  box-shadow: 0 2px 2px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.9rem;
  padding: 6px 16px;
  font-size: 0.85rem;
}
.dd-toolbar__usuario {
  display: flex; flex-direction: column; align-items: flex-end;
  line-height: 1.2; color: #555;
}
.dd-toolbar__usuario strong { color: #222; font-weight: 600; font-size: 0.9rem; }
.dd-toolbar__usuario span {
  color: #888; font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dd-btn-sair {
  background: transparent; color: #c0392b;
  border: 1px solid #c0392b;
  padding: 0.35rem 1rem; border-radius: 3px;
  font-family: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.dd-btn-sair:hover { background: #c0392b; color: #fff; }

@media (max-width: 700px) {
  .dd-topbar { padding: 8px 12px; min-height: 60px; }
  .dd-topbar__logo { height: 44px; }
  .dd-topbar__titulos h1 { font-size: 1rem; }
  .dd-topbar__titulos h2 { font-size: 0.62rem; }
}

/* -------- Navegação contextual por perfil -------- */
.mp-nav {
  background: #f7f7f7;
  border-bottom: 1px solid #e0e0e0;
  padding: 0 24px;
  display: flex;
  gap: 0;
  font-size: 0.9rem;
}
.mp-nav a {
  display: inline-block;
  padding: 8px 16px;
  color: #555;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.mp-nav a:hover {
  color: var(--mp-azul);
  border-bottom-color: var(--mp-azul);
  text-decoration: none;
}
.mp-nav__sep {
  flex: 0 0 1px;
  align-self: stretch;
  background: #d0d0d0;
  margin: 6px 12px;
}
.mp-nav__label {
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  color: #777;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mp-nav__form { display: inline; margin: 0; }
.mp-nav__btn {
  display: inline-block;
  padding: 8px 12px;
  margin: 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #555;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.mp-nav__btn:hover {
  color: var(--mp-azul);
  border-bottom-color: var(--mp-azul);
}
.mp-nav__btn.is-active {
  color: var(--mp-azul);
  border-bottom-color: var(--mp-azul);
  font-weight: 600;
}
.mp-viewas-banner {
  background: #fff7e0;
  border-bottom: 1px solid #f0c674;
  color: #6b4f00;
  padding: 8px 24px;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* -------- Faixa do sistema (cinza-claro com nome em cinza-escuro) -------- */
.pc-header {
  display: flex; align-items: stretch; justify-content: space-between;
  background: #eaeaea;
  color: #444;
  padding: 0 17px;
  border-bottom: 1px solid #dcdcdc;
  min-height: 56px;
}
.pc-header__brand {
  display: flex; align-items: center; gap: 0.6rem;
  color: #444; text-decoration: none;
}
.pc-header__brand:hover { text-decoration: none; }
.pc-header__titulo {
  display: flex; align-items: center;
  min-height: 56px;
}
.pc-header__titulo h1 {
  font-size: 1.15em; margin: 0; padding: 0;
  font-weight: 400; color: #444;
  letter-spacing: -0.01em; line-height: 1.25;
  white-space: nowrap;
}
.pc-header__titulo h1 .pc-header__sigla { margin-right: 0.4rem; }
.pc-header__titulo h2 {
  display: none; /* SISMP não exibe subtítulo no header */
}
.pc-header__sigla {
  display: inline-block;
  color: #1f2937;
  font-weight: 700;
  letter-spacing: 0;
  padding: 0;
  margin-right: 0.3rem;
  font-size: 1em;
  vertical-align: middle;
  background: transparent;
  border-radius: 0;
}
.pc-header__usuario {
  display: flex; align-items: center; gap: 0.9rem;
  color: #555;
}
.pc-header__usuario-info {
  display: flex; flex-direction: column; align-items: flex-end;
  font-size: 0.82rem; line-height: 1.2;
}
.pc-header__usuario-info strong { color: #444; font-weight: 600; }
.pc-header__usuario-info span {
  color: #888; font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pc-btn-sair {
  background: transparent; color: #555;
  border: 1px solid #cfcfcf;
  padding: 0.32rem 0.9rem; border-radius: 3px;
  font-family: inherit; font-size: 0.82rem; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pc-btn-sair:hover {
  background: var(--pc-dourado); color: #fff;
  border-color: var(--pc-dourado);
}

/* -------- Nav abaixo do header (faixa branca com link selecionado verde) -------- */
.pc-nav {
  background: #ffffff;
  display: flex; gap: 0;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--pc-border);
}
.pc-nav a {
  color: #555;
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.pc-nav a:hover {
  color: var(--pc-dourado);
  border-bottom-color: var(--pc-dourado);
  background: #f7f7f7;
  text-decoration: none;
}

@media (max-width: 700px) {
  .pc-header { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .pc-header__titulo h1 { font-size: 1rem; }
  .pc-header__usuario { width: 100%; justify-content: space-between; }
  .pc-nav { overflow-x: auto; }
}

/* -------- Container -------- */
.container {
  max-width: 1100px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}
.rodape { text-align: center; padding: 1rem; color: #6b7280; }

h1 { margin-top: 0; }
.subtitulo { color: #6b7280; }

/* -------- Botão primário (azul MPSP) -------- */
.pc-btn-primario {
  display: inline-block; background: var(--mp-azul); color: #fff;
  border: 1px solid var(--mp-azul-border); padding: 0.55rem 1.2rem; border-radius: 4px;
  font-family: inherit; font-size: 0.95rem; font-weight: 400;
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.pc-btn-primario:hover { background: var(--mp-azul-hover); border-color: var(--mp-azul-border); }
.pc-btn-primario:disabled { background: #c3c3c3; border-color: #b5b5b5; cursor: default; }

/* Compatibilidade com .btn antigos */
.btn {
  display: inline-block; padding: 0.45rem 0.9rem; border-radius: 4px;
  background: #3a3a3a; color: #fff; border: 1px solid #2a2a2a; cursor: pointer;
  font-family: inherit; font-size: 0.9rem; text-decoration: none;
}
.btn:hover { background: #2a2a2a; color: #fff; }
.btn.primary { background: var(--mp-azul); color: #fff; border-color: var(--mp-azul-border); }
.btn.primary:hover { background: var(--mp-azul-hover); border-color: var(--mp-azul-border); }
.btn.small { padding: 0.25rem 0.6rem; font-size: 0.8rem; }
.btn.danger { background: #dc2626; color: #fff; border-color: #b91c1c; }
.btn.danger:hover { background: #b91c1c; border-color: #991b1b; }
.btn-link { background: none; border: none; color: inherit; cursor: pointer; }

.alerta { padding: 0.7rem 1rem; border-radius: 4px; margin: 1rem 0; }
.alerta.erro { background: #fde2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* -------- Login -------- */
.pc-login {
  max-width: 420px; margin: 4rem auto; padding: 2.5rem 2rem;
  background: #1c1c1c; border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
  border-top: 4px solid var(--mp-prateado);
  color: #f3f4f6;
}
.pc-login__brand {
  text-align: center; margin-bottom: 1.5rem;
}
.pc-login__brand img.pc-login__brasao {
  width: 110px; height: auto; margin: 0 auto 1rem; display: block;
  mix-blend-mode: screen;
}
.pc-login__brand h1 {
  font-size: 1.45rem; margin: 0.25rem 0 0.1rem;
  color: #ffffff; font-weight: 700;
}
.pc-login__subt {
  margin: 0 0 0.9rem; font-size: 0.95rem; color: #cfcfcf; font-weight: 400;
}
.pc-login__inst {
  margin: 0; font-size: 0.68rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: #a0a0a0; font-weight: 600;
}
.pc-login__form label { color: #ffffff; }
.pc-login__form input {
  background: #f5f5f5; color: #141414; border: 1px solid #d1d5db;
}
.pc-login__form input::placeholder { color: #888; }
.pc-login__form input:focus {
  background: #ffffff;
}
.pc-login__form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.2rem; }
.pc-login__form label {
  display: flex; flex-direction: column; gap: 0.3rem;
  font-size: 0.85rem; color: #ffffff;
}
.pc-login__form input {
  padding: 0.6rem 0.7rem; border: 1px solid #d1d5db; border-radius: 4px;
  font-size: 1rem; font-family: inherit;
}
.pc-login__form input:focus {
  outline: none; border-color: var(--mp-prateado);
  box-shadow: 0 0 0 3px rgba(138,147,156,0.28);
}
.pc-login__form .pc-btn-primario { margin-top: 0.4rem; }
.pc-login .pc-btn-primario {
  background: var(--mp-bordo); border-color: var(--mp-bordo-border);
}
.pc-login .pc-btn-primario:hover {
  background: var(--mp-bordo-hover); border-color: var(--mp-bordo-border);
}

/* (mantido para compatibilidade) */
.login-box {
  max-width: 380px; margin: 5rem auto; padding: 2rem;
  background: white; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.login-box form { display: flex; flex-direction: column; gap: 0.75rem; }
.login-box label { display: flex; flex-direction: column; font-size: 0.85rem; }
.login-box input { padding: 0.5rem; border: 1px solid #d1d5db; border-radius: 4px; font-size: 1rem; }

/* -------- Layout interno -------- */
.grid-2col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
}
@media (max-width: 800px) { .grid-2col { grid-template-columns: 1fr; } }

.tabela { width: 100%; border-collapse: collapse; background: white; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.tabela th, .tabela td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid var(--pc-border); font-size: 0.9rem; }
.tabela th { background: #fafafa; color: #374151; font-weight: 500; }
.tabela.compacta th, .tabela.compacta td { padding: 0.35rem 0.6rem; font-size: 0.85rem; }
.tabela tr.total td { background: #f3f4f6; }

.badge-zona { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 3px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; }

/* -------- Painel operacional (PM/GCM/Saúde/Assistência) -------- */
.painel-resumo {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem; margin: 1rem 0 1.5rem;
}
.resumo-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 6px;
  padding: 0.9rem 1rem; text-align: center;
}
.resumo-card--alerta { border-color: #fca5a5; background: #fef2f2; }
.resumo-card__num { font-size: 2rem; font-weight: 700; color: #111; line-height: 1; }
.resumo-card__lbl { font-size: 0.8rem; color: #555; text-transform: uppercase; letter-spacing: 0.03em; margin-top: 0.2rem; }

.tabela-operacional td { vertical-align: middle; }
.tabela-operacional .acoes { white-space: nowrap; }
.tabela-operacional .acoes-inner { display: inline-flex; gap: 0.3rem; flex-wrap: wrap; align-items: center; justify-content: center; vertical-align: middle; }
.inline-action { display: inline-block; }
.inline-action[open] {
  display: block; background: #f9fafb; border: 1px solid #e5e7eb;
  border-radius: 4px; padding: 0.5rem; margin-top: 0.4rem; min-width: 320px;
}
.inline-action > summary { list-style: none; cursor: pointer; }
.inline-action > summary::-webkit-details-marker { display: none; }
/* Painel flutuante para formulários complexos (RFN e similares) */
.inline-action.rfn-quick[open] {
  position: absolute; right: 0; min-width: 600px; max-height: 80vh;
  overflow-y: auto; z-index: 300;
  box-shadow: 0 8px 28px rgba(0,0,0,.22);
}
/* Linha full-width de formulário no plano de acompanhamento */
.plano-form-row td { background: #f5f7ff; border-top: 2px solid #bcd0f7; padding: 1rem 1.5rem; }
.plano-form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; margin-bottom: .5rem; }
@media(max-width:700px){ .plano-form-grid { grid-template-columns: 1fr; } }
.form-inline-vert { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.4rem; }
.form-inline-vert label { display: flex; flex-direction: column; font-size: 0.8rem; color: #374151; gap: 0.15rem; }
.form-inline-vert input, .form-inline-vert select, .form-inline-vert textarea {
  font: inherit; padding: 0.3rem 0.5rem;
  background: #f1f2f4;
  border: 1px solid transparent;
  border-bottom: 1px solid #c8ccd0;
  border-radius: 4px 4px 0 0;
}
.form-inline-vert input:focus, .form-inline-vert select:focus, .form-inline-vert textarea:focus {
  outline: none; background: #e9ebee;
  border-bottom-color: var(--mp-azul);
  box-shadow: inset 0 -1px 0 var(--mp-azul);
}

.lista-registros { list-style: none; padding: 0; margin: 0.5rem 0; }
.lista-registros > li {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 5px;
  padding: 0.6rem 0.9rem; margin-bottom: 0.5rem;
}
.lista-registros .registro-desc {
  margin-top: 0.3rem; font-size: 0.88rem; color: #374151; white-space: pre-wrap;
}
.badge-registro {
  display: inline-block; padding: 0.1rem 0.5rem; border-radius: 3px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  color: #fff; background: #6b7280; margin-right: 0.4rem;
}
.badge-registro--rat { background: #1d4ed8; }
.badge-registro--contato { background: #047857; }
.badge-registro--ronda { background: #b45309; }
.badge-registro--outro { background: #6b7280; }
.muted { color: #6b7280; }
.vazio { color: #6b7280; font-style: italic; padding: 0.6rem 0; }

/* -------- Linha do tempo -------- */
.linha-tempo { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 1rem; }
.lt-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #6b7280;
  border-radius: 0 6px 6px 0;
  padding: 0.55rem 0.9rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.lt-meta {
  display: flex; gap: 0.55rem; align-items: center; margin-bottom: 0.28rem;
}
.lt-orgao {
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 0.12rem 0.48rem; border-radius: 99px;
  white-space: nowrap;
}
.lt-data {
  font-size: 0.74rem; color: #9ca3af; font-weight: 500;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.lt-titulo { font-weight: 600; font-size: 0.88rem; color: #111827; }
.lt-desc {
  font-size: 0.81rem; color: #4b5563; margin-top: 0.2rem;
  white-space: pre-wrap; line-height: 1.45;
}
.lt-autor {
  font-size: 0.72rem; color: #9ca3af;
  margin-top: 0.2rem; font-style: italic;
}

/* -------- Alerta de reincidência -------- */
.alerta-reincidencia {
  background: #fff1f2; border: 1.5px solid #fca5a5;
  border-left: 5px solid #dc2626;
  border-radius: 0 8px 8px 0;
  padding: 0.9rem 1.1rem; margin-bottom: 1.4rem;
}
.rei-header {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem;
}
.rei-icone { font-size: 1.15rem; color: #dc2626; }
.rei-header strong { font-size: 0.95rem; color: #991b1b; }
.rei-cpf {
  font-size: 0.78rem; color: #9ca3af; font-variant-numeric: tabular-nums;
  margin-left: 0.4rem;
}
.rei-subtitulo { font-size: 0.85rem; color: #7f1d1d; margin: 0 0 0.5rem; }
.rei-lista { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.rei-lista li { font-size: 0.85rem; color: #374151; display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.rei-zona { font-size: 0.72rem !important; padding: 0.1rem 0.45rem !important; }
.rei-link { color: #dc2626; font-weight: 600; text-decoration: none; }
.rei-link:hover { text-decoration: underline; }

/* Tabela de fatores compacta na página de detalhe */
.tabela-fatores { font-size: 0.78rem; }
.tabela-fatores th, .tabela-fatores td { padding: 0.2rem 0.5rem; }
.tabela-fatores th:last-child, .tabela-fatores td:last-child { text-align: center; width: 3rem; }

/* Breadcrumb */
.breadcrumb { font-size: 0.85rem; margin-bottom: 0.4rem; }
.breadcrumb a { color: #2563eb; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* -------- Agenda de patrulhamento (PM/GCM) -------- */
.agenda-legenda { font-size: 0.85rem; color: #444; margin: 0 0 0.8rem; padding: 0.5rem 0.7rem; background: #f9fafb; border-left: 3px solid #1d4ed8; border-radius: 3px; }
.fase-tag { display: inline-block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; }
.fase-tag--intensiva { color: #991b1b; }
.fase-tag--rotina { color: #065f46; }
.rondas { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 12px; font-weight: 700; font-size: 0.85rem; white-space: nowrap; }
.rondas--ok { background: #d1fae5; color: #065f46; }
.rondas--pendente { background: #fee2e2; color: #991b1b; }
.ronda-quick, .contato-quick { position: relative; }
.ronda-quick > summary, .contato-quick > summary {
  cursor: pointer; list-style: none; user-select: none;
  border: 1px dashed transparent;
  transition: border-color .15s, box-shadow .15s, filter .15s;
}
.ronda-quick > summary::after, .contato-quick > summary::after {
  content: " · Registrar"; font-size: 0.78em; font-weight: 600; opacity: 0.85;
}
.ronda-quick > summary::-webkit-details-marker,
.contato-quick > summary::-webkit-details-marker { display: none; }
.ronda-quick > summary:hover, .contato-quick > summary:hover {
  filter: brightness(0.95);
  border-color: rgba(0,0,0,0.25);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.ronda-quick[open] > summary, .contato-quick[open] > summary {
  box-shadow: 0 0 0 2px #1d4ed8;
  border-color: transparent;
}
.ronda-quick[open] > summary::after, .contato-quick[open] > summary::after { content: " · Fechar"; }
.ronda-quick > .form-inline-vert, .contato-quick > .form-inline-vert { margin-top: 0.5rem; min-width: 240px; }
.contato { display: inline-block; font-size: 0.82rem; }
.contato--ok { color: #065f46; }
.contato--pendente { color: #991b1b; font-weight: 600; }
.tabela-operacional tr.urgente td { background: #fff7ed; }
.tabela-operacional tr.caso-row { cursor: pointer; }
.tabela-operacional tr.caso-row:hover td { background: #f3f4f6; }
.tabela-operacional tr.caso-row.expandida td { background: #eef2ff; }
.tabela-operacional tr.caso-cronologia td { background: #fafbff; padding: 0.4rem 1rem; }
.caso-cronologia__box { max-height: 380px; overflow-y: auto; padding: 0.3rem 0; }
.caso-cronologia__loading { padding: 0.6rem; }
.caso-oculto { display: none !important; }
.caso-voltar-btn {
  display: inline-block; margin: 0 0 0.75rem;
  background: #1d4ed8; color: #fff; border: none;
  padding: 0.5rem 0.9rem; border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12); cursor: pointer;
  font-weight: 600;
}
.caso-voltar-btn:hover { background: #1e40af; }
body.modo-foco .tabela-operacional tr.caso-row.expandida td { background: #eef2ff; }

/* -------- Cronologia / linha do tempo do caso -------- */
.cronologia-wrap { margin: 1rem 0 1.5rem; background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; padding: 0.6rem 1rem; }
.cronologia-wrap > summary { cursor: pointer; list-style: none; padding: 0.2rem 0; }
.cronologia-wrap > summary::-webkit-details-marker { display: none; }
.cronologia-wrap > summary::before {
  content: "▸"; display: inline-block; margin-right: 0.4rem; transition: transform 0.15s; color: #6b7280;
}
.cronologia-wrap[open] > summary::before { transform: rotate(90deg); }
.cronologia { list-style: none; padding: 0.4rem 0 0 0; margin: 0; position: relative; }
.cronologia::before {
  content: ""; position: absolute; left: 14px; top: 6px; bottom: 6px;
  width: 2px; background: #e5e7eb;
}
.cronologia__item {
  position: relative; padding: 0.4rem 0 0.6rem 40px; min-height: 30px;
}
.cronologia__icone {
  position: absolute; left: 0; top: 4px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--cor, #6b7280); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  box-shadow: 0 0 0 3px #fff;
}
.cronologia__quando { font-size: 0.85rem; color: #374151; }
.cronologia__titulo { font-weight: 600; margin-top: 0.1rem; }
.cronologia__detalhe { font-size: 0.9rem; color: #374151; margin-top: 0.2rem; white-space: pre-wrap; }
.cronologia__autor { font-size: 0.78rem; margin-top: 0.15rem; }

.zona-resultado {
  padding: 1.5rem; border-radius: 6px; text-align: center; margin: 1rem 0;
}
.zona-titulo { font-size: 1.6rem; font-weight: 700; }
.zona-info { margin-top: 0.4rem; font-size: 0.85rem; opacity: 0.95; }

dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; }
dt { font-weight: 700; color: #4b5563; }

.form-avaliacao fieldset { background: white; border: 1px solid var(--pc-border); border-radius: 6px; padding: 1rem 1.5rem; margin-bottom: 1rem; }
.form-avaliacao legend { font-weight: 700; color: var(--pc-dourado-hover); padding: 0 0.5rem; }
.form-avaliacao label { display: block; margin: 0.4rem 0; }
.form-avaliacao input[type=text], .form-avaliacao input[type=date], .form-avaliacao input:not([type]), .form-avaliacao textarea, .form-avaliacao select {
  width: 100%; padding: 0.5rem 0.6rem;
  background: #f1f2f4;
  border: 1px solid transparent;
  border-bottom: 1px solid #c8ccd0;
  border-radius: 4px 4px 0 0;
  font-size: 0.95rem; font-family: inherit;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.form-avaliacao input:hover, .form-avaliacao textarea:hover, .form-avaliacao select:hover {
  background: #e9ebee;
}
.form-avaliacao input:focus, .form-avaliacao textarea:focus, .form-avaliacao select:focus {
  outline: none;
  background: #e9ebee;
  border-bottom-color: var(--mp-azul);
  box-shadow: inset 0 -1px 0 var(--mp-azul);
}
.pergunta { margin: 0.8rem 0; padding-bottom: 0.5rem; border-bottom: 1px dashed #f3f4f6; }
.pergunta-texto { font-weight: 600; margin: 0.2rem 0; }
.opcao { display: block; padding: 0.2rem 0 0.2rem 1rem; font-weight: normal; }
.opcao input { margin-right: 0.5rem; }
.depoimento { margin-top: 0.5rem; padding-left: 1rem; display: none; }
.depoimento.show { display: block; }
.pergunta.hidden { display: none; }
.protocolo {
  font-family: "Roboto Mono", "Consolas", ui-monospace, monospace;
  font-weight: 600;
  color: var(--mp-azul);
  background: #eef4fb;
  padding: 0.1em 0.45em;
  border-radius: 4px;
  font-size: 0.85em;
  margin-left: 0.3rem;
  letter-spacing: 0.02em;
}
.pergunta.faltando {
  background: #fef2f2;
  border-left: 3px solid #dc2626;
  padding-left: 0.75rem;
  border-bottom-color: #fecaca;
}

/* Pré-preenchimento via FVD */
.pergunta.pre-preenchida {
  background: #eff6ff;
  border-left: 3px solid #3b82f6;
  padding-left: 0.75rem;
  border-bottom-color: #dbeafe;
}
.tag-fvd, .tag-fvd-inline {
  display: inline-block;
  background: #3b82f6;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  margin-left: 0.5rem;
  vertical-align: middle;
  cursor: help;
}
.origem-fvd {
  font-size: 0.78rem;
  color: #1e40af;
  margin: 0.25rem 0 0.4rem 0;
  font-style: italic;
}
.alerta-fdv-grave {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-left: 4px solid #f59e0b;
  padding: 0.6rem 0.85rem;
  border-radius: 4px;
  margin: 0.6rem 0 0.2rem 0;
  font-size: 0.85rem;
  color: #78350f;
}
.alerta-fdv-grave strong { color: #92400e; display: block; margin-bottom: 0.3rem; }
.alerta-fdv-grave ul { margin: 0.2rem 0 0.4rem 1.1rem; padding: 0; }
.alerta-fdv-grave li { margin: 0.15rem 0; }
.alerta-fdv-rodape { display: block; margin-top: 0.3rem; font-size: 0.78rem; color: #78350f; font-style: italic; }
.aviso-fvd {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  border-left: 4px solid #3b82f6;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin: 1rem 0;
  font-size: 0.92rem;
}
.form-importar-fvd .bloco-importar {
  background: #fafaf9;
  border: 1px dashed #d6d3d1;
}
.form-importar-fvd .dica {
  font-size: 0.85rem;
  color: #57534e;
  margin: 0.2rem 0 0.7rem 0;
}

.botoes { margin: 1.5rem 0; }

.status { padding: 0.15rem 0.5rem; border-radius: 3px; font-size: 0.75rem; }
.status-pendente { background: #fee2e2; color: #991b1b; }
.status-em_andamento { background: #fef3c7; color: #92400e; }
.status-concluido { background: #d1fae5; color: #065f46; }
.status-cancelado { background: #e5e7eb; color: #4b5563; }

.vazio { color: #6b7280; font-style: italic; }
.lista { padding-left: 1.2rem; }

.filtro { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.filtro input { padding: 0.5rem; flex: 1; border: 1px solid #d1d5db; border-radius: 4px; font-family: inherit; }

.form-inline { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.8rem 0; }
.form-inline input, .form-inline select {
  padding: 0.4rem 0.6rem;
  background: #f1f2f4;
  border: 1px solid transparent;
  border-bottom: 1px solid #c8ccd0;
  border-radius: 4px 4px 0 0;
  font-family: inherit;
}
.form-inline input:focus, .form-inline select:focus {
  outline: none; background: #e9ebee;
  border-bottom-color: var(--mp-azul);
  box-shadow: inset 0 -1px 0 var(--mp-azul);
}



/* -------- Árvore de decisão (laudo) -------- */
.zona-chip {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}
.arvore-decisao {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 1rem 0.5rem 0.5rem;
}
.arv-no {
  width: 100%;
  max-width: 560px;
  background: var(--pc-card-bg);
  border: 1px solid var(--pc-border);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow: hidden;
}
.arv-no__pergunta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  background: #fafaf5;
  border-bottom: 1px solid var(--pc-border);
}
.arv-no__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  background: #374151;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.arv-no__rotulo {
  flex: 1;
  font-weight: 600;
  color: #1f2937;
  font-size: 0.95rem;
}
.arv-no__valor {
  font-size: 0.8rem;
  color: #4b5563;
  background: #fff;
  border: 1px solid var(--pc-border);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.arv-no__cond {
  font-family: ui-monospace, "Consolas", monospace;
  font-size: 0.78rem;
  color: #6b7280;
  font-weight: 500;
  margin-left: 0.35rem;
}
.arv-no__skl {
  padding: 0.55rem 0.95rem;
  background: #fff;
  border-bottom: 1px solid var(--pc-border);
  font-family: ui-monospace, "Consolas", "Courier New", monospace;
  font-size: 0.82rem;
  color: #1f2937;
  line-height: 1.55;
}
.arv-no__skl > div { white-space: nowrap; overflow-x: auto; }
.arv-skl__k { color: #6b7280; }
.arv-no__skl--folha {
  margin-top: 0.55rem;
  border: 1px solid var(--pc-border);
  border-radius: 6px;
  background: #fafafa;
}
.arv-no__stats {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem 0.9rem;
  align-items: center;
  padding: 0.55rem 0.9rem;
  background: #fff;
  border-bottom: 1px solid var(--pc-border);
  font-size: 0.82rem;
}
.arv-stat { display: contents; }
.arv-stat__label {
  font-family: ui-monospace, "Consolas", monospace;
  font-size: 0.75rem;
  color: #6b7280;
  text-transform: lowercase;
}
.arv-stat__valor {
  color: #1f2937;
  font-variant-numeric: tabular-nums;
}
.arv-stat__chip {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.02em;
  justify-self: end;
  border: 1px solid currentColor;
  background: transparent !important;
  color: #374151 !important;
}
.arv-stat__chip__dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.arv-barra {
  display: flex;
  height: 12px;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}
.arv-barra__seg { display: block; height: 100%; }
.arv-barra--folha {
  height: 10px;
  margin-top: 0.45rem;
  border-color: #e5e7eb;
  background: #f3f4f6;
}
.arv-folha__stats {
  margin-top: 0.55rem;
  font-size: 0.82rem;
  color: #4b5563;
}
.arv-ramos {
  display: flex;
  gap: 0;
}
.arv-ramo {
  flex: 1;
  padding: 0.6rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
  border-top: 0;
}
.arv-ramo + .arv-ramo {
  border-left: 1px solid var(--pc-border);
}
.arv-ramo__cond {
  font-family: ui-monospace, "Consolas", monospace;
  font-weight: 600;
}
.arv-ramo__marca {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.arv-ramo--ativo {
  background: #f3f4f6;
  color: #111827;
  font-weight: 700;
}
.arv-ramo--inativo {
  background: #fafafa;
  color: #c1c5cc;
  text-decoration: line-through;
  text-decoration-color: #e5e7eb;
}
.arv-conector {
  width: 2px;
  height: 24px;
  background: #9ca3af;
  margin: 0;
  position: relative;
}
.arv-conector::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #9ca3af;
}
.arv-folha {
  width: 100%;
  max-width: 560px;
  margin-top: 0.4rem;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  background: #fff;
  color: #1f2937;
  text-align: left;
  border: 1px solid var(--pc-border);
  border-left: 5px solid var(--zona-cor, #374151);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.arv-folha__rotulo {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}
.arv-folha__nome {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 0.25rem;
  padding: 0.2rem 0.7rem;
  border-radius: 4px;
  background: var(--zona-cor, #374151);
  color: #fff;
  letter-spacing: 0.04em;
}


/* Imagem da árvore de decisão */
.arvore-img-wrap {
  width: 100%;
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--pc-border);
  border-radius: 8px;
  padding: 0.5rem;
  text-align: center;
}
.arvore-img { max-width: 100%; height: auto; display: inline-block; }
.arvore-detalhe { margin-top: 0.6rem; font-size: 0.9rem; }
.arvore-detalhe summary { cursor: pointer; color: #1a4fb0; }
.caminho-arvore-texto { margin: 0.5rem 0 0 1.2rem; }

.btn-link-danger { background:none; border:0; margin-left:1.2rem; padding:0; color:#b00020; cursor:pointer; font:inherit; text-decoration:underline; }
.btn-link-danger:hover { color:#7a0014; }

/* ---- Em construção ---- */
.em-construcao { display: flex; justify-content: center; padding: 3rem 1rem; }
.em-construcao__card { max-width: 520px; text-align: center; padding: 2.5rem 2rem; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.em-construcao__icone { font-size: 3.5rem; line-height: 1; margin-bottom: 1rem; }
.em-construcao h1 { margin: 0 0 1rem; font-size: 1.6rem; color: #172127; }
.em-construcao p { margin: 0.5rem 0; color: #374151; }
.em-construcao .muted { color: #6b7280; font-size: 0.9rem; }
