:root{
  --bg0:#070f1f;
  --bg1:#0a1730;
  --card:#1a2640;
  --card2:#16233b;
  --stroke:rgba(255,255,255,.08);

  --text:#e9f0ff;
  --muted:rgba(233,240,255,.65);

  --primary:#5c63ff;   /* ungu */
  --green:#20c997;
  --yellow:#f6c343;
  --teal:#2dd4bf;

  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 900px at 20% -10%, rgba(92,99,255,.18), transparent 60%),
              linear-gradient(180deg, var(--bg1), var(--bg0));
}

/* safe area */
.safe{
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* layout */
.app{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

.topbar{
  height:54px;
  display:flex;
  align-items:center;
  padding: 0 16px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(10,23,48,.55);
  backdrop-filter: blur(10px);
}

.topbar .title{
  font-weight:700;
  font-size:14px;
  letter-spacing:.2px;
}

.page{
  flex:1;
  padding:16px;
  padding-bottom: 92px; /* ruang untuk bottom nav */
  overflow:auto;
}

/* common */
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card.soft{
  box-shadow:none;
  background: rgba(255,255,255,.04);
}

.row{
  display:flex;
  align-items:center;
}

.space{
  justify-content:space-between;
}

.muted{ color: var(--muted); }
.small{ font-size:12px; }
.tiny{ font-size:11px; }

.h1{
  font-size:22px;
  font-weight:800;
  margin:0;
}
.h2{
  font-size:16px;
  font-weight:800;
  margin:0;
}
.mt8{ margin-top:8px; }
.mt12{ margin-top:12px; }
.mt16{ margin-top:16px; }
.mt20{ margin-top:20px; }
.mb8{ margin-bottom:8px; }
.gap8{ gap:8px; }
.gap10{ gap:10px; }
.gap12{ gap:12px; }
.pad14{ padding:14px; }
.pad16{ padding:16px; }

/* buttons */
.btn{
  height:44px;
  width:100%;
  border:none;
  border-radius: 12px;
  font-weight:800;
  color:#fff;
  background: var(--primary);
  box-shadow: 0 14px 28px rgba(92,99,255,.22);
  cursor:pointer;
}
.btn:active{ transform: translateY(1px); }

.btn.secondary{
  background: rgba(255,255,255,.08);
  border: 1px solid var(--stroke);
  box-shadow:none;
}

.badge{
  font-size:11px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.05);
}
.badge.warn{
  background: rgba(246,195,67,.15);
  border-color: rgba(246,195,67,.35);
  color: #ffe7a3;
}
.badge.ok{
  background: rgba(32,201,151,.15);
  border-color: rgba(32,201,151,.35);
  color: #bff6e4;
}

.iconCircle{
  width:42px;height:42px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background: rgba(92,99,255,.18);
  border:1px solid rgba(92,99,255,.30);
}

/* welcome */
.welcomeWrap{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding: 24px 18px 28px;
  text-align:center;
}

.logoCircle{
  width:86px;height:86px;
  border-radius:999px;
  margin: 0 auto 14px;
  display:grid;
  place-items:center;
  background: rgba(92,99,255,.20);
  border: 1px solid rgba(92,99,255,.35);
}
.logoCircle span{
  font-size:42px;
  font-weight:900;
  letter-spacing:.5px;
}

.features{
  margin: 18px auto 22px;
  text-align:left;
  max-width: 290px;
}
.feature{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 0;
  color: rgba(233,240,255,.85);
}
.check{
  width:18px;height:18px;
  border-radius:6px;
  display:grid;
  place-items:center;
  background: rgba(92,99,255,.18);
  border:1px solid rgba(92,99,255,.35);
}

/* home header */
.hero{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.avatar{
  width:44px;height:44px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background: rgba(92,99,255,.20);
  border:1px solid rgba(92,99,255,.35);
  font-weight:900;
}

.kpiGrid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px;
}
.kpi{
  padding:12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.035);
  text-align:center;
}
.kpi .num{
  font-size:18px;
  font-weight:900;
  margin-top:6px;
}
.kpi .lbl{
  font-size:11px;
  color: var(--muted);
  margin-top:2px;
}

/* big action card (attendance) */
.bigAction{
  padding:16px;
  border-radius: 16px;
  background: rgba(92,99,255,.16);
  border: 1px solid rgba(92,99,255,.35);
  text-align:center;
  width: 100%;
}
.bigAction .cam{
  width:56px;height:56px;
  margin: 2px auto 10px;
  border-radius: 16px;
  display:grid;
  place-items:center;
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
}
.bigAction .txt{
  font-weight:900;
  margin:0;
  font-size:16px;
}
.bigAction .sub{
  margin:6px 0 0;
  font-size:12px;
  color: rgba(233,240,255,.75);
}

/* list items */
.list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.item{
  padding:12px;
  border-radius: 14px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.035);
  display:flex;
  gap:12px;
  align-items:center;
}
.datePill{
  width:44px;
  border-radius:12px;
  padding:8px 0;
  text-align:center;
  background: rgba(92,99,255,.18);
  border:1px solid rgba(92,99,255,.30);
}
.datePill .d{ font-weight:900; font-size:16px; line-height:16px; }
.datePill .m{ font-size:10px; color: rgba(233,240,255,.75); margin-top:2px; }
.item .mid{ flex:1; }
.item .right{
  display:flex; align-items:center; gap:8px;
  font-weight:900;
}
.dot{
  width:10px;height:10px;border-radius:999px;
  background: var(--green);
}

