@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* IArquiteta Design System - Professional & Modern */
/* Sistema de design profissional idêntico ao React original */

:root {
  /* Professional Architecture Brand Colors - Idêntico ao TSX */
  --background: 0 0% 97%;
  --foreground: 215 25% 10%;

  --card: 0 0% 100%;
  --card-foreground: 215 25% 10%;

  --popover: 0 0% 100%;
  --popover-foreground: 215 25% 10%;

  /* Primary: Professional Purple - Nova cor principal */
  --primary: 264 71% 67%; /* #764ee2 */
  --primary-foreground: 0 0% 100%;
  --primary-hover: 264 71% 62%;

  /* Secondary: Elegant Gray - Exato do TSX */
  --secondary: 210 11% 96%;
  --secondary-foreground: 215 25% 25%;

  --muted: 210 11% 96%;
  --muted-foreground: 215 13% 65%;

  --accent: 215 100% 97%;
  --accent-foreground: 215 25% 15%;

  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;

  --border: 220 13% 91%;
  --input: 220 13% 91%;
  --ring: 264 71% 67%;

  --radius: 1rem;

  /* Professional Gradients - Nova paleta roxa */
  --gradient-primary: #583db2;
  --gradient-card: linear-gradient(135deg, hsl(0 0% 100%) 0%, hsl(215 100% 99%) 100%);
  --gradient-hero: #583db2;
  --gradient-purple-deep: #583db2;
  
  /* Professional Shadows - Exatos do TSX */
  --shadow-card: 0 1px 3px 0 hsl(215 25% 10% / 0.08), 0 1px 2px -1px hsl(215 25% 10% / 0.08);
  --shadow-card-hover: 0 4px 6px -1px hsl(215 25% 10% / 0.1), 0 2px 4px -2px hsl(215 25% 10% / 0.1);
  --shadow-primary: 0 4px 14px 0 hsl(264 71% 67% / 0.25);
  --shadow-elegant: 0 8px 32px 0 hsl(215 25% 10% / 0.08);

  /* Smooth Transitions - Idênticos ao TSX */
  --transition-smooth: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Sidebar Variables - Idênticas ao TSX */
  --sidebar-background: 0 0% 98%;
  --sidebar-foreground: 240 5.3% 26.1%;
  --sidebar-primary: 240 5.9% 10%;
  --sidebar-primary-foreground: 0 0% 98%;
  --sidebar-accent: 240 4.8% 95.9%;
  --sidebar-accent-foreground: 240 5.9% 10%;
  --sidebar-border: 220 13% 91%;
  --sidebar-ring: 264 71% 67%;
}

.dark {
  /* Dark Mode: Professional Architecture Theme - Idêntico ao TSX */
  --background: 215 28% 8%;
  --foreground: 0 0% 98%;

  --card: 215 28% 10%;
  --card-foreground: 0 0% 98%;

  --popover: 215 28% 10%;
  --popover-foreground: 0 0% 98%;

  --primary: 264 71% 67%;
  --primary-foreground: 0 0% 100%;
  --primary-hover: 264 71% 72%;

  --secondary: 215 25% 15%;
  --secondary-foreground: 0 0% 90%;

  --muted: 215 25% 15%;
  --muted-foreground: 215 10% 65%;

  --accent: 215 25% 18%;
  --accent-foreground: 0 0% 95%;

  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;

  --border: 215 25% 20%;
  --input: 215 25% 18%;
  --ring: 264 71% 67%;

  /* Dark Mode Gradients - Nova paleta roxa */
  --gradient-card: linear-gradient(135deg, hsl(215 28% 10%) 0%, hsl(215 28% 12%) 100%);
  --gradient-hero: #583db2;

  /* Dark Mode Shadows - Idênticas ao TSX */
  --shadow-card: 0 1px 3px 0 hsl(0 0% 0% / 0.3), 0 1px 2px -1px hsl(0 0% 0% / 0.3);
  --shadow-card-hover: 0 4px 6px -1px hsl(0 0% 0% / 0.4), 0 2px 4px -2px hsl(0 0% 0% / 0.4);
  --shadow-elegant: 0 8px 32px 0 hsl(0 0% 0% / 0.25);

  /* Sidebar Dark Mode - Idênticas ao TSX */
  --sidebar-background: 215 28% 8%;
  --sidebar-foreground: 0 0% 90%;
  --sidebar-primary: 264 71% 67%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 215 25% 15%;
  --sidebar-accent-foreground: 0 0% 90%;
  --sidebar-border: 215 25% 20%;
  --sidebar-ring: 264 71% 67%;
}

/* Reset básico aprimorado */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-feature-settings: "cv03", "cv04", "cv11";
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Remover sublinhado de todos os links globalmente */
a,
a:link,
a:visited,
a:hover,
a:active,
a:focus {
  text-decoration: none;
}

/* Permitir sublinhado apenas quando explicitamente especificado */
a.underline,
a.underline:link,
a.underline:visited,
a.underline:hover,
a.underline:active,
a.underline:focus,
a[style*="text-decoration: underline"],
a[style*="text-decoration:underline"],
.underline a,
.underline a:link,
.underline a:visited,
.underline a:hover,
.underline a:active,
.underline a:focus {
  text-decoration: underline;
}

/* Layout principal aprimorado */
.min-h-screen {
  min-height: 100vh;
}

.flex {
  display: flex;
}

.flex-1 {
  flex: 1 1 0%;
}

.flex-col {
  flex-direction: column;
}

.w-full {
  width: 100%;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

/* Grid responsivo aprimorado */
.grid {
  display: grid;
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* Responsividade moderna */
@media (min-width: 768px) {
  .md\\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .lg\\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
  .xl\\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* Cards elegantes profissionais - Idênticos ao TSX */
.card-elegant {
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.card-elegant::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, hsl(var(--border)), transparent);
  opacity: 0.5;
}

.card-elegant:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

/* Sistema de botões profissional */
.btn-hero {
  background: var(--gradient-hero);
  color: hsl(var(--primary-foreground));
  border: none;
  border-radius: 0.875rem;
  padding: 0.875rem 1.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-primary);
  transition: var(--transition-spring);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  letter-spacing: -0.01em;
}

.btn-hero::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;
}

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

.btn-hero:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px 0 hsl(264 71% 67% / 0.4);
}

.btn-hero:active {
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: hsl(var(--foreground));
  border: 1.5px solid hsl(var(--border));
  border-radius: 0.875rem;
  padding: 0.875rem 1.75rem;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  text-decoration: none;
  position: relative;
  backdrop-filter: blur(8px);
}

.btn-outline:hover {
  background: hsl(var(--accent));
  border-color: hsl(var(--primary));
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

.btn-sm {
  padding: 0.625rem 1.25rem;
  font-size: 0.8125rem;
  border-radius: 0.75rem;
}

.btn-ghost {
  background: transparent;
  color: hsl(var(--muted-foreground));
  border: none;
  border-radius: 0.75rem;
  padding: 0.75rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-ghost:hover {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
  transform: scale(1.05);
}

/* Btn ghost na sidebar sempre branco */
.sidebar .btn-ghost {
  color: rgba(255, 255, 255, 0.9);
}

.sidebar .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 1);
}

/* Sidebar elegante - Identidade Visual Roxa Permanente */
.sidebar {
  background: #583db2;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  width: 16rem;
  transition: var(--transition-smooth);
  position: relative;
  z-index: 50;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.sidebar.collapsed {
  width: 5rem;
}

/* Ajustes visuais quando a sidebar está colapsada */
.sidebar.collapsed .sidebar-header {
  padding: 1rem 0.75rem;
  justify-content: center;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar.collapsed .sidebar-nav {
  padding: 1rem 0.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 180px);
}

/* Scrollbar personalizada para sidebar colapsada */
.sidebar.collapsed .sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar.collapsed .sidebar-nav::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.sidebar.collapsed .sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.sidebar.collapsed .sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Ícones perfeitamente organizados quando colapsado */
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 0.875rem;
  gap: 0;
  width: 100%;
  margin-bottom: 0.5rem;
  border-radius: 0.75rem;
  position: relative;
  transition: all 0.2s ease;
}

.sidebar.collapsed .nav-item i {
  margin: 0;
  width: 1.5rem;
  height: 1.5rem;
}

/* Ajustar a barra de indicação quando colapsado */
.sidebar.collapsed .nav-item::before {
  left: 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
}

/* Garantir que o botão de submenu fique centralizado */
.sidebar.collapsed button.nav-item {
  justify-content: center;
}

/* Melhorar o hover quando colapsado com animação suave */
.sidebar.collapsed .nav-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.sidebar.collapsed .nav-item.active {
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar.collapsed .nav-item.active::before {
  transform: scaleY(1);
}

/* Adicionar feedback ao clicar */
.sidebar.collapsed .nav-item:active {
  transform: scale(0.95);
}

/* Ajustar o botão de toggle quando colapsado */
.sidebar.collapsed #sidebar-toggle {
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.625rem;
  border-radius: 0.625rem;
  transition: all 0.2s ease;
}

.sidebar.collapsed #sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Ajustar o brand/logo quando colapsado */
.sidebar.collapsed #sidebar-brand {
  justify-content: center;
  width: 100%;
}

/* Garantir que apenas o ícone da marca apareça quando colapsado */
.sidebar.collapsed #sidebar-brand i {
  width: 2rem;
  height: 2rem;
}

/* Tooltip elegante para mostrar nome das opções quando colapsado */
.sidebar.collapsed .nav-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar.collapsed .nav-item:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(15px);
}

/* Tooltip com seta */
.sidebar.collapsed .nav-item::before {
  z-index: 1;
}

/* Garantir espaçamento uniforme entre todos os ícones */
.sidebar.collapsed .nav-parent {
  margin-bottom: 0;
}

.sidebar.collapsed .nav-parent .nav-item {
  margin-bottom: 0.5rem;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
}

.sidebar-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1.5rem;
  right: 1.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.sidebar-nav {
  padding: 1.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: var(--transition-smooth);
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: rgba(255, 255, 255, 1);
  transform: scaleY(0);
  transition: transform 0.2s ease;
  border-radius: 0 2px 2px 0;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 1);
}

/* Hover states para ícones da navegação */
.nav-item:hover .h-5 {
  color: rgba(255, 255, 255, 1);
}

.group {
  /* Marcador para grupos de hover */
}

.group-hover\\:text-foreground {
  transition: color 0.2s ease;
}

.nav-item:hover .group-hover\\:text-foreground {
  color: rgba(255, 255, 255, 1);
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 1);
  box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.2);
  font-weight: 600;
}

.nav-item.active::before {
  transform: scaleY(1);
  background: rgba(255, 255, 255, 1);
}

/* Header moderno - Idêntico ao TSX */
.header {
  background: hsl(var(--card));
  border-bottom: 1px solid hsl(var(--border));
  padding: 1rem 1.5rem;
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, hsl(var(--border)), transparent);
}

/* Garantir que o header fique em uma linha - Desktop */
.header-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap;
  width: 100%;
}

.header-search {
  flex: 1;
  min-width: 0;
  max-width: 600px;
}

/* Header Actions - Desktop: manter à direita */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  margin-left: auto;
}

/* Desktop: garantir alinhamento à direita */
@media (min-width: 768px) {
  .header-actions {
    gap: 0.75rem !important;
    margin-left: auto !important;
  }
  
  .mobile-menu-btn {
    display: none !important;
  }
}

.header-btn,
.header-avatar,
.mobile-menu-btn {
  flex-shrink: 0;
}

/* Inputs elegantes */
.input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1.5px solid hsl(var(--border));
  border-radius: 0.875rem;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition-smooth);
  font-family: inherit;
}

.input::placeholder {
  color: hsl(var(--muted-foreground));
  font-weight: 400;
}

.input:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
  background: hsl(var(--card));
}

/* Textarea - mesmo estilo do input */
.textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1.5px solid hsl(var(--border));
  border-radius: 0.875rem;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition-smooth);
  font-family: inherit;
  resize: vertical;
  min-height: 6rem;
  line-height: 1.5;
}

.textarea::placeholder {
  color: hsl(var(--muted-foreground));
  font-weight: 400;
}

.textarea:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
  background: hsl(var(--card));
}

.input-search {
  padding-left: 2.75rem;
}

/* Select elegante */
.select {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1.5px solid hsl(var(--border));
  border-radius: 0.875rem;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition-smooth);
}

.select:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
}

/* Labels elegantes */
.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

/* Sistema de badges profissional */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  border: 1px solid transparent;
  backdrop-filter: blur(4px);
}

.status-lead {
  background: hsl(264 71% 95%);
  color: hsl(264 71% 40%);
  border-color: hsl(264 71% 85%);
}

.status-proposta {
  background: hsl(45 93% 95%);
  color: hsl(45 93% 35%);
  border-color: hsl(45 93% 85%);
}

.status-cliente {
  background: hsl(142 71% 95%);
  color: hsl(142 71% 35%);
  border-color: hsl(142 71% 85%);
}

