/* ===================== BASE / TOKENS =====================
   Paleta e tipografia seguem o Manual de Identidade Visual da BBL:
   principal #786747, azul #B6C6D1, laranja (ação/marca) #D54123,
   bege #AD9577, fundo #EEEAE7. Assinatura tipográfica Lora (títulos)
   + DM Sans (uso cotidiano/digital) — Aurora e Monument Extended ficam
   reservadas pra logo/tagline oficiais, não para UI de sistema.
   Tons intermediários calculados a partir dos percentuais de Luz/Sombra
   do manual (mistura com branco/preto), ajustados quando necessário pra
   manter contraste legível em elementos pequenos de UI. */
:root {
  --primary: #d54123;
  --primary-dark: #aa341c;
  --primary-darker: #802715;
  --primary-light: #f9e3de;
  --tan: #ad9577;
  --steel: #5b7a94;
  --bg: #eeeae7;
  --white: #ffffff;
  --text: #33291f;
  --text-muted: #786747;
  --border: #e2dad0;
  --orange: #e08a2b;
  --orange-light: #f3b56b;
  --red: #c23b3b;
  --red-light: #e58888;
  --green: #3f8a5b;
  --blue: #5b7a94;
  --shadow-sm: 0 1px 3px rgba(51, 41, 31, 0.08);
  --shadow-md: 0 8px 24px rgba(51, 41, 31, 0.12);
  --radius: 14px;
  --radius-sm: 9px;
  --font-heading: 'Lora', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-family: var(--font-heading); }
p { margin: 0; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

.screen { display: none; }
.screen.active { display: flex; }

.req { color: var(--primary); }
.opt { color: var(--text-muted); font-weight: 400; font-size: 0.85em; }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-danger {
  background: var(--red);
  color: #fff;
}
.btn-danger:hover { background: #b32b1f; }

.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: var(--primary-light); color: var(--primary); }

.icon-btn-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  vertical-align: middle;
  margin-left: 4px;
  cursor: pointer;
}
.icon-btn-inline:hover { background: var(--primary-light); color: var(--primary); }
.processo-link-tribunal {
  display: inline-block;
  margin-left: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
}
.detalhes-field .processo-valor-texto { font-weight: inherit; }

/* ===================== SPLASH SCREEN ===================== */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #150a0d;
  opacity: 1;
  transition: opacity 0.6s ease;
}
.splash-screen[hidden] { display: none; }
.splash-screen.fade-out { opacity: 0; pointer-events: none; }

/* ---------- foto de fundo compartilhada (splash + login) ---------- */
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('img/cristo-redentor.webp');
  background-size: cover;
  background-position: center 38%;
}

/* ---------- marca compartilhada (splash + login): logo + divisor + nome por extenso ---------- */
.brand-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}
.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.03em;
  backdrop-filter: blur(2px);
  flex-shrink: 0;
}
.brand-divider {
  width: 1.5px;
  align-self: stretch;
  background: rgba(255, 255, 255, 0.4);
}
.brand-fullname {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.92);
}

.brand-underline {
  width: 100px;
  height: 2px;
  background: var(--orange);
  margin: 22px auto 0;
}

.splash-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, rgba(213, 65, 35, 0.25) 0%, rgba(21, 9, 12, 0.75) 70%);
}

.splash-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #fff;
  padding: 0 24px;
}

.splash-content h1 {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.splash-subtitle {
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.65);
}

.splash-loading {
  margin-top: 22px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}

.splash-dots span {
  animation: splash-blink 1.4s infinite;
  opacity: 0;
}
.splash-dots span:nth-child(2) { animation-delay: 0.2s; }
.splash-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes splash-blink {
  0%, 80%, 100% { opacity: 0; }
  40% { opacity: 1; }
}

/* ===================== LOGIN SCREEN ===================== */
.screen-login {
  width: 100%;
  min-height: 100vh;
}

.screen-trocar-senha {
  width: 100%;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.screen-trocar-senha .login-form-side { flex: none; padding: 40px 32px; background: transparent; }

.login-visual {
  position: relative;
  flex: 1 1 50%;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  background: #1c0d11;
}

.login-visual-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(21, 9, 12, 0.35) 0%, rgba(21, 9, 12, 0.55) 55%, rgba(15, 6, 8, 0.85) 100%);
}

.login-visual-content {
  position: relative;
  z-index: 2;
  padding: 56px 64px 24px;
  max-width: 560px;
}