/* salary list */
.salaryItem{
  padding:12px;
  border-radius: 14px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.035);
  display:flex;
  align-items:center;
  gap:12px;
}
.salaryIcon{
  width:40px;height:40px;border-radius:14px;
  display:grid;place-items:center;
  background: rgba(92,99,255,.18);
  border:1px solid rgba(92,99,255,.30);
}
.amount{
  margin-left:auto;
  color: #35d07f;
  font-weight:900;
  white-space:nowrap;
}
.chev{
  margin-left:10px;
  opacity:.75;
}

/* bottom nav */
.bottomNav{
  position:fixed;
  left:0; right:0; bottom:0;
  padding-bottom: env(safe-area-inset-bottom);
  height: 72px;
  background: rgba(10,23,48,.65);
  backdrop-filter: blur(12px);
  border-top:1px solid var(--stroke);
  display:flex;
  align-items:center;
  justify-content:space-around;
}

.navBtn{
  width:56px;
  height:48px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  border: 1px solid transparent;
  background: transparent;
  cursor:pointer;
}

.navBtn.active{
  background: rgba(92,99,255,.16);
  border-color: rgba(92,99,255,.35);
}

svg{ display:block; }
/* ===== LOGIN ===== */
.formCard{
  padding:16px;
  border-radius: var(--radius);
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.04);
}

.field{ margin-top:12px; text-align:left; }
.label{
  font-size:12px;
  color: rgba(233,240,255,.75);
  margin-bottom:8px;
  display:block;
}

.inputWrap{
  position:relative;
}

.input{
  width:100%;
  height:46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  color: var(--text);
  outline:none;
}
.input:focus{
  border-color: rgba(92,99,255,.55);
  box-shadow: 0 0 0 3px rgba(92,99,255,.14);
}

.eyeBtn{
  position:absolute;
  right:10px;
  top:50%;
  transform: translateY(-50%);
  width:34px;height:34px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: rgba(233,240,255,.85);
  display:grid;
  place-items:center;
  cursor:pointer;
}

.formRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-top:12px;
}

.link{
  font-size:12px;
  color: rgba(233,240,255,.75);
  text-decoration:none;
}
.link:active{ opacity:.85; }

.alert{
  margin-top:12px;
  font-size:12px;
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid rgba(255,90,90,.25);
  background: rgba(255,90,90,.10);
  color: #ffd2d2;
}

.topbarBtn{
  margin-left:auto;
  width:36px;height:36px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: rgba(233,240,255,.90);
  display:grid;
  place-items:center;
  cursor:pointer;
}
/* ==== Attendance camera overlay ==== */
.camOverlay{
  position: fixed; inset: 0;
  background: rgba(10,12,18,.78);
  display:flex; align-items:center; justify-content:center;
  z-index: 9999;
  backdrop-filter: blur(6px);
}
.camOverlayCard{
  width: min(340px, 92vw);
  border-radius: 18px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  padding: 16px;
  text-align:center;
}
.camFrame{
  width: 180px; height: 180px;
  border-radius: 22px;
  border: 2px dashed rgba(255,255,255,.35);
  margin: 10px auto 14px;
  display:flex; align-items:center; justify-content:center;
  position: relative;
  overflow:hidden;
}
.camPulse{
  width: 64px; height: 64px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.55);
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse{
  0%{ transform: scale(.85); opacity:.55;}
  50%{ transform: scale(1.05); opacity:1;}
  100%{ transform: scale(.85); opacity:.55;}
}

.flash{
  position: fixed; inset: 0;
  background: rgba(255,255,255,.85);
  z-index: 10000;
  animation: flash .35s ease-out forwards;
}
@keyframes flash{
  0%{ opacity:0;}
  30%{ opacity:1;}
  100%{ opacity:0;}
}

.smallBtn{
  height: 42px;
  border-radius: 14px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.10);
  color: rgba(233,240,255,.95);
}
.photoPreview{
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  overflow: hidden;
}
.photoPreview img{ width:100%; display:block; }
.stepRow{
  display:flex; align-items:center; justify-content:space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.stepRow:last-child{ border-bottom:0; }
.stepLeft{ display:flex; align-items:center; gap:10px; }
.stepDot{
  width:10px; height:10px; border-radius:999px;
  background: rgba(255,255,255,.22);
}
.stepDot.ok{ background: rgba(32,201,151,.95); }
.stepDot.warn{ background: rgba(246,195,67,.95); }
.attGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}

.attCard{
  border-radius: 16px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  box-shadow: 0 10px 30px rgba(0,0,0,.20);
  min-height: 108px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}

.attCard.done{
  background: rgba(32,201,151,.10);
  border-color: rgba(32,201,151,.25);
}

.attCard.next{
  border-color: rgba(92,99,255,.55);
  box-shadow: 0 10px 30px rgba(92,99,255,.12);
}

.attTop{
  display:flex;
  align-items:flex-start;
  gap:10px;
}

.attBadge{
  width:28px;
  height:28px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  flex: 0 0 auto;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
}

.attBadge.ok{
  background: rgba(32,201,151,.18);
  border-color: rgba(32,201,151,.35);
}

.attBadge.wait{
  background: rgba(246,195,67,.14);
  border-color: rgba(246,195,67,.30);
}

.attTitle{
  font-weight: 900;
  font-size: 14px;
  letter-spacing: .2px;
}

.attTime{
  margin-top:10px;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: .6px;
}

/* responsive */
@media (max-width: 360px){
  .attTime{ font-size: 22px; }
  .attGrid{ gap:10px; }
}
.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
@media (max-width:420px){
  .grid2{ grid-template-columns: 1fr; }
}
.success{
  background: rgba(34,197,94,.15);
  border: 1px solid rgba(34,197,94,.25);
  color: rgba(233,240,255,.95);
  padding: 10px 12px;
  border-radius: 12px;
}