.nv-shell { display: flex; min-height: calc(100vh - 56px); }
.nv-topbar {
  display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 16px;
  background: var(--nova-surface); border-bottom: 1px solid var(--nova-border);
  position: sticky; top: 0; z-index: 30;
}
.nv-brand { display: flex; align-items: center; gap: 9px; font-weight: 500; color: var(--nova-text); text-decoration: none; }
.nv-brand-mark {
  width: 40px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--nova-primary), var(--nova-accent)); color: #f8fbff; font-size: 16px;
}
.nv-brand-mark.has-logo {
  overflow: visible; padding: 0; background: transparent;
  border: 0; box-shadow: none;
}
.nv-brand-mark.has-logo img { width: 100%; height: 100%; display: block; object-fit: contain; }
.nv-login-logo {
  width: min(228px, 72vw); height: auto; margin: 0 auto 16px;
  display: block; background: transparent;
}
.nv-login-logo img { width: 100%; height: auto; display: block; object-fit: contain; }
.nv-search {
  flex: 1; max-width: 420px; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
  border: 1px solid var(--nova-border); border-radius: var(--nova-radius-sm);
  background: var(--nova-surface-2); color: var(--nova-text-faint); font-size: 13px; cursor: pointer;
  font-family: inherit; text-align: left;
}
.nv-search .kbd { margin-left: auto; border: 1px solid var(--nova-border-strong); border-radius: 5px; padding: 1px 6px; font-size: 11px; }
.nv-iconbtn {
  width: 36px; height: 36px; border: 1px solid var(--nova-border); border-radius: var(--nova-radius-sm);
  background: var(--nova-surface); color: var(--nova-text-muted); display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; transition: background var(--nova-dur) var(--nova-ease);
}
.nv-iconbtn:hover { background: var(--nova-surface-2); color: var(--nova-text); }
.nv-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--nova-primary-tint); color: var(--nova-primary-strong);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; border: 0; cursor: pointer;
}

.nv-sidebar {
  width: var(--nova-sidebar-w); flex-shrink: 0; padding: 12px 10px; background: var(--nova-surface);
  border-right: 1px solid var(--nova-border); display: flex; flex-direction: column; gap: 2px;
}
.nv-nav { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px;
  color: var(--nova-text-muted); text-decoration: none; font-size: 14px; transition: background var(--nova-dur) var(--nova-ease); }
.nv-nav i { width: 20px; font-size: 17px; }
.nv-nav:hover { background: var(--nova-surface-2); color: var(--nova-text); }
.nv-nav.active { background: var(--nova-primary-tint); color: var(--nova-primary-strong); font-weight: 500; }
.nv-nav-group { margin: 8px 0 2px; padding: 0 11px; font-size: 11px; letter-spacing: .04em; color: var(--nova-text-faint); text-transform: uppercase; }

.nv-main { flex: 1; min-width: 0; padding: 22px 26px; }
.nv-page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.nv-page-title { font-size: 20px; font-weight: 500; margin: 0; }
.nv-page-sub { color: var(--nova-text-muted); font-size: 13px; margin: 2px 0 0; }

.nv-card { background: var(--nova-surface); border: 1px solid var(--nova-border); border-radius: var(--nova-radius); box-shadow: var(--nova-shadow-sm); }
.nv-card-head { display: flex; align-items: center; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--nova-border); font-weight: 500; }
.nv-card-body { padding: 16px; }

.nv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.nv-metric { background: var(--nova-surface); border: 1px solid var(--nova-border); border-radius: var(--nova-radius);
  padding: 14px 16px; box-shadow: var(--nova-shadow-sm); transition: transform var(--nova-dur) var(--nova-ease); }
.nv-metric:hover { transform: translateY(-2px); box-shadow: var(--nova-shadow); }
.nv-metric-label { color: var(--nova-text-muted); font-size: 13px; }
.nv-metric-value { font-family: var(--nova-num); font-variant-numeric: tabular-nums; font-size: 26px; font-weight: 500; line-height: 1.1; margin-top: 2px; }
.nv-delta { font-size: 12px; }
.nv-delta.up { color: var(--nova-success); }
.nv-delta.down { color: var(--nova-danger); }

.nv-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.nv-table th { text-align: left; padding: .55rem .9rem; color: var(--nova-text-muted); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .03em; font-weight: 500; border-bottom: 1px solid var(--nova-border); }
.nv-table td { padding: var(--nova-row-pad); border-bottom: 1px solid var(--nova-border); }
.nv-table tbody tr { transition: background var(--nova-dur) var(--nova-ease); }
.nv-table tbody tr:hover { background: var(--nova-surface-2); }
.nv-table tbody tr:last-child td { border-bottom: 0; }

.nv-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: var(--nova-radius-pill); font-size: 12px; }
.nv-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.nv-pill.is-pending { background: var(--nova-warning-tint); color: var(--nova-warning); }
.nv-pill.is-assigned { background: var(--nova-info-tint); color: var(--nova-info); }
.nv-pill.is-following { background: var(--nova-primary-tint); color: var(--nova-primary-strong); }
.nv-pill.is-converted { background: var(--nova-success-tint); color: var(--nova-success); }
.nv-pill.is-closed { background: var(--nova-surface-2); color: var(--nova-text-muted); }
.nv-pill.is-overdue { background: var(--nova-danger-tint); color: var(--nova-danger); }
.nv-pill.is-due_today { background: var(--nova-warning-tint); color: var(--nova-warning); }
.nv-pill.is-done { background: var(--nova-surface-2); color: var(--nova-text-muted); }

.nv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: var(--nova-control-h);
  padding: 0 14px; border-radius: var(--nova-radius-sm); border: 1px solid var(--nova-border); background: var(--nova-surface);
  color: var(--nova-text); font-size: 13.5px; cursor: pointer; text-decoration: none;
  transition: background var(--nova-dur) var(--nova-ease), transform .06s ease; }
.nv-btn:hover { background: var(--nova-surface-2); }
.nv-btn:active { transform: scale(.98); }
.nv-btn-primary { background: var(--nova-primary); border-color: var(--nova-primary); color: var(--nova-on-primary); }
.nv-btn-primary:hover { background: var(--nova-primary-strong); border-color: var(--nova-primary-strong); }
.nv-btn-ghost { background: transparent; border-color: transparent; color: var(--nova-text-muted); }
.nv-btn-block { width: 100%; }

.nv-field { margin-bottom: 14px; }
.nv-label { display: block; font-size: 13px; color: var(--nova-text-muted); margin-bottom: 6px; }
.nv-input { width: 100%; height: var(--nova-control-h); padding: 0 12px; border: 1px solid var(--nova-border);
  border-radius: var(--nova-radius-sm); background: var(--nova-surface); color: var(--nova-text); font-size: 14px;
  transition: border-color var(--nova-dur) var(--nova-ease), box-shadow var(--nova-dur) var(--nova-ease); }
.nv-input:focus { outline: none; border-color: var(--nova-primary); box-shadow: 0 0 0 3px var(--nova-primary-tint); }

.nv-empty { text-align: center; color: var(--nova-text-muted); padding: 36px 16px; }
.nv-empty i { font-size: 30px; display: block; margin-bottom: 8px; color: var(--nova-text-faint); }
.nv-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.nv-field-help { margin: 6px 0 0; color: var(--nova-text-muted); font-size: 12px; line-height: 1.5; }

