:root{
  --hero-bg: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
  --card-shadow-hover: 0 8px 24px rgba(0,0,0,0.15);
  --primary-color: #dc2626;
  --secondary-color: #991b1b;
}

body{
  font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  background: #f8f9fa;
}

.navbar {
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

/* Top nav tabs */
.nav-tabs .nav-link {
  color: #6c757d;
  font-weight: 500;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 0.85rem 1.1rem;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-tabs .nav-link:hover {
  color: var(--primary-color);
  border-bottom-color: #f3b4b4;
}

.nav-tabs .nav-link.active {
  color: var(--primary-color);
  font-weight: 700;
  background: transparent;
  border: none;
  border-bottom: 3px solid var(--primary-color);
}

.logo-box{
  width:32px;
  height:32px;
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  border-radius:8px;
  font-size:18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-section{
  background: var(--hero-bg);
  color: white;
  padding: 3rem 0 !important;
}

.hero-section h1 {
  color: white;
  font-weight: 700;
}

.hero-section p {
  color: rgba(255,255,255,0.9);
}

.search-bar{
  max-width:880px;
  border-radius:16px;
  border: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.card.product{
  border-radius: 16px;
  border: none;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card.product:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

.badge-soft{
  background:#fff3cd;
  color:#8a6d3b;
  border:1px solid #ffe8a1;
  font-weight: 600;
}

.price{
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--primary-color);
}

.muted{color:#6c757d}

.pill{
  background:#e9f7ef;
  color:#198754;
  border:1px solid #bfe3cf;
  border-radius:999px;
  padding:.2rem .6rem;
  font-size:.85rem;
  font-weight: 600;
}

.pill-warning{
  background:#fff5e6;
  color:#a15c00;
  border-color:#ffd9a1;
}

/* Supplier badge styling */
.bg-dark-red-subtle{background:#ffe6e6 !important}
.text-dark-red{color:#cc0000 !important}
.bg-purple-subtle{background:#f3e8ff !important}
.text-purple{color:#7c3aed !important}
.bg-teal-subtle{background:#e6fffa !important}
.text-teal{color:#0d9488 !important}

/* Enhanced badge styling */
.badge {
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  border-radius: 8px !important;
}

.badge.rounded-pill {
  border-radius: 50rem !important;
}

.supplier-badge {
  cursor: pointer;
  transition: all 0.2s ease;
}

.supplier-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Button styling */
.btn {
  border-radius: 10px;
  font-weight: 600;
  padding: 0.5rem 1.5rem;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

/* Search input styling */
.form-control {
  border-radius: 10px;
  border: 1px solid #e0e6ed;
  padding: 0.6rem 1rem;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.15);
}

/* Product card enhancements */
.card.product .card-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.5rem;
}

.card.product .d-flex.justify-content-between.align-items-start {
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.card.product .d-flex.justify-content-between.align-items-center {
  margin-top: auto;
  padding-top: 1rem;
  gap: 1.5rem;
}

.card.product .card-title {
  flex: 1;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.4;
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d3748;
}

.card.product .d-flex.flex-column.align-items-end {
  flex-shrink: 0;
  min-width: fit-content;
  gap: 0.4rem;
}

.card.product .text-muted {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #718096;
}

/* Stock badges enhancement */
.badge.bg-success-subtle {
  background: #d4f4dd !important;
  color: #22863a !important;
  border: 1px solid #9ae6b4 !important;
}

.badge.bg-danger-subtle {
  background: #fed7d7 !important;
  color: #c53030 !important;
  border: 1px solid #fc8181 !important;
}

/* Dropdown styling */
.dropdown-menu {
  border-radius: 12px;
  border: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  padding: 0.5rem;
}

.dropdown-item {
  border-radius: 8px;
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background: rgba(220, 38, 38, 0.1);
  color: var(--primary-color);
}

/* Loading state */
.spinner-border {
  width: 3rem;
  height: 3rem;
  border-width: 0.3rem;
}

/* Empty state */
#emptyState {
  padding: 4rem 1rem;
}

#emptyState .display-6 {
  font-size: 4rem;
  opacity: 0.5;
}

/* Product Table Styling */
.product-table {
  background: white;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.product-table thead {
  background: #f8f9fa;
}

.product-table thead th {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6c757d;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 1rem;
  border-bottom: 2px solid #e9ecef;
  vertical-align: middle;
}

.product-table tbody tr {
  border-bottom: 1px solid #e9ecef;
  transition: background 0.2s ease;
}

.product-table tbody tr:last-child {
  border-bottom: none;
}

.product-table tbody tr:hover {
  background: #f8f9fa;
}

.product-table tbody td {
  padding: 1.25rem 1rem;
  vertical-align: top;
}

.product-table .product-code {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: #2d3748;
  font-size: 0.9rem;
  white-space: nowrap;
}

.product-table .product-description {
  color: #2d3748;
  font-weight: 500;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.product-table .product-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.product-table .stock-badge {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.product-table .stock-badge.in-stock {
  background: #d4f4dd;
  color: #22863a;
  border: 1px solid #9ae6b4;
}

.product-table .stock-badge.out-of-stock {
  background: #fed7d7;
  color: #c53030;
  border: 1px solid #fc8181;
}

.product-table .stock-badge.stock-info {
  background: #d4f4dd;
  color: #22863a;
  border: 1px solid #9ae6b4;
}

.product-table .delivery-info {
  color: #2d3748;
  font-size: 0.9rem;
  white-space: nowrap;
}

.product-table .product-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: #dc2626;
  text-align: right;
  white-space: nowrap;
}

.product-table .price-note {
  font-size: 0.75rem;
  color: #6c757d;
  display: block;
  margin-top: 0.25rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-section {
    padding: 2rem 0 !important;
  }

  .card.product .card-body {
    padding: 1.25rem;
  }

  .price {
    font-size: 1rem;
  }

  .product-table thead th,
  .product-table tbody td {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
  }

  .product-table .product-price {
    font-size: 0.95rem;
  }
}

@media (max-width: 576px) {
  .card.product .d-flex.justify-content-between.align-items-start {
    flex-direction: column;
    align-items: stretch;
  }

  .card.product .d-flex.flex-column.align-items-end {
    align-items: flex-start;
    margin-top: 0.5rem;
  }

  .badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
  }

  /* Stack table on mobile */
  .product-table thead {
    display: none;
  }

  .product-table tbody tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
  }

  .product-table tbody td {
    display: block;
    text-align: left !important;
    padding: 0.5rem 1rem;
  }

  .product-table tbody td:before {
    content: attr(data-label);
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
    color: #6c757d;
    font-size: 0.75rem;
    text-transform: uppercase;
  }
}


