/* ============================================
   MODERN CRM DESIGN SYSTEM
   ============================================ */
/* Fonte Plus Jakarta Sans: carregada pelo <link> em crm/dashboard/sidebar.blade.php */

:root {
  /* Cores Principais — verde-petróleo SIAImob (espelha `brand` no tailwind.config.js) */
  --primary-50: #edfcf7;
  --primary-100: #d3f8ea;
  --primary-200: #aaf0d8;
  --primary-300: #72e2c1;
  --primary-400: #39cba5;
  --primary-500: #0f9e80;
  --primary-600: #077f67;
  --primary-700: #086856;
  --primary-800: #0a5347;
  --primary-900: #0b443b;

  /* Cores de assinatura */
  --brand-cyan: #39cba5;
  --brand-violet: #077f67;
  --navy: #0c1415;
  --navy-deep: #070d0e;
  --gradient-brand: linear-gradient(115deg, #0f9e80 0%, #086856 100%);
  --gradient-brand-text: linear-gradient(100deg, #0f9e80 0%, #086856 100%);

  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Cores Neutras */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Cores de Status */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #0f9e80;

  /* Sombras Modernas */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* Bordas */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;
  --radius-full: 9999px;

  /* Transições */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: var(--font-body);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
}

/* Botão de ação primária no estilo da identidade SIAImob (pill + gradiente verde-petróleo).
   Uso: <button class="btn-gradient-primary">Texto</button> ou em <a>. */
.btn-gradient-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 9999px;
  border: none;
  background: var(--gradient-brand);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: 0 10px 25px -8px rgba(7, 127, 103, 0.45);
  transition: all var(--transition-base);
  cursor: pointer;
  text-decoration: none;
}

.btn-gradient-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -8px rgba(7, 127, 103, 0.55);
  color: #ffffff;
}

/* ============================================
   SIDEBAR MODERNO
   ============================================ */

.modern-sidebar {
  width: 264px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform var(--transition-base);
  overflow: hidden;
}

/* ============================================
   MODAIS ACIMA DO SIDEBAR
   ============================================
   O sidebar é fixo com z-index 1000. As telas montam modais com as classes
   utilitárias do Tailwind (`fixed inset-0 ... z-50`), que valem z-index 50 —
   ou seja, o overlay abria FISICAMENTE ATRÁS do menu lateral e os cliques
   caíam no menu, não no conteúdo do modal. Seletor com 3 classes (0,3,0)
   vence o `.z-50` do Tailwind (0,1,0) sem precisar de !important. */
.fixed.inset-0.z-50,
.fixed.inset-0.z-40 {
  z-index: 1100;
}

/* Container principal com margem para o sidebar */
.modern-content-wrapper {
  margin-left: 264px;
  background: #f6f8f8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  flex: 1;
  /* clip (e não hidden): hidden cria uma área de rolagem própria e quebra os elementos
     sticky da página (header, cabeçalhos de tabela). */
  overflow-x: clip;
}

/* Responsivo: em telas menores, o sidebar fica oculto e o conteúdo ocupa toda a largura */
@media (max-width: 768px) {
  .modern-content-wrapper {
    margin-left: 0;
  }

  .modern-sidebar {
    transform: translateX(-100%);
  }

  .modern-sidebar.open {
    transform: translateX(0);
  }
}

.modern-sidebar-header {
  padding: 1.75rem 1.5rem;
  border-bottom: none;
  background: var(--navy);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.modern-sidebar-header::before {
  display: none;
}

.modern-sidebar-header::after {
  display: none;
}

.modern-sidebar-logo {
  display: block;
  position: relative;
  z-index: 1;
}

.modern-sidebar-logo-icon {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.375rem;
  color: white;
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.2),
              0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all var(--transition-base);
}

.modern-sidebar-logo-icon:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.25),
              0 0 0 1px rgba(255, 255, 255, 0.3) inset;
}

.modern-sidebar-logo-text h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
  letter-spacing: 0.02em;
  font-family: var(--font-display);
}

.modern-sidebar-logo-text p {
  font-size: 0.75rem;
  color: #8291b8;
  margin: 0.25rem 0 0 0;
  line-height: 1.4;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.modern-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.25rem 0.75rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.modern-sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.modern-sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.modern-sidebar-nav::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

.modern-sidebar-nav::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.22);
}

.modern-sidebar-section {
  margin-bottom: 2rem;
}

