/*
================================================
Design System Moderne - SCRUM-53
================================================
Système de design inspiré des interfaces modernes
avec focus sur l'expérience utilisateur et l'accessibilité
*/

/* ================================================
   VARIABLES CSS - DESIGN TOKENS
================================================ */
:root {
  /* Couleurs primaires - Palette moderne */
  --primary-50: #f0f4ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #6366f1;  /* Couleur principale */
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --primary-900: #312e81;

  /* Couleurs secondaires - Neutre */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Couleurs fonctionnelles */
  --success-50: #ecfdf5;
  --success-500: #10b981;
  --success-600: #059669;
  
  --warning-50: #fffbeb;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  
  --error-50: #fef2f2;
  --error-500: #ef4444;
  --error-600: #dc2626;

  /* Typographie */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Monaco, Consolas, monospace;

  /* Tailles de police */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */

  /* Espacement - Échelle harmonique */
  --space-1: 0.25rem;      /* 4px */
  --space-2: 0.5rem;       /* 8px */
  --space-3: 0.75rem;      /* 12px */
  --space-4: 1rem;         /* 16px */
  --space-5: 1.25rem;      /* 20px */
  --space-6: 1.5rem;       /* 24px */
  --space-8: 2rem;         /* 32px */
  --space-10: 2.5rem;      /* 40px */
  --space-12: 3rem;        /* 48px */
  --space-16: 4rem;        /* 64px */

  /* Border radius */
  --radius-sm: 0.375rem;   /* 6px */
  --radius-md: 0.5rem;     /* 8px */
  --radius-lg: 0.75rem;    /* 12px */
  --radius-xl: 1rem;       /* 16px */
  --radius-2xl: 1.5rem;    /* 24px */

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;

  /* Layout */
  --header-height: 4rem;
  --sidebar-width: 16rem;
  --container-padding: var(--space-6);
}

/* ================================================
   RESET ET BASE
================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--gray-900);
  background-color: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ================================================
   NAVIGATION MODERNE
================================================ */

/* Navigation principale - classe .modern-nav utilisée par dashboard.html */
.modern-nav {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  transition: var(--transition-fast);
  padding: 0;
}

.modern-nav > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 var(--space-4);
}

.modern-nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 700;
  font-size: var(--text-lg);
  color: white;
}

.modern-nav-brand .brand-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
}

.modern-nav-brand .brand-icon i {
  font-size: var(--text-xl);
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modern-nav-brand .brand-text {
  font-weight: 700;
  font-size: var(--text-lg);
}

.modern-nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--space-2);
}

.modern-nav-menu .nav-item {
  margin: 0;
}

.modern-nav-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

/* SCRUM-59: Removed duplicate .modern-navbar class (not used in any template) */

.modern-nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 500;
  padding: var(--space-2) var(--space-4) !important;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  position: relative;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.modern-nav-link:hover {
  color: white !important;
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

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

.modern-nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--warning-500);
  border-radius: 2px;
}

/* User menu moderne */
.user-menu {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-4);
  backdrop-filter: blur(10px);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: var(--text-sm);
}

/* ================================================
   MÉTRIQUES COMPACTES
================================================ */
.metric-card-compact {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  color: white;
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: var(--transition-fast);
  border: none;
  margin-bottom: var(--space-4);
}

.metric-card-compact:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.metric-card-compact.green {
  background: linear-gradient(135deg, var(--success-500) 0%, var(--success-600) 100%);
}

.metric-card-compact.red {
  background: linear-gradient(135deg, var(--error-500) 0%, var(--error-600) 100%);
}

.metric-card-compact.yellow {
  background: linear-gradient(135deg, var(--warning-500) 0%, var(--warning-600) 100%);
}

.metric-card-compact.purple {
  background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}

.metric-value-compact {
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1;
  margin-bottom: var(--space-2);
}

.metric-label-compact {
  font-size: var(--text-sm);
  opacity: 0.9;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.metric-label-compact i {
  font-size: var(--text-base);
}

/* ================================================
   CARDS MODERNES
================================================ */
.modern-card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: var(--transition-normal);
}

.modern-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.modern-card-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--gray-200);
  background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
}

.modern-card-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.modern-card-title i {
  color: var(--primary-500);
}

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

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

/* ================================================
   BOUTONS MODERNES
================================================ */
.btn-modern {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: var(--transition-slow);
}

.btn-modern:hover::before {
  left: 100%;
}

