/* ============================================================
   UchatBot Design System v5 "Corporate SaaS" — Tokens & Reset
   Tema claro (padrão) + tema escuro via [data-theme="dark"]
   IMPORTANTE: os nomes --uc-* antigos são mantidos por
   compatibilidade com todas as páginas do sistema.
   ============================================================ */
:root {
  /* Superfícies */
  --uc-bg:            #f6f8fb;
  --uc-surface:       #ffffff;   /* cards, sidebar, topbar */
  --uc-elevated:      #ffffff;   /* legado: mesmo que surface no claro */
  --uc-surface-2:     #f1f5f9;   /* hover, inputs, thead */
  --uc-surface-3:     #e8edf4;   /* pressed / selecionado */
  --uc-border:        #e2e8f0;
  --uc-border-strong: #cbd5e1;

  /* Texto */
  --uc-text:       #0f172a;
  --uc-text-2:     #475569;
  --uc-text-muted: #64748b;
  --uc-text-dim:   #94a3b8;
  --uc-heading:    #0f172a;   /* substitui os color:#fff hardcoded */

  /* Marca */
  --uc-primary:        #4f46e5;
  --uc-primary-hover:  #4338ca;
  --uc-primary-active: #3730a3;
  --uc-primary-bg:     #eef2ff;
  --uc-primary-border: #c7d2fe;
  --uc-on-primary:     #ffffff;

  /* Semânticas */
  --uc-success:        #16a34a;
  --uc-success-bg:     #f0fdf4;
  --uc-success-border: #bbf7d0;
  --uc-warning:        #d97706;
  --uc-warning-bg:     #fffbeb;
  --uc-warning-border: #fde68a;
  --uc-danger:         #dc2626;
  --uc-danger-bg:      #fef2f2;
  --uc-danger-border:  #fecaca;
  --uc-info:           #0284c7;
  --uc-info-bg:        #f0f9ff;
  --uc-info-border:    #bae6fd;
  --uc-purple:         #9333ea;
  --uc-purple-bg:      #faf5ff;
  --uc-purple-border:  #e9d5ff;
  --uc-orange:         #ea580c;
  --uc-orange-bg:      #fff7ed;
  --uc-orange-border:  #fed7aa;

  /* Chat */
  --uc-bubble-in:  #f1f5f9;
  --uc-bubble-out: #eef2ff;

  /* Sombras */
  --uc-shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --uc-shadow-md: 0 2px 8px rgba(15,23,42,.07), 0 1px 2px rgba(15,23,42,.05);
  --uc-shadow-lg: 0 12px 32px rgba(15,23,42,.14);

  /* Layout */
  --uc-sidebar-w: 264px;
  --uc-topbar-h: 60px;
  --uc-radius-sm: 6px;
  --uc-radius: 8px;
  --uc-radius-lg: 12px;

  /* Gráficos */
  --uc-chart-grid: #eef2f7;

  color-scheme: light;
}

[data-theme="dark"] {
  --uc-bg:            #0b0e14;
  --uc-surface:       #11151f;
  --uc-elevated:      #11151f;
  --uc-surface-2:     #1a1f2c;
  --uc-surface-3:     #232937;
  --uc-border:        #232937;
  --uc-border-strong: #323a4d;

  --uc-text:       #e6eaf2;
  --uc-text-2:     #a3adc2;
  --uc-text-muted: #a3adc2;
  --uc-text-dim:   #6b7590;
  --uc-heading:    #e6eaf2;

  --uc-primary:        #6366f1;
  --uc-primary-hover:  #818cf8;
  --uc-primary-active: #4f46e5;
  --uc-primary-bg:     rgba(99,102,241,.14);
  --uc-primary-border: rgba(99,102,241,.35);
  --uc-on-primary:     #ffffff;

  --uc-success:        #4ade80;
  --uc-success-bg:     rgba(74,222,128,.12);
  --uc-success-border: rgba(74,222,128,.3);
  --uc-warning:        #fbbf24;
  --uc-warning-bg:     rgba(251,191,36,.12);
  --uc-warning-border: rgba(251,191,36,.3);
  --uc-danger:         #f87171;
  --uc-danger-bg:      rgba(248,113,113,.12);
  --uc-danger-border:  rgba(248,113,113,.3);
  --uc-info:           #38bdf8;
  --uc-info-bg:        rgba(56,189,248,.12);
  --uc-info-border:    rgba(56,189,248,.3);
  --uc-purple:         #c084fc;
  --uc-purple-bg:      rgba(192,132,252,.12);
  --uc-purple-border:  rgba(192,132,252,.3);
  --uc-orange:         #fb923c;
  --uc-orange-bg:      rgba(251,146,60,.12);
  --uc-orange-border:  rgba(251,146,60,.3);

  --uc-bubble-in:  #1a1f2c;
  --uc-bubble-out: rgba(99,102,241,.18);

  --uc-shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --uc-shadow-md: 0 2px 8px rgba(0,0,0,.5);
  --uc-shadow-lg: 0 12px 32px rgba(0,0,0,.6);

  --uc-chart-grid: #1e2431;

  color-scheme: dark;
}

/* ---------- Reset / Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--uc-bg);
  color: var(--uc-text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
a { color: var(--uc-primary); text-decoration: none; }
a:hover { color: var(--uc-primary-hover); }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--uc-primary); outline-offset: 2px; border-radius: 4px; }
::placeholder { color: var(--uc-text-dim); }
.num { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Compat: headings antigos usavam color:#fff — herdam do texto agora */
h1, h2, h3, h4, h5, h6 { color: var(--uc-heading); }
