/* ============================================================
   APLIKASI ORGANISASI HMI — gaya aplikasi mobile
   ============================================================ */
:root{
  --green:#0E6B3D; --green-d:#07492A; --green-l:#12854A; --green-soft:#E7F3EC;
  --gold:#F5C518; --gold-d:#D9A800;
  --bg:#F2F6F3; --card:#FFFFFF; --text:#0F241B; --muted:#68796F; --line:#E3EBE6;
  --danger:#D93B3B; --warn:#E1A200; --info:#1D74C4;
  --radius:18px; --shadow:0 6px 22px rgba(9,54,32,.08);
  --nav-h:70px; --font:'Plus Jakarta Sans',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0}
body{
  font-family:var(--font); background:#0E2418; color:var(--text);
  -webkit-font-smoothing:antialiased;
}
img{max-width:100%;display:block}
button,input,select,textarea{font-family:inherit;font-size:15px}
a{color:inherit;text-decoration:none}
.hidden{display:none !important}

/* ---------- kerangka telepon ---------- */
#frame{
  max-width:440px; margin:0 auto; min-height:100vh; background:var(--bg);
  position:relative; overflow-x:hidden; padding-bottom:calc(var(--nav-h) + 14px);
}
@media(min-width:760px){
  body{background:radial-gradient(circle at 20% 0,#12503a,#071a12 60%);padding:22px 0}
  #frame{border-radius:28px;box-shadow:0 30px 70px rgba(0,0,0,.5);min-height:calc(100vh - 44px);overflow:hidden}
}

/* ---------- splash ---------- */
#splash{
  position:fixed;inset:0;z-index:90;background:#06331E;display:flex;align-items:center;justify-content:center;
  transition:opacity .45s ease, visibility .45s;
}
#splash.gone{opacity:0;visibility:hidden}
#splash .inner{max-width:440px;width:100%;height:100%;position:relative;background:url('/assets/splash.jpg') center/cover no-repeat;display:flex;flex-direction:column;justify-content:flex-end;padding:28px}
#splash .inner .bar{position:absolute;left:50%;bottom:22px;transform:translateX(-50%);width:120px;height:5px;border-radius:9px;background:rgba(255,255,255,.35);overflow:hidden}
#splash .inner .bar i{position:absolute;inset:0;width:40%;background:#fff;border-radius:9px;animation:load 1.6s ease-in-out infinite}
@keyframes load{0%{left:-40%}100%{left:100%}}

/* ---------- header hijau ---------- */
.appbar{
  background:linear-gradient(160deg,var(--green) 0%,var(--green-d) 100%);
  color:#fff;padding:18px 18px 26px;position:relative;overflow:hidden;
  border-bottom-left-radius:26px;border-bottom-right-radius:26px;
}
.appbar::after{content:"";position:absolute;right:-40px;top:-60px;width:180px;height:180px;border-radius:50%;background:rgba(255,255,255,.07)}
.appbar::before{content:"";position:absolute;left:-30px;bottom:-70px;width:140px;height:140px;border-radius:50%;background:rgba(245,197,24,.10)}
.appbar .top{display:flex;align-items:center;gap:12px;position:relative;z-index:2}
.appbar .brand{display:flex;align-items:center;gap:10px}
.appbar .brand img{width:38px;height:38px;border-radius:11px;background:#fff;padding:3px;object-fit:contain}
.appbar h1{margin:0;font-size:16px;font-weight:800;letter-spacing:.2px}
.appbar .sub{margin:2px 0 0;font-size:11.5px;opacity:.85}
.appbar .avatar{margin-left:auto;width:40px;height:40px;border-radius:50%;border:2px solid rgba(255,255,255,.55);object-fit:cover;background:#fff}
.iconbtn{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:rgba(255,255,255,.14);border:0;color:#fff;cursor:pointer;position:relative}
.iconbtn .dot{position:absolute;top:7px;right:8px;width:8px;height:8px;border-radius:50%;background:var(--gold);border:1.5px solid var(--green-d)}
.greeting{margin:16px 0 0;position:relative;z-index:2}
.greeting h2{margin:0;font-size:19px;font-weight:800}
.greeting p{margin:5px 0 0;font-size:12.5px;opacity:.88;line-height:1.5}

/* ---------- kartu & umum ---------- */
.wrap{padding:0 16px}
.card{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:16px;margin:0 0 14px}
.card.tight{padding:12px}
.section{margin:20px 16px 10px;display:flex;align-items:center;justify-content:space-between}
.section h3{margin:0;font-size:15px;font-weight:800}
.section a{font-size:12.5px;color:var(--green);font-weight:700}
.pull{margin-top:-16px}
.chips{display:flex;gap:8px;flex-wrap:wrap}
.chip{border:1px solid var(--line);background:#fff;border-radius:999px;padding:7px 13px;font-size:12px;font-weight:700;color:var(--muted);cursor:pointer}
.chip.on{background:var(--green);border-color:var(--green);color:#fff}
.badge{display:inline-flex;align-items:center;gap:5px;font-size:10.5px;font-weight:800;padding:4px 9px;border-radius:999px;text-transform:uppercase;letter-spacing:.3px}
.b-green{background:var(--green-soft);color:var(--green)}
.b-gold{background:#FDF4D6;color:#8A6A00}
.b-blue{background:#E7F0FA;color:var(--info)}
.b-red{background:#FCEAEA;color:var(--danger)}
.b-grey{background:#EEF1EF;color:var(--muted)}
.muted{color:var(--muted)}
.small{font-size:12px}
.center{text-align:center}
.row{display:flex;align-items:center;gap:12px}
.row.between{justify-content:space-between}
.grow{flex:1;min-width:0}
.ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mt0{margin-top:0}.mb0{margin-bottom:0}

/* grid menu beranda */
.menu-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.menu-item{background:#fff;border:1px solid var(--line);border-radius:15px;padding:12px 6px;text-align:center;cursor:pointer;transition:.15s}
.menu-item:active{transform:scale(.96)}
.menu-item .ic{width:38px;height:38px;margin:0 auto 7px;border-radius:12px;background:var(--green-soft);display:grid;place-items:center;color:var(--green)}
.menu-item span{font-size:10.5px;font-weight:700;color:var(--text)}
.menu-item b{display:block;font-size:13px;color:var(--green);margin-top:2px}

/* kartu kegiatan */
.keg-card{background:#fff;border-radius:16px;overflow:hidden;box-shadow:var(--shadow);margin-bottom:12px}
.keg-card img{height:130px;width:100%;object-fit:cover}
.keg-card .body{padding:12px 14px 14px}
.keg-card h4{margin:0 0 6px;font-size:14px;line-height:1.35;font-weight:800}
.meta{display:flex;flex-wrap:wrap;gap:10px;margin-top:9px;font-size:11.5px;color:var(--muted);font-weight:600}
.meta i{display:inline-block;width:13px;text-align:center;margin-right:3px;font-style:normal}

/* daftar item */
.list{background:#fff;border-radius:16px;box-shadow:var(--shadow);overflow:hidden}
.li{display:flex;align-items:center;gap:12px;padding:13px 14px;border-bottom:1px solid var(--line);cursor:pointer}
.li:last-child{border-bottom:0}
.li .thumb{width:52px;height:52px;border-radius:13px;object-fit:cover;flex:0 0 auto}
.li .ico{width:44px;height:44px;border-radius:13px;background:var(--green-soft);color:var(--green);display:grid;place-items:center;flex:0 0 auto}
.li .ico.gold{background:#FDF4D6;color:#8A6A00}
.li .ico.blue{background:#E7F0FA;color:var(--info)}
.li .ico.red{background:#FCEAEA;color:var(--danger)}
.li h4{margin:0;font-size:13.5px;font-weight:700}
.li p{margin:3px 0 0;font-size:11.5px;color:var(--muted)}
.li .rt{margin-left:auto;text-align:right;font-size:11px;color:var(--muted);font-weight:600;flex:0 0 auto}
.avatar-sm{width:36px;height:36px;border-radius:50%;object-fit:cover;background:var(--green-soft)}

/* tombol */
.btn{display:block;width:100%;border:0;border-radius:14px;padding:14px;font-size:14.5px;font-weight:800;cursor:pointer;background:var(--green);color:#fff;transition:.15s}
.btn:active{transform:scale(.985)}
.btn.ghost{background:#fff;color:var(--green);border:1.5px solid var(--green)}
.btn.gold{background:var(--gold);color:#3A2C00}
.btn.grey{background:#EDF1EE;color:var(--text)}
.btn.danger{background:#FCEAEA;color:var(--danger)}
.btn.sm{padding:10px 14px;font-size:13px;width:auto;display:inline-block}
.btn[disabled]{opacity:.55;pointer-events:none}

/* form */
.field{margin-bottom:13px}
.field label{display:block;font-size:12px;font-weight:700;margin-bottom:6px;color:#33473D}
.input{display:flex;align-items:center;gap:10px;background:#F6F9F7;border:1.5px solid var(--line);border-radius:13px;padding:12px 14px}
.input:focus-within{border-color:var(--green);background:#fff}
.input svg{flex:0 0 auto;color:var(--muted);width:18px;height:18px}
.input input,.input select,.input textarea{border:0;background:transparent;outline:none;width:100%;color:var(--text)}
.input textarea{resize:vertical;min-height:70px}
.ico svg,.li .ico svg,.li .thumb~* svg{width:19px;height:19px}
.menu-item .ic svg,.profile-grid .ic svg{width:20px;height:20px}
.btn svg{width:17px;height:17px;flex:0 0 auto}

/* ---------- login ---------- */
.auth{min-height:100vh;background:#fff;display:flex;flex-direction:column}
.auth-hero{background:linear-gradient(160deg,var(--green-l),var(--green-d));border-bottom-left-radius:34px;border-bottom-right-radius:34px;padding:38px 22px 66px;text-align:center;position:relative;overflow:hidden}
.auth-hero::after{content:"";position:absolute;inset:auto -30px -80px -30px;height:190px;background:radial-gradient(circle at 50% 0,rgba(255,255,255,.16),transparent 70%)}
.auth-hero img.logo{width:88px;height:88px;margin:0 auto 12px;border-radius:22px;background:#fff;padding:6px;object-fit:contain;box-shadow:0 10px 26px rgba(0,0,0,.25)}
.auth-hero h2{margin:0;color:#fff;font-size:20px;font-weight:800}
.auth-hero p{margin:6px 0 0;color:#D9EDE1;font-size:12.5px}
.auth-body{flex:1;padding:0 22px 30px;margin-top:-38px}
.auth-card{background:#fff;border-radius:22px;box-shadow:0 14px 40px rgba(9,54,32,.13);padding:22px 18px}
.auth-card h3{margin:0 0 3px;font-size:18px;font-weight:800}
.auth-card .sub{margin:0 0 18px;font-size:12.5px;color:var(--muted)}
.pw-toggle{background:none;border:0;color:var(--muted);cursor:pointer;font-size:12px;font-weight:700}
.alert{border-radius:12px;padding:11px 13px;font-size:12.5px;font-weight:600;margin-bottom:12px}
.alert.err{background:#FCEAEA;color:var(--danger)}
.alert.ok{background:var(--green-soft);color:var(--green)}
.alert.info{background:#E7F0FA;color:var(--info)}
.link{color:var(--green);font-weight:700;cursor:pointer}

/* ---------- absensi ---------- */
.scanner{background:#092A1A;border-radius:20px;padding:20px;text-align:center;color:#fff;position:relative;overflow:hidden}
.scan-box{width:220px;height:220px;margin:14px auto;border-radius:20px;background:#0F3A26;position:relative;display:grid;place-items:center;overflow:hidden}
.scan-box .qr{background:#fff;padding:10px;border-radius:12px}
.scan-box .qr canvas,.scan-box .qr img{display:block;width:170px;height:170px}
.scan-line{position:absolute;left:12px;right:12px;height:3px;background:linear-gradient(90deg,transparent,var(--gold),transparent);box-shadow:0 0 14px var(--gold);animation:scan 2.4s linear infinite}
@keyframes scan{0%{top:16px}50%{top:198px}100%{top:16px}}
.corner{position:absolute;width:26px;height:26px;border:3px solid var(--gold)}
.c1{top:10px;left:10px;border-right:0;border-bottom:0;border-radius:8px 0 0 0}
.c2{top:10px;right:10px;border-left:0;border-bottom:0;border-radius:0 8px 0 0}
.c3{bottom:10px;left:10px;border-right:0;border-top:0;border-radius:0 0 0 8px}
.c4{bottom:10px;right:10px;border-left:0;border-top:0;border-radius:0 0 8px 0}
.success{text-align:center;padding:24px 18px}
.success .check{width:96px;height:96px;border-radius:50%;background:var(--green-soft);display:grid;place-items:center;margin:0 auto 16px}
.success h3{margin:0;font-size:19px;font-weight:800}
.success p{margin:8px 0 0;color:var(--muted);font-size:13px;line-height:1.6}

/* ---------- statistik ---------- */
.stat2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.stat{background:#fff;border-radius:16px;padding:14px;box-shadow:var(--shadow)}
.stat .lb{font-size:11px;color:var(--muted);font-weight:700}
.stat .vl{font-size:16px;font-weight:800;margin-top:6px}
.stat.in .vl{color:var(--green)}
.stat.out .vl{color:var(--danger)}
.bars{display:flex;align-items:flex-end;gap:8px;height:130px;margin-top:12px}
.bars .col{flex:1;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:6px}
.bars .col i{display:block;width:100%;border-radius:8px 8px 4px 4px;background:linear-gradient(180deg,var(--green-l),var(--green));transition:.4s}
.bars .col.out i{background:linear-gradient(180deg,#F09A9A,var(--danger))}
.bars .col span{font-size:9.5px;color:var(--muted);font-weight:700}
.progress{height:8px;border-radius:9px;background:#EDF1EE;overflow:hidden}
.progress i{display:block;height:100%;background:var(--green);border-radius:9px}

/* ---------- profil ---------- */
.profile-head{text-align:center;padding:6px 18px 0}
.profile-head img.pf{width:96px;height:96px;border-radius:50%;object-fit:cover;border:4px solid #fff;box-shadow:0 10px 24px rgba(0,0,0,.16);margin:-56px auto 12px;background:#fff}
.profile-head h2{margin:0;font-size:18px;font-weight:800}
.profile-head .nim{margin:6px 0 0;font-size:12.5px;color:var(--muted);font-weight:600}
.profile-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:16px}
.profile-grid .menu-item{padding:12px 4px}

/* ---------- chat forum ---------- */
.chat{display:flex;flex-direction:column;gap:12px;padding:14px 16px 20px}
.bubble{max-width:82%;background:#fff;border-radius:16px 16px 16px 4px;padding:11px 13px;box-shadow:var(--shadow);font-size:13px;line-height:1.55}
.bubble.me{align-self:flex-end;background:var(--green);color:#fff;border-radius:16px 16px 4px 16px}
.bubble .who{font-size:11px;font-weight:800;color:var(--green);margin-bottom:3px}
.bubble .t{font-size:10px;opacity:.7;margin-top:6px;text-align:right}
.composer{position:fixed;bottom:0;left:50%;transform:translateX(-50%);max-width:440px;width:100%;background:#fff;border-top:1px solid var(--line);padding:10px 14px calc(10px + env(safe-area-inset-bottom));display:flex;gap:10px;z-index:40}
.composer input{flex:1;border:1.5px solid var(--line);background:#F6F9F7;border-radius:999px;padding:12px 16px;outline:none}

/* ---------- navigasi bawah ---------- */
#bottomnav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:440px;height:var(--nav-h);background:#fff;border-top:1px solid var(--line);display:flex;z-index:50;box-shadow:0 -6px 20px rgba(9,54,32,.06)}
#bottomnav a{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;color:#94A49B;font-size:10px;font-weight:700;position:relative}
#bottomnav a.on{color:var(--green)}
#bottomnav a.on::before{content:"";position:absolute;top:0;width:26px;height:3px;border-radius:0 0 6px 6px;background:var(--green)}
#bottomnav svg{width:22px;height:22px}
@media(min-width:760px){#bottomnav{bottom:22px;border-radius:0 0 28px 28px}}

/* ---------- toast & sheet ---------- */
#toast{position:fixed;left:50%;bottom:96px;transform:translateX(-50%) translateY(20px);background:#0F241B;color:#fff;padding:12px 18px;border-radius:12px;font-size:12.5px;font-weight:600;opacity:0;transition:.25s;z-index:95;max-width:86%;text-align:center}
#toast.on{opacity:1;transform:translateX(-50%) translateY(0)}
.sheet{position:fixed;inset:0;background:rgba(6,26,17,.55);z-index:80;display:flex;align-items:flex-end;justify-content:center}
.sheet .panel{background:#fff;width:100%;max-width:440px;border-radius:22px 22px 0 0;padding:20px 18px calc(24px + env(safe-area-inset-bottom));max-height:88vh;overflow:auto;animation:up .25s ease}
@keyframes up{from{transform:translateY(30px);opacity:.4}to{transform:none;opacity:1}}
.sheet h3{margin:0 0 14px;font-size:16px;font-weight:800}
.grabber{width:44px;height:5px;border-radius:9px;background:#DCE5E0;margin:0 auto 14px}

/* ---------- empty / loading ---------- */
.loading{padding:40px 0;text-align:center;color:var(--muted);font-size:13px;font-weight:600}
.spin{width:26px;height:26px;border:3px solid #DDE7E1;border-top-color:var(--green);border-radius:50%;margin:0 auto 12px;animation:sp .8s linear infinite}
@keyframes sp{to{transform:rotate(360deg)}}
.empty{text-align:center;padding:34px 18px;color:var(--muted)}
.empty h4{margin:12px 0 6px;font-size:14px;color:var(--text)}
.empty p{margin:0;font-size:12.5px}
.skel{background:linear-gradient(90deg,#EDF1EE 25%,#F6F9F7 37%,#EDF1EE 63%);background-size:400% 100%;animation:sk 1.2s ease infinite;border-radius:12px}
@keyframes sk{0%{background-position:100% 50%}100%{background-position:0 50%}}

/* detail kegiatan */
.detail-hero{position:relative;height:210px;background:#0B5B33}
.detail-hero img{width:100%;height:100%;object-fit:cover}
.detail-hero .back{position:absolute;top:14px;left:14px;background:rgba(0,0,0,.45);border:0;color:#fff;width:38px;height:38px;border-radius:50%;display:grid;place-items:center;cursor:pointer;backdrop-filter:blur(4px)}
.detail-title{font-size:17px;font-weight:800;line-height:1.4;margin:0}
.footer-cta{position:fixed;bottom:0;left:50%;transform:translateX(-50%);max-width:440px;width:100%;background:#fff;border-top:1px solid var(--line);padding:12px 16px calc(12px + env(safe-area-inset-bottom));z-index:45;display:flex;gap:10px;align-items:center}
.footer-cta .price{font-size:12px;color:var(--muted);font-weight:700}
.footer-cta .price b{display:block;font-size:14px;color:var(--text)}
@media(min-width:760px){.footer-cta{bottom:22px;border-radius:0 0 28px 28px}}
.wave{height:34px;background:#fff;border-radius:26px 26px 0 0;margin-top:-22px;position:relative;z-index:2}