.login-visual-content h1 {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.login-visual-content p {
  margin-top: 16px;
  font-size: 1.02rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
}

.login-visual-footer {
  position: relative;
  z-index: 2;
  padding: 24px 64px 40px;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
}

.login-form-side {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  padding: 40px 32px;
}

.login-form-wrap {
  width: 100%;
  max-width: 380px;
}

.bbl-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.bbl-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.bbl-logo-mark.small { width: 36px; height: 36px; font-size: 0.8rem; border-radius: 8px; }

.bbl-logo-full {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.login-form-wrap h2 {
  font-size: 1.7rem;
  font-weight: 800;
}

.login-subtitle {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

#login-form { margin-top: 28px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.field input,
.field select,
.field textarea {
  padding: 11px 13px;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(213, 65, 35, 0.12);
}

.password-wrap { position: relative; display: flex; }
.password-wrap input { padding-right: 42px; }

.toggle-password {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.toggle-password:hover { color: var(--primary); background: var(--primary-light); }

.login-error {
  background: #fbe4e4;
  color: var(--red);
  border: 1px solid #f2c2c2;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 14px;
}
.login-error[hidden] { display: none; }

.campo-erro { margin-top: 6px; font-size: 0.78rem; color: var(--red); }
.campo-erro[hidden] { display: none; }
.field.campo-invalido input { border-color: var(--red); }

#login-form .btn { margin-top: 6px; }

.forgot-link {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
}
.forgot-link:hover { text-decoration: underline; }

.secure-badge {
  margin-top: 28px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===================== APP SHELL ===================== */
.screen-app {
  flex-direction: column;
  width: 100%;
  height: 100vh;
}

.app-header {
  flex-shrink: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 28px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.app-header-left { display: flex; align-items: center; gap: 12px; }

.app-header-title {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.app-header-title strong { font-size: 0.95rem; }
.app-header-title span { font-size: 0.78rem; color: var(--text-muted); }

.app-header-right { display: flex; align-items: center; gap: 14px; }

/* ---- corpo do app: menu lateral + conteúdo ---- */
.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.app-sidebar {
  position: relative;
  flex-shrink: 0;
  width: 232px;
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.18s ease;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-muted);
  margin-bottom: 12px;
}
.sidebar-toggle:hover { background: var(--bg); color: var(--primary); }
.sidebar-toggle-icon { transition: transform 0.18s ease; }

.app-tabs {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.app-tabs-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.app-tabs-group:first-child { padding-top: 0; border-top: none; }

.app-tabs-group-label {
  padding: 0 14px 2px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.app-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 11px 14px;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.app-tab-icon { flex-shrink: 0; }
.app-tab-label { overflow: hidden; }
.app-tab:hover { background: var(--bg); color: var(--primary); }
.app-tab.active { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; }

/* ---- menu recolhido (só ícones) ---- */
.app-sidebar.collapsed { width: 68px; }
.app-sidebar.collapsed .sidebar-toggle { margin-left: 0; }
.app-sidebar.collapsed .sidebar-toggle-icon { transform: rotate(180deg); }
.app-sidebar.collapsed .app-tab-label,
.app-sidebar.collapsed .app-tabs-group-label { display: none; }
.app-sidebar.collapsed .app-tab { justify-content: center; padding: 11px; }
.app-body.sidebar-collapsed .indicators-tab { left: 68px; }

.notif-wrap { position: relative; }

.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.notif-painel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  max-height: 420px;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 50;
  overflow: hidden;
}
.notif-painel[hidden] { display: none; }

.notif-painel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.notif-painel-header strong { font-size: 0.88rem; }

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.link-btn:hover { text-decoration: underline; }

.lista-recursos { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.linha-recurso { display: flex; align-items: center; gap: 8px; }
.linha-recurso .input-recurso { flex: 1; }
.linha-recurso .remover-recurso {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.linha-recurso .remover-recurso:hover { color: var(--red); border-color: var(--red); }

.notif-painel-lista { overflow-y: auto; }

.notif-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg); }
.notif-item.nao-lida { background: var(--primary-light); }
.notif-item .notif-item-data { display: block; margin-top: 4px; font-size: 0.72rem; color: var(--text-muted); }
.notif-item.notif-atencao.nao-lida { background: #fff4e5; border-left: 3px solid #e08a00; font-weight: 600; }
.notif-item.notif-urgente.nao-lida { background: var(--red-light); border-left: 3px solid var(--red); font-weight: 700; color: var(--red); }

.notif-painel-vazio { padding: 24px 16px; text-align: center; color: var(--text-muted); font-size: 0.84rem; }

.campo-auto-nota { display: block; margin-top: 4px; font-size: 0.72rem; color: var(--primary); font-style: italic; }
.aviso-polo-sem-dados {
  grid-column: 1 / -1;
  margin: -4px 0 4px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff4e5;
  color: #96650a;
  font-size: 0.78rem;
}

.user-chip { display: flex; align-items: center; gap: 10px; }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.82rem;
}

.user-chip-text { display: flex; flex-direction: column; line-height: 1.25; }
.user-chip-text strong { font-size: 0.85rem; }
.user-chip-text span { font-size: 0.75rem; color: var(--text-muted); }

.app-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 28px;
}

.app-main > .view {
  max-width: 1280px;
  margin: 0 auto;
}

.view { display: none; }
.view.active { display: block; }

/* ===================== CARDS ===================== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 26px;
}

.form-card { max-width: none; }

.card-title-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.card-title-row h2 { font-size: 1.2rem; font-weight: 800; }
.card-title-row p { margin-top: 4px; color: var(--text-muted); font-size: 0.88rem; max-width: 640px; }

/* ===================== FORM GRID ===================== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 20px;
}

/* o gap do grid já espaça as linhas — sem isso, o margin-bottom do .field
   (pensado pra formulários em coluna única) soma com o gap e dobra o espaço. */
.form-grid .field { margin-bottom: 0; }

.field-span-2 { grid-column: span 2; }
.field-span-3 { grid-column: span 3; }

.field textarea { resize: vertical; min-height: 78px; }

/* toggle */
.toggle-wrap { display: flex; align-items: center; height: 44px; }
.toggle-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 0;
}
.toggle-track {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--border);
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  transition: transform 0.2s ease;
}
.toggle-btn[aria-pressed="true"] .toggle-track { background: var(--primary); }
.toggle-btn[aria-pressed="true"] .toggle-thumb { transform: translateX(18px); }
.toggle-label { font-weight: 600; font-size: 0.9rem; }

/* dropzone with smooth reveal */
.field[hidden] { display: none; }

#field-upload {
  overflow: hidden;
  max-height: 700px;
  opacity: 1;
  transform: translateY(0);
  transition: max-height 0.35s ease, opacity 0.3s ease, transform 0.3s ease, margin 0.35s ease;
}
#field-upload.hiding {
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  margin-bottom: -18px;
}
#field-upload.entering {
  max-height: 0;
  opacity: 0;
}

.dropzone {
  border: 1.8px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  color: var(--text-muted);
  transition: border-color 0.15s ease, background 0.15s ease;
  margin-top: 16px;
}
.dropzone svg { color: var(--primary); margin-bottom: 4px; }
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  outline: none;
}
.dropzone-title { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.dropzone-hint { font-size: 0.8rem; }
.dropzone-status { font-size: 0.8rem; font-weight: 600; margin-top: 4px; }
.dropzone-status.sucesso { color: #2e7d32; }
.dropzone-status.aviso { color: #b45309; }

.dados-documento-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
  margin-top: 16px;
}
.dados-documento-grid .field { margin-bottom: 0; }

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 26px;
  gap: 16px;
  flex-wrap: wrap;
}
.form-actions-buttons { display: flex; gap: 12px; }
.required-note { font-size: 0.82rem; color: var(--text-muted); margin-left: auto; }

/* ===================== LIST VIEW ===================== */
.list-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.list-header h2 { font-size: 1.4rem; font-weight: 800; }
.list-header p { margin-top: 4px; color: var(--text-muted); font-size: 0.9rem; }
.list-count { font-weight: 700; color: var(--primary); font-size: 0.95rem; white-space: nowrap; }

.list-header-right { display: flex; align-items: center; gap: 16px; }
#btn-relatorio-dia { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; font-size: 0.88rem; }
#btn-relatorio-dia[hidden] { display: none; }

.filtro-especial-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 7px 8px 7px 14px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.85rem;
  font-weight: 600;
}
.filtro-especial-chip[hidden] { display: none; }
.filtro-especial-chip strong { font-weight: 800; }
.filtro-especial-chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(213, 65, 35, 0.15);
  color: var(--primary-dark);
  font-size: 1rem;
  line-height: 1;
}
.filtro-especial-chip button:hover { background: rgba(213, 65, 35, 0.28); }

