/* =========================================
   THEME DEFINITIONS
   ========================================= */

/* --- LIGHT THEME (Default) --- */
:root {
    --bg-app: #f4f6fb;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f9fafb;
    --bg-surface-active: #eff6ff;
    --text-primary: #1f2933;
    --text-secondary: #6b7280;
    --text-tertiary: #9aa5b1;
    --border-color: #e1e4ea;
    --border-color-hover: #cbd5e1;
    --border-focus: #2563eb;
    --primary-color: #2563eb;
    --primary-gradient-start: #2563eb;
    --primary-gradient-end: #4f46e5;
    --primary-text-on-dark: #ffffff;
    --primary-bg-light: #e5edff;
    --input-bg: #ffffff;
    /* Shadows - Soft & Diffuse */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    /* Semantic Colors */
    --color-danger: #dc2626;
    --color-danger-bg: #fee2e2;
    --color-warning: #f59e0b;
    --color-warning-bg: #fef3c7;
    --color-success: #10b981;
    --color-success-bg: #d1fae5;
    --color-info: #3b82f6;
    --color-info-bg: #eff6ff;
    --color-rating: #eab308;
    /* Asset Condition Colors */
    --condition-excellent: #10b981;
    --condition-excellent-bg: #d1fae5;
    --condition-good: #22c55e;
    --condition-good-bg: #dcfce7;
    --condition-fair: #f59e0b;
    --condition-fair-bg: #fef3c7;
    --condition-poor: #f97316;
    --condition-poor-bg: #ffedd5;
    --condition-damaged: #ef4444;
    --condition-damaged-bg: #fee2e2;
    --condition-nonfunctional: #6b7280;
    --condition-nonfunctional-bg: #f3f4f6;
    /* Internal Note Styling */
    --internal-note-bg: #fefce8;
    --internal-note-border: #fde047;
    --internal-note-text: #854d0e;
    --internal-note-icon: #d97706;
    /* Pill/Chip Colors */
    --pill-green: rgba(34, 197, 94, 0.15);
    --pill-green-text: #15803d;
    --pill-green-border: rgba(34, 197, 94, 0.3);
    --pill-blue: rgba(59, 130, 246, 0.15);
    --pill-blue-text: #1d4ed8;
    --pill-blue-border: rgba(59, 130, 246, 0.3);
    --pill-purple: rgba(168, 85, 247, 0.15);
    --pill-purple-text: #7c3aed;
    --pill-purple-border: rgba(168, 85, 247, 0.3);
    --pill-orange: rgba(249, 115, 22, 0.15);
    --pill-orange-text: #c2410c;
    --pill-orange-border: rgba(249, 115, 22, 0.3);
    --pill-yellow: rgba(234, 179, 8, 0.15);
    --pill-yellow-text: #a16207;
    --pill-yellow-border: rgba(234, 179, 8, 0.3);
    --pill-red: rgba(239, 68, 68, 0.15);
    --pill-red-text: #dc2626;
    --pill-red-border: rgba(239, 68, 68, 0.3);
    --pill-gray: rgba(107, 114, 128, 0.15);
    --pill-gray-text: #4b5563;
    --pill-gray-border: rgba(107, 114, 128, 0.3);
    /* Warranty Status */
    --warranty-active: var(--color-success);
    --warranty-active-bg: var(--color-success-bg);
    --warranty-expiring: var(--color-warning);
    --warranty-expiring-bg: var(--color-warning-bg);
    --warranty-expired: var(--color-danger);
    --warranty-expired-bg: var(--color-danger-bg);
    /* Grid-specific */
    --grid-header-bg: #f5f5f5;
    --grid-row-hover: rgba(59, 130, 246, 0.06);
    --grid-row-selected: rgba(59, 130, 246, 0.12);
}

