/* ── BASE ── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: Poppins, sans-serif;
  background: var(--bg-primary);
  overflow: hidden;
  color: var(--text-primary);
  transition: background 0.3s ease, color 0.3s ease;
}

@supports (padding-top: env(safe-area-inset-top)) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

#app {
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
  scroll-behavior: smooth;
}

/* ── VIEWS ── */
.view {
  display: none;
  width: 100%;
  height: var(--app-height, 100dvh);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 100px;
}
.view.active { display: block; }

/* PULL TO REFRESH */
#pullRefreshIndicator {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 9999;
  transform: translateY(-60px);
  transition: none;
}
#ptrCard { position: relative; }
#ptrIcon {
  position: absolute;
  top: 49%;
  left: 50%;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
}
#ptrCard {
  margin-top: 12px;
  width: 39px;
  height: 39px;
  border-radius: 50%;
  background: var(--bg-card);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
#ptrCard svg {
  position: absolute;
  top: 2px; left: 2px;
  width: 35px; height: 35px;
}
#ptrCard svg circle {
  fill: none;
  stroke: var(--brand-primary);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transform-origin: center;
  transform: rotate(-90deg);
  transition: stroke-dashoffset 0.1s;
}
#pullRefreshIndicator.ptr-show { transform: translateY(0px); }
#pullRefreshIndicator.ptr-loading svg circle {
  animation: ptr-spin 0.7s linear infinite;
  stroke-dashoffset: 56;
}
@keyframes ptr-spin {
  from { transform: rotate(-90deg); }
  to   { transform: rotate(270deg); }
}

/* VIEW TRANSITION ANIMATIONS */
:root {
  --anim-navbar-duration: .45s;
  --anim-navbar-easing:   ease;
  --anim-direct-duration: .48s;
  --anim-direct-easing:   cubic-bezier(.4,0,.2,1);
  --anim-back-duration:   .46s;
  --anim-back-easing:     cubic-bezier(.4,0,.2,1);
}
.view.anim-navbar,
.view.anim-direct {
  animation: viewFade var(--anim-navbar-duration, .25s) var(--anim-navbar-easing, ease) both;
}
.view.anim-back {
  animation: viewZoomOut var(--anim-back-duration, .26s) var(--anim-back-easing, cubic-bezier(.4,0,.2,1)) both;
}
@keyframes viewFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes viewZoomOut { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: scale(1); } }
.no-anim *, .no-anim *::before, .no-anim *::after {
  animation-duration: 0.001ms !important;
  animation-delay: 0ms !important;
  transition-duration: 0.001ms !important;
  transition-delay: 0ms !important;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, .title, .heading { color: var(--text-heading); transition: color 0.3s ease; }
p, .subtitle, .description { color: var(--text-secondary); transition: color 0.3s ease; }
.text-muted { color: var(--text-muted); }

/* ── CARDS ── */
.page, .card, .panel, .modal-content, .popup-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  box-shadow: 0 4px 20px var(--shadow-color);
  border-radius: 16px;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.list-item, .menu-item {
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s ease, border-color 0.3s ease;
}
.list-item:hover, .menu-item:hover { background: var(--bg-hover); }

/* ── FORMS ── */
input, textarea, select, .input-field {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  width: 100%;
  outline: none;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--text-muted); }

/* ── BUTTONS ── */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--text-inverse);
  box-shadow: 0 4px 16px var(--accent-glow);
  border: none;
  border-radius: 12px;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  width: 100%;
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  width: 100%;
  cursor: pointer;
  transition: all 0.3s ease;
}

/* ── BADGES & STATUS ── */
.status-success { color: var(--success); background: var(--success-bg); }
.status-warning { color: var(--warning); background: var(--warning-bg); }
.status-danger  { color: var(--danger);  background: var(--danger-bg); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 0; }

/* ── OVERLAY ── */
.overlay, .backdrop { background: rgba(0,0,0,0.7); }

/* ── TOGGLE SWITCH ── */
.toggle-track {
  width: 44px; height: 26px;
  border-radius: 999px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  position: relative;
  cursor: pointer;
  transition: background 0.25s ease;
  flex-shrink: 0;
}
.toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.25s cubic-bezier(.4,0,.2,1);
}
.toggle-track.on .toggle-thumb { transform: translateX(18px); }

/* ============================================
   NAVBAR BOTTOM (FAB curve)
   ============================================ */
.navbar-bottom {
  position: fixed;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 80px;
  z-index: 999;
  transition: transform .35s ease, opacity .25s ease;
  will-change: transform;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.navbar-bottom.hide { transform: translateY(120%); opacity: 0; pointer-events: none; }

.nav-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 -4px 16px var(--nav-color-shadow));
}
.nav-bg path {
  fill: var(--nav-color);
  filter: drop-shadow(0 -2px 0 var(--bg-secondary));
  transition: d 0.4s cubic-bezier(.34, 1.2, .64, 1);
}

.nav-fab {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--nav-color);
  border: 4px solid var(--nav-fab-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  box-shadow: 0 4px 16px var(--nav-color-shadow);
  transition: left .4s cubic-bezier(.34, 1.3, .64, 1);
  z-index: 2;
  pointer-events: none;
}

.nav-items {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding-bottom: 10px;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  background: none;
  border: none;
  transition: color .25s ease;
  z-index: 1;
  padding-bottom: 2px;
}
.nav-item i { font-size: 20px; color: rgba(255,255,255,0.6); transition: color .25s ease; }
.nav-item span { font-size: 10px; font-weight: 500; letter-spacing: 0.2px; }
.nav-placeholder { display: block; height: 22px; }
.nav-item.active { color: #fff; font-weight: 700; }
.nav-item.active i { color: #fff; }
.nav-item:active i { transform: scale(0.88); }

@keyframes iconPop {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes labelIn {
  0%   { opacity: 0; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}
.nav-fab.is-moving { animation: fabBounce .45s cubic-bezier(.34, 1.5, .64, 1) forwards; }
@keyframes fabBounce {
  0%   { transform: translateX(-50%) scale(1); }
  30%  { transform: translateX(-50%) scale(0.88); }
  65%  { transform: translateX(-50%) scale(1.1); }
  100% { transform: translateX(-50%) scale(1); }
}
.nav-fab i.icon-anim { animation: iconPop .35s cubic-bezier(.34, 1.4, .64, 1) forwards; }
.nav-item.active span { animation: labelIn .3s ease forwards; }

/* ── AKUN NONAKTIF ── */
.nonaktif-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 999999;
  display: flex; align-items: center; justify-content: center;
}
.nonaktif-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 28px 24px 24px;
  width: 88%; max-width: 340px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center;
}
.nonaktif-icon { font-size: 40px; }
.nonaktif-title { font-size: 18px; font-weight: 800; color: var(--text-heading); }
.nonaktif-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.nonaktif-btn {
  width: 100%; height: 44px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff; font-size: 15px; font-weight: 700; margin-top: 6px; cursor: pointer;
}

/* ── SPINNER & EMPTY STATE (dipakai semua view) ── */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 24px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; color: var(--text-muted); padding: 40px 12px; font-size: 14px; }
.section-title {
  font-size: 13px; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.4px; margin: 4px 0 10px;
}
