/* Firebase Inventory App - Styles */

/* ===== LOGIN SCREEN ===== */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  padding: 1rem;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

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

.login-logo {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.login-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.login-header p {
  color: rgba(255,255,255,0.7);
  font-size: 1rem;
}

.login-form {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

.login-form h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: #1a1a2e;
}

.login-form .form-group {
  margin-bottom: 1.25rem;
}

.login-form .form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #374151;
}

.login-form .form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.2s;
}

.login-form .form-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-form .btn-block {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  margin-top: 0.5rem;
}

.login-links {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.login-links a {
  color: #2563eb;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}

.login-links a:hover {
  text-decoration: underline;
}

.login-footer {
  text-align: center;
  margin-top: 2rem;
  color: rgba(255,255,255,0.6);
  font-size: 0.875rem;
}

/* User Profile in Menu */
.user-profile-card {
  text-align: center;
  padding: 1.5rem;
}

.user-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: white;
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.user-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

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

.user-stat-value {
  display: block;
  font-weight: 600;
  color: var(--gray-900);
}

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

/* Hidden class */
.hidden {
  display: none !important;
}

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --purple: #8b5cf6;
  --purple-light: #ede9fe;
  --orange: #f97316;
  --orange-light: #ffedd5;
  --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;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-100);
  color: var(--gray-900);
  line-height: 1.5;
}

/* Layout */
.app-container { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-800) 100%);
  color: white;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: width 0.3s ease;
}

/* Sidebar Header with toggle */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.sidebar-toggle {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 1.2rem;
  font-weight: bold;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

.toggle-icon {
  transition: transform 0.3s ease;
}

/* Collapsed sidebar state */
.sidebar.collapsed {
  width: 64px;
  padding: 0.75rem 0.5rem;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
}

.sidebar.collapsed .sidebar-logo {
  display: none;
}

.sidebar.collapsed .toggle-icon {
  transform: rotate(180deg);
}

.sidebar.collapsed .nav-section-title {
  display: none;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 0.625rem;
}

.sidebar.collapsed .nav-item span:first-child {
  margin: 0;
}

/* Hide text in collapsed sidebar - target everything after the icon */
.sidebar.collapsed .nav-item {
  font-size: 0;
}

.sidebar.collapsed .nav-item span:first-child {
  font-size: 1.1rem;
}

.sidebar.collapsed .badge {
  display: none !important;
}

/* Adjust main content when sidebar is collapsed */
.main-content.sidebar-collapsed {
  margin-left: 64px;
}

.sidebar-logo {
  font-size: 1.5rem;
  font-weight: 700;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-section { margin-bottom: 1.5rem; }

.nav-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--gray-500);
  padding: 0.5rem 1rem;
  letter-spacing: 0.05em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--gray-300);
  text-decoration: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.9rem;
}

.nav-item:hover { background: rgba(255,255,255,0.1); color: white; }
.nav-item.active { background: var(--primary); color: white; }

.nav-item .badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 1.5rem 2rem;
  min-height: 100vh;
}

/* Mobile Responsive - Sidebar */
@media (max-width: 768px) {
  .sidebar {
    position: fixed !important;
    left: -290px !important;
    width: 280px !important;
    height: 100vh !important;
    transition: left 0.3s ease !important;
    z-index: 10000 !important;
    top: 0 !important;
    background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-800) 100%) !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    margin-left: 0 !important;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; /* room to scroll last items above bottom nav */
  }
  
  .sidebar.open {
    left: 0 !important;
    box-shadow: 5px 0 30px rgba(0,0,0,0.5) !important;
  }
  
  .sidebar-overlay {
    display: none !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,0.7) !important;
    z-index: 9999 !important;
    backdrop-filter: blur(2px);
  }
  
  .sidebar-overlay.show {
    display: block !important;
  }
  
  .main-content {
    margin-left: 0;
    padding: 0;
    padding-bottom: 80px; /* Space for bottom nav */
  }
  
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 50;
    margin: -1rem -1rem 1rem -1rem;
  }
  
  .mobile-header h1 {
    font-size: 1.1rem;
    margin: 0;
  }
  
  .menu-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius);
    font-size: 1.2rem;
    cursor: pointer;
  }
  
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--gray-200);
    z-index: 100;
    padding: 0.5rem;
    justify-content: space-around;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  }
  
  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.7rem;
    border-radius: var(--radius);
    min-width: 60px;
  }
  
  .mobile-nav-item span:first-child {
    font-size: 1.3rem;
    margin-bottom: 2px;
  }
  
  .mobile-nav-item.active {
    color: var(--primary);
    background: var(--primary-light);
  }
}

@media (min-width: 769px) {
  .mobile-header,
  .mobile-nav,
  .sidebar-overlay {
    display: none !important;
  }
}

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

.page-title { font-size: 1.75rem; font-weight: 700; color: var(--gray-900); }
.page-subtitle { color: var(--gray-500); font-size: 0.9rem; }
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Cards */
.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--gray-50);
}

.card-title { font-size: 1rem; font-weight: 600; }
.card-body { padding: 1.5rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.875rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.375rem; color: var(--gray-700); }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  outline: none;
  transition: all 0.15s;
  background: white;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea { resize: vertical; min-height: 80px; }
.chart-textarea { width: 100%; font-family: inherit; font-size: 0.875rem; padding: 0.5rem; border: 1px solid var(--gray-300); border-radius: var(--radius); resize: vertical; min-height: 60px; }
.settings-hint { font-size: 0.75rem; color: var(--gray-500, #6b7280); margin-top: 0.25rem; }
.settings-panel summary { cursor: pointer; font-weight: 500; margin-bottom: 0.5rem; }
.label-category-card { margin-bottom: 1.5rem; }
.label-category-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.label-category-title { margin: 0; font-size: 1rem; }
.label-category-title input.label-cat-name { font-size: 1rem; padding: 0.25rem 0.5rem; width: auto; min-width: 180px; }
.label-category-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.mt-md { margin-top: 1rem; }
.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500, #6b7280);
  margin-top: 0.25rem;
}
.form-input-sm { padding: 0.375rem 0.625rem; font-size: 0.8rem; }

.form-section { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--gray-200); }
.form-section-title { font-size: 0.9rem; font-weight: 600; color: var(--gray-700); margin-bottom: 0.75rem; }

/* Tables */
.table-container { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }

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

.table th {
  font-weight: 600;
  color: var(--gray-600);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--gray-50);
}

.table tbody tr { transition: background 0.1s; }
.table tbody tr:hover { background: var(--gray-50); }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.selected-row { background: var(--primary-light); }

/* Bacs (bins) list thumbnails and detail */
.bins-col-thumb { width: 48px; padding: 0.35rem !important; vertical-align: middle; }
.bins-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; display: block; }
.bins-thumb-placeholder { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; background: var(--gray-100); border-radius: 6px; font-size: 1.25rem; }
.bin-detail-photo { text-align: center; }
.bin-detail-photo-img { max-width: 100%; max-height: 200px; object-fit: contain; border-radius: 8px; border: 1px solid var(--gray-200); }

/* Bacs view hero banner */
.bins-hero-banner {
  position: relative;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  color: white;
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.bins-hero-banner::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: radial-gradient(circle at 70% 30%, rgba(59, 130, 246, 0.2) 0%, transparent 60%);
  pointer-events: none;
}
.bins-hero-banner .hero-settings-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}
.bins-hero-banner .hero-settings-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(45deg);
}
.bins-hero-banner .hero-content {
  text-align: center;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}
.bins-hero-banner .hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  color: white;
}
.bins-hero-banner .hero-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  position: relative;
  z-index: 1;
}
.bins-table-row {
  cursor: pointer;
}
.bins-table-row:hover {
  background: var(--gray-50, #f9fafb);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon.blue { background: var(--primary-light); }
.stat-icon.green { background: var(--success-light); }
.stat-icon.yellow { background: var(--warning-light); }
.stat-icon.red { background: var(--danger-light); }

.stat-content { flex: 1; }
.stat-label { font-size: 0.875rem; color: var(--gray-500); }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--gray-900); line-height: 1.2; }

/* Dashboard sections (due today, low stock, en service) */
.dashboard-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.5rem;
}
.dashboard-section {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--gray-200, #e5e7eb);
}
.dashboard-section-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0 0 0.25rem 0;
}
.dashboard-section-desc {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin: 0 0 1rem 0;
}
.dashboard-empty {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin: 0;
  font-style: italic;
}
.dashboard-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem 0;
}
.dashboard-list-item {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.875rem;
}
.dashboard-list-item:last-child { border-bottom: none; }
.dashboard-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.dashboard-link:hover { text-decoration: underline; }

.dashboard-due-item { cursor: pointer; }
.dashboard-due-item:hover { background: var(--gray-50); margin: 0 -0.5rem; padding: 0.6rem 0.5rem; }
.dashboard-due-id { font-family: monospace; color: var(--gray-500); margin-right: 0.5rem; }
.dashboard-due-title { font-weight: 600; color: var(--gray-900); }
.dashboard-due-meta { display: block; font-size: 0.75rem; color: var(--gray-500); margin-top: 0.2rem; }

.dashboard-stock-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem; }
.dashboard-stock-name { font-weight: 600; color: var(--gray-900); flex: 1 1 100%; }
.dashboard-stock-key { font-family: monospace; font-size: 0.75rem; color: var(--gray-500); }
.dashboard-stock-qty { font-weight: 600; color: var(--warning, #d97706); margin-left: auto; }

.dashboard-activity-item { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.dashboard-activity-item:hover { background: var(--gray-50); margin: 0 -0.5rem; padding: 0.6rem 0.5rem; }
.dashboard-activity-icon { font-size: 1rem; }
.dashboard-activity-text { font-weight: 500; color: var(--gray-900); }
.dashboard-activity-ticket { font-size: 0.75rem; color: var(--gray-500); }
.dashboard-activity-time { font-size: 0.75rem; color: var(--gray-500); margin-left: auto; }

.dashboard-project-item { cursor: pointer; }
.dashboard-project-item:hover { background: var(--gray-50); margin: 0 -0.5rem; padding: 0.6rem 0.5rem; }
.dashboard-project-name { font-weight: 500; color: var(--gray-900); }

.dashboard-workers-list .dashboard-list-item { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.dashboard-worker-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.dashboard-worker-name { font-weight: 600; color: var(--gray-900); }
.dashboard-worker-project { font-size: 0.75rem; color: var(--gray-500); }
.dashboard-worker-time { display: flex; flex-direction: column; align-items: flex-end; }
.dashboard-worker-start { font-size: 0.75rem; color: var(--gray-500); }
.dashboard-worker-elapsed { font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.dashboard-worker-link { font-size: 0.75rem; font-weight: 600; color: var(--primary); }

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

.badge-success { background: var(--success-light); color: #065f46; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-danger { background: var(--danger-light); color: #991b1b; }
.badge-info { background: var(--primary-light); color: #1e40af; }
.badge-gray { background: var(--gray-200); color: var(--gray-700); }

/* Auto-created badge for one-time items */
.auto-created-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 4px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fbbf24;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Small auto-created badge for supplier tiles */
.auto-created-badge-small {
  position: absolute;
  top: -4px;
  right: -4px;
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fbbf24;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

/* Search */
.search-container { position: relative; margin-bottom: 1rem; }

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  font-size: 0.9rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: white;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
}

/* Filters */
.filters-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
}

.filters-row .form-select { width: auto; min-width: 150px; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
}

/* Kanban Board */
.kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.kanban-column {
  min-width: 300px;
  max-width: 320px;
  flex-shrink: 0;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
}

.kanban-column-header {
  padding: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.kanban-column-header.yellow { border-color: #fbbf24; background: #fef9c3; }
.kanban-column-header.blue { border-color: #3b82f6; background: #dbeafe; }
.kanban-column-header.orange { border-color: #f97316; background: #ffedd5; }
.kanban-column-header.purple { border-color: #8b5cf6; background: #ede9fe; }
.kanban-column-header.green { border-color: #10b981; background: #d1fae5; }

.kanban-column-body {
  padding: 0.5rem;
  flex: 1;
  min-height: 200px;
}

.kanban-column-body.drag-over { background: rgba(37, 99, 235, 0.1); }

.kanban-card {
  background: white;
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

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

.kanban-card.dragging { opacity: 0.5; }

.kanban-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.kanban-card-id { font-size: 0.75rem; color: var(--gray-500); font-family: monospace; }
.kanban-card-title { font-weight: 500; margin-bottom: 0.5rem; line-height: 1.3; }
.kanban-card-meta { font-size: 0.75rem; color: var(--gray-500); display: flex; flex-direction: column; gap: 0.25rem; }
.kanban-card-footer { font-size: 0.75rem; color: var(--gray-400); margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--gray-100); }

.kanban-empty { text-align: center; padding: 2rem 1rem; color: var(--gray-400); font-size: 0.875rem; }

/* List View */
.list-section { margin-bottom: 1.5rem; }

.list-section-header {
  padding: 0.75rem 1rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: var(--radius) var(--radius) 0 0;
  border-left: 4px solid;
}

.list-section-header.yellow { border-color: #fbbf24; background: #fef9c3; }
.list-section-header.blue { border-color: #3b82f6; background: #dbeafe; }
.list-section-header.orange { border-color: #f97316; background: #ffedd5; }
.list-section-header.purple { border-color: #8b5cf6; background: #ede9fe; }
.list-section-header.green { border-color: #10b981; background: #d1fae5; }

.list-section-body { background: white; border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); }

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background 0.1s;
}

.list-item:hover { background: var(--gray-50); }
.list-item:last-child { border-bottom: none; }
.list-item-main { flex: 1; }
.list-item-id { font-size: 0.75rem; color: var(--gray-500); font-family: monospace; }
.list-item-title { font-weight: 500; }
.list-item-meta { display: flex; gap: 1rem; align-items: center; font-size: 0.8rem; color: var(--gray-500); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10200; /* Above product-modal-overlay (10100) */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  padding: 1rem;
  backdrop-filter: blur(2px);
}

.modal-overlay.active { 
  opacity: 1; 
  visibility: visible; 
}

.modal {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal { transform: scale(1); }

.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1000px; }
.modal-xl { max-width: 1000px; }

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-title { font-size: 1.125rem; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray-400);
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover { color: var(--gray-600); }

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--gray-50);
  flex-shrink: 0;
}

/* Info Items */
.info-item { margin-bottom: 0.5rem; }
.info-label { font-size: 0.75rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.05em; }
.info-value { font-weight: 500; }

/* Item Rows */
.item-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

.item-row.item-complete { opacity: 0.6; }
.item-info { flex: 1; }
.item-sku { font-weight: 600; font-size: 0.875rem; }
.item-name { font-size: 0.8rem; color: var(--gray-500); }
.item-qty { font-weight: 600; }
.item-stock { font-size: 0.8rem; }
.item-status { min-width: 100px; text-align: right; }

/* Transfer Mode */
.transfer-mode { padding: 1rem; }
.transfer-progress { margin-bottom: 1rem; }
.transfer-item { text-align: center; }
.transfer-sku { font-size: 1.5rem; font-weight: 700; font-family: monospace; }
.transfer-name { color: var(--gray-600); }
.transfer-qty-display { font-size: 1.25rem; }
.transfer-qty-value { font-size: 2rem; font-weight: 700; color: var(--primary); }
.transfer-stock { font-size: 0.9rem; }
.transfer-input { max-width: 200px; margin: 0 auto; }
.transfer-input input { text-align: center; font-size: 1.25rem; font-weight: 600; }
.transfer-actions { display: flex; gap: 1rem; }
.transfer-complete { padding: 2rem; }

/* Progress Bar */
.progress-bar-container {
  height: 8px;
  background: var(--gray-200);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s;
}

.progress-inline {
  display: inline-block;
  width: 60px;
  height: 6px;
  background: var(--gray-200);
  border-radius: 9999px;
  overflow: hidden;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.progress-bar-mini {
  height: 100%;
  background: var(--success);
}

/* Cart Items */
.cart-container { max-height: 300px; overflow-y: auto; }

.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

.cart-item-info { flex: 1; }
.cart-item-sku { font-weight: 600; font-size: 0.875rem; }
.cart-item-name { font-size: 0.8rem; color: var(--gray-500); }
.cart-item-qty { width: 70px; text-align: center; }

/* Product Search Item */
.product-search-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.15s;
}

.product-search-item:hover { border-color: var(--primary); background: var(--primary-light); }
.product-search-item.in-cart { border-color: var(--success); background: var(--success-light); }
.product-search-info { flex: 1; }
.product-search-sku { font-weight: 600; font-size: 0.875rem; }
.product-search-name { font-size: 0.8rem; color: var(--gray-500); }
.product-search-stock { font-size: 0.875rem; }
.product-search-action { width: 30px; text-align: center; font-size: 1.25rem; color: var(--primary); }

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.product-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem;
  transition: all 0.15s;
}

.product-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.product-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.product-card-sku { font-weight: 600; font-family: monospace; font-size: 0.875rem; }
.product-card-name { color: var(--gray-700); font-size: 0.9rem; margin-bottom: 0.75rem; line-height: 1.4; }
.product-card-footer { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; }

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--gray-500);
  gap: 1rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--gray-900);
  color: white;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s ease;
  min-width: 280px;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info { border-left: 4px solid var(--primary); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Empty State */
.empty-state { text-align: center; padding: 3rem; color: var(--gray-500); }
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }

/* Perf Indicator */
.perf-indicator {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: var(--gray-900);
  color: var(--success);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-family: monospace;
  z-index: 100;
}

/* Views */
.view { display: none; }
.view.active { display: block; }

/* Utilities */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 1rem; }
.mb-lg { margin-bottom: 1.5rem; }
.ml-sm { margin-left: 0.5rem; }
.my-md { margin-top: 1rem; margin-bottom: 1rem; }
.p-md { padding: 1rem; }
.p-lg { padding: 1.5rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--gray-400);
  font-size: 0.8rem;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--gray-200);
}

.divider span { padding: 0 1rem; }

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.project-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.15s;
}

.project-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

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

.project-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.project-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.project-stat {
  text-align: center;
  padding: 0.5rem;
  background: var(--gray-50);
  border-radius: var(--radius);
}

.project-stat-value {
  display: block;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary);
}

.project-stat-label {
  display: block;
  font-size: 0.7rem;
  color: var(--gray-500);
  text-transform: uppercase;
}

.project-budget {
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-100);
}

/* List Compact */
.list-compact {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

.list-compact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background 0.1s;
}

.list-compact-item:hover {
  background: var(--gray-50);
}

.list-compact-item:last-child {
  border-bottom: none;
}

/* Background colors for progress bar */
.bg-danger { background: var(--danger) !important; }
.bg-success { background: var(--success) !important; }
.bg-warning { background: var(--warning) !important; }

/* Create Ticket Layout */
.create-ticket-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.5rem;
  min-height: 400px;
}

.ticket-info-panel {
  padding-right: 1.5rem;
  border-right: 1px solid var(--gray-200);
}

.products-panel {
  display: flex;
  flex-direction: column;
}

.products-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.products-header h4 {
  margin: 0;
  font-size: 1rem;
}

.product-search-box {
  margin-bottom: 0.75rem;
}

.product-search-box input {
  font-size: 1rem;
  padding: 0.875rem 1rem;
}

.product-search-results {
  flex: 1;
  min-height: 150px;
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.search-hint, .search-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 120px;
  color: var(--gray-400);
  text-align: center;
}

.product-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.1s;
}

.product-result:hover {
  background: var(--gray-50);
}

.product-result:last-child {
  border-bottom: none;
}

.product-result.in-cart {
  background: var(--success-light);
}

.product-result.out-of-stock {
  opacity: 0.6;
}

.product-result-info {
  flex: 1;
  min-width: 0;
}

.product-result-sku {
  font-weight: 600;
  font-size: 0.8rem;
  font-family: monospace;
}

.product-result-name {
  font-size: 0.8rem;
  color: var(--gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-result-stock {
  font-weight: 600;
  font-size: 0.875rem;
  min-width: 40px;
  text-align: center;
}

.product-result-qty {
  width: 60px;
}

.qty-input {
  width: 100%;
  padding: 0.375rem;
  font-size: 0.875rem;
  text-align: center;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
}

.cart-section {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--gray-50);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  font-weight: 600;
  font-size: 0.875rem;
}

.cart-items {
  max-height: 180px;
  overflow-y: auto;
}

.cart-empty {
  padding: 2rem;
  text-align: center;
  color: var(--gray-400);
  font-size: 0.875rem;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--gray-100);
  background: white;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
  line-height: 1;
}

.cart-item-remove:hover {
  color: var(--danger);
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-sku {
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
  font-family: monospace;
}

.cart-item-name {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-qty {
  width: 60px;
  padding: 0.25rem;
  text-align: center;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.875rem;
}

@media (max-width: 768px) {
  .create-ticket-layout {
    grid-template-columns: 1fr;
  }
  
  .ticket-info-panel {
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }
}

/* Price Request View */
.price-request {
  max-height: 70vh;
  overflow-y: auto;
}

.suppliers-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.suppliers-list input {
  width: 150px;
}

.price-table th, .price-table td {
  text-align: center;
  padding: 0.5rem;
}

.price-table .qty-input,
.price-table .price-input {
  width: 80px;
  text-align: center;
  padding: 0.375rem;
}

.price-request-summary {
  background: var(--gray-50);
  padding: 1rem;
  border-radius: var(--radius);
}

/* PO badges */
.badge-draft { background: var(--gray-200); color: var(--gray-700); }
.badge-sent { background: #e3f2fd; color: #1565c0; }
.badge-confirmed { background: var(--success-light); color: var(--success); }
.badge-received { background: #e8f5e9; color: #2e7d32; }
.badge-partial { background: var(--warning-light); color: var(--warning); }

/* Ticket Detail View */
.ticket-detail {
  max-height: 70vh;
  overflow-y: auto;
}

.ticket-header {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.info-item {
  background: var(--gray-50);
  padding: 0.75rem;
  border-radius: var(--radius);
}

.info-label {
  font-size: 0.75rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.info-value {
  font-weight: 500;
}

/* Item rows */
.item-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-bottom: 1px solid var(--gray-100);
}

.item-row:last-child {
  border-bottom: none;
}

.item-row.item-complete {
  background: var(--success-light);
  opacity: 0.7;
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-sku {
  font-weight: 600;
  font-family: monospace;
  font-size: 0.875rem;
}

.item-name {
  font-size: 0.8rem;
  color: var(--gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-qty {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 500;
}

.item-stock, .item-status {
  text-align: right;
}

/* Transfer Mode */
.transfer-mode {
  padding: 1rem;
}

.transfer-progress .progress-bar-container {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.transfer-progress .progress-bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}

.transfer-item {
  background: var(--gray-50);
  border: 2px solid var(--primary);
}

.transfer-sku {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: monospace;
  color: var(--primary);
}

.transfer-name {
  font-size: 1rem;
  color: var(--gray-600);
}

.transfer-qty-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.transfer-input input {
  max-width: 120px;
  margin: 0 auto;
  font-size: 1.5rem;
  font-weight: 700;
}

.transfer-complete {
  background: var(--success-light);
  border-radius: var(--radius);
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--gray-400);
  font-size: 0.875rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--gray-200);
}

.divider span {
  padding: 0 1rem;
}

/* Notifications */
.notifications-panel {
  max-height: 60vh;
  overflow-y: auto;
}

.notifications-list {
  display: flex;
  flex-direction: column;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.notification-item:hover {
  background: var(--gray-50);
}

.notification-item.unread {
  background: #fff9e6;
}

.notification-item.unread:hover {
  background: #fff3cc;
}

.notification-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.notification-message {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-bottom: 0.25rem;
}

.notification-time {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.notification-dot {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
}

/* Add items modal */
.add-items-modal .product-search-results {
  max-height: 200px;
}

.product-result.already-in-ticket {
  opacity: 0.6;
}

/* Reports */
.reports-panel {
  padding: 1rem 0;
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.report-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.report-card:hover {
  border-color: var(--primary);
  background: var(--gray-50);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.report-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.report-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.report-desc {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.btn-group {
  display: flex;
  gap: 0;
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
}

.btn-group .btn:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}

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

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

/* ========================================
   MOBILE RESPONSIVE DESIGN
   ======================================== */

/* Mobile Sidebar - tablet portrait (e.g. iPad up to 12.9") and smaller */
@media (max-width: 1024px) {
  .app-container {
    flex-direction: column;
  }
  
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -280px !important;
    width: 280px !important;
    height: 100vh !important;
    z-index: 10000 !important;
    transition: left 0.3s ease;
    background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-800) 100%);
    overflow-y: auto;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); /* room to scroll last items above bottom nav */
  }
  
  .sidebar.open {
    left: 0 !important;
    box-shadow: 5px 0 30px rgba(0,0,0,0.5);
  }
  
  .sidebar-overlay {
    display: none !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 9999 !important;
  }
  
  .sidebar-overlay.show,
  .sidebar-overlay.active {
    display: block !important;
  }
  
  .main-content {
    margin-left: 0;
    padding: 1rem;
    padding-top: 1rem;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); /* space for bottom nav */
  }
  
  /* Only bottom nav on tablet (no top bar); user opens menu via "Plus" in bottom nav */
  .mobile-header {
    display: none !important;
  }
  
  .bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 997;
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 0.5rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  }
  
  .bottom-nav .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0.25rem;
    color: var(--gray-500);
    font-size: 0.75rem;
    cursor: pointer;
    min-width: 50px;
    border-radius: var(--radius);
  }
  
  .bottom-nav .mobile-nav-item span:first-child {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
  }
  
  .bottom-nav .mobile-nav-item.active {
    color: var(--primary);
  }
  
  .mobile-menu-btn {
    background: none !important;
    border: none !important;
    color: var(--gray-700) !important;
    font-size: 1.5rem !important;
    cursor: pointer !important;
    padding: 0.5rem !important;
    z-index: 10001 !important;
    position: relative !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  
  .mobile-menu-btn:active {
    opacity: 0.7;
  }
  
  .mobile-logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--gray-900);
  }
  
  .mobile-actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
  }
  
  .mobile-action-btn {
    background: none;
    border: none;
    color: var(--gray-700);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    position: relative;
  }
  
  .mobile-action-btn .badge {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.65rem;
    padding: 2px 5px;
  }
}

/* Hide mobile header on desktop */
.mobile-header {
  display: none;
}

/* Mobile Page Header */
@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    margin-bottom: 0;
  }
  
  .page-header h1,
  .page-title {
    font-size: 1.25rem;
  }
  
  .page-subtitle {
    font-size: 0.8rem;
  }
  
  .page-header .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
  }
}

/* Mobile Cards */
@media (max-width: 768px) {
  .card {
    border-radius: 0;
    margin-left: -1rem;
    margin-right: -1rem;
  }
  
  .card-body {
    padding: 1rem;
  }
}

/* Mobile Tables */
@media (max-width: 768px) {
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .data-table {
    min-width: 600px;
  }
  
  /* Stack table for small screens */
  .data-table.responsive {
    min-width: unset;
  }
  
  .data-table.responsive thead {
    display: none;
  }
  
  .data-table.responsive tr {
    display: block;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
  }
  
  .data-table.responsive td {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border: none;
  }
  
  .data-table.responsive td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--gray-500);
  }
}

/* Mobile Grids */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .kanban-board {
    flex-direction: column;
  }
  
  .kanban-column {
    min-width: unset;
    max-width: unset;
  }
}

/* Mobile Modals */
@media (max-width: 768px) {
  .modal {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
  }
  
  .modal-body {
    max-height: calc(100vh - 140px);
  }
  
  .modal-lg, .modal-xl {
    max-width: 100%;
  }
  
  .create-ticket-layout {
    grid-template-columns: 1fr;
  }
}

/* Mobile Forms */
@media (max-width: 768px) {
  .form-input, .form-select, .form-textarea {
    font-size: 16px; /* Prevent iOS zoom */
  }
  
  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
  }
  
  .btn-block {
    width: 100%;
  }
}

/* Mobile Transfer Mode */
@media (max-width: 768px) {
  .transfer-sku {
    font-size: 1.25rem;
  }
  
  .transfer-qty-value {
    font-size: 1.5rem;
  }
  
  .transfer-input input {
    font-size: 1.25rem;
  }
}

/* Mobile Filters */
@media (max-width: 768px) {
  .filters-bar {
    flex-direction: column;
  }
  
  .filters-bar .form-select,
  .filters-bar .form-input {
    width: 100%;
  }
}

/* Touch-friendly elements */
@media (max-width: 768px) {
  .item-row, .product-result, .notification-item {
    padding: 1rem;
    min-height: 60px;
  }
  
  .btn-sm {
    padding: 0.5rem 1rem;
    min-height: 40px;
  }
  
  .nav-item {
    padding: 1rem;
  }
}

/* Bottom Navigation (Mobile) */
.bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border-top: 1px solid var(--gray-200);
    z-index: 997;
    padding: 0.5rem;
    justify-content: space-around;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  }
  
  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.75rem;
    cursor: pointer;
  }
  
  .bottom-nav-item.active {
    color: var(--primary);
  }
  
  .bottom-nav-item span:first-child {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
  }
  
  /* Add padding at bottom for bottom nav */
  .main-content {
    padding-bottom: 80px !important;
  }
  
  /* Ensure mobile nav items are styled correctly */
  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0.25rem;
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.65rem;
    cursor: pointer;
    min-width: 50px;
    border-radius: var(--radius);
  }
  
  .mobile-nav-item span:first-child {
    font-size: 1.2rem;
    margin-bottom: 2px;
  }
  
  .mobile-nav-item.active {
    color: var(--primary);
    background: var(--primary-light);
  }
}

/* Responsive */
@media (max-width: 768px) {
  /* Sidebar is handled by mobile menu - don't hide it, just position it off-screen */
  /* .sidebar { display: none; } - REMOVED - sidebar needs to be visible for mobile menu */
  .main-content { margin-left: 0; padding: 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .kanban-board { flex-direction: column; }
  .kanban-column { max-width: 100%; min-width: 100%; }
  .modal { max-height: 95vh; }
  .projects-grid { grid-template-columns: 1fr; }
}

/* ============ NEW FEATURES STYLES ============ */

/* Info Items */
.info-item {
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: var(--radius);
}

.info-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.info-value {
  font-size: 0.95rem;
  color: var(--gray-900);
}

/* Item Rows */
.item-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-bottom: 1px solid var(--gray-100);
}

.item-row:last-child { border-bottom: none; }

.item-row.item-complete {
  opacity: 0.6;
  background: var(--success-light);
}

.item-info { flex: 1; min-width: 0; }

.item-sku {
  font-family: monospace;
  font-weight: 600;
  font-size: 0.85rem;
}

.item-name {
  font-size: 0.85rem;
  color: var(--gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-qty, .item-stock, .item-status {
  text-align: center;
  font-size: 0.85rem;
}

/* Transfer Mode */
.transfer-mode {
  padding: 1rem;
}

.transfer-sku {
  font-family: monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.transfer-name {
  font-size: 1rem;
  color: var(--gray-600);
}

.transfer-qty-value {
  font-size: 2rem;
  font-weight: 700;
}

.transfer-complete {
  padding: 2rem;
}

/* Progress Bar */
.progress-bar-container {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Checkbox Label */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Alert Box */
.alert {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.alert-info {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  color: var(--primary-hover);
}

.alert-warning {
  background: var(--warning-light);
  border: 1px solid var(--warning);
  color: #92400e;
}

.alert-danger {
  background: var(--danger-light);
  border: 1px solid var(--danger);
  color: #991b1b;
}

/* Ticket Detail Styles */
.ticket-detail .ticket-header {
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 1rem;
}

/* Modal Large */
.modal-lg {
  max-width: 800px;
}

/* Flex utilities */
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

/* Table row clickable */
.table tr.clickable {
  cursor: pointer;
}

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

/* ============ CONSUMPTION & RETURN STYLES ============ */

.consumption-items,
.return-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
}

.consumption-item,
.return-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  gap: 1rem;
}

.consumption-item-info,
.return-item-info {
  flex: 1;
  min-width: 0;
}

.consumption-item-qty,
.return-item-qty {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.consumption-item-qty input,
.return-item-qty input {
  width: 100px;
  text-align: center;
}

/* Billing Comparison */
.billing-consumed {
  max-height: 300px;
  overflow-y: auto;
}

.billing-item {
  display: grid;
  grid-template-columns: 100px 1fr 80px 100px;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.billing-sku {
  font-family: monospace;
  font-weight: 600;
}

.billing-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.billing-qty {
  text-align: center;
  font-weight: 600;
}

.billing-billed {
  width: 100%;
  text-align: center;
}

.billing-results {
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius);
}

.billing-summary {
  padding: 0.75rem;
  border-radius: var(--radius);
  text-align: center;
  font-weight: 600;
}

.billing-summary.has-issues {
  background: var(--warning-light);
}

.billing-summary.no-issues {
  background: var(--success-light);
}

/* Discrepancy Report */
.discrepancy-list {
  max-height: 300px;
  overflow-y: auto;
}

.discrepancy-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-bottom: 1px solid var(--gray-100);
}

.discrepancy-values {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
}

/* Bin Actions */
.bin-actions {
  border-top: 1px solid var(--gray-200);
  padding-top: 1rem;
  margin-top: 1rem;
}

/* ===== CONTACTS CARD VIEW ===== */

.contacts-header {
  background: white;
  padding: 1rem;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 50;
}

.contacts-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.contacts-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

.contacts-header-actions {
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: var(--gray-200);
}

.search-wrapper {
  position: relative;
}

.search-wrapper .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 1rem;
}

.search-wrapper .search-input {
  width: 100%;
  padding: 12px 40px 12px 44px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  font-size: 1rem;
  color: var(--gray-900);
}

.search-wrapper .search-input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--gray-300);
  border: none;
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.search-clear.show {
  display: flex;
}

/* Filter Pills */
.filter-pills-container {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.filter-pills-container::-webkit-scrollbar {
  display: none;
}

.filter-pills {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  min-width: max-content;
  flex-wrap: wrap;
}

.pill {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  color: var(--gray-600);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.pill:hover {
  background: var(--gray-200);
}

.pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pill .count {
  background: rgba(0,0,0,0.1);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Result Row */
.contacts-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.result-count {
  font-size: 0.85rem;
  color: var(--gray-500);
}

.result-count strong {
  color: var(--gray-900);
}

/* Card Grid */
.contact-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  padding: 16px;
}

@media (max-width: 700px) {
  .contact-cards-grid {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 10px;
  }
}

/* Contact Card */
.contact-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.contact-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.contact-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.contact-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  color: white;
}

.avatar-blue { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.avatar-gold { background: linear-gradient(135deg, #f59e0b, #d97706); }
.avatar-green { background: linear-gradient(135deg, #10b981, #059669); }
.avatar-pink { background: linear-gradient(135deg, #ec4899, #db2777); }
.avatar-purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

.contact-card-info {
  flex: 1;
  min-width: 0;
}

.contact-card-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--gray-900);
}

.contact-card-info p {
  color: var(--gray-500);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-card-type {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  flex-shrink: 0;
}

.type-client { background: var(--primary-light); color: var(--primary); }
.type-fournisseur { background: var(--warning-light); color: var(--warning); }
.type-chantier { background: var(--success-light); color: var(--success); }
.type-ingenieur { background: #fce7f3; color: #db2777; }
.type-architecte { background: var(--purple-light); color: var(--purple); }

.contact-card-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--gray-500);
}

.contact-card-row .icon {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.contact-card-row .value {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Load More */
.load-more-container {
  padding: 16px;
  text-align: center;
}

.load-more-btn {
  background: white;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
  max-width: 300px;
  transition: all 0.2s;
}

.load-more-btn:hover {
  background: var(--gray-100);
}

.filter-loading-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--primary-50, #eff6ff);
  border: 1px solid var(--primary-200, #bfdbfe);
  border-radius: 8px;
  margin-bottom: 12px;
  color: var(--primary-700, #1d4ed8);
  font-size: 0.85rem;
  font-weight: 500;
}

.filter-loading-banner .spinner {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.filter-on-loaded-hint {
  margin: 0 0 0.75rem 0;
  font-size: 0.8rem;
  color: var(--gray-600, #4b5563);
  font-style: italic;
}

/* Contact Modal */
.contact-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 1.5rem;
}

.contact-modal-info h2 {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.contact-modal-info p {
  color: var(--gray-500);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.contact-modal-section {
  margin-bottom: 1.5rem;
}

.contact-modal-section h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.contact-modal-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}

.contact-modal-row:last-child {
  border-bottom: none;
}

.contact-modal-icon {
  width: 40px;
  height: 40px;
  background: var(--gray-100);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.contact-modal-content {
  flex: 1;
}

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

.contact-modal-content .value {
  font-size: 0.95rem;
}

.contact-modal-content .value a {
  color: var(--primary);
  text-decoration: none;
}

.contact-map-container {
  background: var(--gray-50);
  border-radius: 12px;
  padding: 16px;
}

.contact-map-container p {
  color: var(--gray-600);
  font-size: 0.9rem;
  margin-bottom: 12px;
  line-height: 1.6;
}

.contact-map-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== PRICE REQUEST STYLES ===== */

.price-request-editor {
  max-height: 70vh;
  overflow-y: auto;
}

.supplier-lists {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suppliers-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: var(--gray-50);
  border-radius: var(--radius);
  min-height: 44px;
}

.supplier-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  border: 1px solid var(--gray-300);
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
}

.chip-remove {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

.chip-remove:hover {
  color: var(--danger);
}

.price-request-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.price-table {
  font-size: 0.85rem;
}

.price-table th.supplier-col {
  min-width: 120px;
  background: var(--primary-light);
}

.price-table .price-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.price-table .price-input {
  width: 80px;
}

.price-table .unit-select {
  width: 60px;
  font-size: 0.75rem;
  padding: 2px 4px;
}

.price-table .qty-input {
  width: 60px;
}

.price-table .row-disabled {
  opacity: 0.5;
}

/* Price color coding */
.price-best {
  background: var(--success-light) !important;
}

.price-mid {
  background: var(--warning-light) !important;
}

.price-worst {
  background: var(--danger-light) !important;
}

.best-price-cell {
  text-align: center;
  background: var(--gray-50);
}

.price-request-summary {
  padding: 12px;
  background: var(--gray-50);
  border-radius: var(--radius);
}

/* ===== PRICE REQUEST - COLONNES DESIGN ===== */

.price-request-colonnes {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 80vh;
}

.pr-header {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.pr-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: var(--radius);
}

.pr-actions-bar .separator {
  color: var(--gray-300);
  margin: 0 0.25rem;
}

.pr-actions-bar .pr-supplier-list-select {
  max-width: 12rem;
}

/* Supplier lists (Paramètres) */
.pr-supplier-lists-list {
  margin-bottom: 1rem;
}
.pr-supplier-list-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-200);
}
.pr-supplier-list-row:last-child {
  border-bottom: none;
}
.pr-supplier-list-name {
  font-weight: 500;
  flex: 1;
}
.pr-supplier-list-meta {
  color: var(--gray-500);
  font-size: 0.875rem;
}
.settings-section-title {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

/* Edit supplier list modal */
.pr-edit-list-selected {
  min-height: 2rem;
  padding: 0.5rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.pr-edit-list-selected-empty {
  color: var(--gray-500);
  font-size: 0.875rem;
}
.pr-edit-list-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.4rem;
  background: var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.875rem;
}
.pr-chip-remove {
  padding: 0;
  line-height: 1;
  opacity: 0.7;
}
.pr-edit-list-search-results {
  margin-top: 0.5rem;
  max-height: 12rem;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}
.pr-search-result-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
}
.pr-search-result-item:hover {
  background: var(--gray-100);
}

/* Optimal Split Card */
.optimal-split-card {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 2px solid #10b981;
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 0.5rem;
}

.optimal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.optimal-icon {
  font-size: 1.5rem;
}

.optimal-title {
  font-weight: 600;
  color: #065f46;
  font-size: 1.1rem;
}

.optimal-body {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}

.optimal-savings {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.savings-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: #059669;
}

.savings-percent {
  font-size: 0.875rem;
  color: #047857;
  background: rgba(5, 150, 105, 0.2);
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
}

.optimal-breakdown {
  flex: 1;
  min-width: 200px;
  font-size: 0.85rem;
  color: #047857;
}

.split-supplier {
  margin-bottom: 0.25rem;
}

.split-total {
  float: right;
  font-weight: 600;
}

.optimal-total {
  font-size: 1.1rem;
  color: #065f46;
}

/* ===== PRICE COMPARISON TABLE (NEW ALIGNED LAYOUT) ===== */

.price-table-container {
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  display: block !important;
}

.price-comparison-table {
  display: table !important;
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: white;
}

/* Make modal content scrollable and taller */
.modal-xl .modal-content {
  max-height: 95vh;
  height: auto;
  display: flex;
  flex-direction: column;
}

.modal-xl .modal-body {
  flex: 1;
  overflow-y: auto;
  max-height: none;
}

.price-request-colonnes {
  min-height: auto;
}

.price-comparison-table th,
.price-comparison-table td {
  border: 1px solid var(--gray-200);
  vertical-align: middle;
}

/* Equivalent Product Rows */
.price-comparison-table .equivalent-row {
  background: #f0f9ff !important;  /* Light blue tint */
  border-left: 3px solid #3b82f6;
}

.price-comparison-table .equivalent-row td {
  background: #f0f9ff;
}

.equivalent-badge {
  display: inline-block;
  background: #3b82f6;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  margin-right: 0.5rem;
  cursor: help;
  white-space: nowrap;
}

.equivalent-badge:hover {
  background: #2563eb;
}

/* Item Column */
.price-comparison-table .col-item {
  width: 280px;
  min-width: 280px;
  background: var(--gray-700);
  color: white;
  padding: 0.75rem;
  font-weight: 600;
  position: sticky;
  left: 0;
  z-index: 10;
  box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

.price-comparison-table tbody .col-item {
  background: white !important;
  color: inherit;
  font-weight: normal;
  padding: 0.5rem;
  z-index: 10;
  box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

.price-comparison-table tbody .col-supplier,
.price-comparison-table tbody .col-price {
  background: white;
  position: relative;
  z-index: 1;
}

.item-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pr-item-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
  background: var(--gray-100);
}

.pr-item-thumb-placeholder {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--gray-100);
  border-radius: var(--radius);
  flex-shrink: 0;
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-weight: 500;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-meta {
  font-size: 0.7rem;
  color: var(--gray-500);
}

.item-qty-inline {
  display: flex;
  gap: 2px;
}

.qty-input-sm {
  width: 70px;
  padding: 0.35rem;
  text-align: center;
  font-size: 0.9rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
}

.unit-select-sm {
  width: 45px;
  padding: 0.125rem;
  font-size: 0.7rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
}

.btn-icon-sm {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.4;
  font-size: 0.875rem;
}

.btn-icon-sm:hover {
  opacity: 1;
}

/* Supplier Columns */
.price-comparison-table .col-supplier {
  min-width: 130px;
  width: 130px;
  padding: 0.25rem;
  color: white;
  font-weight: 600;
  text-align: center;
  position: relative;
  z-index: 1;
  vertical-align: middle;
}

.supplier-header-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* New cleaner supplier header styles */
.supplier-header-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.25rem;
  min-width: 100px;
}

.supplier-close-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s;
}

.supplier-close-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.5);
}

.supplier-docs-btn {
  position: absolute;
  top: 2px;
  right: 28px;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.supplier-docs-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.5);
}

.supplier-docs-badge {
  display: inline-block;
  min-width: 1.1rem;
  height: 1.1rem;
  line-height: 1.1rem;
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(0,0,0,0.25);
  color: white;
  border-radius: 50%;
  margin-left: 0.25rem;
  text-align: center;
}

.supplier-header-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}

.supplier-logo-header {
  height: 28px;
  width: auto;
  max-width: 80px;
  object-fit: contain;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  padding: 3px 6px;
}

.supplier-header-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: inherit;
  text-align: center;
  line-height: 1.2;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-icon-xs {
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  cursor: pointer;
  color: white;
  font-size: 12px;
  line-height: 1;
}

.btn-icon-xs:hover {
  background: rgba(255,255,255,0.4);
}

/* Price Cells */
.col-price {
  padding: 0.5rem;
  text-align: center;
  min-height: 60px;
  position: relative;
}

.col-price.cell-best {
  background: #ecfdf5;
}

.col-price.cell-higher {
  background: #fef2f2;
}

.price-cell-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.price-input-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.price-input-row .currency {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.price-input-inline {
  width: 60px;
  padding: 0.375rem;
  text-align: right;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.price-input-inline.price-input-large {
  width: 90px;
  padding: 0.5rem;
  font-size: 1rem;
}

.price-input-inline.best {
  border-color: #10b981;
  background: #ecfdf5;
}

.price-input-inline.from-history {
  background: #fef3c7;
  border-color: #f59e0b;
}

.unit-mini-inline,
.unit-select-inline {
  width: 40px;
  padding: 0.125rem;
  font-size: 0.7rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
}

.unit-select-inline.unit-select-large {
  width: 70px;
  padding: 0.5rem;
  font-size: 0.9rem;
}

.price-diff {
  font-size: 0.7rem;
  color: #dc2626;
}

.best-badge {
  color: #10b981;
  font-size: 0.875rem;
}

.price-date-hint {
  font-size: 0.65rem;
  color: #92400e;
}

.price-normalized-hint {
  font-size: 0.65rem;
  color: #059669;
  text-align: center;
  margin-top: 2px;
  font-style: italic;
}

/* Add Supplier Column */
.col-add-supplier {
  width: 80px;
  min-width: 80px;
  background: var(--gray-50);
  cursor: pointer;
  text-align: center;
  vertical-align: middle;
}

.col-add-supplier:hover {
  background: var(--gray-100);
}

.add-supplier-btn {
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 500;
}

.empty-table {
  padding: 2rem;
  text-align: center;
  color: var(--gray-500);
  font-style: italic;
}

.row-disabled {
  opacity: 0.5;
}

/* ===== TOTALS ROW (Below table, aligned) ===== */

.totals-row {
  display: flex;
  border: 1px solid var(--gray-200);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}

.totals-item-spacer {
  width: 280px;
  min-width: 280px;
  background: var(--gray-100);
  padding: 0.75rem;
}

.totals-supplier {
  min-width: 140px;
  width: 140px;
  padding: 0.75rem;
  text-align: center;
  background: white;
  border-left: 1px solid var(--gray-200);
}

.totals-supplier.best-supplier {
  background: #ecfdf5;
}

.total-amount {
  font-size: 0.9rem;
}

.total-amount strong {
  font-size: 1rem;
}

.total-diff {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.totals-add-spacer {
  width: 80px;
  min-width: 80px;
  background: var(--gray-50);
}

/* Auto-save Indicator */
.autosave-indicator {
  font-size: 0.75rem;
  font-weight: normal;
  margin-left: 0.5rem;
  color: var(--gray-500);
}

.autosave-indicator.saved {
  color: #10b981;
}

/* Summary Bar */
.pr-summary-bar {
  display: flex;
  gap: 2rem;
  padding: 0.75rem 1rem;
  background: var(--gray-100);
  border-radius: var(--radius);
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-label {
  color: var(--gray-600);
  font-size: 0.875rem;
}

.summary-value {
  font-weight: 600;
}

.summary-highlight {
  margin-left: auto;
  background: #ecfdf5;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid #10b981;
}

.summary-highlight .summary-value {
  color: #059669;
  font-size: 1.1rem;
}

/* Supplier Chips */
.supplier-lists {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.suppliers-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.supplier-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: var(--primary);
  color: white;
  border-radius: 20px;
  font-size: 0.875rem;
}

.chip-remove {
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  cursor: pointer;
  color: white;
  font-size: 14px;
  line-height: 1;
}

.chip-remove:hover {
  background: rgba(255,255,255,0.4);
}

/* History Warning Ribbon */
.history-warning-ribbon {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

.history-warning-ribbon .warning-icon {
  font-size: 1.25rem;
}

.history-warning-ribbon .warning-text {
  flex: 1;
  font-size: 0.875rem;
  color: #92400e;
}

.history-warning-ribbon .btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* Price with history indicator */
.price-input-group .price-input.from-history {
  background: #fef3c7;
  border-color: #f59e0b;
}

.price-date-hint {
  font-size: 0.65rem;
  color: #92400e;
  text-align: center;
}

/* Settings Form */
.input-group {
  display: flex;
  align-items: stretch;
}

.input-addon {
  padding: 0.5rem 0.75rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  color: var(--gray-600);
}

.input-group .form-input {
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Actions Bar at Bottom */
.pr-actions-bottom {
  margin-top: auto;
  border-top: 1px solid var(--gray-200);
  padding-top: 0.75rem;
}

/* Split Processing Cost Line */
.split-processing {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(0,0,0,0.2);
  color: #065f46;
  font-size: 0.85rem;
}

/* Recommendation Card */
.recommendation-card {
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-top: 0.5rem;
}

.recommendation-card.single-recommended {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border: 2px solid #3b82f6;
}

.recommendation-card.split-recommended {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 2px solid #10b981;
}

.recommendation-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.rec-icon {
  font-size: 1.5rem;
}

.rec-title {
  font-weight: 600;
  font-size: 1.1rem;
}

.single-recommended .rec-title {
  color: #1e40af;
}

.split-recommended .rec-title {
  color: #065f46;
}

.recommendation-body {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}

.rec-savings {
  font-size: 1rem;
}

.rec-breakdown {
  flex: 1;
  min-width: 200px;
  font-size: 0.85rem;
}

.rec-total {
  font-size: 1.1rem;
}

.rec-note {
  font-size: 0.8rem;
  font-style: italic;
}

/* ===== OPTIMAL ORDER CARD (Colonnes style) ===== */

.optimal-order-card {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  color: white;
  margin-top: 1rem;
}

.optimal-order-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.optimal-order-icon {
  font-size: 2.5rem;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.optimal-order-info {
  flex: 1;
}

.optimal-order-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.optimal-order-subtitle {
  font-size: 0.875rem;
  opacity: 0.9;
}

.optimal-order-total {
  text-align: right;
}

.optimal-amount {
  font-size: 1.75rem;
  font-weight: 700;
}

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

.optimal-order-breakdown {
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.optimal-supplier-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.optimal-supplier-row:last-child {
  border-bottom: none;
}

.optimal-supplier-block {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.optimal-supplier-block:last-child {
  border-bottom: none;
}

.optimal-supplier-row-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.35rem;
}

.optimal-supplier-items {
  list-style: none;
  margin: 0 0 0 1.25rem;
  padding: 0;
  font-size: 0.8rem;
  opacity: 0.95;
}

.optimal-supplier-items li {
  padding: 0.2rem 0;
}

.supplier-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.supplier-items {
  flex: 1;
  font-size: 0.85rem;
  opacity: 0.9;
}

.supplier-subtotal {
  font-weight: 600;
}

.optimal-order-action {
  text-align: center;
}

.optimal-order-action .btn-success {
  background: white;
  color: #059669;
  border: none;
  font-weight: 600;
  padding: 0.75rem 2rem;
}

.optimal-order-action .btn-success:hover {
  background: #f0fdf4;
}

/* ===== SUPPLIER SUMMARY CARDS ===== */

.supplier-cards-row {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.supplier-summary-card {
  flex: 1;
  min-width: 250px;
  max-width: 300px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.supplier-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.supplier-card-price-per-item {
  list-style: none;
  margin: 0 0 0.5rem 0;
  padding: 0.5rem 0 0 0;
  border-top: 1px solid var(--gray-100);
  font-size: 0.75rem;
  color: var(--gray-600);
}

.supplier-card-price-per-item li {
  padding: 0.2rem 0;
}

.supplier-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: white;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.supplier-card-info {
  flex: 1;
}

.supplier-card-name {
  font-weight: 600;
  font-size: 1rem;
}

.supplier-card-email {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.supplier-card-total {
  text-align: right;
}

.supplier-total-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
}

.supplier-total-label {
  font-size: 0.7rem;
  color: var(--gray-500);
}

.supplier-card-stats {
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
}

.stat-vs-optimal {
  margin-bottom: 0.25rem;
}

.stat-badge {
  margin-bottom: 0.25rem;
}

.stat-best-items {
  color: var(--gray-600);
}

.supplier-card-action {
  text-align: center;
}

.supplier-card-action .btn {
  width: 100%;
}

/* ===== PRODUCT SELECTION MULTI-SELECT ===== */

.selected-products-bar {
  padding: 0.75rem;
  background: var(--primary-light);
  border-radius: var(--radius);
  margin: 0.75rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.selected-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 20px;
  font-size: 0.8rem;
}

.selected-tag button {
  background: rgba(255,255,255,0.3);
  border: none;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  color: white;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
}

.product-result {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
}

.product-result:hover {
  background: var(--gray-50);
}

.product-result.selected {
  background: var(--success-light);
}

.product-result.already-added {
  opacity: 0.6;
  cursor: not-allowed;
}

.product-select-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  width: 100%;
}

.product-select-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.product-info code {
  font-size: 0.75rem;
}

.product-name {
  font-size: 0.875rem;
}

/* Editable item name for ligne libre */
.item-name-input {
  width: 100%;
  max-width: 200px;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
}

.item-name-input:focus {
  border-color: var(--primary);
  outline: none;
}

/* ===== PRICE REQUEST FULL PAGE ===== */

.price-request-page {
  padding: 1.5rem;
  max-width: 100%;
  min-height: calc(100vh - 120px);
}

.price-request-page .page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.price-request-page .page-title {
  margin: 0;
  font-size: 1.5rem;
}

.price-request-page .page-meta {
  color: var(--gray-600);
  font-size: 0.875rem;
}

/* Full width table container */
.price-request-page .price-table-container {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  background: white;
  position: relative;
}

.price-request-page .price-comparison-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

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

.price-request-page .price-comparison-table th {
  background: var(--gray-50);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
}

.price-request-page .col-item {
  min-width: 280px;
  position: sticky;
  left: 0;
  background: white;
  z-index: 5;
  box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

.price-request-page .col-item th {
  background: var(--gray-50);
  z-index: 6;
}

.price-request-page .col-supplier {
  position: relative;
  z-index: 1;
}

.price-request-page .col-supplier th {
  position: relative;
  z-index: 1;
  /* Don't override inline background colors */
}

.price-request-page .col-price {
  min-width: 180px;
  background: white;
  position: relative;
  z-index: 1;
}

/* Page footer actions bar */
.page-footer-actions {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-width, 250px);
  right: 0;
  background: white;
  border-top: 1px solid var(--gray-200);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.page-footer-actions .footer-left,
.page-footer-actions .footer-right {
  display: flex;
  gap: 0.5rem;
}

.page-footer-actions .footer-center {
  flex: 1;
  text-align: center;
}

.autosave-indicator {
  color: var(--success);
  font-size: 0.875rem;
}

/* Add padding at bottom to account for fixed footer */
.price-request-page {
  padding-bottom: 100px;
}

@media (max-width: 768px) {
  .page-footer-actions {
    left: 0;
    flex-wrap: wrap;
    gap: 0.5rem;
    bottom: 60px; /* Above mobile nav */
  }
  
  .page-footer-actions .footer-center {
    order: -1;
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  /* Price Request Mobile */
  .price-request-page {
    padding: 0.5rem;
    padding-bottom: 160px; /* Space for both footer and mobile nav */
  }
  
  .price-request-page .pr-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .price-request-page .pr-actions-bar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .price-request-page .pr-actions-bar .btn {
    flex: 1;
    min-width: 45%;
    justify-content: center;
  }
  
  .price-request-page .price-table-container {
    margin: 0 -0.5rem;
    border-radius: 0;
  }
  
  /* On mobile, remove sticky positioning - everything scrolls together */
  .price-request-page .col-item {
    min-width: 220px;
    width: 220px;
    position: relative !important;
    left: auto !important;
    z-index: 1 !important;
    box-shadow: none !important;
    background: white !important;
    padding: 0.75rem 0.5rem !important;
  }
  
  .price-request-page .item-cell {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .price-request-page .item-info {
    width: 100%;
  }
  
  .price-request-page .item-name {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.3;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
  }
  
  .price-request-page .item-meta {
    font-size: 0.75rem;
  }
  
  /* Quantity, Unit, and Trash all inline on same row */
  .price-request-page .item-cell > .item-qty-inline,
  .price-request-page .item-cell > .btn-icon-sm {
    display: inline-flex;
    vertical-align: middle;
  }
  
  .price-request-page .item-qty-inline {
    margin-top: 0;
    width: auto;
    display: inline-flex;
    gap: 0.25rem;
    align-items: center;
  }
  
  .price-request-page .item-qty-inline .qty-input-sm {
    width: 60px;
    max-width: 60px;
  }
  
  .price-request-page .item-qty-inline .unit-select-sm {
    flex-shrink: 0;
  }
  
  /* Trash icon inline with quantity */
  .price-request-page .item-cell .btn-icon-sm {
    display: inline-flex;
    margin-left: 0.5rem;
    vertical-align: middle;
  }
  
  .price-request-page .col-item th {
    background: var(--gray-50) !important;
    z-index: 1 !important;
    position: relative !important;
  }
  
  .price-request-page .col-supplier {
    position: relative !important;
    z-index: 1 !important;
    /* Allow inline background colors to show */
  }
  
  .price-request-page .col-supplier th {
    position: relative !important;
    z-index: 1 !important;
    /* Don't override inline background colors */
  }
  
  .price-request-page .col-price {
    background: white !important;
    position: relative !important;
    z-index: 1 !important;
  }
  
  .price-request-page .col-price {
    min-width: 140px;
  }
  
  /* Optimal Split Card Mobile */
  .optimal-split-card {
    margin: 0 -0.5rem;
    border-radius: 0;
    padding: 1rem;
  }
  
  .optimal-split-card h3 {
    font-size: 1rem;
  }
}

/* ===== FAST ENTRY MODE - Excel-like ===== */

.fast-entry-container {
  padding: 0;
}

.fast-entry-instructions {
  display: flex;
  gap: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--gray-100);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: var(--gray-600);
}

.fast-entry-instructions span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

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

.fast-entry-table th {
  text-align: left;
  padding: 0.75rem;
  background: var(--gray-50);
  font-weight: 600;
  font-size: 0.875rem;
  border-bottom: 2px solid var(--gray-200);
}

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

.fe-col-item {
  width: 50%;
}

.fe-col-qty {
  width: 10%;
  text-align: center;
}

.fe-col-price {
  width: 25%;
}

.fe-col-unit {
  width: 15%;
}

.fe-item-name {
  font-weight: 500;
  color: var(--gray-900);
}

.fe-item-sku {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-family: var(--font-mono);
}

.fe-row {
  transition: background 0.1s;
}

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

.fe-row-active {
  background: var(--primary-light) !important;
}

.fe-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.fe-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
  outline: none;
}

.fe-price-input {
  font-weight: 600;
  text-align: right;
}

.fe-unit-select {
  cursor: pointer;
}

/* Supplier header clickable */
.supplier-header-name {
  cursor: pointer;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.supplier-header-name:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Compact supplier cards */
.supplier-summary-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  min-width: 180px;
  flex: 1;
}

.supplier-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.supplier-card-info {
  flex: 1;
}

.supplier-card-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.supplier-card-stats {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.supplier-card-total {
  text-align: right;
}

.supplier-total-amount {
  font-size: 1.1rem;
  font-weight: 700;
}

.supplier-total-label {
  font-size: 0.7rem;
  color: var(--gray-500);
  text-transform: uppercase;
}

.supplier-card-diff {
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.supplier-card-action {
  margin-top: 0.5rem;
}

.supplier-card-action .btn {
  width: 100%;
}

/* ===== PRICE REQUEST MOBILE RESPONSIVE ===== */

@media (max-width: 768px) {
  .price-request-colonnes {
    max-height: none;
  }
  
  .pr-header .grid-2 {
    grid-template-columns: 1fr;
  }
  
  .pr-actions-bar {
    flex-wrap: wrap;
  }
  
  .pr-actions-bar .separator {
    display: none;
  }
  
  /* Table scrolls horizontally */
  .price-table-container {
    margin: 0 -1rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  .price-comparison-table .col-item {
    width: 220px;
    min-width: 220px;
    padding: 0.75rem 0.5rem !important;
  }
  
  .item-cell {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .item-info {
    width: 100%;
  }
  
  .item-name {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.3;
    margin-bottom: 0.25rem;
  }
  
  .item-meta {
    font-size: 0.75rem;
  }
  
  /* Quantity, Unit, and Trash all inline */
  .item-cell > .item-qty-inline,
  .item-cell > .btn-icon-sm {
    display: inline-flex;
    vertical-align: middle;
  }
  
  .item-qty-inline {
    margin-top: 0;
    width: auto;
    display: inline-flex;
    gap: 0.25rem;
    align-items: center;
  }
  
  .item-qty-inline .qty-input-sm {
    width: 60px;
    max-width: 60px;
  }
  
  .item-qty-inline .unit-select-sm {
    flex-shrink: 0;
  }
  
  /* Trash icon inline with quantity on mobile */
  .item-cell .btn-icon-sm {
    display: inline-flex;
    margin-left: 0.5rem;
    vertical-align: middle;
  }
  
  /* Totals row responsive */
  .totals-row {
    margin: 0 -1rem;
    border-radius: 0;
  }
  
  .totals-item-spacer {
    width: 200px;
    min-width: 200px;
  }
  
  /* Recommendation card mobile */
  .recommendation-card {
    padding: 0.75rem;
  }
  
  .recommendation-body {
    flex-direction: column;
  }
  
  .rec-breakdown {
    font-size: 0.8rem;
  }
  
  /* Summary bar mobile */
  .pr-summary-bar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  /* History warning ribbon mobile */
  .history-warning-ribbon {
    flex-wrap: wrap;
    font-size: 0.8rem;
  }
  
  .history-warning-ribbon .warning-text {
    flex: 1 1 100%;
    order: 2;
    margin-top: 0.25rem;
  }
}

@media (max-width: 480px) {
  .price-comparison-table .col-item {
    width: 200px;
    min-width: 200px;
    position: relative !important;
    left: auto !important;
    z-index: 1 !important;
    box-shadow: none !important;
    padding: 0.75rem 0.5rem !important;
  }
  
  .price-comparison-table .col-supplier {
    position: relative;
    z-index: 1;
  }
  
  .totals-item-spacer {
    width: 200px;
    min-width: 200px;
  }
  
  .item-cell {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .item-name {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.3;
    font-size: 0.85rem;
  }
  
  .item-qty-inline {
    width: 100%;
    margin-top: 0;
  }
  
  .item-name {
    font-size: 0.75rem;
  }
  
  .price-input-inline {
    width: 50px;
    font-size: 0.8rem;
  }
}

/* ===== ADDITIONAL MOBILE FIXES ===== */

/* Table responsive */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.hide-mobile {
  display: table-cell;
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .page-header h1 {
    font-size: 1.3rem;
  }
  
  .page-actions {
    width: 100%;
    display: flex;
    gap: 8px;
    margin-bottom: 0.75rem; /* Gap before search bar */
  }
  
  .page-actions .btn {
    flex: 1;
    text-align: center;
  }
  
  .filters-bar {
    flex-direction: column;
  }
  
  .filters-bar .form-select,
  .filters-bar .form-input {
    width: 100%;
  }
  
  .grid-2,
  .grid.grid-2 {
    grid-template-columns: 1fr;
  }
  
  /* Card adjustments */
  .card {
    border-radius: 12px;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  /* Modal mobile */
  .modal-content {
    width: 98%;
    max-width: none;
    margin: 5px;
    max-height: 95vh;
  }
  
  .modal-xl .modal-content {
    width: 100%;
    margin: 0;
    border-radius: 0;
    max-height: 100vh;
  }
  
  .modal-body {
    padding: 0.5rem;
  }
  
  .modal-footer {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .modal-footer .btn {
    flex: 1;
    min-width: 100px;
  }
  
  /* Kanban mobile */
  .kanban-board {
    flex-direction: column;
  }
  
  .kanban-column {
    min-width: 100%;
  }
  
  /* Form elements */
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  /* Stats grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .stat-card {
    padding: 1rem;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
  
  /* Companies view mobile */
  .companies-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0 0.5rem;
  }
  
  .company-card {
    padding: 0.75rem;
    border-left: none !important; /* Remove colored border on mobile */
    border-top: 3px solid var(--gray-300); /* Add top border instead */
  }
  
  .company-card-header {
    gap: 0.75rem;
    margin-bottom: 0.75rem;
  }
  
  .company-avatar {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }
  
  .company-name {
    font-size: 0.95rem;
  }
  
  .company-card-body {
    font-size: 0.85rem;
  }
  
  .company-card-footer {
    font-size: 0.8rem;
    margin-top: 0.5rem;
  }
  
  /* Group filter - convert to dropdown on mobile */
  .list-filter-section {
    margin-top: 1rem !important;
    padding: 0 0.5rem;
  }
  
  .list-filter-section .filter-pills {
    display: none; /* Hide pills on mobile */
  }
  
  .list-filter-dropdown {
    display: block;
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    font-weight: 500;
  }
  
  .mobile-add-group {
    display: block;
    margin-top: 0.5rem;
    width: 100%;
  }
  
  .list-filter-dropdown:focus,
  .list-filter-dropdown:hover {
    outline: none;
    border-color: var(--primary);
    background: var(--gray-50);
  }
  
  .group-filter-item:hover {
    background: var(--gray-50) !important;
  }
  
  /* Filter pills mobile - keep for other uses */
  .filter-pills {
    flex-wrap: wrap;
    padding: 8px 12px;
  }
  
  .pill {
    font-size: 0.8rem;
    padding: 6px 12px;
  }
  
  /* Ticket detail */
  .ticket-detail-grid {
    grid-template-columns: 1fr;
  }
  
  /* Transfer mode */
  .transfer-mode-card {
    position: fixed;
    bottom: 70px;
    left: 0;
    right: 0;
    margin: 10px;
    z-index: 50;
    max-height: 60vh;
    overflow-y: auto;
  }
  
  /* Price table mobile */
  .price-table {
    font-size: 0.75rem;
  }
  
  .price-table th.supplier-col {
    min-width: 80px;
  }
  
  .price-table .price-input {
    width: 60px;
  }
}

/* Small phones */
@media (max-width: 375px) {
  .main-content {
    padding: 0.75rem;
    padding-bottom: 80px;
  }
  
  .page-header h1 {
    font-size: 1.1rem;
  }
  
  .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
  
  .contact-cards-grid {
    padding: 8px;
    gap: 8px;
  }
  
  .contact-card {
    padding: 12px;
  }
}

/* =============================================
   FAVORITES & RECENT CONTACTS SECTIONS
   ============================================= */
.contacts-favorites-section,
.contacts-recent-section {
  margin: 1.5rem 0;
  padding: 0 1rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.contacts-scroll-container {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding-bottom: 0.5rem;
}

.contacts-scroll-container::-webkit-scrollbar {
  height: 4px;
}

.contacts-scroll-container::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 2px;
}

.contacts-scroll-container::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 2px;
}

.contacts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.contact-card-horizontal {
  min-width: 140px;
  max-width: 170px;
  flex: 1 1 140px;
  background: white;
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  position: relative;
  flex-shrink: 0;
}

.contact-card-horizontal:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  border-color: var(--primary);
}

.contact-card-horizontal.favorite {
  border-color: #ffd700;
}

.favorite-star {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  font-size: 1rem;
  color: #ffd700;
}

.contact-avatar-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.contact-name-horizontal {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.contact-company-horizontal {
  font-size: 0.7rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  margin-bottom: 0.4rem;
}

.contact-quick-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 100%;
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.contact-quick-info a {
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.favorite-btn-modal {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.15rem;
  margin-left: 0.3rem;
  transition: transform 0.2s;
  vertical-align: middle;
}

.favorite-btn-modal:hover {
  transform: scale(1.2);
}

.favorite-btn-modal.active {
  color: #ffd700;
}

/* Mobile adjustments for contacts view */
@media (max-width: 768px) {
  .contacts-favorites-section,
  .contacts-recent-section {
    margin: 1rem 0;
    padding: 0 0.5rem;
  }
  
  .section-title {
    font-size: 1rem;
  }
  
  /* All horizontal card rows: 3 cards wide */
  .contact-card-horizontal {
    min-width: 90px;
    max-width: 120px;
    flex: 1 1 28%;
    padding: 0.6rem;
  }
  
  .contact-avatar-circle {
    width: 38px;
    height: 38px;
    font-size: 0.85rem;
  }
  
  .contact-name-horizontal {
    font-size: 0.75rem;
  }

  /* Search bar: keep on one line */
  .contacts-hero-banner .hero-search-box {
    flex-wrap: nowrap;
    min-width: 0;
  }
  .contacts-hero-banner .hero-search-input {
    font-size: 0.85rem;
    min-width: 0;
  }

  /* Search result tiles: prevent overflow */
  .companies-grid {
    grid-template-columns: 1fr !important;
    overflow-x: hidden;
  }
  .company-card {
    max-width: 100%;
    overflow: hidden;
  }
  .company-card .company-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Company & contact modals: full-screen on mobile */
  .modal-overlay .modal {
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    width: 100%;
    border-radius: 0;
    margin: 0;
  }
  .modal-overlay {
    padding: 0;
  }
  .modal-overlay.modal-overlay-secondary .modal {
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    width: 100%;
    border-radius: 0;
    margin: 0;
  }

  /* Design B on mobile: remove ALL modal-body padding influence.
     Use -1.5rem to counteract the default 1.5rem, and -0.5rem for 480px override.
     Content sections get their own explicit generous padding. */
  .company-modal-designB,
  .contact-modal-designB {
    margin: -1.5rem;
  }
  /* Content sections: 1.25rem horizontal padding */
  .company-info-grid {
    grid-template-columns: 1fr;
    padding: 0.85rem 1.25rem;
  }
  .contact-card-grid {
    padding: 0.35rem 1.25rem 0.75rem;
  }
  .modal-bottom-actions {
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.65rem 1.25rem;
    justify-content: center;
  }
  .modal-bottom-actions .btn {
    flex: 0 1 auto;
    min-width: auto;
  }
  .contact-grid-card {
    min-height: auto;
  }
  /* Company link bar padding */
  .contact-company-link {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

/* Safe area for notched phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mobile-nav {
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
  }
  
  .main-content {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

/* ===== LIST FILTER IN CONTACTS ===== */

.list-filter-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  margin: 0 1rem 0.5rem;
}

.filter-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
  white-space: nowrap;
}

.form-select-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  flex: 1;
  max-width: 300px;
}

/* Supplier search result */
.supplier-result {
  cursor: pointer;
  padding: 0.75rem;
}

.supplier-result:hover {
  background: var(--gray-50);
}

.supplier-result-main {
  margin-bottom: 0.25rem;
}

/* ===== CONTACTS VIEW (Unified - uses CompaniesView) ===== */

/* Ensure view is visible when active */
#view-contacts,
#view-companies {
  position: relative !important;
}

#view-contacts.active,
#view-companies.active {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 1 !important;
}

/* Ensure companies-main-content inside view is visible */
#view-contacts #companies-main-content,
#view-companies #companies-main-content,
#view-contacts #main-content,
#view-companies #main-content {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 100px !important;
  width: 100% !important;
  height: auto !important;
  overflow: visible !important;
  position: relative !important;
}

.companies-page {
  padding: 1rem;
  display: block !important;
  visibility: visible !important;
  min-height: 200px;
  background: white;
}

@media (max-width: 768px) {
  .companies-page {
    padding: 0.5rem;
  }
}

/* ===== CONTACTS HERO BANNER ===== */
.contacts-hero-banner {
  position: relative;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  color: white;
  border-radius: 20px;
  padding: 2.5rem 2rem 2rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.contacts-hero-banner::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: radial-gradient(circle at 70% 30%, rgba(59, 130, 246, 0.2) 0%, transparent 60%);
  pointer-events: none;
}

.contacts-hero-banner .hero-shape {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.contacts-hero-banner .hero-shape-1 {
  bottom: -200px;
  left: -100px;
  width: 400px;
  height: 400px;
  background: rgba(59, 130, 246, 0.07);
}

.contacts-hero-banner .hero-shape-2 {
  top: -300px;
  right: -150px;
  width: 500px;
  height: 500px;
  background: rgba(96, 165, 250, 0.05);
}

.contacts-hero-banner .hero-shape-3 {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 250px;
  height: 250px;
  background: rgba(147, 197, 253, 0.04);
}

.contacts-hero-banner .hero-action-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.contacts-hero-banner .hero-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.contacts-hero-banner .hero-content {
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.contacts-hero-banner .hero-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: white;
}

.contacts-hero-banner .hero-subtitle {
  font-size: 1rem;
  opacity: 0.8;
  margin: 0;
}

.contacts-hero-banner .hero-search-filter-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
}

.contacts-hero-banner .hero-search-box {
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0.15rem 0.75rem;
  gap: 0.5rem;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}

.contacts-hero-banner .hero-search-box:focus-within {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.contacts-hero-banner .hero-search-icon {
  flex-shrink: 0;
  opacity: 0.7;
}

.contacts-hero-banner .hero-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: white;
  font-size: 1rem;
  outline: none;
  width: 100%;
}

.contacts-hero-banner .hero-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Compact top row with title and back button */
.hero-compact-top {
  position: relative;
  z-index: 1;
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.hero-compact-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}

.back-to-browse-btn {
  background: none;
  border: none;
  color: white;
  padding: 0.35rem 0;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.back-to-browse-btn:hover {
  opacity: 0.75;
}

/* Hero compact mode (search active) */
.contacts-hero-banner.hero-compact {
  padding: 1rem 1.5rem;
  border-radius: 14px;
}

.contacts-hero-banner.hero-compact .hero-content {
  display: none;
}

.contacts-hero-banner.hero-compact .hero-shape {
  display: none;
}

.contacts-hero-banner.hero-compact .hero-search-filter-row {
  max-width: 100%;
  margin: 0;
}

.contacts-hero-banner .hero-filter-toggle {
  align-self: stretch;
}

.contacts-hero-banner.hero-compact .hero-action-btn {
  top: 0.75rem;
  right: 0.75rem;
}

/* Type filter badges inside hero banner */
.hero-type-filters {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  position: relative;
  z-index: 1;
  justify-content: center;
}

.hero-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  backdrop-filter: blur(4px);
}

.hero-filter-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
}

.hero-filter-btn.active {
  background: rgba(255, 255, 255, 0.95);
  color: #1e3a5f;
  border-color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
}

.hero-filter-btn.active:hover {
  background: white;
}

.hero-filter-count {
  background: rgba(0, 0, 0, 0.15);
  padding: 0.05rem 0.4rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  min-width: 1.1rem;
  text-align: center;
}

.hero-filter-btn.active .hero-filter-count {
  background: rgba(30, 58, 95, 0.15);
}

.contacts-filters-bar {
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

@media (max-width: 768px) {
  .contacts-hero-banner {
    padding: 1.5rem 1rem 1.5rem;
    border-radius: 16px;
    margin-bottom: 1rem;
  }

  .contacts-hero-banner .hero-title {
    font-size: 1.5rem;
  }

  .contacts-hero-banner .hero-subtitle {
    font-size: 0.9rem;
  }

  .contacts-hero-banner .hero-action-btn {
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
  }
  
  .contacts-hero-banner.hero-compact {
    padding: 0.75rem 1rem;
  }
  
  .contacts-hero-banner.hero-compact .hero-action-btn {
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
  }

  .hero-type-filters {
    margin-top: 0.5rem;
  }

  .hero-filter-btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.65rem;
  }
}

/* ===== COMPANY MODAL TABS ===== */
.company-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.company-header-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.company-header-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.company-header-details {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.header-detail-item a {
  color: var(--primary);
  text-decoration: none;
}

.header-detail-item a:hover {
  text-decoration: underline;
}

.company-modal-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  background: white;
  padding: 0 1.5rem;
}

.tab-btn {
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: all 0.2s;
  position: relative;
  bottom: -2px;
}

.tab-btn:hover {
  color: var(--primary);
  background: var(--gray-50);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.tab-badge {
  background: var(--primary);
  color: white;
  border-radius: 12px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.company-modal-content {
  padding: 1.5rem;
  min-height: 300px;
}

.tab-panel {
  animation: fadeIn 0.2s;
}

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

/* ===== COMPANY MODAL DESIGN 3 (Mobile-First) ===== */
.company-modal-design3 {
  max-width: 100%;
  overflow-x: hidden;
}

.company-modal-header-sticky {
  padding: 0.75rem 1rem;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  /* Not sticky - scrolls with content */
}

.company-modal-header-sticky .header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.company-name-header {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--gray-500);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.modal-close-btn:hover {
  color: var(--gray-700);
}

.company-modal-header-sticky .header-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.company-modal-header-sticky .badge {
  padding: 0.3rem 0.7rem;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 500;
}

.company-modal-header-sticky .badge.supplier {
  background: #fff3cd;
  color: #856404;
}

.company-modal-header-sticky .badge.client {
  background: #d1ecf1;
  color: #0c5460;
}

.company-modal-header-sticky .badge.active {
  background: #d4edda;
  color: #155724;
}

.company-modal-header-sticky .badge.inactive {
  background: #f8d7da;
  color: #721c24;
}

.company-modal-header-sticky .header-actions {
  display: flex;
  gap: 0.5rem;
}

.company-modal-header-sticky .icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.company-modal-header-sticky .icon-btn:hover {
  border-color: var(--primary);
  background: var(--gray-50);
}

.quick-contact-bar {
  padding: 1rem;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
}

.quick-contact-item {
  min-width: 80px;
  text-align: center;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: background 0.2s;
}

.quick-contact-item:hover {
  background: var(--gray-100);
}

.quick-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin: 0 auto 0.5rem;
  font-size: 0.9rem;
}

.quick-name {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.quick-contact-item.primary .quick-avatar {
  border: 2px solid #ffd700;
}

.modal-content-design3 {
  padding: 0;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
}

.content-card {
  padding: 1.25rem;
  border-bottom: 1px solid var(--gray-200);
}

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

.content-card .card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.content-card .card-action {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.content-card .card-action:hover {
  background: var(--primary-dark);
}

.contact-card-full {
  background: var(--gray-50);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.contact-card-full.primary {
  border: 2px solid #ffd700;
}

.contact-card-full.inactive {
  opacity: 0.6;
}

.contact-top {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.contact-avatar-large {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.contact-info-main {
  flex: 1;
}

.contact-name-large {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.contact-role {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
}

.contact-badges {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.contact-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
}

.contact-badge.primary {
  background: #fff3cd;
  color: #856404;
}

.contact-details-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.detail-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: white;
  border-radius: 8px;
}

.detail-icon {
  font-size: 1.2rem;
  width: 32px;
  text-align: center;
}

.detail-content {
  flex: 1;
}

.detail-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.detail-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}

.detail-value a {
  color: var(--primary);
  text-decoration: none;
}

.detail-value a:hover {
  text-decoration: underline;
}

.detail-action {
  padding: 0.5rem;
  background: var(--gray-100);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.detail-action:hover {
  background: var(--gray-200);
}

/* Toggle button for contact actions */
.contact-actions-toggle {
  display: block;
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.75rem;
  background: var(--gray-50);
  border: 1px dashed var(--gray-300);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  transition: all 0.2s;
}

.contact-actions-toggle:hover {
  background: var(--gray-100);
  border-color: var(--primary);
  color: var(--primary);
}

/* Toggle button for showing archived contacts */
.toggle-archived-btn {
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-archived-btn:hover {
  background: var(--gray-200);
  border-color: var(--primary);
}

/* Add contact button at bottom */
.add-contact-btn {
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem;
}

/* Modal bottom actions */
.modal-bottom-actions {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--gray-200);
  justify-content: flex-end;
}

/* company-name-header is defined above in modal section */

.contact-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.contact-actions-grid .action-btn {
  padding: 0.5rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.contact-actions-grid .action-btn:hover {
  border-color: var(--primary);
  background: var(--gray-50);
}

.contact-actions-grid .action-btn.danger {
  border-color: #dc3545;
  color: #dc3545;
}

.contact-actions-grid .action-btn.danger:hover {
  background: #fff5f5;
}

.contact-actions-grid .action-btn .icon-only {
  display: inline-block;
}

.contact-actions-grid .action-btn .btn-text {
  display: inline-block;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: 8px;
}

.info-label {
  font-weight: 500;
  color: var(--text-secondary);
}

.info-value {
  color: var(--text-primary);
}

.info-value a {
  color: var(--primary);
  text-decoration: none;
}

.info-value a:hover {
  text-decoration: underline;
}

/* Mobile: smaller padding and compact layout */
@media (max-width: 480px) {
  .contact-actions-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
  }
  
  .contact-actions-grid .action-btn {
    padding: 0.5rem;
    min-width: 40px;
    font-size: 0.8rem;
  }
  
  .contact-actions-grid .action-btn .icon-only {
    display: inline-block !important;
    font-size: 1rem;
  }
  
  .contact-actions-grid .action-btn .btn-text {
    display: none !important;
  }
  
  /* Reduce modal padding on mobile */
  .company-modal-design3 {
    padding: 0;
  }
  
  .company-modal-header-sticky {
    padding: 0.5rem 0.75rem;
  }
  
  .company-name-header {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
  }
  
  .modal-content-design3 {
    padding: 0;
  }
  
  .content-card {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0;
    border-radius: 0;
  }
  
  .card-header {
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .card-title {
    font-size: 1rem;
  }
  
  .contact-card-full {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
  }
  
  .contact-top {
    gap: 0.5rem;
  }
  
  .contact-avatar-large {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }
  
  .contact-name-large {
    font-size: 0.95rem;
  }
  
  .contact-details-list {
    margin-top: 0.35rem;
  }
  
  .detail-row {
    padding: 0.3rem 0;
    gap: 0.4rem;
  }
  
  .detail-icon {
    font-size: 0.9rem;
  }
  
  .detail-label {
    font-size: 0.65rem;
  }
  
  .detail-value {
    font-size: 0.8rem;
    word-break: break-all;
  }
  
  .quick-contact-bar {
    padding: 0.4rem;
    gap: 0.5rem;
  }
  
  .quick-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }
  
  .quick-name {
    font-size: 0.65rem;
  }
  
  .info-item {
    padding: 0.4rem;
    flex-direction: column;
    gap: 0.15rem;
  }
  
  .info-label,
  .info-value {
    font-size: 0.8rem;
  }
  
  .modal-bottom-actions {
    padding: 0.65rem 1rem;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    background: var(--gray-50);
  }
  
  .modal-bottom-actions .btn {
    flex: 0 1 auto;
    min-width: auto;
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
  }
  
  .contact-actions-toggle {
    padding: 0.4rem;
    font-size: 0.8rem;
  }
  
  .toggle-archived-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
}

/* Desktop */
@media (min-width: 768px) {
  .contact-actions-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== SECONDARY MODAL OVERLAY (Layer 2) ===== */
.modal-overlay.modal-overlay-secondary {
  z-index: 10300;
  background: rgba(0, 0, 0, 0.5);
}

/* ===== DESIGN B - COMPANY MODAL (Profile Card) ===== */

/* Remove body padding when Design B modals are active */
.company-modal-designB,
.contact-modal-designB {
  margin: -1.5rem;
}

.company-banner {
  background: linear-gradient(135deg, #1a5fb4 0%, #3584e4 50%, #62a0ea 100%);
  padding: 2rem 1.75rem 1.5rem;
  color: white;
  position: relative;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.company-banner .banner-name {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  padding-right: 2.5rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.company-banner .banner-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.company-banner .banner-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.company-banner .banner-badge.client {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.company-banner .banner-badge.supplier {
  background: rgba(255, 193, 7, 0.4);
  color: #fff;
}

.company-banner .banner-badge.active {
  background: rgba(40, 167, 69, 0.4);
  color: #d4edda;
}

.company-banner .banner-badge.inactive {
  background: rgba(220, 53, 69, 0.4);
  color: #f8d7da;
}

.company-banner .banner-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.company-banner .banner-close:hover {
  background: rgba(255, 255, 255, 0.4);
}

.company-stats-bar {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 0.75rem 1rem;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.company-stats-bar .stat-item {
  text-align: center;
}

.company-stats-bar .stat-value {
  font-weight: 700;
  color: var(--text-primary);
}

.company-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
}

.company-info-grid .info-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}

.company-info-grid .info-line {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.company-info-grid .info-line .info-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.company-info-grid .info-line a {
  color: var(--primary);
  text-decoration: none;
}

.company-info-grid .info-line a:hover {
  text-decoration: underline;
}

.maps-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.maps-btn:hover {
  background: var(--primary-dark, #1a56db);
  color: white !important;
  text-decoration: none;
  opacity: 0.9;
}

/* Contact card grid inside company modal */
.contact-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  padding: 0 1.5rem 1.25rem;
}

.contact-card-grid .section-header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.contact-card-grid .section-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.contact-grid-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 1rem 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.contact-grid-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.15);
  transform: translateY(-1px);
}

.contact-grid-card.primary-card {
  border-color: #ffd700;
  background: #fffef5;
}

.contact-grid-card .card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0 auto 0.5rem;
}

.contact-grid-card .card-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.contact-grid-card .card-role {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.contact-grid-card .card-primary-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  background: #ffd700;
  color: #5a4e00;
  border-radius: 10px;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.contact-grid-card .card-quick-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.contact-grid-card .card-quick-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--gray-300);
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.contact-grid-card .card-quick-btn:hover {
  border-color: var(--primary);
  background: #e8f0fe;
}

.contact-grid-card.add-card {
  border: 2px dashed var(--gray-300);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: var(--text-secondary);
}

.contact-grid-card.add-card:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.contact-grid-card.add-card .add-icon {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.contact-grid-card.add-card .add-label {
  font-size: 0.85rem;
  font-weight: 500;
}

.link-contact-item:hover {
  background: var(--gray-50, #f9fafb) !important;
}

/* Card management actions (top-right corner icons) */
.contact-grid-card .card-mgmt-actions {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  display: flex;
  gap: 0.2rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.contact-grid-card:hover .card-mgmt-actions {
  opacity: 1;
}

.contact-grid-card .card-mgmt-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--gray-300);
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  transition: all 0.2s;
  padding: 0;
}

.contact-grid-card .card-mgmt-btn:hover {
  border-color: var(--primary);
  background: #e8f0fe;
}

.contact-grid-card .card-mgmt-btn.danger:hover {
  border-color: #dc3545;
  background: #fff5f5;
}

/* Card info block (wraps name + role for mobile layout) */
.contact-grid-card .card-info-block {
  display: contents; /* On desktop, children flow normally as siblings */
}

/* Mobile bar actions (hidden on desktop, shown on mobile) */
.card-bar-actions {
  display: none;
}

/* ===== DESIGN B - CONTACT MODAL (Profile Card) ===== */
/* Contact banner (matches company banner style) */
.contact-banner {
  padding: 1.75rem 1.75rem 1.25rem;
  color: white;
  position: relative;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.contact-banner .banner-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.contact-banner .banner-info {
  flex: 1;
  min-width: 0;
}

.contact-banner .banner-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  padding-right: 2rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.contact-banner .banner-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.contact-banner .banner-badge {
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
}

.contact-banner .banner-badge.primary {
  background: rgba(255, 215, 0, 0.5);
  color: #fff;
}

.contact-banner .banner-badge.active {
  background: rgba(40, 167, 69, 0.4);
  color: #d4edda;
}

.contact-banner .banner-badge.inactive {
  background: rgba(220, 53, 69, 0.4);
  color: #f8d7da;
}

.contact-banner .banner-fav-btn {
  background: none;
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.1rem;
  transition: transform 0.2s;
  line-height: 1;
}

.contact-banner .banner-fav-btn:hover {
  transform: scale(1.2);
}

.contact-banner .banner-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.contact-banner .banner-close:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* Company link bar under contact banner */
.contact-company-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.5rem;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
}

.contact-company-link:hover {
  background: #e8f0fe;
}

.contact-role-tag {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-left: 0.5rem;
}

.contact-company-unlink {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.2s, background 0.2s;
}

.contact-company-unlink:hover {
  color: var(--danger, #dc3545);
  background: rgba(220, 53, 69, 0.1);
}

/* Info line label (for phone type) */
.info-line-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-left: 0.35rem;
}

/* Mobile adjustments for Design B */
@media (max-width: 480px) {
  /* ---- Banner: full-width, no radius, comfortable padding ---- */
  .company-modal-designB,
  .contact-modal-designB {
    margin: -0.5rem;
  }
  .company-banner {
    padding: 1.4rem 1.25rem 1.1rem;
    border-radius: 0;
  }
  .company-banner .banner-name {
    font-size: 1.15rem;
    padding-right: 2.5rem;
  }
  .company-banner .banner-close,
  .contact-banner .banner-close {
    top: 0.65rem;
    right: 0.85rem;
    width: 30px;
    height: 30px;
    font-size: 1.15rem;
  }

  .contact-banner {
    padding: 1.3rem 1.25rem 1rem;
    gap: 0.75rem;
    border-radius: 0;
  }
  .contact-banner .banner-avatar {
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
  }
  .contact-banner .banner-name {
    font-size: 1.1rem;
    padding-right: 2rem;
  }
  .contact-banner .banner-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
  }

  /* ---- Company link bar ---- */
  .contact-company-link {
    padding: 0.5rem 1.25rem;
    font-size: 0.82rem;
  }

  /* ---- Stats bar ---- */
  .company-stats-bar {
    gap: 0.25rem;
    padding: 0.5rem 1.15rem;
    font-size: 0.75rem;
  }
  .company-stats-bar .stat-value {
    font-size: 1rem;
  }

  /* ---- Info sections as card panels ---- */
  .company-info-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    padding: 0.85rem 1.25rem;
  }
  .company-info-grid > div {
    background: var(--gray-50);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    border: 1px solid var(--gray-200);
  }
  .company-info-grid .info-section-title {
    font-size: 0.65rem;
    margin-bottom: 0.45rem;
    letter-spacing: 0.6px;
  }
  .company-info-grid .info-line {
    font-size: 0.82rem;
    margin-bottom: 0.25rem;
  }
  .company-info-grid .info-line a {
    word-break: break-all;
  }
  .maps-btn {
    font-size: 0.72rem;
    padding: 0.3rem 0.65rem;
    margin-top: 0.35rem;
    border-radius: 6px;
  }

  /* ---- Contact cards (inside company modal): horizontal rows ---- */
  .contact-card-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0.35rem 1.25rem 0.75rem;
  }
  .contact-card-grid .section-header {
    padding: 0.25rem 0;
  }
  .contact-card-grid .section-header h3 {
    font-size: 0.85rem;
  }
  /* Contact card: two-row bar layout */
  .contact-grid-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    text-align: left;
    padding: 0.6rem 0.75rem;
    gap: 0.15rem 0.6rem;
    min-height: auto;
    border-radius: 8px;
  }
  /* Avatar: spans both rows */
  .contact-grid-card .card-avatar {
    width: 40px;
    height: 40px;
    font-size: 0.85rem;
    margin: 0;
    grid-row: 1 / 3;
    grid-column: 1;
  }
  /* Info block: top row, middle column */
  .contact-grid-card .card-info-block {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    grid-row: 1;
    grid-column: 2;
    min-width: 0;
  }
  .contact-grid-card .card-name {
    font-size: 0.85rem;
    margin-bottom: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .contact-grid-card .card-role {
    font-size: 0.65rem;
    margin-bottom: 0;
    color: var(--text-secondary);
    display: none;
  }
  .contact-grid-card .card-primary-badge {
    font-size: 0.6rem;
    padding: 0.08rem 0.35rem;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  /* Quick actions (phone/email): bottom row, middle column */
  .contact-grid-card .card-quick-actions {
    grid-row: 2;
    grid-column: 2;
    margin-top: 0;
    justify-content: flex-start;
    gap: 0.3rem;
  }
  .contact-grid-card .card-quick-btn {
    width: 26px;
    height: 26px;
    font-size: 0.7rem;
  }
  /* Desktop mgmt actions: hidden on mobile */
  .contact-grid-card .card-mgmt-actions {
    display: none;
  }
  /* Bar actions: top row, right column — inline small icons */
  .card-bar-actions {
    display: flex;
    gap: 0.2rem;
    grid-row: 1 / 3;
    grid-column: 3;
    align-self: center;
  }
  .card-bar-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--gray-300);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: all 0.2s;
    padding: 0;
  }
  .card-bar-btn:hover {
    border-color: var(--primary);
    background: #e8f0fe;
  }
  .contact-grid-card.add-card {
    flex-direction: row;
    min-height: auto;
    padding: 0.5rem 0.7rem;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .contact-grid-card.add-card .add-icon {
    font-size: 1.1rem;
    margin-bottom: 0;
  }
  .contact-grid-card.add-card .add-label {
    font-size: 0.78rem;
  }

  /* ---- Bottom actions: small pills ---- */
  .modal-bottom-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.6rem 1.25rem;
    justify-content: center;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    margin-top: 0.5rem;
  }
  .modal-bottom-actions .btn,
  .modal-bottom-actions .btn-sm {
    flex: 0 1 auto;
    min-width: auto;
    padding: 0.35rem 0.6rem;
    font-size: 0.72rem;
    border-radius: 20px;
    white-space: nowrap;
    box-shadow: none;
  }
  .modal-bottom-actions .btn-primary {
    padding: 0.35rem 0.75rem;
  }
  .modal-bottom-actions .btn-danger {
    padding: 0.35rem 0.6rem;
  }
}

/* ===== SECONDARY MODAL OVERLAY (Layer 2) ===== */
.modal-overlay.modal-overlay-secondary {
  z-index: 10300;
  background: rgba(0, 0, 0, 0.5);
}

/* ===== DESIGN B - COMPANY MODAL (Profile Card) ===== */

/* Remove body padding when Design B modals are active */
.company-modal-designB,
.contact-modal-designB {
  margin: -1.5rem;
}

.company-banner {
  background: linear-gradient(135deg, #1a5fb4 0%, #3584e4 50%, #62a0ea 100%);
  padding: 2rem 1.75rem 1.5rem;
  color: white;
  position: relative;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.company-banner .banner-name {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  padding-right: 2.5rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.company-banner .banner-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.company-banner .banner-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.company-banner .banner-badge.client {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.company-banner .banner-badge.supplier {
  background: rgba(255, 193, 7, 0.4);
  color: #fff;
}

.company-banner .banner-badge.active {
  background: rgba(40, 167, 69, 0.4);
  color: #d4edda;
}

.company-banner .banner-badge.inactive {
  background: rgba(220, 53, 69, 0.4);
  color: #f8d7da;
}

.company-banner .banner-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.company-banner .banner-close:hover {
  background: rgba(255, 255, 255, 0.4);
}

.company-stats-bar {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 0.75rem 1rem;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.company-stats-bar .stat-item {
  text-align: center;
}

.company-stats-bar .stat-value {
  font-weight: 700;
  color: var(--text-primary);
}

.company-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
}

.company-info-grid .info-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}

.company-info-grid .info-line {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.company-info-grid .info-line .info-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.company-info-grid .info-line a {
  color: var(--primary);
  text-decoration: none;
}

.company-info-grid .info-line a:hover {
  text-decoration: underline;
}

.maps-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.maps-btn:hover {
  background: var(--primary-dark);
  color: white;
  text-decoration: none;
}

/* Contact card grid inside company modal */
.contact-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  padding: 0 1.5rem 1.25rem;
}

.contact-card-grid .section-header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.contact-card-grid .section-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.contact-grid-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 1rem 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.contact-grid-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.15);
  transform: translateY(-1px);
}

.contact-grid-card.primary-card {
  border-color: #ffd700;
  background: #fffef5;
}

.contact-grid-card .card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0 auto 0.5rem;
}

.contact-grid-card .card-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.contact-grid-card .card-role {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.contact-grid-card .card-primary-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  background: #ffd700;
  color: #5a4e00;
  border-radius: 10px;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.contact-grid-card .card-quick-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.contact-grid-card .card-quick-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--gray-300);
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.contact-grid-card .card-quick-btn:hover {
  border-color: var(--primary);
  background: #e8f0fe;
}

.contact-grid-card.add-card {
  border: 2px dashed var(--gray-300);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: var(--text-secondary);
}

.contact-grid-card.add-card:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.contact-grid-card.add-card .add-icon {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.contact-grid-card.add-card .add-label {
  font-size: 0.85rem;
  font-weight: 500;
}

/* Card management actions (top-right corner icons) */
.contact-grid-card .card-mgmt-actions {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  display: flex;
  gap: 0.2rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.contact-grid-card:hover .card-mgmt-actions {
  opacity: 1;
}

.contact-grid-card .card-mgmt-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--gray-300);
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  transition: all 0.2s;
  padding: 0;
}

.contact-grid-card .card-mgmt-btn:hover {
  border-color: var(--primary);
  background: #e8f0fe;
}

.contact-grid-card .card-mgmt-btn.danger:hover {
  border-color: #dc3545;
  background: #fff5f5;
}

/* ===== DESIGN B - CONTACT MODAL (Profile Card) ===== */
/* Contact banner (matches company banner style) */
.contact-banner {
  padding: 1.75rem 1.75rem 1.25rem;
  color: white;
  position: relative;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.contact-banner .banner-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.contact-banner .banner-info {
  flex: 1;
  min-width: 0;
}

.contact-banner .banner-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  padding-right: 2rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.contact-banner .banner-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.contact-banner .banner-badge {
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
}

.contact-banner .banner-badge.primary {
  background: rgba(255, 215, 0, 0.5);
  color: #fff;
}

.contact-banner .banner-badge.active {
  background: rgba(40, 167, 69, 0.4);
  color: #d4edda;
}

.contact-banner .banner-badge.inactive {
  background: rgba(220, 53, 69, 0.4);
  color: #f8d7da;
}

.contact-banner .banner-fav-btn {
  background: none;
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.1rem;
  transition: transform 0.2s;
  line-height: 1;
}

.contact-banner .banner-fav-btn:hover {
  transform: scale(1.2);
}

.contact-banner .banner-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.contact-banner .banner-close:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* Company link bar under contact banner */
.contact-company-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.5rem;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
}

.contact-company-link:hover {
  background: #e8f0fe;
}

.contact-role-tag {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-left: auto;
}

/* Info line label (for phone type) */
.info-line-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-left: 0.35rem;
}

/* Mobile adjustments for Design B */
@media (max-width: 480px) {
  .company-banner .banner-name {
    font-size: 1.2rem;
  }
  
  .company-info-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }
  
  .contact-card-grid {
    grid-template-columns: 1fr;
    padding: 0 1rem 1rem;
  }
  
  .company-stats-bar {
    gap: 1rem;
    font-size: 0.8rem;
  }
  
  .contact-banner {
    padding: 1.25rem 1.25rem 1rem;
    gap: 0.75rem;
  }
  
  .contact-banner .banner-avatar {
    width: 50px;
    height: 50px;
    font-size: 1.15rem;
  }
  
  .contact-banner .banner-name {
    font-size: 1.2rem;
  }
}

/* ===== QUICK STATS ===== */
.stats-grid-mini {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card-mini {
  background: var(--gray-50);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon-mini {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 8px;
}

.stat-content-mini {
  flex: 1;
}

.stat-value-mini {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label-mini {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
  margin-bottom: 2rem;
}

.quick-actions h4 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  background: white;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.action-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
}

.action-icon {
  font-size: 2rem;
}

.action-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* ===== RECENT ORDERS ===== */
.recent-section {
  margin-top: 2rem;
}

.recent-section h4 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: 8px;
}

.recent-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.recent-item-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-ordered { background: #e3f2fd; color: #1976d2; }
.status-received { background: #e8f5e9; color: #388e3c; }
.status-partial_received { background: #fff3e0; color: #f57c00; }
.status-cancelled { background: #ffebee; color: #d32f2f; }

/* ===== CONTACT DETAIL MODAL ===== */
.contact-detail {
  padding: 1rem;
}

.contact-detail-header {
  display: flex;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 1.5rem;
}

.contact-detail-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.contact-detail-info {
  flex: 1;
}

.contact-detail-info h2 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}

.contact-company-name {
  color: var(--text-secondary);
  margin: 0.25rem 0;
  font-size: 0.95rem;
}

.contact-role {
  color: var(--text-secondary);
  font-style: italic;
  margin: 0.25rem 0;
}

.contact-badges {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.active-badge {
  background: #e8f5e9;
  color: #388e3c;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
}

.contact-detail-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-detail-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.history-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.history-section:last-child {
  border-bottom: none;
}

.history-section h4 {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.notes-section {
  margin-bottom: 1.5rem;
}

.notes-section h4 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

/* Hide ALL loading spinners in contacts/companies view - ULTRA AGGRESSIVE */
#view-contacts .loading,
#view-contacts .spinner,
#view-contacts [class*="loading"],
#view-contacts [class*="spinner"],
#view-contacts #companies-main-content .loading,
#view-contacts #companies-main-content .spinner,
#view-contacts #main-content.loading,
#view-contacts #main-content .loading,
#view-contacts #main-content .spinner,
#view-companies .loading,
#view-companies .spinner,
#view-companies [class*="loading"],
#view-companies [class*="spinner"],
#view-companies #companies-main-content .loading,
#view-companies #companies-main-content .spinner,
#view-companies #main-content.loading,
#view-companies #main-content .loading,
#view-companies #main-content .spinner {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* Ensure companies-main-content is visible */
#view-contacts #companies-main-content,
#view-companies #companies-main-content {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100% !important;
  position: relative !important;
}

.companies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.company-card {
  background: white;
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
}

.company-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-color: var(--primary);
}

.company-card.type-supplier {
  border-left: 4px solid #ffd700;
}

.company-card.type-client {
  border-left: 4px solid #00d4ff;
}

.company-card-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.company-avatar {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.company-avatar.avatar-gold {
  background: linear-gradient(135deg, #ffd700, #f4a900);
  color: #333;
}

.company-avatar.avatar-blue {
  background: linear-gradient(135deg, #00d4ff, #0099cc);
  color: white;
}

.company-info {
  flex: 1;
  min-width: 0;
}

.company-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--gray-600);
}

.type-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-weight: 500;
}

.type-badge.type-supplier {
  background: rgba(255, 215, 0, 0.2);
  color: #b8860b;
}

.type-badge.type-client {
  background: rgba(0, 212, 255, 0.2);
  color: #0099cc;
}

.company-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.primary-contact,
.company-phone,
.company-email {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-700);
}

.company-email span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-100);
  font-size: 0.8rem;
  color: var(--gray-500);
}

.contact-count {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.inactive-badge {
  background: rgba(255,0,0,0.1);
  color: #c00;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
}

/* Filters Bar */
.filters-bar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.filters-bar .search-box {
  max-width: 500px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 250px;
  max-width: 400px;
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
}

.search-box .form-input {
  padding-left: 40px;
}

.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--gray-300);
  background: white;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.pill:hover {
  border-color: var(--primary);
  background: var(--gray-50);
}

.pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.pill .count {
  background: rgba(0,0,0,0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  font-size: 0.75rem;
}

.pill.active .count {
  background: rgba(255,255,255,0.3);
}

/* Company Detail Modal */
.company-detail {
  max-height: 70vh;
  overflow-y: auto;
}

.detail-section {
  margin-bottom: 1.5rem;
}

.detail-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-item .label {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.detail-item a {
  color: var(--primary);
  text-decoration: none;
}

.detail-item a:hover {
  text-decoration: underline;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-header h3 {
  margin: 0;
  font-size: 1rem;
}

.status-active {
  color: #2ed573;
}

.status-inactive {
  color: #ff6b81;
}

/* Contacts List in Company Detail */
.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: 8px;
  transition: background 0.2s;
}

.contact-item:hover {
  background: var(--gray-100);
}

.contact-item.is-primary {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.contact-item.is-inactive {
  opacity: 0.6;
}

.contact-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.contact-info {
  flex: 1;
  min-width: 0;
}

.contact-name {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.primary-badge {
  font-size: 0.7rem;
  background: #ffd700;
  color: #333;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.contact-meta {
  font-size: 0.8rem;
  color: var(--gray-600);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.contact-meta a {
  color: var(--primary);
  text-decoration: none;
}

.contact-meta a:hover {
  text-decoration: underline;
}

.contact-actions {
  display: flex;
  gap: 0.25rem;
}

.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.load-more-container {
  text-align: center;
  padding: 2rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .companies-grid {
    grid-template-columns: 1fr;
  }
  
  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-box {
    max-width: 100%;
  }
  
  .filter-pills {
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }
  
  .company-detail {
    max-height: calc(100vh - 200px);
  }
  
  .contact-item {
    flex-wrap: wrap;
  }
  
  .contact-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-200);
  }
}

/* =============================================
   PRODUCT SELECTOR - Command Palette Style (Light Theme)
   ============================================= */

.ps-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8vh;
  z-index: 10250; /* Above modal-overlay (10200), below modal-overlay-secondary (10300) */
  animation: psOverlayIn 0.15s ease-out;
}

@keyframes psOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ps-modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: psModalIn 0.2s ease-out;
  margin: 0 1rem;
}

.ps-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
  flex-shrink: 0;
}
.ps-modal-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--gray-800, #1f2937);
}
.ps-modal-close {
  background: var(--gray-100, #f3f4f6);
  border: 1px solid var(--gray-200, #e5e7eb);
  color: var(--gray-600, #4b5563);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0;
}
.ps-modal-close:hover {
  background: var(--gray-200, #e5e7eb);
  color: var(--gray-700, #374151);
}

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

/* Search Container */
.ps-search-container {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--gray-50);
  flex-shrink: 0;
}

.ps-search-icon {
  font-size: 1.25rem;
  opacity: 0.6;
}

.ps-search-input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--gray-800);
  outline: none;
}

.ps-search-input::placeholder {
  color: var(--gray-400);
}

.ps-empty-add-btn {
  margin-top: 1rem;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.ps-empty-add-btn:hover {
  background: var(--primary-dark, #1d4ed8);
  opacity: 0.95;
}

.ps-keyboard-hint {
  display: flex;
  gap: 0.25rem;
  color: var(--gray-400);
  font-size: 0.75rem;
}

.ps-keyboard-hint kbd,
.ps-modal kbd {
  background: var(--gray-100);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--gray-300);
  font-family: monospace;
  font-size: 0.7rem;
  color: var(--gray-600);
}

/* Results Container - flexes to fill space, scrolls when needed */
.ps-results-container {
  flex: 1;
  min-height: 0;
  max-height: 350px;
  overflow-y: auto;
  background: white;
}

/* Section */
.ps-section {
  padding: 0.5rem;
}

.ps-section-title {
  padding: 0.5rem 0.75rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-500);
  display: flex;
  justify-content: space-between;
}

.ps-nav-hint {
  font-weight: normal;
  color: var(--gray-400);
}

/* Result Item */
.ps-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  margin: 0 0.5rem 0.25rem;
}

.ps-result-item:hover {
  background: var(--gray-100);
}

.ps-result-item.focused {
  background: var(--primary);
  border-color: var(--primary);
}

.ps-result-item.selected {
  background: rgba(34, 197, 94, 0.1);
  border-color: var(--success);
}

.ps-result-item.focused.selected {
  background: var(--success);
}

.ps-result-item.focused .ps-result-sku,
.ps-result-item.focused .ps-result-meta,
.ps-result-item.focused .ps-result-price,
.ps-result-item.focused .ps-result-name {
  color: white;
}

.ps-result-icon {
  width: 36px;
  height: 36px;
  background: var(--gray-100);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.ps-result-item.focused .ps-result-icon {
  background: rgba(255, 255, 255, 0.2);
}

.ps-product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  /* Prevent flickering on re-render */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.ps-product-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

/* Clickable image for product details */
.ps-clickable-image {
  position: relative;
  cursor: zoom-in;
  border-radius: 8px;
  transition: box-shadow 0.15s ease;
}

.ps-clickable-image:hover {
  box-shadow: 0 0 0 3px var(--primary);
}

.ps-result-content {
  flex: 1;
  min-width: 0;
}

.ps-result-main {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ps-result-sku {
  font-family: 'Consolas', monospace;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
}

.ps-result-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--gray-700);
  font-size: 0.9rem;
}

.ps-result-description {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.ps-result-item.focused .ps-result-description {
  color: rgba(255, 255, 255, 0.8);
}

.ps-result-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.1rem;
  flex-wrap: wrap;
}

.ps-result-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.ps-stock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.ps-stock-dot.stock-high { background: var(--success); }
.ps-stock-dot.stock-low { background: var(--warning); }
.ps-stock-dot.stock-out { background: var(--danger); }

.ps-result-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  flex-shrink: 0;
}

.ps-result-price {
  font-weight: 600;
  color: var(--gray-700);
  font-size: 0.85rem;
}

.ps-result-action {
  font-size: 0.7rem;
  color: var(--gray-400);
}

.ps-result-item.focused .ps-result-action {
  color: rgba(255, 255, 255, 0.8);
}

.ps-result-qty-badge {
  background: var(--success);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

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

.ps-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.4;
}

.ps-hint {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-top: 0.5rem;
}

/* Commands Bar */
.ps-commands-bar {
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: var(--gray-50);
  flex-shrink: 0;
}

.ps-command-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.15s;
}

.ps-command-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.ps-command-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Footer */
.ps-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  flex-shrink: 0;
}

.ps-cart-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ps-cart-text {
  font-size: 0.85rem;
  color: var(--gray-500);
}

.ps-cart-text strong {
  color: var(--gray-800);
  font-size: 1rem;
}

.ps-footer-actions {
  display: flex;
  gap: 0.5rem;
}

.ps-btn-cancel {
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  color: var(--gray-600);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.ps-btn-cancel:hover {
  background: var(--gray-100);
}

.ps-btn-confirm {
  padding: 0.5rem 1.25rem;
  background: var(--primary);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.ps-btn-confirm:hover:not(:disabled) {
  filter: brightness(1.1);
}

.ps-btn-confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =============================================
   CREATE TICKET WIZARD - PRODUCT LIST
   ============================================= */

.wizard-product-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.product-image-container {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wizard-product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wizard-product-placeholder {
  font-size: 1.5rem;
}

.product-info {
  flex: 1;
  min-width: 0;
}

.product-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-code {
  font-family: 'Consolas', monospace;
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 0.15rem;
}

.product-quantity {
  display: flex;
  align-items: center;
}

.quantity-input {
  width: 60px;
  padding: 0.5rem;
  text-align: center;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
}

.btn-remove {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--danger);
  color: white;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.btn-remove:hover {
  filter: brightness(1.1);
}

/* Review Step - Products with Images */
.review-products-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.review-product-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
}

.review-product-image {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
}

.review-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.review-product-placeholder {
  font-size: 1.2rem;
}

.review-product-info {
  flex: 1;
  min-width: 0;
}

.review-product-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-product-code {
  font-family: 'Consolas', monospace;
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.15rem;
}

.review-product-qty {
  font-weight: 600;
  color: var(--primary);
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* =============================================
   QUANTITY MODAL - Keyboard/Mobile Input
   ============================================= */

.qty-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10260; /* Above ps-overlay (10250), below modal-overlay-secondary (10300) */
  padding: 1rem;
  overflow-y: auto;
}

.qty-modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.qty-modal-header {
  padding: 1rem;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.qty-modal-image {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-modal-product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qty-modal-image-placeholder {
  font-size: 2.5rem;
}

.qty-modal-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.qty-modal-personalKey {
  font-family: 'Consolas', monospace;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
}

.qty-modal-sku {
  font-family: 'Consolas', monospace;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.qty-modal-name {
  display: block;
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qty-modal-description {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: var(--gray-50);
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--gray-600);
  line-height: 1.4;
}

.qty-modal-description .description-text {
  display: block;
  margin-bottom: 0.25rem;
}

.qty-modal-description .description-toggle {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  font-weight: 500;
}

.qty-modal-description .description-toggle:hover {
  color: var(--primary-dark);
}

.qty-modal-body {
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
}

/* Single-item layout: title + quantity/unit row + comment below */
.qty-modal-single {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}
.qty-modal-single .qty-single-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-800, #1f2937);
  margin: 0 0 0.25rem 0;
}
.qty-modal-single .qty-single-row {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 12px;
}
.qty-modal-single .qty-single-row .qty-input-group {
  flex: 1;
  min-width: 0;
}
.qty-modal-single .qty-modal-input,
.qty-modal-single .qty-modal-select {
  min-height: 44px;
}
.qty-modal-single .qty-notes-group {
  margin-top: 0;
}

.qty-modal-body:has(.qty-modal-single) {
  flex-direction: column;
  align-items: stretch;
}

.qty-input-group {
  flex: 1;
}

.qty-input-group label {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.qty-modal-input {
  width: 100%;
  padding: 0.75rem;
  font-size: 1.5rem;
  text-align: center;
  border: 2px solid var(--gray-300);
  border-radius: 8px;
  font-weight: 600;
}

.qty-modal-input:focus {
  outline: none;
  border-color: var(--primary);
}

.qty-modal-select {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid var(--gray-300);
  border-radius: 8px;
  background: white;
}

.qty-modal-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Segmented product section - clear, big, mobile-friendly */
.qty-modal-segments { margin-top: 0; }
.qty-modal-segments .qty-segments-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-800, #1f2937);
  margin: 0 0 0.35rem 0;
}
.qty-modal-segments .qty-segments-intro {
  font-size: 0.95rem;
  color: var(--gray-600, #4b5563);
  margin-bottom: 1rem;
  line-height: 1.4;
}
.qty-segment-rows {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.qty-segment-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1rem;
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 12px;
}
.qty-segment-field {
  flex: 1;
  min-width: 0;
}
.qty-segment-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-600, #4b5563);
  margin-bottom: 0.4rem;
}
.qty-segment-row .qty-segment-length,
.qty-segment-row .qty-segment-count {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  font-size: 1.1rem;
  border: 2px solid var(--gray-300, #d1d5db);
  border-radius: 8px;
  font-weight: 500;
}
.qty-segment-row--roll .qty-segment-length {
  background: var(--gray-100, #f3f4f6);
  color: var(--gray-500, #6b7280);
  cursor: not-allowed;
  border-color: var(--gray-200, #e5e7eb);
}
.qty-segment-row--roll .qty-segment-length:focus {
  border-color: var(--gray-200, #e5e7eb);
  outline: none;
}
.qty-segment-row .qty-segment-length:focus,
.qty-segment-row .qty-segment-count:focus {
  outline: none;
  border-color: var(--primary);
}
.qty-segment-row .qty-segment-unit {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  border: 2px solid var(--gray-300, #d1d5db);
  border-radius: 8px;
  background: white;
}
.qty-segment-row .qty-segment-unit:focus {
  outline: none;
  border-color: var(--primary);
}
.qty-segment-times {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-500, #6b7280);
  align-self: center;
  padding-bottom: 0.5rem;
}
.qty-segment-remove {
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem;
  background: white;
  border: 2px solid var(--gray-300, #d1d5db);
  border-radius: 8px;
  cursor: pointer;
  color: var(--gray-600, #4b5563);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-segment-remove:hover {
  background: #fef2f2;
  border-color: var(--danger, #dc2626);
  color: var(--danger, #dc2626);
}
.qty-segment-add {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  background: white;
  border: 2px dashed var(--gray-300, #d1d5db);
  border-radius: 10px;
  color: var(--gray-600, #4b5563);
  cursor: pointer;
  margin-bottom: 1rem;
}
.qty-segment-add:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--gray-50, #f9fafb);
}
.qty-segment-summary {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  padding: 0.75rem 1rem;
  background: rgba(var(--primary-rgb, 59, 130, 246), 0.08);
  border-radius: 8px;
  border: 1px solid rgba(var(--primary-rgb, 59, 130, 246), 0.2);
}
.qty-notes-group label { font-size: 0.9rem; font-weight: 600; color: var(--gray-700, #374151); }
.qty-modal-notes {
  width: 100%;
  min-height: 44px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--gray-300, #d1d5db);
  border-radius: 8px;
  margin-top: 0.35rem;
}
.qty-modal-notes:focus {
  outline: none;
  border-color: var(--primary);
}
.qty-modal.qty-modal-segmented .qty-modal-body { flex-direction: column; align-items: stretch; }
.qty-modal.qty-modal-segmented { max-width: 420px; }

/* Segmented modal: cap height and scroll body when many segments */
.qty-modal.qty-modal-segmented {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.qty-modal.qty-modal-segmented .qty-modal-header,
.qty-modal.qty-modal-segmented .qty-modal-footer,
.qty-modal.qty-modal-segmented .qty-hint {
  flex-shrink: 0;
}
.qty-modal.qty-modal-segmented .qty-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.qty-modal-footer {
  padding: 0.75rem 1rem;
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid var(--gray-200);
}

.qty-btn-remove {
  padding: 0.65rem 1rem;
  background: white;
  border: 1px solid var(--danger);
  border-radius: 8px;
  color: var(--danger);
  font-size: 0.9rem;
  cursor: pointer;
}

.qty-btn-confirm {
  flex: 1;
  padding: 0.65rem 1rem;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.qty-btn-confirm:hover {
  filter: brightness(1.1);
}

.qty-hint {
  padding: 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--gray-400);
  background: var(--gray-50);
}

.qty-hint kbd {
  background: var(--gray-200);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.7rem;
}

/* =============================================
   QUANTITY MODAL - MOBILE RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
  /* Position modal at top to avoid keyboard overlap */
  .qty-modal-overlay {
    align-items: flex-start !important;
    padding: 1rem 1rem 0 1rem !important;
  }
  
  .qty-modal {
    margin-top: 0 !important;
    max-height: 60vh !important;
    overflow-y: auto !important;
  }
  
  /* Hide desktop keyboard hints */
  .qty-hint {
    display: none;
  }
  
  /* Larger input for easier tapping */
  .qty-modal-input {
    font-size: 2rem;
    padding: 1rem;
  }
  
  .qty-modal-select {
    font-size: 1.1rem;
    padding: 1rem;
  }
  
  /* Larger modal image on mobile */
  .qty-modal-image {
    width: 120px;
    height: 120px;
  }
  
  .qty-modal-image-placeholder {
    font-size: 3rem;
  }
  
  /* Adjust button sizes */
  .qty-btn-remove,
  .qty-btn-confirm {
    padding: 1rem;
    font-size: 1rem;
  }
  
  /* Add safe area padding for Android navigation bar */
  .qty-modal-footer {
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
  }
  
  /* Segmented: bigger text and touch targets */
  .qty-modal-segmented .qty-segments-title { font-size: 1.2rem; }
  .qty-modal-segmented .qty-segments-intro { font-size: 1rem; }
  .qty-segment-row {
    padding: 1.1rem;
    gap: 0.85rem;
  }
  .qty-segment-row .qty-segment-length,
  .qty-segment-row .qty-segment-count {
    min-height: 48px;
    font-size: 1.2rem;
    padding: 0.75rem;
  }
  .qty-segment-row .qty-segment-unit {
    min-height: 48px;
    font-size: 1.1rem;
    padding: 0.75rem;
  }
  .qty-segment-add {
    min-height: 48px;
    padding: 1rem;
    font-size: 1.05rem;
  }
  .qty-segment-summary { font-size: 1.05rem; padding: 1rem; }
  .qty-modal-notes { min-height: 48px; font-size: 1.05rem; padding: 0.85rem 1rem; }
  .qty-modal.qty-modal-segmented { max-width: 100%; }
  /* Single-item: bigger touch targets */
  .qty-modal-single .qty-single-title { font-size: 1.2rem; }
  .qty-modal-single .qty-single-row { padding: 1.1rem; }
  .qty-modal-single .qty-modal-input,
  .qty-modal-single .qty-modal-select { min-height: 48px; font-size: 1.1rem; padding: 0.75rem; }
  .qty-modal-single .qty-modal-notes { min-height: 48px; font-size: 1.05rem; }
}

/* =============================================
   PRODUCT SELECTOR - MOBILE RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
  /* Full-screen modal */
  .ps-overlay {
    padding-top: 0;
    align-items: stretch;
  }
  
  .ps-modal {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  
  /* Expandable results */
  .ps-results-container {
    flex: 1;
    max-height: none;
  }
  
  /* Larger tap targets - 48px icons */
  .ps-result-item {
    margin: 0.25rem 0.5rem;
    padding: 1rem;
    gap: 1rem;
  }
  
  .ps-result-icon {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }
  
  .ps-result-personalKey {
    font-size: 0.95rem;
  }
  
  .ps-result-name {
    font-size: 0.9rem;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  
  .ps-result-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  /* Hide desktop keyboard hints */
  .ps-keyboard-hint {
    display: none;
  }
  
  /* Stack command chips vertically */
  .ps-commands-bar {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    flex-wrap: nowrap;
  }
  
  .ps-command-chip {
    width: 100%;
    justify-content: center;
    padding: 0.65rem;
    font-size: 0.9rem;
    flex-shrink: 0;
  }
  
  /* Footer adjustments */
  .ps-footer {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }
  
  .ps-cart-preview {
    width: 100%;
    text-align: center;
  }
  
  .ps-footer-actions {
    width: 100%;
    display: flex;
    gap: 0.75rem;
  }
  
  .ps-btn-cancel {
    flex: 1;
    padding: 0.75rem;
    font-size: 1rem;
  }
  
  .ps-btn-confirm {
    flex: 2;
    padding: 0.75rem;
    font-size: 1rem;
    justify-content: center;
  }
}

/* Large screen: bigger modal and images */
@media (min-width: 1200px) {
  .ps-modal {
    max-width: 900px;
  }
  
  .ps-results-container {
    max-height: 500px;
  }
  
  .ps-result-item {
    padding: 0.85rem 1rem;
    gap: 1rem;
  }
  
  .ps-result-icon {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
  }
  
  .ps-product-image {
    width: 64px;
    height: 64px;
  }
  
  .ps-result-personalKey {
    font-size: 0.95rem;
  }
  
  .ps-result-name {
    font-size: 1rem;
  }
  
  .ps-result-description {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
  }
}

/* List filter section improvements */
.list-filter-section {
  margin: 0;
}

.pill.add-group-pill {
  background: var(--gray-100);
  border: 2px dashed var(--gray-300);
  color: var(--gray-600);
}

.pill.add-group-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Desktop: hide mobile add group button */
@media (min-width: 769px) {
  .mobile-add-group {
    display: none !important;
  }
  
  .list-filter-dropdown {
    display: none !important;
  }
}

/* Contact Form Styles */
.contact-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 576px) {
  .contact-form .form-row {
    grid-template-columns: 1fr;
  }
}

.contact-form .form-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}

.contact-form .section-header-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.contact-form .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.contact-form .checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Custom Fields */
.custom-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.custom-field-row .form-input {
  font-size: 0.9rem;
  padding: 0.5rem;
}

/* ===== New Contact Modal (Design 2) ===== */

/* Section titles */
.ncm-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ncm-section-divider {
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}
.ncm-section {
  margin-bottom: 1.25rem;
}

/* Dynamic phone rows */
.ncm-phone-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
}
.ncm-phone-type {
  width: 130px;
  flex-shrink: 0;
  padding: 0.6rem 0.5rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 0.825rem;
  color: var(--gray-700);
  background: white;
  cursor: pointer;
}
.ncm-phone-type:focus {
  outline: none;
  border-color: var(--primary);
}
.ncm-phone-input {
  flex: 1;
}
.ncm-phone-remove {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: var(--gray-100);
  color: var(--gray-400);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.ncm-phone-remove:hover {
  background: var(--danger-light, #fee2e2);
  color: var(--danger);
}
.ncm-add-phone-btn {
  background: none;
  border: 1.5px dashed var(--gray-300);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: all 0.15s;
  margin-bottom: 0.875rem;
}
.ncm-add-phone-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* Company search dropdown */
.ncm-company-search-wrap {
  position: relative;
}
.ncm-company-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  max-height: 220px;
  overflow-y: auto;
  z-index: 20;
  margin-top: 4px;
  display: none;
}
.ncm-company-dropdown.visible { display: block; }
.ncm-dropdown-item {
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--gray-50);
}
.ncm-dropdown-item:hover { background: var(--gray-50); }
.ncm-dropdown-item:last-child { border-bottom: none; }
.ncm-dropdown-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  background: var(--gray-100);
}
.ncm-dropdown-icon.create {
  background: var(--primary-light);
  color: var(--primary);
}
.ncm-dropdown-text { flex: 1; }
.ncm-dropdown-sub {
  font-size: 0.72rem;
  color: var(--gray-400);
}
.ncm-dropdown-create {
  color: var(--primary);
  font-weight: 600;
}
.ncm-company-selected {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--primary-light);
  border: 1.5px solid var(--primary);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 500;
}
.ncm-company-selected .ncm-company-change {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: underline;
  font-weight: 600;
}

/* Inline new company form */
.ncm-new-company-form {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 1rem;
  margin-top: 0.75rem;
  display: none;
}
.ncm-new-company-form.visible { display: block; }
.ncm-new-company-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-600);
  margin-bottom: 0.75rem;
}

/* Tags input */
.ncm-tags-input {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding: 0.4rem 0.5rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  min-height: 38px;
  align-items: center;
  background: white;
}
.ncm-tags-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}
.ncm-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
}
.ncm-tag-remove {
  cursor: pointer;
  font-size: 0.7rem;
  opacity: 0.7;
  background: none;
  border: none;
  color: var(--primary);
  padding: 0;
  margin-left: 2px;
}
.ncm-tag-remove:hover { opacity: 1; }
.ncm-tags-input input {
  border: none;
  outline: none;
  flex: 1;
  min-width: 80px;
  font-size: 0.8rem;
  background: transparent;
}

/* Checkbox row */
.ncm-checkbox-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.ncm-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--gray-600);
  cursor: pointer;
}
.ncm-checkbox-label input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* Dynamic email rows */
.ncm-email-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
}
.ncm-email-row .ncm-email-input {
  flex: 1;
}

/* Responsive */
@media (max-width: 576px) {
  .ncm-phone-row { flex-wrap: wrap; }
  .ncm-phone-type { width: 100%; }
  .ncm-checkbox-row { flex-direction: column; gap: 0.5rem; }
}

/* ===== End New Contact Modal ===== */

.custom-field-row .btn-danger {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

#custom-fields-container:empty::after {
  content: "Aucun champ personnalisé";
  color: var(--gray-500);
  font-size: 0.85rem;
  font-style: italic;
}

/* Phone Input Mask */
.form-input.phone-mask {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
  letter-spacing: 0.5px;
}

/* Project Contacts Section */
.project-contacts-section {
  background: var(--gray-50);
  border-radius: 8px;
  padding: 1rem;
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-header-row h4 {
  margin: 0;
}

.section-actions {
  display: flex;
  gap: 0.5rem;
}

.contact-circles-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.contact-circle-item {
  position: relative;
  cursor: pointer;
}

.contact-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.contact-circle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.remove-contact-btn {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #dc3545;
  color: white;
  border: 2px solid white;
  font-size: 12px;
  line-height: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.contact-circle-item:hover .remove-contact-btn {
  opacity: 1;
}

.contact-circle-more {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gray-300);
  color: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.contact-circle-more:hover {
  background: var(--gray-400);
}

/* Contact Search Modal */
.contact-search-modal {
  max-height: 60vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Selection tabs (Contacts / Entreprises) */
.selection-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
  background: var(--gray-100, #f3f4f6);
  border-radius: 10px;
}

.selection-tab {
  flex: 1;
  padding: 0.625rem 1rem;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600, #4b5563);
  cursor: pointer;
  transition: all 0.2s;
}

.selection-tab:hover {
  color: var(--gray-900, #111827);
}

.selection-tab.active {
  background: white;
  color: var(--primary, #2563eb);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Company item in search results */
.contact-search-item.company-item {
  border-left: 3px solid #00d4ff;
}

.search-input-container {
  margin-bottom: 1rem;
}

.contact-search-results {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
}

.contact-search-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.contact-search-item:hover {
  background: var(--gray-100);
}

.contact-search-item.is-linked {
  background: #e8f5e9;
  cursor: default;
}

.contact-search-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.contact-search-info {
  flex: 1;
  min-width: 0;
}

.contact-search-name {
  font-weight: 600;
  color: var(--gray-800);
}

.contact-search-company {
  font-size: 0.85rem;
  color: var(--gray-600);
}

.contact-search-email {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.contact-search-action {
  flex-shrink: 0;
}

.linked-badge {
  background: #28a745;
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Unified Contact Selector Modal */
.contact-selector-modal {
  max-width: 560px;
  width: 95%;
}

.cs-create-new {
  border-top: 1px dashed var(--gray-200, #e5e7eb);
  margin-top: 0.25rem;
  padding-top: 0.75rem;
}

.cs-create-new .contact-search-name {
  color: var(--success, #16a34a);
}

/* Project Filter Banner */
.project-filter-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.project-filter-icon {
  font-size: 1.2rem;
}

.project-filter-text {
  flex: 1;
}

.project-filter-banner .btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
}

.project-filter-banner .btn:hover {
  background: rgba(255,255,255,0.3);
}

/* Most Viewed Section */
.contacts-most-viewed-section {
  margin: 2rem 0;
}

.contacts-most-viewed-section .section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-800);
}

.contacts-most-viewed-section .section-subtitle {
  font-size: 0.85rem;
  color: var(--gray-500);
}

/* Visit count badge */
.visit-count-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.contact-card-horizontal {
  position: relative;
}

/* ========================================
   CATALOGUE VIEW STYLES
   ======================================== */

.catalogue-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

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

.catalogue-stat {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.catalogue-stat .stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.catalogue-stat .stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.catalogue-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.catalogue-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.catalogue-filter-btn {
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.catalogue-filter-btn:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

.catalogue-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.catalogue-search {
  flex: 1;
  min-width: 200px;
}

.catalogue-search .form-input {
  width: 100%;
}

.catalogue-results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.catalogue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.catalogue-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.catalogue-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.catalogue-card-image {
  width: 100%;
  height: 140px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}

.catalogue-card-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.catalogue-card-image .image-count-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: white;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 10px;
}

.catalogue-card-image {
  position: relative;
}

.catalogue-has-image {
  opacity: 0.6;
  margin-left: 0.25rem;
}

/* Product Gallery in Modal */
.product-gallery {
  margin-bottom: 1.5rem;
}

.product-gallery-main {
  width: 100%;
  height: 250px;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.product-gallery-main img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-gallery-thumbnails {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem;
}

.gallery-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  background: #fff;
  transition: all 0.2s;
  flex-shrink: 0;
}

.gallery-thumb:hover {
  border-color: var(--primary);
  opacity: 0.8;
}

.gallery-thumb.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.3);
}

.catalogue-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.catalogue-supplier-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  color: white;
}

.catalogue-price {
  font-weight: 700;
  color: var(--success);
  font-size: 1.1rem;
}

.catalogue-card-body {
  padding: 1rem;
}

.catalogue-product-name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.catalogue-product-details {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.catalogue-detail {
  display: flex;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.catalogue-detail .detail-label {
  color: var(--text-secondary);
  min-width: 70px;
}

.catalogue-detail .detail-value {
  color: var(--text-primary);
  word-break: break-all;
}

.catalogue-upc {
  font-family: monospace;
  color: var(--success) !important;
}

.catalogue-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
}

.catalogue-category {
  color: var(--text-secondary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalogue-has-link {
  opacity: 0.6;
}

.catalogue-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.pagination-info {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Product Detail Modal */
.product-detail-modal {
  max-width: 600px;
}

.product-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.product-detail-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--success);
}

.product-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.product-detail-row {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.product-detail-row.full-width {
  flex-direction: column;
}

.product-detail-label {
  color: var(--text-secondary);
  min-width: 120px;
  font-size: 0.9rem;
}

.product-detail-value {
  color: var(--text-primary);
  word-break: break-all;
}

.product-detail-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
}

/* Mobile adjustments for catalogue */
@media (max-width: 768px) {
  .catalogue-filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .catalogue-filter-group {
    justify-content: center;
  }
  
  .catalogue-grid {
    grid-template-columns: 1fr;
  }
  
  .catalogue-pagination {
    flex-direction: column;
    gap: 1rem;
  }
  
  .catalogue-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =====================================================
   CATALOGUE V2 - Design 1: Modern Grid Cards
   ===================================================== */

/* Stats Bar */
.catalogue-stats-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.catalogue-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.catalogue-stat-item .stat-number {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.catalogue-stat-item .stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.catalogue-stat-item.lumen .stat-number { color: #f97316; }
.catalogue-stat-item.nedco .stat-number { color: #4a9eff; }
.catalogue-stat-item.schneider .stat-number { color: #3dcd58; }
.catalogue-stat-item.images .stat-number { color: #a855f7; }

.catalogue-refresh-btn {
  margin-left: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.catalogue-refresh-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

/* Filters Bar */
.catalogue-filters-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.catalogue-filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.catalogue-pill {
  padding: 0.6rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 25px;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.catalogue-pill:hover:not(.active) {
  border-color: var(--primary);
}

.catalogue-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.catalogue-pill.lumen.active { background: #f97316; border-color: #f97316; }
.catalogue-pill.nedco.active { background: #4a9eff; border-color: #4a9eff; }
.catalogue-pill.schneider.active { background: #3dcd58; border-color: #3dcd58; color: #000; }

.catalogue-search-input {
  flex: 1;
  min-width: 280px;
  padding: 0.6rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.catalogue-search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.catalogue-search-input::placeholder {
  color: var(--text-secondary);
}

/* Results Bar */
.catalogue-results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Empty State */
.catalogue-empty {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

.catalogue-empty .empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.catalogue-empty p {
  color: var(--text-primary);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.catalogue-empty .empty-hint {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Grid V2 */
.catalogue-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Card V2 */
.catalogue-card-v2 {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.catalogue-card-v2:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.15);
  border-color: var(--primary);
}

.catalogue-card-v2 .catalogue-card-image {
  width: 100%;
  height: 180px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.catalogue-card-v2 .catalogue-card-image img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.catalogue-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 1;
}

.catalogue-badge.lumen { background: #f97316; color: #000; }
.catalogue-badge.nedco { background: #4a9eff; color: #fff; }
.catalogue-badge.schneider { background: #3dcd58; color: #000; }

.catalogue-image-count {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.7);
  color: white;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 12px;
}

.catalogue-no-image {
  font-size: 3rem;
  opacity: 0.3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--bg-secondary);
}

.catalogue-card-content {
  padding: 1.25rem;
}

.catalogue-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.catalogue-card-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.code-chip {
  background: var(--bg-secondary);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: 'Consolas', 'Monaco', monospace;
  color: var(--text-secondary);
}

.code-chip.upc {
  color: #3dcd58;
}

.catalogue-card-manufacturer {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Pagination */
.pagination-btn {
  padding: 0.75rem 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Modal V2 */
.catalogue-modal {
  max-width: 100%;
}

.catalogue-modal-gallery {
  margin: -1.5rem -1.5rem 1.5rem -1.5rem;
}

.catalogue-modal-main-image {
  width: 100%;
  height: 280px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.catalogue-modal-main-image img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.catalogue-modal-thumbnails {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  background: var(--bg-secondary);
}

.catalogue-thumb {
  width: 60px;
  height: 60px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  flex-shrink: 0;
}

.catalogue-thumb:hover {
  border-color: var(--primary);
}

.catalogue-thumb.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.3);
}

.catalogue-modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.catalogue-modal-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.catalogue-detail-item {
  background: var(--bg-secondary);
  padding: 0.75rem 1rem;
  border-radius: 10px;
}

.catalogue-detail-item .detail-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  display: block;
}

.catalogue-detail-item .detail-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.catalogue-detail-item .detail-value code {
  font-family: 'Consolas', 'Monaco', monospace;
  color: #4a9eff;
}

.catalogue-detail-item .detail-value .upc-code {
  color: #3dcd58;
}

.catalogue-modal-description {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.catalogue-modal-link {
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.catalogue-modal-link:hover {
  text-decoration: underline;
}

/* Catalogue V2 Mobile */
@media (max-width: 768px) {
  .catalogue-stats-bar {
    gap: 1rem;
    justify-content: center;
  }
  
  .catalogue-stat-item .stat-number {
    font-size: 1rem;
  }
  
  .catalogue-filters-bar {
    flex-direction: column;
  }
  
  .catalogue-filter-pills {
    justify-content: center;
  }
  
  .catalogue-search-input {
    min-width: 100%;
  }
  
  .catalogue-grid-v2 {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
  }
  
  .catalogue-card-v2 .catalogue-card-image {
    height: 120px;
  }
  
  .catalogue-card-content {
    padding: 0.75rem;
  }
  
  .catalogue-card-name {
    font-size: 0.85rem;
  }
  
  .catalogue-modal-details {
    grid-template-columns: 1fr;
  }
  
  .catalogue-modal-main-image {
    height: 200px;
  }
}

/* =====================================================
   CATALOGUE V3 - Design 3: Pinterest/Masonry Style
   ===================================================== */

/* Pinterest Header */
.pinterest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--card-bg), var(--bg-secondary));
  border: 1px solid var(--border-color);
  border-radius: 16px;
  margin-bottom: 1rem;
}

.pinterest-stats {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.stat-pill {
  padding: 0.4rem 0.75rem;
  background: var(--bg-secondary);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.stat-pill.total { color: var(--text-primary); font-weight: 600; }
.stat-pill.lumen { color: #f97316; }
.stat-pill.nedco { color: #4a9eff; }
.stat-pill.schneider { color: #3dcd58; }
.stat-pill.images { color: #a855f7; }

.pinterest-refresh {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.pinterest-refresh:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: rotate(180deg);
}

/* Pinterest Controls */
.pinterest-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.pinterest-search {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 30px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all 0.2s;
}

.pinterest-search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.15);
}

.pinterest-search::placeholder {
  color: var(--text-secondary);
}

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

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.filter-select {
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 200px;
}

.filter-select:hover {
  border-color: var(--primary);
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.15);
}

/* Category Search Dropdown */
.category-select-wrapper {
  position: relative;
  min-width: 250px;
}

.category-search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all 0.2s;
}

.category-search-input:hover {
  border-color: var(--primary);
}

.category-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.15);
}

.category-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 100;
  max-height: 400px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.category-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.category-clear-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.category-clear-btn:hover {
  background: var(--bg-tertiary);
}

.category-dropdown-list {
  overflow-y: auto;
  max-height: 350px;
}

.category-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border-color);
}

.category-option:last-child {
  border-bottom: none;
}

.category-option:hover {
  background: var(--bg-tertiary);
}

.category-option.selected {
  background: var(--primary-light);
  color: var(--primary);
}

.category-name {
  flex: 1;
  font-weight: 500;
}

.category-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  margin-left: 0.5rem;
}

.category-option.selected .category-count {
  background: var(--primary);
  color: white;
}

.category-no-results {
  padding: 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.category-show-all {
  padding: 0.75rem;
  text-align: center;
  color: var(--primary);
  cursor: pointer;
  font-weight: 500;
  border-top: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

.category-show-all:hover {
  background: var(--bg-secondary);
}

.filter-chip {
  padding: 0.6rem 1rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 25px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-chip:hover {
  border-color: var(--primary);
}

.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.filter-chip.lumen.active { background: #f97316; border-color: #f97316; color: #000; }
.filter-chip.nedco.active { background: #4a9eff; border-color: #4a9eff; }
.filter-chip.schneider.active { background: #3dcd58; border-color: #3dcd58; color: #000; }

/* Results */
.pinterest-results {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  padding-left: 0.25rem;
}

/* Empty State */
.pinterest-empty {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--card-bg);
  border: 2px dashed var(--border-color);
  border-radius: 20px;
}

.pinterest-empty .empty-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.pinterest-empty p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Grid Layout (left-to-right rows, stable on append) */
.pinterest-masonry {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

/* Masonry Card */
.masonry-card {
  margin-bottom: 0;
  background: linear-gradient(145deg, var(--card-bg), var(--bg-secondary));
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
}

.masonry-card:hover {
  transform: scale(1.02) translateY(-2px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.2);
  border-color: var(--primary);
}

.masonry-image {
  width: 100%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
  min-height: 120px;
}

.masonry-image img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}

.masonry-image .image-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: white;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 10px;
}

.masonry-content {
  padding: 1rem;
}

.masonry-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.catalogue-stock-row:empty {
  display: none;
}

.catalogue-stock-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: var(--gray-50, #f9fafb);
  border-bottom: 1px solid var(--border-light, #e5e7eb);
  font-size: 0.75rem;
  color: var(--gray-600, #4b5563);
}

.stock-row-item {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  white-space: nowrap;
}

.stock-row-item strong {
  color: var(--gray-900, #111827);
}

/* Catalogue Modal - Favorite Star Overlay */
.catalogue-star-overlay {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  font-size: 1.4rem;
  color: #f59e0b;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  pointer-events: none;
  z-index: 2;
}

/* Catalogue Modal - Archived Stamp */
.catalogue-archived-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-18deg);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #dc2626;
  border: 3px solid #dc2626;
  padding: 0.2rem 0.8rem;
  border-radius: 4px;
  opacity: 0.7;
  pointer-events: none;
  z-index: 2;
  white-space: nowrap;
}

.product-image.archived-image {
  position: relative;
}

.product-image.archived-image img {
  opacity: 0.4;
}

/* Catalogue Modal - Archived Product Dimmed Text */
.product-info.archived-product .product-title,
.product-info.archived-product .product-badges,
.product-info.archived-product .product-subtitle {
  opacity: 0.5;
}

.supplier-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 6px;
}

.supplier-tag.lumen { background: #f97316; color: #000; }
.supplier-tag.nedco { background: #4a9eff; color: #fff; }
.supplier-tag.schneider { background: #3dcd58; color: #000; }

.supplier-tag.large {
  font-size: 0.75rem;
  padding: 6px 12px;
  margin-bottom: 1rem;
  display: inline-block;
}

.category-tag {
  font-size: 0.7rem;
  color: var(--text-secondary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.masonry-name {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.masonry-codes {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.code-item {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.code-item code {
  color: #4a9eff;
  font-family: 'Consolas', 'Monaco', monospace;
}

.code-item code.upc {
  color: #3dcd58;
}

.code-item.mfr {
  color: var(--text-secondary);
  font-style: italic;
}

.code-item.personalkey code {
  position: relative;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  background: rgba(74, 158, 255, 0.1);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.code-item.personalkey code:hover {
  background: rgba(74, 158, 255, 0.2);
}

.code-item.personalkey code:hover::after {
  content: 'Copier le Personal Key';
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
}

/* Editable cells in list view */
.editable-cell {
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease;
}

.editable-cell:hover {
  background: rgba(74, 158, 255, 0.05);
}

.editable-cell:hover::after {
  content: '✏️';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  opacity: 0.6;
}

.editable-cell.editing {
  background: rgba(74, 158, 255, 0.1);
  padding: 0 !important;
}

.editable-column {
  background: rgba(74, 158, 255, 0.03);
}

.inline-edit-input {
  font-family: inherit;
  font-size: inherit;
}

/* Edit mode row styling */
.edit-mode-row {
  background: rgba(74, 158, 255, 0.02);
}

.edit-mode-row:hover {
  background: rgba(74, 158, 255, 0.04);
}

.edit-mode-row .editable-cell {
  border: 1px solid transparent;
}

.edit-mode-row .editable-cell:hover {
  border-color: rgba(74, 158, 255, 0.3);
  background: rgba(74, 158, 255, 0.08);
}

/* Pinterest Pagination */
.pinterest-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  margin-top: 1rem;
}

.page-btn {
  padding: 0.75rem 1.5rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 25px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-info {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Pinterest Modal */
.pinterest-modal {
  max-width: 100%;
}

.modal-gallery {
  margin: -1.5rem -1.5rem 1.5rem -1.5rem;
  background: #fff;
}

.gallery-main {
  width: 100%;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.gallery-main img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  overflow-x: auto;
}

.gallery-thumbs .thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  flex-shrink: 0;
}

.gallery-thumbs .thumb:hover {
  border-color: var(--primary);
}

.gallery-thumbs .thumb.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.3);
}

.modal-info {
  padding-top: 0.5rem;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.info-item {
  background: var(--bg-secondary);
  padding: 0.75rem;
  border-radius: 10px;
}

.info-item label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.info-item code {
  font-family: 'Consolas', 'Monaco', monospace;
  color: #4a9eff;
  font-size: 0.9rem;
}

.info-item code.upc {
  color: #3dcd58;
}

.info-item span {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.info-description {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.external-link {
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.85rem;
}

.external-link:hover {
  text-decoration: underline;
}

/* Responsive Grid */
@media (max-width: 1400px) {
  .pinterest-masonry { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1000px) {
  .pinterest-masonry { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .pinterest-masonry { grid-template-columns: 1fr; }
  
  .pinterest-header {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
  
  .pinterest-stats {
    justify-content: center;
  }
  
  .pinterest-refresh {
    align-self: center;
  }
  
  .pinterest-controls {
    flex-direction: column;
  }
  
  .pinterest-filters {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .filter-chip {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
  
  .gallery-main {
    height: 200px;
  }
}

/* ========================================
   CATALOGUE TILES VIEW (LAZY LOADING)
   ======================================== */

/* Hero Banner - Modern Design */
.catalogue-hero-banner {
  position: relative;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  color: white;
  border-radius: 20px;
  padding: 3rem 2rem;
  margin-bottom: 2rem;
  overflow: hidden;
}

.catalogue-hero-banner::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: radial-gradient(circle at 70% 30%, rgba(59, 130, 246, 0.2) 0%, transparent 60%);
  pointer-events: none;
}

.catalogue-hero-banner .hero-shape {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.catalogue-hero-banner .hero-shape-1 {
  bottom: -200px;
  left: -100px;
  width: 400px;
  height: 400px;
  background: rgba(59, 130, 246, 0.07);
}

.catalogue-hero-banner .hero-shape-2 {
  top: -300px;
  right: -150px;
  width: 500px;
  height: 500px;
  background: rgba(96, 165, 250, 0.05);
}

.catalogue-hero-banner .hero-shape-3 {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 250px;
  height: 250px;
  background: rgba(147, 197, 253, 0.04);
}

.hero-settings-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.hero-settings-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(45deg);
}

.hero-content {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

.hero-subtitle {
  font-size: 1.1rem;
  opacity: 0.8;
  font-weight: 400;
}

/* Hero Search Box */
.hero-search-container {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-search-container .hero-search-box {
  flex: 1;
  min-width: 0;
}

.hero-search-box {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 14px;
  padding: 0.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.hero-search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  color: #1f2937;
  min-width: 0;
}

.hero-search-input::placeholder {
  color: #9ca3af;
}

.hero-search-input:focus {
  outline: none;
}

.hero-search-btn {
  padding: 0.875rem 1.5rem;
  background: var(--primary, #3b82f6);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.hero-search-btn:hover {
  background: #2563eb;
  transform: scale(1.02);
}

/* Results View Mini Hero Banner */
.catalogue-results-hero {
  position: relative;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  color: white;
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.catalogue-results-hero .hero-settings-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.catalogue-results-hero .hero-settings-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(45deg);
}

.catalogue-results-hero .hero-filter-toggle,
.catalogue-hero-banner .hero-filter-toggle {
  flex-shrink: 0;
  background: white;
  color: #374151;
  border: none;
  border-radius: 14px;
  padding: 0 1.25rem;
  height: 52px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.catalogue-hero-banner .hero-filter-toggle {
  height: 56px;
}

.catalogue-results-hero .hero-filter-toggle:hover,
.catalogue-hero-banner .hero-filter-toggle:hover,
.catalogue-results-hero .hero-filter-toggle.open,
.catalogue-hero-banner .hero-filter-toggle.open {
  background: #f3f4f6;
  color: #1f2937;
}

.catalogue-results-hero .hero-filter-toggle.has-filters,
.catalogue-hero-banner .hero-filter-toggle.has-filters {
  background: var(--primary, #3b82f6);
  color: white;
}

.catalogue-results-hero .hero-filter-toggle svg,
.catalogue-hero-banner .hero-filter-toggle svg {
  stroke: currentColor;
}

.results-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-right: 3rem;
}

.results-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.results-stats .stat-pill {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.results-stats .stat-pill.total {
  background: rgba(59, 130, 246, 0.3);
  border-color: rgba(59, 130, 246, 0.4);
}

.results-stats .stat-pill.supplier-stat {
  color: white;
  font-weight: 600;
}

.results-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.results-actions .view-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.results-actions .view-toggle-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.results-actions .view-toggle-btn.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.results-actions .view-toggle-btn:hover {
  color: white;
}

.results-actions .action-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.results-actions .action-btn:hover,
.results-actions .action-btn.active {
  background: rgba(255, 255, 255, 0.2);
}

.results-actions .action-btn .edit-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 10px;
  font-weight: 600;
}

.back-to-tiles-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.back-to-tiles-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Results Search Box */
.results-search-container {
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.results-search-container .results-search-box {
  flex: 1;
  min-width: 0;
}

.results-search-box {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 12px;
  padding: 0.4rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.results-search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  color: #1f2937;
  min-width: 0;
}

.results-search-input::placeholder {
  color: #9ca3af;
}

.results-search-input:focus {
  outline: none;
}

.results-search-btn {
  padding: 0.75rem 1.25rem;
  background: var(--primary, #3b82f6);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.results-search-btn:hover {
  background: #2563eb;
}

/* =============================================
   INVENTORY HERO BANNER (matches catalogue style)
   ============================================= */
.inventory-hero-banner {
  position: relative;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  color: white;
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.inventory-hero-banner::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: radial-gradient(circle at 70% 30%, rgba(59, 130, 246, 0.2) 0%, transparent 60%);
  pointer-events: none;
}

.inventory-hero-banner .hero-shape {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.inventory-hero-banner .hero-shape-1 {
  bottom: -200px;
  left: -100px;
  width: 400px;
  height: 400px;
  background: rgba(59, 130, 246, 0.06);
}

.inventory-hero-banner .hero-shape-2 {
  top: -300px;
  right: -150px;
  width: 500px;
  height: 500px;
  background: rgba(96, 165, 250, 0.04);
}

.inventory-hero-banner .hero-shape-3 {
  top: 40%;
  left: 60%;
  width: 200px;
  height: 200px;
  background: rgba(147, 197, 253, 0.03);
}

.inventory-hero-banner .hero-settings-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.inventory-hero-banner .hero-settings-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(-30deg);
}

/* Title row */
.inventory-hero-banner .hero-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-right: 3rem;
  position: relative;
  z-index: 1;
}

.inventory-hero-banner .hero-title-block {
  flex-shrink: 0;
}

.inventory-hero-banner .hero-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: white;
}

.inventory-hero-banner .hero-subtitle {
  font-size: 0.9rem;
  opacity: 0.7;
  margin: 0.15rem 0 0 0;
}

/* Search + Filter Row */
.hero-search-filter-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

.hero-search-box-inv {
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 0 0.75rem;
  gap: 0.5rem;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}

.hero-search-box-inv:focus-within {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.hero-search-box-inv .hero-search-icon {
  flex-shrink: 0;
  opacity: 0.6;
}

.hero-search-input-inv {
  flex: 1;
  background: transparent;
  border: none;
  color: white;
  font-size: 0.95rem;
  padding: 0.65rem 0;
  outline: none;
  min-width: 0;
}

.hero-search-input-inv::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

/* Filter Toggle Button */
.hero-filter-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.85);
  padding: 0 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.hero-filter-toggle:hover,
.hero-filter-toggle.open {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.hero-filter-toggle.has-filters {
  background: rgba(59, 130, 246, 0.3);
  border-color: rgba(59, 130, 246, 0.5);
  color: white;
}

/* Filter Panel */
.hero-filter-panel {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 1;
  animation: filterPanelSlide 0.15s ease-out;
}

@keyframes filterPanelSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.filter-panel-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-panel-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-panel-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.5;
  font-weight: 600;
}

.filter-panel-chips {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

/* Hero Filters */
.hero-filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-filters .filter-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.hero-filter-chip {
  padding: 0.4rem 0.85rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.hero-filter-chip:hover {
  background: rgba(255, 255, 255, 0.2);
}

.hero-filter-chip.active {
  background: white;
  color: #1f2937;
  border-color: white;
  font-weight: 600;
}

.hero-filter-select {
  padding: 0.4rem 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
}

.hero-filter-select option {
  background: #1f2937;
  color: white;
}

/* Results Summary */
.results-summary {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--gray-50);
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--gray-600);
  flex-wrap: wrap;
}

.results-summary .results-count {
  font-weight: 600;
  color: var(--gray-800);
}

.results-summary .results-filter {
  color: var(--gray-500);
}

.results-summary .results-page {
  color: var(--primary);
  font-weight: 500;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .inventory-hero-banner {
    padding: 1rem;
  }
  
  .inventory-hero-banner .hero-title-row {
    flex-direction: column;
    align-items: flex-start;
    padding-right: 2.5rem;
    gap: 0.5rem;
  }
  
  .hero-search-filter-row {
    flex-direction: column;
  }
  
  .hero-filter-toggle {
    justify-content: center;
    padding: 0.5rem 1rem;
  }
  
  .filter-panel-grid {
    flex-direction: column;
  }
  
  .hero-filter-select {
    width: 100%;
  }
  
  .hero-filters {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .hero-filters .filter-group {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Legacy tiles styles (for backwards compatibility) */
.catalogue-tiles-header {
  text-align: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
  color: white;
  border-radius: 16px;
  margin-bottom: 1.5rem;
}

.catalogue-tiles-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.catalogue-tiles-header .subtitle {
  opacity: 0.9;
  font-size: 1rem;
}

.tiles-search-container {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.tiles-search-input {
  flex: 1;
  padding: 1rem 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 1rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.tiles-search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.tiles-search-btn {
  padding: 1rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tiles-search-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.tiles-supplier-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.tiles-supplier-row .supplier-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.tiles-supplier-row .supplier-tile {
  padding: 0.5rem 1rem;
  border: 2px solid transparent;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}

.tiles-supplier-row .supplier-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-color: rgba(0,0,0,0.2);
}

.tiles-supplier-row .supplier-tile:focus {
  outline: none;
  border-color: rgba(0,0,0,0.3);
}

.category-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.category-tile {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.category-tile:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
}

.category-tile-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.category-tile-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.browse-all-container {
  text-align: center;
  padding: 1rem;
  margin-top: 1rem;
}

.back-to-tiles-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-right: 1rem;
}

.back-to-tiles-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary);
}

.load-more-container {
  text-align: center;
  padding: 2rem;
}

.load-more-btn {
  padding: 0.75rem 2rem;
}

.search-btn {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.search-btn:hover {
  background: #1d4ed8;
}

@media (max-width: 768px) {
  .catalogue-hero-banner {
    padding: 2rem 1rem;
    border-radius: 16px;
  }
  
  .hero-title {
    font-size: 1.5rem;
  }
  
  .hero-subtitle {
    font-size: 0.95rem;
  }
  
  .hero-search-box {
    flex-direction: column;
    padding: 0.75rem;
    gap: 0.5rem;
  }
  
  .hero-search-input {
    width: 100%;
    text-align: center;
  }
  
  .hero-search-btn {
    width: 100%;
  }
  
  .hero-settings-btn {
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
  }
  
  /* Results hero mobile */
  .catalogue-results-hero {
    padding: 1rem;
  }
  
  .results-hero-top {
    flex-direction: column;
    align-items: flex-start;
    padding-right: 2.5rem;
  }
  
  .results-stats {
    order: 2;
  }
  
  .results-actions {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }
  
  .back-to-tiles-btn {
    order: 1;
    margin-bottom: 0.5rem;
  }
  
  .results-search-box {
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.5rem;
  }
  
  .results-search-input {
    width: 100%;
    text-align: center;
  }
  
  .results-search-btn {
    width: 100%;
  }
  
  .catalogue-tiles-header h1 {
    font-size: 1.5rem;
  }
  
  .tiles-search-container {
    flex-direction: column;
  }
  
  .category-tiles-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  
  .category-tile-icon {
    font-size: 2rem;
  }
}

/* ========================================
   CATALOGUE VIEW SWITCHING & SELECTION
   ======================================== */

/* View Toggle Buttons */
.pinterest-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.view-toggle {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.25rem;
}

.view-toggle-btn {
  background: transparent;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  color: var(--text-secondary);
}

.view-toggle-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.view-toggle-btn.active {
  background: var(--primary);
  color: white;
}

/* Edit Mode Button */
.pinterest-edit-btn {
  position: relative;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  color: var(--text-secondary);
}

.pinterest-edit-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary);
  color: var(--primary);
}

.pinterest-edit-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.edit-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--danger);
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
  line-height: 1.2;
}

/* Bulk Actions Toolbar */
.bulk-actions-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: 10px;
  margin-bottom: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.bulk-actions-info {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.bulk-actions-info strong {
  color: var(--primary);
  font-weight: 700;
}

.bulk-actions-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Selection Highlighting */
.masonry-card.selected {
  box-shadow: 0 0 0 3px var(--success) !important;
  background: rgba(34, 197, 94, 0.1) !important;
  /* Performance optimizations to prevent reflow */
  will-change: box-shadow, background;
  position: relative;
  z-index: 1;
}

.catalogue-list-row.selected {
  background: rgba(34, 197, 94, 0.1) !important;
  border-left: 3px solid var(--success);
}

.catalogue-list-row.selected td {
  background: transparent;
}

/* List View Styles */
.catalogue-list-container {
  overflow-x: auto;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

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

.catalogue-list-header {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 5;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.catalogue-list-header th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.catalogue-list-header th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
  position: relative;
}

.catalogue-list-header th.sortable:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.catalogue-list-header th.resizable {
  position: relative;
}

.catalogue-list-header th.resizable span {
  display: block;
  padding-right: 20px;
}

.resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  cursor: col-resize;
  background: transparent;
  z-index: 10;
}

.resize-handle:hover {
  background: var(--primary);
}

.catalogue-list-header th.resizable:hover .resize-handle {
  background: var(--primary);
  opacity: 0.5;
}

.catalogue-list-body {
  background: var(--card-bg);
}

.catalogue-list-row {
  cursor: pointer;
  transition: all 0.15s;
  border-bottom: 1px solid var(--border-color);
}

.catalogue-list-row:hover {
  background: var(--bg-secondary);
}

.catalogue-list-row:last-child {
  border-bottom: none;
}

.catalogue-list-row td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
}

.list-cell-image {
  width: 80px;
  padding: 0.5rem !important;
}

.list-thumbnail {
  width: 60px;
  height: 45px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--bg-tertiary);
  padding: 4px;
}

.no-image-placeholder {
  width: 60px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 6px;
  font-size: 1.5rem;
  opacity: 0.5;
}

.list-cell-name {
  font-weight: 500;
  color: var(--text-primary);
  max-width: 300px;
}

.list-cell-sku {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9rem;
}

.list-cell-sku code {
  background: var(--bg-tertiary);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  color: var(--primary);
}

.list-cell-upc code {
  background: var(--bg-tertiary);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  color: var(--success);
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.85rem;
}

.list-cell-category {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Responsive List View */
@media (max-width: 900px) {
  .catalogue-list-container {
    font-size: 0.85rem;
  }
  
  .catalogue-list-header th,
  .catalogue-list-row td {
    padding: 0.5rem 0.75rem;
  }
  
  .list-cell-image {
    width: 60px;
  }
  
  .list-thumbnail,
  .no-image-placeholder {
    width: 50px;
    height: 38px;
  }
  
  .list-cell-name {
    max-width: 200px;
  }
}

/* ============ INVENTORY VIEW STYLES ============ */

/* Stat Card Variants */
.stat-card.warning .stat-value {
  color: var(--warning, #f59e0b);
}

.stat-card.danger .stat-value {
  color: var(--danger, #ef4444);
}

.stat-card.success .stat-value {
  color: var(--success, #10b981);
}

/* Sortable Table Headers */
.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
}

.sortable:hover {
  background: var(--bg-secondary, rgba(0, 0, 0, 0.02));
}

/* Stock Badges */
.stock-badge {
  padding: 2px 8px;
  border-radius: var(--radius-sm, 4px);
  font-size: var(--font-size-xs, 0.75rem);
  font-weight: 600;
  display: inline-block;
}

.stock-badge.normal {
  background: var(--success-bg, rgba(16, 185, 129, 0.1));
  color: var(--success, #10b981);
}

.stock-badge.low {
  background: var(--warning-bg, rgba(245, 158, 11, 0.1));
  color: var(--warning-dark, #d97706);
}

.stock-badge.out {
  background: var(--danger-bg, rgba(239, 68, 68, 0.1));
  color: var(--danger, #ef4444);
}

/* Pagination */
.pagination {
  display: flex;
  gap: var(--space-xs, 0.5rem);
  align-items: center;
}

.pagination button {
  padding: var(--space-xs, 0.5rem) var(--space-sm, 0.75rem);
  border: 1px solid var(--border-light, #e5e7eb);
  background: var(--bg-primary, white);
  border-radius: var(--radius-sm, 4px);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
  background: var(--bg-secondary, #f9fafb);
  border-color: var(--primary, #3b82f6);
}

.pagination button.active {
  background: var(--primary, #3b82f6);
  color: white;
  border-color: var(--primary, #3b82f6);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination span {
  padding: 0 var(--space-xs, 0.5rem);
  color: var(--text-secondary, #6b7280);
}

/* Inventory View Container */
.inventory-view {
  width: 100%;
}

/* Location Tags for Inventory */
.location-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm, 4px);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.location-tag.main {
  background: rgba(59, 130, 246, 0.1);
  color: #1e40af;
}

.location-tag.project {
  background: rgba(16, 185, 129, 0.1);
  color: #065f46;
}

.location-tag.truck {
  background: rgba(245, 158, 11, 0.1);
  color: #92400e;
}

/* Masonry Card Footer */
.masonry-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light, #e5e7eb);
  font-size: 0.875rem;
}

.masonry-price {
  font-weight: 600;
  color: var(--primary, #3b82f6);
}

.masonry-value {
  color: var(--text-secondary, #6b7280);
  font-size: 0.75rem;
}

/* Filter Select */
.filter-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: var(--radius-sm, 4px);
  background: var(--bg-primary, white);
  font-size: 0.875rem;
  color: var(--text-primary, #111827);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-select:hover {
  border-color: var(--primary, #3b82f6);
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ============ PRODUCT MODAL (Design 3) ============ */

/* Modal Overlay */
.product-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10350; /* Above product selector (10250) so product view opens in front */
  padding: 1rem;
}

.product-modal-overlay.active {
  display: flex;
}

@media (max-width: 768px) {
  .product-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
}

/* ============ IMAGE LIGHTBOX ============ */
.image-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10450; /* Above catalogue product modal (10350) when opened from it */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modals opened from catalogue product modal: above product-modal-overlay (10350) */
#cat-segment-modal-overlay,
#bulk-tag-modal {
  z-index: 10450;
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: transparent;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  z-index: 10;
}

.lightbox-close:hover {
  color: #ddd;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  font-size: 3rem;
  cursor: pointer;
  padding: 1rem 1.5rem;
  line-height: 1;
  border-radius: 8px;
  transition: background 0.2s;
}

.lightbox-nav:hover {
  background: rgba(255,255,255,0.2);
}

.lightbox-prev { left: -80px; }
.lightbox-next { right: -80px; }

.lightbox-counter {
  color: white;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.lightbox-thumbnails {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  overflow-x: auto;
  max-width: 100%;
  padding: 0.5rem;
}

.lightbox-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  border: 2px solid transparent;
}

.lightbox-thumb:hover {
  opacity: 0.8;
}

.lightbox-thumb.active {
  opacity: 1;
  border-color: white;
}

@media (max-width: 768px) {
  .lightbox-nav {
    padding: 0.5rem 1rem;
    font-size: 2rem;
  }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
  
  .lightbox-close {
    top: 10px;
    right: 10px;
  }
}

/* Modal Container */
.product-modal {
  background: white;
  border-radius: var(--radius-lg, 12px);
  width: 100%;
  max-width: 1300px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  position: relative;
}

@media (max-width: 768px) {
  .product-modal {
    max-width: 100%;
    height: 100%;
    border-radius: 16px 16px 0 0;
    margin: 0;
  }
}

/* Deprecated Product Modal Warning Styling */
.product-modal.deprecated {
  border: 5px solid #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

.product-modal.deprecated::before {
  content: "⚠️ DEPRECATED MODAL - DO NOT USE";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: #ef4444;
  color: white;
  padding: 8px;
  text-align: center;
  font-weight: bold;
  font-size: 14px;
  z-index: 10000;
}

/* Header */
.product-modal-header {
  padding: 1.75rem 2rem;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
  background: linear-gradient(135deg, var(--gray-50, #f9fafb) 0%, white 100%);
  flex-shrink: 0;
}

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

.product-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.product-image {
  width: 120px;
  height: 120px;
  border-radius: var(--radius, 8px);
  background: var(--gray-100, #f3f4f6);
  border: 2px solid var(--gray-200, #e5e7eb);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-info {
  flex: 1;
}

.product-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900, #111827);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.product-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.product-sku,
.product-personalKey,
.product-upc,
.product-supplier-id {
  font-family: 'Consolas', monospace;
  font-size: 0.9rem;
  color: var(--primary, #2563eb);
  background: var(--primary-light, #dbeafe);
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  font-weight: 600;
  display: inline-block;
}

.badge-clickable {
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.badge-clickable:hover {
  background: var(--primary, #2563eb);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.badge-clickable:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.product-upc {
  background: var(--gray-100, #f3f4f6);
  color: var(--gray-700, #374151);
}

.product-upc.badge-clickable:hover {
  background: var(--gray-700, #374151);
  color: white;
}

.product-supplier-id {
  background: #dcfce7;
  color: #166534;
}

.product-supplier-id.badge-clickable:hover {
  background: #166534;
  color: white;
}

.product-subtitle {
  color: var(--gray-600, #4b5563);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.product-modal-header .btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--gray-300, #d1d5db);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--gray-600, #4b5563);
  padding: 0;
}

.product-modal-header .btn-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.product-modal-header .btn-icon:hover {
  background: var(--gray-50, #f9fafb);
  border-color: var(--gray-400, #9ca3af);
  color: var(--gray-900, #111827);
}

.product-modal-header .btn-edit {
  background: var(--primary, #2563eb);
  color: white;
  border-color: var(--primary, #2563eb);
  padding: 0.5rem 1.25rem;
  width: auto;
  font-size: 0.9rem;
  font-weight: 600;
  gap: 0.5rem;
}

.product-modal-header .btn-edit svg {
  stroke: white;
}

.product-modal-header .btn-edit:hover {
  background: var(--primary-hover, #1d4ed8);
  border-color: var(--primary-hover, #1d4ed8);
}

/* Tab Navigation - Compact */
.tab-nav {
  display: flex;
  gap: 0.25rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200, #e5e7eb);
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar {
  display: none;
}

.tab-nav::after {
  content: '';
  position: absolute;
  right: 0;
  top: 1rem;
  bottom: 0;
  width: 30px;
  background: linear-gradient(to right, transparent, var(--gray-50, #f9fafb));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

@media (max-width: 768px) {
  .tab-nav::after {
    opacity: 1;
  }
}

.tab-button {
  padding: 0.625rem 1.25rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  color: var(--gray-600, #4b5563);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.tab-button:hover {
  color: var(--gray-900, #111827);
  background: var(--gray-100, #f3f4f6);
}

.tab-button.active {
  color: var(--primary, #2563eb);
  background: var(--primary-light, #dbeafe);
  font-weight: 600;
}

.tab-badge {
  background: var(--primary, #2563eb);
  color: white;
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  font-weight: 600;
  margin-left: 0.25rem;
}

.tab-button.active .tab-badge {
  background: var(--primary-hover, #1d4ed8);
}

/* Content Area */
.product-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  background: var(--gray-50, #f9fafb);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dashboard-card {
  background: white;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius, 8px);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.dashboard-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gray-200, #e5e7eb);
  transition: all 0.2s;
}

.dashboard-card:hover {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.15);
  transform: translateY(-2px);
}

.dashboard-card:hover::before {
  background: var(--primary, #2563eb);
}

.dashboard-card[data-tab="inventory"]::before {
  background: var(--success, #10b981);
}

.dashboard-card[data-tab="suppliers"]::before {
  background: var(--warning, #f59e0b);
}

.dashboard-card[data-tab="equivalents"]::before {
  background: var(--purple, #8b5cf6);
}

.dashboard-card[data-tab="notes"]::before {
  background: var(--gray-500, #6b7280);
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-icon {
  font-size: 1.75rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100, #f3f4f6);
  border-radius: 10px;
}

.card-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900, #111827);
  margin-bottom: 0.5rem;
  line-height: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary, #2563eb);
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.75rem;
  cursor: pointer;
}

/* Supplier Badges */
.supplier-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.supplier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  background: var(--gray-100, #f3f4f6);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 6px;
  text-decoration: none;
  color: var(--gray-700, #374151);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}

.supplier-badge.clickable:hover {
  background: var(--primary-light, #dbeafe);
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.badge-icon {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Equivalents Preview */
.equivalents-preview {
  margin: 0.75rem 0;
}

.equivalent-thumbnails {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.equivalent-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 0.5rem 0.75rem;
  background: var(--gray-100, #f3f4f6);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 6px;
  font-family: 'Consolas', monospace;
  font-size: 0.75rem;
  color: var(--gray-700, #374151);
  font-weight: 600;
}

/* Notes Preview */
.notes-preview {
  margin: 0.75rem 0;
}

.note-preview-text {
  font-size: 0.9rem;
  color: var(--gray-700, #374151);
  line-height: 1.5;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-preview-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--gray-500, #6b7280);
  margin-bottom: 0.5rem;
}

.note-author {
  font-weight: 500;
}

.note-date {
  color: var(--gray-400, #9ca3af);
}

/* Expanded Section */
.expanded-section {
  background: white;
  border-radius: var(--radius, 8px);
  padding: 2rem;
  border: 1px solid var(--gray-200, #e5e7eb);
  margin-top: 1.5rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900, #111827);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--gray-200, #e5e7eb);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--gray-50, #f9fafb);
  border-radius: 8px;
  border: 1px solid var(--gray-100, #f3f4f6);
}

.detail-label {
  font-size: 0.7rem;
  color: var(--gray-500, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.detail-value {
  font-weight: 500;
  color: var(--gray-900, #111827);
  font-size: 0.95rem;
  line-height: 1.5;
}

.detail-value a {
  color: var(--primary, #2563eb);
  text-decoration: none;
}

.detail-value a:hover {
  text-decoration: underline;
}

/* Full-width detail item (for long descriptions) */
.detail-item-full {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

.detail-description {
  font-size: 1.1rem;
  line-height: 1.6;
  word-wrap: break-word;
}

/* Product Modal Tab Content */
.product-tab-content {
  padding: 2rem;
  background: var(--gray-50, #f9fafb);
  min-height: 400px;
}

/* Product Stats Tiles */
.product-stats-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-tile {
  background: white;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stat-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--primary, #2563eb);
}

.stat-tile .stat-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.stat-tile .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900, #111827);
  margin-bottom: 0.25rem;
}

.stat-tile .stat-label {
  font-size: 0.85rem;
  color: var(--gray-600, #4b5563);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Product Details Section */
.product-details {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  border: 1px solid var(--gray-200, #e5e7eb);
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.product-details h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-500, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 1.5rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--gray-200, #e5e7eb);
}

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

/* Details sections */
.details-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

.details-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.details-section .section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-500, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

/* Product Modal Edit Form Styles */
#product-edit-form .form-group {
  margin-bottom: 1.25rem;
}

#product-edit-form .form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--gray-700, #374151);
}

#product-edit-form .form-input,
#product-edit-form .form-select,
#product-edit-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  border: 1.5px solid var(--gray-300, #d1d5db);
  border-radius: 8px;
  outline: none;
  transition: all 0.2s;
  background: white;
  font-family: inherit;
}

#product-edit-form .form-input:focus,
#product-edit-form .form-select:focus,
#product-edit-form textarea:focus {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#product-edit-form textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

#product-edit-form input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary, #2563eb);
}

#product-edit-form .btn {
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

#product-edit-form .btn-primary {
  background: var(--primary, #2563eb);
  color: white;
}

#product-edit-form .btn-primary:hover {
  background: var(--primary-hover, #1d4ed8);
}

#product-edit-form .btn-secondary {
  background: var(--gray-200, #e5e7eb);
  color: var(--gray-700, #374151);
}

#product-edit-form .btn-secondary:hover {
  background: var(--gray-300, #d1d5db);
}

.details-section .detail-item-full {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* Category tags */
.category-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--gray-100, #f3f4f6);
  border-radius: 9999px;
  font-size: 0.85rem;
  color: var(--gray-600, #4b5563);
  margin-right: 0.5rem;
  margin-bottom: 0.25rem;
}

/* Product link button */
.product-link-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--primary, #3b82f6);
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s;
}

.product-link-button:hover {
  background: var(--primary-dark, #2563eb);
  color: white;
  text-decoration: none;
}

/* Product link styling */
.product-link {
  color: var(--primary, #3b82f6);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.product-link:hover {
  text-decoration: underline;
  color: var(--primary-dark, #2563eb);
}

/* Price styling */
.detail-price {
  color: var(--accent-green, #10b981);
  font-weight: 600;
  font-size: 1.1rem;
}

/* Supplier Cards in Tab */
.supplier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.supplier-card {
  background: white;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius, 8px);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.supplier-card:hover {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.supplier-name {
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.supplier-price {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary, #2563eb);
  margin-bottom: 0.5rem;
}

.supplier-date {
  font-size: 0.85rem;
  color: var(--gray-500, #6b7280);
}

.supplier-link {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--primary, #2563eb);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}

.supplier-link:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 968px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 768px) {
  .product-modal-header {
    padding: 1.25rem 1rem;
  }

  .product-header {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }
  
  .product-sku,
  .product-upc,
  .product-supplier-id {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
  }
  
  .product-badges {
    gap: 0.35rem;
  }

  .product-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
  }

  .product-title {
    font-size: 1.25rem;
    flex-wrap: wrap;
  }

  .product-sku,
  .product-upc,
  .product-supplier-id {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
  }
  
  .product-badges {
    gap: 0.35rem;
  }

  .product-subtitle {
    font-size: 0.85rem;
  }

  .header-actions {
    flex-direction: column;
    gap: 0.35rem;
  }

      .btn-icon {
        width: 36px;
        height: 36px;
      }

      .btn-icon svg {
        width: 16px;
        height: 16px;
      }

      .btn-edit {
        width: auto;
        padding: 0.4rem 0.85rem;
        font-size: 0.85rem;
      }

      .btn-edit svg {
        width: 16px;
        height: 16px;
      }

  .tab-nav {
    margin-top: 1rem;
    padding-top: 0.75rem;
  }

  .tab-button {
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
  }

  .product-modal-body {
    padding: 1.25rem 1rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .dashboard-card {
    padding: 1.25rem;
  }

  .card-icon {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .card-value {
    font-size: 1.5rem;
  }

  .expanded-section {
    padding: 1.5rem 1rem;
  }

  .section-title {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
  }

  .details-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .supplier-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .supplier-card {
    padding: 1.25rem;
  }
}

@media (max-width: 480px) {
  .product-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .product-image {
    width: 70px;
    height: 70px;
  }

  .product-title {
    font-size: 1.1rem;
  }

  .product-subtitle {
    font-size: 0.8rem;
    line-height: 1.4;
  }

  .header-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    flex-direction: row;
    gap: 0.35rem;
  }

  .header-content {
    position: relative;
    padding-right: 120px;
  }

  .tab-button {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }

  .product-modal-body {
    padding: 1rem 0.75rem;
  }

  .dashboard-card {
    padding: 1rem;
  }

  .card-value {
    font-size: 1.35rem;
  }

  .card-label {
    font-size: 0.8rem;
  }

  .expanded-section {
    padding: 1.25rem 0.75rem;
  }

  .section-title {
    font-size: 1rem;
    padding-bottom: 0.5rem;
  }

  .detail-label {
    font-size: 0.7rem;
  }

  .detail-value {
    font-size: 0.9rem;
  }

  .tag {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
  }
}

/* ============ INVENTORY TAB STYLES ============ */

/* Stock Information */
.stock-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.stock-info-card {
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius, 8px);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stock-info-label {
  font-size: 0.75rem;
  color: var(--gray-500, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stock-info-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900, #111827);
}

/* Resupply Strategy Section */
.resupply-strategy-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
}

.subsection-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 1rem;
}

.resupply-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.resupply-info-item {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.resupply-label {
  font-size: 0.75rem;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.resupply-value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-900);
}

/* Notes and Ratings System */
.notes-section {
  padding: 1.5rem;
}

.notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gray-200);
}

.notes-header h3 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--gray-900);
}

.average-rating {
  text-align: right;
}

.rating-stars-large {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.rating-text {
  font-size: 0.875rem;
  color: var(--gray-600);
  font-weight: 500;
}

.add-review-section {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.add-review-section h4 {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  color: var(--gray-900);
}

.rating-input {
  margin-bottom: 1rem;
}

.rating-input label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.star-input {
  display: flex;
  gap: 0.25rem;
  font-size: 2rem;
}

.star-input-item {
  cursor: pointer;
  color: var(--gray-300);
  transition: color 0.2s ease;
  user-select: none;
}

.star-input-item:hover,
.star-input-item.active {
  color: #fbbf24;
}

.note-textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.875rem;
  resize: vertical;
  margin-bottom: 1rem;
}

.note-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.note-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 1.25rem;
}

.note-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.note-author-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.note-author {
  font-weight: 600;
  color: var(--gray-900);
  font-size: 0.9375rem;
}

.note-rating {
  display: flex;
  gap: 0.125rem;
}

.star {
  font-size: 1rem;
}

.star-full {
  color: #fbbf24;
}

.star-half {
  color: #fbbf24;
  opacity: 0.5;
}

.star-empty {
  color: var(--gray-300);
}

.note-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.note-edited {
  font-style: italic;
  color: var(--gray-400);
}

.note-content {
  color: var(--gray-700);
  line-height: 1.6;
  margin-bottom: 0.75rem;
  white-space: pre-wrap;
}

.note-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-100);
}

.btn-icon-small {
  background: none;
  border: none;
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
  color: var(--gray-600);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.btn-icon-small:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.note-delete:hover {
  background: #fee2e2;
  color: #dc2626;
}

.note-edit:hover {
  background: #dbeafe;
  color: #2563eb;
}

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

.empty-state p {
  margin: 0.5rem 0;
}

.empty-state-hint {
  font-size: 0.875rem;
  color: var(--gray-400);
}

/* Segments Table */
.segments-table-container {
  overflow-x: auto;
  margin-top: 1rem;
}

.segments-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.segments-table thead {
  background: var(--gray-50, #f9fafb);
}

.segments-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--gray-700, #374151);
  border-bottom: 2px solid var(--gray-200, #e5e7eb);
}

.segments-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

.segments-table tbody tr:hover {
  background: var(--gray-50, #f9fafb);
}

/* Segment Format Badges */
.segment-format-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.segment-format-spool {
  background: #dbeafe;
  color: #1e40af;
}

.segment-format-handroll {
  background: #fef3c7;
  color: #92400e;
}

.segment-format-cut_segment {
  background: #e0e7ff;
  color: #3730a3;
}

.segment-format-unknown {
  background: var(--gray-200, #e5e7eb);
  color: var(--gray-700, #374151);
}

/* Segment Condition Badges */
.segment-condition-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.segment-condition-new {
  background: #d1fae5;
  color: #065f46;
}

.segment-condition-used {
  background: #fed7aa;
  color: #92400e;
}

/* Location Breakdown */
.location-breakdown {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.location-item {
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius, 8px);
  padding: 1.25rem;
}

.location-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--gray-900, #111827);
}

.location-icon {
  font-size: 1.25rem;
}

.location-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.location-detail-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: white;
  border-radius: 6px;
  border: 1px solid var(--gray-200, #e5e7eb);
}

.location-code {
  font-family: 'Consolas', monospace;
  font-size: 0.9rem;
  color: var(--gray-700, #374151);
  font-weight: 600;
  flex: 1;
}

.bin-id {
  font-size: 0.85rem;
  color: var(--gray-500, #6b7280);
}

.location-qty {
  font-weight: 600;
  color: var(--primary, #2563eb);
}

.location-more {
  text-align: center;
  padding: 0.5rem;
  color: var(--gray-500, #6b7280);
  font-size: 0.85rem;
  font-style: italic;
}

/* Segments Table */
.segments-table-container {
  overflow-x: auto;
  margin-top: 1rem;
}

.segments-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius, 8px);
  overflow: hidden;
}

.segments-table thead {
  background: var(--gray-100, #f3f4f6);
}

.segments-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-600, #4b5563);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--gray-200, #e5e7eb);
}

.segments-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
  font-size: 0.9rem;
  color: var(--gray-700, #374151);
}

.segments-table tbody tr:hover {
  background: var(--gray-50, #f9fafb);
}

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

.format-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--gray-100, #f3f4f6);
  color: var(--gray-700, #374151);
}

.format-badge.format-spool {
  background: var(--primary-light, #dbeafe);
  color: var(--primary, #2563eb);
}

.format-badge.format-handroll {
  background: var(--success-light, #d1fae5);
  color: var(--success, #10b981);
}

.condition-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.condition-badge.condition-new {
  background: var(--success-light, #d1fae5);
  color: var(--success, #10b981);
}

.condition-badge.condition-used {
  background: var(--warning-light, #fef3c7);
  color: var(--warning, #f59e0b);
}

.condition-badge.condition-broken,
.condition-badge.condition-damaged {
  background: var(--danger-light, #fee2e2);
  color: var(--danger, #ef4444);
}

/* Condition Grid */
.condition-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.condition-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--gray-50, #f9fafb);
  border-radius: var(--radius, 8px);
  border: 1px solid var(--gray-200, #e5e7eb);
  min-width: 120px;
}

.condition-qty {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900, #111827);
}

/* Movement History */
.history-count {
  font-size: 0.85rem;
  font-weight: normal;
  color: var(--gray-500, #6b7280);
  margin-left: 0.5rem;
}

.movement-history-table-container {
  overflow-x: auto;
  margin-top: 1rem;
}

.movement-history-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius, 8px);
  overflow: hidden;
}

.movement-history-table thead {
  background: var(--gray-100, #f3f4f6);
}

.movement-history-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-600, #4b5563);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--gray-200, #e5e7eb);
}

.movement-history-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
  font-size: 0.9rem;
  color: var(--gray-700, #374151);
}

.movement-history-table tbody tr:hover {
  background: var(--gray-50, #f9fafb);
}

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

.movement-type {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.movement-type.movement-in {
  background: var(--success-light, #d1fae5);
  color: var(--success, #10b981);
}

.movement-type.movement-out {
  background: var(--danger-light, #fee2e2);
  color: var(--danger, #ef4444);
}

/* Resupply Strategy */
.resupply-strategy {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

.strategy-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--gray-50, #f9fafb);
  border-radius: var(--radius, 8px);
  border: 1px solid var(--gray-200, #e5e7eb);
}

.strategy-label {
  font-size: 0.75rem;
  color: var(--gray-500, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.strategy-value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-900, #111827);
}

.trigger-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--gray-100, #f3f4f6);
  color: var(--gray-700, #374151);
}

.trigger-badge.trigger-min_threshold {
  background: var(--warning-light, #fef3c7);
  color: var(--warning, #f59e0b);
}

.trigger-badge.trigger-monthly {
  background: var(--primary-light, #dbeafe);
  color: var(--primary, #2563eb);
}

/* Responsive */
@media (max-width: 768px) {
  .stock-info-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stock-info-card {
    padding: 1.25rem;
  }

  .stock-info-value {
    font-size: 1.5rem;
  }

  .location-detail-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .segments-table,
  .movement-history-table {
    font-size: 0.85rem;
  }

  .segments-table th,
  .segments-table td,
  .movement-history-table th,
  .movement-history-table td {
    padding: 0.5rem 0.75rem;
  }

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

/* ============ SUPPLIERS TAB STYLES ============ */

/* Supplier Cards */
.supplier-card {
  background: white;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius, 8px);
  padding: 1.5rem;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.supplier-card:hover {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.supplier-name {
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  color: var(--gray-900, #111827);
}

.supplier-price {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary, #2563eb);
  margin-bottom: 0.25rem;
}

.supplier-price.supplier-no-price {
  font-size: 1rem;
  color: var(--gray-500, #6b7280);
  font-weight: 500;
}

.supplier-date {
  font-size: 0.85rem;
  color: var(--gray-500, #6b7280);
}

.supplier-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--primary, #2563eb);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}

.supplier-link:hover {
  text-decoration: underline;
}

.supplier-availability {
  margin-top: 0.5rem;
}

.availability-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.availability-badge.available {
  background: var(--success-light, #d1fae5);
  color: var(--success, #10b981);
}

.availability-badge.unavailable {
  background: var(--danger-light, #fee2e2);
  color: var(--danger, #ef4444);
}

/* Price History Chart */
.price-range-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.range-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-300, #d1d5db);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-700, #374151);
  transition: all 0.2s;
}

.range-btn:hover {
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
}

.range-btn.active {
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  color: white;
}

.price-chart-container {
  background: white;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius, 8px);
  padding: 1.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
}

.price-chart-svg-container {
  width: 100%;
  min-width: 800px;
}

.price-chart-svg-container svg {
  width: 100%;
  height: auto;
  display: block;
}

.price-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1rem;
  background: var(--gray-50, #f9fafb);
  border-radius: var(--radius, 8px);
  border: 1px solid var(--gray-200, #e5e7eb);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-label {
  font-size: 0.85rem;
  color: var(--gray-700, #374151);
  font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
  .supplier-grid {
    grid-template-columns: 1fr;
  }

  .supplier-card {
    padding: 1.25rem;
  }

  .supplier-price {
    font-size: 1.5rem;
  }

  .price-range-toggle {
    gap: 0.35rem;
  }

  .range-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  .price-chart-container {
    padding: 1rem;
  }

  .price-chart-svg-container {
    min-width: 600px;
  }

  .price-chart-legend {
    gap: 1rem;
    padding: 0.75rem;
  }
}

/* ============ EQUIVALENTS TAB STYLES ============ */

.equivalents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

/* Equivalents section - using same grid as supplier tiles */
.equivalents-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.equivalents-section {
  padding: 1rem;
}

.equivalents-section h3 {
  margin-bottom: 1rem;
  color: var(--gray-900, #111827);
  font-size: 1.25rem;
  font-weight: 700;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-500, #6b7280);
}

.empty-state p {
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

/* Equivalent badge (positioned like auto badge) */
.equivalent-badge-tile {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: #3b82f6;
  color: white;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 1;
}

.equivalent-image {
  width: 100%;
  height: 150px;
  background: var(--gray-100, #f3f4f6);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.equivalent-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.equivalent-image-placeholder {
  font-size: 3rem;
  opacity: 0.3;
}

.equivalent-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.equivalent-name {
  font-weight: 600;
  color: var(--gray-900, #111827);
  font-size: 0.95rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.equivalent-sku {
  font-family: 'Consolas', monospace;
  font-size: 0.8rem;
  color: var(--gray-600, #4b5563);
}

.equivalent-status {
  margin-top: 0.25rem;
}

/* ============ NOTES TAB STYLES ============ */

.add-note-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.note-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: var(--radius, 8px);
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  transition: all 0.2s;
}

.note-textarea:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.note-item {
  background: white;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius, 8px);
  padding: 1.25rem;
  transition: all 0.2s;
}

.note-item:hover {
  border-color: var(--gray-300, #d1d5db);
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.05);
}

.note-content {
  color: var(--gray-900, #111827);
  line-height: 1.6;
  margin-bottom: 0.75rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.note-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-200, #e5e7eb);
}

.note-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--gray-500, #6b7280);
}

.note-author {
  font-weight: 500;
  color: var(--gray-700, #374151);
}

.note-separator {
  color: var(--gray-400, #9ca3af);
}

.note-date {
  color: var(--gray-500, #6b7280);
}

.btn-icon-sm {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500, #6b7280);
  transition: all 0.2s;
  padding: 0;
}

.btn-icon-sm:hover {
  background: var(--danger-light, #fee2e2);
  color: var(--danger, #ef4444);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-600, #4b5563);
}

.empty-icon {
  font-size: 3rem;
  opacity: 0.3;
  display: block;
  margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .equivalents-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .equivalent-image {
    height: 120px;
  }

  .equivalent-info {
    padding: 0.75rem;
  }

  .note-item {
    padding: 1rem;
  }

  .note-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* ===== ASSOCIATION SCRIPT MODAL ===== */

.association-script-modal {
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.association-script-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

.association-script-modal .modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900, #111827);
}

.modal-close-btn {
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 8px;
  color: var(--gray-500, #6b7280);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background: var(--gray-100, #f3f4f6);
  color: var(--gray-700, #374151);
}

.association-script-modal .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200, #e5e7eb);
}

.association-script-modal .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.script-info {
  background: #f9fafb;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid #2563eb;
}

.script-info p {
  margin: 0.5rem 0;
  color: #374151;
}

.script-info ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.script-info li {
  margin: 0.25rem 0;
  color: #6b7280;
}

.script-info .warning {
  color: #f59e0b;
  font-weight: 600;
}

.script-progress {
  background: #f9fafb;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.progress-bar-container {
  width: 100%;
  height: 24px;
  background: #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  border-radius: 12px;
  transition: width 0.3s ease;
}

.progress-text {
  text-align: center;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

.progress-stats {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.progress-stats .stat-item {
  padding: 0.5rem 1rem;
  background: white;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  font-size: 0.875rem;
}

.progress-stats .stat-item.error {
  border-color: #ef4444;
  color: #ef4444;
}

.script-log {
  background: #1a1a2e;
  border-radius: 8px;
  padding: 1rem;
  max-height: 300px;
  overflow-y: auto;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
}

.log-entry {
  margin-bottom: 0.5rem;
  color: #10b981;
}

.log-entry.log-error {
  color: #ef4444;
}

.log-entry.log-success {
  color: #10b981;
}

.log-time {
  color: #6b7280;
  margin-right: 0.5rem;
}

.log-icon {
  margin-right: 0.5rem;
}

.log-message {
  color: inherit;
}

.pinterest-settings {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.pinterest-settings:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.supplier-description {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0.5rem 0;
  line-height: 1.4;
}

/* ===== CATALOGUE SETTINGS MODAL ===== */

.catalogue-settings-modal {
  max-width: 700px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.catalogue-settings-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

.catalogue-settings-modal .modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900, #111827);
}

.settings-tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
  padding: 0 1rem;
  background: var(--gray-50, #f9fafb);
}

.settings-tab {
  padding: 0.875rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-600, #4b5563);
  transition: all 0.2s;
}

.settings-tab:hover {
  color: var(--gray-900, #111827);
  background: rgba(0, 0, 0, 0.02);
}

.settings-tab.active {
  color: var(--primary, #2563eb);
  border-bottom-color: var(--primary, #2563eb);
}

.catalogue-settings-modal .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* Suppliers Settings */
.settings-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.settings-section-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800, #1f2937);
}

.suppliers-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.supplier-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-secondary, #f9fafb);
  border-radius: 10px;
  border: 1px solid var(--gray-200, #e5e7eb);
  transition: all 0.2s;
}

.supplier-row:hover {
  border-color: var(--gray-300, #d1d5db);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.supplier-color-indicator {
  width: 8px;
  height: 40px;
  border-radius: 4px;
  flex-shrink: 0;
}

.supplier-info {
  flex: 1;
}

.supplier-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-900, #111827);
}

.supplier-meta {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.25rem;
  font-size: 0.8rem;
}

.contact-badge {
  color: var(--gray-600, #4b5563);
}

.no-contact {
  color: var(--gray-400, #9ca3af);
  cursor: pointer;
  font-style: italic;
}

.no-contact:hover {
  color: var(--primary, #2563eb);
  text-decoration: underline;
}

.website-link {
  color: var(--primary, #2563eb);
  text-decoration: none;
}

.website-link:hover {
  text-decoration: underline;
}

.supplier-actions {
  display: flex;
  gap: 0.5rem;
}

/* Supplier Tile (Contact-style card) */
.supplier-tile {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--gray-200, #e5e7eb);
  overflow: hidden;
  transition: all 0.2s;
  border-left: 4px solid var(--primary, #2563eb);
  position: relative;
  cursor: pointer;
}

.supplier-tile.current {
  cursor: default;
  border-left-width: 4px;
}

.current-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: #10b981;
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
  z-index: 10;
}

.supplier-tile:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--gray-300, #d1d5db);
}

.supplier-tile-header {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1rem;
  background: var(--gray-50, #f9fafb);
  border-bottom: 1px solid var(--gray-100, #f3f4f6);
}

.supplier-tile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: white;
  flex-shrink: 0;
}

.supplier-tile-title {
  flex: 1;
  min-width: 0;
}

.supplier-tile-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
}

.supplier-tile-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.supplier-tile-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  flex: 1;
}

.supplier-tile-detail {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-100, #f3f4f6);
  font-size: 0.9rem;
}

.supplier-tile-detail:last-child {
  border-bottom: none;
}

.supplier-tile-detail .label {
  color: var(--gray-500, #6b7280);
  font-weight: 500;
}

.supplier-tile-detail .value {
  color: var(--gray-900, #111827);
  font-weight: 600;
}

.supplier-tile-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 500;
  margin-top: 0.75rem;
}

.supplier-tile-link:hover {
  text-decoration: underline;
}

.auto-badge-tile {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: #ff9800;
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
}

/* Product images grid */
.product-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.product-image-thumb {
  width: 100%;
  height: 120px;
  border-radius: 8px;
  border: 1px solid var(--gray-200, #e5e7eb);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--gray-50, #f9fafb);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image-thumb:hover {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.product-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.supplier-tile-tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.supplier-type-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.supplier-location {
  font-size: 0.75rem;
  color: var(--gray-500, #6b7280);
}

.supplier-tile-edit {
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.supplier-tile:hover .supplier-tile-edit {
  opacity: 1;
}

.supplier-tile-body {
  padding: 1rem;
}

.supplier-tile-contact {
  cursor: pointer;
  padding: 0.75rem;
  background: var(--gray-50, #f9fafb);
  border-radius: 8px;
  transition: background 0.15s;
}

.supplier-tile-contact:hover {
  background: var(--gray-100, #f3f4f6);
}

.supplier-tile-contact .contact-row {
  font-size: 0.85rem;
  color: var(--gray-700, #374151);
  padding: 0.2rem 0;
}

.supplier-tile-contact .contact-row:first-child {
  font-weight: 500;
  color: var(--gray-900, #111827);
}

.supplier-tile-contact-count {
  font-size: 0.75rem;
  color: var(--gray-400, #9ca3af);
  margin-top: 0.5rem;
  padding-left: 0.75rem;
}

.supplier-tile-no-contact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--gray-50, #f9fafb);
  border-radius: 8px;
  cursor: pointer;
  border: 1px dashed var(--gray-300, #d1d5db);
  transition: all 0.15s;
}

.supplier-tile-no-contact:hover {
  background: var(--primary-light, #eff6ff);
  border-color: var(--primary, #2563eb);
}

.supplier-tile-no-contact .no-contact-icon {
  font-size: 1.25rem;
  opacity: 0.5;
}

.supplier-tile-no-contact .no-contact-text {
  flex: 1;
  font-size: 0.85rem;
  color: var(--gray-500, #6b7280);
  font-style: italic;
}

.supplier-tile-no-contact .no-contact-action {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary, #2563eb);
}

.supplier-tile-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--gray-100, #f3f4f6);
  background: var(--gray-50, #f9fafb);
}

.supplier-website-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8rem;
  color: var(--primary, #2563eb);
  text-decoration: none;
  font-weight: 500;
}

.supplier-website-btn:hover {
  text-decoration: underline;
}

/* Website link in footer */
.website-link-small {
  font-size: 0.8rem;
  color: var(--primary, #2563eb);
  text-decoration: none;
  margin-left: auto;
}

.website-link-small:hover {
  text-decoration: underline;
}

/* No contact link styling */
.no-contact-link {
  cursor: pointer;
}

.no-contact-link:hover span {
  color: var(--primary, #2563eb) !important;
}

/* Suppliers list as grid */
.suppliers-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* Company card footer flex */
.company-card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.75rem;
  margin-top: auto;
  border-top: 1px solid var(--gray-100, #f3f4f6);
  font-size: 0.8rem;
  color: var(--gray-500, #6b7280);
}

/* Supplier Editor */
.supplier-editor-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
}

.supplier-editor {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  max-height: 90vh;
  overflow-y: auto;
}

/* Form row for side-by-side layout */
.supplier-editor .form-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.supplier-editor .logo-group {
  flex-shrink: 0;
}

.supplier-editor .form-group-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.supplier-editor .form-group-stack .form-group {
  margin-bottom: 0;
}

/* Logo upload zone */
.logo-upload-zone {
  width: 100px;
  height: 100px;
  border: 2px dashed var(--gray-300, #d1d5db);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--gray-50);
  position: relative;
  overflow: hidden;
}

.logo-upload-zone:hover {
  border-color: var(--primary, #2563eb);
  background: var(--gray-100);
}

.logo-upload-zone.drag-over,
.drawing-file-zone.drag-over,
.company-logo-upload.drag-over {
  border-color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.1);
  transform: scale(1.02);
}

.logo-upload-zone.has-logo {
  border-style: solid;
  border-color: var(--gray-200);
}

.logo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.logo-placeholder .logo-icon {
  font-size: 1.5rem;
}

.logo-placeholder .logo-text {
  font-size: 0.65rem;
  color: var(--gray-500);
  text-align: center;
}

.logo-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.logo-remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.logo-upload-zone:hover .logo-remove-btn {
  opacity: 1;
}

.logo-remove-btn:hover {
  background: #ef4444;
}

/* CSV actions */
.csv-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.csv-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.form-hint {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* Mobile responsive */
@media (max-width: 480px) {
  .supplier-editor .form-row {
    flex-direction: column;
    gap: 1rem;
  }
  
  .logo-upload-zone {
    width: 80px;
    height: 80px;
  }
}

.supplier-editor h4 {
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-700, #374151);
  margin-bottom: 0.375rem;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.2s;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.color-picker-row input[type="color"] {
  width: 60px;
  height: 40px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
}

.color-preview {
  flex: 1;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--gray-200, #e5e7eb);
}

.contact-selector {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.selected-contact {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background: var(--gray-100, #f3f4f6);
  border-radius: 6px;
  font-size: 0.9rem;
}

.selected-contact-card {
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  padding: 0.75rem;
}

.selected-contact-card .contact-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.selected-contact-card .contact-icon {
  font-size: 1.1rem;
}

.selected-contact-card .contact-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-900, #111827);
}

.selected-contact-card .contact-detail {
  font-size: 0.8rem;
  color: var(--gray-600, #4b5563);
  padding: 0.15rem 0;
  padding-left: 1.5rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Import Tools */
.import-tools-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Debug options (catalogue settings) */
.debug-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.debug-option-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.debug-option-row input[type="checkbox"] {
  cursor: pointer;
}

.algolia-rank-badge {
  font-size: 0.7rem;
  color: var(--gray-500, #6b7280);
  background: var(--gray-100, #f3f4f6);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  cursor: help;
}

.import-tool-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary, #f9fafb);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.import-tool-card:hover {
  border-color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.03);
  transform: translateX(4px);
}

.tool-icon {
  font-size: 1.5rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 10px;
  border: 1px solid var(--gray-200, #e5e7eb);
}

.tool-info {
  flex: 1;
}

.tool-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-900, #111827);
}

.tool-description {
  font-size: 0.8rem;
  color: var(--gray-500, #6b7280);
  margin-top: 0.25rem;
}

.tool-arrow {
  font-size: 1.25rem;
  color: var(--gray-400, #9ca3af);
  transition: color 0.2s;
}

.import-tool-card:hover .tool-arrow {
  color: var(--primary, #2563eb);
}

/* ============================================
   ADMIN TOOLS PAGE
   ============================================ */
.admin-tools-page {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.admin-tools-page .page-header {
  margin-bottom: 2rem;
}

.admin-tools-page .page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900, #111827);
  margin-bottom: 0.5rem;
}

.admin-tools-page .subtitle {
  color: var(--gray-500, #6b7280);
  font-size: 0.95rem;
}

.admin-tools-page .tools-section {
  margin-bottom: 2rem;
}

.admin-tools-page .section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-700, #374151);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

/* Category Assignment Status Messages */
#assignment-status .status-message {
  padding: 1rem;
  border-radius: 8px;
  font-weight: 500;
  margin-top: 1rem;
}

#assignment-status .status-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
}

#assignment-status .status-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #ef4444;
}

#assignment-status .status-info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #3b82f6;
}

#assign-categories-btn .loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Category Card Styles */
.category-card {
  background: white;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.category-card:hover {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.category-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.category-icon-large {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100, #f3f4f6);
  border-radius: 8px;
}

.category-info {
  flex: 1;
}

.category-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--gray-900, #111827);
  margin-bottom: 0.25rem;
}

.category-meta {
  font-size: 0.85rem;
  color: var(--gray-500, #6b7280);
}

.category-card-actions {
  display: flex;
  gap: 0.5rem;
}

.category-editor {
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.category-form .form-group {
  margin-bottom: 1.25rem;
}

.category-assignment-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-200, #e5e7eb);
}

.admin-tools-page .tools-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-tools-page .tool-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: white;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.admin-tools-page .tool-card:hover {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
  transform: translateX(4px);
}

.admin-tools-page .tool-card .tool-icon {
  font-size: 1.5rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50, #f9fafb);
  border-radius: 10px;
  border: 1px solid var(--gray-200, #e5e7eb);
}

.admin-tools-page .tool-card .tool-content {
  flex: 1;
}

.admin-tools-page .tool-card .tool-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-900, #111827);
}

.admin-tools-page .tool-card .tool-description {
  font-size: 0.85rem;
  color: var(--gray-500, #6b7280);
  margin-top: 0.25rem;
}

.admin-tools-page .tool-card .tool-arrow {
  font-size: 1.25rem;
  color: var(--gray-400, #9ca3af);
  transition: all 0.2s;
}

.admin-tools-page .tool-card:hover .tool-arrow {
  color: var(--primary, #2563eb);
  transform: translateX(4px);
}

/* Association tab inside settings */
.association-settings .script-info {
  background: #f9fafb;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid #2563eb;
}

.association-settings .script-info p {
  margin: 0.4rem 0;
  color: #374151;
  font-size: 0.9rem;
}

.association-settings .script-info ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.association-settings .script-info .warning {
  color: #f59e0b;
  font-weight: 500;
  margin-top: 0.75rem;
}

/* Contact Picker Modal */
.contact-picker-modal {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

.picker-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.picker-search {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-100, #f3f4f6);
}

.picker-search input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 8px;
  font-size: 0.9rem;
}

.picker-search input:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
}

.contacts-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  max-height: 400px;
}

.contact-picker-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.contact-picker-item:hover {
  background: var(--gray-100, #f3f4f6);
}

.contact-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary, #2563eb), #3b82f6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  flex-shrink: 0;
}

.contact-picker-item .contact-info {
  flex: 1;
  min-width: 0;
}

.contact-picker-item .contact-name {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--gray-900, #111827);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-picker-item .contact-detail {
  font-size: 0.8rem;
  color: var(--gray-500, #6b7280);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Price Requests Hero Banner */
.price-requests-hero-banner {
  position: relative;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  color: white;
  border-radius: 20px;
  padding: 3rem 2rem;
  margin-bottom: 2rem;
  overflow: hidden;
}

.price-requests-hero-banner::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: radial-gradient(circle at 70% 30%, rgba(59, 130, 246, 0.2) 0%, transparent 60%);
  pointer-events: none;
}

.price-requests-hero-banner .hero-settings-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.price-requests-hero-banner .hero-settings-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(45deg);
}

.price-requests-hero-banner .hero-content {
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.price-requests-hero-banner .hero-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: white;
}

.price-requests-hero-banner .hero-subtitle {
  font-size: 1rem;
  opacity: 0.9;
  margin: 0;
}

.price-requests-hero-banner .hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

/* Price Requests list view – card list */
.pr-list-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.pr-list-toolbar-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
  margin: 0;
}
.pr-list-toolbar-select {
  min-width: 12rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 0.875rem;
  background: white;
  color: var(--gray-800);
}
.pr-list-container {
  max-height: 60vh;
  overflow-y: auto;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  overflow-x: hidden;
}
.pr-list-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--gray-500);
  font-size: 0.9375rem;
}
.pr-list-empty-hint {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-400);
}
.pr-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pr-list-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background 0.15s;
}
.pr-list-card:last-child {
  border-bottom: none;
}
.pr-list-card:hover {
  background: var(--gray-50);
}
.pr-list-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
}
.pr-list-card-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--gray-900);
}
.pr-list-card-project {
  font-size: 0.875rem;
  color: var(--gray-500);
}
.pr-list-card-date {
  font-size: 0.8125rem;
  color: var(--gray-400);
}
.pr-list-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.pr-list-card-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
}
.pr-list-card-badge-en_cours {
  background: #fef3c7;
  color: #92400e;
}
.pr-list-card-badge-en_attente {
  background: #e0e7ff;
  color: #3730a3;
}
.pr-list-card-badge-probleme {
  background: #fee2e2;
  color: #991b1b;
}
.pr-list-card-badge-termine {
  background: #d1fae5;
  color: #065f46;
}
.pr-list-card-badge-annulé,
.pr-list-card-badge-annule {
  background: var(--gray-200);
  color: var(--gray-600);
}
.pr-list-card-count {
  font-size: 0.8125rem;
  color: var(--gray-500);
}
.pr-list-card-action {
  flex-shrink: 0;
}
.pr-list-load-more {
  text-align: center;
  padding: 0.75rem;
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin: 0;
  border-top: 1px solid var(--gray-100);
}

/* Supplier documents modal — list, dropdown add, delete */
.pr-supplier-docs-modal {
  min-width: 320px;
  max-width: 480px;
}

.pr-supplier-docs-modal .pr-doc-section {
  margin-bottom: 1rem;
}

.pr-supplier-docs-modal .pr-doc-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700, #374151);
  margin: 0 0 0.5rem 0;
}

.pr-supplier-docs-modal .pr-doc-empty {
  font-size: 0.875rem;
  color: var(--gray-500, #6b7280);
  padding: 0.75rem;
  background: var(--gray-50, #f9fafb);
  border-radius: 6px;
  border: 1px dashed var(--gray-200, #e5e7eb);
}

.pr-supplier-docs-modal .pr-doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  overflow: hidden;
}

.pr-supplier-docs-modal .pr-doc-list-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--gray-100, #f3f4f6);
  background: #fff;
}

.pr-supplier-docs-modal .pr-doc-list-item:last-child {
  border-bottom: none;
}

.pr-supplier-docs-modal .pr-doc-link {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--primary, #2563eb);
  text-decoration: none;
  font-size: 0.875rem;
}

.pr-supplier-docs-modal .pr-doc-link:hover {
  text-decoration: underline;
}

.pr-supplier-docs-modal .pr-doc-date {
  font-size: 0.75rem;
  color: var(--gray-500, #6b7280);
  white-space: nowrap;
}

.pr-supplier-docs-modal .pr-doc-delete {
  flex-shrink: 0;
  padding: 0.25rem 0.5rem;
  opacity: 0.8;
}

.pr-supplier-docs-modal .pr-doc-delete:hover {
  opacity: 1;
}

.pr-supplier-docs-modal .pr-doc-add-dropdown {
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  background: var(--gray-50, #f9fafb);
  margin-top: 0.75rem;
}

.pr-supplier-docs-modal .pr-doc-add-summary {
  padding: 0.6rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.pr-supplier-docs-modal .pr-doc-add-summary::-webkit-details-marker {
  display: none;
}

.pr-supplier-docs-modal .pr-doc-add-dropdown[open] .pr-doc-add-summary {
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
  margin-bottom: 0;
}

.pr-supplier-docs-modal .pr-doc-upload {
  padding: 0.75rem;
}

.pr-supplier-docs-modal .pr-doc-upload .form-label {
  font-size: 0.8125rem;
  margin-bottom: 0.35rem;
}

/* Drop zone for supplier docs (drag and drop) */
.pr-doc-dropzone {
  border: 2px dashed var(--gray-300, #d1d5db);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  background: var(--gray-50, #f9fafb);
  transition: border-color 0.15s, background 0.15s;
}

.pr-doc-dropzone:hover {
  border-color: var(--gray-400, #9ca3af);
  background: var(--gray-100, #f3f4f6);
}

.pr-doc-dropzone.pr-doc-dropzone-dragging {
  border-color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.08);
}

.pr-doc-dropzone-text {
  display: block;
  font-size: 0.875rem;
  color: var(--gray-600, #4b5563);
  margin-bottom: 0.5rem;
}

.pr-doc-dropzone-or {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500, #6b7280);
  margin-bottom: 0.5rem;
}

.pr-doc-dropzone-browse {
  display: inline-block;
  cursor: pointer;
}

.pr-doc-dropzone-browse .pr-doc-file-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.pr-doc-upload .mt-sm { margin-top: 0.5rem; }
.pr-supplier-docs-modal .mt-md { margin-top: 1rem; }

/* Price request table — description under product name/code (same cell) */
.item-info .item-desc-inline {
  width: 100%;
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  padding: 0.3rem 0.5rem;
  min-height: 1.75rem;
  color: var(--gray-600, #4b5563);
  border-color: var(--gray-200, #e5e7eb);
}

.item-info .item-desc-inline::placeholder {
  color: var(--gray-400, #9ca3af);
}

@media (max-width: 640px) {
  .pr-list-card {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .pr-list-card-main {
    width: 100%;
    order: 1;
  }
  .pr-list-card-meta {
    order: 2;
  }
  .pr-list-card-action {
    order: 3;
    margin-left: auto;
  }
}

/* Settings Modal Styles */
.settings-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.settings-section {
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 1.5rem;
}

.settings-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-section h3 {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-800);
}

.settings-item {
  margin-bottom: 1rem;
}

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

.settings-item-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}

.settings-item-content > div {
  flex: 1;
}

.settings-item-content strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--gray-800);
  font-size: 0.9375rem;
}

.settings-item-content p {
  margin: 0;
  font-size: 0.875rem;
}

@media (max-width: 768px) {
  .price-requests-hero-banner {
    padding: 2rem 1rem;
    border-radius: 16px;
  }
  
  .price-requests-hero-banner .hero-title {
    font-size: 1.5rem;
  }
  
  .price-requests-hero-banner .hero-subtitle {
    font-size: 0.95rem;
  }
  
  .price-requests-hero-banner .hero-settings-btn {
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
  }
  
  .settings-item-content {
    flex-direction: column;
    align-items: stretch;
  }
  
  .settings-item-content button {
    width: 100%;
  }
}

/* ================================================== */
/* AI-ENHANCED SEARCH UI                              */
/* ================================================== */

/* Expanded Terms Display */
.expanded-terms {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.625rem 1rem;
  border-radius: 8px;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  animation: slideDown 0.3s ease-out;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

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

.search-term {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
  font-weight: 500;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.2s ease;
}

.search-term:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* AI Loading Indicator */
.ai-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideDown 0.3s ease-out;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.ai-loading .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* AI Match Highlight */
.ai-match {
  background: linear-gradient(120deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
  border-left: 3px solid #667eea;
  padding: 0.5rem;
  border-radius: 4px;
  margin: 0.25rem 0;
}

/* Match Reason Badge */
.match-reason {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid rgba(102, 126, 234, 0.2);
  margin-left: 0.5rem;
}

.match-reason.exact {
  background: rgba(34, 197, 94, 0.1);
  color: #059669;
  border-color: rgba(34, 197, 94, 0.2);
}

.match-reason.ai {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  border-color: rgba(102, 126, 234, 0.2);
}

/* Search Input with AI Indicator */
.search-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-container .ai-indicator {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.8;
  transition: all 0.3s ease;
  pointer-events: none;
}

.search-input-container .ai-indicator.active {
  opacity: 1;
  animation: pulse-ai 2s ease-in-out infinite;
}

@keyframes pulse-ai {
  0%, 100% {
    transform: translateY(-50%) scale(1);
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
  }
  50% {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .expanded-terms {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }
  
  .search-term {
    padding: 0.1875rem 0.5rem;
    font-size: 0.75rem;
  }
  
  .ai-loading {
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
  }
  
  .ai-loading .spinner {
    width: 16px;
    height: 16px;
  }
}

/* ========================================
   TAGS / JARGON SYSTEM
   Beautiful, modern tag management UI
   ======================================== */

/* Tags Input Wrapper */
.tags-input-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.tags-input-wrapper input[type="text"] {
  flex: 1;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  background: #ffffff;
  color: #111827;
}

.tags-input-wrapper input[type="text"]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

.btn-tag-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: auto;
  padding: 0;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.btn-tag-add:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
  transform: translateY(-1px);
}

.btn-tag-add:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

/* Tags Display Container */
.tags-display {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  min-height: 3rem;
  align-items: center;
}

.tags-display-readonly {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.tags-empty {
  color: var(--gray-400);
  font-size: 0.875rem;
  font-style: italic;
}

/* Tag Pills (Editable) */
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  background: #eff6ff;
  color: var(--primary-color);
  border: 1px solid #bfdbfe;
  border-radius: 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  animation: tagSlideIn 0.3s ease;
}

.tag-pill:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.tag-text {
  line-height: 1;
}

.tag-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  padding: 0;
  background: transparent;
  color: var(--primary-color);
  border: none;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  opacity: 0.6;
}

.tag-remove:hover {
  background: rgba(37, 99, 235, 0.1);
  opacity: 1;
  transform: scale(1.1);
}

.tag-remove:active {
  transform: scale(0.95);
}

/* Tag Pills (Read-Only) */
.tag-pill-readonly {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  background: #eff6ff;
  color: var(--primary-color);
  border: 1px solid #bfdbfe;
  border-radius: 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Tag Animation */
@keyframes tagSlideIn {
  from {
    opacity: 0;
    transform: translateX(-10px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Dark Mode Support - Removed for tag inputs to keep white background */

/* Responsive Design */
@media (max-width: 768px) {
  .tags-input-wrapper {
    flex-direction: column;
  }
  
  .btn-tag-add {
    width: 100%;
    height: 2.75rem;
  }
  
  .tag-pill {
    font-size: 0.75rem;
    padding: 0.3125rem 0.5625rem;
  }
  
  .tag-remove {
    width: 1rem;
    height: 1rem;
    font-size: 0.875rem;
  }
}

/* ===== AUTOCOMPLETE DROPDOWN ===== */

.autocomplete-dropdown {
  position: fixed;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  max-height: 400px;
  overflow-y: auto;
  z-index: 9999;
  display: none;
}

.autocomplete-item {
  padding: 0.875rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.15s ease;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
  background: #f9fafb;
}

.autocomplete-key {
  font-weight: 600;
  font-size: 0.9375rem;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.autocomplete-name {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.autocomplete-meta {
  font-size: 0.8125rem;
  color: #9ca3af;
}

/* ===== RECENT SEARCHES ===== */

.recent-searches {
  padding: 0.75rem;
}

.recent-searches-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
}

.recent-searches-clear {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  transition: background 0.15s ease;
}

.recent-searches-clear:hover {
  background: #eff6ff;
}

.recent-search-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  margin-bottom: 0.375rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
}

.recent-search-chip:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  transform: translateX(2px);
}

.recent-search-chip:last-child {
  margin-bottom: 0;
}

/* ===== SEARCH HIGHLIGHTING ===== */

mark {
  background: #fef3c7;
  color: #92400e;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-weight: 600;
}

/* Dark mode adjustments for autocomplete */
@media (prefers-color-scheme: dark) {
  .autocomplete-dropdown {
    background: #1f2937;
    border-color: #374151;
  }
  
  .autocomplete-item {
    border-bottom-color: #374151;
  }
  
  .autocomplete-item:hover,
  .autocomplete-item.selected {
    background: #374151;
  }
  
  .autocomplete-key {
    color: #f9fafb;
  }
  
  .autocomplete-name {
    color: #d1d5db;
  }
  
  .autocomplete-meta {
    color: #9ca3af;
  }
  
  .recent-searches-header {
    color: #d1d5db;
  }
  
  .recent-searches-clear {
    color: #60a5fa;
  }
  
  .recent-searches-clear:hover {
    background: #1e3a8a;
  }
  
  .recent-search-chip {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
  }
  
  .recent-search-chip:hover {
    background: #4b5563;
    border-color: #6b7280;
  }
  
  mark {
    background: #78350f;
    color: #fef3c7;
  }
}


/* ===== PUNCH CLOCK COMPONENT ===== */

.punch-clock-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.punch-clock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e5e7eb;
}

.punch-clock-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.punch-clock-date {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

.punch-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.punch-status-badge.active {
  background: #dcfce7;
  color: #166534;
}

.punch-status-badge.inactive {
  background: #f3f4f6;
  color: #6b7280;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse-animation 2s ease-in-out infinite;
}

@keyframes pulse-animation {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.punch-project-info {
  background: #f9fafb;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.punch-project-name {
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.25rem;
}

.punch-start-time {
  font-size: 0.875rem;
  color: #6b7280;
}

.punch-timer {
  text-align: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.timer-label {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.9);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.timer-value {
  font-size: 3rem;
  font-weight: 700;
  color: white;
  font-variant-numeric: tabular-nums;
}

.punch-notes {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: #78350f;
}

.punch-clock-summary {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #e5e7eb;
}

.summary-header h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 1rem 0;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.summary-stat {
  background: #f9fafb;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.summary-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #2563eb;
  margin-bottom: 0.25rem;
}

.summary-stat-label {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
}

.punches-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.punch-item {
  background: #f9fafb;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  border-left: 4px solid #e5e7eb;
}

.punch-item.active {
  border-left-color: #22c55e;
  background: #dcfce7;
}

.punch-item.completed {
  border-left-color: #3b82f6;
}

.punch-item-time {
  font-weight: 600;
  color: #111827;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.punch-item-project {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.punch-item-duration {
  font-size: 0.75rem;
  color: #2563eb;
  font-weight: 600;
}

.loading-spinner {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
}

/* ===== PUNCH CLOCK COMPACT MODE ===== */

.punch-clock-compact-wrapper {
  margin-bottom: 1rem;
}

.punch-clock-compact {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  max-height: 60px;
}

.punch-clock-compact.active {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #86efac;
}

.punch-clock-compact.inactive {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.punch-compact-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.punch-compact-status .pulse-dot {
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.1);
  }
}

.punch-compact-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.punch-compact-timer {
  font-size: 1.25rem;
  font-weight: 700;
  color: #10b981;
  font-variant-numeric: tabular-nums;
  min-width: 80px;
  text-align: center;
}

.punch-compact-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-compact {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  gap: 0.5rem;
}

.btn-compact:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-compact:active {
  transform: translateY(0);
}

.btn-compact.btn-start {
  background: #10b981;
  color: white;
  padding: 0.5rem 1.5rem;
}

.btn-compact.btn-start:hover {
  background: #059669;
}

.btn-compact.btn-pause {
  background: #fbbf24;
  color: #78350f;
  width: 36px;
  height: 36px;
  padding: 0;
}

.btn-compact.btn-pause:hover {
  background: #f59e0b;
}

.btn-compact.btn-stop {
  background: #ef4444;
  color: white;
  width: 36px;
  height: 36px;
  padding: 0;
}

.btn-compact.btn-stop:hover {
  background: #dc2626;
}

.punch-clock-compact-error {
  padding: 0.75rem 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  font-size: 0.875rem;
  text-align: center;
}

/* Punch In Modal (for compact mode) */
.punch-in-modal-content {
  max-width: 500px;
  width: 90%;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.modal-overlay.active .punch-in-modal-content {
  transform: scale(1);
  opacity: 1;
}

.punch-in-modal-content .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background: white;
}

.punch-in-modal-content .modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.punch-in-modal-content .modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.punch-in-modal-content .modal-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.punch-in-modal-content .modal-body {
  padding: 1.5rem;
  background: white;
}

.punch-in-modal-content .modal-body .form-group {
  margin-bottom: 1.25rem;
}

.punch-in-modal-content .modal-body .form-group:last-child {
  margin-bottom: 0;
}

.punch-in-modal-content .modal-body .form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.punch-in-modal-content .modal-body .form-select,
.punch-in-modal-content .modal-body .form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: all 0.2s;
  background: white;
}

.punch-in-modal-content .modal-body .form-select:focus,
.punch-in-modal-content .modal-body .form-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.punch-in-modal-content .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

/* Mobile responsive for compact mode */
@media (max-width: 640px) {
  .punch-clock-compact {
    flex-wrap: wrap;
    max-height: none;
  }
  
  .punch-compact-status {
    flex: 100%;
  }
  
  .punch-compact-timer {
    flex: 1;
  }
  
  .punch-compact-controls {
    flex: none;
  }
  
  .punch-in-modal-content {
    width: 95%;
    max-width: none;
  }
  
  .punch-in-modal-content .modal-header,
  .punch-in-modal-content .modal-body,
  .punch-in-modal-content .modal-footer {
    padding: 1rem;
  }
}

/* Mobile responsive */
@media (max-width: 640px) {
  .punch-clock-card {
    padding: 1rem;
  }
  
  .timer-value {
    font-size: 2.5rem;
  }
  
  .summary-stats {
    grid-template-columns: 1fr;
  }
}


/* ===== PROJECT DETAIL VIEW (Design C - Dashboard Cards) ===== */

.project-detail-view {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Project Header */
.project-header {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.project-header-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.project-header-title {
  flex: 1;
}

.project-header-title h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.25rem 0;
}

.project-client {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0;
}

.project-location {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 8px;
  flex-wrap: wrap;
}

.location-icon {
  font-size: 1.25rem;
}

.location-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
  flex: 1;
}

.location-link:hover {
  text-decoration: underline;
}

/* Quick Actions */
.project-quick-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.quick-action-btn {
  flex: 1;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-action-btn:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.quick-action-icon {
  font-size: 2rem;
}

/* Cards Grid */
.project-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
}

.project-card-wide {
  grid-column: 1 / -1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 2px solid #e5e7eb;
}

.card-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.card-body {
  padding: 1.5rem;
}

/* Currently Working (Worker Cards) */
.current-workers-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.worker-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 3px solid #10b981;
}

.worker-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-initials {
  color: white;
  font-weight: 700;
  font-size: 1.125rem;
}

.worker-info {
  flex: 1;
  min-width: 0;
}

.worker-name {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.25rem;
}

.worker-start {
  font-size: 0.75rem;
  color: #6b7280;
}

.worker-timer {
  font-size: 1.25rem;
  font-weight: 700;
  color: #10b981;
  font-variant-numeric: tabular-nums;
  min-width: 80px;
  text-align: right;
}

.empty-state-small {
  padding: 2rem 1rem;
  text-align: center;
}

.empty-state-small p {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0;
}

.project-documents-empty-state {
  padding: 1.5rem 1rem;
}

.project-documents-toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.project-documents-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.project-documents-crumb {
  font-weight: 600;
}

.project-documents-crumb.is-current {
  color: #111827;
}

.project-documents-crumb-sep {
  color: #9ca3af;
}

.project-document-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  padding: 1.15rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.project-document-dropzone:hover,
.project-document-dropzone.dragover {
  border-color: #2563eb;
  background: #eff6ff;
}

.project-document-dropzone-icon {
  font-size: 1.7rem;
  margin-bottom: 0.45rem;
}

.project-document-dropzone-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #111827;
}

.project-document-dropzone-hint {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.2rem;
}

.project-document-upload-note {
  margin-top: 0.85rem;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.8rem;
  line-height: 1.45;
}

.project-documents-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.project-document-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
}

.project-document-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.project-document-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.project-document-meta {
  min-width: 0;
}

.project-document-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.project-document-subline {
  font-size: 0.78rem;
  color: #6b7280;
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-document-actions {
  flex-shrink: 0;
}

.project-document-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.45rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.7rem;
  font-weight: 700;
}

.project-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.9rem;
}

.project-photo-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.project-photo-button {
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.project-photo-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
}

.project-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-photo-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #6b7280;
}

.project-photo-caption {
  padding-top: 0.45rem;
}

.project-photo-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-photo-meta {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.18rem;
}

.project-photo-ticket-link {
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}

.project-photo-tile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.project-photo-tile-thumb {
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
  aspect-ratio: 1 / 1;
  position: relative;
}

.project-photo-tile-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-photo-tile-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #6b7280;
}

.project-photo-viewer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-photo-viewer-stage {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.project-photo-viewer-main {
  width: 100%;
  min-height: 360px;
  border-radius: 16px;
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-photo-viewer-main img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  display: block;
}

.project-photo-viewer-main-placeholder {
  font-size: 3rem;
  color: #6b7280;
}

.project-photo-viewer-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.project-photo-viewer-title {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
}

.project-photo-viewer-subline {
  font-size: 0.82rem;
  color: #6b7280;
}

.project-photo-viewer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.75rem;
}

.project-photo-viewer-thumb {
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
  aspect-ratio: 1 / 1;
  position: relative;
}

.project-photo-viewer-thumb.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.project-photo-viewer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-photo-viewer-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: #6b7280;
}

#project-upload-panel-host,
#drawing-upload-panel-host {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 10420;
  max-width: calc(100vw - 2rem);
}

.project-upload-panel {
  width: min(420px, calc(100vw - 2rem));
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #dbe5f0;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.project-upload-panel.is-error {
  border-color: #fecaca;
}

.project-upload-panel.is-complete {
  border-color: #bbf7d0;
}

.project-upload-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.85rem;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.project-upload-panel-title {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.project-upload-panel-subtitle {
  font-size: 0.82rem;
  color: #475569;
  margin-top: 0.2rem;
}

.project-upload-panel-actions {
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
}

.project-upload-panel-progress {
  padding: 0 1rem 0.85rem;
}

.project-upload-panel-progress-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #475569;
  margin-bottom: 0.45rem;
}

.project-upload-panel-bar {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.project-upload-panel-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  transition: width 0.25s ease;
}

.project-upload-panel-files {
  padding: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 240px;
  overflow: auto;
}

.project-upload-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.project-upload-file-row.is-active {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.project-upload-file-main {
  min-width: 0;
  flex: 1;
}

.project-upload-file-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-upload-file-meta {
  margin-top: 0.15rem;
  font-size: 0.76rem;
  color: #64748b;
}

.project-upload-file-status {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1d4ed8;
}

.project-upload-panel-minimized {
  width: 100%;
  border: none;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.9rem 1rem;
  cursor: pointer;
}

.project-upload-panel-minimized-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.project-upload-panel-minimized-text {
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-upload-panel-minimized-percent {
  font-size: 0.8rem;
  font-weight: 700;
}

/* Mobile responsive for worker cards */
@media (max-width: 640px) {
  .worker-card {
    flex-wrap: wrap;
  }
  
  .worker-timer {
    flex: 100%;
    text-align: left;
    margin-top: 0.5rem;
  }

  .project-document-row {
    flex-direction: column;
    align-items: stretch;
  }

  .project-document-actions .btn {
    width: 100%;
  }

  .project-photo-viewer-main {
    min-height: 240px;
  }

  #project-upload-panel-host,
  #drawing-upload-panel-host {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    max-width: none;
  }

  .project-upload-panel {
    width: 100%;
  }

  .project-upload-panel-header {
    flex-direction: column;
  }

  .project-upload-panel-actions {
    width: 100%;
  }

  .project-upload-panel-actions .btn {
    flex: 1;
  }
}

/* Project Info Card */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-label {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-value {
  font-weight: 600;
  color: #111827;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-active {
  background: #dcfce7;
  color: #166534;
}

.status-on_hold {
  background: #fef3c7;
  color: #78350f;
}

.status-completed {
  background: #dbeafe;
  color: #1e40af;
}

.status-open {
  background: #dcfce7;
  color: #166534;
}

/* Budget Section */
.budget-section {
  background: #f9fafb;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.budget-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.budget-label {
  font-weight: 500;
  color: #6b7280;
}

.budget-value {
  font-weight: 700;
  color: #111827;
  font-size: 1.125rem;
}

.progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
  transition: width 0.3s;
}

.budget-details {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: #6b7280;
}

.text-danger {
  color: #ef4444 !important;
  font-weight: 600;
}

.text-success {
  color: #10b981 !important;
  font-weight: 600;
}

.project-notes {
  padding: 1rem;
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  border-radius: 4px;
  font-size: 0.875rem;
}

.project-notes p {
  margin: 0.5rem 0 0 0;
  color: #78350f;
}

/* Mini Kanban */
.mini-kanban {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.kanban-column {
  min-width: 200px;
  flex: 1;
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 8px 8px 0 0;
  font-weight: 600;
  color: white;
}

.kanban-yellow { background: #f59e0b; }
.kanban-blue { background: #3b82f6; }
.kanban-orange { background: #f97316; }
.kanban-purple { background: #a855f7; }
.kanban-green { background: #10b981; }

.ticket-count {
  background: rgba(255,255,255,0.3);
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
}

.kanban-column-body {
  background: #f9fafb;
  border-radius: 0 0 8px 8px;
  padding: 0.75rem;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kanban-empty {
  text-align: center;
  color: #9ca3af;
  font-size: 0.875rem;
  padding: 2rem 0;
}

.kanban-ticket-card {
  background: white;
  padding: 0.75rem;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: all 0.2s;
}

.kanban-ticket-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

.ticket-title {
  font-weight: 600;
  color: #111827;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.ticket-meta {
  font-size: 0.75rem;
  color: #6b7280;
}

/* Time Stats */
.time-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.time-stat-card {
  background: #f9fafb;
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
}

.time-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #2563eb;
  margin-bottom: 0.25rem;
}

.time-stat-label {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
}

.time-by-user h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.75rem 0;
}

.user-time-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.user-time-row:last-child {
  border-bottom: none;
}

.user-name {
  color: #374151;
}

.user-hours {
  font-weight: 600;
  color: #2563eb;
}

/* Contacts List */
.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
}

.contact-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #3b82f6;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
}

.contact-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.contact-name {
  font-weight: 600;
  color: #111827;
}

.contact-phone,
.contact-email {
  font-size: 0.875rem;
  color: #2563eb;
  text-decoration: none;
}

.contact-phone:hover,
.contact-email:hover {
  text-decoration: underline;
}

/* Empty/Placeholder States */
.empty-state,
.placeholder-state,
.billing-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

.empty-icon,
.placeholder-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.text-muted {
  color: #9ca3af;
  font-size: 0.875rem;
}

/* Billing */
.billing-period-card {
  background: #f9fafb;
  border-radius: 8px;
  padding: 1.25rem;
}

.billing-period-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.billing-period-label {
  font-weight: 600;
  color: #111827;
}

.billing-period-dates {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
}

.billing-summary {
  background: white;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.billing-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.billing-row:last-child {
  border-bottom: none;
}

.billing-value {
  font-weight: 700;
  color: #2563eb;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .project-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .project-detail-view {
    padding: 0.5rem;
  }
  
  .project-header {
    padding: 1rem;
    margin-bottom: 0.75rem;
  }
  
  .project-card {
    padding: 1rem;
    margin-bottom: 0.75rem;
  }
  
  .project-quick-actions {
    gap: 0.5rem;
  }
  
  .quick-action-btn {
    min-width: 100px;
    padding: 0.625rem;
    font-size: 0.875rem;
  }
  
  .quick-action-icon {
    font-size: 1.25rem;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
  
  .time-stats {
    grid-template-columns: 1fr;
  }
}


/* ===== SCHEDULE TIMELINE (Design B - Card View) ===== */

.schedule-timeline {
  max-width: 800px;
  margin: 0 auto;
}

/* Date Navigation */
.schedule-date-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: white;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.schedule-date-display {
  flex: 1;
  text-align: center;
}

.schedule-day {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.25rem;
}

.schedule-date {
  font-size: 0.875rem;
  color: #6b7280;
}

.today-badge {
  display: inline-block;
  background: #dcfce7;
  color: #166534;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

/* Schedule Content */
.schedule-content {
  min-height: 400px;
}

.schedule-cards-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Project Card */
.schedule-project-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: all 0.2s;
}

.schedule-project-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

.project-card-time {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e5e7eb;
}

.time-range {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #2563eb;
}

.time-start,
.time-end {
  font-size: 1.125rem;
}

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

.time-duration {
  background: #eff6ff;
  color: #2563eb;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
}

.project-card-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.project-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  flex: 1;
}

.project-number {
  background: #f3f4f6;
  color: #6b7280;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
}

.project-card-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.project-detail-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.detail-icon {
  font-size: 1rem;
}

.detail-text {
  flex: 1;
}

.project-card-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.card-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #f3f4f6;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
}

.card-action-btn:hover {
  background: #e5e7eb;
  transform: scale(1.02);
}

/* Empty State */
.schedule-empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: 12px;
}

.schedule-empty-state .empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.schedule-empty-state h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.5rem 0;
}

.schedule-empty-state p {
  color: #6b7280;
  margin: 0;
}

/* Time Reference */
.schedule-time-reference {
  text-align: center;
  padding: 1rem;
  color: #9ca3af;
  font-size: 0.875rem;
  margin-top: 1.5rem;
}

/* Daily Summary at Bottom */
.schedule-daily-summary {
  margin-top: 2rem;
  padding: 1.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.daily-summary-header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e5e7eb;
}

.daily-summary-header h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.daily-summary-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.summary-stat {
  text-align: center;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
}

.summary-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #10b981;
  line-height: 1;
}

.summary-stat-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
  font-weight: 500;
}

.daily-punches-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.punch-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 6px;
  border-left: 3px solid #d1d5db;
}

.punch-summary-item.active {
  background: #f0fdf4;
  border-left-color: #10b981;
}

.punch-summary-item.completed {
  background: #f9fafb;
  border-left-color: #6b7280;
}

.punch-summary-time {
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
}

.punch-summary-project {
  font-size: 0.75rem;
  color: #6b7280;
  flex: 1;
  margin: 0 0.5rem;
}

.punch-summary-duration {
  font-size: 0.875rem;
  font-weight: 600;
  color: #10b981;
}

/* ─── View Toggle (Day / Week) ─── */
.schedule-view-toggle {
  display: flex;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.schedule-view-btn {
  padding: 0.375rem 0.75rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.schedule-view-btn.active {
  background: white;
  color: #2563eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ─── Day View: My Tickets Section ─── */
.schedule-my-tickets {
  margin-top: 1.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  overflow: hidden;
}

.schedule-my-tickets-header {
  padding: 1rem 1.25rem;
  border-bottom: 2px solid #e5e7eb;
}

.schedule-my-tickets-header h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.schedule-my-tickets-list {
  display: flex;
  flex-direction: column;
}

.schedule-ticket-item {
  padding: 0.875rem 1.25rem;
  border-left: 3px solid #9ca3af;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background 0.15s;
}

.schedule-ticket-item:last-child {
  border-bottom: none;
}

.schedule-ticket-item:hover {
  background: #f9fafb;
}

.schedule-ticket-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.schedule-ticket-flavor {
  font-size: 0.75rem;
  font-weight: 600;
}

.schedule-ticket-id {
  font-size: 0.6875rem;
  color: #9ca3af;
  font-weight: 500;
}

.schedule-ticket-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.375rem;
  line-height: 1.3;
}

.schedule-ticket-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.schedule-ticket-dest {
  font-size: 0.75rem;
  color: #6b7280;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-ticket-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.schedule-ticket-due {
  font-size: 0.6875rem;
  color: #6b7280;
}

/* ─── Week View ─── */
.schedule-week-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.schedule-weekend-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: white;
  color: #6b7280;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.schedule-weekend-toggle.active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #2563eb;
}

.schedule-week-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.schedule-week-day-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s;
}

.schedule-week-day-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.schedule-week-day-card.today {
  border: 2px solid #2563eb;
}

.schedule-week-day-card.weekend {
  opacity: 0.7;
  background: #fafafa;
}

.schedule-week-day-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #f9fafb;
  border-bottom: 1px solid #f3f4f6;
}

.schedule-week-day-card.today .schedule-week-day-header {
  background: #eff6ff;
}

.schedule-week-day-name {
  font-weight: 700;
  font-size: 0.875rem;
  color: #111827;
}

.schedule-week-day-date {
  font-size: 0.8125rem;
  color: #6b7280;
}

.schedule-week-day-body {
  padding: 0.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.schedule-week-empty {
  font-size: 0.8125rem;
  color: #9ca3af;
  padding: 0.25rem 0;
  font-style: italic;
}

.schedule-week-assignment {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0;
}

.schedule-week-time {
  font-size: 0.75rem;
  font-weight: 600;
  color: #2563eb;
  white-space: nowrap;
  min-width: 90px;
}

.schedule-week-project-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-week-ticket {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-left: 3px solid #9ca3af;
  border-radius: 0 4px 4px 0;
  background: #fafafa;
  cursor: pointer;
  transition: background 0.15s;
}

.schedule-week-ticket:hover {
  background: #f3f4f6;
}

.schedule-week-ticket-icon {
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.schedule-week-ticket-title {
  font-size: 0.8125rem;
  color: #374151;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Schedule Timeline Mobile ─── */
@media (max-width: 640px) {
  .schedule-timeline {
    padding: 0;
  }
  
  .schedule-daily-summary {
    margin-top: 1rem;
    padding: 1rem;
  }
  
  .daily-summary-stats {
    grid-template-columns: 1fr;
  }
  
  .punch-summary-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .punch-summary-project {
    margin: 0;
  }
  
  .schedule-date-nav {
    padding: 1rem;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  
  .schedule-view-toggle {
    order: -1;
    width: 100%;
    justify-content: center;
    margin-bottom: 0.25rem;
  }

  .schedule-day {
    font-size: 1rem;
  }
  
  .project-name {
    font-size: 1.125rem;
  }
  
  .time-range {
    font-size: 1rem;
  }
  
  .project-card-header {
    flex-direction: column;
    align-items: start;
  }
  
  .project-number {
    align-self: flex-start;
  }

  .schedule-week-toolbar {
    padding: 0 0.5rem;
  }

  .schedule-week-day-body {
    padding: 0.5rem 0.75rem;
  }

  .schedule-ticket-item {
    padding: 0.75rem 1rem;
  }
}


/* ===== TICKET WIZARD (Design C - 5-Step: Type, Informations, Contenu, Révision, Confirmation) ===== */

.ticket-wizard {
  min-height: 500px;
}

/* Step 0: Flavor picker */
.flavor-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.flavor-card {
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  background: white;
}
.flavor-card:hover { border-color: #9ca3af; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.flavor-card.material.selected { border-color: #4CAF50; background: #f0fdf4; }
.flavor-card.service.selected { border-color: #F44336; background: #fef2f2; }
.flavor-card.task.selected { border-color: #2196F3; background: #eff6ff; }
.flavor-card-icon { font-size: 2.5rem; margin-bottom: 0.75rem; display: block; }
.flavor-card-label { font-size: 1rem; font-weight: 700; color: #111827; margin-bottom: 0.375rem; }
.flavor-card-desc { font-size: 0.8125rem; color: #6b7280; line-height: 1.4; }

/* Step 2 Contenu: cart (Design C) */
.cart-count-badge {
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
}
.cart-item-img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  overflow: hidden;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-code { font-size: 0.6875rem; color: #9ca3af; }
.cart-item-notes {
  display: block; width: 100%; margin-top: 0.35rem; padding: 0.25rem 0.4rem;
  font-size: 0.75rem; border: 1px solid #e5e7eb; border-radius: 6px; box-sizing: border-box;
}
.cart-item-notes::placeholder { color: #9ca3af; }
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  width: auto;
  min-width: 0;
  flex-shrink: 0;
  padding: 0.25rem;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: var(--radius, 6px);
  background: white;
}
.qty-btn {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: none;
  border-radius: 6px;
  background: #f9fafb;
  cursor: pointer;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-btn:hover { background: #f3f4f6; }
.cart-item-qty .qty-input {
  width: 56px;
  min-width: 56px;
  text-align: center;
  border: none;
  border-radius: 0;
  padding: 0.3rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  background: transparent;
}
.cart-item-qty .qty-input:focus { outline: none; }
.cart-item-remove {
  width: 28px;
  height: 28px;
  border: none;
  background: #fef2f2;
  color: #ef4444;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-item-remove:hover { background: #fee2e2; }

/* Step 2 Contenu: service call severity */
.severity-pills { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.severity-pill {
  padding: 0.4rem 0.85rem;
  border: 2px solid #e5e7eb;
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  background: white;
  transition: all 0.15s;
  font-family: inherit;
}
.severity-pill.selected-low { border-color: #10b981; background: #f0fdf4; color: #065f46; }
.severity-pill.selected-med { border-color: #f59e0b; background: #fffbeb; color: #92400e; }
.severity-pill.selected-high { border-color: #ef4444; background: #fef2f2; color: #991b1b; }
.severity-pill.selected-crit { border-color: #7c3aed; background: #f5f3ff; color: #5b21b6; }

/* Step 2 Contenu: task list */
.task-input-row { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.task-input { flex: 1; }
.task-list { display: flex; flex-direction: column; gap: 0.375rem; }
.task-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}
.task-drag { color: #9ca3af; cursor: grab; font-size: 0.75rem; }
.task-checkbox { width: 1rem; height: 1rem; }
.task-text { flex: 1; font-size: 0.875rem; }
.task-order { font-size: 0.75rem; color: #9ca3af; }
.task-remove {
  border: none;
  background: #fef2f2;
  color: #ef4444;
  border-radius: 6px;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
}
.task-remove:hover { background: #fee2e2; }

/* Step 1: destination selector */
.dest-selector { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.dest-selector .form-select:first-child { max-width: 140px; }

/* Ticket wizard: make the whole modal scroll, not just the product list */
.ticket-wizard .cart-section .cart-items,
.ticket-wizard #wizard-products .cart-items {
  max-height: none;
  overflow: visible;
}

/* Wizard Step Indicator */
.wizard-step-indicator {
  display: flex;
  justify-content: space-between;
  padding: 1.5rem;
  background: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
  margin: -1.5rem -1.5rem 1.5rem -1.5rem;
}

.wizard-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.wizard-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #d1d5db;
  z-index: 0;
}

.wizard-step.active:not(:last-child)::after,
.wizard-step.completed:not(:last-child)::after {
  background: #3b82f6;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #d1d5db;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  z-index: 1;
  transition: all 0.3s;
  margin-bottom: 0.5rem;
}

.wizard-step.active .step-circle {
  background: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.wizard-step.completed .step-circle {
  background: #10b981;
}

.step-label {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
  text-align: center;
}

.wizard-step.active .step-label {
  color: #3b82f6;
  font-weight: 600;
}

/* Wizard Content */
.wizard-content {
  padding: 0.5rem 0;
}

.wizard-step-content {
  animation: fadeIn 0.3s;
}

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

.step-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.5rem 0;
}

.step-description {
  color: #6b7280;
  margin: 0 0 1.5rem 0;
  font-size: 0.875rem;
}

.prefilled-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #dbeafe;
  color: #1e40af;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.prefilled-badge-remove {
  padding: 0 0.35rem;
  margin: 0;
  margin-left: 0.25rem;
  background: transparent;
  border: none;
  color: #1e40af;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  opacity: 0.85;
}
.prefilled-badge-remove:hover {
  opacity: 1;
  background: rgba(30, 64, 175, 0.15);
}

.required {
  color: #ef4444;
}

.optional {
  color: #9ca3af;
  font-weight: 400;
  font-size: 0.75rem;
}

/* Product Selector */
.product-selector-container {
  margin-bottom: 1.5rem;
}

.wizard-product-list {
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  background: #f9fafb;
  min-height: 200px;
}

.product-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.wizard-product-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.wizard-product-item .product-info {
  flex: 1;
}

.wizard-product-item .product-name {
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.25rem;
}

.wizard-product-item .product-code {
  font-size: 0.75rem;
  color: #6b7280;
}

.wizard-product-item .product-quantity {
  width: 80px;
}

.quantity-input {
  width: 100%;
  padding: 0.5rem;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
}

.btn-remove {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ef4444;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-remove:hover {
  background: #dc2626;
  transform: scale(1.1);
}

/* Review Section */
.review-section {
  background: #f9fafb;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.review-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-weight: 600;
  color: #111827;
}

.review-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.review-row:last-child {
  border-bottom: none;
}

.review-label {
  color: #6b7280;
  font-size: 0.875rem;
}

.review-value {
  color: #111827;
  font-weight: 500;
  text-align: right;
  max-width: 60%;
}

/* Success Animation */
.success-animation {
  text-align: center;
  padding: 2rem;
}

.success-icon {
  font-size: 4rem;
  animation: scaleIn 0.5s;
  margin-bottom: 1rem;
}

@keyframes scaleIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.success-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #10b981;
  margin: 0 0 0.5rem 0;
}

.success-message {
  color: #6b7280;
  margin: 0 0 1.5rem 0;
}

.ticket-id-badge {
  display: inline-block;
  background: #f3f4f6;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: 700;
  color: #111827;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.success-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .wizard-step-indicator {
    padding: 1rem 0.5rem;
  }
  
  .step-circle {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
  }
  
  .step-label {
    font-size: 0.625rem;
  }
  
  .grid-2 {
    grid-template-columns: 1fr !important;
  }
  
  .success-actions {
    flex-direction: column;
  }
  
  .success-actions button {
    width: 100%;
  }
}

/* ===== PERMISSIONS VIEW (Design 3 - Accordion with Role Chips) ===== */

.permissions-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  padding: 3rem;
}

.permissions-empty-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
}

.permissions-empty-state h2 {
  font-size: 1.5rem;
  color: #111827;
  margin-bottom: 0.75rem;
}

.permissions-empty-state p {
  color: #6b7280;
  max-width: 400px;
  margin-bottom: 2rem;
}

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

.permissions-layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 120px);
}

/* Permissions Sidebar */
.permissions-sidebar {
  width: 280px;
  background: white;
  border-right: 1px solid #e5e7eb;
  padding: 1.5rem;
  flex-shrink: 0;
  overflow-y: auto;
}

.permissions-sidebar-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.permissions-role-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.permissions-role-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.permissions-role-item:hover {
  background: #f3f4f6;
}

.permissions-role-item.active {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.permissions-role-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.permissions-role-avatar.role-admin { background: #fef3c7; }
.permissions-role-avatar.role-pm { background: #dbeafe; }
.permissions-role-avatar.role-elec { background: #dcfce7; }
.permissions-role-avatar.role-warehouse { background: #fce7f3; }
.permissions-role-avatar.role-apprentice { background: #e0e7ff; }

.permissions-role-details h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
}

.permissions-role-details p {
  font-size: 0.75rem;
  color: #6b7280;
  margin: 0;
}

.permissions-role-badge {
  margin-left: auto;
  background: #f3f4f6;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #6b7280;
}

.permissions-role-edit-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 0.8rem;
}

.permissions-role-item:hover .permissions-role-edit-btn {
  opacity: 1;
}

.permissions-add-role-btn {
  width: 100%;
  padding: 0.75rem;
  border: 2px dashed #e5e7eb;
  background: transparent;
  border-radius: 8px;
  color: #6b7280;
  cursor: pointer;
  margin-top: 1rem;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.permissions-add-role-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
}

/* Permissions Main Content */
.permissions-main {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  background: #f8fafc;
}

.permissions-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.permissions-title {
  font-size: 1.5rem;
  color: #111827;
  margin: 0;
}

.permissions-subtitle {
  color: #6b7280;
  margin-top: 0.25rem;
}

/* Stats Row */
.permissions-stats-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.permissions-stat-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  flex: 1;
}

.permissions-stat-card h4 {
  font-size: 0.8rem;
  color: #6b7280;
  margin: 0 0 0.25rem 0;
  font-weight: 500;
}

.permissions-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
}

/* Search Box */
.permissions-search-box {
  position: relative;
  margin-bottom: 1.5rem;
}

.permissions-search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.9rem;
  background: white;
}

.permissions-search-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.permissions-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
}

/* Accordion */
.permissions-accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.permissions-accordion-item {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.permissions-accordion-header {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: background 0.2s;
}

.permissions-accordion-header:hover {
  background: #f9fafb;
}

.permissions-accordion-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-right: 1rem;
}

.permissions-accordion-icon.users { background: #dbeafe; }
.permissions-accordion-icon.scheduler { background: #fef3c7; }
.permissions-accordion-icon.inventory { background: #dcfce7; }
.permissions-accordion-icon.tickets { background: #fce7f3; }
.permissions-accordion-icon.catalogue { background: #fed7aa; }
.permissions-accordion-icon.projects { background: #e0e7ff; }
.permissions-accordion-icon.billing { background: #fef3c7; }
.permissions-accordion-icon.reports { background: #dbeafe; }
.permissions-accordion-icon.admin { background: #e0e7ff; }

.permissions-accordion-title {
  font-weight: 600;
  flex: 1;
}

.permissions-permission-count {
  background: #f3f4f6;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #6b7280;
  margin-right: 1rem;
}

.permissions-chevron {
  width: 20px;
  height: 20px;
  transition: transform 0.2s;
  color: #9ca3af;
}

.permissions-accordion-item.open .permissions-chevron {
  transform: rotate(180deg);
}

/* Accordion Content */
.permissions-accordion-content {
  display: none;
  border-top: 1px solid #e5e7eb;
}

.permissions-accordion-item.open .permissions-accordion-content {
  display: block;
}

.permissions-row {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;
}

.permissions-row:last-child {
  border-bottom: none;
}

.permissions-name {
  flex: 1;
  font-size: 0.9rem;
  padding-left: 56px;
}

/* Role Chips */
.permissions-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.permissions-chip {
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
  user-select: none;
}

.permissions-chip.active {
  border-color: currentColor;
}

.permissions-chip.role-admin {
  background: #fef3c7;
  color: #92400e;
}
.permissions-chip.role-admin.active {
  background: #fcd34d;
}

.permissions-chip.role-pm {
  background: #dbeafe;
  color: #1e40af;
}
.permissions-chip.role-pm.active {
  background: #93c5fd;
}

.permissions-chip.role-elec {
  background: #dcfce7;
  color: #166534;
}
.permissions-chip.role-elec.active {
  background: #86efac;
}

.permissions-chip.role-warehouse {
  background: #fce7f3;
  color: #9d174d;
}
.permissions-chip.role-warehouse.active {
  background: #f9a8d4;
}

.permissions-chip.role-apprentice {
  background: #e0e7ff;
  color: #3730a3;
}
.permissions-chip.role-apprentice.active {
  background: #a5b4fc;
}

.permissions-chip.role-default {
  background: #f3f4f6;
  color: #374151;
}
.permissions-chip.role-default.active {
  background: #d1d5db;
}

/* Floating Save Button */
.permissions-floating-save {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: none;
  align-items: center;
  gap: 1rem;
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  z-index: 100;
}

.permissions-floating-save.visible {
  display: flex;
}

.permissions-save-info {
  font-size: 0.875rem;
  color: #6b7280;
}

.permissions-save-info strong {
  color: #f59e0b;
}

/* Permissions Mobile Responsive */
@media (max-width: 900px) {
  .permissions-layout {
    flex-direction: column;
  }
  
  .permissions-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    max-height: 300px;
  }
  
  .permissions-role-list {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .permissions-role-item {
    flex: 1 1 150px;
  }
  
  .permissions-stats-row {
    flex-wrap: wrap;
  }
  
  .permissions-stat-card {
    flex: 1 1 calc(50% - 0.5rem);
  }
  
  .permissions-name {
    padding-left: 0;
  }
  
  .permissions-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .permissions-chips {
    padding-left: 0;
  }
  
  .permissions-floating-save {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ===== LAZY LOADING INDICATORS ===== */

.lazy-load-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  color: var(--text-secondary, #6b7280);
  font-size: 0.875rem;
}

.lazy-load-indicator.no-more {
  color: var(--text-muted, #9ca3af);
  font-style: italic;
}

.loading-spinner-small {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-200, #e5e7eb);
  border-top-color: var(--primary, #667eea);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Contact type badge in search tiles */
.type-badge.type-contact-badge {
  background: #e8f0fe;
  color: #1a73e8;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
}


/* ===== INVENTORY TRANSFER FORM OVERLAY ===== */

.inv-transfer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.inv-transfer-panel {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.inv-transfer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

.inv-transfer-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.inv-transfer-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.inv-transfer-product {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  background: var(--gray-50, #f9fafb);
  border-radius: 10px;
  border: 1px solid var(--gray-200, #e5e7eb);
}

.inv-transfer-sku {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--gray-500, #6b7280);
}

.inv-transfer-stock {
  font-size: 0.875rem;
  color: var(--gray-600, #4b5563);
  margin-top: 0.25rem;
}

.inv-transfer-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.inv-transfer-field label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-700, #374151);
}

.inv-transfer-field select,
.inv-transfer-input {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 8px;
  font-size: 0.9375rem;
  background: white;
  color: var(--gray-900, #111827);
  width: 100%;
  box-sizing: border-box;
}

.inv-transfer-field select:focus,
.inv-transfer-input:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.inv-transfer-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--gray-200, #e5e7eb);
  background: var(--gray-50, #f9fafb);
}

/* ===== TRANSFER MODAL (Design C Final) ===== */
/* Light theme (default) — Dark theme preserved under .transfer-dark below */

.transfer-modal-overlay {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 10400; /* Above ticket-detail overlay (modal-overlay 10200) */
  display: flex;
  flex-direction: column;
  color: var(--gray-900, #111827);
}

/* Scanner modal above transfer modal (bin/location steps) */
.modal-overlay.modal-overlay-above-transfer {
  z-index: 10500;
}

/* Warning popup above transfer modal (visible z-index) */
.transfer-warning-popover-overlay {
  position: fixed;
  inset: 0;
  z-index: 10600;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: transferWarningFadeIn 0.2s ease-out;
}
@keyframes transferWarningFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.transfer-warning-popover {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.06);
  max-width: 380px;
  width: 100%;
  padding: 1.5rem 1.5rem 1.25rem;
  text-align: center;
}
.transfer-warning-popover-icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.75rem;
}
.transfer-warning-popover-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.5rem;
}
.transfer-warning-popover-message {
  font-size: 0.9375rem;
  color: #4b5563;
  line-height: 1.45;
  margin: 0 0 1.25rem;
}
.transfer-warning-popover-btn {
  width: 100%;
  padding: 0.6rem 1rem;
  font-weight: 600;
}

.transfer-modal {
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* Desktop: windowed modal instead of full-screen */
@media (min-width: 768px) {
  .transfer-modal-overlay {
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    padding: 1rem;
  }

  .transfer-modal {
    height: auto;
    max-height: 96vh;
    max-width: 520px;
    width: 100%;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
  }

  .transfer-modal .transfer-header {
    border-radius: 16px 16px 0 0;
  }

  .transfer-modal .transfer-scan-section {
    border-radius: 0 0 16px 16px;
  }

  .transfer-dark.transfer-modal-overlay .transfer-modal {
    background: var(--gray-900, #111827);
  }
}

/* Transfer Header */
.transfer-header {
  background: var(--gray-50, #f9fafb);
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.transfer-header-left {
  flex: 1;
  min-width: 0;
}

.transfer-ticket-info {
  font-size: 0.875rem;
}

.transfer-ticket-id {
  font-weight: 600;
  font-size: 1rem;
  color: var(--gray-900, #111827);
}

.transfer-ticket-meta {
  font-size: 0.75rem;
  color: var(--gray-500, #6b7280);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transfer-bin-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f59e0b;
  color: black;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  flex-shrink: 0;
}

.transfer-btn-exit {
  background: var(--gray-100, #f3f4f6);
  border: 1px solid var(--gray-200, #e5e7eb);
  color: var(--gray-600, #4b5563);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.transfer-btn-exit:active {
  background: var(--gray-200, #e5e7eb);
}

/* Progress Dots */
.transfer-progress-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  flex-wrap: wrap;
}

.transfer-progress-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gray-300, #d1d5db);
  transition: all 0.3s ease;
}

.transfer-progress-dot.completed {
  background: #16a34a;
}

.transfer-progress-dot.skipped {
  background: #f59e0b;
}

.transfer-progress-dot.active {
  background: #2563eb;
  transform: scale(1.3);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.3);
}

/* Main Content */
.transfer-main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  text-align: center;
  position: relative;
  overflow-y: auto;
  min-height: 0;
}

/* Product Image */
.transfer-product-image-container {
  margin-bottom: 1rem;
}

.transfer-product-image {
  width: 160px;
  height: 160px;
  object-fit: contain;
  border-radius: 16px;
  background: var(--gray-50, #f9fafb);
  border: 2px solid var(--gray-200, #e5e7eb);
  padding: 0.75rem;
}

.transfer-product-image-placeholder {
  width: 160px;
  height: 160px;
  background: var(--gray-100, #f3f4f6);
  border: 2px solid var(--gray-200, #e5e7eb);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400, #9ca3af);
  font-size: 4rem;
}

/* Location Badge */
.transfer-location-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #2563eb;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1rem;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.transfer-location-badge:active {
  transform: scale(0.97);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}

.transfer-location-badge svg {
  width: 20px;
  height: 20px;
}

/* Product Info */
.transfer-product-sku {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.transfer-product-description {
  font-size: 1rem;
  color: var(--gray-500, #6b7280);
  margin-bottom: 1rem;
  max-width: 300px;
}

/* Quantity Display */
.transfer-qty-display {
  margin-bottom: 0.5rem;
}

.transfer-qty-number {
  font-size: 6rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(180deg, var(--gray-900, #111827) 0%, var(--gray-500, #6b7280) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.transfer-qty-display-label {
  font-size: 1rem;
  color: var(--gray-500, #6b7280);
  margin-top: 0.5rem;
}

.transfer-available-qty {
  font-size: 0.875rem;
  color: var(--gray-500, #6b7280);
  margin-top: 0.375rem;
}

.transfer-available-qty strong {
  color: var(--gray-700, #374151);
}

.transfer-backorder-inline {
  background: #fef3c7;
  color: #92400e;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.25rem;
}

/* Scan Mismatch Modal */
.scan-mismatch-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}

.scan-mismatch-modal {
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem 1.5rem 1.5rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.2s ease;
}

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

.scan-mismatch-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fef2f2;
  color: #dc2626;
  font-size: 1.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

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

.scan-mismatch-detail {
  background: var(--gray-50);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.scan-mismatch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
}

.scan-mismatch-row + .scan-mismatch-row {
  border-top: 1px solid var(--gray-200);
}

.scan-mismatch-label {
  font-size: 0.8rem;
  color: var(--gray-500);
  font-weight: 500;
}

.scan-mismatch-value {
  font-size: 0.9rem;
  font-weight: 600;
  font-family: monospace;
}

.scan-mismatch-scanned {
  color: #dc2626;
}

.scan-mismatch-expected {
  color: #059669;
}

.scan-mismatch-hint {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-bottom: 1rem;
}

.scan-mismatch-list-section {
  text-align: left;
  margin-bottom: 1.25rem;
}

.scan-mismatch-list-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}

.scan-mismatch-list {
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
}

.mismatch-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--gray-100);
}

.mismatch-item:last-child {
  border-bottom: none;
}

.mismatch-item-current {
  background: #ecfdf5;
}

.mismatch-item-key {
  font-weight: 600;
  font-family: monospace;
  color: var(--gray-900);
}

.mismatch-item-desc {
  color: var(--gray-500);
  font-size: 0.8rem;
  text-align: right;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-mismatch-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.scan-mismatch-btn:hover {
  background: var(--primary-dark, #2563eb);
}

/* Item Counter */
.transfer-item-counter {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  text-align: right;
}

.transfer-item-counter-current {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.transfer-item-counter-total {
  font-size: 0.75rem;
  color: var(--gray-400, #9ca3af);
}

/* Scan Section */
.transfer-scan-section {
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--gray-200, #e5e7eb);
  background: var(--gray-50, #f9fafb);
}

.transfer-freehand-hint {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0 0 1rem;
  text-align: center;
}
.transfer-freehand-confirm {
  width: 100%;
  margin-bottom: 0.5rem;
}
.transfer-scan-prompt {
  text-align: center;
  color: var(--gray-500, #6b7280);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.transfer-scan-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.transfer-scan-input {
  flex: 1;
  padding: 1rem;
  border: 2px solid var(--gray-300, #d1d5db);
  border-radius: 12px;
  background: var(--gray-50, #f9fafb);
  color: var(--gray-900, #111827);
  font-size: 1.125rem;
  text-align: center;
  font-family: monospace;
  letter-spacing: 0.1em;
}

.transfer-scan-input::placeholder {
  color: var(--gray-400, #9ca3af);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: normal;
}

.transfer-scan-input:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
  background: var(--primary-light, #dbeafe);
}

/* Transfer Buttons */
.transfer-btn {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.15s;
}

.transfer-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.transfer-btn-camera {
  background: #2563eb;
  color: white;
  padding: 1rem;
}

.transfer-btn-camera:active {
  background: #1d4ed8;
}

.transfer-nav-row {
  display: flex;
  gap: 0.5rem;
}

.transfer-btn-nav {
  flex: 1;
  background: var(--gray-100, #f3f4f6);
  color: var(--gray-700, #374151);
  border: 1px solid var(--gray-200, #e5e7eb);
}

.transfer-btn-nav:active:not(:disabled) {
  background: var(--gray-200, #e5e7eb);
}

.transfer-btn-skip {
  flex: 2;
}

.transfer-btn-confirm {
  background: #2563eb;
  color: white;
  padding: 1.25rem;
  font-size: 1.125rem;
  width: 100%;
}

.transfer-btn-confirm:active {
  background: #1d4ed8;
}

.transfer-btn-cancel {
  background: var(--gray-100, #f3f4f6);
  color: var(--gray-700, #374151);
  border: 1px solid var(--gray-200, #e5e7eb);
  width: 100%;
}

.transfer-btn-cancel:active {
  background: var(--gray-200, #e5e7eb);
}

/* Confirmation Overlay */
.transfer-confirmation-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.97);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: env(safe-area-inset-top) 1.5rem calc(1.5rem + env(safe-area-inset-bottom));
  color: var(--gray-900, #111827);
}

.transfer-confirmation-overlay.show {
  display: flex;
}

@media (min-width: 768px) {
  .transfer-confirmation-overlay {
    background: rgba(0, 0, 0, 0.5);
    padding: 1rem;
  }

  .transfer-confirmation-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 2.5rem 3rem 2rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    max-width: 520px;
    width: 100%;
    position: relative;
  }

  .transfer-confirmation-close {
    top: 0.75rem;
    right: 0.75rem;
  }
}

.transfer-confirmation-close {
  position: absolute;
  top: calc(1rem + env(safe-area-inset-top));
  right: 1rem;
  background: var(--gray-100, #f3f4f6);
  border: 1px solid var(--gray-200, #e5e7eb);
  color: var(--gray-600, #4b5563);
  width: 44px;
  height: 44px;
  border-radius: 10px;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.transfer-confirmation-close:active {
  background: var(--gray-200, #e5e7eb);
}

.transfer-confirmation-content {
  text-align: center;
  width: 100%;
}

.transfer-confirmation-icon {
  width: 80px;
  height: 80px;
  background: #2563eb;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
}

.transfer-confirmation-icon svg {
  width: 40px;
  height: 40px;
  color: white;
  stroke: white;
}

.transfer-confirmation-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--gray-900, #111827);
}

.transfer-confirmation-subtitle {
  color: var(--gray-500, #6b7280);
  margin-bottom: 2rem;
}

.transfer-qty-section {
  margin-bottom: 1.5rem;
}

.transfer-qty-label {
  font-size: 0.875rem;
  color: var(--gray-500, #6b7280);
  margin-bottom: 1rem;
}

.transfer-qty-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.transfer-qty-btn {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  border: 2px solid var(--gray-300, #d1d5db);
  background: white;
  color: var(--gray-700, #374151);
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.transfer-qty-btn:active {
  background: var(--gray-100, #f3f4f6);
}

.transfer-qty-value {
  font-size: 5rem;
  font-weight: 800;
  min-width: 120px;
  text-align: center;
  color: var(--gray-900, #111827);
}

.transfer-qty-max {
  font-size: 1rem;
  color: var(--gray-400, #9ca3af);
  margin-top: 0.5rem;
}

.transfer-backorder-warning {
  display: none;
  background: #f59e0b;
  color: black;
  padding: 1rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.transfer-backorder-warning.show {
  display: block;
}

.transfer-confirmation-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

/* Map Modal */
.transfer-map-modal {
  position: fixed;
  inset: 0;
  background: white;
  z-index: 10001;
  display: none;
}

.transfer-map-modal.show {
  display: flex;
  flex-direction: column;
}

.transfer-map-header {
  background: #2563eb;
  color: white;
  padding: 1rem;
  padding-top: calc(1rem + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 1rem;
}

.transfer-map-header h3 {
  flex: 1;
  font-size: 1.125rem;
  margin: 0;
}

.transfer-map-back {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.transfer-map-back:active {
  background: rgba(255,255,255,0.3);
}

.transfer-map-content {
  flex: 1;
  background: #f3f4f6;
  min-height: 0;
  overflow: hidden;
}

/* Complete Screen */
.transfer-step1-content,
.transfer-step3-content {
  text-align: center;
  padding: 1.5rem;
}
.transfer-step1-title,
.transfer-step3-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.transfer-step1-hint,
.transfer-step3-hint {
  color: var(--gray-600);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.transfer-step1-content .transfer-scan-input,
.transfer-step3-content .transfer-scan-input {
  width: 100%;
  max-width: 280px;
  margin: 0 auto 1rem;
  display: block;
}
.transfer-step1-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

/* On-the-go transfer: product list and done button */
.transfer-onthego-list {
  margin: 1rem 0;
  max-height: 12rem;
  overflow-y: auto;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  background: var(--gray-50, #f9fafb);
}
.transfer-onthego-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}
.transfer-onthego-item:last-child {
  border-bottom: none;
}
.transfer-onthego-item-name {
  flex: 1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.transfer-onthego-item-qty {
  font-size: 0.875rem;
  color: var(--gray-600, #4b5563);
}
.transfer-onthego-done {
  margin-top: 1rem;
  width: 100%;
}

.transfer-complete-screen {
  text-align: center;
  padding: 2rem;
}

.transfer-complete-icon {
  width: 100px;
  height: 100px;
  background: #16a34a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 3rem;
  color: white;
}

.transfer-complete-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.transfer-complete-summary {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.transfer-summary-item {
  text-align: center;
}

.transfer-summary-value {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: #16a34a;
}

.transfer-summary-item.warning .transfer-summary-value {
  color: #f59e0b;
}

.transfer-summary-item.danger .transfer-summary-value {
  color: #dc2626;
}

.transfer-summary-label {
  font-size: 0.875rem;
  color: var(--gray-500, #6b7280);
}

/* ===== TRANSFER MODAL — DARK THEME (for future dark mode) ===== */
/* Add class "transfer-dark" to .transfer-modal-overlay to activate */

.transfer-dark.transfer-modal-overlay {
  background: var(--gray-900, #111827);
  color: white;
}

.transfer-dark .transfer-header {
  background: rgba(0, 0, 0, 0.3);
  border-bottom: none;
}

.transfer-dark .transfer-ticket-id {
  color: white;
}

.transfer-dark .transfer-ticket-meta {
  color: rgba(255,255,255,0.7);
}

.transfer-dark .transfer-ticket-info {
  opacity: 0.8;
}

.transfer-dark .transfer-btn-exit {
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
}

.transfer-dark .transfer-btn-exit:active {
  background: rgba(255,255,255,0.2);
}

.transfer-dark .transfer-progress-dot {
  background: rgba(255,255,255,0.3);
}

.transfer-dark .transfer-product-image {
  background: white;
  border: none;
}

.transfer-dark .transfer-product-image-placeholder {
  background: rgba(255,255,255,0.1);
  border: none;
  color: rgba(255,255,255,0.5);
}

.transfer-dark .transfer-product-description {
  color: rgba(255,255,255,0.7);
}

.transfer-dark .transfer-qty-number {
  background: linear-gradient(180deg, white 0%, rgba(255,255,255,0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.transfer-dark .transfer-qty-display-label {
  color: rgba(255,255,255,0.6);
}

.transfer-dark .transfer-available-qty {
  color: rgba(255,255,255,0.5);
}

.transfer-dark .transfer-available-qty strong {
  color: rgba(255,255,255,0.8);
}

.transfer-dark .transfer-item-counter-total {
  color: rgba(255,255,255,0.5);
}

.transfer-dark .transfer-scan-section {
  border-top: none;
  background: transparent;
}

.transfer-dark .transfer-scan-prompt {
  color: rgba(255,255,255,0.6);
}

.transfer-dark .transfer-scan-input {
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
  color: white;
}

.transfer-dark .transfer-scan-input::placeholder {
  color: rgba(255,255,255,0.3);
}

.transfer-dark .transfer-scan-input:focus {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.15);
}

.transfer-dark .transfer-btn-nav {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.15);
}

.transfer-dark .transfer-btn-nav:active:not(:disabled) {
  background: rgba(255,255,255,0.2);
}

.transfer-dark .transfer-btn-cancel {
  background: rgba(255,255,255,0.1);
  color: white;
  border: none;
}

.transfer-dark .transfer-btn-cancel:active {
  background: rgba(255,255,255,0.2);
}

.transfer-dark .transfer-confirmation-overlay {
  background: rgba(0, 0, 0, 0.95);
  color: white;
}

.transfer-dark .transfer-confirmation-close {
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
}

.transfer-dark .transfer-confirmation-close:active {
  background: rgba(255,255,255,0.2);
}

.transfer-dark .transfer-confirmation-title {
  color: white;
}

.transfer-dark .transfer-confirmation-subtitle {
  color: rgba(255,255,255,0.6);
}

.transfer-dark .transfer-qty-label {
  color: rgba(255,255,255,0.5);
}

.transfer-dark .transfer-qty-btn {
  border: 2px solid rgba(255,255,255,0.3);
  background: transparent;
  color: white;
}

.transfer-dark .transfer-qty-btn:active {
  background: rgba(255,255,255,0.1);
}

.transfer-dark .transfer-qty-value {
  color: white;
}

.transfer-dark .transfer-qty-max {
  color: rgba(255,255,255,0.4);
}

.transfer-dark .transfer-summary-label {
  color: rgba(255,255,255,0.6);
}

/* ===== PROJECT INVENTORY MODAL ===== */

.project-inventory-modal {
  max-height: 70vh;
  overflow-y: auto;
}

.inventory-status-summary {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--gray-50, #f9fafb);
  border-radius: 12px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.status-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 1rem;
  background: white;
  border-radius: 8px;
  min-width: 80px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.status-stat-icon {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.status-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--status-color);
}

.status-stat-label {
  font-size: 0.75rem;
  color: var(--gray-500, #6b7280);
  text-align: center;
}

.inventory-cost-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--primary, #2563eb);
  color: white;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.inventory-cost-summary strong {
  font-size: 1.25rem;
}

.inventory-status-sections {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.inventory-status-section {
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
}

.inventory-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--gray-50, #f9fafb);
  cursor: pointer;
  user-select: none;
}

.inventory-section-header:hover {
  background: var(--gray-100, #f3f4f6);
}

.section-icon {
  font-size: 1.25rem;
}

.section-title {
  flex: 1;
  font-weight: 600;
}

.section-count {
  background: var(--gray-200, #e5e7eb);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.section-toggle {
  color: var(--gray-400, #9ca3af);
  font-size: 0.75rem;
}

.inventory-section-items {
  border-top: 1px solid var(--gray-200, #e5e7eb);
}

.inventory-section-items.collapsed {
  display: none;
}

.inventory-item-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-100, #f3f4f6);
}

.inventory-item-row:last-child {
  border-bottom: none;
}

.inventory-item-image {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.inventory-item-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  background: var(--gray-100, #f3f4f6);
}

.inventory-item-image .placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100, #f3f4f6);
  border-radius: 6px;
  font-size: 1.25rem;
}

.inventory-item-info {
  flex: 1;
  min-width: 0;
}

.inventory-item-sku {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--gray-900, #111827);
}

.inventory-item-desc {
  font-size: 0.75rem;
  color: var(--gray-500, #6b7280);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inventory-item-qty {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary, #2563eb);
  min-width: 40px;
  text-align: center;
}

.inventory-item-actions {
  display: flex;
  gap: 0.25rem;
}

.inventory-item-actions .btn {
  padding: 0.5rem;
  min-width: 36px;
}

/* ===== TRUCK INVENTORY MODAL ===== */

.truck-inventory-modal {
  max-height: 70vh;
  overflow-y: auto;
}

.truck-summary {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--gray-50, #f9fafb);
  border-radius: 12px;
  margin-bottom: 1rem;
  justify-content: center;
}

.truck-summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.truck-summary-stat .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary, #2563eb);
}

.truck-summary-stat .stat-label {
  font-size: 0.75rem;
  color: var(--gray-500, #6b7280);
}

.truck-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.truck-actions .btn {
  flex: 1;
  min-width: 120px;
}

.truck-inventory-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.truck-item-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--gray-50, #f9fafb);
  border-radius: 8px;
}

.truck-item-image {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.truck-item-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  background: white;
}

.truck-item-image .placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 6px;
  font-size: 1.25rem;
}

.truck-item-info {
  flex: 1;
  min-width: 0;
}

.truck-item-sku {
  font-weight: 600;
  font-size: 0.875rem;
}

.truck-item-desc {
  font-size: 0.75rem;
  color: var(--gray-500, #6b7280);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.truck-item-qty {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary, #2563eb);
  min-width: 40px;
  text-align: center;
}

.truck-item-actions {
  display: flex;
  gap: 0.25rem;
}

/* Restock / Transfer forms */
.restock-form,
.quick-transfer-form,
.return-form,
.transfer-to-project-form {
  padding: 0.5rem 0;
}

.search-results {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  margin-top: 0.5rem;
}

.search-results:empty {
  display: none;
}

.search-result-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100, #f3f4f6);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--gray-50, #f9fafb);
}

.transfer-items-list,
.return-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.transfer-item-row,
.return-item-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: var(--gray-50, #f9fafb);
  border-radius: 6px;
}

.transfer-item-row label,
.return-item-row label {
  flex: 1;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.transfer-item-row .item-sku,
.return-item-row .item-sku {
  font-weight: 600;
  font-size: 0.875rem;
}

.transfer-item-row .item-desc,
.return-item-row .item-desc {
  font-size: 0.75rem;
  color: var(--gray-500, #6b7280);
}

.qty-input {
  width: 80px;
  text-align: center;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-400, #9ca3af);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.empty-state .empty-text {
  font-size: 0.875rem;
}

/* Truck Selector */
.truck-selector {
  padding: 0.5rem 0;
}

.truck-selector p {
  margin-bottom: 1rem;
  color: var(--gray-600, #4b5563);
}

.truck-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.truck-select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-900, #111827);
  transition: all 0.15s;
}

.truck-select-btn:hover {
  background: var(--gray-100, #f3f4f6);
  border-color: var(--primary, #2563eb);
}

.truck-item-count {
  font-size: 0.75rem;
  color: var(--gray-500, #6b7280);
  background: var(--gray-200, #e5e7eb);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
}

/* Truck Manage Button */
.hero-filter-chip.truck-manage {
  background: var(--gray-100, #f3f4f6);
  border: 1px dashed var(--gray-400, #9ca3af);
}

.hero-filter-chip.truck-manage:hover {
  background: var(--gray-200, #e5e7eb);
  border-style: solid;
}

/* ===== MOVEMENTS TAB ===== */

.movements-section {
  padding: 1rem 0;
}

.movements-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.movements-header h3 {
  margin: 0;
  font-size: 1.125rem;
}

.movements-count {
  font-size: 0.875rem;
  color: var(--gray-500, #6b7280);
  background: var(--gray-100, #f3f4f6);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
}

.movements-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.movement-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--gray-50, #f9fafb);
  border-radius: 8px;
  border-left: 3px solid var(--primary, #2563eb);
}

.movement-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.movement-details {
  flex: 1;
  min-width: 0;
}

.movement-type {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.movement-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.25rem;
}

.movement-meta .meta-tag {
  font-size: 0.75rem;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  background: var(--gray-200, #e5e7eb);
}

.movement-meta .meta-tag.project {
  background: #dbeafe;
  color: #1d4ed8;
}

.movement-meta .meta-tag.ticket {
  background: #fef3c7;
  color: #b45309;
}

.movement-meta .meta-tag.bin {
  background: #f3e8ff;
  color: #7c3aed;
}

.movement-meta .meta-tag.status {
  background: #d1fae5;
  color: #047857;
}

.movement-notes {
  font-size: 0.75rem;
  color: var(--gray-500, #6b7280);
  font-style: italic;
}

.movement-qty {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary, #2563eb);
  min-width: 50px;
  text-align: right;
}

.movement-date {
  font-size: 0.75rem;
  color: var(--gray-400, #9ca3af);
  min-width: 100px;
  text-align: right;
}

/* ===== MATERIAL REPORT ===== */

.material-report {
  max-height: 70vh;
  overflow-y: auto;
}

.report-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

.report-header h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
}

.report-project {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900, #111827);
}

.report-date {
  font-size: 0.875rem;
  color: var(--gray-500, #6b7280);
}

.report-summary-cards {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.report-card {
  flex: 1;
  min-width: 100px;
  padding: 1rem;
  background: var(--gray-50, #f9fafb);
  border-radius: 8px;
  text-align: center;
}

.report-card-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900, #111827);
}

.report-card.consumed .report-card-value {
  color: #059669;
}

.report-card.returned .report-card-value {
  color: #7c3aed;
}

.report-card.net .report-card-value {
  color: #2563eb;
}

.report-card-label {
  font-size: 0.75rem;
  color: var(--gray-500, #6b7280);
  margin-top: 0.25rem;
}

.report-breakdown,
.report-items {
  margin-bottom: 1.5rem;
}

.report-breakdown h3,
.report-items h3 {
  font-size: 1rem;
  margin: 0 0 0.75rem 0;
  color: var(--gray-700, #374151);
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

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

.report-table th {
  background: var(--gray-100, #f3f4f6);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--gray-600, #4b5563);
}

.report-table .consumed-row {
  background: #ecfdf5;
}

.report-table .returned-row {
  background: #f5f3ff;
}

.items-table .item-sku {
  font-weight: 600;
  font-size: 0.875rem;
}

.items-table .item-desc {
  font-size: 0.75rem;
  color: var(--gray-500, #6b7280);
}

/* ===== Warehouse labeling – cute toggles ===== */
#view-warehouse-labeling .whl-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  cursor: pointer;
  user-select: none;
  border-radius: 10px;
  transition: background 0.15s ease;
}
#view-warehouse-labeling .whl-toggle-row:hover {
  background: var(--gray-50, #f9fafb);
}
#view-warehouse-labeling .whl-toggle-row .whl-switch {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--gray-300, #d1d5db);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
#view-warehouse-labeling .whl-toggle-row .whl-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}
#view-warehouse-labeling .whl-toggle-row input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
#view-warehouse-labeling .whl-toggle-row input:checked + .whl-switch {
  background: var(--primary, #3b82f6);
}
#view-warehouse-labeling .whl-toggle-row input:checked + .whl-switch::after {
  transform: translateX(20px);
}
#view-warehouse-labeling .whl-toggle-row .whl-label {
  flex: 1;
  font-size: 0.9rem;
  color: var(--gray-700, #374151);
  line-height: 1.35;
}
#view-warehouse-labeling .whl-toggles-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

/* ===== Mobile / Zebra – user-friendly scan & labeling ===== */
@media (max-width: 768px) {
  #view-warehouse-labeling .page-header,
  #view-scan-by-location .page-header {
    padding: 0.5rem 0;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  #view-warehouse-labeling .card,
  #view-scan-by-location .card {
    max-width: 100%;
  }
  #view-warehouse-labeling .card-body,
  #view-scan-by-location .card-body {
    padding: 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
  #view-warehouse-labeling .form-input,
  #view-scan-by-location .form-input,
  #view-scan-by-location .form-input-lg {
    min-height: 48px;
    font-size: 16px !important;
    padding: 0.75rem 1rem;
    -webkit-appearance: none;
    appearance: none;
  }
  #view-warehouse-labeling #warehouse-labeling-scan,
  #view-scan-by-location #scan-by-location-input {
    min-height: 48px;
    font-size: 16px !important;
  }
  #view-warehouse-labeling .btn,
  #view-scan-by-location .btn {
    min-height: 48px;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    touch-action: manipulation;
  }
  #view-warehouse-labeling .btn-sm,
  #view-scan-by-location .btn-sm {
    min-height: 44px;
    padding: 0.5rem 1rem;
  }
  #view-warehouse-labeling .flex.gap-sm,
  #view-warehouse-labeling .flex[style*="align-items"] {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  #view-warehouse-labeling #warehouse-labeling-submit {
    min-width: 64px;
  }
  #view-warehouse-labeling .whl-toggle-row {
    min-height: 48px;
    padding: 0.6rem 0;
  }
  #view-warehouse-labeling .whl-toggle-row .whl-switch {
    width: 48px;
    height: 28px;
  }
  #view-warehouse-labeling .whl-toggle-row .whl-switch::after {
    width: 22px;
    height: 22px;
  }
  #view-warehouse-labeling .whl-toggle-row input:checked + .whl-switch::after {
    transform: translateX(20px);
  }
  #view-warehouse-labeling .whl-toggle-row .whl-label {
    font-size: 1rem;
  }
  #view-warehouse-labeling .card-header .font-semibold,
  #view-scan-by-location .card-header .font-semibold {
    font-size: 1rem;
  }
  #view-warehouse-labeling .card-header > div {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  #view-warehouse-labeling .card-header .btn,
  #view-scan-by-location .card-header .btn {
    width: 100%;
  }
  #view-scan-by-location .grid-2 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  #view-scan-by-location .shelf-product-item,
  #view-scan-by-location .product-result {
    min-height: 48px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    touch-action: manipulation;
  }
  #view-warehouse-labeling .details-section .form-input,
  #view-warehouse-labeling #warehouse-labeling-edit-line1,
  #view-warehouse-labeling #warehouse-labeling-edit-line2 {
    min-height: 48px;
    font-size: 16px !important;
  }
  #view-warehouse-labeling #warehouse-labeling-confirm-print {
    width: 100%;
    min-height: 52px;
    font-size: 1.1rem;
  }
  #view-warehouse-labeling .card-body[style*="max-height: 280px"],
  #view-scan-by-location .card-body[style*="max-height"] {
    max-height: 40vh;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  #view-warehouse-labeling,
  #view-scan-by-location {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
  }
  #view-warehouse-labeling .card-body,
  #view-scan-by-location .card-body {
    padding: 1rem;
  }
  #view-warehouse-labeling .flex.gap-sm {
    flex-direction: column;
  }
  #view-warehouse-labeling #warehouse-labeling-submit {
    width: 100%;
  }
  #view-warehouse-labeling .text-muted[style*="font-size: 0.85rem"] {
    font-size: 0.9rem !important;
  }
  #view-warehouse-labeling .btn-lg,
  #view-scan-by-location .btn-lg {
    min-height: 52px;
    font-size: 1.1rem;
    width: 100%;
  }
  #view-warehouse-labeling .card.mb-md .card-header {
    flex-direction: column;
    align-items: stretch;
  }
  #view-warehouse-labeling .card.mb-md .card-header > div {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* Modals opened from scan/labeling views – touch-friendly on mobile */
@media (max-width: 768px) {
  .modal-overlay .modal-dialog {
    max-height: 90vh;
    margin: 1rem;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .modal-overlay .btn {
    min-height: 48px;
    touch-action: manipulation;
  }
  .modal-overlay [data-toggle-report] {
    min-height: 48px;
    padding: 0.75rem 1rem;
    touch-action: manipulation;
  }
}

/* =====================================================================
   UNIFIED TICKET SYSTEM
   ===================================================================== */

/* Screen-reader only (visually hidden, available to a11y) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Hero Banner ── */
/* Tickets view: larger font for readability */
#view-tickets .tkt-hero-title { font-size: 1.5rem; }
#view-tickets .tkt-hero-subtitle { font-size: 0.9375rem; }
#view-tickets .tkt-hero-stat-label { font-size: 0.8125rem; }
#view-tickets .tkt-flavor-pill { font-size: 0.875rem; }
#view-tickets .tkt-flavor-pill .pill-icon { font-size: 1rem; }
#view-tickets .tkt-flavor-pill .pill-count { font-size: 0.75rem; }
#view-tickets .tkt-search input { font-size: 0.9375rem; }
#view-tickets .tkt-view-toggle-btn { font-size: 0.875rem; }
#view-tickets .tkt-qc-name { font-size: 0.9375rem; }
#view-tickets .tkt-qc-desc { font-size: 0.8125rem; }
#view-tickets .tkt-kanban-col-header { font-size: 0.875rem; }
#view-tickets .tkt-kanban-col-header .col-count { font-size: 0.8125rem; }
#view-tickets .tkt-kanban-empty { font-size: 0.875rem; }
#view-tickets .tkt-card-flavor-badge { font-size: 0.75rem; }
#view-tickets .tkt-card-id { font-size: 0.75rem; }
#view-tickets .tkt-card-title { font-size: 0.9375rem; }
#view-tickets .tkt-card-dest { font-size: 0.8125rem; }
#view-tickets .tkt-card-meta-item { font-size: 0.75rem; }
#view-tickets .tkt-card-priority { font-size: 0.75rem; }
#view-tickets .tkt-card-avatar { font-size: 0.6875rem; }
#view-tickets .tkt-progress-label { font-size: 0.75rem; }
#view-tickets .tkt-list-table th { font-size: 0.8125rem; }
#view-tickets .tkt-list-table td { font-size: 0.875rem; }
#view-tickets .tkt-list-status { font-size: 0.75rem; }

.tkt-hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  color: white;
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}
.tkt-hero-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.tkt-hero-title { font-size: 1.35rem; font-weight: 700; }
.tkt-hero-subtitle { font-size: 0.8125rem; opacity: 0.8; margin-top: 0.15rem; }
.tkt-hero-stats { display: flex; gap: 1rem; flex-wrap: wrap; }
.tkt-hero-stat { background: rgba(255,255,255,0.15); border-radius: 8px; padding: 0.6rem 1rem; min-width: 110px; backdrop-filter: blur(4px); }
.tkt-hero-stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.tkt-hero-stat-label { font-size: 0.6875rem; opacity: 0.8; margin-top: 0.15rem; }
.tkt-hero-stat.urgent .tkt-hero-stat-value { color: #fbbf24; }
.tkt-hero-stat.overdue .tkt-hero-stat-value { color: #f87171; }
.tkt-hero-stat.unread .tkt-hero-stat-value { color: #67e8f9; }

/* ── Toolbar ── */
.tkt-toolbar {
  background: white;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.625rem;
}
.tkt-toolbar-left, .tkt-toolbar-right { display: flex; gap: 0.625rem; align-items: center; flex-wrap: wrap; }

/* ── Flavor Pills ── */
.tkt-flavor-pills { display: flex; gap: 0.375rem; flex-wrap: wrap; }
.tkt-flavor-pill {
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.35rem 0.7rem; border-radius: 20px;
  border: 2px solid #e5e7eb; background: white;
  font-size: 0.75rem; font-weight: 500; cursor: pointer;
  transition: all 0.15s; color: #6b7280;
}
.tkt-flavor-pill:hover { border-color: #9ca3af; }
.tkt-flavor-pill.active { color: white; border-color: transparent; }
.tkt-flavor-pill .pill-icon { font-size: 0.875rem; }
.tkt-flavor-pill .pill-count {
  background: rgba(0,0,0,0.15); padding: 0.05rem 0.4rem;
  border-radius: 10px; font-size: 0.625rem; font-weight: 600;
}
.tkt-flavor-pill:not(.active) .pill-count { background: #f3f4f6; color: #6b7280; }

/* ── Search Box ── */
.tkt-search {
  display: flex; align-items: center;
  background: #f9fafb; border: 1px solid #e5e7eb;
  border-radius: 8px; padding: 0 0.625rem; min-width: 200px;
}
.tkt-search input {
  border: none; background: transparent;
  padding: 0.4rem 0.5rem; font-size: 0.8125rem;
  outline: none; width: 100%; font-family: inherit;
}

/* ── View Toggle ── */
.tkt-view-toggle { display: flex; background: #f3f4f6; padding: 0.15rem; border-radius: 8px; }
.tkt-view-toggle-btn {
  padding: 0.35rem 0.65rem; border: none; border-radius: 6px;
  font-size: 0.75rem; font-weight: 500; cursor: pointer;
  background: transparent; color: #6b7280; transition: all 0.15s;
  font-family: inherit;
}
.tkt-view-toggle-btn.active { background: white; color: #111827; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }

/* ── Quick Create Dropdown ── */
.tkt-qc-dropdown { position: relative; }
.tkt-qc-menu {
  position: absolute; top: calc(100% + 4px); right: 0;
  background: white; border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  padding: 0.5rem; min-width: 220px; z-index: 50;
  display: none;
}
.tkt-qc-menu.visible { display: block; }
.tkt-qc-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.75rem; border-radius: 8px;
  cursor: pointer; transition: background 0.1s;
  border: none; background: none; width: 100%;
  text-align: left; font-family: inherit;
}
.tkt-qc-item:hover { background: #f9fafb; }
.tkt-qc-icon {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.tkt-qc-name { font-weight: 600; font-size: 0.8125rem; color: #111827; }
.tkt-qc-desc { font-size: 0.6875rem; color: #6b7280; }

/* ── Kanban Board ── */
.tkt-kanban {
  display: flex; gap: 0.875rem;
  overflow-x: auto; padding-bottom: 0.75rem;
}
.tkt-kanban-col {
  min-width: 280px; max-width: 320px; flex: 1;
  background: #f9fafb; border-radius: 12px;
  display: flex; flex-direction: column;
}
.tkt-kanban-col-header {
  padding: 0.625rem 0.875rem; border-radius: 12px 12px 0 0;
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; font-size: 0.75rem; color: white;
}
.tkt-kanban-col-header .col-count {
  background: rgba(255,255,255,0.25); padding: 0.1rem 0.45rem;
  border-radius: 10px; font-size: 0.6875rem;
}
.tkt-kanban-col-body {
  padding: 0.625rem; flex: 1;
  display: flex; flex-direction: column; gap: 0.5rem;
  min-height: 150px;
}
.tkt-kanban-empty {
  text-align: center; color: #9ca3af;
  font-size: 0.75rem; padding: 2rem 0.5rem; font-style: italic;
}
.tkt-kanban-col-header {
  flex-wrap: wrap;
  gap: 0.35rem;
}
.tkt-kanban-col-header-toggle {
  width: 100%;
  order: 3;
  font-size: 0.6875rem;
  padding: 0.2rem 0.4rem;
  background: rgba(255,255,255,0.25);
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font-weight: 500;
}
.tkt-kanban-col-header-toggle:hover {
  background: rgba(255,255,255,0.35);
}
.tkt-kanban-col-completed-hidden {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0.5rem;
  text-align: center;
  min-height: 80px;
}
.tkt-kanban-col-completed-count {
  font-size: 0.8125rem;
  color: #6b7280;
}
.tkt-kanban-col-completed-toggle {
  font-size: 0.8125rem;
}

/* ── Ticket Cards ── */
.tkt-card {
  background: white; border-radius: 10px; padding: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); cursor: pointer;
  transition: all 0.15s; border-left: 4px solid transparent;
  position: relative;
}
.tkt-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-1px); }
.tkt-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.375rem; }
.tkt-card-flavor-badge {
  display: inline-flex; align-items: center; gap: 0.2rem;
  font-size: 0.625rem; font-weight: 600;
  padding: 0.1rem 0.4rem; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.02em;
}
.tkt-card-id { font-size: 0.625rem; color: #9ca3af; font-weight: 500; font-family: 'SF Mono','Fira Code',monospace; }
.tkt-card-title { font-weight: 600; font-size: 0.8125rem; color: #111827; margin-bottom: 0.25rem; line-height: 1.3; }
.tkt-card-dest { font-size: 0.6875rem; color: #6b7280; margin-bottom: 0.5rem; }
.tkt-card-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 0.375rem; border-top: 1px solid #f3f4f6;
}
.tkt-card-meta { display: flex; gap: 0.5rem; align-items: center; }
.tkt-card-meta-item { font-size: 0.625rem; color: #9ca3af; display: flex; align-items: center; gap: 0.15rem; }
.tkt-card-priority {
  font-size: 0.625rem; font-weight: 600; padding: 0.1rem 0.4rem; border-radius: 4px;
}
.tkt-priority-urgent { background: #fef2f2; color: #dc2626; }
.tkt-priority-high { background: #fff7ed; color: #ea580c; }
.tkt-priority-normal { background: #f0fdf4; color: #16a34a; }
.tkt-priority-low { background: #f9fafb; color: #9ca3af; }

/* Urgent ticket visibility: red outline */
.tkt-card.tkt-card-urgent { box-shadow: 0 0 0 2px #dc2626; border-left-color: #dc2626 !important; }
.tkt-list-card.tkt-list-card-urgent { box-shadow: 0 0 0 2px #dc2626; border-left: 4px solid #dc2626; }
.tkt-list-table tr.tkt-row-urgent td { background: #fef2f2; }
.tkt-list-table tr.tkt-row-urgent td:first-child { border-left: 4px solid #dc2626; }
.tkt-detail-header.tkt-detail-header-urgent { box-shadow: inset 0 -3px 0 0 #dc2626; background: linear-gradient(135deg, #fef2f2 0%, #fff 100%); }
.tkt-card-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: #dbeafe; color: #2563eb;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.5625rem; font-weight: 700;
}
.tkt-card-unread {
  position: absolute; top: -4px; right: -4px;
  background: #ef4444; color: white;
  font-size: 0.5625rem; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid white;
}
.tkt-card-progress { margin-top: 0.375rem; margin-bottom: 0.15rem; }
.tkt-progress-bg { height: 3px; background: #e5e7eb; border-radius: 2px; overflow: hidden; }
.tkt-progress-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }
.tkt-progress-label { font-size: 0.625rem; color: #9ca3af; margin-top: 0.1rem; }

/* ── List View ── */
.tkt-list-table {
  width: 100%; background: white; border-radius: 12px;
  overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-collapse: collapse;
}
.tkt-list-table th {
  text-align: left; padding: 0.625rem 0.875rem;
  font-size: 0.6875rem; font-weight: 600; color: #6b7280;
  text-transform: uppercase; letter-spacing: 0.025em;
  background: #f9fafb; border-bottom: 1px solid #e5e7eb;
}
.tkt-list-table td {
  padding: 0.625rem 0.875rem; font-size: 0.75rem;
  border-bottom: 1px solid #f3f4f6; vertical-align: middle;
}
.tkt-list-table tr:hover td { background: #f9fafb; cursor: pointer; }
.tkt-list-flavor-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 0.3rem; }
.tkt-list-status {
  font-size: 0.625rem; font-weight: 600;
  padding: 0.15rem 0.5rem; border-radius: 12px;
  display: inline-block;
}

/* ── Ticket Detail Panel (Design N — catalogue style) ── */
.ticket-detail-panel {
  width: 90vw; max-width: 900px; height: 90vh;
  border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
  background: white;
}
.ticket-detail-panel #ticket-detail-root {
  display: flex; flex-direction: column; min-height: 0; flex: 1;
  overflow: hidden;
}

/* ── Header ── */
.tkt-detail-header {
  padding: 1.75rem 4rem 1.75rem 2rem;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
  background: linear-gradient(135deg, var(--gray-50, #f9fafb) 0%, white 100%);
  flex-shrink: 0;
  position: relative; overflow: hidden;
}
.tkt-detail-header-content {
  display: flex; justify-content: space-between; align-items: flex-start;
}
.tkt-detail-header-info { flex: 1; min-width: 0; }
.tkt-detail-title {
  font-size: 1.75rem; font-weight: 700; color: #111827; line-height: 1.25;
  margin-bottom: 0.35rem;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.tkt-detail-badges {
  display: flex; align-items: center; gap: 0.5rem;
  flex-wrap: wrap; margin-bottom: 0.4rem;
}
.tkt-id-badge {
  font-family: 'SF Mono','Fira Code',monospace; font-size: 0.8125rem;
  color: #6b7280; background: #f3f4f6;
  padding: 0.2rem 0.5rem; border-radius: 6px; font-weight: 600;
}
.tkt-flavor-tag {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.2rem 0.5rem; border-radius: 6px;
  font-size: 0.8125rem; font-weight: 600;
}
.tkt-detail-subtitle {
  font-size: 0.9375rem; color: #6b7280; line-height: 1.4;
}
.tkt-detail-subtitle strong { color: #374151; }

/* Flavor accent strip */
.tkt-flavor-strip {
  position: absolute; top: 0; right: 0; bottom: 0; width: 48px;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 1.25rem;
}
.tkt-strip-close {
  width: 36px; height: 36px; border-radius: 8px; border: none;
  background: rgba(255,255,255,0.2); color: white;
  font-size: 1.125rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s;
}
.tkt-strip-close:hover { background: rgba(255,255,255,0.35); }

/* Status / Priority selects */
.tkt-status-select, .tkt-priority-select {
  padding: 0.3rem 0.4rem; border-radius: 6px;
  border: 1px solid #e5e7eb; font-size: 0.75rem;
  font-weight: 600; cursor: pointer; font-family: inherit;
}

/* ── Tab nav (catalogue style) ── */
.tkt-tab-nav {
  display: flex; gap: 0.25rem; margin-top: 1.5rem;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tkt-tab-nav::-webkit-scrollbar { display: none; }
.tkt-tab-btn {
  padding: 0.625rem 1.25rem; background: transparent; border: none;
  font-size: 0.9375rem; font-weight: 500; color: #6b7280;
  cursor: pointer; white-space: nowrap; font-family: inherit;
  border-radius: 8px; display: flex; align-items: center; gap: 0.35rem;
  min-height: 44px; transition: all 0.15s;
}
.tkt-tab-btn:hover { color: #111827; background: #f3f4f6; }
.tkt-tab-btn.active { color: var(--primary, #2563eb); background: var(--primary-light, #dbeafe); font-weight: 600; }
.tkt-tab-badge {
  background: #3b82f6; color: white; font-size: 0.7rem;
  padding: 1px 5px; border-radius: 8px; margin-left: 2px;
}
.tkt-tab-btn.active .tkt-tab-badge { background: var(--primary-hover, #1d4ed8); }
.tkt-tab-count {
  background: #f3f4f6; color: #6b7280; font-size: 0.7rem;
  padding: 1px 5px; border-radius: 8px; margin-left: 2px;
}
.tkt-tab-content {
  padding: 2rem; overflow-y: auto; flex: 1;
  min-height: 0; display: none;
}
.tkt-tab-content.active { display: block; }

/* ── Info Tab — grouped sections ── */
.tkt-info-group {
  background: var(--gray-50, #f9fafb); border: 1px solid var(--gray-100, #f3f4f6);
  border-radius: 10px; padding: 1rem; margin-bottom: 0.75rem;
}
.tkt-info-group-title {
  font-size: 0.6875rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: #9ca3af; margin-bottom: 0.75rem;
}
.tkt-info-group-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.tkt-info-group-item { display: flex; flex-direction: column; gap: 0.15rem; }
.tkt-info-group-label {
  font-size: 0.6875rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.03em; color: #9ca3af;
}
.tkt-info-group-value { font-size: 0.9375rem; color: #111827; font-weight: 500; }
.tkt-info-action {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.2rem 0.5rem; border-radius: 6px; border: none;
  font-size: 0.75rem; font-weight: 500; cursor: pointer;
  background: #f3f4f6; color: #6b7280; font-family: inherit;
}
.tkt-info-action:hover { background: #e5e7eb; color: #111827; }
.tkt-date-input {
  padding: 0.3rem 0.4rem; border-radius: 6px; border: 1px solid var(--gray-300, #d1d5db);
  font-size: 0.875rem; font-family: inherit; cursor: pointer;
}
.tkt-info-section {
  margin-bottom: 0.75rem; padding: 1rem;
  background: var(--gray-50, #f9fafb); border-radius: 10px;
  border: 1px solid var(--gray-100, #f3f4f6);
}
.tkt-info-section-label {
  font-size: 0.6875rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: #9ca3af; margin-bottom: 0.4rem;
}
.tkt-info-section-text { font-size: 0.9375rem; color: #374151; line-height: 1.6; }
.tkt-info-danger { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid #fecaca; }
.tkt-btn-danger {
  padding: 0.4rem 0.75rem; border-radius: 6px; border: none;
  background: #fef2f2; color: #dc2626; font-size: 0.8125rem;
  font-weight: 600; cursor: pointer; font-family: inherit; min-height: 44px;
}
.tkt-btn-danger:hover { background: #fee2e2; }

/* ── Materials Tab (Design N) ── */
.tkt-mat-transfer-primary {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #059669, #047857);
  color: white; border: none; border-radius: 10px;
  font-size: 1rem; font-weight: 700; cursor: pointer; font-family: inherit;
  box-shadow: 0 2px 8px rgba(5,150,105,0.3);
  transition: transform 0.12s, box-shadow 0.12s;
  min-height: 48px;
}
.tkt-mat-transfer-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(5,150,105,0.4); }
.tkt-mat-transfer-primary:active { transform: translateY(0); }
.tkt-mat-actions-row { display: flex; gap: 0.375rem; margin-top: 0.5rem; flex-wrap: wrap; }
.tkt-mat-chip {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.4rem 0.625rem; border-radius: 8px; border: 1px solid #e5e7eb;
  background: white; color: #374151; font-size: 0.75rem; font-weight: 600;
  cursor: pointer; font-family: inherit; white-space: nowrap;
  min-height: 36px; transition: all 0.12s;
}
.tkt-mat-chip:hover { border-color: var(--primary, #2563eb); color: var(--primary, #2563eb); background: var(--primary-light, #dbeafe); }
.tkt-mat-chip-icon { font-size: 0.875rem; }

.tkt-mat-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.tkt-mat-count { font-size: 0.8125rem; color: #6b7280; }
.tkt-mat-count strong { color: #111827; }
.tkt-mat-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem; border: 1px solid #f3f4f6; border-radius: 10px;
  margin-bottom: 0.5rem; transition: all 0.15s;
}
.tkt-mat-row:hover { border-color: #e5e7eb; background: #fafafa; }
.tkt-mat-row-freehand .tkt-mat-info { cursor: pointer; }
.tkt-mat-row-freehand .tkt-mat-info:hover { text-decoration: underline; }
.tkt-mat-freehand-badge {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(var(--primary-rgb, 59, 130, 246), 0.12);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.35rem;
  vertical-align: middle;
}
.tkt-mat-img {
  width: 42px; height: 42px; border-radius: 8px;
  background: #f3f4f6; display: flex; align-items: center;
  justify-content: center; font-size: 1.125rem; flex-shrink: 0;
  overflow: hidden;
}
.tkt-mat-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tkt-mat-info { flex: 1; min-width: 0; }
.tkt-mat-name { font-weight: 600; font-size: 0.8125rem; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tkt-mat-code { font-size: 0.6875rem; color: #9ca3af; font-family: 'SF Mono','Fira Code',monospace; }
.tkt-mat-qty { text-align: center; min-width: 70px; }
.tkt-mat-qty-nums { font-weight: 700; font-size: 0.9375rem; }
.tkt-mat-qty-nums .transferred { color: #10b981; }
.tkt-mat-qty-nums .slash { color: #d1d5db; margin: 0 0.1rem; }
.tkt-mat-qty-nums .total { color: #111827; }
.tkt-mat-qty-label { font-size: 0.625rem; color: #9ca3af; }
.tkt-mat-badge { font-size: 0.625rem; font-weight: 600; padding: 0.15rem 0.4rem; border-radius: 6px; display: inline-block; }
.tkt-mat-badge.pending { background: #fef3c7; color: #92400e; }
.tkt-mat-badge.partial { background: #dbeafe; color: #1e40af; }
.tkt-mat-badge.done { background: #d1fae5; color: #065f46; }

/* Materials tab: pending section and bins */
.tkt-mat-pending-section { margin-bottom: 1.25rem; }
.tkt-mat-pending-title { font-size: 0.8125rem; font-weight: 600; color: #374151; margin-bottom: 0.5rem; }
.tkt-mat-pending-empty { font-size: 0.8125rem; color: #9ca3af; padding: 0.5rem 0; margin: 0; }

.tkt-bins-section { margin-top: 1rem; }
.tkt-bins-section-title { font-size: 0.8125rem; font-weight: 600; color: #374151; margin-bottom: 0.5rem; }
.tkt-bin-block { margin-bottom: 0.5rem; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }
.tkt-bin-details { margin: 0; }
.tkt-bin-header {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0.875rem;
  background: #f9fafb; cursor: pointer; list-style: none; font-size: 0.875rem;
}
.tkt-bin-header::-webkit-details-marker { display: none; }
.tkt-bin-header .tkt-bin-chevron {
  margin-left: auto; width: 0; height: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid #6b7280;
  transition: transform 0.2s;
}
.tkt-bin-details[open] .tkt-bin-header .tkt-bin-chevron { transform: rotate(180deg); }
.tkt-bin-id { font-weight: 600; color: #111827; }
.tkt-bin-location { font-size: 0.75rem; color: #6b7280; }
.tkt-bin-body { padding: 0.5rem 0.875rem 0.75rem; background: #fff; border-top: 1px solid #f3f4f6; }
.tkt-bin-map-wrap { margin-bottom: 0.75rem; border-radius: 8px; overflow: hidden; border: 1px solid #e5e7eb; background: #f9fafb; }
.tkt-bin-map-iframe { display: block; width: 100%; height: 220px; border: none; }
.tkt-bin-item {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0;
  font-size: 0.8125rem; border-bottom: 1px solid #f9fafb;
}
.tkt-bin-item:last-child { border-bottom: none; }
.tkt-bin-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.tkt-bin-item-name { font-weight: 500; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tkt-bin-item-code { font-size: 0.6875rem; color: #9ca3af; font-family: 'SF Mono','Fira Code',monospace; }
.tkt-bin-item-qty { font-weight: 600; color: #059669; min-width: 2rem; text-align: right; }
.tkt-bin-empty { font-size: 0.8125rem; color: #9ca3af; padding: 0.5rem 0; margin: 0; }
.tkt-bin-empty-msg { font-size: 0.8125rem; color: #6b7280; padding: 0.5rem 0; margin: 0; }

.tkt-notes-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 10230; padding: 1.5rem; /* Above ticket-detail .modal-overlay (10200) */
}
.tkt-notes-modal {
  background: var(--bg, #fff); border-radius: var(--radius-lg, 12px);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15), 0 12px 24px -8px rgba(0,0,0,0.1);
  width: 100%; min-width: 360px; max-width: 480px; padding: 0; overflow: hidden;
}
.tkt-notes-modal-header {
  padding: 1.25rem 1.5rem; font-weight: 600; font-size: 1.125rem; color: var(--gray-900, #111827);
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}
.tkt-notes-modal-textarea {
  width: 100%; min-height: 140px; margin: 0; padding: 1rem 1.25rem;
  border: none; border-radius: 0; font-size: 0.9375rem; line-height: 1.5; resize: vertical;
  box-sizing: border-box; background: var(--gray-50, #f9fafb);
  display: block;
}
.tkt-notes-modal-textarea::placeholder { color: var(--gray-400, #9ca3af); }
.tkt-notes-modal-textarea:focus { outline: none; background: var(--bg, #fff); box-shadow: inset 0 0 0 2px var(--primary, #2563eb); }
.tkt-notes-modal-footer {
  display: flex; gap: 0.75rem; justify-content: flex-end; padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200, #e5e7eb); background: var(--gray-50, #f9fafb);
}
.tkt-notes-modal-footer .btn { min-height: 2.25rem; padding: 0.5rem 1rem; font-size: 0.875rem; }

/* ── Messages Tab ── */
.tkt-msg-container { display: flex; flex-direction: column; height: 450px; }
.tkt-msg-thread { flex: 1; overflow-y: auto; padding: 0.75rem 0; display: flex; flex-direction: column; gap: 0.625rem; }
.tkt-msg-group { display: flex; gap: 0.5rem; max-width: 80%; }
.tkt-msg-group.mine { align-self: flex-end; flex-direction: row-reverse; }
.tkt-msg-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.625rem; font-weight: 700; flex-shrink: 0; margin-top: 0.2rem;
}
.tkt-msg-group:not(.mine) .tkt-msg-avatar { background: #dbeafe; color: #2563eb; }
.tkt-msg-group.mine .tkt-msg-avatar { background: #d1fae5; color: #065f46; }
.tkt-msg-name { font-size: 0.625rem; font-weight: 600; color: #6b7280; margin-bottom: 0.15rem; }
.tkt-msg-group.mine .tkt-msg-name { text-align: right; }
.tkt-msg-bubble { padding: 0.5rem 0.75rem; border-radius: 12px; font-size: 0.75rem; line-height: 1.5; }
.tkt-msg-group:not(.mine) .tkt-msg-bubble { background: #f3f4f6; color: #111827; border-top-left-radius: 4px; }
.tkt-msg-group.mine .tkt-msg-bubble { background: #2563eb; color: white; border-top-right-radius: 4px; }
.tkt-msg-time { font-size: 0.5625rem; color: #9ca3af; margin-top: 0.15rem; }
.tkt-msg-group.mine .tkt-msg-time { text-align: right; color: rgba(37,99,235,0.4); }
.tkt-msg-divider { text-align: center; font-size: 0.625rem; color: #9ca3af; padding: 0.375rem 0; position: relative; }
.tkt-msg-divider::before, .tkt-msg-divider::after {
  content: ''; position: absolute; top: 50%; width: 30%; height: 1px; background: #e5e7eb;
}
.tkt-msg-divider::before { left: 0; }
.tkt-msg-divider::after { right: 0; }
.tkt-msg-input-bar { display: flex; gap: 0.375rem; padding-top: 0.625rem; border-top: 1px solid #e5e7eb; }
.tkt-msg-input {
  flex: 1; border: 1px solid #e5e7eb; border-radius: 20px;
  padding: 0.5rem 0.875rem; font-size: 0.75rem; font-family: inherit; outline: none;
}
.tkt-msg-input:focus { border-color: #2563eb; }
.tkt-msg-send-btn, .tkt-msg-attach-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.875rem; transition: background 0.15s;
}
.tkt-msg-send-btn { background: #2563eb; color: white; }
.tkt-msg-send-btn:hover { background: #1d4ed8; }
.tkt-msg-attach-btn { background: white; border: 1px solid #e5e7eb; color: #6b7280; }

/* ── Attachments Tab ── */
.tkt-attach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.tkt-attach-card {
  background: #f9fafb; border: 1px solid #e5e7eb;
  border-radius: 10px; overflow: hidden; cursor: pointer; transition: all 0.15s;
}
.tkt-attach-card:hover { border-color: #2563eb; box-shadow: 0 2px 8px rgba(37,99,235,0.15); }
.tkt-attach-thumb {
  height: 100px; background: #e5e7eb; display: flex;
  align-items: center; justify-content: center; font-size: 2rem; color: #9ca3af;
}
.tkt-attach-info { padding: 0.5rem; }
.tkt-attach-name { font-size: 0.6875rem; font-weight: 600; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tkt-attach-meta { font-size: 0.625rem; color: #9ca3af; margin-top: 0.1rem; }
.tkt-upload-zone {
  border: 2px dashed #d1d5db; border-radius: 12px;
  padding: 1.5rem; text-align: center; color: #9ca3af;
  cursor: pointer; transition: all 0.2s;
}
.tkt-upload-zone:hover { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.tkt-upload-zone.dragover { border-color: #2563eb; background: #eff6ff; }
.tkt-upload-icon { font-size: 1.5rem; margin-bottom: 0.375rem; }
.tkt-upload-text { font-size: 0.8125rem; font-weight: 500; }
.tkt-upload-hint { font-size: 0.6875rem; margin-top: 0.15rem; }

/* ── Tasks Tab ── */
.tkt-task-input-row { display: flex; gap: 0.375rem; margin-bottom: 0.75rem; }
.tkt-task-input {
  flex: 1; padding: 0.5rem 0.75rem; border: 1px solid #d1d5db;
  border-radius: 8px; font-size: 0.8125rem; font-family: inherit; outline: none;
}
.tkt-task-input:focus { border-color: #2563eb; }
.tkt-task-item {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.625rem; border: 1px solid #e5e7eb; border-radius: 10px;
  margin-bottom: 0.375rem; transition: background 0.1s;
}
.tkt-task-item:hover { background: #fafafa; }
.tkt-task-checkbox {
  width: 20px; height: 20px; border: 2px solid #d1d5db;
  border-radius: 50%; flex-shrink: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; font-size: 0.6875rem;
}
.tkt-task-checkbox.checked { background: #10b981; border-color: #10b981; color: white; }
.tkt-task-text { flex: 1; font-size: 0.8125rem; }
.tkt-task-text.completed { text-decoration: line-through; color: #9ca3af; }
.tkt-task-remove { border: none; background: none; color: #d1d5db; cursor: pointer; font-size: 0.8125rem; padding: 0.25rem; }
.tkt-task-remove:hover { color: #ef4444; }

/* ── Issues Tab ── */
.tkt-issue-card {
  border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 0.875rem; margin-bottom: 0.625rem;
}
.tkt-issue-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.5rem; }
.tkt-issue-severity { font-size: 0.625rem; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 12px; }
.tkt-issue-severity.low { background: #f0fdf4; color: #16a34a; }
.tkt-issue-severity.medium { background: #fffbeb; color: #d97706; }
.tkt-issue-severity.high { background: #fef2f2; color: #dc2626; }
.tkt-issue-severity.critical { background: #f5f3ff; color: #7c3aed; }
.tkt-issue-desc { font-size: 0.8125rem; color: #374151; line-height: 1.5; }
.tkt-issue-location { font-size: 0.6875rem; color: #6b7280; margin-top: 0.375rem; }
.tkt-issue-photos { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.tkt-issue-photo { width: 60px; height: 60px; border-radius: 6px; object-fit: cover; background: #e5e7eb; }
.tkt-issue-resolved { opacity: 0.6; border-color: #d1fae5; }
.tkt-issue-resolution { font-size: 0.75rem; color: #065f46; margin-top: 0.375rem; padding: 0.375rem 0.5rem; background: #f0fdf4; border-radius: 6px; }

/* ── Activity Log ── */
.tkt-activity { margin-top: 1rem; padding: 1rem 1.5rem; border-top: 1px solid #f3f4f6; }
.tkt-activity-title { font-weight: 700; font-size: 0.875rem; margin-bottom: 0.75rem; }
.tkt-activity-timeline { position: relative; padding-left: 1.75rem; }
.tkt-activity-timeline::before {
  content: ''; position: absolute; left: 9px; top: 0; bottom: 0;
  width: 2px; background: #e5e7eb;
}
.tkt-activity-item { position: relative; padding-bottom: 1rem; }
.tkt-activity-item:last-child { padding-bottom: 0; }
.tkt-activity-dot {
  position: absolute; left: -1.35rem; top: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.625rem; background: white; border: 2px solid #e5e7eb;
}
.tkt-activity-text { font-size: 0.75rem; color: #374151; line-height: 1.4; }
.tkt-activity-text strong { font-weight: 600; color: #111827; }
.tkt-activity-time { font-size: 0.625rem; color: #9ca3af; margin-top: 0.1rem; }

/* ── Wizard Panel ── */
.ticket-wizard-panel {
  width: 90vw; max-width: 800px; max-height: 90vh;
  border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column;
  background: white;
}
.tkt-wiz-step-indicator {
  display: flex; justify-content: center;
  padding: 1.25rem 1.5rem 0.75rem; gap: 0;
  background: #fafbfc; border-bottom: 1px solid #f3f4f6;
}
.tkt-wiz-step { display: flex; align-items: center; gap: 0.375rem; }
.tkt-wiz-step + .tkt-wiz-step::before {
  content: ''; width: 32px; height: 2px;
  background: #e5e7eb; margin: 0 0.375rem; flex-shrink: 0;
}
.tkt-wiz-step.completed + .tkt-wiz-step::before { background: #10b981; }
.tkt-wiz-circle {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
  border: 2px solid #d1d5db; color: #9ca3af;
  background: white; flex-shrink: 0; transition: all 0.2s;
}
.tkt-wiz-step.active .tkt-wiz-circle { border-color: #2563eb; background: #2563eb; color: white; }
.tkt-wiz-step.completed .tkt-wiz-circle { border-color: #10b981; background: #10b981; color: white; }
.tkt-wiz-label { font-size: 0.6875rem; font-weight: 500; color: #9ca3af; white-space: nowrap; }
.tkt-wiz-step.active .tkt-wiz-label { color: #2563eb; font-weight: 600; }
.tkt-wiz-step.completed .tkt-wiz-label { color: #10b981; }

.tkt-wiz-content { padding: 1.5rem; min-height: 400px; overflow-y: auto; flex: 1; }
.tkt-wiz-step-content { display: none; }
.tkt-wiz-step-content.active { display: block; }
.tkt-wiz-title { font-size: 1.125rem; font-weight: 700; color: #111827; margin-bottom: 0.25rem; }
.tkt-wiz-desc { font-size: 0.8125rem; color: #6b7280; margin-bottom: 1.25rem; }

.tkt-wiz-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1.5rem; border-top: 1px solid #f3f4f6; background: #fafbfc;
}
.tkt-wiz-footer-left, .tkt-wiz-footer-right { display: flex; gap: 0.375rem; }

/* ── Flavor Picker Cards ── */
.tkt-flavor-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.875rem; }
.tkt-flavor-card {
  border: 2px solid #e5e7eb; border-radius: 14px;
  padding: 1.25rem; cursor: pointer; transition: all 0.2s;
  text-align: center; background: white;
}
.tkt-flavor-card:hover { border-color: #9ca3af; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.tkt-flavor-card.selected { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.tkt-flavor-card-icon { font-size: 2.25rem; margin-bottom: 0.625rem; display: block; }
.tkt-flavor-card-name { font-size: 0.9375rem; font-weight: 700; color: #111827; margin-bottom: 0.25rem; }
.tkt-flavor-card-desc { font-size: 0.75rem; color: #6b7280; line-height: 1.4; }

/* ── Wizard Form Elements ── */
.tkt-form-group { margin-bottom: 1rem; }
.tkt-form-label { display: block; font-size: 0.75rem; font-weight: 600; color: #374151; margin-bottom: 0.3rem; }
.tkt-form-label .required { color: #ef4444; }
.tkt-form-label .optional { color: #9ca3af; font-weight: 400; font-size: 0.6875rem; }
.tkt-form-input, .tkt-form-select, .tkt-form-textarea {
  width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #d1d5db;
  border-radius: 8px; font-size: 0.8125rem; font-family: inherit;
  color: #111827; transition: border-color 0.15s; background: white;
}
.tkt-form-input:focus, .tkt-form-select:focus, .tkt-form-textarea:focus {
  outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.tkt-form-textarea { resize: vertical; min-height: 70px; }
.tkt-form-hint { font-size: 0.6875rem; color: #9ca3af; margin-top: 0.15rem; }
.tkt-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.tkt-dest-selector { display: flex; gap: 0.375rem; }
.tkt-dest-selector .tkt-form-select:first-child { max-width: 130px; }
.tkt-prefilled-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: #eff6ff; color: #1e40af; padding: 0.3rem 0.625rem;
  border-radius: 8px; font-size: 0.6875rem; font-weight: 600; margin-bottom: 0.75rem;
}

/* ── Wizard Cart ── */
.tkt-cart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.625rem; }
.tkt-cart-title { font-weight: 700; font-size: 0.875rem; }
.tkt-cart-count { background: #dbeafe; color: #1e40af; font-size: 0.6875rem; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 10px; }
.tkt-cart-item {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.625rem; border: 1px solid #e5e7eb; border-radius: 10px;
  margin-bottom: 0.375rem;
}
.tkt-cart-item-info { flex: 1; }
.tkt-cart-item-name { font-size: 0.75rem; font-weight: 600; }
.tkt-cart-item-code { font-size: 0.625rem; color: #9ca3af; }
.tkt-cart-item-qty { display: flex; align-items: center; gap: 0.2rem; }
.tkt-qty-btn {
  width: 26px; height: 26px; border: 1px solid #d1d5db;
  border-radius: 6px; background: white; cursor: pointer;
  font-size: 0.8125rem; display: flex; align-items: center; justify-content: center;
}
.tkt-qty-input {
  width: 42px; text-align: center; border: 1px solid #d1d5db;
  border-radius: 6px; padding: 0.2rem; font-size: 0.8125rem; font-weight: 600; font-family: inherit;
}
.tkt-cart-remove {
  width: 26px; height: 26px; border: none; background: #fef2f2;
  color: #ef4444; border-radius: 6px; cursor: pointer;
  font-size: 0.8125rem; display: flex; align-items: center; justify-content: center;
}

/* ── Review Section ── */
.tkt-review-section { border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; margin-bottom: 0.75rem; }
.tkt-review-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.625rem 0.875rem; background: #f9fafb; border-bottom: 1px solid #e5e7eb;
  font-weight: 600; font-size: 0.8125rem;
}
.tkt-review-edit-btn { font-size: 0.6875rem; color: #2563eb; background: none; border: none; cursor: pointer; font-weight: 600; font-family: inherit; }
.tkt-review-body { padding: 0.875rem; }
.tkt-review-row { display: flex; justify-content: space-between; padding: 0.25rem 0; font-size: 0.75rem; }
.tkt-review-label { color: #6b7280; }
.tkt-review-value { font-weight: 600; color: #111827; }

/* ── Success Screen ── */
.tkt-success { text-align: center; padding: 2.5rem 1.5rem; }
.tkt-success-icon { font-size: 3.5rem; margin-bottom: 0.75rem; animation: tktPopIn 0.4s ease-out; }
@keyframes tktPopIn { 0% { transform: scale(0.5); opacity: 0; } 70% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
.tkt-success-title { font-size: 1.25rem; font-weight: 700; color: #111827; margin-bottom: 0.375rem; }
.tkt-success-message { font-size: 0.875rem; color: #6b7280; margin-bottom: 1.25rem; line-height: 1.5; }
.tkt-success-badge {
  display: inline-flex; align-items: center; gap: 0.375rem;
  background: #f0fdf4; border: 2px solid #10b981; color: #065f46;
  padding: 0.5rem 1rem; border-radius: 10px; font-size: 1rem; font-weight: 700; margin-bottom: 1.5rem;
}
.tkt-success-actions { display: flex; gap: 0.625rem; justify-content: center; flex-wrap: wrap; }

/* ── Severity Pills ── */
.tkt-severity-pills { display: flex; gap: 0.375rem; margin-bottom: 0.75rem; }
.tkt-severity-pill {
  padding: 0.35rem 0.75rem; border: 2px solid #e5e7eb; border-radius: 20px;
  font-size: 0.75rem; font-weight: 500; cursor: pointer; background: white;
  transition: all 0.15s; font-family: inherit;
}
.tkt-severity-pill.selected { font-weight: 600; }

/* ── Notification Bell ── */
.tkt-notif-bell { position: relative; cursor: pointer; padding: 0.375rem; }
.tkt-notif-count {
  position: absolute; top: -2px; right: -2px;
  background: #ef4444; color: white;
  font-size: 0.5625rem; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .tkt-hero { padding: 0.875rem 1rem; }
  .tkt-hero-top { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .tkt-hero-stats { gap: 0.5rem; }
  .tkt-hero-stat { min-width: 90px; padding: 0.4rem 0.625rem; }
  .tkt-hero-stat-value { font-size: 1.125rem; }
  .tkt-toolbar { flex-direction: column; align-items: stretch; }
  .tkt-toolbar-left, .tkt-toolbar-right { justify-content: center; }
  .tkt-kanban { flex-direction: column; }
  .tkt-kanban-col { min-width: 100%; max-width: 100%; }
  .tkt-search { min-width: 100%; }
  #ticket-detail-overlay { padding: 0; }
  .ticket-detail-panel {
    width: 100vw; max-width: 100vw; height: 100vh; border-radius: 0;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  }
  .ticket-wizard-panel { width: 100vw; max-width: 100vw; max-height: 100vh; border-radius: 0; }
  .tkt-detail-header { padding: 1.25rem 3.5rem 1.25rem 1rem; }
  .tkt-detail-title { font-size: 1.25rem; }
  .tkt-detail-subtitle { font-size: 0.8125rem; }
  .tkt-flavor-strip { width: 44px; padding-top: 1rem; }
  .tkt-strip-close { width: 32px; height: 32px; font-size: 1rem; }
  .tkt-tab-nav { margin-top: 1rem; padding-top: 0.75rem; }
  .tkt-tab-btn { padding: 0.5rem 0.85rem; font-size: 0.8rem; min-height: 44px; }
  .tkt-tab-content { padding: 1.25rem 1rem; }
  .tkt-info-group-grid { gap: 0.5rem; }
  .tkt-mat-toolbar { flex-wrap: wrap; gap: 0.5rem; }
  .tkt-mat-row { flex-wrap: wrap; }
  .tkt-msg-group { max-width: 90%; }
  .tkt-attach-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .tkt-flavor-cards { grid-template-columns: 1fr; }
  .tkt-form-row { grid-template-columns: 1fr; }
  .tkt-wiz-label { display: none; }
  .tkt-wiz-step + .tkt-wiz-step::before { width: 20px; }
  .tkt-wiz-content { padding: 1rem; }

  /* List view: card layout on mobile */
  .tkt-list-cards { display: flex; flex-direction: column; gap: 0.5rem; padding-bottom: 1rem; }
  .tkt-list-card {
    background: white; border-radius: 10px; padding: 0.875rem 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08); border-left: 4px solid #9ca3af;
    cursor: pointer; transition: box-shadow 0.15s;
    min-height: 44px; display: flex; flex-direction: column; gap: 0.35rem;
  }
  .tkt-list-card:active { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
  .tkt-list-card-top {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem;
  }
  .tkt-list-card-type { font-size: 0.75rem; color: #6b7280; font-weight: 500; }
  .tkt-list-card-id { font-size: 0.6875rem; color: #9ca3af; font-family: 'SF Mono','Fira Code',monospace; }
  .tkt-list-card-title { font-weight: 600; font-size: 0.9375rem; color: #111827; line-height: 1.3; }
  .tkt-list-card-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
    font-size: 0.75rem; color: #6b7280;
  }
  .tkt-list-card-meta .tkt-card-avatar { margin-left: auto; }
  .tkt-list-card-empty { text-align: center; color: #9ca3af; padding: 2rem 1rem; font-size: 0.9375rem; }
}
@media (max-width: 400px) {
  .tkt-info-group-grid { grid-template-columns: 1fr; gap: 0.5rem; }
  .tkt-detail-header-info { gap: 0.5rem; }
  .tkt-detail-title { font-size: 1.1rem; }
}

/* ── Search clear (X) button ── */
.search-clear-wrap { position: relative; display: inline-flex; align-items: center; flex: 1; min-width: 0; }
.search-clear-wrap > input,
.search-clear-wrap > input[type="text"],
.search-clear-wrap > input[type="search"] { width: 100%; padding-right: 2rem; }
.search-clear-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border: none; border-radius: 50%;
  background: rgba(0,0,0,0.08); color: #555; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1; padding: 0; z-index: 2;
  -webkit-tap-highlight-color: transparent; transition: background 0.15s;
}
.search-clear-btn:hover { background: rgba(220,38,38,0.15); color: #dc2626; }
.search-clear-btn:active { background: rgba(220,38,38,0.25); color: #b91c1c; }
.search-clear-btn.visible { display: flex; }
@media (prefers-color-scheme: dark) {
  .search-clear-btn { background: rgba(255,255,255,0.12); color: #ccc; }
  .search-clear-btn:hover { background: rgba(239,68,68,0.25); color: #f87171; }
}
/* Dark theme overrides for the app's own dark mode */
[data-theme="dark"] .search-clear-btn,
.dark .search-clear-btn { background: rgba(255,255,255,0.12); color: #ccc; }
[data-theme="dark"] .search-clear-btn:hover,
.dark .search-clear-btn:hover { background: rgba(239,68,68,0.25); color: #f87171; }
