:root {
  --bg: #EEF1F5;
  --card: #FFFFFF;
  --line: #E8ECF1;
  --line-strong: #DCE1E7;
  --field: #F7F9FB;
  --ink: #10252B;
  --ink-2: #3B4A52;
  --muted: #5E6A73;
  --orange: #F07A1A;
  --orange-ink: #8A3D06;
  --orange-link: #B8520A;
  --peach: #FDF1E7;
  --blue: #1E88F0;
  --blue-ink: #1565C0;
  --sky: #EAF3FC;
  --red: #C62828;
  --red-tint: #FCEAEA;
  --r-card: 28px;
  --r-field: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Figtree', system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: var(--orange-link); }
a:hover { color: #8A3D06; }
input, select, button, textarea { font: inherit; color: inherit; }
h1, h2 { font-weight: 500; }
.inline { display: inline; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.right { text-align: right; }

/* ---- Tombol & pil ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn-block { width: 100%; height: 54px; font-size: 16px; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #1B3238; color: #fff; }
.btn-light { background: #fff; color: var(--ink); border-color: var(--line-strong); font-weight: 500; }
.btn-danger { background: #fff; color: var(--red); border-color: #E9B4B4; }
.link-btn { background: none; border: 0; padding: 0; color: var(--orange-link); text-decoration: underline; cursor: pointer; }
.link-btn.danger { color: var(--red); }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 20px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; font-size: 15px; white-space: nowrap; }
.pill-muted { color: var(--muted); }
.pill-muted b { color: var(--ink); font-weight: 700; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #F1F4F7; color: var(--ink-2); font-size: 12px; font-weight: 600; }
.badge-red { background: var(--red-tint); color: var(--red); }

/* ---- Kerangka aplikasi ---- */
.shell { max-width: 1440px; margin: 0 auto; padding: 24px 32px 40px; }
.topbar { display: flex; align-items: center; gap: 12px; min-height: 56px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.logo { display: inline-flex; flex-direction: column; line-height: 1; text-decoration: none; color: var(--ink); }
.logo-word { font-size: 30px; font-weight: 700; letter-spacing: -1.2px; }
.logo-sub { align-self: flex-end; font-size: 12px; font-weight: 600; color: var(--muted); }
.tag-admin { align-self: flex-start; margin-top: 6px; padding: 3px 10px; border-radius: 999px; background: var(--orange); color: var(--ink); font-size: 12px; font-weight: 700; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--peach); color: var(--orange-link); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.frame { display: flex; gap: 28px; margin-top: 22px; }
.rail { display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
.rail-btn { width: 52px; height: 52px; border-radius: 50%; background: #fff; border: 1px solid #E6EAEF; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; padding: 0; }
.rail-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.rail-btn.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.rail-btn.is-off { opacity: 0.4; cursor: default; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.subtitle { margin: 0 0 4px; font-size: 18px; color: var(--muted); }
.title { margin: 0; font-size: 44px; letter-spacing: -1.5px; line-height: 1.05; }
.search input { height: 48px; width: 300px; padding: 0 20px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--field); }

/* ---- Kartu & grid ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; font-size: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.split { display: flex; gap: 16px; align-items: flex-start; }
.split .grow { flex: 1; min-width: 0; }
.split .side { width: 360px; flex-shrink: 0; }
.tint-peach { background: var(--peach); border-radius: 24px; }
.tint-blue { background: var(--sky); border-radius: 24px; }
.stat { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 24px; }
.stat b { font-size: 32px; font-weight: 600; letter-spacing: -1px; line-height: 1.1; }
.stat.tint-peach span { color: var(--orange-ink); }
.stat.tint-blue span { color: var(--blue-ink); }
.stat-dark { background: var(--ink); color: #fff; }
.stat-dark span { color: #B9C6CC; }

/* ---- Langkah persiapan ---- */
.step { display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: 24px; background: #fff; border: 1px solid var(--line); }
.step-head { display: flex; justify-content: space-between; align-items: center; }
.step-no { font-size: 13px; font-weight: 600; color: var(--muted); }
.step-dot { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.step-title { font-size: 19px; font-weight: 600; }
.step-text { font-size: 14px; color: var(--muted); }
.step .btn { align-self: flex-start; margin-top: 4px; height: 44px; }
.step.is-current { background: var(--peach); border-color: var(--peach); }
.step.is-current .step-no { color: var(--orange-ink); }
.step.is-done { opacity: 0.7; }
.step.is-done .step-title { text-decoration: line-through; }
.step.is-done .step-dot { background: var(--ink); border-color: var(--ink); }

/* ---- Tabel ---- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 8px; text-align: left; border-top: 1px solid #EEF1F4; font-size: 14px; vertical-align: middle; }
.table th { border-top: 0; padding-top: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.table td.right, .table th.right { text-align: right; }

/* ---- Form ---- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form + .form { margin-top: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.field input, .field select, .field textarea { height: 50px; border: 1px solid var(--line-strong); border-radius: var(--r-field); padding: 0 18px; background: var(--field); font-size: 15px; font-weight: 400; }
.field input:focus, .search input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.field input[aria-invalid="true"] { border-color: var(--red); }
.field-hint { font-size: 13px; font-weight: 400; color: var(--muted); }
.field-error { font-size: 13px; font-weight: 500; color: var(--red); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); flex-shrink: 0; }

/* ---- Pesan ---- */
.flash { padding: 14px 18px; border-radius: 18px; font-size: 15px; background: #fff; border: 1px solid var(--line); }
.flash-ok { background: var(--sky); border-color: var(--sky); color: #0D3F75; }
.flash-error { background: var(--red-tint); border-color: var(--red-tint); color: #8E1C1C; }
.flash-warn { background: var(--peach); border-color: var(--peach); color: #5E2C06; }
.flash-warn .link-btn { margin-left: 6px; }

/* ---- Halaman masuk/daftar ---- */
.auth { max-width: 1280px; margin: 0 auto; min-height: 100vh; padding: 26px 32px; display: flex; gap: 28px; }
.auth-intro { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 8px 4px; }
.auth-title { margin: 0; font-size: 54px; font-weight: 500; letter-spacing: -2px; line-height: 1.03; }
.feature-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.feature { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 24px; background: #fff; border: 1px solid var(--line); }
.feature.tint-peach { background: var(--peach); border-color: transparent; }
.feature.tint-blue { background: var(--sky); border-color: transparent; }
.auth-intro .logo { align-self: flex-start; }
.feature b { font-size: 18px; font-weight: 600; }
.feature span { font-size: 14px; color: var(--muted); }
.auth-card { width: 460px; flex-shrink: 0; align-self: flex-start; border-radius: 32px; padding: 32px; }
.auth-card .card-head h2 { font-size: 30px; letter-spacing: -0.8px; }
.auth-card .flash { margin-bottom: 14px; }
.center-card { max-width: 480px; margin: 12vh auto; }

@media (max-width: 960px) {
  .shell, .auth { padding: 16px; }
  .auth { flex-direction: column; }
  .auth-card { width: 100%; }
  .auth-title { font-size: 36px; }
  .feature-row, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .frame { flex-direction: column; gap: 14px; }
  .rail { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .split { flex-direction: column; }
  .split .side { width: 100%; }
  .title { font-size: 34px; }
  .topbar-right .pill-muted { display: none; }
  .search input { width: 100%; }
}

/* ---- Nomor WA ---- */
.stack { display: flex; flex-direction: column; gap: 12px; }
.row-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; text-decoration: none; color: var(--ink); padding: 20px 24px; }
.row-card:hover { border-color: var(--line-strong); color: var(--ink); }
.row-main { display: flex; flex-direction: column; gap: 2px; }
.row-main b { font-size: 18px; font-weight: 600; }
.badge-blue { background: var(--sky); color: var(--blue-ink); }
.badge-orange { background: var(--peach); color: var(--orange-ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.qr-box { align-self: center; width: 264px; height: 264px; padding: 12px; border-radius: 24px; background: #fff; border: 1px solid var(--line); }
.qr-box svg { width: 100%; height: 100%; display: block; }
.steps-ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }

/* ---- Chat Room ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.chat-list { display: flex; flex-direction: column; }
.chat-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 6px; border-top: 1px solid #EEF1F4; text-decoration: none; color: var(--ink); }
.chat-row:first-child { border-top: 0; }
.chat-row:hover { background: var(--field); }
.chat-row .row-main b { font-size: 16px; }
.chat-row .row-main .muted { display: block; max-width: 640px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.chat-box { display: flex; flex-direction: column; gap: 14px; }
.bubbles { display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow-y: auto; padding: 4px; }
.bubble { max-width: 76%; padding: 10px 14px; border-radius: 18px; overflow-wrap: anywhere; }
.bubble-text { white-space: pre-wrap; }
.bubble.is-in { align-self: flex-start; background: #F1F4F7; border-bottom-left-radius: 6px; }
.bubble.is-out { align-self: flex-end; background: var(--sky); border-bottom-right-radius: 6px; }
.bubble.is-note { align-self: center; background: var(--peach); color: #5E2C06; font-size: 13px; max-width: 90%; }
.bubble-meta { margin-top: 4px; font-size: 12px; color: var(--muted); }
.send-row { display: flex; gap: 10px; align-items: flex-end; }
.send-row textarea { flex: 1; min-height: 52px; border: 1px solid var(--line-strong); border-radius: 18px; padding: 12px 16px; background: var(--field); resize: vertical; }
.field textarea { height: auto; padding: 12px 18px; resize: vertical; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.key-now { font-size: 14px; font-weight: 400; color: var(--muted); }
.key-now b { color: var(--ink); font-weight: 600; }
@media (max-width: 960px) { .grid-2 { grid-template-columns: 1fr; } }