/* Multi-business intake: one customer can start several independently tracked projects. */
.nv-intake-card { width: min(900px, 100%); }
.nv-intake-card *, .nv-intake-field-grid > *, .nv-intake-type-grid > * { min-width: 0; }
.nv-intake-section { padding: 4px 0 22px; }
.nv-intake-section + .nv-intake-section { padding-top: 22px; border-top: 1px solid var(--nova-border); }
.nv-intake-section--final { padding-bottom: 0; }
.nv-intake-section__head { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 16px; }
.nv-intake-section__index {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 32px; height: 32px; border-radius: 9px; background: var(--nova-primary-tint);
  color: var(--nova-primary-strong); font-family: var(--nova-num); font-size: 12px; font-weight: 650;
}
.nv-intake-section__head h2 { margin: 0; color: var(--nova-text); font-size: 15px; font-weight: 650; line-height: 1.4; }
.nv-intake-section__head p { margin: 2px 0 0; color: var(--nova-text-muted); font-size: 12px; line-height: 1.5; }
.nv-intake-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.nv-intake-field-wide { grid-column: 1 / -1; }
.nv-required { color: var(--nova-danger); }
.nv-optional { color: var(--nova-text-faint); font-size: 11px; font-weight: 400; }
.nv-intake-type-fieldset, .nv-intake-panel, .nv-intake-choice-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.nv-intake-type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nv-intake-type-option { position: relative; }
.nv-intake-type-option > input {
  position: absolute; width: 1px; height: 1px; margin: -1px; opacity: 0; overflow: hidden; pointer-events: none;
}
.nv-intake-type-option > label {
  display: flex; align-items: center; gap: 11px; width: 100%; min-height: 76px; margin: 0; padding: 12px;
  border: 1px solid var(--nova-border); border-radius: var(--nova-radius-sm); background: var(--nova-surface);
  color: var(--nova-text); cursor: pointer; transition: border-color var(--nova-dur) var(--nova-ease), background var(--nova-dur) var(--nova-ease);
}
.nv-intake-type-option__icon {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 38px; height: 38px; border-radius: 10px; background: var(--nova-surface-2); color: var(--nova-text-muted); font-size: 17px;
}
.nv-intake-type-option__copy { display: block; flex: 1; }
.nv-intake-type-option__copy strong { display: block; font-size: 13.5px; font-weight: 650; line-height: 1.35; }
.nv-intake-type-option__copy small { display: block; margin-top: 3px; color: var(--nova-text-muted); font-size: 11.5px; line-height: 1.4; }
.nv-intake-type-option__check {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 22px; height: 22px; border: 1px solid var(--nova-border-strong); border-radius: 6px; color: transparent; font-size: 11px;
}
.nv-intake-type-option > input:checked + label { border-color: var(--nova-primary); background: var(--nova-primary-tint); }
.nv-intake-type-option > input:checked + label .nv-intake-type-option__icon { background: var(--nova-primary); color: var(--nova-on-primary); }
.nv-intake-type-option > input:checked + label .nv-intake-type-option__check { border-color: var(--nova-primary); background: var(--nova-primary); color: var(--nova-on-primary); }
.nv-intake-type-option > input:focus-visible + label { outline: 3px solid var(--nova-primary-tint); outline-offset: 2px; }
.nv-intake-selection-status { min-height: 20px; margin: 8px 2px 0; color: var(--nova-text-muted); font-size: 12px; line-height: 1.5; }
.nv-intake-panel {
  margin-top: 12px; padding: 15px; border: 1px solid var(--nova-border); border-radius: var(--nova-radius);
  background: var(--nova-surface-2);
}
.nv-intake-panel[hidden] { display: none; }
.nv-intake-panel > legend { float: none; width: auto; margin: 0 0 13px; padding: 0; color: var(--nova-text); font-size: 13.5px; font-weight: 650; }
.nv-intake-panel > legend i { margin-right: 6px; color: var(--nova-primary-strong); }
.nv-intake-panel .nv-field:last-child { margin-bottom: 0; }
.nv-intake-choice-group > legend { margin-bottom: 7px; color: var(--nova-text-muted); font-size: 13px; }
.nv-intake-choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.nv-intake-choice-grid label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; margin: 0; padding: 9px 11px;
  border: 1px solid var(--nova-border); border-radius: var(--nova-radius-sm); background: var(--nova-surface);
  color: var(--nova-text-muted); font-size: 12.5px; cursor: pointer;
}
.nv-intake-choice-grid label i { color: transparent; }
.nv-intake-choice-grid input:checked + label { border-color: var(--nova-primary); background: var(--nova-primary-tint); color: var(--nova-primary-strong); }
.nv-intake-choice-grid input:checked + label i { color: var(--nova-primary-strong); }
.nv-intake-choice-grid input:focus-visible + label { outline: 3px solid var(--nova-primary-tint); outline-offset: 2px; }
.nv-intake-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.nv-duplicate-warning {
  margin: 18px 0; padding: 15px; border: 1px solid var(--nova-warning);
  border-radius: var(--nova-radius); background: var(--nova-warning-tint);
}
.nv-duplicate-warning__head { display: flex; align-items: flex-start; gap: 10px; }
.nv-duplicate-warning__head > i { color: var(--nova-warning); font-size: 18px; }
.nv-duplicate-warning__head h2 { margin: 0; color: var(--nova-text); font-size: 14px; font-weight: 650; }
.nv-duplicate-warning__head p { margin: 3px 0 0; color: var(--nova-text-muted); font-size: 12px; line-height: 1.5; }
.nv-duplicate-list { display: grid; gap: 8px; margin: 12px 0; padding: 0; list-style: none; }
.nv-duplicate-list li { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--nova-border); border-radius: var(--nova-radius-sm); background: var(--nova-surface); }
.nv-duplicate-list li > div { flex: 1; min-width: 0; }
.nv-duplicate-list strong, .nv-duplicate-list span { display: block; overflow-wrap: anywhere; }
.nv-duplicate-list strong { font-size: 13px; }
.nv-duplicate-list span { margin-top: 2px; color: var(--nova-text-muted); font-size: 12px; }
.nv-duplicate-confirm { display: flex; align-items: center; gap: 9px; min-height: 44px; }
.nv-duplicate-confirm input { flex: 0 0 auto; width: 20px; height: 20px; }
.nv-duplicate-confirm label { margin: 0; color: var(--nova-text); font-size: 13px; cursor: pointer; }

/* Project-first labels and close-probability presentation across lead surfaces. */
.nv-lead-project { min-width: 0; }
.nv-lead-project__name { display: block; overflow-wrap: anywhere; color: var(--nova-text); font-size: 13.5px; font-weight: 650; line-height: 1.4; }
.nv-lead-project__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; }
.nv-lead-project__customer { color: var(--nova-text-muted); font-size: 12px; }
.nv-stage-probability { padding: 12px 0 2px; }
.nv-stage-probability__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--nova-text-muted); font-size: 12px; }
.nv-stage-probability__head strong { color: var(--nova-text); font-family: var(--nova-num); font-size: 13px; font-weight: 650; }
.nv-stage-probability__track { width: 100%; height: 8px; margin-top: 8px; overflow: hidden; border-radius: 4px; background: var(--nova-surface-2); }
.nv-stage-probability__fill { width: var(--nv-stage-probability, 0%); height: 100%; border-radius: inherit; background: var(--nova-primary); }
.nv-stage-probability.is-pending .nv-stage-probability__track { background: var(--nova-surface-2); border: 1px dashed var(--nova-border-strong); }
.nv-stage-probability.is-pending .nv-stage-probability__fill { display: none; }

