:root {
  /* Palet "PAPER-inspired · Modern Corporate Blue". */
  --bg: #F4F8FC;
  --surface: #FFFFFF;
  --ink: #102A56;
  --ink-2: #334155;
  --muted: #64748B;
  --line: #DCE5ED;
  --line-2: #E2F2F7;
  --primary: #2358A9;
  --primary-2: #418CD2;
  --primary-hover: #2478C5;
  --primary-soft: #E2F2F7;
  --primary-grad: linear-gradient(110deg, #102A56 0%, #2358A9 55%, #418CD2 100%);
  --cyan: #6BC8F2;
  --cyan-soft: #9FDEF4;
  --lime: #D2E69D;
  --bad: #BE123C;
  --bad-bg: #FFF1F3;
  --good: #047857;
  --good-bg: #ECFDF5;
  --warn: #B45309;
  --warn-bg: #FFFBEB;
  --info: #2478C5;
  --info-bg: #E2F2F7;
  --r-sm: 10px;
  --r-md: 14px;
  --r-xl: 22px;
  --shadow: 0 1px 2px rgba(16,42,86,.05), 0 2px 6px rgba(16,42,86,.06);
  --shadow-lg: 0 16px 40px rgba(16,42,86,.16), 0 4px 10px rgba(16,42,86,.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.container { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .brand {
  font-weight: 800; letter-spacing: -0.01em;
  background: var(--primary-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar nav { display: flex; gap: 6px; flex: 1; }
.topbar nav a { padding: 8px 12px; border-radius: var(--r-md); color: var(--muted); text-decoration: none; font-weight: 600; }
.topbar nav a:hover { background: var(--primary-soft); color: var(--primary); }
.topbar nav a.active { background: var(--primary-soft); color: var(--primary); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-grad); color: #fff; font-weight: 700; font-size: 13px;
}
.profile { position: relative; }
.profile-btn {
  display: flex; align-items: center; gap: 8px; border: 1px solid transparent; background: transparent;
  padding: 4px 8px 4px 4px; border-radius: 999px; cursor: pointer; font: inherit; color: var(--ink);
}
.profile-btn:hover { background: var(--line-2); }
.profile-btn .profile-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.profile-btn b { font-size: 13px; }
.profile-btn small { color: var(--muted); font-size: 12px; }
.profile-btn .chev { color: var(--muted); width: 16px; height: 16px; }
.profile-btn .chev svg { width: 16px; height: 16px; }
.profile-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 230px; z-index: 20;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: 8px; display: flex; flex-direction: column; gap: 2px;
}
.profile-menu[hidden] { display: none; }
.profile-menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
.profile-menu-head b { display: block; font-size: 13px; }
.profile-menu-head small { color: var(--muted); font-size: 12px; word-break: break-all; }
.profile-menu a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 13.5px;
}
.profile-menu a svg { width: 17px; height: 17px; flex: none; }
.profile-menu a:hover { background: var(--primary-soft); color: var(--primary); }
.profile-menu a.danger { color: var(--bad); }
.profile-menu a.danger:hover { background: var(--bad-bg); color: var(--bad); }

h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.015em; margin: 0 0 4px; }
.muted { color: var(--muted); margin: 0 0 20px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 16px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; text-decoration: none; cursor: pointer; font-size: 14px;
}
.btn:hover { background: var(--line-2); }
.btn.primary {
  background: var(--primary-grad); border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px rgba(35,88,169,.32);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(35,88,169,.4); filter: brightness(1.04); }
.btn.primary:active { transform: translateY(0); }
.btn.block { width: 100%; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 20px 20px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .14s ease, box-shadow .14s ease;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat .ic {
  width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
}
.stat .ic svg { width: 19px; height: 19px; }
.stat.tone-good .ic { background: var(--good-bg); color: var(--good); }
.stat.tone-warn .ic { background: var(--warn-bg); color: var(--warn); }
.stat.tone-bad .ic { background: var(--bad-bg); color: var(--bad); }
.stat b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.stat span { color: var(--muted); font-size: 13px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 20px; }
.card-h { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-h h2 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }

table.tbl { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; }
table.tbl th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); padding: 10px 14px; background: var(--line-2); border-bottom: 1px solid var(--line); }
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); }
table.tbl tr:last-child td { border-bottom: 0; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 600; }

