/* Konsol admin APRO BC: tema "Kaset Teal" + font Louis George Cafe (sama dengan WS Pro web). */
@font-face { font-family: "Louis George Cafe"; src: url("/assets/LouisGeorgeCafe.ttf") format("truetype"); font-weight: 100 600; font-display: swap; }
@font-face { font-family: "Louis George Cafe"; src: url("/assets/LouisGeorgeCafe-Bold.ttf") format("truetype"); font-weight: 700 900; font-display: swap; }

:root {
  --bg: #0a2623;
  --card: #0f3531;
  --card2: #134440;
  --line: #2a7a70;
  --line-soft: #1d5a53;
  --text: #e8fffb;
  --muted: #8fc9bf;
  --brand: #f2b33d;
  --brand-ink: #1c1604;
  --accent: #7fe0cf;
  --hero1: #0f4c47;
  --hero2: #0a2623;
  --nav: #0f2f2b;
  --ok: #4fe0a0;
  --info: #7ab6ff;
  --warn: #f2b94b;
  --bad: #ff6b8a;
  --shade: rgb(0 0 0 / 0.45);
  --radius: 14px;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 "Louis George Cafe", ui-sans-serif, system-ui, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.warn { color: var(--warn); }
.error { color: var(--bad); min-height: 1em; margin: 6px 0 0; font-size: 13px; }
.ok { color: var(--ok); font-size: 13px; }
.right { text-align: right; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0 0; display: block; }
.pre { white-space: pre-wrap; }
code { font-family: var(--mono); background: var(--card2); padding: 1px 5px; border-radius: 5px; }
h4 { margin: 18px 0 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.ic { width: 16px; height: 16px; flex: 0 0 auto; vertical-align: -3px; }

/* ---------- Form ---------- */
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--card2); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 1px; border-color: var(--brand); }
input[type="checkbox"] { width: auto; accent-color: var(--brand); }
input[type="file"] { padding: 7px; }
textarea { resize: vertical; }
textarea.msg, .msg-view { font-family: var(--mono); font-size: 13px; }
label { display: block; margin: 10px 0; color: var(--muted); font-size: 12.5px; }
label > input, label > select, label > textarea { margin-top: 5px; }
label.check { display: flex; gap: 10px; align-items: center; color: var(--text); font-size: 14px; }
label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
label.inline select { width: auto; margin: 0; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.inline-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.w-num { width: 84px; }

button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border-radius: 10px; border: 1px solid transparent; background: var(--brand); color: var(--brand-ink); font-weight: 700; cursor: pointer; white-space: nowrap; line-height: 1.2; text-decoration: none; }
button:hover, .btn:hover { filter: brightness(1.06); text-decoration: none; }
button.ghost, .btn.ghost { background: transparent; color: var(--text); border-color: var(--line); font-weight: 600; }
button.ghost:hover, .btn.ghost:hover { background: var(--card2); }
button.danger { background: var(--bad); color: #2a0a14; }
button.sm, .btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
button.block { width: 100%; }
button:disabled { opacity: .5; cursor: default; filter: none; }
.icon-btn { padding: 6px; border-radius: 8px; background: transparent; color: var(--muted); border: 0; }
.icon-btn:hover { background: var(--card2); color: var(--text); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-btns.top { margin-top: 12px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 30% 0%, var(--hero1), var(--bg) 60%); }
.login-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: 0 20px 50px -20px var(--shade); text-align: center; }
.login-card label { text-align: left; }
.login-card h1 { margin: 6px 0 0; font-size: 24px; }
.logo-lg { width: 76px; height: 76px; border-radius: 20px; }

