:root {
    --navy: #020617;
    --navy-soft: #0f172a;
    --blue: #2563eb;
    --blue-soft: #eff6ff;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-700: #334155;
    --white: #fff;
    --danger: #dc2626;
    --success: #059669;
    --shadow: 0 18px 45px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--navy-soft); background: var(--slate-50); font-family: Inter, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 18px; display: flex; flex-direction: column; color: #cbd5e1; background: var(--navy); z-index: 30; }
.brand { display: flex; gap: 12px; align-items: center; color: white; padding: 0 8px 26px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: var(--blue); box-shadow: 0 12px 26px rgba(37, 99, 235, .32); }
.brand strong, .brand small, .profile strong, .profile small, .sidebar-foot strong, .sidebar-foot small { display: block; }
.brand strong { font-size: 15px; }.brand small { margin-top: 3px; font-size: 11px; color: var(--slate-400); letter-spacing: .09em; text-transform: uppercase; }
.nav-label { display: block; margin: 10px 12px; font-size: 10px; font-weight: 800; color: #64748b; letter-spacing: .14em; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 13px; min-height: 48px; padding: 0 14px; margin: 5px 0; border-radius: 14px; font-size: 14px; font-weight: 700; }
.nav-item i { width: 20px; text-align: center; }.nav-item:hover { color: white; background: rgba(255,255,255,.06); }.nav-item.is-active { color: white; background: var(--blue); box-shadow: 0 12px 30px rgba(37, 99, 235, .28); }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 11px; padding: 16px 12px 0; border-top: 1px solid rgba(148,163,184,.16); }.sidebar-foot strong { color: white; font-size: 12px; }.sidebar-foot small { margin-top: 2px; color: var(--slate-500); font-size: 10px; }.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 5px rgba(52,211,153,.12); }
.app-main { min-width: 0; }.topbar { height: 76px; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; background: white; border-bottom: 1px solid var(--slate-200); }.topbar-title span, .topbar-title strong { display: block; }.topbar-title span { color: var(--slate-500); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }.topbar-title strong { font-size: 14px; margin-top: 2px; }.topbar-actions, .profile { display: flex; align-items: center; gap: 12px; }.profile { padding-left: 12px; border-left: 1px solid var(--slate-200); }.profile strong { font-size: 12px; }.profile small { color: var(--slate-500); font-size: 10px; margin-top: 2px; }.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; color: white; background: var(--navy); font-size: 13px; font-weight: 800; }.icon-button { position: relative; width: 42px; height: 42px; border: 1px solid var(--slate-200); border-radius: 13px; background: white; color: var(--slate-700); cursor: pointer; }.notification-dot { position: absolute; right: 9px; top: 8px; width: 6px; height: 6px; background: var(--blue); border: 2px solid white; border-radius: 50%; }.mobile-menu { display: none; }
.page-content { max-width: 1500px; margin: 0 auto; padding: 30px 32px 60px; }.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }.eyebrow { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }.page-heading h1 { margin: 6px 0 0; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.04em; }.heading-actions, .form-actions, .inline-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.button { min-height: 43px; padding: 0 17px; display: inline-flex; justify-content: center; align-items: center; gap: 9px; border: 1px solid transparent; border-radius: 13px; cursor: pointer; font-size: 13px; font-weight: 800; }.button.primary { color: white; background: var(--navy); box-shadow: 0 10px 22px rgba(15,23,42,.15); }.button.primary:hover { background: var(--blue); }.button.secondary { background: white; border-color: var(--slate-200); }.button.danger { color: var(--danger); background: #fef2f2; }.button.small { min-height: 35px; padding: 0 12px; border-radius: 10px; font-size: 12px; }
.card { background: white; border: 1px solid var(--slate-200); border-radius: 22px; box-shadow: var(--shadow); }.card-head { min-height: 72px; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--slate-100); }.card-title { display: flex; align-items: center; gap: 12px; }.card-title > i { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--blue); background: var(--blue-soft); }.card-title h2 { margin: 0; font-size: 15px; }.card-title p { margin: 4px 0 0; color: var(--slate-500); font-size: 11px; }.card-body { padding: 22px; }
.section-stack { display: grid; gap: 18px; }.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }.field { grid-column: span 3; }.field.wide { grid-column: span 6; }.field.full { grid-column: 1 / -1; }.field label { display: flex; justify-content: space-between; margin: 0 0 8px; color: var(--slate-700); font-size: 11px; font-weight: 800; }.required { color: var(--danger); }.control { width: 100%; min-height: 46px; padding: 0 13px; color: var(--navy-soft); background: white; border: 1px solid var(--slate-200); border-radius: 12px; outline: none; transition: .2s; }.control:focus { border-color: #60a5fa; box-shadow: 0 0 0 4px rgba(59,130,246,.1); }.control::placeholder { color: #a8b3c4; }.control.textarea { min-height: 100px; padding-top: 12px; resize: vertical; }
.segmented { display: inline-flex; padding: 4px; background: var(--slate-100); border-radius: 12px; }.segmented label { margin: 0; padding: 9px 14px; border-radius: 9px; cursor: pointer; }.segmented input { position: absolute; opacity: 0; }.segmented label:has(input:checked) { color: white; background: var(--navy); }
.subheading { margin: 4px 0 16px; font-size: 12px; color: var(--slate-500); }.table-wrap { max-width: 100%; min-width: 0; overflow-x: auto; }.data-table { width: 100%; border-collapse: collapse; min-width: 820px; }.data-table th { padding: 11px 12px; color: var(--slate-500); background: var(--slate-50); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; text-align: left; }.data-table td { padding: 13px 12px; border-top: 1px solid var(--slate-100); font-size: 12px; }.data-table input { min-width: 90px; }.empty-row td { padding: 30px; color: var(--slate-400); text-align: center; }.form-footer { position: sticky; bottom: 12px; display: flex; justify-content: space-between; gap: 15px; padding: 15px 18px; margin-top: 20px; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border: 1px solid var(--slate-200); border-radius: 18px; box-shadow: 0 16px 40px rgba(15,23,42,.12); }
.crm-module form,
.section-stack,
.section-stack > .card { max-width: 100%; min-width: 0; }
.master-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }.master-card { min-height: 170px; padding: 22px; display: flex; flex-direction: column; border: 1px solid var(--slate-200); border-radius: 20px; background: white; box-shadow: var(--shadow); transition: transform .2s, border .2s; }.master-card:hover { transform: translateY(-3px); border-color: #93c5fd; }.master-icon { width: 44px; height: 44px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 14px; }.master-card h2 { margin: 17px 0 7px; font-size: 15px; }.master-card p { margin: 0; color: var(--slate-500); font-size: 12px; line-height: 1.6; }.master-card .arrow { margin-top: auto; align-self: flex-end; color: var(--slate-400); }
.filter-bar { padding: 18px; margin-bottom: 18px; }.filter-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; }.filter-grid .control { min-height: 42px; }.lead-list { display: grid; gap: 12px; }.lead-row { padding: 18px 20px; display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 20px; align-items: center; background: white; border: 1px solid var(--slate-200); border-radius: 17px; }.lead-company strong, .lead-meta strong { display: block; font-size: 13px; }.lead-company small, .lead-meta small { display: block; margin-top: 5px; color: var(--slate-500); font-size: 11px; }.badge { display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px; border-radius: 999px; font-size: 10px; font-weight: 800; }.badge.blue { color: #1d4ed8; background: #dbeafe; }.badge.green { color: #047857; background: #d1fae5; }.badge.amber { color: #b45309; background: #fef3c7; }.kpi-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }.kpi { padding: 20px; }.kpi span { color: var(--slate-500); font-size: 11px; font-weight: 700; }.kpi strong { display: block; margin-top: 9px; font-size: 28px; letter-spacing: -.04em; }.kpi small { color: var(--success); font-size: 10px; }
.sidebar-backdrop { display: none; }
@media (max-width: 1100px) { .field { grid-column: span 6; }.master-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.filter-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }.lead-row { grid-template-columns: 1.4fr 1fr auto; }.lead-row .lead-meta:nth-child(3) { display:none; } }
@media (max-width: 760px) { .app-shell { display:block; }.sidebar { position: fixed; left: -280px; width: 260px; transition: left .2s; }.sidebar.is-open { left:0; }.sidebar.is-open + .app-main + .sidebar-backdrop, body:has(.sidebar.is-open) .sidebar-backdrop { display:block; position:fixed; inset:0; background:rgba(2,6,23,.54); z-index:20; }.mobile-menu { display:block; }.topbar { padding:0 18px; }.topbar-title { display:none; }.profile > span:last-child { display:none; }.page-content { padding:24px 16px 44px; }.page-heading { align-items:flex-start; }.heading-actions .secondary { display:none; }.field, .field.wide { grid-column:1/-1; }.master-grid, .kpi-grid { grid-template-columns:1fr; }.filter-grid { grid-template-columns:1fr; }.lead-row { grid-template-columns:1fr auto; }.lead-row .lead-meta { display:none; }.form-footer { bottom:6px; }.card-body { padding:17px; } }