.modern-sidebar-section:last-child {
  margin-bottom: 0;
}

.modern-sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.875rem;
  margin-bottom: 0.625rem;
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-base);
  border-radius: var(--radius-md);
  margin-left: 0.125rem;
  margin-right: 0.125rem;
}

.modern-sidebar-section-header:hover {
  background: var(--gray-50);
}

.modern-sidebar-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  flex: 1;
  position: relative;
}

.modern-sidebar-section-title span {
  background: transparent;
  padding: 0;
  position: relative;
  z-index: 1;
  white-space: nowrap;
  font-weight: 600;
  color: var(--gray-600);
}

.section-toggle-icon {
  width: 18px;
  height: 18px;
  color: var(--gray-500);
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color var(--transition-base);
  position: relative;
  z-index: 1;
  opacity: 0.7;
}

.modern-sidebar-section-header:hover .section-toggle-icon {
  color: var(--primary-600);
  opacity: 1;
}

.modern-sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0.25rem;
  margin-top: 0.5rem;
}

.modern-sidebar-menu-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  text-decoration: none;
  transition: all var(--transition-base);
  position: relative;
  margin: 0.125rem 0;
  border: 1px solid transparent;
}

.modern-sidebar-menu-item:hover {
  background: linear-gradient(90deg, var(--gray-50) 0%, rgba(243, 244, 246, 0.8) 100%);
  color: var(--primary-600);
  transform: translateX(4px);
  border-color: rgba(44, 81, 201,0.1);
}

.modern-sidebar-menu-item.active {
  background: linear-gradient(135deg, rgba(44, 81, 201,0.1) 0%, rgba(44, 81, 201,0.08) 100%);
  color: var(--primary-700);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(44, 81, 201,0.15),
              0 0 0 1px rgba(44, 81, 201,0.1) inset;
  border-color: rgba(44, 81, 201,0.2);
}

.modern-sidebar-menu-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 65%;
  background: linear-gradient(180deg, var(--primary-500), var(--primary-600));
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 12px rgba(44, 81, 201,0.5);
  animation: slideIn 0.2s ease-out;
}

.modern-sidebar-menu-item.active::after {
  content: '';
  position: absolute;
  right: 1rem;
  width: 8px;
  height: 8px;
  background: var(--primary-500);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(44, 81, 201,0.15),
              0 2px 4px rgba(44, 81, 201,0.2);
}

.modern-sidebar-menu-item-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-base);
}

.modern-sidebar-menu-item:hover .modern-sidebar-menu-item-icon {
  transform: scale(1.1);
}

.modern-sidebar-menu-item-icon svg {
  width: 100%;
  height: 100%;
  stroke-width: 2;
}

.modern-sidebar-menu-item.active .modern-sidebar-menu-item-icon svg {
  stroke-width: 2.5;
}

/* ============================================
   SUBMENUS
   ============================================ */

.modern-sidebar-submenu-wrapper {
  margin-bottom: 0.25rem;
}

.modern-sidebar-submenu-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  margin: 0.125rem 0;
  user-select: none;
  border: 1px solid transparent;
}

.modern-sidebar-submenu-header:hover {
  background: linear-gradient(90deg, var(--gray-50) 0%, rgba(243, 244, 246, 0.8) 100%);
  color: var(--primary-600);
  transform: translateX(4px);
  border-color: rgba(44, 81, 201,0.1);
}

.modern-sidebar-submenu-header.active {
  background: linear-gradient(135deg, rgba(44, 81, 201,0.1) 0%, rgba(44, 81, 201,0.08) 100%);
  color: var(--primary-700);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(44, 81, 201,0.15);
  border-color: rgba(44, 81, 201,0.2);
}

.submenu-toggle-icon {
  width: 16px;
  height: 16px;
  color: var(--gray-500);
  flex-shrink: 0;
  margin-left: auto;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color var(--transition-base);
  opacity: 0.7;
}

.modern-sidebar-submenu-header:hover .submenu-toggle-icon {
  color: var(--primary-600);
  opacity: 1;
}

.modern-sidebar-submenu-header.active .submenu-toggle-icon {
  color: var(--primary-600);
  transform: rotate(90deg);
  opacity: 1;
}

