
/* ── 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);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Safe area iOS & Android */
@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);
  overflow: hidden;
  padding-bottom: 0;
}

.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 {
  margin-top: 12px;
  width: 39px;
  height: 39px;
  border-radius: 50%;
  background: #F7F3EE;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
#ptrCard img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  position: relative;
  z-index: 1;
}
#ptrCard svg {
  position: absolute;
  top: 2px; left: 2px;
  width: 35px; height: 35px;
}
#ptrCard svg circle {
  fill: none;
  stroke: #b3874f;
  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); }
}

: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);
}

/* NAVBAR → fade */
.view.anim-navbar {
  animation: viewFade
    var(--anim-navbar-duration, .25s)
    var(--anim-navbar-easing,   ease)
    both;
}

/* DIRECT → zoom in */
.view.anim-direct {
  animation: viewFade
    var(--anim-navbar-duration, .25s)
    var(--anim-navbar-easing,   ease)
    both;
}

/* BACK → zoom out */
.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 viewZoomIn {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes viewZoomOut {
  from { opacity: 0; transform: scale(1.04); }
  to   { opacity: 1; transform: scale(1); }
}
/* Animasi OFF */
.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 & CONTAINERS ── */
.page,
.card,
.panel,
.modal-content,
.popup-content,
.dropdown-menu,
.users-card,
.calendar-card,
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  box-shadow: 0 4px 20px var(--shadow-color);
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.list-item,
.menu-item,
.profil-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,
.profil-menu-item:hover {
  background: var(--bg-hover);
}

/* ── HEADER ── */
.header,
.navbar-top {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-bottom: 1px solid var(--border-color);
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* ── FORMS & INPUTS ── */
input,
textarea,
select,
.input-field {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

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);
  transition: all 0.3s ease;
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

/* ── TABLES ── */
table {
  border-color: var(--border-color);
}

th {
  background: var(--bg-secondary);
  color: var(--text-heading);
  border-color: var(--border-color);
}

td {
  border-color: var(--border-color);
}

tr:nth-child(even) {
  background: var(--bg-hover);
}

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


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

/* ── BADGES & STATUS ── */
.badge {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.status-success {
  color: var(--success);
  background: var(--success-bg);
}

.status-warning {
  color: var(--warning);
}

.status-danger {
  color: var(--danger);
}

/* ── DIVIDER & LINKS ── */
hr,
.divider {
  border-color: var(--border-color);
}

a {
  color: var(--accent);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-light);
}

/* ── TOGGLE SWITCH ── */
.toggle-track {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
}

.toggle-thumb {
  background: var(--accent);
}

/* ── PROFIL VIEW ── */
.profil-hero {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
  transition: background 0.3s ease;
}

.profil-avatar {
  background: var(--accent);
  color: var(--text-inverse);
}

/* ============================================
   NAVBAR BOTTOM
   ============================================ */
.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: 12.5%;
  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 container */
.nav-items {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding-bottom: 10px;
}

/* Nav item */
.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;
  -webkit-tap-highlight-color: transparent;
  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;
}

/* Placeholder tinggi untuk item active (FAB menutupi icon) */
.nav-placeholder {
  display: block;
  height: 22px;
}

/* Active state */
.nav-item.active {
  color: #fff;
  font-weight: 700;
}

.nav-item.active i {
  color: #fff;
}

/* Press feedback */
.nav-item:active i {
  transform: scale(0.88);
}

/* Sembunyikan indicator lama */
.nav-indicator {
  display: none;
}

/* ============================================
   NAVBAR ANIMATIONS
   ============================================ */

/* FAB masuk pertama kali */
@keyframes fabIn {
  0%   { transform: translateX(-50%) scale(0.5); opacity: 0; }
  70%  { transform: translateX(-50%) scale(1.08); opacity: 1; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* Icon di FAB ganti */
@keyframes iconPop {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Label fade + slide up */
@keyframes labelIn {
  0%   { opacity: 0; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Icon non-aktif saat item diklik */
@keyframes iconFadeOut {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.7); }
}

/* FAB bounce saat pindah */
.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;
}

.nav-item span {
  opacity: 1;
}