/* Lead pool: dense table on desktop, scan-first cards on touch layouts. */
.nv-pool-page-head { justify-content: space-between; }
.nv-pool-count {
  display: flex; align-items: baseline; gap: 6px; flex: 0 0 auto;
  min-height: 44px; padding: 8px 12px; border: 1px solid var(--nova-border);
  border-radius: var(--nova-radius-sm); background: var(--nova-surface);
  color: var(--nova-text-muted); font-size: 12px; box-shadow: var(--nova-shadow-sm);
}
.nv-pool-count strong {
  color: var(--nova-text); font-family: var(--nova-num); font-size: 20px;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.nv-pool-rule-strip {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  margin: 0 0 14px; padding: 11px 14px; border: 1px solid var(--nova-border);
  border-radius: var(--nova-radius); background: var(--nova-primary-tint); color: var(--nova-text);
}
.nv-pool-rule-strip > i {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: var(--nova-radius-sm); background: var(--nova-surface); color: var(--nova-primary-strong);
}
.nv-pool-rule-strip strong { display: block; margin-bottom: 2px; font-size: 13px; }
.nv-pool-rule-strip span, .nv-pool-rule-strip p { color: var(--nova-text-muted); font-size: 12.5px; line-height: 1.5; }
.nv-pool-rule-strip p { display: flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; }
.nv-pool-rule-strip p i { color: var(--nova-success); }
.nv-pool-table { table-layout: fixed; }
.nv-pool-table th:nth-child(1) { width: 13%; }
.nv-pool-table th:nth-child(2) { width: 13%; }
.nv-pool-table th:nth-child(3) { width: 18%; }
.nv-pool-table th:nth-child(4) { width: 10%; }
.nv-pool-table th:nth-child(5) { width: 20%; }
.nv-pool-table th:nth-child(6) { width: 11%; }
.nv-pool-table th:nth-child(7) { width: 172px; }
.nv-pool-table td { min-width: 0; vertical-align: middle; }
.nv-pool-customer a, .nv-pool-phone a { color: var(--nova-text); text-decoration: none; }
.nv-pool-customer a { font-weight: 600; }
.nv-pool-phone a, .nv-pool-time .nv-pool-value { color: var(--nova-text-muted); font-variant-numeric: tabular-nums; }
.nv-pool-demand .nv-pool-value, .nv-pool-reason .nv-pool-value {
  overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  color: var(--nova-text-muted); line-height: 1.45; overflow-wrap: anywhere;
}
.nv-pool-stage .nv-pill, .nv-pool-mobile-stage {
  background: var(--nova-surface-2); color: var(--nova-text-muted); white-space: nowrap;
}
.nv-pool-mobile-stage { display: none; }
.nv-pool-action { text-align: right; }
.nv-pool-action form { margin: 0; }
.nv-pool-action .nv-btn { min-height: 44px; width: 100%; padding-inline: 10px; white-space: nowrap; }
.nv-pool-empty .nv-empty { max-width: 560px; margin: 0 auto; padding: 52px 24px; }
.nv-pool-empty h2 { margin: 0 0 8px; color: var(--nova-text); font-size: 17px; font-weight: 600; }
.nv-pool-empty p { margin: 0 auto 18px; line-height: 1.65; text-wrap: pretty; }
.nv-pool-empty .nv-empty-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px;
  margin-bottom: 14px; border-radius: 50%; background: var(--nova-primary-tint);
}
.nv-pool-empty .nv-empty-icon i { margin: 0; color: var(--nova-primary-strong); font-size: 24px; }

/* Shared manual-pool and lost-lead reactivation control. */
.lead-pool-action-card { margin-bottom: 16px; }
.nv-pool-reason-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.nv-pool-reason-fieldset legend { margin-bottom: 8px; padding: 0; color: var(--nova-text-muted); font-size: 13px; }
.nv-pool-reason-fieldset legend span { color: var(--nova-danger); }
.nv-pool-reason-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.nv-pool-reason-choice {
  display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; padding: 8px 10px;
  border: 1px solid var(--nova-border); border-radius: var(--nova-radius-sm);
  background: var(--nova-surface); color: var(--nova-text-muted); cursor: pointer;
  transition: border-color var(--nova-dur) var(--nova-ease), background var(--nova-dur) var(--nova-ease);
}
.nv-pool-reason-choice:hover { background: var(--nova-surface-2); }
.nv-pool-reason-choice:focus-within {
  border-color: var(--nova-primary); box-shadow: 0 0 0 3px var(--nova-primary-tint);
}
.nv-pool-reason-choice:has(input:checked) {
  border-color: var(--nova-primary); background: var(--nova-primary-tint); color: var(--nova-primary-strong);
}
.nv-pool-reason-choice input { margin: 0; accent-color: var(--nova-primary); }
.nv-pool-reason-choice span { min-width: 0; line-height: 1.35; }
.nv-pool-other-note { margin: 12px 0 0; }
@supports selector(form:has(input:checked)) {
  .nv-pool-reason-form .nv-pool-other-note { display: none; }
  .nv-pool-reason-form:has(input[value="other"]:checked) .nv-pool-other-note { display: block; }
}
.nv-pool-other-note textarea.nv-input { height: auto; min-height: 72px; padding-top: 10px; padding-bottom: 10px; resize: vertical; }
.nv-action-consequence {
  display: flex; align-items: flex-start; gap: 7px; margin: 12px 0; padding: 10px 11px;
  border-radius: var(--nova-radius-sm); background: var(--nova-surface-2);
  color: var(--nova-text-muted); font-size: 12px; line-height: 1.55;
}
.nv-action-consequence i { flex: 0 0 auto; margin-top: 1px; color: var(--nova-info); }
.nv-pool-release-btn { min-height: 44px; border-color: var(--nova-warning); color: var(--nova-warning); }
.nv-pool-release-btn:hover { background: var(--nova-warning-tint); }

