/* Unified Design System for Hypha Roots */
/* Consolidates Bootstrap, modern-ui.css, dashboard.css, and custom styles */

:root {
  /* Brand Colors - Primary Green Palette */
  --brand-primary: #2E8B57;
  --brand-primary-light: #3CB371;
  --brand-primary-dark: #1e5d39;
  --brand-primary-50: #f0f9f4;
  --brand-primary-100: #dcf4e3;
  --brand-primary-200: #bbe8c9;
  --brand-primary-500: var(--brand-primary);
  --brand-primary-600: var(--brand-primary-dark);
  --brand-primary-700: #155d2f;
  
  /* Neutral Colors */
  --gray-50: #ffffff;  /* Pure white instead of light blue-gray */
  --gray-100: #f8f9fa;  /* Light neutral gray instead of blue-gray */
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Semantic Colors */
  --success-50: #f0fdf4;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-700: #15803d;
  
  --warning-50: #fffbeb;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --warning-700: #b45309;
  
  --error-50: #fef2f2;
  --error-500: #ef4444;
  --error-600: #dc2626;
  --error-700: #b91c1c;
  
  --info-50: #f0f9f4;
  --info-500: #2E8B57;
  --info-600: #1e5d39;
  --info-700: #155d2f;
  
  /* Typography */
  --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  --font-family-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
  
  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  
  /* Spacing Scale */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  
  /* Border Radius */
  --radius-none: 0;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
}

/* Global Reset & Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family-sans);
  background-color: #ffffff;
  color: var(--gray-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
}

/* Ensure the sidebar layout body has no margin/padding issues */
.sidebar-layout {
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden;
}

/* Sidebar Layout System - Updated */
.sidebar-layout {
  min-height: 100vh;
  position: relative;
  display: block; /* Override any flex issues */
}

/* Override Bootstrap Primary Color */
:root {
  --bs-primary: var(--brand-primary);
  --bs-primary-rgb: 46, 139, 87;
}

.bg-primary {
  background-color: var(--brand-primary) !important;
}

.text-primary {
  color: var(--brand-primary) !important;
}

.btn-primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-primary:hover {
  background-color: var(--brand-primary-dark);
  border-color: var(--brand-primary-dark);
}

/* Sidebar Layout System */
.sidebar-layout {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  position: relative;
}

/* Mobile Header */
.mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  background: var(--brand-primary);
}

.mobile-header .navbar {
  padding: 0.5rem 1rem;
  min-height: 56px;
}

.mobile-header .navbar-brand {
  font-size: 1.1rem;
  font-weight: 600;
}

/* Sidebar Navigation */
.sidebar {
  width: 280px;
  background: var(--brand-primary-dark);  /* Dark green background */
  border-right: 1px solid var(--brand-primary);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1040;
  overflow-y: auto;
}

@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
}

/* Sidebar Header */
.sidebar-header {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.1);  /* Slightly darker green */
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: white;
  font-weight: 700;
  font-size: 1.25rem;
}

.sidebar-brand:hover {
  color: var(--brand-primary-100);
  text-decoration: none;
}

.brand-text {
  color: inherit;
}

/* Mobile close button for dark sidebar */
.sidebar .btn-close {
  filter: invert(1);
  opacity: 0.8;
}

.sidebar .btn-close:hover {
  opacity: 1;
}

/* Sidebar Body */
.sidebar-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
}

.sidebar-nav {
  flex: 1;
  padding: 0 0.75rem;
}

/* Navigation Links */
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.25rem;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  border-radius: var(--radius-lg);
  font-weight: 500;
  transition: var(--transition-fast);
  position: relative;
}

.sidebar-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  text-decoration: none;
}

