/* =====================================================================
   CRM BAS — design system
   Lavender lembut, kartu putih membulat, aksen indigo (mengikuti referensi UI/UX).
   Mobile-first: tab bar + tombol (+) di HP/tablet, sidebar di desktop.
   ===================================================================== */
:root {
  --bg: #f4f5fb;
  --bg-2: #eceefa;
  --card: #ffffff;
  --ink: #1c1c28;
  --ink-2: #3b3d4f;
  --muted: #8a8fa3;
  --line: #eceef5;
  --line-2: #e2e4ef;
  --primary: #5b5bd6;
  --primary-2: #6e6cf0;
  --primary-ink: #4342b8;
  --primary-soft: #ecebff;
  --green: #16a36f; --green-soft: #e3f6ee;
  --red: #e5484d; --red-soft: #fdecec;
  --orange: #d9822b; --orange-soft: #fff1e0;
  --blue: #2f6fd6; --blue-soft: #e4effd;
  --pink: #d6407f; --pink-soft: #fde7f0;
  --purple: #7c5ce0; --purple-soft: #f0eafd;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(28, 28, 60, .04), 0 10px 30px rgba(91, 91, 214, .07);
  --shadow-lg: 0 24px 60px rgba(28, 28, 80, .18);
  --side-w: 250px;
  --tab-h: 68px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; min-height: 100vh;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
h4 { font-size: 14px; font-weight: 700; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.ic { flex-shrink: 0; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.sm { font-size: 13px; }
.xs { font-size: 12px; }
.grow { flex: 1; min-width: 0; }
.warn { color: var(--red) !important; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; margin-bottom: 2px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 16px; gap: 22px; z-index: 30;
}
.demo-on .sidebar { top: 36px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); padding: 0 6px; }
.brand b { font-size: 17px; font-weight: 800; display: block; letter-spacing: -.02em; }
.brand small { display: block; color: var(--muted); font-size: 11.5px; }
.logo-mark {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--primary-2), var(--primary)); box-shadow: 0 6px 16px rgba(91, 91, 214, .35);
}
.logo-mark.sm { width: 32px; height: 32px; border-radius: 10px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; color: var(--ink-2); font-weight: 600;
  transition: background .15s, color .15s;
}
.side-item:hover { background: var(--bg); }
.side-item.active { background: var(--primary-soft); color: var(--primary); }
.side-me {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--card); text-align: left; color: var(--muted);
}
.side-me span:not(.avatar) { flex: 1; min-width: 0; }
.side-me b { display: block; color: var(--ink); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-me small { display: block; font-size: 12px; }
.main { flex: 1; min-width: 0; margin-left: var(--side-w); }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 14px 28px 0;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.demo-on .topbar { top: 36px; }
@media (min-width: 1024px) {
  .topbar { position: absolute; right: 0; top: 0; padding: 18px 28px 0; background: none; z-index: 25; }
  .demo-on .topbar { top: 0; }
  .main { position: relative; }
  .view { padding-top: 22px; }
  .page-head, .dash-hero { padding-right: 56px; }
}
.mobile-only { display: none !important; }
.view { padding: 6px 28px 40px; max-width: 1440px; margin: 0 auto; }
.page { opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }
.page.in { opacity: 1; transform: none; }
.tabbar { display: none; }

@media (max-width: 1023px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .mobile-only { display: flex !important; }
  .topbar { padding: 12px 16px 6px; padding-top: max(12px, env(safe-area-inset-top)); }
  .topbar .brand { gap: 8px; padding: 0; }
  .topbar .brand b { font-size: 16px; }
  .view { padding: 4px 16px calc(var(--tab-h) + 34px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; position: fixed; z-index: 40;
    left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); height: var(--tab-h);
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px); border-radius: 24px; box-shadow: 0 10px 30px rgba(28, 28, 80, .12);
    padding: 0 6px; max-width: 560px; margin: 0 auto;
  }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); background: none; border: 0; padding: 6px 0; }
  .tab.active { color: var(--primary); }
  .fab {
    justify-self: center; width: 54px; height: 54px; border-radius: 50%; border: 0; color: #fff; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary-2), var(--primary)); box-shadow: 0 10px 22px rgba(91, 91, 214, .45); margin-top: -26px;
  }
  .fab:active { transform: scale(.95); }
}

