/* ═══════════════════════════════════════════════════════════════
   GLOBAL THEME VARIABLES - ALL PAGES
   Include this FIRST in every page: <link href="css/global/theme.css">
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────
   LIGHT THEME (DEFAULT) -  FIXED TEXT COLORS
   ───────────────────────────────────────────────────────────── */
   html {
  visibility: hidden;
}

html[data-theme] {
  visibility: visible;
}

[data-theme="light"] {
  /* Backgrounds */
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f8fafc;
  --bg-card: #ffffff;
  
  /* Glass Effects */
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-bg-dark: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(148, 163, 184, 0.2);
  --glass-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  --glass-shadow-hover: 0 8px 24px rgba(15, 23, 42, 0.12);
  
  /* Text Colors -  DARKER FOR BETTER READABILITY */
  --text-primary: #1e293b;           /* ✅ Changed from #0f172a */
  --text-secondary: #334155;         /* ✅ Changed from #475569 */
  --text-muted: #475569;             /* ✅ Changed from #64748b */
  --text-ultra-muted: #64748b;
  
  /* Header -  DARKER TEXT */
  --header-bg: #ffffff;
  --header-border: rgba(148, 163, 184, 0.2);
  --header-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  --header-text: #1e293b;            /* ✅ NEW */
  
  /* Sidebar -  DARKER TEXT */
  --sidebar-bg: #ffffff;
  --sidebar-border: rgba(148, 163, 184, 0.2);
  --sidebar-text: #334155;           /* ✅ Changed from #475569 */
  --sidebar-hover-bg: rgba(59, 130, 246, 0.1);
  --sidebar-hover-text: #3b82f6;
  --sidebar-active-bg: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --sidebar-active-text: #ffffff;
  
  /* Footer - DARKER TEXT */
  --footer-bg: #ffffff;
  --footer-border: rgba(148, 163, 184, 0.2);
  --footer-text: #475569;            /* ✅ Changed from #64748b */
  
  /* Form Elements -  DARKER TEXT */
  --input-bg: #ffffff;
  --input-border: #e2e8f0;
  --input-focus-border: #3b82f6;
  --input-text: #1e293b;             /* ✅ Changed from #0f172a */
  --input-placeholder: #94a3b8;
  
  /* Tables -  DARKER TEXT */
  --table-header-bg: rgba(59, 130, 246, 0.1);
  --table-row-hover: rgba(59, 130, 246, 0.05);
  --table-border: #e2e8f0;
  --table-text: #1e293b;             /* ✅ Changed from #0f172a */
  
  /* Modals */
  --modal-bg: rgba(255, 255, 255, 0.95);
  --modal-overlay: rgba(15, 23, 42, 0.5);
  --modal-border: rgba(148, 163, 184, 0.2);
  
  /* Buttons -  DARKER TEXT */
  --btn-primary-bg: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --btn-primary-text: #ffffff;
  --btn-secondary-bg: #f1f5f9;
  --btn-secondary-text: #1e293b;     /* ✅ Changed from #0f172a */
  --btn-danger-bg: #ef4444;
  --btn-success-bg: #10b981;
  
  /*  NEW - Transition Variables */
  --transition-fast: all 0.2s ease;
  --transition-smooth: all 0.3s ease;
}

/* ─────────────────────────────────────────────────────────────
   DARK THEME (NAVY BLUE)
   ───────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  /* Backgrounds - Navy Blue */
  --bg-primary: #0a0e1a;
  --bg-secondary: #0f172a;
  --bg-tertiary: #1e293b;
  --bg-card: #1e293b;
  
  /* Glass Effects - Dark */
  --glass-bg: rgba(15, 23, 42, 0.8);
  --glass-bg-dark: rgba(15, 23, 42, 0.95);
  --glass-border: rgba(71, 85, 105, 0.3);
  --glass-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  --glass-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.4);
  
  /* Text Colors - Dark */
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-ultra-muted: #64748b;
  
  /* Header - Dark */
  --header-bg: #0f172a;
  --header-border: rgba(71, 85, 105, 0.3);
  --header-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --header-text: #f1f5f9;
  
  /* Sidebar - Dark */
  --sidebar-bg: #0f172a;
  --sidebar-border: rgba(71, 85, 105, 0.3);
  --sidebar-text: #cbd5e1;
  --sidebar-hover-bg: rgba(59, 130, 246, 0.15);
  --sidebar-hover-text: #60a5fa;
  --sidebar-active-bg: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --sidebar-active-text: #ffffff;
  
  /* Footer - Dark */
  --footer-bg: #0f172a;
  --footer-border: rgba(71, 85, 105, 0.3);
  --footer-text: #94a3b8;
  
  /* Form Elements - Dark */
  --input-bg: rgba(30, 41, 59, 0.6);
  --input-border: rgba(71, 85, 105, 0.4);
  --input-focus-border: #3b82f6;
  --input-text: #f1f5f9;
  --input-placeholder: #64748b;
  
  /* Tables - Dark */
  --table-header-bg: rgba(59, 130, 246, 0.15);
  --table-row-hover: rgba(59, 130, 246, 0.1);
  --table-border: rgba(71, 85, 105, 0.3);
  --table-text: #f1f5f9;
  
  /* Modals - Dark */
  --modal-bg: rgba(15, 23, 42, 0.95);
  --modal-overlay: rgba(0, 0, 0, 0.7);
  --modal-border: rgba(71, 85, 105, 0.3);
  
  /* Buttons - Dark */
  --btn-primary-bg: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --btn-primary-text: #ffffff;
  --btn-secondary-bg: rgba(30, 41, 59, 0.6);
  --btn-secondary-text: #f1f5f9;
  --btn-danger-bg: #ef4444;
  --btn-success-bg: #10b981;
  
  /* Transition Variables */
  --transition-fast: all 0.2s ease;
  --transition-smooth: all 0.3s ease;
}