/* ---------- Kerangka ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 18px; padding: 10px 18px; width: calc(100% - 44px); max-width: 1356px; margin: 12px auto 0; border-radius: 18px; background: linear-gradient(135deg, color-mix(in srgb, var(--hero1) 92%, transparent), color-mix(in srgb, var(--nav) 92%, transparent)); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1.5px solid var(--line); box-shadow: 0 0 0 6px var(--bg), 0 14px 32px -10px rgb(0 0 0 / .75); }
.topbar { top: 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 15px; white-space: nowrap; }
.brand img { height: 40px; width: auto; display: block; }
.logo-wide { display: block; width: 100%; max-width: 260px; height: auto; margin: -6px auto 4px; }
.brand:hover { text-decoration: none; }
.seg { display: flex; gap: 4px; justify-content: center; background: rgb(0 0 0 / .18); padding: 4px; border-radius: 999px; border: 1px solid var(--line-soft); }
.topbar > .brand { justify-self: start; }
.topbar > .me { justify-self: end; }
.seg a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.seg a:hover { color: var(--text); text-decoration: none; background: rgb(255 255 255 / .04); }
.seg a.active { background: var(--brand); color: var(--brand-ink); }
.me { display: flex; align-items: center; gap: 10px; }
.me-chip { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border-radius: 999px; background: rgb(0 0 0 / .18); border: 1px solid var(--line-soft); }
.me-chip div { display: flex; flex-direction: column; line-height: 1.15; }
.me-chip b { font-size: 13px; }
.me-chip .badge { font-size: 10px; padding: 0 6px; align-self: flex-start; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ok); font-weight: 700; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
main { max-width: 1400px; margin: 0 auto; padding: 22px 22px 40px; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }
.bottom-nav { display: none; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 28px; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Grid ---------- */
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; align-items: start; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.grid-4.compact { gap: 10px; }
.grid-3 > .panel, .grid-2 > .panel { margin-bottom: 0; }
.grid-4 > *, .grid-3 > *, .grid-2 > *, .grid-2-1 > * { min-width: 0; }

