/* ============================================================
   MNA Bridge — CRM & Sales Tracking Canvassing (Prototype)
   Design System: "Precision Field" — refined enterprise,
   brand-driven (logo MA: royal blue + vivid green)
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Brand (diekstrak dari logo.webp) */
  --ma-blue: #2557d6;
  --ma-blue-bright: #3b7af0;
  --ma-blue-deep: #16389b;
  --ma-navy: #0e2569;
  --ma-green: #56b53c;
  --ma-green-bright: #6fcf53;
  --ma-green-deep: #3a9427;

  --brand-grad: linear-gradient(135deg, var(--ma-blue-bright), var(--ma-blue-deep));
  --brand-grad-duo: linear-gradient(118deg, var(--ma-blue) 0%, var(--ma-blue-deep) 48%, var(--ma-green-deep) 100%);
  --green-grad: linear-gradient(135deg, var(--ma-green-bright), var(--ma-green-deep));

  /* Surfaces — light */
  --bg: #eef1f8;
  --bg-grad: radial-gradient(1200px 700px at 85% -10%, color-mix(in srgb, var(--ma-blue) 9%, transparent), transparent 60%),
             radial-gradient(900px 600px at -10% 100%, color-mix(in srgb, var(--ma-green) 8%, transparent), transparent 55%);
  --surface: #ffffff;
  --surface-2: #f5f7fc;
  --surface-3: #eceff8;
  --ink: #131f3d;
  --ink-soft: #4d5b7c;
  --ink-faint: #8b97b4;
  --border: #dce2f0;
  --border-strong: #c4cde4;
  --glass: color-mix(in srgb, #ffffff 72%, transparent);
  --glass-border: color-mix(in srgb, #ffffff 55%, var(--border));
  --shadow-sm: 0 1px 2px rgba(14, 37, 105, 0.06), 0 2px 8px rgba(14, 37, 105, 0.05);
  --shadow-md: 0 4px 14px rgba(14, 37, 105, 0.10), 0 1px 3px rgba(14, 37, 105, 0.07);
  --shadow-lg: 0 18px 50px rgba(14, 37, 105, 0.18);
  --ring: color-mix(in srgb, var(--ma-blue) 30%, transparent);

  /* Status pipeline */
  --st-prospek: #2f6bed;
  --st-followup: #0d97ab;
  --st-nego: #d98206;
  --st-deal: #43a52f;
  --st-batal: #d33b3b;

  /* Semantic */
  --ok: var(--ma-green-deep);
  --warn: #b97d0a;
  --err: #cf3434;
  --chart-target: #9aa7bf;
  --chart-actual: var(--ma-blue);
  --chart-deal: var(--ma-green);

  --font-display: "Bricolage Grotesque", sans-serif;
  --font-body: "Schibsted Grotesk", sans-serif;
  --font-mono: "Spline Sans Mono", monospace;

  --r-sm: 9px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --speed: 0.22s;
  --ease: cubic-bezier(0.33, 1, 0.5, 1);
}

html.dark {
  --bg: #0a1226;
  --bg-grad: radial-gradient(1200px 700px at 85% -10%, color-mix(in srgb, var(--ma-blue) 16%, transparent), transparent 60%),
             radial-gradient(900px 600px at -10% 100%, color-mix(in srgb, var(--ma-green) 9%, transparent), transparent 55%);
  --surface: #111d3a;
  --surface-2: #17254a;
  --surface-3: #1d2e58;
  --ink: #e9eefb;
  --ink-soft: #a3b1d2;
  --ink-faint: #6b7a9f;
  --border: #243660;
  --border-strong: #31477c;
  --glass: color-mix(in srgb, #111d3a 66%, transparent);
  --glass-border: color-mix(in srgb, #4a5f96 38%, transparent);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.42), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.55);
  --ring: color-mix(in srgb, var(--ma-blue-bright) 45%, transparent);
  --chart-target: #46587f;
  --st-prospek: #5b8cf5;
  --st-followup: #2fb9cc;
  --st-nego: #efa83a;
  --st-deal: #62c44b;
  --st-batal: #ef6363;
  --ok: var(--ma-green);
  --warn: #e3a93a;
  --err: #ef6b6b;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
a { color: var(--ma-blue); text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
svg { flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Custom Scrollbars (CRITICAL rule) ---------- */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ma-blue) 32%, transparent) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ma-blue) 26%, transparent);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
  transition: background var(--speed);
}
*::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--ma-blue) 48%, transparent); background-clip: content-box; }

/* ---------- Utilities ---------- */
.glass {
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border: 1px solid var(--glass-border);
}
.mono { font-family: var(--font-mono); }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.small { font-size: 12.5px; }
.flex { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.hide { display: none !important; }
.tr { text-align: right; }

/* ---------- Skeleton loading ---------- */
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(100deg, var(--surface-2) 40%, var(--surface-3) 50%, var(--surface-2) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}
.skeleton * { visibility: hidden; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--brand-grad);
  --btn-ink: #ffffff;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: none;
  border-radius: var(--r-md);
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-weight: 600;
  font-size: 14px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease), opacity var(--speed), filter var(--speed);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); filter: brightness(1.06); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; filter: grayscale(0.4); }
