/* HeroWA — tema kaca ungu VibeCoder dengan aksen hijau WhatsApp. */

:root {
  --bg: #f5f4ff;
  --ink: #1f1b3a;
  --muted: #635f82;
  --line: rgba(99, 91, 150, .16);
  --soft: rgba(255, 255, 255, .62);
  --soft-strong: rgba(255, 255, 255, .82);
  --indigo: #4f46e5;
  --violet: #8b5cf6;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --red: #dc2626;
  --amber: #b45309;
  --cyan: #0e7490;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 45px -28px rgba(79, 70, 229, .55), 0 2px 8px -4px rgba(31, 27, 58, .12);
  --gap: 20px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  background:
    radial-gradient(1100px 700px at 8% -12%, rgba(139, 92, 246, .22), transparent 62%),
    radial-gradient(900px 640px at 98% 4%, rgba(34, 197, 94, .13), transparent 58%),
    radial-gradient(820px 620px at 58% 108%, rgba(99, 102, 241, .18), transparent 62%),
    var(--bg);
  background-attachment: fixed;
}

a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 4px; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.06rem; }
h3 { font-size: 1.02rem; }
h4 { font-size: .95rem; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: .86em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ------------------------------------------------------------- kerangka */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  flex: 0 0 250px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 14px 18px;
  background: rgba(255, 255, 255, .58);
  border-right: 1px solid rgba(255, 255, 255, .8);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  z-index: 30;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 12px; }
