@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ============================================================================
   CAUSÁRIO — DESIGN SYSTEM & TOKENS DE IDENTIDADE JURÍDICA PREMIUM
   Diretrizes UI/UX Pro Max: Trust & Authority + Modern Tech Law + Alta Densidade
   Paleta Oficial extraída de logotipo.jpg:
   - Authority Deep Navy: #0E2A43 / #143048 (Petróleo Institucional)
   - Slate Tech Teal: #23657D / #1A4F62 (Engrenagens, Balança & Inteligência)
   - Luminous Cyan: #38BDF8 (Acentos de Alta Precisão Forense)
   Contraste WCAG 2.1 AA/AAA em todos os elementos de texto e foco
============================================================================ */

:root {
  /* Cores Institucionais do Causário — Extraídas da Identidade Visual Oficial */
  --causario-navy-dark: #07131F;
  --causario-navy-deep: #0E2A43;
  --causario-navy: #143048;
  --causario-navy-hover: #0C1E2D;
  --causario-navy-light: #23657D;
  --causario-navy-soft: rgba(20, 48, 72, 0.08);

  /* Acentos Tech Teal & Cyan do Logotipo Oficial */
  --causario-teal: #23657D;
  --causario-teal-hover: #1A4F62;
  --causario-teal-light: #2E819E;
  --causario-teal-soft: rgba(35, 101, 125, 0.12);
  --causario-teal-border: rgba(35, 101, 125, 0.35);

  --causario-cyan: #38BDF8;
  --causario-cyan-soft: rgba(56, 189, 248, 0.15);

  /* Variáveis de Destaque / Acento (alinhadas ao tom Teal / Petróleo da identidade) */
  --causario-gold: #23657D;
  --causario-gold-hover: #1A4F62;
  --causario-gold-soft: rgba(35, 101, 125, 0.12);
  --causario-gold-border: rgba(35, 101, 125, 0.35);

  /* Variáveis de Retrocompatibilidade */
  --pj-navy: #0E2A43;
  --pj-navy-dark: #07131F;
  --pj-navy-light: #143048;
  --pj-green: #23657D;
  --pj-green-hover: #1A4F62;
  --pj-green-soft: rgba(35, 101, 125, 0.10);
  --pj-blue: #23657D;
  --pj-amber: #E2A03F;
  --pj-red: #DC2626;
  --pj-purple: #7C3AED;

  /* Superfícies e Fundos */
  --bg-app: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-muted: #F1F5F9;
  --bg-surface-elevated: #FFFFFF;

  /* Tipografia & Textos */
  --text-main: #0F172A;
  --text-muted: #475569;
  --text-light: #94A3B8;
  --text-inverse: #FFFFFF;

  /* Bordas e Sombras */
  --border-color: #E2E8F0;
  --border-subtle: #CBD5E1;
  --border-focus: #23657D;
  --ring-focus: rgba(35, 101, 125, 0.25);

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.04), 0 6px 16px rgba(15, 23, 42, 0.04);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  /* Fontes */
  --font-brand: 'Outfit', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Outfit', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

body.theme-escuro {
  --causario-navy-dark: #050D15;
  --causario-navy-deep: #0A1926;
  --causario-navy: #38BDF8;
  --causario-navy-hover: #2BA7E0;
  --causario-navy-light: #7DD3FC;
  --causario-navy-soft: rgba(56, 189, 248, 0.15);

  --causario-teal: #38BDF8;
  --causario-teal-hover: #2BA7E0;
  --causario-teal-light: #7DD3FC;
  --causario-teal-soft: rgba(56, 189, 248, 0.15);
  --causario-teal-border: rgba(56, 189, 248, 0.4);

  --causario-gold: #38BDF8;
  --causario-gold-hover: #2BA7E0;
  --causario-gold-soft: rgba(56, 189, 248, 0.15);
  --causario-gold-border: rgba(56, 189, 248, 0.4);

  --pj-navy: #050D15;
  --pj-navy-dark: #03080E;
  --pj-navy-light: #0E2A43;
  --pj-green: #38BDF8;
  --pj-green-hover: #2BA7E0;
  --pj-green-soft: rgba(56, 189, 248, 0.15);

  --bg-app: #07111A;
  --bg-card: #0D1C2A;
  --bg-muted: #132638;
  --bg-surface-elevated: #183147;

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-light: #64748B;
  --text-inverse: #0F172A;

  --border-color: #1A374E;
  --border-subtle: #244966;
  --border-focus: #38BDF8;
  --ring-focus: rgba(56, 189, 248, 0.3);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.65);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ============================================================================
   RESET & TIPOGRAFIA GLOBAL
============================================================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  font-size: 13.5px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   1. TELA DE ACESSO INSTITUCIONAL CAUSÁRIO (LOGIN / PORTAL DO CLIENTE)
============================================================================ */

.login-screen {
  display: flex;
  min-height: 100vh;
  background: var(--bg-app);
}

.login-banner {
  flex: 1.15;
  background: linear-gradient(135deg, #07131F 0%, #0E2A43 40%, #143048 75%, #23657D 100%);
  color: #fff;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.login-banner::before {
  content: '';
  position: absolute;
  top: -160px;
  right: -160px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.22) 0%, transparent 70%);
  pointer-events: none;
}

.login-banner::after {
  content: '';
  position: absolute;
  bottom: -200px;
  left: -140px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(35, 101, 125, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  user-select: none;
}

.brand-img-logo {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), filter 0.22s ease;
}

