:root {
  --font-ui: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --orange-50: #fff3e0;
  --orange-100: #ffe0b2;
  --orange-200: #ffcc80;
  --orange-300: #ffb74d;
  --orange-500: #ff9800;
  --orange-600: #fb8c00;
  --orange-700: #f57c00;
  --orange-800: #ef6c00;
  --orange-900: #e65100;

  --blue-grey-50: #eceff1;
  --blue-grey-100: #cfd8dc;
  --blue-grey-200: #b0bec5;
  --blue-grey-300: #90a4ae;
  --blue-grey-500: #607d8b;
  --blue-grey-700: #455a64;
  --blue-grey-800: #37474f;
  --blue-grey-900: #263238;

  --green: #2e7d32;
  --green-bg: #e8f5e9;
  --amber: #f9a825;
  --amber-bg: #fff8e1;
  --red: #c62828;
  --red-bg: #ffebee;
  --blue: #1565c0;
  --blue-bg: #e3f2fd;
  --purple: #6a1b9a;
  --purple-bg: #f3e5f5;

  --bg: #f6f7f5;
  --surface: #ffffff;
  --surface-soft: #f5f7f4;
  --surface-strong: #e8eee8;
  --border: #dfe5df;
  --border-strong: #bbc9bd;
  --text: #1f2926;
  --text-soft: #55675c;
  --text-muted: #637269;
  --primary: #205946;
  --primary-hover: #174333;
  --primary-soft: #e8f1eb;
  --primary-contrast: #ffffff;
  --sidebar-bg: #ffffff;
  --sidebar-surface: #eef3ee;
  --sidebar-text: #1f2926;
  --sidebar-muted: #55675c;

  --control-aglo: #1565c0;
  --control-secretaria: #f9a825;
  --control-urgent: #c62828;
  --control-closed: #2e7d32;
  --control-pending: #6a1b9a;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(31, 41, 38, .03);
  --shadow-md: 0 8px 24px rgba(38, 50, 56, .10);
  --shadow-lg: 0 18px 45px rgba(38, 50, 56, .18);

  --sidebar-width: 244px;
  --topbar-height: 74px;
}

html[data-theme='dark'] {
  --bg: #121416;
  --surface: #1c2024;
  --surface-soft: #22282d;
  --surface-strong: #2d343a;
  --border: #374149;
  --border-strong: #52616b;
  --text: #f4f7f8;
  --text-soft: #c1ccd2;
  --text-muted: #91a0a8;
  --primary: #81c3a5;
  --primary-hover: #a4d8be;
  --primary-contrast: #102c22;
  --primary-soft: #213e30;
  --sidebar-bg: #0f171b;
  --sidebar-surface: #1a252b;
  --sidebar-text: #ffffff;
  --sidebar-muted: #9eabb2;
  --green-bg: rgba(46, 125, 50, .18);
  --amber-bg: rgba(249, 168, 37, .18);
  --red-bg: rgba(198, 40, 40, .18);
  --blue-bg: rgba(21, 101, 192, .18);
  --purple-bg: rgba(106, 27, 154, .22);
  color-scheme: dark;
}

/* ── DARK MODE: componentes hardcodeados ─────────────────────────────────── */
[data-theme='dark'] .card,
[data-theme='dark'] .module-card,
[data-theme='dark'] .metric-card,
[data-theme='dark'] .kanban-column,
[data-theme='dark'] .order-card,
[data-theme='dark'] .conversation-item,
[data-theme='dark'] .list-card,
[data-theme='dark'] .info-card,
[data-theme='dark'] .mini-stat,
[data-theme='dark'] .side-panel,
[data-theme='dark'] .detail-panel,
[data-theme='dark'] .modal-surface,
[data-theme='dark'] .proof-card,
[data-theme='dark'] .bag-card,
[data-theme='dark'] .wa-hero-card {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

[data-theme='dark'] .topbar {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme='dark'] .main-area,
[data-theme='dark'] body,
[data-theme='dark'] .content {
  background: var(--bg);
  color: var(--text);
}

[data-theme='dark'] .muted,
[data-theme='dark'] .text-muted,
[data-theme='dark'] small,
[data-theme='dark'] .card-subtitle,
[data-theme='dark'] .brand-subtitle {
  color: var(--text-muted) !important;
}

[data-theme='dark'] input,
[data-theme='dark'] select,
[data-theme='dark'] textarea {
  background: var(--surface-soft);
  border-color: var(--border);
  color: var(--text);
}

[data-theme='dark'] input::placeholder,
[data-theme='dark'] textarea::placeholder {
  color: var(--text-muted);
}

[data-theme='dark'] .ghost-button,
[data-theme='dark'] .soft-button,
[data-theme='dark'] .icon-button {
  background: var(--surface-soft);
  border-color: var(--border);
  color: var(--text);
}

[data-theme='dark'] .ghost-button:hover,
[data-theme='dark'] .soft-button:hover {
  background: var(--surface-strong);
}

[data-theme='dark'] table th {
  background: var(--surface-soft);
  color: var(--text-muted);
  border-color: var(--border);
}

[data-theme='dark'] table td {
  border-color: var(--border);
  color: var(--text);
}

[data-theme='dark'] table tr:hover td {
  background: var(--surface-soft);
}

[data-theme='dark'] .chat-list-panel,
[data-theme='dark'] .chat-workspace,
[data-theme='dark'] .message-bubble {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme='dark'] .message.out .message-bubble {
  background: #1a3a28;
}

[data-theme='dark'] .message.in .message-bubble {
  background: var(--surface-soft);
}

[data-theme='dark'] .composer {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme='dark'] .composer-input {
  background: var(--surface-soft);
  color: var(--text);
}

[data-theme='dark'] .modal-backdrop {
  background: rgba(0,0,0,.65);
}

[data-theme='dark'] .modal-box,
[data-theme='dark'] .modal-surface {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme='dark'] .status-pill.success { color: #6ee7b7; }
[data-theme='dark'] .status-pill.warning { color: #fcd34d; }
[data-theme='dark'] .status-pill.danger  { color: #fca5a5; }
[data-theme='dark'] .status-pill.neutral { color: var(--text-muted); }

[data-theme='dark'] .kanban-toolbar,
[data-theme='dark'] .tabs {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme='dark'] .tab-button {
  color: var(--text-muted);
}

[data-theme='dark'] .tab-button.active {
  background: var(--surface-strong);
  color: var(--text);
}

[data-theme='dark'] .diagnostic-debug-mini,
[data-theme='dark'] .diagnostic-debug-item,
[data-theme='dark'] .diagnostic-debug-score {
  background: var(--surface-soft) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

[data-theme='dark'] .badge.amber { color: #fcd34d; }
[data-theme='dark'] .sync-banner:not(.warning):not(.danger) strong { color: #81c3a5; }
[data-theme='dark'] .section-help,
[data-theme='dark'] .muted-line { color: var(--text-muted) !important; }
