* { box-sizing: border-box; }
body {
  margin: 0; color: #e8eaf0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(-45deg, #0b0e14, #14202f, #1b1533, #0b0e14);
  background-size: 400% 400%;
  animation: bgmove 18s ease infinite;
  min-height: 100dvh;
}
@keyframes bgmove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
/* penting: jangan biarkan display menimpa atribut hidden */
#login-view[hidden], #app-view[hidden] { display: none; }
#login-view {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
}
#login-view .card { margin-top: 0; width: 100%; }
.wrap { max-width: 640px; margin: 0 auto; padding: 16px; }
header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: #161a22; border-bottom: 1px solid #262c38;
  position: sticky; top: 0; z-index: 5;
}
header .title { font-weight: 700; font-size: 18px; }
.hbtns button {
  background: none; border: 1px solid #2c3444; color: #e8eaf0;
  font-size: 18px; border-radius: 8px; padding: 4px 10px; margin-left: 6px; cursor: pointer;
}
.card {
  background: #161a22; border: 1px solid #262c38; border-radius: 12px;
  padding: 20px; margin-top: 40px;
}
.card h1 { margin: 0 0 4px; font-size: 22px; }
.sub { color: #9aa3b5; margin: 0 0 16px; font-size: 14px; }
input, textarea {
  width: 100%; background: #0f1115; color: #e8eaf0;
  border: 1px solid #2c3444; border-radius: 8px;
  padding: 10px 12px; margin-bottom: 10px; font-size: 15px;
  font-family: ui-monospace, monospace;
}
textarea { resize: vertical; }
button {
  background: #2c3444; color: #e8eaf0; border: none; border-radius: 8px;
  padding: 10px 16px; font-size: 15px; cursor: pointer;
}
button.primary { background: #2563eb; color: #fff; width: 100%; font-weight: 600; }
button.danger { background: #7f1d1d; color: #fecaca; width: 100%; font-weight: 600; margin-top: 8px; }
button.danger[hidden] { display: none; }
button:disabled { opacity: .5; cursor: default; }
.err { color: #f87171; font-size: 13px; min-height: 18px; }
.muted { color: #9aa3b5; font-size: 13px; margin-top: 8px; }
.box {
  background: #161a22; border: 1px solid #262c38; border-radius: 12px;
  padding: 16px; margin-bottom: 16px;
}
.box h2 { margin: 0 0 12px; font-size: 16px; }
.badge {
  background: #2c3444; border-radius: 10px; padding: 1px 9px;
  font-size: 12px; font-weight: 600; vertical-align: middle;
}
ul.rows { list-style: none; margin: 0; padding: 0; }
ul.rows li {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: #0f1115; border: 1px solid #262c38; border-radius: 8px;
  padding: 8px 10px; margin-bottom: 8px; font-size: 13px; word-break: break-all;
}
ul.rows .em { font-family: ui-monospace, monospace; }
ul.rows .num { color: #9aa3b5; font-weight: 700; margin-right: 4px; }
ul.rows .rsn { color: #9aa3b5; font-size: 11px; display: block; }
.del {
  background: #3f1d1d; color: #f87171; border-radius: 6px;
  padding: 4px 10px; font-size: 13px; flex-shrink: 0;
}
.tmp { font-size: 13px; color: #9aa3b5; padding: 6px 0; border-bottom: 1px dashed #262c38; }
.tmp b { color: #f87171; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }
.eye {
  position: absolute; right: 4px; top: 4px;
  background: none; border: none; font-size: 19px; line-height: 1;
  padding: 8px 10px; cursor: pointer; opacity: .45;
}
.eye.on { opacity: 1; }
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  display: flex; align-items: center; justify-content: center; z-index: 20; padding: 16px;
}
.modal[hidden] { display: none; }
.modal .card { margin: 0; width: 100%; max-width: 380px; }
.rowbtn { display: flex; gap: 10px; }
.rowbtn button { flex: 1; }
.rowbtn .primary { width: auto; }
