:root {
  /* Soft Blue Modern Color Palette */
  --primary: #3B9FD9;
  /* Bright Blue - Main Actions */
  --primary-dark: #2D89BF;
  --primary-light: #D1E9F6;
  /* Soft Light Blue - Backgrounds */
  --accent: #10b981;
  /* Emerald - Success States */
  --accent-dark: #059669;
  --danger: #e95a5a;
  /* Red */
  --warning: #f59e0b;
  /* Amber */
  --success: #10b981;
  --info: #3B9FD9;
  /* Blue */

  /* Light Neutrals */
  --bg-primary: #ffffff;
  --bg-secondary: #F8FBFD;
  /* Very light blue tint */
  --bg-tertiary: #EDF6FB;
  /* Light blue tint */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  /* Shadows & Effects */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 0 20px rgba(59, 159, 217, 0.15);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  /* Extremely light, subtle gradient */
  background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
  /* Ensure body is relative for fixed background */
}

/* Global Doodle Pattern */
.doodle-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  /* Behind everything */
  pointer-events: none;
  overflow: hidden;
}

.doodle-item {
  position: absolute;
  color: #1a1a1a;
  opacity: 0.2;
  /* Subtle, consistent opacity */
  transition: none;
  /* Remove transitions for performance */
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

h1 {
  font-size: 2.25rem;
}

h2 {
  font-size: 1.875rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

/* Buttons */
.btn {
  padding: 0.625rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  outline: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: var(--shadow-md), 0 0 0 0 rgba(79, 70, 229, 0);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: white;
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--text-muted);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, var(--accent-dark) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

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

.btn-danger {
  background: var(--danger);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-info {
  background: var(--info);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Cards */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

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

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: all var(--transition-base);
  outline: none;
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

input::placeholder {
  color: var(--text-muted);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th {
  background: var(--bg-secondary);
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

tr:hover {
  background: var(--bg-secondary);
}

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

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn var(--transition-fast);
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp var(--transition-base);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-light);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.75rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.close-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Scrollable Modal Variant (Fixed Header/Footer) */
.modal-content.scrollable {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.modal-content.scrollable .modal-header {
  padding: 1.5rem 2rem;
  margin: 0;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.modal-content.scrollable .modal-body {
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
}

.modal-content.scrollable .modal-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-light);
  background: white;
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  border-bottom-left-radius: 1rem;
  border-bottom-right-radius: 1rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

.badge-pending {
  background: rgb(255 237 213);
  color: rgb(154 52 18);
}

.badge-assigned {
  background: rgb(219 234 254);
  color: rgb(30 64 175);
}

.badge-vendor-quoted {
  background: rgb(233 213 255);
  color: rgb(109 40 217);
}

.badge-sales-priced {
  background: rgb(209 250 229);
  color: rgb(6 95 70);
}

.badge-completed {
  background: rgb(187 247 208);
  color: rgb(20 83 45);
}

.badge-active {
  background: rgb(254 249 195);
  color: rgb(133 77 14);
}

/* Icons */
.icon {
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-sm {
  width: 1rem;
  height: 1rem;
}

/* Utilities */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-muted {
  color: var(--text-muted);
}

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

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

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

.mb-4 {
  margin-bottom: 2rem;
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mt-4 {
  margin-top: 2rem;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-1 {
  gap: 0.5rem;
}

.gap-2 {
  gap: 1rem;
}

.gap-3 {
  gap: 1.5rem;
}

.hidden {
  display: none !important;
}

.block {
  display: block;
}

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

/* Dividers */
.divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Loading Spinner */
.spinner {
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

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

  100% {
    transform: rotate(360deg);
  }
}

/* Toast Notifications */
.toast {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: white;
  border: 1px solid var(--border);
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-xl);
  z-index: 10000;
  animation: slideDown 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 400px;
}

.toast-success {
  border-left: 4px solid var(--success);
}

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

.toast-info {
  border-left: 4px solid var(--info);
}

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

.alert-success {
  background: rgb(240 253 244);
  border-color: rgb(187 247 208);
  color: rgb(22 101 52);
}

.alert-danger {
  background: rgb(254 242 242);
  border-color: rgb(254 202 202);
  color: rgb(153 27 27);
}

.alert-warning {
  background: rgb(255 251 235);
  border-color: rgb(254 240 138);
  color: rgb(146 64 14);
}

.alert-info {
  background: rgb(239 246 255);
  border-color: rgb(191 219 254);
  color: rgb(30 64 175);
}

/* Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 1.875rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
  }

  .card {
    padding: 1rem;
  }

  .modal-content {
    padding: 1.5rem;
  }
}

/* Dashboard Layout */
.dashboard {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  /* Ensure it stacks above background */
  z-index: 1;
}

.header {
  margin-bottom: 2rem;
}

/* Enquiry Rows & Expansion */
.enquiry-row {
  margin-bottom: 1rem;
}

.enquiry-header {
  background: var(--bg-primary);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.enquiry-header:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.enquiry-info {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.enquiry-detail {
  display: flex;
  flex-direction: column;
}

.detail-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.detail-value {
  font-weight: 500;
  font-size: 1rem;
}

.toggle-icon {
  transition: transform var(--transition-base);
  margin-left: 1rem;
}

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

.enquiry-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
  margin-top: 0.5rem;
}

.enquiry-items.expanded {
  max-height: 2000px;
}

/* Item Cards (for Sales View) */
.item-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

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

.item-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Icon Sizing */
.ph {
  font-size: 1.125rem;
  vertical-align: middle;
}

.btn .ph {
  margin-right: 0.25rem;
}

.btn-sm .ph {
  font-size: 1rem;
}

/* Custom Radio Buttons */
.radio-option {
  display: block;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: 0.75rem;
  background: var(--bg-primary);
  cursor: pointer;
  transition: all var(--transition-base);
  margin-bottom: 0.75rem;
}

.radio-option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.radio-option input[type="radio"] {
  width: 20px;
  height: 20px;
  margin-right: 1rem;
  cursor: pointer;
  accent-color: var(--primary);
}

.radio-option input[type="radio"]:checked~.radio-content {
  font-weight: 600;
}

.radio-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Combine Modal Improvements */
.combine-modal .modal-content {
  max-width: 700px;
}

.combine-item-card {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
  transition: all var(--transition-base);
}

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

.combine-item-card input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 1rem;
  cursor: pointer;
  accent-color: var(--primary);
}

.combine-item-info {
  flex: 1;
}

.combine-item-info h5 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
}

.combine-item-info p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Premium Admin Dashboard Enhancements */
.admin-gradient-bg {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.premium-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.95) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.stat-card:hover::before {
  opacity: 1;
}

.master-card {
  position: relative;
  overflow: hidden;
}

.master-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.master-card:hover::after {
  opacity: 1;
}

/* Enhanced Login Page */
body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-attachment: fixed;
}

.login-container::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="none"/><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></svg>');
  pointer-events: none;
  z-index: 0;
}

.login-card {
  position: relative;
  z-index: 1;
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Smooth Animations */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Enhanced Form Inputs */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Premium Button Styles */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

/* Bulk Upload Styles */
.bulk-upload-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

.bulk-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.bulk-tab:hover {
  color: var(--primary);
  background: var(--bg-secondary);
}

.bulk-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.bulk-tab-content {
  display: none;
  padding: 1.5rem 0;
}

.bulk-tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* File Upload Zone */
.file-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 1rem;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--bg-secondary);
}

.file-upload-zone:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.02);
}

.file-upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  border-style: solid;
}

.file-upload-zone h4 {
  margin: 1rem 0 0.5rem;
  color: var(--text-primary);
}

/* Progress Bar */
.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin: 1.5rem 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 999px;
}

