/* Stylesheet mandiri.
 *
 * Brief menyarankan Tailwind lewat CDN, tapi CDN itu tidak selalu bisa
 * dijangkau — di environment ini cdn.tailwindcss.com dan unpkg.com diblokir
 * egress policy, dan jaringan internal bank kemungkinan besar sama. Demo yang
 * bergantung pada CDN eksternal berisiko tampil tanpa styling persis saat
 * dipresentasikan, jadi seluruh CSS di-vendor lokal. Tidak ada build step.
 */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --faint: #94a3b8;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --red-border: #fecaca;
  --amber: #b45309;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;
  --violet: #6d28d9;
  --violet-bg: #f5f3ff;
  --violet-border: #ddd6fe;
  --blue: #2563eb;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* --- header --------------------------------------------------------------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand { font-weight: 600; letter-spacing: -0.01em; text-decoration: none; }
.brand span { color: var(--red); }
.nav { display: flex; gap: 16px; font-size: 14px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--red); }
.nav a.on { color: var(--red); font-weight: 500; }
.tagline { margin-left: auto; font-size: 12px; color: var(--faint); }

main { max-width: 1100px; margin: 0 auto; padding: 24px 20px 64px; }

h1.page { font-size: 18px; margin: 0 0 4px; }
p.lede { font-size: 14px; color: var(--muted); margin: 0 0 20px; }
h2.section { font-size: 14px; margin: 0 0 12px; }

/* --- filter bar ----------------------------------------------------------- */
.filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  font-size: 14px;
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 12px; color: var(--muted); }
.field select, .field input[type="number"] {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 8px;
  font: inherit;
  background: var(--surface);
}
.field input[type="number"] { width: 96px; }
.check { display: flex; align-items: center; gap: 8px; padding-bottom: 5px; }
.btn-primary {
  margin-left: auto;
  background: #0f172a;
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 7px 14px;
  font: inherit;
  cursor: pointer;
}
.btn-primary:hover { background: #334155; }

.count { font-size: 14px; color: var(--muted); margin: 0 0 12px; }

/* --- kartu feed ----------------------------------------------------------- */
.cards { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.card-top { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }

.chip {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip.cat-fraud { background: var(--red-bg); color: #991b1b; border-color: var(--red-border); }
.chip.cat-service { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); }
.chip.cat-reputation { background: var(--violet-bg); color: var(--violet); border-color: var(--violet-border); }
.chip.cat-other { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }

/* Badge UNTAGGED adalah jualan utama halaman ini — sengaja paling mencolok. */
.badge-untagged {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--red);
  color: #fff;
}
.badge-previral {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f97316;
  color: #fff;
}

.urgency { margin-left: auto; text-align: right; white-space: nowrap; }
.urgency b {
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
}
.urgency.high b { color: var(--red); }
.urgency.mid b { color: var(--amber); }
.urgency span { font-size: 12px; color: var(--faint); margin-left: 4px; }

.summary { margin: 12px 0 0; font-weight: 500; }
.excerpt {
  margin: 8px 0 0;
  font-size: 14px;
  color: #475569;
  white-space: pre-line;
  border-left: 2px solid var(--border);
  padding-left: 12px;
}

.meta {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.meta .handle { font-weight: 500; color: #334155; }
.meta .pill { background: #f1f5f9; padding: 1px 6px; border-radius: 4px; }
.meta .pill.stub { background: #fef9c3; color: #854d0e; }
.meta a { color: var(--blue); text-decoration: none; }
.meta a:hover { text-decoration: underline; }

.actions { margin-top: 12px; padding-top: 12px; border-top: 1px solid #f1f5f9; }
.status-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.status-now { font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.status-now.new { background: #f1f5f9; color: #475569; }
.status-now.acknowledged { background: #dbeafe; color: #1d4ed8; }
.status-now.escalated { background: var(--red-bg); color: #b91c1c; }
.status-now.dismissed { background: #f1f5f9; color: var(--faint); }
.status-btn {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}
.status-btn:hover { border-color: var(--faint); color: #334155; }

.empty { color: var(--faint); font-size: 14px; }
code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: 13px; }

/* --- impact --------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr; } }

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stat.headline { border: 2px solid var(--red-border); }
.stat .num {
  font-size: 38px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat.headline .num { color: var(--red); }
.stat .label { margin-top: 4px; font-size: 14px; font-weight: 500; }
.stat .sub { margin-top: 8px; font-size: 12px; color: var(--muted); }
.stat .note { margin-top: 8px; font-size: 12px; color: var(--faint); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.chart { display: flex; align-items: flex-end; gap: 3px; height: 160px; }
.chart .col {
  flex: 1;
  min-width: 6px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
}
.chart .seg { width: 100%; border-top: 1px solid #fff; }
.seg.cat-fraud { background: #ef4444; }
.seg.cat-service { background: #f59e0b; }
.seg.cat-reputation { background: #8b5cf6; }
.chart .col .tip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 4px;
  background: #0f172a;
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.chart .col:hover .tip { display: block; }
.axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--faint); margin-top: 8px; }
.legend { display: flex; gap: 16px; margin-top: 16px; font-size: 12px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* --- incidents ------------------------------------------------------------ */
.inc-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.inc-group { font-weight: 500; }
.chip.z { background: var(--red-bg); color: #b91c1c; border-color: var(--red-border); }
.inc-status { margin-left: auto; font-size: 12px; color: var(--muted); }
.inc-numbers { margin-top: 12px; display: flex; align-items: center; gap: 20px; font-size: 14px; }
.inc-numbers .k { font-size: 12px; color: var(--faint); }
.inc-numbers .v { font-variant-numeric: tabular-nums; }
.inc-numbers .v.obs { font-weight: 600; color: var(--red); }
.bars { flex: 1; }
.bar { height: 8px; border-radius: 4px; }
.bar.base { background: #cbd5e1; margin-bottom: 4px; }
.bar.obs { background: #ef4444; }
.samples { margin-top: 12px; padding-top: 12px; border-top: 1px solid #f1f5f9; }
.samples .k { font-size: 12px; color: var(--faint); margin-bottom: 8px; }
.samples ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.samples li { font-size: 14px; color: #475569; }
.samples .who { color: var(--faint); }