.btn.green { --btn-bg: var(--green-grad); }
.btn.danger { --btn-bg: linear-gradient(135deg, #e25555, #b62a2a); }
.btn.ghost {
  --btn-bg: transparent;
  --btn-ink: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn.ghost:hover { border-color: var(--border-strong); background: var(--surface-2); filter: none; }
.btn.soft {
  --btn-bg: color-mix(in srgb, var(--ma-blue) 11%, transparent);
  --btn-ink: var(--ma-blue);
  background: var(--btn-bg);
  box-shadow: none;
}
html.dark .btn.soft { --btn-ink: var(--ma-blue-bright); }
.btn.soft:hover { filter: none; background: color-mix(in srgb, var(--ma-blue) 18%, transparent); }
.btn.sm { padding: 7px 13px; font-size: 13px; border-radius: 10px; }
.btn.lg { padding: 14px 26px; font-size: 15.5px; border-radius: var(--r-lg); }
.btn.block { width: 100%; }
.btn.icon-only { padding: 9px; border-radius: 11px; }

/* Loading spinner inside button — no layout shift */
.btn .btn-label { display: inline-flex; align-items: center; gap: 8px; transition: opacity var(--speed); }
.btn.is-loading .btn-label { opacity: 0; }
.btn .btn-spinner {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--speed);
}
.btn.is-loading .btn-spinner { opacity: 1; }
.btn.is-loading { pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ---------- Chips & Badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px;
  border-radius: 99px;
  font-size: 12px; font-weight: 600;
  background: var(--surface-2);
  color: var(--ink-soft);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.chip.brand { background: color-mix(in srgb, var(--ma-blue) 10%, transparent); color: var(--ma-blue); border-color: color-mix(in srgb, var(--ma-blue) 25%, transparent); }
html.dark .chip.brand { color: var(--ma-blue-bright); }
.chip.green { background: color-mix(in srgb, var(--ma-green) 13%, transparent); color: var(--ma-green-deep); border-color: color-mix(in srgb, var(--ma-green) 30%, transparent); }
html.dark .chip.green { color: var(--ma-green-bright); }
.chip.warn { background: color-mix(in srgb, var(--warn) 13%, transparent); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.chip.err { background: color-mix(in srgb, var(--err) 11%, transparent); color: var(--err); border-color: color-mix(in srgb, var(--err) 28%, transparent); }
.chip.clickable { cursor: pointer; transition: transform var(--speed), border-color var(--speed), background var(--speed); }
.chip.clickable:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.chip.clickable.on { background: var(--brand-grad); color: #fff; border-color: transparent; }

.badge-st {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3.5px 10px; border-radius: 99px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em;
  background: color-mix(in srgb, var(--st) 13%, transparent);
  color: var(--st);
  border: 1px solid color-mix(in srgb, var(--st) 30%, transparent);
}
.badge-st .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--st); }
.st-PROSPEK_BARU { --st: var(--st-prospek); }
.st-FOLLOW_UP { --st: var(--st-followup); }
.st-NEGOSIASI { --st: var(--st-nego); }
.st-DEAL { --st: var(--st-deal); }
.st-BATAL { --st: var(--st-batal); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card.interactive { transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease), border-color var(--speed); cursor: pointer; }
.card.interactive:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.card-sub { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }

.stat-card { position: relative; overflow: hidden; }
.stat-card .stat-num { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.1; margin-top: 8px; }
.stat-card .stat-ico {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent, var(--ma-blue)) 12%, transparent);
  color: var(--accent, var(--ma-blue));
}
.stat-card::after {
  content: ""; position: absolute; right: -28px; top: -28px;
  width: 110px; height: 110px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent, var(--ma-blue)) 7%, transparent);
}

.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-main { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; }
@media (max-width: 980px) { .grid-main, .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink-soft); display: flex; gap: 5px; align-items: center; }
.field .req { color: var(--err); font-weight: 700; }
.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14.5px;
  transition: border-color var(--speed), box-shadow var(--speed), background var(--speed);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ma-blue); box-shadow: 0 0 0 3.5px var(--ring); }
.input:disabled, .select:disabled, .input[readonly] { background: var(--surface-2); color: var(--ink-faint); cursor: not-allowed; }
.textarea { resize: vertical; min-height: 86px; }
.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-faint) 50%), linear-gradient(135deg, var(--ink-faint) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
  cursor: pointer;
}
.field .hint { font-size: 12px; color: var(--ink-faint); }
.field .error-msg { font-size: 12.5px; color: var(--err); font-weight: 600; display: none; align-items: center; gap: 5px; }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea { border-color: var(--err); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--err) 18%, transparent); }
.field.invalid .error-msg { display: flex; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

/* Switch */
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 42px; height: 24px; border-radius: 99px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  transition: background var(--speed), border-color var(--speed);
  position: relative;
}
.switch .track::after {
  content: ""; position: absolute; top: 2.5px; left: 3px;
  width: 17px; height: 17px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform var(--speed) var(--ease);
}
.switch input:checked + .track { background: var(--ma-green-deep); border-color: var(--ma-green-deep); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--ring); outline-offset: 2px; }

