:root{
  --bg:#090713;
  --panel:rgba(24,19,43,.88);
  --text:#F7F3FF;
  --muted:#AAA1C4;
  --line:rgba(174,133,255,.22);
  --accent:#A855F7;
  --accent2:#8B5CF6;
  --green:#34D399;
  --red:#FB5577;
  --pattern:rgba(168,85,247,.12);
  --shadow:0 12px 35px rgba(0,0,0,.3);
  --shadow-sm:0 5px 18px rgba(139,92,246,.15);
  --font-body:'Outfit',sans-serif;
}

body.dark-mode{
  --bg:#090713;
  --panel:rgba(24,19,43,.88);
  --text:#F7F3FF;
  --muted:#AAA1C4;
  --line:rgba(174,133,255,.22);
  --accent:#A855F7;
  --accent2:#8B5CF6;
  --green:#34D399;
  --red:#FB5577;
  --pattern:rgba(168,85,247,.12);
}

*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{
  font-family:var(--font-body);
  background:
    radial-gradient(ellipse at 10% 0%,rgba(124,58,237,.19),transparent 40%),
    radial-gradient(ellipse at 100% 45%,rgba(168,85,247,.12),transparent 40%),
    var(--bg);
  color:var(--text);
  min-height:100vh;
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
  transition:background .3s,color .3s;
}

.hidden{display:none!important}
button:disabled{opacity:.55;cursor:not-allowed}
button:focus-visible,input:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:3px;
}

.bg-pattern{
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  background-image:radial-gradient(var(--pattern) 1px,transparent 1px);
  background-size:25px 25px;
  mask-image:linear-gradient(to bottom,black,transparent 85%);
}

.topbar{
  height:72px;
  position:fixed;
  z-index:30;
  top:0;left:0;right:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 20px;
  background:rgba(12,9,24,.82);
  backdrop-filter:blur(22px);
  -webkit-backdrop-filter:blur(22px);
  border-bottom:1px solid var(--line);
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  font-weight:800;
  font-size:17px;
  letter-spacing:.3px;
}

.brand-mark{
  height:42px;
  width:42px;
  border-radius:13px;
  border:1px solid rgba(192,132,252,.45);
  overflow:hidden;
  background:var(--panel);
  box-shadow:0 0 20px rgba(168,85,247,.25);
}

.brand-mark img{width:100%;height:100%;object-fit:cover}

.theme-toggle{
  display:flex;
  align-items:center;
  justify-content:center;
  width:40px;height:40px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(168,85,247,.1);
  color:var(--text);
  cursor:pointer;
  margin-right:8px;
  transition:.25s;
}

.theme-toggle:active{transform:scale(.94)}
.theme-toggle svg{width:20px;height:20px;fill:currentColor}

.btn{
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px 20px;
  font-family:var(--font-body);
  font-weight:700;
  font-size:14px;
  transition:.2s ease;
  background:rgba(255,255,255,.05);
  color:var(--text);
  cursor:pointer;
  display:inline-flex;
  justify-content:center;
  align-items:center;
  gap:8px;
  text-decoration:none;
}

.btn:active{transform:scale(.97)}

