/*
 * Éssere theme v6 — fonte de verdade única para todos os apps da empresa.
 * Servido por portal.esseresucos.com.br/theme/v6.css.
 * Manual: light-first mono quente, flat. Escuro: chocolate como fundo.
 * Toggle via .dark no <html> (ver v6.js).
 */

@font-face {
  font-family: "Kirvy";
  src: url("/theme/fonts/Kirvy-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Kirvy";
  src: url("/theme/fonts/Kirvy-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Marcas — hex fixo, independente de tema */
:root {
  --essere-orange: 20 89% 54%;      /* #F27222 */
  --safri-green: 122 39% 49%;       /* #4CAF50 */
}

/* Modo claro (opt-in via .light — dark é o padrão) */
.light {
  --background: 39 41% 94%;
  --foreground: 22 28% 20%;
  --card: 40 40% 98%;
  --card-foreground: 22 28% 20%;
  --popover: 40 40% 98%;
  --popover-foreground: 22 28% 20%;
  --primary: var(--essere-orange);
  --primary-foreground: 0 0% 100%;
  --secondary: 36 34% 90%;
  --secondary-foreground: 22 29% 22%;
  --muted: 36 30% 90%;
  --muted-foreground: 22 16% 40%;
  --accent: 36 34% 90%;
  --accent-foreground: 22 29% 22%;
  --destructive: 0 68% 46%;
  --destructive-foreground: 0 0% 100%;
  --border: 33 30% 82%;
  --input: 33 30% 82%;
  --ring: var(--essere-orange);
  --radius: 0.75rem;

  --sidebar: 22 29% 22%;
  --sidebar-background: 22 29% 22%;
  --sidebar-foreground: 39 41% 94%;
  --sidebar-primary: var(--essere-orange);
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 22 26% 28%;
  --sidebar-accent-foreground: 39 41% 94%;
  --sidebar-border: 22 26% 28%;
  --sidebar-ring: var(--essere-orange);

  /* Charts — funcionais */
  --chart-1: 20 89% 54%;   /* laranja */
  --chart-2: 122 39% 49%;  /* verde */
  --chart-3: 211 71% 59%;  /* azul */
  --chart-4: 34 78% 57%;   /* amarelo/ocre */
  --chart-5: 6 63% 46%;    /* vermelho */

  /* Scrollbar */
  --scrollbar-track: 36 30% 90%;
  --scrollbar-thumb: 33 30% 82%;
  --scrollbar-thumb-hover: 30 25% 70%;
}

/* Modo escuro — chocolate como fundo (é o padrão sob :root) */
:root,
.dark {
  --background: 22 29% 12%;
  --foreground: 39 41% 94%;
  --card: 22 25% 17%;
  --card-foreground: 39 41% 94%;
  --popover: 22 25% 17%;
  --popover-foreground: 39 41% 94%;
  --primary: var(--essere-orange);
  --primary-foreground: 0 0% 100%;
  --secondary: 22 20% 22%;
  --secondary-foreground: 39 41% 94%;
  --muted: 22 20% 22%;
  --muted-foreground: 33 15% 70%;
  --accent: 22 20% 22%;
  --accent-foreground: 39 41% 94%;
  --destructive: 0 68% 55%;
  --destructive-foreground: 0 0% 100%;
  --border: 22 20% 28%;
  --input: 22 20% 28%;
  --ring: var(--essere-orange);

  --sidebar: 22 29% 8%;
  --sidebar-background: 22 29% 8%;
  --sidebar-foreground: 39 41% 94%;
  --sidebar-primary: var(--essere-orange);
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 22 25% 14%;
  --sidebar-accent-foreground: 39 41% 94%;
  --sidebar-border: 22 25% 14%;
  --sidebar-ring: var(--essere-orange);

  /* Charts — mesmos hues, um pouco mais claros pra funcionar no dark */
  --chart-1: 20 89% 60%;
  --chart-2: 122 39% 55%;
  --chart-3: 211 71% 65%;
  --chart-4: 34 78% 62%;
  --chart-5: 6 63% 55%;

  /* Scrollbar no dark */
  --scrollbar-track: 22 20% 18%;
  --scrollbar-thumb: 22 15% 28%;
  --scrollbar-thumb-hover: 22 15% 38%;
}

/* Scrollbar unificada — segue o tema via CSS vars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: hsl(var(--scrollbar-track)); }
::-webkit-scrollbar-thumb { background: hsl(var(--scrollbar-thumb)); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: hsl(var(--scrollbar-thumb-hover)); }

.wordmark,
.display {
  font-family: "Kirvy", "Inter", sans-serif;
  font-weight: 400;
}