.brand-img-logo:hover {
  transform: translateY(-1px) scale(1.02);
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: transparent;
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(35, 101, 125, 0.35);
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.brand-icon:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 6px 22px rgba(56, 189, 248, 0.45);
}

.brand-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-text-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.05;
}

.brand-title {
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.2px;
  color: #FFFFFF;
  display: flex;
  align-items: baseline;
}

.brand-c-glyph {
  font-size: 1.15em;
  font-weight: 900;
  background: linear-gradient(135deg, #7DD3FC 0%, #38BDF8 50%, #23657D 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-right: 1.5px;
  filter: drop-shadow(0 2px 4px rgba(35, 101, 125, 0.4));
}

.brand-sub {
  font-family: var(--font-body);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: #38BDF8;
  margin-top: 3px;
  opacity: 0.95;
}

/* Variante para fundo claro (login box e áreas claras) */
.brand-logo-dark .brand-title {
  color: var(--causario-navy);
}

.brand-logo-dark .brand-c-glyph {
  background: linear-gradient(135deg, #23657D 0%, #143048 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-logo-dark .brand-sub {
  color: var(--causario-teal);
}

.brand-badge {
  background: linear-gradient(135deg, var(--causario-teal) 0%, #143048 100%);
  color: #FFFFFF;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  align-self: center;
  margin-left: 2px;
}

.banner-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.banner-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #FCD34D;
  flex-shrink: 0;
}

.login-form-side {
  flex: 0.85;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px;
  background: var(--bg-card);
}

.login-box {
  width: 100%;
  max-width: 440px;
}

.login-box-header {
  text-align: center;
  margin-bottom: 26px;
}

.login-box-header h2 {
  font-size: 21px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 10px;
  letter-spacing: -0.3px;
}

.login-box-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================================
   2. SHELL PRINCIPAL DA APLICAÇÃO SPA
============================================================================ */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 268px;
  background: var(--causario-navy-dark);
  color: #E2E8F0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.28);
}

.sidebar-header {
  padding: 18px 20px 16px;
  background: #07131F;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
}

.nav-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748B;
  padding: 14px 12px 6px;
  font-weight: 800;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9.5px 12px;
  border: none;
  background: transparent;
  color: #94A3B8;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 2px;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 11px;
}

.nav-icon {
  width: 17px;
  height: 17px;
  stroke: #64748B;
  stroke-width: 2;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #FFFFFF;
  transform: translateX(3px);
}

.nav-item:hover .nav-icon {
  stroke: #38BDF8;
  transform: scale(1.1);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(20, 48, 72, 0.95) 0%, rgba(35, 101, 125, 0.85) 100%);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(20, 48, 72, 0.4);
  border-left: 3px solid #38BDF8;
}

.nav-item.active .nav-icon {
  stroke: #FFFFFF;
  filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.6));
}

.nav-counter {
  background: rgba(255, 255, 255, 0.12);
  color: #E2E8F0;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.nav-counter.urgent {
  background: #DC2626;
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.5);
  border-color: rgba(255, 255, 255, 0.3);
}

.sidebar-footer {
  padding: 16px 20px;
  background: #07131F;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 11.5px;
  color: #94A3B8;
}

/* ============================================================================
   3. TOPBAR E ÁREA PRINCIPAL
============================================================================ */

.main-area {
  flex: 1;
  margin-left: 268px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 64px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

body.theme-escuro .topbar {
  background: rgba(13, 21, 39, 0.92);
}

.office-institution-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.badge-icon-svg {
  width: 15px;
  height: 15px;
  stroke: var(--causario-navy);
  flex-shrink: 0;
}

body.theme-escuro .badge-icon-svg {
  stroke: var(--causario-gold);
}

.badge-oab-text {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  padding-left: 6px;
  border-left: 1px solid var(--border-color);
}

.badge-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  display: inline-block;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
  animation: pulse-dot 2.2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.global-search-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-muted);
  border: 1px solid var(--border-color);
  border-radius: 99px;
  padding: 0 10px 0 14px;
  height: 38px;
  max-width: 420px;
  flex: 1 1 240px;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  cursor: pointer;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.global-search-bar:hover {
  background: var(--bg-card);
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

body.theme-escuro .global-search-bar:hover {
  border-color: #475569;
  background: #1e293b;
}

.global-search-bar:focus-within {
  outline: none;
  background: var(--bg-card);
  border-color: var(--causario-navy);
  box-shadow: 0 0 0 3px var(--ring-focus);
}

.global-search-icon {
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  flex-shrink: 0;
  pointer-events: none;
}

.global-search-bar input {
  flex: 1;
  min-width: 0;
  border: none !important;
  background: transparent !important;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  padding: 0 !important;
  margin: 0;
  outline: none !important;
  box-shadow: none !important;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}

.search-kbd {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 11px;
  background: #e2e8f0;
  color: #475569;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  letter-spacing: 0.2px;
  user-select: none;
  pointer-events: none;
  line-height: 1.3;
}

body.theme-escuro .search-kbd {
  background: #1e293b;
  color: #94a3b8;
  border-color: #334155;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.timer-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-muted);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 600;
}

.timer-icon-svg {
  width: 15px;
  height: 15px;
  stroke: var(--causario-navy);
  flex-shrink: 0;
}

body.theme-escuro .timer-icon-svg {
  stroke: var(--causario-gold);
}

.timer-display {
  font-family: var(--font-mono);
  color: var(--causario-navy);
  font-weight: 700;
  letter-spacing: 0.5px;
}

body.theme-escuro .timer-display {
  color: var(--causario-gold);
}

.workspace-content {
  padding: 28px;
  flex: 1;
}

/* ============================================================================
   4. COMPONENTES VISUAIS (BENTO GRID, KPIS, CARDS, TABELAS)
============================================================================ */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 23px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.4px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--causario-navy) 0%, var(--causario-gold) 100%);
  opacity: 0.9;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.kpi-value {
  font-size: 25px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.6px;
  font-variant-numeric: tabular-nums;
}

