:root {
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --secondary-color: #8b5cf6;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;
  --light-bg: #f8f9fa;
  --dark-text: #1f2937;
  --gray-text: #6b7280;
  --border-color: #e5e7eb;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--light-bg);
  color: var(--dark-text);
  line-height: 1.6;
}

/* Premium Card Styles */
.card {
  border: none;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
  background: white;
}

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

.card-header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-radius: 16px 16px 0 0 !important;
  padding: 1.5rem;
  border: none;
}

/* Buttons */
.btn {
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

.btn-danger {
  background: var(--danger-color);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.btn-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* Navigation */
.navbar {
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  padding: 1rem 0;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Product Cards (Mobile-First) */
.product-card {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1rem;
  background: white;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
}

.product-card:hover {
  box-shadow: var(--card-shadow-hover);
}

.product-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--light-bg);
}

.product-card-body {
  padding: 1.25rem;
}

.product-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark-text);
  margin-bottom: 0.5rem;
}

.product-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* Status Badges */
.badge {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
}

.badge-full {
  background: var(--success-color);
  color: white;
}

.badge-in-use {
  background: var(--warning-color);
  color: white;
}

.badge-spent {
  background: var(--danger-color);
  color: white;
}

.badge-half, .badge-third, .badge-quarter, .badge-fifth {
  background: var(--info-color);
  color: white;
}

/* Forms */
.form-control, .form-select {
  border-radius: 12px;
  border: 2px solid var(--border-color);
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.1);
}

.form-label {
  font-weight: 600;
  color: var(--dark-text);
  margin-bottom: 0.5rem;
}

/* Dashboard Stats */
.stat-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  text-align: center;
  transition: all 0.3s ease;
}

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

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  color: var(--gray-text);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
}

/* Scanner Overlay */
.scanner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: none;
}

.scanner-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

#scanner-video {
  width: 100%;
  max-width: 600px;
  border-radius: 16px;
}

.scanner-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: white;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* Loading Spinner */
.spinner {
  border: 4px solid rgba(99, 102, 241, 0.1);
  border-radius: 50%;
  border-top: 4px solid var(--primary-color);
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

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

/* Modal Enhancements */
.modal-content {
  border: none;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
  border-bottom: 2px solid var(--border-color);
  padding: 1.5rem;
}

.modal-body {
  padding: 1.5rem;
}

/* Language Selector */
.language-selector {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 24px;
  padding: 3rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  z-index: 10000;
}

.language-option {
  padding: 1.5rem;
  margin: 0.5rem 0;
  border-radius: 16px;
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  font-weight: 600;
}

.language-option:hover {
  border-color: var(--primary-color);
  background: rgba(99, 102, 241, 0.05);
  transform: translateY(-2px);
}

/* Responsive Tables - Convert to Cards on Mobile */
@media (max-width: 768px) {
  .table-responsive-cards {
    display: block;
  }
  
  .table-responsive-cards table {
    display: none;
  }
  
  .mobile-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--card-shadow);
  }
  
  .mobile-card-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
  }
  
  .mobile-card-row:last-child {
    border-bottom: none;
  }
  
  .mobile-card-label {
    font-weight: 600;
    color: var(--gray-text);
  }
  
  .mobile-card-value {
    color: var(--dark-text);
  }
}

/* Desktop Tables */
@media (min-width: 769px) {
  .mobile-cards-container {
    display: none;
  }
}

/* Utilities */
.gradient-text {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.rounded-lg {
  border-radius: 16px;
}

/* FAB Button (Floating Action Button) */
.fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1000;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5);
}

/* Charts */
.chart-container {
  position: relative;
  height: 300px;
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
}