.btn-main{
  background:linear-gradient(135deg,#A855F7,#6D28D9);
  color:white;
  border:1px solid rgba(216,180,254,.35);
  box-shadow:0 5px 20px rgba(139,92,246,.28);
}

.btn-main:hover{
  box-shadow:0 7px 26px rgba(168,85,247,.45);
  transform:translateY(-2px);
}

.btn-dark{
  background:linear-gradient(135deg,#7C3AED,#4C1D95);
  color:#fff;
  border-color:rgba(192,132,252,.3);
}

.btn-soft{background:rgba(255,255,255,.06)}
.btn-danger{background:#BE3455;color:#fff;border-color:#FB7185}
.btn-wa{background:#16A34A;color:#fff}
.btn-sm{padding:7px 12px;font-size:12px}
.full{width:100%}

main{
  width:min(100%,520px);
  margin:0 auto;
  padding:100px 20px calc(90px + 30px);
}

.page{display:none;animation:fadeIn .35s ease forwards}
.page.active{display:block}

@keyframes fadeIn{
  from{opacity:0;transform:translateY(12px)}
  to{opacity:1;transform:translateY(0)}
}

.eyebrow{
  font-size:11px;
  font-weight:700;
  letter-spacing:1px;
  text-transform:uppercase;
  background:rgba(168,85,247,.14);
  color:#D8B4FE;
  padding:7px 12px;
  border:1px solid rgba(168,85,247,.3);
  border-radius:99px;
  display:inline-block;
  margin-bottom:15px;
}

.page-head{margin:0 0 25px}

.page-head h1{
  font-size:32px;
  font-weight:800;
  letter-spacing:-1px;
  line-height:1.1;
}

.sub{
  color:var(--muted);
  font-size:14px;
  line-height:1.7;
  margin-top:9px;
}

.card{
  background:linear-gradient(145deg,rgba(35,26,60,.92),rgba(19,15,34,.94));
  border:1px solid var(--line);
  border-radius:20px;
  padding:23px;
  box-shadow:var(--shadow);
  margin-bottom:24px;
  backdrop-filter:blur(15px);
}

.card-title{
  font-size:17px;
  font-weight:800;
  margin-bottom:17px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.welcome{margin:10px 0 28px}

.welcome h1{
  font-size:39px;
  line-height:1.12;
  letter-spacing:-1.5px;
  font-weight:800;
}

.welcome h1 span{
  background:linear-gradient(90deg,#C084FC,#8B5CF6,#E879F9);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}

.welcome p{
  font-size:14px;
  color:var(--muted);
  margin-top:12px;
  max-width:330px;
}

.balance-card{
  position:relative;
  overflow:hidden;
  background:
    radial-gradient(circle at 90% 10%,rgba(255,255,255,.2),transparent 30%),
    linear-gradient(135deg,#9333EA,#6D28D9 55%,#4C1D95);
  border:1px solid rgba(216,180,254,.4);
  border-radius:22px;
  padding:25px;
  box-shadow:0 12px 35px rgba(109,40,217,.28);
  margin-bottom:28px;
  color:white;
}

.balance-card:after{
  content:"";
  position:absolute;
  width:170px;height:170px;
  right:-60px;bottom:-90px;
  border:1px solid rgba(255,255,255,.15);
  border-radius:50%;
  box-shadow:0 0 0 20px rgba(255,255,255,.035),0 0 0 40px rgba(255,255,255,.025);
  pointer-events:none;
}

.balance-label{
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:1px;
  margin-bottom:12px;
  display:flex;
  align-items:center;
  gap:7px;
  color:#E9D5FF;
}

.balance-amount{
  font-size:39px;
  font-weight:800;
  letter-spacing:-1px;
  line-height:1.1;
  color:#fff;
  overflow-wrap:anywhere;
}

.balance-actions{display:flex;gap:12px;margin-top:23px}
.balance-actions .btn{flex:1;padding:11px;background:rgba(255,255,255,.13);border-color:rgba(255,255,255,.25);color:white;backdrop-filter:blur(10px)}

.menu-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
  margin-bottom:30px;
}

.menu-item{
  background:rgba(28,22,48,.8);
  border:1px solid var(--line);
  border-radius:17px;
  padding:17px 8px;
  text-align:center;
  box-shadow:0 7px 20px rgba(0,0,0,.16);
  transition:.2s;
  cursor:pointer;
}

.menu-item:active{transform:scale(.96)}

.menu-icon{
  width:43px;height:43px;
  margin:0 auto 11px;
  border-radius:14px;
  background:linear-gradient(145deg,rgba(168,85,247,.25),rgba(109,40,217,.12));
  border:1px solid rgba(192,132,252,.3);
  display:grid;
  place-items:center;
}

.menu-icon svg{
  width:20px;height:20px;
  stroke:#D8B4FE;
  stroke-width:2.3;
}

.menu-item b{font-size:12px;display:block;font-weight:700}

.product{
  border:1px solid var(--line);
  border-radius:21px;
  padding:20px;
  background:linear-gradient(145deg,rgba(34,26,57,.94),rgba(19,15,34,.94));
  box-shadow:var(--shadow);
  margin-bottom:20px;
  position:relative;
  overflow:visible;
}

.product-top{
  display:flex;
  align-items:center;
  gap:15px;
  margin-bottom:17px;
}

.product-logo{
  height:61px;width:61px;
  flex:0 0 61px;
  border-radius:16px;
  border:1px solid rgba(192,132,252,.35);
  background:#000;
  overflow:hidden;
  box-shadow:0 5px 18px rgba(139,92,246,.18);
}

.product-logo img{width:100%;height:100%;object-fit:cover}

.product-name{font-size:18px;font-weight:800;line-height:1.25}
.product-type{
  font-size:11px;
  font-weight:700;
  color:#C4B5FD;
  margin-top:5px;
  text-transform:uppercase;
  letter-spacing:.8px;
}

.stock{
  position:absolute;
  top:-10px;right:17px;
  background:rgba(16,185,129,.17);
  color:#6EE7B7;
  border:1px solid rgba(52,211,153,.45);
  padding:5px 11px;
  border-radius:99px;
  font-size:10px;
  font-weight:800;
  box-shadow:0 4px 15px rgba(16,185,129,.12);
}

.product-desc{
  font-size:13px;
  color:var(--muted);
  line-height:1.7;
  margin-bottom:19px;
  overflow-wrap:anywhere;
}

.product-bottom{
  border-top:1px solid var(--line);
  padding-top:17px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}

.price{font-size:22px;font-weight:800;color:#E9D5FF}
.price small{font-size:12px;color:var(--muted);font-weight:600}

.field{margin:20px 0}

.field label{
  display:block;
  font-size:13px;
  font-weight:700;
  margin-bottom:9px;
  color:#E9D5FF;
}

.input{
  width:100%;
  height:53px;
  padding:0 15px;
  color:var(--text);
  background:rgba(9,7,19,.7);
  border:1px solid var(--line);
  border-radius:12px;
  outline:none;
  font-family:var(--font-body);
  font-size:15px;
  font-weight:600;
  transition:.2s;
}

.input:focus{
  border-color:#A855F7;
  box-shadow:0 0 0 3px rgba(168,85,247,.13);
}

.input::placeholder{color:#77708D;font-weight:400}

.summary{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:16px;
  border:1px solid rgba(168,85,247,.28);
  background:rgba(139,92,246,.09);
  border-radius:13px;
  margin:20px 0;
}

.summary span{font-size:13px;font-weight:700;color:var(--muted)}
.summary strong{font-size:19px;font-weight:800;color:#D8B4FE}

.qty{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px;
  background:rgba(9,7,19,.7);
  border:1px solid var(--line);
  border-radius:12px;
}

.qty button{
  height:39px;width:42px;
  border:1px solid var(--line);
  border-radius:9px;
  background:rgba(168,85,247,.15);
  color:#E9D5FF;
  font-size:20px;
  font-weight:800;
  cursor:pointer;
}

.qty input{
  width:55px;
  text-align:center;
  border:0;
  background:none;
  color:var(--text);
  font-size:18px;
  font-weight:800;
  outline:0;
}

.profile{text-align:center;padding:20px 0;margin-bottom:20px}
.avatar-wrapper{position:relative;width:105px;height:105px;margin:0 auto 18px}

.avatar{
  width:100%;height:100%;
  border-radius:25px;
  border:2px solid rgba(192,132,252,.55);
  background:linear-gradient(135deg,#A855F7,#4C1D95);
  color:#fff;
  display:grid;
  place-items:center;
  font-size:40px;
  font-weight:800;
  box-shadow:0 0 30px rgba(168,85,247,.22);
  overflow:hidden;
}

.avatar img{width:100%;height:100%;object-fit:cover}

.avatar-edit{
  position:absolute;
  bottom:-7px;right:-7px;
  width:36px;height:36px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#2B1B49;
  color:white;
  display:grid;
  place-items:center;
  cursor:pointer;
  box-shadow:var(--shadow-sm);
}

.avatar-edit:active{transform:scale(.94)}
.profile h2{font-size:23px;font-weight:800}
.profile p{font-size:13px;font-weight:500;color:var(--muted);margin-top:5px}

.list-card{
  border:1px solid var(--line);
  border-radius:19px;
  background:rgba(25,19,43,.82);
  overflow:hidden;
  box-shadow:var(--shadow);
  margin-bottom:24px;
}

.list-row{
  display:flex;
  align-items:center;
  gap:14px;
  padding:16px;
  border-bottom:1px solid var(--line);
}

.list-row:last-child{border-bottom:0}

.row-icon{
  width:42px;height:42px;
  border-radius:13px;
  border:1px solid var(--line);
  background:rgba(168,85,247,.12);
  display:grid;
  place-items:center;
  font-weight:800;
  flex-shrink:0;
}

.row-main{flex:1;min-width:0}
.row-main b{display:block;font-size:14px}
.row-main small{
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-top:4px;
  overflow-wrap:anywhere;
}

.row-end{font-size:14px;font-weight:800;white-space:nowrap}
.row-arrow{color:#C4B5FD;font-weight:800;font-size:20px}

.bottom{
  position:fixed;
  z-index:35;
  bottom:0;left:0;right:0;
  height:calc(77px + env(safe-area-inset-bottom));
  padding:9px 12px calc(9px + env(safe-area-inset-bottom));
  display:none;
  justify-content:space-around;
  background:rgba(13,10,25,.91);
  backdrop-filter:blur(22px);
  -webkit-backdrop-filter:blur(22px);
  border-top:1px solid var(--line);
}

.bottom.show{display:flex}

.nav-item{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  color:#827996;
  font-size:11px;
  font-weight:600;
  background:none;
  border:0;
  padding:7px 17px;
  border-radius:13px;
  transition:.2s;
}

.nav-item svg{width:21px;height:21px;stroke:currentColor;stroke-width:2.2}

.nav-item.active{
  color:#E9D5FF;
  background:rgba(139,92,246,.18);
  border:1px solid rgba(168,85,247,.3);
  box-shadow:0 0 18px rgba(139,92,246,.12);
}

.overlay{
  position:fixed;
  inset:0;
  z-index:60;
  display:none;
  align-items:flex-end;
  justify-content:center;
  background:rgba(4,2,12,.78);
  backdrop-filter:blur(9px);
}

.overlay.show{display:flex;animation:fadeIn .2s}

.sheet{
  width:min(100%,520px);
  max-height:90vh;
  overflow:auto;
  padding:25px;
  border-radius:25px 25px 0 0;
  background:#171126;
  border:1px solid var(--line);
  border-bottom:0;
  box-shadow:0 -15px 50px rgba(0,0,0,.35);
  animation:up .3s cubic-bezier(.16,1,.3,1);
}

@keyframes up{from{transform:translateY(100%)}to{transform:translateY(0)}}

.sheet-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:20px;
}

.sheet-head h2{font-size:22px;font-weight:800}

.close{
  border:1px solid var(--line);
  background:rgba(168,85,247,.12);
  color:var(--text);
  width:37px;height:37px;
  border-radius:11px;
  font-size:21px;
  font-weight:700;
  cursor:pointer;
}

.close:active{transform:scale(.94)}

.switch-auth{text-align:center;font-size:13px;font-weight:600;color:var(--muted);margin-top:20px}

.switch-auth button{
  border:0;
  background:none;
  color:#C084FC;
  font-weight:800;
  cursor:pointer;
  text-decoration:underline;
}

.legal-text{font-size:13px;line-height:1.8;color:var(--text)}
.legal-text h3{font-size:15px;margin:16px 0 8px;color:#D8B4FE}
.legal-text p{margin-bottom:12px;color:var(--muted)}

.toast{
  position:fixed;
  z-index:90;
  left:50%;
  bottom:calc(90px + 20px);
  transform:translate(-50%,20px);
  opacity:0;
  pointer-events:none;
  width:max-content;
  max-width:calc(100% - 40px);
  padding:13px 19px;
  border:1px solid rgba(192,132,252,.35);
  border-radius:13px;
  background:#211735;
  color:var(--text);
  font-size:13px;
  font-weight:700;
  box-shadow:0 8px 30px rgba(0,0,0,.35);
  transition:.3s;
}

.toast.show{opacity:1;transform:translate(-50%,0)}

.public-notif{
  position:fixed;
  bottom:-120px;
  left:50%;
  transform:translateX(-50%);
  background:#211735;
  border:1px solid var(--line);
  border-left:4px solid var(--green);
  padding:13px 17px;
  border-radius:14px;
  display:flex;
  align-items:center;
  gap:12px;
  box-shadow:var(--shadow);
  z-index:200;
  transition:bottom .4s cubic-bezier(.16,1,.3,1);
  width:calc(100% - 40px);
  max-width:400px;
}

.public-notif.show{bottom:100px}
.pn-icon{font-size:23px}
.pn-text{font-size:13px;font-weight:600;line-height:1.5;color:var(--text)}
.pn-text b{color:#C084FC}

.qris-modal{
  display:none;
  position:fixed;
  inset:0;
  z-index:100;
  background:rgba(4,2,12,.88);
  backdrop-filter:blur(10px);
  align-items:center;
  justify-content:center;
  padding:20px;
}

.qris-modal.show{display:flex}

.qris-box{
  background:#1B1430;
  border:1px solid var(--line);
  border-radius:22px;
  padding:23px;
  text-align:center;
  width:100%;
  max-width:380px;
  box-shadow:0 15px 50px rgba(0,0,0,.4);
}

.qris-box img{
  width:100%;
  border-radius:13px;
  border:1px solid var(--line);
  margin:20px 0;
  background:#fff;
}

#adminApp{
  display:none;
  width:min(100%,600px);
  margin:0 auto;
  padding:100px 20px 40px;
}

.admin-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}
.admin-title{font-size:27px;font-weight:800}

.admin-badge{
  background:rgba(251,85,119,.15);
  color:#FDA4AF;
  padding:7px 12px;
  border-radius:9px;
  font-size:11px;
  font-weight:800;
  border:1px solid rgba(251,85,119,.35);
}

.admin-stats{display:grid;grid-template-columns:1fr 1fr;gap:13px;margin-bottom:30px}

.stat-card{
  background:linear-gradient(145deg,rgba(35,26,60,.95),rgba(19,15,34,.95));
  border:1px solid var(--line);
  border-radius:16px;
  padding:18px;
  box-shadow:var(--shadow);
}

.stat-card p{font-size:11px;font-weight:700;color:var(--muted);margin-bottom:9px;text-transform:uppercase}
.stat-card h3{font-size:23px;font-weight:800;color:var(--text);overflow-wrap:anywhere}

.admin-table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
  background:#1B1430;
  border-radius:13px;
  overflow:hidden;
  border:1px solid var(--line);
  box-shadow:var(--shadow);
}

.admin-table th{
  padding:13px 10px;
  border-bottom:1px solid var(--line);
  text-align:left;
  font-size:10px;
  text-transform:uppercase;
  background:#251A3D;
  font-weight:800;
  color:#D8B4FE;
}

.admin-table td{
  padding:13px 10px;
  border-bottom:1px solid var(--line);
  font-weight:600;
  color:var(--text);
}

.notif-item{
  background:rgba(168,85,247,.07);
  border:1px solid var(--line);
  border-radius:11px;
  padding:13px;
  margin-bottom:10px;
  font-size:12px;
  font-weight:600;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  color:var(--text);
}

/* RECEIPT COPY (Viu) */
.v-account-box {
  background: rgba(9,7,19,.5);
  border: 1px dashed var(--line);
  padding: 10px;
  border-radius: 10px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.v-account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-family: var(--mono);
}
.v-account-row span { color: var(--muted); }
.btn-copy-sm {
  background: rgba(168,85,247,.2); color: #E9D5FF; border: 1px solid var(--accent);
  padding: 4px 10px; border-radius: 6px; font-size: 10px; font-weight: 700;
  cursor: pointer; transition: .2s;
}
.btn-copy-sm:active { transform: scale(.95); }

@media(min-width:700px){
  .bottom{
    width:min(100%,520px);
    left:50%;
    transform:translateX(-50%);
    border-left:1px solid var(--line);
    border-right:1px solid var(--line);
    border-radius:20px 20px 0 0;
  }
}

@media(max-width:360px){
  main{padding-left:15px;padding-right:15px}
  .welcome h1{font-size:34px}
  .balance-amount{font-size:33px}
  .nav-item{padding-left:12px;padding-right:12px}
}