.btn-modern-primary {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-modern-primary:hover {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  color: white;
}

.btn-modern-secondary {
  background: white;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  box-shadow: var(--shadow-sm);
}

.btn-modern-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
  transform: translateY(-1px);
  color: var(--gray-800);
}

.btn-modern-success {
  background: linear-gradient(135deg, var(--success-500) 0%, var(--success-600) 100%);
  color: white;
}

.btn-modern-warning {
  background: linear-gradient(135deg, var(--warning-500) 0%, var(--warning-600) 100%);
  color: white;
}

.btn-modern-danger {
  background: linear-gradient(135deg, var(--error-500) 0%, var(--error-600) 100%);
  color: white;
}

.btn-modern-sm {
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-4);
}

.btn-modern-lg {
  font-size: var(--text-lg);
  padding: var(--space-4) var(--space-8);
}

/* ================================================
   FORMULAIRES MODERNES
================================================ */
.modern-form-group {
  margin-bottom: var(--space-6);
}

.modern-form-label {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--gray-700);
  margin-bottom: var(--space-2);
  display: block;
}

.modern-form-control {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-lg);
  background: white;
  transition: var(--transition-fast);
  outline: none;
}

.modern-form-control:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.modern-form-control::placeholder {
  color: var(--gray-400);
}

/* ================================================
   BADGES ET INDICATEURS
================================================ */
.modern-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-md);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: var(--success-50);
  color: var(--success-600);
  border: 1px solid var(--success-500);
}

.badge-warning {
  background: var(--warning-50);
  color: var(--warning-600);
  border: 1px solid var(--warning-500);
}

.badge-error {
  background: var(--error-50);
  color: var(--error-600);
  border: 1px solid var(--error-500);
}

.badge-primary {
  background: var(--primary-50);
  color: var(--primary-600);
  border: 1px solid var(--primary-500);
}

/* ================================================
   ALERTES MODERNES
================================================ */
.modern-alert {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-lg);
  border: 1px solid;
  background: white;
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-4);
}

.alert-success {
  background: linear-gradient(135deg, var(--success-50) 0%, white 100%);
  border-color: var(--success-500);
  color: var(--success-600);
}

.alert-warning {
  background: linear-gradient(135deg, var(--warning-50) 0%, white 100%);
  border-color: var(--warning-500);
  color: var(--warning-600);
}

.alert-error {
  background: linear-gradient(135deg, var(--error-50) 0%, white 100%);
  border-color: var(--error-500);
  color: var(--error-600);
}

/* ================================================
   TABLES MODERNES
================================================ */
.modern-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.modern-table thead {
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
}

.modern-table th {
  padding: var(--space-4) var(--space-6);
  text-align: left;
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--gray-200);
}

.modern-table td {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--gray-200);
  vertical-align: top;
}

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

.modern-table tbody tr:last-child td {
  border-bottom: none;
}

/* ================================================
   LAYOUT ET CONTAINERS
================================================ */
.modern-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.modern-section {
  padding: var(--space-12) 0;
}

.modern-section-sm {
  padding: var(--space-8) 0;
}

.modern-section-lg {
  padding: var(--space-16) 0;
}