/* --- BLUE THEME (Formerly Dark) --- */
[data-theme="blue"] {
    --bg-app: #0f172a;
    --bg-surface: #1e293b;
    --bg-surface-hover: #334155;
    --bg-surface-active: #1e3a8a;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --border-color: #334155;
    --border-color-hover: #475569;
    --border-focus: #60a5fa;
    --primary-color: #60a5fa;
    --primary-gradient-start: #3b82f6;
    --primary-gradient-end: #6366f1;
    --primary-text-on-dark: #ffffff;
    --primary-bg-light: rgba(37, 99, 235, 0.2);
    --input-bg: #1e293b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 20px -5px rgba(0, 0, 0, 0.4);
    /* Semantic Colors */
    --color-danger: #f87171;
    --color-danger-bg: rgba(239, 68, 68, 0.15);
    --color-warning: #fbbf24;
    --color-warning-bg: rgba(245, 158, 11, 0.15);
    --color-success: #34d399;
    --color-success-bg: rgba(16, 185, 129, 0.15);
    --color-info: #60a5fa;
    --color-info-bg: rgba(59, 130, 246, 0.15);
    --color-rating: #facc15;
    /* Asset Condition Colors */
    --condition-excellent: #34d399;
    --condition-excellent-bg: rgba(16, 185, 129, 0.15);
    --condition-good: #4ade80;
    --condition-good-bg: rgba(34, 197, 94, 0.15);
    --condition-fair: #fbbf24;
    --condition-fair-bg: rgba(245, 158, 11, 0.15);
    --condition-poor: #fb923c;
    --condition-poor-bg: rgba(249, 115, 22, 0.15);
    --condition-damaged: #f87171;
    --condition-damaged-bg: rgba(239, 68, 68, 0.15);
    --condition-nonfunctional: #94a3b8;
    --condition-nonfunctional-bg: rgba(148, 163, 184, 0.15);
    /* Internal Note Styling */
    --internal-note-bg: rgba(250, 204, 21, 0.1);
    --internal-note-border: #ca8a04;
    --internal-note-text: #fef08a;
    --internal-note-icon: #fbbf24;
    /* Pill/Chip Colors */
    --pill-green: rgba(34, 197, 94, 0.2);
    --pill-green-text: #4ade80;
    --pill-green-border: rgba(34, 197, 94, 0.4);
    --pill-blue: rgba(59, 130, 246, 0.2);
    --pill-blue-text: #93c5fd;
    --pill-blue-border: rgba(59, 130, 246, 0.4);
    --pill-purple: rgba(168, 85, 247, 0.2);
    --pill-purple-text: #c4b5fd;
    --pill-purple-border: rgba(168, 85, 247, 0.4);
    --pill-orange: rgba(249, 115, 22, 0.2);
    --pill-orange-text: #fdba74;
    --pill-orange-border: rgba(249, 115, 22, 0.4);
    --pill-yellow: rgba(234, 179, 8, 0.2);
    --pill-yellow-text: #fde047;
    --pill-yellow-border: rgba(234, 179, 8, 0.4);
    --pill-red: rgba(239, 68, 68, 0.2);
    --pill-red-text: #fca5a5;
    --pill-red-border: rgba(239, 68, 68, 0.4);
    --pill-gray: rgba(156, 163, 175, 0.2);
    --pill-gray-text: #d1d5db;
    --pill-gray-border: rgba(156, 163, 175, 0.4);
    /* Warranty Status */
    --warranty-active: var(--color-success);
    --warranty-active-bg: var(--color-success-bg);
    --warranty-expiring: var(--color-warning);
    --warranty-expiring-bg: var(--color-warning-bg);
    --warranty-expired: var(--color-danger);
    --warranty-expired-bg: var(--color-danger-bg);
    /* Grid-specific */
    --grid-header-bg: var(--bg-surface-hover);
    --grid-row-hover: rgba(59, 130, 246, 0.08);
    --grid-row-selected: rgba(59, 130, 246, 0.15);
}

