/* ========== PROJETOS • EQUIPE / MEMBROS ========== */
.proj-members-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 0.9rem;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.proj-members-list {
  max-height: 220px;
  overflow-y: auto;
  border-radius: 8px;
}

.proj-members-list .list-group-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.proj-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f8fafc;
  font-size: 0.85rem;
}

.proj-member-chip.locked {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.proj-avatar {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.proj-member-chip .chip-remove {
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.proj-member-chip .chip-remove:hover {
  color: #ef4444;
}

.proj-members-card .form-control:focus {
  box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.15);
}
.ed-membros-area {
  position: relative;
}

.ed-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ed-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f8fafc;
  font-size: 0.85rem;
}

.ed-chip-fixed {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.ed-chip-initial {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.ed-chip-badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
}

.ed-chip-remove {
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.ed-chip-remove:hover {
  color: #ef4444;
}

.ed-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1050;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  max-height: 240px;
  overflow-y: auto;
  margin-top: 0.35rem;
}

.ed-suggestion-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

.ed-suggestion-item:hover,
.ed-suggestion-item.active {
  background: #f1f5f9;
}

@media (max-width: 576px) {
  .ed-suggestions {
    position: static;
    width: 100%;
  }
}
/* =========================================================
   ANALYTIAGESTOR - SISTEMA DE DESIGN CORPORATIVO v2.0 (refinado)
   (Base + ajustes de compatibilidade com HTML antigo + app.js)
   ========================================================= */

/* ========== 1. VARIÁVEIS APRIMORADAS (Design Tokens) ========== */
:root {
  --ed-primary: #0f766e;
  --ed-primary-light: #2dd4bf;
  --ed-primary-dark: #115e59;
  --ed-primary-darker: #134e4a;
  --ed-primary-soft: #ecfeff;
  --ed-primary-glow: rgba(15, 118, 110, 0.15);

  --ed-secondary: #64748b;
  --ed-secondary-light: #94a3b8;
  --ed-secondary-dark: #475569;

  --ed-success: #22c55e;
  --ed-success-dark: #16a34a;
  --ed-warning: #f59e0b;
  --ed-warning-dark: #d97706;
  --ed-danger: #ef4444;
  --ed-danger-dark: #dc2626;
  --ed-info: #14b8a6;

  --ed-white: #ffffff;
  --ed-gray-50: #f8fafc;
  --ed-gray-100: #f1f5f9;
  --ed-gray-200: #e2e8f0;
  --ed-gray-300: #cbd5e1;
  --ed-gray-400: #94a3b8;
  --ed-gray-500: #64748b;
  --ed-gray-600: #475569;
  --ed-gray-700: #334155;
  --ed-gray-800: #1e293b;
  --ed-gray-900: #0f172a;

  --ed-bg-base: #f8fafc; /* Removed gradient for better perf on weak GPUs */
  --ed-card-bg: #ffffff;
  --ed-card-bg-hover: #fafbfc;
  --ed-border: #e2e8f0;
  --ed-border-light: #f1f5f9;

  /* Lighter shadows */
  --ed-shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --ed-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --ed-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --ed-shadow-md: 0 6px 10px -3px rgba(0, 0, 0, 0.1);
  --ed-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --ed-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  /* --ed-shadow-glow: 0 0 20px var(--ed-primary-glow); REMOVED */

  --ed-radius-sm: 6px;
  --ed-radius: 10px;
  --ed-radius-md: 12px;
  --ed-radius-lg: 16px;
  --ed-radius-xl: 20px;
  --ed-radius-full: 9999px;

  --ed-transition-fast: 150ms ease;
  --ed-transition-base: 200ms ease;
  --ed-transition-smooth: 300ms ease;

  --bs-primary: #0f766e;
  --bs-primary-rgb: 15, 118, 110;
  --bs-link-color: #0f766e;
  --bs-link-hover-color: #115e59;
  --bs-border-radius: 10px;
  --bs-border-radius-sm: 6px;
  --bs-border-radius-lg: 16px;
}

/* ========== TICKETS • CHECKLIST (farol + drag) ========== */
.checklist-farol-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #cbd5e1; /* neutro */
  flex: 0 0 auto;
}

.checklist-farol-verde {
  background: var(--ed-success);
}
.checklist-farol-amarelo {
  background: var(--ed-warning);
}
.checklist-farol-vermelho {
  background: var(--ed-danger);
}
.checklist-farol-neutro {
  background: #cbd5e1;
}

.checklist-drag-handle {
  padding: 0;
  line-height: 1;
  text-decoration: none;
  cursor: grab;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.25rem;
}

.checklist-drag-handle:active {
  cursor: grabbing;
}

.ticket-checklist-item .form-check-input.checklist-checkbox {
  margin-left: 0.25rem;
}

.ticket-checklist-item.checklist-drag-over {
  outline: 2px dashed rgba(15, 118, 110, 0.35);
  outline-offset: 4px;
}

.ticket-checklist-item.checklist-dragging {
  opacity: 0.6;
}

.checklist-item-conteudo {
  color: var(--ed-gray-700);
  white-space: pre-wrap;
}

/* Separadores leves entre itens (ticket + abertura) */
#modal-ticket-checklist .ticket-checklist-item,
#abertura-checklist-draft .ticket-checklist-item {
  padding: 0.6rem 0.25rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

#modal-ticket-checklist .ticket-checklist-item:last-child,
#abertura-checklist-draft .ticket-checklist-item:last-child {
  border-bottom: none;
}

/* ========== 2. BASE & RESET ========== */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--ed-bg-base);
  color: var(--ed-gray-900);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.6;
  letter-spacing: -0.01em;
}

/* Hardening: evita overflow-x acidental do app (mantém scroll horizontal apenas em wrappers próprios) */
#ed-app {
  overflow-x: hidden;
}

/* ========== A11Y • FOCO VISÍVEL (global, baixo risco) ========== */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.55);
  outline-offset: 2px;
}

/* Evita “duplo foco” do Bootstrap em alguns casos */
:where(.btn, .form-control, .form-select):focus-visible {
  box-shadow: none;
}

/* Respeitar preferências do usuário */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== UTILITÁRIOS LEVES (reuso em empty/loading) ========== */
.ed-empty-state {
  border: 2px dashed var(--ed-border);
  border-radius: var(--ed-radius-lg);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(248, 250, 252, 0.96) 100%
  );
  box-shadow: var(--ed-shadow-sm);
  padding: 2rem 1.25rem;
  text-align: center;
}

.ed-empty-state--compact {
  padding: 1.5rem 1rem;
}

.ed-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.75rem;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(15, 118, 110, 0.1);
  border: 1px solid rgba(15, 118, 110, 0.18);
  color: var(--ed-primary-dark);
}

.ed-empty-icon i {
  font-size: 1.4rem;
}

.ed-empty-title {
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--ed-gray-900);
}

.ed-empty-sub {
  margin-top: 0.25rem;
  color: var(--ed-gray-600);
  font-size: 0.9rem;
}

/* Skeleton (shimmer) — útil para “carregando…” em qualquer view */
@keyframes edShimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

.ed-skel-block {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--ed-radius-lg);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(248, 250, 252, 0.96) 100%
  );
  box-shadow: var(--ed-shadow-xs);
  padding: 1rem;
}

.ed-skel-line {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.08) 0%,
    rgba(15, 118, 110, 0.16) 50%,
    rgba(15, 23, 42, 0.08) 100%
  );
  background-size: 200% 200%;
  animation: edShimmer 1.1s ease-in-out infinite;
  margin: 0.55rem 0;
}

html,
body {
  height: 100%;
}

html.ed-no-page-scroll,
body.ed-no-page-scroll {
  overflow: hidden;
  height: 100%;
}

body.elia-mode {
  overflow: hidden;
}

body.ed-no-page-scroll .container {
  /* O bootstrap usa .container.my-3 com margens; no modo app-like removemos
     para não "estourar" o viewport e quebrar o layout. */
  height: 100vh;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.elia-mode #view-elia {
  flex: 1;
  min-height: 0;
}

/* ========== 3. HEADER PREMIUM ========== */
.ea-header {
  background: var(--ed-primary); /* Solid color for performance */
  color: var(--ed-white);
  border-radius: var(--ed-radius-lg);
  padding: 1rem 1.5rem;
  display: flex;
  margin-bottom: 0.25rem;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--ed-shadow-md); /* lighter shadow */
  position: relative;
  overflow: hidden;
  transition: transform var(--ed-transition-base);
  will-change: transform;
}

/* ========== MENSAGEM GLOBAL FIXA ========== */
#mensagem-global {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  width: calc(100% - 2rem);
  max-width: 1200px;
  z-index: 1050;
  pointer-events: none;
  transition:
    transform var(--ed-transition-smooth) cubic-bezier(0.4, 0, 0.2, 1),
    opacity var(--ed-transition-smooth);
  opacity: 0;
}

#mensagem-global:not(:empty) {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

#mensagem-global .alert {
  margin: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: none;
  animation: slideDownFade 0.3s ease-out;
  border-radius: var(--ed-radius);
}

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

@media (max-width: 768px) {
  #mensagem-global {
    top: 100px;
    width: calc(100% - 1rem);
  }
}

.ea-header::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
}

.ea-header:hover {
  transform: translateY(-2px);
}

.ea-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 1;
}

.brand-wordmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: 0.02em;
  user-select: none;
}

.brand-wordmark--header {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.95rem;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.ea-header-left h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ea-header-left .text-muted {
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: 0.875rem;
}

.ea-header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  z-index: 1;
}

.ea-user-info {
  text-align: right;
  line-height: 1.4;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--ed-radius);
  /* backdrop-filter: blur(10px); REMOVED */
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all var(--ed-transition-base);
}

.ea-user-info:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.ea-user-name {
  font-size: 0.9375rem;
  font-weight: 600;
  display: block;
}

.ea-user-role {
  font-size: 0.75rem;
  opacity: 0.85;
  display: block;
  margin-top: 0.125rem;
}

.ea-bell-btn {
  color: var(--ed-white);
  font-size: 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.5rem;
  border-radius: var(--ed-radius);
  transition: all var(--ed-transition-base);
  backdrop-filter: blur(10px);
  position: relative;
}

.ea-bell-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--ed-shadow-md);
}

.ea-bell-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Botão de Disponibilidade - Design Premium */
.ea-avail-btn {
  color: var(--ed-white);
  font-size: 1.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--ed-radius);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  overflow: hidden;
  isolation: isolate;
}

.ea-avail-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.ea-avail-btn:hover::before {
  left: 100%;
}

/* Estado padrão: VERMELHO (Indisponível) - Sobrepondo o header */
.ea-avail-btn-off {
  background: rgba(239, 68, 68, 0.85);
  border: 1.5px solid rgba(239, 68, 68, 0.6);
  color: rgba(255, 255, 255, 1);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.ea-avail-btn-off:hover {
  background: rgba(239, 68, 68, 0.95);
  border-color: rgba(239, 68, 68, 0.8);
  transform: translateY(-2px);
  box-shadow:
    0 4px 16px rgba(239, 68, 68, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.ea-avail-btn-off #ea-avail-icon {
  color: rgba(248, 113, 113, 1);
  transition: all 0.3s ease;
}

.ea-avail-btn-off:hover #ea-avail-icon {
  transform: scale(1.1);
  color: rgba(252, 165, 165, 1);
}

/* Estado ativo: VERDE (Disponível) - Sobrepondo o header */
.ea-avail-btn-on {
  background: rgba(34, 197, 94, 0.9);
  border: 1.5px solid rgba(34, 197, 94, 0.7);
  color: rgba(255, 255, 255, 1);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.ea-avail-btn-on:hover {
  background: rgba(34, 197, 94, 1);
  border-color: rgba(34, 197, 94, 0.9);
  transform: translateY(-2px);
  box-shadow:
    0 4px 16px rgba(34, 197, 94, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.ea-avail-btn-on #ea-avail-icon {
  color: rgba(74, 222, 128, 1);
  filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.5));
  animation: icon-glow 2s ease-in-out infinite;
}

.ea-avail-btn-on:hover #ea-avail-icon {
  transform: scale(1.15) rotate(5deg);
  filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.7));
}

/* Estado colaborativo: pedido de apoio ativo */
.ea-avail-btn-help {
  background: rgba(245, 158, 11, 0.92);
  border: 1.5px solid rgba(245, 158, 11, 0.75);
  color: rgba(255, 255, 255, 1);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.ea-avail-btn-help:hover {
  background: rgba(245, 158, 11, 1);
  border-color: rgba(245, 158, 11, 0.92);
  transform: translateY(-2px);
  box-shadow:
    0 4px 16px rgba(245, 158, 11, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.ea-avail-btn-help #ea-avail-icon {
  color: rgba(254, 243, 199, 1);
  filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.55));
}

@keyframes icon-glow {
  0%,
  100% {
    filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.8));
  }
}

.ea-avail-btn:active {
  transform: translateY(0) scale(0.97);
  transition: transform 0.1s ease;
}

/* Badge de contagem - refinado */
.ea-avail-badge {
  font-size: 0.65rem;
  padding: 0.2rem 0.45rem;
  font-weight: 600;
  background: var(--ed-success) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Texto do botão (mobile hidden) */
.ea-avail-btn .small {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.95;
  transition: opacity 0.3s ease;
}

.ea-avail-btn:hover .small {
  opacity: 1;
}

/* Lista de Pessoas Disponíveis */
#avail-list .list-group-item {
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
  margin-bottom: 0.5rem;
  padding: 1rem;
  transition: all var(--ed-transition-base);
}

#avail-list .list-group-item:hover {
  background: var(--ed-gray-50);
  border-color: var(--ed-primary-light);
  transform: translateX(2px);
}

.avail-person-name {
  font-weight: 600;
  color: var(--ed-gray-900);
  margin-bottom: 0.25rem;
}

.avail-person-info {
  font-size: 0.875rem;
  color: var(--ed-gray-600);
  margin-bottom: 0.5rem;
}

.avail-person-note {
  font-size: 0.875rem;
  color: var(--ed-gray-700);
  font-style: italic;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background: var(--ed-gray-50);
  border-radius: var(--ed-radius);
  border-left: 3px solid var(--ed-primary);
}

.avail-person-setores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
}

.avail-person-setor-tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: var(--ed-primary-soft);
  color: var(--ed-primary-dark);
  border-radius: 0.5rem;
}

.avail-person-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.avail-person-actions .btn {
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
}

.availability-support-composer {
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  padding: 0.9rem;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.85) 0%, rgba(255, 255, 255, 0.98) 100%);
}

#support-list .list-group-item {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  padding: 0.85rem;
  background: #fff;
}

#support-list .support-request--mine {
  border-color: rgba(59, 130, 246, 0.28);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.75) 0%, #fff 100%);
}

.support-request-title {
  font-weight: 700;
  color: #0f172a;
}

.support-request-meta {
  margin-top: 0.2rem;
  font-size: 0.76rem;
  color: #64748b;
}

.support-request-note {
  margin-top: 0.5rem;
  color: #1e293b;
  font-size: 0.9rem;
  line-height: 1.35;
  white-space: pre-wrap;
}

.support-request-actions {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.support-request-actions .btn {
  font-size: 0.78rem;
  padding: 0.34rem 0.55rem;
}

/* Responsivo: esconder texto no mobile */
@media (max-width: 767.98px) {
  .ea-avail-btn .small {
    display: none !important;
  }
}

/* ========== 4. CARDS MODERNOS (GLASS EFFECT) ========== */
.card {
  background-color: var(--ed-card-bg);
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius-lg);
  box-shadow: var(--ed-shadow);
  transition: all var(--ed-transition-smooth);
  backdrop-filter: blur(10px);
  overflow: hidden;
  position: relative;
  /* fix do ::before */
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--ed-primary) 0%,
    var(--ed-primary-light) 100%
  );
  opacity: 0;
  transition: opacity var(--ed-transition-base);
}

.card:hover {
  box-shadow: var(--ed-shadow-lg);
  transform: translateY(-4px);
  border-color: var(--ed-primary-light);
}

.card:hover::before {
  opacity: 1;
}

.card-header {
  background: linear-gradient(
    135deg,
    var(--ed-gray-50) 0%,
    var(--ed-white) 100%
  );
  border-bottom: 2px solid var(--ed-border);
  padding: 1rem 1.25rem;
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--ed-gray-900);
  border-radius: var(--ed-radius-lg) var(--ed-radius-lg) 0 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.card-header i {
  font-size: 1.125rem;
}

.card-body {
  padding: 1.25rem;
}

/* nested cards (ex.: rel-charts dentro do card de relatórios) */
#rel-charts .card {
  box-shadow: var(--ed-shadow-sm);
}

#rel-charts .card:hover {
  transform: translateY(-2px);
}

/* ========== 5. FORMS PREMIUM ========== */
.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ed-gray-700);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-label i {
  font-size: 1rem;
  color: var(--ed-primary);
}

.form-control,
.form-select {
  border: 2px solid var(--ed-gray-200);
  border-radius: var(--ed-radius);
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  transition: all var(--ed-transition-base);
  background-color: var(--ed-white);
  box-shadow: var(--ed-shadow-xs);
}

.form-control:hover,
.form-select:hover {
  border-color: var(--ed-gray-300);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--ed-primary);
  box-shadow:
    0 0 0 4px var(--ed-primary-glow),
    var(--ed-shadow-sm);
  outline: none;
  transform: translateY(-1px);
}

.form-control::placeholder {
  color: var(--ed-gray-400);
  font-size: 0.875rem;
}

/* ========== 6. BUTTONS MODERNOS (3D EFFECT) ========== */
.btn {
  border-radius: var(--ed-radius);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  transition: all var(--ed-transition-base);
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--ed-shadow-xs);
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn i {
  font-size: 1rem;
  transition: transform var(--ed-transition-base);
}

.btn:hover i {
  transform: scale(1.1);
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--ed-primary) 0%,
    var(--ed-primary-dark) 100%
  );
  border-color: var(--ed-primary);
  color: var(--ed-white);
  box-shadow:
    var(--ed-shadow),
    0 4px 12px rgba(15, 118, 110, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(
    135deg,
    var(--ed-primary-dark) 0%,
    var(--ed-primary-darker) 100%
  );
  border-color: var(--ed-primary-dark);
  transform: translateY(-2px);
  box-shadow:
    var(--ed-shadow-md),
    0 8px 20px rgba(15, 118, 110, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--ed-shadow-sm);
}

.btn-outline-primary {
  border-color: var(--ed-primary);
  color: var(--ed-primary);
  background-color: var(--ed-white);
  box-shadow: var(--ed-shadow-xs);
}

.btn-outline-primary:hover {
  background: linear-gradient(
    135deg,
    var(--ed-primary) 0%,
    var(--ed-primary-dark) 100%
  );
  color: var(--ed-white);
  transform: translateY(-2px);
  box-shadow:
    var(--ed-shadow),
    0 4px 12px rgba(15, 118, 110, 0.3);
}

.btn-outline-secondary {
  border-color: var(--ed-gray-300);
  color: var(--ed-gray-700);
  background-color: var(--ed-white);
}

.btn-outline-secondary:hover {
  background-color: var(--ed-gray-100);
  border-color: var(--ed-gray-400);
  transform: translateY(-1px);
}

.btn-outline-danger {
  border-color: var(--ed-danger);
  color: var(--ed-danger);
  background-color: var(--ed-white);
}

.btn-outline-danger:hover {
  background: linear-gradient(
    135deg,
    var(--ed-danger) 0%,
    var(--ed-danger-dark) 100%
  );
  color: var(--ed-white);
  transform: translateY(-2px);
  box-shadow:
    var(--ed-shadow),
    0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-sm {
  padding: 0.4375rem 0.875rem;
  font-size: 0.8125rem;
  border-radius: calc(var(--ed-radius) - 2px);
}

/* Icon buttons (ações da tabela) - SUPER COMPACTOS */
.btn-action,
.btn-icon {
  width: 26px;
  height: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ed-gray-300);
  background: var(--ed-white);
  color: var(--ed-gray-700);
  border-radius: calc(var(--ed-radius) - 2px);
  transition: all var(--ed-transition-fast);
  flex-shrink: 0;
}

/* Botões de ação na tabela - ainda menores */
#tabela-tickets .btn-action {
  width: 22px;
  height: 22px;
  padding: 0;
}

#tabela-tickets .btn-action i {
  font-size: 0.6875rem;
}

.btn-action:hover,
.btn-icon:hover {
  background: var(--ed-gray-100);
  border-color: var(--ed-gray-400);
  color: var(--ed-gray-900);
  transform: translateY(-1px);
  box-shadow: var(--ed-shadow-xs);
}

.btn-action i,
.btn-icon i {
  font-size: 0.875rem;
}

/* Botão Assumir - Verde */
.btn-action-assumir {
  border-color: #10b981;
  color: #10b981;
}

.btn-action-assumir:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
}

/* Botão Ver - Cinza/Azul */
.btn-action-ver {
  border-color: #64748b;
  color: #64748b;
}

.btn-action-ver:hover {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  color: #fff;
}

/* Botão Histórico - Laranja */
.btn-action-historico {
  border-color: #f59e0b;
  color: #f59e0b;
}

.btn-action-historico:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
}

/* Botão Evento - Rosa/Magenta */
.btn-action-evento {
  border-color: #ec4899;
  color: #ec4899;
}

.btn-action-evento:hover {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  color: #fff;
}

/* Botão Encaminhar Detalhes - Azul */
.btn-action-encaminhar-detalhes {
  border-color: #14b8a6;
  color: #14b8a6;
}

.btn-action-encaminhar-detalhes:hover {
  background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
  color: #fff;
}

/* Botão Vincular Problema - Roxo */
.btn-action-problema {
  border-color: #7c3aed;
  color: #7c3aed;
}

.btn-action-problema:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  color: #fff;
}

/* ========== 7. BADGES PREMIUM - DESIGN HARMONIOSO ========== */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  border: 1px solid;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
  line-height: 1.2;
}

.badge-status i {
  font-size: 0.8125rem;
  line-height: 1;
}

/* Badge status na tabela - compacto */
#tabela-tickets .badge-status {
  font-size: 0.625rem;
  padding: 0.3rem 0.55rem;
  gap: 0.25rem;
}

#tabela-tickets .badge-status i {
  font-size: 0.6875rem;
}

/* Ajuste específico para status "EM ATENDIMENTO" */
#tabela-tickets .badge-status.status-em_atendimento {
  font-size: 0.6rem;
  padding: 0.275rem 0.5rem;
}

#tabela-tickets .badge-status.status-em_atendimento i {
  font-size: 0.65rem;
}

.badge-status:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.status-aberto {
  background: #fef3c7;
  color: #92400e;
  border-color: #fbbf24;
}

.status-aberto:hover {
  background: #fde68a;
  border-color: #f59e0b;
}

.status-em_atendimento {
  background: #14b8a6;
  color: #ffffff;
  border-color: #0f766e;
}

.status-em_atendimento:hover {
  background: #0f766e;
  border-color: #1d4ed8;
}

.status-aguardando {
  background: #f87171;
  color: #ffffff;
  border-color: #ef4444;
}

.status-aguardando:hover {
  background: #ef4444;
  border-color: #dc2626;
}

.status-concluido {
  background: #10b981;
  color: #ffffff;
  border-color: #059669;
}

.status-concluido:hover {
  background: #059669;
  border-color: #047857;
}

.status-cancelado {
  background: #6b7280;
  color: #ffffff;
  border-color: #4b5563;
}

.status-cancelado:hover {
  background: #4b5563;
  border-color: #374151;
}

/* Badge Prioridade - Design Harmonioso e Profissional */
.badge-prioridade {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  transition: all 0.2s ease;
  border: 1px solid;
  line-height: 1.2;
}

.badge-prioridade i {
  font-size: 0.875rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-prioridade span {
  font-weight: 600;
  line-height: 1.2;
}

.badge-prioridade:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

/* Prioridade BAIXA - Verde suave */
.prio-baixa {
  color: #059669;
  border-color: #10b981;
  background: #d1fae5;
}

.prio-baixa:hover {
  background: #a7f3d0;
  border-color: #059669;
}

/* Prioridade MÉDIA - Azul suave */
.prio-media {
  color: #0f766e;
  border-color: #14b8a6;
  background: #ccfbf1;
}

.prio-media:hover {
  background: #99f6e4;
  border-color: #0f766e;
}

/* Prioridade ALTA - Laranja suave */
.prio-alta {
  color: #d97706;
  border-color: #f59e0b;
  background: #fef3c7;
}

.prio-alta:hover {
  background: #fde68a;
  border-color: #d97706;
}

/* Prioridade CRÍTICA - Vermelho suave */
.prio-critica {
  color: #dc2626;
  border-color: #ef4444;
  background: #fee2e2;
}

.prio-critica:hover {
  background: #fecaca;
  border-color: #dc2626;
}

/* Badge prioridade na tabela - compacto */
#tabela-tickets .badge-prioridade {
  font-size: 0.625rem;
  padding: 0.3rem 0.55rem;
  gap: 0.3rem;
}

#tabela-tickets .badge-prioridade i {
  font-size: 0.75rem;
}

/* Badge Farol - Design Harmonioso e Profissional */
.badge-farol {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid;
  transition: all 0.2s ease;
  position: relative;
  line-height: 1.2;
}

.badge-farol i {
  font-size: 0.8125rem;
  line-height: 1;
}

.badge-farol-verde {
  background: #10b981;
  color: #ffffff;
  border-color: #059669;
}

.badge-farol-verde:hover {
  background: #059669;
  border-color: #047857;
  transform: translateY(-1px);
}

.badge-farol-amarelo {
  background: #fbbf24;
  color: #78350f;
  border-color: #f59e0b;
}

.badge-farol-amarelo:hover {
  background: #f59e0b;
  border-color: #d97706;
  transform: translateY(-1px);
}

.badge-farol-vermelho {
  background: #ef4444;
  color: #ffffff;
  border-color: #dc2626;
}

.badge-farol-vermelho:hover {
  background: #dc2626;
  border-color: #b91c1c;
  transform: translateY(-1px);
}

/* Badge Farol Concluído */
.badge-farol-concluido {
  background: #6b7280;
  color: #ffffff;
  border-color: #4b5563;
}

.badge-farol-concluido:hover {
  background: #4b5563;
  border-color: #374151;
  transform: translateY(-1px);
}

/* Badge farol na tabela - compacto */
#tabela-tickets .badge-farol {
  font-size: 0.625rem;
  padding: 0.3rem 0.55rem;
  gap: 0.3rem;
}

#tabela-tickets .badge-farol i {
  font-size: 0.6875rem;
}

/* Ajuste específico para farol "FINALIZADO" - fonte menor */
#tabela-tickets .badge-farol-concluido {
  font-size: 0.65rem;
  padding: 0.35rem 0.65rem;
  gap: 0.3rem;
}

#tabela-tickets .badge-farol-concluido i {
  font-size: 0.75rem;
}

/* Animações para chamar atenção */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

@keyframes pulse-warning {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.15);
  }
}

@keyframes pulse-danger {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  25%,
  75% {
    opacity: 0.9;
    transform: scale(1.1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.2);
  }
}

@keyframes pulse-concluido {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.08);
  }
}

/* Badge "dias aberto" (app.js usa .badge-age) */
.badge-age {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  border: 1px solid var(--ed-gray-200);
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
  color: var(--ed-gray-900);
  box-shadow: var(--ed-shadow-xs);
}

.badge-age strong {
  font-weight: 900;
}

/* ========== 8. TABS MODERNIZADAS ========== */
.nav-tabs {
  border-bottom: 2px solid var(--ed-border);
  display: flex;
  flex-wrap: nowrap;
  gap: 0.125rem;
  overflow-x: hidden;
  justify-content: stretch;
  padding-bottom: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--ed-gray-300) transparent;
}

.nav-tabs::-webkit-scrollbar {
  height: 6px;
}

.nav-tabs::-webkit-scrollbar-thumb {
  background: var(--ed-gray-300);
  border-radius: var(--ed-radius-full);
}

.nav-tabs .nav-link {
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 0.75rem 1.125rem;
  color: var(--ed-gray-600);
  font-weight: 600;
  transition: all var(--ed-transition-base);
  font-size: 0.9375rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  background: transparent;
}

.nav-tabs .nav-link i {
  font-size: 1.125rem;
  transition: transform var(--ed-transition-base);
}

.nav-tabs .nav-link:hover {
  color: var(--ed-primary);
  background: var(--ed-gray-50);
  border-bottom-color: var(--ed-primary-light);
}

.nav-tabs .nav-link:hover i {
  transform: scale(1.1);
}

.nav-tabs .nav-link.active {
  color: var(--ed-primary);
  border-bottom-color: var(--ed-primary);
  background: var(--ed-primary-soft);
  font-weight: 700;
}

.nav-tabs .nav-link.active i {
  color: var(--ed-primary-dark);
}

/* ed-tabs: sempre em UMA linha; se não couber, faz scroll horizontal */
.ed-tabs {
  /* Ocupa 100% do container sem scroll horizontal */
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  width: 100%;
  gap: 0.125rem;
  overflow-x: hidden;
  overflow-y: hidden;
  scrollbar-width: none;
  padding: 0.2rem 0;
  min-height: auto;
  margin-top: 0;
  margin-bottom: 0;
  --ed-tabs-count: 12;
}

/* Para DBA/Admin: não centraliza, usa flex-start */
.ed-tabs.ed-tabs-admin {
  justify-content: flex-start !important;
}

/* Quando não cabe, evita “buracos” do space-between e assume scroll normal */
.ed-tabs.ed-tabs-overflow {
  justify-content: space-between !important;
}

/* Blindagem extra contra regras do Bootstrap/nav-tabs */
ul.nav.nav-tabs.ed-tabs {
  flex-wrap: nowrap !important;
  white-space: nowrap;
}

ul.nav.nav-tabs.ed-tabs > li,
ul.nav.nav-tabs.ed-tabs > .nav-item {
  flex: var(--ed-tab-grow, 1) 1 0%;
  min-width: 0;
}

/* Se estiver em overflow (muitas abas), volta para largura automática e mantém scroll */
.ed-tabs.ed-tabs-overflow > li.nav-item,
.ed-tabs.ed-tabs-overflow > .nav-item {
  flex: var(--ed-tab-grow, 1) 1 0%;
  min-width: 0;
}

.ed-tabs::-webkit-scrollbar {
  height: 0;
}

.ed-tabs::-webkit-scrollbar-thumb {
  background: rgba(15, 118, 110, 0.28);
  border-radius: 999px;
}

.ed-tabs::-webkit-scrollbar-track {
  background: transparent;
}

.ed-tabs .nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  padding: 0.56rem 0.5rem;
  font-size: 0.82rem;
  line-height: 1.2;
  min-height: 2.35rem;
  gap: 0.3rem;
}

.ed-tabs .nav-link i {
  font-size: 1rem;
  margin-right: 0.35rem;
  line-height: 1;
  flex: 0 0 auto;
}

/* Quando faltar espaço (JS aplica .ed-tabs-dense), reduz tamanho automaticamente */
.ed-tabs.ed-tabs-dense .nav-link {
  padding: 0.55rem 0.8rem;
  font-size: 0.84rem;
}

.ed-tabs.ed-tabs-dense .nav-link i {
  font-size: 0.95rem;
  margin-right: 0.3rem;
}

/* Modo extra compacto quando ainda não couber */
.ed-tabs.ed-tabs-dense-extra .nav-link {
  padding: 0.5rem 0.7rem;
  font-size: 0.8rem;
}

.ed-tabs.ed-tabs-dense-extra .nav-link i {
  font-size: 0.9rem;
  margin-right: 0.25rem;
}

.ed-tabs.ed-tabs-compact .nav-link {
  white-space: normal;
  font-size: 0.72rem;
  line-height: 1.12;
  padding: 0.42rem 0.35rem;
  min-height: 2.8rem;
  gap: 0.22rem;
}

.ed-tabs.ed-tabs-compact .nav-link i {
  font-size: 0.82rem;
  margin-right: 0.2rem;
}

/* Reduz padding e tamanho da fonte em telas médias/grandes quando há muitas abas */
@media (min-width: 992px) and (max-width: 1600px) {
  .ed-tabs .nav-link {
    padding: 0.5rem 0.45rem;
    font-size: 0.76rem;
  }

  .ed-tabs .nav-link i {
    font-size: 0.9375rem;
    margin-right: 0.3rem;
  }
}

/* Em telas muito grandes, mantém tamanho compacto */
@media (min-width: 1601px) {
  .ed-tabs .nav-link {
    padding: 0.55rem 0.5rem;
    font-size: 0.8rem;
  }

  .ed-tabs .nav-link i {
    font-size: 0.95rem;
    margin-right: 0.3rem;
  }
}

/* Em telas menores, quebra linha para evitar scroll horizontal */
@media (max-width: 991.98px) {
  .ed-tabs {
    justify-content: stretch !important;
    padding: 0.125rem 0;
    flex-wrap: wrap !important;
    overflow-x: hidden;
    overflow-y: hidden;
    row-gap: 0.125rem;
  }

  .ed-tabs.ed-tabs-admin {
    justify-content: flex-start !important;
  }

  ul.nav.nav-tabs.ed-tabs > li,
  ul.nav.nav-tabs.ed-tabs > .nav-item {
    flex: 1 0 25%;
    max-width: 25%;
  }

  .ed-tabs .nav-link {
    padding: 0.5rem 0.4rem;
    font-size: 0.78rem;
    white-space: normal;
    text-align: center;
  }

  .ed-tabs .nav-link i {
    font-size: 0.95rem;
    margin-right: 0.3rem;
  }
}

/* ========== 9. TABELAS PREMIUM ========== */
.table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
  box-shadow: var(--ed-shadow);
  border-radius: var(--ed-radius);
  overflow: hidden;
}

.table thead th {
  background: linear-gradient(
    135deg,
    var(--ed-gray-100) 0%,
    var(--ed-gray-50) 100%
  );
  color: var(--ed-gray-900);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 2px solid var(--ed-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.table tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--ed-border-light);
  vertical-align: middle;
  transition: background-color var(--ed-transition-fast);
}

.table tbody tr {
  transition: all var(--ed-transition-base);
}

.table tbody tr:hover {
  background-color: var(--ed-gray-50);
  transform: scale(1.001);
  box-shadow: var(--ed-shadow-sm);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* ===== DBA: Usuários & Acessos ===== */
#view-usuarios .admin-users-table-wrap,
#view-usuarios .admin-access-table-wrap {
  overflow-x: auto;
}

#view-usuarios .admin-users-table,
#view-usuarios .admin-access-table {
  min-width: 960px;
  table-layout: auto;
  overflow: visible;
}

#view-usuarios .admin-users-table th,
#view-usuarios .admin-users-table td,
#view-usuarios .admin-access-table th,
#view-usuarios .admin-access-table td {
  white-space: nowrap;
}

#view-usuarios .admin-users-table td:nth-child(2),
#view-usuarios .admin-access-table td:nth-child(2) {
  white-space: normal;
}

#view-usuarios .admin-users-table td:last-child,
#view-usuarios .admin-access-table td:last-child {
  white-space: nowrap;
}

/* compact do app.js */
.table-row-compact td {
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

/* seleção de linha (app.js usa .row-selected) */
.table tbody tr.row-selected {
  background: var(--ed-primary-soft) !important;
  box-shadow: inset 0 0 0 2px rgba(15, 118, 110, 0.25);
}

/* ========== 10. KPI CARDS ========== */
.ea-card-kpi {
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
  border-left: 4px solid var(--ed-primary);
  padding: 1rem 1.25rem;
  border-radius: var(--ed-radius-md);
  box-shadow: var(--ed-shadow);
  transition: all var(--ed-transition-smooth);
  position: relative;
  overflow: hidden;
}

.ea-card-kpi::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    var(--ed-primary-glow) 0%,
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--ed-transition-smooth);
}

.ea-card-kpi:hover {
  transform: translateY(-4px);
  box-shadow: var(--ed-shadow-lg);
  border-left-width: 6px;
}

.ea-card-kpi:hover::before {
  opacity: 1;
}

.ea-card-kpi .label {
  font-size: 0.75rem;
  color: var(--ed-gray-600);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  display: block;
  margin-bottom: 0.5rem;
}

.ea-card-kpi .value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--ed-gray-900);
  display: block;
  line-height: 1;
  letter-spacing: -0.02em;
}

/* ========== 11. ELIA CHAT (novo layout do app.js) ========== */
.elia-chat {
  background: linear-gradient(
    135deg,
    var(--ed-gray-50) 0%,
    var(--ed-white) 100%
  );
  border: 2px solid var(--ed-border);
  border-radius: var(--ed-radius-md);
  padding: 1rem;
  height: 55vh;
  overflow: auto;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.elia-empty {
  color: var(--ed-gray-600);
  font-size: 0.9rem;
  padding: 0.75rem 0.5rem;
}

.elia-row {
  display: flex;
  margin: 10px 0;
}

.elia-row.user {
  justify-content: flex-end;
}

.elia-row.bot {
  justify-content: flex-start;
}

.elia-bubble {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.35;
  white-space: pre-wrap;
  box-shadow: var(--ed-shadow-sm);
}

.elia-row.user .elia-bubble {
  background: linear-gradient(
    135deg,
    var(--ed-primary) 0%,
    var(--ed-primary-dark) 100%
  );
  color: #fff;
  border-bottom-right-radius: 6px;
}

.elia-row.bot .elia-bubble {
  background: #fff;
  color: var(--ed-gray-900);
  border: 2px solid var(--ed-border);
  border-bottom-left-radius: 6px;
}

.elia-meta {
  font-size: 0.72rem;
  opacity: 0.85;
  margin-bottom: 6px;
}

.elia-typing {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--ed-gray-600);
  font-size: 0.85rem;
}

/* mantém compatibilidade com bloco antigo */
#elia-resposta-ticket {
  white-space: pre-wrap;
}

/* ========== 12. TOOLBAR & CHIPS ========== */
.ea-toolbar {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  border: 2px solid var(--ed-border);
  border-radius: var(--ed-radius-md);
  background: linear-gradient(
    135deg,
    var(--ed-gray-50) 0%,
    var(--ed-white) 100%
  );
  margin-bottom: 1.25rem;
  box-shadow: var(--ed-shadow-sm);
}

.ea-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  border-radius: var(--ed-radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  border: 2px solid transparent;
  transition: all var(--ed-transition-base);
  box-shadow: var(--ed-shadow-xs);
}

.ea-chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--ed-shadow-sm);
}

.chip-verde {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border-color: #34d399;
}

.chip-amarelo {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border-color: #fbbf24;
}

.chip-vermelho {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  border-color: #f87171;
}

.chip-cinza {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #475569;
  border-color: #cbd5e1;
}

.ea-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px currentColor;
}

/* Checklist - header actions */
.tickets-checklist-actions {
  width: 100%;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-left: auto;
}

.tickets-checklist-filter-pair {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  flex: 1 1 520px;
  min-width: 0;
  max-width: 560px;
}

.tickets-checklist-filter-pair .form-select {
  width: 100%;
  min-width: 170px;
  max-width: none;
  flex: 1 1 0;
}

.tickets-checklist-buttons {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  white-space: nowrap;
}

.tickets-checklist-buttons .btn {
  white-space: nowrap;
}

.checklist-refresh-btn {
  min-width: 120px;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (max-width: 991.98px) {
  .tickets-checklist-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .tickets-checklist-filter-pair {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .tickets-checklist-filter-pair .form-select {
    max-width: none;
    flex: 1 1 200px;
  }
}

@media (max-width: 576px) {
  .tickets-checklist-filter-pair {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .tickets-checklist-filter-pair .form-select {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }

  .tickets-checklist-buttons {
    width: 100%;
    justify-content: flex-end;
  }
}

#tickets-checklist-card .tickets-checklist-scroll {
  max-height: 60vh;
  overflow-y: auto;
}

#tickets-checklist-table {
  width: 100%;
  table-layout: fixed;
}

#tickets-checklist-table th,
#tickets-checklist-table td {
  vertical-align: top;
}

#tickets-checklist-table th:nth-child(1),
#tickets-checklist-table td:nth-child(1) {
  width: 28%;
  min-width: 260px;
}

#tickets-checklist-table th:nth-child(2),
#tickets-checklist-table td:nth-child(2) {
  width: 32%;
}

#tickets-checklist-table th:nth-child(3),
#tickets-checklist-table td:nth-child(3) {
  width: 14%;
}

#tickets-checklist-table th:nth-child(4),
#tickets-checklist-table td:nth-child(4) {
  width: 14%;
}

#tickets-checklist-table th:nth-child(5),
#tickets-checklist-table td:nth-child(5) {
  width: 12%;
}

#tickets-checklist-table td:nth-child(1),
#tickets-checklist-table td:nth-child(2) {
  word-break: break-word;
}

.ea-card-subtitle {
  color: var(--ed-gray-600);
  font-size: 0.82rem;
}

/* ========== 13. EVENTOS (Timeline Premium) ========== */
.ea-timeline .ea-item,
.ticket-eventos-item {
  border-left: 3px solid var(--ed-primary);
  background: linear-gradient(
    135deg,
    var(--ed-gray-50) 0%,
    var(--ed-white) 100%
  );
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: var(--ed-radius);
  font-size: 0.875rem;
  box-shadow: var(--ed-shadow-xs);
  transition: all var(--ed-transition-base);
  position: relative;
  padding-left: 1.5rem;
}

.ea-timeline .ea-item::before,
.ticket-eventos-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 11px;
  height: 11px;
  background-color: var(--ed-primary);
  border: 3px solid var(--ed-white);
  border-radius: 50%;
  box-shadow: var(--ed-shadow-sm);
}

.ea-timeline .ea-item:hover,
.ticket-eventos-item:hover {
  border-left-width: 5px;
  transform: translateX(4px);
  box-shadow: var(--ed-shadow);
}

.ticket-eventos {
  border-top: 2px solid var(--ed-border);
  margin-top: 1.25rem;
  padding-top: 1rem;
}

/* ========== 14. SEÇÕES & PAINÉIS ========== */
.ea-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 2px dashed var(--ed-border);
}

.ea-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.ea-section-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  color: var(--ed-gray-900);
  margin-bottom: 1rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ea-section-title i {
  color: var(--ed-primary);
  font-size: 1.25rem;
}

.ea-kv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem 1.25rem;
}

.panel-soft {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #fbbf24;
  border-radius: var(--ed-radius-md);
  padding: 1rem 1.25rem;
  box-shadow: var(--ed-shadow-xs);
}

/* ========== 15. LISTA: seleção/expand/actions (app.js) ========== */
.td-sel {
  width: 40px;
  text-align: center;
}

.sel-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  border: 2px solid var(--ed-gray-300);
  background: var(--ed-white);
  cursor: pointer;
  transition: all var(--ed-transition-fast);
}

.row-selected .sel-dot {
  background: var(--ed-primary);
  border-color: var(--ed-primary);
  box-shadow: 0 0 0 4px var(--ed-primary-glow);
}

.btn-expand {
  width: 28px;
  height: 28px;
  border: 2px solid var(--ed-gray-200);
  background: var(--ed-white);
  border-radius: var(--ed-radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--ed-shadow-xs);
  transition: all var(--ed-transition-base);
  font-size: 0.85rem;
}

.btn-expand:hover {
  transform: translateY(-1px);
  border-color: var(--ed-primary-light);
}

.td-titulo-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.td-actions {
  padding: 0.5rem 0.5rem !important;
}

.actions-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.actions-row {
  display: flex;
  gap: 2px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
}

.actions-row-top {
  width: 100%;
}

.actions-row-top .select-status {
  width: 100%;
  font-size: 0.6875rem;
  padding: 0.25rem 0.4rem;
  min-height: 26px;
  max-height: 26px;
  box-sizing: border-box;
  position: relative;
  z-index: 10;
}

/* Dropdown do select de status - z-index alto para não ficar sobreposto */
.actions-row-top .select-status:focus,
.actions-row-top .select-status:active {
  z-index: 1000;
}

/* Garantir que o dropdown do select apareça acima de outros elementos */
.td-actions {
  position: relative;
  z-index: 1;
}

.td-actions .select-status:focus {
  z-index: 1001;
}

.actions-row-bottom {
  flex-wrap: nowrap;
  /* CRÍTICO: mantém botões em linha */
  justify-content: flex-start;
  gap: 3px;
}

/* Expand do ticket (linha extra abaixo) */
.tr-expand td {
  padding: 0 !important;
  border-bottom: none !important;
  background: transparent !important;
}

.expand-box {
  border-top: 2px solid #e5e7eb;
  background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
  padding: 1rem;
  text-align: left;
}

.expand-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.expand-header-left {
  flex: 1;
  min-width: 0;
}

.expand-protocolo {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #6366f1;
  margin-bottom: 0.2rem;
  letter-spacing: 0.05em;
}

.expand-title {
  font-weight: 700;
  font-size: 1rem;
  color: #111827;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.expand-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}

.expand-content {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.expand-section {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.75rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.expand-section-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #e5e7eb;
}

.expand-section-title i {
  font-size: 1rem;
  color: #6366f1;
}

.expand-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.expand-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.expand-info-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.expand-info-label i {
  font-size: 0.875rem;
  color: #9ca3af;
}

.expand-info-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
  line-height: 1.4;
  word-break: break-word;
}

.expand-link {
  color: #6366f1;
  text-decoration: none;
  transition: color 0.2s ease;
}

.expand-link:hover {
  color: #0f766e;
  text-decoration: underline;
}

.expand-description {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #374151;
  white-space: pre-wrap;
  word-wrap: break-word;
  padding: 0.625rem;
  background: #f9fafb;
  border-radius: 6px;
  border-left: 3px solid #6366f1;
}

.expand-finalizacao {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #374151;
  white-space: pre-wrap;
  word-wrap: break-word;
  padding: 0.625rem;
  background: #f0fdf4;
  border-radius: 6px;
  border-left: 3px solid #10b981;
}

.expand-custo {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #fffbeb;
  border-radius: 6px;
  border-left: 3px solid #f59e0b;
}

.expand-custo-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: #92400e;
  margin-top: 0.25rem;
}

/* Responsivo do expand */
@media (max-width: 992px) {
  .expand-info-grid {
    grid-template-columns: 1fr;
  }

  .expand-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .expand-badges {
    width: 100%;
  }
}

/* ========== 16. Tabela tickets: MELHORADA - Minimalista e Profissional ========== */
.tickets-table-shell {
  position: relative;
  border-radius: var(--ed-radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  background: #ffffff;
}

.tickets-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 60vh;
  scrollbar-width: thin;
  scrollbar-color: var(--ed-gray-300) transparent;
  position: relative;
  display: block;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.tickets-scroll::-webkit-scrollbar {
  width: 6px;
}

.tickets-scroll::-webkit-scrollbar-thumb {
  background: var(--ed-gray-300);
  border-radius: var(--ed-radius-full);
}

.tickets-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--ed-gray-400);
}

.tickets-scroll {
  contain: layout style paint;
}

#tabela-tickets thead.tickets-thead-sticky {
  position: sticky;
  top: -1px;
  z-index: 200;
  background: #ffffff !important;
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: table-header-group;
}

#tabela-tickets thead.tickets-thead-sticky tr {
  background: #ffffff !important;
}

.tickets-thead-sticky th {
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  padding: 0.5rem 0.5rem !important;
  white-space: normal;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
  background: #ffffff !important;
  line-height: 1.2;
  position: sticky;
  top: 0;
  z-index: 201;
}

.tickets-thead-sticky th i {
  font-size: 0.875rem;
  opacity: 0.7;
  margin-bottom: 0.1rem;
}

.tickets-thead-sticky th > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

/* Tabela otimizada - minimalista */
#tabela-tickets {
  width: 100%;
  font-size: 0.8125rem;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  position: relative;
}

#tabela-tickets th,
#tabela-tickets td {
  padding: 0.5rem 0.5rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

#tabela-tickets tbody tr {
  transition: background-color 0.15s ease;
  background: #ffffff;
}

#tabela-tickets tbody tr:hover {
  background: rgba(15, 118, 110, 0.02);
}

#tabela-tickets tbody tr.table-striped:nth-of-type(odd) {
  background: rgba(248, 250, 252, 0.4);
}

#tabela-tickets tbody tr.table-striped:nth-of-type(odd):hover {
  background: rgba(15, 118, 110, 0.03);
}

/* Larguras otimizadas - sem scroll horizontal */
#tabela-tickets th:nth-child(1),
#tabela-tickets td:nth-child(1) {
  /* Seleção */
  width: 32px;
  min-width: 32px;
  max-width: 32px;
}

#tabela-tickets th:nth-child(2),
#tabela-tickets td:nth-child(2) {
  /* ID */
  width: 50px;
  min-width: 50px;
  max-width: 50px;
}

.td-id-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.td-id-wrapper .btn-expand {
  width: 22px;
  height: 22px;
  padding: 0;
  font-size: 0.75rem;
}

#tabela-tickets th:nth-child(3),
#tabela-tickets td:nth-child(3) {
  /* Protocolo */
  width: 85px;
  min-width: 85px;
  max-width: 85px;
}

#tabela-tickets th:nth-child(4),
#tabela-tickets td:nth-child(4) {
  /* Título - aumentado após remover coluna Abertura */
  min-width: 130px;
  max-width: 170px;
  width: 160px;
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.4;
}

#tabela-tickets th:nth-child(5),
#tabela-tickets td:nth-child(5) {
  /* Setor */
  width: 85px;
  min-width: 85px;
  max-width: 85px;
  white-space: normal;
  word-wrap: break-word;
}

#tabela-tickets th:nth-child(6),
#tabela-tickets td:nth-child(6) {
  /* Prioridade */
  width: 100px;
  min-width: 100px;
  max-width: 100px;
  text-align: center;
}

#tabela-tickets td:nth-child(6) .badge,
#tabela-tickets td:nth-child(6) .badge-prioridade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  position: relative;
  z-index: 5;
}

#tabela-tickets td:nth-child(6) .badge-prioridade:hover {
  z-index: 20;
}

#tabela-tickets th:nth-child(7),
#tabela-tickets td:nth-child(7) {
  /* Responsável - aumentado após remover coluna Abertura */
  width: 130px;
  min-width: 130px;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
}

#tabela-tickets th:nth-child(8),
#tabela-tickets td:nth-child(8) {
  /* Prazo limite - aumentado após remover coluna Abertura */
  width: 90px;
  min-width: 90px;
  max-width: 90px;
  text-align: center;
}

#tabela-tickets th:nth-child(9),
#tabela-tickets td:nth-child(9) {
  /* Farol */
  width: 140px;
  min-width: 140px;
  max-width: 140px;
  overflow: hidden;
}

/* Ajustes específicos para badges na tabela */
#tabela-tickets td {
  position: relative;
}

#tabela-tickets td:nth-child(9) .badge,
#tabela-tickets td:nth-child(9) .badge-farol-verde,
#tabela-tickets td:nth-child(9) .badge-farol-amarelo,
#tabela-tickets td:nth-child(9) .badge-farol-vermelho,
#tabela-tickets td:nth-child(9) .badge-farol-concluido {
  max-width: 100%;
  overflow: visible;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  position: relative;
  z-index: 5;
}

#tabela-tickets td:nth-child(9) .badge:hover,
#tabela-tickets td:nth-child(9) .badge-farol:hover {
  z-index: 20;
}

#tabela-tickets th:nth-child(10),
#tabela-tickets td:nth-child(10) {
  /* Status */
  width: 145px;
  min-width: 145px;
  max-width: 145px;
  overflow: hidden;
}

#tabela-tickets td:nth-child(10) .badge,
#tabela-tickets td:nth-child(10) .badge-status {
  max-width: 100%;
  overflow: visible;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  position: relative;
  z-index: 5;
}

#tabela-tickets td:nth-child(10) .badge:hover,
#tabela-tickets td:nth-child(10) .badge-status:hover {
  z-index: 20;
}

#tabela-tickets th:nth-child(11),
#tabela-tickets td:nth-child(11) {
  /* Ações */
  width: 130px;
  min-width: 130px;
  max-width: 130px;
}

/* Coluna Protocolo - quebrado em duas linhas */
.td-protocolo {
  padding: 0.5rem 0.5rem !important;
  font-size: 0.8125rem;
}

.td-protocolo-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.protocolo-prefixo {
  font-size: 0.6875rem;
  font-weight: 500;
  color: #64748b;
  line-height: 1.2;
  margin-bottom: 0.05rem;
}

.protocolo-sufixo {
  font-size: 0.8125rem;
  color: #1e293b;
  line-height: 1.2;
  font-weight: 600;
}

/* Coluna Prazo Limite - quebrado em duas linhas (dd/mm e aaaa) */
.td-prazo {
  padding: 0.5rem 0.5rem !important;
  text-align: center;
}

.prazo-dia-mes {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #1e293b;
  line-height: 1.2;
  margin-bottom: 0.05rem;
  text-align: center;
}

.prazo-ano {
  font-size: 0.6875rem;
  color: #64748b;
  line-height: 1.2;
  font-weight: 500;
  text-align: center;
}

/* Ajuste para header Prazo Limite com ícone à esquerda */
#tabela-tickets th:nth-child(8) > div {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: center;
  text-align: left;
}

#tabela-tickets th:nth-child(8) > div > div {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  text-align: left;
}

/* ✅ Coluna Abertura removida - não mais necessário */

/* ===== RESPONSIVO ===== */

/* Tablets e menores (< 1400px) */
@media (max-width: 1399px) {
  #tabela-tickets {
    font-size: 0.75rem;
  }

  #tabela-tickets th,
  #tabela-tickets td {
    padding: 0.45rem 0.4rem;
  }

  .tickets-thead-sticky th {
    padding: 0.45rem 0.4rem !important;
    font-size: 0.6875rem;
  }

  .tickets-thead-sticky th i {
    font-size: 0.8125rem;
  }
}

/* Celulares (< 768px) */
@media (max-width: 767px) {
  /* No mobile, não forçar scroll horizontal: esconder colunas menos essenciais */
  .tickets-scroll {
    overflow-x: hidden;
  }

  #tabela-tickets {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
    font-size: 0.6875rem;
  }

  /* Oculta: #, Setor, Prioridade, Responsável, Prazo e Status (detalhes ficam no expand) */
  #tabela-tickets th:nth-child(2),
  #tabela-tickets td:nth-child(2),
  #tabela-tickets th:nth-child(5),
  #tabela-tickets td:nth-child(5),
  #tabela-tickets th:nth-child(6),
  #tabela-tickets td:nth-child(6),
  #tabela-tickets th:nth-child(7),
  #tabela-tickets td:nth-child(7),
  #tabela-tickets th:nth-child(8),
  #tabela-tickets td:nth-child(8),
  #tabela-tickets th:nth-child(10),
  #tabela-tickets td:nth-child(10) {
    display: none;
  }

  /* Recalibra larguras das colunas restantes: expand, protocolo, título, farol e ações */
  #tabela-tickets th:nth-child(1),
  #tabela-tickets td:nth-child(1) {
    width: 32px;
    min-width: 32px;
    max-width: 32px;
  }

  #tabela-tickets th:nth-child(3),
  #tabela-tickets td:nth-child(3) {
    width: 78px;
    min-width: 78px;
    max-width: 78px;
  }

  #tabela-tickets th:nth-child(9),
  #tabela-tickets td:nth-child(9) {
    width: 92px;
    min-width: 92px;
    max-width: 92px;
  }

  #tabela-tickets th:nth-child(11),
  #tabela-tickets td:nth-child(11) {
    width: 78px;
    min-width: 78px;
    max-width: 78px;
  }

  #tabela-tickets th:nth-child(4),
  #tabela-tickets td:nth-child(4) {
    width: auto;
    min-width: 0;
    max-width: none;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
  }

  #tabela-tickets th,
  #tabela-tickets td {
    padding: 0.4rem 0.3rem;
  }

  .tickets-thead-sticky th {
    padding: 0.4rem 0.3rem !important;
    font-size: 0.6875rem;
  }
}

/* ========== CALENDÁRIO DE TICKETS ========== */
.ed-cal-container {
  display: flex;
  gap: 1.5rem;
  min-height: 500px;
}

.ed-cal-left {
  flex: 0 0 400px;
  background: var(--ed-card-bg);
  border-radius: var(--ed-radius-md);
  padding: 1.25rem;
  box-shadow: var(--ed-shadow);
  border: 1px solid var(--ed-border);
}

.ed-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 0.75rem;
}

.ed-cal-header h5 {
  flex: 1;
  text-align: center;
  color: var(--ed-gray-900);
  font-size: 1.125rem;
}

.ed-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.ed-cal-weekday {
  text-align: center;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--ed-gray-600);
  padding: 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ed-cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--ed-radius);
  border: 1px solid var(--ed-border-light);
  background: var(--ed-gray-50);
  cursor: pointer;
  transition: all var(--ed-transition-fast);
  position: relative;
  padding: 0.25rem;
  min-height: 50px;
}

.ed-cal-day:hover {
  background: var(--ed-primary-soft);
  border-color: var(--ed-primary-light);
  transform: translateY(-1px);
  box-shadow: var(--ed-shadow-sm);
}

.ed-cal-day--other-month {
  opacity: 0.3;
  background: var(--ed-gray-100);
}

.ed-cal-day--today {
  background: linear-gradient(135deg, var(--ed-primary-soft) 0%, #ccfbf1 100%);
  border-color: var(--ed-primary);
  border-width: 2px;
  font-weight: 700;
  color: var(--ed-primary-dark);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.2);
}

.ed-cal-day--selected {
  background: linear-gradient(
    135deg,
    var(--ed-primary) 0%,
    var(--ed-primary-dark) 100%
  );
  border-color: var(--ed-primary-dark);
  color: var(--ed-white);
  font-weight: 700;
  box-shadow:
    var(--ed-shadow-glow),
    0 0 0 3px rgba(15, 118, 110, 0.3);
  z-index: 10;
  position: relative;
}

.ed-cal-day--selected:hover {
  background: linear-gradient(
    135deg,
    var(--ed-primary-dark) 0%,
    var(--ed-primary-darker) 100%
  );
}

.ed-cal-day-number {
  font-size: 0.875rem;
  line-height: 1.2;
  margin-bottom: 0.125rem;
}

.ed-cal-badge-count {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: var(--ed-danger);
  color: var(--ed-white);
  border-radius: var(--ed-radius-full);
  font-size: 0.625rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  line-height: 1;
}

.ed-cal-day--selected .ed-cal-badge-count {
  background: var(--ed-white);
  color: var(--ed-primary-dark);
}

.ed-cal-right {
  flex: 1;
  background: var(--ed-card-bg);
  border-radius: var(--ed-radius-md);
  padding: 1.25rem;
  box-shadow: var(--ed-shadow);
  border: 1px solid var(--ed-border);
  display: flex;
  flex-direction: column;
  min-height: 500px;
}

.ed-cal-list-header {
  border-bottom: 2px solid var(--ed-border);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.ed-cal-list-header h6 {
  color: var(--ed-gray-900);
  font-size: 1.125rem;
}

.ed-cal-list-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(500px - 120px);
  min-height: 200px;
  scrollbar-width: thin;
  scrollbar-color: var(--ed-gray-300) transparent;
}

.ed-cal-list-body::-webkit-scrollbar {
  width: 6px;
}

.ed-cal-list-body::-webkit-scrollbar-thumb {
  background: var(--ed-gray-300);
  border-radius: var(--ed-radius-full);
}

.ed-cal-list-body::-webkit-scrollbar-thumb:hover {
  background: var(--ed-gray-400);
}

.ed-cal-ticket-item {
  padding: 1rem;
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
  margin-bottom: 0.75rem;
  background: var(--ed-card-bg);
  cursor: pointer;
  transition: all var(--ed-transition-fast);
}

.ed-cal-ticket-item:hover {
  background: var(--ed-card-bg-hover);
  border-color: var(--ed-primary-light);
  transform: translateX(4px);
  box-shadow: var(--ed-shadow-sm);
}

.ed-cal-ticket-item:last-child {
  margin-bottom: 0;
}

.ed-cal-ticket-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.ed-cal-ticket-protocolo {
  font-weight: 700;
  color: var(--ed-primary-dark);
  font-size: 0.9375rem;
}

.ed-cal-ticket-title {
  font-weight: 600;
  color: var(--ed-gray-900);
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.ed-cal-ticket-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.ed-cal-ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--ed-gray-600);
}

.ed-cal-ticket-meta-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.ed-cal-ticket-meta-item i {
  font-size: 0.875rem;
  opacity: 0.7;
}

/* Responsivo: empilhar colunas em telas pequenas */
@media (max-width: 992px) {
  .ed-cal-container {
    flex-direction: column;
  }

  .ed-cal-left {
    flex: 1 1 auto;
  }

  .ed-cal-right {
    min-height: 400px;
  }

  .ed-cal-list-body {
    max-height: 350px;
  }
}

@media (max-width: 576px) {
  .ed-cal-left {
    padding: 1rem;
  }

  .ed-cal-grid {
    gap: 0.375rem;
  }

  .ed-cal-day {
    min-height: 45px;
    font-size: 0.8125rem;
  }

  .ed-cal-badge-count {
    font-size: 0.5625rem;
    min-width: 16px;
    height: 16px;
    top: 0.125rem;
    right: 0.125rem;
  }

  .ed-cal-header {
    flex-wrap: wrap;
  }

  .ed-cal-header h5 {
    width: 100%;
    order: 3;
    margin-top: 0.5rem;
  }
}

/* Agenda (Eventos) — substitui Cards de Projeto no Calendário */
.ed-cal-agenda-item {
  padding: 0.9rem 1rem;
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
  cursor: pointer;
  transition: all var(--ed-transition-fast);
  border-left: 4px solid rgba(139, 92, 246, 0.95);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ed-cal-agenda-item:hover {
  background: linear-gradient(135deg, #f5f3ff 0%, #fbfbff 100%);
  border-color: rgba(139, 92, 246, 0.35);
  transform: translateX(4px);
  box-shadow: var(--ed-shadow-sm);
}

.ed-cal-agenda-item:last-child {
  margin-bottom: 0;
}

.ed-cal-agenda-title {
  font-weight: 800;
  color: #1f2937;
  font-size: 0.95rem;
  line-height: 1.35;
  word-break: break-word;
}

.ed-cal-agenda-meta {
  margin-top: 0.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  font-size: 0.82rem;
  color: var(--ed-gray-600);
}

.ed-cal-agenda-time,
.ed-cal-agenda-location {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.ed-cal-agenda-chevron {
  color: var(--ed-gray-400);
  flex: 0 0 auto;
}

@media (max-width: 576px) {
  .ed-cal-agenda-meta {
    flex-direction: column;
    gap: 0.25rem;
  }
  .ed-cal-agenda-time,
  .ed-cal-agenda-location {
    white-space: normal;
  }
}

/* (Legado) Cards de Projeto — não usado no Calendário a partir do Prompt 4.2.7 */
.ed-cal-card-item {
  padding: 1rem;
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  cursor: pointer;
  transition: all var(--ed-transition-fast);
  border-left: 4px solid var(--ed-primary);
}

.ed-cal-card-item:hover {
  background: linear-gradient(135deg, #f1f5f9 0%, #fafbfc 100%);
  border-color: var(--ed-primary-light);
  transform: translateX(4px);
  box-shadow: var(--ed-shadow-sm);
}

.ed-cal-card-item:last-child {
  margin-bottom: 0;
}

.ed-cal-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.ed-cal-card-title {
  font-weight: 700;
  color: var(--ed-primary-dark);
  font-size: 0.9375rem;
  margin-bottom: 0.375rem;
  line-height: 1.4;
  flex: 1;
}

.ed-cal-card-owners {
  font-size: 0.8125rem;
  color: var(--ed-gray-600);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.ed-cal-card-owners i {
  font-size: 0.875rem;
  opacity: 0.7;
}

.ed-cal-card-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--ed-gray-600);
  margin-top: 0.5rem;
}

.ed-cal-card-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--ed-gray-200);
  border-radius: var(--ed-radius-full);
  overflow: hidden;
}

.ed-cal-card-progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--ed-primary) 0%,
    var(--ed-primary-light) 100%
  );
  transition: width var(--ed-transition-base);
}

.ed-cal-section-title {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--ed-gray-700);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--ed-border);
}

.ed-cal-section-title:first-child {
  margin-top: 0;
}

/* Checklist no modal */
.ed-cal-checklist-list {
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
  background: var(--ed-gray-50);
  padding: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
}

.ed-cal-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--ed-radius-sm);
  margin-bottom: 0.5rem;
  background: var(--ed-white);
  transition: background var(--ed-transition-fast);
}

.ed-cal-checklist-item:hover {
  background: var(--ed-gray-100);
}

.ed-cal-checklist-item:last-child {
  margin-bottom: 0;
}

.ed-cal-checklist-item input[type="checkbox"] {
  margin-top: 0.25rem;
  cursor: pointer;
  flex-shrink: 0;
}

.ed-cal-checklist-item input[type="text"] {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  padding: 0.25rem 0;
}

.ed-cal-checklist-item input[type="text"]:focus {
  outline: 2px solid var(--ed-primary);
  outline-offset: 2px;
  border-radius: var(--ed-radius-sm);
}

.ed-cal-checklist-item.done input[type="text"] {
  text-decoration: line-through;
  color: var(--ed-gray-500);
}

.ed-cal-checklist-item-remove {
  background: transparent;
  border: none;
  color: var(--ed-danger);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--ed-radius-sm);
  transition: background var(--ed-transition-fast);
  flex-shrink: 0;
}

.ed-cal-checklist-item-remove:hover {
  background: var(--ed-gray-200);
}

.ed-cal-checklist-empty {
  text-align: center;
  color: var(--ed-gray-500);
  font-size: 0.875rem;
  padding: 1rem;
}

/* Badge duplo no calendário (Tickets + Agenda) */
.ed-cal-badge-tickets {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  background: var(--ed-primary);
  color: var(--ed-white);
  border-radius: var(--ed-radius-full);
  font-size: 0.625rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  line-height: 1;
}

.ed-cal-badge-agenda {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: rgba(139, 92, 246, 0.95);
  color: var(--ed-white);
  border-radius: var(--ed-radius-full);
  font-size: 0.625rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  line-height: 1;
}

.ed-cal-day--selected .ed-cal-badge-tickets,
.ed-cal-day--selected .ed-cal-badge-agenda {
  background: var(--ed-white);
  color: var(--ed-primary-dark);
}

.ed-cal-day[role="button"]:focus-visible {
  outline: 3px solid var(--ed-primary);
  outline-offset: 2px;
  border-radius: var(--ed-radius);
}

.alert-sm {
  font-size: 0.8125rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}

/* ========== PROJETOS - EXECUTIVO (ESCOPADO) ========== */
#view-projetos {
  /* Não depende de estilos globais "ruins": define tokens próprios só para esta view */
  --proj-surface: rgba(255, 255, 255, 0.92);
  --proj-border: rgba(15, 23, 42, 0.1);
  --proj-shadow: 0 12px 34px rgba(2, 6, 23, 0.08);
  --proj-soft: rgba(15, 118, 110, 0.06);

  background:
    radial-gradient(
      1200px 600px at 10% 0%,
      var(--proj-soft) 0%,
      transparent 60%
    ),
    radial-gradient(
      900px 500px at 90% 10%,
      rgba(16, 185, 129, 0.06) 0%,
      transparent 55%
    );
  border-radius: 18px;
  padding: 0.25rem;
}

#view-projetos .card {
  border-radius: 18px;
  border: 1px solid var(--proj-border);
  box-shadow: var(--proj-shadow);
  background: var(--proj-surface);
  backdrop-filter: blur(8px);
}

#view-projetos .card-header {
  background: linear-gradient(
    180deg,
    rgba(15, 118, 110, 0.08) 0%,
    rgba(255, 255, 255, 0.75) 100%
  );
  border-bottom: 1px solid var(--proj-border);
}

#view-projetos .form-control,
#view-projetos .form-select {
  border-radius: 12px;
}

#view-projetos .btn {
  border-radius: 12px;
  font-weight: 700;
}

#view-projetos .table-responsive {
  border-radius: 14px;
}

/* Estado vazio / primeiro uso (Projetos) */
#view-projetos .proj-empty-state {
  padding: 0.25rem 0.25rem 1rem;
}

#view-projetos .proj-empty-card {
  border-radius: 18px;
  border: 1px dashed rgba(15, 118, 110, 0.28);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: var(--proj-shadow);
  padding: 2rem 1.5rem;
  text-align: center;
}

#view-projetos .proj-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
  color: var(--ed-primary-dark);
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.16) 0%,
    rgba(16, 185, 129, 0.1) 100%
  );
  border: 1px solid rgba(15, 118, 110, 0.18);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.1);
}

#view-projetos .proj-empty-icon i {
  font-size: 1.6rem;
}

/* ========== PROJETOS - MODAL (edição/criação) ========== */
#modal-projeto .modal-content {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 22px 60px rgba(2, 6, 23, 0.18);
}

#modal-projeto .modal-header {
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.1) 0%,
    rgba(255, 255, 255, 0.92) 70%
  );
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

#modal-projeto .projeto-modal-hero-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--ed-primary-dark);
  background: rgba(15, 118, 110, 0.14);
  border: 1px solid rgba(15, 118, 110, 0.18);
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.1);
}

#modal-projeto .projeto-modal-hero-icon i {
  font-size: 1.25rem;
}

#modal-projeto .projeto-modal-section {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.08);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
}

#modal-projeto .projeto-modal-section .card-header {
  background: linear-gradient(
    180deg,
    rgba(15, 118, 110, 0.08) 0%,
    rgba(255, 255, 255, 0.9) 100%
  );
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding: 0.85rem 1rem;
}

#modal-projeto .projeto-modal-section .card-body {
  padding: 1rem;
}

#modal-projeto .projeto-elia-assistant-card {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.1) 0%,
    rgba(255, 255, 255, 0.92) 70%
  );
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.08);
}

#modal-projeto .projeto-elia-badge {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--ed-primary-dark);
  background: rgba(15, 118, 110, 0.16);
  border: 1px solid rgba(15, 118, 110, 0.22);
}

/* ========== PROJETOS • ELIA COPILOT (MODAL) ========== */
#modal-projeto .proj-elia-copilot .proj-elia-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

#modal-projeto .proj-elia-copilot .proj-elia-head-left {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
}

#modal-projeto .proj-elia-copilot .proj-elia-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

#modal-projeto .proj-elia-copilot .proj-elia-actions .btn-group {
  background: rgba(248, 250, 252, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  padding: 0.25rem;
  gap: 0.25rem;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.06);
}

#modal-projeto .proj-elia-copilot .proj-elia-actions .btn {
  border-radius: 999px !important;
  font-weight: 900;
  letter-spacing: -0.01em;
  padding: 0.45rem 0.75rem;
  transition: all var(--ed-transition-base);
}

#modal-projeto .proj-elia-copilot .proj-elia-actions .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(2, 6, 23, 0.1);
}

#modal-projeto .proj-elia-copilot .proj-elia-actions .btn:disabled {
  transform: none;
  box-shadow: none;
  opacity: 0.75;
}

#modal-projeto .proj-elia-copilot .proj-elia-share .btn {
  border-radius: 999px;
  font-weight: 800;
}

#modal-projeto .proj-elia-copilot .proj-elia-out {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  padding: 0.75rem 0.85rem;
  min-height: 96px;
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.06);
  white-space: pre-wrap;
  word-break: break-word;
}

#modal-projeto .proj-elia-copilot .proj-elia-out .proj-elia-out-title {
  font-weight: 900;
  color: var(--ed-gray-900);
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#modal-projeto .proj-elia-copilot .proj-elia-bullets {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
}

#modal-projeto .proj-elia-copilot .proj-elia-bullets li {
  margin: 0.25rem 0;
  line-height: 1.35;
}

#modal-projeto .proj-elia-copilot .proj-elia-raw {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ed-gray-800);
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(248, 250, 252, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  padding: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
}

#modal-projeto .proj-elia-copilot .proj-elia-raw-fallback {
  margin-top: 0.5rem;
}

#modal-projeto .proj-elia-copilot .proj-elia-raw-fallback .alert {
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  background: rgba(255, 251, 235, 0.95);
}

/* Skeleton (loading) */
@keyframes projEliaShimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

#modal-projeto .proj-elia-copilot .proj-elia-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

#modal-projeto .proj-elia-copilot .proj-elia-skeleton-line {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.08) 0%,
    rgba(15, 118, 110, 0.16) 50%,
    rgba(15, 23, 42, 0.08) 100%
  );
  background-size: 200% 200%;
  animation: projEliaShimmer 1.1s ease-in-out infinite;
}

#modal-projeto .proj-elia-copilot.is-loading {
  opacity: 0.8;
}

#modal-projeto .proj-elia-copilot.is-loading .proj-elia-actions .btn {
  pointer-events: none;
}

#modal-projeto #projeto-elia-card.is-loading {
  opacity: 0.8;
}

#modal-projeto #projeto-elia-card.is-loading .proj-elia-actions .btn {
  pointer-events: none;
}

#modal-projeto .proj-elia-copilot #projeto-elia-status {
  font-size: 0.875rem;
  color: var(--ed-gray-600);
}

#modal-projeto .proj-elia-copilot #projeto-elia-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ed-primary);
  font-size: 0.875rem;
}

#modal-projeto .proj-elia-copilot #projeto-elia-resumo-container {
  margin-top: 0.5rem;
}

#modal-projeto .proj-elia-copilot .proj-elia-output {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(2, 6, 23, 0.04);
}

#modal-projeto .proj-elia-copilot .proj-elia-out {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ed-gray-800);
}

#modal-projeto .proj-elia-copilot .proj-elia-out ul {
  margin: 0;
  padding-left: 1.25rem;
}

#modal-projeto .proj-elia-copilot .proj-elia-out ul li {
  margin: 0.25rem 0;
}

@media (max-width: 576px) {
  #modal-projeto .proj-elia-copilot .proj-elia-head {
    flex-direction: column;
    align-items: stretch;
  }

  #modal-projeto .proj-elia-copilot .proj-elia-actions {
    justify-content: flex-start;
  }

  #modal-projeto .proj-elia-copilot .proj-elia-actions .btn-group {
    width: 100%;
    justify-content: space-between;
  }
}

#modal-projeto .nav-tabs {
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

#modal-projeto .nav-tabs .nav-link {
  border: 0;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  font-weight: 800;
  color: var(--ed-gray-700);
}

#modal-projeto .nav-tabs .nav-link.active {
  color: var(--ed-primary-dark);
  background: rgba(15, 118, 110, 0.1);
}

#modal-projeto .modal-body {
  padding-top: 1rem;
}

#modal-projeto .modal-footer {
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  background: linear-gradient(
    180deg,
    rgba(248, 250, 252, 0.85) 0%,
    rgba(255, 255, 255, 0.95) 100%
  );
}

/* =========================================================
   PROJETOS • MODAL NOVO PROJETO (UX PREMIUM)
   (Resumo + preview em tempo real; não altera payload)
   ========================================================= */

#modal-projeto .proj-modal-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.1) 0%,
    rgba(255, 255, 255, 0.92) 70%
  );
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.06);
}

#modal-projeto .proj-modal-hero-main {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  min-width: 0;
}

#modal-projeto .proj-hero-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--ed-primary-dark);
  background: rgba(15, 118, 110, 0.14);
  border: 1px solid rgba(15, 118, 110, 0.2);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.1);
}

#modal-projeto .proj-hero-icon i {
  font-size: 1.25rem;
}

#modal-projeto .proj-hero-title {
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-size: 1.15rem;
  color: var(--ed-gray-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#modal-projeto .proj-hero-sub {
  margin-top: 0.25rem;
  color: var(--ed-gray-700);
  font-size: 0.9rem;
  line-height: 1.35;
}

#modal-projeto .proj-hero-micro {
  color: var(--ed-gray-600);
  font-size: 0.78rem;
}

#modal-projeto .proj-hero-tips {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.92);
  padding: 0.75rem 0.85rem;
}

#modal-projeto .proj-hero-tips-title {
  font-weight: 800;
  color: var(--ed-gray-900);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
}

#modal-projeto .proj-hero-tips-list {
  margin-top: 0.55rem;
  padding-left: 1.1rem;
  color: var(--ed-gray-700);
  font-size: 0.85rem;
}

#modal-projeto .proj-hero-tips-list li + li {
  margin-top: 0.25rem;
}

/* Seções (cards) */
#modal-projeto .proj-section-card {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.08);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
}

#modal-projeto .proj-section-card:hover {
  border-color: rgba(15, 118, 110, 0.25);
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.12);
}

#modal-projeto .proj-section-title {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--ed-gray-900);
}

#modal-projeto .proj-section-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ed-primary-dark);
  background: rgba(15, 118, 110, 0.12);
  border: 1px solid rgba(15, 118, 110, 0.18);
}

#modal-projeto .proj-section-icon i {
  line-height: 1;
  display: block;
  margin: 0 !important; /* evita deslocamento por classes bootstrap (ex: me-2) */
}

/* Mesma centralização (sem depender do #modal-projeto) */
.proj-section-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ed-primary-dark);
  background: rgba(15, 118, 110, 0.12);
  border: 1px solid rgba(15, 118, 110, 0.18);
}

.proj-section-icon i {
  line-height: 1;
  display: block;
  margin: 0 !important;
}

/* Tabs “pills” (mantém nav-tabs do Bootstrap, só troca skin) */
#modal-projeto .proj-tabs-pills {
  gap: 0.5rem;
  padding: 0.35rem;
  border-bottom: 0;
  background: rgba(248, 250, 252, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
}

#modal-projeto .proj-tabs-pills .nav-link {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.5rem 0.85rem;
  font-weight: 800;
  color: var(--ed-gray-700);
  transition: all var(--ed-transition-base);
  background: transparent;
}

#modal-projeto .proj-tabs-pills .nav-link:hover {
  background: rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.18);
  color: var(--ed-primary-dark);
}

#modal-projeto .proj-tabs-pills .nav-link.active {
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.16) 0%,
    rgba(255, 255, 255, 0.92) 70%
  );
  border-color: rgba(15, 118, 110, 0.22);
  color: var(--ed-primary-dark);
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.1);
}

/* Preview card */
#modal-projeto .proj-preview-card .card-body {
  padding: 1rem;
}

#modal-projeto .proj-preview-title {
  font-weight: 900;
  color: var(--ed-gray-900);
  letter-spacing: -0.02em;
  font-size: 1.05rem;
  line-height: 1.2;
  word-break: break-word;
}

#modal-projeto .proj-preview-desc {
  margin-top: 0.35rem;
  color: var(--ed-gray-700);
  font-size: 0.875rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

#modal-projeto .proj-preview-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

#modal-projeto .proj-preview-meta-item {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.85);
  padding: 0.6rem 0.75rem;
  min-width: 0;
}

#modal-projeto .proj-preview-meta-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ed-gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#modal-projeto .proj-preview-meta-value {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
  color: var(--ed-gray-900);
  margin-top: 0.2rem;
  font-size: 0.85rem;
  min-width: 0;
}

#modal-projeto .proj-preview-farol::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.18);
}

#modal-projeto .proj-preview-farol[data-farol="verde"]::before {
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
}

#modal-projeto .proj-preview-farol[data-farol="amarelo"]::before {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
}

#modal-projeto .proj-preview-farol[data-farol="vermelho"]::before {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18);
}

#modal-projeto .proj-preview-farol[data-farol="cinza"]::before {
  background: #6b7280;
  box-shadow: 0 0 0 4px rgba(107, 114, 128, 0.18);
}

#modal-projeto .proj-preview-farol[data-farol="auto"]::before,
#modal-projeto .proj-preview-farol:not([data-farol])::before {
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.18);
}

/* ========== PROJETOS • 5W2H MATRIZ + CHECKLIST ETAPAS ========== */

/* 5W2H (Modal) — layout V3: matriz full width + cards abaixo (sem aside “quebrando” no mobile) */
#modal-projeto .proj-5w2h-layout-v3 {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#modal-projeto.proj-5w2h-focus .modal-dialog {
  max-width: min(98vw, 1480px);
  width: min(98vw, 1480px);
  transition:
    width 160ms ease,
    max-width 160ms ease;
}

/* no modo foco: dá sensação de “expansão” e deixa a matriz protagonista */
#modal-projeto.proj-5w2h-focus #pane-projeto-5w2h {
  padding-bottom: 0.25rem;
}

#modal-projeto .proj-5w2h-focus-only {
  display: none;
}

#modal-projeto.proj-5w2h-focus .proj-5w2h-focus-only {
  display: inline-flex;
}

#modal-projeto .proj-5w2h-below-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

#modal-projeto.proj-5w2h-focus .proj-5w2h-below-grid {
  display: none;
}

#modal-projeto.proj-5w2h-focus.proj-5w2h-show-preview .proj-5w2h-below-grid {
  display: grid;
  grid-template-columns: 1fr;
}

#modal-projeto .proj-5w2h-layout-v3 .projeto-5w2h-preview-card {
  position: static;
  top: auto;
}

@media (max-width: 992px) {
  #modal-projeto .proj-5w2h-below-grid {
    grid-template-columns: 1fr;
  }
}

/* 5W2H (Modal) — Matriz estilo planilha */
#modal-projeto .proj-5w2h-matrix-layout {
  grid-template-columns: 1fr 320px;
}

#modal-projeto .proj-5w2h-matrix-layout .projeto-5w2h-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#modal-projeto .proj-5w2h-matrix-card {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(248, 250, 252, 0.85) 0%,
    rgba(255, 255, 255, 0.98) 100%
  );
  box-shadow: 0 14px 40px rgba(2, 6, 23, 0.08);
  overflow: hidden;
}

#modal-projeto .proj-5w2h-matrix-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.1) 0%,
    rgba(255, 255, 255, 0.92) 70%
  );
}

#modal-projeto .proj-5w2h-matrix-top-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

#modal-projeto .proj-5w2h-matrix-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 118, 110, 0.14);
  border: 1px solid rgba(15, 118, 110, 0.22);
  color: var(--ed-primary-dark);
  flex: 0 0 auto;
}

#modal-projeto .proj-5w2h-matrix-title {
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.1;
  color: var(--ed-gray-900);
}

#modal-projeto .proj-5w2h-matrix-sub {
  margin-top: 0.15rem;
  font-size: 0.85rem;
  color: var(--ed-gray-600);
  line-height: 1.3;
}

#modal-projeto .proj-5w2h-matrix-hint {
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--ed-gray-600);
  white-space: nowrap;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(248, 250, 252, 0.85);
}

/* Matriz (Modal): reduzir scroll horizontal em desktop padrão */
#modal-projeto #pane-projeto-5w2h .proj-matriz-5w2h {
  table-layout: fixed;
}

#modal-projeto #pane-projeto-5w2h .proj-5w2h-table-wrap {
  overflow: visible;
}

#modal-projeto #pane-projeto-5w2h .proj-matriz-5w2h thead th {
  white-space: normal;
  line-height: 1.15;
  padding: 0.6rem 0.45rem;
}

#modal-projeto #pane-projeto-5w2h .proj-matriz-5w2h tbody td {
  padding: 0.55rem;
}

#modal-projeto #pane-projeto-5w2h .proj-matriz-5w2h .projeto-5w2h-input {
  min-width: 0;
  padding: 0.45rem 0.5rem;
  font-size: 0.875rem;
}

#modal-projeto #pane-projeto-5w2h textarea.projeto-5w2h-input {
  overflow: hidden;
  resize: none;
}

#modal-projeto #pane-projeto-5w2h .projeto-5w2h-row-num {
  line-height: 1;
}

#modal-projeto #pane-projeto-5w2h .projeto-5w2h-row-actions {
  margin-top: 0.35rem;
  display: flex;
  justify-content: center;
  gap: 0.25rem;
}

#modal-projeto #pane-projeto-5w2h .projeto-5w2h-drag-handle {
  cursor: grab;
}

#modal-projeto
  #pane-projeto-5w2h
  .projeto-5w2h-row.is-done
  .projeto-5w2h-input {
  text-decoration: line-through;
  color: var(--ed-gray-500);
}

#modal-projeto #pane-projeto-5w2h .projeto-5w2h-row.is-dragging {
  opacity: 0.6;
}

#modal-projeto #pane-projeto-5w2h .projeto-5w2h-row.is-drag-over {
  background: var(--ed-gray-100);
}

#modal-projeto #pane-projeto-5w2h .projeto-5w2h-row-actions .btn {
  padding: 0.2rem 0.45rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

#modal-projeto #pane-projeto-5w2h .projeto-5w2h-row-actions .btn:hover {
  border-color: rgba(15, 118, 110, 0.35);
}

#modal-projeto #pane-projeto-5w2h .projeto-5w2h-done-check {
  margin-top: 0.2rem;
  cursor: pointer;
}

/* PROJETOS • 5W2H MULTI-ETAPAS (Modal) */
#modal-projeto #pane-projeto-5w2h .proj-matriz-5w2h tbody td {
  vertical-align: top;
  word-break: break-word;
}

#modal-projeto #pane-projeto-5w2h .proj-5w2h-field {
  white-space: normal;
  word-break: break-word;
}

#modal-projeto #pane-projeto-5w2h .btn-proj-5w2h-remove-row {
  opacity: 0.85;
}

#modal-projeto #pane-projeto-5w2h .btn-proj-5w2h-remove-row:hover {
  opacity: 1;
  border-color: rgba(220, 38, 38, 0.35);
}

#modal-projeto #pane-projeto-5w2h input[type="date"].projeto-5w2h-input,
#modal-projeto #pane-projeto-5w2h input.ed-date-input-br.projeto-5w2h-input {
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
}

#modal-projeto .proj-5w2h-matrix-hint-mobile {
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  background: rgba(239, 246, 255, 0.85);
  border: 1px solid rgba(15, 118, 110, 0.15);
}

#modal-projeto .proj-5w2h-matrix-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.9rem;
}

#modal-projeto .proj-5w2h-matrix-scroll::-webkit-scrollbar {
  height: 8px;
}

#modal-projeto .proj-5w2h-matrix-scroll::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.18);
  border-radius: 999px;
}

#modal-projeto .proj-5w2h-matrix {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  min-width: 1240px; /* matriz com 8 colunas: mantém leitura e permite scroll interno */
}

#modal-projeto .proj-5w2h-matrix-grid {
  display: grid;
  grid-template-columns: 220px 220px 170px 170px 150px 150px 220px 170px;
}

#modal-projeto .proj-5w2h-matrix-head {
  background: linear-gradient(
    180deg,
    rgba(248, 250, 252, 0.95) 0%,
    rgba(241, 245, 249, 0.85) 100%
  );
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

#modal-projeto .proj-5w2h-head-cell {
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-right: 1px solid rgba(15, 23, 42, 0.1);
  min-width: 0;
}

#modal-projeto .proj-5w2h-head-cell:last-child {
  border-right: none;
}

#modal-projeto .proj-5w2h-head-cell i {
  color: var(--ed-primary-dark);
  opacity: 0.95;
}

#modal-projeto .proj-5w2h-head-txt {
  min-width: 0;
}

#modal-projeto .proj-5w2h-head-pt {
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--ed-gray-900);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

#modal-projeto .proj-5w2h-head-en {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ed-gray-500);
  font-weight: 900;
  margin-top: 0.1rem;
}

#modal-projeto .proj-5w2h-matrix-body {
  background: rgba(255, 255, 255, 0.98);
}

#modal-projeto .proj-5w2h-cell {
  padding: 0.75rem;
  border-right: 1px solid rgba(15, 23, 42, 0.1);
  border-bottom: none;
  min-width: 0;
}

#modal-projeto .proj-5w2h-cell:last-child {
  border-right: none;
}

#modal-projeto .proj-5w2h-cell-label {
  display: none; /* aparece no mobile */
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--ed-gray-800);
  margin-bottom: 0.5rem;
}

#modal-projeto .proj-5w2h-cell-label i {
  color: var(--ed-primary-dark);
}

#modal-projeto .proj-5w2h-cell-en {
  font-size: 0.68rem;
  color: var(--ed-gray-500);
  font-weight: 900;
  margin-left: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#modal-projeto .proj-5w2h-matrix textarea.projeto-5w2h-input {
  min-height: 110px;
  resize: vertical;
}

/* Status/Farol (lado direito) */
#modal-projeto .proj-5w2h-meta-card {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
  margin-bottom: 1rem;
}

#modal-projeto .proj-5w2h-meta-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.1) 0%,
    rgba(255, 255, 255, 0.92) 70%
  );
}

#modal-projeto .proj-5w2h-meta-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 900;
  color: var(--ed-gray-900);
}

#modal-projeto .proj-5w2h-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
}

#modal-projeto .proj-5w2h-meta-item {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.85);
  padding: 0.6rem 0.75rem;
  min-width: 0;
}

#modal-projeto .proj-5w2h-meta-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--ed-gray-600);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#modal-projeto .proj-5w2h-meta-title i,
#modal-projeto .proj-5w2h-meta-label i {
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  top: 0.5px;
}

#modal-projeto .proj-5w2h-meta-value {
  margin-top: 0.25rem;
  font-weight: 900;
  color: var(--ed-gray-900);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

#modal-projeto .proj-5w2h-meta-farol {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 900;
}

/* Checklist (Modal) — etapas protagonistas */
#modal-projeto #pane-projeto-checklist .proj-checklist-shell {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(248, 250, 252, 0.85) 0%,
    rgba(255, 255, 255, 0.98) 100%
  );
  box-shadow: 0 14px 40px rgba(2, 6, 23, 0.08);
  padding: 1rem;
}

#modal-projeto #pane-projeto-checklist .proj-checklist-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

#modal-projeto #pane-projeto-checklist .proj-checklist-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

#modal-projeto #pane-projeto-checklist .proj-checklist-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 118, 110, 0.14);
  border: 1px solid rgba(15, 118, 110, 0.22);
  color: var(--ed-primary-dark);
  flex: 0 0 auto;
}

#modal-projeto #pane-projeto-checklist .proj-checklist-title {
  font-weight: 900;
  color: var(--ed-gray-900);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

#modal-projeto #pane-projeto-checklist .proj-checklist-sub {
  margin-top: 0.15rem;
  font-size: 0.85rem;
  color: var(--ed-gray-600);
  line-height: 1.35;
}

#modal-projeto #pane-projeto-checklist .proj-checklist-add-btn {
  border-radius: 999px;
  font-weight: 900;
  padding: 0.55rem 0.9rem;
  white-space: nowrap;
}

#modal-projeto #pane-projeto-checklist .proj-checklist-progress-row {
  margin-top: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#modal-projeto #pane-projeto-checklist .proj-checklist-progress {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.1);
}

#modal-projeto #pane-projeto-checklist .proj-checklist-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #14b8a6 0%, #22c55e 100%);
  transition: width var(--ed-transition-base);
}

#modal-projeto #pane-projeto-checklist .proj-checklist-progress-meta {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-weight: 900;
  color: var(--ed-gray-700);
  white-space: nowrap;
}

#modal-projeto #pane-projeto-checklist .proj-checklist-progress-pct {
  color: var(--ed-primary-dark);
}

#modal-projeto #pane-projeto-checklist .projeto-checklist-list {
  margin-top: 0.9rem;
  max-height: min(62vh, 560px);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  padding: 0.85rem;
}

#modal-projeto #pane-projeto-checklist .proj-checklist-steps {
  counter-reset: projStep;
}

#modal-projeto #pane-projeto-checklist .projeto-checklist-item {
  position: relative;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.06);
  cursor: pointer;
}

#modal-projeto #pane-projeto-checklist .projeto-checklist-item::before {
  counter-increment: projStep;
  content: counter(projStep);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.8rem;
  color: var(--ed-primary-dark);
  background: rgba(15, 118, 110, 0.12);
  border: 1px solid rgba(15, 118, 110, 0.18);
  flex: 0 0 auto;
  margin-top: 0.05rem;
}

#modal-projeto #pane-projeto-checklist .projeto-checklist-item.done {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.28);
}

#modal-projeto #pane-projeto-checklist .projeto-checklist-item.done::before {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.28);
  color: #047857;
}

#modal-projeto
  #pane-projeto-checklist
  .projeto-checklist-item
  input[type="checkbox"] {
  transform: scale(1.15);
  margin-top: 0.35rem;
}

#modal-projeto #pane-projeto-checklist .projeto-checklist-item-text {
  font-size: 0.95rem;
  font-weight: 700;
}

#modal-projeto #pane-projeto-checklist .projeto-checklist-item-remove {
  border-radius: 10px;
}

/* Drawer: tabs principais no miolo */
.projeto-drawer-main-tabs-v2 .projeto-drawer-tabs-v2 {
  padding: 0;
  margin: 0 0 1rem;
  background: transparent;
}

.projeto-drawer-main-tab-content-v2 {
  padding-top: 0.25rem;
}

.projeto-drawer-main-tab-content-v2 > .tab-pane {
  padding-top: 0.5rem;
}

/* Responsivo */
@media (max-width: 992px) {
  #modal-projeto .proj-5w2h-matrix-layout {
    grid-template-columns: 1fr;
  }

  #modal-projeto .proj-5w2h-matrix-scroll {
    overflow: visible;
    padding: 0.85rem;
  }

  #modal-projeto .proj-5w2h-matrix {
    min-width: 0;
    border: none;
    background: transparent;
  }

  #modal-projeto .proj-5w2h-matrix-head {
    display: none;
  }

  #modal-projeto .proj-5w2h-matrix-grid {
    grid-template-columns: 1fr;
  }

  #modal-projeto .proj-5w2h-matrix-body {
    gap: 0.75rem;
    background: transparent;
  }

  #modal-projeto .proj-5w2h-cell {
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 26px rgba(2, 6, 23, 0.06);
  }

  #modal-projeto .proj-5w2h-cell-label {
    display: flex;
  }

  #modal-projeto #pane-projeto-checklist .proj-checklist-header {
    flex-direction: column;
    align-items: stretch;
  }

  #modal-projeto #pane-projeto-checklist .proj-checklist-add-btn {
    width: 100%;
  }
}

#modal-projeto .proj-preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

#modal-projeto .proj-preview-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: rgba(15, 118, 110, 0.08);
  color: var(--ed-primary-dark);
  font-weight: 800;
  font-size: 0.75rem;
}

/* Acessibilidade: foco mais “premium” */
#modal-projeto .form-control:focus,
#modal-projeto .form-select:focus {
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 0 0 0.25rem rgba(15, 118, 110, 0.14);
}

@media (min-width: 992px) {
  #modal-projeto .proj-modal-hero {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

@media (max-width: 576px) {
  #modal-projeto .proj-tabs-pills .nav-link {
    padding: 0.45rem 0.7rem;
    font-size: 0.85rem;
  }
}

/* ========== PROJETO - 5W2H (Modal) | UI/UX fluída ========== */
#modal-projeto .projeto-5w2h-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1rem;
  align-items: start;
}

#modal-projeto .projeto-5w2h-main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

#modal-projeto .projeto-5w2h-intro {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.1) 0%,
    rgba(255, 255, 255, 0.92) 70%
  );
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.06);
}

#modal-projeto .projeto-5w2h-intro-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

#modal-projeto .projeto-5w2h-intro-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: rgba(15, 118, 110, 0.14);
  border: 1px solid rgba(15, 118, 110, 0.22);
  color: var(--ed-primary-dark);
}

#modal-projeto .projeto-5w2h-intro-title {
  font-weight: 900;
  margin: 0;
  line-height: 1.1;
}

#modal-projeto .projeto-5w2h-intro-sub {
  margin: 0.15rem 0 0;
  color: var(--ed-gray-600);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#modal-projeto .projeto-5w2h-intro-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#modal-projeto .projeto-5w2h-section {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  padding: 1rem;
  transition: all var(--ed-transition-base);
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.06);
}

#modal-projeto .projeto-5w2h-section:hover {
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.1);
  transform: translateY(-1px);
}

#modal-projeto .projeto-5w2h-span2 {
  grid-column: 1 / -1;
}

#modal-projeto .projeto-5w2h-section-dates {
  background: linear-gradient(
    135deg,
    rgba(239, 246, 255, 0.92) 0%,
    rgba(255, 255, 255, 0.96) 60%
  );
  border-color: rgba(15, 118, 110, 0.18);
}

#modal-projeto .projeto-5w2h-section-cost {
  background: linear-gradient(
    135deg,
    rgba(255, 249, 230, 0.95) 0%,
    rgba(255, 255, 255, 0.96) 55%
  );
  border-color: rgba(245, 158, 11, 0.35);
}

#modal-projeto .projeto-5w2h-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.75rem;
}

#modal-projeto .projeto-5w2h-icon {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 1.15rem;
  background: rgba(15, 118, 110, 0.12);
  border: 1px solid rgba(15, 118, 110, 0.18);
  color: var(--ed-primary-dark);
  transition: all var(--ed-transition-base);
}

#modal-projeto .projeto-5w2h-section:hover .projeto-5w2h-icon {
  transform: scale(1.06);
}

#modal-projeto .projeto-5w2h-label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin: 0;
  font-weight: 800;
  color: var(--ed-gray-900);
}

#modal-projeto .projeto-5w2h-en {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ed-gray-500);
}

#modal-projeto .projeto-5w2h-pt {
  font-size: 0.95rem;
  color: var(--ed-gray-900);
}

#modal-projeto .projeto-5w2h-input {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.96);
  transition: all var(--ed-transition-base);
}

#modal-projeto .projeto-5w2h-input:focus {
  border-color: rgba(15, 118, 110, 0.75);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
  outline: none;
}

#modal-projeto .projeto-5w2h-input::placeholder {
  color: var(--ed-gray-400);
}

#modal-projeto .projeto-5w2h-input-cost {
  font-weight: 800;
  color: var(--ed-warning-dark);
}

/* Preview (lado direito) */
#modal-projeto .projeto-5w2h-preview-card {
  position: sticky;
  top: 0.75rem;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 40px rgba(2, 6, 23, 0.1);
}

#modal-projeto .projeto-5w2h-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.08) 0%,
    rgba(255, 255, 255, 0.92) 60%
  );
}

#modal-projeto .projeto-5w2h-preview-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 900;
  margin: 0;
}

#modal-projeto .projeto-5w2h-preview-progress {
  font-size: 0.75rem;
  color: var(--ed-gray-600);
  font-weight: 800;
  white-space: nowrap;
  min-width: 72px;
  text-align: right;
}

#modal-projeto .projeto-5w2h-preview-bar {
  height: 12px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

#modal-projeto .projeto-5w2h-preview-bar > div {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22c55e 0%, #0f766e 55%, #f59e0b 100%);
  transition: width var(--ed-transition-base);
}

#modal-projeto .projeto-5w2h-preview-steps {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

#modal-projeto .projeto-5w2h-preview-step {
  padding: 0.55rem 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.65);
}

#modal-projeto .projeto-5w2h-preview-step-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

#modal-projeto .projeto-5w2h-preview-step-title {
  font-weight: 800;
  line-height: 1.25;
}

#modal-projeto .projeto-5w2h-preview-step-deadline {
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--ed-gray-700);
  background: rgba(15, 118, 110, 0.1);
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
  white-space: nowrap;
}

#modal-projeto .projeto-5w2h-preview-step-meta {
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--ed-gray-700);
  font-weight: 700;
}

#modal-projeto .projeto-5w2h-preview-body {
  padding: 0.9rem 0.95rem;
  font-size: 0.875rem;
  color: var(--ed-gray-800);
}

#modal-projeto .projeto-5w2h-preview-item {
  margin-bottom: 0.75rem;
}

#modal-projeto .projeto-5w2h-preview-item:last-child {
  margin-bottom: 0;
}

#modal-projeto .projeto-5w2h-preview-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 900;
  color: var(--ed-gray-600);
  margin-bottom: 0.25rem;
}

#modal-projeto .projeto-5w2h-preview-value {
  white-space: pre-wrap;
  line-height: 1.35;
}

#modal-projeto .projeto-5w2h-preview-actions {
  padding: 0.85rem 0.95rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(
    180deg,
    rgba(248, 250, 252, 0.7) 0%,
    rgba(255, 255, 255, 0.95) 100%
  );
  display: flex;
  gap: 0.5rem;
}

#modal-projeto .projeto-5w2h-preview-actions .btn {
  border-radius: 12px;
  font-weight: 800;
}

/* Dependências (inline add) */
#modal-projeto .projeto-dependencias-add {
  border: 1px dashed rgba(15, 118, 110, 0.35);
  background: rgba(15, 118, 110, 0.06);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.75rem;
}

#modal-projeto .projeto-dependencias-add .form-label {
  margin-bottom: 0.25rem;
}

@media (max-width: 992px) {
  #modal-projeto .projeto-5w2h-layout {
    grid-template-columns: 1fr;
  }

  #modal-projeto .projeto-5w2h-main {
    grid-template-columns: 1fr;
  }

  #modal-projeto .projeto-5w2h-span2 {
    grid-column: auto;
  }

  #modal-projeto .projeto-5w2h-preview-card {
    position: static;
  }

  #modal-projeto .projeto-5w2h-preview-actions {
    flex-direction: column;
  }
}

/* ========== PROJETOS - KANBAN ========== */
.projetos-kanban-container {
  /* Layout Trello-like: colunas responsivas com scroll horizontal quando necessário */
  display: flex;
  gap: var(--proj-spacing-md);
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: visible;
  padding: var(--proj-spacing-md) 0;
  min-height: 400px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--ed-gray-300) transparent;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.projetos-kanban-container::-webkit-scrollbar {
  height: 8px;
}

.projetos-kanban-container::-webkit-scrollbar-track {
  background: transparent;
  border-radius: var(--proj-radius);
}

.projetos-kanban-container::-webkit-scrollbar-thumb {
  background: var(--ed-gray-300);
  border-radius: var(--proj-radius);
}

.projetos-kanban-container::-webkit-scrollbar-thumb:hover {
  background: var(--ed-gray-400);
}

.projeto-coluna {
  background: var(--proj-surface);
  border-radius: var(--proj-radius-md);
  padding: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--proj-border);
  box-shadow: var(--proj-shadow);
  min-width: 300px;
  max-width: 350px;
  flex-shrink: 0;
  height: fit-content;
  max-height: calc(100vh - 250px);
  transition: all var(--proj-transition);
}

.projeto-coluna:hover {
  box-shadow: var(--proj-shadow-hover);
}

.projeto-coluna-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--proj-spacing);
  background: var(--proj-surface);
  border-bottom: 1px solid var(--proj-border);
  border-radius: var(--proj-radius-md) var(--proj-radius-md) 0 0;
}

.projeto-coluna-header-left {
  display: flex;
  align-items: center;
  gap: var(--proj-spacing-sm);
  flex: 1;
  min-width: 0;
}

.projeto-coluna-title {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--ed-gray-900);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.projeto-coluna-count {
  background: var(--ed-gray-300);
  color: var(--ed-gray-700);
  border-radius: var(--ed-radius-full);
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.projeto-coluna-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--proj-spacing-sm);
  min-height: 80px;
  max-height: calc(100vh - 300px);
  scrollbar-width: thin;
  scrollbar-color: var(--ed-gray-300) transparent;
}

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

.projeto-coluna-body::-webkit-scrollbar-track {
  background: transparent;
  border-radius: var(--proj-radius);
}

.projeto-coluna-body::-webkit-scrollbar-thumb {
  background: var(--ed-gray-300);
  border-radius: var(--proj-radius);
}

.projeto-coluna-body::-webkit-scrollbar-thumb:hover {
  background: var(--ed-gray-400);
}

.projeto-coluna-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  background: var(--ed-gray-100);
  border: 1px solid var(--proj-border);
  border-radius: var(--proj-radius-sm);
  color: var(--ed-gray-600);
  cursor: pointer;
  transition: all var(--proj-transition);
  flex-shrink: 0;
}

.projeto-coluna-add-btn:hover {
  background: var(--ed-primary);
  border-color: var(--ed-primary);
  color: var(--ed-white);
  transform: scale(1.1);
}

.projeto-card {
  background: var(--proj-surface);
  border: 1px solid var(--proj-border);
  border-radius: var(--proj-radius);
  padding: var(--proj-spacing);
  margin-bottom: var(--proj-spacing-sm);
  cursor: pointer;
  transition: all var(--proj-transition);
  box-shadow: var(--proj-shadow);
  position: relative;
}

.projeto-card:hover {
  box-shadow: var(--proj-shadow-hover);
  transform: translateY(-2px);
  border-color: var(--ed-primary-light);
}

.projeto-card:active {
  cursor: pointer;
}

.projeto-card.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

/* Farol (Projetos) */
.projeto-card--farol-vermelho {
  border-left: 4px solid var(--ed-danger);
}
.projeto-card--farol-amarelo {
  border-left: 4px solid var(--ed-warning);
}
.projeto-card--farol-verde {
  border-left: 4px solid var(--ed-success);
}
.projeto-card--farol-cinza {
  border-left: 4px solid var(--ed-gray-400);
}

.projeto-card-header {
  display: flex;
  flex-direction: column;
  gap: var(--proj-spacing-sm);
  margin-bottom: var(--proj-spacing-sm);
}

.projeto-card-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--proj-spacing-sm);
}

.projeto-card-codigo {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ed-primary-dark);
  display: inline-flex;
  align-items: center;
  gap: var(--proj-spacing-xs);
  flex: 1;
  min-width: 0;
}

.projeto-card-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--proj-radius-full);
  background: var(--ed-primary);
  color: var(--ed-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid var(--proj-surface);
  box-shadow: var(--proj-shadow-xs);
}

.projeto-card-prazo {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--proj-radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.projeto-card-prazo--atrasado {
  background: rgba(239, 68, 68, 0.1);
  color: var(--ed-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.projeto-card-prazo--hoje {
  background: rgba(245, 158, 11, 0.1);
  color: var(--ed-warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.projeto-card-prazo--amanha {
  background: rgba(245, 158, 11, 0.1);
  color: var(--ed-warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.projeto-card-prazo--7d {
  background: rgba(59, 130, 246, 0.1);
  color: var(--ed-info);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.projeto-card-prazo--ok {
  background: rgba(34, 197, 94, 0.1);
  color: var(--ed-success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.projeto-card-titulo {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ed-gray-900);
  line-height: 1.4;
  margin-bottom: var(--proj-spacing-sm);
  word-break: break-word;
}

.projeto-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--proj-spacing-xs);
  margin-bottom: var(--proj-spacing-sm);
}

.projeto-card-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  background: var(--ed-gray-100);
  border: 1px solid var(--proj-border);
  border-radius: var(--proj-radius-full);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--ed-gray-700);
}

.projeto-card-tag--extra {
  background: var(--ed-gray-200);
  color: var(--ed-gray-600);
}

.projeto-card-badges {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.projeto-farol-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.06);
}
.projeto-farol--verde {
  background: var(--ed-success);
}
.projeto-farol--amarelo {
  background: var(--ed-warning);
}
.projeto-farol--vermelho {
  background: var(--ed-danger);
}
.projeto-farol--cinza {
  background: var(--ed-gray-400);
}

/* Chips (tags) - escopado ao módulo de Projetos */
.proj-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.175rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(15, 23, 42, 0.05);
  color: var(--ed-gray-800);
  white-space: nowrap;
}
.proj-chip--muted {
  opacity: 0.75;
}

.projeto-card-titulo {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ed-gray-900);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.projeto-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--ed-gray-600);
}

.projeto-card-meta-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.projeto-card-meta-item i {
  font-size: 0.875rem;
  opacity: 0.7;
}

.projeto-card-progress {
  margin-top: var(--proj-spacing-sm);
}

.projeto-card-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
}

.projeto-card-progress-text {
  font-weight: 600;
  color: var(--ed-gray-700);
}

.projeto-card-progress-percent {
  font-weight: 700;
  color: var(--ed-primary);
}

.projeto-card-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--ed-gray-200);
  border-radius: var(--ed-radius-full);
  overflow: hidden;
}

.projeto-card-progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--ed-primary) 0%,
    var(--ed-primary-light) 100%
  );
  transition: width var(--ed-transition-base);
}

.projeto-coluna.drag-over {
  background: var(--ed-primary-soft);
  border-color: var(--ed-primary);
}

.projeto-coluna-body.drag-over {
  background: var(--ed-primary-soft);
}

/* Checklist no Modal */
.projeto-checklist-list {
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
  background: var(--ed-gray-50);
  padding: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
}

.projeto-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--ed-radius-sm);
  margin-bottom: 0.5rem;
  background: var(--ed-white);
  transition: background var(--ed-transition-fast);
}

.projeto-checklist-item-handle {
  background: transparent;
  border: none;
  color: var(--ed-gray-500);
  cursor: grab;
  padding: 0.2rem 0.25rem;
  border-radius: var(--ed-radius-sm);
  line-height: 1;
}

.projeto-checklist-item-handle:hover {
  background: var(--ed-gray-200);
}

.projeto-checklist-item.is-dragging {
  opacity: 0.6;
}

.projeto-checklist-item:hover {
  background: var(--ed-gray-100);
}

.projeto-checklist-item:last-child {
  margin-bottom: 0;
}

.projeto-checklist-item input[type="checkbox"] {
  margin-top: 0.25rem;
  cursor: pointer;
  flex-shrink: 0;
}

.projeto-checklist-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.projeto-checklist-item-text {
  border: none;
  background: transparent;
  font-size: 0.875rem;
  padding: 0.25rem 0;
  width: 100%;
}

.projeto-checklist-item-text:focus {
  outline: 2px solid var(--ed-primary);
  outline-offset: 2px;
  border-radius: var(--ed-radius-sm);
}

.projeto-checklist-item.done .projeto-checklist-item-text {
  text-decoration: line-through;
  color: var(--ed-gray-500);
}

.projeto-checklist-item-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--ed-gray-600);
}

.projeto-checklist-item-remove {
  background: transparent;
  border: none;
  color: var(--ed-danger);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--ed-radius-sm);
  transition: background var(--ed-transition-fast);
  flex-shrink: 0;
}

.projeto-checklist-item-remove:hover {
  background: var(--ed-gray-200);
}

/* Dependências no Modal */
.projeto-dependencias-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.projeto-dependencia-item {
  padding: 0.75rem;
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
  background: var(--ed-white);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.projeto-dependencia-info {
  flex: 1;
}

.projeto-dependencia-tipo {
  font-size: 0.75rem;
  color: var(--ed-gray-600);
  text-transform: uppercase;
}

.projeto-dependencia-remove {
  background: transparent;
  border: none;
  color: var(--ed-danger);
  cursor: pointer;
  padding: 0.25rem;
}

/* Histórico Timeline */
.projeto-historico-timeline {
  position: relative;
  padding-left: 2rem;
}

.projeto-historico-timeline::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--ed-border);
}

.projeto-historico-item {
  position: relative;
  padding-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.projeto-historico-item::before {
  content: "";
  position: absolute;
  left: -1.75rem;
  top: 0.25rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ed-primary);
  border: 2px solid var(--ed-white);
  box-shadow: 0 0 0 2px var(--ed-primary);
}

.projeto-historico-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.25rem;
}

.projeto-historico-item-tipo {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--ed-gray-900);
}

.projeto-historico-item-data {
  font-size: 0.75rem;
  color: var(--ed-gray-500);
}

.projeto-historico-item-usuario {
  font-size: 0.8125rem;
  color: var(--ed-gray-600);
  margin-bottom: 0.25rem;
}

.projeto-historico-item-detalhe {
  font-size: 0.8125rem;
  color: var(--ed-gray-700);
  background: var(--ed-gray-50);
  padding: 0.5rem;
  border-radius: var(--ed-radius-sm);
  margin-top: 0.5rem;
}

/* ========== CRONOGRAMA (TIMELINE/GANTT LITE) ========== */
.projetos-cronograma-container {
  background: var(--proj-surface);
  border: 1px solid var(--proj-border);
  border-radius: var(--proj-radius-md);
  padding: var(--proj-spacing-lg);
  box-shadow: var(--proj-shadow);
}

.projetos-cronograma-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--proj-spacing-md);
  margin-bottom: var(--proj-spacing-lg);
  flex-wrap: wrap;
}

.projetos-cronograma-zoom {
  display: flex;
  gap: var(--proj-spacing-xs);
}

.projetos-cronograma-zoom button.active {
  background: var(--ed-primary);
  border-color: var(--ed-primary);
  color: var(--ed-white);
}

.projetos-cronograma-navegacao {
  display: flex;
  gap: var(--proj-spacing-xs);
}

.projetos-cronograma-periodo {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ed-gray-700);
  flex: 1;
  text-align: center;
}

.projetos-cronograma-timeline-wrapper {
  overflow-x: auto;
  border: 1px solid var(--proj-border);
  border-radius: var(--proj-radius);
  background: var(--ed-white);
}

.projetos-cronograma-timeline-header {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--ed-gray-50);
  border-bottom: 2px solid var(--proj-border);
}

.projetos-cronograma-header-day {
  padding: var(--proj-spacing-sm);
  text-align: center;
  border-right: 1px solid var(--proj-border);
  min-width: 60px;
  flex-shrink: 0;
}

.projetos-cronograma-header-day--weekend {
  background: var(--ed-gray-100);
}

.projetos-cronograma-header-day--today {
  background: var(--ed-primary-soft);
  font-weight: 700;
}

.projetos-cronograma-header-day-number {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ed-gray-900);
}

.projetos-cronograma-header-day-name {
  font-size: 0.75rem;
  color: var(--ed-gray-600);
  text-transform: uppercase;
}

.projetos-cronograma-timeline-body {
  position: relative;
  min-height: 400px;
}

.projetos-cronograma-row {
  display: flex;
  border-bottom: 1px solid var(--proj-border);
  min-height: 3rem;
}

.projetos-cronograma-row:last-child {
  border-bottom: none;
}

.projetos-cronograma-row-label {
  width: 250px;
  flex-shrink: 0;
  padding: var(--proj-spacing);
  background: var(--ed-gray-50);
  border-right: 1px solid var(--proj-border);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ed-gray-900);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--proj-spacing-xs);
  transition: background var(--proj-transition);
}

.projetos-cronograma-row-label:hover {
  background: var(--ed-gray-100);
}

.projetos-cronograma-row-bar-container {
  flex: 1;
  position: relative;
  min-height: 3rem;
  padding: var(--proj-spacing-sm) 0;
}

.projetos-cronograma-bar {
  position: absolute;
  height: 1.5rem;
  border-radius: var(--proj-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0 var(--proj-spacing-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ed-white);
  box-shadow: var(--proj-shadow-sm);
  transition: all var(--proj-transition);
  overflow: hidden;
  white-space: nowrap;
}

.projetos-cronograma-bar:hover {
  transform: translateY(-2px);
  box-shadow: var(--proj-shadow-md);
  z-index: 5;
}

.projetos-cronograma-bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.projetos-cronograma-bar--verde {
  background: var(--ed-success) !important;
}

.projetos-cronograma-bar--amarelo {
  background: var(--ed-warning) !important;
}

.projetos-cronograma-bar--vermelho {
  background: var(--ed-danger) !important;
}

.projetos-cronograma-bar--cinza {
  background: var(--ed-gray-400) !important;
}

/* Melhorias no Calendário - Drag & Drop */
.projetos-cal-day--drag-over {
  background: var(--ed-primary-soft) !important;
  border: 2px dashed var(--ed-primary) !important;
  transform: scale(1.05);
}

.projetos-cal-day {
  transition: all var(--proj-transition);
}

.projetos-cal-item {
  cursor: pointer;
  transition: all var(--proj-transition);
}

.projetos-cal-item:hover {
  transform: translateX(4px);
}

/* Responsivo Kanban */
@media (max-width: 768px) {
  .projetos-kanban-container {
    grid-template-columns: 1fr;
  }

  .projeto-coluna {
    max-height: none;
  }

  .projetos-cronograma-row-label {
    width: 150px;
    font-size: 0.75rem;
  }

  .projetos-cronograma-header-day {
    min-width: 40px;
  }
}

/* ========== PROJETOS V2 - PREMIUM UI/UX ========== */

/* Tokens CSS específicos para Projetos V2 */
:root {
  --proj-surface: var(--ed-white);
  --proj-surface-hover: var(--ed-gray-50);
  --proj-border: var(--ed-gray-200);
  --proj-border-hover: var(--ed-primary-light);
  --proj-shadow: var(--ed-shadow-sm);
  --proj-shadow-hover: var(--ed-shadow-md);
  --proj-shadow-lg: var(--ed-shadow-lg);
  --proj-radius: var(--ed-radius);
  --proj-radius-sm: var(--ed-radius-sm);
  --proj-radius-md: var(--ed-radius-md);
  --proj-spacing-xs: 0.375rem;
  --proj-spacing-sm: 0.5rem;
  --proj-spacing: 0.75rem;
  --proj-spacing-md: 1rem;
  --proj-spacing-lg: 1.5rem;
  --proj-transition: var(--ed-transition-fast);
}

/* Command Bar Premium (Sticky) */
.proj-v2-command-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--proj-surface);
  border-bottom: 1px solid var(--proj-border);
  box-shadow: var(--proj-shadow);
  padding: var(--proj-spacing) var(--proj-spacing-lg);
  /* Evita “subir” por cima das abas: sem margem negativa no topo */
  margin: 0 0 var(--proj-spacing-lg) 0;
  border-radius: 18px;
}

.proj-v2-command-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--proj-spacing-md);
  flex-wrap: wrap;
}

.proj-v2-command-row-1 {
  margin-bottom: var(--proj-spacing);
  padding-bottom: var(--proj-spacing);
  border-bottom: 1px solid var(--proj-border);
}

.proj-v2-command-row-2 {
  padding-top: var(--proj-spacing);
}

.proj-v2-command-left,
.proj-v2-command-right {
  display: flex;
  align-items: center;
  gap: var(--proj-spacing);
  flex-wrap: wrap;
  flex: 1;
}

.proj-v2-command-right {
  justify-content: flex-end;
}

/* Título */
.proj-v2-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ed-gray-900);
  margin: 0;
  display: flex;
  align-items: center;
  letter-spacing: -0.02em;
}

.proj-v2-title i {
  color: var(--ed-primary);
}

/* Chips rápidos */
.proj-v2-chips {
  display: flex;
  align-items: center;
  gap: var(--proj-spacing-sm);
  flex-wrap: wrap;
}

.proj-v2-toggle-backlog-wrapper {
  display: flex;
  align-items: center;
  gap: var(--proj-spacing-sm);
  margin-left: var(--proj-spacing);
  padding-left: var(--proj-spacing);
  border-left: 1px solid var(--proj-border);
}

.proj-v2-toggle-switch {
  display: flex;
  align-items: center;
  gap: var(--proj-spacing-xs);
  cursor: pointer;
  user-select: none;
}

.proj-v2-toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.proj-v2-toggle-slider {
  position: relative;
  width: 2.5rem;
  height: 1.25rem;
  background: var(--ed-gray-300);
  border-radius: var(--proj-radius-full);
  transition: all var(--proj-transition);
}

.proj-v2-toggle-slider::before {
  content: "";
  position: absolute;
  width: 1rem;
  height: 1rem;
  left: 0.125rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--ed-white);
  border-radius: var(--proj-radius-full);
  transition: all var(--proj-transition);
  box-shadow: var(--proj-shadow-xs);
}

.proj-v2-toggle-switch input:checked + .proj-v2-toggle-slider {
  background: var(--ed-primary);
}

.proj-v2-toggle-switch input:checked + .proj-v2-toggle-slider::before {
  transform: translate(1.25rem, -50%);
}

.proj-v2-toggle-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ed-gray-700);
}

.proj-v2-toggle-switch:hover .proj-v2-toggle-label {
  color: var(--ed-gray-900);
}

.proj-v2-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--proj-spacing-xs);
  padding: 0.375rem 0.75rem;
  background: var(--ed-gray-100);
  border: 1px solid var(--proj-border);
  border-radius: var(--proj-radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ed-gray-700);
  cursor: pointer;
  transition: all var(--proj-transition);
  white-space: nowrap;
}

.proj-v2-chip:hover {
  background: var(--ed-gray-200);
  border-color: var(--ed-gray-300);
  transform: translateY(-1px);
}

.proj-v2-chip.active {
  background: var(--ed-primary);
  border-color: var(--ed-primary);
  color: var(--ed-white);
}

.proj-v2-chip i {
  font-size: 0.75rem;
}

.proj-v2-chip-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.125rem 0.375rem;
  border-radius: var(--proj-radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.25rem;
}

.proj-v2-chip.active .proj-v2-chip-count {
  background: rgba(255, 255, 255, 0.3);
}

/* Botões */
.proj-v2-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--proj-spacing-xs);
  padding: 0.5rem 1rem;
  background: var(--ed-primary);
  color: var(--ed-white);
  border: none;
  border-radius: var(--proj-radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--proj-transition);
  box-shadow: var(--proj-shadow);
}

.proj-v2-btn-primary:hover {
  background: var(--ed-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--proj-shadow-hover);
}

.proj-v2-btn-primary:active {
  transform: translateY(0);
}

.proj-v2-btn-insights {
  display: inline-flex;
  align-items: center;
  gap: var(--proj-spacing-xs);
  padding: 0.5rem 1rem;
  background: var(--ed-gray-100);
  color: var(--ed-gray-700);
  border: 1px solid var(--proj-border);
  border-radius: var(--proj-radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--proj-transition);
}

.proj-v2-btn-insights:hover {
  background: var(--ed-gray-200);
  border-color: var(--ed-gray-300);
  color: var(--ed-gray-900);
}

.proj-v2-btn-insights.active {
  background: var(--ed-primary);
  border-color: var(--ed-primary);
  color: var(--ed-white);
}

.proj-v2-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: transparent;
  border: 1px solid var(--proj-border);
  border-radius: var(--proj-radius-sm);
  color: var(--ed-gray-600);
  cursor: pointer;
  transition: all var(--proj-transition);
}

.proj-v2-btn-icon:hover {
  background: var(--ed-gray-100);
  border-color: var(--ed-gray-300);
  color: var(--ed-gray-900);
}

.proj-v2-btn-more-filters {
  display: inline-flex;
  align-items: center;
  gap: var(--proj-spacing-xs);
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: 1px solid var(--proj-border);
  border-radius: var(--proj-radius);
  font-size: 0.8125rem;
  color: var(--ed-gray-600);
  cursor: pointer;
  transition: all var(--proj-transition);
}

.proj-v2-btn-more-filters:hover {
  background: var(--ed-gray-100);
  border-color: var(--ed-gray-300);
  color: var(--ed-gray-900);
}

/* Busca */
.proj-v2-search-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

.proj-v2-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ed-gray-400);
  font-size: 0.875rem;
  pointer-events: none;
}

.proj-v2-search {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  background: var(--ed-gray-50);
  border: 1px solid var(--proj-border);
  border-radius: var(--proj-radius);
  font-size: 0.875rem;
  color: var(--ed-gray-900);
  transition: all var(--proj-transition);
}

.proj-v2-search:focus {
  outline: none;
  background: var(--ed-white);
  border-color: var(--ed-primary);
  box-shadow: 0 0 0 3px var(--ed-primary-glow);
}

.proj-v2-search::placeholder {
  color: var(--ed-gray-400);
}

/* Filtros */
.proj-v2-filters {
  display: flex;
  align-items: center;
  gap: var(--proj-spacing-sm);
  flex-wrap: wrap;
}

.proj-v2-filter-select,
.proj-v2-filter-input {
  padding: 0.5rem 0.75rem;
  background: var(--ed-gray-50);
  border: 1px solid var(--proj-border);
  border-radius: var(--proj-radius);
  font-size: 0.875rem;
  color: var(--ed-gray-900);
  transition: all var(--proj-transition);
  min-width: 140px;
}

.proj-v2-filter-input {
  min-width: 120px;
}

.proj-v2-filter-select:focus,
.proj-v2-filter-input:focus {
  outline: none;
  background: var(--ed-white);
  border-color: var(--ed-primary);
  box-shadow: 0 0 0 3px var(--ed-primary-glow);
}

.proj-v2-more-filters-content {
  display: flex;
  align-items: center;
  gap: var(--proj-spacing-md);
  padding-top: var(--proj-spacing);
  margin-top: var(--proj-spacing);
  border-top: 1px solid var(--proj-border);
  flex-wrap: wrap;
}

.proj-v2-checkbox-group {
  display: flex;
  align-items: center;
  gap: var(--proj-spacing-xs);
}

.proj-v2-checkbox {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  accent-color: var(--ed-primary);
}

.proj-v2-checkbox-label {
  font-size: 0.8125rem;
  color: var(--ed-gray-700);
  cursor: pointer;
  user-select: none;
  margin: 0;
}

/* View Switcher (Segmented Control Premium) */
.proj-v2-view-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--ed-gray-100);
  border: 1px solid var(--proj-border);
  border-radius: var(--proj-radius);
  padding: 0.25rem;
  gap: 0.25rem;
}

.proj-v2-view-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--proj-spacing-xs);
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: calc(var(--proj-radius) - 2px);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ed-gray-600);
  cursor: pointer;
  transition: all var(--proj-transition);
  white-space: nowrap;
}

.proj-v2-view-btn:hover {
  background: var(--ed-gray-200);
  color: var(--ed-gray-900);
}

.proj-v2-view-btn.active {
  background: var(--ed-white);
  color: var(--ed-primary);
  box-shadow: var(--proj-shadow);
  font-weight: 600;
}

.proj-v2-view-btn i {
  font-size: 0.875rem;
}

/* Drawer (Offcanvas) - Painel Executivo */
.proj-v2-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 600px;
  height: 100vh;
  z-index: 1050;
  pointer-events: none;
  transition: all var(--ed-transition-base);
}

.proj-v2-drawer.show {
  pointer-events: auto;
}

.proj-v2-drawer-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.5);
  opacity: 0;
  transition: opacity var(--ed-transition-base);
  backdrop-filter: blur(4px);
}

.proj-v2-drawer.show .proj-v2-drawer-backdrop {
  opacity: 1;
}

.proj-v2-drawer-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: var(--proj-surface);
  box-shadow: var(--proj-shadow-lg);
  transform: translateX(100%);
  transition: transform var(--ed-transition-base);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.proj-v2-drawer.show .proj-v2-drawer-content {
  transform: translateX(0);
}

.proj-v2-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--proj-spacing-lg);
  border-bottom: 1px solid var(--proj-border);
  flex-shrink: 0;
}

.proj-v2-drawer-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ed-gray-900);
  margin: 0;
  display: flex;
  align-items: center;
}

.proj-v2-drawer-title i {
  color: var(--ed-primary);
}

.proj-v2-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--proj-radius-sm);
  color: var(--ed-gray-600);
  cursor: pointer;
  transition: all var(--proj-transition);
}

.proj-v2-drawer-close:hover {
  background: var(--ed-gray-100);
  color: var(--ed-gray-900);
}

.proj-v2-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--proj-spacing-lg);
}

/* Insights Cards */
.proj-v2-insights-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--proj-spacing-md);
  margin-bottom: var(--proj-spacing-lg);
}

.proj-v2-insight-card {
  background: var(--proj-surface);
  border: 1px solid var(--proj-border);
  border-radius: var(--proj-radius-md);
  padding: var(--proj-spacing-md);
  text-align: center;
  transition: all var(--proj-transition);
}

.proj-v2-insight-card:hover {
  box-shadow: var(--proj-shadow-hover);
  transform: translateY(-2px);
}

.proj-v2-insight-card-primary {
  border-color: var(--ed-primary);
  background: linear-gradient(
    135deg,
    var(--ed-primary-soft) 0%,
    var(--ed-white) 100%
  );
}

.proj-v2-insight-card-success {
  border-color: var(--ed-success);
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.1) 0%,
    var(--ed-white) 100%
  );
}

.proj-v2-insight-card-danger {
  border-color: var(--ed-danger);
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.1) 0%,
    var(--ed-white) 100%
  );
}

.proj-v2-insight-card-warning {
  border-color: var(--ed-warning);
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.1) 0%,
    var(--ed-white) 100%
  );
}

.proj-v2-insight-icon {
  font-size: 1.5rem;
  margin-bottom: var(--proj-spacing-sm);
}

.proj-v2-insight-card-primary .proj-v2-insight-icon {
  color: var(--ed-primary);
}

.proj-v2-insight-card-success .proj-v2-insight-icon {
  color: var(--ed-success);
}

.proj-v2-insight-card-danger .proj-v2-insight-icon {
  color: var(--ed-danger);
}

.proj-v2-insight-card-warning .proj-v2-insight-icon {
  color: var(--ed-warning);
}

.proj-v2-insight-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ed-gray-900);
  margin-bottom: var(--proj-spacing-xs);
  line-height: 1.2;
}

.proj-v2-insight-label {
  font-size: 0.8125rem;
  color: var(--ed-gray-600);
  font-weight: 500;
}

/* Charts */
.proj-v2-insights-charts {
  display: flex;
  flex-direction: column;
  gap: var(--proj-spacing-lg);
}

.proj-v2-chart-card {
  background: var(--proj-surface);
  border: 1px solid var(--proj-border);
  border-radius: var(--proj-radius-md);
  padding: var(--proj-spacing-md);
  box-shadow: var(--proj-shadow);
}

.proj-v2-chart-card-full {
  width: 100%;
}

.proj-v2-chart-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ed-gray-900);
  margin: 0 0 var(--proj-spacing-md);
}

.proj-v2-chart-card canvas {
  max-height: 300px;
}

/* Table Wrapper (V2) */
.proj-v2-table-wrapper {
  background: var(--proj-surface);
  border: 1px solid var(--proj-border);
  border-radius: var(--proj-radius-md);
  padding: var(--proj-spacing-md);
  box-shadow: var(--proj-shadow);
}

/* ========== DRAWER: DETALHE DO PROJETO (TRELLO-LIKE) ========== */
.projeto-drawer {
  width: 720px !important;
  max-width: 90vw;
}

.projeto-drawer-header {
  border-bottom: 1px solid var(--proj-border);
  padding: var(--proj-spacing-md) var(--proj-spacing-lg);
  background: var(--proj-surface);
}

.projeto-drawer-header-left {
  flex: 1;
  min-width: 0;
}

.projeto-drawer-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ed-gray-900);
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--proj-spacing-xs);
}

.projeto-drawer-codigo {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ed-primary);
}

.projeto-drawer-titulo {
  font-size: 1.125rem;
  color: var(--ed-gray-900);
  word-break: break-word;
}

.projeto-drawer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--proj-spacing-xs);
  margin-top: var(--proj-spacing-sm);
}

.projeto-drawer-header-right {
  display: flex;
  align-items: center;
  gap: var(--proj-spacing-sm);
}

.projeto-drawer-body {
  padding: 0;
  overflow-y: auto;
  background: var(--ed-gray-50);
}

.projeto-drawer-content {
  display: flex;
  gap: 0;
  min-height: 100%;
}

.projeto-drawer-main {
  flex: 1;
  padding: var(--proj-spacing-lg);
  background: var(--proj-surface);
  min-width: 0;
}

.projeto-drawer-sidebar {
  width: 280px;
  flex-shrink: 0;
  padding: var(--proj-spacing-lg);
  background: var(--ed-gray-50);
  border-left: 1px solid var(--proj-border);
}

.projeto-drawer-section {
  margin-bottom: var(--proj-spacing-lg);
  padding-bottom: var(--proj-spacing-lg);
  border-bottom: 1px solid var(--proj-border);
}

.projeto-drawer-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.projeto-drawer-section-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ed-gray-900);
  margin-bottom: var(--proj-spacing);
  display: flex;
  align-items: center;
}

.projeto-drawer-descricao {
  color: var(--ed-gray-700);
  line-height: 1.6;
  white-space: pre-wrap;
}

.projeto-drawer-checklist-list {
  display: flex;
  flex-direction: column;
  gap: var(--proj-spacing-sm);
}

.projeto-drawer-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: var(--proj-spacing-sm);
  padding: var(--proj-spacing-sm);
  background: var(--ed-gray-50);
  border-radius: var(--proj-radius-sm);
  transition: all var(--proj-transition);
}

.projeto-drawer-checklist-item:hover {
  background: var(--ed-gray-100);
}

.projeto-drawer-checklist-item input[type="checkbox"] {
  margin-top: 0.25rem;
  flex-shrink: 0;
  cursor: pointer;
}

.projeto-drawer-checklist-label {
  flex: 1;
  font-size: 0.875rem;
  color: var(--ed-gray-900);
  cursor: pointer;
  user-select: none;
}

.projeto-drawer-dependencias-list {
  display: flex;
  flex-direction: column;
  gap: var(--proj-spacing-sm);
}

.projeto-drawer-dependencia-item {
  display: flex;
  align-items: center;
  padding: var(--proj-spacing-sm);
  background: var(--ed-gray-50);
  border-radius: var(--proj-radius-sm);
  transition: all var(--proj-transition);
}

.projeto-drawer-dependencia-item:hover {
  background: var(--ed-gray-100);
}

.projeto-drawer-dependencia-item a {
  color: var(--ed-primary);
  text-decoration: none;
  font-weight: 500;
}

.projeto-drawer-dependencia-item a:hover {
  text-decoration: underline;
}

.projeto-drawer-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--proj-spacing-md);
}

.projeto-drawer-timeline-item {
  display: flex;
  gap: var(--proj-spacing);
  position: relative;
  padding-left: var(--proj-spacing-md);
}

.projeto-drawer-timeline-item::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  bottom: -1rem;
  width: 2px;
  background: var(--proj-border);
}

.projeto-drawer-timeline-item:last-child::before {
  display: none;
}

.projeto-drawer-timeline-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: var(--proj-radius-full);
  background: var(--ed-primary);
  border: 2px solid var(--proj-surface);
  flex-shrink: 0;
  margin-top: 0.25rem;
  position: absolute;
  left: 0.25rem;
}

.projeto-drawer-timeline-content {
  flex: 1;
  padding: var(--proj-spacing-sm);
  background: var(--ed-gray-50);
  border-radius: var(--proj-radius-sm);
}

.projeto-drawer-timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--proj-spacing-xs);
}

.projeto-drawer-timeline-body {
  font-size: 0.875rem;
  color: var(--ed-gray-700);
}

.projeto-drawer-lastro {
  background: var(--ed-gray-50);
  padding: var(--proj-spacing);
  border-radius: var(--proj-radius);
  margin-top: var(--proj-spacing-lg);
}

.projeto-drawer-lastro-content {
  display: flex;
  flex-direction: column;
  gap: var(--proj-spacing);
}

.projeto-drawer-lastro-item {
  padding: var(--proj-spacing-sm);
  background: var(--proj-surface);
  border-radius: var(--proj-radius-sm);
}

.projeto-drawer-sidebar-section {
  margin-bottom: var(--proj-spacing-lg);
  padding-bottom: var(--proj-spacing-lg);
  border-bottom: 1px solid var(--proj-border);
}

.projeto-drawer-sidebar-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.projeto-drawer-sidebar-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ed-gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--proj-spacing-sm);
  display: block;
}

.projeto-drawer-sidebar-value {
  font-size: 0.875rem;
  color: var(--ed-gray-900);
}

.projeto-drawer-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: var(--proj-radius-full);
  background: var(--ed-primary);
  color: var(--ed-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.projeto-drawer-sidebar-dates {
  display: flex;
  flex-direction: column;
  gap: var(--proj-spacing-sm);
}

.projeto-drawer-sidebar-date-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--proj-spacing-xs) 0;
}

.projeto-drawer-sidebar-date-label {
  font-size: 0.8125rem;
  color: var(--ed-gray-600);
}

.projeto-drawer-sidebar-date-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ed-gray-900);
}

.projeto-drawer-sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--proj-spacing-xs);
}

.projeto-drawer-sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: var(--proj-spacing-sm);
}

/* 5W2H Accordion no Drawer */
.projeto-drawer-5w2h-content {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--proj-spacing-md);
}

.projeto-drawer-5w2h-item {
  grid-column: span 2;
}

.projeto-drawer-5w2h-item.half {
  grid-column: span 1;
}

.projeto-drawer-5w2h-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ed-gray-600);
  text-transform: uppercase;
  margin-bottom: var(--proj-spacing-xs);
}

.projeto-drawer-5w2h-value {
  font-size: 0.875rem;
  color: var(--ed-gray-900);
  padding: var(--proj-spacing-sm);
  background: var(--ed-gray-50);
  border-radius: var(--proj-radius-sm);
  min-height: 2rem;
}

/* Responsivo Drawer */
@media (max-width: 768px) {
  .projeto-drawer {
    width: 100% !important;
    max-width: 100vw;
  }

  .projeto-drawer-content {
    flex-direction: column;
  }

  .projeto-drawer-sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--proj-border);
  }

  .projeto-drawer-5w2h-content {
    grid-template-columns: 1fr;
  }
}

/* ========== DRAWER V2: TRELLO++ PREMIUM ========== */
.projeto-drawer-v2 {
  width: 900px !important;
  max-width: 95vw;
}

/* Skeleton Loading */
.projeto-drawer-skeleton {
  padding: 1.5rem;
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-line {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Header Premium */
.projeto-drawer-header-v2 {
  border-bottom: 2px solid #e5e7eb;
  padding: 1.25rem 1.5rem;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.projeto-drawer-header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
}

.projeto-drawer-header-left {
  flex: 1;
  min-width: 0;
}

.projeto-drawer-title-wrapper {
  margin-bottom: 0.75rem;
}

.projeto-drawer-codigo-v2 {
  font-size: 0.75rem;
  font-weight: 700;
  color: #14b8a6;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.projeto-drawer-titulo-v2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  line-height: 1.4;
  word-break: break-word;
}

.projeto-drawer-badges-v2 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.projeto-drawer-badges-v2 .badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.projeto-drawer-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.projeto-drawer-actions-v2 {
  display: flex;
  gap: 0.375rem;
}

.projeto-drawer-action-btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.projeto-drawer-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Body */
.projeto-drawer-body-v2 {
  padding: 0;
  overflow-y: auto;
  background: #f3f4f6;
}

.projeto-drawer-content-v2 {
  display: flex;
  gap: 0;
  min-height: 100%;
}

/* Coluna Esquerda */
.projeto-drawer-main-v2 {
  flex: 1;
  padding: 1.5rem;
  background: transparent;
  min-width: 0;
  max-width: calc(100% - 320px);
}

.projeto-drawer-section-v2 {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.06);
}

.projeto-drawer-section-v2:last-child {
  margin-bottom: 0;
}

.projeto-drawer-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.projeto-drawer-section-title-v2 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  display: flex;
  align-items: center;
  letter-spacing: -0.01em;
}

.projeto-drawer-descricao-v2 {
  color: #374151;
  line-height: 1.7;
  font-size: 0.9375rem;
  white-space: pre-wrap;
}

.projeto-drawer-empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: #9ca3af;
}

.projeto-drawer-empty-state i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
  opacity: 0.5;
}

.projeto-drawer-empty-state p {
  font-size: 0.875rem;
}

/* Accordion Premium */
.projeto-drawer-accordion-v2 .accordion-item {
  background: transparent;
  border: none;
}

.projeto-drawer-accordion-btn {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: #111827;
  transition: all 0.2s ease;
}

.projeto-drawer-accordion-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.projeto-drawer-accordion-header-row .accordion-button {
  width: auto;
  flex: 1;
}

.projeto-drawer-accordion-expand-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-weight: 800;
}

.projeto-drawer-accordion-expand-btn i {
  font-size: 0.95rem;
}

/* Fullscreen 5W2H (Drawer) */
#modal-projeto-5w2h-full .modal-body {
  background: #f8fafc;
}

#modal-projeto-5w2h-full .proj-matriz-5w2h {
  width: 100%;
  table-layout: fixed;
  background: #ffffff;
}

#modal-projeto-5w2h-full .proj-matriz-5w2h td,
#modal-projeto-5w2h-full .proj-matriz-5w2h th {
  vertical-align: top;
}

#modal-projeto-5w2h-full .proj-matriz-5w2h thead th {
  white-space: normal;
  line-height: 1.2;
}

#modal-projeto-5w2h-full .proj-matriz-5w2h td {
  word-break: break-word;
}

#modal-projeto-5w2h-full .projeto-5w2h-view-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

#modal-projeto-5w2h-full .projeto-5w2h-view-meta .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1;
}

#modal-projeto-5w2h-full .projeto-5w2h-view-meta .badge i {
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  top: 0.5px;
}

/* Zebra + foco visual na tabela do 5W2H expandido */
#modal-projeto-5w2h-full .proj-matriz-5w2h tbody tr:nth-child(odd) {
  background: #f8fafc;
}

#modal-projeto-5w2h-full .proj-matriz-5w2h tbody tr td:first-child {
  border-left: 4px solid rgba(15, 118, 110, 0.22);
}

#modal-projeto-5w2h-full
  .proj-matriz-5w2h
  tbody
  tr:nth-child(even)
  td:first-child {
  border-left-color: rgba(14, 165, 233, 0.22);
}

#modal-projeto-5w2h-full .proj-matriz-5w2h tbody tr:hover {
  background: #eef2ff;
}

#modal-projeto-5w2h-anexos .list-group-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#modal-projeto-5w2h-anexos .projeto-5w2h-anexo-preview {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--ed-border);
  background: var(--ed-gray-50);
}

#modal-projeto-5w2h-anexos .projeto-5w2h-anexo-meta {
  flex: 1;
  min-width: 0;
}

/* PROJETOS • 5W2H MULTI-ETAPAS (Drawer em cards) */
.projeto-5w2h-steps-wrap {
  padding: 0.75rem 0.75rem 0;
}

.projeto-5w2h-step-card {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.06);
  padding: 0.9rem 0.95rem;
  margin: 0.75rem 0.75rem 0;
}

/* Zebra/destaque por etapa (aproveita que o footer agora é <p>, não conta no nth-of-type) */
.projeto-5w2h-steps-wrap > .projeto-5w2h-step-card:nth-of-type(odd) {
  border-left: 4px solid rgba(15, 118, 110, 0.25);
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.03) 0%,
    rgba(255, 255, 255, 0.98) 60%
  );
}

.projeto-5w2h-steps-wrap > .projeto-5w2h-step-card:nth-of-type(even) {
  border-left: 4px solid rgba(14, 165, 233, 0.22);
  background: linear-gradient(
    135deg,
    rgba(14, 165, 233, 0.03) 0%,
    rgba(255, 255, 255, 0.98) 60%
  );
}

.projeto-5w2h-step-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #0f172a;
}

.projeto-5w2h-step-title-meta {
  font-weight: 700;
  font-size: 0.8rem;
  color: #64748b;
  white-space: nowrap;
}

.projeto-5w2h-step-grid {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.projeto-5w2h-step-field-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.projeto-5w2h-step-field-label i {
  font-size: 0.95rem;
  color: rgba(15, 118, 110, 0.85);
}

.projeto-5w2h-step-field-value {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 0.6rem 0.65rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #0f172a;
  word-break: break-word;
}

@media (max-width: 768px) {
  .projeto-5w2h-step-grid {
    grid-template-columns: 1fr;
  }
  .projeto-5w2h-step-title-meta {
    white-space: normal;
  }
}

.projeto-drawer-accordion-btn:not(.collapsed) {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.projeto-drawer-accordion-btn:hover {
  background: #f3f4f6;
}

.projeto-drawer-5w2h-content {
  padding: 1rem 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.projeto-drawer-5w2h-item {
  grid-column: span 2;
}

.projeto-drawer-5w2h-item.half {
  grid-column: span 1;
}

.projeto-drawer-5w2h-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.projeto-drawer-5w2h-value {
  font-size: 0.875rem;
  color: #111827;
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 6px;
  min-height: 2.5rem;
  line-height: 1.5;
}

/* Dependências */
.projeto-drawer-dependencias-list-v2 {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.projeto-drawer-dependencia-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 8px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.projeto-drawer-dependencia-item:hover {
  background: #f3f4f6;
  border-color: #e5e7eb;
  transform: translateX(2px);
}

.projeto-drawer-dependencia-item a {
  color: #14b8a6;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
}

.projeto-drawer-dependencia-item a:hover {
  text-decoration: underline;
}

/* Cronograma */
.projeto-drawer-cronograma-v2 {
  padding: 0.75rem 0;
}

.projeto-drawer-cronograma-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.projeto-drawer-cronograma-month {
  font-size: 0.875rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.01em;
}

.projeto-drawer-cronograma-period {
  font-size: 0.75rem;
  color: #6b7280;
  white-space: nowrap;
}

.projeto-drawer-cronograma-mini {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.2rem;
  margin-bottom: 0.85rem;
}

.projeto-drawer-cronograma-day {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  font-size: 0.72rem;
  border-radius: 6px;
  background: #fbfdff;
  color: #6b7280;
  font-weight: 500;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.projeto-drawer-cronograma-day.today {
  background: #14b8a6;
  color: white;
  font-weight: 700;
  border-color: rgba(59, 130, 246, 0.45);
}

.projeto-drawer-cronograma-day.in-range {
  background: #ccfbf1;
  color: #115e59;
  border-color: rgba(30, 64, 175, 0.14);
}

.projeto-drawer-cronograma-gantt {
  height: 32px;
  background: #f9fafb;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  margin-top: 0.5rem;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.projeto-drawer-cronograma-bar {
  position: absolute;
  height: 100%;
  background: linear-gradient(90deg, #14b8a6, #2dd4bf);
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* Coluna Direita (Sidebar) */
.projeto-drawer-sidebar-v2 {
  width: 320px;
  flex-shrink: 0;
  background: #f9fafb;
  border-left: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
}

.projeto-drawer-sidebar-info {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  overflow-y: auto;
  flex-shrink: 0;
}

.projeto-drawer-sidebar-section-v2 {
  margin-bottom: 1.5rem;
}

.projeto-drawer-sidebar-section-v2:last-child {
  margin-bottom: 0;
}

.projeto-drawer-sidebar-label-v2 {
  font-size: 0.75rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.projeto-drawer-sidebar-value-v2 {
  font-size: 0.875rem;
  color: #111827;
  font-weight: 500;
}

.projeto-drawer-sidebar-dates-v2 {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.projeto-drawer-sidebar-date-item-v2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.projeto-drawer-sidebar-date-label-v2 {
  font-size: 0.8125rem;
  color: #6b7280;
  font-weight: 500;
}

.projeto-drawer-sidebar-date-value-v2 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
}

.projeto-drawer-sidebar-tags-v2 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.projeto-drawer-sidebar-tags-v2 .badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
  border-radius: 12px;
  background: #e5e7eb;
  color: #374151;
  font-weight: 500;
}

/* Tabs Premium */
.projeto-drawer-sidebar-tabs {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.projeto-drawer-tabs-v2 {
  border-bottom: 1px solid #e5e7eb;
  padding: 0 1.5rem;
  margin: 0;
  background: #ffffff;
}

.projeto-drawer-tabs-v2 .nav-link {
  border: none;
  border-bottom: 2px solid transparent;
  color: #6b7280;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  transition: all 0.2s ease;
}

.projeto-drawer-tabs-v2 .nav-link:hover {
  color: #14b8a6;
  border-bottom-color: #ccfbf1;
}

.projeto-drawer-tabs-v2 .nav-link.active {
  color: #14b8a6;
  border-bottom-color: #14b8a6;
  background: transparent;
}

.projeto-drawer-tab-content-v2 {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* Checklist Premium */
.projeto-drawer-checklist-wrapper-v2 {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.projeto-drawer-checklist-header-v2 {
  margin-bottom: 0.5rem;
}

.projeto-drawer-checklist-progress {
  position: relative;
  height: 16px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.projeto-drawer-checklist-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 999px;
  transition: width 0.3s ease;
  position: relative;
}

.projeto-drawer-checklist-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  color: #111827;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65),
    0 1px 2px rgba(0, 0, 0, 0.18);
  z-index: 1;
}

.projeto-drawer-checklist-list-v2 {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 100px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.5rem 0;
}

@media (max-width: 768px) {
  .projeto-drawer-checklist-list-v2 {
    max-height: none;
    overflow-y: visible;
  }
}

.projeto-drawer-checklist-item-v2 {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.projeto-drawer-checklist-item-v2:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.projeto-drawer-checklist-item-v2 input[type="checkbox"] {
  margin-top: 0.125rem;
  flex-shrink: 0;
  cursor: pointer;
  width: 1.125rem;
  height: 1.125rem;
}

.projeto-drawer-checklist-item-content {
  flex: 1;
  min-width: 0;
}

.projeto-drawer-checklist-item-text {
  font-size: 0.875rem;
  color: #111827;
  font-weight: 500;
  line-height: 1.5;
  word-break: break-word;
}

.projeto-drawer-checklist-item-text.done {
  text-decoration: line-through;
  color: #9ca3af;
}

.projeto-drawer-checklist-item-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.projeto-drawer-checklist-item-responsavel {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.projeto-drawer-checklist-item-data {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.projeto-drawer-checklist-item-data.vencido {
  color: #ef4444;
  font-weight: 600;
}

.projeto-drawer-checklist-item-data.proximo {
  color: #f59e0b;
  font-weight: 600;
}

.projeto-drawer-checklist-item-remove {
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  opacity: 0;
}

.projeto-drawer-checklist-item-v2:hover .projeto-drawer-checklist-item-remove {
  opacity: 1;
}

.projeto-drawer-checklist-item-remove:hover {
  background: #fee2e2;
  color: #ef4444;
}

.projeto-drawer-checklist-add-v2 {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.projeto-drawer-checklist-add-v2:focus-within {
  background: #ffffff;
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.projeto-drawer-checklist-add-v2 input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  padding: 0;
}

.projeto-drawer-checklist-add-v2 input:focus {
  outline: none;
}

.projeto-drawer-checklist-add-v2 button {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.projeto-drawer-checklist-vencimentos-v2 {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.projeto-drawer-checklist-vencimentos-v2 .small {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
}

.projeto-drawer-checklist-vencimento-item {
  padding: 0.5rem;
  background: #fef3c7;
  border-radius: 6px;
  font-size: 0.75rem;
  margin-bottom: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.projeto-drawer-checklist-vencimento-item.vencido {
  background: #fee2e2;
}

/* ========== PROJETOS • EVENTOS (HISTÓRICO) ========== */
.proj-event-card {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  background: linear-gradient(
    180deg,
    rgba(248, 250, 252, 0.85) 0%,
    rgba(255, 255, 255, 0.98) 100%
  );
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.06);
  margin-bottom: 1rem;
  overflow: hidden;
}

.proj-event-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.1) 0%,
    rgba(255, 255, 255, 0.92) 70%
  );
}

.proj-event-card-title {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 900;
  color: #111827;
  letter-spacing: -0.01em;
}

.proj-event-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 118, 110, 0.14);
  border: 1px solid rgba(15, 118, 110, 0.22);
  color: #1d4ed8;
  flex: 0 0 auto;
}

.proj-event-card-body {
  padding: 0.9rem 0.95rem;
}

.proj-event-card textarea.form-control {
  min-height: 72px;
  resize: vertical;
}

.proj-event-card textarea.form-control:focus,
.proj-event-card select.form-select:focus {
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 0 0 0.25rem rgba(15, 118, 110, 0.14);
}

.proj-event-btn {
  border-radius: 999px;
  font-weight: 900;
  padding: 0.55rem 1rem;
  min-width: 170px;
}

.proj-event-btn.is-loading {
  pointer-events: none;
  opacity: 0.9;
}

.proj-event-btn.is-loading .proj-event-btn-label {
  display: none;
}

.proj-event-btn:not(.is-loading) .proj-event-btn-loading {
  display: none;
}

@media (max-width: 576px) {
  .proj-event-btn {
    width: 100%;
  }
}

/* Timeline Premium */
.projeto-drawer-timeline-v2 {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 500px;
  overflow-y: auto;
}

.proj-timeline-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.proj-timeline-group-label {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  padding-left: 1.5rem; /* alinha com o conteúdo dos itens */
}

.proj-timeline-group-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Timeline no Modal (Histórico): usa o mesmo visual do drawer, mas sem scroll interno */
#modal-projeto .projeto-historico-timeline-v2 {
  max-height: none;
  overflow-y: visible;
}

.projeto-drawer-timeline-item-v2 {
  display: flex;
  gap: 0.75rem;
  position: relative;
  padding-left: 1.5rem;
}

.projeto-drawer-timeline-item-v2::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 1.25rem;
  bottom: -1rem;
  width: 2px;
  background: #e5e7eb;
}

.projeto-drawer-timeline-item-v2:last-child::before {
  display: none;
}

.projeto-drawer-timeline-dot-v2 {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: #14b8a6;
  border: 2px solid #ffffff;
  flex-shrink: 0;
  margin-top: 0.25rem;
  position: absolute;
  left: 0.25rem;
  z-index: 1;
}

.projeto-drawer-timeline-content-v2 {
  flex: 1;
  padding: 0.75rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.projeto-drawer-timeline-content-v2:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.projeto-drawer-timeline-header-v2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.375rem;
}

.projeto-drawer-timeline-header-v2 strong {
  font-size: 0.875rem;
  color: #111827;
  font-weight: 600;
}

.projeto-drawer-timeline-header-v2 .text-muted {
  font-size: 0.75rem;
  color: #6b7280;
}

.projeto-drawer-timeline-body-v2 {
  font-size: 0.8125rem;
  color: #374151;
  line-height: 1.5;
}

/* Lastro/Governança */
.projeto-drawer-lastro-v2 {
  background: #f9fafb;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
}

.projeto-drawer-lastro-content-v2 {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.projeto-drawer-lastro-item-v2 {
  padding: 0.75rem;
  background: #ffffff;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.projeto-drawer-lastro-item-v2 .small {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.projeto-drawer-lastro-item-v2 .fw-semibold {
  font-size: 0.875rem;
  color: #111827;
  font-weight: 600;
}

/* Avatar */
.projeto-drawer-avatar-v2 {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #14b8a6, #8b5cf6);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsivo */
@media (max-width: 768px) {
  .projeto-drawer-v2 {
    width: 100% !important;
    max-width: 100vw;
  }

  .projeto-drawer-content-v2 {
    flex-direction: column;
  }

  .projeto-drawer-main-v2 {
    max-width: 100%;
  }

  .projeto-drawer-sidebar-v2 {
    width: 100%;
    border-left: none;
    border-top: 1px solid #e5e7eb;
    max-height: 50vh;
  }

  .projeto-drawer-5w2h-content {
    grid-template-columns: 1fr;
  }
}

/* Responsivo */
@media (max-width: 992px) {
  .proj-v2-command-bar {
    padding: var(--proj-spacing);
    margin: 0 0 var(--proj-spacing) 0;
    border-radius: 16px;
  }

  .proj-v2-command-row {
    flex-direction: column;
    align-items: stretch;
  }

  .proj-v2-command-left,
  .proj-v2-command-right {
    width: 100%;
    justify-content: flex-start;
  }

  .proj-v2-command-right {
    justify-content: flex-start;
  }

  .proj-v2-drawer {
    max-width: 100%;
  }

  .proj-v2-insights-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .proj-v2-title {
    font-size: 1.25rem;
  }

  .proj-v2-chips {
    width: 100%;
  }

  .proj-v2-chip {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  .proj-v2-search-wrapper {
    max-width: 100%;
  }

  .proj-v2-filters {
    width: 100%;
  }

  .proj-v2-filter-select,
  .proj-v2-filter-input {
    flex: 1;
    min-width: 0;
  }

  .proj-v2-view-switcher {
    width: 100%;
    justify-content: stretch;
  }

  .proj-v2-view-btn {
    flex: 1;
  }

  .proj-v2-view-btn span {
    display: none;
  }

  .proj-v2-insights-kpis {
    grid-template-columns: 1fr;
  }
}

/* ========== PROJETOS - CALENDÁRIO ========== */
.projetos-cal-container {
  display: flex;
  gap: 1.5rem;
  min-height: 600px;
}

.projetos-cal-left {
  flex: 0 0 60%;
}

.projetos-cal-right {
  flex: 1;
  border-left: 1px solid var(--ed-border);
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
}

.projetos-cal-header {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.projetos-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.projetos-cal-day-header {
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--ed-gray-600);
  padding: 0.5rem;
}

.projetos-cal-day {
  aspect-ratio: 1;
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
  padding: 0.5rem;
  background: var(--ed-white);
  cursor: pointer;
  transition: all var(--ed-transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
}

.projetos-cal-day:hover {
  background: var(--ed-gray-50);
  border-color: var(--ed-primary);
}

.projetos-cal-day--today {
  background: var(--ed-primary-soft);
  border-color: var(--ed-primary);
  font-weight: 700;
}

.projetos-cal-day--selected {
  background: var(--ed-primary);
  color: var(--ed-white);
  border-color: var(--ed-primary-dark);
}

.projetos-cal-day--other-month {
  opacity: 0.3;
  background: var(--ed-gray-100);
}

.projetos-cal-day--overdue {
  border-left: 4px solid var(--ed-danger);
}

.projetos-cal-day--due-soon {
  border-left: 4px solid var(--ed-warning);
}

.projetos-cal-day-number {
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.projetos-cal-badge {
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
  border-radius: var(--ed-radius-full);
  background: var(--ed-primary);
  color: var(--ed-white);
  font-weight: 700;
  margin-top: 0.25rem;
}

.projetos-cal-selected-date {
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
  color: var(--ed-gray-900);
}

.projetos-cal-total {
  font-size: 0.875rem;
  color: var(--ed-gray-600);
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ed-border);
}

.projetos-cal-list-body {
  flex: 1;
  overflow: visible; /* sem scroll interno; a página rola */
  max-height: none;
}

.projetos-cal-item {
  padding: 0.75rem;
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
  margin-bottom: 0.5rem;
  background: var(--ed-white);
  cursor: pointer;
  transition: all var(--ed-transition-fast);
}

.projetos-cal-item:hover {
  background: var(--ed-gray-50);
  border-color: var(--ed-primary);
  transform: translateX(4px);
}

.projetos-cal-item-title {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
  color: var(--ed-gray-900);
}

.projetos-cal-item-meta {
  font-size: 0.75rem;
  color: var(--ed-gray-600);
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* ========== PROJETOS - FLUXOGRAMA ========== */
#projetos-fluxograma-container {
  min-height: 500px;
  position: relative;
}

.projetos-fluxograma-mermaid {
  width: 100%;
  overflow: auto;
}

.projetos-fluxograma-lista {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.projetos-fluxograma-nivel {
  margin-left: 2rem;
  padding-left: 1rem;
  border-left: 2px solid var(--ed-border);
  position: relative;
}

.projetos-fluxograma-nivel::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--ed-primary);
}

.projetos-fluxograma-item {
  padding: 0.75rem;
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
  background: var(--ed-white);
  cursor: pointer;
  transition: all var(--ed-transition-fast);
  margin-bottom: 0.5rem;
  position: relative;
}

.projetos-fluxograma-item::before {
  content: "→";
  position: absolute;
  left: -1.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ed-primary);
  font-weight: 700;
}

.projetos-fluxograma-item:hover {
  background: var(--ed-gray-50);
  border-color: var(--ed-primary);
  transform: translateX(4px);
}

.projetos-fluxograma-item-title {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

.projetos-fluxograma-item-meta {
  font-size: 0.75rem;
  color: var(--ed-gray-600);
  display: flex;
  gap: 0.75rem;
}

.projetos-fluxograma-empty {
  text-align: center;
  padding: 3rem;
  color: var(--ed-gray-500);
}

/* Responsivo Calendário e Fluxograma */
@media (max-width: 768px) {
  .projetos-cal-container {
    flex-direction: column;
  }

  .projetos-cal-right {
    border-left: none;
    border-top: 1px solid var(--ed-border);
    padding-left: 0;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
  }
}

/* ========== 17. Utilidades ========== */
.text-muted {
  color: var(--ed-gray-600) !important;
}

small,
.small {
  font-size: 0.8125rem;
}

*:focus-visible {
  outline: 3px solid var(--ed-primary);
  outline-offset: 2px;
  border-radius: var(--ed-radius-sm);
}

/* ========== 18. LISTAS / SCROLL ========== */
.lista-notas-scroll {
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ed-gray-300) transparent;
}

.lista-notas-scroll::-webkit-scrollbar {
  width: 8px;
}

.lista-notas-scroll::-webkit-scrollbar-thumb {
  background: var(--ed-gray-300);
  border-radius: var(--ed-radius-full);
}

/* ========== 19. PRINT ========== */
@media print {
  body {
    background-color: var(--ed-white);
  }

  .btn,
  .nav,
  #login-form,
  .ea-bell-btn,
  .ea-header-right {
    display: none !important;
  }

  .card {
    box-shadow: none;
    border: 2px solid #000000;
    break-inside: avoid;
  }

  .card:hover {
    transform: none;
  }
}

/* ========== 20. Responsivo ========== */
@media (max-width: 768px) {
  .ea-header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .ea-header::before {
    display: none;
  }

  .ea-header-left,
  .ea-header-right {
    width: 100%;
    justify-content: space-between;
  }

  .brand-wordmark--header {
    font-size: 0.82rem;
    padding: 0.36rem 0.72rem;
  }

  .nav-tabs:not(.ed-tabs) .nav-link {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
  }

  .table {
    font-size: 0.8125rem;
  }

  .btn {
    font-size: 0.8125rem;
    padding: 0.5rem 1rem;
  }

  .card-body {
    padding: 1rem;
  }

  .ea-card-kpi .value {
    font-size: 1.5rem;
  }
}

/* Campos com quebra de linha (relatórios) */
#tabela-relatorios td.wrap {
  white-space: normal;
  min-width: 440px;
}

/* Preview - estilos movidos para seção Pré-visualização melhorada */

/* =========================
   NOTÍCIAS (Portal interno)
   ========================= */
.news-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  min-width: 0;
  padding: 1rem 1.25rem;
  border: 2px solid var(--ed-border);
  border-radius: var(--ed-radius-lg);
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
  box-shadow: var(--ed-shadow-sm);
  flex-wrap: wrap;
}

.news-title {
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
}

.news-subtitle {
  color: var(--ed-gray-600);
  font-size: 0.82rem;
  margin-top: 2px;
}

.news-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
  min-width: 0;
}

.news-search {
  min-width: 240px;
  max-width: 100%;
}

.news-search input {
  min-width: 0;
}

.news-feature-card {
  border-radius: var(--ed-radius-lg);
  overflow: hidden;
  border: 1px solid var(--ed-border);
  box-shadow: var(--ed-shadow);
  background: var(--ed-white);
}

.news-feature-media {
  position: relative;
  min-height: 220px;
  background: linear-gradient(
    135deg,
    var(--ed-gray-100) 0%,
    var(--ed-gray-50) 100%
  );
}

.news-feature-media img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.news-feature-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0) 35%,
    rgba(15, 23, 42, 0.75) 100%
  );
}

.news-feature-body {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  color: #fff;
}

.news-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(6px);
}

.news-feature-title {
  margin-top: 8px;
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.news-feature-summary {
  margin-top: 4px;
  font-size: 0.88rem;
  opacity: 0.95;
}

.news-feature-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.news-item {
  display: flex;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
  box-shadow: var(--ed-shadow-xs);
  transition: all var(--ed-transition-base);
}

.news-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--ed-shadow);
  border-color: var(--ed-primary-light);
}

.news-thumb {
  width: 120px;
  height: 74px;
  border-radius: 12px;
  overflow: hidden;
  flex: 0 0 auto;
  background: var(--ed-gray-100);
  border: 1px solid var(--ed-border);
}

.news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-item-main {
  flex: 1;
  min-width: 0;
}

.news-item-title {
  font-weight: 900;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.15;
}

.news-item-meta {
  color: var(--ed-gray-600);
  font-size: 0.78rem;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.news-item-summary {
  color: var(--ed-gray-800);
  font-size: 0.88rem;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-item-actions {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.quick-tile {
  border-radius: var(--ed-radius);
  padding: 12px 10px;
  border: 1px solid rgba(34, 197, 94, 0.25);
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.18) 0%,
    rgba(34, 197, 94, 0.08) 100%
  );
  box-shadow: var(--ed-shadow-xs);
  transition: all var(--ed-transition-base);
  text-decoration: none;
  color: var(--ed-gray-900);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.quick-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--ed-shadow);
  border-color: rgba(34, 197, 94, 0.45);
}

.quick-tile i {
  font-size: 1.2rem;
  color: #16a34a;
}

.quick-tile span {
  font-weight: 900;
  font-size: 0.82rem;
  line-height: 1.1;
}

.news-simple-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.news-simple-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
  background: var(--ed-white);
  box-shadow: var(--ed-shadow-xs);
}

.news-simple-row i {
  color: #16a34a;
}

.news-events {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.news-event {
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
  box-shadow: var(--ed-shadow-xs);
}

.news-event-date {
  width: 56px;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    var(--ed-primary) 0%,
    var(--ed-primary-dark) 100%
  );
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  text-align: center;
  flex: 0 0 auto;
}

.news-event-date .d {
  font-weight: 900;
  font-size: 1.05rem;
  line-height: 1;
}

.news-event-date .m {
  font-size: 0.72rem;
  opacity: 0.95;
  text-transform: uppercase;
}

.news-event-main {
  min-width: 0;
}

.news-event-title {
  font-weight: 900;
  margin: 0;
  line-height: 1.15;
}

.news-event-loc {
  color: var(--ed-gray-600);
  font-size: 0.78rem;
  margin-top: 4px;
}

.news-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.news-gimg {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--ed-border);
  background: var(--ed-gray-100);
  aspect-ratio: 4 / 3;
  box-shadow: var(--ed-shadow-xs);
}

.news-gimg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 992px) {
  .quick-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .news-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 576px) {
  .news-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .news-search {
    width: 100%;
    min-width: 0;
  }

  .quick-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .news-thumb {
    width: 96px;
  }

  .news-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================
   UNIELITE (biblioteca)
   ========================= */
.ue-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  min-width: 0;
  padding: 1rem 1.25rem;
  border: 2px solid var(--ed-border);
  border-radius: var(--ed-radius-lg);
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
  box-shadow: var(--ed-shadow-sm);
  flex-wrap: wrap;
}

.ue-title {
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
}

.ue-subtitle {
  color: var(--ed-gray-600);
  font-size: 0.82rem;
  margin-top: 2px;
}

.ue-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
  min-width: 0;
}

.ue-search {
  min-width: 240px;
  max-width: 100%;
}

.ue-search input {
  min-width: 0;
}

.ue-filter {
  min-width: 160px;
  max-width: 100%;
}

.ue-feature-card {
  border-radius: var(--ed-radius-lg);
  overflow: hidden;
  border: 1px solid var(--ed-border);
  box-shadow: var(--ed-shadow);
  background: var(--ed-white);
}

.ue-feature-body {
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.ue-feature-thumb {
  width: 180px;
  height: 110px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--ed-border);
  background: var(--ed-gray-100);
  flex: 0 0 auto;
  position: relative;
}

.ue-feature-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ue-play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.ue-feature-main {
  flex: 1;
  min-width: 0;
}

.ue-feature-title {
  font-weight: 900;
  margin: 0;
  line-height: 1.15;
}

.ue-feature-meta {
  color: var(--ed-gray-600);
  font-size: 0.78rem;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.ue-feature-desc {
  color: var(--ed-gray-800);
  margin-top: 8px;
  font-size: 0.9rem;
}

.ue-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--ed-border);
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
  font-size: 0.72rem;
  font-weight: 800;
}

.ue-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ue-card {
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
  box-shadow: var(--ed-shadow-xs);
  padding: 10px;
  transition: all var(--ed-transition-base);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.ue-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ed-shadow);
  border-color: var(--ed-primary-light);
}

.ue-thumb {
  width: 110px;
  height: 68px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--ed-border);
  background: var(--ed-gray-100);
  flex: 0 0 auto;
  position: relative;
}

.ue-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ue-iconbox {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--ed-border);
  background: var(--ed-white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.ue-iconbox i {
  font-size: 1.25rem;
  color: var(--ed-primary);
}

.ue-main {
  flex: 1;
  min-width: 0;
}

.ue-title2 {
  font-weight: 900;
  margin: 0;
  line-height: 1.15;
}

.ue-meta {
  color: var(--ed-gray-600);
  font-size: 0.78rem;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.ue-desc {
  margin-top: 6px;
  color: var(--ed-gray-800);
  font-size: 0.88rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ue-actions2 {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.ue-view-preview {
  border: 1px solid var(--ed-border);
  border-radius: 14px;
  background: var(--ed-gray-50);
  overflow: hidden;
}

.ue-view-preview iframe {
  width: 100%;
  height: 420px;
  border: 0;
  display: block;
}

.ue-summary-box {
  border: 1px solid var(--ed-border);
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
  padding: 10px;
  min-height: 120px;
  white-space: pre-wrap;
}

@media (max-width: 992px) {
  .ue-grid {
    grid-template-columns: 1fr;
  }

  .ue-view-preview iframe {
    height: 300px;
  }
}

@media (max-width: 576px) {
  .ue-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .ue-search {
    width: 100%;
    min-width: 0;
  }

  .ue-feature-body {
    flex-direction: column;
  }

  .ue-feature-thumb {
    width: 100%;
    height: 180px;
  }
}

/* Regras duplicadas removidas - usando as definições principais acima */

.actions-row-bottom {
  flex-wrap: wrap;
}

.btn-action-encaminhar-detalhes {
  border-color: #14b8a6;
  color: #14b8a6;
  background: #fff;
}

.btn-action-encaminhar-detalhes:hover {
  background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
  color: #fff;
}

.btn-action-problema {
  border-color: #7c3aed;
  color: #7c3aed;
  background: #fff;
}

.btn-action-problema:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  color: #fff;
}

/* badge de problema (mostra no título depois) */
.problema-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  color: #5b21b6;
  margin-left: 0.5rem;
}

/* =========================
   DASHBOARD (robusto)
   ========================= */
.dash-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}

.dash-title {
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
}

.dash-subtitle {
  color: var(--ed-gray-600);
  font-size: 0.82rem;
  margin-top: 2px;
}

.dash-actions {
  width: 100%;
}

.dash-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: flex-end;
}

.dash-field {
  min-width: 160px;
}

.dash-field-actions {
  min-width: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dash-matrix {
  border: 1px solid var(--ed-border);
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
}

.dash-matrix table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.dash-matrix th,
.dash-matrix td {
  border-bottom: 1px solid var(--ed-border-light);
  padding: 8px 10px;
  vertical-align: middle;
}

.dash-matrix th {
  background: linear-gradient(
    135deg,
    var(--ed-gray-100) 0%,
    var(--ed-gray-50) 100%
  );
  font-weight: 800;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-matrix .rowhdr {
  font-weight: 800;
  white-space: nowrap;
}

.dash-matrix .cell {
  text-align: center;
  font-weight: 800;
  border-left: 1px solid var(--ed-border-light);
}

.dash-insights-box {
  border: 1px solid var(--ed-border);
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
  padding: 10px;
}

.dash-insights-title {
  font-weight: 900;
  margin-bottom: 6px;
}

.dash-pre {
  white-space: pre-wrap;
  font-size: 0.88rem;
  color: var(--ed-gray-900);
  min-height: 140px;
}

#dash-risk-tbody tr {
  cursor: pointer;
}

#dash-risk-tbody tr:hover {
  background: var(--ed-gray-50);
}

@media (max-width: 992px) {
  .dash-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .dash-actions-row {
    justify-content: flex-start;
  }

  .dash-field {
    min-width: 140px;
  }
}

/* =========================
   RELATÓRIOS EXECUTIVOS
   ========================= */
.rel-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}

.rel-title {
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
}

.rel-subtitle {
  color: var(--ed-gray-600);
  font-size: 0.82rem;
  margin-top: 2px;
}

.rel-top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rel-pre {
  white-space: pre-wrap;
  font-size: 0.88rem;
  color: var(--ed-gray-900);
  border: 1px solid var(--ed-border);
  border-radius: 14px;
  padding: 10px;
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
  min-height: 140px;
}

.rel-card-filters .form-label {
  font-weight: 600;
}

.rel-kpi-big {
  border-radius: 14px;
  border: 1px solid var(--ed-border);
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
  padding: 12px 14px;
  box-shadow: var(--ed-shadow-xs);
  height: 100%;
}

.rel-kpi-big .label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ed-gray-600);
}

.rel-kpi-big .value {
  font-size: 1.55rem;
  font-weight: 900;
  margin-top: 2px;
  line-height: 1.1;
}

.rel-kpi-big .meta {
  font-size: 0.78rem;
  color: var(--ed-gray-600);
  margin-top: 2px;
}

.rel-kpi-primary .value {
  color: var(--ed-primary);
}

.rel-kpi-warning .value {
  color: var(--ed-warning-dark);
}

.rel-kpi-danger .value {
  color: var(--ed-danger-dark);
}

.rel-kpi-attn .value {
  color: #b45309;
}

.rel-aging-chip {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(15, 23, 42, 0.03);
  padding: 8px 10px;
  font-size: 0.86rem;
  font-weight: 800;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition:
    transform var(--ed-transition-fast),
    background var(--ed-transition-fast);
}

.rel-aging-chip:hover {
  background: rgba(15, 118, 110, 0.06);
  transform: translateY(-1px);
}

.rel-aging-chip.active {
  background: rgba(15, 118, 110, 0.12);
  border-color: rgba(15, 118, 110, 0.35);
}

.rel-aging-chip span {
  font-weight: 900;
  color: var(--ed-gray-900);
}

.rel-chart-card {
  border: 1px solid var(--ed-border);
  border-radius: 14px;
  padding: 10px;
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
}

.rel-chart-wrap {
  position: relative;
  height: 260px;
}

.rel-table-wrap {
  max-height: 560px;
  overflow: auto;
}

.rel-table-mini {
  max-height: 280px;
  overflow: auto;
}

#tabela-relatorios thead th {
  white-space: nowrap;
}

#tabela-relatorios tbody tr {
  cursor: pointer;
}

#tabela-relatorios td.wrap {
  white-space: normal;
  min-width: 440px;
}

@media print {
  header.ea-header,
  ul.ed-tabs,
  #mensagem-global,
  .dash-executive-header,
  #rel-permission,
  .rel-card-filters,
  #rel-compare-card,
  #rel-charts,
  #rel-kpis,
  #rel-matrix,
  #rel-elia-q,
  #btn-rel-carregar,
  #btn-rel-copy-link,
  #btn-rel-export-dropdown,
  #btn-rel-print,
  #btn-rel-copy-summary,
  #btn-rel-elia,
  #btn-rel-elia-ask,
  #btn-rel-elia-report,
  #btn-rel-elia-clear,
  #btn-rel-elia-copy,
  #rel-elia-suggest {
    display: none !important;
  }

  body {
    background: #fff !important;
  }

  #view-relatorios {
    display: block !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }

  .rel-table-wrap {
    max-height: none !important;
    overflow: visible !important;
  }
}

.rel-matrix {
  border: 1px solid var(--ed-border);
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
}

.rel-matrix table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.rel-matrix th,
.rel-matrix td {
  border-bottom: 1px solid var(--ed-border-light);
  padding: 8px 10px;
}

.rel-matrix th {
  background: linear-gradient(
    135deg,
    var(--ed-gray-100) 0%,
    var(--ed-gray-50) 100%
  );
  font-weight: 800;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rel-matrix .rowhdr {
  font-weight: 800;
  white-space: nowrap;
}

.rel-matrix .cell {
  text-align: center;
  font-weight: 800;
  border-left: 1px solid var(--ed-border-light);
}

@media (max-width: 992px) {
  .rel-topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===== Relatórios: densidade executiva ===== */
#view-relatorios .card-body {
  padding: 1rem;
}

#rel-kpis .ea-card-kpi {
  padding: 0.85rem 1rem;
}

#rel-kpis .ea-card-kpi .label {
  font-size: 0.68rem;
  margin-bottom: 0.25rem;
}

#rel-kpis .ea-card-kpi .value {
  font-size: 1.55rem;
}

#rel-charts .card-body {
  padding: 0.85rem;
}

#rel-charts canvas {
  max-height: 220px;
}

#rel-matrix {
  overflow: auto;
}

#rel-matrix table {
  min-width: 720px;
}

#rel-matrix th,
#rel-matrix td {
  padding: 6px 8px;
  white-space: nowrap;
}

#rel-matrix .rowhdr {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
}

#rel-matrix thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
}

#rel-exec {
  min-height: 240px;
}

.rel-sidebar-sticky {
  position: sticky;
  top: 12px;
}

/* Relatórios: mais executivo (menos “ar”, mais informação) */
#view-relatorios .card-body {
  padding: 1rem;
}

#rel-charts .card-body {
  padding: 0.85rem;
}

#rel-charts canvas {
  max-height: 240px;
}

.rel-pre {
  min-height: 200px;
}

/* ========== ELIA: ESTILOS EXECUTIVOS ========== */

/* Container Principal */
.elia-container {
  height: calc(100vh - 120px);
  background: #f8f9fa;
}

/* ===== SIDEBAR ===== */
.elia-sidebar {
  background: #ffffff;
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: calc(100vh - 120px);
}

.elia-sidebar-header {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid #e0e0e0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.elia-sidebar-header h5 {
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
}

.elia-sidebar-search {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e0e0e0;
  background: #fafafa;
}

.elia-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.elia-sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid #e0e0e0;
  background: #fafafa;
}

/* Lista de Conversas */
.elia-conversations-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.elia-conversation-item {
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
  border: 1px solid #e0e0e0;
}

.elia-conversation-item:hover {
  background: #f8f9fa;
  border-color: #667eea;
  transform: translateX(2px);
}

.elia-conversation-item.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
}

.elia-conversation-item .conversation-title {
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.elia-conversation-item .conversation-date {
  font-size: 0.75rem;
  opacity: 0.7;
}

.elia-conversation-item.active .conversation-title,
.elia-conversation-item.active .conversation-date {
  color: white;
}

/* ===== MAIN CHAT AREA ===== */
.elia-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: calc(100vh - 120px);
  background: #ffffff;
}

/* Header do Chat */
.elia-chat-header {
  padding: 1rem 1.5rem;
  border-bottom: 2px solid #e0e0e0;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.elia-chat-header h6 {
  font-weight: 600;
  color: #2c3e50;
  font-size: 1rem;
}

.elia-chat-header small {
  font-size: 0.8rem;
}

/* Corpo do Chat */
.elia-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
}

/* Welcome Screen */
.elia-welcome {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem;
}

.elia-logo-big {
  font-size: 5rem;
  color: #667eea;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.elia-suggestions {
  max-width: 800px;
  margin: 0 auto;
}

.elia-suggestion-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  text-align: left;
  transition: all 0.3s ease;
  width: 100%;
  cursor: pointer;
}

.elia-suggestion-card:hover {
  border-color: #667eea;
  background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.elia-suggestion-card i {
  font-size: 1.5rem;
  min-width: 30px;
}

.elia-suggestion-card span {
  font-weight: 500;
  color: #2c3e50;
  font-size: 0.9rem;
}

/* Container de Mensagens */
.elia-messages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Mensagem Individual */
.elia-message {
  display: flex;
  gap: 0.75rem;
  animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.elia-message.user {
  flex-direction: row-reverse;
}

.elia-message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.elia-message.assistant .elia-message-avatar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.elia-message.user .elia-message-avatar {
  background: #34495e;
  color: white;
}

.elia-message-content {
  max-width: 70%;
  background: white;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
}

.elia-message.assistant .elia-message-content {
  border: 2px solid #e0e0e0;
  background: white;
}

.elia-message.user .elia-message-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.elia-message-text {
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.elia-message.user .elia-message-text {
  color: white;
}

.elia-message-time {
  font-size: 0.7rem;
  opacity: 0.6;
  margin-top: 0.5rem;
  text-align: right;
}

.elia-message.assistant .elia-message-time {
  color: #7f8c8d;
}

.elia-message.user .elia-message-time {
  color: white;
}

/* Mensagem de Loading */
.elia-message-loading {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.elia-message-loading .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #667eea;
  animation: loadingDot 1.4s infinite;
}

.elia-message-loading .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.elia-message-loading .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes loadingDot {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }

  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* ===== FOOTER: INPUT ===== */
.elia-chat-footer {
  border-top: 2px solid #e0e0e0;
  background: white;
  padding: 1rem 1.5rem;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.elia-attachments-area {
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  border: 1px solid #e0e0e0;
}

.elia-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: white;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 0.85rem;
}

.elia-attachment-chip i {
  color: #667eea;
}

.elia-attachment-chip button {
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  padding: 0;
  font-size: 0.9rem;
}

.elia-input-container {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 24px;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.elia-input-container:focus-within {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.elia-attach-btn,
.elia-send-btn {
  background: none;
  border: none;
  color: #7f8c8d;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.elia-attach-btn:hover {
  background: #f0f0f0;
  color: #667eea;
}

.elia-send-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.elia-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.elia-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.elia-message-input {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 0.5rem;
  max-height: 150px;
  min-height: 24px;
  font-family: inherit;
}

.elia-message-input:focus {
  outline: none;
}

.elia-input-footer {
  margin-top: 0.5rem;
  text-align: center;
}

.elia-input-footer small {
  font-size: 0.75rem;
}

/* ===== SCROLLBAR CUSTOMIZADA ===== */
.elia-sidebar-body::-webkit-scrollbar,
.elia-chat-body::-webkit-scrollbar {
  width: 6px;
}

.elia-sidebar-body::-webkit-scrollbar-track,
.elia-chat-body::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.elia-sidebar-body::-webkit-scrollbar-thumb,
.elia-chat-body::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

.elia-sidebar-body::-webkit-scrollbar-thumb:hover,
.elia-chat-body::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
  .elia-container {
    height: calc(100vh - 80px);
  }

  .elia-sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    width: 80%;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
  }

  .elia-sidebar.show {
    left: 0;
  }

  .elia-main {
    width: 100%;
  }

  .elia-message-content {
    max-width: 85%;
  }

  .elia-chat-footer {
    padding: 0.75rem 1rem;
  }
}

/* ===== TABELA DE LOGS (DBA) ===== */
#modal-elia-logs .table {
  font-size: 0.85rem;
}

#modal-elia-logs .table th {
  background: #f8f9fa;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
}

#modal-elia-logs .table td {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#modal-elia-logs .table td:hover {
  white-space: normal;
  overflow: visible;
}

/* Badge de Fallback */
.badge-fallback {
  background: #e74c3c;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
}

.badge-api {
  background: #27ae60;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
}

/* Estado Vazio */
.elia-empty-state {
  text-align: center;
  padding: 2rem;
  color: #7f8c8d;
}

.elia-empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* ===== ACESSIBILIDADE ===== */
.elia-message-content:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* ===== ESTADOS DE HOVER E FOCO (escopado na ELIA) ===== */
.elia-conversation-item:focus {
  outline: 2px solid #667eea;
  outline-offset: -2px;
}

.elia-container button:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.55);
  outline-offset: 2px;
}

/* ===== ANIMAÇÕES SUAVES (escopado na ELIA; evita afetar o app inteiro) ===== */
.elia-container * {
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.elia-container button,
.elia-container .elia-conversation-item,
.elia-container .elia-suggestion-card {
  transition: all 0.2s ease;
}

/* ===== ELIA: painel direito (executivo) ===== */
.elia-rightpanel {
  height: 100%;
  max-height: calc(100vh - 120px);
  background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
  border-left: 1px solid #e0e0e0;
}

.elia-right-inner {
  height: 100%;
  overflow: auto;
  padding: 12px;
}

.elia-kpi {
  border: 1px solid var(--ed-border);
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
  padding: 10px;
}

.elia-kpi .k {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ed-gray-600);
  font-weight: 800;
}

.elia-kpi .v {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--ed-gray-900);
  margin-top: 4px;
}

.elia-insights-pre {
  white-space: pre-wrap;
  font-size: 0.88rem;
  min-height: 160px;
  border: 1px solid var(--ed-border);
  border-radius: 14px;
  padding: 10px;
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
}

/* mobile: painel direito cai abaixo */
@media (max-width: 992px) {
  .elia-rightpanel {
    border-left: 0;
    border-top: 1px solid #e0e0e0;
  }
}

/* ===== ELIA OPERAÇÃO ===== */
.elia-quicklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.elia-quickbtn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--ed-border);
  border-radius: 14px;
  padding: 10px;
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
  box-shadow: var(--ed-shadow-xs);
  transition: all var(--ed-transition-base);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.elia-quickbtn:hover {
  transform: translateY(-2px);
  box-shadow: var(--ed-shadow);
  border-color: var(--ed-primary-light);
}

.elia-quickbtn i {
  font-size: 1.1rem;
  margin-top: 2px;
  color: var(--ed-primary);
}

.elia-quickbtn .t {
  font-weight: 900;
  line-height: 1.15;
}

.elia-quickbtn .s {
  font-size: 0.8rem;
  color: var(--ed-gray-600);
  margin-top: 2px;
}

/* KPIs (já tínhamos, só garantindo) */
.elia-kpi {
  border: 1px solid var(--ed-border);
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
  padding: 10px;
}

.elia-kpi .k {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ed-gray-600);
  font-weight: 800;
}

.elia-kpi .v {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--ed-gray-900);
  margin-top: 4px;
}

/* ============================================================
   ANOTAÇÕES PREMIUM - DESIGN SYSTEM
   ============================================================ */

/* ========== Toolbar superior ========== */
.notes-toolbar {
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
  border: 2px solid var(--ed-border);
  border-radius: var(--ed-radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--ed-shadow-sm);
  flex-wrap: wrap;
  min-width: 0;
}

.notes-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.notes-toolbar-left h4 {
  color: var(--ed-gray-900);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.notes-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
}

/* ========== Loading / Skeleton ========== */
@keyframes notesShimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

.notes-skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.note-skel-card {
  border-radius: var(--ed-radius-lg);
  border: 2px solid var(--ed-border);
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
  box-shadow: var(--ed-shadow-sm);
  padding: 1.25rem;
  overflow: hidden;
}

.note-skel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.note-skel-dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.08) 0%,
    rgba(15, 118, 110, 0.18) 50%,
    rgba(15, 23, 42, 0.08) 100%
  );
  background-size: 200% 200%;
  animation: notesShimmer 1.1s ease-in-out infinite;
  flex: 0 0 auto;
}

.note-skel-line {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.08) 0%,
    rgba(15, 118, 110, 0.16) 50%,
    rgba(15, 23, 42, 0.08) 100%
  );
  background-size: 200% 200%;
  animation: notesShimmer 1.1s ease-in-out infinite;
  margin-bottom: 0.55rem;
}

.note-skel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.note-skel-pill {
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.08) 0%,
    rgba(15, 118, 110, 0.14) 50%,
    rgba(15, 23, 42, 0.08) 100%
  );
  background-size: 200% 200%;
  animation: notesShimmer 1.1s ease-in-out infinite;
}

/* Empty state */
#view-notas #notes-empty {
  border: 2px dashed var(--ed-border);
  border-radius: var(--ed-radius-lg);
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
  box-shadow: var(--ed-shadow-sm);
  padding: 2.25rem 1.25rem;
}

#view-notas #notes-empty h5 {
  font-weight: 800;
  color: var(--ed-gray-900);
  letter-spacing: -0.01em;
}

#view-notas #notes-empty .btn {
  border-radius: 999px;
  font-weight: 800;
}

/* ========== Grid de notas (cards) ========== */
#view-notas {
  --notes-card-min: 280px;
  --notes-card-gap: 1rem;
  --notes-card-pad: 1rem;
  --notes-title-lines: 2;
  --notes-content-lines: 6;
  --notes-card-aspect: auto;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--notes-card-min), 1fr));
  gap: var(--notes-card-gap);
  margin-bottom: 2rem;
}

/* ========== Lista de notas (alternativa) ========== */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem; /* Aumentado de 1rem para melhor respiro entre itens */
  margin-bottom: 2rem;
}

.notes-list .note-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  aspect-ratio: auto;
  min-height: 0;
  padding: 1.5rem 1.75rem; /* Aumentado de 1rem 1.25rem para mais espaço interno */
}

.notes-list .note-content {
  flex: 1;
  max-height: none;
  overflow: visible;
}

/* ========== Lista de notas (tabela) ========== */
.notes-list-table {
  margin-bottom: 2rem;
}

.notes-list-table .table {
  margin-bottom: 0;
}

.notes-list-table .notes-list-row {
  cursor: pointer;
}

.notes-list-table .notes-list-title {
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ed-gray-900);
}

.notes-list-table .notes-list-preview {
  color: var(--ed-gray-700);
  font-size: 0.9rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.notes-list-table .note-accent-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--ed-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
  flex: 0 0 auto;
  margin-top: 0.35rem;
}

.notes-list-table .min-w-0 {
  min-width: 0;
}

.notes-list-table .note-row-pinned > td {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

/* ========== Card de nota ========== */
.note-card {
  background: var(--ed-white);
  border: 1px solid var(--ed-border);
  border-left: 5px solid var(--note-accent, var(--ed-primary));
  border-radius: var(--ed-radius-lg);
  padding: var(--notes-card-pad);
  aspect-ratio: auto;
  min-height: 250px;
  height: auto;
  display: flex;
  flex-direction: column;
  box-shadow: var(--ed-shadow-sm);
  transition: all var(--ed-transition-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.note-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--ed-shadow-md);
  border-color: var(--ed-primary-light);
}

.note-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--ed-primary-glow),
    transparent
  );
  opacity: 0;
  transition: opacity var(--ed-transition-base);
}

.note-card:hover::before {
  opacity: 1;
}

/* Nota fixada */
.note-pinned {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-left-color: #f59e0b;
}

/* ========== Header da nota ========== */
.note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

/* Aumentar espaçamento do header na lista */
.notes-list .note-header {
  margin-bottom: 1rem; /* Aumentado de 0.75rem */
}

.note-priority {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
}

.note-actions {
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity var(--ed-transition-fast);
}

.note-card:hover .note-actions {
  opacity: 1;
}

.btn-note-action {
  width: 28px;
  height: 28px;
  border: 1px solid var(--ed-border);
  background: var(--ed-white);
  border-radius: var(--ed-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ed-gray-600);
  transition: all var(--ed-transition-fast);
  cursor: pointer;
}

.btn-note-action:hover {
  background: var(--ed-gray-100);
  color: var(--ed-gray-900);
  border-color: var(--ed-gray-400);
  transform: scale(1.1);
}

/* ========== Conteúdo da nota ========== */
.note-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ed-gray-900);
  margin-bottom: 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: var(--notes-title-lines);
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Aumentar espaçamento do título na lista */
.notes-list .note-title {
  margin-bottom: 0.75rem; /* Aumentado de 0.5rem */
  font-size: 1.25rem; /* Ligeiramente maior na lista */
}

.note-content {
  font-size: 0.875rem;
  color: var(--ed-gray-700);
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1 1 auto;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--notes-content-lines);
}

/* Melhorar espaçamento do conteúdo na lista */
.notes-list .note-content {
  margin-bottom: 1.25rem; /* Aumentado de 1rem */
  font-size: 0.9375rem; /* Ligeiramente maior para melhor legibilidade */
  line-height: 1.7; /* Aumentado de 1.6 */
  max-height: none; /* Remover limite na lista para mostrar mais conteúdo */
}

/* ========== Meta informações ========== */
.note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

/* Aumentar espaçamento dos meta na lista */
.notes-list .note-meta {
  margin-bottom: 1rem; /* Aumentado de 0.75rem */
  gap: 0.625rem; /* Aumentado de 0.5rem */
}

.note-cat {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--ed-radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid currentColor;
}

.note-deadline {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--ed-gray-600);
  padding: 0.25rem 0.625rem;
  border-radius: var(--ed-radius-full);
  background: var(--ed-gray-100);
}

.note-deadline.deadline-past {
  background: #fee2e2;
  color: #dc2626;
  font-weight: 600;
}

.note-deadline.deadline-past i {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* ========== Tags ========== */
.note-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

/* Aumentar espaçamento das tags na lista */
.notes-list .note-tags-wrap {
  margin-bottom: 1rem; /* Aumentado de 0.75rem */
  gap: 0.5rem; /* Aumentado de 0.375rem */
}

.note-tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: var(--ed-gray-100);
  color: var(--ed-gray-700);
  border-radius: var(--ed-radius-sm);
  font-size: 0.7rem;
  font-weight: 500;
  border: 1px solid var(--ed-border);
}

/* ========== Footer ========== */
.note-footer {
  border-top: 1px solid var(--ed-border-light);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.note-footer-actions {
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity var(--ed-transition-fast);
}

.note-card:hover .note-footer-actions {
  opacity: 1;
}

/* Aumentar espaçamento do footer na lista */
.notes-list .note-footer {
  padding-top: 0.75rem; /* Aumentado de 0.5rem */
  margin-top: 0.75rem; /* Aumentado de 0.5rem */
}

.note-footer small {
  color: var(--ed-gray-500);
  font-size: 0.7rem;
}

/* ========== Modal de edição ========== */
#modal-note-editor .modal-content {
  border: 2px solid var(--ed-border);
  box-shadow: var(--ed-shadow-xl);
}

#modal-note-editor .modal-header {
  background: linear-gradient(
    135deg,
    var(--ed-primary-soft) 0%,
    var(--ed-white) 100%
  );
  border-bottom: 2px solid var(--ed-border);
}

#modal-note-editor .modal-title i {
  color: var(--ed-primary);
}

#modal-note-editor textarea {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  resize: vertical;
}

/* ========== Gerenciar categorias ========== */
#modal-manage-cats .list-group-item {
  border-radius: var(--ed-radius-sm);
  margin-bottom: 0.5rem;
  border: 2px solid var(--ed-border);
  transition: all var(--ed-transition-fast);
}

#modal-manage-cats .list-group-item:hover {
  border-color: var(--ed-primary-light);
  background: var(--ed-gray-50);
}

/* ========== Responsivo ========== */
@media (max-width: 1200px) {
  .notes-grid {
    grid-template-columns: repeat(
      auto-fill,
      minmax(var(--notes-card-min), 1fr)
    );
  }
}

@media (max-width: 768px) {
  .notes-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .notes-toolbar-left,
  .notes-toolbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .notes-toolbar-right {
    flex-wrap: wrap;
  }

  .notes-toolbar-right .input-group {
    width: 100% !important;
    margin-bottom: 0.5rem;
  }

  .notes-size-control {
    width: 100%;
    justify-content: space-between;
  }

  .notes-size-control .btn-group {
    flex: 1;
  }

  .notes-size-control .btn-group .btn {
    flex: 1;
  }

  .notes-grid {
    grid-template-columns: 1fr;
  }

  .note-card {
    padding: 1rem;
    aspect-ratio: auto;
    min-height: 0;
  }

  /* Em touch/mobile, não dependa de hover para ações */
  .note-footer-actions {
    opacity: 1;
  }

  .notes-list {
    gap: 1.25rem; /* Reduzido ligeiramente no mobile */
  }

  .notes-list .note-card {
    flex-direction: column;
    padding: 1.25rem; /* Padding uniforme no mobile */
  }

  /* Ajustar espaçamento interno no mobile */
  .notes-list .note-header,
  .notes-list .note-title,
  .notes-list .note-content,
  .notes-list .note-meta,
  .notes-list .note-tags-wrap {
    margin-bottom: 0.875rem; /* Espaçamento consistente no mobile */
  }

  .notes-list .note-footer {
    padding-top: 0.625rem;
    margin-top: 0.625rem;
  }
}

/* ========== Animações extras ========== */
@keyframes slideInNote {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.note-card {
  animation: slideInNote 0.3s ease-out;
}

/* ========== Estados de filtro ========== */
#notes-filter-pinned.active {
  background: var(--ed-primary);
  color: var(--ed-white);
  border-color: var(--ed-primary);
}

#notes-filter-pinned.active:hover {
  background: var(--ed-primary-dark);
  border-color: var(--ed-primary-dark);
}

/* ========== Cores dos badges de status ========== */
.badge.bg-warning {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
  color: #78350f !important;
}

.badge.bg-info {
  background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%) !important;
  color: #134e4a !important;
}

.badge.bg-success {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%) !important;
  color: #064e3b !important;
}

/* ========== Ajustes de impressão ========== */
@media print {
  .notes-toolbar,
  .note-actions,
  .btn-note-action {
    display: none !important;
  }

  .note-card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #000;
  }

  .notes-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== NOTAS • Anexos (modal) ========== */
#note-attachments-uploader input[type="file"] {
  min-width: 260px;
}

#note-attachments-list .list-group-item {
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
  margin-bottom: 0.5rem;
}

.note-attach-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--ed-primary);
  flex: 0 0 auto;
}

.note-attach-name {
  font-weight: 700;
  color: var(--ed-gray-900);
}

.note-attach-meta {
  font-size: 0.8rem;
  color: var(--ed-gray-600);
}

/* ========== NOTAS • Templates (modal) ========== */
#note-tpl-list .list-group-item {
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
  margin-bottom: 0.6rem;
}

#note-tpl-list .list-group-item:hover {
  border-color: var(--ed-primary-light);
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
}

#note-tpl-list .list-group-item.active {
  border-color: var(--ed-primary);
  background: var(--ed-primary-soft);
}

.note-tpl-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--ed-primary);
  flex: 0 0 auto;
}

.note-tpl-preview {
  color: var(--ed-gray-600);
  font-size: 0.875rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========== NOTAS • Paleta de cores ========== */
.ed-color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.ed-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  border: 1px solid var(--ed-border);
  cursor: pointer;
  box-shadow: var(--ed-shadow-xs);
  transition:
    transform var(--ed-transition-fast),
    box-shadow var(--ed-transition-fast),
    border-color var(--ed-transition-fast);
}

.ed-color-swatch:hover {
  transform: translateY(-1px);
  box-shadow: var(--ed-shadow-sm);
  border-color: var(--ed-primary-light);
}

.ed-color-swatch.selected {
  border-color: var(--ed-primary);
  box-shadow: 0 0 0 0.16rem rgba(15, 118, 110, 0.18);
}

.ed-color-palette-hint {
  font-size: 0.78rem;
  color: var(--ed-gray-600);
  margin-top: 0.25rem;
}

/* ========== LOGIN - DESIGN MODERNO E CONVIDATIVO ========== */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: auto;
  padding: 1.5rem 1rem;
}

.login-card {
  background: var(--ed-white);
  border-radius: var(--ed-radius-xl);
  box-shadow: var(--ed-shadow-xl);
  width: 100%;
  max-width: 440px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--ed-primary) 0%,
    var(--ed-primary-light) 100%
  );
}

/* Header do Login */
.login-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-logo-wrapper {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.brand-wordmark--login {
  min-height: 64px;
  padding: 0.75rem 1.25rem;
  border-radius: 14px;
  font-size: 1.2rem;
  color: #ffffff;
  background: linear-gradient(135deg, var(--ed-primary) 0%, var(--ed-primary-light) 100%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 10px 26px rgba(15, 118, 110, 0.28);
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ed-gray-900);
  margin-bottom: 0.375rem;
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 0.9375rem;
  color: var(--ed-gray-600);
  margin: 0;
}

/* Biscoito da Sorte */
.login-motd-wrapper {
  margin-bottom: 1.5rem;
}

.login-fortune-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.login-fortune-question {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ed-gray-700);
}

.login-fortune-button {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border: none;
  border-radius: 50px;
  padding: 1rem 2rem;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.login-fortune-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4);
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.login-fortune-button:active {
  transform: translateY(0);
}

.fortune-cookie {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fortune-cookie i {
  font-size: 32px;
  color: #fef3c7;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.fortune-cookie-line {
  position: absolute;
  width: 24px;
  height: 2px;
  background: #78350f;
  border-radius: 1px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Modal do Biscoito da Sorte */
.fortune-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.fortune-modal.show {
  display: flex;
}

.fortune-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.fortune-modal-content {
  position: relative;
  background: white;
  border-radius: 24px;
  padding: 3rem 2.5rem;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalPop {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(-50px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Efeito Mágico (estrelas) */
.fortune-magic-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  border-radius: 24px;
}

.magic-star {
  position: absolute;
  width: 20px;
  height: 20px;
  background: #fbbf24;
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
  animation: starFloat 1.5s ease-out infinite;
}

.magic-star:nth-child(1) {
  top: 10%;
  left: 15%;
  animation-delay: 0s;
  animation-duration: 1.2s;
}

.magic-star:nth-child(2) {
  top: 20%;
  right: 20%;
  animation-delay: 0.3s;
  animation-duration: 1.4s;
}

.magic-star:nth-child(3) {
  bottom: 30%;
  left: 20%;
  animation-delay: 0.6s;
  animation-duration: 1.3s;
}

.magic-star:nth-child(4) {
  bottom: 20%;
  right: 15%;
  animation-delay: 0.9s;
  animation-duration: 1.5s;
}

.magic-star:nth-child(5) {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 0.1s;
  animation-duration: 1.6s;
  width: 30px;
  height: 30px;
}

@keyframes starFloat {
  0% {
    opacity: 0;
    transform: scale(0) rotate(0deg) translateY(0);
  }
  50% {
    opacity: 1;
    transform: scale(1) rotate(180deg) translateY(-20px);
  }
  100% {
    opacity: 0;
    transform: scale(0) rotate(360deg) translateY(-40px);
  }
}

.fortune-cookie-open {
  font-size: 4rem;
  color: #fbbf24;
  margin: 1rem 0;
  animation: cookieOpen 0.6s ease;
}

@keyframes cookieOpen {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.2) rotate(10deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.fortune-message {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--ed-gray-800);
  line-height: 1.6;
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 16px;
  border: 2px solid #fbbf24;
  animation: messageFadeIn 0.8s ease 0.3s both;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes messageFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal de Resumo de Tickets */
.tickets-summary-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.tickets-summary-modal.show {
  display: flex;
}

.tickets-summary-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.tickets-summary-content {
  position: relative;
  background: white;
  border-radius: 24px;
  padding: 2.5rem;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
}

.tickets-summary-header {
  text-align: center;
  margin-bottom: 2rem;
}

.tickets-summary-icon {
  font-size: 3.5rem;
  color: #0f766e;
  margin-bottom: 1rem;
  animation: cookieOpen 0.6s ease;
}

.tickets-summary-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--ed-gray-800);
  margin: 0;
}

.tickets-summary-body {
  margin-bottom: 2rem;
}

.tickets-summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tickets-summary-stat {
  text-align: center;
  padding: 1rem;
  background: linear-gradient(135deg, #ecfeff 0%, #ccfbf1 100%);
  border-radius: 12px;
  border: 2px solid #93c5fd;
}

.tickets-summary-stat.tickets-summary-stat-total {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #fdba74;
}

.tickets-summary-stat.tickets-summary-stat-total .tickets-summary-stat-value {
  color: #c2410c;
}

.tickets-summary-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #0f766e;
  display: block;
  margin-bottom: 0.25rem;
}

.tickets-summary-stat-label {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
}

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

.tickets-summary-item {
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: #f8fafc;
  border-radius: 12px;
  border-left: 4px solid #0f766e;
  transition: all 0.2s ease;
}

.tickets-summary-item:hover {
  background: #f1f5f9;
  transform: translateX(4px);
}

.tickets-summary-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.tickets-summary-item-protocolo {
  font-weight: 600;
  color: #0f766e;
  font-size: 0.9rem;
}

.tickets-summary-item-prioridade {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.tickets-summary-item-prioridade.baixa {
  background: #dcfce7;
  color: #166534;
}

.tickets-summary-item-prioridade.media {
  background: #fef3c7;
  color: #92400e;
}

.tickets-summary-item-prioridade.alta {
  background: #fed7aa;
  color: #9a3412;
}

.tickets-summary-item-prioridade.critica {
  background: #fee2e2;
  color: #991b1b;
}

.tickets-summary-item-titulo {
  font-weight: 500;
  color: var(--ed-gray-800);
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.tickets-summary-item-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: #64748b;
  flex-wrap: wrap;
}

.tickets-summary-item-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.tickets-summary-empty {
  text-align: center;
  padding: 2rem;
  color: #64748b;
}

.tickets-summary-empty-icon {
  font-size: 4rem;
  color: #cbd5e1;
  margin-bottom: 1rem;
}

.tickets-summary-empty-text {
  font-size: 1.1rem;
  font-weight: 500;
}

.tickets-summary-motivational {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 16px;
  border: 2px solid #fbbf24;
  text-align: center;
  animation: messageFadeIn 0.8s ease 0.3s both;
}

.tickets-summary-motivational-icon {
  font-size: 2rem;
  color: #f59e0b;
  margin-bottom: 0.5rem;
}

.tickets-summary-motivational-text {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ed-gray-800);
  line-height: 1.6;
  margin: 0;
}

.tickets-summary-footer {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

/* Formulário */
.login-form-wrapper {
  margin-bottom: 1.5rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.login-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ed-gray-700);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.login-label i {
  color: var(--ed-primary);
  font-size: 1rem;
}

.login-input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  border: 2px solid var(--ed-border);
  border-radius: var(--ed-radius);
  background: var(--ed-white);
  color: var(--ed-gray-900);
  transition: all var(--ed-transition-base);
}

.login-input:focus {
  outline: none;
  border-color: var(--ed-primary);
  box-shadow: 0 0 0 3px var(--ed-primary-glow);
}

.login-input::placeholder {
  color: var(--ed-gray-400);
}

.login-status {
  font-size: 0.8125rem;
  color: var(--ed-gray-600);
  text-align: center;
  min-height: 1.25rem;
}

/* Botões */
.login-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.btn-login-primary {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(
    135deg,
    var(--ed-primary) 0%,
    var(--ed-primary-dark) 100%
  );
  color: var(--ed-white);
  border: none;
  border-radius: var(--ed-radius);
  box-shadow: var(--ed-shadow);
  transition: all var(--ed-transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-login-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--ed-shadow-lg);
  background: linear-gradient(
    135deg,
    var(--ed-primary-dark) 0%,
    var(--ed-primary-darker) 100%
  );
}

.btn-login-primary:active {
  transform: translateY(0);
}

.btn-login-secondary {
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  background: var(--ed-white);
  color: var(--ed-gray-700);
  border: 2px solid var(--ed-border);
  border-radius: var(--ed-radius);
  transition: all var(--ed-transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-login-secondary:hover {
  background: var(--ed-gray-50);
  border-color: var(--ed-gray-300);
  color: var(--ed-gray-900);
}

/* Seção de Cadastro */
.login-register-section {
  border-top: 1px solid var(--ed-border);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

.login-register-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.login-register-label {
  font-weight: 600;
  color: var(--ed-gray-700);
  font-size: 0.9375rem;
}

.btn-login-link {
  background: none;
  border: none;
  color: var(--ed-primary);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--ed-radius-sm);
  transition: all var(--ed-transition-base);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-login-link:hover {
  background: var(--ed-primary-soft);
  color: var(--ed-primary-dark);
}

.login-register-card {
  background: var(--ed-gray-50);
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius-md);
  padding: 1.5rem;
  margin-top: 1rem;
}

.login-register-note {
  font-size: 0.8125rem;
  color: var(--ed-gray-600);
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ed-border);
  line-height: 1.5;
}

/* Responsivo */
@media (max-width: 576px) {
  .login-container {
    padding: 1rem;
    min-height: auto;
  }

  .login-card {
    padding: 1.5rem 1.25rem;
    border-radius: var(--ed-radius-lg);
  }

  .brand-wordmark--login {
    min-height: 56px;
    font-size: 1.02rem;
    padding: 0.6rem 1rem;
  }

  .login-title {
    font-size: 1.375rem;
  }

  .login-register-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.elia-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  line-height: 1.45;
}

.elia-box code {
  padding: 2px 6px;
  border-radius: 6px;
}

/* ============================================================================
   DASHBOARD EXECUTIVO - DESIGN PREMIUM v3.0
   Sistema de Design Nível CEO/Diretoria
   ============================================================================ */

/* ========== Executive Header ========== */
.dash-executive-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.dash-executive-header::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    rgba(59, 130, 246, 0.15) 0%,
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
}

.dash-executive-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.dash-executive-title-section {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.dash-executive-title-section > i {
  font-size: 3rem;
  color: #14b8a6;
  filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.5));
}

.dash-executive-title {
  font-size: 2rem;
  font-weight: 800;
  color: white;
  margin: 0;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.dash-executive-subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  margin: 0.25rem 0 0 0;
}

.dash-executive-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-dash-executive {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.btn-dash-executive i {
  font-size: 1.1rem;
}

.btn-dash-executive:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.btn-dash-executive-primary {
  background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
  border-color: #14b8a6;
}

.btn-dash-executive-primary:hover {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

.btn-dash-executive-secondary {
  background: rgba(100, 116, 139, 0.3);
}

/* ========== Filtros Compactos ========== */
.dash-executive-filters {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.dash-filter-compact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
}

.dash-filter-compact i {
  color: #2dd4bf;
  font-size: 1.1rem;
}

.dash-filter-compact span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

.form-control-compact,
.form-select-compact {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: all 0.25s;
  min-width: 140px;
}

.form-control-compact:focus,
.form-select-compact:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  outline: none;
}

.form-select-compact option {
  background: #1e293b;
  color: white;
}

.btn-dash-filter-clear {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
}

.btn-dash-filter-clear:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  transform: scale(1.1);
}

.btn-dash-filter-quick {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.btn-dash-filter-quick:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #14b8a6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-dash-filter-quick i {
  font-size: 0.9rem;
}

/* ========== KPIs Hero (Principais) ========== */
.dash-kpi-hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dash-kpi-hero {
  background: linear-gradient(135deg, var(--ed-white) 0%, #f8fafc 100%);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  border: 2px solid rgba(59, 130, 246, 0.1);
  display: flex;
  gap: 1.5rem;
  align-items: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.dash-kpi-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--kpi-color-1) 0%,
    var(--kpi-color-2) 100%
  );
  opacity: 0;
  transition: opacity 0.3s;
}

.dash-kpi-hero:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border-color: var(--kpi-color-1);
}

.dash-kpi-hero:hover::before {
  opacity: 1;
}

.dash-kpi-hero-primary {
  --kpi-color-1: #14b8a6;
  --kpi-color-2: #0f766e;
}

.dash-kpi-hero-warning {
  --kpi-color-1: #f59e0b;
  --kpi-color-2: #d97706;
}

.dash-kpi-hero-danger {
  --kpi-color-1: #ef4444;
  --kpi-color-2: #dc2626;
}

.dash-kpi-hero-success {
  --kpi-color-1: #10b981;
  --kpi-color-2: #059669;
}

.dash-kpi-hero-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: linear-gradient(
    135deg,
    var(--kpi-color-1) 0%,
    var(--kpi-color-2) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.dash-kpi-hero-icon i {
  font-size: 2.5rem;
  color: white;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.dash-kpi-hero-content {
  flex: 1;
}

.dash-kpi-hero-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.dash-kpi-hero-value {
  font-size: 3rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
}

.dash-kpi-hero-unit {
  font-size: 1.5rem;
  color: #64748b;
  margin-left: 0.25rem;
}

.dash-kpi-hero-trend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #10b981;
  font-weight: 600;
}

.dash-kpi-hero-trend i {
  font-size: 1.1rem;
}

.dash-kpi-hero-trend-negative {
  color: #ef4444;
}

/* ========== KPIs Secundários ========== */
.dash-kpi-secondary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.dash-kpi-card {
  background: linear-gradient(135deg, white 0%, #f8fafc 100%);
  border-radius: 16px;
  padding: 1.5rem;
  border: 2px solid transparent;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.dash-kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--kpi-accent-color);
  transform: scaleY(0);
  transition: transform 0.3s;
}

.dash-kpi-card:hover {
  border-color: var(--kpi-accent-color);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.dash-kpi-card:hover::before {
  transform: scaleY(1);
}

.dash-kpi-status-open {
  --kpi-accent-color: #14b8a6;
}

.dash-kpi-status-progress {
  --kpi-accent-color: #f59e0b;
}

.dash-kpi-status-waiting {
  --kpi-accent-color: #8b5cf6;
}

.dash-kpi-status-done {
  --kpi-accent-color: #10b981;
}

.dash-kpi-status-warning {
  --kpi-accent-color: #eab308;
}

.dash-kpi-status-time {
  --kpi-accent-color: #06b6d4;
}

.dash-kpi-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    rgba(var(--kpi-rgb), 0.1) 0%,
    rgba(var(--kpi-rgb), 0.05) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-kpi-status-open .dash-kpi-card-icon {
  --kpi-rgb: 59, 130, 246;
}

.dash-kpi-status-progress .dash-kpi-card-icon {
  --kpi-rgb: 245, 158, 11;
}

.dash-kpi-status-waiting .dash-kpi-card-icon {
  --kpi-rgb: 139, 92, 246;
}

.dash-kpi-status-done .dash-kpi-card-icon {
  --kpi-rgb: 16, 185, 129;
}

.dash-kpi-status-warning .dash-kpi-card-icon {
  --kpi-rgb: 234, 179, 8;
}

.dash-kpi-status-time .dash-kpi-card-icon {
  --kpi-rgb: 6, 182, 212;
}

.dash-kpi-card-icon i {
  font-size: 1.75rem;
  color: var(--kpi-accent-color);
}

.dash-kpi-card-content {
  flex: 1;
}

.dash-kpi-card-value {
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.dash-kpi-card-label {
  font-size: 0.8125rem;
  color: #64748b;
  font-weight: 600;
}

.dash-kpi-card-indicator {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(var(--kpi-rgb), 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-kpi-card-indicator i {
  font-size: 1.5rem;
  color: var(--kpi-accent-color);
}

/* ========== Cards de Gráficos ========== */
.dash-charts-main-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dash-charts-trend-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dash-charts-analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dash-charts-advanced-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dash-chart-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 2px solid rgba(0, 0, 0, 0.03);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.dash-chart-card:hover {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.2);
}

.dash-chart-card-featured {
  border: 2px solid rgba(59, 130, 246, 0.15);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.12);
}

.dash-chart-card-wide {
  grid-column: span 2;
}

.dash-chart-card-large {
  grid-column: span 2;
}

.dash-chart-header {
  background: linear-gradient(135deg, #f8fafc 0%, white 100%);
  padding: 1.25rem 1.5rem;
  border-bottom: 2px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dash-chart-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
  color: #0f172a;
}

.dash-chart-title i {
  font-size: 1.25rem;
  color: #14b8a6;
}

.dash-chart-badge {
  padding: 0.375rem 0.875rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dash-chart-badge-blue {
  background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 100%);
  color: #115e59;
}

.dash-chart-badge-purple {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  color: #6d28d9;
}

.dash-chart-badge-orange {
  background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
  color: #9a3412;
}

.dash-chart-badge-yellow {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
}

.dash-chart-badge-teal {
  background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 100%);
  color: #115e59;
}

.dash-chart-badge-indigo {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #3730a3;
}

.dash-chart-badge-red {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
}

.dash-chart-badge-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.dash-chart-actions {
  display: flex;
  gap: 0.5rem;
}

.dash-chart-action-btn {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #64748b;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.25s;
}

.dash-chart-action-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.dash-chart-action-btn.active {
  background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
  border-color: #14b8a6;
  color: white;
}

.dash-chart-body {
  padding: 1.5rem;
  min-height: 250px;
}

.dash-chart-body-large {
  min-height: 300px;
}

.dash-chart-body-xlarge {
  min-height: 350px;
}

.dash-chart-footer {
  background: #f8fafc;
  padding: 1rem 1.5rem;
  border-top: 1px solid #f1f5f9;
}

.dash-chart-legend-compact {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.dash-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.dash-chart-insight {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: #64748b;
}

.dash-chart-insight i {
  font-size: 1.1rem;
  color: #f59e0b;
}

/* ========== Análise Executiva (Matriz + Riscos) ========== */
.dash-executive-analysis-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dash-matrix-card,
.dash-risk-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 2px solid rgba(0, 0, 0, 0.03);
  overflow: hidden;
  transition: all 0.3s;
}

.dash-matrix-card:hover,
.dash-risk-card:hover {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  transform: translateY(-4px);
}

.dash-matrix-header,
.dash-risk-header {
  background: linear-gradient(135deg, #f8fafc 0%, white 100%);
  padding: 1.25rem 1.5rem;
  border-bottom: 2px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dash-matrix-title,
.dash-risk-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
  color: #0f172a;
}

.dash-matrix-title i,
.dash-risk-title i {
  font-size: 1.25rem;
  color: #14b8a6;
}

.dash-matrix-badge,
.dash-risk-badge {
  padding: 0.375rem 0.875rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
}

.dash-risk-badge {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
}

.dash-matrix-body,
.dash-risk-body {
  padding: 1.5rem;
}

.dash-risk-subtitle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #64748b;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #f1f5f9;
}

.dash-risk-subtitle i {
  color: #14b8a6;
  font-size: 1rem;
}

.dash-risk-table-wrapper {
  overflow-x: auto;
}

.dash-risk-table {
  width: 100%;
  border-collapse: collapse;
}

.dash-risk-table thead {
  background: #f8fafc;
}

.dash-risk-table th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #e2e8f0;
}

.dash-risk-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: all 0.2s;
  cursor: pointer;
}

.dash-risk-table tbody tr:hover {
  background: #f8fafc;
}

.dash-risk-table td {
  padding: 1rem;
  font-size: 0.875rem;
  color: #334155;
}

.dash-matrix-table {
  overflow-x: auto;
}

.dash-matrix-table table {
  width: 100%;
  border-collapse: collapse;
}

.dash-matrix-table th,
.dash-matrix-table td {
  padding: 0.875rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  border: 1px solid #e2e8f0;
}

.dash-matrix-table th {
  background: #f8fafc;
  font-weight: 700;
  color: #0f172a;
}

.dash-matrix-table .cell {
  font-weight: 700;
  border-radius: 8px;
  transition: all 0.2s;
  cursor: pointer;
}

.dash-matrix-table .cell:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* ========== Insights Executivos ========== */
.dash-insights-executive-card {
  background: linear-gradient(135deg, #fafafa 0%, white 100%);
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  border: 2px solid rgba(59, 130, 246, 0.1);
  overflow: hidden;
  margin-bottom: 2rem;
}

.dash-insights-executive-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.dash-insights-executive-header::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle,
    rgba(59, 130, 246, 0.15) 0%,
    transparent 70%
  );
  border-radius: 50%;
}

.dash-insights-executive-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  position: relative;
  z-index: 1;
}

.dash-insights-executive-title i {
  font-size: 2rem;
  color: #fbbf24;
  filter: drop-shadow(0 0 15px rgba(251, 191, 36, 0.5));
}

.dash-insights-executive-actions {
  display: flex;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}

.btn-dash-insight-primary,
.btn-dash-insight-secondary {
  padding: 0.875rem 1.75rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-dash-insight-primary {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #78350f;
  box-shadow: 0 8px 25px rgba(251, 191, 36, 0.3);
}

.btn-dash-insight-primary:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 12px 35px rgba(251, 191, 36, 0.4);
  transform: translateY(-2px);
}

.btn-dash-insight-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.btn-dash-insight-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.dash-insights-executive-body {
  padding: 2rem;
}

.dash-insights-executive-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.dash-insights-auto-section,
.dash-insights-elia-section {
  background: white;
  border-radius: 16px;
  padding: 1.75rem;
  border: 2px solid #f1f5f9;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  transition: all 0.3s;
}

.dash-insights-auto-section:hover,
.dash-insights-elia-section:hover {
  border-color: #14b8a6;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.dash-insights-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f1f5f9;
}

.dash-insights-section-header i {
  font-size: 1.5rem;
}

.dash-insights-auto-section .dash-insights-section-header i {
  color: #14b8a6;
}

.dash-insights-elia-section .dash-insights-section-header i {
  color: #8b5cf6;
}

.dash-insights-section-header span:first-of-type {
  font-weight: 700;
  font-size: 1.05rem;
  color: #0f172a;
  flex: 1;
}

.dash-insights-badge {
  padding: 0.35rem 0.875rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dash-insights-badge-auto {
  background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 100%);
  color: #115e59;
}

.dash-insights-badge-elia {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  color: #6d28d9;
}

.dash-insights-content {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: #334155;
}

.dash-insights-elia-content {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.dash-insights-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #94a3b8;
  padding: 1.5rem;
  justify-content: center;
}

.dash-insights-loading i {
  font-size: 1.5rem;
  animation: spin 2s linear infinite;
}

/* ===== ELIA DBA: AUDITORIA DE REQUISIÇÕES ===== */
.elia-dba-audit-panel {
  animation: fadeIn 0.3s ease-in;
}

.elia-dba-audit-panel .card-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.elia-dba-audit-panel .table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
}

.elia-dba-audit-panel .table tbody tr {
  transition: background-color 0.2s ease;
}

.elia-dba-audit-panel .table tbody tr:hover {
  background-color: #f8f9fa;
  cursor: pointer;
}

.elia-dba-audit-panel #elia-dba-stats-cards .card {
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.elia-dba-audit-panel #elia-dba-stats-cards .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.spin {
  animation: spin 1s linear infinite;
  display: inline-block;
}

/* ==================================================
   TRANSIÇÕES E MICROINTERAÇÕES (Performance & UX)
   ================================================== */

/* Transições suaves em botões */
.btn {
  transition: all var(--ed-transition-fast);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--ed-shadow-sm);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--ed-shadow-xs);
}

.btn:focus-visible {
  outline: 2px solid var(--ed-primary);
  outline-offset: 2px;
}

/* Transições em cards */
.card {
  transition:
    box-shadow var(--ed-transition-base),
    transform var(--ed-transition-fast);
}

.card:hover {
  box-shadow: var(--ed-shadow-md);
}

/* Transições em abas */
.nav-link {
  transition: all var(--ed-transition-fast);
}

.nav-link:hover:not(.active) {
  background-color: var(--ed-gray-100);
}

.nav-link.active {
  transition: all var(--ed-transition-base);
}

/* Transições em inputs */
.form-control,
.form-select {
  transition:
    border-color var(--ed-transition-fast),
    box-shadow var(--ed-transition-fast);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--ed-primary);
  box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.15);
}

/* Transições em tabelas */
.table-hover tbody tr {
  transition: background-color var(--ed-transition-fast);
}

/* Transições em modais */
.modal {
  transition: opacity var(--ed-transition-base);
}

.modal.fade .modal-dialog {
  transition: transform var(--ed-transition-smooth);
}

/* Respeita preferência de movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.dash-insights-placeholder {
  text-align: center;
  padding: 2rem 1rem;
  color: #94a3b8;
}

.dash-insights-placeholder i {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
  color: #cbd5e1;
}

.dash-insights-placeholder p {
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0;
}

.dash-insights-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.75rem;
  background: #f8fafc;
  border-radius: 12px;
  font-size: 0.8125rem;
  color: #64748b;
  border: 1px solid #f1f5f9;
}

.dash-insights-footer i {
  color: #10b981;
  font-size: 1.1rem;
}

/* ========== Responsivo ========== */
@media (max-width: 1400px) {
  .dash-charts-trend-grid {
    grid-template-columns: 1fr;
  }

  .dash-charts-advanced-grid {
    grid-template-columns: 1fr;
  }

  .dash-executive-analysis-grid {
    grid-template-columns: 1fr;
  }

  .dash-insights-executive-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  .dash-kpi-hero-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .dash-charts-analysis-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dash-executive-header {
    padding: 1.5rem;
  }

  .dash-executive-header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .dash-executive-title {
    font-size: 1.5rem;
  }

  .dash-executive-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .dash-filter-compact,
  .form-control-compact,
  .form-select-compact {
    width: 100%;
  }

  .dash-kpi-hero-grid {
    grid-template-columns: 1fr;
  }

  .dash-kpi-hero {
    flex-direction: column;
    text-align: center;
  }

  .dash-kpi-hero-icon {
    margin: 0 auto;
  }

  .dash-kpi-secondary-grid {
    grid-template-columns: 1fr;
  }

  .dash-charts-main-grid {
    grid-template-columns: 1fr;
  }

  .dash-chart-card-wide,
  .dash-chart-card-large {
    grid-column: span 1;
  }

  .dash-insights-executive-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .dash-executive-actions,
  .dash-insights-executive-actions {
    flex-direction: column;
    width: 100%;
  }

  .btn-dash-executive,
  .btn-dash-insight-primary,
  .btn-dash-insight-secondary {
    width: 100%;
    justify-content: center;
  }
}

/* ========== Animações ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dash-kpi-hero,
.dash-kpi-card,
.dash-chart-card {
  animation: fadeInUp 0.6s ease-out;
}

.dash-kpi-hero:nth-child(1) {
  animation-delay: 0.1s;
}

.dash-kpi-hero:nth-child(2) {
  animation-delay: 0.2s;
}

.dash-kpi-hero:nth-child(3) {
  animation-delay: 0.3s;
}

.dash-kpi-hero:nth-child(4) {
  animation-delay: 0.4s;
}

/* ========== Scrollbar personalizada ========== */
.dash-insights-elia-content::-webkit-scrollbar {
  width: 8px;
}

.dash-insights-elia-content::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}

.dash-insights-elia-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.dash-insights-elia-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ELIA: markdown-lite */
.elia-bubble code,
#elia-radar-out code,
#elia-energia-out code {
  background: rgba(0, 0, 0, 0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
}

.elia-bubble pre,
#elia-radar-out pre,
#elia-energia-out pre {
  background: rgba(0, 0, 0, 0.06);
  padding: 0.75rem;
  border-radius: 0.5rem;
  overflow: auto;
  margin: 0.5rem 0;
}

#view-notas .form-select,
#view-notas #notes-filter-pinned {
  min-height: 40px;
}

/* ============================================================================
   LISTA DE TICKETS - FILTROS COLAPSÁVEIS
   ============================================================================ */

/* Animação suave para o collapse dos filtros */
.filtros-collapse {
  animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: top;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Estilo para o botão de toggle filtros */
#btn-toggle-filtros {
  font-weight: 600;
  transition: all 0.3s;
  position: relative;
}

#btn-toggle-filtros i {
  transition: transform 0.3s;
}

#btn-toggle-filtros.active {
  background: var(--ed-primary);
  color: white;
  border-color: var(--ed-primary);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
}

#btn-toggle-filtros.active i {
  transform: rotate(180deg);
}

/* Badge indicador de filtros ativos */
#btn-toggle-filtros::after {
  content: attr(data-count);
  position: absolute;
  top: -6px;
  right: -6px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.4rem;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  display: none;
}

#btn-toggle-filtros.has-filters::after {
  display: block;
}

/* Botão fechar filtros */
#btn-fechar-filtros {
  padding: 0.25rem 0.5rem;
  text-decoration: none;
  transition: all 0.2s;
}

#btn-fechar-filtros:hover {
  transform: scale(1.2);
  color: #dc2626 !important;
}

/* Card de filtros com destaque */
#card-filtros-lista {
  border: 2px solid var(--ed-primary-light);
  box-shadow: 0 8px 30px rgba(15, 118, 110, 0.15);
}

#card-filtros-lista .card-header {
  background: linear-gradient(135deg, #ecfeff 0%, #ccfbf1 100%);
  border-bottom: 2px solid var(--ed-primary-light);
}

/* ========== NOTAS: filtros mais “altos” e sem truncar ========== */
#view-notas .row.notes-filters-row .form-select,
#view-notas .row.notes-filters-row .btn {
  min-height: 42px;
}

#view-notas .row.notes-filters-row .form-select {
  min-width: 190px;
}

#view-notas #notes-filter-status {
  min-width: 170px;
}

#view-notas .row.notes-filters-row .small {
  white-space: nowrap;
}

/* ========== ELIA: garante scroll em colunas flex (painel direito) ========== */
.elia-container .row.g-0 {
  min-height: 0;
}

.elia-sidebar,
.elia-main,
.elia-rightpanel {
  min-height: 0;
}

.elia-sidebar-body,
.elia-chat-body,
.elia-right-inner {
  min-height: 0;
}

/* ========== ELIA V2 (REFATORADA) ========== */
/* Layout app-like: sem scroll da página, apenas áreas internas rolam */
#view-elia:not(.d-none) {
  display: flex !important;
  flex-direction: column;
  height: calc(100vh - var(--elia-top, var(--header-h, 160px)));
  max-height: none;
  min-height: 0;
  overflow: hidden;
  margin-top: 0;
  padding-top: 0;
}

#view-elia,
#view-notas,
#view-noticias,
#view-unielite {
  width: 100%;
  overflow-x: hidden;
  min-width: 0;
}

/* ========== Page Shell (padrão visual das views) ========== */
.ed-page {
  background: var(--ed-white);
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius-lg);
  box-shadow: var(--ed-shadow-xs);
  padding: 1rem;
  margin-bottom: 1rem;
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 576px) {
  .ed-page {
    padding: 0.75rem;
  }
}

.ed-page > * {
  min-width: 0;
}

/* ========== Frame padrão de views (container centralizado) ========== */
.ed-view-container {
  width: 100%;
  margin-inline: auto;
  padding-inline: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
  min-width: 0;
}

/* Espelha os breakpoints do .container do Bootstrap */
@media (min-width: 576px) {
  .ed-view-container {
    max-width: 540px;
  }
}

@media (min-width: 768px) {
  .ed-view-container {
    max-width: 720px;
  }
}

@media (min-width: 992px) {
  .ed-view-container {
    max-width: 960px;
  }
}

@media (min-width: 1200px) {
  .ed-view-container {
    max-width: 1140px;
  }
}

@media (min-width: 1400px) {
  .ed-view-container {
    max-width: 1320px;
  }
}

/* Se já estivermos dentro de um .container do Bootstrap, evita "container duplo" */
.container .ed-view-container {
  max-width: 100%;
  padding-inline: 0;
}

.ed-view-container--fill {
  flex: 1;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.ed-view-container--fill > * {
  min-height: 0;
}

#view-elia .ed-view-container--fill .elia-container-v2 {
  flex: 1;
}

.elia-container-v2 {
  height: 100%;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  border-radius: 20px;
  box-shadow: var(--ed-shadow-md);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.elia-container-v2 > .row {
  height: 100%;
  margin: 0;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.elia-main-v2,
.elia-sidebar-v2,
.elia-chat-body-v2,
.elia-sidebar-body-v2,
.elia-sessions-list-v2,
.elia-messages-v2 {
  min-height: 0;
}

.elia-sidebar-v2 {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  min-height: 0;
  border-top-left-radius: 20px;
  border-bottom-left-radius: 20px;
}

.elia-sidebar-header-v2 {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid #e0e0e0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top-left-radius: 20px;
}

.elia-sidebar-header-v2 h5 {
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0;
}

.elia-sidebar-search-v2 {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e0e0e0;
  background: rgba(248, 250, 252, 0.85);
}

.elia-sidebar-search-v2 .input-group {
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.elia-sidebar-search-v2 .input-group > * {
  border: 0 !important;
}

.elia-sidebar-search-v2 .input-group-text {
  background: transparent;
  color: #64748b;
}

.elia-sidebar-search-v2 .form-control::placeholder {
  color: #94a3b8;
}

.elia-sidebar-body-v2 {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.elia-sidebar-footer-v2 {
  padding: 0.75rem 1rem;
  border-top: 1px solid #e0e0e0;
  background: #fafafa;
}

.elia-sessions-list-v2 {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.elia-session-item-v2 {
  padding: 0.75rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
  border: 1px solid #e0e0e0;
  position: relative;
}

.elia-session-item-v2:hover {
  background: #f8f9fa;
  border-color: #667eea;
  transform: translateX(2px);
}

.elia-session-item-v2:active {
  transform: translateX(1px);
}

.elia-session-item-v2.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.22);
}

.elia-session-item-v2 .session-title {
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.elia-session-item-v2 .session-date {
  font-size: 0.75rem;
  opacity: 0.7;
}

.elia-session-item-v2.active .session-title,
.elia-session-item-v2.active .session-date {
  color: white;
}

.elia-empty-state-v2 {
  text-align: center;
  padding: 2rem 1rem;
  color: #6c757d;
}

.elia-empty-state-v2 i {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.elia-main-v2 {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  min-height: 0;
  border-top-right-radius: 20px;
  border-bottom-right-radius: 20px;
}

.elia-chat-header-v2 {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  background: white;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  border-top-right-radius: 20px;
}

.elia-chat-header-v2 h6 {
  font-weight: 600;
  color: #2c3e50;
  font-size: 1rem;
  margin: 0;
}

.elia-chat-header-v2 small {
  font-size: 0.8rem;
}

.elia-chat-header-v2 .btn,
.elia-sidebar-search-v2 .btn,
.elia-sidebar-footer-v2 .btn {
  border-radius: 12px;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

.elia-chat-header-v2 .btn:hover,
.elia-sidebar-search-v2 .btn:hover,
.elia-sidebar-footer-v2 .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.1);
}

.elia-chat-header-v2 .btn:active,
.elia-sidebar-search-v2 .btn:active,
.elia-sidebar-footer-v2 .btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.elia-chat-body-v2 {
  flex: 1;
  /* Scroll fica no container de mensagens (não no body) */
  overflow: hidden;
  padding: 1.25rem;
  background: transparent;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.elia-welcome-v2 {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem;
}

.elia-messages-v2 {
  /* ✅ scroll interno do chat */
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 4px;
}

.elia-logo-big-v2 {
  font-size: 5rem;
  color: #667eea;
  animation: float 3s ease-in-out infinite;
}

.elia-suggestions-v2 {
  max-width: 800px;
  margin: 0 auto;
}

.elia-suggestion-card-v2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 14px;
  text-align: left;
  transition: all 0.3s ease;
  width: 100%;
  cursor: pointer;
}

.elia-suggestion-card-v2:hover {
  border-color: #667eea;
  background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.elia-suggestion-card-v2:active {
  transform: translateY(-1px);
}

.elia-suggestion-card-v2:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.18);
}

.elia-suggestion-card-v2 i {
  font-size: 1.5rem;
  min-width: 30px;
}

.elia-suggestion-card-v2 strong {
  display: block;
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.95rem;
}

.elia-suggestion-card-v2 small {
  display: block;
  color: #6c757d;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.elia-messages-v2 {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.elia-message-v2 {
  display: flex;
  gap: 0.75rem;
  animation: messageSlideIn 0.3s ease-out;
}

.elia-message-v2.user {
  flex-direction: row-reverse;
}

.elia-message-avatar-v2 {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.elia-message-v2.assistant .elia-message-avatar-v2 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.elia-message-v2.user .elia-message-avatar-v2 {
  background: #34495e;
  color: white;
}

.elia-message-content-v2 {
  max-width: 70%;
  background: white;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
}

.elia-message-v2.assistant .elia-message-content-v2 {
  border: 2px solid #e0e0e0;
  background: white;
}

.elia-message-v2.user .elia-message-content-v2 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.elia-message-text-v2 {
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.elia-message-v2.user .elia-message-text-v2 {
  color: white;
}

.elia-message-time-v2 {
  font-size: 0.7rem;
  opacity: 0.6;
  margin-top: 0.5rem;
  text-align: right;
}

.elia-message-loading-v2 {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.elia-message-loading-v2 .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #667eea;
  animation: loadingDot 1.4s infinite;
}

.elia-chat-footer-v2 {
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  background: white;
  padding: 1rem 1.5rem;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
  border-bottom-right-radius: 20px;
}

.elia-attachments-v2 {
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.elia-attachment-chips-v2 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.elia-attachment-chip-v2 {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 9999px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  font-size: 0.85rem;
}

.elia-attachment-chip-v2 .name {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.elia-attachment-chip-v2 .thumb {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.elia-attachment-chip-v2 button {
  border: 0;
  background: transparent;
  color: #ef4444;
  font-weight: 700;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 9999px;
}

.elia-attachment-chip-v2 button:hover {
  background: rgba(239, 68, 68, 0.1);
}

.elia-attach-btn-v2 {
  background: #ffffff;
  color: #334155;
  border: 1px solid rgba(15, 23, 42, 0.12);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.elia-attach-btn-v2:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.1);
}

.elia-attach-btn-v2:active {
  transform: translateY(0);
  box-shadow: none;
}

.elia-input-container-v2 {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 24px;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.elia-input-container-v2:focus-within {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.elia-send-btn-v2 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.elia-send-btn-v2:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.elia-send-btn-v2:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.elia-message-input-v2 {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 0.5rem;
  max-height: 150px;
  min-height: 24px;
  font-family: inherit;
}

.elia-input-disabled {
  background: #f5f7fb;
  color: #6b7280;
}

.elia-input-footer-v2 {
  margin-top: 0.5rem;
  text-align: center;
}

.elia-input-footer-v2 small {
  font-size: 0.75rem;
}

.elia-sidebar-body-v2::-webkit-scrollbar,
.elia-chat-body-v2::-webkit-scrollbar {
  width: 6px;
}

.elia-sidebar-body-v2::-webkit-scrollbar-track,
.elia-chat-body-v2::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.elia-sidebar-body-v2::-webkit-scrollbar-thumb,
.elia-chat-body-v2::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

.elia-sidebar-body-v2::-webkit-scrollbar-thumb:hover,
.elia-chat-body-v2::-webkit-scrollbar-thumb:hover {
  background: #555;
}

@media (max-width: 991px) {
  body.elia-mode .elia-sidebar-v2 {
    position: fixed;
    left: -100%;
    top: var(--elia-top, var(--header-h, 160px));
    width: 80%;
    max-width: 320px;
    height: calc(100vh - var(--elia-top, var(--header-h, 160px)));
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }

  body.elia-mode .elia-sidebar-v2.show {
    left: 0;
  }

  .elia-message-content-v2 {
    max-width: 85%;
  }
}

/* Energia do Dia / Radar: quando vier texto grande, rola dentro do card */
#elia-energia-out,
#elia-radar-out {
  max-height: 320px;
  overflow-y: auto;
}

@keyframes eaBellPulse {
  0% {
    transform: translateY(0) scale(1);
  }

  35% {
    transform: translateY(-2px) scale(1.08);
  }

  70% {
    transform: translateY(0) scale(1);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

.ea-bell-btn.ea-pulse {
  animation: eaBellPulse 700ms ease-out 1;
}

/* ===== Header: usuário (Nome em destaque) ===== */
.ea-user-name {
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1.1;
}

.ea-user-role {
  opacity: 0.85;
  font-size: 0.78rem;
  line-height: 1.1;
  margin-top: 2px;
}

/* ABERTURA v2 */
.abertura-hero {
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.08) 0%,
    rgba(15, 118, 110, 0.03) 50%,
    #ffffff 100%
  );
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(15, 118, 110, 0.06);
}

.abertura-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    var(--ed-primary) 0%,
    var(--ed-primary-dark) 100%
  );
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.abertura-hero-icon:hover {
  transform: scale(1.05);
}

.abertura-hero-icon i {
  font-size: 1.5rem;
}

.abertura-req {
  color: #dc2626;
  font-weight: 900;
  font-size: 1.1em;
  margin-left: 2px;
}

.abertura-legend {
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.05) 0%,
    rgba(255, 255, 255, 0.95) 100%
  );
  border: 1px solid rgba(15, 118, 110, 0.15);
  border-left: 3px solid var(--ed-primary);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 4px rgba(15, 118, 110, 0.08);
}

.abertura-legend i {
  color: var(--ed-primary);
  font-size: 1.1rem;
}

.abertura-progress {
  background: rgba(15, 118, 110, 0.08);
  border-radius: var(--ed-radius-full);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.abertura-progress .progress-bar {
  background: linear-gradient(
    90deg,
    var(--ed-primary) 0%,
    var(--ed-primary-dark) 100%
  );
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.3);
  transition: width 0.4s ease;
}

.abertura-stepper {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.abertura-step {
  border: 2px solid rgba(15, 118, 110, 0.2);
  background: #fff;
  border-radius: 12px;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ed-gray-700);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.abertura-step:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.15);
  border-color: rgba(15, 118, 110, 0.4);
}

.abertura-step:focus {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.abertura-step .abertura-step-dot {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 118, 110, 0.1);
  color: var(--ed-primary-dark);
  font-size: 0.8rem;
  font-weight: 900;
  transition: all 0.2s ease;
}

.abertura-step.active {
  background: linear-gradient(
    135deg,
    var(--ed-primary) 0%,
    var(--ed-primary-dark) 100%
  );
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 16px rgba(15, 118, 110, 0.3);
}

.abertura-step.active .abertura-step-dot {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  transform: scale(1.1);
}

.abertura-accordion .accordion-button {
  gap: 0.85rem;
  padding: 1.1rem 1.25rem;
  font-weight: 600;
  border-radius: 12px !important;
  transition: all 0.2s ease;
}

.abertura-accordion .accordion-button:not(.collapsed) {
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.08) 0%,
    rgba(255, 255, 255, 0.95) 100%
  );
  border-bottom: 2px solid rgba(15, 118, 110, 0.2);
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.08);
}

.abertura-accordion .accordion-button:hover {
  background: rgba(15, 118, 110, 0.04);
}

.abertura-accordion .accordion-item {
  border: 1px solid rgba(15, 118, 110, 0.1);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.abertura-accordion .accordion-item:last-child {
  margin-bottom: 0;
}

.abertura-acc-step {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.15) 0%,
    rgba(15, 118, 110, 0.08) 100%
  );
  color: var(--ed-primary-dark);
  font-weight: 900;
  font-size: 0.9rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.15);
  transition: all 0.2s ease;
}

.abertura-accordion .accordion-button:not(.collapsed) .abertura-acc-step {
  background: linear-gradient(
    135deg,
    var(--ed-primary) 0%,
    var(--ed-primary-dark) 100%
  );
  color: #fff;
  box-shadow: 0 3px 10px rgba(15, 118, 110, 0.3);
  transform: scale(1.05);
}

.abertura-acc-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ed-gray-900);
}

.abertura-acc-sub {
  font-size: 0.85rem;
  margin-top: 2px;
}

.abertura-accordion .accordion-body {
  padding: 1.5rem 1.25rem;
  background: #fff;
}

/* Melhorias nos botões de ação */
#view-abertura .btn-primary {
  background: linear-gradient(
    135deg,
    var(--ed-primary) 0%,
    var(--ed-primary-dark) 100%
  );
  border: none;
  border-radius: 10px;
  padding: 0.65rem 1.5rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
  transition: all 0.2s ease;
}

#view-abertura .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.35);
}

#view-abertura .btn-outline-primary {
  border: 2px solid var(--ed-primary);
  border-radius: 10px;
  padding: 0.5rem 1.25rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

#view-abertura .btn-outline-primary:hover {
  background: var(--ed-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.2);
}

/* Badge de status melhorado */
.abertura-status-badge {
  font-weight: 700;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  border-radius: 20px;
}

/* Melhorias nos labels e campos do formulário */
#view-abertura .form-label {
  font-weight: 600;
  color: var(--ed-gray-800);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

#view-abertura .form-label .badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  font-weight: 700;
  margin-left: 0.5rem;
}

#view-abertura .form-control,
#view-abertura .form-select {
  border: 1.5px solid rgba(15, 118, 110, 0.15);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  transition: all 0.2s ease;
}

#view-abertura .form-control:focus,
#view-abertura .form-select:focus {
  border-color: var(--ed-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
  outline: none;
}

#view-abertura .abertura-multi-select {
  position: relative;
}

#view-abertura .abertura-multi-select-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background-image: none;
  padding-right: 2rem;
}

#view-abertura .abertura-multi-select-trigger::after {
  content: "";
  position: absolute;
  right: 0.9rem;
  width: 0.65rem;
  height: 0.65rem;
  border-right: 2px solid rgba(100, 116, 139, 0.9);
  border-bottom: 2px solid rgba(100, 116, 139, 0.9);
  transform: rotate(45deg) translateY(-1px);
  pointer-events: none;
}

#view-abertura
  .abertura-multi-select.is-open
  .abertura-multi-select-trigger::after {
  transform: rotate(-135deg) translateY(-1px);
}

#view-abertura .abertura-multi-select.is-open .abertura-multi-select-trigger {
  border-color: var(--ed-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

#view-abertura .abertura-multi-select-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: #ffffff;
  border: 1.5px solid rgba(15, 118, 110, 0.2);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.12);
  z-index: 1060;
  padding: 0.35rem;
}

#view-abertura .abertura-multi-select-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.35;
  color: #334155;
  cursor: pointer;
}

#view-abertura .abertura-multi-select-option:hover {
  background: rgba(15, 118, 110, 0.08);
}

#view-abertura .abertura-multi-select-option .form-check-input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

#view-abertura .abertura-multi-select-empty {
  padding: 0.65rem 0.5rem;
  font-size: 0.8125rem;
  color: #64748b;
}

#view-abertura .form-text {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.25rem;
  line-height: 1.4;
}

#view-abertura .form-text.small {
  font-size: 0.7rem;
}

#view-abertura .invalid-feedback {
  font-size: 0.75rem;
  font-weight: 500;
}

/* Labels mais limpos */
#view-abertura .form-label.fw-medium {
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  margin-bottom: 0.5rem;
  text-transform: none;
  letter-spacing: normal;
}

/* Melhor espaçamento no accordion body */
#view-abertura .accordion-body {
  padding: 1.5rem 1.5rem;
}

/* Legenda mais discreta */
.abertura-legend {
  padding: 0.75rem 1rem;
  background: rgba(248, 250, 252, 0.6);
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

/* ============================
   FORMULÁRIO DE ABERTURA - Melhorias
   ============================ */

/* Labels mais limpos e respirados */
#view-abertura .form-label.fw-medium {
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  margin-bottom: 0.5rem;
  text-transform: none;
  letter-spacing: normal;
}

/* Textos de ajuda menores e mais discretos */
#view-abertura .form-text {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.25rem;
  line-height: 1.4;
}

#view-abertura .form-text.small {
  font-size: 0.7rem;
}

/* Espaçamento melhorado entre campos */
#view-abertura .accordion-body {
  padding: 1.5rem 1.5rem;
}

/* Legenda inicial mais discreta */
.abertura-legend {
  padding: 0.75rem 1rem;
  background: rgba(248, 250, 252, 0.6);
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

/* ELIA mais discreta */
.abertura-elia {
  background: rgba(248, 250, 252, 0.5);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-left: 2px solid rgba(255, 193, 7, 0.3);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: none;
}

.abertura-elia:hover {
  background: rgba(248, 250, 252, 0.8);
  border-color: rgba(226, 232, 240, 1);
}

.abertura-anexos-card {
  background: linear-gradient(
    135deg,
    rgba(108, 117, 125, 0.05) 0%,
    rgba(255, 255, 255, 0.95) 100%
  );
  border: 1px solid rgba(108, 117, 125, 0.15);
  border-left: 3px solid #6c757d;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.abertura-file-summary {
  padding: 0.35rem 0.5rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--ed-border);
}

.abertura-file-item {
  padding: 0.4rem 0.5rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--ed-border);
}

.abertura-file-item + .abertura-file-item {
  margin-top: 0.35rem;
}

/* ============================
   PRÉ-VISUALIZAÇÃO - Card Limpo e Minimalista
   ============================ */
.abertura-card-preview {
  border: 1px solid rgba(226, 232, 240, 0.6);
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.abertura-card-preview:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  border-color: rgba(203, 213, 225, 0.8);
}

.abertura-card-preview .card-header {
  background: #f8fafc;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: #475569;
}

/* Evita sobreposição do badge (ex.: "Quase lá") no título do header do preview */
.abertura-card-preview .card-header > .d-flex {
  width: 100%;
  flex-wrap: wrap;
  gap: 0.5rem;
  row-gap: 0.6rem;
  align-items: flex-start;
}

.abertura-card-preview .card-header > .d-flex > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
  padding-right: 0.5rem;
}

.abertura-card-preview .card-header > .d-flex > div:last-child {
  flex: 0 1 auto;
  margin-left: 0.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  row-gap: 0.35rem;
  column-gap: 0.5rem;
}

@media (max-width: 420px) {
  .abertura-card-preview .card-header > .d-flex > div:last-child {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }
}

.preview-header-icon {
  font-size: 0.95rem;
  color: #64748b;
  opacity: 0.75;
}

.preview-badge-live {
  background: #f1f5f9 !important;
  color: #64748b !important;
  border: 1px solid rgba(226, 232, 240, 0.6) !important;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.abertura-card-preview .card-body {
  padding: 1rem;
  background: #ffffff;
}

/* Título */
.preview-titulo-wrapper {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
  margin-bottom: 0.75rem;
}

#preview-titulo {
  font-size: 1.05rem;
  line-height: 1.4;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
  padding-left: 0.5rem;
  border-left: 2px solid rgba(15, 118, 110, 0.25);
}

/* Badges simplificados */
.abertura-preview-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.preview-badge {
  white-space: nowrap;
  font-size: 0.7rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid rgba(226, 232, 240, 0.6);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.preview-badge i {
  font-size: 0.65rem;
  color: #94a3b8;
  opacity: 0.7;
}

/* Badges simplificados */
.preview-badge-empresa,
.preview-badge-setor,
.preview-badge-categoria,
.preview-badge-natureza,
.preview-badge-canal,
.preview-badge-transportadora {
  background: #ffffff;
  border-color: rgba(226, 232, 240, 0.6);
  color: #64748b;
}

.preview-badge-empresa:hover,
.preview-badge-setor:hover,
.preview-badge-categoria:hover,
.preview-badge-natureza:hover,
.preview-badge-canal:hover,
.preview-badge-transportadora:hover {
  background: #f8fafc;
  border-color: rgba(203, 213, 225, 0.8);
}

/* Badge vazio - ocultar quando vazio */
.preview-badge-empty {
  display: none;
}

/* Prazos simplificados */
.preview-prazos {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.preview-prazo-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid rgba(226, 232, 240, 0.5);
  transition: all 0.2s ease;
}

.preview-prazo-item:hover {
  background: #f1f5f9;
  border-color: rgba(203, 213, 225, 0.7);
}

/* Ocultar prazo quando vazio */
.preview-prazo-empty {
  display: none;
}

.preview-prazo-icon {
  font-size: 0.85rem;
  padding: 0.25rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.preview-prazo-icon-ideal {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.preview-prazo-icon-limite {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.preview-prazo-content {
  flex: 1;
  min-width: 0;
}

.preview-prazo-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 0.15rem;
}

.preview-prazo-value {
  font-size: 0.7rem;
  font-weight: 600;
  color: #334155;
}

/* Descrição simplificada */
.abertura-preview-descricao {
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.5);
  border-radius: 6px;
  padding: 0.75rem;
  min-height: 80px;
  max-height: 150px;
  overflow: auto;
  transition: all 0.2s ease;
}

.abertura-preview-descricao:hover {
  border-color: rgba(203, 213, 225, 0.7);
  background: #ffffff;
}

/* Ocultar descrição quando vazia */
.abertura-preview-descricao-empty {
  display: none;
}

.preview-section-header {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.preview-section-header i {
  font-size: 0.7rem;
  color: #94a3b8;
  opacity: 0.7;
  margin-right: 0.4rem;
}

#preview-descricao {
  white-space: pre-wrap;
  line-height: 1.5;
  color: #334155;
  font-size: 0.8rem;
  margin: 0;
}

/* Contato simplificado */
.preview-contato {
  margin-top: 0.5rem;
}

.preview-contato-items {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.preview-contato-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  background: #f8fafc;
  border-radius: 5px;
  border: 1px solid rgba(226, 232, 240, 0.5);
  transition: all 0.2s ease;
  font-size: 0.75rem;
}

.preview-contato-item:hover {
  background: #ffffff;
  border-color: rgba(203, 213, 225, 0.7);
}

.preview-contato-icon {
  font-size: 0.7rem;
  color: #94a3b8;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
  opacity: 0.7;
}

.preview-contato-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.preview-contato-separator {
  color: #cbd5e1;
  font-weight: 300;
  font-size: 0.7rem;
}

.preview-contato-value-empty {
  color: #cbd5e1;
  font-style: italic;
  font-weight: 400;
  font-size: 0.7rem;
}

.preview-contato-item
  span:not(.preview-contato-separator):not(.preview-contato-value-empty) {
  font-size: 0.75rem;
  color: #475569;
}

/* ============================
   CHECKLIST - Card melhorado
   ============================ */
.abertura-card-checklist {
  border: 1px solid rgba(34, 197, 94, 0.12);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(240, 253, 244, 0.3) 100%
  );
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.06),
    0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
}

.abertura-card-checklist:hover {
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.08),
    0 2px 4px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.abertura-card-checklist .card-header {
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.08) 0%,
    rgba(34, 197, 94, 0.03) 100%
  );
  border-bottom: 1px solid rgba(34, 197, 94, 0.15);
  padding: 0.625rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
}

.abertura-card-checklist .card-body {
  padding: 0.75rem 1rem;
}

#abertura-checklist {
  column-count: 2;
  column-gap: 16px;
  margin: 0;
  padding: 0.25rem 0;
}

#abertura-checklist li {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.35rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid transparent;
}

#abertura-checklist li:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(226, 232, 240, 0.8);
  transform: translateX(4px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

#abertura-checklist li i {
  font-size: 0.875rem;
  transition: all 0.2s ease;
  margin-right: 0.4rem;
  flex-shrink: 0;
}

#abertura-checklist li span {
  font-weight: 500;
  font-size: 0.8125rem;
  color: #475569;
  transition: color 0.2s ease;
}

.abertura-checklist li.is-done {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.2);
}

.abertura-checklist li.is-done span {
  color: #15803d;
  font-weight: 600;
}

.abertura-checklist li.is-done i {
  transform: scale(1);
}

.abertura-checklist li.is-warn {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
}

.abertura-checklist li.is-warn span {
  color: #92400e;
  font-weight: 600;
}

.abertura-checklist li.is-warn i {
  transform: scale(1);
}

@media (max-width: 991.98px) {
  #abertura-checklist {
    column-count: 1;
  }
}

/* Botões do checklist */
.abertura-card-checklist .card-header {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}

.abertura-card-checklist .card-body {
  padding: 0.75rem 1rem;
}

.abertura-card-checklist .card-body .btn {
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease;
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
}

.abertura-card-checklist .card-body .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

@media (min-width: 992px) {
  .abertura-sidebar-sticky {
    position: sticky;
    top: 12px;
  }
}

/* Estilos duplicados removidos - agora em seções específicas acima */

/* ============================
   RESUMO GERAL - Card melhorado
   ============================ */
#abertura-card-resumo {
  border: 1px solid rgba(139, 92, 246, 0.12);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(250, 245, 255, 0.4) 100%
  );
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.06),
    0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
}

#abertura-card-resumo:hover {
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.08),
    0 2px 4px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

#abertura-card-resumo .card-header {
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.08) 0%,
    rgba(139, 92, 246, 0.03) 100%
  );
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
  padding: 0.875rem 1.25rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

#abertura-card-resumo .card-body {
  padding: 1.5rem 1.25rem;
}

.abertura-resumo-hero {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 1rem;
  background: linear-gradient(
    135deg,
    rgba(248, 250, 252, 0.8) 0%,
    rgba(241, 245, 249, 0.6) 100%
  );
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  margin-bottom: 1.25rem;
}

.abertura-resumo-chart-wrap {
  width: 100px;
  height: 100px;
  border-radius: 16px;
  border: 2px solid rgba(139, 92, 246, 0.2);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(250, 245, 255, 0.8) 100%
  );
  padding: 10px;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.1);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.abertura-resumo-chart-wrap:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.abertura-resumo-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.abertura-resumo-hero .small {
  flex: 1;
  line-height: 1.5;
  color: #64748b;
}

.abertura-kpi-grid {
  margin-top: 0.5rem;
}

.abertura-kpi {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(248, 250, 252, 0.9) 100%
  );
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-left-width: 4px;
  padding: 1rem !important;
}

.abertura-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: currentColor;
}

.abertura-kpi-icon {
  position: absolute;
  top: 10px;
  right: 12px;
  opacity: 0.2;
  font-size: 1.3rem;
  transition: all 0.3s ease;
}

.abertura-kpi:hover .abertura-kpi-icon {
  opacity: 0.3;
  transform: scale(1.1);
}

.abertura-kpi .label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.abertura-kpi .value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.abertura-kpi-total {
  border-left-color: #14b8a6;
}

.abertura-kpi-total:hover {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.1) 0%,
    rgba(255, 255, 255, 0.9) 100%
  );
}

.abertura-kpi-open {
  border-left-color: #f59e0b;
}

.abertura-kpi-open:hover {
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.1) 0%,
    rgba(255, 255, 255, 0.9) 100%
  );
}

.abertura-kpi-progress {
  border-left-color: #06b6d4;
}

.abertura-kpi-progress:hover {
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.1) 0%,
    rgba(255, 255, 255, 0.9) 100%
  );
}

.abertura-kpi-wait {
  border-left-color: #a855f7;
}

.abertura-kpi-wait:hover {
  background: linear-gradient(
    135deg,
    rgba(168, 85, 247, 0.1) 0%,
    rgba(255, 255, 255, 0.9) 100%
  );
}

.abertura-kpi-done {
  border-left-color: #22c55e;
}

.abertura-kpi-done:hover {
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.1) 0%,
    rgba(255, 255, 255, 0.9) 100%
  );
}

.abertura-kpi-cancel {
  border-left-color: #ef4444;
}

.abertura-kpi-cancel:hover {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.1) 0%,
    rgba(255, 255, 255, 0.9) 100%
  );
}

/* 5) Sidebar mais “premium” (sem exagero) */
.abertura-sidebar .card-header {
  align-items: center;
}

.abertura-sidebar .card-header .badge {
  font-weight: 800;
}

/* ABERTURA v2.2 — Preview badges consistentes */

/* Estilos de badges movidos para seção Pré-visualização acima */

/* ============================
   PRIORIDADE — Estilos antigos removidos (agora usando design premium acima)
   ============================ */

/* Estilos de badges movidos para seção Pré-visualização acima */

/* ============================
   ABERTURA v2.3 — Suavização visual (só Abertura)
   ============================ */

/* fundo mais leve na área da Abertura */
#view-abertura {
  background: linear-gradient(
    180deg,
    rgba(15, 118, 110, 0.05) 0%,
    rgba(255, 255, 255, 0) 35%
  );
  border-radius: 16px;
}

/* card do form menos “pesado” */
#view-abertura .abertura-form-card {
  box-shadow: var(--ed-shadow-sm);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

/* accordion com menos “cara de bloco bruto” */
#view-abertura .abertura-accordion .accordion-item {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: var(--ed-shadow-xs);
}

#view-abertura .abertura-accordion .accordion-button {
  background: linear-gradient(180deg, #ffffff 0%, rgba(15, 23, 42, 0.02) 100%);
}

#view-abertura .abertura-accordion .accordion-button:not(.collapsed) {
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.08) 0%, #ffffff 85%);
}

/* legend mais “premium” */
#view-abertura .abertura-legend {
  border-style: solid;
  background: linear-gradient(180deg, #ffffff 0%, rgba(15, 118, 110, 0.03) 100%);
}

/* anexos e ELIA mais integrados (menos “caixa dura”) */
#view-abertura .abertura-elia,
#view-abertura .abertura-anexos-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--ed-shadow-xs);
}

/* sidebar cards mais "executivos" */
#view-abertura .abertura-sidebar .card {
  border: 1px solid rgba(15, 23, 42, 0.06);
}

/* =========================================================
   PROMPT 4 — ABERTURA (Sidepanel Executivo) + Polimento Geral
   ========================================================= */

/* 1) Painel direito com "cara de produto" */
.abertura-sidebar-inner {
  background: linear-gradient(
    180deg,
    rgba(15, 118, 110, 0.02) 0%,
    rgba(255, 255, 255, 0.98) 100%
  );
  border-radius: 0;
}

@media (min-width: 992px) {
  .abertura-sidebar-inner {
    padding: 1.5rem !important;
    border-radius: 16px;
  }
}

.abertura-sidebar-sticky {
  position: relative;
}

@media (min-width: 992px) {
  .abertura-sidebar-sticky {
    position: sticky;
    top: 12px;
  }
}

/* 2) Header premium do offcanvas (mobile) */
.abertura-sidebar-header-premium {
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.08) 0%,
    rgba(15, 118, 110, 0.03) 100%
  );
  border-bottom: 2px solid rgba(15, 118, 110, 0.15) !important;
  padding: 1rem 1.25rem;
}

.abertura-sidebar-iconbox {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(
    135deg,
    var(--ed-primary) 0%,
    var(--ed-primary-dark) 100%
  );
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.2);
}

.abertura-sidebar-iconbox i {
  font-size: 1.1rem;
}

.abertura-sidebar-iconbox-sm {
  width: 32px;
  height: 32px;
}

.abertura-sidebar-iconbox-sm i {
  font-size: 0.9rem;
}

/* 3) Top strip visual do painel (desktop) */
.abertura-sidepanel-banner {
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.05) 0%,
    rgba(255, 255, 255, 0.95) 100%
  );
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 118, 110, 0.08);
}

/* 4) Padronização de headers dos cards */
.abertura-card-preview,
.abertura-card-checklist,
#abertura-card-resumo {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

.abertura-card-preview::before,
.abertura-card-checklist::before,
#abertura-card-resumo::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--ed-primary) 0%,
    var(--ed-primary-dark) 100%
  );
  z-index: 1;
}

.abertura-card-checklist::before {
  background: linear-gradient(
    90deg,
    rgba(34, 197, 94, 0.8) 0%,
    rgba(34, 197, 94, 1) 100%
  );
}

#abertura-card-resumo::before {
  background: linear-gradient(
    90deg,
    rgba(139, 92, 246, 0.8) 0%,
    rgba(139, 92, 246, 1) 100%
  );
}

.abertura-card-preview .card-header,
.abertura-card-checklist .card-header,
#abertura-card-resumo .card-header {
  position: relative;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  background: linear-gradient(
    135deg,
    rgba(248, 250, 252, 0.95) 0%,
    rgba(255, 255, 255, 1) 100%
  );
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.abertura-card-preview .card-header i,
.abertura-card-checklist .card-header i,
#abertura-card-resumo .card-header i {
  font-size: 1rem;
  margin-right: 0.5rem;
}

/* 5) Prévia mais executiva */
.abertura-card-preview .card-header {
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.05) 0%,
    rgba(255, 255, 255, 1) 100%
  );
}

.preview-badge-live {
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.1) 0%,
    rgba(34, 197, 94, 0.05) 100%
  ) !important;
  color: #15803d !important;
  border: 1px solid rgba(34, 197, 94, 0.2) !important;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(34, 197, 94, 0.15);
}

/* 6) Checklist mais executivo */
.abertura-card-checklist .card-header {
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.06) 0%,
    rgba(255, 255, 255, 1) 100%
  );
}

#abertura-checklist-count {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--ed-primary-dark);
  border: 1px solid rgba(15, 118, 110, 0.15) !important;
}

.abertura-checklist-progress {
  width: 80px;
  height: 10px;
  background: rgba(15, 118, 110, 0.1);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

#abertura-checklist-bar {
  background: linear-gradient(
    90deg,
    var(--ed-primary) 0%,
    var(--ed-primary-dark) 100%
  );
  transition: width 0.4s ease;
  box-shadow: 0 1px 3px rgba(15, 118, 110, 0.3);
  border-radius: 10px;
}

#abertura-checklist {
  column-count: 2;
  column-gap: 16px;
  margin: 0;
  padding: 0.5rem 0;
}

#abertura-checklist li {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.4rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 1.5;
}

#abertura-checklist li:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 118, 110, 0.2);
  transform: translateX(4px);
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.1);
}

#abertura-checklist li i {
  font-size: 0.9rem;
  transition: all 0.2s ease;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

#abertura-checklist li span {
  font-weight: 500;
  font-size: 0.85rem;
  color: #475569;
  transition: color 0.2s ease;
}

.abertura-checklist li.is-done {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.25);
}

.abertura-checklist li.is-done span {
  color: #15803d;
  font-weight: 600;
}

.abertura-checklist li.is-warn {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
}

.abertura-checklist li.is-warn span {
  color: #92400e;
  font-weight: 600;
}

@media (max-width: 991.98px) {
  #abertura-checklist {
    column-count: 1;
  }
}

/* 7) Upgrade do progresso do topo da Abertura */
.abertura-progress {
  height: 12px;
  background: rgba(15, 118, 110, 0.08);
  border-radius: var(--ed-radius-full);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.abertura-progress .progress-bar {
  background: linear-gradient(
    90deg,
    var(--ed-primary) 0%,
    var(--ed-primary-dark) 100%
  );
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.3);
  transition: width 0.4s ease;
  border-radius: var(--ed-radius-full);
}

/* Badges integrados para Etapa X/Y */
.abertura-step-badge {
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.1) 0%,
    rgba(15, 118, 110, 0.05) 100%
  );
  color: var(--ed-primary-dark);
  border: 1px solid rgba(15, 118, 110, 0.2);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  white-space: nowrap;
}

.abertura-required-badge {
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.1) 0%,
    rgba(34, 197, 94, 0.05) 100%
  );
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.2);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  white-space: nowrap;
}

/* 8) Badge de status no preview */
.abertura-status-badge-preview {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.abertura-status-badge-preview.text-bg-secondary {
  background: linear-gradient(
    135deg,
    rgba(100, 116, 139, 0.15) 0%,
    rgba(100, 116, 139, 0.08) 100%
  ) !important;
  color: #475569 !important;
  border: 1px solid rgba(100, 116, 139, 0.2);
}

.abertura-status-badge-preview.text-bg-primary {
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.15) 0%,
    rgba(15, 118, 110, 0.08) 100%
  ) !important;
  color: var(--ed-primary-dark) !important;
  border: 1px solid rgba(15, 118, 110, 0.2);
}

.abertura-status-badge-preview.text-bg-warning {
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.15) 0%,
    rgba(245, 158, 11, 0.08) 100%
  ) !important;
  color: #92400e !important;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.abertura-status-badge-preview.text-bg-success {
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.15) 0%,
    rgba(34, 197, 94, 0.08) 100%
  ) !important;
  color: #15803d !important;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* 9) Placeholders elegantes e estados vazios */
.preview-field-empty {
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.preview-field-empty .preview-placeholder {
  font-style: italic;
  color: #94a3b8;
}

.preview-titulo:not(.preview-field-empty),
.preview-prazo-value:not(.preview-field-empty),
.preview-descricao-text:not(.preview-field-empty),
.preview-contato-value:not(.preview-field-empty) {
  opacity: 1;
}

.preview-titulo.preview-field-empty {
  color: #cbd5e1;
}

.preview-prazo-value.preview-field-empty {
  color: #cbd5e1;
}

.preview-descricao-text.preview-field-empty {
  color: #cbd5e1;
}

.preview-contato-value.preview-field-empty {
  color: #cbd5e1;
}

/* 10) Card Resumo Rápido / Próximos Passos */
.abertura-card-resumo-rapido {
  border: 1px solid rgba(245, 158, 11, 0.12);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 251, 235, 0.3) 100%
  );
}

.abertura-card-resumo-rapido::before {
  background: linear-gradient(
    90deg,
    rgba(245, 158, 11, 0.8) 0%,
    rgba(245, 158, 11, 1) 100%
  );
}

.abertura-card-resumo-rapido .card-header {
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.06) 0%,
    rgba(255, 255, 255, 1) 100%
  );
}

.abertura-proximos-passos__pendencias ul {
  padding-left: 1.25rem;
}

.abertura-proximos-passos__pendencias li {
  padding: 0.25rem 0;
  color: #64748b;
  position: relative;
}

.abertura-proximos-passos__pendencias li::before {
  content: "•";
  position: absolute;
  left: -1rem;
  color: #f59e0b;
  font-weight: bold;
}

.abertura-proximos-passos__dica {
  background: rgba(15, 118, 110, 0.03);
  border-radius: 8px;
  padding: 0.75rem !important;
  margin-top: 0.5rem;
}

/* 11) Sidecard padrão (estrutura consistente) */
.abertura-sidecard {
  transition: all 0.3s ease;
  border: 1px solid rgba(226, 232, 240, 0.6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.abertura-sidecard:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.abertura-sidecard__header {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
}

.abertura-sidecard__body {
  padding: 1.25rem;
  background: #ffffff;
}

/* 12) Melhorias tipográficas no preview */
.preview-titulo {
  transition:
    color 0.3s ease,
    opacity 0.3s ease;
}

.preview-badge {
  transition: all 0.2s ease;
}

.preview-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preview-prazo-item {
  transition: all 0.2s ease;
}

.preview-prazo-item:hover {
  background: rgba(15, 118, 110, 0.02);
  border-radius: 6px;
  padding: 0.25rem;
  margin: -0.25rem;
}

.preview-contato-item {
  transition: all 0.2s ease;
  padding: 0.25rem 0;
  border-radius: 4px;
}

.preview-contato-item:hover {
  background: rgba(15, 118, 110, 0.02);
  padding-left: 0.5rem;
}

/* 13) Polimento geral (seguro, sem quebrar outras abas) */
#view-abertura :focus-visible {
  outline: 2px solid var(--ed-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
}

#view-abertura .card {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

#view-abertura .card:hover {
  transform: translateY(-1px);
}

#view-abertura .btn {
  transition: all 0.2s ease;
}

/* Notificações: zebra + destaque */
.notif-row-alt {
  background: rgba(0, 0, 0, 0.025);
}

.notif-unread {
  border-left: 4px solid rgba(220, 53, 69, 0.9);
}

/* =========================================
   ELIA v3 — Repaginação + Auditoria DBA
   ========================================= */

#view-elia.elia-v3 .elia-v3-hero {
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: linear-gradient(135deg, var(--ed-primary-soft) 0%, #ffffff 65%);
}

#view-elia.elia-v3 .elia-v3-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    var(--ed-primary) 0%,
    var(--ed-primary-dark) 100%
  );
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--ed-shadow-sm);
}

#view-elia.elia-v3 .elia-v3-icon i {
  font-size: 1.25rem;
}

#view-elia.elia-v3 .elia-v3-tabs .nav-link {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  font-weight: 800;
}

#view-elia.elia-v3 .elia-v3-tabs .nav-link.active {
  border-color: transparent;
  background: linear-gradient(
    135deg,
    var(--ed-primary) 0%,
    var(--ed-primary-dark) 100%
  );
}

/* stage (evita “quebrar” alturas do chat) */
#view-elia.elia-v3 .elia-v3-stage {
  min-height: calc(100vh - 260px);
}

/* Harmoniza o tema do ELIA (substitui o roxo duro do CSS antigo) */
#view-elia.elia-v3 .elia-sidebar-header,
#view-elia.elia-v3 .elia-send-btn,
#view-elia.elia-v3 .elia-conversation-item.active,
#view-elia.elia-v3 .elia-message.user .elia-message-content {
  background: linear-gradient(
    135deg,
    var(--ed-primary) 0%,
    var(--ed-primary-dark) 100%
  ) !important;
}

/* sidebar e painel com “respiro” + scroll */
#view-elia.elia-v3 .elia-sidebar,
#view-elia.elia-v3 .elia-rightpanel,
#view-elia.elia-v3 .elia-main {
  border-color: rgba(15, 23, 42, 0.08) !important;
}

#view-elia.elia-v3 .elia-rightpanel {
  overflow-y: auto;
  max-height: calc(100vh - 260px);
}

/* Auditoria */
#view-elia.elia-v3 .elia-audit-kpi {
  border: 1px solid var(--ed-border);
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
  padding: 10px;
  box-shadow: var(--ed-shadow-xs);
}

#view-elia.elia-v3 .elia-audit-kpi .k {
  font-size: 0.78rem;
  color: var(--ed-gray-600);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

#view-elia.elia-v3 .elia-audit-kpi .v {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--ed-gray-900);
  margin-top: 4px;
}

#view-elia.elia-v3 .elia-audit-table thead th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}

#view-elia.elia-v3 .elia-audit-pre {
  min-height: 220px;
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--ed-border);
  border-radius: 14px;
  padding: 10px;
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
  white-space: pre-wrap;
  font-size: 0.88rem;
}

#rec-card .card-header {
  background: rgba(13, 110, 253, 0.04);
}

#rec-card .form-switch .form-check-input {
  cursor: pointer;
}

/* Badge de status melhorado */
.abertura-status-badge {
  font-weight: 700;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Espaçamento melhorado para o card de recorrência */
#rec-card {
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 12px;
}

#rec-card .card-body {
  padding: 1.5rem !important;
}

#rec-card .form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--ed-gray-700);
}

#rec-card .form-control,
#rec-card .form-select {
  margin-bottom: 0.25rem;
}

#rec-card .form-text {
  margin-top: 0.25rem;
  font-size: 0.85rem;
}

#rec-card #rec-body {
  padding-top: 0.5rem;
}

#rec-card .alert {
  padding: 0.875rem 1rem;
  border-radius: 8px;
}

/* =========================
   RELATORIOS v2 (patch)
   ========================= */

.relatorios-state {
  opacity: 0.95;
}

.relatorios-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.relatorios-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(15, 23, 42, 0.03);
  font-size: 0.78rem;
  line-height: 1;
}

.relatorios-chip b {
  font-weight: 600;
}

.relatorios-chip button {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  line-height: 1;
  opacity: 0.7;
}

.relatorios-chip button:hover {
  opacity: 1;
}

/* ===== MODAL: REGISTRAR EVENTO - MELHORIAS DE UI/UX ===== */
#modal-evento .modal-content {
  border-radius: 12px;
  overflow: hidden;
  animation: modalFadeIn 0.3s ease-out;
}

#modal-evento .modal-header.bg-gradient-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  padding: 1.25rem 1.5rem;
}

#modal-evento .modal-header .modal-title {
  font-weight: 600;
  font-size: 1.25rem;
}

#modal-evento .modal-body {
  padding: 1.5rem;
}

#modal-evento .alert-info {
  background: linear-gradient(135deg, #e7f3ff 0%, #d0e7ff 100%);
  border: 1px solid #b3d9ff;
  border-radius: 8px;
  padding: 0.875rem 1rem;
}

#modal-evento .alert-info i {
  color: #0d6efd;
}

#modal-evento hr {
  opacity: 0.2;
  margin: 1.5rem 0;
}

#modal-evento .form-label {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: #495057;
}

#modal-evento .form-label i {
  margin-right: 0.375rem;
}

#modal-evento .form-select-lg,
#modal-evento .form-control-lg {
  border-radius: 8px;
  border: 1px solid #dee2e6;
  transition: all 0.2s ease;
}

#modal-evento .form-select-lg:focus,
#modal-evento .form-control-lg:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

#modal-evento .card.border-warning {
  border-width: 2px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

#modal-evento .card.border-warning:hover {
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.15);
}

#modal-evento .card.border-secondary {
  border-width: 2px;
  border-radius: 8px;
}

#modal-evento #modal-evento-elia-sugestao {
  background-color: #fffbf0;
  border: 1px solid #ffc107;
  font-size: 0.875rem;
  border-radius: 6px;
}

#modal-evento #modal-evento-detalhe {
  border-radius: 8px;
  border: 2px solid #dee2e6;
  transition: all 0.2s ease;
  resize: vertical;
}

#modal-evento #modal-evento-detalhe:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

/* Reduzir espaçamento da seção de detalhe (checklist) */
#modal-evento .mb-3 {
  margin-bottom: 1rem;
}

#modal-evento .mb-4 {
  margin-bottom: 1.5rem;
}

/* Ajuste específico para badge obrigatório menor */
#modal-evento .badge.bg-danger {
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  font-weight: 600;
  line-height: 1.2;
}

#modal-evento #modal-evento-elia-sugerir {
  transition: all 0.2s ease;
}

#modal-evento #modal-evento-elia-sugerir:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

#modal-evento #modal-evento-elia-aplicar:not(:disabled) {
  transition: all 0.2s ease;
}

#modal-evento #modal-evento-elia-aplicar:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

#modal-evento #modal-evento-anexo-list {
  margin-top: 0.75rem;
}

#modal-evento #modal-evento-anexo-list ul,
#modal-evento #modal-evento-anexo-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

#modal-evento #modal-evento-anexo-list li {
  padding: 0.5rem 0.75rem;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #e9ecef;
  transition: all 0.2s ease;
}

#modal-evento #modal-evento-anexo-list li:hover {
  background: #e9ecef;
}

#modal-evento #modal-evento-anexo-list li i {
  margin-right: 0.5rem;
  color: #6c757d;
}

#modal-evento .modal-footer {
  padding: 1rem 1.5rem;
}

#modal-evento .modal-footer .btn-lg {
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
}

#modal-evento .modal-footer .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#modal-evento .badge {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  font-weight: 500;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Responsividade para mobile */
@media (max-width: 768px) {
  #modal-evento .modal-body {
    padding: 1rem;
  }

  #modal-evento .modal-header {
    padding: 1rem;
  }

  #modal-evento .modal-footer {
    padding: 0.75rem 1rem;
    flex-direction: column-reverse;
    gap: 0.5rem;
  }

  #modal-evento .modal-footer .btn {
    width: 100%;
  }
}

/* ===== MODAL: VER TICKET - DESIGN PREMIUM ===== */
.modal-ticket-premium .modal-content {
  border: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#modal-ticket .modal-dialog {
  margin: 0.5rem auto;
  height: calc(100vh - 1rem);
  height: calc(100dvh - 1rem);
  max-height: calc(100vh - 1rem);
  max-height: calc(100dvh - 1rem);
}

#modal-ticket .modal-content {
  max-height: inherit;
}

/* Header Premium - Design Best-in-Class */
.ticket-modal-header {
  background: #ffffff;
  padding: 0;
  border: none;
  border-bottom: 1px solid #e9ecef;
  position: sticky;
  top: 0;
  z-index: 5;
  overflow: visible;
}

.ticket-header-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Seção superior: Título e Botão Fechar */
.ticket-header-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.75rem 2rem 1.25rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-bottom: 1px solid #e9ecef;
  position: relative;
  min-height: 80px; /* Garante altura mínima */
}

@media (min-width: 769px) {
  .ticket-header-top {
    align-items: center;
  }
}

.ticket-header-title-section {
  min-width: 0; /* Permite shrink */
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 1rem; /* Espaço antes do botão */
}

.ticket-modal-header .modal-title {
  color: #212529;
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  line-height: 1.3;
  word-break: break-word;
}

.ticket-modal-header .modal-title i {
  color: #667eea;
  flex-shrink: 0;
  font-size: 1.5rem;
}

.ticket-header-subtitle {
  color: #6c757d;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  margin: 0;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Botão Fechar Melhorado */
.btn-close-ticket {
  background: #ffffff;
  border: 1.5px solid #e9ecef;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  color: #6c757d;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-close-ticket:hover {
  background: #f8f9fa;
  border-color: #dee2e6;
  color: #212529;
  transform: scale(1.05) rotate(90deg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-close-ticket:active {
  transform: scale(0.95);
}

.btn-close-ticket i {
  font-size: 1.25rem;
  line-height: 1;
}

/* Seção de Badges */
.ticket-header-badges-section {
  padding: 1.25rem 2rem;
  background: #ffffff;
  border-bottom: 1px solid #f0f0f0;
}

.ticket-header-badges-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.875rem;
  flex-wrap: wrap;
}

.ticket-header-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.ticket-header-quick-event {
  border: 1px solid #0f766e;
  color: #1d4ed8;
  background: #ecfeff;
  border-radius: 10px;
  font-weight: 600;
}

.ticket-header-quick-event:hover {
  background: #ccfbf1;
  border-color: #1d4ed8;
  color: #134e4a;
}

.ticket-header-quick-event:active {
  background: #99f6e4;
}

.ticket-badges-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* Body */
.ticket-modal-body {
  padding: 2rem;
  background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
  min-height: 400px;
  overflow-y: auto;
}

.ticket-container {
  max-width: 100%;
}

/* Grid Layout */
.ticket-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  align-items: start;
}

/* Cards Premium */
.ticket-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.ticket-card:last-child {
  margin-bottom: 0;
}

.ticket-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transform: none;
}

.ticket-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-bottom: 1px solid #e9ecef;
}

.ticket-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ticket-card-icon.bg-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ticket-card-icon.bg-info {
  background: linear-gradient(135deg, #0dcaf0 0%, #0aa2c0 100%);
}

.ticket-card-icon.bg-warning {
  background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
}

.ticket-card-icon.bg-success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.ticket-card-icon.bg-secondary {
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.ticket-card-icon.bg-dark {
  background: linear-gradient(135deg, #212529 0%, #343a40 100%);
}

.ticket-card-icon.bg-gradient-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ticket-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #212529;
  margin: 0;
  line-height: 1.3;
}

.ticket-card-subtitle {
  font-size: 0.875rem;
  color: #6c757d;
  margin: 0;
  margin-top: 0.25rem;
}

.ticket-card-body {
  padding: 1rem 1.25rem;
}

/* Descrição */
.ticket-description-content {
  white-space: pre-wrap;
  line-height: 1.8;
  color: #495057;
  font-size: 0.9375rem;
  word-wrap: break-word;
}

/* Info Grid - Melhorado */
.ticket-info-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ticket-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.2s ease;
}

.ticket-info-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.ticket-info-item:hover {
  padding-left: 0.5rem;
}

.ticket-info-label {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6c757d;
  margin-bottom: 0.25rem;
}

.ticket-info-label i {
  font-size: 1rem;
  color: #667eea;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.ticket-info-value {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #212529;
  word-break: break-word;
  line-height: 1.6;
  padding-left: 1.75rem;
  position: relative;
}

.ticket-info-value::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 3px;
  height: calc(100% - 1rem);
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
  border-radius: 2px;
  opacity: 0.3;
}

.ticket-link {
  color: #667eea;
  text-decoration: none;
  transition: color 0.2s ease;
}

.ticket-link:hover {
  color: #764ba2;
  text-decoration: underline;
}

/* Prazo Controls */
.ticket-prazo-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ticket-prazo-controls .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ticket-prazo-controls .form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #495057;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.ticket-prazo-controls .form-label i {
  color: #667eea;
}

/* Timeline */
.ticket-timeline {
  position: relative;
  padding: 0;
}

.ticket-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #6c757d;
  font-size: 0.875rem;
  padding: 1rem 0;
}

.ticket-event-item {
  padding: 1.25rem 0;
  position: relative;
}

.ticket-event-item-separated {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  margin-bottom: 0;
}

.ticket-event-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.ticket-event-meta {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: #495057;
}

.ticket-event-meta b {
  font-weight: 600;
  color: #212529;
}

.ticket-event-tipo {
  margin-bottom: 0.75rem;
}

.ticket-event-tipo .badge {
  font-size: 0.75rem;
  padding: 0.375rem 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ticket-event-detalhe {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #495057;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Footer */
.ticket-modal-footer {
  padding: 1.5rem 2rem;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.ticket-footer-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-action-copy,
.btn-action-print {
  border: 1.5px solid #dee2e6;
  background: #fff;
  color: #495057;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.btn-action-copy:hover {
  border-color: #667eea;
  background: #667eea;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-action-print:hover {
  border-color: #0dcaf0;
  background: #0dcaf0;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 202, 240, 0.3);
}

.ticket-modal-footer .btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  transition: all 0.2s ease;
}

.ticket-modal-footer .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* Form Controls */
.ticket-card .form-control {
  border: 1.5px solid #dee2e6;
  border-radius: 8px;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
}

.ticket-card .form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
  outline: none;
}

.ticket-card .btn {
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
  padding: 0.625rem 1.25rem;
}

.ticket-card .btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.ticket-card .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.35);
}

/* Animações */
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Finalização especial */
.ticket-fin-custo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #28a745;
}

.ticket-fin-text {
  line-height: 1.8;
  color: #495057;
}

/* Ajustes de espaçamento */
.ticket-main-column {
  min-width: 0; /* Permite shrink */
}

.ticket-sidebar-column {
  min-width: 0;
}

/* Timeline melhorada */
.ticket-timeline .ea-timeline {
  padding-left: 0;
}

/* Badges no header - cores originais preservadas, sem overlay */
.ticket-header-badges .badge-status,
.ticket-header-badges .badge-prioridade,
.ticket-header-badges .badge-farol-verde,
.ticket-header-badges .badge-farol-amarelo,
.ticket-header-badges .badge-farol-vermelho,
.ticket-header-badges .badge-farol-concluido {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  /* Mantém cores originais completamente */
}

.ticket-header-badges .badge-status:hover,
.ticket-header-badges .badge-prioridade:hover,
.ticket-header-badges .badge-farol-verde:hover,
.ticket-header-badges .badge-farol-amarelo:hover,
.ticket-header-badges .badge-farol-vermelho:hover,
.ticket-header-badges .badge-farol-concluido:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsividade */
@media (max-width: 1200px) {
  .ticket-grid {
    grid-template-columns: 1fr;
  }

  .ticket-sidebar-column {
    order: -1;
  }
}

@media (max-width: 768px) {
  .ticket-header-top {
    padding: 1.25rem 1rem 1rem;
    gap: 1rem;
    grid-template-columns: 1fr auto;
  }

  .ticket-header-title-section {
    padding-right: 0.75rem;
  }

  .ticket-header-badges-section {
    padding: 1rem;
  }

  .ticket-header-quick-event {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .ticket-modal-header .modal-title {
    font-size: 1.5rem;
  }

  .ticket-header-subtitle {
    font-size: 0.9375rem;
  }

  .btn-close-ticket {
    width: 36px;
    height: 36px;
  }

  .btn-close-ticket i {
    font-size: 1.125rem;
  }

  .ticket-modal-body {
    padding: 1.25rem;
  }

  .ticket-grid {
    gap: 1rem;
  }

  .ticket-card-header {
    padding: 1rem 1.25rem;
  }

  .ticket-card-body {
    padding: 1.25rem;
  }

  .ticket-modal-footer {
    padding: 1rem 1.25rem;
    flex-direction: column;
  }

  .ticket-footer-actions {
    width: 100%;
    flex-direction: column;
  }

  .ticket-footer-actions .btn,
  .ticket-modal-footer .btn-primary {
    width: 100%;
  }
}

/* ===== VIEW: RECORRÊNCIAS - ENTERPRISE PREMIUM ===== */
.recorrencias-header-premium {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
  color: #ffffff;
  animation: fadeInDown 0.4s ease-out;
}

.recorrencias-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.recorrencias-header-title {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
  min-width: 0;
}

.recorrencias-icon-wrapper {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
  backdrop-filter: blur(10px);
}

.recorrencias-main-title {
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.recorrencias-subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

.recorrencias-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.recorrencias-header-actions .btn {
  border-radius: 10px;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.recorrencias-header-actions .btn-primary {
  background: #ffffff;
  color: #667eea;
  border: none;
}

.recorrencias-header-actions .btn-primary:hover {
  background: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.recorrencias-header-actions .btn-outline-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  backdrop-filter: blur(10px);
}

.recorrencias-header-actions .btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

/* Cards de Estatísticas */
.recorrencias-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  animation: fadeInUp 0.5s ease-out;
}

.rec-stat-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e9ecef;
  position: relative;
  overflow: hidden;
}

.rec-stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--card-color) 0%,
    var(--card-color-light) 100%
  );
}

.rec-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.rec-stat-card-primary {
  --card-color: #667eea;
  --card-color-light: #764ba2;
}

.rec-stat-card-success {
  --card-color: #10b981;
  --card-color-light: #059669;
}

.rec-stat-card-secondary {
  --card-color: #6c757d;
  --card-color-light: #495057;
}

.rec-stat-card-info {
  --card-color: #0dcaf0;
  --card-color-light: #0aa2c0;
}

.rec-stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: #ffffff;
  background: linear-gradient(
    135deg,
    var(--card-color) 0%,
    var(--card-color-light) 100%
  );
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.rec-stat-content {
  flex: 1;
  min-width: 0;
}

.rec-stat-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.rec-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #212529;
  line-height: 1;
}

/* Tabela Premium */
.recorrencias-table-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border: 1px solid #e9ecef;
  overflow: visible;
  animation: fadeInUp 0.6s ease-out;
}

/* Garantir que a view de recorrências não gere scrollbar vertical desnecessária */
#view-recorrencias {
  overflow-y: visible;
  min-height: 0;
}

.recorrencias-table-header {
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-bottom: 2px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.recorrencias-table-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.recorrencias-table-header-left h5 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #212529;
  margin: 0;
  display: flex;
  align-items: center;
}

.recorrencias-table-header-left h5 i {
  color: #667eea;
}

.recorrencias-count-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  padding: 0.375rem 0.875rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.recorrencias-table-header-right .input-group {
  border-radius: 10px;
  overflow: hidden;
}

.recorrencias-table-header-right .input-group-text {
  background: #f8f9fa;
  border-color: #dee2e6;
  color: #6c757d;
}

.recorrencias-table-header-right .form-control {
  border-color: #dee2e6;
  font-size: 0.9375rem;
}

.recorrencias-table-header-right .form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.recorrencias-table-body .rec-table-responsive {
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.recorrencias-table-body {
  overflow: visible;
}

.recorrencias-table-body .table-responsive {
  overflow-x: auto;
  overflow-y: visible;
}

.recorrencias-table-body .table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}

.recorrencias-thead {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-bottom: 2px solid #e9ecef;
}

.recorrencias-thead th {
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #495057;
  padding: 0.5rem 0.75rem;
  border-bottom: none;
  text-align: center;
}

/* Wrapper interno para headers com flex */
.rec-th-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rec-th-wrapper.rec-th-left {
  justify-content: flex-start;
}

.rec-th-wrapper.rec-th-right {
  justify-content: flex-end;
}

.recorrencias-thead th i {
  color: #667eea;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.rec-th-wrapper span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#rec-table th,
#rec-table td {
  max-width: 100%;
  min-width: 0;
  padding: 0.625rem 0.5rem;
  vertical-align: middle;
  line-height: 1.4;
}

/* Aplicar quebra de palavra apenas em células de conteúdo */
#rec-table td.rec-col-titulo,
#rec-table td.rec-col-categoria,
#rec-table td.rec-col-responsavel,
#rec-table td.rec-col-setor {
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

/* Coluna Status: garantir que badge não invada outras colunas */
/* Células estreitas: centralizadas com ellipsis */
#rec-table td.rec-col-status,
#rec-table td.rec-col-proxima,
#rec-table td.rec-col-freq,
#rec-table td.rec-col-prazo {
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Centralizar conteúdo interno das células estreitas */
#rec-table td.rec-col-status > *,
#rec-table td.rec-col-proxima > *,
#rec-table td.rec-col-freq > *,
#rec-table td.rec-col-prazo > * {
  margin: 0 auto;
}

#rec-table th.rec-col-status,
#rec-table th.rec-col-proxima,
#rec-table th.rec-col-freq,
#rec-table th.rec-col-prazo {
  text-align: center;
}

/* Células de conteúdo: alinhamento à esquerda (podem quebrar) */
#rec-table td.rec-col-titulo,
#rec-table td.rec-col-categoria,
#rec-table td.rec-col-responsavel {
  text-align: left;
}

#rec-table th.rec-col-titulo,
#rec-table th.rec-col-categoria,
#rec-table th.rec-col-responsavel {
  text-align: left;
}

/* Coluna de ações: alinhada à direita */
#rec-table td.rec-col-acoes {
  text-align: right;
}

#rec-table th {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.75rem 0.5rem;
}

#rec-table td {
  font-size: 0.8125rem;
}

#rec-table .rec-col-acoes,
#rec-table td.rec-col-acoes {
  white-space: nowrap;
  position: relative;
  z-index: 10;
  overflow: visible;
}

#rec-table tbody tr {
  transition: all 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
}

#rec-table tbody tr:hover {
  background-color: #f8f9fa;
  transform: none;
}

#rec-table tbody td {
  padding: 0.5rem 0.75rem;
  vertical-align: middle;
  font-size: 0.8125rem;
}

/* Badges Premium */
.rec-badge-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}

.rec-badge-secondary {
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important;
  color: #ffffff !important;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}

.rec-freq-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  background: #e7f3ff;
  color: #0d6efd;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rec-setor-badge,
.rec-categoria-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: #f8f9fa;
  color: #495057;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
}

/* Cells especiais */
.rec-next-exec {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rec-title-cell {
  min-width: 0;
}

.rec-title-cell strong {
  color: #212529;
  font-size: 0.875rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.rec-responsavel-cell {
  display: flex;
  align-items: center;
  color: #495057;
  font-size: 0.8125rem;
  min-width: 0;
}

.rec-cell-text {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.rec-prazo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ações */
.rec-actions-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  position: relative;
  z-index: 10;
}

.rec-btn-action {
  border-radius: 8px;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-width: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  position: relative;
  z-index: 11;
  pointer-events: auto;
  cursor: pointer;
  min-width: 80px;
  white-space: nowrap;
}

.rec-btn-action:active {
  transform: translateY(0);
  transition: all 0.1s ease;
}

.rec-btn-toggle {
  border-color: #6c757d;
  color: #6c757d;
  background: #ffffff;
}

.rec-btn-toggle:hover {
  background: #6c757d;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(108, 117, 125, 0.25);
}

.rec-btn-toggle:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(108, 117, 125, 0.2);
}

.rec-btn-delete {
  border-color: #dc3545;
  color: #dc3545;
  background: #ffffff;
}

.rec-btn-delete:hover {
  background: #dc3545;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(220, 53, 69, 0.25);
}

.rec-btn-delete:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(220, 53, 69, 0.2);
}

.rec-btn-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Empty State */
.recorrencias-empty-state {
  padding: 3rem 1rem !important;
}

.recorrencias-empty-state i {
  opacity: 0.5;
}

/* Animações */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsividade */
@media (max-width: 1200px) {
  .recorrencias-header-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .recorrencias-header-actions {
    width: 100%;
  }

  .recorrencias-header-actions .btn {
    flex: 1;
  }
}

@media (max-width: 768px) {
  .recorrencias-header-premium {
    padding: 1.5rem;
  }

  .recorrencias-icon-wrapper {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }

  .recorrencias-main-title {
    font-size: 1.5rem;
  }

  .recorrencias-stats-grid {
    grid-template-columns: 1fr;
  }

  .recorrencias-table-header {
    flex-direction: column;
    align-items: stretch;
  }

  .recorrencias-table-header-right {
    width: 100%;
  }

  .recorrencias-table-header-right .input-group {
    max-width: 100%;
  }

  .recorrencias-thead th,
  #rec-table tbody td {
    padding: 0.5rem 0.6rem;
    font-size: 0.78rem;
  }

  .rec-actions-group {
    flex-direction: column;
    width: 100%;
  }

  .rec-btn-action {
    width: 100%;
    justify-content: center;
  }
}

/* =========================================================
   AUDITORIA - Estilos Premium (Tema BI Enterprise)
   ========================================================= */

/* ===== VIEW: AUDITORIA (Container Principal) ===== */
#view-auditoria {
  padding-bottom: 2rem;
  background:
    radial-gradient(
      1100px 420px at -8% -14%,
      rgba(14, 116, 144, 0.15),
      transparent 60%
    ),
    radial-gradient(
      1100px 420px at 108% 0%,
      rgba(15, 118, 110, 0.16),
      transparent 62%
    ),
    linear-gradient(180deg, #f5f9ff 0%, #eef4fb 100%);
  border-radius: calc(var(--ed-radius-lg) + 4px);
}

/* ===== KPIs Hero Cards ===== */
.audit-kpi-card {
  border-radius: var(--ed-radius-md);
  border: 1px solid var(--ed-border);
  background: linear-gradient(
    135deg,
    var(--ed-white) 0%,
    var(--ed-gray-50) 100%
  );
  transition: all var(--ed-transition-base);
  position: relative;
  overflow: hidden;
}

.audit-kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--ed-primary) 50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity var(--ed-transition-base);
}

.audit-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ed-shadow-md);
  border-color: var(--ed-primary-light);
}

.audit-kpi-card:hover::before {
  opacity: 1;
}

.audit-kpi-card.audit-kpi-danger {
  border-left: 4px solid var(--ed-danger);
}

.audit-kpi-card.audit-kpi-danger:hover {
  border-color: var(--ed-danger);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.audit-kpi-card.audit-kpi-warning {
  border-left: 4px solid var(--ed-warning);
}

.audit-kpi-card.audit-kpi-warning:hover {
  border-color: var(--ed-warning);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.audit-kpi-card.audit-kpi-success {
  border-left: 4px solid var(--ed-success);
}

.audit-kpi-card.audit-kpi-success:hover {
  border-color: var(--ed-success);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.audit-kpi-icon {
  opacity: 0.85;
  transition: opacity var(--ed-transition-base);
}

.audit-kpi-card:hover .audit-kpi-icon {
  opacity: 1;
}

.audit-kpi-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ed-gray-900);
  margin: 0.5rem 0;
  letter-spacing: -0.02em;
}

.audit-kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ed-gray-700);
  margin-top: 0.25rem;
}

/* Blindagem de contraste (evita herança de cor inadequada) */
#view-auditoria .audit-kpi-card {
  color: var(--ed-gray-900);
}

#view-auditoria .audit-kpi-value,
#view-auditoria .audit-kpi-label,
#view-auditoria .audit-kpi-value-small {
  color: var(--ed-gray-900) !important;
}

#view-auditoria .audit-kpi-delta {
  color: var(--ed-gray-600) !important;
}

.audit-kpi-delta {
  font-size: 0.7rem;
  margin-top: 0.25rem;
}

.audit-kpi-value-small {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ed-gray-700);
  margin-top: 0.25rem;
}

/* ===== Alertas Críticos ===== */
#view-auditoria .card.border-danger {
  border-width: 2px !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

#view-auditoria .card.border-danger .card-header {
  font-weight: 700;
  letter-spacing: 0.02em;
}

#view-auditoria #audit-alert-setores tbody tr,
#view-auditoria #audit-alert-responsaveis tbody tr,
#view-auditoria #audit-alert-tickets tbody tr {
  cursor: pointer;
  transition: background-color var(--ed-transition-fast);
}

#view-auditoria #audit-alert-setores tbody tr:hover,
#view-auditoria #audit-alert-responsaveis tbody tr:hover,
#view-auditoria #audit-alert-tickets tbody tr:hover {
  background-color: var(--ed-gray-50);
}

/* ===== Filtros ativos ===== */
#view-auditoria #audit-active-filters {
  min-height: 26px;
}

#view-auditoria .audit-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(2, 6, 23, 0.03);
  color: var(--ed-gray-800);
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1;
}

#view-auditoria .audit-filter-chip .audit-filter-chip-remove {
  border: 0;
  background: transparent;
  padding: 0;
  line-height: 1;
  color: var(--ed-gray-700);
  opacity: 0.8;
}

#view-auditoria .audit-filter-chip:hover .audit-filter-chip-remove {
  opacity: 1;
  color: var(--ed-gray-900);
}

/* ===== Ações Prioritárias ===== */
#view-auditoria .audit-priority-card {
  border-width: 2px;
}

#view-auditoria .audit-priority-item {
  border-left: 4px solid transparent;
  padding: 0.65rem 0.75rem;
  transition:
    background-color var(--ed-transition-fast),
    border-color var(--ed-transition-fast),
    transform var(--ed-transition-fast);
}

#view-auditoria .audit-priority-item:hover {
  background-color: var(--ed-gray-50);
  transform: translateY(-1px);
}

#view-auditoria .audit-priority-item:active {
  transform: translateY(0);
}

#view-auditoria .audit-priority-title {
  font-weight: 800;
  color: var(--ed-gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

#view-auditoria .audit-priority-meta {
  font-size: 0.78rem;
  color: var(--ed-gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

#view-auditoria .audit-priority-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ===== Charts ===== */
#view-auditoria canvas {
  max-height: none;
  display: block;
}

/* Deixa os gráficos com "altura de BI" (menos achatados) */
#audit-chart-backlog,
#audit-chart-aging,
#audit-chart-top-setores,
#audit-chart-top-responsaveis,
#audit-chart-custo-setor,
#audit-chart-custo-categoria,
#audit-summary-setor-chart,
#audit-cube-chart {
  height: 340px !important;
}

/* Card headers padrão (não sobrescreve headers com bg-* do Bootstrap) */
#view-auditoria .card-header {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  background-color: var(--ed-gray-50);
  border-bottom: 2px solid var(--ed-border);
}

/* Fix: Alertas Críticos estava com texto branco em fundo claro (background:...) */
#view-auditoria .card-header.bg-danger {
  background-color: var(--ed-danger) !important;
  color: #fff !important;
}

#view-auditoria .card-header.bg-danger * {
  color: #fff !important;
}

/* ===== Checklist compacto ===== */
#view-auditoria .audit-compact-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

#view-auditoria .audit-checklist-scroller {
  max-height: 350px;
  overflow: auto;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.8);
}

#view-auditoria .audit-checklist-scroller thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fbff;
}

#view-auditoria .audit-checklist-toolbar .form-select {
  min-width: 130px;
}

/* ===== Resumos + Cubo ===== */
#view-auditoria .audit-summary-mini {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.94),
    rgba(240, 248, 255, 0.9)
  );
  padding: 0.55rem 0.65rem;
}

#view-auditoria .audit-summary-mini .k {
  font-size: 0.72rem;
  color: #334155;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

#view-auditoria .audit-summary-mini .v {
  font-size: 1.22rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  margin-top: 0.25rem;
}

#view-auditoria .audit-summary-surface {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  padding: 0.75rem;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.94),
    rgba(247, 250, 255, 0.92)
  );
}

#view-auditoria .audit-summary-table-wrap {
  max-height: 170px;
  overflow: auto;
}

#view-auditoria .audit-summary-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fbff;
}

#view-auditoria .audit-summary-setor-chart {
  height: 170px;
  margin-top: 0.4rem;
}

#view-auditoria .audit-cube-chart-wrap {
  height: 150px;
}

#view-auditoria .audit-cube-table-wrap {
  max-height: 170px;
  overflow: auto;
}

#view-auditoria .audit-cube-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fbff;
}

#view-auditoria .audit-cube-table-wrap td,
#view-auditoria .audit-cube-table-wrap th {
  white-space: nowrap;
}

#view-auditoria .audit-cube-col-total {
  font-weight: 800;
  color: #0f172a;
}

/* SLA pills (tabela) */
.audit-sla,
.audit-aging {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  line-height: 1;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.audit-sla-ok {
  background: rgba(34, 197, 94, 0.14);
  color: #0f172a;
  border-color: rgba(34, 197, 94, 0.35);
}

.audit-sla-due {
  background: rgba(245, 158, 11, 0.16);
  color: #0f172a;
  border-color: rgba(245, 158, 11, 0.45);
}

.audit-sla-overdue {
  background: rgba(239, 68, 68, 0.16);
  color: #0f172a;
  border-color: rgba(239, 68, 68, 0.45);
}

.audit-sla-closed {
  background: rgba(100, 116, 139, 0.14);
  color: #0f172a;
  border-color: rgba(100, 116, 139, 0.35);
}

.audit-aging-60 {
  background: rgba(124, 58, 237, 0.14);
  border-color: rgba(124, 58, 237, 0.35);
  color: #0f172a;
}

/* ===== IA para Relatórios ===== */
.audit-ia-answer-box {
  margin-top: 0.9rem;
  border: 1px solid rgba(30, 64, 175, 0.2);
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  padding: 0.8rem;
}

.audit-ia-answer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}

.audit-ia-text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ed-gray-800);
}

.audit-ia-report {
  display: grid;
  gap: 0.55rem;
}

.audit-ia-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  padding: 0.52rem 0.65rem;
}

.audit-ia-section {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  padding: 0.62rem 0.75rem;
  background: #ffffff;
}

.audit-ia-section-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.35rem;
}

.audit-ia-section ul {
  margin: 0.25rem 0 0 1rem;
  padding: 0;
}

.audit-ia-section li {
  margin-bottom: 0.2rem;
}

.audit-ia-high {
  font-weight: 800;
  color: #1d4ed8;
}

.audit-ia-json {
  margin-top: 0.35rem;
  border: 1px solid rgba(15, 118, 110, 0.25);
  background: #f1f7ff;
  border-radius: 10px;
  padding: 0.6rem;
}

.audit-ia-text h1,
.audit-ia-text h2,
.audit-ia-text h3 {
  font-weight: 700;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: var(--ed-gray-900);
}

.audit-ia-text ul,
.audit-ia-text ol {
  margin-left: 1.2rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.audit-ia-text li {
  margin-bottom: 0.25rem;
}

.audit-ia-text code {
  background-color: var(--ed-gray-100);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: 0.85em;
}

/* ===== Filtros ===== */
#view-auditoria .card.shadow-sm {
  border-radius: var(--ed-radius-md);
  border: 1px solid var(--ed-border);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98),
    rgba(247, 251, 255, 0.95)
  );
  backdrop-filter: blur(3px);
}

/* Upgrade geral (menos "seco"): sombras melhores + hover suave */
#view-auditoria .card.shadow-sm {
  box-shadow: var(--ed-shadow) !important;
  transition:
    transform var(--ed-transition-base),
    box-shadow var(--ed-transition-base),
    border-color var(--ed-transition-base);
}

#view-auditoria .card.shadow-sm:hover {
  transform: translateY(-1px);
  box-shadow: var(--ed-shadow-md) !important;
  border-color: rgba(15, 118, 110, 0.22);
}

#view-auditoria .table {
  box-shadow: var(--ed-shadow-xs);
}

#view-auditoria button[data-preset] {
  transition: all var(--ed-transition-fast);
}

#view-auditoria button[data-preset]:hover {
  transform: translateY(-1px);
  box-shadow: var(--ed-shadow-sm);
}

/* ===== Print Styles ===== */
@media print {
  #view-auditoria .dash-executive-actions,
  #view-auditoria .btn,
  #view-auditoria .dropdown,
  #view-auditoria nav,
  #view-auditoria .ea-header {
    display: none !important;
  }

  #view-auditoria {
    background: white !important;
    color: black !important;
  }

  #view-auditoria .card {
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    margin-bottom: 1rem;
  }

  #view-auditoria .card-header {
    background: #f5f5f5 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  #view-auditoria canvas {
    display: none !important;
  }

  #view-auditoria .table {
    font-size: 0.75rem;
  }

  #view-auditoria .audit-kpi-card {
    border: 1px solid #ddd !important;
    page-break-inside: avoid;
  }
}

/* ===== Responsivo ===== */
@media (max-width: 992px) {
  .audit-kpi-value {
    font-size: 1.5rem;
  }

  .audit-kpi-label {
    font-size: 0.7rem;
  }

  #view-auditoria .audit-checklist-scroller {
    max-height: 300px;
  }

  #view-auditoria .audit-summary-setor-chart,
  #view-auditoria .audit-cube-chart-wrap {
    height: 130px;
  }
}

@media (max-width: 576px) {
  .audit-kpi-value {
    font-size: 1.25rem;
  }

  #view-auditoria .card-body {
    padding: 0.75rem;
  }

  #view-auditoria .row.g-3 {
    margin-left: 0;
    margin-right: 0;
  }

  #view-auditoria .row.g-3 > * {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  #view-auditoria .audit-checklist-toolbar {
    width: 100%;
  }

  #view-auditoria .audit-checklist-toolbar .form-select,
  #view-auditoria .audit-checklist-toolbar .btn {
    width: 100%;
  }

  #view-auditoria .audit-checklist-scroller {
    max-height: 260px;
  }

  #view-auditoria .audit-summary-mini .v {
    font-size: 1rem;
  }
}

/* ========== UPGRADE UI/UX - PROMPT 3 ========== */

/* A) TICKET MODAL - Melhorias Mobile e Hierarquia */
@media (max-width: 768px) {
  .ticket-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .ticket-sidebar-column {
    order: -1;
    margin-bottom: 1rem;
  }

  .ticket-card {
    margin-bottom: 1rem;
  }

  .ticket-card-header {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
  }

  .ticket-card-icon {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }

  .ticket-card-title {
    font-size: 1rem;
  }

  .ticket-card-subtitle {
    font-size: 0.8125rem;
  }

  .ticket-info-grid {
    gap: 0.75rem;
  }

  .ticket-info-item {
    padding-bottom: 0.75rem;
  }

  .ticket-header-top {
    padding: 1.25rem 1rem;
    min-height: auto;
  }

  .ticket-modal-header .modal-title {
    font-size: 1.375rem;
    line-height: 1.4;
  }

  .ticket-header-subtitle {
    font-size: 0.875rem;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }

  .ticket-header-badges-section {
    padding: 1rem;
  }

  .ticket-badges-group {
    gap: 0.5rem;
  }

  .ticket-modal-body {
    padding: 1rem;
  }
}

/* Micro-interações: botões de ação no ticket */
.ticket-card .btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ticket-card .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ticket-card .btn:active {
  transform: translateY(0);
}

/* Botão copiar protocolo (se existir) */
.btn-copiar-protocolo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-copiar-protocolo:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* B) RECORRÊNCIAS - Correção de Tabela */
/* Removido - duplicado, usando regras acima */

.rec-title-cell strong {
  font-size: 0.875rem;
  line-height: 1.5;
  display: block;
}

.rec-responsavel-cell {
  font-size: 0.8125rem;
  line-height: 1.4;
}

.rec-cell-text {
  font-size: 0.8125rem;
  line-height: 1.4;
}

@media (max-width: 1200px) {
  #rec-table {
    font-size: 0.75rem;
  }

  #rec-table th,
  #rec-table td {
    padding: 0.5rem 0.375rem;
  }
}

/* C) PROJETOS - Checklist Melhorado */
#modal-projeto #pane-projeto-checklist .proj-checklist-progress-row {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

#modal-projeto #pane-projeto-checklist .proj-checklist-progress {
  height: 12px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

#modal-projeto #pane-projeto-checklist .proj-checklist-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #14b8a6 0%, #22c55e 50%, #10b981 100%);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#modal-projeto #pane-projeto-checklist .proj-checklist-progress-meta {
  font-size: 0.9375rem;
  gap: 0.625rem;
}

#modal-projeto #pane-projeto-checklist .proj-checklist-progress-text {
  font-weight: 900;
  color: var(--ed-gray-900);
}

#modal-projeto #pane-projeto-checklist .proj-checklist-progress-pct {
  font-size: 1rem;
  font-weight: 900;
  color: var(--ed-primary-dark);
}

#modal-projeto #pane-projeto-checklist .projeto-checklist-item {
  padding: 1rem;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 8px rgba(2, 6, 23, 0.06);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#modal-projeto #pane-projeto-checklist .projeto-checklist-item:hover {
  border-color: rgba(15, 118, 110, 0.25);
  box-shadow: 0 4px 16px rgba(2, 6, 23, 0.1);
  transform: translateY(-1px);
}

#modal-projeto #pane-projeto-checklist .projeto-checklist-item.done {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.2);
}

#modal-projeto
  #pane-projeto-checklist
  .projeto-checklist-item
  input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

#modal-projeto #pane-projeto-checklist .projeto-checklist-item::before {
  content: none;
  display: none;
}

#modal-projeto #pane-projeto-checklist .projeto-checklist-item-handle {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(248, 250, 252, 0.9);
  color: var(--ed-gray-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

#modal-projeto #pane-projeto-checklist .projeto-checklist-item-handle:hover {
  background: rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.25);
  color: var(--ed-primary-dark);
}

#modal-projeto #pane-projeto-checklist .projeto-checklist-item-handle:active {
  cursor: grabbing;
}

#modal-projeto #pane-projeto-checklist .projeto-checklist-item.is-dragging {
  opacity: 0.65;
  transform: rotate(1deg);
}

#modal-projeto #pane-projeto-checklist .projeto-checklist-item-text {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5;
  padding: 0.375rem 0;
}

#modal-projeto #pane-projeto-checklist .projeto-checklist-item-remove {
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

#modal-projeto #pane-projeto-checklist .projeto-checklist-item-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  transform: scale(1.1);
}

/* D) PROJETOS - 5W2H Melhorado */
#modal-projeto .proj-5w2h-matrix-card {
  border-radius: 18px;
  box-shadow: 0 16px 48px rgba(2, 6, 23, 0.1);
}

#modal-projeto .proj-5w2h-matrix-top {
  padding: 1.25rem 1.25rem;
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.12) 0%,
    rgba(255, 255, 255, 0.95) 70%
  );
}

#modal-projeto .proj-5w2h-matrix-title {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

#modal-projeto .proj-5w2h-matrix-sub {
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

#modal-projeto .proj-5w2h-head-cell {
  padding: 0.85rem 0.875rem;
  background: linear-gradient(
    180deg,
    rgba(248, 250, 252, 0.98) 0%,
    rgba(241, 245, 249, 0.9) 100%
  );
  border-right: 1px solid rgba(15, 23, 42, 0.12);
}

#modal-projeto .proj-5w2h-head-pt {
  font-size: 0.875rem;
  font-weight: 900;
  color: var(--ed-gray-900);
}

#modal-projeto .proj-5w2h-head-en {
  font-size: 0.7rem;
  margin-top: 0.15rem;
}

#modal-projeto .proj-5w2h-cell {
  padding: 1rem;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.98);
}

#modal-projeto .proj-5w2h-cell-label {
  font-size: 0.8125rem;
  font-weight: 900;
  margin-bottom: 0.625rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

#modal-projeto .projeto-5w2h-input {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  padding: 0.75rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.98);
}

#modal-projeto .projeto-5w2h-input:focus {
  border-color: rgba(15, 118, 110, 0.4);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
  background: #ffffff;
}

#modal-projeto .projeto-5w2h-input::placeholder {
  color: var(--ed-gray-400);
  font-style: italic;
}

/* Responsivo 5W2H */
@media (max-width: 992px) {
  #modal-projeto .proj-5w2h-cell {
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 14px;
    margin-bottom: 0.75rem;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(2, 6, 23, 0.06);
  }

  #modal-projeto .proj-5w2h-cell-label {
    display: flex;
    margin-bottom: 0.75rem;
  }
}

/* Consistência geral - Foco visível */
.ticket-card .form-control:focus,
.ticket-card .form-select:focus,
#modal-projeto .form-control:focus,
#modal-projeto .form-select:focus {
  outline: 2px solid rgba(15, 118, 110, 0.5);
  outline-offset: 2px;
  border-color: rgba(15, 118, 110, 0.4);
}

/* Hover states suaves */
.ticket-card,
#modal-projeto .proj-section-card,
.recorrencias-table-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ticket-card:hover,
#modal-projeto .proj-section-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

#rec-table tbody tr {
  transition: background-color 0.2s ease;
}

#rec-table tbody tr:hover {
  background-color: rgba(248, 250, 252, 0.8);
}

/* ========== PROJETOS - ETAPAS (Stepper) ========== */
.projeto-etapas-progress {
  margin-bottom: 1.5rem;
}

.projeto-etapas-stepper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.projeto-etapas-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  position: relative;
}

.projeto-etapas-step-num {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  position: relative;
  z-index: 2;
  background: #ffffff;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
}

.projeto-etapas-step-num i {
  font-size: 1.25rem;
}

.projeto-etapas-step-num-text {
  position: absolute;
  font-size: 0.75rem;
  font-weight: 700;
}

.projeto-etapas-step.done .projeto-etapas-step-num {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.projeto-etapas-step.done .projeto-etapas-step-num i {
  color: #ffffff;
}

.projeto-etapas-step.active .projeto-etapas-step-num {
  border-color: #667eea;
  background: #f8f9fa;
  color: #667eea;
}

.projeto-etapas-step-line {
  position: absolute;
  left: 1.25rem;
  top: 2.5rem;
  width: 2px;
  height: calc(100% + 1rem);
  background: #e9ecef;
  z-index: 1;
}

.projeto-etapas-step:last-child .projeto-etapas-step-line {
  display: none;
}

.projeto-etapas-step-content {
  flex: 1;
  padding-top: 0.25rem;
}

.projeto-etapas-step-text {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #212529;
  margin-bottom: 0.25rem;
}

.projeto-etapas-step-text.done {
  text-decoration: line-through;
  color: #6c757d;
}

.projeto-etapas-step-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #6c757d;
}

/* ========== PROJETOS - MATRIZ 5W2H (Tabela Profissional) ========== */
.proj-matriz-5w2h,
.proj-5w2h-table {
  font-size: 0.875rem;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.proj-matriz-5w2h thead th,
.proj-5w2h-table thead th {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-bottom: 2px solid #dee2e6;
  font-weight: 700;
  text-align: center;
  padding: 0.75rem 0.5rem;
  white-space: nowrap;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #495057;
  border: 1px solid #dee2e6;
}

.proj-matriz-5w2h tbody td,
.proj-5w2h-table tbody td {
  padding: 0.75rem;
  vertical-align: top;
  border: 1px solid #dee2e6;
  word-break: break-word;
  white-space: normal;
  line-height: 1.5;
}

.proj-matriz-5w2h tbody td:first-child,
.proj-5w2h-table tbody td:first-child {
  text-align: center;
  font-weight: 700;
  background: #f8f9fa;
  color: #667eea;
}

.proj-matriz-5w2h .projeto-5w2h-input,
.proj-5w2h-table .projeto-5w2h-input {
  border: none;
  padding: 0.5rem;
  font-size: 0.875rem;
  width: 100%;
  min-height: 2.5rem;
  resize: vertical;
}

.proj-matriz-5w2h .projeto-5w2h-input:focus,
.proj-5w2h-table .projeto-5w2h-input:focus {
  outline: 2px solid rgba(102, 126, 234, 0.3);
  outline-offset: -2px;
  border-color: transparent;
}

.proj-matriz-5w2h textarea.projeto-5w2h-input,
.proj-5w2h-table textarea.projeto-5w2h-input {
  min-height: 4rem;
}

/* Responsivo: Matriz 5W2H - Modo Stacked (Mobile) */
@media (max-width: 768px) {
  .proj-5w2h-table,
  .proj-matriz-5w2h {
    font-size: 0.8125rem;
  }

  .proj-5w2h-table thead,
  .proj-matriz-5w2h thead {
    display: none;
  }

  .proj-5w2h-table tbody tr,
  .proj-matriz-5w2h tbody tr {
    display: block;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }

  .proj-5w2h-table tbody td,
  .proj-matriz-5w2h tbody td {
    display: block;
    padding: 0.75rem 0;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    text-align: left !important;
    background: transparent !important;
  }

  .proj-5w2h-table tbody td:last-child,
  .proj-matriz-5w2h tbody td:last-child {
    border-bottom: none;
  }

  .proj-5w2h-table tbody td::before,
  .proj-matriz-5w2h tbody td::before {
    content: attr(data-label);
    display: block;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #667eea;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
  }

  .proj-5w2h-table tbody td:first-child::before,
  .proj-matriz-5w2h tbody td:first-child::before {
    content: "Item #";
  }

  .proj-5w2h-table tbody td:first-child,
  .proj-matriz-5w2h tbody td:first-child {
    font-size: 0.75rem;
    color: #667eea;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 0.5rem;
  }

  .proj-5w2h-table .badge {
    display: inline-block;
    margin-top: 0.25rem;
  }
}

/* Desktop: manter tabela normal */
@media (min-width: 769px) {
  .proj-5w2h-table thead {
    display: table-header-group;
  }

  .proj-5w2h-table tbody tr {
    display: table-row;
  }

  .proj-5w2h-table tbody td {
    display: table-cell;
  }

  .proj-5w2h-table tbody td::before {
    display: none;
  }
}

/* ========== PROJETOS - PREVIEW CARDS (Atividade + Etapas) ========== */
.proj-preview-card {
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 1rem;
  margin-top: 0.5rem;
}

.projeto-drawer-sidebar-v2 .proj-preview-card {
  padding: 0.75rem;
}

.projeto-drawer-sidebar-v2 .proj-activity-item {
  padding: 0.55rem 0;
}

.projeto-drawer-sidebar-v2 .proj-activity-item-body {
  padding-left: 1.5rem;
}

.projeto-drawer-sidebar-v2 .proj-activity-item-text {
  font-size: 0.8125rem;
}

.projeto-drawer-sidebar-v2 .projeto-drawer-lastro-content-v2 {
  padding: 0.75rem;
  background: #f9fafb;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 12px;
}

.proj-activity-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.proj-activity-item:last-child {
  border-bottom: none;
}

.proj-activity-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.proj-activity-item-date {
  font-size: 0.75rem;
}

.proj-activity-item-body {
  padding-left: 1.75rem;
}

.proj-activity-item-text {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #212529;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.proj-activity-item-user {
  margin-top: 0.25rem;
}

.proj-etapas-preview-progress {
  margin-bottom: 1rem;
}

.proj-stepper-preview {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.proj-stepper-preview-item {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  padding: 0.5rem 0;
}

.proj-stepper-preview-item.done .proj-stepper-preview-text {
  text-decoration: line-through;
  color: #6c757d;
}

.proj-stepper-preview-text {
  flex: 1;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .proj-preview-card {
    padding: 0.75rem;
  }

  .proj-activity-item-text {
    font-size: 0.8125rem;
  }
}

/* ========== PLANO DE AÇÃO (5W2H) ========== */
.plano-acao-5w2h {
  --pa-bg: #eef2f7;
  --pa-surface: #f7f9fc;
  --pa-card: #ffffff;
  --pa-border: rgba(15, 23, 42, 0.12);
  --pa-border-strong: rgba(15, 23, 42, 0.18);
  --pa-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  --pa-shadow-lg: 0 26px 70px rgba(15, 23, 42, 0.22);
  --pa-radius: 16px;
  --pa-radius-sm: 12px;
  --pa-spacing: 0.75rem;
  --pa-spacing-lg: 1.25rem;
  --pa-transition: 160ms ease;
  --pa-accent: #0f766e; /* azul petróleo */
  --pa-accent-soft: rgba(15, 118, 110, 0.12);
  --pa-ink: #0b1220;
  --pa-ink-2: rgba(11, 18, 32, 0.72);
  --pa-ink-3: rgba(11, 18, 32, 0.56);

  padding: 0.75rem 0.75rem 1.25rem;
  background:
    radial-gradient(
      1200px 520px at 18% -10%,
      rgba(15, 118, 110, 0.1) 0%,
      rgba(15, 118, 110, 0) 55%
    ),
    radial-gradient(
      900px 420px at 92% 0%,
      rgba(30, 64, 175, 0.08) 0%,
      rgba(30, 64, 175, 0) 58%
    ),
    linear-gradient(180deg, var(--pa-bg) 0%, #f6f8fb 60%, #f3f6fa 100%);
  border-radius: 18px;
}

@media (min-width: 1200px) {
  .plano-acao-5w2h {
    padding: 1rem 1.25rem 1.5rem;
  }
}

.plano-acao-5w2h .pa-command-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(248, 250, 252, 0.92) 100%
  );
  border: 1px solid var(--pa-border);
  border-left: 4px solid var(--pa-accent);
  box-shadow: var(--pa-shadow);
  padding: var(--pa-spacing) var(--pa-spacing-lg);
  border-radius: var(--pa-radius);
  margin-bottom: var(--pa-spacing-lg);
  backdrop-filter: blur(10px);
}

.plano-acao-5w2h .pa-command-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--pa-spacing);
  flex-wrap: wrap;
}

.plano-acao-5w2h .pa-command-row-1 {
  padding-bottom: var(--pa-spacing);
  border-bottom: 1px solid var(--pa-border);
}

.plano-acao-5w2h .pa-command-row-2 {
  padding-top: var(--pa-spacing);
  align-items: flex-start;
}

.plano-acao-5w2h .pa-command-left,
.plano-acao-5w2h .pa-command-right {
  display: flex;
  align-items: center;
  gap: var(--pa-spacing);
  flex-wrap: wrap;
}

.plano-acao-5w2h .pa-command-right {
  justify-content: flex-end;
}

.plano-acao-5w2h .pa-command-row-2 .pa-command-left {
  flex: 1 1 auto;
  min-width: 0;
  gap: 0.55rem;
}

.plano-acao-5w2h .pa-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--pa-ink);
  margin: 0;
  display: flex;
  align-items: center;
  letter-spacing: -0.02em;
}

.plano-acao-5w2h .pa-title i {
  color: var(--pa-accent);
}

.plano-acao-5w2h .pa-search-wrapper {
  position: relative;
  min-width: 220px;
  max-width: 340px;
  flex: 1 1 280px;
}

.plano-acao-5w2h .pa-search {
  width: 100%;
  padding: 0.48rem 0.8rem 0.48rem 2.15rem;
  border-radius: 999px;
  border: 1px solid var(--pa-border);
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.9);
}

.plano-acao-5w2h .pa-search:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.12);
}

.plano-acao-5w2h .pa-search-icon {
  position: absolute;
  left: 0.72rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(11, 18, 32, 0.5);
  font-size: 0.95rem;
}

.plano-acao-5w2h .pa-filter {
  min-width: 150px;
  max-width: 190px;
  flex: 0 1 180px;
}

@media (min-width: 1200px) {
  .plano-acao-5w2h .pa-command-row-2 .pa-command-left {
    flex-wrap: nowrap;
  }
}

@media (max-width: 1199.98px) {
  .plano-acao-5w2h .pa-command-row-2 .pa-command-left {
    width: 100%;
    flex-wrap: wrap;
  }

  .plano-acao-5w2h .pa-search-wrapper,
  .plano-acao-5w2h .pa-filter {
    max-width: none;
  }
}

.plano-acao-5w2h .pa-empty {
  display: flex;
  justify-content: center;
  margin-bottom: var(--pa-spacing-lg);
}

.plano-acao-5w2h .pa-empty-card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.94) 0%,
    rgba(248, 250, 252, 0.94) 100%
  );
  border: 1px dashed var(--pa-border-strong);
  border-radius: 18px;
  padding: 2.1rem;
  text-align: center;
  box-shadow: var(--pa-shadow);
  max-width: 640px;
}

.plano-acao-5w2h .pa-empty-icon {
  font-size: 2.1rem;
  color: var(--pa-accent);
  margin-bottom: 0.85rem;
}

.plano-acao-5w2h .pa-list-container {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(248, 250, 252, 0.92) 100%
  );
  border: 1px solid var(--pa-border);
  border-radius: 18px;
  box-shadow: var(--pa-shadow);
  padding: 0.5rem 0.75rem 1rem;
  margin-bottom: var(--pa-spacing-lg);
}

.plano-acao-5w2h .pa-view-switcher {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--pa-border);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--pa-shadow);
}

.plano-acao-5w2h .pa-view-btn {
  border: 0;
  background: transparent;
  color: var(--pa-ink-2);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition:
    background var(--pa-transition),
    color var(--pa-transition),
    box-shadow var(--pa-transition);
}

.plano-acao-5w2h .pa-view-btn i {
  font-size: 1rem;
}

.plano-acao-5w2h .pa-view-btn.active {
  background: var(--pa-accent);
  color: #fff;
  box-shadow: 0 8px 16px rgba(15, 118, 110, 0.25);
}

.plano-acao-5w2h .pa-view-btn:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.5);
  outline-offset: 2px;
}

.plano-acao-5w2h .pa-board-container {
  background: linear-gradient(
    180deg,
    rgba(246, 248, 252, 0.95) 0%,
    rgba(241, 245, 249, 0.95) 100%
  );
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  padding: 0.6rem 0.85rem 1rem;
  margin-bottom: var(--pa-spacing-lg);
}

.plano-acao-5w2h .pa-board {
  display: flex;
  gap: var(--pa-spacing);
  overflow-x: auto;
  padding: 0.5rem 0.25rem;
  scroll-snap-type: x proximity;
}

.plano-acao-5w2h .pa-board-col {
  flex: 0 0 290px;
  width: 290px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 16px;
  min-height: 180px;
  max-height: 70vh;
  scroll-snap-align: start;
}

.plano-acao-5w2h .pa-board-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  font-weight: 700;
  color: var(--pa-ink);
  background: rgba(241, 245, 249, 0.92);
  position: sticky;
  top: 0;
  z-index: 1;
}

.plano-acao-5w2h .pa-board-col-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.6rem 0.75rem 0.6rem 0.6rem;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 140px;
}

.plano-acao-5w2h .pa-board-card {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  padding: 0.65rem 0.75rem;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition:
    transform var(--pa-transition),
    box-shadow var(--pa-transition),
    border-color var(--pa-transition);
}

.plano-acao-5w2h .pa-board-card:hover,
.plano-acao-5w2h .pa-board-card:focus-visible {
  border-color: rgba(15, 118, 110, 0.28);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.1);
  transform: translateY(-1px);
  outline: none;
}

.plano-acao-5w2h .pa-board-card--concluido {
  border-left: 3px solid rgba(16, 185, 129, 0.7);
}

.plano-acao-5w2h .pa-board-card--em_andamento {
  border-left: 3px solid rgba(15, 118, 110, 0.7);
}

.plano-acao-5w2h .pa-board-card--rascunho {
  border-left: 3px solid rgba(100, 116, 139, 0.5);
}

.plano-acao-5w2h .pa-board-card--arquivado {
  border-left: 3px solid rgba(148, 163, 184, 0.7);
  opacity: 0.85;
}

.plano-acao-5w2h .pa-board-card--bloqueado {
  border-left: 3px solid rgba(245, 158, 11, 0.7);
}

.plano-acao-5w2h .pa-board-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.plano-acao-5w2h .pa-board-card-title {
  font-weight: 700;
  color: var(--pa-ink);
}

.plano-acao-5w2h .pa-board-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.plano-acao-5w2h .pa-board-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.9);
  color: var(--pa-ink-3);
  white-space: nowrap;
}

.plano-acao-5w2h .pa-board-badge--done {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.35);
  color: #047857;
}

.plano-acao-5w2h .pa-board-badge--status.pa-status-em_andamento {
  background: rgba(15, 118, 110, 0.12);
  border-color: rgba(15, 118, 110, 0.25);
  color: #1d4ed8;
}

.plano-acao-5w2h .pa-board-badge--status.pa-status-concluido {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.35);
  color: #047857;
}

.plano-acao-5w2h .pa-board-badge--status.pa-status-rascunho {
  background: rgba(100, 116, 139, 0.14);
  border-color: rgba(100, 116, 139, 0.28);
  color: #475569;
}

.plano-acao-5w2h .pa-board-badge--status.pa-status-arquivado {
  background: rgba(148, 163, 184, 0.2);
  border-color: rgba(148, 163, 184, 0.35);
  color: #64748b;
}

.plano-acao-5w2h .pa-board-badge--status.pa-status-bloqueado {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.35);
  color: #92400e;
}

.plano-acao-5w2h .pa-board-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0.5rem;
}

.plano-acao-5w2h .pa-board-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.9);
  color: var(--pa-ink-3);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.plano-acao-5w2h .pa-board-chip--muted {
  background: rgba(248, 250, 252, 0.9);
}

.plano-acao-5w2h .pa-board-card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.plano-acao-5w2h .pa-board-card-actions .btn {
  padding: 0.18rem 0.45rem;
  font-size: 0.72rem;
  white-space: nowrap;
}

.plano-acao-5w2h .pa-board-card-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
}

.plano-acao-5w2h .pa-board-card--dragging {
  opacity: 0.7;
  transform: scale(0.995);
}

.plano-acao-5w2h .pa-board-col-body.is-drag-over {
  outline: 2px dashed rgba(15, 118, 110, 0.35);
  outline-offset: 2px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.06);
}

.plano-acao-5w2h .pa-board-chip--recent {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.28);
  color: #047857;
}

.plano-acao-5w2h .pa-board-chip--stale {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.32);
  color: #92400e;
}

.plano-acao-5w2h .pa-table {
  margin-bottom: 0;
}

.plano-acao-5w2h .pa-table tbody tr {
  transition: background var(--pa-transition);
}

.plano-acao-5w2h .pa-table tbody tr:hover {
  background: rgba(15, 118, 110, 0.045);
}

.plano-acao-5w2h .pa-minhas-pendencias-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--pa-spacing);
  margin-bottom: var(--pa-spacing-lg);
}

.plano-acao-5w2h .pa-minhas-pendencias-kpi {
  background: var(--pa-card);
  border: 1px solid var(--pa-border);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  box-shadow: var(--pa-shadow);
}

.plano-acao-5w2h .pa-minhas-pendencias-kpi-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pa-ink-3);
  margin-bottom: 0.35rem;
}

.plano-acao-5w2h .pa-minhas-pendencias-kpi-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--pa-ink);
}

.plano-acao-5w2h .pa-minhas-pendencias-chart {
  background: var(--pa-card);
  border: 1px solid var(--pa-border);
  border-radius: 12px;
  padding: 0.75rem;
  box-shadow: var(--pa-shadow);
  margin-bottom: var(--pa-spacing-lg);
  max-height: 320px;
}

.plano-acao-5w2h .pa-minhas-pendencias-chart canvas {
  max-height: 280px;
}

.plano-acao-5w2h .pa-minhas-pendencias-row--overdue {
  border-left: 4px solid #dc3545;
  background: rgba(220, 53, 69, 0.06);
}

.plano-acao-5w2h .pa-minhas-pendencias-row--due-soon {
  border-left: 4px solid #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.plano-acao-5w2h .pa-etapa-card.pa-etapa-flash {
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.35);
  animation: pa-etapa-flash 1.5s ease-out;
}

@keyframes pa-etapa-flash {
  0% {
    background-color: rgba(15, 118, 110, 0.18);
  }
  100% {
    background-color: transparent;
  }
}

.plano-acao-5w2h .pa-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pa-ink-3);
}

.plano-acao-5w2h .pa-progress {
  min-width: 160px;
}

.plano-acao-5w2h .pa-progress-bar {
  height: 7px;
  background: rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.35rem;
}

.plano-acao-5w2h .pa-progress-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--pa-accent), #1d4ed8);
}

.plano-acao-5w2h .pa-chip-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.18);
  color: rgba(11, 18, 32, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.plano-acao-5w2h .pa-chip-status i {
  font-size: 0.85rem;
  line-height: 1;
}

.plano-acao-5w2h .pa-chip-status.pa-status-concluido {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.3);
  color: #047857;
}

.plano-acao-5w2h .pa-chip-status.pa-status-em_andamento {
  background: rgba(29, 78, 216, 0.14);
  border-color: rgba(29, 78, 216, 0.3);
  color: #1d4ed8;
}

.plano-acao-5w2h .pa-chip-status.pa-status-arquivado {
  background: rgba(71, 85, 105, 0.1);
  border-color: rgba(71, 85, 105, 0.22);
  color: #334155;
}

.plano-acao-5w2h .pa-chip-status.pa-status-bloqueado {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.32);
  color: #92400e;
}

.plano-acao-5w2h .pa-chip-status.pa-status-rascunho {
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(100, 116, 139, 0.22);
  color: #334155;
}

.plano-acao-5w2h .pa-table .btn-group .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.5rem;
  white-space: nowrap;
}

.plano-acao-5w2h .pa-table .btn-group .btn i {
  font-size: 0.95rem;
}

.plano-acao-5w2h .pa-table tbody tr.pa-row-arquivado {
  color: var(--ed-gray-600);
  background: rgba(148, 163, 184, 0.08);
}

.plano-acao-5w2h .pa-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 1200px;
  height: 100vh;
  z-index: 1040;
  pointer-events: none;
  transition: all var(--pa-transition);
}

.plano-acao-5w2h .pa-drawer.full {
  max-width: none;
}

.plano-acao-5w2h .pa-drawer.show {
  pointer-events: auto;
}

.plano-acao-5w2h .pa-drawer-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.5);
  opacity: 0;
  backdrop-filter: blur(4px);
  transition: opacity var(--pa-transition);
}

.plano-acao-5w2h .pa-drawer.show .pa-drawer-backdrop {
  opacity: 1;
}

.plano-acao-5w2h .pa-drawer-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: var(--pa-surface);
  box-shadow: var(--pa-shadow-lg);
  transform: translateX(100%);
  transition: transform var(--pa-transition);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.plano-acao-5w2h .pa-drawer.full .pa-drawer-content {
  width: 96vw;
  border-radius: 16px 0 0 16px;
}

.plano-acao-5w2h .pa-drawer.show .pa-drawer-content {
  transform: translateX(0);
}

.plano-acao-5w2h .pa-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--pa-spacing);
  padding: var(--pa-spacing-lg);
  border-bottom: 1px solid var(--pa-border);
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
}

.plano-acao-5w2h .pa-drawer-title {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ed-gray-900);
  flex: 1;
  min-width: 0;
}

.plano-acao-5w2h .pa-plan-header-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 992px) {
  .plano-acao-5w2h .pa-plan-header-grid {
    grid-template-columns: 1fr;
  }
}

.plano-acao-5w2h .pa-plan-header-card,
.plano-acao-5w2h .pa-drawer-desc {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  padding: 0.6rem 0.75rem;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.plano-acao-5w2h .pa-plan-header-card .form-label,
.plano-acao-5w2h .pa-drawer-desc .form-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--pa-ink-3);
}

.plano-acao-5w2h .pa-title-input {
  max-width: 520px;
}

.plano-acao-5w2h .pa-plan-header-grid .pa-title-input {
  max-width: none;
}

.plano-acao-5w2h .pa-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border: none;
  border-radius: var(--pa-radius-sm);
  background: transparent;
  color: var(--ed-gray-600);
  transition: all var(--pa-transition);
}

.plano-acao-5w2h .pa-drawer-close:hover {
  background: var(--ed-gray-100);
  color: var(--ed-gray-900);
}

.plano-acao-5w2h .pa-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--pa-spacing-lg);
  display: flex;
  flex-direction: column;
  gap: var(--pa-spacing-lg);
}

.plano-acao-5w2h .pa-archived-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--pa-spacing);
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(100, 116, 139, 0.35);
  border-radius: var(--pa-radius);
  background: rgba(100, 116, 139, 0.08);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.plano-acao-5w2h .pa-archived-banner-text strong {
  color: var(--ed-gray-900);
}

.plano-acao-5w2h .pa-drawer-meta {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: var(--pa-spacing);
  padding: var(--pa-spacing);
  border: 1px solid var(--pa-border);
  border-radius: var(--pa-radius);
  background: var(--ed-gray-50);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.plano-acao-5w2h .pa-meta-fields,
.plano-acao-5w2h .pa-meta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--pa-spacing);
  align-items: center;
}

.plano-acao-5w2h .pa-meta-fields > .form-select,
.plano-acao-5w2h .pa-meta-fields > .form-control {
  flex: 1 1 220px;
  min-width: 220px;
}

.plano-acao-5w2h .pa-meta-actions .btn,
.plano-acao-5w2h .pa-etapa-actions .btn,
.plano-acao-5w2h .pa-etapas-toolbar .btn {
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.plano-acao-5w2h .pa-meta-actions .btn-outline-secondary,
.plano-acao-5w2h .pa-etapa-actions .btn-outline-secondary {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.45);
}

.plano-acao-5w2h .pa-meta-updated:empty {
  display: none;
}

.plano-acao-5w2h .pa-etapas-wrapper {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: calc(var(--pa-radius) + 4px);
  padding: var(--pa-spacing);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(248, 250, 252, 0.96) 100%
  );
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.plano-acao-5w2h .pa-etapas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--pa-spacing);
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: calc(var(--pa-radius) + 4px);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(240, 249, 255, 0.9) 100%
  );
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.1);
  position: relative;
  position: sticky;
  top: 0;
  z-index: 2;
  margin-bottom: var(--pa-spacing);
}

.plano-acao-5w2h .pa-etapas-toolbar::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(15, 118, 110, 0),
    rgba(15, 118, 110, 0.55),
    rgba(29, 78, 216, 0.4)
  );
}

.plano-acao-5w2h .pa-etapas-toolbar-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.plano-acao-5w2h .pa-etapas-toolbar-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--pa-ink);
}

.plano-acao-5w2h .pa-etapas-toolbar-sub {
  font-size: 0.78rem;
  color: var(--pa-ink-3);
}

.plano-acao-5w2h .pa-etapas-toolbar-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  text-align: right;
}

.plano-acao-5w2h .pa-etapas-toolbar-hint {
  font-size: 0.72rem;
  color: var(--pa-ink-3);
}

.plano-acao-5w2h .pa-etapas-wrapper.pa-etapas-collapsed {
  padding-bottom: 0.5rem;
}

.plano-acao-5w2h .pa-etapas-wrapper.pa-etapas-collapsed .pa-kpis,
.plano-acao-5w2h .pa-etapas-wrapper.pa-etapas-collapsed .pa-etapas-list,
.plano-acao-5w2h .pa-etapas-wrapper.pa-etapas-collapsed .pa-empty-inline {
  display: none;
}

.plano-acao-5w2h .pa-etapas-wrapper.pa-etapas-compact .pa-etapas-list {
  gap: 0.6rem;
}

.plano-acao-5w2h .pa-etapas-wrapper.pa-etapas-compact .pa-etapa-card {
  padding: 0.6rem 0.7rem;
}

.plano-acao-5w2h
  .pa-etapas-wrapper.pa-etapas-compact
  .pa-etapa-card:not(.pa-etapa-expanded)
  .pa-etapa-top,
.plano-acao-5w2h
  .pa-etapas-wrapper.pa-etapas-compact
  .pa-etapa-card:not(.pa-etapa-expanded)
  .pa-etapa-details {
  display: none;
}

.plano-acao-5w2h
  .pa-etapas-wrapper.pa-etapas-compact
  .pa-etapa-card:not(.pa-etapa-expanded)
  .pa-etapa-summary {
  display: flex;
}

.plano-acao-5w2h
  .pa-etapas-wrapper.pa-etapas-compact
  .pa-etapa-card.pa-etapa-expanded
  .pa-etapa-summary {
  display: none;
}

.plano-acao-5w2h
  .pa-etapas-wrapper.pa-etapas-compact
  .pa-etapa-card.pa-etapa-expanded {
  border-color: rgba(15, 118, 110, 0.32);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
}

.plano-acao-5w2h .pa-etapa-collapse-btn {
  display: none;
}

.plano-acao-5w2h
  .pa-etapas-wrapper.pa-etapas-compact
  .pa-etapa-card.pa-etapa-expanded
  .pa-etapa-collapse-btn {
  display: inline-flex;
}

.plano-acao-5w2h .pa-drawer.pa-etapas-focus .pa-drawer-meta,
.plano-acao-5w2h .pa-drawer.pa-etapas-focus .pa-historico {
  display: none;
}

.plano-acao-5w2h .pa-drawer.pa-etapas-focus .pa-kpis {
  display: none;
}

.plano-acao-5w2h .pa-drawer.pa-etapas-compact-view .pa-drawer-title,
.plano-acao-5w2h .pa-drawer.pa-etapas-compact-view .pa-drawer-meta,
.plano-acao-5w2h .pa-drawer.pa-etapas-compact-view .pa-historico,
.plano-acao-5w2h .pa-drawer.pa-etapas-compact-view .pa-kpis,
.plano-acao-5w2h .pa-drawer.pa-etapas-compact-view .pa-archived-banner {
  display: none;
}

.plano-acao-5w2h .pa-drawer.pa-etapas-focus .pa-drawer-body {
  gap: var(--pa-spacing);
  padding-top: var(--pa-spacing);
}

.plano-acao-5w2h .pa-drawer.pa-etapas-focus .pa-etapas-wrapper {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: var(--pa-spacing-lg);
}

.plano-acao-5w2h .pa-drawer.pa-etapas-focus .pa-drawer-content {
  background: linear-gradient(
    180deg,
    rgba(241, 245, 249, 0.9) 0%,
    rgba(248, 250, 252, 0.95) 100%
  );
}

.plano-acao-5w2h .pa-drawer-desc textarea.form-control {
  resize: vertical;
  min-height: 2.6rem;
}

@media (max-width: 576px) {
  .plano-acao-5w2h .pa-etapas-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .plano-acao-5w2h .pa-etapas-toolbar-actions {
    align-items: flex-start;
    text-align: left;
  }
}

.plano-acao-5w2h .pa-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--pa-spacing);
  margin-bottom: var(--pa-spacing);
}

.plano-acao-5w2h .pa-kpi-card {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(240, 249, 255, 0.9) 100%
  );
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: calc(var(--pa-radius) + 4px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  padding: 0.75rem 0.9rem;
  min-width: 0;
  --pa-kpi-accent: var(--pa-accent);
}

.plano-acao-5w2h .pa-kpi-card[data-kpi="progress"] {
  --pa-kpi-accent: var(--pa-accent);
}
.plano-acao-5w2h .pa-kpi-card[data-kpi="tasks"] {
  --pa-kpi-accent: #1d4ed8;
}
.plano-acao-5w2h .pa-kpi-card[data-kpi="overdue"] {
  --pa-kpi-accent: #ef4444;
}
.plano-acao-5w2h .pa-kpi-card[data-kpi="dueSoon"] {
  --pa-kpi-accent: #f59e0b;
}
.plano-acao-5w2h .pa-kpi-card[data-kpi="blocked"] {
  --pa-kpi-accent: #f97316;
}

.plano-acao-5w2h .pa-kpi-card.is-attn {
  border-color: var(--pa-kpi-accent);
  box-shadow:
    0 0 0 2px rgba(15, 23, 42, 0.08),
    0 22px 48px rgba(15, 23, 42, 0.14);
}

.plano-acao-5w2h .pa-kpi-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.plano-acao-5w2h .pa-kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 118, 110, 0.14);
  border: 1px solid rgba(15, 118, 110, 0.2);
  color: var(--pa-kpi-accent);
  flex: 0 0 auto;
}

.plano-acao-5w2h .pa-kpi-icon i {
  font-size: 0.95rem;
}

.plano-acao-5w2h .pa-kpi-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ed-gray-600);
}

.plano-acao-5w2h .pa-kpi-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ed-gray-900);
  line-height: 1.15;
  margin-top: 0.15rem;
}

.plano-acao-5w2h .pa-kpi-sub {
  font-size: 0.82rem;
  color: var(--ed-gray-600);
  margin-top: 0.15rem;
}

.plano-acao-5w2h .pa-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--ed-gray-300);
  border: 1px solid rgba(15, 23, 42, 0.15);
  flex: 0 0 auto;
}

.plano-acao-5w2h .pa-dot-verde {
  background: #22c55e;
  border-color: rgba(34, 197, 94, 0.35);
}

.plano-acao-5w2h .pa-dot-amarelo {
  background: #f59e0b;
  border-color: rgba(245, 158, 11, 0.4);
}

.plano-acao-5w2h .pa-dot-vermelho {
  background: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

.plano-acao-5w2h .pa-dot-azul {
  background: #0f766e;
  border-color: rgba(15, 118, 110, 0.4);
}

.plano-acao-5w2h .pa-dot-cinza {
  background: var(--ed-gray-300);
  border-color: rgba(100, 116, 139, 0.35);
}

.plano-acao-5w2h .pa-anexos-badge {
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  padding: 0.22rem 0.45rem;
  border-radius: 999px;
}

.plano-acao-5w2h .pa-anexos-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.plano-acao-5w2h .pa-etapas-list {
  display: flex;
  flex-direction: column;
  gap: var(--pa-spacing);
  min-width: 0;
}

.plano-acao-5w2h .pa-etapa-card {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
  position: relative;
  overflow: hidden;
  padding: 0.75rem;
  min-width: 0;
}

.plano-acao-5w2h .pa-etapa-summary {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(241, 245, 249, 0.95) 100%
  );
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.plano-acao-5w2h .pa-etapa-summary-main {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.plano-acao-5w2h .pa-etapa-summary-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--pa-ink);
  min-width: 0;
}

.plano-acao-5w2h .pa-etapa-summary-num {
  font-weight: 800;
  color: var(--pa-ink-3);
}

.plano-acao-5w2h .pa-etapa-summary-what {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plano-acao-5w2h .pa-etapa-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  font-size: 0.76rem;
  color: var(--pa-ink-3);
}

.plano-acao-5w2h .pa-etapa-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(248, 250, 252, 0.9);
}

.plano-acao-5w2h .pa-etapa-summary-chip i {
  font-size: 0.8rem;
}

.plano-acao-5w2h .pa-etapa-summary-status {
  background: rgba(226, 232, 240, 0.7);
  border-color: rgba(148, 163, 184, 0.45);
  font-weight: 600;
}

.plano-acao-5w2h .pa-etapa-summary-blocked {
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(254, 243, 199, 0.8);
}

.plano-acao-5w2h .pa-etapa-summary-fase {
  background: rgba(15, 118, 110, 0.12);
  border-color: rgba(15, 118, 110, 0.3);
  color: #134e4a;
}

.plano-acao-5w2h .pa-etapa-summary-periodo {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.32);
  color: #065f46;
}

.plano-acao-5w2h .pa-etapa-summary-user {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.28);
  color: #5b21b6;
}

.plano-acao-5w2h .pa-etapa-summary-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}

@media (max-width: 768px) {
  .plano-acao-5w2h .pa-etapa-summary {
    flex-direction: column;
    align-items: flex-start;
  }
  .plano-acao-5w2h .pa-etapa-summary-what {
    white-space: normal;
  }
  .plano-acao-5w2h .pa-etapa-summary-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

.plano-acao-5w2h .pa-etapa-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    rgba(14, 165, 233, 0.35),
    rgba(124, 58, 237, 0.28),
    rgba(16, 185, 129, 0.3)
  );
}

.plano-acao-5w2h .pa-etapa-card.pa-farol-verde {
  border-left: 4px solid #22c55e;
}
.plano-acao-5w2h .pa-etapa-card.pa-farol-amarelo {
  border-left: 4px solid #f59e0b;
}
.plano-acao-5w2h .pa-etapa-card.pa-farol-vermelho {
  border-left: 4px solid #ef4444;
}
.plano-acao-5w2h .pa-etapa-card.pa-farol-cinza {
  border-left: 4px solid var(--ed-gray-300);
}

.plano-acao-5w2h .pa-etapa-card:hover {
  border-color: rgba(15, 118, 110, 0.28);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

.plano-acao-5w2h .pa-etapa-card:focus-within {
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow:
    0 0 0 2px rgba(15, 118, 110, 0.08),
    0 14px 34px rgba(15, 23, 42, 0.12);
}

.plano-acao-5w2h .pa-etapa-top {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr) minmax(
      240px,
      360px
    );
  gap: 0.65rem;
  align-items: start;
}

@media (max-width: 992px) {
  .plano-acao-5w2h .pa-etapa-top {
    grid-template-columns: 1fr;
  }
}

.plano-acao-5w2h .pa-etapa-leading {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.4rem 0.5rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.94) 0%,
    rgba(241, 245, 249, 0.88) 100%
  );
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}

.plano-acao-5w2h .pa-step-farol {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--pa-ink-3);
  flex: 0 0 100%;
  margin-top: 0.2rem;
}

.plano-acao-5w2h .pa-step-farol-text {
  line-height: 1.2;
}

.plano-acao-5w2h .pa-etapa-leading .pa-etapa-num {
  font-weight: 800;
  color: var(--ed-gray-700);
}

.plano-acao-5w2h .pa-chip-fase {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plano-acao-5w2h .pa-etapa-card.is-blocked {
  border-color: rgba(245, 158, 11, 0.35);
}

.plano-acao-5w2h .pa-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--ed-primary, #0f766e);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
  border: 2px solid var(--pa-surface, #ffffff);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  cursor: default;
}

.plano-acao-5w2h .pa-etapa-blocked-banner {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.12);
  color: var(--ed-gray-900);
  font-size: 0.82rem;
}

.plano-acao-5w2h .pa-etapa-what {
  min-width: 0;
}

.plano-acao-5w2h .pa-etapa-trailing {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.plano-acao-5w2h .pa-etapa-required {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

.plano-acao-5w2h .pa-required-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

@media (max-width: 1100px) {
  .plano-acao-5w2h .pa-required-row {
    grid-template-columns: 1fr;
  }
}

.plano-acao-5w2h .pa-required-field {
  position: relative;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.98) 0%,
    var(--req-soft) 100%
  );
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  padding: 0.6rem 0.7rem;
  overflow: hidden;
  --req-accent: #1d4ed8;
  --req-accent-2: #2dd4bf;
  --req-soft: rgba(59, 130, 246, 0.08);
}

.plano-acao-5w2h .pa-required-field::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    rgba(29, 78, 216, 0.35),
    rgba(96, 165, 250, 0.35)
  );
}

.plano-acao-5w2h .pa-required-field.is-fase {
  --req-accent: #1d4ed8;
  --req-accent-2: #2dd4bf;
  --req-soft: rgba(59, 130, 246, 0.08);
}

.plano-acao-5w2h .pa-required-field.is-what {
  --req-accent: #1d4ed8;
  --req-accent-2: #2dd4bf;
  --req-soft: rgba(59, 130, 246, 0.08);
}

.plano-acao-5w2h .pa-required-field.is-what textarea {
  min-height: 3.1rem;
}

.plano-acao-5w2h .pa-required-field.is-when {
  --req-accent: #1d4ed8;
  --req-accent-2: #2dd4bf;
  --req-soft: rgba(59, 130, 246, 0.08);
}

.plano-acao-5w2h .pa-required-field.is-who {
  --req-accent: #1d4ed8;
  --req-accent-2: #2dd4bf;
  --req-soft: rgba(59, 130, 246, 0.08);
}

.plano-acao-5w2h .pa-required-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
}

.plano-acao-5w2h .pa-required-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(29, 78, 216, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.18);
}

.plano-acao-5w2h .pa-required-title {
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(15, 23, 42, 0.75);
}

.plano-acao-5w2h .pa-required-star {
  color: #ef4444;
}

.plano-acao-5w2h .pa-required-body .form-control {
  border-radius: 12px;
  border-color: rgba(148, 163, 184, 0.35);
  background: #f8fafc;
}

.plano-acao-5w2h .pa-required-body .form-control:focus {
  border-color: var(--req-accent);
  box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.14);
}

.plano-acao-5w2h .pa-required-when-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.plano-acao-5w2h .pa-required-when-grid > * {
  min-width: 0;
}

.plano-acao-5w2h .pa-required-when-grid .input-group {
  width: 100%;
  flex-wrap: nowrap;
}

.plano-acao-5w2h .pa-required-when-grid .input-group > .form-control {
  min-width: 0;
}

@media (max-width: 900px) {
  .plano-acao-5w2h .pa-required-when-grid {
    grid-template-columns: 1fr;
  }
}

.plano-acao-5w2h .pa-etapa-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  padding: 0.45rem;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.plano-acao-5w2h .pa-etapa-status {
  min-width: 160px;
  flex: 1 1 160px;
}

.plano-acao-5w2h .pa-etapa-meta .form-select {
  min-width: 110px;
}

.plano-acao-5w2h .pa-etapa-meta .pa-etapa-input[data-field="when_inicio"],
.plano-acao-5w2h .pa-etapa-meta .pa-etapa-input[data-field="when_fim"] {
  flex: 1 1 140px;
  min-width: 140px;
}

.plano-acao-5w2h .pa-etapa-meta .form-check {
  margin-bottom: 0;
  flex: 0 1 auto;
}

@media (max-width: 576px) {
  .plano-acao-5w2h .pa-etapa-meta {
    justify-content: flex-start;
  }
  .plano-acao-5w2h .pa-etapa-actions {
    justify-content: flex-start;
  }
}

.plano-acao-5w2h .pa-etapa-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-wrap: wrap;
  min-width: 240px;
}

@media (max-width: 992px) {
  .plano-acao-5w2h .pa-etapa-actions {
    align-items: flex-start;
  }
}

.plano-acao-5w2h .pa-flow-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.plano-acao-5w2h .pa-flow-graph {
  height: 70vh;
  min-height: 520px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 12px;
  background: #ffffff;
}

.plano-acao-5w2h .pa-etapa-details {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--pa-border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.plano-acao-5w2h .pa-etapa-details textarea.form-control,
.plano-acao-5w2h .pa-etapa-details input.form-control {
  min-height: 2.3rem;
}

.plano-acao-5w2h .pa-etapa-details input[data-field="how_much"] {
  min-height: 2.3rem;
}

/* 5W2H: grid de cards (detalhes) */
.plano-acao-5w2h .pa-etapa-details-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
}

.plano-acao-5w2h .pa-5w2h-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--pa-spacing);
}

.plano-acao-5w2h .pa-5w2h-field-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
  padding: 0.55rem 0.65rem;
  min-width: 0;
  transition:
    transform var(--pa-transition),
    border-color var(--pa-transition);
}

.plano-acao-5w2h .pa-5w2h-field-card:hover {
  border-color: rgba(15, 118, 110, 0.28);
  transform: translateY(-1px);
}

.plano-acao-5w2h .pa-5w2h-field-card:focus-within {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
  transform: translateY(-1px);
}

.plano-acao-5w2h .pa-5w2h-field-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.plano-acao-5w2h .pa-5w2h-field-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pa-accent-soft);
  color: var(--pa-accent);
  border: 1px solid rgba(15, 118, 110, 0.22);
  flex: 0 0 auto;
}

.plano-acao-5w2h .pa-5w2h-field-title {
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pa-ink-3);
  margin: 0;
}

.plano-acao-5w2h .pa-5w2h-field-body .form-control,
.plano-acao-5w2h .pa-5w2h-field-body .form-select {
  border-radius: 12px;
  border-color: rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.92);
}

.plano-acao-5w2h .pa-5w2h-field-body .form-control:focus,
.plano-acao-5w2h .pa-5w2h-field-body .form-select:focus {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.12);
}

.plano-acao-5w2h .pa-etapa-select.pa-etapa-status {
  min-width: 165px;
}

.plano-acao-5w2h .pa-etapa-select.pa-etapa-farol {
  min-width: 110px;
}

.plano-acao-5w2h .pa-etapa-status-nao_iniciado {
  border-color: rgba(100, 116, 139, 0.5);
}
.plano-acao-5w2h .pa-etapa-status-em_andamento {
  border-color: rgba(15, 118, 110, 0.5);
}
.plano-acao-5w2h .pa-etapa-status-bloqueado {
  border-color: rgba(245, 158, 11, 0.6);
}
.plano-acao-5w2h .pa-etapa-status-em_validacao {
  border-color: rgba(14, 165, 233, 0.6);
}
.plano-acao-5w2h .pa-etapa-status-concluido {
  border-color: rgba(16, 185, 129, 0.6);
}
.plano-acao-5w2h .pa-etapa-status-cancelado {
  border-color: rgba(107, 114, 128, 0.55);
}

@media (max-width: 768px) {
  .plano-acao-5w2h .pa-etapa-details {
    gap: var(--pa-spacing);
  }
}

.plano-acao-5w2h .pa-drag-handle {
  cursor: grab;
  color: var(--ed-gray-500);
  border: 1px solid var(--pa-border);
  background: var(--ed-gray-100);
}

.plano-acao-5w2h .pa-drag-armed .pa-drag-handle {
  cursor: grabbing;
}

.plano-acao-5w2h .pa-dragging {
  opacity: 0.6;
}

.plano-acao-5w2h .pa-etapa-text {
  min-width: 0;
  width: 100%;
  resize: vertical;
  overflow: hidden;
  min-height: 2.2rem;
  border-radius: var(--pa-radius-sm);
}

.plano-acao-5w2h .pa-etapa-card.done .pa-etapa-text {
  text-decoration: line-through;
  color: var(--ed-gray-500);
  background: #f8fafc;
}

.plano-acao-5w2h .pa-etapa-num {
  font-weight: 700;
  color: var(--ed-gray-600);
}

.plano-acao-5w2h .pa-etapa-card .form-control,
.plano-acao-5w2h .pa-etapa-card .form-select {
  min-width: 0;
}

.plano-acao-5w2h .pa-empty-inline {
  text-align: center;
  font-size: 0.85rem;
  color: var(--ed-gray-500);
  padding: 1rem;
}

.plano-acao-5w2h .pa-historico {
  border: 1px solid var(--pa-border);
  border-radius: var(--pa-radius);
  padding: var(--pa-spacing);
  background: var(--pa-surface);
  box-shadow: var(--pa-shadow);
}

.plano-acao-5w2h .pa-historico-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.plano-acao-5w2h .pa-historico-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 260px;
  overflow-y: auto;
}

.plano-acao-5w2h .pa-historico-item {
  padding: 0.6rem 0.75rem;
  border-radius: var(--pa-radius-sm);
  background: var(--ed-gray-50);
  border: 1px solid var(--pa-border);
}

.plano-acao-5w2h .pa-historico-list .pa-historico-item:nth-child(odd) {
  background: #ffffff;
}

.plano-acao-5w2h .pa-historico-list .pa-historico-item:nth-child(even) {
  background: #f1f5f9;
  border-left: 3px solid rgba(15, 118, 110, 0.25);
}

.plano-acao-5w2h .pa-historico-item strong {
  color: var(--ed-gray-900);
}

.plano-acao-5w2h .pa-anexos-upload {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.plano-acao-5w2h .pa-anexos-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.plano-acao-5w2h .pa-anexo-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--pa-border);
  border-radius: var(--pa-radius-sm);
  background: var(--ed-gray-50);
}

.plano-acao-5w2h #pa-pendencias-body .pa-anexo-card {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.28);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.plano-acao-5w2h #pa-pendencias-body .pa-anexo-card:nth-child(even) {
  background: #f8fafc;
}

.plano-acao-5w2h #pa-pendencias-body .pa-anexo-card:hover {
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.plano-acao-5w2h .pa-anexo-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

/* ========== PLANO DE AÇÃO • PREVIEW (Modal - somente leitura) ========== */
.pa-preview-wrap {
  --pa-bg: #eef2f7;
  --pa-surface: #f7f9fc;
  --pa-card: #ffffff;
  --pa-border: rgba(15, 23, 42, 0.12);
  --pa-border-strong: rgba(15, 23, 42, 0.18);
  --pa-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  --pa-radius: 16px;
  --pa-radius-sm: 12px;
  --pa-accent: #0f766e;
  --pa-ink: #0b1220;
  --pa-ink-2: rgba(11, 18, 32, 0.72);
  --pa-ink-3: rgba(11, 18, 32, 0.56);

  padding: 0.9rem;
  border-radius: 18px;
  background:
    radial-gradient(
      1200px 520px at 18% -10%,
      rgba(15, 118, 110, 0.1) 0%,
      rgba(15, 118, 110, 0) 55%
    ),
    radial-gradient(
      900px 420px at 92% 0%,
      rgba(30, 64, 175, 0.08) 0%,
      rgba(30, 64, 175, 0) 58%
    ),
    linear-gradient(180deg, var(--pa-bg) 0%, #f6f8fb 60%, #f3f6fa 100%);
}

.pa-preview-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (max-width: 1200px) {
  .pa-preview-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .pa-preview-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pa-preview-kpi {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.94) 0%,
    rgba(248, 250, 252, 0.94) 100%
  );
  border: 1px solid var(--pa-border);
  border-left: 4px solid var(--pa-accent);
  border-radius: var(--pa-radius);
  box-shadow: var(--pa-shadow);
  padding: 0.85rem 1rem;
  min-height: 92px;
}

.pa-preview-kpi .pa-preview-kpi-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pa-ink-3);
}

.pa-preview-kpi .pa-preview-kpi-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--pa-ink);
  line-height: 1.1;
  margin-top: 0.2rem;
}

.pa-preview-kpi .pa-preview-kpi-sub {
  font-size: 0.82rem;
  color: var(--pa-ink-2);
  margin-top: 0.15rem;
}

.pa-preview-progress .progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.1);
  overflow: hidden;
}

.pa-preview-progress .progress-bar {
  background: linear-gradient(90deg, var(--pa-accent), #1d4ed8);
}

.pa-preview-etapas {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(248, 250, 252, 0.92) 100%
  );
  border: 1px solid var(--pa-border);
  border-radius: 18px;
  box-shadow: var(--pa-shadow);
  padding: 0.75rem;
}

.pa-preview-etapas .table {
  margin-bottom: 0;
}

.pa-preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid var(--pa-border);
  background: rgba(255, 255, 255, 0.8);
  color: var(--pa-ink-2);
  white-space: nowrap;
}

.pa-preview-badge.pa-preview-badge-success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.25);
  color: #047857;
}

.pa-preview-badge.pa-preview-badge-warning {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.28);
  color: #92400e;
}

.pa-preview-badge.pa-preview-badge-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.22);
  color: #b91c1c;
}

.pa-preview-badge.pa-preview-badge-secondary {
  background: rgba(71, 85, 105, 0.1);
  border-color: rgba(71, 85, 105, 0.22);
  color: #334155;
}

.pa-preview-more summary {
  cursor: pointer;
  user-select: none;
}

.pa-preview-more summary:hover {
  color: var(--pa-ink);
}

/* ========== PLANO DE AÇÃO: INSIGHTS ========== */
.pa-insights-kpis .pa-insights-kpi {
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.pa-insights-kpis .pa-insights-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pa-insights-charts .pa-insights-chart-card {
  min-height: 300px;
}

.pa-insights-canvas-wrap {
  position: relative;
  height: 250px;
  width: 100%;
}

.pa-insights-canvas-wrap canvas {
  max-height: 100%;
}

@media (max-width: 768px) {
  .pa-insights-canvas-wrap {
    height: 200px;
  }
}

/* ========== WORKFLOWS ========== */
.wf-header-card {
  border: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 60%);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  overflow: visible !important;
  position: relative;
  z-index: 5;
}

.wf-filters-card {
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.wf-table-card {
  border: 1px solid #e2e8f0;
}

.wf-calendar-card {
  border: 1px solid #e2e8f0;
}

.wf-base-card {
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.wf-base-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.04em;
}

.wf-base-table td {
  font-size: 0.88rem;
}

.wf-base-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.wf-base-actions .btn {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.55rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wf-base-actions .btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.wf-base-freq {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  font-size: 0.72rem;
  font-weight: 600;
}

.wf-table {
  font-size: 0.92rem;
}

.wf-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
}

.wf-table td {
  vertical-align: middle;
}

.wf-table th:nth-child(2),
.wf-table td:nth-child(2) {
  width: 36%;
  min-width: 260px;
}

.wf-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.04);
}

.wf-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
  max-width: 480px;
}

.wf-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.34;
  max-width: 480px;
  margin-top: 0.2rem;
}

.wf-actions-cell {
  width: 96px;
  min-width: 96px;
}

.wf-actions-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.42rem;
}

.wf-btn-check,
.wf-btn-pop {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.62rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wf-btn-pop {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.wf-btn-pop:hover,
.wf-btn-pop:focus-visible {
  border-color: #94a3b8;
  background: #eef2ff;
  color: #1d4ed8;
}

.wf-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.wf-badge--done {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
  border-color: rgba(22, 163, 74, 0.25);
}

.wf-badge--overdue {
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
  border-color: rgba(220, 38, 38, 0.2);
}

.wf-badge--due {
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.25);
}

.wf-badge--pending {
  background: rgba(148, 163, 184, 0.18);
  color: #475569;
  border-color: rgba(148, 163, 184, 0.3);
}

.wf-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  border: 1px solid #cbd5f5;
}

.wf-side-card {
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.wf-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.wf-summary-item strong {
  display: block;
  font-size: 1.1rem;
  color: #0f172a;
}

.wf-chart-wrap {
  min-height: 220px;
}

.wf-empty-state {
  border: 1px dashed #cbd5f5;
}

.wf-loading {
  margin-bottom: 0.75rem;
}

.wf-month-picker .form-select,
.wf-month-picker .form-control {
  min-width: 0;
}

.wf-month-picker #wf-month-select {
  flex: 1 1 auto;
}

.wf-month-picker #wf-year-input {
  flex: 0 0 96px;
}

.wf-header-card .card-body {
  overflow: visible !important;
  position: relative;
  z-index: 4;
}

.wf-header-actions {
  max-width: 100%;
}

.wf-header-actions .btn-group {
  position: relative;
}

.wf-header-actions .dropdown-menu {
  z-index: 1300;
}

.wf-view-switcher {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
}

.wf-view-switcher .btn {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  white-space: nowrap;
  font-size: clamp(0.76rem, 0.62rem + 0.24vw, 0.9rem);
  line-height: 1.15;
  padding: 0.42rem 0.48rem;
  border-radius: 0.65rem !important;
}

.wf-view-switcher .btn i {
  font-size: 0.9em;
  margin-right: 0;
}

#wf-admin-elia-improve {
  white-space: nowrap;
}

.wf-filter-meta {
  border-top: 1px dashed #cbd5e1;
  padding-top: 0.5rem;
}

.wf-cal-header {
  margin-bottom: 0.75rem;
}

.wf-cal-grid {
  margin-top: 0.5rem;
}

.wf-cal-day {
  align-items: stretch;
  justify-content: flex-start;
  cursor: pointer;
  aspect-ratio: auto;
  min-height: 120px;
  max-height: 130px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  padding: 0.4rem;
}

.wf-cal-day-number {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}

.wf-cal-items {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin-top: 0.4rem;
  min-height: 0;
  overflow: hidden;
}

.wf-cal-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.42rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.wf-cal-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

.wf-cal-item .bi {
  font-size: 0.64rem;
  flex: 0 0 auto;
}

.wf-cal-item-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.wf-cal-item--done {
  background: rgba(22, 163, 74, 0.14);
  border-color: rgba(22, 163, 74, 0.25);
  color: #166534;
}

.wf-cal-item--overdue {
  background: rgba(220, 38, 38, 0.14);
  border-color: rgba(220, 38, 38, 0.25);
  color: #991b1b;
}

.wf-cal-item--due {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.28);
  color: #92400e;
}

.wf-cal-item--pending {
  background: rgba(148, 163, 184, 0.2);
  border-color: rgba(148, 163, 184, 0.28);
  color: #475569;
}

.wf-cal-more {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.25rem;
  font-weight: 600;
}

.wf-cal-day-list .list-group-item {
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  margin-bottom: 0.45rem;
}

.wf-cal-day-list .list-group-item:last-child {
  margin-bottom: 0;
}

.wf-admin-pop-file-name {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wf-admin-modal-body {
  padding-top: 0.75rem;
}

.wf-admin-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.wf-admin-sidebar {
  border: 1px solid #dbe2f1;
  border-radius: 1rem;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 640px;
}

.wf-admin-sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.wf-admin-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.wf-admin-stat {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 0.65rem;
  padding: 0.42rem 0.55rem;
}

.wf-admin-stat span {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
}

.wf-admin-stat strong {
  display: block;
  font-size: 1rem;
  color: #0f172a;
}

.wf-admin-filters .form-label {
  color: #475569;
}

.wf-admin-cards {
  border: 1px solid #dbe2f1;
  border-radius: 0.8rem;
  background: #ffffff;
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 460px;
  overflow: auto;
}

.wf-admin-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.8rem;
  background: #ffffff;
  padding: 0.55rem;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.wf-admin-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 5px 14px rgba(30, 64, 175, 0.12);
  transform: translateY(-1px);
}

.wf-admin-card.is-selected {
  border-color: #0f766e;
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.18);
  background: linear-gradient(180deg, #eef2ff 0%, #ffffff 100%);
}

.wf-admin-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.15rem;
}

.wf-admin-card-subtitle {
  font-size: 0.75rem;
  color: #64748b;
}

.wf-admin-card-meta {
  margin-top: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.wf-admin-card-actions {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.wf-admin-editor {
  border: 1px solid #dbe2f1;
  border-radius: 1rem;
  background: #ffffff;
  padding: 0.95rem;
  min-height: 640px;
}

.wf-admin-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 0.8rem;
}

.wf-admin-form-sections {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.wf-admin-section {
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  padding: 0.75rem;
  background: #f8fafc;
}

.wf-admin-section-title {
  margin-bottom: 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

@media (max-width: 1199.98px) {
  .wf-admin-layout {
    grid-template-columns: 1fr;
  }

  .wf-admin-sidebar,
  .wf-admin-editor {
    min-height: 0;
  }
}

@media (max-width: 767.98px) {
  .wf-view-switcher {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wf-table th:nth-child(2),
  .wf-table td:nth-child(2) {
    min-width: 220px;
  }

  .wf-title,
  .wf-desc {
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }

  .wf-admin-editor-head {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 575.98px) {
  .wf-view-switcher {
    grid-template-columns: 1fr;
  }
}

.ed-date-input-br {
  min-width: 0;
}

.ed-date-native-picker {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
  border: 0;
  padding: 0;
  margin: 0;
}

.ed-date-popover {
  position: fixed;
  z-index: 2000;
  width: min(320px, calc(100vw - 16px));
  border: 1px solid #dbe2f1;
  border-radius: 0.8rem;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
  padding: 0.55rem;
}

.ed-date-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.ed-date-popover-title {
  flex: 1;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  text-transform: capitalize;
}

.ed-date-nav-btn {
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border-radius: 0.55rem;
  border-color: #dbe2f1;
}

.ed-date-popover-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.2rem;
  margin-bottom: 0.2rem;
}

.ed-date-popover-weekdays span {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
}

.ed-date-popover-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.2rem;
}

.ed-date-day-empty {
  height: 2rem;
}

.ed-date-day-btn {
  height: 2rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  background: transparent;
  color: #0f172a;
  font-size: 0.82rem;
  line-height: 1;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.ed-date-day-btn:hover {
  background: #eef2ff;
  border-color: #ccfbf1;
}

.ed-date-day-btn.is-today {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.ed-date-day-btn.is-selected {
  background: linear-gradient(135deg, #0f766e, #0f766e);
  border-color: #1d4ed8;
  color: #ffffff;
}

.ed-date-popover-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.35rem;
}

.ed-date-popover-footer .btn-link {
  text-decoration: none;
  padding-inline: 0.35rem;
}

/* ========== WORKFLOWS MAPA ========== */
.wf-map-card {
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.wf-map-toolbar {
  padding: 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.8rem;
  background: #f8fafc;
}

.wf-map-toolbar .form-label {
  color: #475569;
  white-space: nowrap;
}

.wf-map-field {
  min-width: 0;
}

.wf-map-field .form-select,
.wf-map-field .form-control {
  min-width: 0;
}

.wf-map-field--select {
  min-width: 360px;
  flex: 1 1 420px;
}

.wf-map-field--select #wf-map-select {
  width: 100%;
  min-width: 260px;
}

.wf-map-field--setor {
  min-width: 240px;
  flex: 0 1 260px;
}

.wf-map-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1rem;
  min-height: 520px;
}

.wf-map-palette {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.75rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
}

.wf-map-palette-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.wf-map-palette-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 190px;
  overflow: auto;
  padding-right: 0.25rem;
}

.wf-map-palette-item {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 0.6rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  cursor: grab;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.wf-map-palette-item small {
  color: #64748b;
  font-size: 0.72rem;
}

.wf-map-canvas-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  overflow: hidden;
  background: #f8fafc;
  position: relative;
  min-height: 520px;
}

.wf-map-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 520px;
  background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
  background-size: 20px 20px;
  overflow: hidden;
  transform-origin: 0 0;
}

.wf-map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.wf-map-nodes {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.wf-map-node {
  position: absolute;
  min-width: 160px;
  max-width: 220px;
  background: #ffffff;
  border: 1px solid #cbd5f5;
  border-radius: 0.75rem;
  padding: 0.5rem 0.65rem;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  cursor: grab;
}

.wf-map-node.selected {
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
}

.wf-map-node-title {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.9rem;
}

.wf-map-node-meta {
  color: #64748b;
  font-size: 0.72rem;
}

.wf-map-node--atividade {
  border-left: 4px solid #0f766e;
}

.wf-map-node--setor {
  border-left: 4px solid #7c3aed;
}

.wf-map-node--validacao {
  border-left: 4px solid #f59e0b;
}

.wf-map-edge {
  fill: none;
  stroke: #94a3b8;
  stroke-width: 2;
}

.wf-map-edge.selected {
  stroke: #0f766e;
  stroke-width: 2.6;
}

.wf-map-connect-active {
  background: #0f766e !important;
  color: #ffffff !important;
  border-color: #0f766e !important;
}

@media (max-width: 992px) {
  .wf-map-toolbar {
    padding: 0.45rem;
  }

  .wf-map-field--select,
  .wf-map-field--setor {
    min-width: 0;
    width: 100%;
  }

  .wf-map-field--select #wf-map-select,
  .wf-map-field--setor #wf-map-setor {
    min-width: 0;
    width: 100%;
  }

  .wf-map-layout {
    grid-template-columns: 1fr;
  }
  .wf-map-palette {
    max-height: none;
  }
}

/* Performance optimization for large tables */
.table-responsive,
.tickets-scroll {
  content-visibility: auto;
  contain-intrinsic-size: 1000px; /* Estimate height */
}

/* ========== PAINEL DO USUÁRIO ========== */
#view-painel-usuario {
  position: relative;
  padding: 0.65rem 0.15rem 1rem;
}

#view-painel-usuario::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(820px 320px at 2% 2%, rgba(15, 118, 110, 0.08), transparent 62%),
    radial-gradient(700px 280px at 98% 0%, rgba(14, 165, 233, 0.08), transparent 65%);
  pointer-events: none;
}

#view-painel-usuario > * {
  position: relative;
  z-index: 1;
}

#view-painel-usuario .painel-usuario-header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.94) 100%);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  padding: 1rem 1rem 0.95rem;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.06);
}

#view-painel-usuario .painel-usuario-header #btn-pu-resumo,
#view-painel-usuario .painel-usuario-header #btn-pu-refresh {
  min-width: 120px;
}

.painel-usuario-stat-card {
  transition: transform var(--ed-transition-base), box-shadow var(--ed-transition-base);
  border: 1px solid rgba(0,0,0,0.05) !important;
  background: #fff;
}

.painel-usuario-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--ed-shadow-lg) !important;
  border-color: var(--ed-primary-light) !important;
  z-index: 2;
}

#view-painel-usuario #pu-card-tickets .card-body {
  border-top: 3px solid #0f766e;
  background:
    radial-gradient(120% 92% at 0% 0%, rgba(15, 118, 110, 0.16) 0%, rgba(15, 118, 110, 0.03) 48%, rgba(255, 255, 255, 0) 100%),
    linear-gradient(180deg, #ecfeff 0%, #ffffff 100%);
}

#view-painel-usuario #pu-card-checklists .card-body {
  border-top: 3px solid #06b6d4;
  background: linear-gradient(180deg, #f4fdff 0%, #ffffff 100%);
}

#view-painel-usuario #pu-card-plans .card-body {
  border-top: 3px solid #16a34a;
  background: linear-gradient(180deg, #f5fff7 0%, #ffffff 100%);
}

#view-painel-usuario #pu-card-workflows .card-body {
  border-top: 3px solid #d97706;
  background: linear-gradient(180deg, #fffaf0 0%, #ffffff 100%);
}

#view-painel-usuario .pu-detail-card {
  position: relative;
  overflow: hidden;
  z-index: 0;
}

#view-painel-usuario .pu-detail-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.7;
  z-index: 0;
}

#view-painel-usuario .pu-detail-card > * {
  position: relative;
  z-index: 1;
}

#view-painel-usuario .pu-detail-card--tickets::before {
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.9) 0%, rgba(255, 255, 255, 0) 36%);
}

#view-painel-usuario .pu-detail-card--checklists::before {
  background: linear-gradient(180deg, rgba(236, 254, 255, 0.9) 0%, rgba(255, 255, 255, 0) 36%);
}

#view-painel-usuario .pu-detail-card--plans::before {
  background: linear-gradient(180deg, rgba(240, 253, 244, 0.9) 0%, rgba(255, 255, 255, 0) 36%);
}

#view-painel-usuario .pu-detail-card--workflows::before {
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.9) 0%, rgba(255, 255, 255, 0) 36%);
}

#view-painel-usuario .card {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.17);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

#view-painel-usuario .card-header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

#view-painel-usuario .card-header .btn-link {
  color: #0f766e;
  font-weight: 600;
}

#view-painel-usuario .card-header .btn-link:hover {
  color: #1d4ed8;
  text-decoration: underline !important;
}

#view-painel-usuario .list-group-item {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  margin: 0.45rem 0 0;
  padding: 0.75rem 0.85rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #fff;
  transition: background-color var(--ed-transition-fast), transform var(--ed-transition-fast), box-shadow var(--ed-transition-fast);
}

#view-painel-usuario .list-group-item:first-child {
  margin-top: 0.65rem;
}

#view-painel-usuario .list-group-item:last-child {
  margin-bottom: 0;
}

#view-painel-usuario .list-group-item:hover {
  background-color: #f8fbff;
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(15, 118, 110, 0.08);
}

#view-painel-usuario .pu-list-scroll {
  max-height: min(62vh, 540px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0.65rem 0.65rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 118, 110, 0.25) transparent;
}

#view-painel-usuario .pu-list-scroll::-webkit-scrollbar {
  width: 8px;
}

#view-painel-usuario .pu-list-scroll::-webkit-scrollbar-thumb {
  background: rgba(15, 118, 110, 0.22);
  border-radius: 999px;
}

#view-painel-usuario .pu-list-scroll::-webkit-scrollbar-track {
  background: transparent;
}

#view-painel-usuario .pu-item-late {
  border-left: 4px solid #ef4444;
  background: linear-gradient(90deg, rgba(254, 242, 242, 0.7) 0%, #ffffff 20%);
}

#view-painel-usuario .pu-list-item {
  display: block;
  text-align: left;
}

#view-painel-usuario .pu-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.55rem;
  min-width: 0;
}

#view-painel-usuario .pu-row + .pu-row {
  margin-top: 0.25rem;
}

#view-painel-usuario .pu-title {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-painel-usuario .pu-meta {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-painel-usuario .pu-status-badge {
  flex: 0 0 auto;
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-painel-usuario .pu-date {
  flex: 0 0 auto;
  min-width: 5rem;
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  #view-painel-usuario .pu-row {
    flex-wrap: wrap;
  }

  #view-painel-usuario .pu-status-badge,
  #view-painel-usuario .pu-date {
    margin-left: auto;
  }
}

#view-painel-usuario .pu-gauge-wrap {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0.2rem auto 0;
}

#view-painel-usuario .pu-gauge-svg {
  width: 100%;
  height: auto;
  display: block;
}

#view-painel-usuario .pu-gauge-track {
  fill: none;
  stroke: rgba(148, 163, 184, 0.25);
  stroke-width: 14;
  stroke-linecap: round;
}

#view-painel-usuario .pu-gauge-value {
  fill: none;
  stroke: #10b981; /* atualizado via JS conforme score */
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 420ms ease, stroke 200ms ease;
}

#view-painel-usuario .pu-gauge-needle {
  stroke: #0f172a;
  stroke-width: 3;
  stroke-linecap: round;
}

#view-painel-usuario .pu-gauge-hub {
  fill: #0f172a;
}

#view-painel-usuario .pu-perf-score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  background: rgba(15, 118, 110, 0.1);
  color: #1d4ed8;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
}

#view-painel-usuario .pu-gauge-center {
  display: none;
}

#view-painel-usuario .pu-perf-score {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

#view-painel-usuario .pu-perf-sub {
  font-size: 0.85rem;
  line-height: 1.25;
  margin-top: 0.35rem !important;
}

#view-painel-usuario .card-body > .pu-perf-sub {
  max-width: 260px;
  margin-left: auto;
  margin-right: auto;
}

.cursor-pointer {
  cursor: pointer;
}

/* Modal Resumo Diário */
#modal-resumo-diario .modal-header {
  background: linear-gradient(135deg, var(--ed-primary) 0%, var(--ed-primary-dark) 100%);
}

#modal-resumo-diario .modal-body {
  background-color: #f8fafc;
}

.rd-card-summary {
  background: #fff;
  border-radius: var(--ed-radius);
  padding: 1rem;
  box-shadow: var(--ed-shadow-sm);
  border: 1px solid rgba(0,0,0,0.05);
  height: 100%;
  transition: transform var(--ed-transition-base);
}

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

.rd-icon-circle {
  width: 42px; 
  height: 42px; 
  border-radius: 50%; 
  display: flex; 
  align-items: center; 
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

/* Backgrounds suaves para ícones */
.bg-soft-primary { background-color: #ecfeff; color: #0f766e; }
.bg-soft-info { background-color: #ecfeff; color: #06b6d4; }
.bg-soft-success { background-color: #f0fdf4; color: #10b981; }
.bg-soft-warning { background-color: #fffbeb; color: #f59e0b; }
.bg-soft-danger { background-color: #fef2f2; color: #ef4444; }

/* =========================
   FINANCEIRO
   ========================= */
#view-financeiro .fin-kpi-card {
  border-left: 4px solid #0f766e;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

#view-financeiro .fin-kpi-card .h4 {
  color: #0f172a;
  font-weight: 700;
}

#view-financeiro .card-header {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.9) 100%);
}

#view-financeiro canvas {
  min-height: 220px;
}

#view-financeiro table tbody tr td {
  vertical-align: middle;
}

@media (max-width: 992px) {
  #view-financeiro .btn-group.btn-group-sm {
    display: flex;
    gap: 0.25rem;
  }
}