/* Processing Spinner */
.processing-spinner {
  margin: 1rem 0;
}

.ph-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Review Cards */
.review-enquiry-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all var(--transition-base);
}

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

.review-enquiry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.match-status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.match-exact {
  background: rgb(209 250 229);
  color: rgb(5 150 105);
}

.match-fuzzy {
  background: rgb(254 249 195);
  color: rgb(133 77 14);
}

.match-none {
  background: rgb(254 242 242);
  color: rgb(153 27 27);
}

.product-suggestion {
  background: var(--bg-tertiary);
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-top: 0.5rem;
}

.product-suggestion select {
  width: 100%;
  margin-top: 0.5rem;
}

/* Review Items Table */
.review-items-table {
  width: 100%;
  margin-top: 1rem;
}

.review-items-table th {
  background: var(--bg-tertiary);
  padding: 0.5rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.review-items-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.875rem;
}

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

/* ========================================
   WYSIWYG PDF Preview Container
   ======================================== */

.pdf-preview-container {
  background: white;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  font-family: 'Helvetica', Arial, sans-serif;
  color: #000;
  max-height: 85vh;
  overflow-y: auto;
}

/* Header Section */
.pdf-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px;
  border: 2px solid #000;
  margin-bottom: 0;
}

.pdf-header-left {
  display: flex;
  gap: 20px;
  flex: 1;
}

.company-logo img {
  max-width: 80px;
  max-height: 60px;
  object-fit: contain;
}

