:root {
  --primary-color: #e52657;
  --primary-dark:  #c71f4a;
  --secondary-color: #ffd700;
  --ink: #222;
  --soft: #fff0f5;
  --muted: #6c757d;
  --bg: #f5f5f5;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  /* untuk halaman dengan top header fixed (90px) + bottom nav (90px) */
}
body.has-topnav { padding-top: 148px; }
body.has-bottomnav { padding-bottom: 95px; }

/* ========== TOP HEADER (fixed, red gradient) ========== */
.top-header {
  padding: 18px 18px 14px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 999;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.header-top {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 1200px; margin: 0 auto;
}
.brand-info { color: white; line-height: 1.1; }
.brand-title { font-size: 20px; font-weight: 800; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; }
.brand-title .logo { background: white; color: var(--primary-color); width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
.brand-label { font-size: 11px; opacity: .85; margin-top: 3px; }

.header-right { display: flex; align-items: center; gap: 10px; }

.header-chip {
  background: rgba(255,255,255,.2);
  backdrop-filter: blur(10px);
  color: white;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.25);
}
.header-chip:hover { background: rgba(255,255,255,.3); color: white; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.2); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; border: none; cursor: pointer;
  text-decoration: none;
  backdrop-filter: blur(10px);
}
.icon-btn:hover { background: rgba(255,255,255,.35); color: white; }

