:root {
  --accent: #0F5C4A;
  --gold: #F2B33D;
  --bg: #ecedf3;
  --card: #ffffff;
  --ink: #1b1f2e;
  --ink2: #5b6176;
  --line: #dfe1ea;
  --in: #ffffff;
  --out: #dcefe7;
  --hot: #c4402f;
  --warm: #c98a1a;
  --cold: #4b7bb5;
  --ok: #1f8a5b;
  --bad: #c4402f;
  --r: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--ink2); text-align: center; gap: 12px; }
.muted { color: var(--ink2); }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand b { display: block; font-size: 17px; }
.brand small { display: block; color: var(--ink2); font-size: 12.5px; }
.brand small.off { color: var(--bad); }
.brand.small b { font-size: 15.5px; }
.logo { width: 38px; height: 38px; border-radius: 11px; background: var(--accent); color: var(--gold);
  display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: none; }
.logo .mark { width: 52%; height: 52%; display: block; }
.logo.big { width: 64px; height: 64px; font-size: 30px; border-radius: 18px; opacity: .9; }

/* ---------- buttons ---------- */
.btn { display: block; width: 100%; border: 0; border-radius: 12px; padding: 14px 16px; font-weight: 600; font-size: 15.5px; cursor: pointer; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:disabled { opacity: .6; }
.btn.google { display: flex; align-items: center; justify-content: center; gap: 12px; background: #fff; color: var(--ink);
  border: 1.5px solid var(--line); box-shadow: 0 1px 2px #1b1f2e12; }
.btn.google:hover { background: #f7f8fb; }
.btn.google:disabled { opacity: .7; cursor: wait; }
.btn.google .g { width: 22px; height: 22px; stroke: none; }
.btn.ghost { background: transparent; color: var(--accent); }
.iconbtn { border: 0; background: transparent; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  cursor: pointer; color: var(--ink); flex: none; text-decoration: none; }
.iconbtn:active { background: var(--bg); }

/* ---------- login ---------- */
#app.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 20px; padding: 28px 22px; box-shadow: 0 10px 40px #1b1f2e14; }
.login-card .brand { margin-bottom: 24px; }
.login-card form { display: grid; gap: 10px; }
.login-card label { font-weight: 600; font-size: 14px; }
.login-card input { border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; font-size: 16px; }
.login-card input:focus { outline: none; border-color: var(--accent); }
#code { letter-spacing: .4em; text-align: center; font-size: 22px; font-weight: 600; }
.hint { color: var(--ink2); font-size: 13.5px; line-height: 1.45; margin: 0 0 6px; }
.err { color: var(--bad); font-size: 14px; }
.foot { color: var(--ink2); font-size: 13px; text-align: center; margin: 22px 0 0; line-height: 1.6; }

/* ---------- shell ---------- */
#app.shell { height: 100vh; height: 100dvh; display: grid; grid-template-columns: 100%; overflow: hidden; }
.pane { min-height: 0; display: flex; flex-direction: column; background: var(--card); }
.pane.chat { display: none; background: var(--bg); }
#app.show-chat .pane.inbox { display: none; }
#app.show-chat .pane.chat { display: flex; }
.bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: var(--card); min-height: 62px; position: relative; }
.bar .brand { flex: 1; }

/* ---------- inbox ---------- */
.searchbox { margin: 10px 12px 4px; display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 12px; padding: 0 12px; color: var(--ink2); }
.searchbox svg { width: 18px; height: 18px; }
.searchbox input { flex: 1; border: 0; background: transparent; padding: 11px 0; font-size: 15px; outline: none; }
.chips { display: flex; gap: 8px; padding: 8px 12px 10px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 13px; font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.chip span { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--bg); font-size: 12px; font-weight: 600; margin-left: 2px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.on span { background: #ffffff2b; }
.list { list-style: none; margin: 0; padding: 0 0 var(--safe-b); overflow-y: auto; flex: 1; }
.list .empty { text-align: center; color: var(--ink2); padding: 48px 20px; }
.row { display: flex; gap: 12px; padding: 12px 14px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); }
.row:active, .row.active { background: #f3f4f9; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: #dcebe5; color: var(--accent); font-weight: 600; display: grid; place-items: center; flex: none; font-size: 15px; }
.avatar.sm { width: 38px; height: 38px; font-size: 13.5px; }
.mid { flex: 1; min-width: 0; display: grid; gap: 3px; }
.l1, .l2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 15.5px; }
.l1 time { color: var(--ink2); font-size: 12.5px; flex: none; }
.row.unread .l1 time { color: var(--accent); font-weight: 600; }
.prev { flex: 1; min-width: 0; color: var(--ink2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.unread .prev { color: var(--ink); font-weight: 500; }
.badge { background: var(--accent); color: #fff; border-radius: 999px; min-width: 22px; height: 22px; padding: 0 7px; font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: none; }
.l3 { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 0; }
.l3:empty { display: none; }
.tag { font-size: 11.5px; font-weight: 600; border-radius: 6px; padding: 2px 7px; background: var(--bg); color: var(--ink2); }
.tag.hot { background: #fbe4e0; color: var(--hot); }
.tag.warm { background: #fbefd9; color: #9c6a10; }
.tag.cold { background: #e2ecf8; color: var(--cold); }
.tag.ad { background: #f3ecdf; color: #7a5d27; }
.tag.wait { background: #e8f2ec; color: var(--ok); }
.tag.wait.late { background: #fbe4e0; color: var(--hot); }
.who { font-size: 12px; color: var(--ink2); margin-left: auto; }

/* ---------- chat ---------- */
.placeholder { flex: 1; display: grid; place-items: center; align-content: center; gap: 14px; color: var(--ink2); }
.chathead { gap: 4px; padding-left: 4px; }
.who-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; text-align: left; cursor: pointer; padding: 4px; border-radius: 10px; }
.who-btn b { display: block; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-btn small { display: block; color: var(--ink2); font-size: 12.5px; }
.who-btn > span:last-child { min-width: 0; }
.assignbar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: #f7f3ea; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.assignbar label { color: #7a5d27; font-weight: 600; }
.assignbar select { flex: 1; border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; background: #fff; }
.msgs { flex: 1; overflow-y: auto; padding: 14px 12px 8px; display: flex; flex-direction: column; gap: 4px; }
.loading { text-align: center; color: var(--ink2); padding: 30px; font-size: 14px; }
.day { text-align: center; margin: 10px 0 6px; }
.day span { background: #dfe1ea; color: var(--ink2); font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 8px; }
.adcard { display: flex; gap: 10px; align-items: flex-start; background: #f7f3ea; border: 1px solid #ebdfc6; border-radius: 12px; padding: 10px 12px; margin: 0 auto 8px; max-width: 92%; color: #7a5d27; }
.adcard small { display: block; font-size: 11.5px; }
.adcard b { display: block; font-size: 14px; color: var(--ink); }
.adcard p { margin: 4px 0 0; font-size: 13px; color: var(--ink2); }
.bubble { max-width: min(80%, 520px); padding: 8px 10px 5px; border-radius: 14px; font-size: 15px; line-height: 1.42; box-shadow: 0 1px 1px #1b1f2e0f; word-wrap: break-word; overflow-wrap: anywhere; }
.bubble.in { background: var(--in); align-self: flex-start; border-top-left-radius: 4px; }
.bubble.out { background: var(--out); align-self: flex-end; border-top-right-radius: 4px; }
.bubble.failed { background: #fbe4e0; }
.bubble .txt a { word-break: break-all; }
.meta { display: flex; gap: 6px; justify-content: flex-end; align-items: center; font-size: 11.5px; color: var(--ink2); margin-top: 2px; }
.meta .by { font-weight: 600; color: var(--accent); }
.tick { font-weight: 700; letter-spacing: -2px; }
.tick.read { color: #2f7de1; }
.tick.failed { color: var(--bad); letter-spacing: 0; }
.fail { color: var(--bad); font-size: 12.5px; margin-top: 3px; }
.mediabox { min-width: 200px; min-height: 60px; display: grid; place-items: center; background: #f0f1f6; border-radius: 10px; margin-bottom: 4px; overflow: hidden; font-size: 13px; }
.mediabox img, .mediabox video { display: block; max-width: 100%; max-height: 340px; border-radius: 10px; cursor: zoom-in; }
.mediabox audio { width: 240px; }
.docbtn { display: flex; gap: 8px; align-items: center; border: 0; background: #f0f1f6; border-radius: 10px; padding: 10px 12px; cursor: pointer; margin-bottom: 4px; text-align: left; }
.banner { margin: 0 10px 8px; padding: 10px 12px; border-radius: 12px; background: #f0f1f6; font-size: 13.5px; line-height: 1.45; color: var(--ink2); }
.banner.warn { background: #fbefd9; color: #6d4b0c; }
.banner.soft { background: #e8f2ec; color: #18603f; padding: 7px 12px; }
#composer { padding-bottom: var(--safe-b); background: var(--bg); }
#composer:has(.banner.warn) { padding-bottom: calc(var(--safe-b) + 10px); }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 8px 10px 10px; }
.composer textarea { flex: 1; resize: none; border: 0; border-radius: 22px; padding: 12px 16px; font-size: 16px; line-height: 1.35; background: #fff; max-height: 140px; outline: none; box-shadow: 0 1px 2px #1b1f2e12; }
.sendbtn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.sendbtn svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }

/* ---------- menus ---------- */
.menu { position: absolute; z-index: 40; background: var(--card); border-radius: 14px; box-shadow: 0 12px 40px #1b1f2e26; padding: 6px; min-width: 240px; }
#me-menu { position: fixed; top: 60px; left: 12px; }
.chatmenu { right: 10px; top: 56px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 12px; border-radius: 10px; cursor: pointer; font-size: 14.5px; }
.menu button:hover { background: var(--bg); }
.menu .danger { color: var(--bad); }
.menu .me { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu .me small { display: block; color: var(--ink2); font-size: 12.5px; }
.menu .ver { display: block; color: var(--ink2); font-size: 11px; padding: 4px 12px; }

/* ---------- lead panel (sheet di HP) ---------- */
.pane.lead { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; max-height: 86vh; border-radius: 20px 20px 0 0;
  transform: translateY(105%); transition: transform .25s ease; box-shadow: 0 -10px 40px #1b1f2e22; }
.pane.lead.open { transform: none; }
.pane.lead .bar { border-radius: 20px 20px 0 0; }
.pane.lead .bar b { flex: 1; font-size: 16px; padding-left: 4px; }
.sheet-backdrop { position: fixed; inset: 0; background: #1b1f2e55; z-index: 45; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet-backdrop.on { opacity: 1; pointer-events: auto; }
.leadbody { overflow-y: auto; padding: 14px 16px calc(24px + var(--safe-b)); display: grid; gap: 12px; }
.leadbody label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.leadbody input, .leadbody select, .leadbody textarea { border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 15px; font-weight: 400; color: var(--ink); background: #fff; }
.leadbody input:focus, .leadbody select:focus, .leadbody textarea:focus { outline: none; border-color: var(--accent); }
.leadbody .ro { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.leadbody .ro span { color: var(--ink2); }
.leadbody .ro b { text-align: right; font-weight: 500; }
.labels { border: 0; padding: 0; margin: 0; display: flex; gap: 8px; }
.labels legend { font-size: 13px; font-weight: 600; color: var(--ink2); margin-bottom: 6px; padding: 0; }
.lab { flex: 1; border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 0; font-weight: 600; cursor: pointer; }
.lab.hot.on { background: var(--hot); border-color: var(--hot); color: #fff; }
.lab.warm.on { background: var(--warm); border-color: var(--warm); color: #fff; }
.lab.cold.on { background: var(--cold); border-color: var(--cold); color: #fff; }
.saved { font-size: 12.5px; margin: 0; min-height: 16px; }
.saved.ok { color: var(--ok); } .saved.bad { color: var(--bad); }
.leadbody h4 { margin: 8px 0 0; font-size: 13px; color: var(--ink2); }
.acts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.acts time { color: var(--ink2); font-size: 12px; margin-right: 6px; }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; top: calc(70px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -20px); background: #1b1f2e; color: #fff;
  padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 99; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--bad); } #toast.ok { background: var(--ok); }

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  #app.shell { grid-template-columns: 380px 1fr 340px; }
  .pane.inbox { border-right: 1px solid var(--line); }
  .pane.chat, #app.show-chat .pane.chat { display: flex; }
  #app.show-chat .pane.inbox { display: flex; }
  .chathead .back { display: none; }
  .chathead { padding-left: 12px; }
  .pane.lead { position: static; transform: none; max-height: none; border-radius: 0; box-shadow: none; border-left: 1px solid var(--line); transition: none; }
  .pane.lead .bar { border-radius: 0; }
  .pane.lead .closebtn { display: none; }
  .sheet-backdrop { display: none; }
  #toast { top: 74px; }
}
@media (min-width: 900px) and (max-width: 1180px) {
  #app.shell { grid-template-columns: 340px 1fr 300px; }
}

/* ---------- Sprint 2: status, tawaran, onboarding ---------- */
.pres { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--line); background: #fff; border-radius: 999px;
  padding: 7px 12px; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.pres.online { border-color: #bfe3d2; background: #ecf8f2; color: #12704a; }
.pres.break { border-color: #f3dfaa; background: #fdf6e3; color: #8a6510; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #9aa0b4; flex: none; display: inline-block; }
.dot.online { background: #1fae6b; box-shadow: 0 0 0 3px #1fae6b33; }
.dot.break { background: #e0a52b; }
#pres-menu { position: fixed; top: 60px; right: 60px; left: auto; }
#pres-menu button { display: flex; align-items: center; gap: 10px; }
#pres-menu small { color: var(--ink2); font-size: 12px; margin-left: auto; padding-left: 10px; }
.banner.hot { background: #fbe4e0; color: #8f2a1c; font-weight: 600; }
.banner.hot.urgent, .tag.urgent { animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { opacity: .55; } }

#offers { position: fixed; inset: 0; z-index: 80; display: none; align-items: flex-end; justify-content: center;
  background: #0b1a1555; padding: 12px; padding-bottom: calc(12px + var(--safe-b)); }
#offers.on { display: flex; }
.offer { width: 100%; max-width: 420px; background: #fff; border-radius: 22px; padding: 18px; box-shadow: 0 20px 60px #0b1a1544;
  display: grid; gap: 12px; animation: up .25s ease; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.offer-top { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.offer-top b { flex: 1; }
.offer-top .count { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 20px; color: var(--accent); }
.offer-top .count.urgent { color: var(--bad); }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: #1fae6b; box-shadow: 0 0 0 0 #1fae6b88; animation: pulse 1.4s infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 12px #1fae6b00; } }
.offer-who { display: flex; gap: 12px; align-items: center; }
.offer-who b { display: block; font-size: 17px; }
.offer-who small { color: var(--ink2); }
.offer-ad { display: flex; gap: 8px; align-items: center; background: #f7f3ea; color: #7a5d27; border-radius: 10px; padding: 8px 10px; font-size: 13.5px; }
.offer-ad svg { width: 18px; height: 18px; flex: none; }
.offer-msg { margin: 0; background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: 15px; line-height: 1.4; max-height: 90px; overflow: hidden; }
.offer .btn.primary { padding: 16px; font-size: 17px; }
.offer-note { color: var(--ink2); font-size: 12.5px; text-align: center; }

#onb { position: fixed; inset: 0; z-index: 90; background: #0b1a1566; display: grid; place-items: center; padding: 16px; }
.onb-card { width: 100%; max-width: 440px; max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 22px; padding: 22px 20px 16px; box-shadow: 0 20px 60px #0b1a1544; }
.onb-dots { display: flex; gap: 6px; margin-bottom: 14px; }
.onb-dots span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.onb-dots span.on { background: var(--accent); }
.onb-body h2 { margin: 0 0 8px; font-size: 20px; }
.onb-body p { margin: 0 0 12px; color: var(--ink2); line-height: 1.5; font-size: 14.5px; }
.onb-body .btn { margin-top: 6px; }
.rules { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 8px; font-size: 14.5px; line-height: 1.45; }
.okline { color: var(--ok) !important; font-weight: 600; }
.badline { color: var(--bad) !important; }
.onb-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.onb-nav .btn { width: auto; padding: 12px 20px; }
@media (max-width: 420px) { .pres { padding: 6px 10px; font-size: 13px; } .bar .brand small { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }

/* ---------- Sprint 3a: tab, lead, follow up, modal ---------- */
.pane.inbox { position: relative; }
.tabs { display: flex; gap: 4px; margin: 10px 12px 0; background: var(--bg); border-radius: 12px; padding: 4px; }
.tabs button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 9px 6px; font-weight: 600; font-size: 14px; color: var(--ink2); cursor: pointer; }
.tabs button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px #1b1f2e1a; }
.tabs button span { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; margin-left: 2px; }
.fab { position: absolute; right: 16px; bottom: calc(18px + var(--safe-b)); z-index: 30; display: flex; align-items: center; gap: 6px;
  border: 0; border-radius: 999px; padding: 13px 18px 13px 14px; background: var(--accent); color: #fff; font-weight: 600; font-size: 15px;
  box-shadow: 0 8px 24px #0f5c4a55; cursor: pointer; }
.fab svg { width: 20px; height: 20px; stroke-width: 2.4; }
.list { padding-bottom: calc(84px + var(--safe-b)); }
.row.fu-row { align-items: center; }
.mini { border: 0; border-radius: 9px; padding: 8px 12px; background: var(--accent); color: #fff; font-weight: 600; font-size: 13px; cursor: pointer; flex: none; white-space: nowrap; }
.mini.ghost { background: var(--bg); color: var(--ink); }
.mini:disabled { opacity: .6; }
.linkbtn { font-size: 13.5px; font-weight: 600; text-decoration: none; }

.fu-mini { display: flex; align-items: center; gap: 10px; background: #f3f6f4; border-radius: 12px; padding: 10px 12px; }
.fu-mini div { flex: 1; min-width: 0; }
.fu-mini small { display: block; color: var(--ink2); font-size: 12px; }
.fu-mini b { font-size: 14px; font-weight: 600; }

.who-btn.static { cursor: default; }
.leadpage { flex: 1; overflow-y: auto; padding: 12px 12px calc(28px + var(--safe-b)); display: grid; gap: 12px; align-content: start; }
.leadpage .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.act { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--card); border-radius: 12px; padding: 13px; text-decoration: none; font-weight: 600; color: var(--accent); box-shadow: 0 1px 2px #1b1f2e12; }
.leadpage .hint { margin: 0; }
.card { background: var(--card); border-radius: 14px; padding: 14px; box-shadow: 0 1px 2px #1b1f2e12; }
.card h4 { margin: 0 0 10px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.card h4 svg { width: 18px; height: 18px; color: var(--accent); }
.leadbody.flat { overflow: visible; padding: 14px; }
.fu-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.fu-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.fu-list li.due { background: #fbefd9; }
.fu-list li > div:first-child { flex: 1; min-width: 0; }
.fu-list b { display: block; font-size: 14px; }
.fu-list small { color: var(--ink2); font-size: 12.5px; }
.fu-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.fu-add { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.fu-add input { border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 14px; min-width: 0; }
.fu-add input[type=date] { flex: 0 0 auto; }
.fu-add #fu-note { flex: 1 1 140px; }
.card details { margin-top: 8px; font-size: 13.5px; }
.card summary { cursor: pointer; color: var(--accent); font-weight: 600; margin-bottom: 8px; }

#modal { position: fixed; inset: 0; z-index: 85; background: #0b1a1566; display: flex; align-items: flex-end; justify-content: center; padding: 10px; padding-bottom: calc(10px + var(--safe-b)); }
.modal-card { width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 20px; padding: 16px 18px 18px; box-shadow: 0 20px 60px #0b1a1544; display: grid; gap: 12px; animation: up .2s ease; }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head b { font-size: 17px; }
.modal-card .hint { margin: 0; }
.form { display: grid; gap: 12px; }
.fld { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.fld input, .fld select, .fld textarea { border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px; font-size: 16px; font-weight: 400; color: var(--ink); background: #fff; width: 100%; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: none; border-color: var(--accent); }
.opts { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.opts legend { font-size: 13px; font-weight: 600; color: var(--ink2); margin-bottom: 6px; padding: 0; }
.opts button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 13px; font-size: 14px; cursor: pointer; }
.opts button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.modal-card .err { margin: 0; }
.imp-sum { background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.imp-sum.ok { background: #e8f2ec; color: #18603f; }
.imp-sum .bad, tr.bad td { color: var(--bad); }
.imp-table { overflow-x: auto; margin-top: 8px; }
.imp-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.imp-table th, .imp-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
@media (min-width: 900px) {
  #modal { align-items: center; }
  .leadpage { padding: 16px 20px 28px; }
}
@media (min-width: 900px) {
  #app.shell.lead-mode { grid-template-columns: 380px 1fr; }
  #app.shell.lead-mode .pane.lead { display: none; }
  .leadpage { max-width: 760px; width: 100%; margin: 0 auto; }
}

/* ---------- Sprint 3b: laporan & kode sumber ---------- */
.chips.flat { padding: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { background: var(--card); border-radius: 14px; padding: 12px 14px; box-shadow: 0 1px 2px #1b1f2e12; }
.stat b { display: block; font-size: 26px; font-weight: 700; color: var(--accent); }
.stat small { color: var(--ink2); font-size: 12.5px; }
.stat.warn b { color: var(--bad); }
.bar-row { display: grid; grid-template-columns: 86px 1fr 34px; align-items: center; gap: 10px; font-size: 13.5px; margin: 6px 0; }
.bar-row b { text-align: right; }
.bar-track { height: 10px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--accent); border-radius: 6px; min-width: 2px; }
.adv { border-top: 1px solid var(--line); padding: 12px 0 4px; }
.adv:first-of-type { border-top: 0; padding-top: 0; }
.adv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.adv-head small { color: var(--ink2); font-size: 12.5px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 13.5px; }
.kv span { color: var(--ink2); }
.kv b { text-align: right; font-weight: 600; }
.kv em { font-style: normal; font-weight: 500; }
.kv em.bad { color: var(--bad); }
.codes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.codes li { background: var(--bg); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; }
.codes li.off { opacity: .6; }
.code-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.code-head b { font-family: ui-monospace, Menlo, monospace; font-size: 15px; }
.codes small { color: var(--ink2); font-size: 12.5px; }
.code-act { display: flex; gap: 6px; flex-wrap: wrap; }
.code-act .mini.ghost { background: #fff; }
img.qr { width: 240px; height: 240px; margin: 0 auto; image-rendering: pixelated; display: block; }
.hint.break { word-break: break-all; font-size: 12px; }
a.btn { text-align: center; text-decoration: none; }
.leadpage { grid-template-columns: minmax(0, 1fr); }
.leadpage > * { min-width: 0; }
.chips.flat { flex: none; min-height: 40px; }
.keybox { border: 2px solid var(--gold); }
code.key { display: block; word-break: break-all; background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 10px; }
pre.code { white-space: pre-wrap; word-break: break-all; background: #1b1f2e; color: #e8eaf2; border-radius: 10px; padding: 10px 12px; font-size: 12px; margin: 0 0 8px; }
