@custom-variant dark (&:is(.dark *));

:root {
  --font-size: 16px;
  
  /* MUDANÇA 1: Fundo Off-White para destacar os cards brancos (Efeito Apple/Stripe) */
  --background: #F8F9FC; 
  --foreground: #1e293b; /* Slate 800 - Texto cinza escuro, não preto puro */

  --card: #ffffff;
  --card-foreground: #1e293b;

  --popover: #ffffff;
  --popover-foreground: #1e293b;

  /* MUDANÇA 2: Azul Corporativo mais profundo (Royal Blue) */
  --primary: #2563eb; /* Blue 600 - Mais vibrante e moderno que o 1977cc */
  --primary-foreground: #ffffff;

  --secondary: #f1f5f9;
  --secondary-foreground: #0f172a;

  --muted: #f8fafc;
  --muted-foreground: #64748b;

  --accent: #f1f5f9;
  --accent-foreground: #0f172a;

  --destructive: #ef4444;
  --destructive-foreground: #ffffff;

  /* MUDANÇA 3: Bordas quase invisíveis */
  --border: rgba(148, 163, 184, 0.15); 
  --input: rgba(148, 163, 184, 0.2);
  --input-background: #ffffff;
  
  --switch-background: #cbd5e1;
  --ring: #2563eb;

  /* MUDANÇA 4: Arredondamento maior (Fim do quadrado) */
  --radius: 1rem; /* 16px - Deixa tudo mais suave e moderno */

  /* MUDANÇA 5: Sidebar Escura (Visual Dashboard Pro) */
  --sidebar: #0F172A; /* Slate 900 - Fundo escuro profissional */
  --sidebar-foreground: #F8FAFC; /* Texto claro */
  --sidebar-primary: #3b82f6;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #1e293b; /* Destaque no hover da sidebar */
  --sidebar-accent-foreground: #ffffff;
  --sidebar-border: rgba(255, 255, 255, 0.1);
  --sidebar-ring: #3b82f6;

  --success: 34, 197, 94;
  --warning: 249, 115, 22;
  --info: 59, 130, 246;
  --brand: 37, 99, 235; /* Atualizado para combinar com o primary */
}

.dark {
  --background: #0f172a;
  --foreground: #f8fafc;
  --card: #1e293b;
  --card-foreground: #f8fafc;
  --popover: #1e293b;
  --popover-foreground: #f8fafc;
  --primary: #42a5f5;
  --primary-foreground: #ffffff;
  --secondary: #1e3a5f;
  --secondary-foreground: #e3f2fd;
  --muted: #334155;
  --muted-foreground: #94a3b8;
  --accent: #1e3a5f;
  --accent-foreground: #e3f2fd;
  --destructive: #ef5350;
  --destructive-foreground: #ffffff;
  --border: rgba(66, 165, 245, 0.2);
  --input: rgba(66, 165, 245, 0.1);
  --ring: #42a5f5;
  --font-weight-medium: 500;
  --font-weight-normal: 400;
  --chart-1: #42a5f5;
  --chart-2: #64b5f6;
  --chart-3: #90caf9;
  --chart-4: #bbdefb;
  --chart-5: #e3f2fd;
  --sidebar: #1e293b;
  --sidebar-foreground: #f8fafc;
  --sidebar-primary: #42a5f5;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #1e3a5f;
  --sidebar-accent-foreground: #e3f2fd;
  --sidebar-border: rgba(66, 165, 245, 0.2);
  --sidebar-ring: #42a5f5;
  --success: 34, 197, 94;
  --warning: 251, 146, 60;
  --info: 96, 165, 250;
  --brand: 66, 165, 245; /* Cor principal da FKSmart (42A5F5 em RGB) para dark mode */
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-input-background: var(--input-background);
  --color-switch-background: var(--switch-background);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }

  body {
    @apply bg-background text-foreground;
  }
}

/**
 * Base typography. This is not applied to elements which have an ancestor with a Tailwind text class.
 */
@layer base {
  :where(:not(:has([class*=' text-']), :not(:has([class^='text-'])))) {
    h1 {
      font-size: var(--text-2xl);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
    }

    h2 {
      font-size: var(--text-xl);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
    }

    h3 {
      font-size: var(--text-lg);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
    }

    h4 {
      font-size: var(--text-base);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
    }

    p {
      font-size: var(--text-base);
      font-weight: var(--font-weight-normal);
      line-height: 1.5;
    }

    label {
      font-size: var(--text-base);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
    }

    button {
      font-size: var(--text-base);
      font-weight: var(--font-weight-medium);
      line-height: 1.5;
    }

    input {
      font-size: var(--text-base);
      font-weight: var(--font-weight-normal);
      line-height: 1.5;
    }
  }
}

html {
  font-size: var(--font-size);
}
/* --- CLASSES DE CARD REDESENHADAS (Visual Moderno) --- */

/* Efeito de vidro/elevação suave */
.card-base {
  --card-accent-color: var(--foreground);
  --card-accent-bg: var(--card);
  
  background-color: var(--card-accent-bg);
  color: var(--foreground);
  
  /* TRUQUE DE DESIGN: Removemos a borda dura e usamos sombra */
  border: 1px solid transparent; 
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease-in-out;
}

/* Efeito ao passar o mouse: o card "levanta" levemente */
.card-base:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  border-color: rgba(37, 99, 235, 0.1); /* Sutil borda azul ao passar o mouse */
}

.card-primary {
  --card-accent-color: #ffffff;
  --card-accent-bg: var(--primary); /* Usa a var --primary nova */
  
  background-color: var(--card-accent-bg);
  color: var(--card-accent-color);
  border: none;
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3); /* Sombra colorida brilhante */
}

/* Cards de status com fundos mais sutis e elegantes */
.card-success {
  --card-accent-color: #15803d; /* Verde mais escuro para leitura */
  --card-accent-bg: #dcfce7; /* Fundo verde muito claro */
  border: 1px solid #bbf7d0;
}

.card-warning {
  --card-accent-color: #c2410c;
  --card-accent-bg: #ffedd5;
  border: 1px solid #fed7aa;
}

.card-info {
  --card-accent-color: #1d4ed8;
  --card-accent-bg: #dbeafe;
  border: 1px solid #bfdbfe;
}

.icon-24 { width: 24px; height: 24px; display: inline-block; }
.icon-28 { width: 28px; height: 28px; display: inline-block; }
.brand-logo { height: 28px; width: auto; display: block; }
@media (min-width: 1024px){ .brand-logo { height: 32px; } }

/* Logo */
.brand-logo { height: 28px; width: auto; display: block; }
@media (min-width: 1024px){ .brand-logo { height: 32px; } }