/* ===================================================
   ZENITH RESELLER TERMINAL - MODERN EXECUTIVE THEME
   Zero Emojis - High Clarity - Premium FinTech Palette
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --header-bg: #0f172a;
  --header-border: #1e293b;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-white: #ffffff;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  
  --success: #059669;
  --success-hover: #047857;
  --success-light: #ecfdf5;
  
  --warning: #d97706;
  --warning-light: #fffbeb;
  
  --purple: #6366f1;
  --purple-light: #eef2ff;
  
  --border-light: #e2e8f0;
  --border-card: #cbd5e1;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-bottom: 90px;
}

/* Container Frame */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background-color: var(--bg-body);
  position: relative;
  overflow-x: hidden;
  padding: 16px 16px 30px 16px;
}

/* Utility SVG Icons */
.icon-svg {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
  fill: currentColor;
  flex-shrink: 0;
}

.icon-svg-lg {
  width: 22px;
  height: 22px;
}

.icon-svg-sm {
  width: 14px;
  height: 14px;
}

/* --- HEADER CARD --- */
.header-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid var(--header-border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  padding: 20px 20px 22px 20px;
  color: var(--text-white);
  position: relative;
  margin-bottom: 16px;
  overflow: hidden;
}

.header-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.reseller-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.12);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.tier-badge {
  background-color: #f59e0b;
  color: #0f172a;
  font-weight: 800;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-name {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-white);
  margin-bottom: 8px;
  word-break: break-word;
}

.store-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.store-name-text {
  color: var(--text-white);
  font-weight: 700;
}

.edit-store-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s;
}

.edit-store-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.tier-subtext {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- 2x2 METRICS GRID --- */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.metric-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.metric-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-saldo { background: #eff6ff; color: var(--primary); }
.icon-escrow { background: var(--warning-light); color: var(--warning); }
.icon-gmv { background: var(--success-light); color: var(--success); }
.icon-produk { background: var(--purple-light); color: var(--purple); }

.metric-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  word-break: break-all;
}

/* --- ACTION BUTTONS (2-COL) --- */
.action-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.action-btn {
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 12px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.action-btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-success {
  background-color: var(--success);
  color: #ffffff;
}

.btn-success:hover {
  background-color: var(--success-hover);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

/* --- SECTION HEADER --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-pill-action {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.2);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.btn-pill-action:hover {
  background: var(--primary);
  color: #ffffff;
}

/* --- ITEM CARDS (WITHDRAW & ORDERS) --- */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.clean-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}

.clean-card:hover {
  border-color: var(--border-card);
}

.clean-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.clean-card-amount {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

/* Status Chips */
.status-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.status-paid {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.status-processing {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.clean-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.clean-card-subtitle {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Category Filter Chips */
.filter-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.filter-scroll::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.filter-chip.active, .filter-chip:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* --- FIXED BOTTOM NAVIGATION --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 66px;
  z-index: 100;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
  padding: 6px 2px;
}

.nav-item.active {
  color: var(--primary);
}

.nav-icon {
  margin-bottom: 3px;
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* --- MODAL SYSTEM --- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 200;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  padding: 22px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: #f1f5f9;
  border: none;
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-input, .form-select {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  background: #f8fafc;
  outline: none;
  transition: all 0.2s;
}

.form-input:focus, .form-select:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Toast */
.toast-notice {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #334155;
  box-shadow: var(--shadow-lg);
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  z-index: 300;
  display: none;
  max-width: 90%;
  text-align: center;
}

/* Platform Icons */
.platform-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: -2px;
  margin-right: 4px;
  flex-shrink: 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Floating WhatsApp CS Button */
.floating-cs-btn {
  position: fixed;
  bottom: 84px;
  right: 16px;
  background: #16a34a;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
  z-index: 95;
  transition: transform 0.2s, box-shadow 0.2s;
  letter-spacing: 0.3px;
}

.floating-cs-btn:hover {
  background: #15803d;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.45);
}