.brand .logo { flex: 0 0 auto; filter: drop-shadow(0 6px 12px rgba(99, 102, 241, .35)); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text b { font-size: 1.02rem; letter-spacing: -.01em; }
.brand-text span { font-size: .72rem; color: var(--muted); line-height: 1.3; }

.nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1 1 auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 11px;
  color: #3b3560; font-weight: 500; font-size: .9rem;
  transition: background .15s ease, color .15s ease;
}
.nav-item:hover { background: rgba(99, 102, 241, .08); text-decoration: none; }
.nav-item.active { background: linear-gradient(135deg, rgba(79, 70, 229, .14), rgba(139, 92, 246, .16)); color: var(--indigo); }
.nav-item .ic { width: 18px; height: 18px; opacity: .85; }
.nav-logout { color: #7c2d12; }

.sidebar-foot { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.who { display: flex; flex-direction: column; padding: 0 10px 4px; min-width: 0; }
.who-name { font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-mail { font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 22px 28px 8px;
}
.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.page-title { font-size: 1.3rem; }
.page-sub { margin: 0; color: var(--muted); font-size: .82rem; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.content { padding: 12px 28px 40px; display: flex; flex-direction: column; gap: var(--gap); max-width: 1180px; width: 100%; }
.content-wide { max-width: 1360px; }

.icon-btn.nav-toggle { display: none; }
.scrim { display: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--soft-strong); color: #3b3560; cursor: pointer; font-size: 1.1rem;
}
.icon-btn:hover { background: #fff; }

/* --------------------------------------------------------------- kartu */

.card {
  background: var(--soft);
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  overflow: hidden;
}
.card-accent { border-color: rgba(139, 92, 246, .35); box-shadow: 0 24px 50px -30px rgba(109, 40, 217, .6); }
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.card-head h2 { margin: 0; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: .8rem; }
.card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 18px 20px 20px; }
.card-body-flush { padding: 0; }
.card-body-flush > .pad { padding: 18px 20px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.gap-sm { gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row-gap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gap-top { margin-top: 16px; }

.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 18px; border-radius: 16px;
  background: var(--soft-strong); border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: var(--shadow);
}
.stat-ic {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(79, 70, 229, .14), rgba(139, 92, 246, .18));
  color: var(--indigo);
}
.stat-ic .ic { width: 18px; height: 18px; }
.stat > div { display: flex; flex-direction: column; min-width: 0; }
.stat-num { font-size: 1.32rem; font-weight: 700; letter-spacing: -.02em; }
.stat-label { font-size: .78rem; color: var(--muted); }
.stat-hint { font-size: .7rem; color: #8b87a8; }

/* -------------------------------------------------------------- tombol */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 8px 15px;
  border-radius: 11px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .875rem;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .06s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:hover { text-decoration: none; }
.btn .ic { width: 16px; height: 16px; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #4f46e5, #8b5cf6);
  box-shadow: 0 12px 22px -14px rgba(79, 70, 229, .9);
}
.btn-primary:hover { box-shadow: 0 14px 26px -12px rgba(79, 70, 229, .85); }
.btn-ghost { background: rgba(255, 255, 255, .78); border-color: var(--line); color: #3b3560; }
.btn-ghost:hover { background: #fff; }
.btn-danger { background: linear-gradient(135deg, #dc2626, #ef4444); color: #fff; }
.btn-danger-ghost { background: rgba(255, 255, 255, .8); border-color: rgba(220, 38, 38, .35); color: var(--red); }
.btn-sm { min-height: 30px; padding: 5px 11px; font-size: .8rem; border-radius: 9px; }
.btn-block { width: 100%; }
.inline-form { display: inline-flex; }
form { margin: 0; }

/* --------------------------------------------------------------- form */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: .78rem; font-weight: 600; color: #4b456e; }
.field-static { display: flex; flex-direction: column; gap: 7px; }
.field-static > .label { font-size: .78rem; font-weight: 600; color: #4b456e; }
.input {
  width: 100%; min-height: 38px; padding: 9px 12px;
  border-radius: var(--radius-sm); border: 1px solid rgba(99, 91, 150, .24);
  background: rgba(255, 255, 255, .85); color: var(--ink);
  font: inherit; font-size: .9rem;
}
.input:focus { outline: 2px solid rgba(99, 102, 241, .35); outline-offset: 1px; border-color: rgba(99, 102, 241, .5); }
textarea.input { min-height: 74px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #6b6890 50%), linear-gradient(135deg, #6b6890 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.input[readonly] { background: rgba(243, 241, 255, .9); color: #4b456e; }

.check { display: flex; align-items: flex-start; gap: 9px; font-size: .85rem; color: #3b3560; padding: 2px 0; }
.check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--indigo); flex: 0 0 auto; }
.checks { display: flex; flex-wrap: wrap; gap: 14px; }

.filters { display: grid; grid-template-columns: 1.6fr .8fr .9fr 1fr auto; gap: 12px; align-items: end; }
.filters-actions { display: flex; gap: 8px; }

.hint { font-size: .76rem; color: var(--muted); margin: 0; }
.link { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: .78rem; }
.nowrap { white-space: nowrap; }
.break { word-break: break-word; overflow-wrap: anywhere; }
.danger { color: var(--red); }
.success { color: var(--green); }
.ta-r { text-align: right; }
.msg-preview { max-width: 380px; }

.details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.details summary { cursor: pointer; font-weight: 600; font-size: .85rem; color: #4b456e; margin-bottom: 10px; }

.hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* --------------------------------------------------------------- tabel */

.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.table th {
  text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: #6f6a91; font-weight: 700; padding: 11px 14px; white-space: nowrap;
  border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .45);
}
.table td { padding: 11px 14px; border-bottom: 1px solid rgba(99, 91, 150, .1); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(255, 255, 255, .5); }
.table .pad { padding: 20px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* -------------------------------------------------------------- lencana */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; white-space: nowrap;
  border: 1px solid transparent;
}
.b-green { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.b-red { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.b-amber { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.b-cyan { background: #cffafe; color: #0e7490; border-color: #a5f3fc; }
.b-violet { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.b-grey { background: #f1f0f7; color: #5c5878; border-color: #e4e1f0; }

/* --------------------------------------------------------------- flash */

.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 13px;
  font-size: .86rem; border: 1px solid transparent;
}
.flash .ic { width: 18px; height: 18px; flex: 0 0 auto; }
.flash span { flex: 1 1 auto; min-width: 0; }
.flash-ok { background: rgba(220, 252, 231, .85); border-color: #bbf7d0; color: #166534; }
.flash-err { background: rgba(254, 226, 226, .9); border-color: #fecaca; color: #991b1b; }
.flash-info { background: rgba(237, 233, 254, .85); border-color: #ddd6fe; color: #5b21b6; }

/* --------------------------------------------------------------- kode */

.copy-box {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; border-radius: 11px;
  background: rgba(255, 255, 255, .8); border: 1px solid var(--line);
}
.copy-value { flex: 1 1 220px; min-width: 0; word-break: break-all; font-size: .82rem; }
.copy-btn { flex: 0 0 auto; }

pre.code-block {
  margin: 0; padding: 12px 14px; overflow-x: auto;
  border-radius: 12px; border: 1px solid rgba(99, 91, 150, .18);
  background: #211d3a; color: #e6e4ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem; line-height: 1.55;
  white-space: pre;
}

/* --------------------------------------------------------------- langkah */

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: flex; align-items: flex-start; gap: 11px; }
.steps li > div { display: flex; flex-direction: column; gap: 2px; }
.step-dot {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(99, 102, 241, .35); background: rgba(255, 255, 255, .8);
  color: var(--indigo);
}
.step-dot .ic { width: 14px; height: 14px; }
.steps li.done .step-dot { background: var(--green-soft); border-color: #86efac; color: var(--green); }
.steps.numbered { counter-reset: step; }
.steps.numbered li::before {
  counter-increment: step; content: counter(step);
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #4f46e5, #8b5cf6); color: #fff;
  font-size: .76rem; font-weight: 700;
}

/* --------------------------------------------------------------- lain-lain */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .8); border: 1px solid var(--line);
  font-size: .8rem; font-weight: 600; color: #3b3560; cursor: pointer;
}
.chip:hover { background: #fff; border-color: rgba(99, 102, 241, .4); }

.dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 0 0 12px; }
.dl > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dl dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #7a759b; font-weight: 700; }
.dl dd { margin: 0; font-size: .88rem; word-break: break-word; }

.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.plan-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px; border-radius: 15px;
  background: rgba(255, 255, 255, .82); border: 1px solid var(--line);
}
.plan-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.plan-price { font-weight: 700; color: var(--indigo); font-size: .9rem; }
.plan-preview { background: rgba(255, 255, 255, .7); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: .82rem; }
.plan-preview ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 26px 18px; }
.empty-icon {
  width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(79, 70, 229, .14), rgba(139, 92, 246, .2));
  color: var(--indigo);
}
.empty h3 { margin: 4px 0 0; }
.empty p { max-width: 460px; color: var(--muted); font-size: .86rem; }

.mini-card { padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, .72); border: 1px solid var(--line); }
.mini-card h4 { margin-bottom: 4px; }

.msg-body {
  white-space: pre-wrap; word-break: break-word;
  max-height: 240px; overflow: auto;
  padding: 12px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, .8); border: 1px solid var(--line);
  font-size: .88rem;
}

/* --------------------------------------------------------------- dialog */

dialog.dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  padding: 20px; border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 18px; background: #fbfaff; color: var(--ink);
  box-shadow: 0 40px 80px -30px rgba(31, 27, 58, .55);
}
dialog.dialog-lg { width: min(720px, calc(100vw - 28px)); }
dialog.dialog::backdrop { background: rgba(31, 27, 58, .42); backdrop-filter: blur(3px); }
dialog.dialog h3 { margin-bottom: 4px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; margin-top: 6px; }

/* --------------------------------------------------------------- sederhana */

body.simple { display: flex; align-items: flex-start; justify-content: center; padding: 36px 16px 60px; }
.simple-wrap { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 14px; }
.simple-card {
  padding: 26px 24px; border-radius: 22px;
  background: var(--soft); border: 1px solid rgba(255, 255, 255, .82);
  box-shadow: var(--shadow); backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  display: flex; flex-direction: column; gap: 16px;
}
.simple-brand { display: flex; align-items: center; gap: 12px; }
.simple-brand > div { display: flex; flex-direction: column; }
.simple-brand b { font-size: 1.05rem; }
.simple-brand span { font-size: .76rem; color: var(--muted); }
.simple-foot { text-align: center; font-size: .74rem; color: var(--muted); margin: 0; }
.simple .stack h2 { margin-bottom: 2px; }

/* ------------------------------------------------------------ responsif */

@media (max-width: 1080px) {
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-actions { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: 260px; flex-basis: 260px;
    transform: translateX(-102%);
    transition: transform .2s ease;
    box-shadow: 0 0 60px rgba(31, 27, 58, .25);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(31, 27, 58, .35); z-index: 20; }
  .icon-btn.nav-toggle { display: inline-flex; }
  .topbar { padding: 16px 16px 4px; }
  .content { padding: 10px 16px 32px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .dl { grid-template-columns: minmax(0, 1fr); }
  .plans { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 13px 14px; gap: 10px; }
  .stat-num { font-size: 1.16rem; }
  .card-head { flex-direction: column; align-items: stretch; gap: 10px; padding: 16px 16px 12px; }
  .card-body { padding: 16px; }
  .table th, .table td { padding: 10px 12px; }
  .msg-preview { max-width: 220px; }
  .filters { grid-template-columns: minmax(0, 1fr); }
  .topbar-actions .btn { min-height: 34px; }
  .page-title { font-size: 1.14rem; }
  dialog.dialog { padding: 16px; }
}


/* ------------------------------------------------- WhatsApp Web (QR) */

.flash-warn { background: rgba(254, 243, 199, .92); border-color: #fde68a; color: #92400e; }
.card-warn { border-color: rgba(245, 158, 11, .38); }
.card-warn .card-head { background: rgba(254, 243, 199, .28); }

.risk-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: .84rem; color: #4b456e; }
.risk-list li::marker { color: #b45309; }
.risk-list b { color: #7c2d12; }

.qr-panel { display: grid; grid-template-columns: minmax(0, 232px) minmax(0, 1fr); gap: 18px; align-items: start; }
.qr-box {
  display: flex; align-items: center; justify-content: center;
  width: 232px; height: 232px; padding: 10px;
  border-radius: 16px; background: #fff; border: 1px solid var(--line);
  box-shadow: inset 0 0 0 6px rgba(99, 102, 241, .06);
}
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-box .hint { text-align: center; padding: 0 8px; }
.qr-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.qr-status { margin: 0; font-weight: 700; font-size: .9rem; color: var(--indigo); }
.qr-side .steps { gap: 8px; }
.pair-code {
  display: flex; align-items: center; justify-content: center;
  padding: 12px 14px; border-radius: 12px;
  background: #211d3a; color: #e6e4ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.35rem; letter-spacing: .22em; font-weight: 700;
}

@media (max-width: 720px) {
  .qr-panel { grid-template-columns: minmax(0, 1fr); }
  .qr-box { width: 100%; height: auto; aspect-ratio: 1 / 1; max-width: 260px; margin: 0 auto; }
}
