/* ========================================================
   NUSA STORE - Modern PPOB Fintech Design System
   Responsive, Mobile-First, Clean & Minimalist
   ======================================================== */

:root {
  --primary: #0f766e;        /* Emerald Teal - Professional PPOB Trust */
  --primary-dark: #115e59;
  --primary-light: #14b8a6;
  --primary-subtle: #f0fdfa;
  --primary-border: #ccfbf1;
  
  --secondary: #0284c7;      /* Ocean Blue */
  --secondary-subtle: #f0f9ff;
  
  --accent: #f59e0b;         /* Amber / Gold */
  --accent-subtle: #fffbeb;
  
  --dark: #0f172a;           /* Slate 900 */
  --dark-light: #1e293b;
  --text-main: #334155;      /* Slate 700 */
  --text-muted: #64748b;     /* Slate 500 */
  --text-light: #94a3b8;
  
  --bg-app: #f8fafc;         /* Slate 50 */
  --bg-card: #ffffff;
  --bg-input: #f1f5f9;
  
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  
  --success: #10b981;
  --success-subtle: #ecfdf5;
  --warning: #f59e0b;
  --warning-subtle: #fffbeb;
  --danger: #ef4444;
  --danger-subtle: #fef2f2;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.1);
  --shadow-float: 0 12px 30px -4px rgba(15, 118, 110, 0.25);
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Layout App Container (Mobile-first friendly) */
.app-container {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  background-color: #ffffff;
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .app-container {
    max-width: 720px;
  }
}

@media (min-width: 1024px) {
  .app-container.full-desktop {
    max-width: 1140px;
    border-radius: var(--radius-lg);
    margin: 24px auto;
    min-height: calc(100vh - 48px);
    overflow: hidden;
  }
}

/* Top App Header */
.app-header {
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 50%, #0284c7 100%);
  color: #ffffff;
  padding: 20px 20px 32px 20px;
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
  position: relative;
}

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

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
  color: #ffffff;
  text-decoration: none;
}

.brand-badge i {
  color: #6ee7b7;
  font-size: 1.4rem;
}

.header-user-action {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-btn {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.user-avatar-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Saldo & Agent Card */
.agent-balance-card {
  background: #ffffff;
  color: var(--dark);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  margin-top: -12px;
  position: relative;
  z-index: 2;
  border: 1px solid var(--border-light);
}

.balance-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.balance-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.agent-status-pill {
  font-size: 0.72rem;
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.balance-amount {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--dark);
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.balance-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.balance-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

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

.balance-action-btn.primary:hover {
  background: var(--primary-dark);
}

.balance-action-btn.secondary {
  background: var(--bg-app);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.balance-action-btn.secondary:hover {
  background: #e2e8f0;
}

/* Page Main Body */
.app-body {
  padding: 20px;
  flex: 1;
}

/* Section Titles */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.3px;
}

.section-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.section-link:hover {
  text-decoration: underline;
}

/* PPOB Product Grid */
.ppob-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

@media (min-width: 640px) {
  .ppob-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.ppob-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  background: #ffffff;
  padding: 16px 8px 12px 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
}

.ppob-item:hover {
  transform: translateY(-3px);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
}

.ppob-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 8px;
  transition: var(--transition);
}

.ppob-icon-pulsa  { background: #eff6ff; color: #2563eb; }
.ppob-icon-data   { background: #f0fdf4; color: #16a34a; }
.ppob-icon-pln    { background: #fffbeb; color: #d97706; }
.ppob-icon-pdam   { background: #ecfeff; color: #0891b2; }
.ppob-icon-bpjs   { background: #fdf2f8; color: #db2777; }
.ppob-icon-emoney { background: #f5f3ff; color: #7c3aed; }

.ppob-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
}

/* Banner Slider / Promo */
.promo-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.promo-card::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.3) 0%, transparent 70%);
}

.promo-badge {
  display: inline-block;
  background: #f59e0b;
  color: #000000;
  font-weight: 800;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.promo-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.promo-card p {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* History List / Table */
.trx-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trx-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.trx-item:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.trx-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trx-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.trx-details h5 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--dark);
}

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

.trx-right {
  text-align: right;
}

.trx-price {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--dark);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.badge-success { background: var(--success-subtle); color: #047857; }
.badge-warning { background: var(--warning-subtle); color: #b45309; }
.badge-danger  { background: var(--danger-subtle);  color: #b91c1c; }

/* Forms & Inputs */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background-color: var(--bg-app);
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--dark);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

/* Product Selection Cards */
.product-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.product-option-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  background: #ffffff;
  transition: var(--transition);
  position: relative;
}

.product-option-card:hover {
  border-color: var(--primary-light);
}

.product-option-card.selected {
  border-color: var(--primary);
  background: var(--primary-subtle);
  box-shadow: 0 0 0 1px var(--primary);
}

.product-option-card .prod-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}

.product-option-card .prod-price {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--primary);
}

.product-option-card .prod-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  width: 100%;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-app);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
  width: auto;
}

/* Bottom Navigation Bar for Mobile */
.bottom-nav {
  position: sticky;
  bottom: 0;
  background: #ffffff;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 12px;
  z-index: 10;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.03);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.bottom-nav-item i {
  font-size: 1.25rem;
  margin-bottom: 2px;
}

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

/* Modal and Drawers */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.show {
  display: flex;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 440px;
  width: 100%;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modalEnter 0.2s ease-out;
}

@keyframes modalEnter {
  from {
    transform: scale(0.95) translateY(10px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: var(--bg-app);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
}

/* Struk / Receipt Styles */
.receipt-card {
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 16px 0;
  font-family: 'Courier New', Courier, monospace;
}

.receipt-header {
  text-align: center;
  border-bottom: 1px dashed #cbd5e1;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.receipt-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success { background: var(--success-subtle); color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger  { background: var(--danger-subtle);  color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: var(--secondary-subtle); color: #075985; border: 1px solid #bae6fd; }

/* Responsive adjustments */
@media (max-width: 480px) {
  .balance-amount {
    font-size: 1.5rem;
  }
  .ppob-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
}