/* --- TRUE DARK THEME (World Class / Relaxing) --- */
[data-theme="dark"] {
    --bg-app: #0d1117;
    --bg-surface: #161b22;
    --bg-surface-hover: #21262d;
    --bg-surface-active: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-tertiary: #484f58;
    --border-color: #30363d;
    --border-color-hover: #8b949e;
    --border-focus: #58a6ff;
    --primary-color: #58a6ff;
    --primary-gradient-start: #1f6feb;
    --primary-gradient-end: #238636;
    --primary-text-on-dark: #ffffff;
    --primary-bg-light: rgba(56, 139, 253, 0.15);
    --input-bg: #0d1117;
    --shadow-sm: 0 1px 0 rgba(0,0,0,0.4);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    /* Semantic Colors */
    --color-danger: #f87171;
    --color-danger-bg: rgba(239, 68, 68, 0.12);
    --color-warning: #fbbf24;
    --color-warning-bg: rgba(245, 158, 11, 0.12);
    --color-success: #34d399;
    --color-success-bg: rgba(16, 185, 129, 0.12);
    --color-info: #58a6ff;
    --color-info-bg: rgba(56, 139, 253, 0.12);
    --color-rating: #facc15;
    /* Asset Condition Colors */
    --condition-excellent: #34d399;
    --condition-excellent-bg: rgba(16, 185, 129, 0.12);
    --condition-good: #4ade80;
    --condition-good-bg: rgba(34, 197, 94, 0.12);
    --condition-fair: #fbbf24;
    --condition-fair-bg: rgba(245, 158, 11, 0.12);
    --condition-poor: #fb923c;
    --condition-poor-bg: rgba(249, 115, 22, 0.12);
    --condition-damaged: #f87171;
    --condition-damaged-bg: rgba(239, 68, 68, 0.12);
    --condition-nonfunctional: #8b949e;
    --condition-nonfunctional-bg: rgba(139, 148, 158, 0.12);
    /* Internal Note Styling */
    --internal-note-bg: rgba(250, 204, 21, 0.08);
    --internal-note-border: #a16207;
    --internal-note-text: #fef08a;
    --internal-note-icon: #fbbf24;
    /* Pill/Chip Colors */
    --pill-green: rgba(34, 197, 94, 0.2);
    --pill-green-text: #4ade80;
    --pill-green-border: rgba(34, 197, 94, 0.4);
    --pill-blue: rgba(59, 130, 246, 0.2);
    --pill-blue-text: #93c5fd;
    --pill-blue-border: rgba(59, 130, 246, 0.4);
    --pill-purple: rgba(168, 85, 247, 0.2);
    --pill-purple-text: #c4b5fd;
    --pill-purple-border: rgba(168, 85, 247, 0.4);
    --pill-orange: rgba(249, 115, 22, 0.2);
    --pill-orange-text: #fdba74;
    --pill-orange-border: rgba(249, 115, 22, 0.4);
    --pill-yellow: rgba(234, 179, 8, 0.2);
    --pill-yellow-text: #fde047;
    --pill-yellow-border: rgba(234, 179, 8, 0.4);
    --pill-red: rgba(239, 68, 68, 0.2);
    --pill-red-text: #fca5a5;
    --pill-red-border: rgba(239, 68, 68, 0.4);
    --pill-gray: rgba(156, 163, 175, 0.2);
    --pill-gray-text: #d1d5db;
    --pill-gray-border: rgba(156, 163, 175, 0.4);
    /* Warranty Status */
    --warranty-active: var(--color-success);
    --warranty-active-bg: var(--color-success-bg);
    --warranty-expiring: var(--color-warning);
    --warranty-expiring-bg: var(--color-warning-bg);
    --warranty-expired: var(--color-danger);
    --warranty-expired-bg: var(--color-danger-bg);
    /* Grid-specific */
    --grid-header-bg: var(--bg-surface-hover);
    --grid-row-hover: rgba(56, 139, 253, 0.08);
    --grid-row-selected: rgba(56, 139, 253, 0.15);
}

