/* Prime Group: dashboard iklan.
   Navy = struktur, amber = "perlu perhatian / sedang berlaku", hijau = siap. */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/plus-jakarta-sans.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bg: #edf1f5;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --ink: #14202e;
  --muted: #5b6878;
  --line: #dbe2ea;
  --line-strong: #c3cdd8;
  --navy: #10263d;
  --navy-2: #1b3d61;
  --navy-tint: #e8eff7;
  --side-ink: #eaf0f6;
  --side-muted: #9db0c5;
  --amber: #d99a2b;
  --amber-ink: #8a5800;
  --amber-bg: #fbf0d9;
  --ok: #1b7a4e;
  --ok-bg: #e1f2e9;
  --err: #b42318;
  --err-bg: #fde8e5;
  --focus: #d99a2b;
  --r-panel: 14px;
  --r-ctl: 9px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d141c;
    --surface: #141e29;
    --surface-2: #1a2633;
    --ink: #e5ebf1;
    --muted: #93a2b2;
    --line: #233142;
    --line-strong: #31445a;
    --navy: #09111a;
    --navy-2: #3b6c9f;
    --navy-tint: #18293b;
    --side-ink: #e5ebf1;
    --side-muted: #8ea2b8;
    --amber: #e3a843;
    --amber-ink: #f0c475;
    --amber-bg: #2f2410;
    --ok: #5cc38f;
    --ok-bg: #11301f;
    --err: #ff8b7b;
    --err-bg: #3a1a16;
    --focus: #e3a843;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--font);
  font-feature-settings: "tnum" 0;
}
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 26px; font-weight: 750; letter-spacing: -0.015em; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
a { color: var(--navy-2); }
b, strong { font-weight: 700; }
code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em; background: var(--surface-2); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 6px;
}
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
@media (prefers-color-scheme: dark) {
  a { color: #8fb8e3; }
  .side { border-right: 1px solid var(--line); }
}

/* ---------- Shell: sidebar + kandungan ---------- */
.shell {
  display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(90deg, var(--navy) 0 252px, transparent 252px);
}
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 14px 16px;
  background: var(--navy); color: var(--side-ink);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; color: inherit; text-decoration: none; }
