:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --border: #e2e8e5;
  --text: #1c2a24;
  --muted: #64746d;
  --primary: #0f7a55;
  --primary-hover: #0b6446;
  --indigo: #4f46e5;
  --red: #c2413b;
  --amber: #b26b00;
  --blue: #2563eb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 40, 30, 0.06);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif, "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji";
  --mono: ui-monospace, Consolas, monospace, "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji";
  color: var(--text);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 14px; line-height: 1.5; }
h1, h2 { margin: 0 0 8px; }
h2 { font-size: 15px; }
code { background: #eef2f0; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.error { color: var(--red); }
.ok-text { color: var(--primary); }

/* ---------- header ---------- */
.topbar { background: #0f2219; color: #fff; position: sticky; top: 0; z-index: 40; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04), 0 2px 8px rgba(0, 0, 0, 0.12); }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 0 16px; height: 60px; display: flex; gap: 20px; align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #1aa673, #0b6446); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 20px; height: 20px; fill: #fff; stroke: #fff; stroke-width: 0; }
.brand-mark svg path:last-child { fill: none; stroke-width: 1.6; }
.brand-text { display: grid; line-height: 1.15; min-width: 0; }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: 0.01em; }
.brand-sub { font-size: 11px; color: #9fb8ab; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }

.tabs { display: flex; gap: 2px; height: 100%; margin-right: auto; }
.tab { white-space: nowrap; position: relative; background: transparent; border: 0; color: #a9c0b4; padding: 0 14px; cursor: pointer; font: inherit; font-weight: 500; height: 100%; }
.tab:hover { color: #fff; }
.tab.active { color: #fff; }
.tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: #2fc48a; }

.top-right { display: flex; align-items: center; gap: 12px; }
.wa-pill { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 12px; font-weight: 600; color: #d6e5dd; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 999px; padding: 5px 11px; cursor: pointer; white-space: nowrap; }
.wa-pill:hover { background: rgba(255, 255, 255, 0.1); }
.wa-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #8aa197; }
.wa-pill.on .dot { background: #2fc48a; box-shadow: 0 0 0 3px rgba(47, 196, 138, 0.25); }
.wa-pill.bad .dot { background: #ef6b63; box-shadow: 0 0 0 3px rgba(239, 107, 99, 0.25); }
.wa-pill.idle .dot { background: #e5b445; }

.usermenu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 9px; background: transparent; border: 0; color: #fff; font: inherit; cursor: pointer; padding: 4px 6px; border-radius: 10px; }
.user-btn:hover, .user-btn[aria-expanded="true"] { background: rgba(255, 255, 255, 0.08); }
.user-meta { display: grid; text-align: left; line-height: 1.15; }
.user-name { font-weight: 600; font-size: 13px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 11px; color: #9fb8ab; }
.chev { width: 14px; height: 14px; fill: none; stroke: #9fb8ab; stroke-width: 2; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #e3f5ec; color: #0b6446; display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16); padding: 6px; z-index: 60; }
.menu-head { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; font: inherit; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--text); }
.menu button:hover { background: #f1f5f3; }
.menu button.danger { color: var(--red); }

.container { max-width: 1280px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.view { display: grid; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.head-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.head-tools .search { width: 220px; }
.grid2 { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.stack { display: grid; gap: 8px; margin-bottom: 8px; align-content: start; }

/* ---------- form ---------- */
label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: #34453d; }
.check, label.inline { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.file-btn.disabled { opacity: 0.55; pointer-events: none; }
input, select, textarea {
  font: inherit; font-size: 13px; color: var(--text); background: #fbfcfb;
  border: 1px solid #cfd9d4; border-radius: 7px; padding: 7px 9px; width: 100%; min-width: 0;
}
input[type="checkbox"] { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(15, 122, 85, 0.25); border-color: var(--primary); background: #fff; }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 12px; align-items: end; }
.form-grid.guards { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); align-items: start; }
.form-grid.two { grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
.form-grid.guards label span { font-weight: 400; }
.form-end { display: flex; gap: 8px; justify-content: flex-end; align-items: end; flex-wrap: wrap; margin-top: 8px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.filter-row input, .filter-row select { width: auto; flex: 1 1 160px; }
.search { max-width: 260px; }

/* ---------- tombol ---------- */
.btn {
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 7px;
  border: 1px solid #cfd9d4; background: #fff; color: var(--text); padding: 8px 14px;
}
.btn:hover { background: #f1f5f3; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.indigo { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.btn.warn { background: #fff4e5; border-color: #f0c98a; color: var(--amber); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: #eef2f0; color: var(--text); }
.btn.danger { color: var(--red); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.block { width: 100%; }
.btn-icon { display: inline-flex; align-items: center; gap: 7px; }
.btn-icon .icon { width: 16px; height: 16px; fill: currentColor; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
button.link { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; font-weight: 500; color: var(--primary); cursor: pointer; text-transform: none; letter-spacing: 0; }
button.link:hover { text-decoration: underline; }

/* ---------- status ---------- */
.status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 12px; }
.label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.value { font-size: 16px; font-weight: 700; margin-top: 2px; }
.status-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.alert { border-radius: 8px; padding: 10px 12px; margin: 12px 0 0; font-size: 13px; }
.alert.warn { background: #fff7e8; border: 1px solid #f3d39c; color: #7a4a00; }
.alert.info { background: #eef4ff; border: 1px solid #c9d8f5; color: #29446e; margin: 0; }
#integrationWarnings { display: grid; gap: 10px; }
#integrationWarnings:empty { display: none; }
#integrationWarnings .alert { margin: 0; }
.label-head { display: flex; align-items: center; gap: 2px; }
.src-badge { display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 6px; border-radius: 4px; background: #eef2f0; color: #4a5a53; vertical-align: 1px; }
.src-badge.app { background: #e3f5ec; color: #0b6446; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- badge & chip ---------- */
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eef2f0; color: #4a5a53; white-space: nowrap; }
.badge.green { background: #e3f5ec; color: #0b6446; }
.badge.red { background: #fde8e7; color: var(--red); }
.badge.amber { background: #fff1db; color: var(--amber); }
.badge.blue { background: #e6eeff; color: var(--blue); }
.badge.indigo { background: #eceafe; color: var(--indigo); }
.badge.outline { background: transparent; border: 1px solid var(--border); color: var(--muted); margin-top: 4px; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }
.note { font-size: 11px; color: var(--muted); margin-top: 3px; flex-basis: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.chip { font: inherit; font-size: 12px; border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 4px 11px; cursor: pointer; color: #34453d; }
.chip:hover { border-color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- tabel ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: #f7f9f8; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px; border-bottom: 1px solid #eef2f0; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .w-draft { width: 34%; min-width: 260px; }
.table textarea { font-size: 12px; min-width: 240px; }
.table.compact td { padding: 6px 8px; }
.name { font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 28px !important; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 10px; }
.pager .muted { margin-right: auto; }

.activity { list-style: none; padding: 0; margin: 0; max-height: 260px; overflow: auto; font-size: 12px; }
.activity li { padding: 4px 0; border-bottom: 1px dashed #eef2f0; }
.activity li.warn { color: var(--amber); }
.activity li.error { color: var(--red); }

/* ---------- dialog, toast, login ---------- */
.dialog { border: 0; border-radius: 14px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2); }
.dialog::backdrop { background: rgba(10, 25, 18, 0.5); }
.dialog-body { padding: 20px; display: grid; gap: 12px; }
.dropzone { border: 2px dashed #9fd3bb; background: #f1faf5; border-radius: 10px; padding: 16px; text-align: center; cursor: pointer; font-weight: 500; }
details summary { cursor: pointer; font-size: 12px; font-weight: 600; margin-bottom: 6px; }

.toast { position: fixed; right: 16px; bottom: 16px; max-width: min(420px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 10px; color: #fff; font-size: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); z-index: 50; }
.toast.ok { background: #12261d; }
.toast.bad { background: var(--red); }

.login-body { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); display: grid; gap: 12px; padding: 24px; }
.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; }
.login-brand h1 { font-size: 18px; margin: 0; }
.login-brand p { margin: 2px 0 0; }

/* ---------- form tambahan ---------- */
h3 { font-size: 13px; margin: 16px 0 8px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.hint { font-weight: 400; font-size: 11.5px; color: var(--muted); }
.span-all { grid-column: 1 / -1; }
.input-row { display: flex; gap: 6px; }
.input-row input { flex: 1; }
.stack-form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field-label { font-size: 12px; font-weight: 600; color: #34453d; display: flex; justify-content: space-between; align-items: center; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg label { display: block; cursor: pointer; position: relative; }
.seg input, .check-chip input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.seg span { display: grid; gap: 2px; border: 1px solid #cfd9d4; border-radius: 9px; padding: 9px 11px; background: #fbfcfb; height: 100%; }
.seg span b { font-size: 13px; }
.seg span small { font-weight: 400; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.seg input:checked + span { border-color: var(--primary); background: #effaf4; box-shadow: 0 0 0 1px var(--primary) inset; }
.seg input:focus-visible + span { outline: 2px solid rgba(15, 122, 85, 0.35); }

.check-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.check-chip { display: inline-flex; cursor: pointer; position: relative; }
.check-chip span { font-size: 12px; font-weight: 500; border: 1px solid #cfd9d4; border-radius: 999px; padding: 5px 11px; background: #fff; color: #34453d; }
.check-chip input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.check-chip input:focus-visible + span { outline: 2px solid rgba(15, 122, 85, 0.35); }

.progress-box { margin-top: 14px; border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: #fafcfb; }
.progress-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.bar { height: 8px; background: #e5ece8; border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #1aa673, #0f7a55); transition: width 0.4s ease; }
.pp-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(110px, 100%), 1fr)); gap: 8px; margin-top: 10px; }
.pp-stats div { display: grid; }
.pp-stats b { font-size: 16px; }
.pp-stats span { font-size: 11px; color: var(--muted); }

/* ---------- pengaturan ---------- */
.settings-layout { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.side-nav { display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; position: sticky; top: 76px; }
.side-link { text-align: left; background: none; border: 0; font: inherit; font-weight: 500; color: #34453d; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.side-link:hover { background: #f1f5f3; }
.side-link.active { background: #e3f5ec; color: #0b6446; font-weight: 600; }
.settings-panels, .panel { display: grid; gap: 16px; min-width: 0; }

.login-box { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 16px; padding: 16px; border: 1px dashed #9fd3bb; border-radius: 12px; background: #f6fbf8; }
.login-box h3 { margin-top: 0; }
.login-box ol { padding-left: 18px; margin: 6px 0 10px; }
.qr-frame { width: 236px; height: 236px; background: #fff; border: 1px solid var(--border); border-radius: 10px; display: grid; place-items: center; padding: 8px; }
.qr-frame img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.pair-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.pair-form label { flex: 1 1 220px; }
.pair-code { font-family: var(--mono); font-size: 30px; font-weight: 700; letter-spacing: 0.18em; color: #0b6446; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px; display: inline-block; margin: 12px 0 6px; }
.code-help pre { background: #12261d; color: #d6e5dd; border-radius: 8px; padding: 10px 12px; font-size: 12px; overflow-x: auto; white-space: pre; }
.user-cell { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- langkah dashboard & poster ---------- */
.step { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; margin-right: 6px; vertical-align: 1px; }
.col-stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.stack-form.compact { gap: 10px; }
.poster-box { display: flex; gap: 12px; align-items: flex-start; }
.poster-thumb { width: 96px; height: 120px; flex: none; border: 1px dashed #b8cbc2; border-radius: 8px; background: #f7faf8; display: grid; place-items: center; overflow: hidden; text-align: center; padding: 4px; }
.poster-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.poster-actions { display: grid; gap: 6px; flex: 1; min-width: 0; }
.file-btn { position: relative; justify-self: start; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.tpl-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; margin-top: 8px; }
.tpl-editor, .tpl-side { display: grid; gap: 10px; align-content: start; min-width: 0; }
#tplText { font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
.chip.ph { font-family: var(--mono); font-size: 11.5px; }
.tpl-ok { color: var(--primary); }
.tpl-warn { color: var(--amber); }
.variant-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.variant-list li { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: #fafcfb; font-size: 12px; }
.variant-list .v-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.variant-list pre { margin: 0; white-space: pre-wrap; font-family: var(--mono); font-size: 11.5px; color: #34453d; }
.preview-list { display: grid; gap: 8px; }
.preview-msg { background: #e7f8ee; border: 1px solid #c5e9d4; border-radius: 10px 10px 10px 2px; padding: 8px 10px; font-size: 12.5px; white-space: pre-wrap; }
.preview-msg .meta { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 4px; white-space: normal; }
.chip.emoji { font-size: 15px; padding: 2px 8px; line-height: 1.3; }
.draft-counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.count-pill { font-size: 12px; border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px; background: #fafcfb; color: #4a5a53; }
.count-pill b { font-size: 13px; color: var(--text); }
.count-pill.green { background: #e3f5ec; border-color: #bfe6d0; }
.count-pill.amber { background: #fff1db; border-color: #f3d39c; }
.count-pill.blue { background: #e6eeff; border-color: #c9d8f5; }
#sendCounts { margin: 4px 0 4px; }
.draft-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
#draftCounts { padding-top: 14px; border-top: 1px solid var(--border); }
#draftCounts + .draft-actions { border-top: 0; padding-top: 4px; }
.meters { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 12px; margin: 8px 0 16px; }
.meter { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #fafcfb; }
.meter .bar { margin: 6px 0 4px; }
.meter .bar.warn span { background: linear-gradient(90deg, #e5b445, #b26b00); }
.meter .bar.full span { background: linear-gradient(90deg, #ef6b63, #c2413b); }

@media (max-width: 960px) {
  .user-meta, .chev { display: none; }
  .brand-sub { display: none; }
}

@media (max-width: 860px) {
  .grid2, .settings-layout, .tpl-grid, .draft-actions { grid-template-columns: 1fr; }
  .side-nav { position: static; display: flex; overflow-x: auto; }
  .side-link { white-space: nowrap; }
  .search { max-width: none; width: 100%; }
  .head-tools { width: 100%; }
  .head-tools .search { flex: 1; width: auto; }
  .topbar-inner { height: auto; flex-wrap: wrap; padding: 8px 16px 0; gap: 8px 12px; }
  .tabs { order: 3; width: 100%; height: 42px; overflow-x: auto; margin-right: 0; }
  .top-right { margin-left: auto; }
}

@media (max-width: 560px) {
  .seg { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .wa-pill #waPillText { display: none; }
}

/* ================= alur langkah dashboard ================= */

html { scroll-behavior: smooth; }
.step-card { scroll-margin-top: 140px; }
.stepper {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px;
  position: sticky; top: 60px; z-index: 30; margin: -4px 0 0; padding: 10px 0;
  background: linear-gradient(var(--bg) 80%, rgba(245, 247, 246, 0));
}
.stepper a {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  text-decoration: none; color: var(--text); font-weight: 600; font-size: 13px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; min-width: 0;
}
.stepper a:hover { border-color: var(--primary); }
.stepper a .step { grid-row: 1 / 3; margin: 0; background: #cfd9d4; color: #34453d; }
.stepper a .step-hint { font-size: 11px; font-weight: 400; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper a.done { border-color: #bfe6d0; background: #f3fbf6; }
.stepper a.done .step { background: var(--primary); color: #fff; font-size: 0; }
.stepper a.done .step::before { content: "✓"; font-size: 12px; }
.stepper a.active { border-color: #c9d8f5; background: #f2f6ff; }
.stepper a.active .step { background: var(--blue); color: #fff; }

.event-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px 24px; align-items: start; }
.event-grid .form-end { margin-top: 0; }
.send-status { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.send-status #stWorker { margin: 10px 0 0; }
#statusCard .card-head .actions { display: flex; gap: 8px; }

@media (max-width: 860px) {
  .stepper { position: static; display: flex; overflow-x: auto; padding: 0 0 4px; background: none; scrollbar-width: none; }
  .stepper::-webkit-scrollbar { display: none; }
  .stepper a { flex: 0 0 auto; }
  .event-grid { grid-template-columns: 1fr; }
  .step-card { scroll-margin-top: 16px; }
}

/* ================= responsif: tablet & HP ================= */

.tabs, .side-nav { scrollbar-width: none; }
.tabs::-webkit-scrollbar, .side-nav::-webkit-scrollbar { display: none; }
.cell-wrap { overflow-wrap: anywhere; }
.name, .preview-msg, .variant-list pre, .activity li, .alert { overflow-wrap: anywhere; }
.dialog { max-height: calc(100dvh - 32px); overflow: auto; }

@media (max-width: 720px) {
  .container { padding: 12px; gap: 12px; }
  .view { gap: 12px; }
  .card { padding: 14px; }
  .status-grid { grid-template-columns: 1fr 1fr; gap: 10px 12px; }
  .status-foot { gap: 8px; }
  .poster-box { flex-direction: column; }
  .poster-thumb { width: 100%; height: 160px; }
  .poster-thumb img { object-fit: contain; }
  .card-head { align-items: flex-start; }
  .card-head > .muted { width: 100%; }
  .pager { flex-wrap: wrap; }
  .pager .muted { width: 100%; }
  .filter-row input, .filter-row select, .filter-row .btn { flex: 1 1 100%; }
  .filter-row label.inline { flex: 1 1 45%; }
  .chips { gap: 6px; }
  #leadFilters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  #leadFilters::-webkit-scrollbar { display: none; }
  #leadFilters .chip { white-space: nowrap; }
  .login-box { padding: 12px; gap: 12px; }
  .qr-frame { width: 100%; max-width: 260px; height: auto; aspect-ratio: 1; margin: 0 auto; }
  .pair-code { font-size: 24px; letter-spacing: 0.12em; }
  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .menu { position: fixed; top: 64px; right: 12px; left: auto; }

  /* Tabel → kartu: setiap baris jadi kartu dengan label kolom. */
  .table-wrap:has(> .table.cards) { border: 0; overflow: visible; border-radius: 0; }
  .table.cards thead { display: none; }
  .table.cards, .table.cards tbody { display: block; }
  .table.cards tr {
    display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: row dense; gap: 8px 12px;
    border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #fff;
  }
  .table.cards td { display: block; padding: 0; border: 0; min-width: 0; }
  .table.cards td.cell-full, .table.cards td.empty { grid-column: 1 / -1; }
  .head-tools .search { flex: 1 1 100%; }
  .head-tools .btn { flex: 1 1 auto; }
  .table.cards td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 3px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
  }
  .table.cards td.right { text-align: left; }
  .table.cards td.nowrap { white-space: normal; }
  .table.cards .cell-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; border-top: 1px solid #eef2f0; }
  .table.cards .cell-actions .btn { flex: 1 1 auto; }
  .table.cards .w-draft, .table.cards textarea { min-width: 0; width: 100%; }
  .table.cards td.empty { border: 1px dashed var(--border); border-radius: 10px; }
  .table.cards tr:has(td.empty) { display: block; border: 0; padding: 0; }
}

/* Layar sentuh: target minimal ±36px & font input 16px (mencegah iPhone zoom otomatis). */
@media (max-width: 720px), (pointer: coarse) {
  input, select, textarea, #tplText, .table textarea { font-size: 16px; }
  input:not([type=checkbox]):not([type=radio]), select { min-height: 42px; }
  .btn { min-height: 40px; }
  .btn.small { min-height: 36px; }
  .chip, .check-chip span { min-height: 36px; display: inline-flex; align-items: center; }
  .chip.emoji { min-width: 40px; justify-content: center; font-size: 18px; }
  .wa-pill { min-height: 36px; min-width: 36px; justify-content: center; }
  .user-btn { min-height: 40px; }
  .side-link { min-height: 40px; }
  .tab { min-height: 42px; }
  input[type=checkbox] { width: 18px; height: 18px; }
  .menu button { min-height: 44px; }
  .btn.block { min-height: 46px; font-size: 15px; }
}

@media (max-width: 360px) {
  .brand-name { font-size: 14px; }
  .brand-mark { width: 30px; height: 30px; }
  .tab { padding: 0 9px; font-size: 13px; }
  .status-grid { grid-template-columns: 1fr 1fr; }
  .value { font-size: 15px; }
}

/* Desktop lebar: manfaatkan ruang tanpa membuat baris teks terlalu panjang. */
@media (min-width: 1600px) {
  .topbar-inner, .container { max-width: 1440px; }
}