.status-perdido {
  background: hsl(0 84% 95%);
  color: hsl(0 84% 40%);
  border-color: hsl(0 84% 85%);
}

.dark .status-lead {
  background: hsl(264 71% 15%);
  color: hsl(264 71% 75%);
  border-color: hsl(264 71% 25%);
}

.dark .status-proposta {
  background: hsl(45 93% 15%);
  color: hsl(45 93% 75%);
  border-color: hsl(45 93% 25%);
}

.dark .status-cliente {
  background: hsl(142 71% 15%);
  color: hsl(142 71% 75%);
  border-color: hsl(142 71% 25%);
}

.dark .status-perdido {
  background: hsl(0 84% 15%);
  color: hsl(0 84% 75%);
  border-color: hsl(0 84% 25%);
}

/* Kanban cards elegantes */
.kanban-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.kanban-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.kanban-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
  border-color: hsl(var(--primary) / 0.3);
}

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

/* Tipografia profissional */
.text-3xl {
  font-size: 1.875rem;
  line-height: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.text-xl {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
}

.text-xs {
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
}

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-center { text-align: center; }
.text-right { text-align: right; }

/* Cores de texto aprimoradas */
.text-foreground { color: hsl(var(--foreground)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.text-primary { color: hsl(var(--primary)); }
.text-destructive { color: hsl(var(--destructive)); }

/* Espaçamentos modernos */
.p-6 { padding: 1.5rem; }
.p-4 { padding: 1rem; }
.p-3 { padding: 0.75rem; }
.p-2 { padding: 0.5rem; }

.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-4 { padding-bottom: 1rem; }
.pb-6 { padding-bottom: 1.5rem; }

.mb-4 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mt-4 { margin-top: 1rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.ml-2 { margin-left: 0.5rem; }

.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-0 > * + * { margin-top: 0; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }

.gap-6 { gap: 1.5rem; }
.gap-4 { gap: 1rem; }
.gap-3 { gap: 0.75rem; }
.gap-2 { gap: 0.5rem; }

/* Progress bar elegante */
.progress {
  background: hsl(var(--secondary));
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  background: var(--gradient-primary);
  height: 100%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Utilitários modernos */
.relative { position: relative; }
.absolute { position: absolute; }
.hidden { display: none; }
.block { display: block; }
.inline-flex { display: inline-flex; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cursor-pointer { cursor: pointer; }

.border { border: 1px solid hsl(var(--border)); }
.border-t { border-top: 1px solid hsl(var(--border)); }
.border-b { border-bottom: 1px solid hsl(var(--border)); }
.border-r { border-right: 1px solid hsl(var(--border)); }

.rounded-xl { border-radius: 0.75rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }
.rounded-2xl { border-radius: 1rem; }

/* Alturas específicas */
.h-2 { height: 0.5rem; }
.h-3 { height: 0.75rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-12 { height: 3rem; }
.h-24 { height: 6rem; }

.w-3 { width: 0.75rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-12 { width: 3rem; }
.w-24 { width: 6rem; }

/* Cores de fundo */
.bg-red-500 { background-color: #ef4444; }
.bg-yellow-500 { background-color: #eab308; }
.bg-green-500 { background-color: #22c55e; }
.bg-purple-500 { background-color: #764ee2; }
.bg-orange-500 { background-color: #f97316; }

.bg-blue-100 { background-color: #dbeafe; }
.bg-yellow-100 { background-color: #fef3c7; }
.bg-green-100 { background-color: #dcfce7; }
.bg-purple-100 { background-color: #f3e8ff; }
.bg-orange-100 { background-color: #fed7aa; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-red-100 { background-color: #fee2e2; }

/* Cores de fundo com opacidade */
.bg-purple-500\/10 { background-color: rgba(118, 78, 226, 0.1); }
.bg-yellow-500\/10 { background-color: rgba(234, 179, 8, 0.1); }
.bg-green-500\/10 { background-color: rgba(34, 197, 94, 0.1); }
.bg-orange-500\/10 { background-color: rgba(249, 115, 22, 0.1); }
.bg-red-500\/10 { background-color: rgba(239, 68, 68, 0.1); }

.text-blue-800 { color: #1e40af; }
.text-yellow-800 { color: #92400e; }
.text-green-800 { color: #166534; }
.text-purple-800 { color: #6b21a8; }
.text-orange-800 { color: #9a3412; }
.text-gray-800 { color: #1f2937; }

/* Cores de texto específicas */
.text-purple-600 { color: #764ee2; }
.text-blue-600 { color: #2563eb; }
.text-yellow-600 { color: #d97706; }
.text-green-600 { color: #16a34a; }
.text-orange-600 { color: #ea580c; }
.text-red-600 { color: #dc2626; }
.text-red-700 { color: #b91c1c; }
.text-yellow-700 { color: #a16207; }
.text-green-700 { color: #15803d; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }

/* Animações elegantes */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Responsividade aprimorada */
@media (max-width: 768px) {
  /* Garantir scroll correto no mobile */
  html, body {
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
  }
  
  /* FORÇAR TUDO EM UMA LINHA - SUPER IMPORTANTE */
  .header * {
    box-sizing: border-box;
  }
  
  /* Garantir que o layout não interfira com o header fixo */
  .layout-container {
    position: relative;
  }
  
  .layout-content {
    position: relative;
    overflow-x: hidden;
    overflow-y: visible;
  }
  
  /* Botão hambúrguer mobile - visível apenas em mobile */
  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: hsl(var(--foreground));
    transition: all 0.2s ease;
    z-index: 40;
    flex-shrink: 0 !important;
    width: 2.25rem !important;
    height: 2.25rem !important;
    padding: 0.375rem;
    margin-right: 0.25rem;
  }
  
  .mobile-menu-btn i {
    width: 1.25rem;
    height: 1.25rem;
  }
  
  .mobile-menu-btn:hover {
    background: hsl(var(--accent));
  }
  
  .mobile-menu-btn:active {
    transform: scale(0.95);
  }
  
  /* Ajustar header para mobile - TODOS os elementos na mesma linha */
  .header {
    padding: 0.5rem !important;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: hsl(var(--card) / 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
  
  /* Adicionar espaçamento no topo do conteúdo para compensar o header fixo */
  .layout-content {
    padding-top: 60px;
  }
  
  /* Esconder header quando sidebar estiver aberto no mobile */
  .sidebar.open ~ .layout-content .header {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
  }
  
  .header-container,
  .header > div {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.25rem !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    overflow-x: auto;
    overflow-y: visible;
  }
  
  /* Container de busca redimensionado para mobile */
  .header-search,
  .header-search[style] {
    flex: 1 1 auto !important;
    min-width: 100px !important;
    max-width: 180px !important;
    flex-shrink: 1 !important;
  }
  
  /* Header Actions - Mobile: manter gap reduzido */
  .header-actions {
    gap: 0.25rem !important;
    margin-left: 0 !important;
  }
  
  /* Remover max-width conflitante */
  .header .max-w-md {
    max-width: none !important;
  }
  
  /* Campo de busca compacto */
  .header .input-search {
    font-size: 0.75rem;
    padding: 0.5rem 0.375rem 0.5rem 1.75rem;
    width: 100%;
    border-radius: 0.5rem;
    min-width: 80px;
  }
  
  .header .input-search::placeholder {
    font-size: 0.75rem;
  }
  
  .header i[data-lucide="search"] {
    left: 0.375rem;
    width: 1rem;
    height: 1rem;
  }
  
  /* Botões compactos mas clicáveis */
  .header-btn {
    width: 2rem !important;
    height: 2rem !important;
    padding: 0.25rem !important;
    flex-shrink: 0 !important;
  }
  
  .header-btn i {
    width: 1rem;
    height: 1rem;
  }
  
  /* Avatar compacto */
  .header-avatar {
    flex-shrink: 0 !important;
  }
  
  .header-avatar button {
    width: 1.875rem !important;
    height: 1.875rem !important;
  }
  
  .header-avatar button img,
  .header-avatar button > div {
    width: 1.875rem !important;
    height: 1.875rem !important;
    font-size: 0.625rem;
  }
  
  /* Badge de notificação ajustado */
  .header button span[class*="absolute"] {
    width: 14px;
    height: 14px;
    font-size: 0.5rem;
    top: -3px;
    right: -3px;
  }
  
  /* Sidebar mobile */
  .sidebar {
    width: 280px;
    max-width: 85vw;
    position: fixed;
    top: 0;
    left: -100%;
    height: 100vh;
    z-index: 2000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #583db2;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
  }
  
  .sidebar.open {
    left: 0;
  }
  
  .main-content {
    margin-left: 0;
    padding: 1rem;
  }

  .text-3xl {
    font-size: 1.5rem;
    line-height: 2rem;
  }
}

/* Ajustes para telas muito pequenas - todos os elementos ainda visíveis */
@media (max-width: 480px) {
  .mobile-menu-btn {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0.375rem;
    margin-right: 0.375rem;
  }
  
  .header {
    padding: 0.5rem 0.5rem;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: hsl(var(--card) / 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }
  
  .header-container {
    gap: 0.375rem !important;
  }
  
  /* Busca ainda mais compacta */
  .header .input-search {
    font-size: 0.75rem;
    padding: 0.375rem 0.375rem 0.375rem 1.75rem;
  }
  
  .header i[data-lucide="search"] {
    left: 0.375rem;
    width: 0.875rem;
    height: 0.875rem;
  }
  
  /* Botões ainda mais compactos */
  .header-btn {
    width: 2rem !important;
    height: 2rem !important;
    padding: 0.25rem !important;
  }
  
  .header-btn i {
    width: 1rem !important;
    height: 1rem !important;
  }
  
  /* Avatar menor */
  .header-avatar button {
    width: 1.75rem !important;
    height: 1.75rem !important;
  }
  
  .header-avatar button img,
  .header-avatar button > div {
    width: 1.75rem !important;
    height: 1.75rem !important;
    font-size: 0.625rem;
  }
  
  /* Badge de notificação menor */
  .header button span[class*="badge"],
  .header button span[class*="bg-primary"] {
    width: 12px;
    height: 12px;
    font-size: 0.5rem;
    top: -4px;
    right: -4px;
  }
}

/* Mobile-specific adjustments (max-width: 767px) */
@media (max-width: 767px) {
  .text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
  }

  .grid-cols-2 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .gap-6 {
    gap: 1rem;
  }

  .p-6 {
    padding: 1rem;
  }
  
  /* IMPORTANTE: Garantir mesma largura horizontal no mobile */
  #dashboard-main-layout,
  #dashboard-main-layout > *,
  #calendar-wrapper,
  #calendar-card,
  #active-projects-carousel,
  .space-y-6 > section {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }
  
  /* Garantir padding consistente nos cards */
  #calendar-card,
  #active-projects-carousel {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  
  /* Ajustar overflow do carrossel de projetos para não causar scroll horizontal */
  #active-projects-carousel > .p-6 {
    overflow: hidden !important;
  }
}

/* Estados especiais */
.opacity-60 {
  opacity: 0.6;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

/* Min widths para kanban */
.min-w-300 {
  min-width: 300px;
}

/* Container max widths */
.max-w-md {
  max-width: 28rem;
}

.max-w-2xl {
  max-width: 42rem;
}

/* Flex row utilities */
.flex-row {
  flex-direction: row;
}

/* Justify utilities */
.justify-end {
  justify-content: flex-end;
}

/* Padding utilities específicos */
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }

/* Margin utilities */
.mt-2 { margin-top: 0.5rem; }

/* Responsive utilities */
@media (min-width: 640px) {
  .sm\\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Hover utilities */
.hover\\:border-primary\/20:hover {
  border-color: rgba(118, 78, 226, 0.2);
}

/* Transition utilities */
.transition-all {
  transition-property: all;
}

.duration-200 {
  transition-duration: 200ms;
}

/* Justify content center para botões */
.justify-center {
  justify-content: center;
}

/* Auto margins */
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

/* Z-index utilities */
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-30 { z-index: 30; }

/* Transform utilities */
.transform {
  transform: translateX(0) translateY(0) rotate(0) skewX(0) skewY(0) scaleX(1) scaleY(1);
}

.-translate-y-1\/2 {
  transform: translateY(-50%);
}

.top-1\/2 {
  top: 50%;
}

.left-3 {
  left: 0.75rem;
}

.right-0 {
  right: 0;
}

.top-10 {
  top: 2.5rem;
}

/* Layout principal aprimorado - Idêntico ao TSX */
.main-content {
  flex: 1;
  padding: 1.5rem;
  background: hsl(var(--background));
}

/* Layout flex container - Como no TSX */
.layout-container {
  min-height: 100vh;
  background: hsl(var(--background));
  display: flex;
  width: 100%;
}

.layout-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Melhorias específicas para dark mode */
.dark {
  color-scheme: dark;
}

.dark .card-elegant {
  border-color: hsl(var(--border));
  background: var(--gradient-card);
}

.dark .btn-outline {
  border-color: hsl(var(--border));
}

.dark .btn-outline:hover {
  border-color: hsl(var(--primary));
  background: hsl(var(--accent) / 0.8);
}

/* Estilos para elementos específicos */
.sidebar-backdrop {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.sidebar-backdrop.show {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Tooltips elegantes */
.tooltip {
  background: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(8px);
  z-index: 9999;
}

/* Performance otimizations */
.card-elegant,
.btn-hero,
.btn-outline,
.nav-item,
.kanban-card {
  will-change: transform;
  transform: translateZ(0);
}

/* Loading state */
.app-loading {
  opacity: 0;
  transform: translateY(20px);
}

.app-loaded {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glassmorphism effects */
.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass-effect {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Enhanced hover effects */
.hover-lift {
  transition: var(--transition-smooth);
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elegant);
}

/* Gradient text - Idêntico ao TSX */
.gradient-text {
  background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(var(--primary-hover)) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Gradientes adicionais para TSX compatibility */
.bg-gradient-to-r {
  background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

.from-primary {
  --tw-gradient-from: hsl(var(--primary));
  --tw-gradient-to: hsl(var(--primary) / 0);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.to-primary-hover {
  --tw-gradient-to: hsl(var(--primary-hover));
}

.bg-clip-text {
  background-clip: text;
  -webkit-background-clip: text;
}

.text-transparent {
  color: transparent;
}

/* Enhanced button animations */
.btn-hero:hover::before {
  animation: shimmer 0.8s ease-in-out;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) skewX(-45deg); }
  100% { transform: translateX(200%) skewX(-45deg); }
}

/* Micro-interactions */
.micro-bounce:active {
  transform: scale(0.98);
}

/* Enhanced focus states */
.focus-ring:focus {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
  border-radius: 0.5rem;
}

/* Table Styles - Professional Data Tables */
.table-elegant,
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table-elegant thead,
.data-table thead {
  background: hsl(var(--muted) / 0.3);
  border-bottom: 2px solid hsl(var(--border));
}

.table-elegant th,
.data-table th {
  text-align: left;
  padding: 1rem 1.5rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  font-size: 0.8125rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  position: relative;
}

.table-elegant th:first-child,
.data-table th:first-child {
  padding-left: 1.5rem;
}

.table-elegant th:last-child,
.data-table th:last-child {
  padding-right: 1.5rem;
}

.table-elegant td,
.data-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
  vertical-align: top;
}

.table-elegant td:first-child,
.data-table td:first-child {
  padding-left: 1.5rem;
}

.table-elegant td:last-child,
.data-table td:last-child {
  padding-right: 1.5rem;
}

.table-elegant tbody tr,
.data-table tbody tr {
  transition: background-color 0.2s ease;
}

.table-elegant tbody tr:hover,
.data-table tbody tr:hover {
  background: hsl(var(--accent) / 0.5);
}

.table-elegant tbody tr.inactive,
.data-table tbody tr.inactive {
  opacity: 0.6;
}

/* Table responsive wrapper */
.table-wrapper {
  overflow-x: auto;
  border-radius: 1rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
}

/* Table cell content styling */
.table-cell-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table-cell-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

/* Status indicators in tables */
.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.active {
  background: hsl(142 71% 45%);
  box-shadow: 0 0 0 2px hsl(142 71% 45% / 0.2);
}

.status-dot.inactive {
  background: hsl(var(--muted-foreground));
  box-shadow: 0 0 0 2px hsl(var(--muted-foreground) / 0.2);
}

/* Action buttons in tables */
.table-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.table-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  border: none;
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: var(--transition-smooth);
}

.table-action-btn:hover {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
  transform: scale(1.05);
}

.table-action-btn.destructive:hover {
  background: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
}

.table-action-btn.warning:hover {
  background: hsl(45 93% 47% / 0.1);
  color: hsl(45 93% 47%);
}

.table-action-btn.success:hover {
  background: hsl(142 71% 45% / 0.1);
  color: hsl(142 71% 45%);
}

/* Responsive table adjustments */
@media (max-width: 1024px) {
  .table-elegant th,
  .table-elegant td {
    padding: 0.75rem 1rem;
  }
  
  .table-elegant th:first-child,
  .table-elegant td:first-child {
    padding-left: 1rem;
  }
  
  .table-elegant th:last-child,
  .table-elegant td:last-child {
    padding-right: 1rem;
  }
}

@media (max-width: 768px) {
  .table-elegant {
    font-size: 0.8125rem;
  }
  
  .table-elegant th,
  .table-elegant td {
    padding: 0.5rem 0.75rem;
  }
  
  .table-actions {
    gap: 0.125rem;
  }
  
  .table-action-btn {
    width: 1.75rem;
    height: 1.75rem;
  }
}

/* Custom selection */
::selection {
  background: hsl(var(--primary) / 0.2);
  color: hsl(var(--primary));
}

/* Enhanced grid spacing */
.grid-elegant {
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .grid-elegant {
    gap: 2rem;
  }
}

/* Status indicators with pulse */
.status-indicator {
  position: relative;
}

.status-indicator::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  animation: pulse-status 2s infinite;
  opacity: 0.3;
}

@keyframes pulse-status {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.1); opacity: 0.1; }
}

/* Enhanced mobile experience */
@media (max-width: 768px) {
  .touch-friendly {
    min-height: 44px;
    min-width: 44px;
  }
  
  .card-elegant {
    border-radius: 1rem;
    margin-bottom: 1rem;
  }
  
  .btn-hero {
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }
}

/* Scroll personalizado */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: hsl(var(--muted));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: hsl(var(--muted-foreground) / 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--muted-foreground) / 0.5);
}

/* Focus states aprimorados */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
}

/* Modal System - Modern 2025 Design */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
  overflow-y: auto;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* IMPORTANTE: Garantir que o modal não receba blur */
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
}

.modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
  /* IMPORTANTE: Overlay ATRÁS do conteúdo */
  z-index: 1;
  cursor: pointer;
  pointer-events: auto;
}

.modal.hidden .modal-overlay {
  animation: fadeOut 0.3s ease;
}

.modal-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* IMPORTANTE: Container NA FRENTE do overlay */
  z-index: 2;
  /* Garantir que o conteúdo fique acima do blur */
  isolation: isolate;
  /* Remover qualquer filter herdado */
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  /* Permitir interação com o conteúdo */
  pointer-events: auto;
}

.modal-content {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 1.5rem;
  box-shadow: var(--shadow-elegant);
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(1) translateY(0);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  /* IMPORTANTE: Conteúdo acima de tudo */
  z-index: 3;
  /* IMPORTANTE: Remover qualquer blur do conteúdo */
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
  /* Garantir interação com o conteúdo */
  pointer-events: auto;
}

.modal.hidden .modal-content {
  transform: scale(0.95) translateY(20px);
}

/* Modal Header */
.modal-header {
  padding: 1.5rem 1.5rem 0 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
  position: relative;
  flex-shrink: 0;
}

.modal-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1.5rem;
  right: 1.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, hsl(var(--border)), transparent);
}

.modal-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.5rem;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  border: none;
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.modal-close:hover {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
  transform: scale(1.1);
}

.modal-close:active {
  transform: scale(0.95);
}

/* Modal Body */
.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--muted-foreground) / 0.3) transparent;
}

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

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

.modal-body::-webkit-scrollbar-thumb {
  background: hsl(var(--muted-foreground) / 0.3);
  border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--muted-foreground) / 0.5);
}

/* Modal Footer */
.modal-footer {
  padding: 0 1.5rem 1.5rem 1.5rem;
  border-top: 1px solid hsl(var(--border));
  position: relative;
  flex-shrink: 0;
  background: hsl(var(--card));
  z-index: 1;
}

.modal-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 1.5rem;
  right: 1.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, hsl(var(--border)), transparent);
}

/* Modal Types */
.modal-form .modal-content {
  border-color: hsl(var(--primary) / 0.2);
}

.modal-success .modal-content {
  border-color: hsl(142 71% 45% / 0.3);
}

.modal-error .modal-content {
  border-color: hsl(var(--destructive) / 0.3);
}

.modal-confirmation .modal-content {
  border-color: hsl(45 93% 47% / 0.3);
}

/* Form Styles inside Modal */
.modal .form-grid {
  display: grid;
  gap: 1.5rem;
}

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

.modal .form-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.modal .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal .form-group-full {
  grid-column: 1 / -1;
}

.modal .form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  letter-spacing: -0.01em;
}

.modal .form-label.required::after {
  content: '*';
  color: hsl(var(--destructive));
  margin-left: 0.25rem;
}

.modal .form-input,
.modal .form-select,
.modal .form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1.5px solid hsl(var(--border));
  border-radius: 0.875rem;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition-smooth);
  font-family: inherit;
}

.modal .form-input:focus,
.modal .form-select:focus,
.modal .form-textarea:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
  background: hsl(var(--card));
}

.modal .form-textarea {
  resize: vertical;
  min-height: 4rem;
}

.modal .form-help {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.25rem;
}

/* Responsive Modal */
@media (max-width: 768px) {
  .modal {
    padding: 0.5rem;
    align-items: flex-end;
  }
  
  .modal-content {
    border-radius: 1.5rem 1.5rem 0 0;
    max-height: 95vh;
    width: 100%;
  }
  
  .modal.hidden .modal-content {
    transform: translateY(100%);
  }
  
  .modal .form-grid-2,
  .modal .form-grid-3 {
    grid-template-columns: 1fr;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Loading States */
.modal .btn-loading {
  position: relative;
  pointer-events: none;
}

.modal .btn-loading .button-text {
  opacity: 0;
}

.modal .btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1rem;
  height: 1rem;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Dark Mode Enhancements */
.dark .modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}

.dark .modal-content {
  background: hsl(var(--card));
  border-color: hsl(var(--border));
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Services View Toggle Styles */
.view-toggle-btn.active {
  border-color: hsl(var(--primary)) !important;
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

/* Services View Container */
.services-view {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.services-view.active {
  display: block;
}

/* Grid View Specific Styles */
#grid-view .card-elegant {
  height: 100%;
  display: flex;
  flex-direction: column;
}

#grid-view .card-elegant .p-4 {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#grid-view .space-y-3 {
  flex: 1;
}

/* Table View Responsive */
@media (max-width: 1200px) {
  .table-wrapper {
    overflow-x: auto;
  }
  
  .table-elegant {
    min-width: 800px;
  }
}

@media (max-width: 767px) {
  /* Grid adjustments for mobile */
  #grid-view .grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Table view mantém formato de tabela com scroll horizontal */
  #table-view .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 1rem;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    box-shadow: var(--shadow-soft);
  }
  
  #table-view .table-elegant {
    min-width: 800px;
    font-size: 0.8125rem;
  }
  
  #table-view .table-elegant th,
  #table-view .table-elegant td {
    padding: 0.75rem;
    font-size: 0.8125rem;
  }
  
  #table-view .table-elegant th:first-child,
  #table-view .table-elegant td:first-child {
    padding-left: 1rem;
  }
  
  #table-view .table-elegant th:last-child,
  #table-view .table-elegant td:last-child {
    padding-right: 1rem;
  }
  
  /* Ajustar ações para serem mais compactas */
  #table-view .table-actions {
    gap: 0.25rem;
  }
  
  #table-view .table-action-btn {
    width: 2rem;
    height: 2rem;
    padding: 0.25rem;
  }
  
  #table-view .table-action-btn i {
    width: 1rem;
    height: 1rem;
  }
  
  /* Dica visual de scroll horizontal */
  #table-view .table-wrapper::after {
    content: '← Deslize para ver mais →';
    display: block;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    background: hsl(var(--muted) / 0.2);
    border-top: 1px solid hsl(var(--border));
  }
  
  /* Header responsive adjustments */
  .flex.items-center.justify-between:not(.header-container) {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .flex.items-center.gap-2:not(.header-container) {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  /* Garantir que o header NUNCA quebre em linhas */
  .header-container {
    flex-wrap: nowrap !important;
    flex-direction: row !important;
  }
  
  /* Acordeões na página de custos - manter título e setinha na mesma linha */
  .accordion-toggle {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 0.5rem !important;
  }
  
  .accordion-toggle h3 {
    flex: 1 !important;
    min-width: 0 !important;
  }
  
  .accordion-icon {
    flex-shrink: 0 !important;
  }
  
  /* Centralizar Parâmetros Financeiros na página de Custos */
  #parametros-financeiros-content .grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  
  #parametros-financeiros-content .grid > div {
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  
  #parametros-financeiros-content .grid > div p,
  #parametros-financeiros-content .grid > div span,
  #parametros-financeiros-content .grid > div div {
    text-align: center !important;
    justify-content: center !important;
  }
  
  #parametros-financeiros-content .grid > div .flex {
    justify-content: center !important;
    align-items: center !important;
  }
  
  #parametros-financeiros-content .text-sm,
  #parametros-financeiros-content .text-2xl,
  #parametros-financeiros-content .text-3xl,
  #parametros-financeiros-content .font-bold {
    text-align: center !important;
    display: block !important;
    width: 100% !important;
  }
  
  /* Centralizar botões, exceto o botão de editar capacidade */
  #parametros-financeiros-content button:not([onclick*="editarCapacidade"]) {
    margin: 0 auto !important;
    display: block !important;
  }
  
  /* Garantir que o botão de editar NÃO seja forçado a block */
  #parametros-financeiros-content button[onclick*="editarCapacidade"] {
    margin: 0 !important;
    display: inline-flex !important;
  }
  
  /* Centralizar a div que contém o valor e o botão de editar */
  #parametros-financeiros-content .grid > div:first-child .flex {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0.5rem !important;
    flex-wrap: nowrap !important;
  }
  
  /* O span com o valor */
  #capacidade-display {
    display: inline-block !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
  }
  
  /* Botão de editar capacidade - garantir que fique inline */
  #parametros-financeiros-content .grid > div:first-child .flex button[onclick*="editarCapacidade"] {
    display: inline-flex !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
  }
  
  #parametros-financeiros-content form:not(#capacidade-form) {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  
  #parametros-financeiros-content form .flex {
    justify-content: center !important;
  }
  
  /* Garantir que o campo de edição fique fechado no mobile também */
  #parametros-financeiros-content #capacidade-form {
    display: none !important;
  }
  
  /* Quando estiver aberto (com style inline), usar flex para centralizar no mobile */
  #parametros-financeiros-content #capacidade-form[style*="display: flex"],
  #parametros-financeiros-content #capacidade-form[style*="display:flex"],
  #parametros-financeiros-content #capacidade-form[style*="display: block"],
  #parametros-financeiros-content #capacidade-form[style*="display:block"] {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
}