.search-bar-container { margin-top: 12px; display: flex; gap: 8px; max-width: 1200px; margin-left: auto; margin-right: auto; }
.search-bar {
  flex: 1; background: white; border-radius: 12px;
  padding: 10px 14px; display: flex; align-items: center; gap: 10px;
}
.search-bar i { color: #999; font-size: 15px; }
.search-bar input { border: none; outline: none; flex: 1; font-size: 13px; }
.filter-btn {
  width: 44px; height: 44px; background: white; border-radius: 12px;
  border: none; color: var(--primary-color); font-size: 16px; cursor: pointer;
}

/* ========== CONTAINER ========== */
.app-container { max-width: 1200px; margin: 0 auto; padding: 20px 16px 16px; }
.container, .container-fluid { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ========== CARDS ========== */
.card-kdk {
  background: white;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
  margin-bottom: 16px;
}
.card-kdk .card-body { padding: 20px; }
.card-kdk .card-header { background: transparent; border: 0; padding: 20px 20px 0; }

/* Promo hero card */
.hero-card {
  background: linear-gradient(135deg, var(--primary-color), #ff6b8a);
  border-radius: 20px;
  padding: 25px 20px;
  color: white;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}
.hero-card::before {
  content: ''; position: absolute; top: -50%; right: -15%;
  width: 220px; height: 220px; background: rgba(255,255,255,.12); border-radius: 50%;
}
.hero-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 6px; position: relative; }
.hero-card p { font-size: 13px; opacity: .95; position: relative; margin: 0; }
.hero-card .hero-emoji { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 50px; opacity: .35; }

/* ========== SECTION TITLE ========== */
.section-title {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before { content: "»"; font-size: 16px; }

/* ========== BUTTONS ========== */
.btn-kdk {
  background: var(--primary-color);
  color: white; border: 0;
  padding: 11px 20px;
  border-radius: 12px;
  font-weight: 600;
  transition: all .2s;
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
}
.btn-kdk:hover { background: var(--primary-dark); color: white; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(229,38,87,.3); }
.btn-kdk.btn-lg { padding: 14px 26px; font-size: 16px; }

.btn-outline-kdk {
  background: transparent;
  color: var(--primary-color);
  border: 1.5px solid var(--primary-color);
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 600;
}
.btn-outline-kdk:hover { background: var(--primary-color); color: white; }

/* ========== LABEL CHIP & BADGES ========== */
.label-chip {
  display: inline-block;
  background: var(--soft);
  color: var(--primary-color);
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
}

.required { color: var(--primary-color); font-weight: 700; }

/* ========== QUICK GRID MENU (ala jastip jastip-grid) ========== */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.quick-item {
  text-align: center; text-decoration: none; color: inherit;
  cursor: pointer; transition: transform .2s;
}
.quick-item:hover { transform: scale(1.05); }
.quick-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--soft);
  color: var(--primary-color);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin: 0 auto 8px;
}
.quick-label { font-size: 11px; color: #666; font-weight: 500; }

/* ========== STATS ========== */
.stat-card {
  background: white;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--ink); margin-top: 4px; }
.stat-value.text-danger { color: #dc3545 !important; }
.stat-value.text-success { color: #198754 !important; }
.stat-value.text-warning { color: #f0ad4e !important; }
.stat-value.text-info    { color: #0dcaf0 !important; }

/* ========== FORMS ========== */
.form-label { font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #333; }
.form-control, .form-select {
  border-radius: 10px; border: 1px solid #e5e7eb; padding: 10px 14px; font-size: 14px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(229,38,87,.1);
}
.form-control-sm, .form-select-sm { padding: 7px 10px; font-size: 13px; border-radius: 8px; }
.form-text { font-size: 11px; color: var(--muted); }

/* ========== TABLES ========== */
.table { font-size: 13px; }
.table thead.table-light th { background: #f8f9fa; color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .3px; }
.table > :not(caption) > * > * { padding: 12px 10px; }

/* ========== ITEM ROWS (packing list) ========== */
.kdk-item-row {
  display: flex; align-items: center; gap: .75rem;
  padding: 10px 12px; border-bottom: 1px solid #f0f0f0;
}
.kdk-item-row:hover { background: #fafafa; }
.kdk-item-row .label { flex: 1; font-size: 13px; }
.kdk-item-row input[type=number] { width: 100px; border-radius: 8px; padding: 6px 10px; }

/* ========== BOX SELECTOR (ala ergeasia) ========== */
.box-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 12px;
}
.box-card {
  position: relative;
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px 12px 14px;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  display: block;
  margin: 0;
}
.box-card input[type=radio] { display: none; }
.box-card:hover { border-color: var(--primary-color); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(229,38,87,.12); }
.box-card.selected {
  border-color: var(--primary-color);
  background: var(--soft);
  box-shadow: 0 4px 16px rgba(229,38,87,.22);
}
.box-card .box-plus {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-color); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: bold;
  box-shadow: 0 2px 6px rgba(229,38,87,.3);
}
.box-card.selected .box-plus { background: #198754; }
.box-card.selected .box-plus::before { content: "\2713"; font-size: 14px; }
.box-card.selected .box-plus i { display: none; }

.box-img-wrap {
  height: 130px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  position: relative;
}
.box-img-wrap img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  transition: transform .2s;
}
.box-card:hover .box-img-wrap img { transform: scale(1.05); }

/* Fallback CSS-drawn box (0 KB, instant) — dipakai kalau <div class="box-3d box-3d-N"> */
.box-3d {
  background:
    linear-gradient(to right, rgba(0,0,0,.08), transparent 20%),
    linear-gradient(135deg, #e8d2a0 0%, #d4b87a 50%, #c0a068 100%);
  border: 1px solid #a67c52;
  border-radius: 3px;
  position: relative;
  box-shadow: 2px 4px 10px rgba(0,0,0,.2);
  margin: 0 auto;
}
.box-3d::before {
  content: "KK"; position: absolute; top: 25%; left: 50%;
  transform: translateX(-50%);
  background: var(--primary-color); color: white;
  padding: 3px 8px; font-size: 10px; font-weight: 800;
  border-radius: 2px; letter-spacing: .5px;
}
.box-3d::after {
  content: ""; position: absolute;
  top: 8%; left: 10%; right: 10%; height: 4px;
  background: rgba(0,0,0,.15);
}
.box-3d-1 { width: 72px; height: 110px; }
.box-3d-2 { width: 72px; height: 88px; }
.box-3d-3 { width: 72px; height: 58px; }

.box-label {
  background: var(--soft); color: var(--primary-color);
  padding: 7px 16px; border-radius: 10px;
  font-weight: 700; font-size: 13px;
  display: inline-block;
  transition: all .2s;
}
.box-card.selected .box-label {
  background: var(--primary-color); color: white;
}
.box-code {
  font-size: 10px; color: var(--muted);
  margin-top: 6px; text-transform: uppercase; letter-spacing: .5px;
}
.box-dim {
  font-size: 11px; color: var(--muted);
  margin-top: 4px;
}

/* ========== REWARD / HADIAH SELECTOR ========== */
.reward-section-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.reward-section-header h6 { margin: 0; }
.reward-section-header .badge-gratis {
  background: var(--primary-color); color: white;
  padding: 3px 12px; border-radius: 14px;
  font-size: 11px; font-weight: 700;
  letter-spacing: .3px;
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  background: #f8f9fa;
  padding: 12px;
  border-radius: 14px;
  margin-bottom: 10px;
}
.reward-card {
  position: relative;
  background: white;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 12px 8px 10px;
  cursor: pointer;
  text-align: center;
  transition: all .2s;
  margin: 0;
  display: block;
}
.reward-card:hover { border-color: var(--primary-color); transform: translateY(-2px); }
.reward-card input[type=radio] { display: none; }
.reward-card.selected {
  border-color: var(--primary-color);
  box-shadow: 0 2px 10px rgba(229,38,87,.18);
}
.reward-card .reward-check {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary-color); color: white;
  align-items: center; justify-content: center;
  font-size: 13px; font-weight: bold;
  display: none;
}
.reward-card.selected .reward-check { display: flex; }

.reward-img-wrap {
  width: 64px; height: 64px;
  background: #f3f4f6;
  border-radius: 12px;
  margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.reward-img-wrap img { max-width: 80%; max-height: 80%; object-fit: contain; }
.reward-img-wrap i { font-size: 28px; color: var(--primary-color); }

.reward-name {
  font-size: 12px; font-weight: 600; color: #333;
  margin-bottom: 2px;
  line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reward-price {
  font-size: 11px; color: var(--primary-color); font-weight: 700;
}

.reward-selected-banner {
  background: #fff5f7;
  border: 2px solid var(--primary-color);
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 8px;
  align-items: center;
  gap: 12px;
  display: none;
}
.reward-selected-banner.show { display: flex; }
.reward-selected-banner .mini-img {
  width: 40px; height: 40px; border-radius: 8px;
  background: white;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.reward-selected-banner .mini-img img { max-width: 85%; max-height: 85%; object-fit: contain; }
.reward-selected-banner .mini-img i { font-size: 20px; color: var(--primary-color); }
.reward-selected-banner .badge-selected {
  background: var(--primary-color); color: white;
  padding: 5px 11px; border-radius: 16px;
  font-size: 11px; font-weight: 700;
  white-space: nowrap;
}
.reward-selected-banner .reward-title {
  flex: 1; font-weight: 600; font-size: 14px;
}
.reward-selected-banner .reward-price-strike {
  color: var(--primary-color); font-weight: 700;
  text-decoration: line-through;
}

@media (max-width: 576px) {
  .box-selector-grid { gap: 8px; }
  .box-card { padding: 14px 8px 12px; }
  .box-img-wrap { height: 105px; margin-bottom: 10px; }
  .box-label { font-size: 12px; padding: 5px 12px; }
  .box-code { font-size: 9px; }
  .box-dim { font-size: 10px; }
}

/* ========== TIMELINE ========== */
.tracking-timeline { position: relative; padding-left: 22px; }
.tracking-timeline .item { position: relative; padding-bottom: 14px; padding-left: 10px; }
.tracking-timeline .item::before {
  content: ""; position: absolute; left: -18px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary-color); border: 2px solid white;
  box-shadow: 0 0 0 2px var(--primary-color);
}
.tracking-timeline .item::after {
  content: ""; position: absolute; left: -13px; top: 20px; bottom: -2px;
  width: 2px; background: #eee;
}
.tracking-timeline .item:last-child::after { display: none; }

/* ========== STEP PILLS ========== */
.step-pill {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: #e5e7eb; color: #999; font-weight: 700;
}
.step-pill.active { background: var(--primary-color); color: white; }

/* ========== BOTTOM NAVIGATION ========== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: white;
  padding: 10px 0 6px 0;
  box-shadow: 0 -2px 20px rgba(0,0,0,.08);
  z-index: 1000;
  border-radius: 22px 22px 0 0;
}
.nav-container {
  display: flex; justify-content: space-around; align-items: center;
  max-width: 600px; margin: 0 auto;
  padding: 0 14px; position: relative;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-decoration: none; color: #999; font-size: 10px; font-weight: 600;
  flex: 1; padding: 4px 0;
  transition: color .2s;
}
.nav-item i { font-size: 20px; }
.nav-item.active, .nav-item:hover { color: var(--primary-color); }
.nav-item.center { position: relative; margin-top: -28px; }
.nav-item.center .center-fab {
  width: 58px; height: 58px;
  background: linear-gradient(135deg, var(--primary-color), #ff4d7a);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 26px;
  border: 5px solid #fff;
  box-shadow: 0 4px 14px rgba(229,38,87,.4);
  transition: transform .3s;
}
.nav-item.center:hover .center-fab { transform: scale(1.08); }
.nav-item.center span { margin-top: 3px; color: var(--primary-color); }

/* ========== AUTH PAGES (standalone, no layout) ========== */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  padding: 30px 16px;
  display: flex; align-items: center; justify-content: center;
}
.auth-card {
  background: white;
  border-radius: 24px;
  max-width: 440px; width: 100%;
  padding: 32px 26px;
  box-shadow: 0 10px 40px rgba(0,0,0,.15);
}
.auth-logo {
  text-align: center; margin-bottom: 20px;
}
.auth-logo .logo-box {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border-radius: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 32px;
  margin-bottom: 12px;
}
.auth-logo h1 { font-size: 20px; font-weight: 800; color: var(--primary-color); margin: 0; }
.auth-logo p { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ========== LANDING HERO ========== */
.landing-hero {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  padding: 60px 20px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.landing-hero::after {
  content: ''; position: absolute; bottom: -1px; left: 0; right: 0;
  height: 40px;
  background: var(--bg);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.landing-hero h1 { font-size: 32px; font-weight: 800; margin-bottom: 12px; }
.landing-hero p { font-size: 15px; opacity: .95; max-width: 500px; margin: 0 auto 24px; }
.landing-hero .hero-emoji { font-size: 70px; margin-bottom: 16px; display: block; }

/* ========== FLASH / ALERTS ========== */
.alert {
  border: 0; border-radius: 12px; font-size: 13px; padding: 12px 16px;
}
.alert-success { background: #d1e7dd; color: #0f5132; }
.alert-danger  { background: #f8d7da; color: #842029; }
.alert-warning { background: #fff3cd; color: #856404; }
.alert-info    { background: #cff4fc; color: #055160; }

/* ========== RESPONSIVE ========== */
@media (max-width: 576px) {
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-card h3 { font-size: 17px; }
  .landing-hero h1 { font-size: 26px; }
  .stat-value { font-size: 18px; }
}
@media (min-width: 992px) {
  body.has-bottomnav { padding-bottom: 30px; }
  .bottom-nav { display: none; }
}

/* Tighter mobile top-header */
@media (max-width: 576px) {
  body.has-topnav { padding-top: 128px; }
  .brand-title { font-size: 17px; }
  .brand-title .logo { width: 28px; height: 28px; font-size: 15px; }
  .header-chip { padding: 5px 10px; font-size: 11px; }
  .app-container { padding: 14px 12px 16px; }
}

/* print: hide nav */
@media print {
  .top-header, .bottom-nav { display: none !important; }
  body { padding: 0 !important; }
}