/* Tahap 1B: halaman masuk, akun, 2FA, dan pengguna. */

/* ---------- halaman tanpa login ---------- */

body.tamu {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px 16px;
  box-sizing: border-box;
  background: var(--background);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}
.tamu-kotak {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 26px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}
/* UI-A: logo lebih kecil, tidak lagi memakan setengah kotak. */
.tamu-logo {
  display: flex;
  justify-content: flex-start;
  margin: 0 0 14px;
}
.tamu-logo img { width: 52px; height: 52px; object-fit: contain; display: block; background: var(--sidebarBg); border-radius: 12px; padding: 6px; }
.tamu-judul { font-size: 20px; margin: 0 0 4px; }
.tamu-sub { font-size: 12.5px; color: var(--textMuted); margin: 0 0 18px; line-height: 1.55; }
.tamu-kaki { font-size: 11px; color: var(--textMuted); }
.tamu .btn { width: 100%; padding: 12px; font-size: 13.5px; }
.tamu-tautan { margin-top: 14px; text-align: center; font-size: 12px; }

/* ---------- isian ---------- */

.isian { display: flex; flex-direction: column; margin-bottom: 14px; }
.isian .ctl { width: 100%; box-sizing: border-box; }
.ctl:focus { outline: 2px solid var(--buttonColor); outline-offset: -1px; }
.ctl-galat { border-color: #DC2626; }
.isian-petunjuk { font-size: 11.5px; color: var(--textMuted); margin-top: 5px; line-height: 1.45; }
.isian-galat { font-size: 12px; color: #DC2626; margin-top: 5px; }
select.ctl { cursor: pointer; }
.ctl-kode { font-size: 22px; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- pesan ---------- */

.pesan {
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 12.5px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.pesan-info { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.pesan-peringatan { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.pesan-galat { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }

/* ---------- halaman akun & pengguna ---------- */

.form-sempit { max-width: 440px; }
.bagian { margin-bottom: 16px; }
.baris-tombol { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; }

.ringkas { display: grid; grid-template-columns: 150px 1fr; gap: 9px 16px; font-size: 13px; }
.ringkas dt { color: var(--textMuted); }
.ringkas dd { margin: 0; font-weight: 600; }

.qr-kotak { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.qr-gambar {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  line-height: 0;
}
.qr-gambar svg { width: 180px; height: 180px; }
.rahasia {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 13px;
  background: var(--surfaceAlt);
  border-radius: 8px;
  padding: 8px 10px;
  word-break: break-all;
  user-select: all;
}
.langkah { font-size: 13px; line-height: 1.7; padding-left: 18px; margin: 0 0 14px; }

.kode-cadangan {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 6px 0 16px;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.kode-cadangan div {
  background: var(--surfaceAlt);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.password-sementara {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: #FFFFFF;
  border-radius: 8px;
  padding: 6px 12px;
  display: inline-block;
  margin: 6px 0;
  user-select: all;
}

.data-table td {
  padding: 11px 14px;
  font-size: 12.5px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr.nonaktif td { color: var(--textMuted); }
.pill-hijau { background: #DCFCE7; color: #166534; }
.pill-abu { background: #E2E8F0; color: #475569; }
.pill-kuning { background: #FEF3C7; color: #92400E; }
.pill-biru { background: #DBEAFE; color: #1E40AF; }
.pill-merah { background: #FEE2E2; color: #991B1B; }
/* Tombol aksi boleh turun baris supaya tabel tidak melebar keluar layar. */
.sel-aksi { text-align: right; min-width: 120px; }
.sel-aksi .act, .sel-aksi form { display: inline-block; margin: 2px 0 2px 4px; }
.sel-aksi form .act { margin: 0; }

/* Tautan yang berpenampilan tombol. */
a.btn, a.act { text-decoration: none; display: inline-block; }
a.btn-plus { display: inline-flex; align-items: center; gap: 6px; }
.teks-redup { color: var(--textMuted); font-size: 11.5px; }

/* ---------- pengguna di kaki sidebar ---------- */

.sidebar-pengguna { padding: 8px 14px 6px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar-pengguna .nama { font-size: 12.5px; font-weight: 700; color: var(--sidebarText); }
.sidebar-pengguna .peran { font-size: 11px; color: var(--sidebarTextMuted); margin-top: 1px; }
.sidebar-pengguna .aksi { display: flex; gap: 6px; margin-top: 6px; }
.sidebar-pengguna .aksi a,
.sidebar-pengguna .aksi button {
  flex: 1;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: var(--sidebarText);
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.sidebar-pengguna .aksi a:hover,
.sidebar-pengguna .aksi button:hover { background: rgba(255, 255, 255, 0.08); }
.sidebar-pengguna form { flex: 1; display: flex; }
.sidebar.collapsed .sidebar-pengguna .nama,
.sidebar.collapsed .sidebar-pengguna .peran,
.sidebar.collapsed .sidebar-pengguna .aksi a { display: none; }
.sidebar.collapsed .sidebar-pengguna { padding: 8px; }

@media (max-width: 767px) {
  .ringkas { grid-template-columns: 1fr; gap: 2px; }
  .ringkas dd { margin-bottom: 8px; }
  .sidebar.collapsed .sidebar-pengguna .nama,
  .sidebar.collapsed .sidebar-pengguna .peran { display: block; }
  .sidebar.collapsed .sidebar-pengguna .aksi a { display: block; }
  .sidebar.collapsed .sidebar-pengguna { padding: 12px 16px 6px; }
}

/* ---------- hak akses (Tahap 1C) ---------- */

.hak-legenda { gap: 8px; }
.hak-legenda-item { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; margin: 0 14px 4px 0; }
.hak-tabel th, .hak-tabel td { text-align: center; }
.hak-tabel th:first-child, .hak-tabel td:first-child { text-align: left; }
.hak-tabel th.hak-kolom { min-width: 118px; vertical-align: bottom; line-height: 1.4; }
.hak-tabel th.hak-terkunci { background: var(--surfaceAlt); }
.hak-modul { font-weight: 600; white-space: nowrap; }
.hak-kelompok td {
  background: var(--surfaceAlt);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--textMuted);
  text-align: left !important;
  padding: 7px 14px;
}
.hak-2fa td { background: #FFFBEB; }
.hak-kolom { white-space: nowrap; }

.hak-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  margin: 1px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--textMuted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.hak-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.hak-chip:focus-within { outline: 2px solid var(--buttonColor); outline-offset: 1px; }
.hak-chip.aktif { background: var(--buttonColor); border-color: var(--buttonColor); color: #FFFFFF; }
.hak-chip.terkunci { cursor: default; opacity: 0.55; }
.hak-chip-contoh { cursor: default; }
.hak-tombol { margin-top: 14px; }
.hak-bawaan { margin-top: 10px; }
/* Nama modul tetap terlihat saat tabel digeser ke samping di layar sempit. */
.hak-tabel th:first-child,
.hak-tabel td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.hak-tabel tr.hak-2fa td:first-child { background: #FFFBEB; }
.hak-tabel tr.hak-kelompok td:first-child { background: var(--surfaceAlt); }

/* ---------- log aktivitas & notifikasi (Tahap 1D) ---------- */

.saring-log { flex-direction: row; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.saring-log .isian { margin-bottom: 0; min-width: 150px; flex: 1; }
.saring-log .saring-tombol { flex: 0 0 auto; min-width: 0; }
.log-tabel td { vertical-align: top; }
.log-waktu { white-space: nowrap; }
.log-rincian { font-size: 12px; line-height: 1.6; max-width: 380px; }
.halaman { display: flex; align-items: center; gap: 12px; justify-content: center; }

.notif-baris {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 4px;
  border-top: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}
.notif-baris:first-child { border-top: none; }
.notif-baris:hover { background: var(--surfaceAlt); color: var(--text); }
.notif-baris .primary { font-size: 13px; }
.notif-baris .meta { font-size: 11.5px; color: var(--textMuted); margin-top: 2px; }
.notif-baris.baru .primary { font-weight: 700; }
.notif-baris.baru .primary::before { content: '● '; color: var(--menuActive); }

.sidebar-pengguna { position: relative; }
.lonceng {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 16px;
  text-decoration: none;
  opacity: 0.75;
}
.lonceng.ada { opacity: 1; }
.lonceng span {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #DC2626;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}
.sidebar.collapsed .lonceng { position: static; display: block; text-align: center; margin-bottom: 6px; }

/* ---------- dokumen (Tahap 1D-2) ---------- */

.pill-batal { background: #FEE2E2; color: #991B1B; letter-spacing: 0.06em; }
tr.baris-batal td { color: var(--textMuted); }
tr.baris-batal td strong, tr.baris-batal .teks-dokumen { text-decoration: line-through; }
.angka { font-variant-numeric: tabular-nums; white-space: nowrap; }
.form-buka { display: flex !important; gap: 6px; align-items: center; justify-content: flex-end; }
.form-buka .ctl { padding: 6px 9px; font-size: 12px; min-width: 200px; }
.page-title .pill { vertical-align: middle; margin-left: 6px; font-size: 11px; }

/* ---------- persetujuan & tanggal (Tahap 1D-3) ---------- */

.tanggal-bungkus { position: relative; display: flex; gap: 6px; align-items: stretch; }
.tanggal-bungkus .ctl-tanggal { flex: 1; font-variant-numeric: tabular-nums; }
.tanggal-kalender {
  border: 1px solid var(--border); background: var(--surface); border-radius: 10px;
  padding: 0 10px; cursor: pointer; font-size: 15px;
}
.tanggal-tersembunyi { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; }

.persetujuan-kotak {
  border: 1px solid #FDE68A; background: #FFFBEB; border-radius: 10px;
  padding: 11px 13px; font-size: 12.5px; margin-bottom: 12px; line-height: 1.5;
}
.form-pin { width: 100%; }
.persetujuan-baris { align-items: flex-start; }
.persetujuan-aksi { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.cara-baris { margin-bottom: 10px; }

/* ---------- Wizard pemasangan (Tahap 10A) ---------- */
.langkah-pasang { display: flex; gap: 6px 14px; list-style: none; padding: 0; margin: 0 0 18px; flex-wrap: wrap; }
.langkah-pasang li { display: flex; align-items: center; gap: 6px; font-size: 0.85em; color: var(--textMuted, #64748B); }
.langkah-pasang li span { width: 22px; height: 22px; border-radius: 50%; border: 1px solid currentColor; display: inline-flex; align-items: center; justify-content: center; font-size: 0.8em; }
.langkah-pasang li.aktif { color: #2563EB; font-weight: 600; }
.langkah-pasang li.aktif span { background: #2563EB; color: #fff; border-color: #2563EB; }
.langkah-pasang li.selesai { color: #16A34A; }
.daftar-syarat { list-style: none; padding: 0; margin: 0 0 16px; }
.daftar-syarat li { padding: 6px 0; border-bottom: 1px solid var(--border, #E2E8F0); }
.daftar-syarat li span { display: inline-block; width: 18px; }
.daftar-syarat li.ok span { color: #16A34A; }
.daftar-syarat li.gagal { color: #B91C1C; }