/* ---------- Kartu statistik ---------- */
.stat { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px; min-width: 0; }
.stat-top { display: flex; justify-content: space-between; gap: 12px; flex: 1; }
.stat-main { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 6px; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-value small { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto; }
.stat-ic .ic { width: 18px; height: 18px; }
.stat .bar { margin-top: 12px; }
.stat-link { margin-top: 10px; align-self: flex-start; background: none; border: 0; padding: 0; color: var(--accent); font-size: 12.5px; font-weight: 700; }
.stat-link .ic { width: 14px; height: 14px; }
.grid-4.compact .stat { padding: 12px; }
.grid-4.compact .stat-value { font-size: 20px; }

.tone-primary { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.tone-success, .tone-ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.tone-info { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }
.tone-warning, .tone-warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.tone-danger, .tone-bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.tone-muted { background: color-mix(in srgb, var(--muted) 13%, transparent); color: var(--muted); }
.tone-brand { background: var(--brand); color: var(--brand-ink); }

.bar { height: 7px; border-radius: 999px; background: var(--card2); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.bar.multi i { border-radius: 0; }
.bar i.ok { background: var(--ok); }
.bar i.bad { background: var(--bad); }
.bar i.warnc { background: var(--warn); }

/* ---------- Panel ---------- */
.panel { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); margin-bottom: 16px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.panel-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.panel-body { padding: 16px 18px; }
.panel .count, .tabs .count { display: inline-grid; place-items: center; min-width: 20px; height: 19px; padding: 0 6px; border-radius: 999px; background: var(--card2); color: var(--muted); font-size: 11px; font-weight: 700; }

.tabs { display: inline-flex; flex-wrap: wrap; gap: 3px; background: var(--card2); padding: 3px; border-radius: 11px; border: 1px solid var(--line-soft); margin-bottom: 0; }
#sTabs .tabs { margin-bottom: 16px; }
.modal-body > .tabs { margin-bottom: 12px; }
.tabs button { background: transparent; color: var(--muted); border: 0; padding: 6px 12px; font-size: 13px; font-weight: 600; border-radius: 8px; }
.tabs button:hover { color: var(--text); filter: none; }
.tabs button.active { background: var(--brand); color: var(--brand-ink); }
.tabs button.active .count { background: rgb(0 0 0 / .18); color: var(--brand-ink); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.search { position: relative; flex: 1; max-width: 420px; margin: 0; }
.search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 34px; margin: 0; }

/* ---------- Tabel ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: rgb(0 0 0 / .12); border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tbody tr:hover td { background: rgb(255 255 255 / .025); }
.tbl .sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.tbl .sub.warn { color: var(--warn); }
.tbl.compact td { padding: 6px 8px; }
.tbl.compact input, .tbl.compact select { margin: 0; padding: 6px 8px; }
.who { display: flex; align-items: center; gap: 10px; }
.who div { display: flex; flex-direction: column; min-width: 0; }
.who span { font-size: 11.5px; color: var(--muted); }
.link { cursor: pointer; color: var(--accent); }
.amount { font-size: 15px; }
.dest { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.dest .sub { flex-basis: 100%; }

.badge { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; font-weight: 700; font-size: 12.5px; background: hsl(var(--h) 45% 30%); color: hsl(var(--h) 80% 88%); }
.modal-head .avatar { vertical-align: middle; margin-right: 4px; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.pager > div { display: flex; gap: 8px; align-items: center; }
.empty { padding: 34px 10px; text-align: center; }
.empty p { margin: 0; font-weight: 700; }
.empty span { color: var(--muted); font-size: 12.5px; }

/* ---------- Dasbor ---------- */
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 8px; border-radius: 2px; margin-left: 8px; }
.lg-bar { background: var(--brand); }
.lg-line { background: var(--accent); height: 2px !important; }
.chart { width: 100%; height: 220px; display: block; }
.chart .c-bar { fill: color-mix(in srgb, var(--brand) 85%, transparent); }
.chart .c-bar:hover { fill: var(--brand); }
.chart .c-line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .c-axis { stroke: var(--line-soft); vector-effect: non-scaling-stroke; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .c-y { fill: var(--brand); } .chart .c-y2 { fill: var(--accent); }
.camp-list { display: flex; flex-direction: column; gap: 14px; }
.camp-row-top { display: flex; align-items: center; gap: 8px; }
.camp-row-top b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camp-row .bar { margin: 7px 0 5px; }
.camp-row-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.kv-list { display: flex; flex-direction: column; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line-soft); }
.kv:last-child { border-bottom: 0; }
.kv > span { color: var(--muted); font-size: 13px; }
.kv > b { text-align: right; display: inline-flex; align-items: center; gap: 4px; }
.kv.issue div { display: flex; flex-direction: column; }
.kv.issue div span { color: var(--muted); font-size: 11.5px; }
.kv.issue strong { font-size: 20px; }
.allclear { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 0; color: var(--muted); text-align: center; }
.allclear .ic { width: 30px; height: 30px; color: var(--ok); }
.allclear b { color: var(--text); }

/* ---------- Kampanye ---------- */
.camp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.camp-card { background: var(--card2); border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.camp-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.camp-head h3 { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.camp-body { display: flex; gap: 10px; }
.msg-view { flex: 1; margin: 0; white-space: pre-wrap; background: rgb(0 0 0 / .15); padding: 10px; border-radius: 9px; max-height: 140px; overflow: auto; }
.thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 11.5px; color: var(--muted); }
.chips b { color: var(--text); }
.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 10; min-width: 210px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 5px; box-shadow: 0 14px 30px -10px var(--shade); display: flex; flex-direction: column; }
.menu button { justify-content: flex-start; background: transparent; color: var(--text); font-weight: 500; padding: 8px 10px; border-radius: 8px; }
.menu button:hover { background: var(--card2); filter: none; }
.menu .danger-text { color: var(--bad); }
.msg-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px; }
.msg-tools .var { background: var(--card); color: var(--accent); border-color: var(--line); font-weight: 600; }
.msg-preview { background: var(--card2); border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 12px; margin: 8px 0; font-size: 13px; }
.msg-preview ol { margin: 4px 0; padding-left: 20px; }
.msg-preview li { margin: 3px 0; white-space: pre-wrap; }
.img-preview { max-width: 200px; max-height: 200px; border-radius: 10px; border: 1px solid var(--line-soft); display: block; }

/* ---------- Laporan & pengaturan ---------- */
.filter-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filter-row label { margin: 0; flex: 0 1 200px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick .active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.dl-list { display: flex; flex-direction: column; gap: 8px; }
.dl-list button { justify-content: flex-start; }
.save-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 0 8px; }
.panel .save-bar { padding: 14px 0 0; margin-top: 6px; border-top: 1px dashed var(--line-soft); }
.prov-scroll { max-height: 470px; overflow: auto; border-radius: 12px; }
.steps { margin: 0; padding-left: 18px; color: var(--muted); }
.steps li { margin: 6px 0; }
.steps b { color: var(--text); }

/* ---------- Modal & toast ---------- */
dialog.modal { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--card); color: var(--text); box-shadow: 0 30px 70px -20px var(--shade); }
dialog.modal.wide { width: min(920px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgb(2 12 11 / .62); backdrop-filter: blur(2px); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: var(--card); z-index: 2; }
.modal-head h3 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.modal-head p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.modal-body { padding: 16px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line-soft); position: sticky; bottom: 0; background: var(--card); }
form.modal-body .modal-foot { margin: 16px -20px -16px; }
.modal-foot.spread { justify-content: space-between; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin-top: 10px; }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 11px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--text); box-shadow: 0 12px 30px -10px var(--shade); font-size: 13px; transition: opacity .4s, transform .4s; }
.toast.tone-ok { border-left: 4px solid var(--ok); }
.toast.tone-bad { border-left: 4px solid var(--bad); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- Responsif ---------- */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 > :last-child { grid-column: 1 / -1; }
  .seg a span { display: none; }
  .seg a { padding: 8px 12px; }
}
@media (max-width: 900px) {
  .seg { display: none; }
  .topbar { padding: 10px 14px; justify-content: space-between; }
  .me-chip div, .live { display: none; }
  main { padding: 16px 14px 96px; }
  .grid-2, .grid-2-1, .camp-grid, .detail-grid, .form-2 { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 > .panel { grid-column: 1 / -1; }
  .page-head h1 { font-size: 23px; }
  #toasts { bottom: 84px; }
}
@media (max-width: 640px) {
  /* Tabel menjadi daftar kartu agar tidak perlu digeser ke samping. */
  .tbl-wrap { border: 0; overflow: visible; border-radius: 0; }
  .tbl, .tbl tbody { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tr { display: block; background: var(--card2); border: 1px solid var(--line-soft); border-radius: 14px; padding: 4px 12px; margin-bottom: 10px; }
  .tbl tbody tr:hover td { background: transparent; }
  .tbl td { display: flow-root; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); text-align: right; min-width: 0; overflow-wrap: anywhere; }
  .tbl td::before { content: attr(data-label); float: left; max-width: 45%; margin: 2px 12px 0 0; text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
  .tbl td .sub { margin-top: 2px; }
  .tbl td .row-actions, .tbl td .actions { justify-content: flex-end; }
  .tbl td:first-child { text-align: left; padding: 10px 0 9px; }
  .tbl td:first-child::before, .tbl td[data-label=""]::before { display: none; }
  .tbl td:last-child, .tbl tbody tr:last-child td:last-child { border-bottom: 0; }
  .tbl td:last-child:has(> svg:only-child) { display: none; }
  .tbl tr:has(> td:last-child > svg:only-child) td:nth-last-child(2) { border-bottom: 0; }
  .tbl td[colspan] { display: block; text-align: center; }
  .panel-head { flex-wrap: wrap; }
  .panel-head > * { min-width: 0; max-width: 100%; }
  .panel-actions { max-width: 100%; min-width: 0; }
  .tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: 0 0 auto; white-space: nowrap; }
  .page-head { margin-bottom: 14px; }
  .page-head p { font-size: 13px; }
}
@media (max-width: 520px) {
  .grid-4, .grid-3 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px; }
  .stat-value { font-size: 19px; }
  .stat-label { font-size: 10px; }
  .stat-hint { font-size: 11px; }
  .page-head h1 { font-size: 22px; }
  .page-head > div:last-child { width: 100%; }
  .stat-ic { display: none; }
  .panel-head, .panel-body { padding: 12px; }
  .camp-head { flex-direction: column; }
}

