/* ===================================================================
   ALPHA FARM CRM - MODULE STYLES (Products, Customers, Quotes, Orders)
   Doanh nghiệp Tư nhân Trang trại Hoa Alpha (Đà Lạt)
   =================================================================== */

.modal-overlay.visible,
.modal-overlay.active {
  display: flex !important;
}

/* CRM Top Navigation Tabs in Header */
.crm-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card-subtle);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
}

.crm-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.crm-nav-link:hover {
  color: var(--primary-green);
  background: #ffffff;
  box-shadow: var(--shadow-xs);
}

.crm-nav-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-dark) 100%);
  box-shadow: 0 4px 12px var(--green-glow);
}

.crm-nav-link .nav-badge {
  background: rgba(255, 255, 255, 0.25);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
}

/* CRM Page Layout Container */
.crm-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 28px 60px;
}

/* Page Header Title & Subtitle */
.crm-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.crm-title-area h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.5px;
}

.crm-title-area p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Stat Cards Grid */
.crm-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.crm-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.green {
  background: var(--green-soft);
  color: var(--primary-green);
  border: 1px solid var(--green-border);
}

.stat-icon.amber {
  background: var(--accent-gold-soft);
  color: var(--accent-gold-dark);
  border: 1px solid var(--accent-gold-border);
}

.stat-icon.blue {
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.stat-icon.gray {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.stat-content {
  flex: 1;
}

.stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  margin-top: 2px;
  font-family: var(--font-sans);
}

/* Smart CRM Toolbar */
.crm-toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
}

.toolbar-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
}

.search-input-wrapper {
  position: relative;
  min-width: 280px;
  flex: 1;
  max-width: 400px;
}

.search-input-wrapper svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light-muted);
  pointer-events: none;
}

.search-input-wrapper input {
  width: 100%;
  padding: 9px 14px 9px 40px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: var(--bg-card-subtle);
  font-size: 14px;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s;
}

.search-input-wrapper input:focus {
  background: #ffffff;
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.filter-select {
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: #ffffff;
  font-size: 13.5px;
  color: var(--text-main);
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-select:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Data Table Card */
.crm-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.crm-table-wrapper {
  overflow-x: auto;
}

.crm-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.crm-table th {
  background: #f8faf9;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.crm-table td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  vertical-align: middle;
}

.crm-table tbody tr {
  transition: background-color 0.15s ease;
}

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

/* Badges & Tags */
.product-code-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  padding: 3px 9px;
  border-radius: 6px;
}

.category-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #475569;
}

.price-text {
  font-weight: 800;
  font-size: 15px;
  color: var(--primary-green);
  font-family: var(--font-sans);
}

/* iOS-Style Switch Toggle for Publish Status */
.switch-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background-color: #cbd5e1;
  border-radius: 24px;
  transition: background-color 0.25s ease;
}

.switch-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch-toggle input:checked + .switch-slider {
  background-color: var(--primary-green);
}

.switch-toggle input:checked + .switch-slider::before {
  transform: translateX(20px);
}

.switch-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.switch-toggle input:checked ~ .switch-label {
  color: var(--primary-dark);
}

/* Action Icon Buttons */
.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon-action {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon-action:hover {
  background: var(--bg-card-subtle);
  border-color: var(--border-light);
  color: var(--primary-green);
}

.btn-icon-action.delete:hover {
  background: #fef2f2;
  border-color: #fee2e2;
  color: var(--danger);
}

/* Empty State */
.crm-empty-state {
  text-align: center;
  padding: 60px 20px;
}

.crm-empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--green-soft);
  color: var(--primary-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crm-empty-state h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.crm-empty-state p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto 20px;
}

/* Modal Form Styles */
.crm-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.crm-form-group.full-width {
  grid-column: span 2;
}

.crm-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.crm-form-group label .req {
  color: var(--danger);
}

.crm-form-group input,
.crm-form-group select,
.crm-form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: #ffffff;
  font-size: 14px;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s;
  font-family: inherit;
}