/* Segmented control — fluid sliding pill */
.seg {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3px;
  isolation: isolate;
}
.seg .seg-pill {
  position: absolute; z-index: 0;
  top: 3px; bottom: 3px; left: 3px;
  width: calc((100% - 6px) / var(--n, 2));
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform 0.28s var(--ease);
  transform: translateX(calc(var(--i, 0) * 100%));
}
.seg button {
  position: relative; z-index: 1;
  border: none; background: transparent;
  padding: 7px 16px;
  font-size: 13px; font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 9px;
  transition: color var(--speed);
  white-space: nowrap;
}
.seg button.on { color: var(--ink); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-faint);
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr { transition: background var(--speed); }
.tbl tbody tr:hover { background: color-mix(in srgb, var(--ma-blue) 4%, transparent); }
.tbl tbody tr:last-child td { border-bottom: none; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: color-mix(in srgb, var(--ma-navy) 45%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  opacity: 0;
  transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; }
.modal {
  width: 100%; max-width: 480px;
  max-height: calc(100dvh - 48px);
  display: flex; flex-direction: column;
  border-radius: var(--r-xl);
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(0.97);
  transition: transform 0.28s var(--ease);
  overflow: hidden;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 12px; }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 6px 22px 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; border-top: 1px solid var(--border); }
.modal-x {
  border: none; background: var(--surface-2); color: var(--ink-soft);
  width: 32px; height: 32px; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--speed), transform var(--speed), color var(--speed);
}
.modal-x:hover { background: var(--surface-3); transform: rotate(90deg); color: var(--ink); }

/* ---------- Toasts ---------- */
.toast-stack {
  position: fixed; top: 18px; right: 18px; z-index: 300;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(92vw, 380px);
}
@keyframes toast-in { from { opacity: 0; transform: translateX(24px) scale(0.96); } to { opacity: 1; transform: none; } }
.toast {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 13px 16px;
  border-radius: var(--r-md);
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  font-size: 13.5px; font-weight: 500;
  animation: toast-in 0.32s var(--ease);
  border-left: 3px solid var(--t-accent, var(--ma-blue));
}
.toast.ok { --t-accent: var(--ok); }
.toast.warn { --t-accent: var(--warn); }
.toast.err { --t-accent: var(--err); }
.toast .t-ico { color: var(--t-accent); margin-top: 1px; }
.toast.leaving { opacity: 0; transform: translateX(24px); transition: all 0.3s; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-wrap { min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; }
@media (max-width: 880px) { .login-wrap { grid-template-columns: 1fr; } .login-brand { display: none; } }
.login-brand {
  position: relative;
  background: var(--brand-grad-duo);
  color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px 52px;
  overflow: hidden;
}
.login-brand::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(700px 420px at 110% 8%, rgba(255,255,255,0.14), transparent 60%),
    radial-gradient(520px 380px at -8% 105%, rgba(255,255,255,0.10), transparent 55%);
}
.login-brand::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(900px 600px at 30% 40%, black, transparent 75%);
}
.login-brand > * { position: relative; z-index: 1; }
.lb-logo { display: flex; align-items: center; gap: 14px; }
.lb-logo img { width: 54px; height: auto; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.25)); background: #fff; border-radius: 14px; padding: 7px; }
.lb-logo .t1 { font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.2; }
.lb-logo .t2 { font-size: 12px; opacity: 0.75; letter-spacing: 0.14em; text-transform: uppercase; }
.lb-hero h1 { font-size: clamp(30px, 3.6vw, 44px); font-weight: 700; line-height: 1.12; letter-spacing: -0.02em; }
.lb-hero h1 .hl { color: var(--ma-green-bright); }
.lb-hero p { margin-top: 14px; max-width: 46ch; opacity: 0.85; font-size: 15px; }
.lb-points { display: flex; flex-direction: column; gap: 11px; margin-top: 26px; }
.lb-point { display: flex; gap: 11px; align-items: center; font-size: 13.5px; font-weight: 500; }
.lb-point .ico {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  display: flex; align-items: center; justify-content: center;
}
.lb-foot { font-size: 12px; opacity: 0.65; }

.login-side {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 36px 22px;
  gap: 18px;
}
.login-card { width: 100%; max-width: 430px; padding: 30px 28px; border-radius: var(--r-xl); }
.login-card h2 { font-size: 24px; }
.login-card .sub { color: var(--ink-soft); font-size: 13.5px; margin-top: 4px; margin-bottom: 22px; }
.login-mobile-logo { display: none; align-items: center; gap: 11px; margin-bottom: 18px; }
.login-mobile-logo img { width: 40px; border-radius: 10px; background: #fff; padding: 5px; box-shadow: var(--shadow-sm); }
@media (max-width: 880px) { .login-mobile-logo { display: flex; } }

@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-3px); } 40%, 60% { transform: translateX(3px); } }
.login-card.shake { animation: shake 0.5s; }
.login-alert {
  display: none; align-items: flex-start; gap: 9px;
  background: color-mix(in srgb, var(--err) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--err) 30%, transparent);
  color: var(--err);
  font-size: 13px; font-weight: 600;
  border-radius: var(--r-md);
  padding: 11px 13px;
  margin-bottom: 16px;
}
.login-alert.show { display: flex; }

