/* =========================================================
   JamWira - Stylesheet (DANA-inspired mobile UI)
   ========================================================= */
:root {
  --jw-blue: #0A6CFF;
  --jw-blue-dark: #0048B3;
  --jw-blue-light: #E8F1FF;
  --jw-bg: #F2F4F8;
  --jw-white: #FFFFFF;
  --jw-text: #1A1D29;
  --jw-text-muted: #7C8398;
  --jw-orange: #FF8A00;
  --jw-green: #12B76A;
  --jw-red: #E4483C;
  --jw-yellow: #FFC542;
  --jw-radius-lg: 20px;
  --jw-radius-md: 14px;
  --jw-radius-sm: 10px;
  --jw-shadow: 0 8px 24px rgba(16, 24, 64, 0.08);
  --jw-shadow-sm: 0 2px 8px rgba(16, 24, 64, 0.06);
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #DCE3F0;
  font-family: var(--font-main);
  color: var(--jw-text);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-weight: 400;
  letter-spacing: 0.1px;
  touch-action: manipulation;
  overscroll-behavior-y: contain;
  -webkit-text-size-adjust: 100%;
}

/* Disable pinch-zoom & double-tap-to-zoom app-wide (native app feel) */
html {
  touch-action: manipulation;
}
img, svg { touch-action: manipulation; }

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* App shell: constrained mobile frame, centers on desktop */
.app-shell {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--jw-bg);
  position: relative;
  padding-bottom: 88px;
  box-shadow: 0 0 40px rgba(0,0,0,0.12);
}

/* ---------------- Header ---------------- */
.jw-header {
  background: linear-gradient(160deg, var(--jw-blue) 0%, #2F8CFF 100%);
  color: #fff;
  padding: 18px 18px 46px;
  border-radius: 0 0 28px 28px;
  position: relative;
}
.jw-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.jw-header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.2px;
}
.jw-header-brand .logo-dot {
  width: 30px; height: 30px;
  background: #fff;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: var(--jw-blue);
  font-weight: 700;
  font-size: 13px;
}
.jw-header-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  border: none;
  color: #fff;
  position: relative;
}
.jw-header-icon .dot-badge {
  position: absolute; top: 4px; right: 5px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--jw-yellow);
  border: 1.5px solid var(--jw-blue);
}

.jw-balance-label { font-size: 12.5px; opacity: 0.85; margin-top: 18px; }
.jw-balance-row {
  display: flex; align-items: baseline; gap: 8px; margin-top: 4px;
}
.jw-balance-amount { font-size: 26px; font-weight: 700; letter-spacing: 0.2px; }
.jw-balance-eye { opacity: 0.75; font-size: 14px; }

/* quick actions row, floats over the header curve */
.jw-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 18px -4px -60px;
  position: relative;
  z-index: 2;
}
.jw-quick-actions a {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.jw-quick-actions .qa-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}

/* ---------------- Body content ---------------- */
.jw-content { padding: 64px 16px 8px; }

.jw-card {
  background: var(--jw-white);
  border-radius: var(--jw-radius-lg);
  box-shadow: var(--jw-shadow);
  padding: 18px;
  margin-bottom: 16px;
}

.jw-section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 2px 12px;
}
.jw-section-title h3 { font-size: 15.5px; margin: 0; font-weight: 700; }
.jw-section-title a { font-size: 12.5px; color: var(--jw-blue); font-weight: 700; }