.company-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.company-name {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 4px;
}

.company-info {
  font-size: 10px;
  line-height: 1.4;
}

.pdf-header-right {
  display: flex;
  align-items: center;
  padding-left: 20px;
}

.quotation-title {
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 2px;
}

/* Quote Details Bar */
.pdf-quote-bar {
  display: flex;
  border: 2px solid #000;
  border-top: none;
  padding: 12px 20px;
  margin-bottom: 0;
}

.quote-bar-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  border-right: 2px solid #000;
  padding-right: 20px;
}

.quote-bar-right {
  display: flex;
  align-items: center;
  padding-left: 20px;
}

.quote-field {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 10px;
}

.quote-label {
  font-weight: bold;
  min-width: 80px;
}

.quote-value {
  flex: 1;
}

.quote-value.editable {
  background: rgba(59, 159, 217, 0.05);
  padding: 2px 6px;
  border-radius: 3px;
  cursor: text;
  border: 1px solid transparent;
}

.quote-value.editable:hover {
  background: rgba(59, 159, 217, 0.1);
  border-color: rgba(59, 159, 217, 0.3);
}

.quote-value.editable:focus {
  outline: none;
  background: white;
  border-color: var(--primary);
}

.quote-date-input {
  border: 1px solid rgba(59, 159, 217, 0.3);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  background: rgba(59, 159, 217, 0.05);
}

/* Customer Section */
.pdf-customer-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 2px solid #000;
  border-top: none;
  margin-bottom: 0;
}

.customer-column {
  display: flex;
  flex-direction: column;
}

.customer-column:first-child {
  border-right: 2px solid #000;
}

.customer-header {
  background: #f0f0f0;
  padding: 8px 12px;
  font-size: 10px;
  font-weight: bold;
  border-bottom: 2px solid #000;
}

.customer-content {
  padding: 12px;
  min-height: 100px;
}

.customer-name {
  font-size: 11px;
  font-weight: bold;
  margin-bottom: 6px;
}

.customer-name.editable {
  background: rgba(59, 159, 217, 0.05);
  padding: 2px 6px;
  border-radius: 3px;
  cursor: text;
  border: 1px solid transparent;
}

.customer-name.editable:hover {
  background: rgba(59, 159, 217, 0.1);
  border-color: rgba(59, 159, 217, 0.3);
}

.customer-name.editable:focus {
  outline: none;
  background: white;
  border-color: var(--primary);
}

.customer-address {
  width: 100%;
  border: 1px solid rgba(59, 159, 217, 0.3);
  padding: 6px;
  border-radius: 3px;
  font-size: 9px;
  font-family: 'Helvetica', Arial, sans-serif;
  background: rgba(59, 159, 217, 0.05);
  resize: vertical;
  min-height: 60px;
}

.customer-address:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
}

/* Items Table */
.pdf-items-table {
  border: 2px solid #000;
  border-top: none;
  margin-bottom: 0;
}

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

.pdf-items-table thead {
  background: #f0f0f0;
}

.pdf-items-table th {
  font-size: 9px;
  font-weight: bold;
  padding: 8px 6px;
  text-align: left;
  border: 1px solid #000;
}

.pdf-items-table td {
  font-size: 10px;
  padding: 6px;
  border: 1px solid #000;
  vertical-align: top;
}

.pdf-items-table .editable {
  background: rgba(59, 159, 217, 0.05);
  padding: 4px 6px;
  border-radius: 3px;
  cursor: text;
  min-height: 20px;
  border: 1px solid transparent;
}

.pdf-items-table .editable:hover {
  background: rgba(59, 159, 217, 0.1);
  border-color: rgba(59, 159, 217, 0.3);
}

.pdf-items-table .editable:focus {
  outline: none;
  background: white;
  border-color: var(--primary);
}

.pdf-items-table .item-input {
  width: 100%;
  border: 1px solid rgba(59, 159, 217, 0.3);
  padding: 4px 6px;
  border-radius: 3px;
  font-size: 10px;
  background: rgba(59, 159, 217, 0.05);
}

.pdf-items-table .item-input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
}

.pdf-items-table .item-amount {
  font-weight: bold;
  text-align: right;
  background: #f9f9f9;
}

.delete-item-btn {
  background: transparent;
  border: none;
  color: #dc3545;
  cursor: pointer;
  padding: 4px;
  border-radius: 3px;
  transition: all 0.2s;
}

.delete-item-btn:hover {
  background: #dc3545;
  color: white;
}