.demo-accounts { width: 100%; max-width: 430px; }
.demo-accounts .da-title { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); text-align: center; margin-bottom: 10px; }
.da-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.da-card {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: transform var(--speed) var(--ease), border-color var(--speed), box-shadow var(--speed);
  font-family: var(--font-body);
}
.da-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--ma-blue) 45%, var(--border)); box-shadow: var(--shadow-md); }
.da-card .da-av {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
  background: var(--av-bg, var(--brand-grad));
}
.da-card .da-role { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.da-card .da-name { font-size: 11.5px; color: var(--ink-faint); }
.da-card.inactive { opacity: 0.75; }
.da-card.inactive .da-av { background: linear-gradient(135deg, #9aa3b5, #6b7488); }
.login-links { display: flex; gap: 16px; justify-content: center; font-size: 13px; font-weight: 600; flex-wrap: wrap; }
.login-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); transition: color var(--speed); }
.login-links a:hover { color: var(--ma-blue); }

/* ============================================================
   DESKTOP SHELL (ASM / Super Admin)
   ============================================================ */
.shell-desktop { display: grid; grid-template-columns: 262px 1fr; min-height: 100dvh; }
@media (max-width: 980px) { .shell-desktop { grid-template-columns: 1fr; } .sidebar { display: none; } .sidebar.mobile-open { display: flex; position: fixed; inset: 0 28% 0 0; z-index: 150; box-shadow: var(--shadow-lg); } }

.sidebar {
  display: flex; flex-direction: column;
  padding: 22px 16px;
  border-right: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  position: sticky; top: 0; height: 100dvh;
  overflow-y: auto;
}
.sb-logo { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
.sb-logo img { width: 38px; border-radius: 10px; background: #fff; padding: 4px; box-shadow: var(--shadow-sm); }
.sb-logo .t1 { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; line-height: 1.15; }
.sb-logo .t2 { font-size: 10.5px; color: var(--ink-faint); letter-spacing: 0.12em; text-transform: uppercase; }

.side-nav { position: relative; display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.nav-section { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); padding: 14px 12px 6px; }
.nav-ind {
  position: absolute; left: 0; width: 100%;
  height: 42px; border-radius: 12px;
  background: var(--brand-grad);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--ma-blue) 38%, transparent);
  transition: transform 0.32s var(--ease), opacity 0.2s;
  z-index: 0;
  opacity: 0;
}
.nav-item {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 11px;
  padding: 10.5px 12px;
  height: 42px;
  border-radius: 12px;
  color: var(--ink-soft);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  border: none; background: transparent;
  font-family: var(--font-body);
  text-align: left;
  width: 100%;
  transition: color 0.25s var(--ease), background var(--speed);
}
.nav-item:hover:not(.active) { background: color-mix(in srgb, var(--ma-blue) 7%, transparent); color: var(--ink); }
.nav-item.active { color: #fff; }
.nav-item .badge-n {
  margin-left: auto;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--ma-green) 18%, transparent);
  color: var(--ma-green-deep);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.nav-item.active .badge-n { background: rgba(255,255,255,0.22); color: #fff; }
.sb-foot { margin-top: auto; padding-top: 16px; }
.sb-user {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
}
.avatar {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
  background: var(--brand-grad);
}
.avatar.green { background: var(--green-grad); }
.avatar.navy { background: linear-gradient(135deg, var(--ma-navy), var(--ma-blue-deep)); }
.sb-user .u-name { font-size: 13px; font-weight: 700; line-height: 1.2; }
.sb-user .u-role { font-size: 11px; color: var(--ink-faint); }

.main-col { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 14px;
  padding: 13px 26px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
}
.topbar .tb-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.topbar .tb-sub { font-size: 12px; color: var(--ink-faint); }
.tb-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.tb-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--speed), border-color var(--speed), color var(--speed), background var(--speed);
}
.tb-btn:hover { transform: translateY(-1px); border-color: var(--border-strong); color: var(--ink); }
.tb-btn .n-dot {
  position: absolute; top: -4px; right: -4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 99px;
  background: var(--green-grad);
  color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.burger { display: none; }
@media (max-width: 980px) { .burger { display: flex; } }

.content { padding: 26px; display: flex; flex-direction: column; gap: 18px; max-width: 1460px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; font-weight: 700; }
.page-head .ph-sub { color: var(--ink-soft); font-size: 13.5px; margin-top: 3px; }

/* user dropdown menu */
.umenu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 230px;
  border-radius: var(--r-lg);
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  padding: 7px;
  z-index: 160;
  transform-origin: top right;
  animation: pop-in 0.2s var(--ease);
}
@keyframes pop-in { from { opacity: 0; transform: scale(0.94) translateY(-5px); } to { opacity: 1; transform: none; } }
.umenu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  border: none; background: transparent;
  color: var(--ink); font-size: 13.5px; font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background var(--speed);
  text-align: left;
}
.umenu-item:hover { background: color-mix(in srgb, var(--ma-blue) 9%, transparent); }
.umenu-item.danger { color: var(--err); }
.umenu-item.danger:hover { background: color-mix(in srgb, var(--err) 9%, transparent); }
.umenu-sep { height: 1px; background: var(--border); margin: 6px 8px; }

/* ============================================================
   MOBILE SHELL (Sales)
   ============================================================ */
.shell-mobile {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  position: relative;
  background: var(--bg);
  background-image: var(--bg-grad);
}
@media (min-width: 540px) {
  .shell-mobile {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }
}
.m-topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 11px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
}
.m-topbar .mt-title { font-family: var(--font-display); font-weight: 700; font-size: 16.5px; flex: 1; }
.m-content { flex: 1; padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 15px; }

