:root {
  --brand: #1f6f43; --brand-dark: #16532f; --brand-soft: #e8f3ec;
  --surface: #fcfcfb; --bg: #f4f5f2; --ink: #0b0b0b; --ink-2: #52514e; --muted: #8a8984; --line: #e4e3de;
  --series-1: #2a78d6; --track: #e8eef7;
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
}
body { background: var(--bg); color: var(--ink); font-size: .9rem; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); --bs-btn-active-bg: var(--brand-dark); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand-dark); }
a { color: var(--brand); }
.app { display: flex; min-height: 100vh; }
.sidebar { width: 236px; background: #10291b; color: #cfe1d5; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 1030; transition: transform .2s; }
.sidebar .brand { display: flex; gap: .6rem; align-items: center; padding: 1.1rem 1rem; color: #fff; text-decoration: none; font-weight: 600; font-size: 1.05rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand i { font-size: 1.6rem; color: #7fd49b; }
.sidebar .brand small { display: block; font-weight: 400; font-size: .7rem; color: #9fbfaa; }
.sidebar nav { padding: .6rem .5rem; flex: 1; overflow-y: auto; }
.sidebar nav a { display: flex; align-items: center; gap: .6rem; color: #cfe1d5; text-decoration: none; padding: .5rem .75rem; border-radius: 6px; margin-bottom: 2px; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: var(--brand); color: #fff; }
.nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #7d9b88; padding: .9rem .75rem .3rem; }
.nav-count { margin-left: auto; background: var(--critical); color: #fff; border-radius: 10px; font-size: .7rem; padding: 0 .45rem; font-weight: 600; }
.sidebar-foot { font-size: .7rem; color: #6f8b79; padding: .6rem 1rem; }
.main { flex: 1; margin-left: 236px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: .75rem; background: #fff; border-bottom: 1px solid var(--line); padding: .6rem 1.25rem; position: sticky; top: 0; z-index: 1020; }
.page-title { font-size: 1.1rem; margin: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content { padding: 1.25rem; }
@media (max-width: 991px) { .sidebar { transform: translateX(-100%); } .sidebar.open { transform: none; } .main { margin-left: 0; } }

.card { border: 1px solid var(--line); border-radius: 10px; box-shadow: none; }
.card-header { background: #fff; border-bottom: 1px solid var(--line); font-weight: 600; padding: .7rem 1rem; }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .5rem .6rem; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); font-weight: 600; background: #fafaf8; white-space: nowrap; }
.table-hover tbody tr:hover { background: #f7faf8; }
.small-muted { font-size: .78rem; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.filters .form-select, .filters .form-control { width: auto; min-width: 140px; font-size: .85rem; }

/* Stat tiles */
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1rem; height: 100%; }
.kpi .label { font-size: .75rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 1.6rem; font-weight: 600; line-height: 1.2; margin-top: .2rem; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: .78rem; color: var(--muted); }
.kpi a { color: inherit; text-decoration: none; }

/* Funnel / bar marks: satu hue, ujung membulat 4px pada sisi data */
.bars .bar-row { display: grid; grid-template-columns: 120px 1fr 110px; gap: .6rem; align-items: center; padding: 3px 0; }
.bars .bar-label { font-size: .82rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars .bar-track { height: 14px; position: relative; }
.bars .bar-fill { height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.bars .bar-val { font-size: .82rem; font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); }
.bars .bar-row:hover .bar-fill { filter: brightness(1.12); }
.meter { height: 8px; background: var(--track); border-radius: 4px; overflow: hidden; }
.meter > div { height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }

/* Badges */
.stage-badge { font-weight: 500; border: 1px solid transparent; }
.stage-new { background: #eef0f3; color: #3b4048; }
.stage-contacted { background: #e3eefb; color: #1c5cab; }
.stage-mql { background: #e5f4ee; color: #0f6b4a; }
.stage-sql { background: #fdf0e0; color: #8a5300; }
.stage-proposal { background: #efeafc; color: #4a3aa7; }
.stage-negotiation { background: #fde8ef; color: #9c2f58; }
.stage-won { background: #dff3df; color: #0b6b0b; }
.stage-lost { background: #f9e1e1; color: #9e2626; }
.stage-nurture { background: #f1f0eb; color: #5b5a54; }
.temp-badge { font-weight: 500; }
.temp-hot { background: #fde4dc; color: #a33b12; }
.temp-warm { background: #fff2d6; color: #7a5400; }
.temp-cold { background: #e3eefb; color: #1c5cab; }
.prio-badge { background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-weight: 500; }
.prio-1 { border-color: var(--brand); color: var(--brand); }
.fu-badge { font-size: .78rem; white-space: nowrap; }
.fu-overdue { color: var(--critical); font-weight: 600; }
.fu-today { color: #8a5a00; font-weight: 600; }
.fu-upcoming { color: var(--ink-2); }
.fu-none { color: var(--muted); }

/* Kanban */
.board { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; }
.board-col { flex: 0 0 272px; background: #ecede8; border-radius: 10px; display: flex; flex-direction: column; max-height: calc(100vh - 190px); }
.board-col-head { padding: .6rem .75rem; border-bottom: 1px solid #dddcd5; }
.board-col-head .t { font-weight: 600; font-size: .85rem; display: flex; justify-content: space-between; }
.board-col-head .s { font-size: .74rem; color: var(--ink-2); }
.board-list { padding: .5rem; overflow-y: auto; flex: 1; min-height: 80px; }
.lead-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .55rem .65rem; margin-bottom: .5rem; cursor: grab; font-size: .8rem; }
.lead-card:hover { border-color: #b9c9bf; }
.lead-card .org { font-weight: 600; font-size: .83rem; line-height: 1.25; }
.lead-card .meta { color: var(--ink-2); font-size: .74rem; }
.lead-card a { color: inherit; text-decoration: none; }
.sortable-ghost { opacity: .4; }
.score-pill { font-size: .7rem; font-variant-numeric: tabular-nums; border: 1px solid var(--line); border-radius: 10px; padding: 0 .4rem; color: var(--ink-2); }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 2.2rem; }
.timeline li::before { content: ''; position: absolute; left: .78rem; top: 1.6rem; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .ic { position: absolute; left: 0; top: 0; width: 1.75rem; height: 1.75rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); }
.timeline .planned .ic { background: #fff4dc; color: #8a5a00; }
.timeline .cancelled { opacity: .55; }
.bant-row { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: center; padding: .35rem 0; border-bottom: 1px dashed var(--line); }
.bant-dots span { display: inline-block; width: 22px; height: 8px; border-radius: 4px; background: var(--track); margin-left: 3px; }
.bant-dots span.on { background: var(--series-1); }
.stepper { display: flex; gap: 4px; flex-wrap: wrap; }
.stepper .st { flex: 1; min-width: 88px; text-align: center; font-size: .72rem; padding: .35rem .25rem; background: #eceee9; color: var(--ink-2); border-radius: 4px; }
.stepper .st.done { background: #cfe0f5; color: #184f95; }
.stepper .st.cur { background: var(--series-1); color: #fff; font-weight: 600; }
.svc-check { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .75rem; margin-bottom: .4rem; }
.svc-check:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.org-search-results { position: absolute; z-index: 1050; width: 100%; max-height: 320px; overflow-y: auto; }

/* Login */
.login-page { margin: 0; background: #0f2418; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(380px, 1fr); }
.login-hero { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 2.5rem 3rem; color: #fff;
  background: linear-gradient(160deg, rgba(10,32,20,.82) 0%, rgba(16,52,32,.55) 45%, rgba(10,32,20,.88) 100%), var(--login-bg) center / cover no-repeat; }
.login-brand { font-weight: 700; font-size: 1.25rem; letter-spacing: .2px; display: flex; align-items: center; gap: .5rem; }
.login-brand i { color: #9be3b4; font-size: 1.5rem; }
.login-brand span { font-weight: 400; font-size: .85rem; opacity: .75; padding-left: .6rem; border-left: 1px solid rgba(255,255,255,.35); }
.login-pitch { max-width: 560px; }
.login-pitch h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 700; line-height: 1.15; margin-bottom: 1rem; }
.login-pitch p { font-size: 1.05rem; opacity: .85; margin-bottom: 2rem; }
.login-stats { display: flex; gap: 2.25rem; margin-bottom: 2rem; }
.login-stats b { display: block; font-size: 1.9rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.login-stats span { font-size: .8rem; opacity: .75; }
.login-waves { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.login-waves li { display: flex; align-items: center; gap: .45rem; padding: .35rem .8rem .35rem .4rem; border-radius: 999px; font-size: .85rem;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(4px); }
.login-waves li span { width: 1.4rem; height: 1.4rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; background: #fff; color: var(--brand-dark); }
.login-waves li:first-child { background: rgba(155,227,180,.28); border-color: rgba(155,227,180,.6); }
.login-credit { font-size: .72rem; opacity: .6; }
.login-credit a { color: inherit; }
.login-panel { background: #fff; display: flex; align-items: center; justify-content: center; padding: 2.5rem; }
.login-form { width: 100%; max-width: 380px; }
.login-form h2 { font-weight: 700; font-size: 1.6rem; margin-bottom: .25rem; }
.login-form .input-group-text { background: #f5f7f6; color: #6b7a72; }
.login-form .form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(31,111,67,.15); }
.login-brand-sm { color: var(--brand-dark); margin-bottom: 1.5rem; }
.login-brand-sm i { color: var(--brand); }
.login-hint { display: flex; gap: .75rem; padding: .75rem .9rem; margin-bottom: 1.25rem; border-radius: 10px; font-size: .82rem;
  background: var(--brand-soft); border: 1px solid #cfe6d8; color: #1d3b2a; }
.login-hint > i { font-size: 1.1rem; color: var(--brand); }
.login-hint code { color: var(--brand-dark); background: #fff; padding: .05rem .35rem; border-radius: 4px; font-size: .85rem; }
@media (max-width: 991.98px) {
  .login-shell { grid-template-columns: 1fr; background: linear-gradient(rgba(10,32,20,.55), rgba(10,32,20,.75)), var(--login-bg) center / cover no-repeat; }
  .login-hero { display: none; }
  .login-panel { background: transparent; padding: 1.25rem; min-height: 100vh; }
  .login-form { background: #fff; padding: 2rem 1.75rem; border-radius: 14px; box-shadow: 0 1rem 3rem rgba(0,0,0,.35); }
}