.kpi-foot {
  font-size: 12px;
  color: var(--text-muted);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
  font-size: 14.5px;
  background: var(--bg-card);
}

.card-body {
  padding: 22px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 22px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}

/* ============================================================================
   5. TABELAS DE ALTA DENSIDADE E BADGES DE STATUS
============================================================================ */

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table.pj-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.pj-table th {
  text-align: left;
  padding: 9px 12px;
  background: var(--bg-muted);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

table.pj-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  font-size: 12.5px;
}

table.pj-table tr:hover td {
  background: var(--causario-navy-soft);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.badge-green {
  background: rgba(5, 150, 105, 0.12);
  color: #047857;
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.badge-blue {
  background: rgba(37, 99, 235, 0.12);
  color: #1D4ED8;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.badge-amber {
  background: rgba(217, 119, 6, 0.12);
  color: #B45309;
  border: 1px solid rgba(217, 119, 6, 0.28);
}

.badge-red {
  background: rgba(220, 38, 38, 0.12);
  color: #B91C1C;
  border: 1px solid rgba(220, 38, 38, 0.28);
}

.badge-purple {
  background: rgba(124, 58, 237, 0.12);
  color: #6D28D9;
  border: 1px solid rgba(124, 58, 237, 0.28);
}

.badge-gray {
  background: rgba(100, 116, 139, 0.12);
  color: #334155;
  border: 1px solid rgba(100, 116, 139, 0.25);
}

body.theme-escuro .badge-green { background: rgba(16, 185, 129, 0.18); color: #34D399; }
body.theme-escuro .badge-blue  { background: rgba(59, 130, 246, 0.18); color: #93C5FD; }
body.theme-escuro .badge-amber { background: rgba(245, 158, 11, 0.18); color: #FCD34D; }
body.theme-escuro .badge-red   { background: rgba(239, 68, 68, 0.18); color: #FCA5A5; }
body.theme-escuro .badge-gray  { background: rgba(148, 163, 184, 0.18); color: #E2E8F0; }

/* ============================================================================
   6. BOTÕES, CONTROLES E FORMULÁRIOS
============================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8.5px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--causario-navy) 0%, var(--causario-teal) 100%);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(20, 48, 72, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--causario-navy-hover) 0%, var(--causario-teal-hover) 100%);
  box-shadow: 0 4px 14px rgba(20, 48, 72, 0.45);
  transform: translateY(-1px);
}

.btn-gold {
  background: linear-gradient(135deg, var(--causario-teal) 0%, var(--causario-navy) 100%);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(35, 101, 125, 0.35);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--causario-teal-hover) 0%, var(--causario-navy-hover) 100%);
  box-shadow: 0 4px 14px rgba(35, 101, 125, 0.45);
  transform: translateY(-1px);
}

.btn-navy {
  background: var(--causario-navy-dark);
  color: #FFFFFF;
}

.btn-navy:hover {
  background: var(--causario-navy-deep);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-muted);
  border-color: var(--border-subtle);
}

.btn-sm {
  padding: 5px 11px;
  font-size: 12px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.form-control {
  padding: 9px 13px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: inherit;
  font-size: 13.5px;
  transition: all 0.18s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--causario-navy);
  box-shadow: 0 0 0 3px var(--ring-focus);
}

/* ============================================================================
   7. KANBAN DE PRAZOS & TAREFAS
============================================================================ */

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.kanban-col {
  background: var(--bg-muted);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 440px;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 13px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--causario-navy);
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: grab;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kanban-card.dragging {
  opacity: 0.45;
  cursor: grabbing;
  transform: scale(0.98);
}

.kanban-col.drag-over {
  background: rgba(56, 189, 248, 0.08) !important;
  border: 2px dashed var(--causario-cyan) !important;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.doc-header-preview {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  min-height: 110px;
  position: relative;
}

/* ============================================================================
   8. TIMELINE PROCESSUAL & MODAL
============================================================================ */

.timeline {
  border-left: 2px solid var(--causario-navy);
  margin-left: 12px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timeline-item {
  position: relative;
  background: var(--bg-muted);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--causario-gold);
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 6px rgba(217, 119, 6, 0.6);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 11, 22, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-panel.modal-dossie,
.modal-panel.modal-wide {
  max-width: 1100px;
  max-height: 94vh;
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 16px;
  background: var(--bg-muted);
  flex-shrink: 0;
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.doc-preview-sheet {
  background: #FFFFFF;
  color: #0F172A;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 36px 44px;
  font-family: 'Georgia', serif;
  line-height: 1.7;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.tabs-bar {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  color: var(--causario-navy);
}

.tab-btn.active {
  color: var(--causario-navy);
  border-bottom-color: var(--causario-gold);
}

body.theme-escuro .tab-btn.active {
  color: var(--causario-gold);
  border-bottom-color: var(--causario-gold);
}

.tab-svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  flex-shrink: 0;
}

.quick-login-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  background: var(--bg-muted);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-login-chip svg {
  stroke: var(--causario-navy);
}

body.theme-escuro .quick-login-chip svg {
  stroke: var(--causario-gold);
}

.quick-login-chip:hover {
  background: var(--causario-navy-soft);
  border-color: var(--causario-navy);
  color: var(--causario-navy);
}

.hidden {
  display: none !important;
}


/* ============================================================================
   LEADSIM-INSPIRED GLASS, FLOATING ROUNDED SHELL & COMPONENT TOKENS
   Referência direta de c:\python\leadsim\backend\templates\base.html
============================================================================ */

:root {
  --glass-bg: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-blur: blur(14px);
  --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-soft: 0 4px 18px 0 rgba(0, 0, 0, 0.05);
  --sidebar-width: 275px;
  --sidebar-collapsed-width: 80px;
}

body.theme-escuro {
  --glass-bg: rgba(13, 28, 42, 0.88);
  --glass-border: rgba(56, 189, 248, 0.22);
  --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 4px 18px 0 rgba(0, 0, 0, 0.35);
}

/* Ambient Radial Mesh Background (LeadSim style) */
body {
  background-color: var(--bg-app);
  background-image: 
    radial-gradient(at 0% 0%, hsla(214, 32%, 91%, 0.85) 0, transparent 50%), 
    radial-gradient(at 100% 0%, hsla(217, 32%, 91%, 0.85) 0, transparent 50%);
  background-attachment: fixed;
}

body.theme-escuro {
  background-image: 
    radial-gradient(at 0% 0%, rgba(14, 42, 67, 0.7) 0, transparent 50%), 
    radial-gradient(at 100% 0%, rgba(35, 101, 125, 0.35) 0, transparent 50%);
}

/* Layout Shell Inspirado em LeadSim - Sem gap vazando dados no topo */
.app-shell {
  display: flex !important;
  flex-wrap: nowrap !important;
  padding: 0 1.25rem 1.25rem 1.25rem !important;
  gap: 1.25rem !important;
  min-height: 100vh !important;
  width: 100% !important;
  box-sizing: border-box !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Floating Rounded Sidebar (LeadSim) */
.sidebar {
  width: var(--sidebar-width) !important;
  background: var(--bg-card) !important;
  border-radius: var(--radius-xl) !important;
  padding: 1.5rem 1rem !important;
  display: flex !important;
  flex-direction: column !important;
  position: sticky !important;
  top: 1.25rem !important;
  margin-top: 1.25rem !important;
  height: calc(100vh - 2.5rem) !important;
  z-index: 1000 !important;
  box-shadow: var(--shadow-sm) !important;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease !important;
  border: 1px solid var(--border-color) !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

body:not(.theme-escuro) .sidebar {
  background: #F8FAFC !important;
  border-color: #E2E8F0 !important;
}

body:not(.theme-escuro) .sidebar-header {
  background: transparent !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

body:not(.theme-escuro) .sidebar-footer {
  background: transparent !important;
  border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
}

body:not(.theme-escuro) #sidebar-office-name {
  color: var(--text-main) !important;
}

body:not(.theme-escuro) .nav-item {
  color: var(--text-muted) !important;
}

body:not(.theme-escuro) .nav-item:hover {
  color: var(--causario-navy) !important;
  background: rgba(35, 101, 125, 0.08) !important;
}

body:not(.theme-escuro) .nav-item.active {
  background: #FFFFFF !important;
  color: var(--causario-navy) !important;
  box-shadow: var(--shadow-sm) !important;
  border-left: 3px solid var(--causario-teal) !important;
}

body:not(.theme-escuro) .nav-item.active .nav-icon {
  stroke: var(--causario-teal) !important;
  filter: none !important;
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
  position: absolute;
  right: -12px;
  top: 36px;
  width: 24px;
  height: 24px;
  background: var(--causario-teal);
  border: 2px solid var(--bg-card);
  border-radius: 50%;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  z-index: 1010;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.sidebar-toggle-btn:hover {
  background: var(--causario-navy-deep);
  transform: scale(1.15);
}

/* Collapsed Sidebar Behavior (LeadSim) */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-width, 78px) !important;
  min-width: var(--sidebar-collapsed-width, 78px) !important;
  padding: 1.25rem 0.45rem !important;
  align-items: center !important;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), padding 0.25s ease !important;
}

.sidebar.collapsed .sidebar-header {
  padding: 8px 0 14px 0 !important;
  justify-content: center !important;
  text-align: center !important;
  width: 100% !important;
}

.sidebar.collapsed .sidebar-brand {
  justify-content: center !important;
  width: 100% !important;
  margin: 0 auto !important;
  text-align: center !important;
}

.sidebar.collapsed .brand-img-full,
.sidebar.collapsed .nav-item-text,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .sidebar-office-info,
.sidebar.collapsed .logout-text {
  display: none !important;
}

.sidebar.collapsed .brand-img-icon {
  display: block !important;
  margin: 0 auto !important;
  width: 38px !important;
  height: 38px !important;
  object-fit: contain !important;
}

.sidebar.collapsed .sidebar-nav {
  width: 100% !important;
  padding: 8px 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  overflow-x: hidden !important;
}

.sidebar.collapsed .nav-item {
  width: 48px !important;
  height: 44px !important;
  margin: 0 auto 6px auto !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 12px !important;
  position: relative !important;
  text-align: center !important;
  border-left: none !important;
  transform: none !important;
}

.sidebar.collapsed .nav-item:hover {
  transform: scale(1.06) !important;
}

.sidebar.collapsed .nav-item.active {
  border-left: none !important;
  box-shadow: 0 4px 14px rgba(35, 101, 125, 0.35) !important;
}

.sidebar.collapsed .nav-item-left {
  gap: 0 !important;
  justify-content: center !important;
  margin: 0 !important;
  width: 100% !important;
}

.sidebar.collapsed .nav-icon {
  width: 20px !important;
  height: 20px !important;
  margin: 0 auto !important;
}

.sidebar.collapsed .nav-counter {
  position: absolute !important;
  top: 2px !important;
  right: 2px !important;
  min-width: 16px !important;
  height: 16px !important;
  padding: 0 4px !important;
  font-size: 9px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 99px !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) !important;
  border: 1.5px solid var(--bg-card) !important;
  z-index: 2 !important;
}

.sidebar.collapsed .sidebar-footer {
  width: 100% !important;
  padding: 10px 0 0 0 !important;
  display: flex !important;
  justify-content: center !important;
}

.sidebar.collapsed .logout-btn-premium {
  width: 46px !important;
  height: 42px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  justify-content: center !important;
  border-radius: 12px !important;
}

/* Pinned Logout Button (LeadSim) */
.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
}

.logout-btn-premium {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #EF4444;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
  box-sizing: border-box;
}

.logout-btn-premium:hover {
  background: rgba(239, 68, 68, 0.16);
  color: #DC2626;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.2);
}

.sidebar.collapsed .logout-btn-premium {
  padding: 10px 0;
  justify-content: center;
}

/* Floating Glass Topbar (LeadSim) */
.main-area {
  flex: 1 !important;
  margin-left: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 1.25rem !important;
  min-width: 0 !important;
  padding-top: 0 !important;
  margin-top: 0 !important;
}

.topbar {
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid var(--border-color) !important;
  border-left: 1px solid var(--border-color) !important;
  border-right: 1px solid var(--border-color) !important;
  border-top: none !important;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  border-bottom-left-radius: var(--radius-lg) !important;
  border-bottom-right-radius: var(--radius-lg) !important;
  padding: 0.75rem 1.5rem !important;
  height: auto !important;
  min-height: 64px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  position: sticky !important;
  top: 0 !important;
  margin-top: 0 !important;
  z-index: 95 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
  box-sizing: border-box !important;
}

body.theme-escuro .topbar {
  background: rgba(14, 25, 45, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.35) !important;
}

.mobile-menu-btn {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  flex-shrink: 0;
}

.topbar-icon-btn {
  position: relative;
  cursor: pointer;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar-icon-btn:hover {
  color: var(--causario-teal);
  border-color: var(--causario-teal);
  transform: translateY(-1px);
}

.notif-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #EF4444;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.user-profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 6px 4px 10px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.user-profile-chip:hover {
  border-color: var(--causario-teal);
  box-shadow: var(--shadow-sm);
}

.user-profile-meta {
  text-align: right;
  line-height: 1.15;
}

.user-name {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
}

.user-role-badge {
  font-size: 10.5px;
  color: var(--causario-teal);
  font-weight: 600;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--bg-card);
  box-shadow: var(--shadow-sm);
}

/* Workspace Content Container */
.workspace-content {
  padding: 0 !important;
  flex: 1 !important;
  min-width: 0 !important;
}

/* Modern LeadSim Stat Cards Grid */
.stats-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
  gap: 1.25rem !important;
  margin-bottom: 1.75rem !important;
}

.stat-card {
  background: var(--bg-card) !important;
  border-radius: var(--radius-lg) !important;
  padding: 1.35rem 1.5rem !important;
  border: 1px solid var(--border-color) !important;
  border-left: 4px solid var(--causario-teal) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.75rem !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: var(--shadow-sm) !important;
  position: relative !important;
  overflow: hidden !important;
}

.stat-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: var(--shadow-md) !important;
  border-color: var(--causario-teal) !important;
}

.stat-card.stat-warning { border-left-color: #F59E0B !important; }
.stat-card.stat-success { border-left-color: #10B981 !important; }
.stat-card.stat-danger  { border-left-color: #EF4444 !important; }
.stat-card.stat-info    { border-left-color: #0EA5E9 !important; }
.stat-card.stat-primary { border-left-color: var(--causario-teal) !important; }

.stat-card-top {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

.stat-card .label {
  font-size: 11.5px !important;
  font-weight: 800 !important;
  color: var(--text-muted) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  margin-bottom: 4px !important;
}

.stat-card .value {
  font-size: 1.85rem !important;
  font-weight: 900 !important;
  color: var(--text-main) !important;
  line-height: 1.1 !important;
  letter-spacing: -0.02em !important;
}

.stat-card .icon-box {
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.stat-card .foot {
  font-size: 12px !important;
  color: var(--text-muted) !important;
  margin-top: auto !important;
}

/* Operational Alert Banners (LeadSim ops-alert) */
.ops-alert {
  padding: 0.85rem 1.25rem !important;
  border-radius: var(--radius-md) !important;
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
  border: 1px solid transparent !important;
  border-left-width: 4px !important;
  margin-bottom: 1.25rem !important;
  animation: slideInLeft 0.3s ease-out !important;
}

.ops-alert-warning {
  background: rgba(245, 158, 11, 0.08) !important;
  border-color: rgba(245, 158, 11, 0.2) !important;
  border-left-color: #F59E0B !important;
}

.ops-alert-info {
  background: rgba(14, 165, 233, 0.08) !important;
  border-color: rgba(14, 165, 233, 0.2) !important;
  border-left-color: #0EA5E9 !important;
}

.ops-alert-danger {
  background: rgba(239, 68, 68, 0.08) !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
  border-left-color: #EF4444 !important;
}

.ops-alert .alert-icon-box {
  background: var(--bg-card) !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: var(--shadow-sm) !important;
  flex-shrink: 0 !important;
}

.ops-alert .alert-msg {
  flex: 1 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--text-main) !important;
}

/* Dashboard Header LeadSim Welcome */
.dashboard-header {
  margin-bottom: 1.75rem !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-end !important;
  flex-wrap: wrap !important;
  gap: 14px !important;
}

.dashboard-welcome {
  font-size: 2rem !important;
  font-weight: 800 !important;
  color: var(--text-main) !important;
  letter-spacing: -0.03em !important;
  line-height: 1.2 !important;
}

.gradient-text {
  background: linear-gradient(135deg, var(--causario-teal) 0%, #38BDF8 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

.dashboard-subtitle {
  color: var(--text-muted) !important;
  margin: 0.35rem 0 0 0 !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
}

/* Toast Notifications Container & Items (LeadSim) */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 20000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--causario-teal);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 320px;
  max-width: 460px;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
  from { transform: translateX(110%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-item.toast-fadeout {
  animation: toastFadeOut 0.3s forwards;
}

@keyframes toastFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

.toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-msg {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
}

/* Confirmation Modal (LeadSim confirm-modal) */
.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15000;
  padding: 1.5rem;
}

.confirm-modal-overlay.hidden {
  display: none !important;
}

.confirm-modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-float);
  text-align: center;
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-icon-box {
  width: 56px;
  height: 56px;
  background: rgba(245, 158, 11, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  color: #F59E0B;
}

.confirm-icon-box svg {
  width: 28px;
  height: 28px;
}

.confirm-modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.confirm-modal-actions .btn {
  flex: 1;
}

/* Responsive Off-Canvas Drawer (LeadSim) */
@media (max-width: 1024px) {
  .app-shell {
    padding: 0.75rem !important;
    gap: 0.75rem !important;
  }
}

@media (max-width: 768px) {
  .app-shell {
    padding: 0 0.5rem 0.5rem 0.5rem !important;
    gap: 0.5rem !important;
    flex-direction: column !important;
  }
  .sidebar {
    position: fixed !important;
    left: -320px !important;
    top: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    width: 280px !important;
    border-radius: 0 !important;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.4) !important;
    z-index: 99999 !important;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }
  .sidebar.mobile-open {
    left: 0 !important;
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99998;
  }
  .sidebar-backdrop.active {
    display: block !important;
  }
  .mobile-menu-btn {
    display: inline-flex !important;
  }
  .sidebar-toggle-btn {
    display: none !important;
  }
  .topbar {
    padding: 0.6rem 0.85rem !important;
    top: 0 !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
  }
  .global-search-bar {
    max-width: 180px !important;
  }
}


/* ============================================================================
   CORREÇÃO CRÍTICA DE VISIBILIDADE / TELA DE LOGIN & MENU TRANSPARENTE
============================================================================ */

/* Garante que elementos com .hidden nunca sejam renderizados mesmo com flex !important */
#app-view.hidden,
#login-view.hidden,
.app-shell.hidden,
.login-screen.hidden,
.hidden {
  display: none !important;
}

#app-view:not(.hidden) {
  display: flex !important;
}

#login-view:not(.hidden) {
  display: flex !important;
}

/* Sidebar Header com Fundo 100% Transparente e Logotipo Perfeitamente Centralizado */
.sidebar-header {
  background: transparent !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
  padding: 14px 12px 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  width: 100% !important;
}

body.theme-escuro .sidebar-header {
  background: transparent !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.sidebar-brand {
  background: transparent !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  margin: 0 auto !important;
  text-align: center !important;
}

.sidebar-brand .brand-img-full {
  margin: 0 auto !important;
  display: block !important;
  max-width: 100% !important;
}

.sidebar-brand .brand-img-icon {
  margin: 0 auto !important;
  display: none;
}

/* Melhorias na Tela de Login */
.login-screen {
  min-height: 100vh !important;
  width: 100% !important;
  background: var(--bg-body, #F8FAFC) !important;
  background-image: 
    radial-gradient(at 0% 0%, hsla(214, 32%, 91%, 0.85) 0, transparent 50%), 
    radial-gradient(at 100% 0%, hsla(217, 32%, 91%, 0.85) 0, transparent 50%) !important;
}

.login-form-side {
  background: var(--bg-card) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.03) !important;
}

.quick-login-chip {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-login-chip:hover {
  background: var(--causario-teal, #23657D);
  color: #ffffff;
  border-color: var(--causario-teal, #23657D);
  transform: translateY(-1px);
}

/* ============================================================================
   ESTILOS PARA O COPILOT JURÍDICO IA AVANÇADO
============================================================================ */

.ia-prompt-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.ia-prompt-chip {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.ia-prompt-chip:hover {
  border-color: var(--causario-teal);
  color: var(--causario-teal);
  background: rgba(35, 101, 125, 0.06);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.ia-prompt-chip.active {
  background: var(--causario-teal);
  color: #ffffff;
  border-color: var(--causario-teal);
  box-shadow: 0 4px 10px rgba(35, 101, 125, 0.25);
}

.ia-chat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.ia-response-bubble {
  background: var(--bg-muted, #F8FAFC);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-main);
  white-space: pre-wrap;
  font-family: var(--font-body);
}

body.theme-escuro .ia-response-bubble {
  background: rgba(14, 28, 44, 0.6);
  border-color: rgba(56, 189, 248, 0.2);
}

.ia-actions-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.ia-model-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(35, 101, 125, 0.1);
  color: var(--causario-teal);
}



/* ============================================================================
   RESPONSIVIDADE E VISIBILIDADE CNJ & PARCELAS (RESOLUÇÃO ADAPTATIVA)
============================================================================ */

/* Container de busca na Base Real do CNJ (DJEN / Comunica PJe) */
.cnj-live-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  align-items: flex-end;
  width: 100%;
}

.cnj-live-search-btn-container {
  display: flex;
  align-items: flex-end;
  min-width: 220px;
}

.cnj-live-search-btn-container .btn {
  width: 100%;
  min-height: 40px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: normal;
  text-align: center;
  padding: 8px 16px;
  line-height: 1.25;
}

@media (min-width: 1600px) {
  .cnj-live-search-grid {
    grid-template-columns: 1.3fr 1fr 1.2fr 1fr auto;
  }
  .cnj-live-search-btn-container {
    min-width: auto;
  }
  .cnj-live-search-btn-container .btn {
    width: auto;
    white-space: nowrap;
    padding: 0 20px;
    height: 40px;
  }
}

/* Botões Especializados de Parcelas e Honorários */
.btn-parcelas-ver {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #047857 !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  font-weight: 600 !important;
  font-size: 11.5px !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  transition: all 0.2s ease !important;
}

.btn-parcelas-ver:hover {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

body.theme-escuro .btn-parcelas-ver {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
  border-color: rgba(52, 211, 153, 0.4) !important;
}

body.theme-escuro .btn-parcelas-ver:hover {
  background: #059669 !important;
  color: #ffffff !important;
}

.btn-parcelas-gerar {
  background: rgba(35, 101, 125, 0.1) !important;
  color: var(--causario-teal, #23657D) !important;
  border: 1px solid rgba(35, 101, 125, 0.35) !important;
  font-weight: 600 !important;
  font-size: 11.5px !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  transition: all 0.2s ease !important;
}

.btn-parcelas-gerar:hover {
  background: var(--causario-teal, #23657D) !important;
  color: #ffffff !important;
  border-color: var(--causario-teal, #23657D) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(35, 101, 125, 0.3);
}

body.theme-escuro .btn-parcelas-gerar {
  background: rgba(56, 189, 248, 0.15) !important;
  color: #38bdf8 !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
}

body.theme-escuro .btn-parcelas-gerar:hover {
  background: #0284c7 !important;
  color: #ffffff !important;
}

/* Responsividade das Tabelas e Colunas de Ações */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.table-wrap::-webkit-scrollbar {
  height: 6px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.table-actions-cell {
  text-align: right;
  white-space: nowrap;
}

.table-actions-flex {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
}

@media (max-width: 1200px) {
  .pj-table th, .pj-table td {
    padding: 10px 12px;
    font-size: 12.5px;
  }
  .table-actions-flex {
    gap: 4px;
  }
  .table-actions-flex .btn-sm {
    padding: 4px 8px;
    font-size: 11px;
  }
}

@media (max-width: 768px) {
  .cnj-live-search-grid {
    grid-template-columns: 1fr;
  }
  .cnj-live-search-btn-container {
    width: 100%;
  }
  .cnj-live-search-btn-container .btn {
    width: 100%;
  }
}

/* ============================================================================
   PORTAL DO CLIENTE & SAAS ADMIN CONSOLE STYLES (CAUSÁRIO CLEAN)
============================================================================ */

.portal-cliente-shell,
.saas-admin-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  background: var(--bg-main);
  animation: fadeIn 0.25s ease-in-out;
}

.portal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.saas-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  background: #07131f;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#impersonate-banner {
  transition: all 0.3s ease;
}

@media (max-width: 768px) {
  .portal-topbar,
  .saas-topbar {
    padding: 0 14px;
    height: auto;
    min-height: 60px;
    flex-wrap: wrap;
    gap: 10px;
  }
}

/* ============================================================================
   DOSSIÊ COMPLETO DO CASO — ARQUITETURA LIMPA E PROGRESSIVE DISCLOSURE
============================================================================ */

.dossie-header-card {
  background: var(--bg-muted);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.dossie-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.dossie-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.dossie-cnj-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--causario-navy);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 3px 10px;
  border-radius: 6px;
}

.dossie-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dossie-more-menu {
  position: relative;
}

.dossie-more-menu summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.dossie-more-menu summary::-webkit-details-marker {
  display: none;
}

.dossie-more-menu summary:hover {
  border-color: var(--causario-teal);
  color: var(--causario-teal);
}

.dossie-more-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dossie-more-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-main);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}

.dossie-more-item:hover {
  background: var(--bg-muted);
}

.dossie-more-item.danger {
  color: #dc2626;
}

.dossie-more-item.danger:hover {
  background: rgba(220, 38, 38, 0.08);
}

.dossie-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 12px 0;
  line-height: 1.35;
}

.dossie-meta-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.dossie-meta-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dossie-meta-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}

.dossie-meta-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dossie-nav-tabs {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 10px 0 10px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.04) 0%, rgba(15, 23, 42, 0.07) 100%);
  border: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  border-radius: 12px 12px 0 0;
  margin-bottom: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.dossie-nav-tabs::-webkit-scrollbar {
  display: none;
}

.dossie-nav-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-bottom: none;
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 9px 9px 0 0;
  margin-bottom: 0;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.dossie-nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.88);
  border-color: var(--border-color);
}

.dossie-nav-tab.active {
  background: var(--bg-card);
  color: var(--causario-navy, #0f172a);
  border-color: var(--border-color);
  border-top: 3px solid var(--causario-teal);
  border-bottom: 2px solid var(--bg-card);
  margin-bottom: -1px;
  padding-top: 9px;
  padding-bottom: 11px;
  font-weight: 700;
  z-index: 2;
  box-shadow: 0 -3px 10px rgba(15, 23, 42, 0.05);
}

#pasta-conteudo-aba {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 18px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
}

.dossie-tab-count {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-muted);
}

.dossie-nav-tab.active .dossie-tab-count {
  background: var(--causario-teal);
  color: #ffffff;
}

.dossie-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.dossie-stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dossie-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
}

.dossie-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dossie-party-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dossie-party-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg-muted);
  border-radius: 8px;
  border-left: 3px solid var(--border-subtle);
}

.dossie-party-row.is-client {
  border-left-color: #16a34a;
}

.dossie-party-row.is-opposing {
  border-left-color: #d97706;
}

.dossie-party-row.is-lawyer {
  border-left-color: var(--causario-teal);
}

@media (max-width: 860px) {
  .dossie-meta-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .dossie-summary-strip {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   AÇÕES DO CASO — TOOLBAR MODERNA E ÍCONES PREMIUM DE ALTA DENSIDADE
============================================================================ */
.case-actions-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: nowrap;
}

.case-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #143048, #23657D);
  color: #ffffff !important;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(20, 48, 72, 0.2);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  text-decoration: none;
}

.case-btn-primary:hover {
  background: linear-gradient(135deg, #0e2436, #1c5266);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(20, 48, 72, 0.35);
}

.case-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 29px;
  height: 29px;
  padding: 0;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.case-btn-icon:hover {
  background: var(--bg-muted);
  color: var(--causario-navy);
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

body.theme-escuro .case-btn-icon:hover {
  color: #38bdf8;
  border-color: #475569;
}

.case-btn-icon.active-fin {
  color: #059669;
  border-color: rgba(5, 150, 105, 0.35);
  background: rgba(5, 150, 105, 0.06);
}

.case-btn-icon.active-fin:hover {
  background: rgba(5, 150, 105, 0.14);
  border-color: #059669;
}

.case-btn-icon.warn-cnj {
  color: #d97706;
  border-color: rgba(217, 119, 6, 0.35);
  background: rgba(217, 119, 6, 0.06);
}

.case-btn-icon.warn-cnj:hover {
  background: rgba(217, 119, 6, 0.15);
  border-color: #d97706;
}

.case-btn-icon.danger-del {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.25);
}

.case-btn-icon.danger-del:hover {
  background: rgba(220, 38, 38, 0.1);
  border-color: #dc2626;
  color: #b91c1c;
}

.case-badge-pill {
  position: absolute;
  top: -4px;
  right: -5px;
  background: #059669;
  color: #ffffff;
  font-size: 8.5px;
  font-weight: 800;
  padding: 0 4px;
  min-width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  border-radius: 99px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  border: 1.5px solid var(--bg-card);
}

/* ============================================================================
   CONTRATOS & HONORÁRIOS — LISTAGEM E AÇÕES APRIMORADAS
   ============================================================================ */

.contract-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.contract-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 99px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.contract-pill-btn:hover {
  border-color: var(--causario-teal);
  color: var(--text-main);
  background: var(--bg-muted);
}

.contract-pill-btn.active {
  background: linear-gradient(135deg, #143048, #23657D);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(20, 48, 72, 0.22);
}

.contract-proc-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  font-family: monospace;
  color: var(--causario-teal);
  background: rgba(35, 101, 125, 0.08);
  border: 1px solid rgba(35, 101, 125, 0.22);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.contract-proc-link:hover {
  background: rgba(35, 101, 125, 0.16);
  border-color: var(--causario-teal);
  transform: translateY(-1px);
}

.contract-progress-track {
  width: 100%;
  max-width: 125px;
  height: 5px;
  background: var(--border-color);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 4px;
}

.contract-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.contract-more-menu {
  position: relative;
  display: inline-block;
}

.contract-more-menu > summary {
  list-style: none;
  width: 29px;
  height: 29px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  user-select: none;
  transition: all 0.2s ease;
}

.contract-more-menu > summary::-webkit-details-marker {
  display: none;
}

.contract-more-menu > summary:hover {
  background: var(--bg-muted);
  color: var(--text-main);
  border-color: #cbd5e1;
}