/* --- GUNMETAL THEME (Industrial / Titanium) --- */
[data-theme="gunmetal"] {
    /* Base: Titanium Grey */
    --bg-app: #333842;
    /* Surface: Slightly darker gunmetal for cards/sidebar */
    --bg-surface: #2b2f38;
    --bg-surface-hover: #404652;
    --bg-surface-active: #4b5261;
    /* Text: Silver & White */
    --text-primary: #f3f4f6;
    --text-secondary: #aeb5bc;
    --text-tertiary: #6e7681;
    /* Borders: Metallic Rim */
    --border-color: rgba(255, 255, 255, 0.15);
    --border-color-hover: rgba(255, 255, 255, 0.3);
    --border-focus: #d1d5db;
    /* Primary: Slate / Steel Blue (Less saturated than standard blue) */
    --primary-color: #64748b;
    --primary-gradient-start: #475569;
    --primary-gradient-end: #334155;
    --primary-text-on-dark: #ffffff;
    --primary-bg-light: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(0, 0, 0, 0.25);
    /* Shadows: Deep & Sharp for metal separation */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.6);
    --shadow-lg: 0 12px 24px rgba(0,0,0,0.7);
    /* Semantic Colors */
    --color-danger: #f87171;
    --color-danger-bg: rgba(239, 68, 68, 0.12);
    --color-warning: #fbbf24;
    --color-warning-bg: rgba(245, 158, 11, 0.12);
    --color-success: #34d399;
    --color-success-bg: rgba(16, 185, 129, 0.12);
    --color-info: #94a3b8;
    --color-info-bg: rgba(148, 163, 184, 0.12);
    --color-rating: #fbbf24;
    /* Asset Condition Colors */
    --condition-excellent: #34d399;
    --condition-excellent-bg: rgba(16, 185, 129, 0.12);
    --condition-good: #4ade80;
    --condition-good-bg: rgba(34, 197, 94, 0.12);
    --condition-fair: #fbbf24;
    --condition-fair-bg: rgba(245, 158, 11, 0.12);
    --condition-poor: #fb923c;
    --condition-poor-bg: rgba(249, 115, 22, 0.12);
    --condition-damaged: #f87171;
    --condition-damaged-bg: rgba(239, 68, 68, 0.12);
    --condition-nonfunctional: #aeb5bc;
    --condition-nonfunctional-bg: rgba(174, 181, 188, 0.12);
    /* Internal Note Styling */
    --internal-note-bg: rgba(250, 204, 21, 0.08);
    --internal-note-border: #a16207;
    --internal-note-text: #fef08a;
    --internal-note-icon: #fcd34d;
    /* Pill/Chip Colors */
    --pill-green: rgba(34, 197, 94, 0.2);
    --pill-green-text: #4ade80;
    --pill-green-border: rgba(34, 197, 94, 0.4);
    --pill-blue: rgba(59, 130, 246, 0.2);
    --pill-blue-text: #93c5fd;
    --pill-blue-border: rgba(59, 130, 246, 0.4);
    --pill-purple: rgba(168, 85, 247, 0.2);
    --pill-purple-text: #c4b5fd;
    --pill-purple-border: rgba(168, 85, 247, 0.4);
    --pill-orange: rgba(249, 115, 22, 0.2);
    --pill-orange-text: #fdba74;
    --pill-orange-border: rgba(249, 115, 22, 0.4);
    --pill-yellow: rgba(234, 179, 8, 0.2);
    --pill-yellow-text: #fde047;
    --pill-yellow-border: rgba(234, 179, 8, 0.4);
    --pill-red: rgba(239, 68, 68, 0.2);
    --pill-red-text: #fca5a5;
    --pill-red-border: rgba(239, 68, 68, 0.4);
    --pill-gray: rgba(156, 163, 175, 0.2);
    --pill-gray-text: #d1d5db;
    --pill-gray-border: rgba(156, 163, 175, 0.4);
    /* Warranty Status */
    --warranty-active: var(--color-success);
    --warranty-active-bg: var(--color-success-bg);
    --warranty-expiring: var(--color-warning);
    --warranty-expiring-bg: var(--color-warning-bg);
    --warranty-expired: var(--color-danger);
    --warranty-expired-bg: var(--color-danger-bg);
    /* Grid-specific */
    --grid-header-bg: var(--bg-surface-hover);
    --grid-row-hover: rgba(255, 255, 255, 0.04);
    --grid-row-selected: rgba(255, 255, 255, 0.08);
}