.brand strong { display: block; font-size: 15px; letter-spacing: -0.005em; }
.brand small { display: block; color: var(--side-muted); font-size: 12.5px; }
.brand-mark {
  display: grid; place-items: center; flex: none;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--amber); color: #10263d; font-weight: 800; font-size: 14px; letter-spacing: 0.02em;
}
.nav { display: grid; gap: 2px; margin-top: 30px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 9px;
  color: var(--side-muted); text-decoration: none; font-weight: 600; font-size: 14.5px;
}
.nav a:hover { color: var(--side-ink); background: rgb(255 255 255 / 0.06); }
.nav a.active { color: #fff; background: rgb(255 255 255 / 0.1); box-shadow: inset 3px 0 0 var(--amber); }
.nav hr { border: 0; border-top: 1px solid rgb(255 255 255 / 0.09); margin: 10px 12px; width: calc(100% - 24px); }
.nav .count {
  margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 99px;
  background: rgb(217 154 43 / 0.2); color: #f3c470;
  font-style: normal; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.ok { background: #4cc38a; }
.dot.warn { background: var(--amber); }
.dot.err { background: #f0857a; }
.dot.muted { background: #5d7088; }
.me {
  margin-top: auto; padding: 14px 8px 0 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-top: 1px solid rgb(255 255 255 / 0.09);
}
.me strong { display: block; font-size: 14px; }
.me small { display: block; color: var(--side-muted); font-size: 12.5px; }
.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px;
  border: 0; background: transparent; color: var(--side-muted); cursor: pointer;
}
.icon-btn:hover { color: #fff; background: rgb(255 255 255 / 0.08); }

.main { padding: 40px 48px 72px; min-width: 0; }
.page { display: grid; gap: 24px; max-width: 1180px; }
.stack { display: grid; gap: 20px; min-width: 0; }
.stack:empty { display: none; }

/* ---------- Kepala halaman ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head > div:first-child { display: grid; gap: 6px; }
.lede { color: var(--muted); font-size: 15.5px; max-width: 64ch; }

/* Hero halaman Utama: satu ayat yang beritahu keadaan sekarang. */
.hero { display: grid; gap: 12px; padding: 4px 0 6px; }
.hero-greet { color: var(--muted); font-weight: 550; }
.hero-title {
  font-size: clamp(30px, 3.3vw, 42px); line-height: 1.1; font-weight: 780;
  letter-spacing: -0.025em; max-width: 26ch; text-wrap: balance;
}
.hero-sub { color: var(--muted); font-size: 17px; max-width: 62ch; }
.hero .row { margin-top: 6px; }
.hero.live .hero-title { display: flex; align-items: baseline; gap: 14px; }
.hero.live .hero-title::before {
  content: ""; flex: none; width: 12px; height: 12px; border-radius: 50%;
  background: var(--amber); transform: translateY(-0.12em);
  box-shadow: 0 0 0 0 rgb(217 154 43 / 0.55);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgb(217 154 43 / 0.55); }
  70% { box-shadow: 0 0 0 12px rgb(217 154 43 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(217 154 43 / 0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero.live .hero-title::before { animation: none; }
  .progress > i { transition: none; }
}

/* ---------- Panel ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-panel); padding: 20px 22px; min-width: 0;
}
.panel.flush { padding: 0; overflow: hidden; }
.panel.narrow { max-width: 640px; }
.panel > h2 + * { margin-top: 12px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head > div:first-child { display: grid; gap: 4px; }
.flow > * + * { margin-top: 12px; }
.link { font-size: 14px; font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
.hint { color: var(--muted); font-size: 13.5px; font-weight: 400; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 8px 0; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

/* ---------- Senarai semak setup ---------- */
.setup { padding: 0; overflow: hidden; }
.setup-head {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.setup-head > div { display: grid; gap: 2px; }
.progress { width: 180px; height: 6px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--amber); transition: width 0.5s ease; }
.steps-list { list-style: none; margin: 0; padding: 0; }
.step {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 16px 22px; border-top: 1px solid var(--line);
}
.step:first-child { border-top: 0; }
.step-mark {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--line-strong); color: #fff;
}
.step-mark .ico { width: 15px; height: 15px; stroke-width: 2.6; }
.step.done .step-mark { background: var(--ok); border-color: var(--ok); }
.step.done .step-title { color: var(--muted); }
.step.next { box-shadow: inset 3px 0 0 var(--amber); background: color-mix(in srgb, var(--amber-bg) 55%, transparent); }
.step.next .step-mark { border-color: var(--amber); }
.step-title { display: block; font-weight: 700; }
.step-note { color: var(--muted); font-size: 14px; margin-top: 2px; }
.setup-done summary {
  display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; font-weight: 600;
}
.setup-done summary::-webkit-details-marker { display: none; }
.setup-done summary .ico { color: var(--ok); stroke-width: 2.4; }
.setup-done summary .link { margin-left: auto; }
.setup-done[open] summary .link { visibility: hidden; }
.setup-done .steps-list { margin: 14px -22px -20px; border-top: 1px solid var(--line); }
.code-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Jalur status ---------- */
.status-line {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel);
}
.status-line > div { display: grid; gap: 1px; padding: 14px 20px; border-left: 1px solid var(--line); min-width: 0; }
.status-line > div:first-child { border-left: 0; }
.status-line span { color: var(--muted); font-size: 13px; }
.status-line strong { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-line small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-line small.tone-err { color: var(--err); }

/* ---------- Senarai baris ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.rows li:first-child { border-top: 0; padding-top: 4px; }
.rows li > div { display: grid; min-width: 0; }
.rows strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows small { font-size: 13px; }
.when { color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap; }

/* ---------- Butang ---------- */
.btn {
  font: inherit; font-weight: 650; font-size: 14px; line-height: 1.3;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--r-ctl);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn .ico { width: 16px; height: 16px; }
.btn.primary { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.btn.primary:hover { filter: brightness(1.12); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--err); }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn.block { width: 100%; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.mt { margin-top: 12px; }
.grow { flex: 1 1 220px; min-width: 0; }

/* ---------- Tag status ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 10px; border-radius: 999px; white-space: nowrap;
  font-size: 12.5px; font-weight: 650; background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line);
}
.tag .ico { width: 13px; height: 13px; stroke-width: 2.4; }
.tag.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.tag.warn { background: var(--amber-bg); color: var(--amber-ink); border-color: transparent; }
.tag.err { background: var(--err-bg); color: var(--err); border-color: transparent; }
.tone-ok { color: var(--ok); }
.tone-warn { color: var(--amber-ink); }
.tone-err { color: var(--err); }
.tone-muted { color: var(--muted); }

/* ---------- Amaran ---------- */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-radius: 12px; font-size: 14.5px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.alert .ico { margin-top: 2px; }
.alert.warn { background: var(--amber-bg); border-color: color-mix(in srgb, var(--amber) 35%, transparent); color: var(--amber-ink); }
.alert.err { background: var(--err-bg); border-color: color-mix(in srgb, var(--err) 30%, transparent); color: var(--err); }
.alert.small { font-size: 13.5px; padding: 10px 12px; }
.alert a { color: inherit; font-weight: 700; }
.error { color: var(--err); background: var(--err-bg); padding: 9px 12px; border-radius: 9px; font-size: 14px; }
.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 10px 10px 16px; border-radius: 12px;
  background: var(--navy-tint); border: 1px solid color-mix(in srgb, var(--navy-2) 25%, transparent);
  font-weight: 600; font-size: 14.5px;
}

/* ---------- Borang ---------- */
.form { display: grid; gap: 18px; }
label, .label { display: grid; gap: 6px; font-weight: 650; font-size: 14px; }
.label .hint, label .hint { font-weight: 400; }
.field { display: grid; gap: 6px; }
.field-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
input, textarea, select {
  font: inherit; font-weight: 400; color: inherit;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl); padding: 9px 12px; width: 100%;
}
textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--navy-2); }
input[type="datetime-local"], select { width: auto; }
label.inline { display: flex; align-items: center; gap: 10px; font-weight: 600; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 400; cursor: pointer; }
.fmt-bar { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.fmt-bar button {
  font: inherit; font-size: 13.5px; width: 32px; height: 28px; border: 0;
  background: var(--surface); color: var(--ink); cursor: pointer;
}
.fmt-bar button + button { border-left: 1px solid var(--line); }
.fmt-bar button:hover { background: var(--surface-2); }
.tpl-pick select { min-width: 240px; }

/* Gambar */
.drop {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border: 1.5px dashed var(--line-strong); border-radius: 12px;
  color: var(--muted); font-weight: 500; cursor: pointer;
}
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--navy-2); color: var(--ink); background: var(--surface-2); }
.drop:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.image-field.over .image-chosen { outline: 2px dashed var(--navy-2); outline-offset: 4px; border-radius: 10px; }
.image-chosen { display: flex; align-items: center; gap: 14px; }
.image-chosen > div { display: grid; gap: 8px; min-width: 0; }
.image-chosen strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-chosen img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); flex: none; }