/* Garantir que o formulário de edição de capacidade fique fechado por padrão */
#capacidade-form {
  display: none;
}

/* Enhanced hover effects for grid cards */
#grid-view .hover-lift {
  transition: var(--transition-smooth);
}

#grid-view .hover-lift:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-elegant);
  border-color: hsl(var(--primary) / 0.3);
}

/* Smooth transitions for view switching */
.services-view {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.services-view.active {
  opacity: 1;
  transform: translateY(0);
}

/* Enhanced table styles for services */
.table-elegant tbody tr:hover {
  background: hsl(var(--accent) / 0.7);
  transform: scale(1.01);
}

.table-elegant tbody tr.inactive {
  opacity: 0.6;
}

.table-elegant tbody tr.inactive:hover {
  opacity: 0.8;
}

/* Status indicators with better visibility */
.status-dot {
  position: relative;
}

.status-dot::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  opacity: 0.3;
  animation: pulse-ring 2s infinite;
}

.status-dot.active::after {
  background: hsl(142 71% 45%);
}

.status-dot.inactive::after {
  background: hsl(var(--muted-foreground));
}

@keyframes pulse-ring {
  0%, 100% {
    transform: scale(1);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.1;
  }
}

/* Grid card content alignment */
#grid-view .text-center {
  text-align: center;
}