/* ---------- Live preview WhatsApp (dialog kampanye) ---------- */
dialog.modal.xwide { width: min(1180px, calc(100vw - 24px)); }
.with-preview { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.with-preview > .modal-foot { grid-column: 1 / -1; }
.with-preview .form-col { min-width: 0; }
.wa-preview { position: sticky; top: 8px; display: flex; flex-direction: column; gap: 10px; }
.wa-title { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.wa-title i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.wa-phone { border: 7px solid #0d1f1c; border-radius: 28px; overflow: hidden; background: #efeae2; box-shadow: 0 18px 40px -18px var(--shade); display: flex; flex-direction: column; height: 470px; }
.wa-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #075e54; color: #fff; }
.wa-head div { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.wa-head b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-head small { font-size: 11px; opacity: .85; }
.wa-ava { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgb(255 255 255 / .2); }
.wa-icons { opacity: .9; }
.wa-chat { flex: 1; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 8px; background-color: #efeae2; background-image: radial-gradient(rgb(0 0 0 / .035) 1px, transparent 1px); background-size: 14px 14px; }
.wa-day { align-self: center; background: #fff; color: #54656f; font-size: 11px; padding: 3px 10px; border-radius: 8px; box-shadow: 0 1px 1px rgb(0 0 0 / .08); }
.wa-bubble { align-self: flex-end; max-width: 88%; background: #d9fdd3; color: #111b21; border-radius: 10px 2px 10px 10px; padding: 5px 7px 4px; box-shadow: 0 1px 1px rgb(0 0 0 / .12); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 13.5px; line-height: 1.4; }
.wa-bubble img { display: block; width: 100%; max-height: 260px; object-fit: cover; border-radius: 7px; margin-bottom: 4px; }
.wa-text { white-space: pre-wrap; overflow-wrap: anywhere; padding: 0 2px; }
.wa-text code { background: rgb(0 0 0 / .06); color: inherit; font-size: 12px; }
.wa-link { color: #027eb5; text-decoration: underline; }
.wa-ph { color: #667781; }
.wa-meta { display: block; text-align: right; font-size: 10.5px; color: #667781; margin-top: 2px; }
.wa-ticks { color: #53bdeb; letter-spacing: -3px; margin-left: 2px; }
.wa-input { display: flex; align-items: center; gap: 8px; padding: 8px; background: #f0f2f5; }
.wa-input span { flex: 1; background: #fff; color: #8696a0; border-radius: 999px; padding: 8px 14px; font-size: 13px; font-family: system-ui, sans-serif; }
.wa-input b { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #00a884; color: #fff; }
@media (max-width: 900px) {
  .with-preview { grid-template-columns: 1fr; }
  .wa-preview { position: static; }
  .wa-phone { height: 400px; }
}
.with-preview .img-preview { display: none !important; }

/* ==========================================================================
   Admin ponsel — desain "Kaca Teal" seperti admin WS Pro web: tanpa bar atas,
   pil kanan atas, bar bawah "Curve Wave", kartu kaca, pop up jadi lembar bawah.
   ========================================================================== */
@property --am-i { syntax: "<number>"; inherits: true; initial-value: 2; }
.am-pill, .am-navwrap { display: none; }
@media (max-width: 900px) {
  body:has(#shell:not(.hidden)) {
    background: radial-gradient(120% 55% at 0% 0%, color-mix(in srgb, var(--hero1) 85%, var(--bg)) 0%, transparent 60%),
      radial-gradient(90% 45% at 100% 22%, color-mix(in srgb, var(--accent) 16%, var(--bg)) 0%, transparent 55%), var(--bg) fixed;
  }
  .topbar { display: none; }
  main { padding: 16px 16px 120px; }
  .page-head > div:first-child { padding-right: 96px; }
  .page-head h1 { font-size: 24px; }

  /* Kartu kaca */
  .panel, .stat { background: color-mix(in srgb, var(--card) 80%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-radius: 20px; }
  .stat { border-radius: 16px; }

  /* Tab segmen berbentuk pil */
  .tabs { border-radius: 999px; padding: 4px; background: color-mix(in srgb, var(--text) 9%, transparent); border: 0; }
  .tabs button { border-radius: 999px; font-weight: 700; font-size: 12.5px; padding: 8px 14px; }

  /* Pil kanan atas */
  .am-pill { position: fixed; right: 12px; top: calc(12px + env(safe-area-inset-top, 0px)); z-index: 45; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px;
    background: color-mix(in srgb, var(--card) 82%, transparent); color: var(--text); box-shadow: 0 6px 18px -8px rgb(0 0 0 / .5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
  .am-pill a, .am-pill button { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 999px; color: inherit; background: transparent; border: 0; padding: 0; }
  .am-pill a:hover { text-decoration: none; }
  .am-pill .ic { width: 18px; height: 18px; }
  .am-pill [data-active="true"] { background: var(--brand); color: var(--brand-ink); }
  .am-pill i { width: 1px; height: 18px; background: currentColor; opacity: .25; }

  /* Bar bawah Curve Wave */
  .am-navwrap { display: block; position: fixed; left: 10px; right: 10px; bottom: 8px; z-index: 40; padding: 5px; border-radius: 30px;
    border: 1.5px solid color-mix(in srgb, var(--text) 30%, transparent); background: color-mix(in srgb, var(--text) 6%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
  .am-nav { --am-x: calc((var(--am-i) + .5) * 100% / 5); position: relative; height: 62px; transition: --am-i .45s cubic-bezier(.5, 1.4, .5, 1); }
  .am-nav-bg { position: absolute; inset: 0; border-radius: 24px; background: color-mix(in srgb, var(--nav) 92%, transparent);
    -webkit-mask: radial-gradient(circle at var(--am-x) 2px, transparent 29px, #000 29.5px); mask: radial-gradient(circle at var(--am-x) 2px, transparent 29px, #000 29.5px); }
  .am-nav[data-has-active="false"] .am-nav-bg { -webkit-mask: none; mask: none; }
  .am-nav-items { position: relative; display: grid; height: 100%; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .am-nav-item { display: grid; place-items: center; color: color-mix(in srgb, var(--text) 62%, var(--nav)); }
  .am-nav-item .ic { width: 21px; height: 21px; }
  .am-nav-item[data-on="true"] .ic { opacity: 0; }
  .am-nav-bubble { position: absolute; top: -22px; left: calc(var(--am-x) - 24px); display: grid; width: 48px; height: 48px; place-items: center; border-radius: 999px;
    background: var(--brand); color: var(--brand-ink); box-shadow: 0 8px 18px -6px rgb(0 0 0 / .5); pointer-events: none; }
  .am-nav-bubble .ic { width: 21px; height: 21px; }
  .am-nav-label { position: absolute; bottom: 6px; left: clamp(34px, var(--am-x), calc(100% - 34px)); transform: translateX(-50%); font-size: 10px; font-weight: 700; white-space: nowrap; color: var(--text); pointer-events: none; }
  #toasts { bottom: 96px; }

  /* Pop up menjadi lembar bawah */
  dialog.modal, dialog.modal.wide, dialog.modal.xwide { width: 100%; max-width: 100%; margin: auto 0 0; max-height: calc(100dvh - 44px); border-width: 1px 0 0; border-radius: 28px 28px 0 0;
    box-shadow: 0 -18px 40px -20px rgb(0 0 0 / .7); animation: am-sheet-in .28s cubic-bezier(.2, .8, .2, 1); overflow-x: hidden; }
  .modal-head { padding-top: 26px; border-radius: 28px 28px 0 0; }
  .modal-head::before { content: ""; position: absolute; top: 10px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 999px; background: var(--line); }
  .modal-body, .modal-head, .modal-foot { padding-left: 16px; padding-right: 16px; }
  form.modal-body .modal-foot { margin: 16px -16px -16px; }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .modal-foot > button { flex: 1 1 0; }
  dialog.modal input, dialog.modal textarea, dialog.modal select { font-size: 16px; }
}
@keyframes am-sheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .am-nav { transition: none; } dialog.modal { animation: none; } }

.img-edit { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; }
.img-edit .thumb { max-width: 160px; max-height: 160px; border-radius: 10px; object-fit: cover; }

/* Alur pengiriman kampanye: 4 kotak berpanah per baris (seperti WS Pro web). */
.flow { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.flow-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.flow-box { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--card2) 70%, transparent); text-align: center; min-width: 0; }
.flow-box span { font-size: 11px; color: var(--muted); line-height: 1.2; max-width: 100%; }
.flow-box b { font-size: 16px; font-variant-numeric: tabular-nums; }
.flow-box:not(:last-child)::after { content: ""; position: absolute; right: -11px; top: 50%; margin-top: -5px; border: 5px solid transparent; border-left: 6px solid var(--brand); }
.flow-box.ok b { color: var(--ok); }
.flow-box.bad { border-color: color-mix(in srgb, var(--bad) 70%, transparent); }
.flow-box.bad b { color: var(--bad); }
.flow-box.done b, .flow-box.off { opacity: .45; }
@media (max-width: 520px) { .flow-row { gap: 10px; } .flow-box span { font-size: 10px; white-space: normal; line-height: 1.2; } .flow-box b { font-size: 14px; } .flow-box:not(:last-child)::after { right: -9px; } }
.camp-meta { margin-top: 8px; }

/* Pemilih kode negara nomor target */
.cpick-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 4px; font-size: 13px; color: var(--muted); }
.cpick { position: relative; }
.cpick-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; background: var(--card2); color: var(--text); border: 1px solid var(--line); font-weight: 600; }
.cpick-btn .caret { color: var(--muted); font-size: 11px; }
.cpick .iso { display: inline-block; min-width: 22px; font-size: 10.5px; font-weight: 800; letter-spacing: .03em; color: var(--muted); }
.cpick-pop { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; width: min(300px, 80vw); background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px -12px var(--shade); padding: 8px; }
.cpick-search { width: 100%; margin-bottom: 6px; }
.cpick-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; }
.cpick-item { display: grid; grid-template-columns: 30px 1fr auto 16px; align-items: center; gap: 6px; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text); text-align: left; font-size: 13px; }
.cpick-item:hover, .cpick-item.on { background: var(--card2); }
.cpick-item .dl { color: var(--muted); font-variant-numeric: tabular-nums; }
.cpick-item .ck { color: var(--brand); }

/* Tabel ringkas di HP: satu data per baris, kolom sejajar (lebar tetap per jenis tabel). */
.m-only { display: none; }
@media (max-width: 640px) {
  .tbl.m-rows tr { display: grid; align-items: center; gap: 4px 10px; padding: 9px 12px; margin-bottom: 6px; border-radius: 12px; }
  .tbl.m-rows td { display: none; padding: 0; border: 0; text-align: left; min-width: 0; font-size: 13px; }
  .tbl.m-rows td::before { display: none; }
  .tbl.m-rows .sub, .tbl.m-rows td .icon-btn, .tbl.m-rows .m-hide-i { display: none; }
  .tbl.m-rows .m-only { display: inline; }
  .tbl.m-rows td[colspan] { display: block; grid-column: 1 / -1; text-align: center; }
  .tbl.m-rows td:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tbl.m-rows .who .avatar { width: 28px; height: 28px; font-size: 11px; }
  .tbl.m-rows .who span { display: none; }
  .tbl.m-rows .who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  .tbl.m-rows .badge { white-space: nowrap; }
  /* kolom yang tampil (sesuai urutan) & lebarnya */
  .tbl.m-live tr { grid-template-columns: minmax(0, 1fr) 84px 58px; }
  .tbl.m-live td:is(:nth-child(1), :nth-child(2), :nth-child(4)) { display: block; }
  .tbl.m-blasts tr { grid-template-columns: minmax(0, 1fr) 118px 108px; }
  .tbl.m-blasts td:is(:nth-child(2), :nth-child(5), :nth-child(6)) { display: block; }
  .tbl.m-blasts.m-rows td:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; justify-self: stretch; }
  .tbl.m-users tr { grid-template-columns: minmax(0, 1fr) 92px 70px; }
  .tbl.m-users td:is(:nth-child(1), :nth-child(2), :nth-child(6)) { display: block; }
  .tbl.m-wd-pending tr { grid-template-columns: minmax(0, 1fr) 92px 96px; }
  .tbl.m-wd-pending td:is(:nth-child(1), :nth-child(2), :nth-child(6)) { display: block; }
  .tbl.m-wd-pending td:nth-child(6) .badge { display: none; }
  .tbl.m-wd-done tr { grid-template-columns: minmax(0, 1fr) 92px 82px; }
  .tbl.m-wd-done td:is(:nth-child(1), :nth-child(2), :nth-child(5)) { display: block; }
  .tbl.m-rekap tr { grid-template-columns: minmax(0, 1fr) 56px 96px; }
  .tbl.m-rekap td:is(:nth-child(1), :nth-child(2), :nth-child(8)) { display: block; }
  .tbl.m-targets tr { grid-template-columns: minmax(0, 1fr) 104px minmax(0, 84px); }
  .tbl.m-targets td:is(:nth-child(1), :nth-child(2), :nth-child(3)) { display: block; }
  .tbl.m-wdh tr { grid-template-columns: 92px minmax(0, 1fr) 82px; }
  .tbl.m-wdh td:is(:nth-child(1), :nth-child(2), :nth-child(4)) { display: block; }
  /* kolom ke-2 & ke-3 rata kanan */
  .tbl.m-rows:not(.m-sends) tr > td:is(:nth-child(n+2)) { text-align: right; justify-self: end; }
  .tbl.m-rows .row-btns { justify-content: flex-end; flex-wrap: nowrap; }
  .tbl.m-blasts.m-rows tr > td:nth-child(2) { text-align: left; justify-self: stretch; }
  .tbl.m-rows .row-btns .sm { padding: 6px 10px; }
  /* pop up detail blaster: waktu · nomor blast -> tujuan · status */
  .tbl.m-sends tr { grid-template-columns: 64px minmax(0, 1fr) 104px; grid-template-areas: "t s c" "t d c"; }
  .tbl.m-sends td { display: block; }
  .tbl.m-sends td.m-hide { display: none; }
  .tbl.m-sends .m-t { grid-area: t; font-size: 11.5px; color: var(--muted); }
  .tbl.m-sends .m-s { grid-area: s; font-size: 12px; }
  .tbl.m-sends .m-s::after { content: " →"; color: var(--muted); }
  .tbl.m-sends .m-d { grid-area: d; font-size: 12.5px; }
  .tbl.m-sends .m-c { grid-area: c; justify-self: end; }
}
/* Panel yang sedang membuka pemilih negara naik ke atas panel lain (kartu kaca membuat stacking context). */
.panel:has(.cpick-pop:not(.hidden)), dialog .modal-body:has(.cpick-pop:not(.hidden)) { position: relative; z-index: 50; }
