/* Partner portal – premium styles */
:root {
  --partner-accent: #00b14f;
  --partner-accent2: #0ea271;
}

/* ── App Header ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 12px;
  flex-wrap: wrap;
}
.app-header-info {
  display: flex;
  align-items: center;
  gap: 14px;
}
.store-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #00b14f, #006e2f);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 8px 20px rgba(0,177,79,0.3);
}
.app-header-info h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}
.app-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.store-status-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  background: #dff8ea;
  color: #006e2f;
  border: 1px solid #a3e6bf;
}
.store-status-badge.closed {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}
.btn-sm {
  padding: 8px 14px !important;
  font-size: 13px !important;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #00b14f, #008a3a);
  box-shadow: 0 8px 20px rgba(0,138,58,0.28);
  border: none;
  border-radius: 12px;
  padding: 11px 18px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s, filter 0.2s;
  font-family: inherit;
  font-size: 14px;
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }

/* ── Main Tabs ── */
.main-tabs {
  display: flex;
  gap: 4px;
  background: #f0f4f1;
  border-radius: 16px;
  padding: 5px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.main-tab {
  flex: 1;
  min-width: 100px;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  color: #4a6553;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: none;
}
.main-tab:hover {
  background: rgba(0,177,79,0.1);
  transform: none;
}
.main-tab.active {
  background: #fff;
  color: #006e2f;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* ── Section toolbar ── */
.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.section-toolbar h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0a3520;
}

/* ── KPI Cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.kpi-card {
  border-radius: 18px;
  padding: 20px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.09);
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  opacity: 0.12;
  background: #fff;
}
.kpi-today { background: linear-gradient(135deg, #00b14f, #008a3a); color: #fff; }
.kpi-week  { background: linear-gradient(135deg, #0ea5e9, #0369a1); color: #fff; }
.kpi-month { background: linear-gradient(135deg, #a855f7, #7c3aed); color: #fff; }
.kpi-total { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }

.kpi-icon { font-size: 28px; margin-bottom: 8px; }
.kpi-label { font-size: 12px; font-weight: 600; opacity: 0.85; margin-bottom: 4px; }
.kpi-value { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 4px; }
.kpi-sub   { font-size: 12px; opacity: 0.8; }

/* ── Charts ── */
.chart-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}
.chart-card, .payment-split-card {
  padding: 20px;
}
.chart-card h4, .payment-split-card h4 {
  margin: 0 0 16px 0;
  font-size: 15px;
  font-weight: 700;
  color: #0a3520;
}
.chart-wrap {
  position: relative;
  height: 200px;
}

/* ── Top products & recent orders ── */
.top-products-card, .recent-orders-card {
  padding: 20px;
  margin-bottom: 20px;
}
.top-products-card h4, .recent-orders-card h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0a3520;
}

/* ── Form panel ── */
.form-panel {
  padding: 24px;
  margin-bottom: 16px;
  animation: slideDown 0.25s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.form-panel h4 { margin: 0 0 4px 0; font-size: 16px; font-weight: 700; color: #0a3520; }

.image-upload-group {
  margin-top: 14px;
}
.image-upload-group > label {
  display: block;
  margin-bottom: 8px;
}
.image-type-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.radio-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  background: #f2f6f3;
  border: 1px solid #c9d5cd;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #3b5249;
  transition: all 0.2s;
}
.radio-opt input[type="radio"] { display: none; }
.radio-opt.active {
  background: #dff8ea;
  border-color: #62cc93;
  color: #006e2f;
}
#image-preview, #edit-image-preview {
  max-width: 160px;
  max-height: 120px;
  border-radius: 10px;
  object-fit: cover;
  margin-top: 8px;
  border: 2px solid #c9d5cd;
}

.category-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.category-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f2f6f3;
  border: 1px solid #c9d5cd;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  color: #3b5249;
}
.category-chip input { display: none; }
.category-chip.selected {
  background: #dff8ea;
  border-color: #00b14f;
  color: #006e2f;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* Product image in table */
.product-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: #eef2ef;
  border: 1px solid #d3ddd7;
}
.no-img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #eef2ef;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1px solid #d3ddd7;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.status-PENDING   { background: #fef9c3; color: #854d0e; }
.status-CONFIRMED { background: #dbeafe; color: #1e40af; }
.status-PREPARING { background: #ffedd5; color: #9a3412; }
.status-PICKED_UP { background: #ede9fe; color: #5b21b6; }
.status-DELIVERED { background: #dcfce7; color: #166534; }
.status-CANCELLED { background: #fee2e2; color: #991b1b; }

.pm-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}
.pm-SEPAY_QR { background: #e0f2fe; color: #0369a1; }
.pm-COD      { background: #fef3c7; color: #92400e; }

/* ── Wallet ── */
.wallet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.wallet-card {
  padding: 24px;
}
.wallet-merchant {
  background: linear-gradient(135deg, #dff8ea 0%, #f0faf4 100%);
  border-color: #a3e6bf;
}
.wallet-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.wallet-icon { font-size: 28px; }
.wallet-label { font-weight: 600; color: #2d4436; font-size: 14px; }
.wallet-balance {
  font-size: 32px;
  font-weight: 800;
  color: #006e2f;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}
.wallet-hold { font-size: 13px; margin-bottom: 8px; }
.wallet-note { font-size: 12px; color: #6b7f72; background: rgba(255,255,255,0.6); padding: 8px 10px; border-radius: 8px; }
.payout-card { padding: 24px; }
.payout-card h4 { margin: 0 0 4px 0; font-size: 16px; font-weight: 700; color: #0a3520; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 30, 18, 0.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none !important; }
.modal-box {
  width: min(720px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.modal-header h3 { margin: 0; font-size: 18px; font-weight: 700; }
.modal-close {
  background: #f2f6f3;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4a6553;
  transition: background 0.2s;
  box-shadow: none;
  padding: 0;
}
.modal-close:hover { background: #fee2e2; color: #b91c1c; transform: none; }

/* ── Auth promo icon ── */
.auth-promo .promo-icon { font-size: 52px; margin-bottom: 16px; }
.auth-promo { padding: 32px 0; }

/* ── Tabs in auth ── */
.tabs { display: flex; gap: 6px; }
.tab-btn {
  padding: 9px 18px;
  border-radius: 10px;
  font-weight: 600;
  color: #4a6553;
  background: #f2f6f3;
  border: 1px solid #d3ddd7;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: none;
}
.tab-btn.active {
  background: var(--brand-soft);
  color: #006e2f;
  border-color: #a3e6bf;
}
.tab-btn:hover { transform: none; }

/* ── Auth card ── */
.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
  padding: 60px 0;
}
.auth-card { padding: 32px; }
.auth-card h2 { margin: 0 0 4px 0; font-size: 22px; font-weight: 800; }
.intro { margin: 0 0 16px 0; font-size: 14px; }
.promo-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.promo-badge {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.35);
  font-size: 13px;
  font-weight: 600;
  color: #0a3520;
}
.auth-promo h1 { font-size: 28px; font-weight: 800; line-height: 1.25; color: #0a3520; margin: 0 0 10px 0; }
.auth-promo p { color: #3b5249; font-size: 15px; line-height: 1.6; }

/* ── Select input ── */
select { cursor: pointer; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .chart-row { grid-template-columns: 1fr; }
  .wallet-grid { grid-template-columns: 1fr; }
  .auth-layout { grid-template-columns: 1fr; padding: 32px 0; }
}
@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .main-tabs { gap: 2px; }
  .main-tab { min-width: 70px; font-size: 12px; padding: 8px 10px; }
}