.search { display: flex; gap: 8px; margin-bottom: 16px; }
.search input { flex: 1; max-width: 320px; min-height: 38px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 0 12px; }

.alert { background: var(--bad-bg); color: var(--bad); padding: 10px 14px; border-radius: var(--r-md); margin-bottom: 16px; font-size: 14px; }

.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 80vh; }
.login-box {
  width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: 28px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 14px;
}
.login-box h1 {
  margin: 0; background: var(--primary-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.card-form, form.card-form {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 20px; display: flex; flex-direction: column; gap: 14px; max-width: 520px;
  box-shadow: var(--shadow);
}
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
input, select, textarea {
  min-height: 40px; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 8px 12px; font: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

.jamaah-pick { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.jamaah-row { display: flex; align-items: center; gap: 14px; padding: 9px 12px; border-bottom: 1px solid var(--line-2); font-weight: 500; }
.jamaah-row:last-child { border-bottom: 0; }
.jamaah-row .chk { flex: 1; display: flex; align-items: center; gap: 10px; font-weight: 500; }
.jamaah-row .chk input { min-height: auto; width: 16px; height: 16px; }
.jamaah-row .chk span { display: flex; flex-direction: column; }
.jamaah-row .chk small { color: var(--muted); font-size: 12px; font-weight: 400; }
.jamaah-row .kamar-select { min-height: 32px; width: 110px; padding: 2px 8px; }
.jamaah-row .pic-radio { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.jamaah-row .pic-radio input { min-height: auto; width: 15px; height: 15px; }

.badge-kamar { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--line-2); font-size: 12px; font-weight: 600; }

/* ===== Layout sidebar ===== */
.shell { display: flex; min-height: 100vh; }
.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sidebar {
  width: 240px; flex: none; background: var(--surface); border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px;
}
.sb-brand { padding: 4px 10px 18px; }
.sb-brand b {
  display: block; font-size: 17px; font-weight: 800; letter-spacing: -0.01em;
  background: var(--primary-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sb-brand small { color: var(--muted); font-size: 12px; }
.sb-group { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sb-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md);
  color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px;
}
.sb-nav a svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.sb-nav a:hover { background: var(--line-2); color: var(--primary); }
.sb-nav a.active { background: var(--primary-soft); color: var(--primary); }
.sb-nav a.active svg { color: var(--primary); }
.topbar { justify-content: space-between; gap: 12px; }
.topbar-title { color: var(--muted); font-size: 13px; font-weight: 600; }
.container { width: 100%; max-width: 1180px; margin: 0; }
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px; }
  .sb-brand { padding-bottom: 8px; }
  .sb-nav { flex-direction: row; flex-wrap: wrap; }
  .sb-group { display: none; }
  .topbar-title { display: none; }
  .topbar { justify-content: flex-end; }
}

/* ===== Foto & detail ===== */
.foto { position: relative; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; background: var(--primary-soft); color: var(--primary); font-weight: 700; flex: none; }
.foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.foto-sm { width: 36px; height: 36px; border-radius: 50%; font-size: 12px; }
.foto-lg { width: 120px; height: 160px; border-radius: var(--r-md); font-size: 32px; }
.cell-name { display: flex; align-items: center; gap: 10px; }
.cell-name a { color: var(--ink); font-weight: 600; text-decoration: none; }
.cell-name a:hover { color: var(--primary); }
.cell-name small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
a.rowlink { color: var(--primary); font-weight: 600; text-decoration: none; }
.detail { display: grid; grid-template-columns: 140px 1fr; gap: 20px; padding: 20px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 24px; }
.kv div span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.kv div b { font-weight: 600; word-break: break-word; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 13px; margin-bottom: 10px; }
.back svg { width: 15px; height: 15px; }
.back:hover { color: var(--primary); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filters select { max-width: 280px; }
