/* Dewa Scraper: kertas hangat + zamrud hemat + serif editorial (lihat DESIGN.md). */
:root {
  --paper: #FAF8F3;
  --card: #FFFFFF;
  --ink: #1C2430;
  --muted: #5B6472;
  --line: #E5DFD3;
  --emerald: #0E6B4F;
  --emerald-ink: #0A4D39;
  --ochre: #B45309;
  --danger: #B42318;
  --radius: 10px;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); line-height: 1.6; }
#root > h1 { font-size: 1.1rem; margin: 0 0 .6rem; }
a { color: var(--emerald-ink); }
:focus-visible { outline: 3px solid var(--emerald); outline-offset: 2px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }
.topbar { border-bottom: 1px solid var(--line); background: rgba(250, 248, 243, .86); -webkit-backdrop-filter: blur(12px) saturate(1.1); backdrop-filter: blur(12px) saturate(1.1); position: sticky; top: 0; z-index: 10; }
.topbar .wrap { display: flex; align-items: center; gap: 1.25rem; padding-top: .8rem; padding-bottom: .8rem; }
.brand { font-family: var(--serif); font-size: 1.25rem; text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: .5rem; }
.brand-logo { width: 30px; height: 30px; border-radius: 7px; display: inline-block; }
nav.mainnav { display: flex; gap: 1rem; margin-left: auto; }
nav.mainnav a { text-decoration: none; color: var(--muted); font-size: .95rem; }
nav.mainnav a:hover { color: var(--ink); }
.btn { display: inline-block; border: 1px solid var(--emerald-ink); background: var(--emerald); color: #fff; padding: .65rem 1.2rem; min-height: 44px; border-radius: var(--radius); font-weight: 600; text-decoration: none; cursor: pointer; font-size: .95rem; }
.btn:hover { background: var(--emerald-ink); border-color: var(--emerald-ink); }
.btn.ghost { background: transparent; color: var(--emerald-ink); }
.btn.ghost:hover { background: #EAF3EE; color: var(--emerald-ink); }
/* Varian kecil untuk tombol tabel dan aksi baris. */
.btn.sm { min-height: 36px; padding: .4rem .8rem; font-size: .83rem; border-radius: 8px; }
.btn.ghost.sm { border-color: var(--line); color: var(--ink); }
.btn.ghost.sm:hover { border-color: var(--emerald-ink); color: var(--emerald-ink); background: #EAF3EE; }
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 2.5rem; padding: 3.5rem 0 2.5rem; align-items: start; }
.hero h1 { font-size: 2.4rem; margin: 0 0 .75rem; }
.hero p.lede { font-size: 1.08rem; color: var(--muted); max-width: 34rem; }
.ledger { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; box-shadow: 0 2px 8px rgba(28, 36, 48, 0.04); }
.ledger header { padding: .7rem 1rem; border-bottom: 1px solid var(--line); font-size: .8rem; color: var(--muted); display: flex; justify-content: space-between; }
.ledger table { width: 100%; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
.ledger td, .ledger th { padding: .55rem .8rem; border-bottom: 1px solid var(--line); text-align: left; }
.ledger tr:last-child td { border-bottom: none; }
section.block { padding: 2.5rem 0; border-top: 1px solid var(--line); }
section.block h2 { font-size: 1.6rem; margin: 0 0 .4rem; position: relative; padding-top: .7rem; }
section.block h2::before { content: ''; position: absolute; top: 0; left: 0; width: 2.2rem; height: 3px; border-radius: 2px; background: var(--ochre); }
section.block .sub { color: var(--muted); max-width: 38rem; margin: 0 0 1.5rem; }
.plans { display: grid; grid-template-columns: repeat(5, 1fr); gap: .9rem; }
.plan { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 1.1rem; display: flex; flex-direction: column; gap: .35rem; box-shadow: 0 1px 6px rgba(28, 36, 48, 0.04); }
.plan.featured { border: 2px solid var(--emerald); }
.plan .pname { font-family: var(--serif); font-size: 1.05rem; }
.plan .price { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.plan .per { font-size: .8rem; color: var(--muted); }
.plan ul { margin: .5rem 0 1rem; padding-left: 1.1rem; font-size: .87rem; color: var(--muted); }
.plan .tag { display: inline-block; font-size: .72rem; font-weight: 700; color: var(--ochre); text-transform: uppercase; letter-spacing: .04em; }
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.tool { border-left: 3px solid var(--emerald); background: var(--card); border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0 var(--radius) var(--radius) 0; padding: 1rem 1.2rem; }
.tool h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.tool p { margin: 0; color: var(--muted); font-size: .92rem; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: .8rem 1rem; margin-bottom: .6rem; }
.faq summary { cursor: pointer; font-weight: 600; min-height: 44px; }
footer { border-top: 1px solid var(--line); padding: 1.8rem 0 2.5rem; color: var(--muted); font-size: .87rem; }
.sitefoot { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; }
.sitefoot .footside { display: flex; flex-direction: column; gap: .15rem; }
.sitefoot nav { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center; }
.sitefoot nav a { color: var(--muted); text-decoration: none; }
.sitefoot nav a:hover { color: var(--ink); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table.data { width: 100%; border-collapse: collapse; font-size: .87rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: .6rem .8rem; border-bottom: 1px solid var(--line); text-align: left; }
.stage { font-size: .75rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; background: #F1ECE1; color: var(--ink); }
.stage.admin { background: #DDF0E6; color: var(--emerald-ink); }
.stage.deal { background: #DDF0E6; color: var(--emerald-ink); }
.stage.gagal { background: #F9E3E0; color: var(--danger); }
/* Diagram batang horizontal analitik (data nyata dari leads). */
.hbars { display: flex; flex-direction: column; gap: .45rem; margin: .6rem 0 1.2rem; }
.hbar { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr 3.2rem; gap: .6rem; align-items: center; font-size: .83rem; }
.hbar .bl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.hbar .bt { height: 10px; background: #EEE8D9; border-radius: 999px; overflow: hidden; }
.hbar .bf { height: 100%; border-radius: 999px; background: var(--emerald); width: 0; transition: width .5s ease; }
.hbar .bv { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.analytics { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.apanel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 1rem 1.1rem; }
.apanel h3 { margin: 0 0 .3rem; font-size: 1rem; }
input, select, textarea { width: 100%; padding: .6rem .7rem; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; font-family: var(--sans); background: #fff; color: var(--ink); }
label { display: block; font-size: .85rem; font-weight: 600; margin: .7rem 0 .25rem; }
.formcard { max-width: 26rem; margin: 3rem auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 1.8rem; }
.notice { border: 1px solid var(--line); border-left: 3px solid var(--ochre); background: #FFFDF6; padding: .7rem 1rem; border-radius: 0 8px 8px 0; margin: 1rem 0; font-size: .9rem; }
.error { border-left-color: var(--danger); background: #FDF3F2; }
.tabs { display: flex; gap: .5rem; margin: 1.2rem 0; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: .5rem .9rem; min-height: 44px; cursor: pointer; font-size: .9rem; }
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.menubtn { display: none; }
/* Utilitas desain (ganti inline style tersebar). */
.muted { color: var(--muted); }
.muted-sm { color: var(--muted); font-size: .8rem; }
.mt1 { margin-top: 1rem; }
.full { width: 100%; }
.oauthbtn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.pad1 { padding: 1rem; }
.pvbox { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; }
.autogrid { display: grid; gap: 1rem; }
.cols-bayar { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.cols-admin { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.cols-dl { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
/* Form pencarian yang lebih informatif. */
.cari-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 720px) {
  .cari-grid { grid-template-columns: 1fr 1fr; }
  .cari-grid > div:last-child { grid-column: span 2; }
}
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .45rem; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .35rem .7rem; font-size: .8rem; cursor: pointer; color: var(--ink); min-height: 32px; }
.chip:hover { border-color: var(--emerald-ink); color: var(--emerald-ink); background: #EAF3EE; }
.search-summary { padding: .5rem .7rem; background: #FFFDF6; border: 1px dashed var(--line); border-radius: 8px; display: inline-block; }
.log-card { border: 1px solid var(--line); border-left: 3px solid var(--emerald); background: #fff; padding: .55rem .7rem; border-radius: 0 8px 8px 0; margin: .4rem 0; font-size: .85rem; }
.log-card.notice { border-left-color: var(--ochre); background: #FFFDF6; }
.log-card.error { border-left-color: var(--danger); background: #FDF3F2; }
.tip { border: 1px solid var(--line); background: #F7F4EC; border-radius: 8px; padding: .7rem .9rem; font-size: .85rem; color: var(--muted); margin-top: .8rem; }
.tip b { color: var(--ink); }
.mt05 { margin-top: .5rem; }
/* Toast notification. */
#toasts { position: fixed; bottom: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 100; max-width: min(22rem, 90vw); }
.toast { background: var(--ink); color: #fff; border-radius: 8px; padding: .65rem .9rem; font-size: .87rem; opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease; }
.toast.show { opacity: 1; transform: none; }
.toast.err { background: var(--danger); }
/* Modal generik. */
.mback { position: fixed; inset: 0; background: rgba(28, 36, 48, .45); display: flex; align-items: center; justify-content: center; z-index: 90; padding: 1rem; }
.mcard { background: var(--card); border-radius: 12px; border: 1px solid var(--line); max-width: 26rem; width: 100%; padding: 1.4rem; box-shadow: 0 2px 10px rgba(28, 36, 48, 0.05); }
.mcard h3 { margin-top: 0; }
.mfoot { display: flex; gap: .6rem; margin-bottom: 0; }
.detailmodal { max-width: 34rem; }
/* Skeleton loading. */
.skel { height: 1.1rem; border-radius: 6px; background: #ECE5D5; background-image: linear-gradient(90deg, #ECE5D5 25%, #F7F2E8 50%, #ECE5D5 75%); background-size: 200% 100%; animation: sk 1.2s ease infinite; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
/* Empty state. */
.empty { text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--card); padding: 2.5rem 1.5rem; max-width: 30rem; margin: 1.5rem auto; }
.empty-pin { width: 34px; height: 34px; border-radius: 50% 50% 50% 0; background: var(--emerald); transform: rotate(-45deg); margin: 0 auto .8rem; }
/* Perkakas daftar + bulk bar + pager. */
.leadtools { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin: 1rem 0; }
.leadtools input[type="search"] { max-width: 16rem; }
.tabs.slim button { min-height: 36px; padding: .35rem .7rem; font-size: .82rem; }
.bulkbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; border: 1px solid var(--line); background: #FFFDF6; border-radius: 8px; padding: .5rem .8rem; margin-bottom: .8rem; }
.bulkbar select { width: auto; min-height: 36px; }
.pager { display: flex; gap: .8rem; align-items: center; justify-content: center; margin: 1rem 0; }
/* CRM tools: search + count */
.crm-tools { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin: 1rem 0; }
.crm-tools input[type="search"] { max-width: 18rem; }
/* Papan CRM (Kanban) */
.board { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: .5rem; }
.bcol { flex: 0 0 17rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: 70vh; }
.bhead { padding: .6rem .8rem; border-bottom: 1px solid var(--line); font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.bhead.baru { background: #E0F2FE; color: #0369A1; }
.bhead.dihubungi { background: #FEF3C7; color: #B45309; }
.bhead.negosiasi { background: #FFEDD5; color: #C2410C; }
.bhead.deal { background: #DCFCE7; color: #15803D; }
.bhead.gagal { background: #FEE2E2; color: #B91C1C; }
.bcards { flex: 1; overflow-y: auto; padding: .5rem; display: flex; flex-direction: column; gap: .5rem; }
.bcard { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .7rem .8rem; cursor: pointer; transition: box-shadow .15s ease, transform .15s ease; box-shadow: 0 1px 4px rgba(28, 36, 48, 0.04); }
.bcard:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); transform: translateY(-1px); }
.btitle { font-weight: 700; margin-bottom: .2rem; }
.bmeta { font-size: .8rem; color: var(--muted); margin-bottom: .2rem; }
.bactions { display: flex; gap: .4rem; margin-top: .5rem; flex-wrap: wrap; }
/* Daftar follow-up di detail. */
.fulist { list-style: none; padding: 0; margin: .5rem 0; }
.fulist li { border-bottom: 1px solid var(--line); padding: .4rem 0; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.fulist li.done { opacity: .55; text-decoration: line-through; }
.fulist .ch { font-size: .78rem; font-weight: 700; color: var(--emerald-ink); white-space: nowrap; }
/* Aksi cepat di baris tabel. */
table.data td .btn.ghost.sm { padding: .35rem .55rem; font-size: .78rem; min-height: 32px; }
/* Tur onboarding. */
.tourtip { position: fixed; z-index: 95; background: var(--ink); color: #fff; border-radius: 10px; padding: .8rem 1rem; max-width: 19rem; font-size: .87rem; }
.tourtip .row { display: flex; gap: .6rem; margin-top: .6rem; }
.tourtip button { background: #fff; color: var(--ink); border: none; }
/* Bukti tepercaya: fakta terverifikasi, bukan angka klaim. */
.trust { display: flex; gap: 1.5rem; flex-wrap: wrap; padding: 1rem 0 0; font-size: .87rem; color: var(--muted); }
.trust span { display: inline-flex; align-items: center; gap: .45rem; }
.trust b { color: var(--emerald-ink); }
/* Tombol dasar: semua <button> langsung rapi tanpa kelas khusus. */
button { font-family: var(--sans); font-size: .87rem; font-weight: 600; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .85rem; min-height: 40px; cursor: pointer; transition: background .15s ease, border-color .15s ease, transform .05s ease; }
button:hover { background: #F3EFE6; border-color: #D8D0BE; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
/* Kartu angka analitik studio. */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .7rem; margin: 1rem 0; }
.kpi { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: .7rem .9rem; }
.kpi .n { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: .76rem; color: var(--muted); }
table.data tbody tr.rowlink { cursor: pointer; }
table.data tbody tr.rowlink:hover td { background: #FAF6EC; }
tr.detail td { background: #FFFDF7; font-size: .85rem; }
.detailgrid { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem 1.2rem; padding: .4rem 0; }
.detailgrid dt { color: var(--muted); font-size: .76rem; }
.detailgrid dd { margin: 0 0 .4rem; }
/* Transisi antar pane studio. */
#pane { animation: panein .25s ease; }
@keyframes panein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* Reveal saat scroll (MOTION 2): dipasang via .reveal oleh JS. */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: none; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  #pane { animation: none; }
  button { transition: none; }
  .skel { animation: none; }
  .toast { transition: none; }
}
/* Tabel leads menumpuk pagaya kartu di layar kecil. */
@media (max-width: 640px) {
  table.data thead, table.data tr:first-child th { position: static; }
  table.data tr.rowlink { display: block; border-bottom: 2px solid var(--line); padding: .4rem 0; }
  table.data tr.rowlink td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border: none; padding: .3rem .8rem; }
  table.data tr.rowlink td::before { content: attr(data-label); color: var(--muted); font-size: .76rem; font-weight: 700; }
  table.data tr.rowlink td[data-cb]::before { content: ''; }
  table.data tr.detail td { display: block; }
  table.data tr:first-child { display: none; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr 1fr; }
  .tools { grid-template-columns: 1fr; }
  nav.mainnav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--paper); flex-direction: column; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
  nav.mainnav.open { display: flex; }
  .menubtn { display: inline-block; margin-left: auto; }
}
@media (max-width: 560px) { .plans { grid-template-columns: 1fr; } .hero h1 { font-size: 1.9rem; } }