@media (max-width: 1100px) {
  .nv-pool-rule-strip { grid-template-columns: 34px minmax(0, 1fr); }
  .nv-pool-rule-strip p { grid-column: 2; white-space: normal; }
  .nv-pool-card { border: 0; background: transparent; box-shadow: none; }
  .nv-pool-table { display: block; overflow: visible; table-layout: auto; }
  .nv-pool-table thead {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  .nv-pool-table tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .nv-pool-table tr {
    display: grid; grid-template-columns: 82px minmax(0, 1fr); align-content: start;
    gap: 7px 10px; min-width: 0; padding: 13px; border: 1px solid var(--nova-border);
    border-radius: var(--nova-radius); background: var(--nova-surface); box-shadow: var(--nova-shadow-sm);
  }
  .nv-pool-table tbody tr:hover { background: var(--nova-surface); }
  .nv-pool-table td {
    display: grid; grid-template-columns: 82px minmax(0, 1fr); grid-column: 1 / -1; align-items: center;
    min-width: 0; min-height: 0; padding: 0; border: 0; white-space: normal;
  }
  .nv-pool-table td::before {
    content: attr(data-label); grid-column: 1; color: var(--nova-text-faint); font-size: 12px;
  }
  .nv-pool-customer {
    display: flex !important; grid-template-columns: none !important; justify-content: space-between;
    gap: 10px; padding-bottom: 9px !important; border-bottom: 1px solid var(--nova-border) !important;
  }
  .nv-pool-customer::before, .nv-pool-action::before { display: none; }
  .nv-pool-customer a {
    display: inline-flex; align-items: center; min-width: 0 !important; min-height: 44px;
    white-space: normal; overflow-wrap: anywhere;
  }
  .nv-pool-mobile-stage {
    display: inline-flex; align-items: center; align-self: center; flex: 0 0 auto;
    min-height: 28px; padding: 3px 9px; border-radius: var(--nova-radius-pill); font-size: 12px;
  }
  .nv-pool-phone a, .nv-pool-table td > .nv-pool-value {
    grid-column: 2; min-width: 0; overflow: visible; display: block; -webkit-line-clamp: unset;
    white-space: normal; overflow-wrap: anywhere;
  }
  .nv-pool-stage { display: none !important; }
  .nv-pool-table td.nv-pool-action {
    display: block; grid-template-columns: none; margin-top: 3px; padding-top: 11px !important;
    border-top: 1px solid var(--nova-border) !important;
  }
  .nv-pool-action form { width: 100%; }
  .nv-pool-action .nv-btn { width: 100%; min-height: 44px; }
}

.nv-funnel { display: flex; align-items: stretch; gap: 4px; height: 52px; }
.nv-funnel-seg { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0;
  border-radius: 7px; color: #fff; background: var(--nova-primary); }
.nv-funnel-seg .n { font-family: var(--nova-num); font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 500; }
.nv-funnel-seg .l { font-size: 10.5px; opacity: .92; }
.nv-funnel-seg.is-won { background: var(--nova-success); }

.nv-toggle { display: inline-flex; border: 1px solid var(--nova-border); border-radius: 8px; overflow: hidden; font-size: 12px; }
.nv-toggle button { padding: 5px 11px; background: transparent; border: 0; color: var(--nova-text-muted); cursor: pointer; }
.nv-toggle button.on { background: var(--nova-surface-2); color: var(--nova-text); }

.nv-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; background: var(--nova-surface);
  border: 1px solid var(--nova-border); border-radius: var(--nova-radius); box-shadow: var(--nova-shadow-lg);
  padding: 6px; z-index: 40; }
.nv-menu a, .nv-menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0;
  background: transparent; color: var(--nova-text); font-size: 13.5px; border-radius: 8px; text-decoration: none; cursor: pointer; text-align: left; }
.nv-menu a:hover, .nv-menu button:hover { background: var(--nova-surface-2); }

.nv-alert { border: 1px solid var(--nova-border); border-radius: var(--nova-radius-sm); padding: 11px 14px; margin-bottom: 14px; font-size: 13.5px; }
.nv-alert.success { background: var(--nova-success-tint); color: var(--nova-success); border-color: transparent; }
.nv-alert.danger { background: var(--nova-danger-tint); color: var(--nova-danger); border-color: transparent; }
.nv-alert.warning { background: var(--nova-warning-tint); color: var(--nova-warning); border-color: transparent; }
.nv-alert.info { background: var(--nova-info-tint); color: var(--nova-info); border-color: transparent; }

@media (max-width: 860px) {
  .nv-sidebar { position: fixed; left: 0; top: 56px; bottom: 0; transform: translateX(-100%);
    transition: transform var(--nova-dur) var(--nova-ease); z-index: 35; box-shadow: var(--nova-shadow-lg); }
  .nv-sidebar.open { transform: translateX(0); }
  .nv-main { padding: 16px; }
  .nv-search {
    display: inline-flex; flex: 0 0 44px; width: 44px; max-width: 44px;
    height: 44px; padding: 0; justify-content: center;
  }
  .nv-search > span { display: none; }
}
@media (min-width: 861px) { .nv-menu-toggle { display: none; } }

.nv-toasts { position: fixed; top: 16px; right: 16px; z-index: 60; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.nv-toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--nova-radius);
  background: var(--nova-surface); border: 1px solid var(--nova-border); box-shadow: var(--nova-shadow-lg);
  font-size: 13.5px; color: var(--nova-text); transition: opacity .2s ease, transform .2s ease;
  animation: nv-toast-in var(--nova-dur) var(--nova-ease); }
.nv-toast .ic { font-size: 17px; line-height: 1.3; }
.nv-toast.success .ic { color: var(--nova-success); }
.nv-toast.danger .ic { color: var(--nova-danger); }
.nv-toast.warning .ic { color: var(--nova-warning); }
.nv-toast.info .ic { color: var(--nova-info); }
.nv-toast .msg { flex: 1; }
.nv-toast .x { cursor: pointer; color: var(--nova-text-faint); border: 0; background: none; font-size: 16px; line-height: 1; padding: 0; }
@keyframes nv-toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }

.nv-drawer-root { position: fixed; inset: 0; z-index: 50; }
.nv-drawer-overlay { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); animation: nv-fade .2s ease; }
.nv-drawer { position: absolute; top: 0; right: 0; height: 100%; width: 480px; max-width: 92vw; background: var(--nova-bg);
  border-left: 1px solid var(--nova-border); box-shadow: var(--nova-shadow-lg); overflow-y: auto;
  animation: nv-drawer-in .22s var(--nova-ease); }
.nv-drawer-close { position: sticky; top: 12px; float: right; margin: 12px 12px 0 0; width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--nova-border); background: var(--nova-surface); color: var(--nova-text-muted); cursor: pointer; z-index: 2; }
.nv-drawer-body { padding: 18px 20px 28px; }
.nv-drawer-body .htmx-indicator { display: none; }
@keyframes nv-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes nv-drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
@media (max-width: 560px) { .nv-drawer { width: 100%; } }

/* Kanban board */
.nv-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.nv-col { flex: 0 0 264px; background: var(--nova-surface-2); border: 1px solid var(--nova-border); border-radius: var(--nova-radius); display: flex; flex-direction: column; max-height: calc(100vh - 190px); }
.nv-col.is-over { outline: 2px dashed var(--nova-primary); outline-offset: -2px; }
.nv-col-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; font-weight: 500; font-size: 13.5px; border-bottom: 1px solid var(--nova-border); }
.nv-col-count { background: var(--nova-surface); border: 1px solid var(--nova-border); border-radius: var(--nova-radius-pill); padding: 0 8px; font-size: 12px; color: var(--nova-text-muted); font-variant-numeric: tabular-nums; }
.nv-col-body { padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 44px; }
.nv-col-empty { color: var(--nova-text-faint); font-size: 12px; text-align: center; padding: 12px 0; }
.nv-kcard { background: var(--nova-surface); border: 1px solid var(--nova-border); border-radius: var(--nova-radius-sm); padding: 10px 12px; cursor: grab; box-shadow: var(--nova-shadow-sm); transition: box-shadow var(--nova-dur) var(--nova-ease); }
.nv-kcard:hover { box-shadow: var(--nova-shadow); }
.nv-kcard.is-dragging { opacity: .5; cursor: grabbing; }
.nv-kcard-name { font-weight: 500; font-size: 13.5px; }
.nv-kcard-phone { color: var(--nova-text-muted); font-size: 12px; margin-top: 1px; }
.nv-kcard-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; }
.nv-kcard-assignee { color: var(--nova-text-faint); font-size: 11.5px; }