#grid-view .space-y-3 > * + * {
  margin-top: 0.75rem;
}

/* Better spacing for grid view */
#grid-view .grid {
  gap: 1.5rem;
}

/* Custom 3-column grid for services */
.servicos-grid-3-cols {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
  #grid-view .grid {
    gap: 2rem;
  }
  
  /* Force 3 columns on desktop - custom class */
  .servicos-grid-3-cols {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Table action buttons enhancement */
.table-action-btn {
  position: relative;
  overflow: hidden;
}

.table-action-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: currentColor;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
  opacity: 0.1;
}

.table-action-btn:hover::before {
  width: 100%;
  height: 100%;
}


/* Enhanced card shadows for grid view */
#grid-view .card-elegant {
  box-shadow: var(--shadow-card);
  border: 1px solid hsl(var(--border));
}

#grid-view .card-elegant:hover {
  box-shadow: var(--shadow-elegant);
  border-color: hsl(var(--primary) / 0.2);
}

/* Improved responsive behavior */
@media (max-width: 640px) {
  .flex.items-center.gap-4 {
    flex-direction: column;
    align-items: stretch;
  }
  
  .relative.flex-1 {
    order: 1;
  }
  
  .select {
    order: 2;
    width: 100% !important;
  }
  
  .flex.items-center.gap-1 {
    order: 3;
    justify-content: center;
  }
}

/* Campo somente leitura para modelo de cobrança */
.form-input-readonly {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  min-height: 2.75rem;
  transition: all 0.2s ease;
}

.form-input-readonly:hover {
  background: hsl(var(--muted) / 0.8);
}

.form-input-readonly span:first-child {
  font-size: 1rem;
}

.form-input-readonly span:last-child {
  font-weight: 500;
  flex: 1;
}

/* Estado quando modelo está definido */
.form-input-readonly.modelo-definido {
  background: hsl(var(--primary) / 0.05);
  border-color: hsl(var(--primary) / 0.2);
  color: hsl(var(--primary));
}

.form-input-readonly.modelo-definido:hover {
  background: hsl(var(--primary) / 0.08);
}

/* Dynamic Proposal Form Styles */
.form-section-header {
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid hsl(var(--border));
}

.form-section-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 0.25rem;
}

.form-section-description {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin: 0;
}

.dynamic-fields {
  padding: 1rem;
  background: hsl(var(--accent));
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  margin-bottom: 1rem;
  animation: slideIn 0.3s ease-out;
}

.valor-calculado {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: hsl(264 71% 67% / 0.08);
  border: 2px solid hsl(264 71% 67% / 0.2);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1.125rem;
  color: hsl(var(--foreground));
  transition: var(--transition-smooth);
}

.valor-calculado:hover {
  background: hsl(264 71% 67% / 0.12);
  border-color: hsl(264 71% 67% / 0.3);
}

.valor-icon {
  font-size: 1.25rem;
  opacity: 0.8;
}

.valor-text {
  flex: 1;
  color: hsl(264 71% 67%);
  font-weight: 700;
}

.valor-breakdown {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  border-radius: calc(var(--radius) - 4px);
  padding: 0.75rem;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
  font-size: 0.875rem;
}

.breakdown-label {
  color: hsl(var(--muted-foreground));
  font-weight: 500;
}

.breakdown-value {
  color: hsl(var(--foreground));
  font-weight: 600;
}

.calc-trigger {
  transition: var(--transition-smooth);
}

.calc-trigger:focus {
  border-color: hsl(264 71% 67%);
  box-shadow: 0 0 0 3px hsl(264 71% 67% / 0.1);
}

/* Form validation states */
.form-input.error {
  border-color: hsl(var(--destructive));
  box-shadow: 0 0 0 3px hsl(var(--destructive) / 0.1);
}

.form-input.success {
  border-color: hsl(142 76% 36%);
  box-shadow: 0 0 0 3px hsl(142 76% 36% / 0.1);
}

/* Dynamic field animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive adjustments for dynamic fields */
@media (max-width: 768px) {
  .dynamic-fields {
    padding: 0.75rem;
  }
  
  .valor-calculado {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .valor-text {
    font-size: 1rem;
  }
}

/* Loading states */
.calc-loading {
  opacity: 0.6;
  pointer-events: none;
}

.calc-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  border: 2px solid hsl(var(--muted-foreground));
  border-top: 2px solid hsl(var(--primary));
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: translateY(-50%) rotate(0deg); }
  100% { transform: translateY(-50%) rotate(360deg); }
}

/* ===== PIPELINE STYLES ===== */

/* IMPORTANTE: Impede scroll horizontal na página toda */
html {
  overflow-x: hidden;
  width: 100%;
}

body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

.layout-container {
  overflow-x: hidden;
  width: 100%;
}

.layout-content {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

.main-content {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* View Toggle Group */
.view-toggle-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem;
  background: hsl(var(--muted) / 0.3);
  border-radius: 8px;
}

.view-toggle-group .btn-outline {
  background: transparent;
  border: none;
  transition: all 0.2s ease;
}

.view-toggle-group .btn-outline.active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.view-toggle-group .btn-outline:hover:not(.active) {
  background: hsl(var(--muted) / 0.5);
}

/* View Containers */
.view-container {
  width: 100%;
  max-width: 100%;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  /* Container pai não causa scroll */
  overflow-x: hidden;
  overflow-y: visible;
  /* Garante que não ultrapasse a largura disponível */
  box-sizing: border-box;
}

.view-container.hidden {
  display: none;
}

/* ===== KANBAN BOARD STYLES ===== */

/* Main Kanban Board - Container que segura o scroll */
.kanban-board {
  width: 100%;
  max-width: 100%;
  height: calc(100vh - 380px);
  min-height: 500px;
  max-height: calc(100vh - 380px);
  border: 1px solid hsl(var(--border));
  border-radius: 12px;
  background: hsl(var(--muted) / 0.2);
  position: relative;
  box-shadow: var(--shadow-card);
  /* IMPORTANTE: Esconde qualquer overflow - o scroll é só no .kanban-container */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Container with horizontal scroll - APENAS ESTA DIV ROLA */
.kanban-container {
  display: flex;
  gap: 1.5rem;
  height: 100%;
  width: 100%;
  /* SCROLL HORIZONTAL APENAS AQUI */
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1.25rem;
  scroll-behavior: smooth;
  /* Força o scroll horizontal a aparecer sempre que necessário */
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--primary) / 0.7) hsl(var(--muted) / 0.3);
  /* Garante que o container não afete o resto da página */
  isolation: isolate;
  /* Força o flex a não encolher as colunas e ativar o scroll */
  flex-wrap: nowrap;
  /* Drag to scroll */
  cursor: default;
  user-select: none;
  position: relative;
}

/* Scrollbar styling */
.kanban-container::-webkit-scrollbar {
  height: 16px;
  background: hsl(var(--muted) / 0.2);
  border-radius: 0 0 12px 12px;
}

.kanban-container::-webkit-scrollbar-track {
  background: hsl(var(--muted) / 0.3);
  border-radius: 8px;
  margin: 4px 12px;
  border: 1px solid hsl(var(--border));
}

.kanban-container::-webkit-scrollbar-thumb {
  background: hsl(var(--primary) / 0.8);
  border-radius: 8px;
  border: 3px solid hsl(var(--muted) / 0.2);
  transition: all 0.3s ease;
  min-width: 60px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.kanban-container::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--primary));
  border-color: hsl(var(--muted) / 0.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Drag to Scroll Visual Feedback for Pipeline Kanban */
.kanban-container.dragging {
  cursor: grabbing !important;
  user-select: none;
}

.kanban-container.dragging * {
  cursor: grabbing !important;
}

.kanban-container:hover {
  cursor: grab;
}

/* Kanban Columns */
.kanban-column {
  flex: 0 0 350px;
  min-width: 350px;
  max-width: 350px;
  height: calc(100% - 2rem);
  display: flex;
  flex-direction: column;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
  overflow: hidden;
  flex-shrink: 0;
}

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

/* Column Header */
.kanban-column-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}

.stage-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kanban-column-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 0;
  line-height: 1.2;
}

.kanban-column-subtitle {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin: 0;
  margin-top: 2px;
}

.stage-count {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  min-width: 24px;
  text-align: center;
}

/* Column Content */
.kanban-column-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

.kanban-column-content::-webkit-scrollbar {
  width: 8px;
}

.kanban-column-content::-webkit-scrollbar-track {
  background: hsl(var(--muted) / 0.2);
  border-radius: 4px;
  margin: 4px 0;
}

.kanban-column-content::-webkit-scrollbar-thumb {
  background: hsl(var(--muted-foreground) / 0.4);
  border-radius: 4px;
  border: 2px solid hsl(var(--card));
}

.kanban-column-content::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--muted-foreground) / 0.6);
}

/* Empty State */
.kanban-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  text-align: center;
  color: hsl(var(--muted-foreground));
  min-height: 200px;
}

.empty-state-icon {
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0 0 0.25rem 0;
}

.empty-state-subtext {
  font-size: 0.75rem;
  margin: 0;
  opacity: 0.7;
}

/* Kanban Cards */
.kanban-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  padding: 1rem;
  cursor: grab;
  transition: var(--transition-smooth);
  position: relative;
  box-shadow: 0 1px 3px 0 hsl(var(--foreground) / 0.05);
  overflow: visible;
}

.kanban-card:hover {
  border-color: hsl(var(--primary) / 0.3);
  box-shadow: 0 4px 12px 0 hsl(var(--primary) / 0.1);
  transform: translateY(-1px);
}

.kanban-card:active {
  cursor: grabbing;
  transform: rotate(2deg) scale(1.02);
  box-shadow: 0 8px 25px 0 hsl(var(--primary) / 0.15);
}

.kanban-card.dragging {
  opacity: 0.8;
  transform: rotate(5deg) scale(1.05);
  z-index: 1000;
}

/* Accordion functionality for cards */
.kanban-card.collapsed {
  padding: 0.75rem;
  overflow: hidden;
}

.kanban-card.collapsed .kanban-card-header {
  margin-bottom: 0;
}

