/* Connect Japan CRM – shared UI styles */
:root {
  --bg: #f7f4ef;
  --surface: #ffffff;
  --border: #e8e3d9;
  --border-strong: #d8d1c3;
  --text: #1b1f36;
  --muted: #697089;
  --primary: #4f46e5;
  --primary-600: #4338ca;
  --primary-soft: #eef0ff;
  --side: #1a2a5e;
  --side-hover: #2a3c78;
  --success: #12a150;
  --success-soft: #e3f7ec;
  --warn: #c77a05;
  --warn-soft: #fff3da;
  --danger: #d93a3a;
  --danger-soft: #fde8e8;
  --info: #0b7fc0;
  --info-soft: #e2f3fc;
  --violet: #7c3aed;
  --violet-soft: #f0e8fe;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 24, 60, .05), 0 4px 14px rgba(20, 24, 60, .04);
  --sidebar-w: 72px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Bengali", "Noto Sans JP", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400' viewBox='0 0 400 400'><g transform='translate(90 80)' opacity='0.14'><g fill='%23f3b8c7'><path d='M0 0 C 7 -4 11 -14 0 -22 C -11 -14 -7 -4 0 0 Z'/><path transform='rotate(72)' d='M0 0 C 7 -4 11 -14 0 -22 C -11 -14 -7 -4 0 0 Z'/><path transform='rotate(144)' d='M0 0 C 7 -4 11 -14 0 -22 C -11 -14 -7 -4 0 0 Z'/><path transform='rotate(216)' d='M0 0 C 7 -4 11 -14 0 -22 C -11 -14 -7 -4 0 0 Z'/><path transform='rotate(288)' d='M0 0 C 7 -4 11 -14 0 -22 C -11 -14 -7 -4 0 0 Z'/></g><circle r='2.5' fill='%23f7c88a'/></g><g transform='translate(310 180) rotate(20)' opacity='0.12'><g fill='%23f3b8c7'><path d='M0 0 C 7 -4 11 -14 0 -22 C -11 -14 -7 -4 0 0 Z'/><path transform='rotate(72)' d='M0 0 C 7 -4 11 -14 0 -22 C -11 -14 -7 -4 0 0 Z'/><path transform='rotate(144)' d='M0 0 C 7 -4 11 -14 0 -22 C -11 -14 -7 -4 0 0 Z'/><path transform='rotate(216)' d='M0 0 C 7 -4 11 -14 0 -22 C -11 -14 -7 -4 0 0 Z'/><path transform='rotate(288)' d='M0 0 C 7 -4 11 -14 0 -22 C -11 -14 -7 -4 0 0 Z'/></g><circle r='2.5' fill='%23f7c88a'/></g><g transform='translate(150 320) rotate(-30)' opacity='0.14'><g fill='%23f3b8c7'><path d='M0 0 C 7 -4 11 -14 0 -22 C -11 -14 -7 -4 0 0 Z'/><path transform='rotate(72)' d='M0 0 C 7 -4 11 -14 0 -22 C -11 -14 -7 -4 0 0 Z'/><path transform='rotate(144)' d='M0 0 C 7 -4 11 -14 0 -22 C -11 -14 -7 -4 0 0 Z'/><path transform='rotate(216)' d='M0 0 C 7 -4 11 -14 0 -22 C -11 -14 -7 -4 0 0 Z'/><path transform='rotate(288)' d='M0 0 C 7 -4 11 -14 0 -22 C -11 -14 -7 -4 0 0 Z'/></g><circle r='2.5' fill='%23f7c88a'/></g><g fill='%23f3b8c7'><path opacity='0.12' transform='translate(240 60) rotate(45)' d='M0 0 C 8 8 10 24 0 40 C -10 24 -8 8 0 0 Z'/><path opacity='0.10' transform='translate(40 220) rotate(110)' d='M0 0 C 8 8 10 24 0 40 C -10 24 -8 8 0 0 Z'/><path opacity='0.12' transform='translate(360 350) rotate(-15)' d='M0 0 C 8 8 10 24 0 40 C -10 24 -8 8 0 0 Z'/></g><g fill='%23aed0b6'><path opacity='0.12' transform='translate(200 150) rotate(-20)' d='M0 0 Q 18 -12 32 2 Q 14 18 0 0 Z'/><path opacity='0.10' transform='translate(60 360) rotate(40)' d='M0 0 Q 18 -12 32 2 Q 14 18 0 0 Z'/></g></svg>");
  background-repeat: repeat;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 800; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Sidebar (icon only) ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--side);
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 0;
  z-index: 50;
}
.brand {
  width: 42px; height: 42px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border);
  display: grid; place-items: center;
  margin-bottom: 22px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
  overflow: hidden;
}
.brand img { display: block; width: 30px; height: 30px; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  position: relative;
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  color: #aebbe3; background: transparent; border: 0; cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-item svg.i { width: 22px; height: 22px; }
.nav-item:hover { background: var(--side-hover); color: #fff; }
.nav-item.active { background: #d2123f; color: #fff; box-shadow: 0 6px 14px rgba(210, 18, 63, .45); }
.nav-item[data-tip]::after {
  content: attr(data-tip);
  position: absolute; left: calc(100% + 12px); top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: #0a0c1c; color: #fff; font-size: 12px; font-weight: 600;
  padding: 5px 10px; border-radius: 8px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s;
}
.nav-item[data-tip]:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }
.nav-badge {
  position: absolute; top: 6px; right: 6px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: #f43f5e; color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
}
.sidebar-bottom { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid #34478a; width: 46px; }
.profile { position: relative; }
.avatar-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 2px solid #4a5fa8; background: #fff;
  color: #1a2a5e; font-weight: 700; font-size: 14px; cursor: pointer;
  display: grid; place-items: center; position: relative;
}
.avatar-btn::after {
  content: ""; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px;
  background: #22c55e; border: 2px solid var(--side); border-radius: 50%;
}
.avatar-btn:hover { border-color: #818cf8; }
.popover {
  position: absolute; left: calc(100% + 14px); bottom: 0; width: 240px;
  background: #fff; color: var(--text); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(10, 12, 40, .3);
  border: 1px solid var(--border);
  padding: 8px; display: none;
}
.popover.open { display: block; }
.popover .who { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.popover .who b { display: block; font-size: 13.5px; }
.popover .who small { color: var(--muted); font-size: 12px; }
.popover .who .av { background: #1a2a5e !important; color: #fff; }
.popover a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-weight: 500; color: #2b3050; }
.popover a:hover { background: var(--bg); }
.popover a.danger { color: var(--danger); }
.popover a.danger:hover { background: var(--danger-soft); }

/* ---------- Layout ---------- */
.main { margin-left: var(--sidebar-w); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 64px; padding: 0 28px;
  background: rgba(247, 244, 239, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
}
.topbar .title h1 { font-size: 18px; font-weight: 800; }
.topbar .title small { color: var(--muted); font-size: 12px; }
.topbar .spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 0 12px; height: 38px; color: var(--muted); min-width: 280px;
}
.search input { border: 0; outline: 0; background: transparent; flex: 1; color: var(--text); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); display: grid; place-items: center; cursor: pointer; color: #454b68; position: relative;
}
.icon-btn:hover { background: var(--primary-soft); color: var(--primary); }
.icon-btn.edit { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 30%, transparent); background: var(--primary-soft); }
.icon-btn.edit:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.icon-btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); background: var(--danger-soft); }
.icon-btn.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.sm .i { width: 15px; height: 15px; }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; background: #f43f5e; border-radius: 50%; border: 2px solid #fff; }
.content { padding: 24px 28px 48px; max-width: 1480px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; font-weight: 800; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.crumbs a:hover { color: var(--primary); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  height: 38px; padding: 0 16px; border-radius: 10px; font-weight: 600; font-size: 13.5px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(79, 70, 229, .3); }
.btn.primary:hover { background: var(--primary-600); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-h h3 { font-size: 15px; font-weight: 800; }
.card-h small { color: var(--muted); }
.card-b { padding: 20px; }
.grid { display: grid; gap: 18px; }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-main-r { grid-template-columns: minmax(0, 1fr) 340px; }
.g-side-l { grid-template-columns: 330px minmax(0, 1fr); }
.g-lead { grid-template-columns: minmax(0, 1fr) 480px; }
@media (max-width: 1200px) { .g-lead { grid-template-columns: minmax(0, 1fr); } }
.g-lead-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .g-lead-split { grid-template-columns: minmax(0, 1fr); } }
.mt { margin-top: 18px; }

.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.stat .lbl { color: var(--muted); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; padding-right: 42px; }
.stat .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; position: absolute; top: 16px; right: 16px; }
.stat .val { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.stat .delta { font-size: 12.5px; color: var(--muted); }
.stat .delta b { color: var(--success); }
.stat .delta b.down { color: var(--danger); }
.tone-primary { background: var(--primary-soft); color: var(--primary); }
.tone-success { background: var(--success-soft); color: var(--success); }
.tone-warn { background: var(--warn-soft); color: var(--warn); }
.tone-info { background: var(--info-soft); color: var(--info); }
.tone-violet { background: var(--violet-soft); color: var(--violet); }
.tone-danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-new { background: var(--info-soft); color: var(--info); }
.b-contacted { background: var(--violet-soft); color: var(--violet); }
.b-followup { background: #fff4d6; color: #8a6d0f; }
.b-counselling, .b-consultation { background: var(--warn-soft); color: var(--warn); }
.b-applied, .b-processing { background: var(--primary-soft); color: var(--primary); }
.b-offer, .b-interested { background: #dcf5f1; color: #0f8f7e; }
.b-enrolled, .b-active { background: var(--success-soft); color: var(--success); }
.b-lost, .b-dropped, .b-closed { background: var(--danger-soft); color: var(--danger); }
.b-hold { background: #eceef5; color: #5b6180; }
.b-done { background: #e8ecf4; color: #3f4766; }
.b-running { background: var(--success-soft); color: var(--success); }
.b-open { background: var(--info-soft); color: var(--info); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 7px; font-size: 12px; font-weight: 600; background: #eef0f7; color: #444b69; }
.chip.jp { background: #ffe9ec; color: #c8203b; }
.chip.en { background: var(--info-soft); color: var(--info); }
.chip.temp-hot { background: #ffe4e4; color: #d93025; }
.chip.temp-warm { background: #fff4d6; color: #b45309; }
.chip.temp-cold { background: #e0f2fe; color: #0369a1; }

/* ---------- Avatars ---------- */
.av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: #fff; flex: none; }
.av.lg { width: 72px; height: 72px; font-size: 24px; }
.av.sm { width: 28px; height: 28px; font-size: 11px; }
.av1 { background: #6366f1; } .av2 { background: #0ea5e9; } .av3 { background: #14b8a6; }
.av4 { background: #f59e0b; } .av5 { background: #ec4899; } .av6 { background: #8b5cf6; } .av7 { background: #ef4444; }
.person { display: flex; align-items: center; gap: 12px; }
.person b { display: block; font-weight: 600; }
.person small { color: var(--muted); font-size: 12px; }
a.person:hover b { text-decoration: underline; color: var(--primary); }

/* ---------- Tables ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar-sub { padding-top: 10px; padding-bottom: 10px; background: var(--bg); gap: 12px; }
.date-filter { position: relative; display: inline-block; }
.date-filter .df-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: 10px;
  background: #fff; color: var(--text); font-size: 13px; font-weight: 500;
  cursor: pointer; min-width: 180px; justify-content: space-between;
  transition: border-color .12s, box-shadow .12s;
}
.date-filter .df-trigger:hover { border-color: var(--primary); }
.date-filter.open .df-trigger { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
.date-filter .df-trigger .df-label.is-placeholder { color: var(--muted); font-weight: 400; }
.date-filter .df-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  min-width: 280px; padding: 12px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
  display: none;
}
.date-filter.open .df-panel { display: block; }
.df-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.df-preset {
  height: 30px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); font-size: 12px; font-weight: 500;
  cursor: pointer; text-align: center;
  transition: background .12s, border-color .12s, color .12s;
}
.df-preset:hover { border-color: var(--primary); color: var(--primary); }
.df-preset.active { background: color-mix(in srgb, var(--primary) 12%, transparent); border-color: var(--primary); color: var(--primary); }
.df-custom {
  display: grid; grid-template-columns: auto 1fr; gap: 8px 10px;
  align-items: center; padding-top: 10px; border-top: 1px solid var(--border);
}
.df-custom label { font-size: 12px; color: var(--muted); font-weight: 600; }
.df-custom input[type="date"] {
  height: 34px; padding: 0 10px; border: 1px solid var(--border-strong);
  border-radius: 8px; font-size: 13px; background: #fff; width: 100%;
}
.df-clear {
  margin-top: 10px; width: 100%; height: 32px;
  border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--muted); font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: color .12s, border-color .12s;
}
.df-clear:hover { color: var(--danger); border-color: var(--danger); }
.toolbar .search { min-width: 260px; background: var(--bg); }
.select, .input, .textarea {
  height: 38px; border: 1px solid var(--border-strong); border-radius: 10px; background: #fff; padding: 0 12px; outline: none; width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
.date-field { position: relative; display: block; width: 100%; }
.date-field > .input { padding-right: 34px; }
.date-field-btn {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 26px; height: 26px; display: inline-grid; place-items: center;
  background: transparent; border: 0; color: var(--muted); cursor: pointer; border-radius: 6px;
}
.date-field-btn:hover { color: var(--primary); background: #f3f4f6; }
.date-field-native {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; opacity: 0; pointer-events: none; padding: 0; border: 0;
}
.toolbar .select { width: auto; min-width: 140px; }
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 90px; }
.select:focus, .input:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 12px 16px; background: #faf8f4; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
tbody tr:hover { background: #fafbff; }
tbody tr:last-child td { border-bottom: 0; }
td small, .muted { color: var(--muted); }
td small { display: block; font-size: 12px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 16px; height: 16px; cursor: pointer; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; flex-wrap: wrap; gap: 10px; }
.pager-info { display: inline-flex; align-items: center; gap: 6px; }
.pager-size { height: 28px; padding: 0 24px 0 8px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%235b6180' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: right 6px center; }
.pages { display: flex; gap: 4px; }
.pages button { min-width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-weight: 600; }
.pages button.on { background: var(--primary); color: #fff; border-color: var(--primary); }

.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-tabs button,
.pill-tabs a {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center;
}
.pill-tabs button b,
.pill-tabs a b { margin-left: 6px; font-weight: 700; color: var(--text); }
.pill-tabs button.on,
.pill-tabs a.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.pill-tabs button.on b,
.pill-tabs a.on b { color: #fff; }

.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); padding: 0 20px; }
.tabs button { background: none; border: 0; padding: 14px 2px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--primary); border-color: var(--primary); }
.panel { display: none; }
.panel.on { display: block; }

/* ---------- Progress ---------- */
.bar { height: 8px; background: #eceef6; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.bar.green > i { background: var(--success); }
.bar.amber > i { background: #f59e0b; }
.prog { display: flex; align-items: center; gap: 10px; min-width: 130px; }
.prog .bar { flex: 1; }
.prog span { font-size: 12px; font-weight: 600; color: var(--muted); min-width: 34px; text-align: right; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 18px; }
.form-grid[hidden] { display: none; }
.form-grid.c3 { grid-template-columns: repeat(3, 1fr); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: #333955; }
.field label .req { color: var(--danger); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.input-group { display: flex; }
.input-group .addon { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--border-strong); border-right: 0; background: var(--bg); border-radius: 10px 0 0 10px; color: var(--muted); font-weight: 600; }
.input-group .input { border-radius: 0 10px 10px 0; }
.input-group .addon-select { appearance: none; -webkit-appearance: none; padding: 0 28px 0 12px; border: 1px solid var(--border-strong); border-right: 0; background: var(--bg) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235b6180' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right 10px center; border-radius: 10px 0 0 10px; color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; }
.form-section { padding: 22px 24px; border-bottom: 1px solid var(--border); }
.form-section:last-child { border-bottom: 0; }
.sub-section { margin-top: 22px; padding: 18px 20px; background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 3%, #fff), #fff); border: 1px solid var(--border); border-radius: 12px; position: relative; }
.sub-section::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; background: var(--primary); border-radius: 0 3px 3px 0; opacity: .5; }
.sub-section h4 { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 14px; }
.form-section h3 { font-size: 15px; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.form-section h3 .num { width: 24px; height: 24px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 12px; display: grid; place-items: center; }
.form-section > p { margin: 0 0 16px 34px; color: var(--muted); font-size: 12.5px; }
.chips-select { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-select label { cursor: pointer; }
.chips-select input { display: none; }
.chips-select span { display: inline-block; padding: 7px 14px; border: 1px solid var(--border-strong); border-radius: 999px; font-weight: 600; font-size: 13px; background: #fff; color: #454b68; }
.chips-select input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.chips-group { display: flex; flex-direction: column; gap: 8px; }
.chips-group-label { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.chips-group-label:first-child { margin-top: 0; }
.multi-select { position: relative; }
.multi-select.filter-ms { min-width: 200px; max-width: 280px; }
.multi-select.filter-ms .multi-trigger { height: 38px; border-radius: 10px; }
.multi-trigger { width: 100%; height: 38px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fff; border: 1px solid var(--border-strong); border-radius: 8px; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.multi-trigger:hover { border-color: var(--primary); }
.multi-trigger .multi-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.multi-trigger .multi-label:empty::before { content: attr(data-placeholder); color: var(--muted); }
.multi-panel { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; max-height: 260px; overflow-y: auto; background: #fff; border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(16,24,40,.08); padding: 6px; }
.multi-select.open .multi-panel { display: block; }
.multi-panel label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.multi-panel label:hover { background: var(--primary-soft); }
.multi-panel input { margin: 0; }
.count-pill { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
.basic-filter { display: contents; }
.basic-slot { display: block; min-height: 38px; }
.modal-wrap { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; z-index: 100; padding: 32px 20px; overflow-y: auto; opacity: 0; transition: opacity .18s ease; }
.modal-wrap.on { display: flex; opacity: 1; }
.modal-wrap > .modal { background: #fff; border-radius: 14px; width: 100%; max-width: 720px; box-shadow: 0 1px 2px rgba(10, 12, 40, .08), 0 24px 48px -12px rgba(10, 12, 40, .35); border: 1px solid rgba(15, 23, 42, .06); overflow: hidden; display: flex; flex-direction: column; max-height: calc(100vh - 64px); transform: translateY(8px) scale(.985); opacity: 0; animation: modalIn .22s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes modalIn { to { transform: translateY(0) scale(1); opacity: 1; } }
.modal-wrap > .modal > .card-h { position: sticky; top: 0; background: #fff; z-index: 2; padding: 16px 22px; border-bottom: 1px solid var(--border); border-radius: 14px 14px 0 0; }
.modal-wrap > .modal > .card-h h3 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.modal-wrap > .modal > .card-h small { color: var(--muted); font-size: 12.5px; }
.modal-wrap > .modal > .card-b { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.modal-filters .multi-select.filter-ms { min-width: 0; max-width: none; width: 100%; }
.modal-filters .date-filter { display: block; width: 100%; }
.modal-filters .multi-trigger, .modal-filters .df-trigger { width: 100%; }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; padding: 14px 0 0; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(255,255,255,0), #fff 30%); }
@media (max-width: 640px) { .modal-filters { grid-template-columns: 1fr; } .modal-wrap { padding: 16px; } .modal-wrap > .modal { max-height: calc(100vh - 32px); } }
.user-picker { position: relative; }
.user-trigger { width: 100%; min-height: 38px; padding: 4px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fff; border: 1px solid var(--border-strong); border-radius: 8px; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.user-trigger:hover { border-color: var(--primary); }
.user-trigger-content { flex: 1; display: flex; align-items: center; min-width: 0; }
.user-panel { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; max-height: 300px; overflow-y: auto; background: #fff; border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(16,24,40,.08); padding: 4px; }
.user-picker.open .user-panel { display: block; }
.user-opt { display: block; cursor: pointer; border-radius: 6px; }
.user-opt input { position: absolute; opacity: 0; pointer-events: none; }
.user-opt:hover { background: var(--primary-soft); }
.user-opt input:checked ~ .user-row { background: var(--primary-soft); border-radius: 6px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; }
.user-row .avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; flex: none; }
.user-meta { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.2; }
.user-sub { font-size: 11.5px; color: var(--muted); line-height: 1.2; margin-top: 2px; }
.date-wrap { position: relative; display: block; }
.date-wrap > input[type="date"] { color: transparent; }
.date-wrap > input[type="date"]:focus { color: var(--text); }
.date-wrap > input[type="date"]::-webkit-datetime-edit { color: transparent; }
.date-wrap > input[type="date"]:focus::-webkit-datetime-edit { color: var(--text); }
.date-view { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); pointer-events: none; font-size: 13.5px; color: var(--text); background: #fff; padding: 0 2px; }
.date-view.ph { color: var(--muted); }
.date-wrap > input[type="date"]:focus + .date-view { display: none; }
.check-row { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text); }
.check-row input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; margin: 0; }
.form-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.form-section-head h3 { margin: 0; }
.switch-row { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text); }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider { position: absolute; inset: 0; background: #d1d5db; border-radius: 999px; transition: background .2s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(16px); }
.choice-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.choice-cards label { cursor: pointer; }
.choice-cards input { position: absolute; opacity: 0; }
.choice-cards .cc { border: 2px solid var(--border); border-radius: 14px; padding: 16px; display: flex; gap: 14px; align-items: center; background: #fff; transition: border-color .12s, background .12s; }
.choice-cards .cc .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 20px; }
.choice-cards .cc b { display: block; }
.choice-cards .cc small { color: var(--muted); }
.choice-cards input:checked + .cc { border-color: var(--primary); background: var(--primary-soft); }
.form-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; background: #faf8f4; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.lead-aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lead-aside .card-h { padding: 14px 18px; }
.lead-aside .card-h h3 { font-size: 14px; }
.lead-aside .card-b { padding: 14px 18px; }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-radio { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); background: #fff; }
.pill-radio input { position: absolute; opacity: 0; pointer-events: none; }
.pill-radio .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pill-radio .dot.hot { background: #ef4444; }
.pill-radio .dot.warm { background: #f59e0b; }
.pill-radio .dot.cold { background: #3b82f6; }
.pill-radio:has(input:checked) { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.upload { border: 2px dashed var(--border-strong); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); background: #faf8f4; cursor: pointer; }
.upload:hover { border-color: var(--primary); color: var(--primary); }
.upload b { color: var(--primary); }

/* ---------- Detail bits ---------- */
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 10px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.stepper { display: flex; align-items: center; padding: 20px 24px; overflow-x: auto; }
.step { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 120px; }
.step .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: #eceef6; color: var(--muted); flex: none; }
.step .dot svg.i { width: 14px; height: 14px; stroke-width: 3; }
.step b { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.step::after { content: ""; flex: 1; height: 2px; background: #e1e4ef; margin: 0 8px; }
.step:last-child { flex: none; }
.step:last-child::after { display: none; }
.step.done .dot { background: var(--success); color: #fff; }
.step.done b { color: var(--text); }
.step.done::after { background: var(--success); }
.step.now .dot { background: var(--primary); color: #fff; box-shadow: 0 0 0 5px rgba(79, 70, 229, .18); }
.step.now b { color: var(--primary); }
@media (max-width: 1024px) { .stepper { display: none; } }

/* Info grid (tab content) */
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--border); border-left: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.info-grid .cell { padding: 14px 18px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; min-width: 0; transition: background .15s ease; position: relative; }
.info-grid .cell:hover { background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 4%, #fff), #fff 70%); }
.info-grid .cell small { display: block; color: var(--muted); font-size: 10.5px; margin: 0; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.info-grid .cell strong { font-weight: 600; font-size: 14.5px; color: var(--text); line-height: 1.4; letter-spacing: -.005em; }
.info-grid .cell.span-2 { grid-column: 1 / -1; }
.info-grid .cell .badge, .info-grid .cell .chip { align-self: flex-start; margin-top: 2px; }
@media (max-width: 760px) { .info-grid { grid-template-columns: 1fr; } }

/* Panel headings in lead tabs — refined eyebrow */
#lead-tabs-scope .panel > h4,
#lead-tabs-scope .sub-section > h4 { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin: 0 0 14px; display: inline-flex; align-items: center; gap: 10px; }
#lead-tabs-scope .panel > h4::before,
#lead-tabs-scope .sub-section > h4::before { content: ""; width: 22px; height: 2px; background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 20%, transparent)); border-radius: 99px; }
#lead-tabs-scope .panel { padding: 22px 24px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 22px 40px; }
.timeline li::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::before { display: none; }
.timeline .tl-ic { position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }
.timeline .tl-ic svg.i { width: 14px; height: 14px; }
.timeline b { font-weight: 600; }
.timeline small { color: var(--muted); display: block; }
.timeline p { margin: 6px 0 0; background: var(--bg); padding: 10px 12px; border-radius: 10px; color: #3a4060; }

.doclist { list-style: none; margin: 0; padding: 0; }
.doclist li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.doclist li:last-child { border-bottom: 0; }
.doclist .grow { flex: 1; }
.doclist .grow small { color: var(--muted); display: block; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.mini-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.mini-list li:first-child { padding-top: 0; }
.mini-list .grow { flex: 1; min-width: 0; }
.mini-list .grow b { display: block; font-weight: 600; }
.mini-list .grow small { color: var(--muted); }
.time { font-size: 12px; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 3px 8px; border-radius: 6px; }

/* ---------- Charts (pure CSS) ---------- */
.hbars { display: flex; flex-direction: column; gap: 14px; }
.hbar .top { display: flex; justify-content: space-between; margin-bottom: 6px; font-weight: 600; }
.hbar .top span { color: var(--muted); font-weight: 500; }
.cols { display: flex; align-items: flex-end; gap: 14px; height: 220px; padding: 10px 4px 0; border-bottom: 1px solid var(--border); position: relative; }
.col { flex: 1; display: flex; gap: 4px; align-items: flex-end; height: 100%; justify-content: center; position: relative; }
.col i { display: block; width: 40%; max-width: 22px; border-radius: 6px 6px 0 0; background: #c7cbf7; }
.col i.b2 { background: var(--primary); }
.col-labels { display: flex; gap: 14px; padding: 8px 4px 0; }
.col-labels span { flex: 1; text-align: center; font-size: 12px; color: var(--muted); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel div { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 10px; color: #fff; font-weight: 600; }
.funnel div span { font-weight: 800; }

/* ---------- Course cards ---------- */
.course-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.course-card .top { display: flex; justify-content: space-between; align-items: flex-start; }
.course-card .badge-lg { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; font-weight: 800; }
.course-card h3 { font-size: 16px; }
.course-card p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.course-card .meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px; background: var(--bg); border-radius: 10px; }
.course-card .meta small { display: block; color: var(--muted); font-size: 11.5px; }
.course-card .meta b { font-size: 14px; }

/* ---------- Summary (sticky) ---------- */
.sticky { position: sticky; top: 84px; }
.sum-row { display: flex; justify-content: space-between; padding: 8px 0; }
.sum-row.total { border-top: 1px dashed var(--border-strong); margin-top: 6px; padding-top: 14px; font-weight: 800; font-size: 16px; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--info-soft); color: #0a5f93; font-size: 13px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.login-art { background: radial-gradient(circle at 20% 20%, #4f46e5, transparent 50%), radial-gradient(circle at 80% 80%, #a855f7, transparent 50%), #1a2a5e; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art h1 { font-size: 38px; letter-spacing: -.02em; max-width: 520px; }
.login-art p { color: #c9cdf2; max-width: 460px; font-size: 16px; }
.login-art .tags { display: flex; gap: 10px; flex-wrap: wrap; }
.login-art .tags span { padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); font-weight: 600; font-size: 13px; }
.login-form { display: grid; place-items: center; padding: 40px; }
.login-box { width: 100%; max-width: 380px; }
.login-box h2 { font-size: 26px; margin-bottom: 6px; }
.login-box > p { color: var(--muted); margin: 0 0 26px; }
.login-box .field { margin-bottom: 16px; }

/* ---------- Analytics ---------- */
.g-6 { grid-template-columns: repeat(6, 1fr); }
.filterbar { position: sticky; top: 64px; z-index: 25; display: flex; flex-wrap: wrap; gap: 14px 28px; padding: 14px 20px; align-items: flex-end; margin-bottom: 18px; }
.f-lbl { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; font-weight: 600; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(20, 24, 60, .14); }
.bchips { display: flex; gap: 6px; flex-wrap: wrap; }
.bchip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-strong); background: #fff; border-radius: 999px; padding: 5px 12px; font-weight: 600; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.bchip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c, #64748b); opacity: .35; }
.bchip.on { color: var(--text); border-color: var(--c, var(--primary)); background: color-mix(in srgb, var(--c, #4f46e5) 8%, #fff); }
.bchip.on i { opacity: 1; }
.range { display: flex; align-items: center; gap: 8px; }
.range .input, .f-group .select { height: 34px; width: auto; }
.f-group .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

.insights { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.insight { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: #fff; align-items: flex-start; }
.insight .ii { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.insight b { display: block; font-size: 13.5px; margin-bottom: 3px; }
.insight p { margin: 0; font-size: 12.5px; color: #454b68; }
.insight.t-danger { background: #fff7f7; border-color: #f4c9c9; }
.insight.t-warn { background: #fffaf0; border-color: #f2dcaa; }
.insight.t-success { background: #f4fcf7; border-color: #bfe8cf; }
.insight.t-info { background: #f3f9fe; border-color: #bcdff4; }

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .ax { font-size: 11px; fill: #8087a3; }
.chart .tip { position: absolute; top: 8px; pointer-events: none; background: #12152b; color: #fff; border-radius: 10px; padding: 9px 12px; font-size: 12px; box-shadow: 0 10px 30px rgba(10, 12, 40, .3); min-width: 170px; opacity: 0; transition: opacity .08s; z-index: 5; }
.tip b { display: block; margin-bottom: 5px; }
.tip .r { display: flex; justify-content: space-between; gap: 14px; line-height: 1.7; }
.tip .r i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.tip .warn { color: #ff9b9b; font-weight: 700; }
.legend { flex-wrap: wrap; }
.legend span { white-space: nowrap; }
.legend .dash { background: none !important; border-top: 2px dashed #64748b; height: 0 !important; width: 14px !important; border-radius: 0 !important; vertical-align: middle; }

.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-wrap svg { width: 150px; height: 150px; flex: none; }
.dc-n { font-size: 22px; font-weight: 800; fill: #1b1f36; text-anchor: middle; }
.dc-l { font-size: 11px; fill: #8087a3; text-anchor: middle; }
.dl { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 8px; }
.dl li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dl i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.dl .n { flex: 1; }
.dl b { font-weight: 700; }
.dl em { font-style: normal; color: var(--muted); width: 44px; text-align: right; }

.heat { display: grid; grid-template-columns: 34px repeat(24, 1fr); gap: 3px; font-size: 10.5px; color: var(--muted); }
.heat .cell { aspect-ratio: 1.15; border-radius: 4px; background: var(--primary); }
.heat .lab { display: flex; align-items: center; font-weight: 600; }
.heat .hl { text-align: center; }
.heat-legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 12px; }
.heat-legend i { width: 110px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(79, 70, 229, .08), var(--primary)); }

.pr { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pr::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
.pr-u { background: #fde8e8; color: #c42b2b; }
.pr-h { background: #fff0d6; color: #a85f00; }
.pr-m { background: #e4efff; color: #1d5fd0; }
.pr-l { background: #eceff5; color: #5b6180; }
.bar.red > i { background: var(--danger); }
.bar.blue > i { background: var(--info); }
.loadcell { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.loadcell .bar { flex: 1; }
.loadcell b { min-width: 40px; text-align: right; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.mcell { display: inline-block; min-width: 44px; padding: 5px 10px; border-radius: 8px; font-weight: 700; }
.stack { display: flex; height: 30px; border-radius: 8px; overflow: hidden; background: #eceef6; position: relative; }
.stack i { display: block; height: 100%; }
.stack .un { background: repeating-linear-gradient(45deg, #f1b9b9, #f1b9b9 5px, #fbe3e3 5px, #fbe3e3 10px); }
.stack .free { background: #d9f2e4; }
.cap-wrap { position: relative; padding-top: 4px; }
.capmark { position: absolute; top: 0; bottom: -4px; width: 2px; background: #12152b; }
.capmark::after { content: "Capacity"; position: absolute; top: -17px; left: 50%; transform: translateX(-50%); font-size: 10.5px; font-weight: 700; color: #12152b; }
.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.rules li { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: #454b68; }
.rules li div { display: flex; justify-content: space-between; align-items: center; }
.rules li small { color: var(--muted); font-weight: 600; }
.score { display: flex; align-items: center; gap: 8px; min-width: 100px; }
.score .bar { flex: 1; height: 6px; }
.score b { font-size: 12.5px; }
.why { white-space: normal; min-width: 220px; max-width: 320px; color: #454b68; }
.why-ads { white-space: normal; min-width: 240px; color: #454b68; font-size: 12.5px; }

/* ---------- Consultant dashboard ---------- */
.hello { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 22px 26px; border-radius: 16px; color: #fff; margin-bottom: 18px; background: radial-gradient(circle at 90% 0%, rgba(168, 85, 247, .55), transparent 55%), linear-gradient(135deg, #312e81, #4f46e5); box-shadow: 0 10px 30px rgba(79, 70, 229, .25); }
.hello h2 { font-size: 22px; }
.hello p { margin: 6px 0 0; color: #dfe1ff; max-width: 640px; }
.hello p b { color: #fff; }
.hello .btn { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .3); color: #fff; box-shadow: none; }
.hello .btn:hover { background: rgba(255, 255, 255, .24); }
.hello .btn.solid { background: #fff; color: var(--primary-600); border-color: #fff; }
.task { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.task:last-child { border-bottom: 0; }
.task .grow { flex: 1; min-width: 0; }
.task .tname { font-weight: 600; display: block; }
.task small { color: var(--muted); display: block; font-size: 12.5px; }
.task .when { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; text-align: right; min-width: 92px; }
.task.done { opacity: .45; }
.task.done .tname { text-decoration: line-through; }
.task .pr { min-width: 76px; justify-content: center; }
.sla, .dleft { font-variant-numeric: tabular-nums; font-weight: 800; padding: 3px 9px; border-radius: 8px; font-size: 12.5px; white-space: nowrap; }
.sla.ok, .dleft.g { background: var(--success-soft); color: var(--success); }
.sla.warn, .dleft.a { background: var(--warn-soft); color: var(--warn); }
.sla.bad, .dleft.r { background: var(--danger-soft); color: var(--danger); }
.sched { list-style: none; margin: 0; padding: 0; }
.sched li { display: grid; grid-template-columns: 62px 1fr; gap: 12px; padding: 6px 0; }
.sched .t { font-weight: 700; font-size: 12.5px; color: var(--muted); padding-top: 9px; }
.sched .ev { border-left: 3px solid var(--c, var(--primary)); background: var(--bg); border-radius: 8px; padding: 8px 12px; }
.sched .ev b { display: block; font-size: 13.5px; }
.sched .ev small { color: var(--muted); }
.sched li.now .t { color: var(--primary); }
.sched li.now .ev { background: var(--primary-soft); }
.sched li.past { opacity: .5; }
.pipe { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.pipe .st { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #faf8f4; }
.pipe .st span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.pipe .st b { font-size: 22px; display: block; line-height: 1.3; }
.pipe .st em { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--danger); background: var(--danger-soft); padding: 1px 7px; border-radius: 6px; }
.pipe .st em.none { color: var(--success); background: var(--success-soft); }
.ring { --p: 0; --c: var(--primary); width: 66px; height: 66px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), #eceef6 0); display: grid; place-items: center; position: relative; flex: none; }
.ring::before { content: ""; position: absolute; inset: 7px; background: #fff; border-radius: 50%; }
.ring b { position: relative; font-size: 13.5px; }
.target { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.target:last-child { border-bottom: 0; padding-bottom: 0; }
.target:first-child { padding-top: 0; }
.target .grow { flex: 1; }
.target .grow b { display: block; }
.target .grow small { color: var(--muted); }
.wk-wrap { position: relative; height: 200px; }
.wk { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; height: 100%; align-items: end; }
.wk .d { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.wk .stk { width: 70%; max-width: 34px; display: flex; flex-direction: column-reverse; border-radius: 6px 6px 0 0; overflow: hidden; }
.wk .stk i { display: block; }
.wk .v { font-size: 11.5px; font-weight: 700; margin-bottom: 3px; }
.wk .l { font-size: 11.5px; color: var(--muted); height: 22px; line-height: 22px; }
.wk .d.today .stk { opacity: .6; }
.wk-target { position: absolute; left: 0; right: 0; border-top: 2px dashed #94a3b8; pointer-events: none; }
.wk-target span { position: absolute; right: 0; top: -19px; font-size: 11px; font-weight: 700; color: #64748b; background: #fff; padding: 0 4px; }
.tiny-btn { height: 28px; padding: 0 10px; font-size: 12px; }
.row-sub { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.row-sub:last-child { border-bottom: 0; padding-bottom: 0; }
.row-sub:first-child { padding-top: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .g-4, .insights { grid-template-columns: repeat(2, 1fr); }
  .g-6 { grid-template-columns: repeat(3, 1fr); }
  .filterbar { position: static; }
  .pipe { grid-template-columns: repeat(4, 1fr); }
  .g-3 { grid-template-columns: repeat(2, 1fr); }
  .g-main, .g-main-r, .g-side-l { grid-template-columns: 1fr; }
  .sticky { position: static; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 16px; }
  .search { min-width: 0; flex: 1; }
  .topbar .title small { display: none; }
  .content { padding: 18px 16px 40px; }
  .g-4, .g-3, .g-2, .g-6, .insights, .form-grid, .form-grid.c3, .choice-cards { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
}

/* ---------- Workspace / dashboard extras ---------- */
.g-5 { grid-template-columns: repeat(5, 1fr); }
.viewas { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.viewas .select { height: 38px; min-width: 210px; font-weight: 600; }
.view-banner { display: none; margin-bottom: 16px; }
.view-banner.show { display: flex; }
.mini-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; background: var(--bg); }
.mini-stat b { font-size: 20px; }
.mini-stat small { color: var(--muted); font-size: 12px; }
.mini-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.link { color: var(--primary); font-weight: 600; }
.link:hover { text-decoration: underline; }
@media (max-width: 1200px) { .g-5 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .g-5 { grid-template-columns: 1fr; } .viewas span { display: none; } }

/* ---------- Batch attendance ---------- */
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: pulse 1.6s infinite; vertical-align: middle; margin-right: 6px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 70% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.live-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; border-radius: 12px; background: #effaf3; border: 1px solid #bfe8cf; margin-bottom: 18px; }
.live-banner .grow { flex: 1; min-width: 220px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 11px; height: 11px; border-radius: 3px; background: #e1e4ef; }
.dots i.P { background: var(--success); }
.dots i.L { background: #f59e0b; }
.dots i.A { background: var(--danger); }
.dots i.E { background: #94a3b8; }
.att-counts { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.att-counts b { font-size: 16px; margin-right: 4px; }
.sd-id-row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.sd-qr { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.sd-qr svg { display: block; border-radius: 6px; }
.sd-qr small { color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.ex-sub { padding: 10px 18px 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ex-list { display: flex; flex-direction: column; }
.ex-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--border); }
.ex-row:first-child { border-top: 0; }
.ex-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ex-main b { font-size: 14.5px; }
.ex-main small { color: var(--muted); font-size: 12.5px; }
.ex-main .chip { align-self: flex-start; }
.ex-acts { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.ex-over { color: var(--danger); font-weight: 600; }
.ex-tbl .acts { white-space: nowrap; }
.ex-tbl .acts .btn, .ex-tbl .acts .icon-btn { margin-left: 4px; }
.exm-cert { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.exm-cert .muted { font-size: 13px; }
.btn.danger { border-color: #f0a3a3; color: var(--danger); background: #fff; }
.btn.danger:hover { background: #fff3f3; }
.la-sec { margin-bottom: 26px; }
.la-sec:last-child { margin-bottom: 0; }
.la-sec-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.la-sec-h h4 { margin: 0; font-size: 15px; }
.la-sub { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 14px 0 8px; }
.la-sub:first-child { margin-top: 0; }
.la-noteform { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.la-noteform .textarea { background: #fff; min-height: 60px; }

/* Notes — crm-app list-group look */
.la-notes { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.la-notes:empty { display: none; }
.la-note-row { padding: 12px 14px; border-top: 1px solid var(--border); }
.la-note-row:first-child { border-top: 0; }
.la-note-row.editing { background: #fafbff; }
.la-note-head { display: flex; align-items: center; justify-content: flex-start; gap: 10px; }
.la-note-head strong { font-size: 13.5px; color: #1a1f3d; }
.la-note-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.la-note-stamp { color: var(--muted); font-size: 11.5px; font-weight: 500; }
.la-note-av { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; color: #fff; font-weight: 700; font-size: 12px; }
.la-note-head .la-note-meta { margin-left: auto; }
.la-note-meta { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.la-note-meta small { color: var(--muted); font-size: 12px; }
.la-note-body { margin: 10px 0 0 44px; padding-top: 10px; border-top: 1px dashed #E2E8F0; font-size: 14px; line-height: 1.55; color: #1a1f3d; white-space: pre-wrap; }
.la-note-edit { margin-top: 8px; }
.la-note-edit .textarea { min-height: 72px; }
.la-note-edit-acts { display: flex; gap: 6px; margin-top: 8px; }

/* Icon-link buttons (crm-app transparent inline buttons) */
.btn-ilink { background: transparent; border: 1px solid transparent; padding: 5px 7px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; font: inherit; transition: all .15s ease; }
.btn-ilink:hover { background: var(--bg); color: #1a1f3d; border-color: var(--border); }
.btn-ilink.danger { color: #b91c1c; }
.btn-ilink.danger:hover { background: #fef2f2; color: #991b1b; border-color: #FECACA; }
.btn-ilink.success { color: #059669; }
.btn-ilink.success:hover { background: #ecfdf5; color: #047857; border-color: #A7F3D0; }
.btn-ilink.warn { color: #b45309; }
.btn-ilink.warn:hover { background: #fffbeb; color: #92400e; border-color: #FDE68A; }
.btn-ilink.primary { color: #2563eb; }
.btn-ilink.primary:hover { background: #eff6ff; color: #1d4ed8; border-color: #BFDBFE; }
.btn-ilink .i { width: 15px; height: 15px; }

/* Appointments — template consult-item look */
.consult-list { display: flex; flex-direction: column; gap: 10px; }
.consult-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: 1px solid #E2E8F0; border-radius: 10px; background: #fff; position: relative; }
.consult-item .consult-date { width: 56px; text-align: center; background: #EEF2FF; color: #4338CA; border-radius: 8px; padding: 8px 0; flex-shrink: 0; }
.consult-item .consult-date strong { display: block; font-size: 18px; font-weight: 700; line-height: 1; }
.consult-item .consult-date span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.consult-item .consult-info { flex: 1; min-width: 0; }
.consult-item .consult-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.consult-item .consult-title { display: block; font-size: 14px; font-weight: 700; color: #1a1f3d; }
.consult-item .consult-meta { color: #64748B; font-size: 12px; display: block; margin-top: 2px; }
.consult-item .consult-status { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.consult-item .consult-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px dashed #E2E8F0; }
.consult-item .consult-actions button { font-size: 12px; padding: 6px 12px; border-radius: 8px; border: 1px solid #E2E8F0; background: #FFF; color: #475569; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; transition: all .15s ease; line-height: 1; }
.consult-item .consult-actions button:hover { background: #F8FAFC; border-color: #CBD5E1; transform: translateY(-1px); box-shadow: 0 2px 4px rgba(15, 23, 42, .06); }
.consult-item .consult-actions button:active { transform: translateY(0); box-shadow: none; }
.consult-item .consult-actions button .i { width: 13px; height: 13px; }
.consult-item .consult-actions button.success { color: #15803D; border-color: #BBF7D0; background: #F0FDF4; }
.consult-item .consult-actions button.success:hover { background: #DCFCE7; border-color: #86EFAC; }
.consult-item .consult-actions button.primary { color: #1D4ED8; border-color: #BFDBFE; background: #EFF6FF; }
.consult-item .consult-actions button.primary:hover { background: #DBEAFE; border-color: #93C5FD; }
.consult-item .consult-actions button.warn { color: #B45309; border-color: #FDE68A; background: #FFFBEB; }
.consult-item .consult-actions button.warn:hover { background: #FEF3C7; border-color: #FCD34D; }
.consult-item .consult-actions button.danger { color: #DC2626; border-color: #FECACA; background: #FEF2F2; }
.consult-item .consult-actions button.danger:hover { background: #FEE2E2; border-color: #FCA5A5; }
.consult-item .reschedule-note { margin-top: 6px; padding: 5px 9px; background: #EFF6FF; color: #1D4ED8; border-radius: 6px; font-size: 11.5px; font-weight: 600; display: inline-block; }

.consult-item.status-scheduled .consult-status { background: #DBEAFE; color: #1D4ED8; }
.consult-item.status-completed { background: #FAFEFB; }
.consult-item.status-completed .consult-date { background: #DCFCE7; color: #15803D; }
.consult-item.status-completed .consult-status { background: #DCFCE7; color: #15803D; }
.consult-item.status-postponed { background: #FAFAFA; opacity: 0.85; }
.consult-item.status-postponed .consult-date { background: #FEF3C7; color: #A16207; }
.consult-item.status-postponed .consult-title { text-decoration: line-through; color: #94A3B8; }
.consult-item.status-postponed .consult-status { background: #FEF3C7; color: #A16207; }
.consult-item.status-overdue .consult-date { background: #FEE2E2; color: #B91C1C; }
.consult-item.status-overdue .consult-status { background: #FEE2E2; color: #B91C1C; }

.cancel-reason { margin-top: 6px; font-size: 11.5px; color: #94A3B8; font-style: italic; }
.consult-note { margin: 6px 0 0; font-size: 12.5px; color: #475569; white-space: pre-wrap; }
.consult-outcome { margin: 6px 0 0; font-size: 12px; color: #334155; background: var(--bg); border-radius: 6px; padding: 5px 8px; }
.st-P { background: var(--success-soft); color: var(--success); }
.st-L { background: var(--warn-soft); color: var(--warn); }
.st-A { background: var(--danger-soft); color: var(--danger); }
.st-E { background: #eceef5; color: #5b6180; }
.st-N { background: #f3f4f9; color: #8087a3; }
.sel-status { height: 32px; border-radius: 8px; border: 1px solid var(--border-strong); font-weight: 600; font-size: 12.5px; padding: 0 8px; cursor: pointer; }
.qr-card { text-align: center; }
.qr-frame { position: relative; display: inline-block; padding: 12px; border-radius: 16px; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow); }
.qr-frame svg { display: block; width: min(100%, 290px); height: auto; }
.qr-frame.locked svg { opacity: .08; }
.qr-lock { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px; font-weight: 700; color: #454b68; }
.qr-lock small { font-weight: 500; color: var(--muted); }
.qr-timer { height: 6px; border-radius: 99px; background: #eceef6; margin: 14px auto 6px; max-width: 290px; overflow: hidden; }
.qr-timer i { display: block; height: 100%; background: var(--primary); width: 100%; transition: width 1s linear; }
.qr-meta { font-size: 12.5px; color: var(--muted); }
.fs-overlay { position: fixed; inset: 0; z-index: 100; background: #0b0d1e; color: #fff; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; text-align: center; }
.fs-overlay.on { display: flex; }
.fs-overlay .qr-frame { padding: 18px; border-radius: 22px; }
.fs-overlay .qr-frame svg { width: min(68vh, 80vw); }
.fs-overlay h2 { font-size: 28px; }
.fs-overlay p { margin: 0; color: #b8bde6; font-size: 17px; }
.fs-stats { display: flex; gap: 28px; font-size: 18px; }
.fs-stats b { font-size: 30px; display: block; }
.fs-close { position: absolute; top: 20px; right: 24px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: #12152b; color: #fff; padding: 11px 18px; border-radius: 12px; box-shadow: 0 12px 34px rgba(10, 12, 40, .35); font-weight: 600; opacity: 0; transition: .2s; z-index: 120; pointer-events: none; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.count-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.count-strip div { padding: 10px 12px; border-radius: 10px; }
.count-strip b { display: block; font-size: 22px; line-height: 1.2; }
.count-strip small { font-size: 12px; font-weight: 600; }
.time-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; align-items: end; }

/* student scan screen (phone) */
.scan-page { min-height: 100vh; background: linear-gradient(160deg, #e9ebff, #f6f0ff); display: flex; flex-direction: column; align-items: center; padding: 28px 16px 40px; gap: 22px; }
.phone { width: 100%; max-width: 390px; min-height: 700px; background: #f7f4ef; border-radius: 38px; border: 10px solid #1a2a5e; box-shadow: 0 30px 70px rgba(30, 30, 90, .35); overflow: hidden; display: flex; flex-direction: column; }
.phone-top { background: linear-gradient(135deg, #312e81, #4f46e5); color: #fff; padding: 28px 22px 26px; }
.phone-top .brand { width: 34px; height: 34px; border-radius: 10px; margin: 0 0 14px; font-size: 15px; background: rgba(255, 255, 255, .2); box-shadow: none; }
.phone-top h1 { font-size: 20px; }
.phone-top p { margin: 4px 0 0; color: #dcdfff; font-size: 13px; }
.phone-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.phone-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.phone-card .kv { grid-template-columns: 92px 1fr; font-size: 13.5px; }
.result { text-align: center; padding: 26px 16px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.result .big { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 8px; }
.result .big svg.i { width: 40px; height: 40px; stroke-width: 2.5; }
.result h2 { font-size: 22px; }
.result p { margin: 0; color: var(--muted); max-width: 290px; }
.demo-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 560px; }
.demo-links a { padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: #454b68; }
.demo-links a:hover { border-color: var(--primary); color: var(--primary); }
@media (max-width: 760px) { .time-grid { grid-template-columns: repeat(2, 1fr); } .count-strip { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Roles, shared helpers ---------- */
.nav-sep { height: 1px; background: #34478a; margin: 6px 8px; }
.role-switch { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.role-switch small { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 6px; font-weight: 600; }
.role-switch .seg { display: flex; }
.role-switch .seg button { flex: 1; padding: 5px 4px; }
.hb { display: flex; flex-direction: column; gap: 9px; }
.hb-row { display: grid; grid-template-columns: minmax(90px, 36%) 1fr 44px; gap: 10px; align-items: center; font-size: 13px; }
.hb-n { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-n small { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; }
.hb-t { height: 8px; background: #eceef6; border-radius: 99px; overflow: hidden; }
.hb-t i { display: block; height: 100%; border-radius: 99px; }
.hb-row > b { text-align: right; font-variant-numeric: tabular-nums; }
.spark { display: block; }
.dotc { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 8px; vertical-align: middle; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; user-select: none; }
.table-wrap.tall { max-height: 460px; overflow: auto; }
.table-wrap.tall th { position: sticky; top: 0; z-index: 2; }
table.sortable th[data-s] { cursor: pointer; user-select: none; }
table.sortable th[data-s]:hover { color: var(--text); }
table.sortable th.sorted { color: var(--primary); }
table.sortable th.sorted::after { content: " " attr(data-dir); font-size: 9px; }
tr.clickable { cursor: pointer; }
tr.sel-row, tr.sel-row:hover { background: var(--primary-soft); }
td.rk { color: var(--muted); font-weight: 600; width: 40px; }
.mini-h { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 16px 0 10px; }
@keyframes flash { from { box-shadow: 0 0 0 3px rgba(79, 70, 229, .35); } to { box-shadow: none; } }
.card.flash { animation: flash .6s ease-out; }

/* ---------- Lead map ---------- */
.g-map { grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); }
.map-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.map-tools .select { height: 34px; }
.map-wrap { position: relative; max-width: 640px; margin: 0 auto; }
#mapSvg { display: block; width: 100%; height: auto; max-height: 720px; }
.dist { stroke: #fff; stroke-width: .7; stroke-linejoin: round; cursor: pointer; transition: fill .25s; }
.dist:hover { stroke: #1e1b4b; stroke-width: 1.4; }
.dist.sel { stroke: #111827; stroke-width: 2; }
.dl-t { fill: #1f2340; font-family: inherit; paint-order: stroke; stroke: rgba(255, 255, 255, .55); stroke-width: .5px; }
.dl-t.lt { fill: #fff; stroke: rgba(30, 27, 75, .35); }
.map-tip { position: absolute; pointer-events: none; opacity: 0; background: #12152b; color: #fff; border-radius: 10px; padding: 10px 13px; font-size: 12px; min-width: 190px; box-shadow: 0 10px 30px rgba(10, 12, 40, .3); z-index: 5; transition: opacity .08s; }
.map-tip b { display: block; font-size: 13.5px; }
.map-tip small { display: block; color: #aab0d6; margin-bottom: 6px; }
.map-tip .r { display: flex; justify-content: space-between; gap: 18px; line-height: 1.7; }
.map-legend { position: absolute; left: 0; bottom: 6px; width: 190px; font-size: 11.5px; color: var(--muted); background: rgba(255, 255, 255, .85); padding: 8px 10px; border-radius: 10px; }
.lg-bar { height: 10px; border-radius: 6px; }
.lg-lbl { display: flex; justify-content: space-between; margin-top: 3px; font-weight: 600; }
.lg-pin { margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.pin-d { width: 9px; height: 9px; border-radius: 50%; border: 2px solid #4f46e5; background: #fff; display: inline-block; }
.d-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.d-stats > div { background: var(--bg); border-radius: 10px; padding: 10px 6px; text-align: center; }
.d-stats b { display: block; font-size: 19px; font-weight: 800; }
.d-stats small { color: var(--muted); font-size: 11.5px; }
.dtr { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.tl-list { display: flex; flex-direction: column; }
.tl { display: grid; grid-template-columns: 22px minmax(90px, 1.1fr) 1.2fr 44px; gap: 10px; align-items: center; padding: 8px 8px; border: 0; background: transparent; border-radius: 9px; cursor: pointer; text-align: left; font-size: 13px; }
.tl:hover { background: var(--bg); }
.tl.on { background: var(--primary-soft); }
.tl .n { color: var(--muted); font-weight: 700; font-size: 12px; }
.tl .nm { font-weight: 600; }
.tl .nm small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.tl .bar i { background: var(--primary); }
.tl b { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .g-map { grid-template-columns: 1fr; } }

/* ---------- Team performance ---------- */
.wl { display: flex; flex-direction: column; gap: 4px; }
.wl-row { display: grid; grid-template-columns: 150px 1fr 48px 112px; gap: 12px; align-items: center; padding: 6px 8px; border-radius: 9px; cursor: pointer; }
.wl-row:hover { background: var(--bg); }
.wl-row.on { background: var(--primary-soft); }
.wl-n b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-n small { color: var(--muted); font-size: 11.5px; }
.wl-t { position: relative; height: 10px; background: #eceef6; border-radius: 99px; }
.wl-t i { display: block; height: 100%; border-radius: 99px; }
.wl-t u { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #12152b; opacity: .55; border-radius: 2px; }
.wl-v { font-variant-numeric: tabular-nums; text-align: right; font-size: 13px; }
.fn { display: flex; flex-direction: column; gap: 14px; }
.fn-row { display: grid; grid-template-columns: 130px 1fr 64px 120px; gap: 12px; align-items: center; font-size: 13px; }
.fn-n { font-weight: 600; }
.fn-t { height: 22px; background: #eef0f7; border-radius: 6px; overflow: hidden; }
.fn-t i { display: block; height: 100%; border-radius: 6px; }
.fn-row b { text-align: right; font-variant-numeric: tabular-nums; }
.fn-row em { font-style: normal; color: var(--muted); font-size: 12px; }
.score { display: inline-grid; place-items: center; width: 38px; height: 28px; border-radius: 8px; font-weight: 800; font-size: 14px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); }
td small { display: block; color: var(--muted); font-size: 11.5px; }
.scrim { position: fixed; inset: 0; background: rgba(12, 14, 40, .35); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 80; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 100vw; background: #fff; z-index: 90; transform: translateX(105%); transition: transform .25s ease; box-shadow: -20px 0 60px rgba(10, 12, 40, .2); padding: 26px 26px 30px; overflow-y: auto; }
.drawer.open { transform: none; }
.drawer-x { position: absolute; top: 14px; right: 14px; }
.dr-head { display: flex; gap: 14px; align-items: center; padding-right: 36px; }
.dr-score { text-align: center; color: var(--c); }
.dr-score b { display: block; font-size: 34px; font-weight: 800; line-height: 1; }
.dr-score small { color: var(--muted); font-size: 11px; }
.mt-row { display: grid; grid-template-columns: 128px 1fr 62px; gap: 4px 12px; align-items: center; font-size: 13px; margin-bottom: 9px; }
.mt-row small { grid-column: 2 / 4; color: var(--muted); font-size: 11px; margin-top: -4px; }
.mt-bar { position: relative; height: 8px; background: #eceef6; border-radius: 99px; }
.mt-bar i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.mt-bar u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #12152b; opacity: .6; }
.mt-row b { text-align: right; }
.mt-row b.ok { color: var(--success); } .mt-row b.bad { color: var(--danger); }
.dr-notes { margin: 0; padding-left: 18px; font-size: 13.5px; color: #454b68; display: flex; flex-direction: column; gap: 6px; }
.dr-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.dr-spark svg { width: 100%; height: 60px; }
#tpTbl th, #tpTbl td { padding-left: 10px; padding-right: 10px; }
#tpTbl .prog { min-width: 92px; gap: 6px; }
#tpTbl th { font-size: 10.5px; letter-spacing: .03em; white-space: normal; line-height: 1.25; }
table.compact th, table.compact td { padding-left: 10px; padding-right: 10px; }
table.compact th { font-size: 10.5px; letter-spacing: .03em; white-space: normal; line-height: 1.25; }
table.compact .prog { min-width: 92px; gap: 6px; }

/* ---------- Theme: warm page background, navy sidebar, bold primary text ---------- */
:root { --text: #141a36; }
.person b, .insight b, .stat .val, .hb-n, .tl .nm, .wl-n b, .kv dd, td b, th { font-weight: 700; }
.stat .val { font-weight: 800; }
.stat .lbl, .card-h small + *, label { font-weight: 700; }
.table-wrap td { color: var(--text); font-weight: 600; }
.table-wrap td small, .table-wrap td .muted { font-weight: 500; }

/* =====================================================================
   Responsive layer (loaded last so it wins). Desktop: full width. Tablet: stacked grids. Phone: slide-out menu.
   ===================================================================== */
.content { max-width: none; width: 100%; }
.main { min-width: 0; }
.menu-btn { display: none; flex: none; }
.nav-scrim { display: none; }
.g-div { grid-template-columns: minmax(0, 1.58fr) minmax(0, 1fr); }
.card, .chart { max-width: 100%; }
.chart { overflow: hidden; }
.heat { overflow-x: auto; }
.seg { max-width: 100%; overflow-x: auto; }

@media (min-width: 1700px) { .content { padding-left: 40px; padding-right: 40px; } .topbar { padding-left: 40px; padding-right: 40px; } }
@media (max-width: 1400px) {
  .g-6, .g-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .g-main, .g-main-r, .g-side-l, .g-map, .g-div { grid-template-columns: minmax(0, 1fr); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filterbar { position: static; }
  .sticky { position: static; }
}
@media (max-width: 1000px) {
  .g-2, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .drawer { width: 420px; }
}

/* phones and small tablets: menu becomes a slide-out panel */
@media (max-width: 900px) {
  .main { margin-left: 0; }
  .menu-btn { display: grid; }
  .sidebar { width: 272px; align-items: stretch; padding: 16px 14px; transform: translateX(-105%); transition: transform .22s ease; z-index: 70; overflow-y: auto; box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: 12px 0 40px rgba(10, 12, 40, .4); }
  .sidebar .brand { margin-bottom: 14px; }
  .nav { gap: 2px; }
  .nav-item { width: 100%; height: 46px; display: flex; align-items: center; justify-content: flex-start; gap: 14px; padding: 0 14px; }
  .nav-item[data-tip]::after { position: static; transform: none; opacity: 1; background: none; padding: 0; color: inherit; font-size: 14px; font-weight: 700; content: attr(data-tip); white-space: normal; text-align: left; line-height: 1.2; }
  .nav-item[data-tip]:hover::after { transform: none; }
  .nav-badge { position: static; margin-left: auto; order: 3; }
  .nav-sep { margin: 6px 4px; }
  .sidebar-bottom { width: 100%; padding-top: 12px; }
  .sidebar-bottom .nav-item { width: 100%; }
  .profile { width: 100%; }
  .popover { left: 0; right: 0; bottom: calc(100% + 8px); width: auto; }
  .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(12, 14, 40, .45); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; }
  .nav-scrim.on { opacity: 1; pointer-events: auto; }
  .topbar { height: auto; min-height: 60px; padding: 8px 14px; flex-wrap: wrap; gap: 10px; }
  .topbar .title { min-width: 0; flex: 1 1 140px; }
  .topbar .title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .title small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .spacer { display: none; }
  .topbar .search { order: 9; flex: 1 1 100%; min-width: 0; }
  .topbar .btn { padding: 0 12px; }
  .content { padding: 16px 14px 40px; }
  .card-h { flex-wrap: wrap; padding: 14px 16px; }
  .card-b { padding: 16px; }
  .toolbar { padding: 12px 16px; }
  .toolbar .search { min-width: 0; flex: 1 1 100%; }
  .toolbar .select { flex: 1 1 140px; width: auto; }
  .filterbar { padding: 14px 16px; gap: 14px 20px; }
  .f-group { min-width: 0; max-width: 100%; }
  .range { flex-wrap: wrap; }
  .legend { gap: 10px 14px; }
  .pager { padding: 12px 16px; }
  .page-head { align-items: stretch; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1 1 auto; justify-content: center; }
  .drawer { width: 100vw; padding: 20px 18px 26px; }
  .modal { max-height: 94vh; }
  .stat .val { font-size: 24px; }
  .hello { padding: 18px; }
}
@media (max-width: 760px) {
  .g-6, .g-5, .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .insights { grid-template-columns: minmax(0, 1fr); }
  .stat { padding: 14px; }
  .stat .lbl { padding-right: 34px; font-size: 12px; }
  .stat .ico { width: 30px; height: 30px; top: 12px; right: 12px; }
  .form-grid, .form-grid.c3 { grid-template-columns: minmax(0, 1fr); }
  .prog-pick { grid-template-columns: minmax(0, 1fr); }
  .time-grid { grid-template-columns: repeat(2, 1fr); }
  .kv { grid-template-columns: 110px 1fr; }
  th, td { padding-left: 12px; padding-right: 12px; }
  .map-legend { position: static; width: auto; margin-top: 8px; }
  .tl { grid-template-columns: 20px minmax(70px, 1fr) minmax(40px, .8fr) 38px; }
  .wl-row { grid-template-columns: 120px 1fr 44px; }
  .wl-row .badge { display: none; }
  .fn-row { grid-template-columns: 96px 1fr 52px; }
  .fn-row em { display: none; }
  .hb-row { grid-template-columns: minmax(70px, 38%) 1fr 38px; }
  .doc { grid-template-columns: 46px minmax(0, 1fr); }
  .doc .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .d-stats { grid-template-columns: repeat(2, 1fr); }
  .t-kv { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 360px) {
  .g-6, .g-5, .g-4 { grid-template-columns: minmax(0, 1fr); }
  .topbar .btn { font-size: 12.5px; }
  .seg button { padding: 5px 9px; }
}
@media (max-width: 760px) {
  .pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legend { max-width: 100%; }
  .card-h > * { min-width: 0; }
}

td .btn.sm { padding: 0 9px; gap: 5px; }
.upc .prog { min-width: 70px; gap: 6px; } .upc .prog span { min-width: 30px; }
.upc td { white-space: nowrap; } .upc td:nth-child(3), .upc td:nth-child(4) { white-space: normal; min-width: 70px; }

/* numeric table columns are centred (set by app.js) */
th.tc, td.tc { text-align: center; }
td.tc small { text-align: center; }
td.tc .prog { justify-content: center; }

/* Drop-down fields: custom caret with proper spacing from the right edge */
select.select, select.sel-status {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  padding-right: 38px; cursor: pointer; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23697089' stroke-width='2.5' 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 13px center; background-size: 14px;
}
select.select:focus, select.sel-status:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
select.select:disabled { opacity: .6; cursor: not-allowed; }
select.sel-status { padding-right: 30px; background-position: right 9px center; background-size: 12px; }
.select.sm, .select[style*="height:32px"] { padding-right: 32px; }

.role-switch .seg { display: grid; grid-template-columns: 1fr 1fr; }