.sidebar-nav .nav-link.active {
  background: var(--brand-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.sidebar-nav .nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: white;
  border-radius: 0 3px 3px 0;
}

.sidebar-nav .nav-link i {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.sidebar-nav .nav-link span {
  flex: 1;
  font-size: 0.95rem;
}

/* Navigation Sections - Collapsible */
.nav-section {
  margin-bottom: 0.5rem;
}

.nav-section-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  width: 100%;
  color: rgba(255, 255, 255, 0.9);
  background: none;
  border: none;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: left;
  transition: var(--transition-fast);
  cursor: pointer;
}

.nav-section-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-section-toggle.active {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.nav-section-toggle i:first-child {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.nav-section-toggle span {
  flex: 1;
}

.nav-section-toggle .chevron {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-fast);
  font-size: 0.875rem;
}

.nav-section-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

/* Navigation Collapse */
.nav-collapse {
  padding-left: 1rem;
  margin-top: 0.25rem;
}

/* Sub Navigation Links */
.nav-sublink {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  margin-bottom: 0.125rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.875rem;
  transition: var(--transition-fast);
  position: relative;
}

.nav-sublink:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  text-decoration: none;
}

.nav-sublink.active {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-weight: 600;
}

.nav-sublink.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 16px;
  background: var(--brand-primary);
  border-radius: 1px;
}

.nav-sublink i {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  opacity: 0.8;
}

.nav-sublink span {
  flex: 1;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.sidebar-footer .nav-item {
  margin-bottom: 0.5rem;
}

.sidebar-footer .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  color: var(--gray-600);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: var(--transition-fast);
}

.sidebar-footer .nav-link:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

.sidebar-footer .dropdown-menu {
  bottom: 100%;
  top: auto;
  margin-bottom: 0.5rem;
}

/* Main Content Area */
.main-content {
  flex: 1;
  min-height: 100vh;
  background: #ffffff;
  padding-top: 56px; /* Account for mobile header */
  display: flex;
  flex-direction: column;
}

@media (min-width: 992px) {
  .main-content {
    margin-left: 280px;
    padding-top: 0;
  }
}

.main-content .unified-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Footer Styling for Sidebar Layout */
.sidebar-layout .footer {
  margin-top: auto;
  background: white !important;
  border-top: 1px solid var(--gray-200);
  padding: 2rem 0 1rem 0 !important;
}

.sidebar-layout .footer h5 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--gray-800);
}

.sidebar-layout .footer p,
.sidebar-layout .footer li {
  font-size: 0.875rem;
  line-height: 1.4;
}

.sidebar-layout .footer ul {
  margin-bottom: 0;
}

.sidebar-layout .footer .row:first-child {
  margin-bottom: 1rem;
}

.sidebar-layout .footer hr {
  margin: 1rem 0;
  opacity: 0.3;
}

.sidebar-layout .footer .copyright {
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* Layout Components */
.unified-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.unified-section {
  margin-bottom: var(--space-8);
}

/* Modern Navigation Enhancement */
.navbar-brand {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.navbar-nav .nav-link {
  font-weight: 500;
  transition: var(--transition-fast);
  border-radius: var(--radius-md);
  margin: 0 var(--space-1);
}

.navbar-nav .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Ensure navbar stays green */
.navbar.bg-primary,
.navbar-dark.bg-primary {
  background-color: var(--brand-primary) !important;
}

.dropdown-menu {
  border: none;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
}

.dropdown-header {
  font-weight: 600;
  color: var(--gray-700);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-2) var(--space-3);
}

.dropdown-item {
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.dropdown-item:hover {
  background-color: var(--brand-primary-50);
  color: var(--brand-primary-700);
}

/* Unified Card System */
.unified-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition-base);
  margin-bottom: var(--space-6);
}

.unified-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
  transform: translateY(-1px);
}

.unified-card-header {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  padding: var(--space-6);
}

.unified-card-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.unified-card-body {
  padding: var(--space-6);
}

.unified-card-footer {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  padding: var(--space-4) var(--space-6);
}

/* Modern Button System */
.btn-unified {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-weight: 500;
  font-size: var(--text-sm);
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  line-height: 1;
}

.btn-unified:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.btn-unified-primary {
  background: var(--brand-primary);
  color: white;
}

.btn-unified-primary:hover {
  background: var(--brand-primary-dark);
  color: white;
}

.btn-unified-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}

.btn-unified-secondary:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

.btn-unified-success {
  background: var(--success-500);
  color: white;
}

.btn-unified-success:hover {
  background: var(--success-600);
  color: white;
}

.btn-unified-outline {
  background: transparent;
  color: var(--brand-primary);
  border: 1px solid var(--brand-primary);
}

.btn-unified-outline:hover {
  background: var(--brand-primary-50);
  border-color: var(--brand-primary-600);
}

/* Status Badge System */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.status-badge-success {
  background: var(--success-50);
  color: var(--success-700);
}