.crm-form-group input:focus,
.crm-form-group select:focus,
.crm-form-group textarea:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.crm-checkbox-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  border-radius: 10px;
  cursor: pointer;
  margin-top: 6px;
}

.crm-checkbox-card input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary-green);
  cursor: pointer;
}

.crm-checkbox-card .checkbox-text {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--primary-dark);
}

.crm-checkbox-card .checkbox-hint {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  font-weight: 400;
}

/* Toast Notifications */
.crm-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.crm-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1f2937;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 500;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 380px;
}

.crm-toast.success {
  background: #065f46;
  border-left: 4px solid #34d399;
}

.crm-toast.error {
  background: #991b1b;
  border-left: 4px solid #f87171;
}

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

/* Responsive adjustments */
@media (max-width: 900px) {
  .crm-container {
    padding: 16px;
  }
  .crm-form-grid {
    grid-template-columns: 1fr;
  }
  .crm-form-group.full-width {
    grid-column: span 1;
  }
  .crm-page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===================================================================
   PHASE 4 & 5 EXTENSIONS: QUOTES & ORDERS STYLING
   =================================================================== */

/* Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

/* Quote Statuses */
.status-draft {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}
.status-draft::before { background: #94a3b8; }

.status-sent {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.status-sent::before { background: #3b82f6; }

.status-accepted {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.status-accepted::before { background: #10b981; }

.status-rejected {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.status-rejected::before { background: #ef4444; }

/* Order Statuses */
.order-status-pending {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}
.order-status-pending::before { background: #f59e0b; }

.order-status-confirmed {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}
.order-status-confirmed::before { background: #6366f1; }

.order-status-delivering {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
.order-status-delivering::before { background: #0ea5e9; }

.order-status-completed {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #6ee7b7;
}
.order-status-completed::before { background: #10b981; }

.order-status-failed {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}
.order-status-failed::before { background: #ef4444; }

.order-status-cancelled {
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #d1d5db;
}
.order-status-cancelled::before { background: #9ca3af; }

/* Quote Editor Layout (Split view: Editor & Live A4 Preview) */
.quote-editor-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1200px) {
  .quote-editor-container {
    grid-template-columns: 1fr;
  }
}

.quote-editor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.quote-editor-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Quote Line Items Editor */
.quote-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.quote-items-table th {
  background: #f8fafc;
  padding: 10px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.quote-items-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.quote-items-table select,
.quote-items-table input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 13px;
  background: #ffffff;
}

.quote-items-table select:focus,
.quote-items-table input:focus {
  border-color: var(--primary-green);
  outline: none;
}

.quote-items-table .locked-price {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  cursor: not-allowed;
}

.btn-remove-row {
  background: transparent;
  color: #ef4444;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: background 0.2s;
}

.btn-remove-row:hover {
  background: #fee2e2;
}

/* A4 Live Preview Wrapper */
.a4-preview-wrapper {
  background: #64748b;
  padding: 24px;
  border-radius: 14px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.a4-quote-sheet {
  background: #ffffff;
  width: 100%;
  max-width: 680px;
  padding: 28px 32px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  border-radius: 4px;
  color: #1f2937;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 12.5px;
  line-height: 1.45;
}

/* Header Alpha Farm inside A4 sheet */
.quote-a4-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--primary-green);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.quote-a4-company {
  font-size: 11.5px;
  color: #374151;
  line-height: 1.4;
}

.quote-a4-company strong {
  font-size: 13.5px;
  color: var(--primary-dark);
  display: block;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.quote-a4-logo {
  height: 52px;
  object-fit: contain;
}

.quote-a4-title {
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: 0.5px;
  margin: 14px 0 16px;
  text-transform: uppercase;
}

.quote-a4-meta-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 12px;
}

.quote-a4-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 12px;
}

.quote-a4-table th {
  background: #0d5e2e;
  color: #ffffff;
  border: 1px solid #0d5e2e;
  padding: 7px 6px;
  font-weight: 700;
  text-align: center;
}

.quote-a4-table td {
  border: 1px solid #cbd5e1;
  padding: 6px 8px;
  vertical-align: middle;
}

.quote-a4-terms {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 11.5px;
  color: #475569;
  line-height: 1.5;
  margin-top: 14px;
}

.quote-a4-terms h5 {
  color: var(--primary-dark);
  font-size: 12px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.quote-a4-terms ol {
  margin: 0;
  padding-left: 18px;
}

.quote-a4-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 10px;
  font-size: 12px;
}

.quote-a4-sign {
  text-align: center;
  min-width: 180px;
}

.quote-a4-sign strong {
  display: block;
  font-size: 12.5px;
  color: var(--primary-dark);
}

.quote-a4-sign span {
  display: block;
  font-size: 11px;
  color: #6b7280;
  font-style: italic;
  margin-bottom: 48px;
}

/* Order timeline bar */
.order-steps-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin: 20px 0 24px;
  padding: 0 10px;
}

.order-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 2;
  cursor: pointer;
}

.order-step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s;
}

.order-step-item.active .order-step-circle {
  background: var(--primary-green);
  color: #ffffff;
  box-shadow: 0 0 0 4px var(--green-glow);
}

.order-step-item.completed .order-step-circle {
  background: #10b981;
  color: #ffffff;
}

.order-step-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.order-step-item.active .order-step-label {
  color: var(--primary-dark);
  font-weight: 700;
}

/* ===================================================================
   PRODUCT CATALOG WITH IMAGES, CATEGORIES, RBAC & PDF LOOKBOOK
   =================================================================== */

/* Category Pill Tabs */
.category-pill-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  margin-bottom: 12px;
  scrollbar-width: thin;
}

.category-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.category-pill-btn:hover {
  background: #f0fdf4;
  color: var(--primary-green);
  border-color: #bbf7d0;
}

.category-pill-btn.active {
  background: var(--primary-green);
  color: #ffffff;
  border-color: var(--primary-green);
  box-shadow: 0 2px 8px var(--green-glow);
}

.category-pill-btn .pill-count {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.08);
}

.category-pill-btn.active .pill-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* View Mode Switcher (Grid vs Table) */
.view-mode-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 2px;
}

.view-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-mode-btn.active {
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: var(--shadow-xs);
}

/* Products Grid View */
.products-grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.product-card.selected {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 2px var(--green-glow);
}

/* Product Card Image */
.product-card-img-wrap {
  width: 100%;
  height: 190px;
  background: #f1f5f9;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.product-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-card-img {
  transform: scale(1.04);
}

.product-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 32px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.product-card-img-placeholder span {
  font-size: 11.5px;
  margin-top: 4px;
}

.product-card-checkbox {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 22px;
  height: 22px;
  accent-color: var(--primary-green);
  cursor: pointer;
  z-index: 5;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.product-card-badges {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  z-index: 5;
}

.product-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card-code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary-green);
  margin-bottom: 4px;
}

.product-card-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 6px;
}

.product-card-spec {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.product-card-price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--border-light);
}

.product-card-price {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary-green);
}

.product-card-unit {
  font-size: 12.5px;
  color: var(--text-muted);
}

.product-card-desc {
  font-size: 12px;
  color: var(--text-light-muted);
  line-height: 1.45;
  margin: 6px 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-footer {
  padding: 10px 16px;
  background: #fafcfb;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Thumbnail in Table View */
.table-product-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: transform 0.2s;
}

.table-product-thumb:hover {
  transform: scale(1.15);
}

.table-product-thumb-empty {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #94a3b8;
  border: 1px solid var(--border-light);
}

/* Floating Action Bar when items selected */
.floating-catalog-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #111827;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 50px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  opacity: 0;
}

.floating-catalog-bar.active {
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
  opacity: 1;
}

.floating-bar-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
}

.floating-bar-count {
  background: var(--primary-green);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.floating-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.floating-bar-btn.btn-quote {
  background: var(--primary-green);
  color: #ffffff;
}

.floating-bar-btn.btn-quote:hover {
  background: var(--primary-dark);
}

.floating-bar-btn.btn-invoice {
  background: #0284c7;
  color: #ffffff;
}

.floating-bar-btn.btn-invoice:hover {
  background: #0369a1;
}

.floating-bar-btn.btn-pdf {
  background: #ffffff;
  color: #111827;
}

.floating-bar-btn.btn-pdf:hover {
  background: #f1f5f9;
}

.floating-bar-btn.btn-clear {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #374151;
}

.floating-bar-btn.btn-clear:hover {
  color: #ffffff;
  border-color: #6b7280;
}

/* Image Upload Preview in Modal */
.image-upload-wrapper {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 6px;
}

.image-preview-box {
  width: 110px;
  height: 110px;
  border-radius: 12px;
  border: 2px dashed var(--border-light);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.image-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-upload-inputs {
  flex: 1;
}

.preset-images-gallery {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 0;
  max-width: 440px;
}

.preset-thumb {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
}

.preset-thumb:hover,
.preset-thumb.active {
  border-color: var(--primary-green);
  transform: scale(1.1);
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.lightbox-modal.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  color: #ffffff;
  font-size: 32px;
  cursor: pointer;
  background: transparent;
  border: none;
}

/* ================= CATALOG A4 PRINT & LOOKBOOK STYLES ================= */
@media print {
  body.printing-catalog * {
    visibility: hidden;
  }
  body.printing-catalog #print-catalog-sheet,
  body.printing-catalog #print-catalog-sheet * {
    visibility: visible;
  }
  body.printing-catalog #print-catalog-sheet {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    margin: 0 !important;
    padding: 8mm 10mm !important;
    box-shadow: none !important;
    background: #ffffff !important;
  }
}

.catalog-print-wrapper {
  display: none;
}

.catalog-a4-sheet {
  background: #ffffff;
  width: 210mm;
  min-height: 297mm;
  padding: 10mm 12mm;
  margin: 0 auto;
  box-sizing: border-box;
  color: #1f2937;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.4;
}

.catalog-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2.5px solid var(--primary-dark);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.catalog-company-name {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.catalog-company-meta {
  font-size: 11.5px;
  color: #374151;
  margin-top: 3px;
}

.catalog-company-addr {
  font-size: 11px;
  color: #6b7280;
  margin-top: 2px;
}

.catalog-sheet-logo {
  height: 48px;
  max-width: 170px;
  object-fit: contain;
}

.catalog-title-box {
  text-align: center;
  margin: 12px 0 14px;
}

.catalog-main-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary-dark);
  text-transform: uppercase;
  margin: 0;
  letter-spacing: 0.5px;
}

.catalog-sub-title {
  font-size: 11.5px;
  color: #64748b;
  font-style: italic;
  margin-top: 3px;
}

.catalog-grid-print {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 14px 0;
}

.catalog-card-print {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  break-inside: avoid;
  page-break-inside: avoid;
  display: flex;
  flex-direction: column;
}

.catalog-card-print img {
  width: 100%;
  height: 125px;
  object-fit: cover;
  display: block;
}

.catalog-card-print-body {
  padding: 8px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.catalog-card-print-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--primary-green);
  margin-bottom: 2px;
}

.catalog-card-print-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 2px;
  line-height: 1.25;
}

.catalog-card-print-spec {
  font-size: 11px;
  color: #475569;
  margin-bottom: 4px;
}

.catalog-card-print-price {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary-green);
}

.catalog-card-print-desc {
  font-size: 10px;
  color: #64748b;
  margin-top: 4px;
  line-height: 1.3;
}

.catalog-terms-section {
  margin-top: 14px;
  border-top: 1.5px solid #e2e8f0;
  padding-top: 10px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.catalog-terms-title {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.catalog-terms-list {
  margin: 0;
  padding-left: 18px;
  font-size: 10.5px;
  color: #4b5563;
  line-height: 1.5;
}

.catalog-terms-list li {
  margin-bottom: 3px;
}

.catalog-sign-footer {
  margin-top: 14px;
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  break-inside: avoid;
  page-break-inside: avoid;
}

.catalog-sign-left {
  max-width: 55%;
}

.catalog-sign-right {
  text-align: right;
  min-width: 220px;
}


