:root {
  --bg: #f6f5f1;
  --panel: #ffffff;
  --ink: #1d2327;
  --muted: #6b7378;
  --line: #e4e1d9;
  --accent: #d1495b;
  --ok: #2a9d6f;
  --warn: #c98a1b;
  --chip: #f0eee8;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171a; --panel: #1c2024; --ink: #e9ecee; --muted: #98a1a8;
    --line: #2c3238; --chip: #262b30; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #14171a; --panel: #1c2024; --ink: #e9ecee; --muted: #98a1a8;
  --line: #2c3238; --chip: #262b30; --shadow: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 "Plus Jakarta Sans", system-ui, sans-serif; }
a { color: inherit; }
.muted { color: var(--muted); }
.pad { padding: 24px 16px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.brand-name { font-weight: 800; }
.brand-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
select, input[type=search] { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }

.tabs { display: flex; gap: 4px; padding: 8px 20px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; position: sticky; top: 63px; z-index: 4; }
.tabs a { text-decoration: none; padding: 7px 14px; border-radius: 8px; color: var(--muted); font-weight: 600; white-space: nowrap; font-size: 14px; }
.tabs a.aktif { background: var(--ink); color: var(--panel); }

main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 64px; }
h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 32px 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.lead { font-size: 16px; max-width: 760px; color: var(--muted); margin: 0 0 20px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .n { font-size: 28px; font-weight: 800; line-height: 1.1; }
.kpi .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
ul.list { margin: 0; padding-left: 18px; }
ul.list li { margin: 4px 0; }

.temuan { counter-reset: t; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.temuan li { counter-increment: t; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 12px 48px; position: relative; }
.temuan li::before { content: counter(t); position: absolute; left: 14px; top: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--chip); margin: 2px 4px 2px 0; }
.chip.aktif { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); font-weight: 600; }
.chip.mati { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); font-weight: 600; }
.chip.menang { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-weight: 600; }

/* bar per produk */
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 70px; gap: 10px; align-items: center; font-size: 14px; }
.bar-track { height: 22px; background: var(--chip); border-radius: 6px; overflow: hidden; display: flex; }
.bar-track span { height: 100%; }
.bar-track .mati { opacity: .35; }

/* timeline */
.timeline { overflow-x: auto; }
.timeline svg { display: block; min-width: 640px; width: 100%; }
.timeline text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.timeline .lbl { fill: var(--ink); font-weight: 600; font-size: 12px; }
.timeline line { stroke: var(--line); }

/* produk */
.pcard { cursor: pointer; transition: transform .1s; border-top: 4px solid var(--c, var(--accent)); }
.pcard:hover { transform: translateY(-2px); }
.pcard .harga { font-size: 22px; font-weight: 800; }
.pcard .model { font-size: 12px; color: var(--muted); }
.stat { display: flex; gap: 14px; margin: 10px 0; font-size: 13px; color: var(--muted); }
.stat b { color: var(--ink); }
.prio { float: right; font-size: 12px; font-weight: 700; background: var(--ink); color: var(--panel); border-radius: 6px; padding: 2px 8px; }

.detail-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.back { text-decoration: none; color: var(--muted); font-size: 14px; }
.angle-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.angle-row:last-child { border-bottom: 0; }
.hook { border-left: 3px solid var(--accent); padding: 6px 12px; margin: 8px 0; background: var(--chip); border-radius: 0 8px 8px 0; font-style: italic; }

/* iklan */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters input[type=search] { flex: 1; min-width: 180px; }
.ad { display: grid; gap: 8px; }
.ad-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ad-id { font-size: 12px; color: var(--muted); }
.usia { font-weight: 800; font-size: 18px; }
.usia small { font-weight: 500; font-size: 12px; color: var(--muted); }
details summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
details p { white-space: pre-line; margin: 8px 0 0; font-size: 14px; }
.links { font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }

.prio-list { display: grid; gap: 10px; }
.prio-item { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; }
.prio-item .num { width: 44px; height: 44px; border-radius: 10px; background: var(--c); color: #fff; font-weight: 800; font-size: 20px; display: grid; place-items: center; }

@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .tabs { padding: 8px 16px; top: 59px; }
  main { padding: 18px 16px 48px; }
  .bar-row { grid-template-columns: 100px 1fr 54px; font-size: 13px; }
  h1 { font-size: 22px; }
}