.status-badge-warning {
  background: var(--warning-50);
  color: var(--warning-700);
}

.status-badge-error {
  background: var(--error-50);
  color: var(--error-700);
}

.status-badge-info {
  background: var(--info-50);
  color: var(--info-700);
}

.status-badge-neutral {
  background: var(--gray-100);
  color: var(--gray-700);
}

/* Form System */
.form-unified {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.form-group-unified {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label-unified {
  font-weight: 500;
  color: var(--gray-700);
  font-size: var(--text-sm);
}

.form-input-unified, 
.form-select-unified, 
.form-textarea-unified {
  padding: var(--space-3);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  background: white;
  color: var(--gray-900);
  font-size: var(--text-sm);
  transition: var(--transition-fast);
}

.form-input-unified:focus,
.form-select-unified:focus,
.form-textarea-unified:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-50);
}

/* Dashboard Stats Grid */
.stats-grid-unified {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.stat-card-unified {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  text-align: center;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card-unified::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-light));
}

.stat-card-unified:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-number {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: var(--space-2);
}

.stat-label {
  color: var(--gray-500);
  font-size: var(--text-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Data Table Enhancement */
.table-unified {
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-unified table {
  margin: 0;
}

.table-unified th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-200);
  padding: var(--space-4);
}

.table-unified td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--gray-100);
}

.table-unified tr:hover {
  background: var(--gray-50);
}

/* Alert System */
.alert-unified {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.alert-unified-success {
  background: var(--success-50);
  border-color: var(--success-200);
  color: var(--success-700);
}

.alert-unified-warning {
  background: var(--warning-50);
  border-color: var(--warning-200);
  color: var(--warning-700);
}

.alert-unified-error {
  background: var(--error-50);
  border-color: var(--error-200);
  color: var(--error-700);
}

.alert-unified-info {
  background: var(--info-50);
  border-color: var(--info-200);
  color: var(--info-700);
}

/* Empty State Component */
.empty-state-unified {
  text-align: center;
  padding: var(--space-16);
  color: var(--gray-500);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-6);
  opacity: 0.5;
}

.empty-state-title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--space-2);
}

.empty-state-description {
  font-size: var(--text-sm);
  line-height: 1.6;
  margin-bottom: var(--space-6);
}

/* Loading States */
.loading-unified {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--gray-500);
}

