/* ============================================================
   DSAR — Daily Sales Activity Report
   Modern design system · dark forest green + electric lime
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* palette */
  --ink: #14201b;
  --ink-soft: #3c4b44;
  --muted: #6b7d74;
  --line: #e6ece7;
  --paper: #f4f7f4;
  --white: #ffffff;

  --forest: #16362c;
  --forest-2: #1d4537;
  --forest-3: #275848;
  --lime: #c9f24e;
  --lime-strong: #a8d61f;
  --teal: #6fd6bd;
  --orange: #f2a35e;
  --purple: #b795e8;
  --blue: #7cc4ee;
  --red: #ef6d6d;

  /* elevation */
  --shadow-sm: 0 1px 2px rgba(20, 32, 27, .05), 0 2px 8px rgba(20, 32, 27, .05);
  --shadow-md: 0 4px 14px rgba(20, 32, 27, .07), 0 12px 32px rgba(20, 32, 27, .07);
  --shadow-lg: 0 24px 60px rgba(20, 32, 27, .14);

  /* shape */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  --font: 'Manrope', system-ui, sans-serif;
  --mono: 'DM Mono', ui-monospace, monospace;

  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p { margin-top: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img, svg { display: block; }

.hidden { display: none !important; }

::selection { background: var(--lime); color: var(--forest); }

/* custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c4d2c8; border-radius: 8px; border: 3px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: #a8bbae; }

:focus-visible {
  outline: 2px solid var(--lime-strong);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Shared text helpers ---------- */
.eyebrow {
  display: block;
  font: 500 11px var(--mono);
  letter-spacing: .18em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.muted { color: var(--muted); }

/* ============================================================
   LOGIN
   ============================================================ */
.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  background: var(--paper);
}

/* left visual panel */
.login-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 44px 6vw 40px;
  color: #f4faf0;
  background:
    radial-gradient(900px 500px at -10% -20%, rgba(111, 214, 189, .16), transparent 60%),
    radial-gradient(700px 600px at 110% 110%, rgba(201, 242, 78, .14), transparent 55%),
    linear-gradient(155deg, #1a3d31 0%, var(--forest) 55%, #102a22 100%);
}

.login-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 70% 40%, #000 30%, transparent 75%);
  pointer-events: none;
}

.login-visual::after {
  content: '';
  position: absolute;
  width: 560px;
  height: 560px;
  border: 1px solid rgba(201, 242, 78, .25);
  border-radius: 50%;
  right: -200px;
  bottom: -220px;
  box-shadow:
    0 0 0 46px rgba(201, 242, 78, .05),
    0 0 0 96px rgba(201, 242, 78, .03);
  pointer-events: none;
}

.visual-top, .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: .16em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: linear-gradient(140deg, var(--lime), #e3ff7a);
  color: var(--forest);
  font-weight: 800;
  font-size: 17px;
  border-radius: 11px;
  font-family: var(--mono);
  letter-spacing: 0;
  box-shadow: 0 6px 18px rgba(201, 242, 78, .3);
}

.visual-copy {
  margin: auto 0;
  max-width: 580px;
  position: relative;
  z-index: 1;
}

.login-visual .eyebrow {
  color: var(--lime);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.login-visual .eyebrow::before {
  content: '';
  width: 26px;
  height: 1px;
  background: var(--lime);
  opacity: .7;
}

.visual-copy h1 {
  font-size: clamp(46px, 5.6vw, 80px);
  line-height: 1;
  letter-spacing: -.05em;
  font-weight: 800;
  margin: 0 0 26px;
}
.visual-copy h1 em {
  font-style: normal;
  color: var(--lime);
  position: relative;
  white-space: nowrap;
}
.visual-copy h1 em::after {
  content: '';
  position: absolute;
  left: 2%;
  bottom: .04em;
  width: 96%;
  height: .14em;
  background: rgba(201, 242, 78, .28);
  border-radius: 99px;
}

.visual-copy p {
  font-size: 16px;
  line-height: 1.8;
  color: #b9d2c4;
  max-width: 420px;
}

.visual-footer {
  font: 11px var(--mono);
  letter-spacing: .1em;
  display: flex;
  justify-content: space-between;
  color: #7e9a8c;
  position: relative;
  z-index: 1;
}

/* right form panel */
.login-panel {
  display: grid;
  place-items: center;
  padding: 56px 48px;
  background: var(--white);
}

.login-form-wrap { width: 100%; max-width: 408px; }

.login-form-wrap h2 {
  font-size: 34px;
  letter-spacing: -.04em;
  font-weight: 800;
  margin: 0 0 10px;
}
.login-form-wrap .muted { font-size: 14px; margin: 0 0 34px; }

/* form controls (shared login + app) */
label { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.req { color: var(--red); font-weight: 800; margin-left: 2px; }
.opt { font-weight: 600; font-size: 11px; font-style: italic; color: var(--muted); margin-left: 2px; }

input, select, textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  background: #fbfdfb;
  border-radius: var(--r-md);
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
input::placeholder, textarea::placeholder { color: #9fb0a6; font-weight: 400; }
input:hover, select:hover, textarea:hover { border-color: #cddbd1; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--lime-strong);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(168, 214, 31, .16);
}
input:disabled { background: #f0f3f0; color: var(--muted); }
input:user-invalid, select:user-invalid, textarea:user-invalid {
  border-color: var(--red);
  background: #fdf6f6;
  box-shadow: 0 0 0 4px rgba(239, 109, 109, .14);
}
input:user-invalid:hover, select:user-invalid:hover, textarea:user-invalid:hover { border-color: var(--red); }
/* state tidak valid untuk field yang divalidasi lewat JS (mis. nomor kontak ganda) */
input.field-invalid, select.field-invalid, textarea.field-invalid {
  border-color: var(--red);
  background: #fdf6f6;
  box-shadow: 0 0 0 4px rgba(239, 109, 109, .14);
}
.field-hint.error { color: var(--red); }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7d74' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
textarea { resize: vertical; min-height: 110px; line-height: 1.6; }

/* login specifics */
.password-wrap { position: relative; }
.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font: 600 11px var(--mono);
  letter-spacing: .04em;
  color: var(--forest);
  background: #eef5ec;
  padding: 6px 11px;
  border-radius: 7px;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.password-toggle:hover { background: var(--lime); }

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0 24px;
  font-size: 12.5px;
}
.check-label { flex-direction: row; align-items: center; gap: 9px; font-weight: 500; color: var(--muted); cursor: pointer; }
.check-label input { width: 16px; height: 16px; accent-color: var(--lime-strong); cursor: pointer; }
.login-options a { color: var(--forest); font-weight: 700; text-decoration: none; border-bottom: 1.5px solid rgba(22, 54, 44, .25); padding-bottom: 1px; transition: border-color .18s; }
.login-options a:hover { border-color: var(--lime-strong); }

/* buttons */
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(140deg, var(--forest-2), var(--forest));
  color: #eef9ee;
  font-weight: 700;
  font-size: 13.5px;
  padding: 13px 22px;
  border-radius: var(--r-md);
  box-shadow: 0 8px 20px rgba(22, 54, 44, .28), inset 0 1px 0 rgba(255, 255, 255, .12);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s;
  white-space: nowrap;
}
.primary-button span { color: var(--lime); transition: transform .18s var(--ease); }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(22, 54, 44, .34), inset 0 1px 0 rgba(255, 255, 255, .12); filter: brightness(1.08); }
.primary-button:hover span { transform: translate(2px, -1px); }
.primary-button:active { transform: translateY(0); }
.primary-button.full-width { width: 100%; }

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--white);
  border: 1.5px solid var(--line);
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 12.5px;
  padding: 11px 18px;
  border-radius: var(--r-md);
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
  white-space: nowrap;
}
.secondary-button:hover { border-color: var(--forest-3); background: #f3f8f2; transform: translateY(-1px); }

.text-button {
  font-size: 12px;
  font-weight: 700;
  color: var(--forest);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap .18s var(--ease), color .18s;
}
.text-button span { transition: transform .18s var(--ease); }
.text-button:hover { color: var(--lime-strong); }
.text-button:hover span { transform: translateX(3px); }

.icon-button {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--white);
  color: var(--ink-soft);
  font-size: 15px;
  transition: border-color .18s, background .18s, transform .18s var(--ease);
}
.icon-button:hover { border-color: #cddbd1; background: #f6faf6; transform: translateY(-1px); }
.icon-button.small { width: 30px; height: 30px; border-radius: var(--r-sm); font-size: 13px; }

.form-message {
  min-height: 18px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--red);
  margin: 14px 0 0;
}

