/* Laporan Leads Maharewa — navy + emas (logo Maharewa) */
:root {
  --brand: #0E1B2C;
  --brand-dark: #08111D;
  --brand2: #172A42;
  --gold: #D4AF61;
  --gold-dark: #9A7426;
  --bg: #F3F4F7;
  --card: #FFFFFF;
  --text: #16202E;
  --muted: #6B7280;
  --line: #E3E6EC;
  --hot: #EE7B1E; --hot-soft: #FDF0E3;
  --cold: #3B8FD9; --cold-soft: #E4F0FB;
  --high: #D12A3C; --high-soft: #FBE5E7;
  --ok: #1E8E5A; --err: #C62828;
  --font: Lexend, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 16px; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(circle at 50% 20%, var(--brand2), var(--brand) 55%, var(--brand-dark)); }
.login-box { width: 100%; max-width: 340px; text-align: center; color: #fff; }
.login-logo { width: 120px; height: auto; margin-bottom: 8px; }
.login h1 { font-size: 16px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin: 8px 0 20px; }
.login input { width: 100%; padding: 14px; border-radius: 10px; border: 0; font-size: 18px; text-align: center; letter-spacing: .2em; margin-bottom: 10px; }
.login .btn { width: 100%; }
.login .err { color: #FFD2C7; min-height: 1.2em; }
#cancelLogin { margin-top: 18px; }

/* header */
.top { background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img.top-logo { height: 42px; width: auto; }
.brand b { display: block; font-size: 16px; letter-spacing: .12em; color: var(--gold); font-weight: 500; }
.brand small { display: block; color: rgba(255,255,255,.72); font-size: 12px; }
.link-btn { background: none; border: 1px solid rgba(212,175,97,.55); color: var(--gold); border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.tabs { display: flex; background: var(--brand); padding: 0 12px; gap: 4px; position: sticky; top: 0; z-index: 5; border-bottom: 1px solid rgba(212,175,97,.25); }
.tab { flex: 1; background: none; border: 0; color: rgba(255,255,255,.7); padding: 12px 4px; font: inherit; font-size: 14px; font-weight: 500;
  border-bottom: 3px solid transparent; cursor: pointer; text-align: center; text-decoration: none; }
.tab.active { color: var(--gold); border-color: var(--gold); }

main { max-width: 760px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border-radius: 14px; padding: 16px; margin-bottom: 14px; border: 1px solid var(--line); }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 700; }

/* form */
label, .field { display: block; font-size: 14px; font-weight: 500; color: var(--muted); margin-bottom: 14px; }
label em { font-weight: 400; }
input, textarea, select { display: block; width: 100%; margin-top: 6px; padding: 12px; font: inherit; color: var(--text); border: 1px solid var(--line); border-radius: 10px; background: #fff; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--gold); outline-offset: -1px; }
.jenis { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 6px; }
.opt { margin: 0; cursor: pointer; }
.opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.opt span { display: block; text-align: center; padding: 14px 4px; border-radius: 10px; border: 2px solid var(--line); font-size: 16px; color: var(--text); }
.opt.hot input:checked + span { border-color: var(--hot); background: var(--hot-soft); color: var(--hot); }
.opt.cold input:checked + span { border-color: var(--cold); background: var(--cold-soft); color: var(--cold); }
.opt.high input:checked + span { border-color: var(--high); background: var(--high-soft); color: var(--high); }
.opt input:focus-visible + span { outline: 2px solid var(--gold); }
.check { display: flex; gap: 12px; align-items: flex-start; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.check b { color: var(--text); font-size: 15px; font-weight: 500; }
.check small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.btn { border: 0; border-radius: 10px; padding: 14px 18px; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.btn.primary { background: var(--brand); color: var(--gold); width: 100%; }
.btn.gold { background: var(--gold); color: var(--brand-dark); }
.btn:disabled { opacity: .6; }
.btn.small { padding: 8px 12px; font-size: 13px; background: var(--bg); color: var(--brand); border: 1px solid var(--line); }
.msg { min-height: 1.2em; margin: 10px 0 0; text-align: center; font-weight: 500; }
.msg.ok { color: var(--ok); } .msg.bad { color: var(--err); }

/* list */
.row-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.row-head h2 { margin: 0; }
.pills { display: flex; gap: 6px; }
.pill { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.pill.hot { background: var(--hot-soft); color: var(--hot); } .pill.hot::before { content: "🔥 "; }
.pill.cold { background: var(--cold-soft); color: var(--cold); } .pill.cold::before { content: "❄️ "; }
.pill.high { background: var(--high-soft); color: var(--high); } .pill.high::before { content: "⭐ "; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .who { font-weight: 500; }
.list small { display: block; color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); text-align: center; padding: 12px 0; }
.badge { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; white-space: nowrap; align-self: center; }
.badge.hot { background: var(--hot-soft); color: var(--hot); }
.badge.cold { background: var(--cold-soft); color: var(--cold); }
.badge.high { background: var(--high-soft); color: var(--high); }
.tag-cek { display: inline-block; background: #F6EEDC; color: var(--gold-dark); font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; margin-left: 4px; }
.muted-sm { color: var(--muted); font-size: 13.5px; margin: -4px 0 12px; }
#rpRange { margin: -6px 0 12px; font-weight: 500; color: var(--gold-dark); }
.rp-btns { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.rp-btns .btn.small { padding: 14px 8px; font-size: 14px; }

/* rekap */
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 7px 14px; font: inherit; font-size: 14px; cursor: pointer; color: var(--text); }
.chip.active { background: var(--brand); border-color: var(--brand); color: var(--gold); }
.range { display: flex; align-items: center; gap: 8px; }
.range input { margin: 0; min-width: 0; padding: 10px 8px; font-size: 15px; }
.range span { color: var(--muted); font-size: 14px; }
.sel-proyek { margin-top: 12px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--card); border-radius: 14px; padding: 14px; border: 1px solid var(--line); }
.kpi small { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi b { display: block; font-size: 28px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpis .kpi:first-child { background: var(--brand); border-color: var(--brand); }
.kpis .kpi:first-child small { color: rgba(255,255,255,.72); }
.kpis .kpi:first-child b { color: var(--gold); }
.kpi.hot b { color: var(--hot); } .kpi.cold b { color: var(--cold); } .kpi.high b { color: var(--high); }
@media (max-width: 520px) { .kpis { grid-template-columns: repeat(2, 1fr); } }

.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin: -4px 0 10px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.dot.hot { background: var(--hot); } .dot.cold { background: var(--cold); } .dot.high { background: var(--high); }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 180px; overflow-x: auto; padding-bottom: 22px; position: relative; }
.bar { flex: 1 1 0; min-width: 7px; max-width: 42px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.bar .seg { width: 100%; }
.bar .seg.hot { background: var(--hot); } .bar .seg.cold { background: var(--cold); } .bar .seg.high { background: var(--high); }
.bar .seg:first-of-type { border-radius: 4px 4px 0 0; }
.bar .n { font-size: 11px; text-align: center; color: var(--text); font-weight: 500; margin-bottom: 2px; }
.bar .d { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--muted); }

.tbl-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .note { color: var(--muted); max-width: 220px; }
.tbl.rekap tr.grp td { background: #F6EEDC; font-weight: 700; border-top: 2px solid var(--line); }
.tbl.rekap tr.cs td:first-child { padding-left: 18px; }
.tbl.rekap tr.cs td.zero { color: #B4BBCB; }
.tbl.rekap tr.all td { background: var(--brand); color: var(--gold); font-weight: 700; }
.del { background: none; border: 0; color: var(--err); cursor: pointer; font: inherit; font-size: 13px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 10px 16px 28px; }