/* ================================================
   UTILITAIRES MODERNES
================================================ */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-effect {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.fade-in {
  animation: fadeIn var(--transition-slow) ease-out;
}

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

.slide-up {
  animation: slideUp var(--transition-slow) ease-out;
}

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

/* ================================================
   RESPONSIVE DESIGN - SCRUM-59 MODERNIZED
   Mobile-first approach with 5 breakpoints
================================================ */

/* Breakpoint Variables for consistency */
:root {
  --breakpoint-sm: 576px;   /* Small devices (phones) */
  --breakpoint-md: 768px;   /* Medium devices (tablets) */
  --breakpoint-lg: 992px;   /* Large devices (desktops) */
  --breakpoint-xl: 1200px;  /* Extra large devices */
  --breakpoint-xxl: 1400px; /* Ultra wide screens */
}

/* Small devices (phones, 576px and below) */
@media (max-width: 575.98px) {
  :root {
    --container-padding: var(--space-3);
    --header-height: 3rem;
  }

  body {
    font-size: 14px;
  }

  .container-fluid {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .nav-simple nav {
    flex-direction: column;
    gap: 0.5rem;
  }

  .nav-simple .nav-link {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
  }

  .metric-card-compact {
    padding: 1rem;
  }

  .metric-value-compact {
    font-size: 1.5rem;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .product-card {
    padding: 1rem;
  }

  .chart-container {
    height: 200px;
  }

  .btn-modern {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    width: 100%;
  }

  .modern-card-header,
  .modern-card-body {
    padding: var(--space-3);
  }
}

/* Medium devices (tablets, 576px to 768px) */
@media (min-width: 576px) and (max-width: 767.98px) {
  :root {
    --container-padding: var(--space-4);
    --header-height: 3.5rem;
  }

  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .chart-container {
    height: 250px;
  }

  .modern-card-header,
  .modern-card-body {
    padding: var(--space-4);
  }

  .modern-table th,
  .modern-table td {
    padding: var(--space-3) var(--space-4);
  }

  .btn-modern {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-xs);
  }
}

/* Large devices (desktops, 768px to 992px) */
@media (min-width: 768px) and (max-width: 991.98px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .chart-container {
    height: 280px;
  }
}

/* Extra large devices (large desktops, 992px to 1200px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .catalog-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .chart-container {
    height: 300px;
  }
}

/* Ultra wide screens (1200px and above) */
@media (min-width: 1200px) {
  .container-fluid {
    max-width: 1400px;
  }

  .catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }

  .chart-container {
    height: 350px;
  }
}

/* Print styles */
@media print {
  .nav-simple,
  .btn-modern,
  .modern-nav {
    display: none !important;
  }

  .modern-card {
    box-shadow: none;
    border: 1px solid #000;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }
}

/* ================================================
   PAGE-SPECIFIC STYLES - SCRUM-59 CENTRALIZED
   Extracted from inline <style> tags in templates
================================================ */

/* Navigation Simple - Dashboard/Analytics */
.nav-simple {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 0;
  margin-bottom: 2rem;
}

.nav-simple nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.nav-simple .nav-link {
  color: var(--gray-500);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-simple .nav-link:hover,
.nav-simple .nav-link.active {
  color: var(--gray-900);
  background: var(--gray-100);
}

/* Metric Cards - Dashboard */
.metric-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
  padding: 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.metric-card.green {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.metric-card.red {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.metric-card-compact {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1rem;
  transition: box-shadow 0.2s ease;
}

.metric-card-compact:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.metric-value-compact {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--gray-900);
}

.metric-label-compact {
  font-size: 0.875rem;
  color: var(--gray-500);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.metric-card-compact.green .metric-value-compact {
  color: var(--success-600);
}

.metric-card-compact.red .metric-value-compact {
  color: var(--error-600);
}

.metric-card-compact.purple .metric-value-compact {
  color: #7c3aed;
}

.metric-value {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.metric-label {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Price Change Indicators */
.price-change-table {
  font-size: 0.9rem;
}

.price-increase {
  color: var(--error-500);
}

.price-decrease {
  color: var(--success-500);
}

/* Chart Container */
.chart-container {
  margin: 0.5rem 0;
  padding: 0.75rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-sm);
  height: 300px;
}

/* Login Page Styles */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--gray-100) 100%);
}

.login-card {
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.login-header p {
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* Catalog Page Styles */
.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.catalog-filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Product Card */
.product-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.2s ease;
}

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

.product-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.product-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--gray-900);
  margin: 0;
}

.product-code {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-family: monospace;
}

.product-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-100);
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* Transaction Table Styles */
.transaction-row {
  transition: background-color 0.15s ease;
}

.transaction-row:hover {
  background-color: var(--gray-50);
}

.transaction-status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.transaction-status.qualified {
  background: var(--success-50);
  color: var(--success-600);
}

.transaction-status.pending {
  background: var(--warning-50);
  color: var(--warning-600);
}

.transaction-status.error {
  background: var(--error-50);
  color: var(--error-600);
}

/* ================================================
   DARK MODE SUPPORT
   SCRUM-59: Complete dark mode for all components
================================================ */
@media (prefers-color-scheme: dark) {
  /* Override CSS variables for dark mode */
  :root {
    --gray-50: #1f2937;
    --gray-100: #374151;
    --gray-200: #4b5563;
    --gray-300: #6b7280;
    --gray-400: #9ca3af;
    --gray-500: #d1d5db;
    --gray-600: #e5e7eb;
    --gray-700: #f3f4f6;
    --gray-800: #f9fafb;
    --gray-900: #ffffff;

    /* Functional colors - softer for dark mode */
    --success-50: #064e3b;
    --warning-50: #78350f;
    --error-50: #7f1d1d;
  }

  /* Base styles */
  body {
    background-color: #111827;
    color: #f3f4f6;
  }

  /* Cards and containers */
  .modern-card,
  .metric-card,
  .metric-card-compact,
  .product-card,
  .login-card,
  .stat-card,
  .chart-section,
  .quick-actions,
  .recent-activity,
  .system-info {
    background: #1f2937;
    border-color: #374151;
    color: #f3f4f6;
  }

  /* Navigation */
  .nav-simple {
    background: #1f2937;
    border-color: #374151;
  }

  .nav-simple .nav-link {
    color: #9ca3af;
  }

  .nav-simple .nav-link:hover,
  .nav-simple .nav-link.active {
    background: #374151;
    color: #f3f4f6;
  }

  /* Dashboard specific */
  .dashboard-container,
  .dashboard-header {
    color: #f3f4f6;
  }

  .dashboard-title,
  .page-title {
    color: #f9fafb;
  }

  .dashboard-subtitle,
  .page-subtitle {
    color: #9ca3af;
  }

  .metric-value,
  .stat-number {
    color: #f9fafb;
  }

  .metric-label,
  .stat-label {
    color: #9ca3af;
  }

  .chart-title {
    color: #f3f4f6;
  }

  .chart-container {
    background: #1f2937;
    border-color: #374151;
  }

  /* Catalog specific */
  .catalog-grid {
    background: #111827;
  }

  .product-card:hover {
    border-color: #4b5563;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  }

  .product-card-header {
    background: #374151;
    border-color: #4b5563;
  }

  /* Activity items */
  .activity-header {
    background: #374151;
    border-color: #4b5563;
  }

  .activity-item {
    border-color: #374151;
  }

  .activity-item:hover {
    background: #374151;
  }

  .activity-title {
    color: #f3f4f6;
  }

  .activity-time {
    color: #9ca3af;
  }

  /* Action buttons */
  .action-button {
    background: #374151;
    color: #f3f4f6;
    border-color: #4b5563;
  }

  .action-button:hover {
    background: #4b5563;
    border-color: #6b7280;
    color: #f9fafb;
  }

  .action-button i {
    color: #818cf8;
  }

  /* Forms */
  .modern-form-control,
  .form-control,
  .form-select {
    background: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
  }

  .modern-form-control:focus,
  .form-control:focus,
  .form-select:focus {
    background: #374151;
    border-color: #6366f1;
    color: #f3f4f6;
  }

  /* Login card specific */
  .login-card {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  }

  /* Transaction status - maintain colored backgrounds */
  .transaction-status {
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Tables */
  .table {
    color: #f3f4f6;
  }

  .table thead th {
    background: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
  }

  .table tbody td {
    border-color: #374151;
  }

  .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(55, 65, 81, 0.5);
  }

  .table-hover tbody tr:hover {
    background-color: #374151;
  }

  /* Badges - maintain visibility */
  .badge {
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .badge-success {
    background: #065f46;
    color: #a7f3d0;
  }

  .badge-primary {
    background: #3730a3;
    color: #c7d2fe;
  }

  /* Debug log (scanner_debug.html) */
  .debug-log {
    background: #374151;
    color: #f3f4f6;
    border: 1px solid #4b5563;
  }

  /* Buttons - Bootstrap overrides */
  .btn-outline-secondary {
    color: #d1d5db;
    border-color: #4b5563;
  }

  .btn-outline-secondary:hover {
    background: #374151;
    color: #f3f4f6;
    border-color: #6b7280;
  }

  .btn-dark {
    background: #f3f4f6;
    color: #111827;
    border-color: #f3f4f6;
  }

  /* Info items */
  .info-label {
    color: #9ca3af;
  }

  /* Modal dialogs */
  .modal-content {
    background: #1f2937;
    border-color: #374151;
    color: #f3f4f6;
  }

  .modal-header,
  .modal-footer {
    border-color: #374151;
  }

  /* Dropdowns */
  .dropdown-menu {
    background: #1f2937;
    border-color: #374151;
  }

  .dropdown-item {
    color: #f3f4f6;
  }

  .dropdown-item:hover {
    background: #374151;
    color: #f9fafb;
  }

  /* Alerts */
  .alert {
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Scrollbars for dark mode */
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  ::-webkit-scrollbar-track {
    background: #1f2937;
  }

  ::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
  }
}