/* offline pill */
.net-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700;
  padding: 5px 10px; border-radius: 99px;
  background: color-mix(in srgb, var(--ma-green) 14%, transparent);
  color: var(--ma-green-deep);
  border: 1px solid color-mix(in srgb, var(--ma-green) 32%, transparent);
  cursor: pointer;
  transition: all var(--speed);
}
html.dark .net-pill { color: var(--ma-green-bright); }
.net-pill.off { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); border-color: color-mix(in srgb, var(--err) 30%, transparent); }
.net-pill .pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.8); } }
.net-pill .pulse { animation: pulse 1.8s infinite; }

/* Bottom nav — glass + fluid scoop indicator */
.bottomnav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  z-index: 120;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-top: 1px solid var(--glass-border);
}
.bn-ind {
  position: absolute;
  top: 6px;
  left: 10px;
  width: calc((100% - 20px) / 5);
  height: 52px;
  z-index: 0;
  pointer-events: none;
  transition: transform 0.34s var(--ease);
  transform: translateX(calc(var(--i, 0) * 100%));
  display: flex; align-items: flex-start; justify-content: center;
}
.bn-ind::before {
  content: "";
  width: 46px; height: 30px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--ma-blue) 14%, transparent);
  transition: opacity var(--speed);
}
.bn-ind.hidden::before { opacity: 0; }
.bn-item {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px 2px;
  border: none; background: transparent;
  color: var(--ink-faint);
  font-size: 10.5px; font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: color var(--speed), transform var(--speed);
  border-radius: 12px;
}
.bn-item:active { transform: scale(0.93); }
.bn-item.active { color: var(--ma-blue); }
html.dark .bn-item.active { color: var(--ma-blue-bright); }
.bn-fab {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  border: none;
  width: 56px; height: 56px;
  margin: -26px auto 0;
  border-radius: 19px;
  background: var(--green-grad);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--ma-green-deep) 45%, transparent), 0 2px 6px rgba(0,0,0,0.18);
  transition: transform var(--speed) var(--ease), box-shadow var(--speed);
}
.bn-fab:hover { transform: translateY(-3px) scale(1.04); }
.bn-fab:active { transform: scale(0.95); }
.bn-fab-label { font-size: 10.5px; font-weight: 700; color: var(--ma-green-deep); text-align: center; margin-top: 4px; }
html.dark .bn-fab-label { color: var(--ma-green-bright); }

/* ============================================================
   SALES — Home
   ============================================================ */
.hello-card {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl);
  padding: 22px;
  color: #fff;
  background: var(--brand-grad-duo);
  box-shadow: var(--shadow-md);
}
.hello-card::after {
  content: "";
  position: absolute; right: -40px; bottom: -60px;
  width: 190px; height: 190px;
  border-radius: 56px;
  transform: rotate(24deg);
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.14);
}
.hello-card .hc-date { font-size: 11.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.8; }
.hello-card h3 { font-size: 21px; margin-top: 4px; }
.hello-card .hc-team { font-size: 13px; opacity: 0.85; margin-top: 2px; }

.ring-row { display: flex; gap: 16px; align-items: center; margin-top: 18px; position: relative; z-index: 1; }
.ring-box { position: relative; width: 88px; height: 88px; flex-shrink: 0; }
.ring-box svg { transform: rotate(-90deg); }
.ring-box .ring-track { stroke: rgba(255,255,255,0.22); }
.ring-box .ring-val { stroke: var(--ma-green-bright); stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
.ring-box .ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-box .ring-center .rc-n { font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1; }
.ring-box .ring-center .rc-l { font-size: 9.5px; opacity: 0.8; }
.ring-meta { display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.ring-meta .rm-line { display: flex; gap: 8px; align-items: center; }
.ring-meta .rm-line b { font-family: var(--font-mono); font-weight: 600; }

.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-stat { padding: 14px 12px; border-radius: var(--r-lg); text-align: center; }
.quick-stat .qn { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--accent, var(--ma-blue)); }
.quick-stat .ql { font-size: 11px; color: var(--ink-soft); font-weight: 600; margin-top: 2px; }

.visit-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 0;
  border-bottom: 1px dashed var(--border);
}
.visit-item:last-child { border-bottom: none; padding-bottom: 2px; }
.visit-item .vi-ico {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--st, var(--ma-blue)) 12%, transparent);
  color: var(--st, var(--ma-blue));
}
.visit-item .vi-name { font-weight: 700; font-size: 13.5px; }
.visit-item .vi-meta { font-size: 11.5px; color: var(--ink-faint); margin-top: 1px; }

/* ============================================================
   SALES — Canvassing Form
   ============================================================ */
.timer-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  padding: 5px 11px; border-radius: 99px;
  background: color-mix(in srgb, var(--ma-green) 13%, transparent);
  color: var(--ma-green-deep);
  border: 1px solid color-mix(in srgb, var(--ma-green) 30%, transparent);
}
html.dark .timer-chip { color: var(--ma-green-bright); }
.timer-chip.over { background: color-mix(in srgb, var(--warn) 13%, transparent); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 32%, transparent); }