.kanban-card:not(.collapsed) {
  padding: 1rem;
  padding-bottom: 0.5rem;
  overflow: visible;
}

.kanban-card:not(.collapsed) .kanban-card-header {
  margin-bottom: 0.75rem;
}

.kanban-card.collapsed .kanban-card-content,
.kanban-card.collapsed .kanban-card-footer {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin: 0;
  padding: 0;
  transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.3s ease, padding 0.3s ease;
}

.kanban-card:not(.collapsed) .kanban-card-content {
  max-height: 1000px;
  opacity: 1;
  margin-bottom: 0.5rem;
  padding-bottom: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease 0.1s, margin 0.3s ease;
}

.kanban-card:not(.collapsed) .kanban-card-footer {
  max-height: 150px;
  opacity: 1;
  padding-top: 0.5rem;
  padding-bottom: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease 0.1s, padding 0.3s ease;
}

/* Card Header */
.kanban-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 0.75rem;
  position: relative;
  cursor: pointer;
}

.contact-info {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.contact-avatar {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: hsl(var(--primary) / 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--primary));
  flex-shrink: 0;
}

.contact-name h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 0;
  line-height: 1.3;
  word-break: break-word;
}

.company-name {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin: 2px 0 0 0;
  line-height: 1.2;
}

.contact-origin {
  flex-shrink: 0;
  margin-right: 1rem;
}

.origin-badge {
  font-size: 0.625rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border: 1px solid hsl(var(--border));
}

/* Card Content */
.kanban-card-content {
  margin-bottom: 0.75rem;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.contact-detail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.detail-icon {
  width: 12px;
  height: 12px;
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
}

.detail-text {
  color: hsl(var(--muted-foreground));
  line-height: 1.3;
  word-break: break-all;
  flex: 1;
}

/* Interest Tags */
.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

.interest-tag {
  font-size: 0.625rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 4px;
  line-height: 1;
}

.more-tag {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

/* Contact Notes */
.contact-notes {
  margin-bottom: 0;
  padding-bottom: 0;
}

.contact-notes p {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
  margin: 0;
  padding-bottom: 0;
  font-style: italic;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Card Footer */
.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.5rem;
  padding-bottom: 0;
  border-top: 1px solid hsl(var(--border));
}

.next-action {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex: 1;
  min-width: 0;
}

.footer-icon {
  width: 12px;
  height: 12px;
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
}

.footer-text {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.4;
}

/* Card Actions */
.card-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  opacity: 0.7;
  transition: var(--transition-smooth);
}

.kanban-card:hover .card-actions {
  opacity: 1;
}

.action-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  color: hsl(var(--muted-foreground));
}

.action-btn:hover {
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  transform: scale(1.1);
}

.edit-btn:hover {
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

.delete-btn:hover {
  background: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
}

.archive-btn:hover {
  background: hsl(45 93% 47% / 0.1);
  color: hsl(45 93% 47%);
}

/* Drag and Drop States */
.kanban-column-content.drag-over {
  background: hsl(var(--primary) / 0.05);
  border: 2px dashed hsl(var(--primary) / 0.3);
  border-radius: 8px;
}

.kanban-card.drag-placeholder {
  opacity: 0.5;
  border: 2px dashed hsl(var(--border));
  background: hsl(var(--muted) / 0.5);
}

/* Status Badge Colors */
.status-lead {
  background: hsl(264 71% 67% / 0.1);
  color: hsl(264 71% 67%);
  border-color: hsl(264 71% 67% / 0.2);
}

.status-proposta {
  background: hsl(45 93% 47% / 0.1);
  color: hsl(45 93% 47%);
  border-color: hsl(45 93% 47% / 0.2);
}

.status-cliente {
  background: hsl(142 76% 36% / 0.1);
  color: hsl(142 76% 36%);
  border-color: hsl(142 76% 36% / 0.2);
}

.status-perdido {
  background: hsl(0 84% 60% / 0.1);
  color: hsl(0 84% 60%);
  border-color: hsl(0 84% 60% / 0.2);
}

/* Stage Indicator Colors */
.bg-purple-500 { background: hsl(264 71% 67%); }
.bg-yellow-500 { background: hsl(45 93% 47%); }
.bg-orange-500 { background: hsl(25 95% 53%); }
.bg-green-500 { background: hsl(142 76% 36%); }
.bg-red-500 { background: hsl(0 84% 60%); }

/* ===== TABLE VIEW STYLES ===== */

.contacts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.contacts-table th {
  background: hsl(var(--muted) / 0.5);
  color: hsl(var(--foreground));
  font-weight: 600;
  padding: 1rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid hsl(var(--border));
}

.contacts-table td {
  padding: 0.75rem;
  border-bottom: 1px solid hsl(var(--border));
  vertical-align: top;
}

.table-row {
  transition: var(--transition-smooth);
}

.table-row:hover {
  background: hsl(var(--muted) / 0.3);
}

.table-row:hover .table-actions {
  opacity: 1;
}

/* Table Column Widths */
.th-checkbox { width: 50px; }
.th-contact { width: 250px; }
.th-stage { width: 150px; }
.th-contact-info { width: 200px; }
.th-location { width: 120px; }
.th-interests { width: 150px; }
.th-next-action { width: 120px; }
.th-actions { width: 120px; }

/* Checkbox Styles */
.checkbox-input {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  cursor: pointer;
  transition: var(--transition-smooth);
}

.checkbox-input:checked {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
}

/* Contact Cell Styles */
.contact-cell {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.contact-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: hsl(var(--primary) / 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--primary));
  flex-shrink: 0;
}

.contact-info-cell {
  flex: 1;
  min-width: 0;
}

.contact-name-cell {
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 2px;
  word-break: break-word;
}

.contact-company-cell {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 4px;
}

.contact-origin-cell {
  margin-top: 4px;
}

.origin-badge-small {
  font-size: 0.625rem;
  font-weight: 500;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border: 1px solid hsl(var(--border));
}

/* Stage Cell Styles */
.stage-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stage-indicator-small {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stage-name {
  font-weight: 500;
  color: hsl(var(--foreground));
}

/* Contact Info Details */
.contact-info-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.contact-detail-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-icon-small {
  width: 12px;
  height: 12px;
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
}

.detail-text-small {
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  word-break: break-all;
  flex: 1;
}

/* Location Cell */
.location-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Interests Cell */
.interests-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.interest-tag-small {
  font-size: 0.625rem;
  font-weight: 500;
  padding: 0.125rem 0.375rem;
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 4px;
  line-height: 1;
}

.interest-tag-small.more-tag {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

/* Next Action Cell */
.next-action-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Table Actions */
.table-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  opacity: 0.7;
  transition: var(--transition-smooth);
}

.action-btn-small {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  color: hsl(var(--muted-foreground));
}

.action-btn-small:hover {
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  transform: scale(1.1);
}

.action-btn-small.edit-btn:hover {
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

.action-btn-small.delete-btn:hover {
  background: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
}

.action-btn-small.archive-btn:hover {
  background: hsl(45 93% 47% / 0.1);
  color: hsl(45 93% 47%);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .kanban-board {
    height: calc(100vh - 400px);
    min-height: 500px;
  }
  
  .kanban-container {
    gap: 1rem;
  }
  
  .kanban-column {
    flex: 0 0 280px;
    min-width: 280px;
    max-width: 280px;
  }
}

@media (max-width: 768px) {
  .kanban-board {
    height: calc(100vh - 450px);
    min-height: 400px;
  }
  
  .kanban-container {
    gap: 0.75rem;
    padding: 0.75rem;
  }
  
  .kanban-column {
    flex: 0 0 260px;
    min-width: 260px;
    max-width: 260px;
  }
  
  .kanban-column-header {
    padding: 0.75rem 1rem;
  }
  
  .kanban-column-content {
    padding: 0.75rem;
  }
  
  .kanban-card {
    padding: 0.75rem;
  }
  
  .card-actions {
    opacity: 1;
  }
  
  .action-btn {
    width: 32px;
    height: 32px;
  }
  
  .kanban-container::-webkit-scrollbar {
    height: 10px;
  }
  
  .kanban-column-content::-webkit-scrollbar {
    width: 6px;
  }
}

/* ===================================
   Dashboard Calendar Styles
   =================================== */

/* Dashboard Top Section - Two Column Layout */
#dashboard-top {
  align-items: stretch;
}

#metrics-wrapper,
#calendar-wrapper {
  display: flex;
  flex-direction: column;
}

#metrics-grid {
  display: grid;
  gap: 1rem;
  height: 100%;
}

#calendar-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

#calendar-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Cabeçalho dos dias da semana */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  width: 100%;
  margin-bottom: 0.5rem;
}

.calendar-weekdays > div {
  text-align: center;
  padding: 0.25rem;
}

#calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  flex: 1;
  width: 100%;
}

/* Células do Calendário */
.cal-cell {
  position: relative;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: var(--transition-smooth);
  padding: 0.5rem;
  border: 1px solid hsl(var(--border) / 0.3);
  border-radius: 0.375rem;
  background: hsl(var(--card));
  overflow: hidden;
  word-wrap: break-word;
  box-sizing: border-box;
}

.cal-cell:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: hsl(var(--primary) / 0.5);
  transform: translateY(-1px);
}

.cal-cell:active {
  transform: translateY(0);
}

.cal-cell:focus {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
}

/* Célula de Hoje */
.cal-today {
  font-weight: 600;
  box-shadow: 0 0 0 2px hsl(var(--primary));
}

.cal-today:hover {
  box-shadow: 0 0 0 2px hsl(var(--primary)), var(--shadow-card-hover);
}

/* Indicador "Hoje" */
.cal-today-indicator {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Célula Vazia (dias fora do mês) */
.cal-cell-empty {
  min-height: 80px;
  background: transparent;
}

/* Número do Dia */
.cal-day-number {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

/* Indicadores de Tarefas - Dots coloridos por prioridade */

/* Dot de EVENTOS (roxo/purple) */
.cal-dot-event {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background-color: #7c3aed; /* Purple 600 */
  background: linear-gradient(135deg, #7c3aed, #6d28d9); /* Gradiente roxo */
  display: inline-block;
  box-shadow: 0 0 4px rgba(124, 58, 237, 0.4); /* Brilho suave roxo */
}

/* Dot de TAREFA - Prioridade URGENTE (vermelho escuro/rosa forte) */
.cal-dot-urgente {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background-color: #dc2626; /* Red 600 */
  background: linear-gradient(135deg, #dc2626, #b91c1c); /* Gradiente vermelho */
  display: inline-block;
  box-shadow: 0 0 5px rgba(220, 38, 38, 0.5); /* Brilho vermelho */
}

/* Dot de TAREFA - Prioridade ALTA (laranja/vermelho) */
.cal-dot-alta {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background-color: #f97316; /* Orange 500 */
  background: linear-gradient(135deg, #f97316, #ea580c); /* Gradiente laranja */
  display: inline-block;
  box-shadow: 0 0 4px rgba(249, 115, 22, 0.4); /* Brilho laranja */
}

/* Dot de TAREFA - Prioridade MÉDIA (amarelo) */
.cal-dot-media {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background-color: #eab308; /* Yellow 500 */
  background: linear-gradient(135deg, #eab308, #ca8a04); /* Gradiente amarelo */
  display: inline-block;
  box-shadow: 0 0 4px rgba(234, 179, 8, 0.4); /* Brilho amarelo */
}

/* Dot de TAREFA - Prioridade BAIXA (verde) */
.cal-dot-baixa {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background-color: #22c55e; /* Green 500 */
  background: linear-gradient(135deg, #22c55e, #16a34a); /* Gradiente verde */
  display: inline-block;
  box-shadow: 0 0 4px rgba(34, 197, 94, 0.4); /* Brilho verde */
}

/* Badge "+n" */
.cal-plus {
  font-size: 10px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 500;
}

/* Status Dots (mini-lista) */
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  flex-shrink: 0;
}

/* Mini-lista de Preview - REMOVIDA (usar popover) */
[data-cal-preview] {
  display: none; /* Não usar mais preview inline */
  margin-top: auto;
}

[data-cal-preview] li {
  line-height: 1.2;
  max-width: 100%;
}

/* Responsive: Desktop */
@media (min-width: 1024px) {
  #dashboard-top {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  
  #calendar-card {
    min-height: 100%;
  }
  
  #dashboard-main-layout {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Responsive: Desktop Grande */
@media (min-width: 1440px) {
  #calendar-body {
    padding: 1.5rem;
  }
  
  .cal-cell {
    min-height: 90px;
    padding: 0.75rem;
  }
  
  .cal-day-number {
    font-size: 0.938rem;
  }
  
  #calendar-grid {
    gap: 0.375rem;
  }
}

/* Responsive: Tablet */
@media (max-width: 1023px) {
  #dashboard-top {
    display: flex;
    flex-direction: column;
  }
  
  #calendar-card {
    min-height: 500px;
    overflow: hidden;
  }
  
  /* Ajustar header do calendário em tablets */
  #calendar-card > div:first-child {
    padding: 1rem;
    gap: 1rem;
  }
  
  #calendar-card > div:first-child > div:last-child {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  #calendar-card .btn-hero {
    font-size: 0.813rem;
    padding: 0.625rem 1rem !important;
  }
  
  .cal-cell {
    min-height: 75px;
  }
  
  .cal-cell-empty {
    min-height: 75px;
  }
}