/* catatan kecil di bawah field form (mis. keterangan lingkup regional manager) */
.field-hint {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin: 10px 2px 0;
}
/* kolom regional yang terkunci untuk manager (form pengguna & filter performa) */
#userRegional[readonly],
.filter-form input[readonly] {
  background: #f4f6f4;
  color: var(--muted);
  cursor: not-allowed;
}

.demo-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  padding: 14px 16px;
  background: #f6faf3;
  border: 1px dashed #cfe0c8;
  border-radius: var(--r-md);
}
.demo-note strong { display: block; font-size: 12px; }
.demo-note small { font: 11px var(--mono); color: var(--muted); }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #57c98a;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(87, 201, 138, .2);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(87, 201, 138, .2); }
  50% { box-shadow: 0 0 0 6px rgba(87, 201, 138, .08); }
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app-view { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 252px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 26px 16px 18px;
  color: #dcebe0;
  background: linear-gradient(180deg, var(--forest-2) 0%, var(--forest) 40%, #122b22 100%);
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand { padding: 0 12px; margin-bottom: 30px; }
.sidebar-brand .brand-mark { width: 32px; height: 32px; font-size: 15px; box-shadow: none; }
.sidebar-brand div { display: flex; flex-direction: column; }
.sidebar-brand strong { font-size: 14px; letter-spacing: .14em; color: #f2fbee; }
.sidebar-brand small { font-size: 8.5px; letter-spacing: .02em; color: #86a298; margin-top: 2px; }

.workspace-switcher {
  border: 1px solid rgba(255, 255, 255, .09);
  background: rgba(255, 255, 255, .05);
  border-radius: var(--r-md);
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
  transition: background .18s, border-color .18s;
}
.workspace-switcher:hover { background: rgba(255, 255, 255, .08); border-color: rgba(201, 242, 78, .3); }

.workspace-switcher div, .profile-mini > span:nth-child(2) { min-width: 0; flex: 1; }
.workspace-switcher strong, .workspace-switcher small,
.profile-mini strong, .profile-mini small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-switcher strong { font-size: 12px; color: #eef7ee; }
.workspace-switcher small, .profile-mini small { font-size: 10px; color: #88a298; margin-top: 2px; }
.chevron { color: #92aa9e; font-size: 12px; }

/* avatars */
.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: .02em;
}
.avatar-green { background: linear-gradient(140deg, #e4ff86, var(--lime)); color: #315038; }
.avatar-blue { background: linear-gradient(140deg, #d3ecfb, var(--blue)); color: #2b5871; }
.avatar-orange { background: linear-gradient(140deg, #fde0c0, var(--orange)); color: #7c4a20; }
.avatar-dark { background: rgba(255, 255, 255, .1); color: #d4ecdb; border: 1px solid rgba(255, 255, 255, .14); }

/* nav */
.nav-label {
  font: 500 10px var(--mono);
  color: #6f8f7f;
  letter-spacing: .16em;
  padding: 0 12px;
  margin: 0 0 10px;
  text-transform: uppercase;
}
.nav-label-spaced { margin-top: 34px; }

.nav-item {
  width: 100%;
  color: #a2bcae;
  text-align: left;
  border-radius: 11px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  margin: 3px 0;
  position: relative;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.nav-item.nav-link { font-family: inherit; text-decoration: none; cursor: pointer; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #eff9ef; transform: translateX(2px); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(201, 242, 78, .16), rgba(201, 242, 78, .05));
  color: #f4fcef;
  font-weight: 800;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  background: var(--lime);
  border-radius: 0 4px 4px 0;
}
.nav-icon { width: 18px; height: 18px; color: #9dbfa9; flex-shrink: 0; }
.nav-item.active .nav-icon { color: var(--lime); }
.nav-badge {
  margin-left: auto;
  background: var(--lime);
  color: var(--forest);
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 6px;
}

/* sidebar bottom */
.sidebar-bottom { margin-top: auto; }
.sync-status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 15px 11px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: 11.5px;
  font-weight: 600;
  color: #b5ccbe;
  margin-bottom: 8px;
}
.sync-status small { margin-left: auto; font: 10px var(--mono); color: #7e9a8c; }

.profile-mini {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: var(--r-md);
  transition: background .18s var(--ease);
  text-align: left;
}
.profile-mini:hover { background: rgba(255, 255, 255, .07); }
.profile-mini strong { display: block; font-size: 12px; color: #eef7ee; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-mini .more { color: #7e9a8c; font-size: 13px; letter-spacing: 1px; }

/* ---------- Main content & topbar ---------- */
.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 34px;
  background: rgba(244, 247, 244, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(230, 236, 231, .9);
}

.mobile-menu { display: none; font-size: 20px; color: var(--ink-soft); width: 38px; height: 38px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--white); }

.breadcrumb { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
.breadcrumb b { color: #b6c6bc; font-weight: 500; }
.breadcrumb strong { color: var(--ink); font-weight: 800; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 13px; }
.notification-dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  border: 2px solid var(--white);
}
.topbar-date {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 9px 14px;
  font: 500 12px var(--mono);
  color: var(--ink-soft);
}
/* pemilih lingkup regional di topbar (khusus direksi) */
.scope-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 99px;
  padding: 5px 8px 5px 14px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.scope-picker:focus-within {
  border-color: var(--lime-strong);
  box-shadow: 0 0 0 3px rgba(168, 214, 31, .18);
}
.scope-picker-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.scope-picker select {
  border: 0;
  background: transparent;
  padding: 4px 2px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--forest);
  cursor: pointer;
  max-width: 180px;
}
.scope-picker select:focus { outline: none; }
.calendar-icon { color: var(--lime-strong); }
.topbar-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--forest-2), var(--forest));
  color: var(--lime);
  font-size: 11px;
  font-weight: 800;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

/* ---------- Page content ---------- */
.page-content { padding: 34px 34px 60px; max-width: 1340px; width: 100%; margin: 0 auto; }

.page-section { display: none; animation: pageIn .35s var(--ease); }
.page-section.active { display: block; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.page-heading h1 {
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: -.035em;
  font-weight: 800;
  margin: 0 0 8px;
}
.page-heading .muted { font-size: 14px; margin: 0; }

.date-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--white);
  border: 1.5px solid var(--line);
  padding: 10px 15px;
  border-radius: var(--r-md);
  font: 500 12px var(--mono);
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
  align-self: flex-start;
}

/* ---------- Panels ---------- */
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}
.panel-heading h2 { font-size: 16px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 4px; }
.panel-heading .muted { font-size: 12px; margin: 0; }
.live-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 700 10px var(--mono);
  letter-spacing: .14em;
  color: #2e9e66;
  background: #e8f8ee;
  padding: 6px 11px;
  border-radius: 99px;
}
.live-label i { width: 7px; height: 7px; border-radius: 50%; background: #2e9e66; animation: pulse 2s infinite; }

/* ---------- Dashboard: metrics ---------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--forest-3), var(--teal));
  opacity: .85;
}
.metric-card.accent-lime::before { background: linear-gradient(90deg, var(--lime-strong), var(--lime)); }
.metric-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.metric-card.clickable { cursor: pointer; }
.metric-card.clickable:hover, .metric-card.clickable:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow-md); outline: 2px solid var(--orange); outline-offset: -2px; }
.metric-card .card-hint { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--muted); opacity: 0; transform: translateX(-4px); transition: opacity .15s ease, transform .15s ease; }
.metric-card.clickable:hover .card-hint, .metric-card.clickable:focus-visible .card-hint { opacity: 1; transform: translateX(0); }

.metric-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.metric-label { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.metric-symbol {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  font-size: 15px;
  border-radius: 11px;
  background: #eef5ec;
  color: var(--forest-3);
}
.metric-symbol.orange { background: #fdf0e2; color: #cf7d2c; }
.metric-symbol.purple { background: #f1ebfa; color: #7c55b8; }

.metric-card > strong {
  display: block;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}
.metric-foot { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.trend { font-weight: 800; padding: 3px 9px; border-radius: 99px; font-size: 11px; }
.trend.up { color: #2e9e66; background: #e8f8ee; }
.trend.warning { color: #c07a24; background: #fdf3e3; }

/* ---------- Dashboard grids ---------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* activity list */
.activity-list, .followup-list { display: flex; flex-direction: column; }
.activity-row, .followup-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 10px;
  border-radius: var(--r-md);
  transition: background .16s var(--ease);
}
.activity-row:hover, .followup-row:hover { background: #f6faf6; }
.activity-row + .activity-row, .followup-row + .followup-row { border-top: 1px solid #f0f4f0; }

.activity-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 16px;
  border-radius: 12px;
  background: #eef5ec;
  color: var(--forest-3);
  flex-shrink: 0;
}
.activity-icon.blue { background: #e8f4fc; color: #3d7ea8; }
.activity-icon.orange { background: #fdf0e2; color: #cf7d2c; }

.activity-info, .followup-info { min-width: 0; flex: 1; }
.activity-info strong, .followup-info strong { display: block; font-size: 13.5px; font-weight: 800; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-info span, .followup-info span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.activity-time { font: 500 11px var(--mono); color: var(--muted); flex-shrink: 0; }

/* status tags */
.tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .03em;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
}
.tag.hot { background: #fdecec; color: #c23b3b; }
.tag.warm { background: #fdf3e3; color: #c07a24; }
.tag.cold { background: #e9f2fb; color: #3d7ea8; }
.tag.pengajuan { background: #f1ebfa; color: #7c55b8; }
.filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid #d9c9f0;
  border-radius: 999px;
  background: #f1ebfa;
  color: #7c55b8;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}
.filter-badge b { font-weight: 700; }
.filter-badge span { font-size: 11px; opacity: .7; }
.filter-badge:hover { background: #e7ddf6; border-color: #c4abE8; }
.filter-badge.hidden { display: none; }
.tag.realisasi { background: #e8f8ee; color: #2e9e66; }
.tag.belum-berminat { background: #f0f2f0; color: #7c8a81; }
.tag.follow-up-kembali { background: #eafaf6; color: #2a9d84; }

/* donut / pipeline */
.pipeline-chart { display: flex; align-items: center; gap: 26px; margin: 6px 0 18px; }
.donut-chart {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(closest-side, var(--white) 71%, transparent 72% 100%),
    conic-gradient(#ef6d6d 0 34%, #f2a35e 34% 58%, #7cc4ee 58% 76%, #d9e3da 76% 100%);
  box-shadow: inset 0 0 0 1px var(--line);
}
.donut-center { text-align: center; }
.donut-center strong { display: block; font-size: 27px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.donut-center span { font: 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.pipeline-legend { flex: 1; display: flex; flex-direction: column; gap: 11px; min-width: 0; }
.pipeline-legend > div { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-soft); }
.pipeline-legend strong { margin-left: auto; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.legend-dot { width: 10px; height: 10px; border-radius: 4px; flex-shrink: 0; }
.legend-dot.hot { background: #ef6d6d; }
.legend-dot.warm { background: #f2a35e; }
.legend-dot.cold { background: #7cc4ee; }
.legend-dot.neutral { background: #d9e3da; }

.pipeline-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #f6faf3;
  border-radius: var(--r-md);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.pipeline-footer strong { font-size: 15px; font-weight: 800; color: var(--forest); }

/* follow up list */
.followup-date {
  width: 46px;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f4f9f2;
  border: 1px solid #e2eedd;
  border-radius: 12px;
  flex-shrink: 0;
}
.followup-date strong { font-size: 16px; font-weight: 800; line-height: 1.1; color: var(--forest); }
.followup-date span { font: 9px var(--mono); letter-spacing: .1em; color: var(--muted); }

/* team */
.team-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.team-row + .team-row { border-top: 1px solid #f0f4f0; }
.team-person { flex: 1; min-width: 0; }
.team-person strong { display: block; font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-person span { font-size: 11px; color: var(--muted); }
.team-stat { text-align: right; flex-shrink: 0; }
.team-stat strong { display: block; font-size: 16px; font-weight: 800; line-height: 1.1; }
.team-stat span { font-size: 10px; color: var(--muted); }
.team-progress {
  width: 64px;
  height: 6px;
  background: #edf2ed;
  border-radius: 99px;
  overflow: hidden;
  flex-shrink: 0;
}
.team-progress span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--lime-strong), var(--lime));
  animation: growBar .8s var(--ease);
}
@keyframes growBar { from { width: 0 !important; } }

/* ---------- Forms ---------- */
.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(250px, .7fr);
  gap: 18px;
  align-items: start;
}

.activity-form { padding: 30px 32px; }

.form-section-title { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 24px; }
.form-section-title > span {
  font: 500 12px var(--mono);
  color: var(--forest-3);
  background: #ecf6e3;
  border: 1px solid #dcecc9;
  border-radius: 9px;
  padding: 8px 10px;
  flex-shrink: 0;
}
.form-section-title h2 { font-size: 15px; font-weight: 800; margin: 0 0 4px; }
.form-section-title p { font-size: 11.5px; color: var(--muted); margin: 0; }
.form-section-title.second { border-top: 1px solid var(--line); padding-top: 28px; margin-top: 30px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .span-2 { grid-column: span 2; }

/* pemilih jenis aktivitas: pemicu mode ambil data lama */
.activity-type-field { margin-bottom: 22px; }
.activity-type-field select { font-weight: 700; }
.activity-type-field .field-hint b { color: var(--forest); font-weight: 800; }

/* ---------- Mode ambil data lama (Follow Up / Survey) ---------- */
.reuse-block {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 22px;
  padding: 20px 22px;
  border: 1px dashed #cbe3ae;
  border-radius: var(--r-lg);
  background: #f7fcee;
}
.reuse-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(168, 214, 31, .18);
  color: var(--forest);
}
.reuse-body { flex: 1; min-width: 0; }
.reuse-body > strong { display: block; font-size: 13.5px; font-weight: 800; margin-bottom: 5px; }
.reuse-body > p { font-size: 11.5px; line-height: 1.7; color: var(--muted); margin: 0 0 14px; }
.reuse-body > p b { color: var(--forest); font-weight: 800; }
.reuse-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.reuse-controls label { min-width: 0; }
.reuse-controls .secondary-button { padding: 11px 16px; align-self: stretch; }
.reuse-body .field-hint { margin-top: 10px; }
.reuse-body .field-hint.success { color: var(--forest); font-weight: 600; }
/* saat data lama sudah dimuat: blok terlihat 'aktif' (bukan sekadar petunjuk) */
.reuse-block.is-loaded {
  border-style: solid;
  border-color: rgba(168, 214, 31, .55);
  background: #f4fbe6;
}

/* riwayat aktivitas lama nasabah terpilih (muncul saat data dimuat) */
.reuse-history {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(168, 214, 31, .45);
}
.reuse-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.reuse-history-head h4 { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: -.01em; color: var(--ink-soft); }
.reuse-history-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--forest);
  background: rgba(168, 214, 31, .16);
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.reuse-history-flag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--forest);
  background: rgba(168, 214, 31, .2);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.reuse-history-empty { margin: 0; font-size: 11.5px; font-style: italic; color: var(--muted); }
.reuse-history-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
}
.reuse-history-item {
  padding: 10px 12px;
  border: 1px solid #e2ecd3;
  border-left: 3px solid #cfe4a8;
  border-radius: 10px;
  background: #fff;
}
.reuse-history-item.is-source {
  border-left-color: var(--forest);
  background: #f4fbe6;
  box-shadow: 0 0 0 1px rgba(168, 214, 31, .35);
}
.reuse-history-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.reuse-history-who { font-size: 12px; font-weight: 800; color: var(--forest); }
.reuse-history-time { font-size: 10.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.reuse-history-tags { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; flex-wrap: wrap; }
.reuse-history-owner { font-size: 11px; font-weight: 600; color: var(--muted); }
.reuse-history-text {
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-soft);
  white-space: pre-wrap;
  word-break: break-word;
}

/* field master nasabah terkunci saat mode ambil data aktif */
label.field-locked { opacity: .92; }
label.field-locked > input,
label.field-locked > select,
label.field-locked > textarea {
  background: #eff3ee;
  color: var(--muted);
  border-style: dashed;
  cursor: not-allowed;
}

/* ---------- Akses data aplikasi angsuran (Penagihan / Relationship) ---------- */
.angsuran-block {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 22px;
  padding: 20px 22px;
  border: 1px solid #d4e4f2;
  border-left: 3px solid #4a90c7;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, #f4fafe, #eef5fc);
}
.angsuran-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(74, 144, 199, .14);
  color: #2f6f9e;
}
.angsuran-body { flex: 1; min-width: 0; }
.angsuran-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.angsuran-head > div { min-width: 0; }
.angsuran-head strong { display: block; font-size: 13.5px; font-weight: 800; margin-bottom: 5px; }
.angsuran-head p { font-size: 11.5px; line-height: 1.7; color: var(--muted); margin: 0; }
.angsuran-head p b { color: #2f6f9e; font-weight: 800; }
.angsuran-app-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 99px;
  border: 1.5px solid #bcd8ec;
  background: var(--white);
  color: #2f6f9e;
  font-size: 11.5px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.angsuran-app-link:hover { background: #e6f2fb; border-color: #9cc6e4; color: #215a82; }
.angsuran-app-link svg { flex-shrink: 0; }
.angsuran-actions { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.angsuran-sso-note { font-size: 10px; font-weight: 700; color: #5b8bb0; text-align: right; }
.angsuran-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.angsuran-controls label { min-width: 0; }
.angsuran-controls .secondary-button { padding: 11px 16px; align-self: stretch; }
.angsuran-body .field-hint { margin-top: 10px; }
.angsuran-results:empty { display: none; }

/* keadaan kosong / memuat / galat */
.angsuran-state {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  margin-top: 12px;
  border-radius: var(--r-md);
  background: var(--white);
  border: 1px solid #dce9f3;
}
.angsuran-state-icon { font-size: 16px; line-height: 1.2; }
.angsuran-state strong { display: block; font-size: 12.5px; font-weight: 800; }
.angsuran-state p { margin: 3px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.angsuran-state p b { color: var(--ink-soft); }

/* tabel hasil pencarian */
.angsuran-table-wrap { margin-top: 12px; overflow-x: auto; border: 1px solid #dce9f3; border-radius: var(--r-md); background: var(--white); }
.angsuran-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.angsuran-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 12px;
  background: #f2f8fc;
  white-space: nowrap;
}
.angsuran-table td { padding: 10px 12px; border-top: 1px solid #eef4f8; vertical-align: middle; white-space: nowrap; }
.angsuran-table tbody tr:hover { background: #f7fbfe; }
.angsuran-table .ta-r { text-align: right; font-variant-numeric: tabular-nums; }
.angsuran-cell-nama strong { display: block; font-size: 12.5px; font-weight: 800; color: var(--ink); }
.angsuran-cell-nama span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); }
.angsuran-cell-money { font-weight: 800; color: var(--forest); }
.angsuran-kol {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
  background: #eef4f8;
  color: var(--ink-soft);
}
.angsuran-status { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 10px; font-weight: 800; }
.angsuran-status.is-paid { background: #e6f7ee; color: #1f7a4d; }
.angsuran-status.is-unpaid { background: #fdecec; color: #b23b3b; }
.angsuran-foot { margin: 10px 2px 0; font-size: 10.5px; color: var(--muted); }

/* pilih nasabah dari hasil pencarian -> isi form aktivitas */
.angsuran-th-pick { width: 1%; }
.angsuran-cell-pick { width: 1%; }
.angsuran-table tbody tr.angsuran-row { cursor: pointer; }
.angsuran-table tbody tr.angsuran-row:focus-visible { outline: 2px solid #4a90c7; outline-offset: -2px; }
.angsuran-table tbody tr.angsuran-row.is-selected { background: #e9f3fc; }
.angsuran-table tbody tr.angsuran-row.is-selected:hover { background: #e0eefb; }
.angsuran-table tbody tr.angsuran-row.is-selected td { border-top-color: #cfe4f4; }
.angsuran-pick {
  display: inline-block;
  min-width: 62px;
  padding: 5px 10px;
  border: 1px solid #cbe0f0;
  border-radius: 99px;
  background: #f2f9fe;
  color: #2f6f9e;
  font-size: 10.5px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.angsuran-row:hover .angsuran-pick { background: #e2f0fb; border-color: #a9cfe8; }
.angsuran-row.is-selected .angsuran-pick { background: #1f7a4d; border-color: #1f7a4d; color: #fff; }

/* bar ringkasan nasabah yang dipilih */
.angsuran-selection {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #bfe3cd;
  border-radius: var(--r-md);
  background: #f1faf4;
}
.angsuran-selection.hidden { display: none; }
.angsuran-selection-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1f7a4d;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.angsuran-selection-body { flex: 1; min-width: 0; }
.angsuran-selection-body strong { display: block; font-size: 13px; font-weight: 800; color: var(--ink); }
.angsuran-selection-body span { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.angsuran-selection-clear {
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid #cde7d8;
  border-radius: var(--r-sm);
  background: #fff;
  color: #1f7a4d;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.angsuran-selection-clear:hover { background: #e7f6ee; border-color: #a9d8bd; }

/* sorot singkat field yang terisi otomatis dari data angsuran */
label.field-filled > input,
label.field-filled > select {
  animation: fieldFilled 1.4s ease;
}
@keyframes fieldFilled {
  0% { box-shadow: 0 0 0 3px rgba(31, 122, 77, .22); }
  100% { box-shadow: 0 0 0 0 rgba(31, 122, 77, 0); }
}

.activity-form textarea { min-height: 115px; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 22px;
}

.form-aside { display: flex; flex-direction: column; gap: 16px; }

.aside-tip {
  background: linear-gradient(155deg, var(--forest-2), var(--forest));
  color: #e8f2e6;
  padding: 26px;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.aside-tip::after {
  content: '';
  position: absolute;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(201, 242, 78, .22);
  border-radius: 50%;
  right: -70px;
  bottom: -80px;
}
.tip-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: rgba(201, 242, 78, .16);
  color: var(--lime);
  border-radius: 11px;
  font-size: 17px;
}
.aside-tip h3 { font-size: 15px; font-weight: 800; margin: 20px 0 8px; }
.aside-tip p { font-size: 11.5px; line-height: 1.8; color: #b9ccc0; margin-bottom: 0; }
.tip-rule { height: 1px; background: rgba(255, 255, 255, .14); margin: 22px 0 18px; }
.tip-stat { display: flex; align-items: center; gap: 14px; }
.tip-stat strong { font-size: 30px; font-weight: 800; color: var(--lime); line-height: 1; }
.tip-stat span { font-size: 10.5px; line-height: 1.6; color: #a9bfb2; }

.aside-check {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.aside-check strong { display: block; font-size: 12.5px; font-weight: 800; margin-bottom: 14px; }
.aside-check span {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  color: #6f9279;
  margin-top: 10px;
}
.aside-check span::before {
  content: '';
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #e8f8ee
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 24 24' fill='none' stroke='%232e9e66' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
    center / 9px no-repeat;
}

/* ---------- Toolbar & table ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.search-box { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.search-box svg, .search-box span { color: #8c9e94; flex-shrink: 0; }
.search-box input { border: 0; outline: 0; width: 100%; font-size: 13px; background: transparent; padding: 6px 0; box-shadow: none; }
.search-box input:focus { box-shadow: none; }

.table-panel { padding: 8px; overflow: hidden; }
.table-wrap { overflow-x: auto; border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
thead th {
  font: 700 10.5px var(--font);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fafcfa;
  white-space: nowrap;
}
tbody td {
  padding: 15px 16px;
  border-bottom: 1px solid #f0f4f0;
  font-size: 13px;
  vertical-align: middle;
}
tbody tr { transition: background .15s var(--ease); }
tbody tr:hover { background: #f7faf6; }
tbody tr:last-child td { border-bottom: 0; }
tbody td strong { font-weight: 800; display: block; font-size: 13px; }
tbody td small { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.table-avatar { display: inline-grid; vertical-align: middle; margin-right: 11px; }
.row-menu { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: #8c9e94; transition: background .16s, color .16s; letter-spacing: 1px; }
.row-menu:hover { background: #eef5ec; color: var(--forest); }
.status-select { width: auto; min-width: 140px; padding: 7px 30px 7px 12px; font-size: 12.5px; font-weight: 600; border-radius: 9px; cursor: pointer; }

/* ---------- Data prospek: baris filter per kolom ---------- */
.filter-row th { padding: 8px 10px; background: #f5f9f5; border-bottom: 1px solid var(--line); }
.filter-row .col-filter {
  width: 100%;
  min-width: 96px;
  padding: 7px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 8px;
  background: #fff;
}
.filter-row .col-filter:focus { box-shadow: 0 0 0 2px rgba(21, 122, 70, .15); }
.area-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  background: #eaf6ee;
  color: var(--forest);
  white-space: nowrap;
}

/* regional = satu tingkat di atas area (cabang), tampilan lebih lembut */
.regional-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 4px 10px;
  border-radius: 99px;
  background: #eef1f7;
  color: #3f5a87;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .filter-row { display: none; }
}

/* ---------- Popup notifikasi perubahan status ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(16, 32, 24, .45); display: grid; place-items: center; z-index: 90; backdrop-filter: blur(3px); }
.modal-card { background: #fff; border-radius: 18px; padding: 28px 30px; width: min(420px, calc(100vw - 40px)); text-align: center; box-shadow: 0 24px 60px rgba(16, 32, 24, .25); animation: pageIn .22s ease; }
.modal-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 50%; background: var(--lime); color: var(--forest); font-size: 24px; font-weight: 800; }
.modal-card h3 { margin: 0 0 10px; font-size: 18px; }
.modal-card p { margin: 0 0 18px; color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
.modal-card .primary-button { width: 100%; }

/* ---------- Lightbox bukti gambar AO (tabel data prospek) ---------- */
.view-image-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 9px;
  border: 1.5px solid var(--line); background: #fbfdfb; color: var(--forest);
  font-size: 12px; font-weight: 700; white-space: nowrap;
  transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
.view-image-btn svg { flex-shrink: 0; }
.view-image-btn:hover { border-color: var(--lime-strong); background: #f2f8ec; box-shadow: var(--shadow-sm); }
.view-image-btn:active { transform: translateY(1px); }
.no-image { color: var(--muted); font-size: 12px; font-weight: 600; }

.image-modal-card { position: relative; width: min(680px, calc(100vw - 40px)); padding: 14px; text-align: left; }
.image-modal-card img { width: 100%; max-height: 62vh; object-fit: contain; border-radius: 12px; background: #f4f7f4; display: block; }
.image-modal-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(20, 32, 27, .55); color: #fff; font-size: 13px; font-weight: 700;
  transition: background .18s var(--ease);
}
.image-modal-close:hover { background: var(--forest); }
.image-modal-caption { display: flex; flex-direction: column; gap: 3px; padding: 13px 6px 4px; }
.image-modal-caption strong { font-size: 14px; font-weight: 800; color: var(--ink); }
.image-modal-caption span { font-size: 12px; color: var(--muted); }

/* ---------- Reports ---------- */
.report-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.report-big { display: flex; flex-direction: column; }
.report-big > strong {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.03em;
  margin: 8px 0 18px;
  font-variant-numeric: tabular-nums;
}
.report-big small { font-size: 11px; color: var(--muted); margin-top: auto; }

.mini-bars { display: flex; align-items: flex-end; gap: 7px; height: 64px; margin-bottom: 14px; }
.mini-bars i {
  flex: 1;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--lime), #dceeb2);
  min-height: 8%;
  animation: growBar .9s var(--ease) backwards;
}
.mini-bars i:nth-child(odd) { background: linear-gradient(180deg, var(--forest-3), #6d9b8b); }

.progress-line { height: 9px; background: #edf2ed; border-radius: 99px; overflow: hidden; margin-bottom: 14px; }
.progress-line span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--forest-3), var(--teal)); animation: growBar 1s var(--ease); }

.report-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.report-pills span { font-size: 11px; font-weight: 800; padding: 5px 12px; border-radius: 99px; background: var(--line); color: var(--ink-soft); }
.report-pills span.muted { background: none; padding: 0; font-weight: 600; }

.report-table { margin-bottom: 16px; }
.period-select { width: auto; font-size: 12px; font-weight: 700; padding: 8px 34px 8px 13px; }

.breakdown-row { display: grid; grid-template-columns: 190px 1fr 40px; align-items: center; gap: 16px; padding: 11px 0; }
.breakdown-row + .breakdown-row { border-top: 1px solid #f0f4f0; }
.breakdown-row > span { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breakdown-row strong { font-size: 13px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.breakdown-bar { height: 9px; background: #edf2ed; border-radius: 99px; overflow: hidden; }
.breakdown-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--forest-3), var(--lime-strong));
  animation: growBar .9s var(--ease);
}

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.settings-card h2 { font-size: 15px; font-weight: 800; margin: 0 0 20px; }
.settings-card label { margin-bottom: 15px; }
.settings-card .primary-button { margin-top: 6px; }

.setting-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid #f0f4f0;
}
.setting-toggle:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-toggle strong { display: block; font-size: 13px; font-weight: 800; }
.setting-toggle span { font-size: 11.5px; color: var(--muted); }
.setting-toggle input { width: 40px; height: 22px; accent-color: var(--lime-strong); cursor: pointer; flex-shrink: 0; }

/* ---------- Empty state & toast ---------- */
.empty-state {
  padding: 36px 20px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  background: repeating-linear-gradient(-45deg, #fafcfa, #fafcfa 12px, #f5f8f5 12px, #f5f8f5 24px);
  border: 1.5px dashed var(--line);
  border-radius: var(--r-md);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  background: var(--forest);
  color: #eef9ee;
  font-size: 13px;
  font-weight: 700;
  padding: 14px 20px 14px 16px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(14px) scale(.97);
  pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.toast::before {
  content: '';
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--lime)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2316362c' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
    center / 10px no-repeat;
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }

/* ---------- Responsive ---------- */
@media (max-width: 1050px) {
  .sidebar { width: 216px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-layout { grid-template-columns: 1fr; }
  .form-aside { display: grid; grid-template-columns: 1fr 1fr; }
  .report-summary { grid-template-columns: 1fr 1fr; }
  .report-summary .report-big:last-child { grid-column: span 2; }
  .page-content, .topbar { padding-left: 24px; padding-right: 24px; }
}

@media (max-width: 720px) {
  .login-view { grid-template-columns: 1fr; }
  .login-visual { min-height: 320px; padding: 28px 26px 26px; }
  .visual-copy { margin: auto 0 26px; }
  .visual-copy h1 { font-size: 44px; margin-bottom: 16px; }
  .visual-copy p { font-size: 13px; }
  .login-panel { padding: 40px 24px; }

  .sidebar {
    position: fixed;
    z-index: 50;
    left: -260px;
    top: 0;
    bottom: 0;
    height: 100%;
    transition: left .28s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { left: 0; }
  .mobile-menu { display: grid; place-items: center; }
  .breadcrumb { display: none; }
  .topbar-date { display: none; }
  .scope-picker { padding: 4px 6px 4px 10px; gap: 4px; }
  .scope-picker-label { display: none; }
  .scope-picker select { max-width: 118px; }
  .topbar { padding: 12px 18px; }
  .page-content { padding: 24px 16px 48px; }

  .page-heading { flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
  .page-heading > .primary-button, .page-heading > .secondary-button { align-self: stretch; }

  .metric-grid { gap: 10px; }
  .metric-card { padding: 16px; }
  .metric-card > strong { font-size: 24px; }
  .metric-foot { flex-wrap: wrap; }

  .dashboard-grid { gap: 10px; margin-bottom: 10px; }
  .panel { padding: 18px; }
  .pipeline-chart { justify-content: center; gap: 20px; }

  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .activity-form { padding: 20px; }
  .form-aside { display: flex; }
  .reuse-block { padding: 18px 16px; gap: 12px; }
  .reuse-controls { grid-template-columns: 1fr; }
  .reuse-controls .secondary-button { width: 100%; }
  .angsuran-block { padding: 18px 16px; gap: 12px; }
  .angsuran-head { flex-direction: column; }
  .angsuran-actions { align-items: stretch; width: 100%; }
  .angsuran-app-link { width: 100%; justify-content: center; }
  .angsuran-sso-note { text-align: center; }
  .angsuran-controls { grid-template-columns: 1fr; }
  .angsuran-controls .secondary-button { width: 100%; }
  .angsuran-selection { flex-wrap: wrap; padding: 12px; }
  .angsuran-selection-clear { width: 100%; }
  .angsuran-pick { min-width: 52px; }

  .toolbar { flex-wrap: wrap; }
  .search-box { flex-basis: 100%; }
  .toolbar select { flex: 1; }
  .toolbar .secondary-button { flex: 1; }

  .report-summary { grid-template-columns: 1fr; gap: 10px; }
  .report-summary .report-big:last-child { grid-column: auto; }
  .breakdown-row { grid-template-columns: 110px 1fr 34px; gap: 10px; }

  .settings-grid { grid-template-columns: 1fr; }
  .toast { left: 16px; right: 16px; bottom: 16px; }
}

/* login form spacing */
.stack-label { margin-bottom: 18px; }

/* ============================================================
   Role badges, halaman pengguna & laporan (versi PHP)
   ============================================================ */
.form-message.success { color: #2e9e66; font-weight: 600; }
.form-message.error { color: #c23b3b; font-weight: 600; }

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.role-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.role-marketing { background: #e8f6ee; color: #1e7d4f; }
.role-spv { background: #e9f2fb; color: #3d7ea8; }
.role-manager { background: #fdf3e3; color: #c07a24; }
.role-direksi { background: #f1ebfa; color: #7c55b8; }

.users-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  gap: 22px;
  align-items: start;
}
.user-cell { display: inline-flex; flex-direction: column; vertical-align: middle; line-height: 1.4; }
.user-cell small { font-size: 11px; color: var(--muted); }

.row-actions { display: inline-flex; gap: 6px; }
.row-actions .row-menu { width: auto; height: auto; padding: 5px 11px; font-size: 12px; font-weight: 700; border-radius: 8px; border: 1px solid transparent; letter-spacing: 0; }
.row-actions .row-menu.danger { color: #c23b3b; }
.row-actions .row-menu.danger:hover { background: #fdecec; }

.report-pills span.pill-hot { background: #fdecec; color: #c23b3b; }
.report-pills span.pill-warm { background: #fdf3e3; color: #c07a24; }
.report-pills span.pill-warm-prospek { background: #fbeecb; color: #96660f; }
.report-pills span.pill-cold { background: #e9f2fb; color: #3d7ea8; }
.report-pills span.pill-belum-berminat { background: #eef1f3; color: #5f6f78; }
.report-pills span.pill-follow-up-kembali { background: #e4f4f2; color: #2f8f83; }
.report-pills span.pill-pengajuan { background: #f1ebfa; color: #7c55b8; }
.report-pills span.pill-realisasi { background: #e8f8ee; color: #2e9e66; }
.report-pills span.pill-gagal { background: #f0f2f0; color: #7c8a81; }
/* tahap tanpa data: tetap tampil redup agar seluruh alur pipeline terbaca */
.report-pills span.pill-empty { background: transparent; border: 1px dashed var(--line); color: var(--muted); font-weight: 700; }

@media (max-width: 1050px) {
  .users-layout { grid-template-columns: 1fr; }
}

/* Logo asset */
.dsar-logo {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 8px;
}
.sidebar-brand .dsar-logo { width: 32px; height: 32px; }
.visual-top .dsar-logo { width: 38px; height: 38px; }
.login-logo { filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .16)); }

/* ---------- Reports: rentang waktu download laporan ---------- */
.export-range { margin-bottom: 16px; }
.export-range .panel-heading { margin-bottom: 14px; }
.range-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.range-chip {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 99px;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease), color .18s var(--ease);
  white-space: nowrap;
}
.range-chip:hover { border-color: var(--forest-3); background: #f3f8f2; }
.range-chip.is-active { background: var(--forest); border-color: var(--forest); color: #fff; }
.range-dates { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.range-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.range-field input {
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
}
.range-field input:focus { outline: none; border-color: var(--forest-3); box-shadow: 0 0 0 2px rgba(21, 122, 70, .15); }
.range-sep { font-weight: 800; color: var(--muted); padding-bottom: 12px; }
.range-dates .primary-button { margin-left: auto; }
@media (max-width: 600px) {
  .range-dates > * { flex: 1 1 100%; }
  .range-dates .range-sep { display: none; }
  .range-dates .primary-button { margin-left: 0; }
}

/* ---------- Halaman Performa (performa.php) ---------- */
.performa-body { background: var(--paper); }
.performa-shell { max-width: 1180px; margin: 0 auto; padding: 28px 32px 64px; }
.performa-topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; flex-wrap: wrap; }
.performa-topbar .sidebar-brand { margin-right: auto; margin-bottom: 0; }
.performa-topbar .sidebar-brand strong { color: var(--ink); }
.performa-topbar .sidebar-brand small { color: var(--muted); }
.performa-user { display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--line); border-radius: 99px; padding: 6px 16px 6px 6px; }
.performa-user strong { font-size: 13px; }
.performa-user small { display: block; font-size: 11px; color: var(--muted); }
.period-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-soft);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 99px;
  padding: 9px 16px;
  white-space: nowrap;
}
.period-chip b { font-weight: 800; color: var(--forest); }
.filter-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.filter-form select {
  padding: 10px 12px;
  font: 600 13px var(--font);
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  min-width: 170px;
}
.filter-form select:focus { outline: none; border-color: var(--forest-3); box-shadow: 0 0 0 2px rgba(21, 122, 70, .15); }
.filter-form .primary-button { height: 41px; }
.filter-form .text-button { padding-bottom: 12px; }
.rank-badge {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  background: #f1f4f1;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.rank-badge.rank-1 { background: #fdf3e3; color: #c07a24; }
.rank-badge.rank-2 { background: #eef1f4; color: #5d7189; }
.rank-badge.rank-3 { background: #f6e9dd; color: #a3663c; }
.num-strong { font-weight: 800; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.empty-cell { text-align: center; color: var(--muted); font-size: 13px; padding: 28px 16px !important; }
.empty-note { margin: 4px 0 8px; color: var(--muted); font-size: 13px; }
.type-breakdown { padding: 6px 16px 14px; }
.report-summary.performa-summary { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1050px) {
  .report-summary.performa-summary { grid-template-columns: repeat(2, 1fr); }
  .report-summary.performa-summary .report-big:last-child { grid-column: span 2; }
}
@media (max-width: 600px) {
  .performa-shell { padding: 20px 16px 48px; }
  .performa-topbar .secondary-button { align-self: stretch; }
  .report-summary.performa-summary { grid-template-columns: 1fr; }
  .report-summary.performa-summary .report-big:last-child { grid-column: auto; }
  .period-chip { align-self: flex-start; }
}

/* ============================================================
   Performa — angka klikabel & popup detail aktivitas (drill-down)
   ============================================================ */

/* Angka metrik yang bisa diklik (kartu ringkasan) */
.report-big .metric-hit {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  align-self: flex-start;
  margin: 8px 0 18px;
  padding: 0;
  color: inherit;
  border-radius: 10px;
  transition: color .16s var(--ease);
}
.metric-hit-value {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.metric-hit-cue {
  font-size: 20px;
  line-height: 1;
  font-weight: 800;
  color: var(--muted);
  opacity: .45;
  transform: translateY(-1px);
  transition: transform .18s var(--ease), opacity .18s var(--ease), color .18s var(--ease);
}
.report-big .metric-hit:hover,
.report-big .metric-hit:focus-visible { color: var(--forest); }
.report-big .metric-hit:hover .metric-hit-cue,
.report-big .metric-hit:focus-visible .metric-hit-cue { opacity: 1; color: var(--forest); transform: translate(3px, -1px); }
.report-big .metric-hit:active { transform: translateY(1px); }

/* Angka pada tabel & breakdown jenis aktivitas */
.num-hit {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: 8px;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.num-hit.num-strong { font-size: 13.5px; font-weight: 800; color: var(--ink); }
.num-hit:hover, .num-hit:focus-visible { background: #eef5ec; color: var(--forest); }
.num-hit:active { background: #e3efe4; }
.breakdown-row .num-hit { justify-self: end; }

/* ---------- Popup detail aktivitas ---------- */
.detail-modal-card {
  position: relative;
  width: min(960px, calc(100vw - 32px));
  max-height: 88vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  text-align: left;
  overflow: hidden;
}
.detail-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdfb, #fff);
}
.detail-modal-titles { min-width: 0; }
.detail-modal-eyebrow {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.detail-modal-head h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.modal-card .detail-modal-meta { display: block; margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.detail-modal-head .image-modal-close { position: static; margin: -4px -4px 0 0; flex-shrink: 0; }

.detail-modal-body {
  flex: 1;
  overflow: auto;
  padding: 0;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}
.detail-table-wrap { overflow-x: auto; }
.detail-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.detail-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  font: 700 10px var(--font);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: #f7faf7;
  white-space: nowrap;
}
.detail-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f1;
  font-size: 12.5px;
  vertical-align: top;
}
.detail-table tbody tr:last-child td { border-bottom: 0; }
.detail-table tbody tr:hover { background: #f8fbf7; }
.detail-table tbody td strong { display: block; font-size: 12.5px; font-weight: 800; color: var(--ink); }
.detail-table tbody td small { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.detail-table .nowrap { white-space: nowrap; }
.detail-table .detail-wrap { min-width: 150px; }
.detail-table .num-strong { font-size: 12.5px; }

.detail-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 190px;
  padding: 40px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.detail-state-error { color: #c23b3b; font-weight: 600; }
.detail-state-empty {
  background: repeating-linear-gradient(-45deg, #fafcfa, #fafcfa 12px, #f5f8f5 12px, #f5f8f5 24px);
}
.detail-spinner {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2.5px solid #dfe8e0;
  border-top-color: var(--forest-3);
  animation: detailSpin .7s linear infinite;
}
@keyframes detailSpin { to { transform: rotate(360deg); } }

.detail-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  background: #fbfdfb;
}
.detail-modal-count { font-size: 12px; font-weight: 700; color: var(--muted); }

@media (max-width: 600px) {
  .report-big .metric-hit { margin: 6px 0 14px; }
  .metric-hit-value { font-size: 28px; }
  .detail-modal-card { width: calc(100vw - 20px); max-height: 90vh; }
  .detail-modal-head { padding: 16px 16px 13px; }
  .detail-modal-foot { padding: 11px 16px; }
  .detail-table { min-width: 680px; }
}

/* ============================================================
   DATA PROSPEK — baris dapat diklik + popup detail & catatan SPV
   ============================================================ */

/* keterangan singkat di toolbar (baris dapat diklik) */
.table-hint {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* baris prospek kini bisa diklik sebagai satu kesatuan */
tbody tr.is-clickable { cursor: pointer; }
tbody tr.is-clickable:hover { background: #f2f8f1; }
tbody tr.is-clickable:focus-visible { outline: 2px solid var(--lime-strong); outline-offset: -2px; }

.col-action { text-align: right; }
.row-detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--forest);
  background: #eef5ec;
  border-radius: 9px;
  white-space: nowrap;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.row-detail-btn:hover { background: var(--forest); color: #fff; }
.row-detail-btn::after { content: '›'; font-size: 15px; line-height: 1; opacity: .7; }
.row-detail-btn:hover .note-flag { box-shadow: 0 0 0 3px rgba(201, 242, 78, .35); }

/* titik penanda: prospek sudah punya catatan dari SPV */
.note-flag {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime-strong);
  box-shadow: 0 0 0 3px rgba(168, 214, 31, .22);
  flex-shrink: 0;
}

/* kunci scroll halaman selama popup atribut terbuka */
body.modal-open { overflow: hidden; }

/* --- grid detail di dalam popup --- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
  padding: 18px 22px 6px;
}
.detail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px dashed #edf2ee;
}
.detail-field.is-wide { grid-column: 1 / -1; }
.detail-field-label {
  font: 700 10px var(--font);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.detail-field-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.detail-empty { color: #a2b1a8; font-weight: 500; font-style: italic; }

.detail-image-block {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px 0 4px;
}
.detail-image {
  margin-top: 8px;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 12px;
  background: #f4f7f4;
  border: 1px solid var(--line);
}

/* --- panel catatan supervisor di dalam popup --- */
.note-panel {
  margin: 10px 22px 22px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdfb, #fff);
}
.note-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.note-panel-head h4 { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: -.01em; }
.note-hint { font-size: 11px; font-weight: 600; color: var(--muted); }
.note-panel textarea { min-height: 84px; }
/* lebih spesifik dari .modal-card p agar catatan tidak ter-center */
.detail-modal-card .note-text {
  display: block;
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}
.detail-modal-card .note-text-empty { color: var(--muted); font-style: italic; }
.note-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.note-status { font-size: 12px; font-weight: 700; color: #2e9e66; min-height: 16px; }
.note-status:empty { visibility: hidden; }

/* meta "terakhir diperbarui" + riwayat catatan (audit trail) */
.note-meta {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}
.note-meta strong { color: var(--ink); font-weight: 700; }

.note-history {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.note-history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.note-history-head h4 { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: -.01em; color: var(--ink-soft); }
.note-history-body { display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; }
.note-history-empty { margin: 0; font-size: 12px; font-style: italic; color: var(--muted); }

.note-history-item {
  padding: 9px 11px;
  border-radius: 10px;
  background: #f7faf6;
  border: 1px solid var(--line);
  border-left: 3px solid var(--lime-strong);
}
.note-history-item.is-clear { border-left-color: #d9b3b3; background: #fbf7f7; }
.note-history-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.note-history-who { font-size: 11.5px; font-weight: 700; color: var(--ink); }
.note-history-time { font-size: 10.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.note-history-text { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-soft); white-space: pre-wrap; word-break: break-word; }

/* di dalam popup ini tombol tidak boleh melebar penuh (aturan .modal-card .primary-button) */
.detail-modal-card .primary-button { width: auto; }
.detail-modal-card .secondary-button { padding: 9px 16px; }

@media (max-width: 900px) {
  .table-hint { display: none; }
}
@media (max-width: 600px) {
  .detail-grid { grid-template-columns: 1fr; padding: 14px 16px 4px; }
  .detail-field.is-wide { grid-column: auto; }
  .detail-image { max-height: 240px; }
  .note-panel { margin: 10px 16px 18px; padding: 14px; }
  .note-actions { flex-direction: column-reverse; align-items: stretch; }
  .note-actions .primary-button { width: 100%; }
  .col-action { text-align: left; }
  .row-detail-btn { padding: 6px 10px; }
}

/* ============================================================
   OVERVIEW — angka klikabel (kartu metrik & legend pipeline)
   ============================================================ */

/* angka pada legend pipeline kini dapat diklik untuk melihat prospeknya */
.pipeline-legend .legend-hit {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 3px 8px;
  margin: -3px -8px;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink-soft);
  text-align: left;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.pipeline-legend .legend-hit:hover,
.pipeline-legend .legend-hit:focus-visible { background: #eef5ec; color: var(--forest); }
.pipeline-legend .legend-hit:hover strong,
.pipeline-legend .legend-hit:focus-visible strong { color: var(--forest); }
.pipeline-legend .legend-hit:active { background: #e3efe4; }
.pipeline-legend .legend-hit:focus-visible { outline: 2px solid var(--lime-strong); outline-offset: 1px; }

/* aksi (tombol) di sisi kanan footer popup drill-down */
.detail-modal-foot .detail-modal-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

@media (max-width: 600px) {
  .detail-modal-foot { flex-wrap: wrap; }
  .detail-modal-foot .detail-modal-actions { width: 100%; }
  .detail-modal-foot .detail-modal-actions .secondary-button { flex: 1; }
}