.spinner-unified {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--gray-200);
  border-top: 2px solid var(--brand-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Animation Classes */
.fade-in-unified {
  animation: fadeInUnified 0.3s ease-in-out;
}

@keyframes fadeInUnified {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-up-unified {
  animation: slideUpUnified 0.3s ease-out;
}

@keyframes slideUpUnified {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Responsive Utilities */
@media (max-width: 768px) {
  .unified-container {
    padding: 0 var(--space-2);
  }
  
  .stats-grid-unified {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  
  .unified-card-header,
  .unified-card-body {
    padding: var(--space-4);
  }
  
  .btn-unified {
    width: 100%;
    justify-content: center;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --gray-50: #1f2937;
    --gray-100: #374151;
    --gray-200: #4b5563;
    --gray-900: #f9fafb;
  }
  
  body {
    background-color: var(--gray-800);
    color: var(--gray-100);
  }
  
  .unified-card {
    background: var(--gray-900);
    border-color: var(--gray-700);
  }
  
  .unified-card-header {
    background: var(--gray-800);
    border-color: var(--gray-700);
  }
}

/* Text Size Utility Classes */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Text Color Utility Classes - High Specificity */
.text-gray-50, h1.text-gray-50, h2.text-gray-50, p.text-gray-50 { color: var(--gray-50) !important; }
.text-gray-100, h1.text-gray-100, h2.text-gray-100, p.text-gray-100 { color: var(--gray-100) !important; }
.text-gray-200, h1.text-gray-200, h2.text-gray-200, p.text-gray-200 { color: var(--gray-200) !important; }
.text-gray-300, h1.text-gray-300, h2.text-gray-300, p.text-gray-300 { color: var(--gray-300) !important; }
.text-gray-400, h1.text-gray-400, h2.text-gray-400, p.text-gray-400 { color: var(--gray-400) !important; }
.text-gray-500, h1.text-gray-500, h2.text-gray-500, p.text-gray-500 { color: var(--gray-500) !important; }
.text-gray-600, h1.text-gray-600, h2.text-gray-600, p.text-gray-600 { color: var(--gray-600) !important; }
.text-gray-700, h1.text-gray-700, h2.text-gray-700, p.text-gray-700 { color: var(--gray-700) !important; }
.text-gray-800, h1.text-gray-800, h2.text-gray-800, p.text-gray-800 { color: var(--gray-800) !important; }
.text-gray-900, h1.text-gray-900, h2.text-gray-900, p.text-gray-900 { color: var(--gray-900) !important; }

.text-white, h1.text-white, h2.text-white, p.text-white { color: white !important; }
.text-black, h1.text-black, h2.text-black, p.text-black { color: black !important; }

.text-primary { color: var(--brand-primary) !important; }
.text-brand-primary { color: var(--brand-primary) !important; }
.text-success { color: var(--success-600) !important; }
.text-warning { color: var(--warning-600) !important; }
.text-error { color: var(--error-600) !important; }
.text-info { color: var(--info-600) !important; }

.bg-success { background-color: var(--success-50); }
.bg-warning { background-color: var(--warning-50); }
.bg-error { background-color: var(--error-50); }
.bg-info { background-color: var(--info-50); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }

.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Layout Utilities */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Spacing Utilities */
.space-y-1 > * + * { margin-top: var(--space-1); }
.space-y-2 > * + * { margin-top: var(--space-2); }
.space-y-3 > * + * { margin-top: var(--space-3); }
.space-y-4 > * + * { margin-top: var(--space-4); }
.space-y-6 > * + * { margin-top: var(--space-6); }

/* Width Utilities */
.w-full { width: 100%; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }

/* Height Utilities */
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }

/* Margin Utilities */
.mr-2 { margin-right: var(--space-2); }
.mr-3 { margin-right: var(--space-3); }
.ml-2 { margin-left: var(--space-2); }
.mt-1 { margin-top: var(--space-1); }
.mt-3 { margin-top: var(--space-3); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

/* Padding Utilities */
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-12 { padding: 3rem; }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.pt-3 { padding-top: var(--space-3); }

/* Text Alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Background Colors */
.bg-gray-50 { background-color: var(--gray-50); }
.bg-gray-100 { background-color: var(--gray-100); }
.bg-white { background-color: white; }

.bg-success-50 { background-color: var(--success-50); }
.bg-warning-50 { background-color: var(--warning-50); }
.bg-error-50 { background-color: var(--error-50); }
.bg-info-50 { background-color: var(--info-50); }

/* Border Radius */
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Border Utilities */
.border { border: 1px solid var(--gray-200); }
.border-t { border-top: 1px solid var(--gray-200); }
.border-l-4 { border-left: 4px solid; }
.border-green-500 { border-color: #22c55e; }
.border-red-500 { border-color: #ef4444; }
.border-yellow-500 { border-color: #f59e0b; }
.border-blue-500 { border-color: #3b82f6; }
.border-primary { border-color: var(--brand-primary); }

/* Position Utilities */
.relative { position: relative; }
.absolute { position: absolute; }
.top-full { top: 100%; }
.right-0 { right: 0; }
.z-50 { z-index: 50; }

/* Display Utilities */
.hidden { display: none; }
.block { display: block; }

/* Other Utilities */
.cursor-pointer { cursor: pointer; }
.opacity-75 { opacity: 0.75; }
.transition-shadow { transition: box-shadow 0.15s ease-in-out; }
.hover\:shadow-md:hover { box-shadow: var(--shadow-md); }
.min-w-150 { min-width: 150px; }

/* Color Utilities for Tailwind-style colors */
.text-red-600 { color: #dc2626; }
.text-green-600 { color: #16a34a; }
.text-blue-600 { color: #2563eb; }
.text-orange-600 { color: #ea580c; }
.text-purple-600 { color: #9333ea; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-red-50 { background-color: #fef2f2; }
.bg-yellow-50 { background-color: #fefce8; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-primary-50 { background-color: var(--brand-primary-50); }

/* Flexbox Utilities */
.flex-wrap { flex-wrap: wrap; }

/* Lists */
.list-disc { list-style-type: disc; }
.list-decimal { list-style-type: decimal; }
.list-inside { list-style-position: inside; }