/* Cavaleirus Backend — sistema de design (variáveis) e base.
   Cores e medidas tiradas da referência aprovada (estilo Gorgias).
   Usa SEMPRE estas variáveis nas páginas; não escrevas cores soltas. */

@font-face { font-family: Inter; src: url('../fonts/Inter-Regular.ttf') format('truetype'); font-weight: 400 500; font-display: swap; }
@font-face { font-family: Inter; src: url('../fonts/Inter-SemiBold.ttf') format('truetype'); font-weight: 600 900; font-display: swap; }

:root {
  /* --- Cores base --- */
  --c-shell: #252525;          /* fundo escuro da aplicação */
  --c-rail: #242424;           /* barra de ícones */
  --c-rail-border: #383838;
  --c-side: #252525;           /* barra lateral */
  --c-side-text: #b8b8bb;
  --c-side-muted: #77777c;
  --c-side-hover: #333333;
  --c-side-active: #484848;
  --c-side-line: #38383b;

  --c-bg: #f8f8fa;             /* fundo da área de trabalho */
  --c-surface: #ffffff;        /* cartões, tabelas, painéis */
  --c-surface-2: #fcfcfd;      /* coluna de detalhes, rodapés */
  --c-surface-3: #fafafb;      /* cabeçalho de tabela */
  --c-hover: #f7f7fa;
  --c-border: #e8e8eb;
  --c-border-strong: #dddde4;
  --c-border-soft: #eeeef3;

  --c-text: #2c2c30;
  --c-text-2: #55555e;         /* texto secundário */
  --c-muted: #8a8b93;
  --c-faint: #a8a8b0;

  --c-primary: #4d79ed;        /* azul de ação */
  --c-primary-hover: #416be0;
  --c-primary-soft: #f3f6fe;
  --c-primary-line: #d9e2fa;
  --c-coral: #fa8b76;          /* logótipo e contadores da barra de ícones */

  /* --- Tons pastel (fundo / texto) para etiquetas --- */
  --t-neutral-bg: #f0f0f4;  --t-neutral-fg: #7f7f8a;
  --t-blue-bg: #e4effa;     --t-blue-fg: #4f7ba3;
  --t-green-bg: #e6f3ed;    --t-green-fg: #4c936f;
  --t-yellow-bg: #faf2d6;   --t-yellow-fg: #9a7b26;
  --t-orange-bg: #fcebdc;   --t-orange-fg: #b07443;
  --t-red-bg: #fbe5e2;      --t-red-fg: #c0574b;
  --t-purple-bg: #eeeafa;   --t-purple-fg: #8a72b0;
  --t-pink-bg: #f8e4eb;     --t-pink-fg: #b06984;

  /* Cores de estado (pontos, barras de KPI). Sempre com rótulo, nunca só cor. */
  --s-ok: #4fae80;
  --s-warn: #e0a43b;
  --s-bad: #e06a5a;
  --s-critical: #d2493a;
  --s-info: #4d79ed;

  /* Gráficos: um só tom azul, do claro ao escuro (séries encaixadas). */
  --chart-1: #c9d7fa;
  --chart-2: #8eabf3;
  --chart-3: #4d79ed;
  --chart-4: #2f55bd;
  --chart-grid: #ececf1;
  --chart-axis: #a0a0aa;

  /* Avisos */
  --c-demo-bg: #fff7ed; --c-demo-line: #f1e8dc; --c-demo-fg: #8d6f42;

  /* --- Espaçamentos (escala de 4 px) --- */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  /* --- Raios --- */
  --r-xs: 3px; --r-sm: 4px; --r-md: 6px; --r-lg: 8px; --r-pill: 999px;

  /* --- Sombras --- */
  --sh-1: 0 1px 2px rgba(30, 30, 50, .05);
  --sh-pop: 0 6px 24px rgba(41, 43, 72, .14), 0 1px 3px rgba(41, 43, 72, .08);
  --sh-modal: 0 20px 60px rgba(20, 20, 35, .25);
  --focus: 0 0 0 3px rgba(77, 121, 237, .22);

  /* --- Tipografia --- */
  --font: Inter, -apple-system, 'Segoe UI', Arial, sans-serif;
  --fs-xs: 11px; --fs-sm: 12px; --fs-md: 13px; --fs-lg: 15px; --fs-xl: 18px; --fs-2xl: 24px;
  --lh: 1.5;

  /* --- Estrutura --- */
  --rail-w: 52px;
  --side-w: 232px;
  --topbar-h: 56px;
  --z-sticky: 5; --z-side: 40; --z-pop: 1000; --z-modal: 1100; --z-toast: 1200; --z-tip: 1300;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font: 400 var(--fs-md)/var(--lh) var(--font); color: var(--c-text); background: var(--c-shell);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: transparent; padding: 0; }
button:disabled { cursor: default; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, p { margin: 0; }
h2 { font-size: var(--fs-lg); font-weight: 600; }
h3 { font-size: var(--fs-md); font-weight: 600; }
p { line-height: 1.6; }
svg { flex-shrink: 0; }
input[type=checkbox] { accent-color: var(--c-primary); width: 14px; height: 14px; margin: 0; cursor: pointer; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; border-radius: var(--r-xs); }
::selection { background: #d6e1fc; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
