:root {
  --paper: #FFF6E9;
  --ink: #2B1B10;
  --ink-soft: #6B5541;
  --orange: #E85C0D;
  --orange-deep: #C24A08;
  --orange-soft: #FDE3CE;
  --line: #E8D5B8;
  --red: #C13B3B;
  --green: #2F7A4F;
  --nav-height: 60px;
}

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

html, body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  font-family: "Plus Jakarta Sans", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

/* ---------- Loading (skeleton) ---------- */

.app-loading {
  position: fixed;
  inset: 0;
  background: var(--paper);
  overflow: hidden;
  z-index: 200;
}
.app-loading[hidden] { display: none; }

.skeleton-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px;
}

.skeleton-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.skeleton {
  background: linear-gradient(90deg, var(--orange-soft) 25%, #F7E7D3 37%, var(--orange-soft) 63%);
  background-size: 400% 100%;
  animation: skeleton-shine 1.4s ease infinite;
  border-radius: 10px;
}
@keyframes skeleton-shine {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.skeleton-avatar { width: 38px; height: 38px; border-radius: 10px; }
.skeleton-bell { width: 28px; height: 28px; border-radius: 50%; }
.skeleton-line { height: 12px; }
.skeleton-earning-card { height: 150px; border-radius: 18px; }
.skeleton-order-card { height: 220px; border-radius: 16px; margin-bottom: 14px; }

/* ---------- View container ---------- */

.view-root {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 88px;
}

.view-section { display: none; }
.view-section.active { display: block; }

/* ---------- Bottom nav ---------- */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-around;
  min-height: var(--nav-height);
  padding: 0 4px max(0px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  z-index: 20;
}
.bottom-nav[hidden] { display: none; }
.bottom-nav.bottom-nav-hide { display: none; }

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  padding: 4px 2px;
  cursor: pointer;
  color: var(--ink-soft);
  font-family: "Plus Jakarta Sans", sans-serif;
}
.nav-btn i { font-size: 17px; }
.nav-btn span { font-size: 10.5px; font-weight: 500; }
.nav-btn.active { color: var(--orange); }
.nav-btn.active span { font-weight: 700; }

/* ---------- Komponen bersama ---------- */

.btn-primary {
  width: 100%;
  border: none;
  border-radius: 13px;
  padding: 14px;
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  color: #fff;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  box-shadow: 0 10px 20px -8px rgba(232, 92, 13, 0.55);
}
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }
.btn-primary:active { transform: scale(0.98); }

.global-toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  max-width: 88%;
  text-align: center;
  z-index: 200;
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.4);
}
.global-toast[hidden] { display: none; }
.global-toast.success { background: var(--green); }
.global-toast.error { background: var(--red); }

.perm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 27, 16, 0.5);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.perm-modal-card {
  width: 100%;
  max-width: 320px;
  background: #fff;
  border-radius: 20px;
  padding: 28px 22px 22px;
  text-align: center;
  box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.4);
}
.perm-modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--orange-soft);
  color: var(--orange-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin: 0 auto 14px;
}
.perm-modal-card h3 {
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 8px;
}
.perm-modal-card p {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 20px;
}
.perm-modal-cancel {
  width: 100%;
  border: none;
  background: none;
  color: var(--ink-soft);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  padding: 12px;
  cursor: pointer;
}