/* Command palette (⌘K) */
.nv-palette-overlay { position: fixed; inset: 0; z-index: 70; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; animation: nv-fade .15s ease; }
.nv-palette { width: 100%; max-width: 560px; background: var(--nova-surface); border: 1px solid var(--nova-border); border-radius: var(--nova-radius); box-shadow: var(--nova-shadow-lg); overflow: hidden; }
.nv-palette-search { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--nova-border); color: var(--nova-text-muted); }
.nv-palette-input { flex: 1; border: 0; outline: none; background: transparent; color: var(--nova-text); font-size: 15px; }
.nv-palette-results { max-height: 52vh; overflow-y: auto; padding: 6px; }
.nv-palette-group { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--nova-text-faint); padding: 8px 10px 4px; }
.nv-palette-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--nova-radius-sm); text-decoration: none; color: var(--nova-text); }
.nv-palette-row:hover { background: var(--nova-surface-2); }
.nv-palette-ico { width: 30px; height: 30px; border-radius: 8px; background: var(--nova-primary-tint); color: var(--nova-primary-strong); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Notification center */
.nv-badge { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: var(--nova-radius-pill); background: var(--nova-danger); color: #fff; font-size: 10.5px;
  line-height: 17px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--nova-surface); }
.nv-topbar .nv-iconbtn { position: relative; }
.nv-notif-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 6px;
  border-bottom: 1px solid var(--nova-border); margin-bottom: 4px; }
.nv-notif-title { font-weight: 500; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.nv-notif-title .nv-badge { position: static; box-shadow: none; }
.nv-notif-allread { font-size: 12px; padding: 2px 6px; }
.nv-notif-list { max-height: 360px; overflow-y: auto; }
.nv-notif-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 8px;
  text-decoration: none; color: var(--nova-text); position: relative; }
.nv-notif-row:hover { background: var(--nova-surface-2); }
.nv-notif-row.is-unread { background: var(--nova-primary-tint); }
.nv-notif-row.is-unread:hover { background: var(--nova-primary-tint); }
.nv-notif-ico { width: 30px; height: 30px; border-radius: 8px; background: var(--nova-surface-2);
  color: var(--nova-text-muted); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nv-notif-row.is-unread .nv-notif-ico { background: var(--nova-surface); color: var(--nova-primary-strong); }
.nv-notif-main { flex: 1; min-width: 0; }
.nv-notif-text { display: block; font-size: 13px; line-height: 1.35; }
.nv-notif-row.is-unread .nv-notif-text { font-weight: 500; }
.nv-notif-time { display: block; font-size: 11.5px; color: var(--nova-text-faint); margin-top: 2px; }
.nv-notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--nova-primary); flex-shrink: 0; margin-top: 6px; }
.nv-notif-foot { display: block; text-align: center; padding: 8px; font-size: 12.5px; color: var(--nova-primary-strong);
  text-decoration: none; border-top: 1px solid var(--nova-border); margin-top: 4px; }
.nv-notif-foot:hover { background: var(--nova-surface-2); }
/* Full-page history: scoped width + left accent for unread rows */
.nv-notif-page .nv-notif-row { border-radius: 0; border-bottom: 1px solid var(--nova-border); padding: 12px 16px; }
.nv-notif-page .nv-notif-row:last-child { border-bottom: 0; }
.nv-notif-page .nv-notif-row.is-unread { border-left: 3px solid var(--nova-primary); background: var(--nova-primary-tint); }
/* The bell dropdown is wider than the default avatar menu */
#nv-notif-menu.nv-menu { min-width: 320px; padding: 6px; }
.nv-palette-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nv-palette-title { font-size: 13.5px; font-weight: 500; }
.nv-palette-sub { font-size: 12px; color: var(--nova-text-muted); }
.nv-legal-link { color: var(--nova-text-faint); text-decoration: none; }

/* AI assistant */
.nv-ai { position: fixed; right: 20px; bottom: 20px; z-index: 65; }
.nv-ai-fab { width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, var(--nova-primary), var(--nova-accent)); box-shadow: var(--nova-shadow-lg);
  font-size: 22px; transition: transform var(--nova-dur) var(--nova-ease); }
.nv-ai-fab:hover { transform: translateY(-2px); }
.nv-ai-panel { position: absolute; right: 0; bottom: 64px; width: 360px; max-width: 86vw; height: 460px; max-height: 70vh;
  display: flex; flex-direction: column; background: var(--nova-surface); border: 1px solid var(--nova-border);
  border-radius: var(--nova-radius); box-shadow: var(--nova-shadow-lg); overflow: hidden; }
.nv-ai-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--nova-border); font-weight: 500; }
.nv-ai-x { margin-left: auto; border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--nova-text-faint); }
.nv-ai-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.nv-ai-msg { padding: 9px 12px; border-radius: 12px; font-size: 13.5px; max-width: 86%; white-space: pre-wrap; line-height: 1.5; }
.nv-ai-msg.user { align-self: flex-end; background: var(--nova-primary); color: var(--nova-on-primary); border-bottom-right-radius: 4px; }
.nv-ai-msg.assistant { align-self: flex-start; background: var(--nova-surface-2); color: var(--nova-text); border-bottom-left-radius: 4px; }
.nv-ai-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--nova-border); }
.nv-ai-input input { flex: 1; height: 36px; padding: 0 12px; border: 1px solid var(--nova-border); border-radius: var(--nova-radius-sm); background: var(--nova-surface); color: var(--nova-text); }

/* Settings centre: one administrative entry, grouped by the work to do. */
.nv-settings-hub {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, 1fr);
  gap: 16px; align-items: stretch;
}
.nv-settings-group {
  min-width: 0; padding: 18px; background: var(--nova-surface);
  border: 1px solid var(--nova-border); border-radius: var(--nova-radius);
  box-shadow: var(--nova-shadow-sm);
}
.nv-settings-group[data-settings-group="business"] { grid-row: span 2; }
.nv-settings-group-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 15px; }
.nv-settings-group-icon, .nv-settings-item-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  color: var(--nova-primary-strong); background: var(--nova-primary-tint);
  border-radius: var(--nova-radius-sm);
}
.nv-settings-group-icon { width: 38px; height: 38px; font-size: 17px; }
.nv-settings-group-head h2 { margin: 0; font-size: 16px; font-weight: 650; text-wrap: balance; }
.nv-settings-group-head p { margin: 4px 0 0; color: var(--nova-text-muted); font-size: 12.5px; line-height: 1.45; text-wrap: pretty; }
.nv-settings-items { display: grid; gap: 8px; }
.nv-settings-item {
  display: flex; align-items: center; gap: 11px; min-height: 62px; padding: 10px 12px;
  color: var(--nova-text); text-decoration: none; background: var(--nova-surface-2);
  border: 1px solid transparent; border-radius: var(--nova-radius-sm);
  transition: border-color var(--nova-dur) var(--nova-ease), background var(--nova-dur) var(--nova-ease);
}
.nv-settings-item:hover { color: var(--nova-text); background: var(--nova-primary-tint); border-color: var(--nova-border-strong); }
.nv-settings-item-icon { width: 34px; height: 34px; }
.nv-settings-item-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 2px; }
.nv-settings-item-copy strong { font-size: 13.5px; font-weight: 600; }
.nv-settings-item-copy span { color: var(--nova-text-muted); font-size: 12px; line-height: 1.4; text-wrap: pretty; }
.nv-settings-item > .bi-chevron-right { color: var(--nova-text-faint); }
.nv-settings-context {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px;
  padding: 10px 12px; background: var(--nova-surface); border: 1px solid var(--nova-border);
  border-radius: var(--nova-radius); box-shadow: var(--nova-shadow-sm);
}
.nv-settings-back, .nv-settings-related a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 36px;
  padding: 0 10px; border-radius: var(--nova-radius-sm); text-decoration: none;
}
.nv-settings-back { gap: 6px; color: var(--nova-primary-strong); font-weight: 600; }
.nv-settings-context-group { color: var(--nova-text-muted); font-size: 12px; }
.nv-settings-related { display: flex; flex: 1; justify-content: flex-end; flex-wrap: wrap; gap: 4px; }
.nv-settings-related a { color: var(--nova-text-muted); font-size: 12.5px; }
.nv-settings-related a:hover, .nv-settings-related a.active {
  color: var(--nova-primary-strong); background: var(--nova-primary-tint);
}