/* Responsive: Tablet Médio (769px - 1023px) */
@media (min-width: 769px) and (max-width: 1023px) {
  #calendar-wrapper {
    width: 100%;
    max-width: 100%;
  }
  
  #calendar-card {
    width: 100%;
  }
  
  #calendar-body {
    padding: 1rem;
  }
  
  .calendar-weekdays > div {
    font-size: 0.75rem;
    padding: 0.25rem;
  }
  
  #calendar-grid {
    gap: 0.25rem;
  }
  
  .cal-cell {
    min-height: 70px;
    padding: 0.5rem;
  }
  
  .cal-day-number {
    font-size: 0.813rem;
  }
}

/* Responsive: Mobile */
@media (max-width: 768px) {
  #metrics-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  /* Garantir que calendário e projetos tenham mesma largura */
  #calendar-wrapper,
  #calendar-card,
  #active-projects-carousel {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    overflow: hidden;
  }
  
  #calendar-card {
    min-height: 450px;
  }
  
  /* Ajustar header do calendário no mobile */
  #calendar-card > div:first-child {
    padding: 0.75rem !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  #calendar-card > div:first-child > div:first-child {
    width: 100%;
  }
  
  #calendar-card > div:first-child > div:last-child {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  #calendar-card .btn-hero {
    flex: 1;
    min-width: 120px;
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem !important;
  }
  
  #current-month {
    min-width: 100px;
    font-size: 0.75rem;
  }
  
  #prev-month,
  #next-month {
    padding: 0.5rem;
  }
  
  /* Ajustar corpo do calendário para não cortar */
  #calendar-body {
    padding: 0.75rem 0.5rem;
    width: 100%;
    overflow: hidden;
  }
  
  /* Cabeçalho dos dias da semana - reduzir espaçamento */
  .calendar-weekdays {
    margin-bottom: 0.375rem;
    padding: 0 0.25rem;
  }
  
  .calendar-weekdays > div {
    padding: 0.125rem;
    font-size: 0.625rem;
  }
  
  /* Grid do calendário - ajustar gap e garantir que caiba */
  #calendar-grid {
    gap: 0.1rem;
    width: 100%;
    padding: 0 0.25rem;
  }
  
  .cal-cell {
    min-height: 60px;
    padding: 0.25rem;
    font-size: 0.75rem;
  }
  
  .cal-cell-empty {
    min-height: 60px;
  }
  
  .cal-day-number {
    font-size: 0.7rem;
    line-height: 1;
  }
  
  .cal-dot,
  .cal-dot-event {
    width: 4px;
    height: 4px;
  }
  
  .cal-plus {
    font-size: 8px;
    padding: 1px 2px;
  }
  
  .status-dot {
    width: 4px;
    height: 4px;
  }
  
  [data-cal-preview] {
    font-size: 8px;
  }
  #calendar-card .p-4 {
    padding: 0.75rem !important;
  }
  
  #calendar-card .flex.items-center.justify-between {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  #current-month {
    min-width: 100px;
    font-size: 0.75rem;
  }
  
  #prev-month,
  #next-month {
    padding: 0.375rem;
  }
  
  #prev-month i,
  #next-month i {
    width: 0.875rem;
    height: 0.875rem;
  }
  
  /* Botão "Ir para Tarefas" menor no mobile */
  #calendar-card .btn-hero {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.75rem;
    white-space: nowrap;
  }
}

/* Responsive: Extra Small Mobile */
@media (max-width: 640px) {
  #metrics-grid {
    grid-template-columns: 1fr;
  }
  
  /* Garantir mesma largura para calendário e projetos em telas pequenas */
  #calendar-wrapper,
  #calendar-card,
  #active-projects-carousel {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }
  
  #calendar-card {
    min-height: 400px;
  }
  
  /* Header do calendário ainda mais compacto */
  #calendar-card > div:first-child {
    padding: 0.5rem !important;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  #calendar-card > div:first-child h3 {
    font-size: 0.875rem;
  }
  
  #calendar-card > div:first-child .h-8 {
    width: 1.5rem;
    height: 1.5rem;
  }
  
  #calendar-card > div:first-child .h-8 i {
    width: 0.875rem;
    height: 0.875rem;
  }
  
  #current-month {
    min-width: 80px;
    font-size: 0.688rem;
  }
  
  #prev-month,
  #next-month {
    padding: 0.375rem;
  }
  
  #prev-month i,
  #next-month i {
    width: 0.75rem;
    height: 0.75rem;
  }
  
  #calendar-card .btn-hero {
    padding: 0.375rem 0.625rem !important;
    font-size: 0.688rem;
    min-width: 100px;
  }
  
  /* Reduzir ainda mais o padding do calendário em telas muito pequenas */
  #calendar-body {
    padding: 0.5rem 0.25rem;
  }
  
  /* Cabeçalho dos dias - ainda menor */
  .calendar-weekdays {
    padding: 0 0.125rem;
    margin-bottom: 0.25rem;
  }
  
  .calendar-weekdays > div {
    font-size: 0.563rem;
    padding: 0;
  }
  
  /* Grid mais compacto */
  #calendar-grid {
    gap: 0.063rem;
    padding: 0 0.125rem;
  }
  
  .cal-cell {
    min-height: 48px;
    padding: 0.188rem;
    font-size: 0.688rem;
  }
  
  .cal-cell-empty {
    min-height: 48px;
  }
  
  .cal-day-number {
    font-size: 0.625rem;
  }
  
  .cal-dot,
  .cal-dot-event {
    width: 3px;
    height: 3px;
  }
  
  .cal-plus {
    font-size: 7px;
    padding: 0px 2px;
  }
  
  /* Ocultar preview em telas muito pequenas */
  [data-cal-preview] {
    display: none;
  }
  
  /* Header ainda mais compacto em telas muito pequenas */
  #calendar-card .p-4 {
    padding: 0.5rem !important;
  }
  
  #current-month {
    min-width: 80px;
    font-size: 0.688rem;
  }
  
  #prev-month,
  #next-month {
    padding: 0.25rem;
  }
  
  /* Botão "Ir para Tarefas" ainda menor */
  #calendar-card .btn-hero {
    padding: 0.375rem 0.625rem !important;
    font-size: 0.688rem;
  }
  
  /* Título do calendário */
  #calendar-card h3 {
    font-size: 0.875rem;
  }
}

/* ===================================
   Calendar Day Modal Styles
   =================================== */

/* Calendar Modal usa o sistema de modal padrão definido acima */
/* Estilos específicos do calendário abaixo */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
  flex-shrink: 0;
}

/* Estilos já definidos anteriormente - não duplicar aqui */

/* Botão ícone pequeno */
.btn-icon-sm {
  padding: 0.25rem;
  border: none;
  background: transparent;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-sm:hover {
  background: hsl(var(--accent));
}

.btn-icon {
  padding: 0.5rem;
  border: none;
  background: transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--muted-foreground));
}

.btn-icon:hover {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
}

/* Responsivo: Modal em mobile */
@media (max-width: 768px) {
  .modal-container {
    max-width: 100%;
    max-height: 95vh;
    border-radius: 0.75rem;
  }
  
  .modal-header {
    padding: 1rem;
  }
  
  .modal-body {
    padding: 1rem;
  }
  
  .modal-header .flex {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .modal-header .flex > div:last-child {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* ==========================================================================
   CALENDAR POPOVER (Hover) - Estilo Pílulas
   ========================================================================== */

.calendar-popover {
  /* Transições e estados de visibilidade */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.calendar-popover.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Fallback para bg-primary se variável CSS não estiver disponível */
.btn-popover-modal.bg-primary {
  background-color: hsl(var(--primary) / 1);
}

.btn-popover-modal.bg-primary:hover {
  background-color: hsl(var(--primary) / 0.9);
}

/* Garantir que cores Tailwind funcionem */
.bg-emerald-500 {
  background-color: #10b981;
}

.bg-blue-500 {
  background-color: #3b82f6;
}

.bg-amber-500 {
  background-color: #f59e0b;
}

.bg-purple-500 {
  background-color: #a855f7;
}

.bg-red-500 {
  background-color: #ef4444;
}

.bg-red-600 {
  background-color: #dc2626;
}

.bg-gray-400 {
  background-color: #9ca3af;
}

/* Responsivo: Esconder em mobile (usar modal direto) */
@media (max-width: 767px) {
  .calendar-popover {
    display: none !important;
  }
}

/* ==========================================================================
   CALENDAR DAY MODAL - Estilos Restritos (Escopo Fechado)
   Pilha z-index: popover(9999) < overlay(10010) < painel(10020)
   ========================================================================== */

/* Container principal do modal - z-index alto */
#calendar-day-modal[data-caldaymodal] {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1rem;
}

/* Overlay do modal - abaixo do painel mas acima do popover */
#calendar-day-modal[data-caldaymodal] > div[data-close]:first-child {
  position: fixed;
  inset: 0;
  z-index: 10010;
  background-color: rgba(0, 0, 0, 0.4);
  cursor: pointer;
  backdrop-filter: blur(4px);
}

/* Painel principal do modal - z-index mais alto */
#calendar-day-modal[data-caldaymodal] > div.relative {
  position: relative;
  z-index: 10020;
  margin: 0 auto;
  width: 100%;
  max-width: 48rem; /* max-w-3xl = 48rem */
  border-radius: 1rem;
  background-color: white;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid #e5e7eb;
}

/* Dark mode para o painel */
.dark #calendar-day-modal[data-caldaymodal] > div.relative {
  background-color: hsl(var(--card));
  border-color: hsl(var(--border));
}

/* Header do modal */
#calendar-day-modal[data-caldaymodal] header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark #calendar-day-modal[data-caldaymodal] header {
  border-bottom-color: hsl(var(--border));
}

/* Título com ícone */
#calendar-day-modal[data-caldaymodal] header > div:first-child {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

#calendar-day-modal[data-caldaymodal] header > div:first-child > span {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
  flex-shrink: 0;
}

#calendar-day-modal[data-caldaymodal] header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
}

.dark #calendar-day-modal[data-caldaymodal] header h3 {
  color: hsl(var(--foreground));
}

/* Botões do header */
#calendar-day-modal[data-caldaymodal] header > div:last-child {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

#calendar-day-modal[data-caldaymodal] .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
}

#calendar-day-modal[data-caldaymodal] .btn.btn-primary {
  background-color: #7c3aed;
  color: white;
  box-shadow: 0 4px 14px 0 rgba(124, 58, 237, 0.25);
}

#calendar-day-modal[data-caldaymodal] .btn.btn-primary:hover {
  background-color: #6d28d9;
  transform: translateY(-1px);
}

#calendar-day-modal[data-caldaymodal] .btn.btn-ghost {
  background-color: transparent;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

.dark #calendar-day-modal[data-caldaymodal] .btn.btn-ghost {
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}

#calendar-day-modal[data-caldaymodal] .btn.btn-ghost:hover {
  background-color: #f9fafb;
}

.dark #calendar-day-modal[data-caldaymodal] .btn.btn-ghost:hover {
  background-color: hsl(var(--accent));
}

#calendar-day-modal[data-caldaymodal] .btn.btn-icon {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background-color: transparent;
  color: #6b7280;
  border: none;
}

#calendar-day-modal[data-caldaymodal] .btn.btn-icon:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.dark #calendar-day-modal[data-caldaymodal] .btn.btn-icon:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--foreground));
}

/* Seção do body */
#calendar-day-modal[data-caldaymodal] section {
  padding: 1.25rem;
}

#calendar-day-modal[data-caldaymodal] section h4 {
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0;
}

.dark #calendar-day-modal[data-caldaymodal] section h4 {
  color: hsl(var(--muted-foreground));
}

/* Contador de tarefas */
#calendar-day-modal[data-caldaymodal] [data-tasks-count] {
  color: #9ca3af;
  font-weight: 400;
}

/* Lista de tarefas */
#calendar-day-modal[data-caldaymodal] [data-tasks-list] {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#calendar-day-modal[data-caldaymodal] [data-tasks-list] > li {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Lista de eventos */
#calendar-day-modal[data-caldaymodal] [data-events-list] {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#calendar-day-modal[data-caldaymodal] [data-events-list] > li {
  list-style: none;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  background-color: white;
}

.dark #calendar-day-modal[data-caldaymodal] [data-events-list] > li {
  background-color: hsl(var(--card));
  border-color: hsl(var(--border));
}