/* Authenticated ABOX console shell, matched to the HRMS workspace. */
.app-shell { display: block; min-height: 100vh; }
.system-bar { min-height: 28px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; color: #dbeafe; background: #1e3a8a; font-size: 10px; font-weight: 600; }
.system-bar > div { display: flex; align-items: center; gap: 7px; }
.system-bar a { color: white; }.system-divider { height: 13px; border-left: 1px solid rgba(255,255,255,.22); margin: 0 8px; }
.system-bar .status-dot { width: 7px; height: 7px; background: #34d399; box-shadow: none; }
.app-navbar { position: sticky; top: 0; z-index: 40; min-height: 64px; padding: 0 24px; display: flex; align-items: stretch; color: var(--slate-700); background: white; border-bottom: 1px solid var(--slate-200); box-shadow: 0 1px 3px rgba(15,23,42,.05); }
.app-navbar .brand { width: 206px; margin-right: 8px; padding: 0 24px 0 0; gap: 10px; color: var(--navy-soft); border-right: 1px solid var(--slate-200); }
.app-navbar .brand-mark { width: 38px; height: 38px; border-radius: 10px; box-shadow: none; }
.app-navbar .brand strong { font-size: 14px; }.app-navbar .brand small { color: var(--slate-500); font-size: 9px; }
.main-nav { display: flex; align-items: stretch; min-width: 0; overflow-x: auto; }
.main-nav .nav-item { position: relative; min-height: 64px; margin: 0; padding: 0 20px; gap: 8px; border-radius: 0; color: var(--slate-700); background: transparent; box-shadow: none; white-space: nowrap; font-size: 12px; font-weight: 500; }
.main-nav .nav-item i { width: auto; color: var(--slate-400); font-size: 8px; }.main-nav .nav-item:hover { color: var(--blue); background: var(--slate-50); }.main-nav .nav-item.is-active { color: var(--blue); background: #f8fbff; box-shadow: inset 0 -2px var(--blue); }
.app-navbar .topbar-actions { margin-left: auto; padding-left: 12px; background: white; }.app-navbar .profile { min-width: 178px; }.app-navbar .profile-arrow { color: var(--slate-400); font-size: 9px; margin-left: auto; }
.app-navbar .avatar { width: 36px; height: 36px; color: white; background: var(--blue); border-radius: 50%; }.app-navbar .profile strong { font-size: 11px; }.app-navbar .profile small { font-size: 9px; font-weight: 700; text-transform: uppercase; }
.page-content { max-width: 1600px; padding: 26px 24px 60px; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; color: var(--slate-500); font-size: 10px; }.breadcrumbs i { color: var(--slate-400); font-size: 7px; }.breadcrumbs strong { color: var(--blue); }
.page-heading { align-items: center; margin-bottom: 24px; }.page-heading h1 { margin: 0; font-size: 24px; letter-spacing: -.025em; }.page-heading p { margin: 6px 0 0; color: var(--slate-500); font-size: 12px; }
.button { min-height: 42px; border-radius: 11px; }.button.primary { background: var(--blue); box-shadow: 0 8px 18px rgba(37,99,235,.16); }.button.primary:hover { background: #1d4ed8; }.button.secondary { color: var(--slate-700); }
.card { border-color: #e5eaf1; border-radius: 16px; box-shadow: 0 1px 3px rgba(15,23,42,.04); }.card-head { min-height: 68px; padding: 16px 20px; }.card-body { padding: 20px; }.card-title > i { width: 36px; height: 36px; border-radius: 10px; }.card-title h2 { font-size: 14px; }.card-title p { font-size: 10px; }
.control { min-height: 42px; border-radius: 10px; }.field label { font-size: 11px; }.section-stack { gap: 16px; }
.command-bar { min-height: 64px; padding: 10px 18px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: white; border: 1px solid #e5eaf1; border-radius: 16px; box-shadow: 0 1px 3px rgba(15,23,42,.04); }.command-bar strong { font-size: 13px; }
.form-footer { position: static; margin-top: 16px; border-radius: 16px; box-shadow: none; }
.master-card { min-height: 160px; border-radius: 16px; box-shadow: 0 1px 3px rgba(15,23,42,.04); }.lead-row { border-radius: 14px; box-shadow: 0 1px 3px rgba(15,23,42,.03); }
@media (max-width: 1050px) { .app-navbar { padding: 0 14px; }.app-navbar .brand { width: 172px; }.main-nav .nav-item { padding: 0 13px; }.app-navbar .profile { min-width: auto; }.app-navbar .profile > span:nth-child(2), .profile-arrow { display:none; } }
@media (max-width: 760px) { .system-bar { padding: 0 14px; }.app-navbar { flex-wrap: wrap; min-height: auto; }.app-navbar .brand { height: 58px; border-right: 0; }.app-navbar .topbar-actions { height: 58px; }.main-nav { order: 3; width: 100%; border-top: 1px solid var(--slate-100); }.main-nav .nav-item { min-height: 46px; padding: 0 14px; }.page-content { padding: 20px 14px 44px; }.page-heading h1 { font-size: 22px; }.command-bar { align-items: flex-start; flex-direction: column; }.command-bar .form-actions { width: 100%; }.command-bar .button { flex: 1; } }
.report-notice {
  align-items: center;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  color: #1e40af;
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 16px;
}

.empty-table {
  color: #64748b;
  padding: 36px 16px !important;
  text-align: center;
}

.map-kpi-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
}

.lead-map-card {
  overflow: hidden;
}

.map-toolbar {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 20px 22px;
}

.map-toolbar h2 {
  margin: 0 0 4px;
}

.map-toolbar p {
  color: #64748b;
  margin: 0;
}

.map-view-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lead-map {
  background: #e2e8f0;
  border-block: 1px solid #dbe3ef;
  height: min(68vh, 720px);
  min-height: 470px;
  width: 100%;
  z-index: 1;
}

.map-status-filter {
  min-width: 170px;
}

.map-legend {
  align-items: center;
  color: #475569;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 13px 22px;
}

.map-legend span {
  align-items: center;
  display: inline-flex;
  gap: 7px;
}

.map-legend small {
  margin-left: auto;
}

.legend-dot {
  border-radius: 50%;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.legend-marker {
  border-radius: 50%;
  display: inline-block;
  height: 12px;
  width: 12px;
}

.legend-exact {
  background: #2563eb;
  border: 2px solid #1d4ed8;
}

.legend-approximate {
  background: #fbbf24;
  border: 2px solid #d97706;
}

.map-location-exact { color: #1d4ed8 !important; font-weight: 700; }
.map-location-approximate { color: #b45309 !important; font-weight: 700; }

.legend-low { background: #2563eb; }
.legend-medium { background: #f59e0b; }
.legend-high { background: #dc2626; }

.lead-map-popup {
  display: grid;
  gap: 3px;
  min-width: 180px;
}

.lead-map-popup strong {
  color: #0f172a;
  font-size: 14px;
}

.lead-map-popup span,
.lead-map-popup small {
  color: #475569;
}

.map-load-error {
  align-items: center;
  color: #991b1b;
  display: flex;
  height: 100%;
  justify-content: center;
}

@media (max-width: 980px) {
  .map-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .map-kpi-grid {
    grid-template-columns: 1fr;
  }

  .lead-map {
    height: 62vh;
    min-height: 400px;
  }

  .map-view-switch,
  .map-view-switch .button {
    width: 100%;
  }
}

/* Legacy-compatible Follow-up Summary. */
.followup-command-bar { margin-bottom: 16px; }
.followup-kpis .kpi { transition: border-color .2s, transform .2s; }
.followup-kpis .kpi:hover { border-color: #93c5fd; transform: translateY(-2px); }
.followup-filter-grid { grid-template-columns: repeat(6,minmax(0,1fr)); }
.followup-list { display: grid; gap: 14px; }
.followup-card { background: white; border: 1px solid #e3e9f1; border-radius: 16px; box-shadow: 0 2px 8px rgba(15,23,42,.035); overflow: hidden; }
.followup-card-head { align-items: center; background: linear-gradient(90deg,#fff,#f8fbff); border-bottom: 1px solid var(--slate-100); display: flex; gap: 20px; justify-content: space-between; padding: 14px 17px; }
.followup-date-box { background: var(--blue-soft); border-radius: 11px; min-width: 150px; padding: 10px 13px; text-align: right; }
.followup-date-box small,.followup-date-box strong { display: block; }
.followup-date-box small { color: var(--slate-500); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.followup-date-box strong { color: var(--blue); font-size: 12px; margin-top: 4px; }
.followup-card-grid { display: grid; grid-template-columns: 1.2fr 1.3fr 1fr 1.3fr; }
.followup-conversation { align-items: flex-start; background: #f8fafc; border-top: 1px solid var(--slate-100); display: flex; gap: 10px; padding: 11px 17px; }
.followup-conversation > i { color: var(--blue); margin-top: 2px; }
.followup-conversation small,.followup-conversation span { display: block; }
.followup-conversation small { color: var(--slate-500); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.followup-conversation span { color: var(--slate-700); font-size: 10px; line-height: 1.5; margin-top: 3px; }
.followup-owner { color: var(--slate-500); font-size: 10px; font-weight: 700; margin-right: auto; }
@media (max-width: 1200px) {
  .followup-filter-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .followup-card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .followup-card-grid .lead-detail-block:nth-child(3) { border-left: 0; border-top: 1px solid var(--slate-100); }
  .followup-card-grid .lead-detail-block:nth-child(4) { border-top: 1px solid var(--slate-100); }
}
@media (max-width: 700px) {
  .followup-filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .followup-card-head { align-items: flex-start; flex-direction: column; }
  .followup-date-box { min-width: 0; text-align: left; width: 100%; }
}
@media (max-width: 560px) {
  .followup-filter-grid,.followup-card-grid { grid-template-columns: 1fr; }
  .followup-filter-grid .field,.followup-filter-grid .field.wide { grid-column: 1; }
  .followup-card-grid .lead-detail-block + .lead-detail-block { border-left: 0; border-top: 1px solid var(--slate-100); }
}
.master-section-heading { align-items: end; display: flex; justify-content: space-between; margin: 30px 0 14px; }
.master-section-heading:first-of-type { margin-top: 0; }
.master-section-heading > div { align-items: center; display: flex; gap: 10px; }
.master-section-heading span { align-items: center; background: var(--blue-soft); border-radius: 8px; color: var(--blue); display: inline-flex; font-size: 10px; font-weight: 800; height: 28px; justify-content: center; width: 28px; }
.master-section-heading h2 { font-size: 15px; margin: 0; }
.master-section-heading p { color: var(--slate-500); font-size: 10px; margin: 0; }
.region-path { align-items: center; background: white; border: 1px solid var(--slate-200); border-radius: 12px; display: flex; gap: 9px; margin-bottom: 16px; padding: 10px 14px; }
.region-path span { border-radius: 8px; color: var(--slate-500); font-size: 10px; font-weight: 800; padding: 7px 10px; }
.region-path span.active { background: var(--blue); color: white; }
.region-path i { color: var(--slate-400); font-size: 7px; }
.region-context { color: var(--slate-500); font-size: 10px; }
.region-table { min-width: 820px; }
@media (max-width: 620px) {
  .master-section-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .region-path { overflow-x: auto; }
}

/* Lead register: modern ABOX rendering of the legacy Joomla operational list. */
.lead-command-bar {
  align-items: center;
  background: #fff;
  border: 1px solid #e5eaf1;
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 13px 16px;
}
.lead-command-bar strong,
.lead-command-bar span { display: block; }
.lead-command-bar strong { font-size: 14px; }
.lead-command-bar span { color: var(--slate-500); font-size: 11px; margin-top: 3px; }
.lead-filter-card { margin-bottom: 16px; overflow: hidden; }
.lead-filter-card summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: auto 1fr auto;
  list-style: none;
  padding: 16px 18px;
}
.lead-filter-card summary::-webkit-details-marker { display: none; }
.lead-filter-card summary span { align-items: center; display: flex; font-size: 13px; font-weight: 800; gap: 9px; }
.lead-filter-card summary span i { color: var(--blue); }
.lead-filter-card summary small { color: var(--slate-500); font-size: 10px; }
.lead-filter-card[open] .filter-chevron { transform: rotate(180deg); }
.filter-chevron { color: var(--slate-400); font-size: 10px; transition: transform .2s; }
.lead-filter-form { border-top: 1px solid var(--slate-100); padding: 18px; }
.lead-filter-grid { display: grid; gap: 13px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.lead-filter-grid .field { grid-column: span 1; }
.lead-filter-grid .field.wide { grid-column: span 2; }
.lead-filter-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.lead-register-list { display: grid; gap: 13px; }
.lead-register-card {
  background: #fff;
  border: 1px solid #e3e9f1;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(15,23,42,.035);
  overflow: hidden;
}
.lead-card-head {
  align-items: center;
  background: linear-gradient(90deg, #fff, #fbfdff);
  border-bottom: 1px solid var(--slate-100);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 14px 17px;
}
.lead-identity { align-items: center; display: flex; gap: 12px; min-width: 0; }
.lead-sequence {
  align-items: center;
  background: var(--blue-soft);
  border-radius: 10px;
  color: var(--blue);
  display: flex;
  flex: 0 0 38px;
  font-size: 11px;
  font-weight: 800;
  height: 38px;
  justify-content: center;
}
.lead-title-line { align-items: center; display: flex; flex-wrap: wrap; gap: 9px; }
.lead-title-line h2 { font-size: 14px; margin: 0; }
.lead-identity p { color: var(--slate-500); font-size: 10px; margin: 4px 0 0; }
.badge.red { background: #fee2e2; color: #b91c1c; }
.lead-head-meta { display: flex; gap: 24px; }
.lead-head-meta span { min-width: 90px; }
.lead-head-meta small,
.lead-head-meta strong { display: block; }
.lead-head-meta small,
.lead-detail-block small,
.lead-activity-strip small { color: var(--slate-500); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.lead-head-meta strong { font-size: 11px; margin-top: 4px; }
.lead-card-body { display: grid; gap: 0; grid-template-columns: 1.45fr 1fr 1fr 1fr; }
.lead-detail-block { display: flex; gap: 11px; min-width: 0; padding: 16px; }
.lead-detail-block + .lead-detail-block { border-left: 1px solid var(--slate-100); }
.lead-detail-block > i {
  align-items: center;
  background: var(--blue-soft);
  border-radius: 9px;
  color: var(--blue);
  display: flex;
  flex: 0 0 32px;
  height: 32px;
  justify-content: center;
}
.lead-detail-block > div { min-width: 0; }
.lead-detail-block strong,
.lead-detail-block a,
.lead-detail-block p { overflow-wrap: anywhere; }
.lead-detail-block strong { display: block; font-size: 11px; margin-top: 5px; }
.lead-detail-block a { color: var(--blue); display: block; font-size: 11px; margin-top: 5px; }
.lead-detail-block p { color: var(--slate-500); font-size: 10px; line-height: 1.45; margin: 4px 0 0; }
.lead-inline-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.lead-inline-tags span {
  background: var(--slate-100);
  border-radius: 999px;
  color: var(--slate-700);
  font-size: 9px;
  padding: 4px 7px;
}
.lead-activity-strip {
  align-items: flex-start;
  background: #f8fafc;
  border-top: 1px solid var(--slate-100);
  display: flex;
  gap: 9px;
  padding: 10px 17px;
}
.lead-activity-strip i { color: var(--slate-400); margin-top: 2px; }
.lead-activity-strip small { display: block; }
.lead-activity-strip span { color: var(--slate-700); display: block; font-size: 10px; line-height: 1.45; margin-top: 3px; }
.lead-card-actions {
  align-items: center;
  border-top: 1px solid var(--slate-100);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 11px 16px;
}
.lead-quote-state { color: var(--success); font-size: 10px; font-weight: 700; margin-left: auto; }
.button.quote { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.button.quote:hover { background: #6d28d9; border-color: #6d28d9; color: #fff; }
.lead-quote-state { text-decoration: none; }
.quote-workspace,
#crm-quotation-form,
.quote-workspace > .card { max-width: 100%; min-width: 0; width: 100%; }
.quote-workspace { max-width: 1500px; }
.quote-gst-type { width: max-content; }
.quote-products-card { border-color: #bfdbfe; }
.quote-products-head { background: linear-gradient(100deg, #eff6ff 0%, #fff 72%); border-bottom-color: #bfdbfe; }
.quote-products-head .card-title > i { background: #2563eb; color: #fff; }
.quote-add-product-button {
  background: #f97316;
  border-color: #f97316;
  box-shadow: 0 8px 18px rgba(249,115,22,.22);
  color: #fff;
}
.quote-add-product-button:hover { background: #ea580c; border-color: #ea580c; color: #fff; }
.quote-product-autocomplete { position: relative; }
.quote-product-autocomplete > i {
  color: #2563eb;
  left: 13px;
  pointer-events: none;
  position: absolute;
  top: 15px;
  z-index: 1;
}
.quote-product-autocomplete .quote-product-search { padding-left: 38px; }
.quote-product-autocomplete .quote-product-search:focus { background: #f8fbff; }
.quote-items-wrap { max-width: 100%; min-width: 0; overflow-x: auto; }
.quote-items-table { min-width: 1180px; }
.quote-items-table td { vertical-align: top; }
.quote-items-table th:first-child, .quote-items-table td:first-child { min-width: 330px; }
.quote-items-table .control { min-width: 92px; }
.quote-description { min-height: 62px; margin-top: 7px; resize: vertical; }
.quote-line-total { display: block; min-width: 100px; padding: 10px 4px; font-weight: 800; color: var(--text); text-align: right; }
.icon-button { border: 0; background: #f1f5f9; color: #64748b; border-radius: 8px; width: 36px; height: 36px; cursor: pointer; }
.icon-button:hover { color: #dc2626; background: #fee2e2; }
.quote-totals { display: flex; justify-content: flex-end; gap: 22px; padding: 18px 22px; border-top: 1px solid var(--border); }
.quote-totals div { min-width: 130px; display: grid; gap: 3px; }
.quote-totals span { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.quote-totals strong { font-size: 18px; }
.quote-totals .grand { padding-left: 20px; border-left: 2px solid #c4b5fd; }
.quote-totals .grand strong { color: #6d28d9; font-size: 24px; }
.quote-terms { display: grid; gap: 10px; }
.quote-term-row { display: grid; grid-template-columns: minmax(180px, .35fr) 1fr 40px; gap: 10px; align-items: start; }
.quote-term-row textarea { min-height: 44px; resize: vertical; }
.quotation-register-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.quotation-register-card { padding: 20px; display: grid; gap: 16px; }
.quotation-register-card header, .quotation-register-card footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.quotation-register-card h2, .quotation-register-card p { margin: 0; }
.quotation-register-meta { display: flex; gap: 18px; color: var(--muted); font-size: 12px; }
.quotation-register-total { display: grid; gap: 3px; padding: 14px; border-radius: 12px; background: #f8fafc; }
.quotation-register-total span, .quotation-register-total small { color: var(--muted); }
.quotation-register-total strong { font-size: 24px; color: #6d28d9; }
.quote-success { padding: 12px 15px; margin-bottom: 14px; border: 1px solid #86efac; border-radius: 10px; background: #f0fdf4; color: #15803d; font-weight: 700; }
.quotation-document { max-width: 1100px; margin: 0 auto; padding: 36px; }
.quotation-document { position: relative; overflow: hidden; }
.quotation-watermark { position: absolute; inset: 28% auto auto 50%; width: 360px; max-height: 360px; object-fit: contain; opacity: .035; transform: translateX(-50%); pointer-events: none; }
.quotation-brand { display: flex; align-items: flex-start; gap: 16px; }
.quotation-brand > img { width: 72px; height: 72px; object-fit: contain; }
.quotation-document-head, .quotation-parties, .quotation-document-footer { display: flex; justify-content: space-between; gap: 30px; }
.quotation-document-head { padding-bottom: 22px; border-bottom: 3px solid #2563eb; }
.quotation-document-head h2 { margin: 4px 0; font-size: 30px; letter-spacing: .08em; }
.quotation-document-head > div:last-child { display: grid; justify-items: end; gap: 5px; }
.quotation-document-head > div:last-child > strong { font-size: 25px; }
.quotation-parties { padding: 24px 0; }
.quotation-parties > div { flex: 1; padding: 16px; background: #f8fafc; border-radius: 12px; }
.quotation-parties h3, .quotation-parties p, .quotation-copy h3, .quotation-copy p { margin: 4px 0; }
.quotation-copy { margin-bottom: 22px; }
.quotation-print-table td small { display: block; margin-top: 4px; color: var(--muted); }
.quotation-document-summary { width: min(430px, 100%); margin: 22px 0 22px auto; display: grid; }
.quotation-document-summary div { display: flex; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.quotation-document-summary .grand { background: #eff6ff; color: #1d4ed8; font-size: 20px; }
.quotation-document-terms li { margin-bottom: 9px; }
.quotation-document-terms li span { display: block; color: var(--muted); }
.quotation-amount-words { margin: 0 0 22px; padding: 12px 14px; border: 1px solid #dbeafe; border-radius: 10px; background: #f8fbff; font-size: 12px; }
.quotation-bottom-grid { display: grid; grid-template-columns: minmax(260px,.8fr) minmax(0,1.2fr); gap: 28px; padding-top: 8px; }
.quotation-bottom-grid h3 { font-size: 13px; margin: 0 0 10px; }
.quotation-bank { margin: 0; display: grid; gap: 6px; }
.quotation-bank div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; font-size: 11px; }
.quotation-bank dt { color: var(--muted); font-weight: 700; }
.quotation-bank dd { margin: 0; font-weight: 700; }
.quotation-list-table { min-width: 1280px; }
.quotation-list-table td small { display: block; margin-top: 4px; color: var(--muted); }
.quotation-list-table td > a { color: var(--blue); font-weight: 700; }
.quotation-list-card { max-width: 100%; min-width: 0; overflow: hidden; }
.quotation-document-footer { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border); }
@media (max-width: 900px) {
  .kpi-grid,
  .map-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .kpi-grid,
  .map-kpi-grid { grid-template-columns: 1fr; }
  #crm-quotation-form .lead-command-bar { width: 100%; }
  #crm-quotation-form .lead-command-bar .inline-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  #crm-quotation-form .lead-command-bar .button { width: 100%; }
  .quote-workspace .card { overflow: hidden; }
  .quote-workspace .card-head { align-items: flex-start; flex-wrap: wrap; padding: 15px; }
  .quote-workspace .card-head .card-title { align-items: flex-start; min-width: 0; }
  .quote-workspace .card-head .card-title > div { min-width: 0; }
  .quote-workspace .card-head .button { margin-left: 48px; }
  .quote-products-head { background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%); }
  .quote-products-head .card-title h2 { color: #1e3a8a; font-size: 15px; }
  .quote-products-head .card-title p { color: #475569; }
  .quote-gst-type { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .quote-gst-type label { justify-content: center; text-align: center; }
  .quote-items-wrap { overflow: visible; padding: 0 14px 14px; }
  .quote-items-table { display: block; min-width: 0; width: 100%; }
  .quote-items-table thead { display: none; }
  .quote-items-table tbody { display: grid; gap: 12px; width: 100%; }
  .quote-items-table .quote-item-row {
    background: #f8fafc;
    border: 1px solid var(--slate-200);
    border-radius: 13px;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 13px;
    width: 100%;
  }
  .quote-items-table .quote-item-row td {
    border: 0;
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 0;
  }
  .quote-items-table .quote-item-row td::before {
    color: var(--slate-500);
    content: "";
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .quote-items-table .quote-item-row td:first-child { grid-column: 1 / -1; min-width: 0; }
  .quote-items-table .quote-item-row td:first-child::before { content: "Product / Description"; }
  .quote-items-table .quote-item-row td:nth-child(2)::before { content: "HSN"; }
  .quote-items-table .quote-item-row td:nth-child(3)::before { content: "Rate"; }
  .quote-items-table .quote-item-row td:nth-child(4)::before { content: "Quantity"; }
  .quote-items-table .quote-item-row td:nth-child(5)::before { content: "Discount"; }
  .quote-items-table .quote-item-row td:nth-child(6)::before { content: "GST %"; }
  .quote-items-table .quote-item-row td:nth-child(7)::before { content: "Amount"; }
  .quote-items-table .quote-item-row td:nth-child(8) { align-items: end; display: flex; justify-content: flex-end; }
  .quote-items-table .control { min-width: 0; width: 100%; }
  .quote-description { min-height: 76px; }
  .quote-line-total { background: #fff; border: 1px solid var(--slate-200); border-radius: 10px; min-width: 0; padding: 13px; text-align: left; }
  .quote-totals { display: grid; grid-template-columns: 1fr 1fr; }
  .quote-totals .grand { grid-column: 1 / -1; padding: 10px 0 0; border-left: 0; border-top: 2px solid #c4b5fd; }
  .quote-term-row { grid-template-columns: 1fr 40px; }
  .quote-term-row textarea { grid-column: 1; }
  .quotation-document { padding: 20px; }
  .quotation-document-head, .quotation-parties, .quotation-document-footer { display: grid; }
  .quotation-bottom-grid { grid-template-columns: 1fr; }
  .quotation-document-head > div:last-child { justify-items: start; }
}
@media (max-width: 430px) {
  .quote-items-table .quote-item-row { grid-template-columns: 1fr; }
  .quote-items-table .quote-item-row td:first-child { grid-column: 1; }
  .quote-totals { grid-template-columns: 1fr; gap: 12px; }
  .quote-totals .grand { grid-column: 1; }
  .quote-workspace .card-head .button { margin-left: 0; width: 100%; }
  .quote-term-row { grid-template-columns: minmax(0, 1fr) 40px; }
}
@media print {
  .quote-preview-actions, .quote-success { display: none !important; }
  .quotation-document { box-shadow: none; border: 0; padding: 0; max-width: none; }
  .quotation-document-head h2 { font-size: 24px; }
  .quotation-print-table { min-width: 0; }
  .quotation-print-table th, .quotation-print-table td { padding: 7px; font-size: 9px; }
}

/* CRM Administrator dashboard */
.crm-dashboard {
    display: grid;
    gap: 22px;
    padding-bottom: 32px;
}

.crm-dashboard-hero {
    background:
        radial-gradient(circle at 85% 15%, rgba(255,255,255,.22), transparent 26%),
        linear-gradient(135deg, #173ea5 0%, #2762e9 52%, #5038b8 100%);
    border-radius: 24px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 30px;
    box-shadow: 0 18px 40px rgba(37, 78, 183, .18);
}

.crm-dashboard-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.crm-dashboard-hero h1 {
    margin: 13px 0 5px;
    font-size: clamp(25px, 3vw, 36px);
    line-height: 1.15;
    font-weight: 800;
}

.crm-dashboard-hero p {
    margin: 0;
    color: rgba(255,255,255,.8);
    font-size: 14px;
}

.crm-dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 9px;
}

.crm-dashboard-actions .button {
    min-height: 42px;
    border-radius: 11px;
}

.crm-dashboard-actions .button.white {
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.28);
    color: #fff;
}

.crm-dashboard-actions .button.accent {
    background: #fff;
    border-color: #fff;
    color: #1948be;
}

.crm-dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.crm-dashboard-kpi {
    --kpi-color: #2563eb;
    --kpi-bg: #eff6ff;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 18px;
    border: 1px solid #e4eaf3;
    border-radius: 18px;
    background: #fff;
    color: #15243d;
    box-shadow: 0 5px 16px rgba(20, 46, 82, .05);
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.crm-dashboard-kpi:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--kpi-color) 40%, #e4eaf3);
    box-shadow: 0 10px 25px rgba(20, 46, 82, .09);
}

.crm-dashboard-kpi span {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #63718a;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.crm-dashboard-kpi span i {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border-radius: 9px;
    color: var(--kpi-color);
    background: var(--kpi-bg);
}

.crm-dashboard-kpi strong {
    font-size: clamp(23px, 2vw, 30px);
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-dashboard-kpi small {
    color: #758198;
    font-size: 11px;
    line-height: 1.45;
}

.crm-dashboard-kpi.violet { --kpi-color:#7c3aed; --kpi-bg:#f5f3ff; }
.crm-dashboard-kpi.amber { --kpi-color:#d97706; --kpi-bg:#fffbeb; }
.crm-dashboard-kpi.emerald { --kpi-color:#059669; --kpi-bg:#ecfdf5; }
.crm-dashboard-kpi.indigo { --kpi-color:#4f46e5; --kpi-bg:#eef2ff; }
.crm-dashboard-kpi.rose { --kpi-color:#e11d48; --kpi-bg:#fff1f2; }

.crm-dashboard-grid {
    display: grid;
    gap: 18px;
}

.crm-dashboard-grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(300px, .85fr); }
.crm-dashboard-grid-work { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.crm-dashboard-grid-bottom { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }

.crm-dashboard-panel {
    border-radius: 20px;
    overflow: hidden;
}

.crm-panel-head {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #edf1f6;
}

.crm-panel-head span {
    display: block;
    margin-bottom: 3px;
    color: #8a96a9;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.crm-panel-head h2 {
    margin: 0;
    color: #18263e;
    font-size: 16px;
    font-weight: 800;
}

.crm-panel-head > a {
    color: #2762df;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.crm-trend-chart {
    height: 270px;
    display: grid;
    grid-template-columns: repeat(12, minmax(28px, 1fr));
    align-items: end;
    gap: 9px;
    padding: 25px 22px 9px;
}

.crm-trend-month {
    height: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
    gap: 8px;
}

.crm-trend-bars {
    height: 215px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    border-bottom: 1px solid #e7ecf3;
}

.crm-trend-bars i {
    width: min(12px, 42%);
    min-height: 3px;
    border-radius: 5px 5px 1px 1px;
}

.crm-trend-bars .leads, .crm-chart-legend i.leads { background: #2864e8; }
.crm-trend-bars .quotes, .crm-chart-legend i.quotes { background: #9b7ae8; }
.crm-trend-month > span { text-align: center; color: #7e899b; font-size: 10px; font-weight: 700; }
.crm-chart-legend { display: flex; justify-content: center; gap: 20px; padding: 2px 20px 18px; color: #657187; font-size: 11px; }
.crm-chart-legend span { display: flex; align-items: center; gap: 6px; }
.crm-chart-legend i { width: 8px; height: 8px; border-radius: 2px; }

.crm-status-stack { display: grid; gap: 15px; padding: 20px; }
.crm-status-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 12px; color: #59677e; }
.crm-status-row strong { color: #23324b; }
.crm-status-track { height: 7px; overflow: hidden; border-radius: 999px; background: #edf1f7; }
.crm-status-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#2a65e8,#8c72e1); }

.crm-dashboard-list { display: grid; }
.crm-dashboard-list > a {
    min-width: 0;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 12px 18px;
    border-bottom: 1px solid #f0f3f7;
    text-decoration: none;
}
.crm-dashboard-list > a:last-child { border-bottom: 0; }
.crm-dashboard-list > a:hover { background: #f8faff; }
.crm-list-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: #eef4ff; color: #2863df; }
.crm-list-icon.overdue { color: #dc2626; background: #fff1f2; }
.crm-list-icon.today { color: #d97706; background: #fffbeb; }
.crm-list-copy { min-width: 0; }
.crm-list-copy strong, .crm-list-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-list-copy strong { color: #24334c; font-size: 12px; }
.crm-list-copy small { margin-top: 2px; color: #8590a2; font-size: 10px; }
.crm-list-date { color: #68758b; font-size: 10px; font-weight: 700; white-space: nowrap; }
.crm-list-date.overdue { color: #dc2626; }
.crm-dashboard-empty { padding: 24px; color: #748198; font-size: 13px; }

.crm-quote-funnel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 20px;
}
.crm-quote-funnel > div { min-width: 0; padding: 15px; border-radius: 14px; background: #f7f9fc; }
.crm-quote-funnel span, .crm-quote-funnel small { display: block; color: #748198; font-size: 10px; }
.crm-quote-funnel strong { display: block; margin: 7px 0 5px; color: #1d2b43; font-size: 23px; }
.crm-quote-funnel small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.crm-user-performance { display: grid; }
.crm-user-performance > div { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px 18px; border-bottom: 1px solid #f0f3f7; }
.crm-user-performance > div:last-child { border-bottom: 0; }
.crm-user-rank { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; background: #edf3ff; color: #2862da; font-size: 10px; font-weight: 800; }
.crm-user-name { min-width: 0; }
.crm-user-name strong, .crm-user-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-user-name strong { color: #25344d; font-size: 12px; }
.crm-user-name small { margin-top: 2px; color: #8b96a7; font-size: 10px; }
.crm-user-performance > div > strong { color: #526078; font-size: 11px; white-space: nowrap; }

@media (max-width: 1280px) {
    .crm-dashboard-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .crm-dashboard-hero { align-items: flex-start; flex-direction: column; }
    .crm-dashboard-actions { justify-content: flex-start; }
    .crm-dashboard-grid-main, .crm-dashboard-grid-work, .crm-dashboard-grid-bottom { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .crm-dashboard { gap: 15px; }
    .crm-dashboard-hero { padding: 22px 18px; border-radius: 18px; }
    .crm-dashboard-hero h1 { font-size: 25px; }
    .crm-dashboard-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
    .crm-dashboard-actions .button { justify-content: center; padding-inline: 10px; }
    .crm-dashboard-actions .button.accent { grid-column: 1 / -1; }
    .crm-dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .crm-dashboard-kpi { padding: 14px; border-radius: 15px; }
    .crm-dashboard-kpi strong { font-size: 21px; }
    .crm-dashboard-kpi.rose strong { font-size: 16px; }
    .crm-panel-head { padding: 15px; }
    .crm-panel-head h2 { font-size: 14px; }
    .crm-panel-head > a { font-size: 10px; }
    .crm-trend-chart { overflow-x: auto; grid-template-columns: repeat(12, 34px); justify-content: start; padding-inline: 15px; }
    .crm-dashboard-list > a { grid-template-columns: 34px minmax(0,1fr); padding-inline: 14px; }
    .crm-list-date { grid-column: 2; }
    .crm-quote-funnel { grid-template-columns: repeat(2, minmax(0,1fr)); padding: 14px; }
}

@media print {
    .crm-dashboard-actions { display: none !important; }
    .crm-dashboard { gap: 10px; }
    .crm-dashboard-hero { color: #111827; background: #fff; box-shadow: none; border: 1px solid #dbe2eb; }
    .crm-dashboard-hero p { color: #4b5563; }
}
.lead-empty { padding: 54px 20px; text-align: center; }
.lead-empty > i { color: var(--slate-400); font-size: 34px; }
.lead-empty h2 { font-size: 17px; margin: 14px 0 6px; }
.lead-empty p { color: var(--slate-500); font-size: 11px; margin: 0 0 18px; }
.lead-pagination { align-items: center; display: flex; justify-content: space-between; padding: 18px 3px 0; }
.lead-pagination > span { color: var(--slate-500); font-size: 11px; }
.lead-pagination > div { display: flex; gap: 8px; }

@media (max-width: 1200px) {
  .lead-filter-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .lead-card-body { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .lead-detail-block:nth-child(3) { border-left: 0; border-top: 1px solid var(--slate-100); }
  .lead-detail-block:nth-child(4) { border-top: 1px solid var(--slate-100); }
}
@media (max-width: 800px) {
  .lead-filter-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .lead-card-head { align-items: flex-start; flex-direction: column; }
  .lead-head-meta { gap: 14px; width: 100%; }
  .lead-head-meta span { min-width: 0; }
}
@media (max-width: 560px) {
  .lead-command-bar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .lead-filter-card summary { grid-template-columns: 1fr auto; }
  .lead-filter-card summary small { display: none; }
  .lead-filter-grid,
  .lead-card-body { grid-template-columns: 1fr; }
  .lead-filter-grid .field,
  .lead-filter-grid .field.wide { grid-column: 1; }
  .lead-detail-block + .lead-detail-block { border-left: 0; border-top: 1px solid var(--slate-100); }
  .lead-head-meta { display: grid; grid-template-columns: repeat(3,1fr); }
  .lead-card-actions .button { flex: 1 1 calc(50% - 8px); }
  .lead-quote-state { margin-left: 0; width: 100%; }
}

@media print {
  .system-bar, .app-navbar, .breadcrumbs, .heading-actions, .lead-command-bar,
  .lead-filter-card, .lead-card-actions, .lead-pagination { display: none !important; }
  body { background: #fff; }
  .page-content { max-width: none; padding: 0; }
  .lead-register-card { break-inside: avoid; box-shadow: none; }
}

/* CRM Config masters: shared safe CRUD layout. */
.master-workspace { align-items: start; display: grid; gap: 18px; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); }
.master-form-card { position: sticky; top: 82px; }
.master-form-fields { display: grid; gap: 16px; }
.master-form-actions { border-top: 1px solid var(--slate-100); display: flex; gap: 10px; margin-top: 20px; padding-top: 18px; }
.master-list-card { min-width: 0; overflow: hidden; }
.master-search { align-items: center; background: var(--slate-50); border: 1px solid var(--slate-200); border-radius: 10px; display: flex; min-width: 230px; padding: 0 11px; }
.master-search > i { color: var(--slate-400); font-size: 11px; }
.master-search input { background: transparent; border: 0; min-height: 38px; outline: 0; padding: 0 9px; width: 100%; }
.master-search a { color: var(--slate-400); }
.master-alert { align-items: center; border: 1px solid; border-radius: 12px; display: flex; gap: 10px; margin-bottom: 16px; padding: 12px 15px; font-size: 12px; font-weight: 700; }
.master-alert.success { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.master-alert.error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.master-table { min-width: 700px; }
.master-table td strong { font-size: 12px; }
.master-table form { margin: 0; }
.master-table .button[disabled] { cursor: not-allowed; opacity: .38; }
.master-unused { color: var(--slate-400); }
@media (max-width: 980px) {
  .master-workspace { grid-template-columns: 1fr; }
  .master-form-card { position: static; }
}
@media (max-width: 620px) {
  .master-list-card .card-head { align-items: stretch; flex-direction: column; }
  .master-search { min-width: 0; width: 100%; }
}

/* Legacy CRM MIS reports rebuilt as responsive operational matrices. */
.mis-filter-card { border-color: #bfdbfe; }
.mis-filter-card summary { background: linear-gradient(100deg, #eff6ff 0%, #fff 72%); }
.mis-filter-grid { grid-template-columns: repeat(6, minmax(140px, 1fr)); }
.mis-print-button { background: #0f766e; border-color: #0f766e; color: #fff; }
.mis-print-button:hover { background: #115e59; border-color: #115e59; color: #fff; }
.mis-report-card { overflow: hidden; }
.mis-report-card .card-head { align-items: center; gap: 16px; }
.mis-legend { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 999px; color: #1d4ed8; font-size: 10px; font-weight: 800; padding: 7px 10px; }
.mis-wide-table { overflow-x: auto; }
.mis-report-table { min-width: 760px; }
.mis-wide-table .mis-report-table { min-width: max-content; }
.mis-report-table th,
.mis-report-table td { vertical-align: top; white-space: nowrap; }
.mis-report-table td:first-child,
.mis-report-table th:first-child { background: #fff; left: 0; position: sticky; z-index: 2; }
.mis-report-table thead th:first-child { background: var(--slate-50); z-index: 4; }
.mis-report-table tfoot th { background: #eff6ff; color: #1e3a8a; font-weight: 800; }
.mis-report-table tfoot th:first-child { background: #dbeafe; }
.mis-group-head th { background: #dbeafe; border-bottom-color: #93c5fd; color: #1e3a8a; text-align: center; }
.mis-cell-link { color: #1d4ed8; display: grid; gap: 3px; text-decoration: none; }
.mis-cell-link:hover strong { text-decoration: underline; }
.mis-report-table td > strong,
.mis-cell-link strong { display: block; font-size: 11px; }
.mis-report-table td small,
.mis-cell-link small { color: var(--slate-500); display: block; font-size: 9px; line-height: 1.45; }
.mis-chart-card { overflow: hidden; }
.mis-bar-list { display: grid; gap: 11px; }
.mis-bar-row { align-items: center; display: grid; gap: 12px; grid-template-columns: minmax(130px, 220px) minmax(140px, 1fr) 60px; }
.mis-bar-row > span { color: var(--slate-700); font-size: 11px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mis-bar-row > div { background: #e2e8f0; border-radius: 999px; height: 9px; overflow: hidden; }
.mis-bar-row > div i { background: linear-gradient(90deg, #2563eb, #60a5fa); border-radius: inherit; display: block; height: 100%; min-width: 2px; }
.mis-bar-row > strong { color: var(--slate-700); font-size: 11px; text-align: right; }

@media (max-width: 1200px) {
  .mis-filter-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
}
@media (max-width: 760px) {
  .mis-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mis-report-card .card-head { align-items: flex-start; flex-direction: column; }
  .mis-legend { border-radius: 10px; line-height: 1.4; }
  .mis-report-table th,
  .mis-report-table td { padding: 10px 9px; }
  .mis-bar-row { gap: 8px; grid-template-columns: 100px minmax(100px, 1fr) 42px; }
}
@media (max-width: 460px) {
  .mis-filter-grid { grid-template-columns: 1fr; }
  .mis-filter-card .lead-filter-actions .button { flex: 1 1 calc(50% - 8px); }
  .mis-bar-row { grid-template-columns: 84px minmax(90px, 1fr) 34px; }
}
@media print {
  .system-bar, .app-navbar, .breadcrumbs, .heading-actions, .mis-filter-card,
  .mis-report-card .card-head .mis-legend { display: none !important; }
  body, .crm-module { background: #fff !important; overflow: visible !important; }
  .page-content { max-width: none; padding: 0; }
  .card { border: 0; box-shadow: none; break-inside: avoid; }
  .mis-report-card { overflow: visible; }
  .mis-wide-table { overflow: visible; }
  .mis-report-table { font-size: 8px; min-width: 100%; width: 100%; }
  .mis-report-table th, .mis-report-table td { padding: 4px; white-space: normal; }
  .mis-report-table td:first-child, .mis-report-table th:first-child { position: static; }
}
