:root {
  --bg: #070912;
  --panel: rgba(20, 24, 40, 0.62);
  --panel-brd: rgba(255, 255, 255, 0.09);
  --text: #eef1f8;
  --muted: #98a1b8;
  --brand: #6d8bff;
  --brand2: #8b5cf6;
  --ok: #3ecf8e;
  --err: #ff6b81;
  --radius: 20px;
}

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

html, body { height: 100%; }

body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  filter: blur(60px);
  opacity: 0.75;
}
.blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}
.b1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle at 30% 30%, #4f6bff, transparent 70%);
  top: -140px; left: -120px;
  animation: drift1 22s ease-in-out infinite;
}
.b2 {
  width: 480px; height: 480px;
  background: radial-gradient(circle at 60% 40%, #a855f7, transparent 70%);
  bottom: -160px; right: -100px;
  animation: drift2 26s ease-in-out infinite;
}
.b3 {
  width: 380px; height: 380px;
  background: radial-gradient(circle at 50% 50%, #06b6d4, transparent 70%);
  top: 40%; left: 55%;
  animation: drift3 30s ease-in-out infinite;
}
@keyframes drift1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(80px,60px)} }
@keyframes drift2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-70px,-50px)} }
@keyframes drift3 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-60px,40px)} }

/* ---------- Auth layout ---------- */
body.auth {
  display: grid;
  place-items: center;
  padding: 24px;
  min-height: 100svh;
}

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 34px 30px 26px;
  background: var(--panel);
  border: 1px solid var(--panel-brd);
  border-radius: 26px;
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.06);
  animation: rise 0.6s cubic-bezier(0.2,0.8,0.2,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }

.brand { display: flex; align-items: center; gap: 14px; }
.brand h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.brand.small h1 { font-size: 17px; }
.tag { color: var(--muted); font-size: 12.5px; margin-top: 2px; letter-spacing: 0.02em; }

.logo {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: grid; place-items: center;
  color: #dfe6ff;
  background: linear-gradient(150deg, var(--brand), var(--brand2));
  box-shadow: 0 8px 22px -6px rgba(109,139,255,0.7);
}
.brand.small .logo { width: 34px; height: 34px; border-radius: 10px; }

.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 26px 0 20px;
  color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em;
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--panel-brd), transparent);
}

.lede { color: var(--muted); font-size: 14.5px; line-height: 1.55; margin-bottom: 20px; }

.stack { display: flex; flex-direction: column; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font: inherit; font-weight: 700; font-size: 15px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s;
  color: #fff;
}
.btn:active { transform: scale(0.98); }
.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 12px 30px -10px rgba(109,139,255,0.8);
}
.btn.primary:hover { box-shadow: 0 16px 38px -10px rgba(139,92,246,0.9); transform: translateY(-1px); }
.btn.ghost {
  background: rgba(255,255,255,0.05);
  border-color: var(--panel-brd);
  color: #cfd6ea; font-weight: 600;
}
.btn.ghost:hover { background: rgba(255,255,255,0.09); }
.btn.sm { padding: 9px 14px; font-size: 13px; border-radius: 11px; }