/* Promo / deals banner */
.jw-promo {
  background: linear-gradient(120deg, #FFF4E5, #FFE8CC);
  border-radius: var(--jw-radius-lg);
  padding: 16px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
  box-shadow: var(--jw-shadow-sm);
}
.jw-promo .promo-text b { display: block; font-size: 14.5px; color: var(--jw-text); }
.jw-promo .promo-text span { font-size: 12px; color: var(--jw-orange); font-weight: 700; }
.jw-promo .promo-btn {
  background: var(--jw-blue); color: #fff; border: none;
  padding: 9px 16px; border-radius: 10px; font-weight: 700; font-size: 12.5px;
}

/* Grid menu (like DANA deals icon grid) */
.jw-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 6px;
  padding-top: 14px;
}
.jw-menu-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.jw-menu-grid .icon-box {
  width: 46px; height: 46px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.jw-menu-grid span { font-size: 11px; text-align: center; font-weight: 600; color: var(--jw-text); line-height: 1.25; }
.bg-daging { background: #FFEAE8; }
.bg-sayuran { background: #E6F9EF; }
.bg-buahan { background: #FFF3DE; }
.bg-blue { background: var(--jw-blue-light); }

/* Product card */
.jw-product {
  display: flex; gap: 12px;
  background: var(--jw-white);
  border-radius: var(--jw-radius-md);
  box-shadow: var(--jw-shadow-sm);
  padding: 12px;
  margin-bottom: 12px;
  align-items: center;
}
.jw-product .thumb {
  width: 58px; height: 58px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0;
}
.jw-product .info { flex: 1; min-width: 0; }
.jw-product .info h4 { margin: 0 0 3px; font-size: 14px; font-weight: 700; }
.jw-product .info p { margin: 0; font-size: 12px; color: var(--jw-text-muted); }
.jw-product .tag {
  display: inline-block; margin-top: 6px;
  font-size: 11px; font-weight: 700; color: var(--jw-green);
  background: #E6F9EF; padding: 2px 8px; border-radius: 6px;
}
.jw-product .chevron { color: var(--jw-text-muted); font-size: 18px; }

/* Category badge colors */
.badge-daging { color: var(--jw-red); background: #FFEAE8; }
.badge-sayuran { color: var(--jw-green); background: #E6F9EF; }
.badge-buahan { color: var(--jw-orange); background: #FFF3DE; }

/* Plan choice pills */
.jw-plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.jw-plan-pill {
  border: 1.5px solid #E3E7F0;
  border-radius: var(--jw-radius-sm);
  padding: 12px 8px;
  text-align: center;
  background: #fff;
  cursor: pointer;
  transition: all .15s ease;
}
.jw-plan-pill b { display: block; font-size: 14px; }
.jw-plan-pill span { font-size: 11.5px; color: var(--jw-text-muted); }
.jw-plan-pill.active { border-color: var(--jw-blue); background: var(--jw-blue-light); }
.jw-plan-pill.active b { color: var(--jw-blue); }
.jw-plan-pill input { display: none; }

/* Buttons */
.jw-btn {
  display: block; width: 100%; text-align: center;
  background: var(--jw-blue); color: #fff; border: none;
  padding: 14px; border-radius: 14px; font-weight: 700; font-size: 14.5px;
  box-shadow: 0 8px 18px rgba(10,108,255,0.28);
}
.jw-btn:disabled { opacity: 0.5; }
.jw-btn.outline { background: #fff; color: var(--jw-blue); border: 1.5px solid var(--jw-blue); box-shadow: none; }
.jw-btn.secondary { background: var(--jw-text); }

/* Forms */
.jw-field { margin-bottom: 14px; }
.jw-field label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; color: var(--jw-text); }
.jw-field input, .jw-field select, .jw-field textarea {
  width: 100%; padding: 13px 14px; border-radius: 12px;
  border: 1.5px solid #E3E7F0; font-size: 14px; background: #FAFBFD;
}
.jw-field input:focus, .jw-field select:focus { outline: none; border-color: var(--jw-blue); background: #fff; }
.jw-field .amount-input { font-size: 20px; font-weight: 700; }
.jw-hint { font-size: 11.5px; color: var(--jw-text-muted); margin-top: 5px; }

/* Alerts */
.jw-alert { padding: 12px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.jw-alert.success { background: #E6F9EF; color: #0B7A43; }
.jw-alert.error { background: #FFEAE8; color: #C2271D; }
.jw-alert.info { background: var(--jw-blue-light); color: var(--jw-blue-dark); }

/* Status chip */
.jw-status { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.jw-status.berjalan { background: #FFF3DE; color: var(--jw-orange); }
.jw-status.jatuh_tempo { background: var(--jw-blue-light); color: var(--jw-blue); }
.jw-status.dicairkan { background: #E6F9EF; color: var(--jw-green); }
.jw-status.dibatalkan { background: #F1F2F5; color: var(--jw-text-muted); }

/* Investment summary row */
.jw-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; font-size: 13px; }
.jw-row span:first-child { color: var(--jw-text-muted); }
.jw-row span:last-child { font-weight: 700; }
.jw-divider { border: none; border-top: 1px dashed #E3E7F0; margin: 8px 0; }

/* Activity/history list */
.jw-history-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #F0F1F5; }
.jw-history-item:last-child { border-bottom: none; }
.jw-history-item .h-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.jw-history-item .h-info { flex: 1; min-width: 0; }
.jw-history-item .h-info b { font-size: 13.5px; display: block; }
.jw-history-item .h-info span { font-size: 11.5px; color: var(--jw-text-muted); }
.jw-history-item .h-amount { font-weight: 700; font-size: 13.5px; text-align: right; white-space: nowrap; }
.jw-history-item .h-amount.plus { color: var(--jw-green); }
.jw-history-item .h-amount.minus { color: var(--jw-red); }

/* ---------------- Bottom Nav ---------------- */
.jw-bottomnav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 460px;
  background: #fff;
  border-top: 1px solid #EEF0F5;
  display: flex; justify-content: space-around; align-items: center;
  padding: 10px 6px 18px;
  z-index: 50;
}
.jw-bottomnav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px; color: var(--jw-text-muted); font-weight: 700;
  flex: 1;
}
.jw-bottomnav a.active { color: var(--jw-blue); }
.jw-bottomnav .nav-icon { font-size: 19px; }
.jw-bottomnav .nav-center {
  margin-top: -30px;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(160deg, var(--jw-blue), #2F8CFF);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: 0 10px 20px rgba(10,108,255,0.4);
  border: 4px solid #fff;
}
.jw-bottomnav .nav-center + span { display: none; }

/* ---------------- Auth pages ---------------- */
.jw-auth-wrap {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  padding: 32px 24px; max-width: 460px; margin: 0 auto; background: var(--jw-bg);
}
.jw-auth-logo { text-align: center; margin-bottom: 28px; }
.jw-auth-logo .logo-dot {
  width: 64px; height: 64px; border-radius: 18px;
  background: var(--jw-blue); color: #fff; font-weight: 700; font-size: 24px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
}
.jw-auth-logo h1 { font-size: 20px; margin: 0; }
.jw-auth-logo p { font-size: 12.5px; color: var(--jw-text-muted); margin: 4px 0 0; }
.jw-auth-switch { text-align: center; margin-top: 18px; font-size: 13px; color: var(--jw-text-muted); }
.jw-auth-switch a { color: var(--jw-blue); font-weight: 700; }

/* Simple top bar for inner pages */
.jw-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; background: #fff; position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid #EEF0F5;
}
.jw-topbar .back-btn { font-size: 20px; }
.jw-topbar h2 { font-size: 16px; margin: 0; font-weight: 700; }

.jw-empty { text-align: center; padding: 50px 20px; color: var(--jw-text-muted); }
.jw-empty .emoji { font-size: 40px; display: block; margin-bottom: 10px; }

/* Tabs */
.jw-tabs { display: flex; gap: 8px; padding: 14px 16px 0; }
.jw-tabs a {
  padding: 8px 14px; border-radius: 20px; font-size: 12.5px; font-weight: 700;
  background: #fff; color: var(--jw-text-muted); border: 1px solid #E3E7F0;
}
.jw-tabs a.active { background: var(--jw-blue); color: #fff; border-color: var(--jw-blue); }

/* Admin */
.admin-shell { max-width: 1100px; margin: 0 auto; padding: 20px; font-family: var(--font-main); }
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-nav a { padding: 9px 14px; background: #fff; border-radius: 10px; font-size: 13px; font-weight: 700; border: 1px solid #E3E7F0; }
.admin-nav a.active { background: var(--jw-blue); color: #fff; border-color: var(--jw-blue); }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--jw-shadow-sm); }
.admin-table th, .admin-table td { padding: 11px 14px; text-align: left; font-size: 13px; border-bottom: 1px solid #F0F1F5; }
.admin-table th { background: #F7F9FC; font-weight: 700; color: var(--jw-text-muted); font-size: 11.5px; text-transform: uppercase; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 14px; margin-bottom: 22px; }
.admin-stat-card { background: #fff; border-radius: 14px; padding: 16px; box-shadow: var(--jw-shadow-sm); }
.admin-stat-card span { font-size: 12px; color: var(--jw-text-muted); font-weight: 700; }
.admin-stat-card b { display: block; font-size: 20px; margin-top: 4px; }
.btn-sm { padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 700; border: none; }
.btn-sm.blue { background: var(--jw-blue-light); color: var(--jw-blue); }
.btn-sm.green { background: #E6F9EF; color: var(--jw-green); }
.btn-sm.red { background: #FFEAE8; color: var(--jw-red); }

@media (min-width: 480px) {
  .app-shell { margin-top: 20px; margin-bottom: 20px; border-radius: 28px; overflow: hidden; min-height: calc(100vh - 40px); }
  .jw-header { border-radius: 0; }
  .jw-bottomnav { border-radius: 0 0 28px 28px; }
}
