/* ============================================================
   KPHRI — Vendor Panel Styles
   vendor.css
   ============================================================ */

.vendor-sidebar {
  background: #2D1052 !important;
}

.vendor-sidebar .nav-item.active {
  background: rgba(255, 202, 40, 0.18) !important;
  color: var(--yellow) !important;
  border-color: rgba(255, 202, 40, 0.3) !important;
}

.vendor-sidebar .nav-item.active .nav-icon {
  color: var(--yellow) !important;
}

/* Vendor Stat Row */
.vendor-stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 1024px) {
  .vendor-stat-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
  .vendor-stat-row { grid-template-columns: 1fr; }
}

/* Vendor Product Grid */
.product-grid-vendor {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.25rem;
}

.product-card-vendor {
  background: var(--surface);
  border-radius: 16px;
  border: 1.5px solid var(--purple-200);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 18px rgba(106, 27, 154, 0.05);
  display: flex;
  flex-direction: column;
}

.product-card-vendor:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(106, 27, 154, 0.14);
  border-color: var(--purple-400);
}

.product-card-vendor-image {
  height: 140px;
  position: relative !important;
  background: var(--purple-50);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.product-card-vendor-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-status-badge {
  position: absolute !important;
  top: 8px !important;
  left: 8px !important;
  z-index: 10 !important;
  pointer-events: none;
}

.product-card-vendor-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card-vendor-name {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  min-height: 2.5em;
}

.product-card-vendor-price {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.product-card-vendor-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.5rem;
}

.product-card-vendor-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--border);
}

/* Service Card */
.service-list { display: flex; flex-direction: column; gap: 1rem; }

.service-card {
  background: var(--surface);
  border-radius: 16px;
  border: 1.5px solid var(--purple-200);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 4px 18px rgba(106, 27, 154, 0.05);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.service-card:hover { box-shadow: 0 10px 28px rgba(106, 27, 154, 0.12); transform: translateY(-2px); border-color: var(--purple-400); }

.service-icon {
  width: 56px; height: 56px;
  border-radius: var(--r-lg);
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  border: 1px solid rgba(255,111,32,0.2);
}

.service-info { flex: 1; }
.service-name { font-weight: 800; font-size: 1rem; margin-bottom: 0.25rem; color: var(--text-primary); }
.service-desc { font-size: 0.8125rem; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; }
.service-price { font-size: 1.05rem; font-weight: 800; color: var(--primary); text-align: right; white-space: nowrap; }
.service-price-type { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }

.service-actions { display: flex; flex-direction: column; gap: 0.375rem; }

/* Image / Emoji Picker */
.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  max-height: 180px;
  overflow-y: auto;
  margin-top: 0.5rem;
  padding: 4px;
}

.emoji-option {
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  transition: all var(--t-base);
  background: var(--surface);
}

.emoji-option:hover { border-color: var(--purple-500); background: var(--purple-50); transform: scale(1.08); }
.emoji-option.selected { border-color: var(--purple-800); background: var(--purple-100); box-shadow: 0 0 0 2px rgba(106,27,154,0.25); }

/* Form image upload */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--t-base);
  background: var(--surface-2);
}
.upload-area:hover { border-color: var(--purple-500); background: var(--purple-50); }
.upload-icon { font-size: 32px; margin-bottom: 0.5rem; }
.upload-text { font-size: 0.8125rem; color: var(--text-secondary); }
.upload-text strong { color: var(--purple-800); }

/* Order Card (vendor view) */
.order-list { display: flex; flex-direction: column; gap: 1rem; }

.order-card-vendor {
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--t-base);
}

.order-card-vendor:hover { box-shadow: var(--shadow-md); border-color: var(--purple-200); }

.order-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.order-card-id { font-size: 0.875rem; font-weight: 800; color: var(--purple-800); }
.order-card-date { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.order-card-body { padding: 1.125rem 1.25rem; }
.order-card-items { font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: 0.5rem; line-height: 1.5; }

.order-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border);
}

.order-card-total { font-size: 1rem; font-weight: 800; color: var(--primary); }

/* Profile section */
.profile-completeness {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.profile-completeness-bar {
  height: 8px;
  background: var(--bg-2);
  border-radius: var(--r-full);
  overflow: hidden;
  margin: 0.625rem 0;
}

.profile-completeness-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--r-full);
  transition: width 1s ease;
}

/* Vendor stats row */
.vendor-stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Mobile */
@media (max-width: 1100px) {
  .vendor-stat-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .product-grid-vendor { grid-template-columns: repeat(2, 1fr); gap: 0.875rem; }
  .service-card { flex-direction: column; align-items: flex-start; }
  .service-actions { flex-direction: row; width: 100%; }
  .service-actions .btn { flex: 1; }
}

@media (max-width: 480px) {
  .vendor-stat-row { grid-template-columns: 1fr; }
  .product-grid-vendor { grid-template-columns: 1fr; }
}

