@import "tailwindcss";

@plugin "@tailwindcss/forms";
@plugin "@tailwindcss/typography";


@import "tw-animate-css";


@custom-variant dark (&:is(.dark *));

/* ---------------------------------------------------------------------------
   Paco — tokens sob o design system Modernist.

   Regras que estes tokens carregam:
   · raio 0 em todo lugar (--radius: 0)
   · ação construtiva = --primary (azul-escuro #16365c); nunca vermelho
   · vermelho tem dois papéis: --expense (dado) e --destructive (excluir)
   · receita/despesa SEMPRE via --income / --expense — não use chart-*
   · sem gradientes de marca, sem sombra de cartão
   Hex ao lado de cada oklch para conferência.
--------------------------------------------------------------------------- */

:root {
  --background: oklch(0.958 0.001 60);          /* #f3f2f2 */
  --foreground: oklch(0.222 0.003 50);          /* #201e1d */
  --card: oklch(0.958 0.001 60);                /* #f3f2f2 — cartão não é mais branco */
  --card-foreground: oklch(0.222 0.003 50);
  --popover: oklch(0.958 0.001 60);
  --popover-foreground: oklch(0.222 0.003 50);

  --primary: oklch(0.34 0.077 258);             /* #16365c */
  --primary-foreground: oklch(0.958 0.001 60);  /* #f3f2f2 */
  --primary-hover: oklch(0.28 0.070 259);       /* #102a4a */
  --primary-active: oklch(0.23 0.060 260);      /* #0b1f37 */
  --primary-tint: oklch(0.955 0.008 255);       /* #eef2f7 — fundo de seleção suave */

  --secondary: oklch(0.925 0.002 60);           /* #eae9e9 */
  --secondary-foreground: oklch(0.222 0.003 50);
  --muted: oklch(0.925 0.002 60);
  --muted-foreground: oklch(0.222 0.003 50 / 0.55);
  --accent: oklch(0.955 0.008 255);
  --accent-foreground: oklch(0.34 0.077 258);

  /* vermelho: só destruição */
  --destructive: oklch(0.45 0.16 32);           /* #a32014 */
  --destructive-foreground: oklch(0.958 0.001 60);
  --destructive-hover: oklch(0.40 0.15 32);     /* #8a1a10 */
  --destructive-active: oklch(0.34 0.13 32);    /* #6e150c */

  /* dinheiro: os dois únicos tokens permitidos para receita/despesa */
  --income: oklch(0.5 0.07 156);
  --expense: oklch(0.5 0.11 30);

  --border: oklch(0.222 0.003 50 / 0.4);        /* régua forte, 2px */
  --border-subtle: oklch(0.222 0.003 50 / 0.18);/* régua fina de lista, 1px */
  --input: oklch(0.222 0.003 50 / 0.4);
  --ring: oklch(0.34 0.077 258);                /* foco = primária, nunca o azul do browser */

  --chart-1: oklch(0.5 0.11 30);
  --chart-2: oklch(0.5 0.07 156);
  --chart-3: oklch(0.34 0.077 258);
  --chart-4: oklch(0.45 0.05 258);
  --chart-5: oklch(0.60 0.02 60);

  --radius: 0;

  /* sidebar: campo azul, é ela que carrega a identidade */
  --sidebar: oklch(0.34 0.077 258);             /* #16365c */
  --sidebar-foreground: oklch(0.958 0.001 60);  /* #f3f2f2 */
  --sidebar-primary: oklch(0.958 0.001 60);     /* item ativo: bloco claro */
  --sidebar-primary-foreground: oklch(0.34 0.077 258);
  --sidebar-accent: oklch(0.958 0.001 60 / 0.1);/* hover */
  --sidebar-accent-foreground: oklch(0.958 0.001 60);
  --sidebar-border: oklch(0.958 0.001 60 / 0.25);
  --sidebar-ring: oklch(0.958 0.001 60);

  /* ruby_ui specific */
  --warning: oklch(0.72 0.14 70);
  --warning-foreground: oklch(0.222 0.003 50);
  --success: oklch(0.5 0.07 156);               /* alinhado a --income */
  --success-foreground: oklch(0.958 0.001 60);
}