/* Administrator operation log: dense enough to audit, calm enough to scan. */
.nv-audit-page-head { justify-content: space-between; }
.nv-audit-total {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px;
  color: var(--nova-primary-strong); background: var(--nova-primary-tint);
  border: 1px solid var(--nova-border); border-radius: var(--nova-radius-pill);
  font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.nv-audit-filter-error { display: flex; align-items: flex-start; gap: 9px; }
.nv-audit-filter-card { margin-bottom: 16px; }
.nv-card-title { margin: 0; font-size: 14px; font-weight: 600; }
.nv-card-sub { margin: 3px 0 0; color: var(--nova-text-muted); font-size: 12px; font-weight: 400; }
.nv-audit-filter-form { display: grid; gap: 14px; }
.nv-audit-filter-grid {
  display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 12px;
}
.nv-audit-filter-field { display: grid; min-width: 0; gap: 6px; }
.nv-audit-filter-field > span { color: var(--nova-text-muted); font-size: 12px; font-weight: 500; }
.nv-audit-filter-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.nv-audit-results { overflow: hidden; }
.nv-table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.nv-audit-table { table-layout: fixed; }
.nv-audit-table th:nth-child(1) { width: 140px; }
.nv-audit-table th:nth-child(2) { width: 110px; }
.nv-audit-table th:nth-child(3) { width: 132px; }
.nv-audit-table th:nth-child(4) { width: 126px; }
.nv-audit-table th:nth-child(5) { width: 20%; }
.nv-audit-table td { vertical-align: top; line-height: 1.55; overflow-wrap: anywhere; }
.nv-audit-time { color: var(--nova-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nv-audit-category {
  display: inline-flex; align-items: center; min-height: 26px; padding: 2px 9px;
  color: var(--nova-primary-strong); background: var(--nova-primary-tint);
  border-radius: var(--nova-radius-pill); font-size: 12px; white-space: nowrap;
}
.nv-audit-action { font-weight: 500; }
.nv-audit-operator { display: block; }
.nv-audit-table small { display: block; margin-top: 2px; color: var(--nova-text-faint); font-size: 11.5px; }
.nv-audit-object { color: var(--nova-text); }
.nv-audit-detail { color: var(--nova-text-muted); }
.nv-audit-empty { display: grid; justify-items: center; gap: 6px; }
.nv-audit-empty i { margin-bottom: 2px; }
.nv-audit-empty strong { color: var(--nova-text); font-size: 14px; }
.nv-audit-empty span { font-size: 12.5px; }
.nv-audit-empty .nv-btn { margin-top: 7px; }
.nv-audit-pagination { margin-top: 16px; }

/* Responsive application shell -------------------------------------------------
   The desktop CRM and the existing /m pages share the same interaction floor:
   readable content, an off-canvas navigation, and controls that work by touch. */
.nv-skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 14px;
  border-radius: var(--nova-radius-sm); background: var(--nova-primary);
  color: var(--nova-on-primary); text-decoration: none; transform: translateY(-160%);
  transition: transform var(--nova-dur) var(--nova-ease);
}
.nv-skip-link:focus { transform: translateY(0); }
.nv-sidebar { overflow-y: auto; overscroll-behavior: contain; }
.nv-sidebar-scrim { display: none; }
.nv-card, .nv-card-body, .nv-page-head > * { min-width: 0; }
.nv-page-title { text-wrap: balance; }
.nv-page-sub { text-wrap: pretty; }
img, video, canvas, svg { max-width: 100%; }
code, pre, .nv-notif-text, .nv-palette-title, .nv-palette-sub { overflow-wrap: anywhere; }

:where(a, button, input, select, textarea, summary, [role="button"]):focus-visible {
  outline: 2px solid var(--nova-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--nova-primary-tint);
}

.nv-board-stage-wrap { display: none; margin-top: 10px; }
.nv-board-stage-label { display: block; margin-bottom: 4px; color: var(--nova-text-muted); font-size: 12px; }
.nv-board-stage {
  width: 100%; min-height: 44px; padding: 0 10px; border: 1px solid var(--nova-border);
  border-radius: var(--nova-radius-sm); background: var(--nova-surface); color: var(--nova-text);
}

.nv-lead-edit-card { width: min(860px, 100%); }
.nv-lead-edit-lock {
  display: flex; align-items: center; gap: 11px; margin-bottom: 22px; padding: 12px 14px;
  border: 1px solid var(--nova-border); border-radius: var(--nova-radius-sm);
  background: var(--nova-surface-2);
}
.nv-lead-edit-lock__icon {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 36px; height: 36px; border-radius: 10px; background: var(--nova-primary-tint);
  color: var(--nova-primary-strong);
}
.nv-lead-edit-lock strong, .nv-lead-edit-lock span { display: block; }
.nv-lead-edit-lock strong { font-size: 13.5px; }
.nv-lead-edit-lock span { margin-top: 2px; color: var(--nova-text-muted); font-size: 12px; line-height: 1.45; }
.nv-lead-edit-section { padding: 0 0 18px; }
.nv-lead-edit-section + .nv-lead-edit-section {
  padding-top: 20px; border-top: 1px solid var(--nova-border);
}
.nv-lead-edit-section__head { margin-bottom: 14px; }
.nv-lead-edit-section__head h2 { margin: 0; font-size: 15px; font-weight: 650; }
.nv-lead-edit-section__head p { margin: 3px 0 0; color: var(--nova-text-muted); font-size: 12px; line-height: 1.5; }
.nv-lead-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.nv-lead-edit-wide { grid-column: 1 / -1; }
.nv-lead-edit-actions {
  display: flex; flex-wrap: wrap; gap: 8px; padding-top: 18px; border-top: 1px solid var(--nova-border);
}

.lead-followup-stack { display: contents; }

.nv-project-schedule-editor { position: relative; }
.nv-project-schedule-editor > summary { list-style: none; white-space: nowrap; }
.nv-project-schedule-editor > summary::-webkit-details-marker { display: none; }
.nv-project-schedule-form {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 24;
  display: grid; grid-template-columns: repeat(3, minmax(125px, 1fr)); gap: 10px;
  width: min(540px, calc(100vw - 48px)); padding: 14px;
  border: 1px solid var(--nova-border); border-radius: var(--nova-radius);
  background: var(--nova-surface); box-shadow: var(--nova-shadow); text-align: left;
}
.nv-project-schedule-actions { display: flex; align-items: end; gap: 8px; }

@media (max-width: 860px) {
  :root { --nova-control-h: 44px; }

  body.nv-nav-open { overflow: hidden; }
  .nv-sidebar-scrim {
    display: block; position: fixed; inset: 56px 0 0; z-index: 34; padding: 0;
    border: 0; border-radius: 0; background: rgba(15, 23, 42, .46);
  }
  .nv-sidebar { width: min(82vw, var(--nova-sidebar-w)); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .nv-main { width: 100%; max-width: 100%; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .nv-page-head { flex-wrap: wrap; align-items: flex-start; }
  .nv-main [style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  .nv-main dl[style*="grid-template-columns"] { grid-template-columns: minmax(88px, auto) minmax(0, 1fr) !important; }

  .lead-detail-main, .lead-detail-sidebar { display: contents; }
  .lead-detail-main > *, .lead-detail-sidebar > * { order: 10; }
  .lead-assignment-card { order: 5; }
  .lead-followup-stack { display: flex; flex-direction: column; }
  .lead-followup-compose { order: 20; }
  .lead-followup-history { order: 30; }

  .nv-btn, .nv-iconbtn { min-height: 44px; }
  .nv-btn { min-width: 44px; }
  .nv-iconbtn, .nv-avatar { min-width: 44px; min-height: 44px; }
  .nv-main a[href]:not(.nv-btn) { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
  .nv-nav, .nv-menu a, .nv-menu button, .nv-palette-row, .nv-toggle button { min-height: 44px; }
  .nv-input { min-height: 44px; font-size: 16px; }
  textarea.nv-input { height: auto; min-height: 96px; padding-top: 10px; padding-bottom: 10px; }
  input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; flex: 0 0 auto; }
  .nv-main label:has(input[type="checkbox"]), .nv-main label:has(input[type="radio"]),
  .nv-drawer-body label:has(input[type="checkbox"]), .nv-drawer-body label:has(input[type="radio"]) {
    min-height: 44px; align-items: center;
  }
  summary { min-height: 44px; display: flex; align-items: center; }

  .nv-table {
    display: block; width: 100%; max-width: 100%; overflow-x: auto;
    overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .nv-table th, .nv-table td { min-height: 44px; white-space: nowrap; }
  .nv-table td > [style*="max-width"] { white-space: normal; }

  /* Dense operational tables opt into cards so the action column never falls
     outside the first phone/tablet viewport.  data-label keeps each value
     understandable after the visual table header is hidden. */
  .nv-mobile-card-table { display: block; overflow: visible; }
  .nv-mobile-card-table thead {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  .nv-mobile-card-table tbody {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 10px; padding: 10px;
  }
  .nv-mobile-card-table tr {
    display: grid; align-content: start; gap: 7px; min-width: 0; padding: 13px;
    border: 1px solid var(--nova-border); border-radius: var(--nova-radius-sm);
    background: var(--nova-surface); box-shadow: var(--nova-shadow-sm);
  }
  .nv-mobile-card-table tbody tr:hover { background: var(--nova-surface); }
  .nv-mobile-card-table td {
    display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 8px;
    align-items: start; min-width: 0; min-height: 0; padding: 0; border: 0;
    white-space: normal; overflow-wrap: anywhere;
  }
  .nv-mobile-card-table td::before {
    content: attr(data-label); grid-column: 1; color: var(--nova-text-faint);
    font-size: 12px; line-height: 1.6;
  }
  .nv-mobile-card-table td > * { grid-column: 2; min-width: 0; }
  .nv-mobile-card-table td[data-mobile-actions] {
    display: block; margin-top: 4px; padding-top: 11px; border-top: 1px solid var(--nova-border);
  }
  .nv-mobile-card-table td[data-mobile-actions]::before { display: none; }
  .nv-mobile-card-table td[data-mobile-actions] > * { width: 100%; }
  .nv-mobile-card-table td[data-mobile-actions] .nv-btn {
    width: 100%; min-width: 0; justify-content: center;
  }
  .nv-mobile-card-table td[data-mobile-empty] { display: block; grid-column: 1 / -1; }
  .nv-mobile-card-table td[data-mobile-empty]::before { display: none; }

  .nv-project-schedule-form {
    position: fixed; inset: 68px 12px auto; width: auto;
    max-height: calc(100dvh - 80px); overflow-y: auto;
    grid-template-columns: minmax(0, 1fr) !important;
    padding: 16px;
  }
  .nv-project-schedule-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nv-project-schedule-actions .nv-btn { width: 100%; justify-content: center; }

  .nv-card:has(> .cal-grid) {
    overflow-x: auto !important; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch;
  }
  .cal-grid { min-width: 640px; }
  .cal-booking { min-height: 44px; display: flex; align-items: center; }

  .nv-board { scroll-snap-type: x proximity; overscroll-behavior-inline: contain; }
  .nv-col { max-height: calc(100dvh - 170px); scroll-snap-align: start; }
  .nv-kcard { min-height: 44px; cursor: pointer; }
  .nv-board-stage-wrap { display: block; }

  .nv-drawer { height: 100dvh; max-width: 100vw; }
  .nv-drawer-close { width: 44px; height: 44px; }
  .nv-drawer-body { min-width: 0; padding-bottom: max(28px, env(safe-area-inset-bottom)); }
  .nv-palette-overlay { padding: max(12px, env(safe-area-inset-top)) 12px 12px; }
  .nv-palette { max-height: calc(100dvh - 24px); }
  .nv-palette-results { max-height: calc(100dvh - 92px); }
  .nv-settings-hub { grid-template-columns: minmax(0, 1fr); }
  .nv-settings-group[data-settings-group="business"] { grid-row: auto; }
  .nv-settings-back, .nv-settings-related a { min-height: 44px; }
  .nv-audit-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nv-audit-table { table-layout: auto; }
  .nv-audit-table tbody { grid-template-columns: minmax(0, 1fr); }
  .nv-legal-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }

  .nv-btn:active, .nv-nav:active, .nv-menu a:active, .nv-palette-row:active, .nv-kcard:active {
    background: var(--nova-surface-2);
  }
}

@media (max-width: 560px) {
  .nv-topbar { gap: 6px; padding: 0 8px; }
  .nv-brand { min-width: 44px; min-height: 44px; margin-right: auto; justify-content: center; font-size: 0; }
  .nv-brand-mark { width: 36px; height: 28px; font-size: 17px; }
  .nv-login-logo { width: min(204px, 68vw); }
  .nv-topbar-action-secondary { display: none; }
  .nv-main { padding: 14px 12px; }
  .nv-page-head { gap: 10px; margin-bottom: 14px; }
  .nv-page-head > [style*="margin-left:auto"],
  .nv-page-head > [style*="margin-left: auto"] { width: 100%; margin-left: 0 !important; flex-wrap: wrap; }
  .nv-page-head > a[style*="margin-left"] { justify-content: center; }
  .nv-page-head > [style*="margin-left"] .nv-btn { flex: 1 1 auto; }
  .nv-page-title { font-size: 19px; line-height: 1.3; }
  .nv-page-sub { line-height: 1.55; }
  .nv-card-head { min-height: 48px; padding: 12px 14px; flex-wrap: wrap; }
  .nv-card-body { padding: 14px; }

  .nv-intake-card { max-width: 100%; overflow: hidden; }
  .nv-intake-section { padding-bottom: 18px; }
  .nv-intake-section + .nv-intake-section { padding-top: 18px; }
  .nv-intake-field-grid, .nv-intake-type-grid, .nv-intake-choice-grid { grid-template-columns: minmax(0, 1fr); }
  .nv-intake-field-wide { grid-column: auto; }
  .nv-intake-type-option > label { min-height: 72px; }
  .nv-intake-panel { padding: 13px; }
  .nv-intake-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .nv-intake-actions .nv-btn { width: 100%; min-height: 44px; }
  .nv-lead-edit-grid { grid-template-columns: minmax(0, 1fr); }
  .nv-lead-edit-wide { grid-column: auto; }
  .nv-lead-edit-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .nv-lead-edit-actions .nv-btn { width: 100%; min-height: 44px; }
  .nv-duplicate-list li { align-items: stretch; flex-direction: column; }
  .nv-duplicate-list .nv-btn { width: 100%; }

  .nv-opt-row { flex-wrap: wrap; align-items: flex-start !important; }
  .nv-opt-row > [data-drag-handle] { display: none; }
  .nv-opt-order { margin-left: auto; }
  .nv-opt-edit {
    flex-basis: 100% !important; min-width: 0; flex-wrap: wrap;
    padding-top: 8px; border-top: 1px solid var(--nova-border);
  }
  .nv-opt-edit input[type="color"] { width: 44px !important; height: 44px !important; }
  .nv-opt-edit input[type="text"] { flex: 1 1 160px; min-width: 0; max-width: none !important; }
  .nv-opt-action { flex: 1 1 calc(50% - 4px); }
  .nv-opt-action .nv-btn { width: 100%; justify-content: center; }
  .nv-opt-create { flex-wrap: wrap; }
  .nv-opt-create .nv-input { flex: 1 1 180px; min-width: 0; max-width: none !important; }

  .nv-pool-page-head .nv-pool-count { width: 100%; justify-content: center; }
  .nv-pool-rule-strip { padding: 12px; }
  .nv-pool-rule-strip p { grid-column: 1 / -1; padding-top: 9px; border-top: 1px solid var(--nova-border); }
  .nv-pool-table tbody { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .nv-pool-table tr { padding: 12px; }
  .nv-pool-empty .nv-empty { padding: 38px 18px; }

  /* Task rows become compact cards so the two frequent actions stay visible at 320px. */
  .nv-task-table { display: block; overflow: visible; }
  .nv-task-table thead {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  .nv-task-table tbody { display: grid; gap: 10px; padding: 10px; }
  .nv-task-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 10px;
    width: 100%; padding: 12px; border: 1px solid var(--nova-border);
    border-radius: var(--nova-radius-sm); background: var(--nova-surface);
  }
  .nv-task-table td {
    display: block; min-width: 0; min-height: 0; padding: 0; border: 0;
    white-space: normal; overflow-wrap: anywhere;
  }
  .nv-task-customer { grid-column: 1; font-weight: 500; }
  .nv-task-assignee { grid-column: 2; grid-row: 1; color: var(--nova-text-muted); font-size: 12px; }
  .nv-task-assignee::before { content: attr(data-label) "："; color: var(--nova-text-faint); }
  .nv-task-content, .nv-task-due, .nv-task-actions { grid-column: 1 / -1; }
  .nv-task-content::before { content: attr(data-label) "："; color: var(--nova-text-faint); font-size: 12px; }
  .nv-task-actions {
    display: flex; align-items: center; gap: 8px; padding-top: 10px;
    border-top: 1px solid var(--nova-border);
  }
  .nv-task-actions > div {
    display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%; gap: 8px !important;
  }
  .nv-task-actions .nv-btn { min-width: 0; width: 100%; justify-content: center; }

  .nv-card-body > form[method="GET"] > .nv-input {
    flex: 1 1 calc(50% - 4px); width: calc(50% - 4px) !important; min-width: 0; max-width: none !important;
  }
  .nv-card-body > form[method="GET"] > input[type="text"],
  .nv-card-body > form[method="GET"] > details,
  .nv-card-body form[method="GET"] details .nv-input { flex-basis: 100%; width: 100% !important; }
  .nv-card-body form[style*="display:flex"] { align-items: stretch !important; flex-wrap: wrap; }
  .nv-card-body form[style*="display:flex"] > .nv-input { min-width: 0; }

  .nv-funnel { height: auto; min-height: 52px; overflow-x: auto; align-items: stretch; overscroll-behavior-inline: contain; }
  .nv-funnel-seg { flex: 0 0 70px !important; min-height: 52px; }
  .nv-metric { padding: 14px; }
  .nv-metric-value { font-size: 24px; }

  .nv-menu {
    position: fixed; top: 60px; right: 8px; left: 8px; width: auto; min-width: 0 !important;
    max-width: calc(100vw - 16px); max-height: calc(100dvh - 72px); overflow-y: auto;
  }
  #nv-notif-menu.nv-menu { min-width: 0; }
  .nv-toasts { top: 8px; right: 8px; left: 8px; max-width: none; }
  .nv-toast .x { min-width: 44px; min-height: 44px; margin: -8px -10px -8px 0; }

  .nv-drawer-body { padding: 14px 12px max(24px, env(safe-area-inset-bottom)); }
  .nv-ai { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .nv-ai-panel { right: 0; width: calc(100vw - 24px); max-width: none; height: min(520px, calc(100dvh - 88px)); max-height: none; }
  .nv-ai-fab, .nv-ai-x { min-width: 44px; min-height: 44px; }
  .nv-ai-input input { min-width: 0; min-height: 44px; font-size: 16px; }
  .nv-ai-input .nv-btn { min-width: 64px; }

  .nv-settings-group { padding: 14px; }
  .nv-settings-context { align-items: stretch; }
  .nv-settings-back { min-height: 44px; }
  .nv-settings-context-group { display: flex; align-items: center; padding: 0 8px; }
  .nv-settings-related { flex-basis: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nv-settings-related a { min-height: 44px; padding: 7px 8px; text-align: center; }
  .nv-audit-page-head { align-items: stretch; }
  .nv-audit-total { justify-content: center; width: 100%; min-height: 44px; }
  .nv-audit-filter-grid { grid-template-columns: minmax(0, 1fr); }
  .nv-audit-filter-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nv-audit-filter-actions .nv-btn { width: 100%; min-width: 0; }

  .pagination { flex-wrap: wrap; gap: 4px; }
  .page-link { min-height: 44px; display: inline-flex; align-items: center; }
}

@media (hover: none), (pointer: coarse) {
  .nv-metric:hover, .nv-ai-fab:hover { transform: none; }
  .nv-board-stage-wrap { display: block; }
}