/* Saluran */
.channels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.channel {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; font-weight: 400;
}
.channel input { margin-top: 3px; width: 17px; height: 17px; }
.channel > span { display: grid; gap: 1px; min-width: 0; }
.channel strong { font-size: 14.5px; }
.channel small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel:has(input:checked) { border-color: var(--navy-2); background: var(--navy-tint); }
.channel:has(input:disabled) { opacity: 0.6; cursor: not-allowed; }

/* Pemilih group */
.picker { display: grid; gap: 4px; }
.picker-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.picker-tools input[type="search"] { flex: 1 1 220px; width: auto; }
.picker-list {
  max-height: 300px; overflow-y: auto; display: grid; gap: 1px;
  border: 1px solid var(--line); border-radius: 12px; padding: 6px;
}
.picker-list label.check { padding: 7px 8px; border-radius: 8px; }
.picker-list label.check:hover { background: var(--surface-2); }
.picker-list label.check span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-list small { color: var(--muted); font-size: 13px; }
.picker-list .empty { padding: 12px; }
.picker > .label { margin-bottom: 2px; }

/* Segmen */
.segmented {
  display: inline-flex; justify-self: start; padding: 3px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px;
}
.segmented label { display: block; cursor: pointer; font-weight: 600; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 7px 20px; border-radius: 8px; color: var(--muted); }
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(16 38 61 / 0.14); }
.segmented input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }

/* ---------- Buat iklan: dua lajur ---------- */
.composer { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.composer-side { position: sticky; top: 24px; }
.summary { display: grid; gap: 12px; }
.summary > h2 + * { margin-top: 0; }
.bubble {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 4px 16px 16px 16px; padding: 10px 12px;
  max-height: 340px; overflow: auto; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere;
}
.bubble img { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 10px; margin-bottom: 8px; }
.bubble code { font-size: 13px; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 14px; margin: 4px 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 650; }
.save-tpl { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }

/* ---------- Kempen ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font: inherit; font-size: 13.5px; font-weight: 650;
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted);
}
.chip:hover { color: var(--ink); }
.chip[aria-selected="true"] { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.chip .n { margin-left: 6px; opacity: 0.75; font-variant-numeric: tabular-nums; }

/* ---------- Jadual ---------- */
.table-wrap { overflow-x: auto; position: relative; } /* relative: label sr-only kekal di dalam kotak skrol */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 13px; font-weight: 650; color: var(--muted);
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap;
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:last-child > td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.actions .btn { margin-left: 4px; }
.table tr.disabled td { color: var(--muted); }
.table .cb { width: 52px; }
.table tr.detail > td { background: var(--surface-2); padding: 6px 16px 14px; }
.table .snippet { color: var(--muted); font-size: 13.5px; max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table.inner { font-size: 13.5px; }
.table.inner td { padding: 7px 10px; }
.table.panelled th:first-child, .table.panelled td:first-child { padding-left: 22px; }
.table.panelled th:last-child, .table.panelled td:last-child { padding-right: 22px; }
.k-sched { white-space: nowrap; }
.k-sched small { display: block; color: var(--muted); font-size: 13px; }
.k-channels { display: grid; gap: 2px; white-space: nowrap; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ---------- Template ---------- */
.tpl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.tpl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; align-content: start; }
.tpl {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.tpl.editing { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.tpl img { display: block; width: 100%; height: 132px; object-fit: cover; object-position: center top; border-bottom: 1px solid var(--line); }
.tpl-body { display: grid; gap: 6px; padding: 14px 16px; flex: 1; align-content: start; }
.tpl-body p {
  color: var(--muted); font-size: 13.5px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.tpl-body small { color: var(--muted); font-size: 12.5px; }
.tpl-foot { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); }
.tpl-foot .danger { margin-left: auto; }
.tpl-editor { position: sticky; top: 24px; }
.empty-state {
  grid-column: 1 / -1; display: grid; gap: 6px; justify-items: start;
  padding: 28px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-panel); color: var(--muted);
}
.empty-state h3 { color: var(--ink); }
.empty-state .btn { margin-top: 8px; }

/* ---------- WhatsApp ---------- */
.wa-connect { display: flex; gap: 28px; flex-wrap: wrap; }
.wa-side { flex: 1 1 320px; display: grid; gap: 14px; align-content: start; }
.qr-box {
  width: 264px; height: 264px; flex: none; display: grid; place-items: center; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: var(--r-panel); background: #fff; padding: 12px; color: #4f5b69;
}
.qr-box img { width: 100%; height: 100%; image-rendering: pixelated; }
.howto { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.howto li::marker { color: var(--muted); font-weight: 700; }

.list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.advanced { margin-top: 10px; }
details > summary { cursor: pointer; font-weight: 600; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 50;
  padding: 11px 18px; border-radius: 10px; font-weight: 600; max-width: calc(100% - 32px);
  background: var(--ink); color: var(--bg); box-shadow: 0 8px 28px rgb(0 0 0 / 0.22);
}
.toast.err { background: var(--err); color: #fff; }

/* ---------- Log masuk ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--navy); }
.login-card { width: 100%; max-width: 390px; background: var(--surface); border-radius: 16px; padding: 30px; display: grid; gap: 22px; }
.login-card .brand { padding: 0; color: var(--ink); }
.login-card .brand small { color: var(--muted); }
.login-card form { display: grid; gap: 14px; }

/* ---------- Skrin kecil ---------- */
@media (max-width: 1100px) {
  .composer, .tpl-layout { grid-template-columns: minmax(0, 1fr); }
  .composer-side, .tpl-editor { position: static; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .side {
    position: sticky; top: 0; z-index: 20; height: auto;
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px 0;
  }
  .brand small { display: none; }
  .nav { order: 3; width: 100%; margin: 0; display: flex; overflow-x: auto; gap: 2px; scrollbar-width: none; }
  .nav hr { display: none; }
  .nav a { padding: 9px 10px; white-space: nowrap; border-radius: 8px 8px 0 0; }
  .nav a.active { box-shadow: inset 0 -3px 0 var(--amber); }
  .nav .dot, .nav .count { margin-left: 2px; }
  .me { margin: 0 0 0 auto; padding: 0; border: 0; }
  .me > span { display: none; }
  .main { padding: 22px 16px 56px; }
  .cols-2, .channels { grid-template-columns: minmax(0, 1fr); }
  .status-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-line > div:nth-child(odd) { border-left: 0; }
  .status-line > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .step { grid-template-columns: 28px minmax(0, 1fr); }
  .step-act { grid-column: 2; }
  .setup-head { flex-wrap: wrap; }
  .table td.actions { white-space: normal; }
  .qr-box { width: 100%; max-width: 280px; height: auto; aspect-ratio: 1; }
}

/* ---------- Ejen ---------- */
.status-line.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.owner { display: flex; align-items: center; gap: 5px; margin-top: 4px; color: var(--muted); font-size: 13px; font-weight: 500; }
.owner .ico { width: 14px; height: 14px; }
.via { display: grid; gap: 12px; padding-top: 18px; margin-top: 4px; border-top: 1px solid var(--line); }
.via-head { display: grid; gap: 4px; }
label.check.all-agents { padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; font-weight: 600; }
label.check.all-agents:has(input:checked) { border-color: var(--navy-2); background: var(--navy-tint); }
.table.agents td small { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }
.table.agents td small a { color: inherit; }
.table.agents td .tag + small { margin-top: 5px; }
.banner code.pw { font-size: 16px; letter-spacing: 0.06em; padding: 2px 8px; }
.banner .hint { display: block; margin-top: 4px; font-weight: 400; }
.page > .later { order: 5; }
.claim { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.claim .btn { flex: none; }
.hint.center { text-align: center; }
.done-title { font-size: 22px; }
@media (max-width: 900px) {
  .status-line.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