.modern-sidebar-submenu {
  margin-top: 0.5rem;
  margin-left: 2rem;
  padding-left: 1rem;
  border-left: 2px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  animation: slideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modern-sidebar-submenu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-600);
  text-decoration: none;
  transition: all var(--transition-base);
  position: relative;
  border-left: 2px solid transparent;
  margin-left: -1rem;
  padding-left: 1.125rem;
}

.modern-sidebar-submenu-item:hover {
  background: var(--gray-50);
  color: var(--primary-600);
  transform: translateX(4px);
  border-left-color: var(--primary-400);
  margin-left: -0.875rem;
}

.modern-sidebar-submenu-item.active {
  background: linear-gradient(90deg, rgba(44, 81, 201,0.12) 0%, rgba(44, 81, 201,0.08) 100%);
  color: var(--primary-700);
  border-left-color: var(--primary-600);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(44, 81, 201,0.1);
}

.modern-sidebar-submenu-item.active::before {
  content: '';
  position: absolute;
  left: -0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--primary-600);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(44, 81, 201,0.2);
}

.modern-sidebar-footer {
  padding: 1.5rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  background: linear-gradient(180deg, var(--gray-50) 0%, #ffffff 100%);
  text-align: center;
}

.modern-sidebar-footer-text {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin: 0;
  line-height: 1.6;
  font-weight: 500;
}

/* ============================================
   HEADER MODERNO
   ============================================ */

.modern-header {
  height: 64px;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: none;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
  width: 100%;
}

.modern-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  max-width: 600px;
}

/* Botão de menu e fundo escuro: só aparecem no celular (ver @media max-width: 768px) */
.modern-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  color: var(--gray-700, #374151);
  background: transparent;
  border: none;
  cursor: pointer;
}

.modern-menu-toggle:hover {
  background: var(--gray-100, #f3f4f6);
}

.modern-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 999;
}

.modern-header-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.modern-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

.modern-header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  background: var(--gray-50);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
}

.modern-header-user:hover {
  background: var(--gray-100);
}

.modern-header-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

/* ============================================
   CARDS MODERNOS
   ============================================ */

.modern-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  transition: all var(--transition-base);
}

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

.modern-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.modern-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.modern-card-body {
  color: var(--gray-600);
}

.modern-card-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}

/* ============================================
   STAT CARDS MODERNOS
   ============================================ */

.modern-stat-card {
  background: #ffffff;
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 6px 18px rgba(16, 24, 40, 0.06);
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

/* Brilho sutil no canto superior — substitui a antiga barra azul fixa */
.modern-stat-card::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.06), transparent 70%);
  pointer-events: none;
}

.modern-stat-card:hover {
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.12);
  transform: translateY(-4px);
}

.modern-stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.modern-stat-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.modern-stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-100), var(--primary-200));
  color: var(--primary-600);
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(16, 24, 40, 0.08);
}

.modern-stat-card-icon svg {
  width: 24px;
  height: 24px;
}

.modern-stat-card-value {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--gray-900);
  margin: 0.15rem 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.modern-stat-card-footer {
  font-size: 0.75rem;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.modern-stat-card-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
}

.modern-stat-card-trend.up {
  color: var(--success);
}

.modern-stat-card-trend.down {
  color: var(--error);
}

/* ============================================
   BUTTONS MODERNOS
   ============================================ */

.modern-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  line-height: 1.5;
}

.modern-btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: white;
  box-shadow: 0 4px 6px -1px rgba(44, 81, 201,0.3);
}

.modern-btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-700), var(--primary-800));
  box-shadow: 0 6px 12px -2px rgba(44, 81, 201,0.4);
  transform: translateY(-1px);
}