/* Responsivo */
@media (max-width: 768px) {
  #calendar-day-modal[data-caldaymodal] {
    padding: 1rem 0.5rem;
  }
  
  #calendar-day-modal[data-caldaymodal] > div.relative {
    max-width: 100%;
  }
  
  #calendar-day-modal[data-caldaymodal] header {
    flex-wrap: wrap;
    padding: 1rem;
  }
  
  #calendar-day-modal[data-caldaymodal] header > div:last-child {
    width: 100%;
    margin-left: 0;
    margin-top: 0.5rem;
    justify-content: space-between;
  }
  
  #calendar-day-modal[data-caldaymodal] .btn {
    flex: 1;
    font-size: 0.8125rem;
    padding: 0.5rem 1rem;
  }
  
  #calendar-day-modal[data-caldaymodal] .btn.btn-icon {
    flex: 0;
    width: 2rem;
    height: 2rem;
  }
}

/* ==========================================================================
   TASK EDIT MODAL - Modal de Edição Inline (usa classes padrão do sistema)
   Z-index customizado para aparecer acima do Modal do Dia
   ========================================================================== */

/* O modal de edição usa as classes padrão .modal, .modal-overlay, .modal-container
   Apenas ajustamos o z-index inline via style="z-index: 10030" no HTML
   para garantir que apareça acima do Modal do Dia (z-index 10020) */

/* ==========================================================================
   DASHBOARD - Active Projects Carousel & Team Section
   ========================================================================== */

/* Dashboard Main Layout - 2 columns: Left (KPIs + Team) | Right (Calendar) */
#dashboard-main-layout {
  display: grid;
  gap: 1.5rem;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

/* Garantir que calendário nunca cause overflow horizontal */
#calendar-wrapper {
  overflow: hidden;
  width: 100%;
  min-width: 0; /* Importante para grid */
}

#calendar-card {
  overflow: hidden;
  width: 100%;
  min-width: 0; /* Importante para grid */
}

/* Responsividade do Dashboard Main Layout */
@media (max-width: 1023px) {
  #dashboard-main-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  #dashboard-main-layout {
    gap: 1rem;
  }
  
  #dashboard-kpis {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

@media (min-width: 640px) and (max-width: 768px) {
  #dashboard-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Dashboard KPIs - Estilo Moderno e Elegante */
#dashboard-kpis .card-elegant {
  position: relative;
  overflow: hidden;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border) / 0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#dashboard-kpis .card-elegant::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

#dashboard-kpis .card-elegant:hover::before {
  opacity: 1;
}

#dashboard-kpis .card-elegant:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 28px -8px hsl(var(--foreground) / 0.15);
  border-color: hsl(var(--border) / 0.8);
}

/* Ícones dos KPIs com gradiente suave */
#dashboard-kpis .bg-purple-500\/10 {
  background: linear-gradient(135deg, rgba(118, 78, 226, 0.15), rgba(118, 78, 226, 0.05));
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(118, 78, 226, 0.1);
}

#dashboard-kpis .bg-yellow-500\/10 {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), rgba(234, 179, 8, 0.05));
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.1);
}

#dashboard-kpis .bg-green-500\/10 {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.1);
}

#dashboard-kpis .bg-blue-500\/10 {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

/* Números dos KPIs com estilo mais impactante */
#dashboard-kpis .text-2xl {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, hsl(var(--foreground)), hsl(var(--foreground) / 0.7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Textos secundários com melhor legibilidade */
#dashboard-kpis .text-sm {
  font-weight: 600;
  letter-spacing: -0.01em;
}

#dashboard-kpis .text-xs {
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Animação suave no hover dos ícones */
#dashboard-kpis .card-elegant:hover [data-lucide] {
  transform: scale(1.1) rotate(5deg);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#dashboard-kpis [data-lucide] {
  transition: transform 0.3s ease;
}

/* Cores específicas por tipo de KPI */
#dashboard-kpis .card-elegant:nth-child(1) {
  --accent-color: rgba(118, 78, 226, 0.8);
}

#dashboard-kpis .card-elegant:nth-child(2) {
  --accent-color: rgba(234, 179, 8, 0.8);
}

#dashboard-kpis .card-elegant:nth-child(3) {
  --accent-color: rgba(34, 197, 94, 0.8);
}

#dashboard-kpis .card-elegant:nth-child(4) {
  --accent-color: rgba(59, 130, 246, 0.8);
}

/* Desktop: 2 colunas lado a lado */
@media (min-width: 1024px) {
  #dashboard-main-layout {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Coluna esquerda (KPIs + Equipe) */
  #dashboard-main-layout > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }
  
  #dashboard-kpis {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  /* Equipe Ativa - expande para preencher espaço restante */
  #active-team {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  
  #active-team .p-6:last-child {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  
  #team-carousel-container {
    width: 100%;
    display: flex;
    align-items: center;
  }
  
  /* Calendário - mesma altura da coluna esquerda */
  #calendar-wrapper {
    height: 100%;
  }
  
  #calendar-card {
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  
  #calendar-body {
    flex: 1;
    min-height: 450px;
    overflow: auto;
  }
  
  #calendar-grid {
    height: 100%;
  }
}

/* Tablet/Mobile: empilhamento vertical */
@media (max-width: 1023px) {
  #dashboard-main-layout {
    grid-template-columns: 1fr;
    width: 100%;
  }
  
  /* Garantir que todos os elementos tenham a mesma largura */
  #dashboard-main-layout > div {
    width: 100%;
    max-width: 100%;
  }
  
  #dashboard-kpis {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  #calendar-wrapper {
    height: auto;
    width: 100%;
  }
  
  #calendar-card {
    height: auto;
    width: 100%;
  }
  
  #calendar-body {
    min-height: 400px;
  }
}

/* Mobile: KPIs em 1 coluna */
@media (max-width: 640px) {
  #dashboard-kpis {
    grid-template-columns: 1fr;
  }
  
  /* Garantir mesma largura horizontal para calendário e projetos */
  #dashboard-main-layout,
  #active-projects-carousel {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  /* Remover qualquer padding que possa causar diferença de largura */
  #calendar-card .p-4,
  #active-projects-carousel .p-6 {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Responsive: Mobile Landscape */
@media (max-width: 896px) and (max-height: 500px) and (orientation: landscape) {
  #calendar-card {
    min-height: 350px;
  }
  
  #calendar-body {
    padding: 0.5rem;
  }
  
  .cal-cell {
    min-height: 45px;
    padding: 0.25rem;
  }
  
  .cal-cell-empty {
    min-height: 45px;
  }
  
  .cal-day-number {
    font-size: 0.688rem;
  }
  
  .calendar-weekdays > div {
    font-size: 0.625rem;
  }
  
  #calendar-grid {
    gap: 0.125rem;
  }
}

/* Melhorias gerais de responsividade */
@media (max-width: 480px) {
  #calendar-card > div:first-child {
    padding: 0.5rem !important;
  }
  
  #calendar-card > div:first-child > div:last-child {
    width: 100%;
    justify-content: space-between;
  }
  
  #calendar-card .btn-hero {
    flex: 1 1 auto;
    max-width: 45%;
  }
  
  #prev-month,
  #next-month,
  #current-month {
    flex-shrink: 0;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .cal-cell {
    min-height: 60px;
    touch-action: manipulation;
  }
  
  .cal-cell:active {
    transform: scale(0.98);
    background: hsl(var(--accent));
  }
  
  #prev-month,
  #next-month {
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
  }
}

/* Prevenir overflow horizontal global no dashboard */
.space-y-6 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Melhorias de acessibilidade para o calendário */
.cal-cell[aria-label] {
  position: relative;
}

.cal-cell:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
  z-index: 1;
}

/* ==========================================================================
   QUICK ACTIONS - Ações Rápidas Responsivas
   ========================================================================== */

#quick-actions-section {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

#quick-actions-grid {
  width: 100%;
  max-width: 100%;
}

.quick-action-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 100px;
  background: hsl(var(--card));
  touch-action: manipulation;
}

.quick-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px hsl(var(--foreground) / 0.1);
}

.quick-action-btn:active {
  transform: translateY(0);
}

.quick-action-btn i {
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

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

.quick-action-btn span {
  word-wrap: break-word;
  max-width: 100%;
  line-height: 1.3;
}

/* Responsive: Desktop Grande */
@media (min-width: 1280px) {
  .quick-action-btn {
    min-height: 110px;
  }
}

/* Responsive: Desktop */
@media (min-width: 1024px) {
  #quick-actions-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .quick-action-btn {
    min-height: 105px;
  }
}

/* Responsive: Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  #quick-actions-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .quick-action-btn {
    min-height: 95px;
  }
}

/* Responsive: Mobile Large */
@media (min-width: 640px) and (max-width: 767px) {
  #quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .quick-action-btn {
    min-height: 90px;
    padding: 0.75rem;
  }
  
  .quick-action-btn i {
    width: 1.25rem;
    height: 1.25rem;
  }
  
  .quick-action-btn span {
    font-size: 0.813rem;
  }
}

/* Responsive: Mobile */
@media (max-width: 639px) {
  #quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  
  .quick-action-btn {
    min-height: 85px;
    padding: 0.625rem;
    gap: 0.375rem;
  }
  
  .quick-action-btn i {
    width: 1.125rem;
    height: 1.125rem;
  }
  
  .quick-action-btn span {
    font-size: 0.75rem;
    line-height: 1.2;
  }
}

/* Responsive: Mobile Extra Small */
@media (max-width: 480px) {
  #quick-actions-section .p-4 {
    padding: 0.75rem;
  }
  
  #quick-actions-grid {
    gap: 0.5rem;
  }
  
  .quick-action-btn {
    min-height: 80px;
    padding: 0.5rem;
    gap: 0.25rem;
  }
  
  .quick-action-btn i {
    width: 1rem;
    height: 1rem;
  }
  
  .quick-action-btn span {
    font-size: 0.688rem;
    line-height: 1.1;
  }
}

/* Responsive: Mobile em Landscape */
@media (max-width: 896px) and (max-height: 500px) and (orientation: landscape) {
  #quick-actions-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
  }
  
  .quick-action-btn {
    min-height: 70px;
    padding: 0.5rem;
  }
  
  .quick-action-btn span {
    font-size: 0.688rem;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .quick-action-btn {
    min-height: 88px;
  }
  
  .quick-action-btn:active {
    background: hsl(var(--accent));
    transform: scale(0.98);
  }
}

/* Garantir que todos os botões tenham a mesma altura na linha */
#quick-actions-grid {
  align-items: stretch;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* ==========================================================================
   DASHBOARD CONTENT GRID - Atividades e Tarefas Responsivas
   ========================================================================== */

#dashboard-content-grid {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

#dashboard-content-grid > .card-elegant {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

/* Responsive: Mobile */
@media (max-width: 1023px) {
  #dashboard-content-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  #dashboard-content-grid .p-6 {
    padding: 1rem;
  }
  
  #dashboard-content-grid .space-y-4 {
    gap: 0.75rem;
  }
}

@media (max-width: 768px) {
  #dashboard-content-grid {
    gap: 0.75rem;
  }
  
  #dashboard-content-grid .p-6 {
    padding: 0.75rem;
  }
  
  #dashboard-content-grid h3 {
    font-size: 1rem;
  }
  
  #dashboard-content-grid .text-sm {
    font-size: 0.813rem;
  }
}

@media (max-width: 640px) {
  #dashboard-content-grid .p-4 {
    padding: 0.625rem;
  }
  
  #dashboard-content-grid .rounded-xl {
    border-radius: 0.5rem;
  }
  
  /* Ajustar ícones em mobile */
  #dashboard-content-grid .h-8.w-8 {
    width: 1.75rem;
    height: 1.75rem;
  }
  
  #dashboard-content-grid .h-8.w-8 i {
    width: 0.875rem;
    height: 0.875rem;
  }
}

/* Custom Scrollbar for Carousels */
.scrollbar-custom {
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--primary) / 0.3) hsl(var(--muted) / 0.2);
  scroll-behavior: smooth;
  overflow-y: hidden !important;
  overflow-x: auto;
}

.scrollbar-custom::-webkit-scrollbar {
  height: 8px;
  width: 0px;
}

.scrollbar-custom::-webkit-scrollbar-corner {
  display: none;
}

.scrollbar-custom::-webkit-scrollbar-track {
  background: hsl(var(--muted) / 0.2);
  border-radius: 4px;
}

.scrollbar-custom::-webkit-scrollbar-thumb {
  background: hsl(var(--primary) / 0.3);
  border-radius: 4px;
  transition: background 0.2s ease;
}

.scrollbar-custom::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--primary) / 0.5);
}

/* Carrossel de Projetos - Sem scroll vertical */
#active-projects-carousel {
  overflow: hidden;
}

#projects-carousel-container {
  overflow-y: hidden !important;
}

/* Project Cards in Carousel - Formato Retrato */
.project-card {
  transition: var(--transition-smooth);
  border: 1px solid hsl(var(--border));
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
}

.project-card * {
  text-align: left !important;
}

.project-card .flex {
  justify-content: flex-start !important;
}

.project-card .flex.justify-between {
  justify-content: space-between !important;
}

.project-card .flex.justify-start {
  justify-content: flex-start !important;
}

