/* ==========================================================================
   LOUIS VAREN - HOMME ATELIER
   Admin Portal Features Extension Stylesheet
   CRM Customers, Coupons, Reviews Moderation, Analytics, Settings & Inventory
   ========================================================================== */

/* --- Enhanced Metrics Grid --- */
.metrics-grid-5 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
}

/* --- Analytics & Breakdown Grid --- */
.analytics-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 900px) {
  .analytics-two-col {
    grid-template-columns: 1fr;
  }
}

.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
}

.breakdown-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
  width: 140px;
}

.breakdown-bar-container {
  flex: 1;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
}

.breakdown-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--brand-cognac);
  transition: width 0.4s ease;
}

.breakdown-val {
  font-weight: 600;
  color: var(--text-primary);
  width: 70px;
  text-align: right;
  font-family: var(--font-sans);
}

/* --- Customer CRM Table Elements --- */
.customer-cell-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.customer-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #24160F;
  color: #EDE2D8;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--gold-primary);
  flex-shrink: 0;
}

.customer-name {
  font-weight: 600;
  color: var(--text-primary);
}

.customer-email {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tier-gold {
  background: #FFF8E1;
  color: #B78103;
  border: 1px solid rgba(197, 155, 39, 0.4);
}

.tier-patron {
  background: #EFEBE9;
  color: var(--brand-cognac);
  border: 1px solid rgba(138, 74, 40, 0.3);
}

/* --- Coupons Table Elements --- */
.coupon-code-pill {
  font-family: monospace;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--brand-cognac);
  background: rgba(138, 74, 40, 0.08);
  border: 1px dashed rgba(138, 74, 40, 0.3);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.status-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.status-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.status-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #D5CCC0;
  transition: .3s;
  border-radius: 999px;
}

.status-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .status-slider {
  background-color: #2E7D32;
}

input:checked + .status-slider:before {
  transform: translateX(18px);
}

/* --- Reviews Table Elements --- */
.review-stars-gold {
  color: #C59B27;
  font-size: 0.95rem;
  letter-spacing: 2px;
}

.review-preview-text {
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* --- Settings Form Elements --- */
.settings-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.settings-card-header {
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.settings-card-header h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.settings-card-header p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --- Quick Restock Pill in Products Table --- */
.quick-restock-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.btn-quick-stock {
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-quick-stock:hover {
  background: var(--brand-cognac);
  border-color: var(--brand-cognac);
  color: #FFFFFF;
}

/* --- Quick Order Status Changer Select --- */
.quick-status-select {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  cursor: pointer;
  outline: none;
}

.quick-status-select.pending {
  background: #FFF8E1;
  color: #B78103;
  border-color: rgba(183, 129, 3, 0.4);
}

.quick-status-select.processing {
  background: #E3F2FD;
  color: #1565C0;
  border-color: rgba(21, 101, 192, 0.4);
}

.quick-status-select.shipped {
  background: #E8F5E9;
  color: #2E7D32;
  border-color: rgba(46, 125, 50, 0.4);
}

.quick-status-select.delivered {
  background: #EDE7F6;
  color: #4527A0;
  border-color: rgba(69, 39, 160, 0.4);
}

.quick-status-select.cancelled {
  background: #FFEBEE;
  color: #C62828;
  border-color: rgba(198, 40, 40, 0.4);
}

/* ==========================================================================
   Manual Logistics & Order Fulfillment Styling
   ========================================================================== */

.sr-order-summary-box {
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn-chip {
  background: var(--bg-subtle, #f5f5f5);
  border: 1px solid var(--border-light, #e0e0e0);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-primary, #333);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-chip:hover {
  background: var(--brand-cognac, #8C6239);
  color: #fff;
  border-color: var(--brand-cognac, #8C6239);
  transform: translateY(-1px);
}

.btn-chip.active {
  background: var(--brand-cognac, #8C6239);
  color: #fff;
  border-color: var(--brand-cognac, #8C6239);
  font-weight: 600;
}

.sr-success-container {
  background: #F0FDF4;
  border: 1.5px solid #86EFAC;
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  text-align: center;
}

.btn-dispatch-action {
  background: var(--brand-cognac);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.btn-dispatch-action:hover {
  background: #734F2C;
  transform: translateY(-1px);
}