.form-section { border-radius: var(--r-lg); }
.form-section .fs-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.form-section .fs-num {
  width: 26px; height: 26px; border-radius: 9px; flex-shrink: 0;
  background: var(--brand-grad);
  color: #fff; font-size: 12.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.form-section .fs-head h4 { font-size: 14.5px; }
.form-section .fs-head .fs-sub { font-size: 11.5px; color: var(--ink-faint); }

/* GPS panel */
.gps-panel {
  border-radius: var(--r-lg);
  border: 1.5px solid color-mix(in srgb, var(--gps-c, var(--ma-blue)) 35%, transparent);
  background: color-mix(in srgb, var(--gps-c, var(--ma-blue)) 6%, transparent);
  padding: 15px;
  transition: border-color 0.4s, background 0.4s;
}
.gps-panel.good { --gps-c: var(--ma-green-deep); }
.gps-panel.bad { --gps-c: var(--err); }
.gps-row { display: flex; align-items: center; gap: 12px; }
.gps-icon {
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--gps-c, var(--ma-blue)) 14%, transparent);
  color: var(--gps-c, var(--ma-blue));
}
@keyframes radar { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gps-c, var(--ma-blue)) 38%, transparent); } 100% { box-shadow: 0 0 0 16px transparent; } }
.gps-panel.locking .gps-icon { animation: radar 1.3s infinite; }
.gps-title { font-size: 13.5px; font-weight: 700; }
.gps-coords { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); }
.acc-meter { margin-top: 13px; }
.acc-meter .am-bar {
  height: 7px; border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
  position: relative;
}
.acc-meter .am-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--ma-green), var(--ma-green-deep));
  transition: width 0.45s var(--ease), background 0.3s;
}
.acc-meter.bad .am-fill { background: linear-gradient(90deg, #e58c3c, var(--err)); }
.acc-meter .am-row { display: flex; justify-content: space-between; font-size: 11.5px; margin-top: 5px; color: var(--ink-soft); }
.acc-meter .am-row b { font-family: var(--font-mono); }
.sim-slider { width: 100%; accent-color: var(--ma-blue); margin-top: 8px; }

/* photo uploader */
.photo-drop {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--speed), background var(--speed), transform var(--speed);
  background: var(--surface-2);
}
.photo-drop:hover { border-color: var(--ma-blue); background: color-mix(in srgb, var(--ma-blue) 5%, var(--surface-2)); transform: translateY(-1px); }
.photo-drop .pd-ico {
  width: 48px; height: 48px; margin: 0 auto 10px;
  border-radius: 15px;
  background: var(--brand-grad);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
}
.photo-preview { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); }
.photo-preview img { width: 100%; height: 190px; object-fit: cover; }
.photo-preview .pp-meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 10px 13px;
  background: linear-gradient(transparent, rgba(7, 16, 40, 0.82));
  color: #fff; font-size: 11.5px;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.pp-remove {
  position: absolute; top: 9px; right: 9px;
  width: 30px; height: 30px; border-radius: 10px;
  border: none; cursor: pointer;
  background: rgba(7, 16, 40, 0.55);
  backdrop-filter: blur(8px);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--speed);
}
.pp-remove:hover { background: rgba(207, 52, 52, 0.85); }
.compress-tag {
  display: inline-flex; gap: 5px; align-items: center;
  background: color-mix(in srgb, var(--ma-green) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--ma-green) 45%, transparent);
  padding: 2.5px 8px; border-radius: 99px;
  font-size: 10.5px; font-weight: 700;
}

/* sticky save bar */
.save-bar {
  position: sticky; bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 90;
  border-radius: var(--r-lg);
  padding: 12px;
  display: flex; gap: 10px; align-items: center;
  box-shadow: var(--shadow-md);
}
.save-bar .sb-note { font-size: 11px; color: var(--ink-soft); line-height: 1.4; flex: 1; }
.save-bar .sb-note b { color: var(--err); }

/* ============================================================
   KANBAN
   ============================================================ */
.kanban-wrap { overflow-x: auto; padding-bottom: 10px; }
.kanban { display: grid; grid-template-columns: repeat(5, minmax(252px, 1fr)); gap: 13px; min-width: 1330px; align-items: start; }
.shell-mobile .kanban { min-width: unset; grid-template-columns: 1fr; }
.shell-mobile .kanban-wrap { overflow: visible; }
.kcol {
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--st) 5%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--st) 16%, var(--border));
  display: flex; flex-direction: column;
  max-height: calc(100dvh - 240px);
  min-height: 180px;
}
.shell-mobile .kcol { max-height: none; }
.kcol-head {
  display: flex; align-items: center; gap: 9px;
  padding: 13px 14px 11px;
  border-bottom: 1px solid color-mix(in srgb, var(--st) 14%, var(--border));
  position: relative;
}
.kcol-head::before {
  content: "";
  position: absolute; top: 0; left: 14px; right: 14px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--st);
}
.kcol-head .kc-name { font-size: 12.5px; font-weight: 800; letter-spacing: 0.04em; color: var(--st); }
.kcol-head .kc-count {
  margin-left: auto;
  min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--st) 14%, transparent);
  color: var(--st);
  font-size: 11.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.kcol-body { padding: 11px; display: flex; flex-direction: column; gap: 9px; overflow-y: auto; flex: 1; min-height: 70px; }
.kcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 13px;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  transition: transform var(--speed) var(--ease), box-shadow var(--speed), border-color var(--speed);
}
.kcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--ma-blue) 35%, var(--border)); }
.kcard:active { cursor: grabbing; }
.kcard .kc-company { font-weight: 700; font-size: 13.5px; line-height: 1.3; }
.kcard .kc-needs { font-size: 12px; color: var(--ink-soft); margin-top: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kcard .kc-foot { display: flex; align-items: center; gap: 7px; margin-top: 10px; flex-wrap: wrap; }
.kcard .kc-tag { font-size: 10.5px; font-weight: 600; color: var(--ink-faint); display: inline-flex; align-items: center; gap: 4px; }
.kcard .kc-reason {
  margin-top: 8px; font-size: 11.5px;
  color: var(--err);
  background: color-mix(in srgb, var(--err) 8%, transparent);
  border-left: 2.5px solid var(--err);
  padding: 6px 9px; border-radius: 7px;
}
.kcard.sortable-ghost { opacity: 0.45; border: 1.5px dashed var(--ma-blue); background: color-mix(in srgb, var(--ma-blue) 7%, var(--surface)); }
.kcard.sortable-drag { box-shadow: var(--shadow-lg); transform: rotate(2.5deg); }
.kcol-empty { text-align: center; font-size: 12px; color: var(--ink-faint); padding: 18px 8px; border: 1.5px dashed var(--border); border-radius: var(--r-md); }

/* ============================================================
   MAP
   ============================================================ */
.map-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
@media (max-width: 1080px) { .map-layout { grid-template-columns: 1fr; } }
.map-box { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
#leaflet-map { height: calc(100dvh - 300px); min-height: 430px; width: 100%; background: var(--surface-2); }
html.dark .leaflet-tile { filter: invert(1) hue-rotate(195deg) brightness(0.92) contrast(0.9) saturate(0.7); }
html.dark .leaflet-container { background: #0d1730; }
.leaflet-popup-content-wrapper {
  border-radius: 14px !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid var(--border);
}
.leaflet-popup-tip { background: var(--surface) !important; }
.map-pop { font-family: var(--font-body); min-width: 215px; }
.map-pop .mp-company { font-weight: 800; font-size: 14px; font-family: var(--font-display); }
.map-pop .mp-row { display: flex; gap: 7px; align-items: flex-start; font-size: 12px; margin-top: 6px; color: var(--ink-soft); }
.map-pop .mp-row svg { margin-top: 1.5px; color: var(--ink-faint); }
.map-pop .btn { margin-top: 11px; }
.map-side { display: flex; flex-direction: column; gap: 13px; }
.cover-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 8.5px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.cover-row:last-child { border: none; }
.cover-row .cr-bar { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-3); margin: 0 4px; overflow: hidden; }
.cover-row .cr-fill { height: 100%; border-radius: 99px; background: var(--brand-grad); }
.cover-row b { font-family: var(--font-mono); font-size: 12.5px; }
.marker-pin {
  width: 30px; height: 30px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  background: var(--pin, var(--ma-blue));
  border: 2.5px solid #fff;
  box-shadow: 0 3px 9px rgba(7, 16, 40, 0.4);
  display: flex; align-items: center; justify-content: center;
}
.marker-pin svg { transform: rotate(45deg); color: #fff; }
.marker-cluster-mna {
  background: color-mix(in srgb, var(--ma-blue) 24%, transparent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.marker-cluster-mna > div {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand-grad);
  color: #fff; font-weight: 800; font-size: 12.5px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  border: 2px solid rgba(255,255,255,0.85);
}

/* ============================================================
   PIVOT
   ============================================================ */
.pivot-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.pivot-bar .pb-label { font-size: 12px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.07em; }
.pv-row-group { cursor: pointer; user-select: none; }
.pv-row-group td { background: color-mix(in srgb, var(--ma-blue) calc(9% - var(--lvl, 0) * 2%), var(--surface)); font-weight: 700; }
.pv-caret { display: inline-flex; transition: transform var(--speed); margin-right: 7px; color: var(--ink-faint); vertical-align: -3px; }
.pv-row-group.open .pv-caret { transform: rotate(90deg); }
.pv-indent { display: inline-block; }
.pv-agg { font-family: var(--font-mono); font-size: 12px; }

/* ============================================================
   CHARTS / DASHBOARD widgets
   ============================================================ */
.chart-box { position: relative; height: 320px; }
.funnel-row { display: flex; align-items: center; gap: 11px; padding: 7px 0; }
.funnel-row .fr-label { width: 110px; font-size: 12px; font-weight: 700; color: var(--st); flex-shrink: 0; }
.funnel-row .fr-track { flex: 1; height: 26px; background: var(--surface-2); border-radius: 9px; overflow: hidden; }
.funnel-row .fr-fill {
  height: 100%;
  border-radius: 9px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--st) 75%, transparent), var(--st));
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 9px;
  color: #fff; font-size: 11.5px; font-weight: 800;
  min-width: 30px;
  transition: width 0.8s var(--ease);
}
.reason-item { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.reason-item:last-child { border: none; }
.reason-item .ri-n {
  font-family: var(--font-mono); font-weight: 600;
  background: color-mix(in srgb, var(--err) 10%, transparent);
  color: var(--err);
  padding: 1px 9px; border-radius: 7px; font-size: 12px;
  height: fit-content;
}

/* progress bar mini */
.mini-prog { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; min-width: 70px; }
.mini-prog .mp-fill { height: 100%; border-radius: 99px; background: var(--green-grad); transition: width 0.7s var(--ease); }
.mini-prog .mp-fill.low { background: linear-gradient(90deg, #e58c3c, var(--warn)); }

/* ============================================================
   QUEUE (offline drafts)
   ============================================================ */
.queue-item { display: flex; gap: 12px; align-items: center; }
.queue-item .qi-thumb {
  width: 52px; height: 52px; border-radius: 13px; flex-shrink: 0;
  object-fit: cover; border: 1px solid var(--border);
}
.queue-item .qi-status { margin-left: auto; }
@keyframes sync-rotate { to { transform: rotate(360deg); } }
.syncing-ico { animation: sync-rotate 1s linear infinite; display: inline-flex; }

/* ============================================================
   COVERAGE & FLOWS
   ============================================================ */
.cov-epic-head {
  display: flex; align-items: center; gap: 11px;
  padding: 16px 2px 9px;
}
.cov-epic-head .ce-tag {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  background: var(--brand-grad); color: #fff;
  padding: 3px 9px; border-radius: 7px;
}
.cov-epic-head h3 { font-size: 15.5px; }
.cov-badge-ui { background: color-mix(in srgb, var(--ma-green) 14%, transparent); color: var(--ma-green-deep); border: 1px solid color-mix(in srgb, var(--ma-green) 32%, transparent); }
html.dark .cov-badge-ui { color: var(--ma-green-bright); }
.cov-badge-anno { background: color-mix(in srgb, var(--ma-blue) 10%, transparent); color: var(--ma-blue); border: 1px solid color-mix(in srgb, var(--ma-blue) 28%, transparent); }
html.dark .cov-badge-anno { color: var(--ma-blue-bright); }
.cov-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap; }

.flow-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1080px) { .flow-grid { grid-template-columns: 1fr; } }
.flow-col-head {
  display: flex; align-items: center; gap: 11px;
  padding: 16px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  color: #fff;
}
.flow-col-head h3 { font-size: 16px; }
.flow-col-head .fch-sub { font-size: 12px; opacity: 0.82; }
.flow-body { padding: 18px 16px; display: flex; flex-direction: column; }
.flow-node {
  position: relative;
  display: flex; gap: 12px;
  padding-bottom: 22px;
}
.flow-node::before {
  content: "";
  position: absolute; left: 14px; top: 32px; bottom: 2px;
  width: 2px;
  background: linear-gradient(var(--border-strong) 60%, transparent);
}
.flow-node:last-child::before { display: none; }
.flow-node .fn-dot {
  width: 29px; height: 29px; border-radius: 10px; flex-shrink: 0;
  background: var(--fn-bg, var(--brand-grad));
  color: #fff; font-size: 12.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  box-shadow: var(--shadow-sm);
  z-index: 1;
}
.flow-node .fn-title { font-size: 13.5px; font-weight: 700; line-height: 1.35; }
.flow-node .fn-desc { font-size: 12px; color: var(--ink-soft); margin-top: 3px; line-height: 1.5; }
.flow-node .fn-fid { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-faint); margin-top: 5px; display: flex; gap: 6px; flex-wrap: wrap; }
.flow-node .fn-fid span { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; }
.flow-branch {
  margin: 2px 0 14px 41px;
  border-left: 2px dashed color-mix(in srgb, var(--warn) 55%, transparent);
  padding: 8px 12px;
  background: color-mix(in srgb, var(--warn) 6%, transparent);
  border-radius: 0 11px 11px 0;
  font-size: 12px; color: var(--ink-soft);
}
.flow-branch b { color: var(--warn); }

/* ============================================================
   MISC
   ============================================================ */
.empty-state { text-align: center; padding: 38px 18px; }
.empty-state .es-ico {
  width: 60px; height: 60px; margin: 0 auto 14px;
  border-radius: 19px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint);
}
.empty-state h4 { font-size: 15.5px; }
.empty-state p { font-size: 13px; color: var(--ink-soft); margin-top: 5px; }