.dark {
  --background: oklch(0.20 0.008 258);
  --foreground: oklch(0.958 0.001 60);
  --card: oklch(0.24 0.010 258);
  --card-foreground: oklch(0.958 0.001 60);
  --popover: oklch(0.24 0.010 258);
  --popover-foreground: oklch(0.958 0.001 60);

  --primary: oklch(0.70 0.09 255);
  --primary-foreground: oklch(0.20 0.008 258);
  --primary-hover: oklch(0.76 0.09 255);
  --primary-active: oklch(0.82 0.07 255);
  --primary-tint: oklch(0.30 0.030 258);

  --secondary: oklch(0.28 0.010 258);
  --secondary-foreground: oklch(0.958 0.001 60);
  --muted: oklch(0.28 0.010 258);
  --muted-foreground: oklch(0.958 0.001 60 / 0.6);
  --accent: oklch(0.30 0.030 258);
  --accent-foreground: oklch(0.958 0.001 60);

  --destructive: oklch(0.58 0.17 32);
  --destructive-foreground: oklch(0.958 0.001 60);
  --destructive-hover: oklch(0.64 0.18 32);
  --destructive-active: oklch(0.70 0.18 32);

  --income: oklch(0.68 0.10 156);
  --expense: oklch(0.66 0.15 30);

  --border: oklch(0.958 0.001 60 / 0.35);
  --border-subtle: oklch(0.958 0.001 60 / 0.15);
  --input: oklch(0.958 0.001 60 / 0.35);
  --ring: oklch(0.70 0.09 255);

  --chart-1: oklch(0.66 0.15 30);
  --chart-2: oklch(0.68 0.10 156);
  --chart-3: oklch(0.70 0.09 255);
  --chart-4: oklch(0.60 0.06 255);
  --chart-5: oklch(0.75 0.02 60);

  --sidebar: oklch(0.24 0.030 258);
  --sidebar-foreground: oklch(0.958 0.001 60);
  --sidebar-primary: oklch(0.958 0.001 60);
  --sidebar-primary-foreground: oklch(0.24 0.030 258);
  --sidebar-accent: oklch(0.958 0.001 60 / 0.1);
  --sidebar-accent-foreground: oklch(0.958 0.001 60);
  --sidebar-border: oklch(0.958 0.001 60 / 0.25);
  --sidebar-ring: oklch(0.958 0.001 60);

  /* ruby_ui specific */
  --warning: oklch(0.78 0.14 70);
  --warning-foreground: oklch(0.20 0.008 258);
  --success: oklch(0.68 0.10 156);
  --success-foreground: oklch(0.20 0.008 258);
}

@theme inline {
  --font-sans: "Archivo", ui-sans-serif, system-ui, sans-serif;

  --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-primary-hover: var(--primary-hover);
  --color-primary-active: var(--primary-active);
  --color-primary-tint: var(--primary-tint);
  --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-destructive-hover: var(--destructive-hover);
  --color-destructive-active: var(--destructive-active);
  --color-income: var(--income);
  --color-expense: var(--expense);
  --color-border: var(--border);
  --color-border-subtle: var(--border-subtle);
  --color-input: var(--input);
  --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: 0;
  --radius-md: 0;
  --radius-lg: 0;
  --radius-xl: 0;
  --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);

  /* ruby_ui specific */
  --color-warning: var(--warning);
  --color-warning-foreground: var(--warning-foreground);
  --color-success: var(--success);
  --color-success-foreground: var(--success-foreground);
}

/* Container settings */
@utility container {
  margin-inline: auto;
  padding-inline: 1.5rem;
  max-width: 1400px;
}

/* Régua forte de 2px — o que organiza a página no lugar de sombra e cartão. */
@utility rule {
  border: 0;
  height: 2px;
  background: var(--border);
}

/* Rótulo/kicker: Archivo 800, 11px, uppercase. */
@utility label-kicker {
  font-weight: 800;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

/* Número grande de KPI. Escala com a viewport pra não estourar em telas
   estreitas (evita quebra/sobreposição de linha nos cards do dashboard). */
@utility figure-lg {
  font-weight: 800;
  font-size: clamp(24px, 7vw, 34px);
  line-height: 1.05;
}

/*
  Removidos de propósito — não reintroduzir:
    @utility bg-gradient-primary  (marca com gradiente)
    @utility bg-gradient-card     (gradiente decorativo em cartão)
  A classe `shadow-card`, usada em algumas views, nunca existiu neste arquivo;
  remova os usos em vez de defini-la.
*/

@layer base {
  * {
    @apply border-border;
  }
  body {
    @apply bg-background text-foreground;
  }
  :focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
  }
  ::selection {
    background: color-mix(in srgb, var(--primary) 25%, transparent);
  }
}
