:root {
  --hijau-tua: #0f4c3a;
  --hijau: #1a7a54;
  --hijau-terang: #2fbf80;
  --krem: #f7f4ec;
  --teks: #16241f;
  --merah: #c0392b;
  --kuning: #b8860b;
  --abu: #6b7770;
  --putih: #ffffff;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--krem);
  color: var(--teks);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  min-height: 100vh;
}

header.top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0 20px;
}
header.top .badge {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--hijau-tua);
  color: var(--putih);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
header.top h1 {
  font-size: 17px;
  margin: 0;
  line-height: 1.2;
}
header.top .sub {
  font-size: 12px;
  color: var(--abu);
}

.card {
  background: var(--putih);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(15, 76, 58, 0.08);
  margin-bottom: 16px;
}

#reader {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
#reader video { border-radius: var(--radius); }

.status-box {
  border-radius: var(--radius);
  padding: 28px 18px;
  text-align: center;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease;
}
.status-box.idle { background: #eceee9; color: var(--abu); }
.status-box.ok { background: var(--hijau-terang); color: #06301e; }
.status-box.deny { background: #f2b8b8; color: var(--merah); }
.status-box.warn { background: #f4dfa6; color: #7a5b00; }

.status-box .ikon { font-size: 44px; line-height: 1; }
.status-box .judul { font-size: 22px; font-weight: 700; }
.status-box .detail { font-size: 15px; opacity: 0.9; }
.status-box .waktu { font-size: 12px; opacity: 0.7; }

.stat-row {
  display: flex;
  gap: 10px;
}
.stat {
  flex: 1;
  background: var(--putih);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}
.stat .n { font-size: 22px; font-weight: 700; color: var(--hijau-tua); }
.stat .l { font-size: 11px; color: var(--abu); }

.manual {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.manual input {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #d8d3c4;
  font-size: 15px;
}
button {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  background: var(--hijau-tua);
  color: var(--putih);
  cursor: pointer;
}
button.secondary { background: var(--abu); }
button:active { opacity: 0.85; }

.menu-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.menu-item {
  display: block;
  background: var(--putih);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  color: var(--teks);
  box-shadow: 0 1px 3px rgba(15, 76, 58, 0.08);
}
.menu-item .t { font-weight: 700; font-size: 16px; }
.menu-item .d { font-size: 13px; color: var(--abu); margin-top: 2px; }

textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #d8d3c4;
  font-family: monospace;
  font-size: 13px;
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }
table th, table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid #eee; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.pill.belum { background: #eee; color: var(--abu); }
.pill.sudah_sholat { background: #d7f2e3; color: var(--hijau-tua); }
.pill.sudah_pulang { background: #dbeafe; color: #1e40af; }

.small-note { font-size: 12px; color: var(--abu); margin-top: 6px; }
label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 4px; margin-top: 10px; }
input[type=text], input[type=password] { width: 100%; padding: 10px; border-radius: 10px; border: 1px solid #d8d3c4; font-size: 14px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.logout-link {
  font-size: 12px;
  color: var(--abu);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  font-family: inherit;
}

select {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #d8d3c4;
  font-size: 14px;
  font-family: inherit;
  background: var(--putih);
}

.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  font-size: 13px;
  gap: 8px;
}
.user-row .peran { font-size: 11px; color: var(--abu); }
.user-row button { padding: 6px 8px; font-size: 11px; white-space: nowrap; }