/* ── Smart Restock Alert Card ── */
.restock-alert-card {
  background: var(--warning-bg);
  border: 1px solid #FCD34D;
  border-radius: var(--r-xl);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.restock-alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.875rem;
}

.restock-alert-title {
  font-weight: 800;
  font-size: 0.9375rem;
  color: #92400E;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.restock-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.875rem;
  background: #FFFFFF;
  border-radius: var(--r-md);
  border: 1px solid #FDE68A;
  margin-bottom: 0.5rem;
}

/* ── Professional B2B Coupon Ticket System ── */
.voucher-kpi-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.voucher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
  gap: 1.25rem;
}

@media (max-width: 820px) {
  .voucher-kpi-summary { grid-template-columns: 1fr; }
  .voucher-grid { grid-template-columns: 1fr; }
}

.b2b-voucher-card {
  background: var(--surface);
  border-radius: 16px;
  border: 1.5px solid var(--purple-200);
  box-shadow: 0 4px 18px rgba(106, 27, 154, 0.06);
  display: flex;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-height: 160px;
}

.b2b-voucher-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(106, 27, 154, 0.14);
  border-color: var(--purple-400);
}

.b2b-voucher-card.is-expired {
  opacity: 0.75;
  background: #FAF8FC;
  border-color: var(--border);
}

.voucher-stub {
  background: linear-gradient(135deg, #2D1052 0%, #6A1B9A 100%);
  color: #FFFFFF;
  padding: 1.25rem 0.875rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 130px;
  flex-shrink: 0;
  text-align: center;
  position: relative;
}

.b2b-voucher-card.is-expired .voucher-stub {
  background: linear-gradient(135deg, #4A5568 0%, #718096 100%);
}

.stub-icon {
  font-size: 30px;
  color: #FFCA28;
  margin-bottom: 6px;
}

.stub-discount-val {
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.1;
  color: #FFFFFF;
  letter-spacing: -0.02em;
}

.stub-discount-type {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #FFCA28;
  letter-spacing: 0.05em;
  margin-top: 6px;
}

/* Dashed divider line with cutouts */
.voucher-divider-line {
  position: relative;
  width: 1px;
  border-left: 2px dashed var(--purple-200);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.voucher-divider-line .notch {
  width: 18px;
  height: 18px;
  background: var(--bg-1);
  border-radius: 50%;
  position: absolute;
  left: -10px;
  z-index: 2;
  border: 1.5px solid var(--purple-200);
}

.voucher-divider-line .notch-top {
  top: -10px;
}

.voucher-divider-line .notch-bottom {
  bottom: -10px;
}

.voucher-body {
  padding: 1.125rem 1.25rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.voucher-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  width: 100%;
}

.voucher-code-pill {
  font-family: monospace;
  font-size: 0.84375rem;
  font-weight: 800;
  color: var(--purple-800);
  background: var(--purple-50);
  border: 1px dashed var(--purple-400);
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  min-width: 0;
  overflow: hidden;
  flex-shrink: 1;
}

.voucher-code-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voucher-code-pill:hover {
  background: var(--purple-100);
  border-color: var(--purple-800);
  transform: scale(1.02);
}

.voucher-terms {
  font-size: 0.78125rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0.875rem;
}

.voucher-terms .term-item {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voucher-terms .term-item i {
  color: var(--purple-800);
  font-size: 15px;
  flex-shrink: 0;
}

.voucher-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  width: 100%;
}

.voucher-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 2px dashed var(--purple-200);
  padding: 1.25rem;
  position: relative;
  transition: all var(--t-base);
  box-shadow: var(--shadow-sm);
}

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

.voucher-code-badge {
  background: var(--purple-100);
  color: var(--purple-800);
  font-family: monospace;
  font-size: 1.125rem;
  font-weight: 800;
  padding: 0.375rem 0.875rem;
  border-radius: var(--r-md);
  letter-spacing: 1px;
  display: inline-block;
  margin-bottom: 0.75rem;
  border: 1px solid var(--purple-200);
}

/* ── Printable Delivery Order Sheet ── */
.delivery-order-sheet {
  background: #FFFFFF;
  color: #1A1428;
  padding: 2rem;
  border-radius: var(--r-lg);
  font-family: var(--font);
}

.delivery-order-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid #1A1428;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.delivery-order-signatures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
  text-align: center;
}

.signature-box {
  border-top: 1px solid #9E96B5;
  padding-top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  margin-top: 4rem;
}

/* ── Vendor Top Performance List ── */
.top-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.top-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  background: var(--bg-2);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  transition: all var(--t-fast);
}

.top-list-item:hover {
  background: var(--purple-50);
  border-color: var(--purple-200);
}

.top-list-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.top-list-rank.gold { background: #FEF08A; color: #854D0E; }
.top-list-rank.silver { background: #E2E8F0; color: #334155; }
.top-list-rank.bronze { background: #FFEDD5; color: #9A3412; }

.product-thumb-sm {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  flex-shrink: 0;
  font-size: 20px;
  color: var(--purple-800);
}

.product-thumb-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
