:root {
  --ink: #1b2430;
  --muted: #5e675f;
  --paper: #f3efe6;
  --card: #fffdf8;
  --line: #e4d9c8;
  --green: #0d6b52;
  --green-dark: #084838;
  --sidebar: #10241c;
  --sidebar-text: #d7e6df;
  --amber: #8a5a12;
  --red: #8d2d2d;
  --shadow: 0 18px 40px rgba(40, 32, 18, 0.08);
  --sans: "Montserrat", "Segoe UI", sans-serif;
  --display: "Montserrat", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
}
body:not(.is-panel) {
  display: flex;
  flex-direction: column;
}
body:not(.is-panel) > .public-main,
body:not(.is-panel) > .narrow { flex: 1 0 auto; }
a { color: var(--green-dark); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

.topbar, .card, .stat, .alert, .photo, .table-wrap, .filters {
  border: 1px solid var(--line);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 7vw;
  background: #fffdf8;
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand-logo {
  height: 78px;
  width: auto;
  display: block;
  background: #fff;
  border-radius: 12px;
}
.sidebar .brand-logo {
  height: 96px;
  padding: 8px 12px;
}
.center-brand .brand-logo { height: 128px; }
.brand small, .muted, .help { color: var(--muted); }
.brand strong, h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.top-links { display: flex; gap: 10px; align-items: center; }
.public-main {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1.15fr);
  gap: 28px;
  padding: 32px 7vw 28px;
}
.lede h1 { font-size: clamp(2rem, 4vw, 3.4rem); line-height: 0.95; margin: 0 0 12px; }
.lede p { font-size: 1.12rem; line-height: 1.5; }
.steps { list-style: none; padding: 0; margin: 24px 0; }
.steps li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  margin: 12px 0;
}
.steps b {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e7f3ee;
  color: var(--green-dark);
}
.sheet {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sheet span, .badge, .role {
  border-radius: 999px;
  padding: 4px 10px;
  background: #efe7da;
  font-size: 0.86rem;
}
.card {
  background: var(--card);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.card h2 { margin-top: 0; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.form-col { max-width: 420px; }
dialog.modal {
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 0;
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
  color: inherit;
  background: var(--card);
}
dialog.modal::backdrop { background: rgba(16, 36, 30, 0.55); }
dialog.modal h2 { margin-top: 0; }
label span, .field-label { display: block; font-weight: 600; margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  border: 1px solid #d9cdb8;
  background: white;
  border-radius: 10px;
  padding: 11px 12px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(13, 107, 82, 0.18);
  border-color: var(--green);
}
.help { margin: 6px 0 0; font-size: 0.92rem; }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.photo {
  border-radius: 14px;
  padding: 12px;
  background: #faf7f1;
}
.photo img, .frame img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  margin-top: 8px;
  background: #ece4d6;
}
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn, button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: var(--green);
  color: white;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
}
.btn.secondary, button.secondary { background: #efe7da; color: var(--ink); }
.btn.danger, button.danger { background: var(--red); }
.icon-actions { flex-wrap: nowrap; gap: 8px; }
.icon-actions form { margin: 0; display: flex; }
.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}
.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn.ghost { background: transparent; color: var(--sidebar-text); border: 1px solid rgba(255,255,255,0.12); }
.alert {
  background: #fff4f1;
  color: var(--red);
  border-radius: 12px;
  padding: 10px 12px;
}
.narrow { max-width: 440px; margin: 8vh auto; padding: 0 16px; }
.login-card { padding: 28px; }
.center-brand {
  flex-direction: column;
  text-align: center;
  justify-content: center;
  margin-bottom: 18px;
}

.shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 22px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.sidebar a { color: inherit; text-decoration: none; }
.side-brand { justify-content: center; }
.side-user {
  display: grid;
  gap: 2px;
  padding: 0 8px;
}
.side-user small { color: #b7c9c0; }
.side-user .role { justify-self: start; margin-top: 6px; }
.side-nav { display: grid; gap: 4px; }
.side-nav a {
  padding: 11px 12px;
  border-radius: 12px;
  font-weight: 600;
}
.side-nav a.is-active,
.side-nav a:hover { background: rgba(255,255,255,0.08); }
.side-logout { margin-top: auto; }
.side-logout .ghost { width: 100%; }
.who { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.role { background: #e7f3ee; color: var(--green-dark); font-weight: 700; }
.sidebar .role { background: rgba(255,255,255,0.12); color: white; }
.content {
  min-width: 0;
  padding: 28px 32px 20px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.content h1 { margin: 0 0 6px; font-size: 1.75rem; }
.page-head { margin-bottom: 18px; }
.page-head p { margin: 0; }
.page-head, .filters, .split, .user-row, .status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.stat { background: white; border-radius: 16px; padding: 16px; text-decoration: none; color: inherit; }
.stat strong { display: block; font-size: 1.8rem; font-family: var(--display); }
.stat em { font-style: normal; color: var(--muted); }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.bars i {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: var(--green);
  margin-top: 6px;
}
.table-wrap { background: white; border-radius: 16px; overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.82rem; font-weight: 600; letter-spacing: 0.08em; color: var(--muted); }
.badge.menunggu { background: #f8e7c8; color: var(--amber); }
.badge.aktif { background: #e5f4ee; color: var(--green-dark); }
.badge.nonaktif { background: #f8e4e4; color: var(--red); }
.filters {
  margin: 0 0 16px;
  padding: 12px;
  background: white;
  border-radius: 16px;
}
.filters input, .filters select { width: auto; min-width: 160px; flex: 1; }
.status-row { align-items: end; margin-top: 8px; }
.status-row label { flex: 1; min-width: 180px; max-width: 280px; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
.detail { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; }
.frame img { height: 280px; }
.user-card, .stack > * { margin-bottom: 14px; }
.referral-url { margin: 8px 0 0; font-weight: 700; word-break: break-all; }
.site-footer {
  margin-top: auto;
  padding: 18px 16px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
}
.site-footer p { margin: 0; }
@media (max-width: 900px) {
  .public-main, .grid.two, .photos, .stats, .detail { grid-template-columns: 1fr; }
  .topbar, .public-main { padding-left: 16px; padding-right: 16px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .content { padding: 16px; }
  table { min-width: 680px; }
  .filters input, .filters select, .filters button { width: 100%; }
}
