:root{
  --bg:#0b0f16;
  --panel:#121826;
  --panel2:#0f1522;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --line:#263042;
  --primary:#f59e0b;
  --danger:#ef4444;
  --btn:#1f2937;
  --radius:12px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
}

/* LOGIN */
.login{
  min-height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
}
.loginWrap{width:100%; max-width:420px; text-align:center}
.logoBox{display:flex;justify-content:center;margin:8px 0 6px}
.logoImg{width:72px;height:72px}
.brand{font-size:22px;font-weight:900;letter-spacing:1px;margin-bottom:10px}
.loginCard{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:14px;
  text-align:left;
}
.lbl{display:block;font-size:12px;color:var(--muted);margin:10px 0 6px}
.inp,.ta,select.inp{
  width:100%;
  padding:12px 12px;
  border-radius:10px;
  border:1px solid var(--line);
  background:var(--panel2);
  color:var(--text);
  outline:none;
  font-size:15px;
}
.ta{resize:vertical}
.inp:focus,.ta:focus{border-color:#fbbf24; box-shadow:0 0 0 3px rgba(245,158,11,.18)}
.btn{
  width:100%;
  padding:12px 12px;
  border-radius:10px;
  border:0;
  font-weight:900;
  letter-spacing:.6px;
  cursor:pointer;
  margin-top:12px;
}
.btnPrimary{background:var(--primary); color:#111827}
.btnDanger{background:var(--danger); color:#111827}
.btnGhost{background:var(--btn); color:var(--text); border:1px solid var(--line)}
.status{margin-top:10px;color:var(--primary);font-size:13px}
.smallNote{margin-top:10px;color:var(--muted);font-size:12px}

/* APP */
.app{min-height:100%}
.hdr{
  position:sticky;
  top:0;
  z-index:20;
  background:#0a0f18;
  border-bottom:1px solid var(--line);
  display:grid;
  grid-template-columns: 64px 1fr 120px;
  align-items:center;
  gap:8px;
  padding:8px 10px;
}
.hdrLogo{width:40px;height:40px}
.hdrMid{text-align:center}
.hdrUser{font-weight:1000;font-size:14px}
.hdrRight{text-align:right}
.hdrCreditLabel{font-size:10px;color:var(--muted);font-weight:900}
.hdrCredit{font-weight:1000;font-size:14px;display:inline-block;}

.tabs{
  position:sticky;
  top:56px;
  z-index:19;
  display:flex;
  gap:6px;
  padding:8px 10px;
  background:#0a0f18;
  border-bottom:1px solid var(--line);
  overflow-x:auto;
}
.tab{
  flex:0 0 auto;
  border:1px solid var(--line);
  background:var(--btn);
  color:var(--text);
  padding:10px 12px;
  border-radius:999px;
  font-weight:1000;
  font-size:12px;
  letter-spacing:.4px;
  cursor:pointer;
}
.tab.active{
  background:var(--primary);
  color:#111827;
  border-color:rgba(245,158,11,.6);
}
.tabMore{min-width:42px}

.content{padding:10px}
.pageTitle{
  font-weight:1000;
  letter-spacing:1px;
  font-size:13px;
  margin:4px 0 10px;
  color:#fbbf24;
}
.box{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:12px;
  margin-bottom:10px;
}
.boxTitle{
  font-weight:1000;
  font-size:12px;
  color:#fbbf24;
  margin-bottom:6px;
  letter-spacing:.6px;
}
.row2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
@media (max-width: 360px){
  .row2{grid-template-columns: 1fr}
  .hdr{grid-template-columns: 56px 1fr 110px}
}
.listNote{color:var(--muted);font-size:13px}

.cards{display:flex;flex-direction:column;gap:10px}
.card{
  background:var(--panel2);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:12px;
}
.cardTop{display:flex;justify-content:space-between;gap:10px;align-items:center}
.pill{font-size:11px;border:1px solid var(--line);padding:4px 10px;border-radius:999px;color:var(--muted);font-weight:900}
.bigNum{font-size:22px;font-weight:1000;margin-top:6px}
.pantun{margin-top:8px;color:var(--text);white-space:pre-wrap;font-size:13px;line-height:1.35}

.hidden{display:none !important}



/* Receipt HTML in modal */
.receiptHtml{
  background:#05070d;
  border:1px solid #141b28;
  border-radius:10px;
  padding:10px;
  color:var(--text);
  font-size:13px;
  line-height:1.4;
}
.receiptHtml .muted{color:var(--muted)}

/* Ensure modal hidden by default */
.modal.hidden{display:none !important}

/* ===== Full Screen Sheet (Mobile Safe) ===== */
.sheet.hidden{display:none !important}
.sheet{
  position:fixed;
  inset:0;
  background:#0b0f1a;
  z-index:9999;
  display:flex;
  flex-direction:column;
}

.sheetHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px;
  background:#0e1424;
  border-bottom:1px solid #1f2937;
}

.sheetTitle{
  font-weight:1000;
  letter-spacing:.5px;
  color:#fbbf24;
}

.sheetClose{
  background:#111827;
  color:#fff;
  border:1px solid #1f2937;
  width:36px;height:36px;
  border-radius:10px;
  font-size:18px;
}

.sheetBody{
  padding:14px;
  overflow:auto;
}

.sheetRow{
  display:flex;
  justify-content:space-between;
  padding:6px 0;
}

.sheetLabel{
  font-size:12px;
  color:#9ca3af;
  font-weight:900;
}

.sheetValue{
  font-weight:1000;
}

.btnDangerWide{
  margin:12px 0;
  width:100%;
  padding:14px;
  border-radius:12px;
  background:#ef4444;
  color:#111827;
  font-weight:1000;
  font-size:16px;
  border:none;
}

.sheetSectionTitle{
  margin:10px 0 6px;
  font-weight:900;
  color:#fbbf24;
}

/* Bottom cancel button spacing */
#btnSheetCancelReceipt{
  margin-top:16px;
}

/* Share button */
.btnPrimaryWide{
  margin-top:16px;
  width:100%;
  padding:14px;
  border-radius:12px;
  background:#f59e0b;
  color:#111827;
  font-weight:1000;
  font-size:16px;
  border:none;
}


/* Logout icon button in tab bar */
.tabIcon{
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 22px;
  padding: 10px 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.9;
}
.tabIcon:hover{ opacity: 1; }


/* Credit balance refresh button */
.refreshBtn{
  border:0;
  background:rgba(255,255,255,0.08);
  cursor:pointer;
  font-size:14px;
  padding:4px 6px;
  border-radius:8px;
  color:inherit;
  opacity:0.95;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:1;
}
.refreshBtn:hover{ opacity:1; }

.refreshBtn:hover{ opacity:1; }


/* Header credit + refresh */
.hdrCreditWrap{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
}


/* Buy rows */
.buyRows{ display:flex; flex-direction:column; gap:10px; margin-top:10px; }
.buyRow{ display:flex; gap:10px; align-items:center; }
.buyRow .inp{ flex:1; }
.buyRow .btnDelRow{
  border:0;
  background:rgba(255,255,255,0.08);
  color:inherit;
  padding:6px 10px;
  border-radius:10px;
  cursor:pointer;
  opacity:0.9;
}
.buyRow .btnDelRow:hover{ opacity:1; }


/* 3 columns row for BUY (day/company/session) */
.row3{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap:10px;
}
@media (max-width: 520px){
  .row3{ grid-template-columns: 1fr; }
}


/* Inline logo svg sizing */
.logoImg svg{ width:72px; height:72px; display:block; }
.hdrLogo svg{ width:40px; height:40px; display:block; }