/* ─────────────────────────────────────────────────────────────
   GLOBAL STYLES - APPLY TO ALL PAGES
   ───────────────────────────────────────────────────────────── */

/* Body */
body {
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  transition: var(--transition-smooth);
}

/* Header */
.fixedheader {
  background: var(--header-bg) !important;
  border-bottom: 1px solid var(--header-border) !important;
  box-shadow: var(--header-shadow) !important;
  transition: var(--transition-smooth);
}

/* Sidebar */
.sidebar,
.sidebarMainContent .sidebar,
.sideBar {
  background: var(--sidebar-bg) !important;
  border-right: 1px solid var(--sidebar-border) !important;
  transition: var(--transition-smooth);
}

.sidebar .nav-link {
  color: var(--sidebar-text) !important;
  transition: var(--transition-fast);
}

.sidebar .nav-link:hover {
  background: var(--sidebar-hover-bg) !important;
  color: var(--sidebar-hover-text) !important;
}

.sidebar .nav-link.active {
  background: var(--sidebar-active-bg) !important;
  color: var(--sidebar-active-text) !important;
}

/* Footer */
footer,
.premium-footer,
.footer-sec {
  background: var(--footer-bg) !important;
  /* border-top: 1px solid var(--footer-border) !important; */
  color: var(--footer-text) !important;
  transition: var(--transition-smooth);
}

/* Cards */
.card,
.compact-card,
.glass-card,
.welcome-banner-compact {
  background: var(--glass-bg) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--glass-shadow) !important;
  color: var(--text-primary) !important;
  transition: var(--transition-smooth);
}

/* Tables */
table thead th {
  background: var(--table-header-bg) !important;
  color: var(--text-primary) !important;
}

table tbody tr {
  transition: var(--transition-fast);
}

table tbody tr:hover {
  background: var(--table-row-hover) !important;
}

table tbody td {
  color: var(--table-text) !important;
  border-bottom: 1px solid var(--table-border) !important;
}

/* Forms */
input,
textarea,
select {
  background: var(--input-bg) !important;
  border: 1px solid var(--input-border) !important;
  color: var(--input-text) !important;
  transition: var(--transition-fast);
}

input::placeholder,
textarea::placeholder {
  color: var(--input-placeholder) !important;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--input-focus-border) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Buttons */
.btn-primary {
  background: var(--btn-primary-bg) !important;
  color: var(--btn-primary-text) !important;
  border: none !important;
  transition: var(--transition-fast);
}

.btn-secondary {
  background: var(--btn-secondary-bg) !important;
  color: var(--btn-secondary-text) !important;
  border: 1px solid var(--glass-border) !important;
  transition: var(--transition-fast);
}

/* Modals */
.modal-content {
  background: var(--modal-bg) !important;
  border: 1px solid var(--modal-border) !important;
  transition: var(--transition-smooth);
}

.modal-backdrop {
  background: var(--modal-overlay) !important;
}

/* Content Area */
.content,
.premium-content {
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  transition: var(--transition-smooth);
}

/* Text Classes */
.text-primary { 
  color: var(--text-primary) !important; 
}

.text-secondary { 
  color: var(--text-secondary) !important; 
}

.text-muted { 
  color: var(--text-muted) !important; 
}

/* NEW - Specific Text Elements */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary) !important;
}

p {
  color: var(--text-secondary) !important;
}

.welcome-title-compact {
  color: var(--text-primary) !important;
  font-weight: 700 !important;
}

.welcome-subtitle-compact {
  color: var(--text-muted) !important;
  font-weight: 500 !important;
}

.company-name-header {
  color: var(--text-primary) !important;
  font-weight: 700 !important;
}

.text-gray-700 {
  color: var(--text-primary) !important;
}

/* Background Classes */
.bg-primary { 
  background: var(--bg-primary) !important; 
}

.bg-secondary { 
  background: var(--bg-secondary) !important; 
}

.bg-card { 
  background: var(--bg-card) !important; 
}

/* Border Classes */
.border { 
  border-color: var(--glass-border) !important; 
}

/* Smooth Transitions for All Elements */
* {
  transition-property: background-color, color, border-color;
  transition-duration: 0.3s;
  transition-timing-function: ease;
}

/* END OF GLOBAL THEME CSS */
