:root {
  --bg: #ffffff;
  --ink: #3d1d36;
  --title: #5a2350;
  --muted: #8d7187;
  --line: #f6d3e3;
  --line-strong: #eeb2cd;
  --pink: #e0458f;
  --pink-ink: #a3215f;
  --pink-soft: #fff0f6;
  --pink-chip: #fde4ef;
  --mark: #fbd5e6;
  --card: linear-gradient(180deg, #ffffff 0%, #fff8fb 100%);
  --shadow: 0 10px 30px rgba(224, 69, 143, 0.08), 0 1px 2px rgba(90, 35, 80, 0.04);
  --radius: 24px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 18px 16px 80px; }

/* ---------- header ---------- */
.brandrow { display: flex; align-items: center; justify-content: space-between; margin: -4px -8px 0 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 2px; }
.brand { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--pink); margin: 0; }
h1 { margin: 0; white-space: nowrap; font-size: 28px; line-height: 1.15; font-weight: 800; color: var(--title); display: flex; align-items: center; gap: 10px; letter-spacing: -.02em; }
.count { font-size: 15px; font-weight: 700; color: var(--pink-ink); background: var(--pink-chip); border-radius: 999px; padding: 3px 11px; letter-spacing: 0; }
.ghost { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 15px; padding: 8px 6px; border-radius: 12px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.ghost:hover { color: var(--pink-ink); background: var(--pink-soft); }
.ghost svg { width: 18px; height: 18px; }

.feedbar { margin: 10px 0 4px; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.feedbar .dot { margin-right: 6px; vertical-align: 1px; }
.feedbar .sep { margin: 0 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #c9b6c4; display: inline-block; }
.dot.ok { background: #2fb37a; box-shadow: 0 0 0 3px #dff6ea; }
.dot.bad { background: #e5484d; box-shadow: 0 0 0 3px #fde3e4; }
.feedbar .sep { opacity: .5; }
.linkbtn { border: 0; background: none; color: var(--pink-ink); font-weight: 700; cursor: pointer; padding: 2px 0; text-decoration: none; font-size: 13.5px; }
.linkbtn:disabled { opacity: .5; cursor: default; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 26px; overflow-x: auto; scrollbar-width: none; border-bottom: 1.5px solid var(--line); margin: 14px 0 18px; padding: 0 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 0; background: none; padding: 10px 0 12px; font-weight: 700; font-size: 16px; color: var(--muted); cursor: pointer; position: relative; display: inline-flex; align-items: center; gap: 8px; }
.tab .n { font-size: 13px; background: var(--pink-chip); color: var(--pink-ink); border-radius: 10px; padding: 2px 9px; }
.tab[aria-selected="true"] { color: var(--pink); }
.tab[aria-selected="true"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1.5px; height: 3px; border-radius: 3px; background: var(--pink); }

/* ---------- filter ---------- */
.filters { display: grid; grid-template-columns: 1fr minmax(140px, 220px); gap: 12px; margin-bottom: 20px; }
.field { position: relative; }
.field svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.input, .select {
  width: 100%; height: 52px; border: 1.5px solid var(--line-strong); border-radius: 20px; background: #fff;
  padding: 0 16px; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input { padding-left: 44px; }
.input::placeholder { color: #a8909f; }
.input:focus, .select:focus { border-color: var(--pink); box-shadow: 0 0 0 4px #fde4ef; }
.select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238d7187' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; cursor: pointer; }

/* ---------- kartu ---------- */
.list > * { min-width: 0; }
.list { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 18px; align-items: start; }
.card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 20px 14px; animation: rise .35s ease both; }
.card.fresh { border-color: var(--line-strong); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.head { display: flex; align-items: flex-start; gap: 12px; }
.avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--pink-chip); color: var(--pink-ink); display: grid; place-items: center; font: 600 18px/1 Georgia, 'Times New Roman', serif; }
.who { flex: 1; min-width: 0; }
.name { font-weight: 700; font-size: 17px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { font-size: 14px; color: var(--muted); display: flex; gap: 5px; white-space: nowrap; }
.meta .handle { min-width: 7ch; overflow: hidden; text-overflow: ellipsis; }
.meta time { flex: none; }
.meta a { text-decoration: none; }
.pill { flex: none; font-size: 13px; font-weight: 600; border-radius: 999px; padding: 5px 14px; border: 1.5px solid; }
.st-baru { color: var(--pink-ink); border-color: #f2b9d2; background: var(--pink-soft); }
.st-ditindaklanjuti { color: #5b46b0; border-color: #d6cdfa; background: #f5f2ff; }
.st-selesai { color: #237a50; border-color: #bfe8d3; background: #effbf4; }
.st-diabaikan { color: #7d6f78; border-color: #e3dbe0; background: #f8f5f7; }
.st-disaring { color: #9a5b12; border-color: #f2d9b4; background: #fff8ee; }
.iconbtn { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 0; background: none; color: #b399aa; border-radius: 12px; cursor: pointer; }
.iconbtn:hover { background: var(--pink-soft); color: var(--pink-ink); }
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn.on { color: var(--pink); }
.iconbtn.on svg { fill: currentColor; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 14px; }
.chip { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; border-radius: 12px; padding: 6px 12px; border: 1.5px solid #f0c3d7; background: #fff5f9; color: var(--pink-ink); }
.chip .mono { font: 700 14px/1 Georgia, serif; }
.chip.kind { background: #fff; }
.chip.fh { background: var(--pink); border-color: var(--pink); color: #fff; }
.chip.src { font-size: 12px; font-weight: 600; border: 0; background: #fbf1f6; color: #a2869a; padding: 6px 10px; }

.text { font-size: 17px; line-height: 1.6; color: #4a2b44; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.text mark { background: var(--mark); color: #8f1a52; border-radius: 6px; padding: 1px 4px; }
.match { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.match svg { width: 17px; height: 17px; flex: none; }
.reason { margin-top: 10px; font-size: 13.5px; color: #9a5b12; background: #fff8ee; border-radius: 10px; padding: 6px 10px; }
.foot { border-top: 1.5px solid var(--line); margin-top: 16px; padding-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid #eaa5c4; background: #fff; color: var(--pink-ink); font-weight: 700; font-size: 15px; border-radius: 16px; padding: 10px 16px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--pink-soft); }
.btn svg { width: 16px; height: 16px; }
.btn.solid { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn.solid:hover { background: #cc357c; }
.open { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 15px; text-decoration: none; }
.open:hover { color: var(--pink-ink); }
.open svg { width: 15px; height: 15px; }
.statussel { margin-left: auto; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 15px; padding: 6px 26px 6px 8px; appearance: none; cursor: pointer; border-radius: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%238d7187' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m3.5 5.5 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 6px center; }
.statussel:hover { background-color: var(--pink-soft); }

/* ---------- lain-lain ---------- */
.empty { grid-column: 1 / -1; text-align: center; padding: 48px 20px; color: var(--muted); border: 1.5px dashed var(--line-strong); border-radius: var(--radius); }
.empty b { display: block; color: var(--title); font-size: 18px; margin-bottom: 6px; }
.more { display: flex; justify-content: center; margin-top: 22px; }
.toast { position: fixed; left: 50%; top: 14px; transform: translate(-50%, -160%); visibility: hidden; transition: transform .3s ease, visibility .3s; z-index: 30; background: var(--pink); color: #fff; font-weight: 700; border: 0; border-radius: 999px; padding: 10px 18px; box-shadow: 0 10px 24px rgba(224, 69, 143, .35); cursor: pointer; }
.toast.show { transform: translate(-50%, 0); visibility: visible; }
.sheet-bg { position: fixed; inset: 0; background: rgba(61, 29, 54, .28); z-index: 40; display: none; }
.sheet-bg.show { display: block; }
.sheet { position: fixed; z-index: 41; left: 50%; bottom: 0; width: min(560px, 100%); transform: translate(-50%, 105%); transition: transform .28s ease; background: #fff; border-radius: 26px 26px 0 0; padding: 18px 18px 26px; max-height: 86vh; overflow: auto; box-shadow: 0 -12px 40px rgba(90, 35, 80, .18); }
.sheet.show { transform: translate(-50%, 0); }
@media (min-width: 700px) { .sheet { bottom: auto; top: 50%; border-radius: 26px; transform: translate(-50%, -45%); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; } .sheet.show { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; } }
.sheet h2 { margin: 2px 0 4px; font-size: 20px; color: var(--title); }
.sheet .sub { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.tpl { width: 100%; text-align: left; border: 1.5px solid var(--line); background: var(--card); border-radius: 18px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; }
.tpl:hover { border-color: var(--pink); }
.tpl b { display: block; color: var(--pink-ink); font-size: 14px; margin-bottom: 3px; }
.tpl span { font-size: 15px; color: #4a2b44; }
.tpl-edit { border: 1.5px solid var(--line); border-radius: 18px; padding: 12px; margin-bottom: 10px; display: grid; gap: 8px; }
.tpl-edit input, .tpl-edit textarea { border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 8px 10px; width: 100%; outline: none; }
.tpl-edit textarea { min-height: 76px; resize: vertical; }
.tpl-edit input:focus, .tpl-edit textarea:focus { border-color: var(--pink); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hint { font-size: 13px; color: var(--muted); }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: 44px; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 6px; min-width: 200px; display: none; z-index: 20; }
.menu-list.show { display: block; }
.menu-list a, .menu-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 10px; font-weight: 600; text-decoration: none; cursor: pointer; color: var(--ink); }
.menu-list a:hover, .menu-list button:hover { background: var(--pink-soft); color: var(--pink-ink); }

@media (max-width: 520px) {
  h1 { font-size: 26px; }
  .list { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 168px; gap: 10px; }
  .ghost { font-size: 14px; padding: 8px 2px; }
  .head { gap: 10px; }
  .pill { padding: 4px 11px; }
  .card { padding: 18px 18px 12px; }
}

/* ---------- login & sedot ---------- */
.center { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.panel { width: min(420px, 100%); background: var(--card); border: 1.5px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); padding: 28px 24px; }
.panel h1 { font-size: 26px; margin-bottom: 6px; }
.panel p { color: var(--muted); margin: 0 0 18px; }
.panel .input { padding-left: 16px; margin-bottom: 12px; }
.panel .btn { width: 100%; justify-content: center; }
.err { color: #c2264f; font-size: 14px; min-height: 20px; margin-top: 8px; }
.log { font-size: 14px; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 10px 12px; max-height: 260px; overflow: auto; }
.log div { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.log div:last-child { border: 0; }
.bm { display: inline-flex; align-items: center; gap: 8px; background: var(--pink); color: #fff; font-weight: 800; border-radius: 16px; padding: 12px 18px; text-decoration: none; cursor: grab; }
.steps { padding-left: 20px; color: var(--ink); }
.steps li { margin-bottom: 8px; }
code.box { display: block; background: #fff5f9; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; font-size: 12px; word-break: break-all; max-height: 120px; overflow: auto; }