.forbidden-wrap { min-height: 70dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.forbidden-card { max-width: 430px; text-align: center; padding: 40px 32px; }
.forbidden-card .fc-ico {
  width: 72px; height: 72px; margin: 0 auto 18px;
  border-radius: 23px;
  background: color-mix(in srgb, var(--err) 11%, transparent);
  color: var(--err);
  display: flex; align-items: center; justify-content: center;
}
.forbidden-card h2 { font-size: 21px; }
.forbidden-card .code { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); letter-spacing: 0.2em; margin-bottom: 6px; }

.anno-note {
  display: flex; gap: 10px;
  font-size: 12.5px; color: var(--ink-soft);
  background: color-mix(in srgb, var(--ma-blue) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--ma-blue) 18%, transparent);
  border-radius: var(--r-md);
  padding: 11px 13px;
  line-height: 1.55;
}
.anno-note svg { color: var(--ma-blue); flex-shrink: 0; margin-top: 2px; }
.anno-note code { font-family: var(--font-mono); font-size: 11.5px; background: var(--surface-2); padding: 0.5px 5px; border-radius: 5px; border: 1px solid var(--border); }

.photo-modal-img { width: 100%; border-radius: var(--r-md); border: 1px solid var(--border); }

/* entry animation for views */
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.view-anim > * { animation: view-in 0.4s var(--ease) backwards; }
.view-anim > *:nth-child(1) { animation-delay: 0.02s; }
.view-anim > *:nth-child(2) { animation-delay: 0.07s; }
.view-anim > *:nth-child(3) { animation-delay: 0.12s; }
.view-anim > *:nth-child(4) { animation-delay: 0.17s; }
.view-anim > *:nth-child(5) { animation-delay: 0.22s; }
.view-anim > *:nth-child(6) { animation-delay: 0.27s; }

/* print friendly-ish */
@media print { .sidebar, .topbar, .bottomnav, .toast-stack { display: none !important; } }
