/* Keadaan awal: hanya #loading yang tampil. WAJIB di stylesheet, bukan
   atribut style="display:none" — CSP portal memakai style-src 'self' tanpa
   'unsafe-inline', jadi atribut inline DIBLOKIR dan ketiga bagian tampil
   bersamaan sampai whoami() selesai. tampil() menyetel 'block' (bukan ''), 
   supaya aturan di bawah ini tidak menyembunyikannya kembali. */
#login, #home { display: none; }
#lg-msg { margin-top: 8px; }

/* JOKAM — portal identitas komunitas / gate pass (jokam.sb-abudhabi.org).
   Gaya mengikuti aplikasi Absensi (gradien biru-ungu, kartu putih membulat). */
:root {
  --primary: #3b6ef5; --primary-dark: #2f56c4; --grad: linear-gradient(135deg, #3b6ef5, #6a4df5);
  --bg: #f2f4f8; --card: #ffffff; --text: #131a26; --muted: #5f6b80; --line: #e3e7ef;
}
* { box-sizing: border-box; margin: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
header { background: var(--grad); color: #fff; padding: 18px 20px; display: flex; align-items: center; gap: 12px; }
header .flag { border-radius: 3px; flex: 0 0 auto; }
header h1 { font-size: 1.15rem; letter-spacing: -.01em; }
header p { font-size: .8rem; opacity: .85; }
main { max-width: 560px; margin: 0 auto; padding: 18px 14px 40px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(19,26,38,.04); }
.card h2 { font-size: 1.02rem; margin-bottom: 4px; }
.muted { color: var(--muted); font-size: .86rem; }
.kecil { font-size: .78rem; margin-top: 10px; }
label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin: 12px 0 4px; }
label.cek { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-top: 12px; }
input:not([type=checkbox]) { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: .95rem; background: #fbfcfe; }
input:focus { outline: 2px solid var(--primary); border-color: transparent; }
.btn { display: inline-block; width: 100%; margin-top: 14px; padding: 12px; border: 0; border-radius: 10px; background: var(--grad); color: #fff; font-weight: 700; font-size: .95rem; cursor: pointer; }
.btn:disabled { opacity: .6; }
.btn.ghost { background: #fff; color: var(--primary-dark); border: 1px solid var(--line); width: auto; padding: 9px 14px; font-size: .82rem; margin: 0; flex: 0 0 auto; }
/* profil */
.profil { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.avatar { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; background: #dbe7ff; flex: 0 0 auto; line-height: 0; }
.avatar svg, .avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.pf-info { flex: 1; min-width: 0; }
.pf-nama { font-weight: 800; font-size: 1.02rem; overflow-wrap: anywhere; }
.badge { display: inline-block; font-size: .68rem; font-weight: 700; padding: 2px 9px; border-radius: 20px; background: var(--grad); color: #fff; margin-top: 3px; }
/* daftar aplikasi */
.apps-title { font-size: .95rem; margin: 18px 0 10px; }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.app { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 6px; transition: transform .12s, box-shadow .12s; }
a.app:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(59,110,245,.14); border-color: #c9d7fb; }
.app-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; }
.app-ico svg { width: 22px; height: 22px; }
.app-nama { font-weight: 700; font-size: .9rem; }
.app-desc { font-size: .74rem; color: var(--muted); }
.app.segera { opacity: .55; }
.app.segera .app-ico { background: #97a1b4; }
/* toast */
#toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); background: #131a26; color: #fff; padding: 10px 18px; border-radius: 12px; font-size: .85rem; opacity: 0; pointer-events: none; transition: all .25s; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%); }
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1420; --card: #1a2130; --text: #e8ecf3; --muted: #97a1b4; --line: #26303f; }
  input:not([type=checkbox]) { background: #141a27; color: var(--text); }
  .btn.ghost { background: #1a2130; color: #b9c8f5; }
}
