/* Modern Workshop Management UI - Inspired by Tailwind CSS */
/* Color Palette */
:root {
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;
  
  --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;
  
  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-600: #16a34a;
  --green-800: #166534;
  
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-600: #dc2626;
  --red-800: #991b1b;
  
  --yellow-50: #fefce8;
  --yellow-100: #fef3c7;
  --yellow-600: #d97706;
  --yellow-800: #92400e;
  
  --orange-50: #fff7ed;
  --orange-600: #ea580c;
  
  --purple-50: #faf5ff;
  --purple-600: #9333ea;
  
  --emerald-50: #ecfdf5;
  --emerald-600: #059669;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--gray-900);
  background-color: var(--gray-50);
  margin: 0;
  padding: 0;
}

/* Layout Components */
.min-h-screen {
  min-height: 100vh;
}

.bg-gray-50 {
  background-color: var(--gray-50);
}

.bg-white {
  background-color: white;
}

/* Header Styles */
.modern-header {
  background-color: white;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-container {
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .header-container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .header-container {
    padding: 0 2rem;
  }
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
}

/* Logo and Brand */
.brand-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand-logo {
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--primary-600);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo svg {
  height: 1.5rem;
  width: 1.5rem;
  color: white;
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
  line-height: 1.2;
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin: 0;
}

.brand-text-mobile h1 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

@media (min-width: 640px) {
  .brand-text {
    display: block;
  }
  .brand-text-mobile {
    display: none;
  }
}

@media (max-width: 639px) {
  .brand-text {
    display: none;
  }
  .brand-text-mobile {
    display: block;
  }
}

/* Navigation */
.desktop-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

@media (min-width: 1280px) {
  .desktop-nav {
    display: flex;
  }
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.nav-link:hover {
  text-decoration: none;
}

.nav-link.active {
  background-color: var(--primary-50);
  color: var(--primary-700);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.nav-link:not(.active) {
  color: var(--gray-600);
}

.nav-link:not(.active):hover {
  color: var(--gray-900);
  background-color: var(--gray-50);
}

.nav-link svg {
  height: 1rem;
  width: 1rem;
}

/* User Profile Dropdown */
.user-dropdown {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: none;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.user-profile-btn:hover {
  background-color: var(--gray-50);
}

.user-avatar {
  width: 2rem;
  height: 2rem;
  background-color: var(--primary-600);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
}

.user-name {
  color: var(--gray-700);
  display: none;
}

@media (min-width: 768px) {
  .user-name {
    display: block;
  }
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: block;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
}

@media (min-width: 1280px) {
  .mobile-menu-btn {
    display: none;
  }
}

.mobile-menu-btn svg {
  height: 1.5rem;
  width: 1.5rem;
}

/* Mobile Navigation */
.mobile-nav {
  position: fixed;
  top: 4rem;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: white;
  z-index: 40;
  overflow-y: auto;
  padding: 1.5rem 1rem;
}

@media (min-width: 1280px) {
  .mobile-nav {
    display: none;
  }
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  margin-bottom: 0.25rem;
}

.mobile-nav-item:hover {
  text-decoration: none;
}

.mobile-nav-item.active {
  background-color: var(--primary-50);
  color: var(--primary-700);
  border-left: 4px solid var(--primary-700);
}

.mobile-nav-item:not(.active) {
  color: var(--gray-600);
}

.mobile-nav-item:not(.active):hover {
  color: var(--gray-900);
  background-color: var(--gray-50);
}

.mobile-nav-item svg {
  height: 1.25rem;
  width: 1.25rem;
}

.mobile-nav-separator {
  border-top: 1px solid var(--gray-200);
  margin: 1rem 0;
}

/* Main Content */
.main-content {
  padding: 1rem;
  max-width: 80rem;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .main-content {
    padding: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .main-content {
    padding: 2rem;
  }
}

/* Card Components */
.card {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.card-header {
  padding: 1.5rem 1.5rem 0 1.5rem;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
}

.card-content {
  padding: 1.5rem;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat-card {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  padding: 1.5rem;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
}

.stat-icon {
  padding: 0.75rem;
  border-radius: 50%;
  margin-bottom: 1rem;
}

.stat-icon svg {
  height: 1.5rem;
  width: 1.5rem;
}

.stat-text {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-text h3 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.stat-text p {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
  margin: 0;
}

/* Color Variants */
.text-blue-600 { color: var(--primary-600); }
.bg-blue-50 { background-color: var(--primary-50); }
.text-green-600 { color: var(--green-600); }
.bg-green-50 { background-color: var(--green-50); }
.text-purple-600 { color: var(--purple-600); }
.bg-purple-50 { background-color: var(--purple-50); }
.text-orange-600 { color: var(--orange-600); }
.bg-orange-50 { background-color: var(--orange-50); }
.text-emerald-600 { color: var(--emerald-600); }
.bg-emerald-50 { background-color: var(--emerald-50); }
.text-red-600 { color: var(--red-600); }
.bg-red-50 { background-color: var(--red-50); }

/* Page Header */
.page-header {
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.page-subtitle {
  color: var(--gray-600);
  margin: 0.5rem 0 0 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:hover {
  text-decoration: none;
}

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

.btn-primary:hover {
  background-color: var(--primary-700);
  color: white;
}

.btn-outline {
  background-color: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
}

.btn-outline:hover {
  background-color: var(--gray-50);
  color: var(--gray-900);
}

.btn svg {
  height: 1rem;
  width: 1rem;
}

/* Table Styles */
.table-container {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.table th {
  background-color: var(--gray-50);
  font-weight: 600;
  color: var(--gray-900);
  font-size: 0.875rem;
}

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

/* Form Styles */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.25rem;
}

.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Responsive Grid */
.grid {
  display: grid;
  gap: 1.5rem;
}

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

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

/* Utility Classes */
.space-y-6 > * + * {
  margin-top: 1.5rem;
}

.space-y-4 > * + * {
  margin-top: 1rem;
}

.space-y-4-plus > * + * {
  margin-top: 1.125rem;
}

.space-y-3 > * + * {
  margin-top: 0.75rem;
}

.hidden {
  display: none;
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.p-3 {
  padding: 0.75rem;
}

.p-6 {
  padding: 1.5rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.text-sm {
  font-size: 0.875rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-2xl {
  font-size: 1.5rem;
}

.text-3xl {
  font-size: 1.875rem;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.text-gray-600 {
  color: var(--gray-600);
}

.text-gray-700 {
  color: var(--gray-700);
}

.text-gray-900 {
  color: var(--gray-900);
}

.border {
  border: 1px solid var(--gray-200);
}

.rounded-lg {
  border-radius: 0.5rem;
}

.hover\:bg-gray-50:hover {
  background-color: var(--gray-50);
}

.transition-colors {
  transition: background-color 0.2s, color 0.2s;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-green {
  background-color: var(--green-100);
  color: var(--green-800);
}

.badge-blue {
  background-color: var(--primary-100);
  color: var(--primary-800);
}

.badge-yellow {
  background-color: var(--yellow-100);
  color: var(--yellow-800);
}

.badge-red {
  background-color: var(--red-100);
  color: var(--red-800);
}

/* Additional badge classes for suppliers page */
.badge-success {
  background-color: var(--green-100);
  color: var(--green-800);
}

.badge-danger {
  background-color: var(--red-100);
  color: var(--red-800);
}

.badge-info {
  background-color: var(--primary-100);
  color: var(--primary-800);
}

.badge-secondary {
  background-color: var(--gray-100);
  color: var(--gray-800);
}

/* Statistics and layout improvements */
.content-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.page-title h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-900);
  margin: 0;
  line-height: 1.2;
}

.page-title p {
  font-size: 1rem;
  color: var(--gray-600);
  margin: 0.25rem 0 0 0;
  line-height: 1.4;
}

.page-icon {
  width: 3.5rem;
  height: 3.5rem;
  background-color: var(--primary-100);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-600);
  flex-shrink: 0;
}

.page-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: all 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.stat-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.primary {
  background-color: var(--primary-100);
  color: var(--primary-600);
}

.stat-icon.success {
  background-color: var(--green-100);
  color: var(--green-600);
}

.stat-icon.info {
  background-color: var(--primary-100);
  color: var(--primary-600);
}

.stat-icon.warning {
  background-color: var(--yellow-100);
  color: var(--yellow-600);
}

.stat-content {
  flex: 1;
  display: flex;
  flex-direction: column-reverse;
}

.stat-number {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.1;
  margin-top: 0.25rem;
}

.stat-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-600);
  line-height: 1.3;
  margin-bottom: 0;
}

/* Card styling */
.card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  background-color: var(--gray-50);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
}

.card-content {
  padding: 0;
}

/* Table improvements */
.table-responsive {
  overflow-x: auto;
  border-radius: 0;
  border: none;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  background: white;
  min-width: 780px;
}

.table th:nth-child(1) { min-width: 140px; } /* Supplier name */
.table th:nth-child(2) { min-width: 110px; } /* Phone */
.table th:nth-child(3) { min-width: 160px; } /* Email */
.table th:nth-child(4) { min-width: 110px; } /* Balance */
.table th:nth-child(5) { min-width: 80px; } /* Items count */
.table th:nth-child(6) { min-width: 120px; } /* Total value */
.table th:nth-child(7) { min-width: 160px; } /* Actions */

.table th {
  background-color: var(--gray-50);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
  font-size: 0.875rem;
}

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

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

/* Customer Link Styling */
.customer-link {
  color: var(--primary-600);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
}

.customer-link:hover {
  color: var(--primary-700);
  background-color: var(--primary-50);
  text-decoration: none;
  transform: translateY(-1px);
}

.customer-link:focus {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

.table-cell-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Alert improvements */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid transparent;
}

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

.alert-danger {
  background-color: var(--red-50);
  color: var(--red-800);
  border-color: var(--red-200);
}

.alert svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--gray-500);
}

.empty-icon {
  margin-bottom: 1rem;
  color: var(--gray-400);
}

.empty-state h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.empty-state p {
  margin-bottom: 1.5rem;
}

/* Button improvements */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.btn-primary:hover {
  background-color: var(--primary-700);
  border-color: var(--primary-700);
  color: white;
}

.btn-outline {
  background-color: white;
  color: var(--gray-700);
  border-color: var(--gray-300);
}

.btn-outline:hover {
  background-color: var(--gray-50);
  color: var(--gray-900);
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  min-width: auto;
}

.btn-success {
  background-color: var(--green-600);
  color: white;
  border-color: var(--green-600);
}

.btn-success:hover {
  background-color: var(--green-700);
  color: white;
}

.btn-info {
  background-color: var(--primary-600);
  color: white;
  border-color: var(--primary-600);
}

.btn-info:hover {
  background-color: var(--primary-700);
  color: white;
}

.btn-danger {
  background-color: var(--red-600);
  color: white;
  border-color: var(--red-600);
}

.btn-danger:hover {
  background-color: var(--red-700);
  color: white;
}

/* Action buttons in table */
.action-buttons {
  display: flex;
  gap: 0.375rem;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.action-buttons .btn-sm {
  padding: 0.25rem 0.5rem;
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-buttons .btn-sm .icon {
  width: 14px;
  height: 14px;
}

/* Responsive improvements */
@media (max-width: 768px) {
  .content-wrapper {
    padding: 1rem;
  }
  
  .page-header {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 2rem;
  }
  
  .page-title h1 {
    font-size: 1.75rem;
  }
  
  .page-title p {
    font-size: 0.9rem;
  }
  
  .page-actions {
    justify-content: stretch;
    gap: 0.75rem;
  }
  
  .page-actions .btn {
    flex: 1;
    justify-content: center;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
  }
  
  .stat-card {
    padding: 1.5rem;
    gap: 1rem;
  }
  
  .stat-icon {
    width: 3rem;
    height: 3rem;
  }
  
  .stat-number {
    font-size: 1.75rem;
  }
  
  .stat-label {
    font-size: 0.85rem;
  }
  
  .card-header {
    padding: 1rem;
  }
  
  .table th,
  .table td {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }
  
  .action-buttons {
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  
  .action-buttons .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 640px) {
  .stats-grid {
    /* minmax(0, ...) rather than a bare 1fr: 1fr floors each track at its
     * content's min-content width (~172px here), which two-up exceeds the
     * available 328px on a 360px phone and pushed the whole page sideways. */
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .stat-card {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem;
  }
  
  .stat-icon {
    margin-bottom: 0.5rem;
  }
}

/* Mobile Table Improvements */
@media (max-width: 768px) {
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  }
  
  .table {
    min-width: 800px; /* Ensure table has minimum width */
  }
  
  .table th,
  .table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
  }
  
  /* Make customer names more prominent on mobile */
  .customer-link {
    font-weight: 600;
    color: var(--primary-700);
    background-color: var(--primary-50);
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--primary-200);
  }
  
  .customer-link:hover {
    background-color: var(--primary-100);
    border-color: var(--primary-300);
  }
  
  /* Hide some columns on very small screens */
  .table th:nth-child(4), /* VIN column */
  .table td:nth-child(4) {
    display: none;
  }
  
  /* Adjust action buttons for mobile */
  .action-buttons {
    gap: 0.25rem;
  }
  
  .btn-action {
    width: 2rem;
    height: 2rem;
    padding: 0.25rem;
  }
  
  .btn-action .icon {
    width: 1rem;
    height: 1rem;
  }
}

@media (max-width: 480px) {
  /* Hide more columns on very small screens */
  .table th:nth-child(3), /* Car column */
  .table td:nth-child(3),
  .table th:nth-child(5), /* Tasks column */
  .table td:nth-child(5) {
    display: none;
  }
  
  .table th,
  .table td {
    padding: 0.5rem 0.25rem;
    font-size: 0.8rem;
  }
  
  /* Make customer link even more prominent */
  .customer-link {
    display: block;
    text-align: center;
    font-weight: 700;
    padding: 0.5rem 1rem;
  }
  
  /* Mobile pagination improvements */
  .pagination {
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  
  .page-item {
    margin: 0.125rem;
  }
  
  .page-link {
    padding: 0.375rem 0.625rem;
    font-size: 0.875rem;
    min-width: 2.5rem;
    text-align: center;
  }
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-edit {
  background-color: var(--primary-50);
  color: var(--primary-600);
}

.btn-edit:hover {
  background-color: var(--primary-100);
  color: var(--primary-700);
}

.btn-delete {
  background-color: var(--red-50);
  color: var(--red-600);
}

.btn-delete:hover {
  background-color: var(--red-100);
  color: var(--red-700);
}

.btn-photos {
  background-color: var(--green-50);
  color: var(--green-600);
}

.btn-photos:hover {
  background-color: var(--green-100);
  color: var(--green-700);
}

/* Icons */
.icon {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.icon-lg {
  width: 1.25rem;
  height: 1.25rem;
}

.icon-xl {
  width: 1.5rem;
  height: 1.5rem;
}

/* Quick Actions */
.quick-action {
  display: block;
  width: 100%;
  padding: 1.25rem;
  text-decoration: none;
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.quick-action:hover {
  background-color: var(--gray-50);
  border-color: var(--primary-300);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15);
  text-decoration: none;
}

.quick-action:last-child {
  margin-bottom: 0;
}

.quick-action-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.quick-action-content svg {
  height: 1.5rem;
  width: 1.5rem;
  flex-shrink: 0;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background-color: var(--gray-100);
}

.quick-action span {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gray-700);
  transition: color 0.2s;
}

.quick-action:hover span {
  color: var(--gray-900);
}

/* Quick Action Icon Colors */
.quick-action .text-blue-600 {
  background-color: var(--primary-50);
  color: var(--primary-600);
}

.quick-action .text-green-600 {
  background-color: var(--green-50);
  color: var(--green-600);
}

.quick-action .text-orange-600 {
  background-color: var(--orange-50);
  color: var(--orange-600);
}

.quick-action .text-purple-600 {
  background-color: var(--purple-50);
  color: var(--purple-600);
}

/* Recent Jobs List */
.job-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.job-item:hover {
  background-color: var(--gray-50);
  border-color: var(--primary-300);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15);
}

.job-item:last-child {
  margin-bottom: 0;
}

.job-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.job-icon {
  padding: 0.5rem;
  border-radius: 0.5rem;
  background-color: var(--primary-50);
  color: var(--primary-600);
  flex-shrink: 0;
}

.job-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.job-details h4 {
  font-weight: 600;
  margin: 0;
  font-size: 0.95rem;
  color: var(--gray-900);
  transition: color 0.2s;
}

.job-details p {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin: 0.25rem 0 0 0;
  transition: color 0.2s;
}

.job-item:hover .job-details h4 {
  color: var(--gray-900);
}

.job-item:hover .job-details p {
  color: var(--gray-700);
}

.job-status {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.job-amount {
  font-weight: 600;
  margin: 0;
  font-size: 0.95rem;
  color: var(--gray-900);
}

.job-status .badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
}

/* Responsive Utilities */
@media (max-width: 639px) {
  .sm\:hidden {
    display: none;
  }
}

@media (min-width: 640px) {
  .sm\:block {
    display: block;
  }
  .sm\:px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  .sm\:py-6 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }
}

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

@media (min-width: 1024px) {
  .lg\:px-8 {
    padding-left: 2rem;
    padding-right: 2rem;
  }
  .lg\:py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .xl\:flex {
    display: flex;
  }
  .xl\:hidden {
    display: none;
  }
}

/* Pagination Improvements */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem 0;
}

.page-item {
  display: inline-block;
}

.page-link {
  display: block;
  padding: 0.5rem 0.75rem;
  margin: 0 0.125rem;
  color: var(--primary-600);
  text-decoration: none;
  border: 1px solid var(--gray-300);
  border-radius: 0.375rem;
  transition: all 0.2s;
  background-color: white;
}

.page-link:hover {
  background-color: var(--primary-50);
  border-color: var(--primary-400);
  color: var(--primary-700);
  text-decoration: none;
}

.page-item.active .page-link {
  background-color: var(--primary-600);
  border-color: var(--primary-600);
  color: white;
}

.page-item.active .page-link:hover {
  background-color: var(--primary-700);
  border-color: var(--primary-700);
  color: white;
}

@media (max-width: 640px) {
  .pagination {
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0 1rem;
  }
  
  .page-item {
    margin: 0.125rem;
  }
  
  .page-link {
    padding: 0.375rem 0.625rem;
    font-size: 0.875rem;
    min-width: 2.5rem;
    text-align: center;
    margin: 0;
  }
}

/* =====================================================================
 * Accessibility: keyboard focus indicator
 * =====================================================================
 * We expose a visible ring only when focus is coming from the keyboard,
 * so mouse users never see the outline. Applies to buttons, links, inputs,
 * and anything explicitly marked tabindex-able.
 */
:focus { outline: none; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
  border-radius: 6px;
}

.btn-close:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

/* =====================================================================
 * Button loading state (used by js/ui-helpers.js + [data-loading-submit])
 * ===================================================================== */
.btn.is-loading,
button.is-loading,
.btn-action.is-loading {
  pointer-events: none;
  position: relative;
}

.ui-spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -0.125em;
  animation: ui-spinner-rotate 0.75s linear infinite;
}

@keyframes ui-spinner-rotate {
  to { transform: rotate(360deg); }
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =====================================================================
 * Floating action button (schedule.php)
 * =====================================================================
 * The waiting-room entry cards that used to live here moved to
 * css/pages/waiting_room.css when that page was migrated to the design system.
 * ===================================================================== */
.fab {
  position: fixed;
  bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  right: calc(30px + env(safe-area-inset-right, 0px));
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  cursor: pointer;
  border: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 100;
}
.fab:hover,
.fab:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.6);
}

/* =====================================================================
 * Login page (formerly inlined in login.php)
 * ===================================================================== */
.login-page {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.login-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  width: 100%;
  max-width: 450px;
  transition: transform 0.3s ease;
}
.login-card:hover { transform: translateY(-5px); }
.login-header {
  background: linear-gradient(135deg, var(--primary-600) 0%, #0a58ca 100%);
  padding: 2rem;
  text-align: center;
  color: #fff;
}
.login-header img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 1rem;
  transition: transform 0.3s ease;
}
.login-header img:hover { transform: scale(1.05); }
.login-header h2 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 600;
}
.login-body { padding: 2rem; }
.login-page .form-label {
  font-weight: 500;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}
.login-page .form-control {
  border-radius: 10px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-300);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.login-page .form-control:focus {
  border-color: var(--primary-600);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}
.btn-login {
  background: linear-gradient(135deg, var(--primary-600) 0%, #0a58ca 100%);
  border: none;
  border-radius: 10px;
  padding: 0.75rem;
  font-weight: 500;
  width: 100%;
  margin-top: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3);
}
.login-page .alert {
  border-radius: 10px;
  border: none;
  padding: 1rem;
  margin-bottom: 1.5rem;
}
.login-page .alert-danger {
  background-color: var(--red-100);
  color: var(--red-600);
}
.language-selector {
  margin-top: 1.5rem;
  text-align: center;
}
.btn-language {
  color: var(--primary-600);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.btn-language:hover {
  background-color: rgba(13, 110, 253, 0.1);
  color: var(--primary-600);
}
.btn-language.active {
  background-color: var(--primary-600);
  color: #fff;
}
.login-page .input-group {
  position: relative;
}
.login-page .input-group i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
}
.login-page .input-group .form-control {
  padding-left: 2.5rem;
}
@media (max-width: 576px) {
  .login-container { padding: 1rem; }
  .login-card      { border-radius: 15px; }
  .login-header    { padding: 1.5rem; }
  .login-body      { padding: 1.5rem; }
}

/* =====================================================================
 * Reduced-motion: kill non-essential animation/transitions/transforms
 * ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .login-card:hover,
  .fab:hover,
  .ui-fab:hover,
  .btn-login:hover,
  .login-header img:hover {
    transform: none;
  }
}

/* =====================================================================
 * Print
 * =====================================================================
 * Strip chrome (nav, FAB, action bars) and show records on a white page.
 */
@media print {
  html, body {
    background: #fff !important;
    color: #000 !important;
  }
  .modern-header,
  .ui-nav,
  .mobile-menu-btn,
  .offcanvas,
  .fab,
  .ui-fab,
  .ui-toast-stack,
  .action-buttons,
  .btn-action,
  .ui-rowactions,
  .dropdown,
  .user-dropdown,
  nav,
  footer {
    display: none !important;
  }
  .main-content {
    padding: 0 !important;
    margin: 0 !important;
  }
  a[href]::after { content: ""; } /* Suppress default print URL append */
  .card,
  .ui-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .page-header { margin-bottom: 0.5rem; }
  .page-title  { font-size: 1.25rem; }
  table { border-collapse: collapse; }
  table, th, td {
    border: 1px solid #999 !important;
  }
  th, td { padding: 4px 6px !important; }
}

/* ---------------------------------------------------------------------------
   htmx: loading indicators
   htmx toggles .htmx-request on the element named by hx-indicator, and on the
   element that triggered the request.
   --------------------------------------------------------------------------- */
.htmx-indicator {
    opacity: 0;
    transition: opacity 150ms ease-in;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
}

/* Fade content that is being replaced so swaps read as intentional. */
.htmx-swapping {
    opacity: 0.5;
    transition: opacity 100ms ease-out;
}

/* ---------------------------------------------------------------------------
   Cross-document view transitions
   Chromium cross-fades between page loads; other browsers ignore this.
   --------------------------------------------------------------------------- */
@view-transition {
    navigation: auto;
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none !important;
    }
}