.list-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-wrap {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 0 12px;
}
.search-wrap svg { color: var(--text-muted); flex-shrink: 0; }
.search-wrap input {
  border: none;
  outline: none;
  padding: 10px 0;
  font-size: 0.92rem;
  width: 100%;
  background: transparent;
}

#status-filter {
  padding: 10px 14px;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: 0.9rem;
  min-width: 190px;
}

.dia-filter-wrap { display: flex; align-items: center; gap: 6px; }
.dia-filter-wrap input[type="date"] {
  padding: 10px 14px;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: 0.9rem;
  font-family: var(--font-mono);
}
.dia-filter-wrap .icon-btn { width: 38px; height: 38px; flex-shrink: 0; }

.table-card { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }

.tickets-table { width: 100%; border-collapse: collapse; min-width: 860px; }
.tickets-table th {
  text-align: left;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  white-space: nowrap;
}
.tickets-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  vertical-align: middle;
}
.tickets-table tbody tr:last-child td { border-bottom: none; }
.tickets-table tbody tr.clickable-row { cursor: pointer; outline: none; }
.tickets-table tbody tr.clickable-row:hover,
.tickets-table tbody tr.clickable-row:focus-visible { background: var(--primary-light); }

.ticket-num { font-family: var(--font-mono); font-weight: 700; color: var(--primary); }

/* ---------- tabela de usuários (Controladoria) ---------- */
#pessoas-tbody td:nth-child(3) { width: 200px; }
#pessoas-tbody td:nth-child(4) { width: 160px; }
#pessoas-tbody td:last-child { width: 92px; }

