/* index.css — global tokens & shell. Style spesifik per view ada di views/<nama>/<nama>.css */

:root {
  --paper: #FFF6E9;
  --black: #00000;
  --ink: #2B1B10;
  --ink-soft: #6B5541;
  --orange: #E85C0D;
  --orange-deep: #C24A08;
  --orange-soft: #FDE3CE;
  --line: #E8D5B8;
  --red: #C13B3B;
  --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: Poppins, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ---------- Loading ---------- */

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

.app-loading .view-root {
  padding-bottom: 0;
}

/* ---------- Header ---------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--orange);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
}
.app-header[hidden] { display: none; }

.app-header-brand {
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- 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; }

.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 (dipakai di lebih dari 1 view) ---------- */

.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: #2f7a4f; }
.global-toast.error { background: var(--red); }

.global-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 27, 16, 0.45);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.global-confirm-overlay[hidden] { display: none; }

.global-confirm-card {
  width: 100%;
  max-width: 320px;
  background: #fff;
  border-radius: 18px;
  padding: 22px 20px;
  text-align: center;
  box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.4);
}
.global-confirm-message {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14.5px;
  color: var(--ink);
  margin: 0 0 18px;
  line-height: 1.5;
}
.global-confirm-actions {
  display: flex;
  gap: 10px;
}
.global-confirm-cancel,
.global-confirm-ok {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
}
.global-confirm-cancel {
  background: var(--paper);
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
}
.global-confirm-ok {
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  color: #fff;
}