/* ---------- Demo bar ---------- */
.demo-bar {
  position: sticky; top: 0; z-index: 50; height: 36px; display: flex; align-items: center; justify-content: center; gap: 14px;
  background: var(--ink); color: #fff; font-size: 12.5px; padding: 0 12px;
}
.demo-bar button { background: rgba(255, 255, 255, .14); color: #fff; border: 0; border-radius: 99px; padding: 4px 12px; font-size: 12px; font-weight: 600; }
@media (max-width: 560px) { .hide-xs { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 14px;
  border: 1px solid transparent; font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn-primary, .btn-dark { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(91, 91, 214, .28); }
.btn-primary:hover, .btn-dark:hover { background: var(--primary-ink); }
.btn-ghost { background: var(--card); border-color: var(--line-2); color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: #e0dfff; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 11px; gap: 6px; }
.btn-block { width: 100%; }
.danger { color: var(--red) !important; }
.icon-btn {
  position: relative; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-2); padding: 0;
}
.icon-btn:hover { background: var(--bg); }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 11px; }
.icon-btn.xs { width: 26px; height: 26px; border-radius: 8px; }
.icon-btn.ok { color: var(--green); }
.avatar-btn { border: 0; background: none; width: auto; }
.badge-count {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff;
  font-size: 10.5px; font-weight: 700; font-style: normal; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--bg);
}
.link { background: none; border: 0; padding: 0; color: var(--primary); font-weight: 600; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.link-btn.center { margin: 4px auto 0; }

/* ---------- Pills, tags, avatars ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 8px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.pill-neutral { background: #f0f1f6; color: #5d6276; }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-orange, .pill-yellow { background: var(--orange-soft); color: var(--orange); }
.pill-blue { background: var(--blue-soft); color: var(--blue); }
.pill-purple { background: var(--purple-soft); color: var(--purple); }
.pill-indigo { background: var(--primary-soft); color: var(--primary); }
.pill-pink { background: var(--pink-soft); color: var(--pink); }
.bdot { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.bdot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.ch-tag {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 8px; font-size: 11.5px; font-weight: 600;
  color: var(--c); background: color-mix(in srgb, var(--c) 11%, white);
}
.tag { display: inline-block; background: var(--bg); border-radius: 7px; padding: 1px 8px; font-size: 12px; margin: 0 2px 4px 0; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; font-weight: 700; flex-shrink: 0; }
.av-xs { width: 22px; height: 22px; font-size: 9.5px; }
.av-sm { width: 32px; height: 32px; font-size: 11.5px; }
.av-md { width: 40px; height: 40px; font-size: 13.5px; }
.av-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.org { border-radius: 14px; }
.avatar.org.av-lg { border-radius: 18px; }

/* ---------- Cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card.soft { background: var(--bg); box-shadow: none; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head p { margin-top: 2px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.section-title { margin: 26px 0 12px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); padding: 40px 16px; text-align: center; grid-column: 1 / -1; }
.empty.sm { padding: 14px 8px; font-size: 13px; }

/* ---------- Page head & toolbars ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 20px; }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.filters, .filters-row { display: flex; gap: 8px; flex-wrap: wrap; }
.search {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; background: var(--card); border-radius: 14px;
  border: 1px solid var(--line); color: var(--muted); min-width: 220px;
}
.search.wide { flex: 1; max-width: 460px; }
.search input { border: 0; outline: 0; background: none; width: 100%; color: var(--ink); }
.select-pill {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: 13px; color: var(--muted);
}
.select-pill select { appearance: none; border: 0; background: none; outline: 0; color: var(--ink); font-weight: 600; font-size: 13px; padding-right: 18px; cursor: pointer; max-width: 200px; }
.select-pill > .ic:last-child { position: absolute; right: 10px; pointer-events: none; }
.check-pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); background: var(--card); border: 1px solid var(--line); border-radius: 13px; cursor: pointer; }
.check-pill input { accent-color: var(--primary); width: 16px; height: 16px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--card); font-weight: 600; font-size: 13px; color: var(--ink-2);
}
.chip span { background: var(--bg); color: var(--muted); border-radius: 99px; padding: 0 8px; font-size: 11.5px; }
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip.on span { background: rgba(255, 255, 255, .22); color: #fff; }
.seg-ctl { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 2px; }
.seg-ctl button { border: 0; background: none; height: 32px; padding: 0 14px; border-radius: 10px; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg-ctl button.on { background: var(--primary); color: #fff; box-shadow: 0 4px 10px rgba(91, 91, 214, .3); }
.result-count { margin: -4px 0 12px; }

/* ---------- Bars & rings ---------- */
.bar { height: 8px; border-radius: 99px; background: var(--primary-soft); overflow: hidden; margin: 6px 0 4px; }
.bar.thin { height: 5px; margin: 6px 0 0; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.ring { position: relative; display: grid; place-items: center; flex-shrink: 0; }
.ring svg { position: absolute; inset: 0; }
.ring b { position: relative; font-size: 13px; font-weight: 800; }
.donut { position: relative; flex-shrink: 0; }
.donut-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-c b { font-size: 26px; font-weight: 800; line-height: 1.1; }
.donut-c small { color: var(--muted); font-size: 12px; }

/* ---------- Dashboard ---------- */
.dash-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 20px; }
.dash-hero h1 { font-size: 30px; }
.dash-hero .eyebrow { font-size: 14px; font-weight: 500; }
.wave { display: inline-block; }
.hero-ctl { display: flex; gap: 10px; flex-wrap: wrap; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kpi small { color: var(--muted); font-weight: 600; font-size: 13px; }
.kpi b { font-size: 25px; font-weight: 800; letter-spacing: -.02em; }
.kpi-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.tone-indigo { background: var(--primary-soft); color: var(--primary); }
.tone-red { background: var(--red-soft); color: var(--red); }
.tone-green { background: var(--green-soft); color: var(--green); }
.tone-orange { background: var(--orange-soft); color: var(--orange); }
.tone-pink { background: var(--pink-soft); color: var(--pink); }
.delta { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: #f0f1f6; color: var(--muted); }
.delta.up { background: var(--green-soft); color: var(--green); }
.delta.down { background: var(--red-soft); color: var(--red); }
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.lg { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.lg i { width: 10px; height: 10px; border-radius: 50%; }
.lg.off { opacity: .45; text-decoration: line-through; }

/* Line chart */
.lc-host { position: relative; width: 100%; }
.lc { display: block; overflow: visible; touch-action: pan-y; }
.lc-grid { stroke: var(--line-2); stroke-dasharray: 4 5; }
.lc-y { font-size: 11px; fill: var(--muted); text-anchor: end; }
.lc-x { font-size: 11.5px; fill: var(--muted); text-anchor: middle; }
.lc-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.lc-dot { fill: #fff; stroke-width: 2.5; }
.lc-cursor { stroke: var(--line-2); stroke-width: 1.5; }
.chart-tip {
  position: absolute; z-index: 5; min-width: 170px; background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 12px;
  font-size: 12px; pointer-events: none; box-shadow: var(--shadow-lg);
}
.chart-tip b { display: block; margin-bottom: 6px; font-size: 12.5px; }
.chart-tip span { display: flex; align-items: center; gap: 7px; padding: 1px 0; }
.chart-tip i { width: 8px; height: 8px; border-radius: 50%; }
.chart-tip em { margin-left: auto; font-style: normal; font-weight: 700; padding-left: 12px; }
.chart-tip .tot { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 5px; padding-top: 5px; }

.bt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.bt-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.bt-name i { width: 10px; height: 10px; border-radius: 50%; }
.channel-wrap { display: flex; gap: 22px; align-items: center; }
.ch-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ch-table th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 0 6px 8px; white-space: nowrap; }
.ch-table td { padding: 7px 6px; border-top: 1px solid var(--line); white-space: nowrap; }
.ch-table .r { text-align: right; }
.ch-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.ch-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); }
.mini-bar { display: inline-block; width: 40px; height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; vertical-align: middle; margin-right: 6px; }
.mini-bar i { display: block; height: 100%; }
.pipe-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.pipe-mini li { display: grid; grid-template-columns: 22px 92px 1fr 26px 64px; align-items: center; gap: 8px; font-size: 13px; }
.pm-n { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 13%, white); }
.pm-l { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-bar { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.pm-bar i { display: block; height: 100%; border-radius: inherit; min-width: 3px; }
.pipe-mini b { text-align: right; }
.pipe-mini small { text-align: right; white-space: nowrap; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.li-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border-radius: 14px; border: 0; background: none; text-align: left; }
.li-btn:hover { background: var(--bg); }
.li-btn b, .list b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-btn small, .list small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-r { text-align: right; flex-shrink: 0; }
.cal-chip { width: 42px; height: 46px; border-radius: 12px; background: var(--pink-soft); color: var(--pink); display: grid; place-content: center; text-align: center; flex-shrink: 0; }
.cal-chip b { font-size: 16px; line-height: 1; color: var(--pink); }
.cal-chip small { font-size: 10.5px !important; color: var(--pink) !important; font-weight: 600; }
.tasks li { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.tasks li:last-child { border-bottom: 0; }
.tasks .st-done b { text-decoration: line-through; color: var(--muted); }
.tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); background: none; display: grid; place-items: center; padding: 0; color: #fff; flex-shrink: 0; }
.tick.on { background: var(--green); border-color: var(--green); }

/* ---------- Pipeline ---------- */
.phase-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.phase {
  text-align: left; border: 2px solid transparent; background: var(--card); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.phase::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); }
.phase small { color: var(--muted); font-weight: 600; font-size: 12px; }
.phase b { font-size: 22px; font-weight: 800; }
.phase span { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.phase.on { border-color: var(--c); }
.board { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 16px; scroll-snap-type: x proximity; align-items: flex-start; }
.col { flex: 0 0 272px; background: var(--bg-2); border-radius: 20px; padding: 12px; scroll-snap-align: start; max-height: calc(100vh - 240px); display: flex; flex-direction: column; }
.col-head { display: flex; align-items: center; gap: 8px; }
.col-head b { font-size: 13.5px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-n { width: 24px; height: 24px; border-radius: 8px; background: var(--c); color: #fff; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.col-count { background: var(--card); border-radius: 99px; padding: 0 9px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.col-sum { font-size: 12px; color: var(--muted); font-weight: 600; margin: 4px 0 10px 32px; }
.col-body { display: flex; flex-direction: column; gap: 10px; min-height: 80px; overflow-y: auto; border-radius: 14px; padding: 2px; transition: background .15s; }
.col-body.over { background: color-mix(in srgb, var(--c) 14%, transparent); }
.col-empty { color: var(--muted); font-size: 12.5px; text-align: center; padding: 20px 0; border: 1.5px dashed var(--line-2); border-radius: 14px; }
.deal { background: var(--card); border-radius: 16px; padding: 12px; box-shadow: 0 1px 2px rgba(28, 28, 60, .05); cursor: pointer; border-left: 3px solid var(--c); }
.deal:hover { box-shadow: 0 6px 18px rgba(91, 91, 214, .12); }
.deal.dragging { opacity: .5; }
.deal-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.deal-top b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal p { font-size: 12.5px; color: var(--muted); margin: 2px 0 8px; }
.deal-val { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.deal-val b { font-size: 15px; }
.deal-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--muted); font-size: 11.5px; }
.deal-foot small { display: inline-flex; align-items: center; gap: 4px; }
.mv { margin-left: auto; display: flex; gap: 4px; }

/* Deal detail */
.dd-head { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.dd-head h2 { margin: 2px 0 6px; }
.dd-tags { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.who { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.dd-value { text-align: right; display: flex; flex-direction: column; }
.dd-value small { color: var(--muted); font-size: 12px; }
.dd-value b { font-size: 22px; font-weight: 800; color: var(--primary); }
.stepper { list-style: none; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; padding: 0; margin: 20px 0; }
.stepper li { position: relative; }
.stepper button { width: 100%; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; color: var(--muted); }
.stepper li::before { content: ''; position: absolute; top: 13px; left: -50%; right: 50%; height: 3px; background: var(--line); z-index: 0; }
.stepper li:first-child::before { display: none; }
.stepper li.done::before, .stepper li.cur::before { background: var(--primary); }
.stepper i {
  position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11.5px; font-weight: 700;
  background: var(--card); border: 2px solid var(--line-2); color: var(--muted);
}
.stepper .done i { background: var(--primary); border-color: var(--primary); color: #fff; }
.stepper .cur i { background: var(--primary); border-color: var(--primary-soft); box-shadow: 0 0 0 4px var(--primary-soft); color: #fff; }
.stepper span { font-size: 10.5px; font-weight: 600; text-align: center; line-height: 1.2; }
.stepper .cur span { color: var(--primary); }
.dd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dd-grid h4 { margin-bottom: 10px; }
.pay-bar { height: 10px; background: var(--card); border-radius: 99px; overflow: hidden; margin: 10px 0; }
.pay-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #2fd197); border-radius: inherit; }
.pay-sum { display: flex; justify-content: space-between; gap: 12px; }
.pay-sum span { display: flex; flex-direction: column; }
.pay-sum small { color: var(--muted); font-size: 12px; }
.pay-sum b { font-size: 15px; }
.pay-sum .due b { color: var(--red); }
.pay-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
.pay-list li { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 12px; padding: 8px 10px; }
.pay-list b { display: block; font-size: 13.5px; }
.pay-list small { display: block; color: var(--muted); font-size: 12px; }
.pay-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* ---------- Clients ---------- */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.client-card { display: flex; flex-direction: column; gap: 12px; text-align: left; border: 0; transition: transform .15s, box-shadow .15s; }
.client-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(91, 91, 214, .12); }
.cc-top { display: flex; align-items: center; gap: 12px; }
.cc-id { flex: 1; min-width: 0; }
.cc-id b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-id small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-loc { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.cc-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: var(--bg); border-radius: 14px; padding: 10px 12px; }
.cc-stats small { display: block; color: var(--muted); font-size: 11px; }
.cc-stats b { font-size: 13.5px; }
.cc-foot { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.cd-head { display: flex; gap: 14px; align-items: center; }
.cd-head h2 { margin-bottom: 2px; }
.cd-head .cc-tags { margin-top: 8px; }
.cd-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0; }
.cd-stats span { background: var(--bg); border-radius: 14px; padding: 10px 14px; }
.cd-stats small { display: block; color: var(--muted); font-size: 12px; }
.cd-stats b { font-size: 16px; font-weight: 800; }
.cd-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.cd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.cd-grid h4 { margin-bottom: 10px; }
.cd-deals { display: flex; flex-direction: column; gap: 6px; }
.cd-deal { display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 10px 12px; }
.cd-deal:hover { background: var(--bg); }
.cd-deal b { display: block; font-size: 13.5px; }
.cd-deal small { display: block; color: var(--muted); font-size: 12px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; display: flex; gap: 12px; padding-bottom: 14px; }
.timeline li::before { content: ''; position: absolute; left: 13px; top: 30px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.tdot { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.timeline .st-missed .tdot { background: var(--red-soft); color: var(--red); }
.timeline .st-done .tdot { background: var(--green-soft); color: var(--green); }
.trow { display: flex; align-items: center; gap: 8px; }
.timeline small { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 4px; }
.timeline p { font-size: 13px; margin: 3px 0; }

/* ---------- Wilayah ---------- */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
.w-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.w-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.w-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.w-table .c { text-align: center; } .w-table .r { text-align: right; }
.w-row { cursor: pointer; }
.w-row:hover td { background: var(--bg); }
.w-row.open td { background: var(--primary-soft); }
.w-row.dim { color: var(--muted); }
.w-table tfoot td { font-weight: 800; border-bottom: 0; }
.stack-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; min-width: 4px; }
.stack-bar .cu { background: var(--primary); } .stack-bar .ca { background: #c7c6f7; }
.w-detail td { background: #fafaff; padding: 16px; white-space: normal; }
.w-detail-in { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.cat-table { border-collapse: collapse; font-size: 13px; margin-top: 6px; background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.cat-table th { background: var(--ink); color: #fff; padding: 8px 14px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; }
.cat-table td { padding: 7px 14px; border-bottom: 1px solid var(--line); text-align: center; }
.cat-table td:nth-child(2) { text-align: left; }
.cat-table tfoot td { font-weight: 800; color: var(--red); border-bottom: 0; }
.cat-table tfoot td:nth-child(2) { color: var(--ink); }

/* ---------- Team ---------- */
.branch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.branch-card { border-top: 4px solid var(--c); }
.branch-card h3 { font-size: 19px; }
.mini-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 6px; }
.mini-kv div { background: var(--bg); border-radius: 12px; padding: 8px 10px; }
.mini-kv dt { font-size: 11px; color: var(--muted); }
.mini-kv dd { margin: 0; font-weight: 700; font-size: 13.5px; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.team-card.top { background: linear-gradient(160deg, #f4f3ff, #fff 60%); outline: 2px solid var(--primary-soft); }
.tc-head { display: flex; align-items: center; gap: 10px; }
.tc-head b { display: block; }
.tc-head small { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.rank { width: 26px; height: 26px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: 12px; display: grid; place-items: center; }
.team-card.top .rank { background: var(--primary); color: #fff; }
.tc-prog { margin-top: 14px; }

/* ---------- Activities (port dari NEXTFLOW) ---------- */
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); }
.stat-ic { width: 40px; height: 40px; border-radius: 13px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.stat small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.stat b { font-size: 22px; font-weight: 800; line-height: 1.2; }
.stat span { display: block; font-size: 11.5px; color: var(--muted); }
.act-list { display: flex; flex-direction: column; gap: 18px; }
.day-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.day-head span { background: var(--card); border-radius: 99px; padding: 0 8px; font-size: 11.5px; color: var(--muted); }
.day-group { display: flex; flex-direction: column; gap: 8px; }
.act-item { display: flex; gap: 14px; background: var(--card); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); }
.act-item.st-done { opacity: .85; }
.act-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.act-ic.sm { width: 26px; height: 26px; border-radius: 8px; }
.t-visit { background: var(--primary-soft); color: var(--primary); --tc: var(--primary); }
.t-call { background: var(--blue-soft); color: var(--blue); --tc: var(--blue); }
.t-whatsapp { background: var(--green-soft); color: var(--green); --tc: var(--green); }
.t-meeting { background: var(--purple-soft); color: var(--purple); --tc: var(--purple); }
.t-delivery { background: var(--orange-soft); color: var(--orange); --tc: var(--orange); }
.t-followup { background: var(--pink-soft); color: var(--pink); --tc: var(--pink); }
.act-main { flex: 1; min-width: 0; }
.act-title { font-size: 14px; }
.act-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.act-meta span { display: inline-flex; align-items: center; gap: 5px; }
.act-notes { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.act-owner { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.act-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; }
.act-btns { display: flex; gap: 6px; }

/* ---------- Calendar (port dari NEXTFLOW) ---------- */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-nav { display: flex; align-items: center; gap: 10px; }
.cal-nav h3 { min-width: 150px; text-align: center; text-transform: capitalize; }
.cal-tools { display: flex; gap: 8px; align-items: center; }
.cal-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ev-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--tc); }
.mhead { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; padding-bottom: 8px; }
.mgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mcell { min-height: 104px; border-radius: 14px; background: var(--bg); padding: 6px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; border: 2px solid transparent; }
.mcell.out { opacity: .45; }
.mcell.today .mnum { background: var(--primary); color: #fff; }
.mcell.sel { border-color: var(--primary); background: #fff; }
.mnum { font-size: 12px; font-weight: 700; width: 24px; height: 24px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 2px; }
.m-bday { font-size: 11px; margin-left: 2px; }
.mnum:has(.m-bday) { width: auto; padding: 0 4px; }
.mevents { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ev { display: flex; gap: 4px; border: 0; border-radius: 6px; padding: 2px 5px; font-size: 10.5px; text-align: left; min-width: 0; overflow: hidden; white-space: nowrap; }
.ev.st-done { opacity: .6; } .ev.st-missed { text-decoration: line-through; opacity: .55; }
.ev-time { font-weight: 700; }
.ev-name { overflow: hidden; text-overflow: ellipsis; }
.ev-more { font-size: 10.5px; color: var(--muted); padding-left: 4px; }
.mdots { display: none; gap: 3px; flex-wrap: wrap; }
.week-scroll { max-height: 600px; overflow: auto; }
.wgrid { min-width: 640px; }
.whead { display: grid; grid-template-columns: 50px repeat(7, 1fr); gap: 4px; position: sticky; top: 0; background: var(--card); z-index: 2; padding-bottom: 6px; }
.wday { border: 0; background: var(--bg); border-radius: 12px; padding: 6px 0; display: flex; flex-direction: column; align-items: center; }
.wday small { font-size: 11px; color: var(--muted); }
.wday b { font-size: 15px; }
.wday.today { background: var(--primary); color: #fff; } .wday.today small { color: #e3e2ff; }
.wday.sel { outline: 2px solid var(--primary); }
.wbody { position: relative; display: grid; grid-template-columns: 50px repeat(7, 1fr); gap: 4px; }
.wtimes { position: relative; }
.wtimes span { position: absolute; right: 6px; font-size: 10.5px; color: var(--muted); transform: translateY(-6px); }
.wcol { position: relative; background: var(--bg); border-radius: 10px; }
.wcol.today { background: #f0f0ff; }
.wline { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line-2); }
.wnow { position: absolute; left: 0; right: 0; border-top: 2px solid var(--red); z-index: 2; }
.wev { position: absolute; border: 0; border-left: 3px solid var(--tc); border-radius: 8px; padding: 3px 6px; font-size: 10.5px; text-align: left; overflow: hidden; display: flex; flex-direction: column; z-index: 1; }
.wev.short { flex-direction: row; gap: 4px; white-space: nowrap; }
.wev span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda { position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; }
.agenda h3 { text-transform: capitalize; }
.agenda-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.ag-item { display: flex; gap: 10px; }
.ag-time { width: 44px; flex-shrink: 0; display: flex; flex-direction: column; font-size: 12px; padding-top: 10px; }
.ag-time small { color: var(--muted); }
.ag-main { flex: 1; min-width: 0; background: var(--bg) !important; color: var(--ink) !important; border-radius: 14px; padding: 10px 12px; border-left: 3px solid var(--tc); display: flex; flex-direction: column; gap: 3px; }
.ag-title { display: flex; align-items: center; gap: 8px; }
.ag-title .pill { margin-left: auto; }
.ag-loc { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.ag-main p { font-size: 12.5px; color: var(--ink-2); }
.ag-foot { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.ag-foot .act-btns { margin-left: auto; }
.st-missed .ag-main { opacity: .7; }
.bday-row { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: var(--pink-soft); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; font-size: 18px; }
.bday-row b { display: block; font-size: 13px; color: var(--pink); }
.bday-row small { display: block; font-size: 12px; color: var(--ink-2); }
.cal-add-head { display: flex; flex-direction: column; gap: 2px; background: var(--bg); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.cal-add-head small { color: var(--muted); display: flex; align-items: center; gap: 5px; }

/* ---------- Modal ---------- */
#modal-root { position: relative; z-index: 100; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(28, 28, 50, .38); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px;
  animation: fade .18s ease;
}
.modal-backdrop.closing { animation: fade .18s ease reverse forwards; }
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 40px); background: var(--card); border-radius: 26px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: pop .22s cubic-bezier(.2, .9, .3, 1.2);
}
.modal.wide { width: min(880px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 8px; }
.modal-body { padding: 8px 22px 22px; overflow-y: auto; overscroll-behavior: contain; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@media (max-width: 640px) {
  .modal-backdrop { place-items: end stretch; padding: 0; }
  .modal, .modal.wide { width: 100%; max-height: 92vh; border-radius: 26px 26px 0 0; animation: sheet .26s cubic-bezier(.2, .9, .3, 1); padding-bottom: env(safe-area-inset-bottom); }
  @keyframes sheet { from { transform: translateY(40%); opacity: .4; } }
}

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full, .form-section.full { grid-column: 1 / -1; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field em { color: var(--red); font-style: normal; }
.field input, .field select, .field textarea {
  width: 100%; height: 44px; border-radius: 13px; border: 1.5px solid var(--line-2); background: var(--card); padding: 0 13px; outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; padding: 10px 13px; resize: vertical; }
.field input[type=color] { padding: 4px; cursor: pointer; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.hint { font-size: 11.5px; color: var(--muted); }
.form-section { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.input-money { display: flex; align-items: center; border: 1.5px solid var(--line-2); border-radius: 13px; padding-left: 13px; background: var(--card); }
.input-money span { color: var(--muted); font-weight: 600; }
.input-money input { border: 0 !important; box-shadow: none !important; }
.input-money:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.input-group { display: flex; gap: 8px; }
.input-group .btn { height: 44px; }
.chip-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.cp { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 99px; border: 1.5px solid var(--line-2); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-2); user-select: none; }
.cp input { display: none; }
.cp.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.radio-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rc { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; border-radius: 14px; border: 1.5px solid var(--line-2); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.rc input { display: none; }
.rc .ic { color: var(--c); }
.rc.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 9%, white); color: var(--ink); }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .radio-cards { grid-template-columns: repeat(2, 1fr); }
  .form-actions .btn { flex: 1; }
  .form-actions .grow { display: none; }
}

/* ---------- Settings, notifications, menus ---------- */
.acct { display: flex; align-items: center; gap: 14px; background: var(--bg); border-radius: 18px; padding: 14px; }
.acct b { display: block; }
.acct small { display: block; color: var(--muted); font-size: 12.5px; }
.n-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0 8px; font-size: 13px; }
.n-head span { background: var(--bg); border-radius: 99px; padding: 0 8px; font-size: 11.5px; color: var(--muted); }
.set-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; color: var(--ink); }
.set-row > div { flex: 1; min-width: 0; }
.set-row b { display: block; font-size: 13.5px; }
.set-row small { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.set-link:hover { background: var(--bg); border-radius: 12px; }
.n-ic { width: 36px; height: 36px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; font-size: 16px; }
.set-note { display: flex; gap: 8px; font-size: 12px; color: var(--muted); background: var(--bg); border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.switch { width: 46px; height: 28px; border-radius: 99px; background: var(--line-2); border: 0; position: relative; padding: 0; transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch.on { background: var(--primary); }
.switch.on i { transform: translateX(18px); }
.n-banner { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; text-align: left; background: var(--primary-soft); color: var(--primary); border-radius: 16px; padding: 12px 14px; }
.n-banner span { flex: 1; }
.n-banner b { display: block; }
.n-banner small { color: var(--ink-2); }
.n-item { display: flex; align-items: center; gap: 12px; padding: 8px 4px; color: var(--ink); border-radius: 12px; }
.n-item:hover { background: var(--bg); }
.n-item b { display: block; font-size: 13.5px; }
.n-item small { color: var(--muted); font-size: 12px; }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-grid button { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; border: 1.5px solid var(--line); background: var(--card); border-radius: 18px; padding: 14px; text-align: left; }
.quick-grid button:hover { border-color: var(--primary); }
.quick-grid small { color: var(--muted); font-size: 12px; }
@media (max-width: 480px) { .quick-grid { grid-template-columns: 1fr; } .quick-grid button { flex-direction: row; align-items: center; } }
.menu-list { display: flex; flex-direction: column; }

/* ---------- Toast & alerts ---------- */
#toast-root { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 14px; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg); animation: pop .2s; transition: opacity .3s, transform .3s; }
.toast.out { opacity: 0; transform: translateY(8px); }
@media (max-width: 1023px) { #toast-root { bottom: calc(var(--tab-h) + 26px + env(safe-area-inset-bottom)); } }
#alert-root { position: fixed; top: 16px; right: 16px; z-index: 150; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.alert-card { display: flex; gap: 12px; background: var(--card); border-radius: 18px; padding: 14px; box-shadow: var(--shadow-lg); border-left: 4px solid var(--primary); animation: pop .25s; }
.alert-card.out { opacity: 0; transition: opacity .2s; }
.alert-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.alert-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.alert-main small { display: flex; align-items: center; gap: 5px; color: var(--primary); font-weight: 600; font-size: 12px; }
.alert-main span { font-size: 12.5px; color: var(--muted); }
.alert-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ---------- Auth ---------- */
#gate { position: fixed; inset: 0; z-index: 90; background: radial-gradient(1200px 600px at 10% -10%, #e4e2ff, transparent), var(--bg); overflow: auto; }
.auth-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(400px, 100%); background: var(--card); border-radius: 28px; padding: 30px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 14px; }
.auth-logo { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 6px; }
.auth-card .form { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 1279px) {
  .span-8, .span-7, .span-5 { grid-column: span 12; }
  .span-4 { grid-column: span 6; }
  #branch-card { grid-column: span 12; }
  .bt-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .cal-layout { grid-template-columns: 1fr; }
  .agenda { position: static; max-height: none; }
}
@media (max-width: 1023px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .phase-strip { grid-template-columns: repeat(5, minmax(120px, 1fr)); overflow-x: auto; }
  .col { max-height: none; }
}
@media (max-width: 767px) {
  h1 { font-size: 23px; }
  .dash-hero h1 { font-size: 26px; }
  .span-4 { grid-column: span 12; }
  .dash-grid { gap: 12px; }
  .card { padding: 16px; border-radius: 18px; }
  .kpi b { font-size: 20px; }
  .kpi-ic { width: 34px; height: 34px; border-radius: 11px; }
  .hero-ctl { width: 100%; }
  .hero-ctl .seg-ctl { flex: 1; } .hero-ctl .seg-ctl button { flex: 1; padding: 0 8px; }
  .hero-ctl .select-pill { flex: 1; }
  .card-head { flex-wrap: wrap; }
  .legend { justify-content: flex-start; }
  .channel-wrap { flex-direction: column; align-items: stretch; }
  .channel-wrap .donut { align-self: center; }
  .ch-table th:nth-child(3), .ch-table td:nth-child(3) { display: none; }
  .phase-strip { display: flex; margin: 0 -16px 14px; padding: 2px 16px 4px; }
  .phase { flex: 0 0 130px; }
  .board { margin: 0 -16px; padding: 2px 16px 16px; scroll-snap-type: x mandatory; }
  .col { flex-basis: 84vw; max-width: 320px; }
  .search, .search.wide { min-width: 0; flex: 1 1 100%; max-width: none; }
  .filters, .filters-row { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; width: calc(100% + 32px); }
  .filters > *, .filters-row > * { flex-shrink: 0; }
  .page-head { margin-bottom: 14px; }
  .page-head .head-actions { width: 100%; }
  .page-head .head-actions .btn { flex: 1; }
  .client-grid { grid-template-columns: 1fr; gap: 12px; }
  .cd-grid, .dd-grid { grid-template-columns: 1fr; }
  .cd-stats { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 110px 1fr; }
  .stepper { grid-template-columns: repeat(6, 1fr); row-gap: 14px; }
  .stepper li:nth-child(7)::before { display: none; }
  .dd-value { text-align: left; width: 100%; flex-direction: row; align-items: baseline; gap: 8px; }
  .hide-sm { display: none; }
  .mcell { min-height: 54px; padding: 4px; border-radius: 10px; }
  .mevents { display: none; }
  .mdots { display: flex; }
  .mgrid { gap: 3px; }
  .act-item { flex-wrap: wrap; }
  .act-side { flex-direction: row; width: 100%; align-items: center; }
  .pipe-mini li { grid-template-columns: 22px 84px 1fr 22px 58px; gap: 6px; }
}

/* ---------- Combo (pilihan yang bisa dicari) ---------- */
.combo { position: relative; display: flex; align-items: center; }
.combo-ic { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.field .combo-input, .combo-input {
  width: 100%; height: 44px; border-radius: 13px; border: 1.5px solid var(--line-2); background: var(--card); padding: 0 36px 0 38px; outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.combo-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.combo-clear { position: absolute; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 8px; background: var(--bg); color: var(--muted); display: grid; place-items: center; padding: 0; }
.combo-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20; list-style: none; margin: 0; padding: 6px; max-height: 280px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg);
}
.combo-list li { padding: 8px 10px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; }
.combo-list li b { font-size: 13.5px; font-weight: 600; }
.combo-list li small { font-size: 12px; color: var(--muted); }
.combo-list li.on { background: var(--primary-soft); }
.combo-list li.sel b { color: var(--primary); }
.combo-list .combo-none, .combo-list .combo-more { color: var(--muted); font-size: 12.5px; cursor: default; }
.combo-list .combo-create { flex-direction: row; align-items: center; gap: 6px; color: var(--primary); font-weight: 600; font-size: 13px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }

/* ---------- Item produk di form order ---------- */
.items { display: flex; flex-direction: column; gap: 8px; }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 130px 120px 34px; gap: 8px; align-items: end; background: var(--bg); border-radius: 14px; padding: 10px; }
.item-row label { display: flex; flex-direction: column; gap: 4px; }
.item-row label > span, .ir-sub small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.item-row input[data-f=qty] { width: 100%; height: 44px; border-radius: 13px; border: 1.5px solid var(--line-2); background: var(--card); padding: 0 10px; outline: 0; }
.item-row .input-money input { width: 100%; height: 41px; padding: 0 8px; outline: 0; background: none; }
.ir-sub { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; height: 44px; }
.ir-sub b { font-size: 13px; }
.item-row .icon-btn { margin-bottom: 5px; }
.items-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.items-total { margin-left: auto; font-size: 13px; color: var(--muted); font-weight: 600; }
.items-total b { color: var(--ink); font-size: 16px; margin-left: 6px; }
.dd-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dd-items li { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; }
.dd-items small { color: var(--muted); grid-column: 1; font-size: 12px; }
.dd-items b { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 13px; }
@media (max-width: 640px) {
  .item-row { grid-template-columns: 1fr 1fr 34px; }
  .item-row .ir-prod { grid-column: 1 / -1; }
  .item-row .ir-sub { grid-column: 1 / 3; flex-direction: row; justify-content: space-between; align-items: center; height: auto; }
  .item-row .icon-btn { grid-column: 3; grid-row: 2; }
  .items-total { margin-left: 0; width: 100%; }
}

/* ---------- Ikon tipe aktivitas & chip tipe ---------- */
.radio-cards.compact { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); }
.radio-cards.compact .rc { justify-content: center; padding: 0; }
.type-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.type-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 11px; border: 0; font-size: 13px; font-weight: 600; }

/* ---------- Produk ---------- */
.table-card { padding: 8px 14px; }
.p-name { display: flex; align-items: center; gap: 10px; }
.p-name b { display: block; }
.p-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.p-table td small.muted { font-size: 11.5px; }
.show-sm { display: none !important; }
.om-cell { display: inline-flex; align-items: center; gap: 8px; }
.mini-bar.wide { width: 90px; }
.kpi b.kpi-sm { font-size: 17px; line-height: 1.3; }
@media (max-width: 767px) {
  .show-sm { display: block !important; color: var(--muted); font-size: 11.5px; }
  .p-table td { white-space: normal; }
}

/* ---------- Logo BAS ---------- */
.logo-img { width: 44px; height: auto; flex-shrink: 0; display: block; }
.logo-img.sm { width: 34px; }

/* ---------- Login (Admin / Sales + Mode Demo) ---------- */
#gate { background: radial-gradient(900px 500px at 0% 0%, #e7e6ff, transparent), radial-gradient(700px 500px at 100% 100%, #fff1dc, transparent), var(--bg); }
.auth-wrap { min-height: calc(100vh - 40px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 48px; align-items: center; max-width: 1080px; margin: 0 auto; padding: 32px 24px 8px; }
.auth-brand { display: flex; flex-direction: column; gap: 34px; }
.auth-logo-wide { width: min(420px, 100%); height: auto; }
.auth-pitch h2 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: #0b3c6b; }
.auth-pitch p { color: var(--ink-2); font-size: 15.5px; margin-top: 8px; max-width: 460px; }
.auth-pitch ul { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-direction: column; gap: 10px; }
.auth-pitch li { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink-2); }
.auth-pitch li .ic { color: var(--primary); background: var(--card); box-sizing: content-box; padding: 7px; border-radius: 10px; box-shadow: var(--shadow); }
.auth-card { width: 100%; background: var(--card); border-radius: 28px; padding: 30px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 12px; }
.auth-card h1 { font-size: 24px; }
.auth-mark { width: 54px; height: auto; margin-bottom: 4px; }
.auth-seg { width: 100%; margin-top: 4px; }
.auth-seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; }
.auth-card .form { display: flex; flex-direction: column; gap: 12px; }
.auth-note { display: flex; gap: 8px; font-size: 12.5px; background: var(--orange-soft); color: #8a4f12; border-radius: 12px; padding: 10px 12px; }
.auth-note .ic { margin-top: 2px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 44px !important; }
.pw-eye { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border: 0; border-radius: 9px; background: none; color: var(--muted); display: grid; place-items: center; }
.pw-eye.on { color: var(--primary); background: var(--primary-soft); }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 4px 0; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.demo-box { display: flex; flex-direction: column; gap: 10px; background: linear-gradient(135deg, #f4f3ff, #fff8ec); border: 1px dashed #c9c7f5; border-radius: 18px; padding: 14px; }
.demo-box b { display: flex; align-items: center; gap: 6px; color: var(--primary-ink); }
.demo-box small { display: block; color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }
.demo-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 12px 0 20px; }
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; gap: 20px; padding: 20px 16px 4px; }
  .auth-brand { align-items: center; gap: 0; }
  .auth-logo-wide { width: min(260px, 70%); }
  .auth-pitch { display: none; }
  .auth-card { padding: 22px; border-radius: 24px; }
  .auth-mark { display: none; }
}
.demo-actions { display: inline-flex; gap: 6px; }

/* ---------- Grid tambahan dashboard ---------- */
.span-6 { grid-column: span 6; }
@media (max-width: 1023px) { .span-6 { grid-column: span 12; } }
.radio-cards { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.radio-cards.compact { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); }
.li-r .pill { margin-bottom: 2px; }

/* ---------- Komplain ---------- */
.cmp-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.cmp-section h4 { display: flex; align-items: center; gap: 8px; }
.cmp-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cmp button { width: 100%; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; border-left: 4px solid var(--red); }
.cmp.st-process button { border-left-color: var(--orange); }
.cmp.st-resolved button { border-left-color: var(--green); background: #fbfcfb; }
.cmp button:hover { background: var(--bg); }
.cmp-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cmp-top small { margin-left: auto; }
.cmp p { font-size: 13.5px; }
.cmp-res { display: flex; gap: 6px; align-items: flex-start; background: var(--bg); border-radius: 10px; padding: 7px 10px; font-size: 12.5px !important; color: var(--ink-2); }
.cmp-res .ic { margin-top: 2px; color: var(--green); }
.cmp small { font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Stok ---------- */
.stock-cell { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.p-ic.lg { width: 56px; height: 56px; border-radius: 18px; }
.move-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.move-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--bg); border-radius: 14px; }
.move-list b { display: block; font-size: 13.5px; }
.move-list small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; margin-top: 2px; }
.mv-qty { min-width: 84px; text-align: right; font-weight: 800; font-size: 15px; }
.mv-qty.plus { color: var(--green); } .mv-qty.minus { color: var(--orange); }
.ir-hint { display: block; }
.ir-stock { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.ir-stock b { color: var(--green); }
.ir-stock.short, .ir-stock.short b { color: var(--red); }
.item-row { align-items: start; }
.item-row .ir-sub, .item-row label { margin-top: 0; }

/* ---------- Panel Supervisor ---------- */
.u-name { display: flex; align-items: center; gap: 10px; }
.u-name b { display: block; }
.u-name small { display: block; color: var(--muted); font-size: 12px; }
.u-acts { display: inline-flex; gap: 6px; }
.u-table td { white-space: nowrap; }
.cred { display: grid; gap: 8px; }
.cred span { background: var(--bg); border-radius: 14px; padding: 10px 14px; }
.cred small { display: block; color: var(--muted); font-size: 12px; }
.cred b { font-size: 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; }
.avatar-stack { display: flex; padding: 8px 4px; }
.avatar-stack .avatar { margin-right: -8px; border: 2px solid var(--card); }
.avatar-stack .more { margin-left: 14px; font-size: 12px; color: var(--muted); align-self: center; }
.pw-gen { height: 44px !important; }
@media (max-width: 767px) { .u-table td, .u-table th { padding: 10px 6px; } }