.add-item-btn {
  width: 100%;
  padding: 10px;
  background: rgba(59, 159, 217, 0.05);
  border: 2px dashed rgba(59, 159, 217, 0.3);
  border-top: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.add-item-btn:hover {
  background: rgba(59, 159, 217, 0.1);
  border-color: var(--primary);
}

/* Footer Section */
.pdf-footer {
  display: flex;
  gap: 0;
  border: 2px solid #000;
  border-top: none;
  margin-bottom: 0;
}

.footer-left {
  flex: 1.5;
  padding: 12px;
  border-right: 2px solid #000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-right {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.footer-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-title {
  font-size: 10px;
  font-weight: bold;
}

.footer-value {
  font-size: 9px;
  font-weight: bold;
  color: #000;
}

.footer-textarea {
  width: 100%;
  border: 1px solid rgba(59, 159, 217, 0.3);
  padding: 6px;
  border-radius: 3px;
  font-size: 9px;
  font-family: 'Helvetica', Arial, sans-serif;
  background: rgba(59, 159, 217, 0.05);
  resize: vertical;
  line-height: 1.4;
}

.footer-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
}

/* Summary Table */
.summary-table {
  display: flex;
  flex-direction: column;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 9px;
  border-bottom: 1px solid #000;
}

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

.summary-row.summary-total {
  background: #f0f0f0;
  font-weight: bold;
  font-size: 10px;
  border-top: 2px solid #000;
}

/* Signature Section */
.signature-section {
  padding: 12px;
  border-top: 2px solid #000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.signature-company {
  font-size: 9px;
  font-weight: normal;
}

.signature-image {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.signature-image img {
  max-width: 120px;
  max-height: 60px;
  object-fit: contain;
}

.signature-text {
  font-size: 9px;
  font-weight: normal;
  text-align: center;
}

/* ========================================
   Dashboard Filter Chips
   ======================================== */

.search-filter-card {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  overflow-x: auto;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid var(--border);
  background: var(--bg-page);
  color: var(--text-secondary);
  user-select: none;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bg-tertiary);
  transform: translateY(-1px);
}

.filter-chip.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}

.filter-chip i {
  font-size: 0.875rem;
}

.filter-chip.active i {
  color: var(--primary-dark);
}

/* ========================================
   Custom Vendor Dropdown with Pricing
   ======================================== */


/* ========================================
   Custom Vendor Dropdown with Pricing
   ======================================== */

.custom-vendor-dropdown {
  position: relative;
  width: 100%;
}

.vendor-dropdown-trigger {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--bg-page);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition-fast);
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.vendor-dropdown-trigger:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
}

.vendor-dropdown-trigger.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: var(--bg-page);
}

.vendor-dropdown-trigger .placeholder {
  color: var(--text-muted);
}

.vendor-dropdown-trigger .selected-vendor {
  color: var(--text-primary);
  font-weight: 600;
}

.vendor-dropdown-trigger i {
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  font-size: 1rem;
}

.vendor-dropdown-trigger.active i {
  transform: rotate(180deg);
  color: var(--primary);
}

.vendor-dropdown-options {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  max-height: 350px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.vendor-dropdown-options.active {
  display: block;
}

.vendor-option {
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all var(--transition-base);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.vendor-option:last-child {
  border-bottom: none;
}

.vendor-option:hover {
  background: var(--bg-tertiary);
}

.vendor-option.selected {
  background: var(--primary-light);
  /* border-left: 3px solid var(--primary); Removed for cleaner look */
}

.add-new-vendor-option {
  border-top: 2px solid var(--border);
  border-bottom: none !important;
  background: var(--bg-page);
  color: var(--primary);
  position: sticky;
  bottom: 0;
}

.add-new-vendor-option:hover {
  background: var(--primary-light) !important;
}

.vendor-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.vendor-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.vendor-spec {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.vendor-pricing {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
}

.vendor-last-price {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  font-feature-settings: "tnum";
}

.vendor-no-history {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 0.5rem 0;
}

.vendor-price-badge {
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.vendor-price-badge.cheapest {
  background: #dcfce7;
  color: #166534;
}

.combined-from-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: #6d28d9;
  background: #ede9fe;
  border: 1px solid #c4b5fd;
  border-radius: 0.25rem;
  padding: 0.1rem 0.4rem;
  margin-top: 0.2rem;
  white-space: nowrap;
}

.vendor-price-badge.not-cheapest {
  background: #f3f4f6;
  color: #4b5563;
}
/* Long lists: the browser can skip laying out and painting rows that are scrolled out of view.
   (Hundreds of enquiries otherwise cost layout work on every redraw. `auto` remembers each row's real height.) */
.enquiry-row,
.enquiry-accordion-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 72px;
}