.oab-editor { display: flex; gap: 6px; }
.oab-numero-input {
  width: 82px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.84rem;
}
.oab-uf-select {
  width: 64px;
  padding: 6px 4px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.84rem;
}
.oab-editor-coluna { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.oab-editor-extra { align-items: center; }
.oab-extra-numero-input { width: 82px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; font-size: 0.84rem; }
.oab-extra-uf-select { width: 64px; padding: 6px 4px; border: 1px solid var(--border); border-radius: 7px; font-size: 0.84rem; }
.oab-extra-remover {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
}
.oab-extra-remover:hover { color: var(--red); }
.oab-adicionar-extra { font-size: 0.78rem; }
.oab-numero-input:disabled, .oab-uf-select:disabled { opacity: 0.6; }
.papel-toggle .toggle-label { color: var(--text-muted); }
.papel-toggle[aria-pressed="true"] .toggle-label { color: var(--primary); font-weight: 700; }
.papel-toggle:disabled { opacity: 0.5; cursor: not-allowed; }
.excluir-pessoa:disabled { opacity: 0.5; cursor: not-allowed; }
.ticket-client strong { display: block; }
.ticket-type-group span { display: block; }
.ticket-type-group .type { font-weight: 600; }
.ticket-type-group .group { font-size: 0.78rem; color: var(--text-muted); }

.prazo-cell.atrasado { color: var(--red); font-weight: 700; }
.prazo-cell .prazo-sub { display: block; font-size: 0.76rem; font-weight: 600; }

.progress-cell { min-width: 170px; }
.progress-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}
.status-badge.aguardando-complementacao { background: #fdf0d5; color: #8a4b0c; border: 1px dashed #c98a2f; }
.status-badge.aberto { background: #fbe6cf; color: #a05a0b; }
.status-badge.em-analise { background: #ded4f5; color: #5a3caf; }
.status-badge.em-andamento { background: #cfe3fb; color: #235694; }
.status-badge.aguardando-cliente { background: #f5e3cf; color: #92600c; }
.status-badge.cadastrado-no-cpj { background: #d3ecdb; color: #1f7a41; }
.status-badge.concluido { background: #d3ecdb; color: #1f7a41; }
.status-badge.cancelado { background: #e6e1df; color: #5c5254; }

.atraso-tag { font-size: 0.74rem; font-weight: 700; color: var(--red); }

.progress-bar-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.progress-bar-fill { height: 100%; border-radius: 999px; transition: width 0.3s ease; }
.progress-bar-fill.color-orange { background: var(--orange); }
.progress-bar-fill.color-red { background: var(--red); }
.progress-bar-fill.color-blue { background: var(--blue); }
.progress-bar-fill.color-green { background: var(--green); }
.progress-bar-fill.color-gray { background: #8a7f81; }

.empty-state { text-align: center; padding: 40px; color: var(--text-muted); font-size: 0.92rem; }

/* indicators vertical tab */
.indicators-tab {
  position: fixed;
  left: 232px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 22px 13px;
  border-radius: 0 14px 14px 0;
  box-shadow: 0 6px 22px rgba(213, 65, 35, 0.5);
  z-index: 15;
  transition: background 0.15s ease, box-shadow 0.15s ease, padding-right 0.15s ease;
}
.indicators-tab-icon { flex-shrink: 0; transform: rotate(90deg); }
.indicators-tab-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  white-space: nowrap;
}
.indicators-tab:hover {
  background: var(--primary-dark);
  padding-right: 20px;
  box-shadow: 0 8px 28px rgba(213, 65, 35, 0.6);
}

/* ===================== MODAL INDICADORES ===================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(21, 9, 12, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal-overlay[hidden] { display: none; }

.modal-panel {
  background: var(--bg);
  border-radius: var(--radius);
  width: 100%;
  max-width: 1180px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 28px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.3rem; font-weight: 800; }
.modal-header p { margin-top: 4px; color: var(--text-muted); font-size: 0.88rem; }

.modal-body { padding: 24px 28px 32px; overflow-y: auto; flex: 1; min-height: 0; }

.indicadores-filtros {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.indicadores-filtros .field { margin-bottom: 0; min-width: 150px; }
.indicadores-filtros .field[hidden] { display: none; }
.indicadores-filtros #ind-limpar-filtros { margin-left: auto; }

.metrics-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 26px;
}

.metric-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.metric-card .metric-value { font-size: 1.7rem; font-weight: 800; color: var(--primary); line-height: 1; }
.metric-card .metric-label { margin-top: 8px; font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

.metrics-row-compact { grid-template-columns: repeat(2, 1fr); max-width: 640px; }
.metrics-row-djen2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 26px; }
.metric-card .metric-sublabel { margin-top: 6px; font-size: 0.72rem; color: var(--text-muted); line-height: 1.4; }
.metric-card-alerta .metric-sublabel { color: #7a2a2a; }

.metric-card-alerta {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: var(--red-light);
  border-color: var(--red);
  transition: filter 0.15s ease;
}
.metric-card-alerta:hover { filter: brightness(0.97); }
.metric-card-alerta .metric-value { color: var(--red); }
.metric-card-alerta .metric-label { color: #7a2a2a; }

.indicadores-subtabs {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.subtab-btn {
  padding: 10px 4px;
  margin-bottom: -1px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}
.subtab-btn:hover { color: var(--primary); }
.subtab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.indicadores-painel { display: none; }
.indicadores-painel.active { display: block; }

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.chart-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.chart-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; }
.chart-hint { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 12px; }
.chart-wrap { position: relative; height: 220px; margin-top: 12px; }

.cpj-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cpj-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.cpj-item button {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
}
.cpj-item:hover { background: var(--primary-light); border-color: var(--primary); }
.cpj-name { font-weight: 600; font-size: 0.88rem; }
.cpj-count {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 10px;
  border-radius: 999px;
}

/* ===================== MODAL DETALHES DO CHAMADO ===================== */
.detalhes-panel { max-width: 1320px; }

.detalhes-layout {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}
.detalhes-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detalhes-card { padding: 22px 24px; }
.detalhes-card > h3 { font-size: 1rem; font-weight: 800; margin-bottom: 14px; }

.detalhes-cards-row {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 20px;
  align-items: start;
}

/* ---------- cabeçalho do modal de detalhes ---------- */
.detalhes-modal-header { align-items: center; gap: 20px; }
.detalhes-header-left { display: flex; align-items: center; gap: 16px; }
.detalhes-header-right { display: flex; align-items: center; gap: 16px; }

.detalhes-numero-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.detalhes-numero-chip span {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 700;
}
.detalhes-numero-chip strong { font-family: var(--font-mono); font-size: 1.15rem; color: var(--primary); font-weight: 800; }

.detalhes-header-titulos h2 { font-size: 1.25rem; }

.detalhes-prazo-pill { font-size: 0.85rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.detalhes-prazo-pill.atrasado { color: var(--red); }
.detalhes-prazo-pill[hidden] { display: none; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 16px 28px;
  background: var(--white);
  border-top: 1px solid var(--border);
}

.detalhes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 24px;
  margin-bottom: 8px;
}
.detalhes-grid-compacto {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 8px;
}

.detalhes-field { display: flex; flex-direction: column; gap: 4px; }
.detalhes-field.full { grid-column: span 2; }
.detalhes-field .label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  font-weight: 700;
}
.detalhes-field .value { font-size: 0.92rem; color: var(--text); }

.documento-atual-nome { font-size: 0.88rem; color: var(--text); margin: 0 0 6px; }
.campo-hint { font-size: 0.76rem; color: var(--text-muted); margin: 4px 0 0; }

.selo-datajud {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
}
.selo-datajud.selo-simulado { background: #fbe6cf; color: #92600c; }

.datajud-indisponivel { color: var(--text-muted); font-size: 0.9rem; font-style: italic; }

.datajud-card-resumo {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}
.datajud-card-resumo p { margin: 0 0 8px; font-size: 0.92rem; color: var(--text); }
.datajud-card-resumo p:last-of-type { margin-bottom: 0; }
.datajud-card-resumo strong { font-weight: 700; }

/* ---------- card combinado "Informações judiciais (DataJud + DJEN)" ---------- */
.secao-judicial-titulo {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
  color: var(--primary);
  margin: 22px 0 10px;
}
.secao-judicial-titulo:first-of-type { margin-top: 0; }

.djen-lista { display: flex; flex-direction: column; gap: 12px; }
.djen-publicacao {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.djen-publicacao-cabecalho {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 10px;
  margin-bottom: 4px;
}
.djen-publicacao-cabecalho strong { font-size: 0.92rem; color: var(--text); }
.djen-publicacao-tipo {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.djen-publicacao-orgao { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 8px; }
.djen-publicacao-texto { font-size: 0.86rem; color: var(--text); line-height: 1.5; }
.djen-publicacao-link {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.djen-publicacao-link:hover { text-decoration: underline; }

.djen-publicacao.critica { border-color: var(--red); background: #fbeeee; }
.djen-publicacao.nao-lida .djen-publicacao-cabecalho strong { font-weight: 800; }
.djen-publicacao-tipo.critica { color: var(--red); background: var(--red-light); }

.djen-publicacao-processo {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.djen-filtro-processo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.85rem;
}
.djen-filtro-processo select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.prazo-estimado {
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--border);
  color: var(--text-muted);
  cursor: help;
}
.prazo-estimado.proximo { background: #fff4e5; color: #96650a; }
.prazo-estimado.urgente, .prazo-estimado.atrasado { background: var(--red-light); color: var(--red); }
.prazo-estimado.sem-prazo { background: transparent; color: var(--text-muted); font-weight: 600; font-style: italic; padding-left: 0; }

.djen-publicacao-acoes {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
}

.djen-ver-completo {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}
.djen-ver-completo:hover { text-decoration: underline; }

.djen-toggle-lida {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
}
.djen-publicacao.lida .djen-toggle-lida { color: var(--green); border-color: var(--green); background: #e9f5ee; }
.djen-toggle-lida:disabled { opacity: 0.6; cursor: not-allowed; }

.djen-grupo-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-alt, #eee);
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.djen-grupo-toggle {
  margin-top: 10px;
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}
.djen-grupo-toggle:hover { text-decoration: underline; }
.djen-grupo-itens {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.djen-grupo-item { padding-left: 2px; }
.djen-grupo-item-parte { font-size: 0.84rem; font-weight: 600; color: var(--text); }
.djen-grupo-item .djen-publicacao-acoes { margin-top: 6px; }

.djen-status-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.djen-status-footer.alerta { color: var(--red); font-weight: 700; }

.oab-filtros-row { display: flex; gap: 24px; flex-wrap: wrap; }
.oab-dia-nav { display: flex; align-items: center; gap: 8px; }
.oab-dia-nav input[type="date"] {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 0.9rem;
  font-family: var(--font-mono);
}
.oab-dia-nav .btn-outline { padding: 8px 14px; font-size: 0.85rem; }

.oab-toggle-lida {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-left: auto;
}
.djen-publicacao.lida .oab-toggle-lida { color: var(--green); border-color: var(--green); background: #e9f5ee; }
.oab-toggle-lida:disabled { opacity: 0.6; cursor: not-allowed; }

.documento-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}
.documento-card .doc-name { font-weight: 600; font-size: 0.9rem; }

@media (max-width: 600px) {
  .detalhes-grid { grid-template-columns: 1fr; }
  .detalhes-field.full { grid-column: span 1; }
}

/* ---------- cabeçalho de detalhes (linha "Aberto por...") ---------- */
.detalhes-header-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}
.detalhes-header-info .sep { opacity: 0.5; }
.detalhes-header-info .atraso { color: var(--red); font-weight: 700; }

/* ---------- stepper de status ---------- */
.stepper-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.stepper-status-pill.aguardando { background: #f5e3cf; color: #92600c; }
.stepper-status-pill.cancelado { background: #e6e1df; color: #5c5254; }

.stepper {
  display: flex;
  align-items: flex-start;
  margin: 4px 0 24px;
}
.stepper-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  text-align: center;
}
.stepper-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  width: 100%;
  height: 3px;
  background: var(--border);
  z-index: 0;
}
.stepper-step.done:not(:last-child)::after { background: var(--primary); }
.stepper-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--border);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
}
.stepper-step.done .stepper-dot { border-color: var(--primary); background: var(--primary); color: #fff; }
.stepper-step.current .stepper-dot { border-color: var(--primary); background: #fff; color: var(--primary); }
.stepper-step.current.especial .stepper-dot { border-color: var(--orange); color: var(--orange); }
.stepper-step.current.cancelado .stepper-dot { border-color: #8a7f81; color: #8a7f81; }
.stepper-label { margin-top: 8px; font-size: 0.72rem; font-weight: 600; color: var(--text-muted); }
.stepper-step.done .stepper-label, .stepper-step.current .stepper-label { color: var(--text); }

/* ---------- stepper vertical (barra lateral fixa do painel de detalhes) ---------- */
.detalhes-stepper-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  padding-left: 24px;
  border-left: 1px solid var(--border);
}
.detalhes-stepper-sidebar h4 {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 18px;
}

.stepper.vertical {
  flex-direction: column;
  align-items: stretch;
  margin: 0;
}
.stepper.vertical .stepper-step {
  flex: none;
  flex-direction: row;
  align-items: flex-start;
  text-align: left;
  gap: 12px;
  padding-bottom: 30px;
}
.stepper.vertical .stepper-step:last-child { padding-bottom: 0; }
.stepper.vertical .stepper-step:not(:last-child)::after {
  top: 26px;
  left: 12px;
  width: 3px;
  height: calc(100% - 20px);
}
.stepper.vertical .stepper-label { margin-top: 4px; text-align: left; }

@media (max-width: 800px) {
  .detalhes-layout { flex-direction: column; }
  .detalhes-stepper-sidebar {
    width: 100%;
    position: static;
    order: -1;
    padding-left: 0;
    padding-bottom: 20px;
    border-left: none;
    border-bottom: 1px solid var(--border);
  }
  .detalhes-cards-row { grid-template-columns: 1fr; }
  .detalhes-header-left { flex-wrap: wrap; }
}

/* ---------- automações (só Controladoria) ---------- */
.automacoes-titulo {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 10px;
}
.automacoes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.automacao-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--primary-light);
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.automacao-card:hover { background: #f5d0c5; border-color: var(--primary); }
.automacao-card:active { transform: translateY(1px); }
.automacao-card:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.automacao-card .automacao-titulo { font-weight: 700; font-size: 0.9rem; color: var(--primary-dark); }
.automacao-card .automacao-desc { font-size: 0.76rem; color: var(--text-muted); }

.automacao-card.sucesso { background: #e3f2e9; border-color: var(--green); }
.automacao-card.sucesso:hover { background: #d3ecdd; border-color: var(--green); }
.automacao-card.sucesso .automacao-titulo { color: var(--green); }

/* ---------- histórico ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item {
  position: relative;
  padding: 0 0 18px 22px;
  border-left: 2px solid var(--border);
  margin-left: 5px;
}
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--white);
}
.timeline-texto { font-size: 0.88rem; font-weight: 600; }
.timeline-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

/* ---------- rodapé do painel de detalhes ---------- */
.detalhes-footer-readonly {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}
.readonly-tag { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

.detalhes-footer-editor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
  flex-wrap: wrap;
}
.detalhes-footer-editor .footer-actions { display: flex; align-items: center; gap: 10px; }
.saved-indicator { font-size: 0.8rem; font-weight: 700; color: var(--green); display: inline-flex; align-items: center; gap: 6px; }
.saved-indicator.pendente { color: var(--orange); }
.btn-danger-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--red);
}
.btn-danger-icon:hover { background: #fbe4e4; border-color: var(--red); }

.pessoa-acoes { display: flex; align-items: center; gap: 6px; }
.icon-btn:disabled, .btn-danger-icon:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 700px) {
  .automacoes-grid { grid-template-columns: 1fr; }
  .stepper-label { font-size: 0.62rem; }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1000px) {
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .field-span-3 { grid-column: span 2; }
  .charts-grid { grid-template-columns: 1fr; }
  .metrics-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
  .screen-login { flex-direction: column; }
  .login-visual { min-height: 300px; flex: none; }
  .login-visual-content { padding: 32px 28px 12px; }
  .login-visual-content h1 { font-size: 1.5rem; }
  .login-visual-footer { padding: 16px 28px 24px; }
  .login-form-side { flex: none; padding: 32px 24px; }

  .app-header { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .app-body { flex-direction: column; }
  .app-sidebar, .app-sidebar.collapsed { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 10px; overflow: auto; }
  .sidebar-toggle { display: none; }
  .app-tabs { flex-direction: row; gap: 4px; }
  .app-tabs-group { flex-direction: row; padding-top: 0; border-top: none; }
  .app-tabs-group-label { display: none; }
  .app-tab, .app-sidebar.collapsed .app-tab { flex: 1; flex-direction: column; gap: 4px; text-align: center; white-space: nowrap; padding: 8px 6px; }
  .app-sidebar.collapsed .app-tab-label { display: block; }
  .app-main { padding: 18px 16px; }
  .indicators-tab, .app-body.sidebar-collapsed .indicators-tab { left: 0; }

  .form-grid { grid-template-columns: 1fr; }
  .field-span-2, .field-span-3 { grid-column: span 1; }
  .dados-documento-grid { grid-template-columns: 1fr; }

  .metrics-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .user-chip-text { display: none; }
  .indicators-tab { padding: 16px 10px; }
  .indicators-tab-icon { width: 16px; height: 16px; }
  .indicators-tab-label { font-size: 0.76rem; }
  .metrics-row { grid-template-columns: 1fr 1fr; }
  .modal-body { padding: 18px 16px 24px; }
}

/* ===================== RELATÓRIO DO DIA ===================== */
.confirmacao-modal-panel { max-width: 460px; }
.confirmacao-body { display: flex; gap: 16px; align-items: flex-start; padding-bottom: 4px; }
.confirmacao-icone {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff4e5;
  color: #e08a00;
}
.confirmacao-icone.confirmacao-icone-destrutiva { background: var(--red-light); color: var(--red); }
.confirmacao-conteudo h3 { margin: 0 0 8px; font-size: 1.05rem; }
.confirmacao-conteudo p { margin: 0; font-size: 0.9rem; color: var(--text); line-height: 1.5; }

.relatorio-modal-panel { max-width: 560px; }
.relatorio-filtros-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
}
.relatorio-filtros-grid .field { margin-bottom: 0; }
.relatorio-previa { margin-top: 14px; font-size: 0.86rem; color: var(--text-muted); }

@media (max-width: 520px) {
  .relatorio-filtros-grid { grid-template-columns: 1fr; }
}

.relatorio-impressao {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #e9e1dd;
  overflow-y: auto;
  padding: 32px;
}
.relatorio-impressao[hidden] { display: none; }

.relatorio-toolbar {
  max-width: 900px;
  margin: 0 auto 16px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.relatorio-folha {
  max-width: 900px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 48px 56px;
}

.relatorio-cabecalho {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--primary);
}
.relatorio-marca {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.relatorio-titulo { text-align: right; }
.relatorio-titulo h1 { font-size: 1.3rem; font-weight: 800; }
.relatorio-titulo p { margin-top: 4px; color: var(--primary); font-weight: 700; }
.relatorio-filtros-aplicados { margin-top: 2px; color: var(--text-muted); font-weight: 500; font-size: 0.82rem; }

.relatorio-meta { margin: 18px 0; color: var(--text-muted); font-size: 0.85rem; }

.relatorio-tabela { width: 100%; border-collapse: collapse; }
.relatorio-tabela th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 10px 8px;
  border-bottom: 2px solid var(--border);
}
.relatorio-tabela td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.relatorio-vazio { text-align: center; color: var(--text-muted); font-style: italic; padding: 24px; }
.relatorio-link-tribunal {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}
.relatorio-link-tribunal:hover { text-decoration: underline; }

.dock-historico-filtro {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
  font-size: 0.85rem;
}
.dock-historico-filtro input[type="date"] {
  padding: 6px 8px;
  border: 1px solid var(--border, #ddd);
  border-radius: 6px;
  font-size: 0.85rem;
}

.relatorio-aviso-estimativa {
  margin: -8px 0 16px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff4e5;
  color: #96650a;
  font-size: 0.8rem;
}

.relatorio-tabela tr.linha-erro td { color: var(--red); }

.relatorio-prazo-situacao { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); }
.relatorio-prazo-situacao.proximo { color: #96650a; }
.relatorio-prazo-situacao.urgente, .relatorio-prazo-situacao.atrasado { color: var(--red); }

@media print {
  body > *:not(#relatorio-impressao) { display: none !important; }
  .relatorio-impressao { position: static; background: none; padding: 0; z-index: auto; overflow: visible; }
  .relatorio-toolbar.no-print { display: none !important; }
  .relatorio-folha { box-shadow: none; border-radius: 0; padding: 0; max-width: none; }
}

/* ===================== DOCK — PROTÓTIPO (JIRA) ===================== */
.app-tab-icon-logo {
  width: 18px;
  height: 18px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.dock-header { display: flex; align-items: center; gap: 14px; }
.dock-header-logo {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.app-tab-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--orange-light);
  color: #6b4400;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.prototipo-pill, .conectado-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--orange-light);
  color: #6b4400;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}
.conectado-pill { background: #d3ecdb; color: #1f7a41; }

.dock-aviso-prototipo {
  border-color: var(--orange);
  background: #fff4e5;
}
.dock-aviso-prototipo strong { color: #96650a; }
.dock-aviso-prototipo p { margin: 6px 0 0; color: var(--text-muted); font-size: 0.86rem; }

.dock-regra-card { margin-top: 16px; }
.dock-regra-lista { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 4px 0 0; padding: 0; }
.dock-regra-lista li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.86rem;
  color: var(--text);
  line-height: 1.5;
}
.dock-regra-ok, .dock-regra-espera, .dock-regra-fora {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.8rem;
}
.dock-regra-ok { background: #e2f0e6; color: var(--green); }
.dock-regra-espera { background: #fff4e5; color: #96650a; }
.dock-regra-fora { background: var(--bg); color: var(--text-muted); }

/* ---- board estilo Jira (cores/tokens inspirados no design do Jira, só
   pra deixar visualmente óbvio "isto é um espelho do Jira") ---- */
.jira-board {
  background: #f7f8f9;
  border: 1px solid #dfe1e6;
  border-radius: 6px;
  padding: 16px;
  margin-top: 8px;
}
.jira-coluna { width: 100%; }
.jira-coluna-cabecalho {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 12px;
}
.jira-coluna-titulo {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #44546f;
}
.jira-coluna-contador {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #dcdfe4;
  color: #44546f;
  font-size: 0.72rem;
  font-weight: 700;
}
.jira-coluna-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  align-items: start;
}

.jira-card {
  background: var(--white);
  border: 1px solid #dfe1e6;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(9, 30, 66, 0.08);
  padding: 12px 14px;
}
.jira-card-topo { display: flex; align-items: center; gap: 8px; }
.jira-card-tipo-icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 3px;
  flex-shrink: 0;
}
.jira-card-chave {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  font-weight: 700;
  color: #0c66e4;
}
.jira-card-anexo {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f4f5f7;
  border: 1px solid #dfe1e6;
  color: #44546f;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0;
}
.jira-card-anexo svg { flex-shrink: 0; }
.jira-card-anexo-texto { line-height: 1; }

.jira-card-resumo {
  margin: 8px 0 10px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #172b4d;
  line-height: 1.4;
}

.jira-card-rodape { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.jira-lozenge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 3px;
  background: #dcdfe4;
  color: #44546f;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.jira-tipo-label { font-size: 0.74rem; font-weight: 600; }

.dock-resultado-automacao {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
}
.dock-resultado-automacao.aguardando { background: #fdf0d5; color: #8a4b0c; border: 1px dashed #c98a2f; }
.dock-resultado-automacao.real { background: var(--bg); border: 1px solid var(--border); color: var(--text); }
.dock-resultado-automacao.erro { background: #fbe4e4; color: var(--red); border: 1px solid #f2c2c2; }
.dock-resultado-tag-real {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e2f0e6;
  color: var(--green);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.dock-extraido {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.dock-extraido-titulo { font-size: 0.76rem; color: var(--text-muted); font-style: italic; margin: 0 0 8px; }
.dock-extraido-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; }
.dock-campo { display: flex; flex-direction: column; gap: 2px; }
.dock-campo-rotulo { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.dock-campo-valor { font-size: 0.82rem; color: var(--text); }

@media (max-width: 520px) {
  .dock-extraido-grid { grid-template-columns: 1fr; }
}
