/* ==========================================================================
   SISTEMA DE DISEÑO CORPORATIVO EMPRESARIAL (DESIGN TOKENS & ATOMIC FOUNDATIONS)
   Paleta Profesional B2B / Industrial SCADA - Modo Claro y Modo Oscuro
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* TEMA OSCURO CORPORATIVO (Deep Obsidian & Glassmorphism) */
:root, :root[data-theme="dark"] {
  --brand-primary: #6366f1;
  --brand-primary-hover: #4f46e5;
  --brand-secondary: #0f172a;
  --brand-accent: #818cf8;
  --brand-glow: rgba(99, 102, 241, 0.25);
  
  --bg-body: #090d16;
  --bg-surface: #0f172a;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  --bg-header: rgba(15, 23, 42, 0.85);
  --bg-input: #0b1120;
  
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-inverse: #090d16;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-focus: #6366f1;
  
  --status-ok: #10b981;
  --status-ok-bg: rgba(16, 185, 129, 0.12);
  --status-ok-border: rgba(16, 185, 129, 0.25);
  
  --status-warning: #f59e0b;
  --status-warning-bg: rgba(245, 158, 11, 0.12);
  --status-warning-border: rgba(245, 158, 11, 0.25);
  
  --status-alert: #ef4444;
  --status-alert-bg: rgba(239, 68, 68, 0.12);
  --status-alert-border: rgba(239, 68, 68, 0.25);
  
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --badge-bg: var(--status-ok-bg);
  --badge-text: var(--status-ok);
  --badge-border: var(--status-ok-border);
  --btn-nav-bg: rgba(99, 102, 241, 0.15);
  --btn-nav-text: #f8fafc;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --shadow-card-hover: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(99, 102, 241, 0.2);
  --shadow-elevated: 0 20px 30px -10px rgba(0, 0, 0, 0.7);
}

/* TEMA CLARO CORPORATIVO (Enterprise Clean Slate / WCAG AAA Compliant) */
:root[data-theme="light"] {
  --brand-primary: #4f46e5;
  --brand-primary-hover: #4338ca;
  --brand-secondary: #f8fafc;
  --brand-accent: #4f46e5;
  --brand-glow: rgba(79, 70, 229, 0.15);
  
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-header: #ffffff;
  --bg-input: #ffffff;
  
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-focus: #4f46e5;
  
  --status-ok: #059669;
  --status-ok-bg: #ecfdf5;
  --status-ok-border: #a7f3d0;
  
  --status-warning: #d97706;
  --status-warning-bg: #fffbeb;
  --status-warning-border: #fde68a;
  
  --status-alert: #dc2626;
  --status-alert-bg: #fef2f2;
  --status-alert-border: #fecaca;
  
  --badge-bg: #ecfdf5;
  --badge-text: #059669;
  --badge-border: #a7f3d0;
  --btn-nav-bg: #ede9fe;
  --btn-nav-text: #4338ca;
  
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05), 0 0 0 1px #e2e8f0;
  --shadow-card-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04), 0 0 0 1px #cbd5e1;
  --shadow-elevated: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

/* RESET Y BASE TIPOGRÁFICA */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.875rem;
  line-height: 1.5;
  letter-spacing: -0.011em;
  transition: background-color 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar refinado */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

/* FORM SELECTS & INPUTS ESTILIZADOS */
select, .form-select, input, .form-input {
  font-family: var(--font-family);
  background-color: var(--bg-input) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.875rem;
  outline: none;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

select:focus, .form-select:focus, input:focus, .form-input:focus {
  border-color: var(--brand-primary) !important;
  box-shadow: 0 0 0 3px var(--brand-glow) !important;
}

select option, .form-select option {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  padding: 8px 12px;
}

:root[data-theme="light"] select option,
:root[data-theme="light"] .form-select option {
  background-color: #ffffff !important;
  color: #0f172a !important;
}