/* Avatar do Responsável no Card de Projeto */
.project-responsavel-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid hsl(var(--border));
  flex-shrink: 0;
}

.project-responsavel-avatar-placeholder {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 600;
  color: white;
  border: 1px solid hsl(var(--border));
  flex-shrink: 0;
}

.project-card > div {
  display: flex;
  flex-direction: column;
  padding: 1.25rem !important;
  overflow: hidden;
}

.project-card h4 {
  margin-bottom: 0.5rem;
  min-height: 2.6rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: left !important;
}

.project-card .flex.items-start {
  margin-bottom: 0.5rem;
  min-height: 2.6rem;
  align-items: flex-start;
}

.project-card p {
  margin-bottom: 0.25rem;
  text-align: left !important;
}

/* Campos Cliente e Responsável com altura mínima para alinhamento */
.project-card > div > p {
  margin-bottom: 0.375rem;
  min-height: 1.4rem;
  text-align: left !important;
}

.project-card span {
  text-align: left !important;
}

.project-card div {
  text-align: left;
}

.project-card .mb-2 {
  margin-bottom: 0.375rem;
  min-height: 1.4rem;
}

.project-card .mb-3 {
  margin-bottom: 0.375rem;
}

/* Seção de Datas do Projeto */
.project-dates {
  margin-bottom: 0.5rem;
  margin-top: 0.25rem;
  padding: 0.375rem 0;
  border-top: 1px solid hsl(var(--border) / 0.3);
  border-bottom: 1px solid hsl(var(--border) / 0.3);
  min-height: 3rem;
}

.project-dates p {
  margin-bottom: 0.125rem;
  line-height: 1.2;
}

.project-dates p:last-child {
  margin-bottom: 0;
}

.project-dates .text-xs {
  font-size: 0.7rem;
}

.project-dates [data-lucide] {
  opacity: 0.6;
}

.project-dates .font-medium {
  min-width: 45px;
}

/* Seção de progresso com altura fixa para alinhamento */
.project-card > div > div.mb-2:not(.project-dates) {
  margin-bottom: 0.625rem;
  min-height: 4rem;
}

.project-card .progress {
  margin-bottom: 0.25rem;
}

.project-card .text-xs.mt-1 {
  margin-top: 0.125rem;
  line-height: 1.2;
}

.project-card .mt-3 {
  margin-top: 0.875rem;
  padding-top: 0;
  flex-shrink: 0;
}

.project-card .mt-4 {
  margin-top: 0.75rem;
  padding-top: 0;
  flex-shrink: 0;
}

.project-card .flex-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.project-card .w-full {
  width: 100%;
}

.project-card .btn-sm {
  padding: 0.625rem 1rem;
  justify-content: center;
  font-size: 0.8125rem;
  flex-shrink: 0;
  text-align: center !important;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-elegant);
  border-color: hsl(var(--primary) / 0.3);
}

/* Team Member Styling */
.team-member {
  text-decoration: none;
  transition: var(--transition-smooth);
}

.team-member:hover {
  transform: translateY(-2px);
}

.team-avatar-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
}

.team-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid hsl(var(--border));
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
}

.team-avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid hsl(var(--border));
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
}

.team-member:hover .team-avatar,
.team-member:hover .team-avatar-placeholder {
  border-color: hsl(var(--primary));
  box-shadow: var(--shadow-card-hover);
  transform: scale(1.05);
}

/* Active Team - agora dentro da coluna esquerda */
#active-team {
  /* Estilos específicos se necessário */
}

/* ========================================
   ELEGANT TIMEPICKER - Seletor de Horário Moderno
   ======================================== */

.elegant-timepicker {
  position: relative;
  width: 100%;
  z-index: 1;
}

.timepicker-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  background: white;
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.timepicker-display:hover {
  border-color: hsl(var(--primary));
  background: hsl(var(--accent));
}

.elegant-timepicker.active .timepicker-display {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
}

.timepicker-icon {
  color: hsl(var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
}

.timepicker-value {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  letter-spacing: 0.05em;
}

.timepicker-chevron {
  color: hsl(var(--muted-foreground));
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.elegant-timepicker.active .timepicker-chevron {
  transform: rotate(180deg);
}

.timepicker-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  animation: slideDown 0.2s ease;
  pointer-events: all;
}

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

.timepicker-dropdown.hidden {
  display: none;
}

.timepicker-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.time-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.time-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.time-selector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  position: relative;
  z-index: 2;
}

.time-btn {
  width: 2.5rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--accent));
  border: 1px solid hsl(var(--border));
  border-radius: 0.375rem;
  color: hsl(var(--primary));
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: all;
  outline: none;
}

.time-btn:hover {
  background: hsl(var(--primary));
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px hsl(var(--primary) / 0.3);
}

.time-btn:active {
  transform: translateY(0);
  box-shadow: none;
  background: hsl(var(--primary) / 0.9);
}

.time-btn:focus {
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.2);
}

.time-input {
  width: 3.5rem;
  height: 3rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  background: hsl(var(--accent));
  border: 2px solid hsl(var(--border));
  border-radius: 0.5rem;
  outline: none;
  transition: all 0.2s ease;
}

.time-input:focus {
  border-color: hsl(var(--primary));
  background: white;
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
}

.time-separator {
  font-size: 2rem;
  font-weight: 700;
  color: hsl(var(--muted-foreground));
  margin: 0 0.5rem;
  align-self: center;
  margin-top: 1.5rem;
}

.timepicker-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid hsl(var(--border));
  position: relative;
  z-index: 2;
}

.preset-btn {
  padding: 0.5rem;
  background: hsl(var(--accent));
  border: 1px solid hsl(var(--border));
  border-radius: 0.375rem;
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: all;
}

.preset-btn:hover {
  background: hsl(var(--primary));
  color: white;
  border-color: hsl(var(--primary));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px hsl(var(--primary) / 0.2);
}

.preset-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px hsl(var(--primary) / 0.15);
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .timepicker-dropdown {
    padding: 0.75rem;
  }
  
  .timepicker-controls {
    gap: 1rem;
  }
  
  .time-input {
    width: 3rem;
    height: 2.5rem;
    font-size: 1.25rem;
  }
  
  .time-separator {
    font-size: 1.5rem;
  }
  
  .timepicker-presets {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .team-avatar-wrapper {
    width: 64px;
    height: 64px;
  }
  
  .team-avatar,
  .team-avatar-placeholder {
    width: 64px;
    height: 64px;
    border-width: 2px;
  }
  
  .team-avatar-placeholder span {
    font-size: 1.25rem;
  }
  
  /* Manter layout dos cards igual ao desktop */
  .project-card {
    width: 280px !important;
    min-width: 280px;
    height: auto;
    overflow: hidden;
  }
  
  .project-card > div {
    padding: 1.5rem !important;
    text-align: left;
  }
  
  /* Garantir alinhamento à esquerda de todos os textos */
  .project-card h4,
  .project-card p,
  .project-card span,
  .project-card div {
    text-align: left !important;
  }
  
  /* Forçar elementos flex para começar à esquerda */
  .project-card .flex.items-center {
    justify-content: flex-start !important;
  }
  
  .project-card .flex.justify-start {
    justify-content: flex-start !important;
  }
  
  .project-card h4 {
    min-height: 2.5rem;
    font-size: 1rem;
  }
  
  /* Garantir consistência dos elementos internos */
  .project-card .text-sm {
    font-size: 0.875rem;
  }
  
  .project-card .text-xs {
    font-size: 0.75rem;
  }
  
  .project-card .btn-sm {
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
  }
}

/* Hide scroll buttons on mobile */
@media (max-width: 640px) {
  #projects-scroll-left,
  #projects-scroll-right {
    display: none;
  }
  
  /* Manter layout interno dos cards igual ao desktop */
  .project-card {
    width: 280px !important;
    min-width: 280px;
  }
  
  .project-card > div {
    padding: 1.5rem !important;
    text-align: left;
  }
  
  /* Garantir alinhamento à esquerda de todos os textos */
  .project-card h4,
  .project-card p,
  .project-card span,
  .project-card div {
    text-align: left !important;
  }
  
  /* Forçar elementos flex para começar à esquerda */
  .project-card .flex.items-center {
    justify-content: flex-start !important;
  }
  
  .project-card .flex.justify-start {
    justify-content: flex-start !important;
  }
  
  /* Garantir que todos os elementos internos mantenham o mesmo espaçamento */
  .project-card .flex.items-start.justify-between {
    margin-bottom: 0.75rem;
  }
  
  .project-card h4 {
    font-size: 1rem;
    line-height: 1.3;
  }
  
  .project-card .text-sm {
    font-size: 0.875rem;
  }
  
  .project-card .text-xs {
    font-size: 0.75rem;
  }
  
  /* Status badge */
  .project-card .text-xs.px-2.py-1 {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
  }
  
  /* Cliente e Responsável */
  .project-card > div > p.text-sm {
    margin-bottom: 0.375rem;
  }
  
  /* Datas */
  .project-card .project-dates {
    margin-bottom: 0.5rem;
    margin-top: 0.25rem;
    padding: 0.375rem 0;
  }
  
  .project-card .project-dates p {
    font-size: 0.75rem;
    margin-bottom: 0.125rem;
  }
  
  /* Progresso */
  .project-card .mb-2 {
    margin-bottom: 0.5rem;
  }
  
  .project-card .progress {
    height: 0.5rem;
  }
  
  /* Botões */
  .project-card .flex.flex-col.mt-3 {
    margin-top: 0.75rem;
    gap: 0.5rem;
  }
  
  .project-card .btn-sm {
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
  }
  
  /* Ícones */
  .project-card [data-lucide] {
    flex-shrink: 0;
  }
}

/* Mobile Extra Small - Manter consistência */
@media (max-width: 480px) {
  .project-card {
    width: 280px !important;
    min-width: 280px;
  }
  
  .project-card > div {
    padding: 1.25rem !important;
    text-align: left;
  }
  
  /* Garantir alinhamento à esquerda */
  .project-card h4,
  .project-card p,
  .project-card span,
  .project-card div {
    text-align: left !important;
  }
  
  /* Forçar elementos flex para começar à esquerda */
  .project-card .flex.items-center {
    justify-content: flex-start !important;
  }
  
  .project-card .flex.justify-start {
    justify-content: flex-start !important;
  }
  
  /* Ajustar apenas tamanhos de fonte ligeiramente, manter estrutura */
  .project-card h4 {
    font-size: 0.938rem;
  }
  
  .project-card .text-sm {
    font-size: 0.813rem;
  }
}

/* Landscape Mobile - Cards mantêm mesma estrutura */
@media (max-width: 896px) and (max-height: 500px) and (orientation: landscape) {
  .project-card {
    width: 260px !important;
  }
  
  .project-card > div {
    padding: 1rem !important;
    text-align: left;
  }
  
  /* Garantir alinhamento à esquerda */
  .project-card h4,
  .project-card p,
  .project-card span,
  .project-card div {
    text-align: left !important;
  }
  
  /* Forçar elementos flex para começar à esquerda */
  .project-card .flex.items-center {
    justify-content: flex-start !important;
  }
  
  .project-card .flex.justify-start {
    justify-content: flex-start !important;
  }
  
  .project-card h4 {
    font-size: 0.875rem;
    min-height: auto;
  }
  
  .project-card .project-dates {
    padding: 0.25rem 0;
    min-height: auto;
  }
  
  .project-card .flex.flex-col.mt-3 {
    margin-top: 0.5rem;
    gap: 0.375rem;
  }
}

/* ============================================ */
/* Financial Dashboard Responsive Layout       */
/* ============================================ */

/* Mobile: Stack all grid layouts vertically */
@media (max-width: 767px) {
  /* Stack 2-column charts to 1 column on mobile */
  .space-y-6 > .grid.grid-cols-2 {
    grid-template-columns: 1fr !important;
  }
  
  /* Stack 3 KPIs to single column on mobile */
  .space-y-6 .grid.grid-cols-3 {
    grid-template-columns: 1fr !important;
  }
  
  /* Stack 4 KPIs to 2 columns on mobile */
  .space-y-6 > .grid.grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }
  
  /* Adjust card padding on mobile */
  .space-y-6 .card-elegant {
    padding: 1rem !important;
  }
  
  /* Make chart containers responsive */
  .space-y-6 canvas {
    max-width: 100% !important;
  }
}

/* Tablet: Optimize for medium screens */
@media (min-width: 768px) and (max-width: 1023px) {
  /* Keep 2-column layouts on tablet */
  .space-y-6 > .grid.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  /* 3 KPIs stay as 3 columns on tablet */
  .space-y-6 .grid.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  
  /* 4 KPIs become 2x2 grid on tablet */
  .space-y-6 > .grid.grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Desktop: Full layout (1024px and up) - No overrides needed, base classes work */
@media (min-width: 1024px) {
  /* Ensure grid layouts are not overridden on desktop */
  .space-y-6 > .grid.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  
  .space-y-6 .grid.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  
  .space-y-6 > .grid.grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}