@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  /* --- TEMA CLARO (Default) --- */
  color-scheme: light;
  
  /* Bases */
  --bg: #f1f5f9;
  --bg-elevated: #ffffff;
  --bg-pattern: radial-gradient(circle at 1px 1px, rgba(15, 23, 42, 0.06) 1px, transparent 0);

  /* Superficies */
  --card-bg: #ffffff;
  --card-elevated: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.85);
  --sidebar-bg: #ffffff;
  --menu-bg: rgba(255, 255, 255, 0.95);
  
  /* Textos */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff; /* Para botones o fondos oscuros en tema claro */

  /* Bordes */
  --border-soft: #e2e8f0;
  --border-medium: #cbd5e1;

  /* Inputs */
  --input-bg: #f8fafc;
  --input-border: #e2e8f0;
  --input-focus-border: #3b82f6;
  --input-focus-shadow: rgba(59, 130, 246, 0.15);

  /* Tablas */
  --table-header-bg: #f8fafc;
  --table-row-hover: #f1f5f9;
  --table-border: #e2e8f0;

  /* Acciones & Estados */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.15);
  
  --danger: #dc2626;
  --danger-glow: rgba(220, 38, 38, 0.15);
  
  --success: #16a34a;
  --success-glow: rgba(22, 163, 74, 0.15);

  --warning: #d97706;

  /* Componentes Especiales (Glass/Tanques) */
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-blur: 12px;
  
  --tank-bg: #ffffff;
  --tank-border: #cbd5e1;
  
  /* Neones (Versión Light: colores sólidos vibrantes) */
  --neon-green: #059669;
  --neon-yellow: #d97706;
  --neon-red: #e11d48;
  --neon-blue: #2563eb;
}

/* --- TEMA OSCURO --- */
[data-theme="dark"] {
  color-scheme: dark;
  
  /* Bases */
  --bg: #020617;             
  --bg-elevated: #0f172a;    
  --bg-pattern: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.05) 1px, transparent 0);

  /* Superficies */
  --card-bg: rgba(30, 41, 59, 0.6); /* Semi-transparente */
  --card-elevated: #1e293b;
  --header-bg: rgba(15, 23, 42, 0.85);
  --sidebar-bg: rgba(15, 23, 42, 0.95);
  --menu-bg: rgba(15, 23, 42, 0.95);

  /* Textos */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;

  /* Bordes */
  --border-soft: rgba(148, 163, 184, 0.15);
  --border-medium: rgba(148, 163, 184, 0.3);

  /* Inputs */
  --input-bg: rgba(15, 23, 42, 0.6);
  --input-border: rgba(148, 163, 184, 0.2);
  --input-focus-border: #3b82f6;
  --input-focus-shadow: rgba(59, 130, 246, 0.25);

  /* Tablas */
  --table-header-bg: rgba(30, 41, 59, 0.8);
  --table-row-hover: rgba(255, 255, 255, 0.03);
  --table-border: rgba(148, 163, 184, 0.1);

  /* Acciones */
  --accent: #3b82f6;         
  --accent-hover: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.5);
  
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.5);
  
  --success: #22c55e;
  --success-glow: rgba(34, 197, 94, 0.5);

  --warning: #f59e0b;

  /* Componentes */
  --glass-bg: rgba(30, 41, 59, 0.4);
  --glass-border: rgba(255, 255, 255, 0.1);
  
  --tank-bg: #1e293b;
  --tank-border: #475569;
  
  /* Neones (Versión Dark: brillantes con glow) */
  --neon-green: #22c55e;
  --neon-yellow: #f59e0b;
  --neon-red: #f43f5e;
  --neon-blue: #3b82f6;
}

body {
    background-color: var(--bg);
    background-image: var(--bg-pattern);
    background-size: 24px 24px;
    color: var(--text-main);
    font-family: 'Inter', system-ui, sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; border: 2px solid var(--bg); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--border-soft); border-color: var(--bg); }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Botón Theme Toggle */
.btn-icon-ghost {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1.2rem;
    margin-right: 10px;
}
.btn-icon-ghost:hover {
    background: var(--bg-elevated);
    color: var(--accent);
    border-color: var(--border-soft);
}

/* ===== Fix: logo con mismos colores en tema claro y oscuro ===== */
[data-theme="dark"] .brand-logo,
[data-theme="dark"] .brand-logo-small {
    filter: none !important;
    mix-blend-mode: normal !important;
}