.modern-btn-secondary {
  background: white;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.modern-btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.modern-btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.modern-btn-success:hover {
  box-shadow: 0 6px 12px -2px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.modern-btn-danger {
  background: linear-gradient(135deg, var(--error), #dc2626);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

.modern-btn-danger:hover {
  box-shadow: 0 6px 12px -2px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.modern-btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

.modern-btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

/* ============================================
   FORMS MODERNOS
   ============================================ */

.modern-form-group {
  margin-bottom: 1.5rem;
}

.modern-form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.modern-form-label.required::after {
  content: ' *';
  color: var(--error);
}

.modern-form-input,
.modern-form-select,
.modern-form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: white;
  color: var(--gray-900);
  transition: all var(--transition-base);
}

.modern-form-input:focus,
.modern-form-select:focus,
.modern-form-textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(44, 81, 201,0.1);
}

.modern-form-input:disabled,
.modern-form-select:disabled,
.modern-form-textarea:disabled {
  background: var(--gray-50);
  color: var(--gray-500);
  cursor: not-allowed;
}

.modern-form-help {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

.modern-form-error {
  font-size: 0.75rem;
  color: var(--error);
  margin-top: 0.25rem;
}

.modern-form-input.error,
.modern-form-select.error,
.modern-form-textarea.error {
  border-color: var(--error);
}

/* ============================================
   TABLES MODERNOS
   ============================================ */

.modern-table-wrapper {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
}

.modern-table thead {
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
}

.modern-table th {
  padding: 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-600);
}

.modern-table tbody tr {
  border-bottom: 1px solid var(--gray-200);
  transition: background var(--transition-fast);
}

.modern-table tbody tr:hover {
  background: var(--gray-50);
}

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

.modern-table td {
  padding: 1rem;
  font-size: 0.875rem;
  color: var(--gray-700);
}

/* ============================================
   BADGES MODERNOS
   ============================================ */

.modern-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  line-height: 1.5;
}

.modern-badge-primary {
  background: var(--primary-100);
  color: var(--primary-700);
}

.modern-badge-success {
  background: #d1fae5;
  color: #065f46;
}

.modern-badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.modern-badge-error {
  background: #fee2e2;
  color: #991b1b;
}

.modern-badge-gray {
  background: var(--gray-100);
  color: var(--gray-700);
}

/* ============================================
   PIPELINE MODERNO
   ============================================ */

.modern-pipeline {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 1rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-300) transparent;
}

.modern-pipeline::-webkit-scrollbar {
  height: 8px;
}

.modern-pipeline::-webkit-scrollbar-track {
  background: transparent;
}

.modern-pipeline::-webkit-scrollbar-thumb {
  background-color: var(--gray-300);
  border-radius: 4px;
}

.modern-pipeline-column {
  min-width: 320px;
  background: var(--gray-50);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--gray-200);
}

.modern-pipeline-column-header {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gray-200);
}

.modern-pipeline-column-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0 0 0.5rem 0;
}

.modern-pipeline-column-count {
  font-size: 0.875rem;
  color: var(--gray-600);
  font-weight: 500;
}

.modern-pipeline-column-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  max-height: calc(100vh - 300px);
  padding-right: 0.5rem;
}

.modern-pipeline-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  cursor: grab;
  transition: all var(--transition-base);
}

.modern-pipeline-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.modern-pipeline-card:active {
  cursor: grabbing;
}

.modern-pipeline-card.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
  cursor: grabbing;
}

.modern-pipeline-column-body.drag-over {
  background: #F3F4F6;
  border: 2px dashed #8B5CF6;
  border-radius: var(--radius-lg);
}

.modern-pipeline-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.modern-pipeline-card-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
  line-height: 1.3;
}

.modern-pipeline-card-body {
  font-size: 0.75rem;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
}

.modern-pipeline-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  border-top: 1px solid var(--gray-200);
}

/* ============================================
   UTILITIES
   ============================================ */

.modern-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.modern-page-header {
  margin-bottom: 2rem;
}

.modern-page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0 0 0.5rem 0;
  background: linear-gradient(135deg, var(--gray-900), var(--gray-700));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modern-page-subtitle {
  font-size: 1rem;
  color: var(--gray-600);
  margin: 0;
}

.modern-grid {
  display: grid;
  gap: 1.5rem;
}

.modern-grid-1 { grid-template-columns: repeat(1, 1fr); }
.modern-grid-2 { grid-template-columns: repeat(2, 1fr); }
.modern-grid-3 { grid-template-columns: repeat(3, 1fr); }
.modern-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .modern-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .modern-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .modern-grid-4,
  .modern-grid-3,
  .modern-grid-2 { grid-template-columns: repeat(1, 1fr); }
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

.modern-fade-in {
  animation: fadeIn var(--transition-slow) ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

.modern-slide-in {
  animation: slideIn var(--transition-slow) ease-out;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .modern-sidebar {
    transform: translateX(-100%);
  }

  .modern-sidebar.open {
    transform: translateX(0);
  }

  .modern-menu-toggle {
    display: inline-flex;
  }

  body.sidebar-mobile-aberta .modern-sidebar-overlay {
    display: block;
  }

  .modern-container {
    padding: 0 1rem;
  }
}

