/* White Sender — palet dari whitedesk.id: teal, krem, peach, hitam hangat */
:root {
  --teal-900: #1f5156; --teal-800: #28696f; --teal-700: #3e777d; --teal-100: #dfecea; --teal-50: #eef5f3;
  --cream: #f4f2de; --cream-soft: #fffef3; --peach: #e9b384; --peach-dark: #c98f5d; --peach-soft: #f8e4d2; --ink: #0a0500;
  --bg: #f6f4ea; --card: #fffef8; --text: #1d2422; --muted: #5f6a66; --line: #e6e1cd; --field: #fbfaf2;
  --ok: #2f8f5b; --warn: #a8701a; --bad: #b8433a; --bad-soft: #fbe6e3;
  --radius: 16px; --shadow: 0 1px 0 rgba(10,5,0,.04), 0 8px 24px -14px rgba(31,81,86,.22);
  --side: #28696f;
  --wa-panel: #ffffff; --wa-head: #f0f2f5; --wa-bg: #efeae2; --wa-in: #ffffff; --wa-out: #d9fdd3; --wa-text: #111b21;
  --wa-sub: #667781; --wa-line: #e9edef; --wa-hover: #f5f6f6; --wa-active: #f0f2f5; --wa-accent: #00a884; --wa-search: #f0f2f5;
  --wa-day: #ffffff; --wa-dot: rgba(17,27,33,.06); --wa-pill: #e7fce3; --wa-pill-text: #008069; --wa-icon: #54656f;
}
/* Tema gelap: otomatis ikut perangkat, atau dipaksa lewat Pengaturan (data-theme di <html>) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101716; --card: #17201f; --text: #ecefe6; --muted: #a3b2ad; --line: #283534; --field: #131b1a;
    --teal-100: #1f3634; --teal-50: #19292a; --peach-soft: #3a2b1f; --bad-soft: #3a2220; --side: #143a3d;
    --ok: #5cc48c; --warn: #e3a94f; --bad: #ef7a6e; --chip-text: #8fd0c6; --chip-peach: var(--peach);
    --wa-panel: #111b21; --wa-head: #202c33; --wa-bg: #0b141a; --wa-in: #202c33; --wa-out: #005c4b; --wa-text: #e9edef;
    --wa-sub: #8696a0; --wa-line: #222d34; --wa-hover: #202c33; --wa-active: #2a3942; --wa-search: #202c33;
    --wa-day: #182229; --wa-dot: rgba(233,237,239,.035); --wa-pill: #0a332c; --wa-pill-text: #00a884; --wa-icon: #aebac1;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101716; --card: #17201f; --text: #ecefe6; --muted: #a3b2ad; --line: #283534; --field: #131b1a;
  --teal-100: #1f3634; --teal-50: #19292a; --peach-soft: #3a2b1f; --bad-soft: #3a2220; --side: #143a3d;
  --ok: #5cc48c; --warn: #e3a94f; --bad: #ef7a6e; --chip-text: #8fd0c6; --chip-peach: var(--peach);
  --wa-panel: #111b21; --wa-head: #202c33; --wa-bg: #0b141a; --wa-in: #202c33; --wa-out: #005c4b; --wa-text: #e9edef;
    --wa-sub: #8696a0; --wa-line: #222d34; --wa-hover: #202c33; --wa-active: #2a3942; --wa-search: #202c33;
    --wa-day: #182229; --wa-dot: rgba(233,237,239,.035); --wa-pill: #0a332c; --wa-pill-text: #00a884; --wa-icon: #aebac1;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2, h3, .brand-name, .num-big { font-family: "Sen", system-ui, sans-serif; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--peach); outline-offset: 2px; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: var(--teal-50); padding: 1px 5px; border-radius: 5px; }
.dots { background-image: radial-gradient(rgba(244,242,222,.10) 1px, transparent 1px); background-size: 14px 14px; }

/* ---------- tombol ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 10px 16px;
  font-weight: 700; font-size: 14px; background: var(--teal-800); color: var(--cream-soft); box-shadow: 0 3px 0 var(--teal-900);
  transition: transform .08s, box-shadow .08s; white-space: nowrap; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--teal-900); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.peach { background: var(--peach); color: var(--ink); box-shadow: 0 3px 0 var(--peach-dark); }
.btn.ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.danger { background: var(--card); color: var(--bad); border: 1px solid var(--line); box-shadow: none; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 10px; }
.btn svg { width: 17px; height: 17px; flex: none; }
.link { color: var(--teal-700); font-weight: 700; font-size: 13px; background: none; border: 0; padding: 0; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line);
  background: var(--card); color: var(--teal-800); flex: none; padding: 0; }
.icon-btn svg { width: 19px; height: 19px; }

/* ---------- form ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 12px 0 5px; }
input, textarea, select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); color: var(--text); }
input:focus, textarea:focus, select:focus { border-color: var(--teal-700); outline: none; box-shadow: 0 0 0 3px var(--teal-100); }
textarea { min-height: 100px; resize: vertical; }
input[type="checkbox"] { width: 18px; height: 18px; margin: 0 8px 0 0; vertical-align: -4px; accent-color: var(--teal-800); }
label.check { display: flex; align-items: center; color: var(--text); font-weight: 600; margin: 10px 0; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; align-items: center; }

/* ---------- login ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--teal-800); }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border-radius: 22px; padding: 28px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.45); }
.auth-card .brand { color: var(--text); padding: 0 0 18px; }
.auth-card .brand small { color: var(--muted); }
.auth-card h1 { font-size: 22px; margin: 4px 0 2px; }
.auth-card .btn { width: 100%; margin-top: 18px; padding: 12px; }
.auth-error { color: var(--bad); font-size: 13px; margin-top: 10px; min-height: 1em; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { background-color: var(--side); color: var(--cream); padding: 20px 14px 16px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--cream-soft); }
.brand-name { font-size: 19px; font-weight: 800; line-height: 1.1; }
.brand small { display: block; font-size: 11px; font-weight: 600; color: rgba(244,242,222,.65); letter-spacing: .04em; margin-top: 2px; }
.nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; background: none;
  border-radius: 12px; color: rgba(244,242,222,.85); font-weight: 600; font-size: 14px; text-align: left; }
.nav button:hover { background: rgba(244,242,222,.09); color: var(--cream-soft); }
.nav button[aria-current="page"] { background: var(--cream); color: var(--teal-900); }
.nav svg { width: 19px; height: 19px; flex: none; }
.nav .count { margin-left: auto; background: var(--peach); color: var(--ink); font-size: 11px; font-weight: 800; border-radius: 99px; padding: 1px 8px; }
.nav .sep { height: 1px; background: rgba(244,242,222,.14); margin: 8px 10px; }
.side .spacer { flex: 1; min-height: 12px; }
.wa-card { width: 100%; text-align: left; background: rgba(10,5,0,.2); border: 1px solid rgba(244,242,222,.15); border-radius: 14px; padding: 12px;
  font-size: 13px; color: rgba(244,242,222,.8); }
.wa-card:hover { border-color: rgba(244,242,222,.35); }
.wa-card b { color: var(--cream-soft); }
.wa-card .meter { height: 6px; background: rgba(244,242,222,.15); border-radius: 99px; margin-top: 10px; overflow: hidden; }
.wa-card .meter i { display: block; height: 100%; width: 0; background: var(--peach); border-radius: 99px; transition: width .4s; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; flex: none; background: #9aa; }
.dot.on { background: #6fe0a3; box-shadow: 0 0 0 4px rgba(111,224,163,.2); }
.dot.wait { background: var(--peach); box-shadow: 0 0 0 4px rgba(233,179,132,.2); }
.dot.off { background: #ef8a7e; box-shadow: 0 0 0 4px rgba(239,138,126,.18); }
.me { display: flex; align-items: center; gap: 8px; padding: 12px 0 0; font-size: 13px; color: rgba(244,242,222,.75); }
.me-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; color: inherit; text-align: left;
  padding: 6px; border-radius: 12px; }
.me-btn:hover { background: rgba(244,242,222,.09); }
.me b { color: var(--cream-soft); display: block; }
.me .grow { flex: 1; min-width: 0; }
.me .icon-btn { width: 34px; height: 34px; background: transparent; border-color: rgba(244,242,222,.2); color: var(--cream); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none;
  background: var(--peach); color: var(--ink); text-transform: uppercase; position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: var(--wa-head); }
.av-1 { background: var(--teal-100); color: var(--teal-900); }
.av-2 { background: #e7defa; color: #4a3a7a; }
.av-3 { background: #fde2e2; color: #8a2d2d; }
.av-4 { background: #dff0d8; color: #2f5e22; }

main { padding: 26px 32px 60px; min-width: 0; }
.mobile-bar { display: none; }
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.top h1 { margin: 0; font-size: 26px; }
.top p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.top .grow { flex: 1; }
.view { display: grid; gap: 16px; align-content: start; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { font-size: 16px; margin: 0 0 4px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.muted { color: var(--muted); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
.notice { background: var(--peach-soft); border-radius: 12px; padding: 10px 12px; font-size: 13px; color: var(--text); }

.chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--teal-50);
  color: var(--chip-text, var(--teal-800)); white-space: nowrap; margin: 0 4px 2px 0; }
.chip.peach { background: var(--peach-soft); color: var(--chip-peach, #8a4f1e); }
.chip.gray { background: var(--line); color: var(--muted); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- tabel ---------- */
.tablewrap { overflow-x: auto; margin: 0 -6px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 6px; border-top: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 700; font-size: 12px; border-top: 0; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: var(--teal-50); }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn { margin-left: 4px; }
.clip { max-width: 380px; white-space: pre-wrap; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty { color: var(--muted); font-size: 14px; padding: 28px 8px; text-align: center; }
.empty b { display: block; color: var(--text); font-family: "Sen"; font-size: 16px; margin-bottom: 4px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills button { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 99px; padding: 4px 12px; font-size: 12px; font-weight: 700; }
.pills button[aria-pressed="true"] { background: var(--teal-800); color: var(--cream-soft); border-color: var(--teal-800); }
.filters input, .filters select { width: auto; min-width: 170px; padding: 8px 12px; }

/* ---------- beranda ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.stat .ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-800); }
.stat .ico svg { width: 17px; height: 17px; }
.num-big { display: block; font-size: 30px; font-weight: 800; line-height: 1.1; margin: 10px 0 2px; }
.num-big small { font-size: 15px; color: var(--muted); font-weight: 600; }
.delta { font-size: 12px; font-weight: 700; color: var(--ok); }
.delta.down { color: var(--bad); }
.delta.flat { color: var(--muted); }
.dash { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart { width: 100%; height: 220px; display: block; }
.chart text { font: 600 11px "Plus Jakarta Sans", sans-serif; fill: var(--muted); }
.rows { display: grid; gap: 2px; }
.row { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 12px; border: 0; background: none; text-align: left; width: 100%; }
button.row:hover { background: var(--teal-50); }
.row .when { flex: none; width: 56px; text-align: center; background: var(--peach-soft); border-radius: 10px; padding: 5px 0; font: 800 14px "Sen"; color: var(--text); line-height: 1.15; }
.row .when small { display: block; font: 600 10px "Plus Jakarta Sans"; color: var(--muted); }
.row .body { min-width: 0; flex: 1; }
.row .title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 10px; background: var(--teal-50); border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: repeating-linear-gradient(45deg, var(--teal-700) 0 8px, var(--teal-800) 8px 16px);
  background-size: 22px 22px; animation: slide 1.2s linear infinite; transition: width .4s; }
@keyframes slide { to { background-position: 22px 0; } }
@media (prefers-reduced-motion: reduce) { .bar i { animation: none; } }

/* ---------- inbox (tata letak WhatsApp Web) ---------- */
main.flush { padding: 0; }
main.flush #view-inbox { gap: 0; }
.wa { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); height: 100vh; background: var(--wa-panel); color: var(--wa-text);
  position: relative; overflow: hidden; }
.wa.info-open { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr) 360px; }
.wa .grow { flex: 1; }
.wa-ic { width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; color: var(--wa-icon); display: grid; place-items: center; flex: none; padding: 0; }
.wa-ic:hover { background: var(--wa-active); }
.wa-ic svg { width: 22px; height: 22px; }
.wa-list { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--wa-line); background: var(--wa-panel); }
.wa-list-head { display: flex; align-items: center; gap: 6px; padding: 14px 12px 6px 18px; min-height: 60px; }
.wa-list-head h2 { margin: 0; font: 700 22px "Plus Jakarta Sans", system-ui, sans-serif; letter-spacing: -.01em; }
.wa-search { margin: 6px 12px 8px; display: flex; align-items: center; gap: 10px; background: var(--wa-search); border-radius: 10px; padding: 0 12px; }
.wa-search svg { width: 17px; height: 17px; color: var(--wa-sub); flex: none; }
.wa-search input { border: 0; background: none; padding: 9px 0; box-shadow: none !important; color: var(--wa-text); font-size: 14px; }
.wa-pills { display: flex; gap: 8px; padding: 2px 14px 10px; flex-wrap: wrap; }
.wa-pills button { border: 0; background: var(--wa-head); color: var(--wa-sub); border-radius: 99px; padding: 6px 13px; font-size: 13.5px; font-weight: 600; }
.wa-pills button[aria-pressed="true"] { background: var(--wa-pill); color: var(--wa-pill-text); }
.wa-chats { flex: 1; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.wa-arch { display: flex; align-items: center; gap: 18px; width: 100%; padding: 12px 22px; border: 0; background: none; color: var(--wa-text); font-weight: 600; text-align: left; }
.wa-arch:hover { background: var(--wa-hover); }
.wa-arch svg { width: 20px; height: 20px; color: var(--wa-accent); }
.wa-arch .n { margin-left: auto; color: var(--wa-accent); font-size: 12px; font-weight: 700; }
.wa-arch-note { font-size: 12.5px; color: var(--wa-sub); text-align: center; padding: 10px 24px 14px; border-bottom: 1px solid var(--wa-line); }
.wa-chat { position: relative; display: flex; align-items: center; gap: 13px; width: 100%; padding: 0 0 0 13px; border: 0; background: none; text-align: left; color: var(--wa-text); }
.wa-chat:hover { background: var(--wa-hover); }
.wa-chat[aria-current="true"] { background: var(--wa-active); }
.wa-chat .avatar { width: 49px; height: 49px; font-size: 16px; }
.wa-chat .txt { flex: 1; min-width: 0; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--wa-line); }
.wa-chat .l1, .wa-chat .l2 { display: flex; align-items: center; gap: 6px; }
.wa-chat .name { flex: 1; min-width: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-chat time { font-size: 12px; color: var(--wa-sub); flex: none; }
.wa-chat.has-unread time { color: var(--wa-accent); font-weight: 600; }
.wa-chat .last { flex: 1; min-width: 0; font-size: 13.5px; color: var(--wa-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.wa-chat .last .tick { display: inline-block; vertical-align: -2px; margin-right: 3px; }
.wa-chat .badge { background: var(--wa-accent); color: #fff; font-size: 12px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 99px; display: grid; place-items: center; padding: 0 6px; flex: none; }
.wa-chat .chev { width: 22px; height: 22px; border: 0; background: none; color: var(--wa-sub); padding: 0; display: none; flex: none; }
.wa-chat .chev svg { width: 20px; height: 20px; }
.wa-chat:hover .chev, .wa-chat .chev[aria-expanded="true"] { display: grid; place-items: center; }
.wa-chat .chip { margin: 0; font-size: 10px; }
.tick { width: 16px; height: 16px; color: var(--wa-sub); }
.tick.fail { color: var(--bad); }
.wa-empty { padding: 40px 24px; text-align: center; color: var(--wa-sub); font-size: 14px; }
.wa-empty b { display: block; color: var(--wa-text); font-size: 15px; margin-bottom: 4px; }

.wa-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; background: var(--wa-bg); }
.wa-intro { flex: 1; display: grid; place-items: center; text-align: center; padding: 28px; background: var(--wa-head); border-bottom: 6px solid var(--wa-accent); }
.wa-intro > div { max-width: 460px; }
.wa-intro .mark { color: var(--wa-sub); }
.wa-intro h2 { font: 300 30px "Plus Jakarta Sans", system-ui, sans-serif; margin: 16px 0 10px; color: var(--wa-text); }
.wa-intro p { color: var(--wa-sub); font-size: 14px; margin: 0 0 10px; }
.wa-intro .lock { font-size: 13px; margin-top: 26px; }
.steps-list { text-align: left; color: var(--wa-text); font-size: 14px; line-height: 1.6; margin: 14px auto 22px; padding-left: 22px; max-width: 380px; }
.wa-head { display: flex; align-items: center; gap: 8px; padding: 0 12px 0 14px; height: 60px; background: var(--wa-head); flex: none; border-left: 1px solid var(--wa-line); }
.wa-head .back { display: none; }
.wa-head-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 13px; border: 0; background: none; color: var(--wa-text); text-align: left; padding: 6px 0; }
.wa-head-who .avatar { width: 40px; height: 40px; }
.who-text { min-width: 0; display: grid; }
.who-text b { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-text small { color: var(--wa-sub); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 7% 10px; display: flex; flex-direction: column; overscroll-behavior: contain;
  background-color: var(--wa-bg); background-image: radial-gradient(var(--wa-dot) 1.2px, transparent 1.2px); background-size: 18px 18px; }
.wa-more { align-self: center; font-size: 12.5px; color: var(--wa-sub); background: var(--wa-day); border-radius: 8px; padding: 5px 12px; margin: 4px 0 10px; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
.wa-day { align-self: center; font-size: 12.5px; color: var(--wa-sub); background: var(--wa-day); border-radius: 8px; padding: 5px 12px; margin: 10px 0 8px;
  box-shadow: 0 1px .5px rgba(11,20,26,.13); text-transform: uppercase; letter-spacing: .02em; font-weight: 500; }
.msg { max-width: min(65%, 560px); position: relative; padding: 6px 7px 8px 9px; border-radius: 8px; font-size: 14.2px; line-height: 1.42;
  box-shadow: 0 1px .5px rgba(11,20,26,.13); margin-bottom: 2px; color: var(--wa-text); word-wrap: break-word; overflow-wrap: anywhere; }
.msg.in { align-self: flex-start; background: var(--wa-in); }
.msg.out { align-self: flex-end; background: var(--wa-out); }
.msg.first { margin-top: 8px; }
.msg.first.in { border-top-left-radius: 0; }
.msg.first.out { border-top-right-radius: 0; }
.msg.first.in::before, .msg.first.out::before { content: ""; position: absolute; top: 0; width: 8px; height: 13px; }
.msg.first.in::before { left: -8px; background: var(--wa-in); clip-path: polygon(0 0, 100% 0, 100% 100%); }
.msg.first.out::before { right: -8px; background: var(--wa-out); clip-path: polygon(0 0, 100% 0, 0 100%); }
.msg .body { white-space: pre-wrap; }
.msg .meta { float: right; margin: 6px 0 -5px 10px; font-size: 11px; color: var(--wa-sub); display: inline-flex; align-items: center; gap: 3px; position: relative; top: 4px; }
.msg .meta .tick { width: 15px; height: 15px; }
.msg.failed { outline: 1px solid var(--bad); }
.msg .src { display: inline-block; font-size: 11px; font-weight: 700; color: var(--wa-pill-text); background: var(--wa-pill); border-radius: 5px; padding: 0 6px; margin: 0 0 3px; }
.msg .err { display: block; font-size: 12px; color: var(--bad); margin-top: 3px; }
.msg .label { display: inline-flex; align-items: center; gap: 6px; color: var(--wa-sub); font-style: italic; }
.msg .label svg { width: 16px; height: 16px; }
.msg a { color: #027eb5; text-decoration: underline; text-decoration-color: transparent; }
.msg a:hover { text-decoration-color: currentColor; }
.msg.revoked .body { color: var(--wa-sub); font-style: italic; }
.msg .photo { display: block; margin: -3px -4px 4px -6px; border-radius: 6px; overflow: hidden; background: rgba(0,0,0,.06); min-width: 200px; min-height: 120px; cursor: zoom-in; border: 0; padding: 0; }
.msg .photo img { display: block; max-width: 100%; width: 330px; max-height: 360px; object-fit: cover; }
.msg .photo.broken { cursor: default; display: grid; place-items: center; color: var(--wa-sub); font-size: 12.5px; padding: 24px; min-height: 0; }
.msg .doc { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.05); border-radius: 6px; padding: 10px; margin: -2px -3px 4px -5px; min-width: 240px; color: var(--wa-text); text-decoration: none !important; }
.msg .doc svg { width: 30px; height: 30px; color: #6a7ee8; flex: none; }
.msg .doc b { display: block; font-weight: 600; font-size: 14px; word-break: break-all; }
.msg .doc small { color: var(--wa-sub); font-size: 12px; }
.link-card { margin: 6px -3px 2px -5px; border-radius: 6px; padding: 7px 9px; font-size: 12.5px; line-height: 1.4; background: rgba(0,0,0,.045); border-left: 3px solid var(--wa-sub); }
.link-card b { font-size: 12.5px; }
.link-card .dom { font-weight: 700; word-break: break-all; }
.link-card.safe { border-left-color: #25a35a; }
.link-card.info { border-left-color: #6a8ca0; }
.link-card.warn { border-left-color: #e0a12f; background: rgba(224,161,47,.12); }
.link-card.danger { border-left-color: #e0473a; background: rgba(224,71,58,.12); }
.link-card .lvl { font-weight: 800; }
.link-card.safe .lvl { color: #1f8a4c; } .link-card.warn .lvl { color: #b07812; } .link-card.danger .lvl { color: #d03b2f; }

.wa-attach { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--wa-head); border-top: 1px solid var(--wa-line); }
.wa-attach .thumb { width: 52px; height: 52px; border-radius: 8px; background: var(--wa-panel); display: grid; place-items: center; overflow: hidden; flex: none; color: #6a7ee8; }
.wa-attach .thumb img { width: 100%; height: 100%; object-fit: cover; }
.wa-attach .thumb svg { width: 28px; height: 28px; }
.wa-attach b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-attach small { color: var(--wa-sub); font-size: 12px; }
.wa-compose { display: flex; align-items: flex-end; gap: 6px; padding: 8px 12px; background: var(--wa-head); flex: none; }
.wa-compose textarea { flex: 1; min-height: 42px; max-height: 140px; resize: none; border: 0; border-radius: 10px; background: var(--wa-panel); color: var(--wa-text);
  padding: 10px 14px; font-size: 15px; line-height: 1.4; box-shadow: none !important; }
.wa-compose .wa-ic { height: 42px; }
.wa-send { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--wa-accent); color: #fff; display: grid; place-items: center; flex: none; padding: 0; }
.wa-send svg { width: 19px; height: 19px; margin-left: -2px; }
.wa-send:disabled { opacity: .5; }

.wa-info { background: var(--wa-panel); border-left: 1px solid var(--wa-line); display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.wa-info header { display: flex; align-items: center; gap: 14px; height: 60px; padding: 0 14px; background: var(--wa-head); flex: none; position: sticky; top: 0; z-index: 1; }
.wa-info header b { font-weight: 500; font-size: 16px; }
.wa-info .who { text-align: center; padding: 26px 20px 20px; border-bottom: 8px solid var(--wa-head); }
.wa-info .who .avatar { width: 160px; height: 160px; font-size: 48px; margin: 0 auto 14px; }
.wa-info .who h3 { margin: 0; font: 500 21px "Plus Jakarta Sans", sans-serif; word-break: break-word; }
.wa-info .who p { margin: 4px 0 0; color: var(--wa-sub); font-size: 15px; }
.wa-info .blk { padding: 14px 24px; border-bottom: 8px solid var(--wa-head); font-size: 14px; }
.wa-info .blk h4 { margin: 0 0 6px; font-size: 13.5px; font-weight: 500; color: var(--wa-sub); }
.wa-info .acts { padding: 6px 0; }
.wa-info .acts button { display: flex; align-items: center; gap: 18px; width: 100%; border: 0; background: none; color: var(--wa-text); padding: 13px 24px; font-size: 15px; text-align: left; }
.wa-info .acts button:hover { background: var(--wa-hover); }
.wa-info .acts svg { width: 20px; height: 20px; color: var(--wa-icon); flex: none; }
.wa-info .acts .danger { color: var(--bad); }
.wa-info .acts .danger svg { color: var(--bad); }

.wa-menu { position: fixed; z-index: 60; min-width: 210px; background: var(--wa-panel); color: var(--wa-text); border-radius: 10px; padding: 8px 0;
  box-shadow: 0 2px 5px rgba(11,20,26,.26), 0 2px 10px rgba(11,20,26,.16); }
.wa-menu button { display: flex; align-items: center; gap: 14px; width: 100%; border: 0; background: none; color: inherit; padding: 10px 22px; font-size: 14.5px; text-align: left; }
.wa-menu button:hover { background: var(--wa-hover); }
.wa-menu svg { width: 19px; height: 19px; color: var(--wa-icon); flex: none; }

/* ---------- dialog ---------- */
dialog.wide { width: min(620px, calc(100% - 32px)); }
.dlg h3 { font-size: 14px; margin: 20px 0 0; }
.who-row { display: flex; align-items: center; gap: 12px; margin: 12px 0 4px; }
.profile-top { display: flex; align-items: center; gap: 16px; margin: 14px 0; }
.pf-avatar { position: relative; flex: none; }
.pf-avatar .avatar { width: 80px; height: 80px; font-size: 26px; }
.pf-cam { position: absolute; right: -4px; bottom: -4px; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--card); background: var(--teal-800); color: var(--cream); display: grid; place-items: center; padding: 0; }
.pf-cam svg { width: 16px; height: 16px; }
.sub-card { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; background: var(--teal-50); border-radius: 14px; padding: 12px 14px; }
.sub-card span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.sub-card b { font-size: 14px; }
.users-table td { vertical-align: middle; }
.users-table .who-cell { display: flex; align-items: center; gap: 12px; }
th.right, td.right { text-align: right; }
.act-ic { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--teal-800); display: inline-grid; place-items: center; vertical-align: middle; padding: 0; }
.act-ic svg { width: 16px; height: 16px; }
.btn.stop { background: var(--bad); color: #fff; box-shadow: 0 3px 0 #8e2f27; }
.ct-actions { white-space: nowrap; text-align: right; }
.ct-actions .btn { margin-left: 4px; }
dialog { border: 0; border-radius: 20px; padding: 0; width: min(460px, calc(100% - 32px)); background: var(--card); color: var(--text); box-shadow: 0 30px 80px -30px rgba(0,0,0,.5); }
dialog::backdrop { background: rgba(10,5,0,.45); }
.dlg { padding: 22px; }
.dlg h2 { margin: 0 0 4px; font-size: 19px; }
.dlg-x { float: right; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); padding: 2px 6px; margin: -6px -8px 0 0; }
.qr { display: block; margin: 16px auto 8px; width: 260px; max-width: 100%; background: #fff; border-radius: 14px; padding: 8px; }
.wa-state { display: flex; align-items: center; gap: 8px; font-weight: 700; margin: 14px 0 6px; }

#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: var(--cream);
  padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: calc(100% - 32px); z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
pre.code { background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 12px;
  font-family: ui-monospace, Consolas, monospace; overflow-x: auto; white-space: pre; margin: 0; }

/* ---------- responsif ---------- */
@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .wa.info-open { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); }
  .wa-info { position: absolute; top: 0; right: 0; bottom: 0; width: min(360px, 100%); z-index: 5; box-shadow: -8px 0 30px rgba(0,0,0,.18); }
  .wa { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); }
  .msg { max-width: 80%; }
}
@media (max-width: 960px) {
  .dash, .split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 30; transform: translateX(-105%); transition: transform .2s; box-shadow: 0 0 60px rgba(0,0,0,.35); }
  .app.menu-open .side { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(10,5,0,.4); z-index: 25; }
  .mobile-bar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; background-color: var(--side); color: var(--cream-soft); padding: 10px 14px; }
  .mobile-bar .icon-btn { background: transparent; border-color: rgba(244,242,222,.25); color: var(--cream); width: 38px; height: 38px; }
  .mobile-bar .brand-name { font-size: 17px; flex: 1; }
  main { padding: 18px 16px 48px; }
  .top h1 { font-size: 22px; }
  .cols { grid-template-columns: 1fr; }
  .wa, .wa.info-open { grid-template-columns: 1fr; height: calc(100vh - 58px); height: calc(100dvh - 58px); }
  .wa .wa-main { display: none; }
  .wa.show-convo .wa-list { display: none; }
  .wa.show-convo .wa-main { display: flex; }
  .wa-head .back { display: grid; }
  .wa-msgs { padding: 10px 12px; }
  .msg { max-width: 88%; }
  .msg .photo img { width: 260px; }
  .filters input, .filters select { min-width: 0; flex: 1; }
  .top .btn span { display: none; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .num-big { font-size: 24px; }
  .card { padding: 14px; }
}

/* ---------- peran, kuota, blast ---------- */
.chip.prem { background: linear-gradient(90deg, #f3d38a, #e9b384); color: #4a2c06; display: inline-flex; align-items: center; gap: 4px; }
.chip.prem svg, svg.star { width: 12px; height: 12px; }
.me svg.star { color: var(--peach); vertical-align: -1px; margin-right: 4px; }
.nav .count.prem { background: rgba(244,242,222,.16); color: var(--peach); font-size: 10px; letter-spacing: .02em; }
.quota-card { margin-top: 12px; background-color: var(--teal-800); color: rgba(244,242,222,.85); border-radius: 14px; padding: 14px 16px; font-size: 13px; }
.quota-card .qrow { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.quota-card b { color: var(--cream-soft); }
.quota-card .qbig { font: 800 20px "Sen", sans-serif; color: var(--cream-soft); }
.quota-card .meter { height: 7px; background: rgba(244,242,222,.15); border-radius: 99px; margin: 8px 0; overflow: hidden; }
.quota-card .meter i { display: block; height: 100%; background: var(--peach); border-radius: 99px; }
.quota-card small { display: block; color: rgba(244,242,222,.7); font-size: 12px; margin-top: 4px; }
.theme-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 12px 0 2px; border-top: 1px solid var(--line); }
.sub-h { font-size: 14px; margin: 18px 0 0; }
.lock-card { display: flex; gap: 16px; align-items: flex-start; background: var(--peach-soft); border-color: transparent; }
.lock-ic { width: 34px; height: 34px; flex: none; color: var(--peach-dark); }
.dur { height: 10px; border-radius: 99px; background: rgba(184,67,58,.14); overflow: hidden; margin: 4px 0 6px; }
.dur i { display: block; height: 100%; border-radius: 99px; transition: width .6s ease; }
.dur.run i { background: repeating-linear-gradient(45deg, #d9483b 0 8px, #e2645a 8px 16px); background-size: 22px 22px; animation: slide 1.1s linear infinite; }
.dur.ok { background: rgba(47,143,91,.15); }
.dur.ok i { background: var(--ok); }
.dur.off { background: var(--line); }
.dur.off i { background: var(--muted); }

/* ---------- halaman login (gaya whitedesk.id: teal, krem, peach, retro) ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: var(--bg); background-image: radial-gradient(rgba(40,105,111,.13) 1.2px, transparent 1.2px); background-size: 16px 16px; }
.auth-shell { width: min(1040px, 100%); display: grid; grid-template-columns: 1.05fr 1fr; gap: 10px; background: var(--card); border: 1px solid var(--line);
  border-radius: 28px; padding: 10px; box-shadow: 0 40px 80px -40px rgba(31,81,86,.45), 0 0 0 6px rgba(244,242,222,.5); animation: rise .6s cubic-bezier(.2,.8,.2,1) both; }
.auth-art { position: relative; overflow: hidden; border-radius: 20px; min-height: 560px; display: flex; flex-direction: column; justify-content: space-between; padding: 22px 24px 26px;
  color: var(--cream); background-color: var(--teal-800);
  background-image: radial-gradient(rgba(244,242,222,.13) 1.2px, transparent 1.2px), radial-gradient(120% 80% at 100% 0%, rgba(233,179,132,.28), transparent 55%), linear-gradient(160deg, #3e777d, #1f5156);
  background-size: 14px 14px, auto, auto; }
.art-brand { display: flex; align-items: center; gap: 10px; font: 800 17px "Sen", sans-serif; color: var(--cream-soft); position: relative; z-index: 2; }
.art-brand small { display: block; font: 600 11px "Plus Jakarta Sans", sans-serif; color: rgba(244,242,222,.65); letter-spacing: .04em; }
.art-stage { position: relative; flex: 1; display: grid; place-items: center; margin: 8px 0; min-height: 300px; }
.art-glow { position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(233,179,132,.45), transparent 65%); filter: blur(10px); animation: pulse 5s ease-in-out infinite; }
.art-pc { position: relative; width: min(330px, 78%); height: auto; filter: drop-shadow(0 24px 30px rgba(10,5,0,.35)); animation: bob 6s ease-in-out infinite; z-index: 1; }
.art-bubble { position: absolute; z-index: 2; max-width: 210px; background: #fffef8; color: #1d2422; font-size: 12.5px; line-height: 1.35; padding: 8px 11px 6px; border-radius: 14px 14px 14px 4px;
  box-shadow: 0 10px 24px -10px rgba(10,5,0,.45); opacity: 0; animation: pop 9s ease-in-out infinite; }
.art-bubble b { display: block; font-size: 11px; color: var(--teal-800); }
.art-bubble i { display: block; text-align: right; font-style: normal; font-size: 10px; color: #6b766f; margin-top: 2px; }
.art-bubble.out { background: #d9fdd3; border-radius: 14px 14px 4px 14px; }
.art-bubble.b1 { top: 6%; left: 0; animation-delay: .4s; }
.art-bubble.b2 { top: 30%; right: 0; animation-delay: 2.2s; }
.art-bubble.b3 { bottom: 14%; right: 6%; animation-delay: 4s; padding: 10px 14px; }
.dots3 { display: inline-flex; gap: 4px; }
.dots3 span { width: 6px; height: 6px; border-radius: 50%; background: #5f6a66; animation: blink 1.2s infinite; }
.dots3 span:nth-child(2) { animation-delay: .2s; }
.dots3 span:nth-child(3) { animation-delay: .4s; }
.art-chip { position: absolute; z-index: 2; font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 99px; background: var(--peach); color: var(--ink);
  box-shadow: 0 3px 0 var(--peach-dark); animation: floaty 5s ease-in-out infinite; white-space: nowrap; }
.art-chip.c1 { bottom: 4%; left: 2%; }
.art-chip.c2 { top: 52%; left: -2%; background: var(--cream); box-shadow: 0 3px 0 #cfcab0; animation-delay: -2.5s; }
.art-star { position: absolute; color: var(--peach); font-size: 18px; z-index: 2; animation: twinkle 3s ease-in-out infinite; }
.art-star.s1 { top: 18%; right: 18%; }
.art-star.s2 { bottom: 30%; left: 12%; animation-delay: -1s; font-size: 13px; }
.art-star.s3 { top: 62%; right: 4%; animation-delay: -2s; }
.art-copy { position: relative; z-index: 2; }
.art-copy small { font-size: 13px; color: rgba(244,242,222,.75); }
.art-copy h2 { margin: 6px 0 0; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.2; color: var(--cream-soft); max-width: 420px; }
.auth-panel { display: grid; place-items: center; padding: 28px clamp(20px, 5vw, 64px); }
.auth-form { width: 100%; max-width: 380px; }
.auth-form.swap { animation: fadeIn .35s ease both; }
.auth-mark { display: block; margin-bottom: 10px; }
.auth-form h1 { font-size: 28px; margin: 0 0 4px; }
.auth-form > .muted { font-size: 13.5px; margin: 0 0 6px; }
.auth-form input { padding: 11px 13px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; padding: 0; }
.pw-eye svg { width: 18px; height: 18px; }
.auth-row { display: flex; justify-content: flex-end; margin-top: 8px; }
.auth-submit { width: 100%; margin-top: 18px; padding: 12px; font-size: 15px; }
.auth-ok { color: var(--ok); font-size: 13px; margin-top: 8px; }
.auth-switch { text-align: center; font-size: 13.5px; color: var(--muted); margin: 18px 0 0; }
.auth-switch .link { font-size: 13.5px; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-12px) rotate(1deg); } }
@keyframes pulse { 0%, 100% { transform: scale(.92); opacity: .75; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes pop { 0% { opacity: 0; transform: translateY(12px) scale(.9); } 8%, 70% { opacity: 1; transform: none; } 80%, 100% { opacity: 0; transform: translateY(-8px) scale(.96); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes twinkle { 0%, 100% { opacity: .35; transform: scale(.8) rotate(0); } 50% { opacity: 1; transform: scale(1.15) rotate(20deg); } }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .auth-shell, .art-pc, .art-glow, .art-chip, .art-star, .dots3 span, .auth-form.swap, .dur.run i { animation: none; }
  .art-bubble { animation: none; opacity: 1; }
}
@media (max-width: 860px) {
  .auth { padding: 12px; place-items: start center; }
  .auth-shell { grid-template-columns: 1fr; border-radius: 22px; }
  .auth-art { min-height: 0; padding: 18px; }
  .art-stage { min-height: 210px; }
  .art-pc { width: 190px; }
  .art-bubble { max-width: 170px; font-size: 11.5px; }
  .art-bubble.b3, .art-chip.c2, .art-star.s3 { display: none; }
  .art-copy h2 { font-size: 20px; }
  .auth-panel { padding: 20px 14px 24px; }
}

/* ---------- anti meluber: kolom grid boleh menyempit, teks panjang dipotong "…" ---------- */
.dash { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rows { grid-template-columns: minmax(0, 1fr); }
.row, .card, .stack { min-width: 0; }
.row .chip { flex: none; }
td { overflow-wrap: break-word; }
@media (max-width: 1200px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) { .dash { grid-template-columns: minmax(0, 1fr); } }

/* ---------- lihat foto: layar gelap penuh, foto di tengah ---------- */
dialog.lightbox { width: 100vw; height: 100vh; height: 100dvh; max-width: 100vw; max-height: 100vh; max-height: 100dvh; margin: 0; padding: 0;
  border-radius: 0; background: rgba(8, 12, 14, .9); box-shadow: none; }
dialog.lightbox[open] { display: grid; place-items: center; }
dialog.lightbox::backdrop { background: rgba(0, 0, 0, .6); }
.lightbox img { display: block; max-width: min(92vw, 1100px); max-height: 86vh; max-height: 86dvh; width: auto; height: auto; object-fit: contain;
  border-radius: 10px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); background: #111; }
.lb-x { position: fixed; top: 16px; right: 18px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff;
  display: grid; place-items: center; padding: 0; }
.lb-x:hover { background: rgba(255, 255, 255, .22); }
.lb-x svg { width: 22px; height: 22px; }

/* ---------- sidebar bisa diciutkan ---------- */
.side .brand { position: relative; }
.brand-text { min-width: 0; }
.side-toggle { margin-left: auto; width: 32px; height: 32px; border-radius: 9px; border: 1px solid rgba(244,242,222,.2); background: transparent; color: var(--cream);
  display: grid; place-items: center; padding: 0; flex: none; }
.side-toggle:hover { background: rgba(244,242,222,.1); }
.side-toggle svg { width: 18px; height: 18px; transition: transform .2s; }
.app { transition: grid-template-columns .2s ease; }
.app.collapsed { grid-template-columns: 76px 1fr; }
.app.collapsed .side { padding: 16px 10px; cursor: e-resize; }
.app.collapsed .brand { flex-direction: column; gap: 10px; padding: 4px 0 14px; }
.app.collapsed .brand-text, .app.collapsed .nav .count, .app.collapsed .me .grow, .app.collapsed .upgrade-btn span,
.app.collapsed .wa-card > :not(:first-child), .app.collapsed #waTitle, .app.collapsed #signOut { display: none; }
.app.collapsed .side-toggle { margin: 0; }
.app.collapsed .side-toggle svg { transform: scaleX(-1); }
.app.collapsed .nav button { justify-content: center; padding: 11px 0; font-size: 0; gap: 0; cursor: pointer; }
.app.collapsed .nav svg { width: 21px; height: 21px; }
.app.collapsed .nav .sep { margin: 8px 6px; }
.app.collapsed .wa-card { padding: 12px 0; display: grid; place-items: center; }
.app.collapsed .wa-card .dot { margin: 0; }
.app.collapsed .upgrade-btn { justify-content: center; padding: 10px 0; }
.app.collapsed .me { justify-content: center; }
.app.collapsed .me-btn { flex: none; padding: 4px; }
@media (max-width: 860px) {
  .app.collapsed { grid-template-columns: 1fr; }
  .side-toggle { display: none; }
}

/* ---------- tombol & banner upgrade ---------- */
.upgrade-btn { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; border: 0; border-radius: 14px; padding: 11px 12px; margin-bottom: 8px;
  background: linear-gradient(135deg, #f3d38a, var(--peach)); color: var(--ink); box-shadow: 0 3px 0 var(--peach-dark), 0 10px 24px -12px rgba(233,179,132,.8);
  position: relative; overflow: hidden; transition: transform .1s; }
.upgrade-btn:hover { transform: translateY(-1px); }
.upgrade-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--peach-dark); }
.upgrade-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 45%, transparent 60%);
  transform: translateX(-100%); animation: shine 3.2s ease-in-out infinite; }
.upgrade-btn svg { width: 22px; height: 22px; flex: none; }
.upgrade-btn b { display: block; font-size: 14px; }
.upgrade-btn small { display: block; font-size: 11.5px; font-weight: 600; opacity: .75; }
.upgrade-btn.waiting { background: rgba(244,242,222,.12); color: var(--cream); box-shadow: none; border: 1px dashed rgba(244,242,222,.35); }
.upgrade-btn.waiting::after { display: none; }
@keyframes shine { 0%, 55% { transform: translateX(-100%); } 85%, 100% { transform: translateX(100%); } }
.free-tag { display: inline-block; font: 800 11px "Plus Jakarta Sans", sans-serif; letter-spacing: .08em; background: var(--ink); color: var(--peach); padding: 3px 9px; border-radius: 6px; }
.upgrade-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; background-color: var(--teal-800); color: var(--cream);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.upgrade-banner h2 { margin: 8px 0 4px; font-size: 20px; color: var(--cream-soft); }
.upgrade-banner p { margin: 0; color: rgba(244,242,222,.82); font-size: 14px; max-width: 620px; }

/* ---------- pratinjau bubble WhatsApp ---------- */
.wa-prev { margin-top: 12px; }
.wa-prev:empty { display: none; }
.prev-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.phone { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--wa-bg); }
.phone-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #008069; color: #fff; }
.phone-top .avatar { width: 30px; height: 30px; font-size: 11px; }
.phone-top b { display: block; font-size: 13.5px; }
.phone-top small { font-size: 11px; opacity: .8; }
.phone-body { padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; min-height: 90px;
  background-image: radial-gradient(var(--wa-dot) 1.2px, transparent 1.2px); background-size: 16px 16px; }
.pmsg { max-width: 85%; padding: 6px 9px 7px; border-radius: 8px; font-size: 13.5px; line-height: 1.4; color: var(--wa-text); white-space: pre-wrap;
  overflow-wrap: anywhere; box-shadow: 0 1px .5px rgba(11,20,26,.13); position: relative; }
.pmsg.in { align-self: flex-start; background: var(--wa-in); border-top-left-radius: 0; }
.pmsg.out { align-self: flex-end; background: var(--wa-out); border-top-right-radius: 0; }
.pmsg a { color: #027eb5; }
.pmeta { float: right; margin: 6px 0 -4px 10px; font-size: 10.5px; color: var(--wa-sub); display: inline-flex; align-items: center; gap: 2px; position: relative; top: 3px; }
.tick2 { width: 14px; height: 14px; color: #53bdeb; }
.pempty { align-self: center; color: var(--wa-sub); font-size: 12.5px; padding: 18px 0; }

/* ---------- pilih kontak ---------- */
.pick { position: relative; }
.pick-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 10; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 40px -16px rgba(0,0,0,.35); max-height: 280px; overflow-y: auto; padding: 4px; }
.pick-list button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; padding: 7px 8px; border-radius: 9px; }
.pick-list button:hover { background: var(--teal-50); }
.pick-list .avatar { width: 30px; height: 30px; font-size: 11px; }
.pick-list b { display: block; font-size: 13.5px; }
.pick-list small { color: var(--muted); font-size: 12px; }
.pick-empty { padding: 12px; color: var(--muted); font-size: 13px; text-align: center; }

/* ---------- daftar: pita GRATIS & pilihan verifikasi ---------- */
.free-ribbon { position: relative; background: linear-gradient(135deg, #fff3e3, var(--peach-soft)); border: 1.5px dashed var(--peach); border-radius: 14px;
  padding: 12px 14px 12px 14px; margin: 0 0 14px; font-size: 13px; line-height: 1.45; color: var(--text); animation: wiggle 4s ease-in-out infinite; }
.free-ribbon .free-tag { font-size: 13px; margin-right: 6px; transform: rotate(-3deg); }
@keyframes wiggle { 0%, 92%, 100% { transform: none; } 94% { transform: rotate(-1deg); } 96% { transform: rotate(1deg); } }
.via-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.via { margin: 0; display: block; cursor: pointer; position: relative; }
.via input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; left: 0; top: 0; }
.via span { display: block; border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 12px; background: var(--field); }
.via b { display: block; font-size: 14px; color: var(--text); }
.via small { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.via input:checked + span { border-color: var(--teal-700); background: var(--teal-50); box-shadow: 0 0 0 3px var(--teal-100); }
.via input:focus-visible + span { outline: 2px solid var(--peach); }
.via.off { opacity: .5; cursor: not-allowed; }

/* ---------- dialog sambutan & upgrade ---------- */
dialog.hero-dlg::backdrop { background: rgba(10,5,0,.62); backdrop-filter: blur(2px); }
.welcome { text-align: center; position: relative; overflow: hidden; padding-top: 30px; }
.welcome-ic { width: 72px; height: 72px; margin: 0 auto 10px; border-radius: 22px; background: var(--peach); color: var(--ink); display: grid; place-items: center;
  box-shadow: 0 4px 0 var(--peach-dark); animation: bob 3s ease-in-out infinite; }
.welcome-ic svg { width: 38px; height: 38px; }
.welcome h2 { font-size: 22px; }
.welcome .lead { color: var(--muted); margin: 6px 0 14px; }
.quota-pill { background: var(--teal-800); color: var(--cream); border-radius: 16px; padding: 14px; }
.quota-pill span { display: block; font-size: 12px; color: rgba(244,242,222,.7); font-weight: 600; }
.quota-pill b { display: block; font: 800 26px "Sen", sans-serif; color: var(--cream-soft); }
.quota-pill small { font-size: 12px; color: rgba(244,242,222,.75); }
.welcome-steps { text-align: left; font-size: 14px; margin: 14px 0 4px; padding-left: 22px; line-height: 1.7; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; background: var(--peach); animation: fall 2.6s ease-in forwards; opacity: 0; }
.confetti i:nth-child(2n) { background: var(--teal-700); }
.confetti i:nth-child(3n) { background: #f3d38a; width: 6px; height: 6px; border-radius: 50%; }
.confetti i:nth-child(1) { left: 8%; animation-delay: .1s; } .confetti i:nth-child(2) { left: 20%; animation-delay: .5s; }
.confetti i:nth-child(3) { left: 33%; animation-delay: .2s; } .confetti i:nth-child(4) { left: 46%; animation-delay: .7s; }
.confetti i:nth-child(5) { left: 58%; animation-delay: .3s; } .confetti i:nth-child(6) { left: 70%; animation-delay: .6s; }
.confetti i:nth-child(7) { left: 82%; animation-delay: .15s; } .confetti i:nth-child(8) { left: 92%; animation-delay: .45s; }
@keyframes fall { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(260px) rotate(320deg); } }
.upg h2 { margin: 10px 0 4px; }
.perks { list-style: none; padding: 0; margin: 14px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.perks li { background: var(--teal-50); border-radius: 12px; padding: 10px 12px 10px 34px; position: relative; font-size: 13px; }
.perks li::before { content: "✓"; position: absolute; left: 12px; top: 9px; font-weight: 800; color: var(--teal-800); }
.perks b { display: block; font-size: 14px; }
.perks span { color: var(--muted); }
.amount-row { display: flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--field); overflow: hidden; }
.amount-row span { padding: 0 4px 0 14px; font-weight: 800; color: var(--muted); }
.amount-row input { border: 0; background: none; font: 800 20px "Sen", sans-serif; box-shadow: none !important; padding-left: 4px; }
.amount-pills { margin-top: 8px; }
.qris { display: block; width: min(300px, 100%); margin: 14px auto; border-radius: 14px; border: 1px solid var(--line); }
.proof-prev img { display: block; max-height: 220px; max-width: 100%; margin-top: 8px; border-radius: 10px; border: 1px solid var(--line); }
.track { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 0; }
.track li { position: relative; padding: 0 0 16px 32px; font-size: 14px; }
.track li::before { content: ""; position: absolute; left: 6px; top: 2px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); }
.track li::after { content: ""; position: absolute; left: 13px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.track li:last-child::after { display: none; }
.track li.done::before { background: var(--ok); border-color: var(--ok); }
.track li.now::before { background: var(--peach); border-color: var(--peach-dark); animation: pulse 1.6s ease-in-out infinite; }
.track b { display: block; }
.track small { color: var(--muted); }
.up-acts { display: flex; gap: 6px; margin-top: 6px; }
.users-table td { min-width: 0; }
@media (prefers-reduced-motion: reduce) {
  .upgrade-btn::after, .free-ribbon, .welcome-ic, .confetti i, .track li.now::before { animation: none; }
}
.side .brand { gap: 8px; }
.side .brand-name { font-size: 17px; white-space: nowrap; }

/* ---------- badge merah notifikasi (pengajuan upgrade menunggu) ---------- */
.nav button { position: relative; }
.nav .count.alert { background: #e5483b; color: #fff; min-width: 20px; text-align: center; box-shadow: 0 0 0 2px var(--side); animation: ping 2s ease-in-out infinite; }
@keyframes ping { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.app.collapsed .nav .count.alert { display: block; position: absolute; top: 4px; right: 10px; margin: 0; font-size: 10px; padding: 0 5px; min-width: 16px; line-height: 16px; }
@media (prefers-reduced-motion: reduce) { .nav .count.alert { animation: none; } }

/* ---------- timeline status upgrade ---------- */
.upg-card .card-head { align-items: flex-start; }
.timeline { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; counter-reset: none; }
.timeline li { position: relative; padding: 0 12px 0 0; }
.timeline li::after { content: ""; position: absolute; top: 15px; left: 34px; right: 4px; height: 3px; border-radius: 3px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.done::after { background: var(--ok); }
.tl-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 800 13px "Sen", sans-serif; background: var(--line); color: var(--muted);
  margin-bottom: 8px; position: relative; z-index: 1; }
.tl-dot svg { width: 16px; height: 16px; }
.timeline li.done .tl-dot { background: var(--ok); color: #fff; }
.timeline li.now .tl-dot { background: var(--peach); color: var(--ink); box-shadow: 0 0 0 5px rgba(233,179,132,.3); animation: pulse 1.6s ease-in-out infinite; }
.timeline li.bad .tl-dot { background: var(--bad); color: #fff; }
.timeline b { display: block; font-size: 14px; }
.timeline small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.timeline li.bad small { color: var(--bad); }
@media (max-width: 640px) {
  .timeline { grid-template-columns: 1fr; gap: 14px; }
  .timeline li { padding-left: 44px; }
  .timeline li .tl-dot { position: absolute; left: 0; top: 0; }
  .timeline li::after { left: 15px; top: 34px; bottom: -14px; right: auto; width: 3px; height: auto; }
}

/* ---------- ucapan terima kasih upgrade ---------- */
.thanks { text-align: center; position: relative; overflow: hidden; padding-top: 10px; }
.thanks h2 { font-size: 21px; }

/* ---------- hapus akun ---------- */
.act-ic.del { color: var(--bad); margin-left: 4px; }
.act-ic.del:hover { background: var(--bad-soft); }
.danger-zone { margin-top: 14px; border: 1px solid var(--bad-soft); border-radius: 14px; padding: 10px 14px; }
.danger-zone summary { cursor: pointer; color: var(--bad); font-weight: 700; font-size: 13.5px; }
.danger-zone p { font-size: 13px; color: var(--muted); }
.users-table { min-width: 980px; }

/* ---------- sidebar ringkas (di zoom 100% terlihat seperti zoom 85%) ---------- */
@media (min-width: 861px) { .app { grid-template-columns: 224px 1fr; } }
.side { padding: 16px 10px 12px; gap: 2px; }
.side .brand { padding: 2px 6px 14px; }
.side .brand svg:first-child { width: 32px; height: 32px; }
.side .brand-name { font-size: 15.5px; }
.side .brand small { font-size: 10px; }
.side-toggle { width: 28px; height: 28px; border-radius: 8px; }
.side-toggle svg { width: 16px; height: 16px; }
.nav button { padding: 8px 10px; gap: 10px; font-size: 13px; border-radius: 10px; }
.nav svg { width: 17px; height: 17px; }
.nav .count { font-size: 10px; padding: 0 7px; }
.nav .sep { margin: 6px 8px; }
.upgrade-btn { padding: 9px 10px; gap: 9px; border-radius: 12px; margin-bottom: 6px; }
.upgrade-btn svg { width: 19px; height: 19px; }
.upgrade-btn b { font-size: 12.5px; }
.upgrade-btn small { font-size: 10.5px; }
.wa-card { padding: 10px; font-size: 11.5px; border-radius: 12px; }
.wa-card .meter { height: 5px; margin-top: 8px; }
.me { padding-top: 8px; font-size: 12px; }
.me .avatar { width: 32px; height: 32px; font-size: 12px; }
.me .icon-btn { width: 30px; height: 30px; }
.me .icon-btn svg { width: 16px; height: 16px; }
/* layar laptop pendek: lebih rapat lagi supaya semua menu muat tanpa digulir */
@media (max-height: 800px) and (min-width: 861px) {
  .side { padding-top: 12px; }
  .side .brand { padding-bottom: 10px; }
  .nav button { padding: 6.5px 10px; }
  .wa-card { padding: 8px 10px; }
  .wa-card #waSub { display: none; }
}
@media (max-width: 860px) {
  .side { width: 248px; }
}
/* kartu di sidebar tidak boleh tergencet; kalau tetap tidak muat, sidebar yang digulir */
.side > .brand, .side > .nav, .side > .upgrade-btn, .side > .wa-card, .side > .me { flex-shrink: 0; }