.hint { color: var(--muted); font-size: 12.5px; margin-top: 14px; text-align: center; }
.hint b { color: #cdd5ea; }

.otp-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.otp-input {
  width: 100%;
  text-align: center;
  font: inherit; font-weight: 700;
  font-size: 30px;
  letter-spacing: 0.5em;
  padding: 16px 10px 16px 0.5em;
  color: var(--text);
  background: rgba(0,0,0,0.35);
  border: 1.5px solid var(--panel-brd);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.otp-input::placeholder { color: #4a5268; letter-spacing: 0.4em; }
.otp-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(109,139,255,0.18); }

.resend { margin-top: 12px; }
.resend .btn { width: 100%; }

.alert {
  font-size: 13.5px;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 8px;
  border: 1px solid;
}
.alert.err { color: #ffc2cb; background: rgba(255,107,129,0.12); border-color: rgba(255,107,129,0.35); }
.alert.ok { color: #b8f5d8; background: rgba(62,207,142,0.12); border-color: rgba(62,207,142,0.35); }

.foot {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 24px;
  color: var(--muted); font-size: 11.5px;
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(62,207,142,0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(62,207,142,0.55); }
  70% { box-shadow: 0 0 0 8px rgba(62,207,142,0); }
  100% { box-shadow: 0 0 0 0 rgba(62,207,142,0); }
}

/* ---------- Dashboard ---------- */
body.app { min-height: 100svh; }

.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 26px;
  border-bottom: 1px solid var(--panel-brd);
  background: rgba(10,12,22,0.55);
  backdrop-filter: blur(16px);
}

.dash {
  position: relative; z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 26px 60px;
  display: flex; flex-direction: column; gap: 26px;
}
.eyebrow { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 6px; }
.welcome h2 { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
.muted { color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.welcome .muted { margin-top: 6px; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.stat {
  padding: 18px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--panel-brd);
  backdrop-filter: blur(16px);
  display: flex; flex-direction: column; gap: 8px;
}
.stat .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; }
.stat .v { font-size: 19px; font-weight: 700; }
.ok-text { color: var(--ok); }

.panel {
  padding: 26px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--panel-brd);
  backdrop-filter: blur(16px);
}
.panel h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.panel .muted { margin-bottom: 18px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}
.tile {
  padding: 22px 18px;
  border-radius: 14px;
  background: rgba(0,0,0,0.25);
  border: 1px dashed var(--panel-brd);
  font-weight: 700; font-size: 15px;
  display: flex; flex-direction: column; gap: 4px;
  color: #cdd5ea;
}
.tile span { font-size: 12px; font-weight: 500; color: var(--muted); }

@media (max-width: 520px) {
  .card { padding: 28px 22px 22px; }
  .welcome h2 { font-size: 27px; }
  .otp-input { font-size: 26px; }
}

/* ---------- Admin v2 ---------- */
.beta {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  vertical-align: middle; margin-left: 6px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  padding: 3px 8px; border-radius: 999px;
}
.tabs { display: flex; gap: 6px; }
.tab {
  font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--muted); background: transparent;
  border: 1px solid transparent; border-radius: 10px;
  padding: 8px 14px; cursor: pointer; transition: 0.15s;
}
.tab:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.tab.active { color: #fff; background: rgba(109,139,255,0.18); border-color: rgba(109,139,255,0.4); }

.flex-between { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.live-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--panel-brd); border-radius: 999px;
  padding: 6px 12px; background: rgba(0,0,0,0.25);
}
.sub { margin: 26px 0 12px; font-size: 16px; font-weight: 700; }

.renters { display: flex; flex-direction: column; gap: 12px; }
.renters.small .renter { opacity: 0.65; }
.renter {
  display: flex; gap: 16px; align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--panel-brd);
  backdrop-filter: blur(16px);
}
.rimg {
  width: 64px; height: 64px; border-radius: 12px; object-fit: cover;
  background: rgba(0,0,0,0.35); border: 1px solid var(--panel-brd);
}
.rimg.none { display: grid; place-items: center; color: var(--muted); font-size: 18px; }
.rinfo { flex: 1; min-width: 0; }
.rrow { font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rsub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.rt { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.timer { font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.run-text { color: #9db4ff; }
.pause-text { color: #ffd28a; }
.muted-timer { color: var(--muted); font-size: 14px; }
.rbtns { display: flex; gap: 6px; }

.badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em;
  padding: 3px 9px; border-radius: 999px; text-transform: uppercase;
}
.badge.wait { color: #cdd5ea; background: rgba(255,255,255,0.1); }
.badge.run { color: #9db4ff; background: rgba(109,139,255,0.16); }
.badge.pause { color: #ffd28a; background: rgba(255,200,90,0.14); }
.badge.stop { color: #ff9aa8; background: rgba(255,107,129,0.14); }

.btn.warn { background: linear-gradient(135deg, #b8860b, #d97706); }
.btn.ok { background: linear-gradient(135deg, #18935f, var(--ok)); }
.btn.danger { background: linear-gradient(135deg, #b91c48, #e11d48); }

.pkgs { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.pkg {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--panel-brd);
}
.pkg.off { opacity: 0.5; }
.pkg > div:first-child { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.pkg .sub { margin: 0; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.price { font-weight: 800; font-size: 17px; color: #9db4ff; white-space: nowrap; }

.pkg-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.pkg-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.pkg-form input {
  font: inherit; color: var(--text);
  background: rgba(0,0,0,0.35); border: 1px solid var(--panel-brd);
  border-radius: 10px; padding: 10px 12px; min-width: 110px; outline: none;
}
.pkg-form input:focus { border-color: var(--brand); }
.pkg-form .chk { flex-direction: row; align-items: center; gap: 8px; }
.panel.narrow { max-width: 560px; }

.pin-form { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.pin-form input {
  font: inherit; font-weight: 700; letter-spacing: 0.3em; color: var(--text);
  background: rgba(0,0,0,0.35); border: 1px solid var(--panel-brd);
  border-radius: 10px; padding: 11px 16px; width: 180px; outline: none; text-align: center;
}
.pin-form input:focus { border-color: var(--brand); }
.hint.left { text-align: left; margin-top: 12px; }

@media (max-width: 720px) {
  .tabs { order: 3; width: 100%; }
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .renter { flex-wrap: wrap; }
  .rt { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; }
}

/* ---------- toast notifikasi ---------- */
.toast-box {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}
.toast {
  padding: 13px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(109,139,255,0.95), rgba(139,92,246,0.95));
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 16px 40px -12px rgba(0,0,0,0.7);
  animation: toastIn 0.35s cubic-bezier(0.2,0.8,0.2,1) both;
}
.toast.out { animation: toastOut 0.4s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }
.ext-line { color: #9db4ff; }

/* ---------- lightbox foto ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
  padding: 24px;
}
.lightbox.show { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 14px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.9);
  animation: rise 0.3s ease both;
}

/* ---------- sales / kalender ---------- */
.sales-quick { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.sales-grid { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.cal-panel { padding: 18px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-head b { font-size: 15px; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.cal-dow span { text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day {
  aspect-ratio: 1;
  border: none;
  border-radius: 9px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: 0.12s;
}
.cal-day:hover { background: rgba(109,139,255,0.25); }
.cal-day.in-range { background: rgba(109,139,255,0.18); }
.cal-day.sel { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; font-weight: 700; }
.sales-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.scard {
  padding: 18px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--panel-brd);
  display: flex; flex-direction: column; gap: 8px;
}
.scard .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.scard .v { font-size: 20px; font-weight: 800; }
.sales-days { display: flex; flex-direction: column; gap: 8px; }
.sday {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 13px;
  background: var(--panel); border: 1px solid var(--panel-brd);
}
.sday-date { font-weight: 700; font-size: 14px; min-width: 78px; }
.sday-meta { flex: 1; font-size: 12.5px; color: var(--muted); }
.sday-total { font-weight: 800; color: #9db4ff; }
@media (max-width: 760px) {
  .sales-grid { grid-template-columns: 1fr; }
  .sales-cards { grid-template-columns: repeat(2, 1fr); }
}

.scard .sub2 { font-size: 11.5px; color: var(--muted); }
.scard.cash { border-color: rgba(62,207,142,0.4); }
.scard.cash .v { color: #3ECF8E; }
.scard.qris { border-color: rgba(109,139,255,0.4); }
.scard.qris .v { color: #9DB4FF; }

/* ---------- member ---------- */
.members { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.mem {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--panel-brd);
}
.mem-av {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff; font-weight: 800; font-size: 18px;
}
.mem-info { flex: 1; min-width: 0; }
.mem-name { font-weight: 700; font-size: 15px; }
.mem-id { font-size: 12px; color: var(--muted); margin-top: 3px; }
.mem-stats { text-align: right; }
.mem-hours { font-weight: 800; font-size: 16px; color: #9DB4FF; }
.mem-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* ---------- lacak hp ---------- */
.mem-av.dev { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.dev-row { cursor: pointer; transition: 0.15s; }
.dev-row:hover { border-color: rgba(109,139,255,0.5); background: rgba(109,139,255,0.06); }
.dev-detail { margin-top: 18px; }
.dev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 14px; }
.dev-cell { padding: 12px 14px; border-radius: 12px; background: rgba(0,0,0,0.25); border: 1px solid var(--panel-brd); display: flex; flex-direction: column; gap: 5px; }
.dev-cell .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.dev-cell b { font-size: 14px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px !important; word-break: break-all; }
.dev-loc { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.dev-coord { font-weight: 700; color: #9DB4FF; }
.dev-map { width: 100%; height: 340px; border: 1px solid var(--panel-brd); border-radius: 14px; background: #000; }

.dev-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.dev-addr { font-size: 12.5px; color: var(--muted); line-height: 1.5; max-width: 640px; }
