:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --enrgy-orange: #ff9933;
  --enrgy-blue: #008bd2;
  --enrgy-white: #ffffff;
  --enrgy-blue-dark: #005f90;
  --ink: #20242a;
  --muted: #667085;
  --line: #d8e4ec;
  --color-primary: #008bd2;
  --color-primary-strong: #005f90;
  --color-primary-soft: #e8f6fd;
  --color-danger: #e03131;
  --color-danger-soft: #fff1f1;
  --color-warning: #f97316;
  --color-warning-soft: #fff4e8;
  --color-success: #16a34a;
  --color-success-soft: #ebf9ef;
  --color-purple: #6d3fd4;
  --color-purple-soft: #f1ecff;
  --color-caution: #d78b00;
  --color-caution-soft: #fff8df;
  --color-border: #d8e4ec;
  --color-surface: #ffffff;
  --color-text: #20242a;
  --color-text-muted: #667085;
  --card-radius: 12px;
  --card-shadow: 0 10px 26px rgba(0, 63, 96, .055);
  color: var(--ink);
  background: #f7fafc;
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
  grid-template-rows: 64px 1fr;
  overflow-x: hidden;
}

.auth-required {
  overflow: hidden;
}

.auth-required .sidebar,
.auth-required main,
.auth-required .topbar {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(0, 139, 210, .18), rgba(255, 153, 51, .18)), #f7fafc;
  padding: 24px;
}

.login-screen[hidden] {
  display: none !important;
}

.login-card {
  width: min(460px, 100%);
  background: var(--enrgy-white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(0, 63, 96, .18);
  padding: 28px;
  display: grid;
  gap: 16px;
}

.login-card img {
  width: 64px;
  height: 64px;
}

.login-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 7px;
  background: var(--enrgy-blue);
  color: var(--enrgy-white);
  font-weight: 800;
  text-decoration: none;
}

.disabled-link {
  opacity: .55;
  cursor: not-allowed;
}

.login-help {
  font-size: 13px;
}

.platform-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 20px;
  align-items: center;
  margin-top: 18px;
  padding: 22px;
  background: linear-gradient(135deg, rgba(0, 139, 210, .10), rgba(255, 153, 51, .10)), var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

.platform-hero h3 {
  margin-top: 8px;
  font-size: 24px;
  line-height: 1.2;
}

.platform-hero p {
  margin-top: 8px;
  max-width: 760px;
}

.platform-hero img {
  width: 88px;
  height: 88px;
  justify-self: end;
}

.eyebrow {
  color: var(--color-primary-strong);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.tool-card {
  min-height: 152px;
  padding: 18px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 10px;
  align-content: start;
  text-align: left;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

.tool-card:hover,
.tool-card:focus-visible {
  border-color: rgba(0, 139, 210, .38);
  box-shadow: 0 12px 30px rgba(0, 95, 144, .10);
}

.tool-card strong {
  font-size: 17px;
}

.tool-card small {
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.4;
}

.tool-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
  border-radius: 10px;
  font-weight: 900;
}

.sales-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.sales-overview-card {
  min-height: 176px;
}

.sales-worklist {
  display: grid;
  gap: 18px;
}

.sales-worklist-focus {
  display: grid;
  gap: 14px;
}

.sales-worklist-focus__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.sales-worklist-focus__card {
  max-width: 520px;
}

.sales-worklist-focus__card .dashboard-card--employee {
  height: 100%;
}

.admin-tool .tool-icon {
  color: var(--enrgy-orange);
  background: var(--color-warning-soft);
}

.dashboard-quality,
.dashboard-cards,
.dashboard-sections,
.dashboard-drilldown {
  margin-top: 18px;
}

.dashboard-quality:empty,
.dashboard-cards:empty,
.dashboard-sections:empty,
.dashboard-drilldown:empty {
  display: none;
}

.dashboard-quality-card,
.dashboard-panel,
.dashboard-card,
.dashboard-row,
.traffic-card,
.mini-kpis > div,
.employee-card-grid > .dashboard-card,
.drilldown-table > div,
.lead-detail-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

.dashboard-quality-card {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
}

.dashboard-quality-card span,
.dashboard-quality-card small {
  color: var(--muted);
}

.dashboard-quality-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-quality-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dashboard-quality-title .metric-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.dashboard-quality-title .metric-icon svg {
  width: 17px;
  height: 17px;
}

.dashboard-quality-title h3,
.dashboard-quality-card h4 {
  margin: 0;
}

.dashboard-quality-card h4 {
  color: var(--color-text);
  font-size: 15px;
  font-weight: 800;
}

.dashboard-quality-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.dashboard-quality-row {
  box-shadow: none;
}

.dashboard-quality-compact-grid {
  display: grid;
  grid-template-columns: minmax(180px, .55fr) minmax(180px, .45fr);
  gap: 7px 28px;
}

.dashboard-quality-compact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
  min-height: 24px;
  font-size: 14px;
}

.dashboard-quality-compact-row span {
  color: var(--muted);
  min-width: 0;
}

.dashboard-quality-compact-row strong {
  color: var(--color-primary-strong);
  font-size: 14px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.dashboard-quality-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.dashboard-quality-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.dashboard-quality-check .metric-icon {
  width: 20px;
  height: 20px;
  border-radius: 7px;
}

.dashboard-quality-check .metric-icon svg {
  width: 13px;
  height: 13px;
}

.dashboard-quality-check--success .metric-icon {
  color: var(--color-success);
  background: var(--color-success-soft);
}

.dashboard-quality-check--danger .metric-icon {
  color: var(--color-danger);
  background: var(--color-danger-soft);
}

.team-risk-panel {
  display: grid;
  gap: 12px;
}

.team-risk-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.team-risk-head h3,
.team-risk-head p {
  margin: 0;
}

.team-risk-head p,
.team-risk-thresholds {
  color: var(--color-text-muted);
  font-size: 13px;
}

.team-risk-thresholds {
  margin: 0;
}

.team-risk-list {
  display: grid;
  gap: 8px;
}

.team-risk-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(220px, 1.6fr) minmax(150px, .8fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.team-risk-row:hover {
  border-color: var(--color-primary);
  box-shadow: 0 8px 18px rgba(0, 139, 210, .12);
}

.team-risk-row:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.team-risk-row:active {
  transform: translateY(1px);
}

.team-risk-row--danger {
  border-left: 4px solid var(--color-danger);
}

.team-risk-row--warning {
  border-left: 4px solid var(--color-warning);
}

.team-risk-row__lead,
.team-risk-row__meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.team-risk-row__lead strong,
.team-risk-row__lead small,
.team-risk-row__meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-risk-row__lead small,
.team-risk-row__meta small {
  color: var(--color-text-muted);
  font-size: 12px;
}

.team-risk-row__reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.risk-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.risk-chip--danger {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.risk-chip--warning {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge .metric-icon {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  color: currentColor;
  background: transparent;
}

.status-badge .metric-icon svg {
  width: 13px;
  height: 13px;
}

.status-badge--success { color: var(--color-success); background: var(--color-success-soft); }
.status-badge--warning { color: var(--color-warning); background: var(--color-warning-soft); }
.status-badge--danger { color: var(--color-danger); background: var(--color-danger-soft); }
.status-badge--caution { color: var(--color-caution); background: var(--color-caution-soft); }

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

.dashboard-summary {
  display: grid;
  gap: 14px;
}

.dashboard-summary h3 {
  margin: 0;
}

.dashboard-card {
  color: var(--color-text);
  text-align: left;
  padding: 18px 20px;
}

.dashboard-card--kpi,
.metric-card,
.traffic-card {
  min-height: 118px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 14px;
  align-items: center;
  align-content: center;
  max-width: 100%;
  min-width: 0;
}

.dashboard-card--status {
  width: 100%;
}

.dashboard-card--employee,
.dashboard-card--list,
.dashboard-card--drilldown,
.lead-detail-card {
  width: 100%;
}

.dashboard-card--kpi .metric-icon,
.metric-card .metric-icon,
.traffic-card .metric-icon {
  grid-row: 1 / span 2;
}

.dashboard-card--kpi .metric-label,
.metric-card .metric-label,
.traffic-card .metric-label {
  align-self: end;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: normal;
  white-space: normal;
}

.dashboard-card--kpi .metric-value,
.metric-card .metric-value,
.traffic-card .metric-value {
  align-self: start;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.dashboard-card--kpi small,
.metric-card small,
.card-subtitle {
  grid-column: 2;
  color: var(--color-text-muted);
  font-size: 13px;
}

.dashboard-card[data-drilldown],
.traffic-card[data-traffic] {
  cursor: pointer;
}

.dashboard-card[data-drilldown]:hover,
.traffic-card[data-traffic]:hover,
.dashboard-row:hover {
  border-color: rgba(0, 139, 210, .38);
  box-shadow: 0 12px 30px rgba(0, 95, 144, .10);
}

.dashboard-card[data-drilldown]:focus-visible,
.traffic-card[data-traffic]:focus-visible {
  outline: 3px solid rgba(0, 139, 210, .32);
  outline-offset: 2px;
}

.metric-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
  flex: 0 0 auto;
}

.metric-icon svg {
  width: 20px;
  height: 20px;
}

.metric-card--danger .metric-icon,
.metric-row--danger .metric-icon { color: var(--color-danger); background: var(--color-danger-soft); }
.metric-card--warning .metric-icon,
.metric-row--warning .metric-icon { color: var(--color-warning); background: var(--color-warning-soft); }
.metric-card--success .metric-icon,
.metric-row--success .metric-icon { color: var(--color-success); background: var(--color-success-soft); }
.metric-card--purple .metric-icon,
.metric-row--purple .metric-icon { color: var(--color-purple); background: var(--color-purple-soft); }
.metric-card--caution .metric-icon,
.metric-row--caution .metric-icon { color: var(--color-caution); background: var(--color-caution-soft); }

.metric-label {
  color: var(--color-text);
  font-size: 15px;
  font-weight: 500;
}

.metric-value {
  color: var(--color-primary-strong);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.05;
  text-align: right;
}

.metric-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 44px;
}

button.metric-row {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.metric-row--clickable {
  cursor: pointer;
  border-radius: 8px;
  min-height: 44px;
  transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
}

.metric-row--clickable:hover {
  background: var(--color-primary-soft);
}

.metric-row--clickable:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.metric-row--clickable:active {
  transform: translateY(1px);
}

.metric-row .metric-label {
  min-width: 0;
}

.metric-row .metric-value {
  font-size: 16px;
  white-space: nowrap;
}

.metric-stack {
  display: grid;
  gap: 10px;
}

.card-title {
  margin: 0 0 10px;
  color: var(--color-text);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.card-divider {
  height: 1px;
  background: var(--color-border);
  margin: 8px 0;
}

.dashboard-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-panel {
  padding: 20px;
  display: grid;
  gap: 14px;
  min-width: 0;
}

.dashboard-panel h3 {
  margin: 0;
}

.dashboard-panel p {
  margin: 0;
  color: var(--color-text-muted);
}

.dashboard-wide {
  grid-column: 1 / -1;
}

.dashboard-offer-traffic-layout {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr);
  gap: 16px;
  align-items: start;
}

.dashboard-offer-panel,
.dashboard-traffic-panel {
  height: 100%;
  align-content: start;
}

.daily-followup-panel {
  gap: 12px;
}

.daily-followup-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.daily-followup-status {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.daily-followup-status--ready {
  color: #006091;
  background: rgba(0, 139, 210, .12);
}

.daily-followup-status--empty {
  color: var(--color-text-muted);
  background: var(--color-surface-muted);
}

.daily-followup-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.daily-followup-grid .metric-card {
  min-height: 104px;
}

.daily-followup-employees {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.daily-followup-employee {
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-muted);
  display: grid;
  gap: 4px;
}

.daily-followup-employee span {
  color: #006091;
  font-weight: 800;
}

.daily-followup-employee small {
  color: var(--color-text-muted);
  font-weight: 700;
}

.dashboard-panel h4 {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.dashboard-row,
.drilldown-table > div,
.lead-detail-card {
  padding: 12px 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.dashboard-row + .dashboard-row,
.drilldown-table > div + div,
.lead-detail-card + .lead-detail-card {
  margin-top: 8px;
}

.lead-detail-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: flex-start;
}

.lead-detail-card__body {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.lead-detail-card__title {
  color: var(--color-text);
  font-size: 16px;
  line-height: 1.25;
}

.lead-detail-card__owner,
.lead-detail-card__meta,
.lead-detail-card__reason {
  color: var(--color-text-muted);
  line-height: 1.35;
}

.lead-detail-card__reason {
  font-size: 13px;
}

.lead-detail-card__link,
.lead-detail-card__link-missing {
  width: fit-content;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
}

.lead-detail-card__link {
  color: var(--color-primary);
  text-decoration: none;
}

.lead-detail-card__link:hover {
  text-decoration: underline;
}

.lead-detail-card__link .metric-icon {
  width: 24px;
  height: 24px;
}

.lead-detail-card__link .metric-icon svg {
  width: 14px;
  height: 14px;
}

.lead-detail-card__link-missing {
  color: var(--color-text-muted);
}

.traffic-grid,
.mini-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.traffic-grid--compact {
  grid-template-columns: 1fr;
  gap: 10px;
}

.traffic-grid--compact .traffic-card {
  min-height: 56px;
  padding: 10px 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-content: center;
}

.traffic-grid--compact .traffic-card .metric-icon {
  grid-row: auto;
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.traffic-grid--compact .traffic-card .metric-icon svg {
  width: 17px;
  height: 17px;
}

.traffic-grid--compact .traffic-card .metric-label,
.traffic-grid--compact .traffic-card .metric-value {
  align-self: center;
}

.traffic-grid--compact .traffic-card .metric-label {
  min-width: 0;
}

.traffic-grid--compact .traffic-card .metric-value {
  color: var(--color-primary-strong);
  font-size: 22px;
  text-align: right;
}

.traffic-card,
.mini-kpis > div {
  color: var(--color-text);
  min-width: 0;
}

.dashboard-offer-panel .mini-kpis {
  grid-auto-rows: 1fr;
}

.dashboard-offer-panel .offer-kpi-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-offer-panel .mini-kpis > div {
  min-height: 104px;
}

.dashboard-offer-panel .offer-kpi-grid .metric-card {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
}

.dashboard-offer-panel .mini-kpis .metric-label {
  line-height: 1.25;
}

.dashboard-offer-panel .mini-kpis .metric-value {
  font-size: 24px;
  line-height: 1.15;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offer-assignment-notice {
  width: 100%;
  margin-top: 12px;
  border: 1px solid rgba(255, 153, 51, .36);
  border-radius: 10px;
  background: var(--color-warning-soft);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  color: var(--color-text);
  font: inherit;
  text-align: left;
}

button.offer-assignment-notice {
  cursor: pointer;
}

button.offer-assignment-notice:hover {
  border-color: rgba(249, 115, 22, .55);
  box-shadow: 0 10px 22px rgba(249, 115, 22, .10);
}

button.offer-assignment-notice:focus-visible {
  outline: 3px solid rgba(249, 115, 22, .28);
  outline-offset: 2px;
}

.offer-assignment-notice .metric-icon {
  color: var(--color-warning);
  background: #fff8f1;
}

.offer-assignment-notice span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.offer-assignment-notice strong {
  font-weight: 850;
}

.offer-assignment-notice small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.offer-assignment-notice b {
  color: var(--color-primary-strong);
  white-space: nowrap;
}

.offer-period-summary {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px 16px;
}

.offer-period-summary__text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.offer-period-summary__text strong,
.offer-period-summary__count {
  color: var(--color-text);
  font-weight: 800;
}

.offer-period-summary__text span {
  color: var(--color-text-muted);
  font-size: 13px;
}

.offer-period-summary__count {
  color: var(--color-primary-strong);
  text-align: right;
  white-space: nowrap;
}

.traffic-red { border-color: #f2aaa0; background: #fff3f1; }
.traffic-yellow { border-color: #ffd189; background: #fff8ea; }
.traffic-green { border-color: #a7d9bf; background: #effaf4; }
.traffic-gray { border-color: #c9d5df; background: #f7fafc; }

.employee-card-grid {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.employee-card-row {
  display: grid;
  gap: 16px;
  grid-auto-rows: 1fr;
  min-width: 0;
}

.employee-card-row--1 { grid-template-columns: minmax(0, 1fr); }
.employee-card-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.employee-card-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.employee-card-row--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.employee-metric-card {
  display: grid;
  gap: 10px;
  align-content: start;
  height: 100%;
  min-width: 0;
}

.employee-metric-card .metric-row {
  grid-template-columns: 44px minmax(0, 1fr) minmax(112px, 42%);
  column-gap: 10px;
}

.employee-metric-card .metric-row .metric-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-metric-card .metric-row .metric-value {
  justify-self: end;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.employee-next-action {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}

button.employee-next-action {
  width: 100%;
  color: inherit;
  font: inherit;
  min-height: 44px;
  text-align: left;
}

.employee-next-action--clickable {
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.employee-next-action--clickable:hover {
  border-color: rgba(0, 139, 210, .38);
  box-shadow: 0 10px 24px rgba(0, 95, 144, .10);
}

.employee-next-action--clickable:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.employee-next-action--clickable:active {
  transform: translateY(1px);
}

.employee-next-action .metric-icon {
  grid-row: 1 / span 2;
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.employee-next-action .metric-icon svg {
  width: 17px;
  height: 17px;
}

.employee-next-action span,
.employee-next-action strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-next-action span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.employee-next-action strong {
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.25;
}

.employee-next-action--danger .metric-icon { color: var(--color-danger); background: var(--color-danger-soft); }
.employee-next-action--warning .metric-icon { color: var(--color-warning); background: var(--color-warning-soft); }
.employee-next-action--success .metric-icon { color: var(--color-success); background: var(--color-success-soft); }
.employee-next-action--purple .metric-icon { color: var(--color-purple); background: var(--color-purple-soft); }
.employee-next-action--blue .metric-icon { color: var(--color-primary-strong); background: var(--color-primary-soft); }
.employee-next-action--caution .metric-icon { color: var(--color-caution); background: var(--color-caution-soft); }

.employee-activity-section {
  display: grid;
  gap: 8px;
}

.employee-activity-section h5 {
  margin: 0;
  color: var(--color-text);
  font-size: 15px;
  font-weight: 800;
}

.employee-activity-list {
  display: grid;
  gap: 7px;
}

.employee-activity-row {
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  padding: 3px 4px;
  border-radius: 8px;
  color: var(--color-text);
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
}

.employee-activity-row:hover {
  background: var(--color-primary-soft);
}

.employee-activity-row:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.employee-activity-row:active {
  transform: translateY(1px);
}

.employee-activity-row .metric-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.employee-activity-row .metric-icon svg {
  width: 16px;
  height: 16px;
}

.employee-activity-row span {
  min-width: 0;
}

.employee-activity-row strong {
  color: var(--color-primary-strong);
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.employee-activity-row__chevron {
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.employee-activity-row--danger .metric-icon { color: var(--color-danger); background: var(--color-danger-soft); }
.employee-activity-row--warning .metric-icon { color: var(--color-warning); background: var(--color-warning-soft); }
.employee-activity-row--success .metric-icon { color: var(--color-success); background: var(--color-success-soft); }
.employee-activity-row--purple .metric-icon { color: var(--color-purple); background: var(--color-purple-soft); }
.employee-activity-row--blue .metric-icon { color: var(--color-primary-strong); background: var(--color-primary-soft); }
.employee-activity-row--caution .metric-icon { color: var(--color-caution); background: var(--color-caution-soft); }

.employee-activity-empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.lead-quality-board {
  display: grid;
  gap: 14px;
}

.lead-quality-board > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.lead-quality-context {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.lead-quality-context div {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 10px 12px;
}

.lead-quality-context span,
.lead-quality-context small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
}

.lead-quality-context strong {
  color: var(--color-text);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.2;
}

.lead-quality-summary {
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  background: var(--color-surface);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) auto minmax(260px, .85fr);
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
}

.lead-quality-summary--success {
  border-color: var(--color-success-soft);
  background: linear-gradient(135deg, #ffffff 0%, #effaf4 100%);
}

.lead-quality-summary--warning {
  border-color: var(--color-warning-soft);
  background: linear-gradient(135deg, #ffffff 0%, #fff8ea 100%);
}

.lead-quality-summary--danger {
  border-color: var(--color-danger-soft);
  background: linear-gradient(135deg, #ffffff 0%, #fff3f1 100%);
}

.lead-quality-summary--empty {
  grid-template-columns: auto minmax(0, 1fr);
  background: var(--color-surface-soft);
}

.lead-quality-summary > .metric-icon,
.lead-quality-summary__head .metric-icon {
  width: 36px;
  height: 36px;
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
}

.lead-quality-summary__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.lead-quality-summary h4,
.lead-quality-summary p {
  margin: 0;
}

.lead-quality-summary h4 {
  color: var(--color-text);
  font-size: 17px;
  font-weight: 850;
}

.lead-quality-summary p {
  color: var(--muted);
  line-height: 1.35;
}

.lead-quality-summary__score {
  display: grid;
  gap: 2px;
  text-align: right;
  white-space: nowrap;
}

.lead-quality-summary__score span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.lead-quality-summary__score strong {
  color: var(--color-primary-strong);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.lead-data-quality__priority {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.lead-data-quality__priority span {
  align-items: center;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  gap: 10px;
  justify-content: space-between;
  min-height: 36px;
  padding: 7px 10px;
}

.lead-data-quality__priority b {
  color: var(--color-primary-strong);
  font-size: 18px;
  font-weight: 900;
}

.lead-quality-summary__metrics,
.employee-quality__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.lead-quality-summary__metrics span,
.employee-quality__grid span {
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  font-size: 13px;
  font-weight: 700;
}

.lead-quality-summary__metrics b,
.employee-quality__grid b {
  color: var(--color-text);
  font-weight: 850;
}

.lead-data-quality {
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  background: var(--color-surface-soft);
  display: grid;
  gap: 12px;
  padding: 14px 16px;
}

.lead-data-quality__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.lead-data-quality__head .metric-icon {
  width: 36px;
  height: 36px;
  color: var(--color-warning);
  background: var(--color-warning-soft);
}

.lead-data-quality--empty .metric-icon {
  color: var(--color-success);
  background: var(--color-success-soft);
}

.lead-data-quality h4,
.lead-data-quality p {
  margin: 0;
}

.lead-data-quality h4 {
  color: var(--color-text);
  font-size: 16px;
  font-weight: 850;
}

.lead-data-quality p {
  color: var(--muted);
  line-height: 1.35;
}

.lead-data-quality__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.lead-data-quality__group {
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: 9px;
  padding-top: 12px;
}

.lead-data-quality__group-head {
  display: grid;
  gap: 2px;
}

.lead-data-quality__group h5,
.lead-data-quality__group p {
  margin: 0;
}

.lead-data-quality__group h5 {
  color: var(--color-text);
  font-size: 14px;
  font-weight: 850;
}

.lead-data-quality__group p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.lead-data-quality__metric {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 10px;
}

.lead-data-quality__metric span {
  color: var(--color-text);
  font-size: 13px;
  font-weight: 780;
  line-height: 1.25;
}

.lead-data-quality__metric strong {
  color: var(--color-primary-strong);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.lead-data-quality__metric--danger {
  border-color: var(--color-danger-soft);
}

.lead-data-quality__metric--warning {
  border-color: var(--color-warning-soft);
}

.lead-data-quality__metric--info {
  border-color: var(--color-primary-soft);
}

.lead-data-quality__complete {
  border: 1px solid var(--color-success-soft);
  border-radius: 10px;
  background: #fff;
  color: var(--color-success);
  padding: 9px 10px;
  font-weight: 800;
}

.lead-quality-criteria {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lead-quality-criteria span {
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface-soft);
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 750;
}

.lead-quality-criteria .metric-icon {
  width: 20px;
  height: 20px;
  color: var(--color-success);
  background: var(--color-success-soft);
}

.lead-quality-criteria .metric-icon svg {
  width: 13px;
  height: 13px;
}

.employee-quality {
  display: grid;
  gap: 7px;
}

.employee-quality__score {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.employee-quality__score .metric-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.employee-quality__score .metric-icon svg {
  width: 15px;
  height: 15px;
}

.employee-quality__score span {
  color: var(--color-text);
  font-size: 13px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-quality__score strong {
  color: var(--color-primary-strong);
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
}

.employee-quality--success .metric-icon { color: var(--color-success); background: var(--color-success-soft); }
.employee-quality--warning .metric-icon { color: var(--color-warning); background: var(--color-warning-soft); }
.employee-quality--danger .metric-icon { color: var(--color-danger); background: var(--color-danger-soft); }

.employee-quality__grid span {
  background: var(--color-surface-soft);
  font-size: 12px;
  padding: 5px 7px;
}

.activity-detail-quality dd {
  display: grid;
  gap: 3px;
}

.activity-detail-quality strong {
  color: var(--color-primary-strong);
}

.activity-detail-quality span {
  color: var(--color-text);
  font-weight: 750;
}

.activity-detail-quality small {
  color: var(--muted);
}

.activity-timeline-list {
  display: grid;
  gap: 10px;
}

.activity-timeline-day {
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  background: var(--color-surface);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.activity-timeline-day__head,
.activity-timeline-type-row {
  width: 100%;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  font: inherit;
  text-align: left;
}

.activity-timeline-day__head {
  padding: 12px 14px;
}

.activity-timeline-day__head strong {
  color: var(--color-primary-strong);
}

.activity-timeline-day__types {
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: 0;
  padding: 6px 10px 8px;
}

.activity-timeline-type-row {
  min-height: 36px;
  padding: 6px 4px;
  border-radius: 8px;
}

.activity-timeline-type-row + .activity-timeline-type-row {
  border-top: 1px solid rgba(216, 228, 236, .72);
}

.activity-timeline-day__head:hover,
.activity-timeline-type-row:hover {
  background: var(--color-primary-soft);
  cursor: pointer;
}

.activity-timeline-day__head:focus-visible,
.activity-timeline-type-row:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.activity-timeline-type-row .metric-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.activity-timeline-type-row span,
.activity-timeline-day__head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-timeline-type-row strong {
  color: var(--color-primary-strong);
  white-space: nowrap;
}

.activity-timeline-type-row--danger .metric-icon { color: var(--color-danger); background: var(--color-danger-soft); }
.activity-timeline-type-row--warning .metric-icon { color: var(--color-warning); background: var(--color-warning-soft); }
.activity-timeline-type-row--success .metric-icon { color: var(--color-success); background: var(--color-success-soft); }
.activity-timeline-type-row--purple .metric-icon { color: var(--color-purple); background: var(--color-purple-soft); }
.activity-timeline-type-row--blue .metric-icon { color: var(--color-primary-strong); background: var(--color-primary-soft); }
.activity-timeline-type-row--caution .metric-icon { color: var(--color-caution); background: var(--color-caution-soft); }

.drilldown-summary {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.activity-detail-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
}

.activity-detail-list div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
}

.activity-detail-list dt {
  color: var(--muted);
  font-weight: 700;
}

.activity-detail-list dd {
  margin: 0;
  min-width: 0;
  color: var(--color-text);
}

.activity-detail-comment dd {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.activity-detail-comment p {
  margin: 0;
}

.activity-comment-more {
  margin-top: 6px;
}

.activity-comment-more summary {
  color: var(--color-primary-strong);
  cursor: pointer;
  font-weight: 800;
}

.activity-comment-more p {
  margin-top: 6px;
}

.compact-dashboard-rows {
  display: grid;
  gap: 8px;
}

.compact-dashboard-rows .dashboard-row {
  min-height: 42px;
  padding: 10px 14px;
}

.dashboard-details {
  display: grid;
  gap: 12px;
}

.dashboard-details summary {
  cursor: pointer;
  color: var(--color-text);
  font-size: 18px;
  font-weight: 800;
  list-style-position: outside;
}

.dashboard-details[open] summary {
  margin-bottom: 4px;
}

.drilldown-table > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  justify-content: stretch;
}

.drilldown-table span,
.drilldown-table small {
  color: var(--color-text-muted);
}

.drilldown-table strong {
  display: block;
  margin-bottom: 4px;
}

.drilldown-table small {
  display: block;
  margin-top: 6px;
}

.empty-state {
  color: var(--muted);
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 7px;
}

.sidebar {
  grid-row: 1 / -1;
  background: var(--enrgy-blue);
  color: white;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.mobile-menu-button,
.mobile-menu-backdrop,
.mobile-nav-extra,
.mobile-top-logo {
  display: none;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; }
h2 { font-size: 22px; }
h3 { font-size: 16px; }
p { color: var(--muted); line-height: 1.45; }
.sidebar p { color: rgba(255, 255, 255, .86); margin-top: 6px; font-size: 13px; }
.brand {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
}

.brand > div {
  min-width: 0;
}

.brand h1 {
  font-size: 20px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.brand img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--enrgy-white);
  padding: 4px;
}

nav { display: grid; gap: 8px; }
.nav-group {
  display: grid;
  gap: 4px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav span {
  width: 20px;
  display: inline-flex;
  justify-content: center;
}
button, select, input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 7px;
  padding: 10px 14px;
  background: var(--enrgy-blue);
  color: white;
  cursor: pointer;
  min-height: 40px;
}
button:disabled { opacity: .55; cursor: progress; }

.ghost-button {
  background: transparent;
  color: var(--enrgy-blue-dark);
  border: 1px solid rgba(0, 139, 210, .24);
}

.ghost-button:hover {
  background: rgba(0, 139, 210, .08);
}

.nav {
  background: transparent;
  color: var(--enrgy-white);
  text-align: left;
}

.nav-submenu {
  display: grid;
  gap: 4px;
  margin-left: 16px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, .24);
}

.nav-sub {
  min-height: 34px;
  padding: 8px 10px;
  color: rgba(255, 255, 255, .88);
  font-size: 13px;
}

.nav-sub span {
  width: 16px;
  font-size: 12px;
}

.nav-parent.active {
  background: rgba(255, 255, 255, .14);
}

.nav.active {
  background: rgba(255, 255, 255, .18);
  color: var(--enrgy-white);
  box-shadow: inset 4px 0 0 var(--enrgy-orange);
}

.nav-sub.active {
  background: rgba(255, 255, 255, .16);
  box-shadow: inset 3px 0 0 var(--enrgy-orange);
}

.topbar {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: var(--enrgy-white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-status {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.topbar-status span {
  color: var(--muted);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.top-link {
  background: transparent;
  color: var(--ink);
  border: 1px solid transparent;
}

.top-link:hover,
.top-link.active {
  color: var(--enrgy-blue-dark);
  background: rgba(0, 139, 210, .08);
  border-color: rgba(0, 139, 210, .18);
}

.user-menu {
  position: relative;
}

.user-button {
  width: 188px;
  min-height: 44px;
  background: rgba(0, 139, 210, .08);
  color: var(--ink);
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  text-align: left;
  padding: 6px 10px;
}

.user-button > span:first-child,
.profile-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--enrgy-orange);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.user-summary {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.user-summary strong,
.user-summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-button small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 280px;
  display: grid;
  gap: 4px;
  padding: 8px;
  background: var(--enrgy-white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(0, 63, 96, .16);
  z-index: 30;
}

.user-dropdown-profile {
  display: grid;
  gap: 2px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

.user-dropdown-profile span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.user-dropdown[hidden] {
  display: none !important;
}

.user-dropdown button {
  background: transparent;
  color: var(--ink);
  text-align: left;
  justify-content: flex-start;
}

.user-dropdown button:hover {
  background: rgba(0, 139, 210, .08);
  color: var(--enrgy-blue-dark);
}

main {
  grid-column: 2;
  grid-row: 2;
  padding: 24px;
  overflow: auto;
}
.tab { display: none; }
.tab.active { display: block; }

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.toolbar {
  display: grid;
  grid-template-columns: 160px 240px minmax(300px, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
}
.toolbar.single-action {
  grid-template-columns: max-content;
  align-items: start;
}
label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #344054;
}
.help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
input, select {
  border: 1px solid #d0d5dd;
  border-radius: 7px;
  background: white;
  height: 42px;
  min-height: 42px;
  padding: 8px 10px;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  height: auto;
  min-height: 0;
}
input:focus, select:focus {
  outline: 3px solid rgba(0, 139, 210, .18);
  border-color: var(--enrgy-blue);
}

@media (max-width: 980px) {
  .toolbar {
    grid-template-columns: 1fr;
  }
  .employee-toolbar,
  .activity-summary,
  .activity-grid,
  .employee-kpi-dashboard {
    grid-template-columns: 1fr;
  }
  .employee-kpi-cards {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
  .kpi-card.wide {
    grid-column: span 2;
  }
  .quote-overview-total,
  .quote-employee summary,
  .quote-document {
    grid-template-columns: 1fr;
  }
  .quote-overview-total {
    align-items: flex-start;
    flex-direction: column;
  }
}

.log {
  white-space: pre-wrap;
  background: #003f60;
  color: #e4e7ec;
  border-radius: 7px;
  padding: 12px;
  min-height: 44px;
  margin-bottom: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.log:empty { display: none; }

.employee-toolbar {
  grid-template-columns: minmax(420px, 760px) 280px;
}

.range-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  max-width: min(100%, 960px);
}

.range-group-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-left: 4px;
}

.range-group-label:first-child {
  margin-left: 0;
}

.range-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.range-tab:hover,
.range-tab:focus-visible {
  border-color: var(--enrgy-blue);
  box-shadow: 0 0 0 3px rgba(0, 139, 210, .12);
  outline: none;
}

.range-tab.active {
  background: var(--enrgy-blue);
  border-color: var(--enrgy-blue);
  color: #fff;
}

#employeeActivityRangeLabel {
  max-width: 960px;
}

@media (max-width: 980px) {
  .employee-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .range-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: calc(100vw - 36px);
    padding-bottom: 2px;
    scrollbar-width: thin;
    overscroll-behavior-x: contain;
  }

  .range-tab {
    flex: 0 0 auto;
    min-height: 42px;
    padding-inline: 11px;
  }
}

.activity-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.activity-summary .action-hint {
  grid-column: 1 / -1;
}

.employee-kpi-dashboard {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.employee-kpi-people {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 8px;
  align-content: start;
  max-height: 520px;
  overflow: auto;
}

.employee-kpi-person {
  border: 1px solid transparent;
  background: #f7fafc;
  color: var(--ink);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.employee-kpi-person:hover,
.employee-kpi-person.active {
  border-color: var(--enrgy-blue);
  background: #edf8ff;
}

.employee-kpi-person span,
.employee-kpi-person strong {
  position: relative;
  z-index: 1;
}

.employee-kpi-person i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: var(--bar, 0%);
  background: var(--enrgy-orange);
}

.employee-kpi-main {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 14px;
}

.employee-kpi-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.employee-kpi-title p {
  font-size: 13px;
}

.employee-kpi-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
}

.kpi-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
  display: grid;
  gap: 4px;
}

.kpi-card strong {
  color: var(--enrgy-blue-dark);
  font-size: 22px;
}

.kpi-card span {
  color: var(--muted);
  font-size: 12px;
}

.kpi-card.primary {
  background: #edf8ff;
  border-color: #b9def2;
}

.kpi-card.accent {
  background: #fff6ed;
  border-color: #ffd2a6;
}

.kpi-card.wide {
  grid-column: span 2;
}

.employee-kpi-bars {
  display: grid;
  gap: 8px;
}

.activity-type-breakdown {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.activity-type-breakdown h4 {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.activity-type-breakdown p {
  padding: 12px 14px;
  color: var(--muted);
}

.activity-type-row {
  display: grid;
  grid-template-columns: 1fr 170px 54px;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid #eef3f7;
  font-size: 13px;
}

.activity-type-row:first-of-type {
  border-top: 0;
}

.activity-type-row span {
  font-weight: 700;
}

.activity-type-row em {
  color: var(--muted);
  font-style: normal;
}

.activity-type-row strong {
  color: var(--enrgy-blue-dark);
  text-align: right;
}

.kpi-bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 48px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.kpi-bar-row div {
  height: 8px;
  background: #edf2f7;
  border-radius: 99px;
  overflow: hidden;
}

.kpi-bar-row i {
  display: block;
  height: 100%;
  background: var(--enrgy-blue);
  border-radius: inherit;
}

.source-note {
  margin-top: 2px;
  color: var(--muted);
}

.kpi-source-box {
  border: 1px solid #b9def2;
  background: #eef8ff;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.kpi-source-box p {
  margin: 0;
  color: var(--muted);
}

.kpi-source-box em {
  display: inline-block;
  margin-left: 6px;
  color: var(--enrgy-blue-dark);
  font-style: normal;
  font-weight: 700;
}

.quote-overview-card {
  margin-bottom: 16px;
}

.section-note {
  margin: -4px 0 12px;
  font-size: 13px;
}

.quote-overview-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  background: #f2f9fd;
  border: 1px solid #b9def2;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.quote-overview-total strong {
  color: var(--enrgy-blue-dark);
  font-size: 24px;
}

.quote-overview-total span,
.quote-document span,
.quote-employee summary em {
  color: var(--muted);
  font-style: normal;
}

.quote-warning {
  margin-bottom: 10px;
}

.quote-month-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.quote-month-card {
  border: 1px solid #ffd2a6;
  background: #fff6ed;
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 5px;
}

.quote-month-card span {
  color: var(--muted);
  font-weight: 700;
}

.quote-month-card strong {
  color: var(--enrgy-blue-dark);
  font-size: 24px;
}

.quote-month-card em {
  color: var(--ink);
  font-style: normal;
}

.quote-month-card b {
  color: var(--muted);
  font-size: 12px;
}

.quote-employee-list {
  display: grid;
  gap: 8px;
}

.quote-employee {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.quote-employee summary {
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  font-weight: 700;
}

.quote-employee summary strong {
  color: var(--enrgy-blue-dark);
}

.quote-documents {
  border-top: 1px solid var(--line);
}

.quote-document {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid #eef3f7;
}

.quote-document:first-child {
  border-top: 0;
}

.quote-document div {
  display: grid;
  gap: 2px;
}

.quote-document b {
  color: var(--ink);
}

.summary-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 4px;
}

.summary-card strong {
  color: var(--enrgy-blue-dark);
  font-size: 24px;
}

.summary-card span {
  color: var(--muted);
  font-size: 13px;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.activity-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.activity-section-head h3 {
  margin: 0;
  font-size: 17px;
}

.activity-section-head span {
  background: rgba(0, 139, 210, .10);
  color: var(--enrgy-blue-dark);
  border-radius: 999px;
  min-width: 32px;
  padding: 4px 9px;
  text-align: center;
  font-weight: 700;
}

.activity-list {
  display: grid;
  gap: 0;
  max-height: 560px;
  overflow: auto;
}

.activity-item {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.activity-item-head span,
.activity-meta {
  color: var(--muted);
  font-size: 12px;
}

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.activity-meta span {
  background: #f2f4f7;
  border-radius: 999px;
  padding: 3px 8px;
}

.activity-item p {
  margin: 0;
  color: #344054;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.activity-empty {
  color: var(--muted);
  padding: 14px;
}

.groups {
  display: grid;
  gap: 12px;
}
.group {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.group.success {
  border-color: var(--enrgy-blue);
}
.group-head {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.group-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.apply-one {
  background: var(--enrgy-blue);
  white-space: nowrap;
}
.undo-merge {
  background: var(--enrgy-orange);
  white-space: nowrap;
}
.action-hint {
  border: 1px solid rgba(0, 139, 210, .24);
  background: rgba(0, 139, 210, .08);
  color: var(--enrgy-blue-dark);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 14px;
}
.group-status {
  border-top: 1px solid rgba(0, 139, 210, .24);
  background: rgba(0, 139, 210, .08);
  color: var(--enrgy-blue-dark);
  padding: 12px 14px;
  font-weight: 700;
}
.group-status.running {
  border-top-color: rgba(0, 139, 210, .24);
  background: rgba(0, 139, 210, .08);
  color: var(--enrgy-blue-dark);
}
.group-status.error {
  border-top-color: rgba(255, 153, 51, .36);
  background: rgba(255, 153, 51, .12);
  color: #8a4700;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-width: 42px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(0, 139, 210, .10);
  color: var(--enrgy-blue-dark);
  font-size: 12px;
  font-weight: 700;
}
.warn { background: rgba(255, 153, 51, .14); color: #8a4700; }
.danger { background: rgba(255, 153, 51, .14); color: #8a4700; }
.muted { color: var(--muted); font-size: 12px; }
.history-card.history-undone {
  opacity: .78;
}
.history-card.history-undone .group-head {
  background: rgba(255, 153, 51, .08);
}
.history-note {
  border: 1px solid rgba(255, 153, 51, .36);
  background: rgba(255, 153, 51, .12);
  color: #8a4700;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 700;
}
.group-body {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(340px, 1.4fr);
  gap: 14px;
  padding: 14px;
}
.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.mini-table th, .mini-table td {
  text-align: left;
  border-bottom: 1px solid #eef2f6;
  padding: 7px 6px;
  vertical-align: top;
}
.mini-table th { color: var(--muted); font-weight: 600; }
.mini-table tr.master-row td {
  background: rgba(0, 139, 210, .08);
  border-top: 1px solid rgba(0, 139, 210, .24);
  border-bottom: 1px solid rgba(0, 139, 210, .24);
}
.mini-table tr.master-row td:first-child {
  box-shadow: inset 4px 0 0 var(--enrgy-blue);
  padding-left: 10px;
}
.master-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--enrgy-blue);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  vertical-align: 2px;
}
.item-link {
  color: var(--enrgy-blue);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.item-link:hover { text-decoration: underline; }
.updates {
  display: grid;
  gap: 8px;
}
.update {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px;
  background: #fcfcfd;
  font-size: 13px;
}
.danger-box {
  border-color: rgba(255, 153, 51, .36);
  background: rgba(255, 153, 51, .12);
  color: #7a3c00;
}
.decision-matrix {
  border: 1px solid rgba(255, 153, 51, .42);
  border-radius: 7px;
  background: rgba(255, 153, 51, .10);
  padding: 10px;
  display: grid;
  gap: 8px;
}
.decision-note {
  color: #7a3c00;
  font-size: 13px;
  line-height: 1.4;
}
.decision-actions {
  color: #7a3c00;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.caution {
  color: #8a4700;
}
.radio-line {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
  color: #344054;
  font-size: 12px;
  margin-bottom: 4px;
}
.radio-line input {
  min-height: 0;
  padding: 0;
}
.apply-manual {
  background: var(--enrgy-orange);
  white-space: nowrap;
}

.group.ignored {
  opacity: .72;
}

.group.ignored .group-head {
  background: #fff7ed;
}

.ignore-group {
  white-space: nowrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(32, 36, 42, .42);
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: min(860px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  background: var(--enrgy-white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 72px rgba(0, 63, 96, .28);
  display: grid;
  gap: 16px;
  padding: 18px;
}

.modal-head,
.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.merge-review-body {
  display: grid;
  gap: 12px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.review-box,
.review-warning,
.review-confirm-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.review-box span,
.review-confirm-note {
  color: var(--muted);
}

.review-warning {
  background: #fff7ed;
  border-color: rgba(255, 153, 51, .45);
  color: #7a3c00;
}

.review-confirm-note {
  background: rgba(0, 139, 210, .06);
}

.report-list {
  display: grid;
  gap: 8px;
}
.report-row {
  display: grid;
  grid-template-columns: 1fr 180px 220px 120px;
  gap: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  align-items: center;
}

.report-row.stale-report {
  background: #fff7ed;
  border-color: rgba(255, 153, 51, .45);
}

.report-row.stale-report span {
  color: #9a4b00;
  font-weight: 700;
}

.settings-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
}

.settings-menu,
.settings-content,
.help-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.settings-menu {
  padding: 10px;
  align-self: start;
  display: grid;
  gap: 6px;
}

.settings-menu-item {
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.settings-menu-item.active {
  background: rgba(0, 139, 210, .10);
  color: var(--enrgy-blue-dark);
  box-shadow: inset 4px 0 0 var(--enrgy-orange);
}

.settings-content {
  padding: 16px;
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: grid;
  gap: 14px;
}

.profile-box {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.profile-box span,
.profile-box small {
  display: block;
  color: var(--muted);
}

.add-user-form {
  display: grid;
  grid-template-columns: 1fr 1.3fr 140px max-content;
  gap: 10px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.users-table input,
.users-table select {
  width: 100%;
}

.board-access-table th,
.board-access-table td {
  vertical-align: top;
}

.permission-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid #b9ddf3;
  border-radius: 8px;
  background: #eef8fe;
  color: #005f90;
  margin-bottom: 14px;
}

.permission-help span {
  color: var(--muted);
  font-size: 13px;
  min-width: min(100%, 360px);
}

.manual-normalization-panel {
  display: grid;
  gap: 12px;
  border: 1px solid #f2c48d;
  border-radius: 8px;
  background: #fff8ef;
  padding: 14px;
}

.manual-normalization-panel h4 {
  margin: 0 0 6px;
  color: #7a3f00;
}

.manual-normalization-panel p {
  margin: 0 0 6px;
  color: var(--muted);
}

.manual-normalization-panel label {
  max-width: 420px;
}

.permission-grid {
  display: grid;
  gap: 10px;
}

.permission-grid-head,
.permission-row {
  display: grid;
  grid-template-columns: minmax(520px, 1.35fr) minmax(360px, 1fr) minmax(170px, 0.42fr);
  gap: 16px;
  align-items: start;
}

.permission-grid-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 4px;
}

.permission-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
}

.permission-main,
.permission-roles,
.permission-status {
  display: grid;
  gap: 8px;
}

.permission-main {
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.8fr) minmax(140px, 0.75fr);
}

.permission-main p {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.permission-main input[readonly] {
  background: #f6f9fc;
  color: var(--muted);
}

.permission-roles {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 8px;
}

.permission-roles small {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.permission-role {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: #f8fafc;
  font-weight: 700;
  white-space: nowrap;
}

.permission-role.admin {
  background: #fff7ed;
}

.permission-role.supervisor {
  background: #eef8fe;
}

.permission-role.editor {
  background: #eef8fe;
}

.permission-role.viewer {
  background: #f0fdf4;
}

.permission-role:has(input:disabled) {
  opacity: 0.48;
}

.permission-role input:disabled {
  cursor: not-allowed;
}

.permission-status {
  justify-items: start;
}

.permission-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  color: #005f90;
  background: #eef8fe;
}

.permission-badge.locked {
  color: #8a4b00;
  background: #fff2df;
}

.permission-badge.wide {
  color: #137333;
  background: #e7f7ed;
}

.permission-badge.editor {
  color: #005f90;
  background: #eef8fe;
}

.permission-badge.supervisor {
  color: #005f90;
  background: #eef8fe;
}

.permission-badge.admin {
  color: #6b3bd9;
  background: #f1eaff;
}

.role-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-width: 260px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.sales-employees-list {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.sales-employee-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.sales-employee-row small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.sales-employee-status {
  justify-self: end;
  font-weight: 700;
  color: var(--enrgy-blue-dark);
  background: var(--color-primary-soft);
  border-radius: 999px;
  padding: 4px 9px;
}

.help-topic-nav,
.help-topic-grid,
.help-topic-sections,
.help-split-grid {
  display: grid;
  gap: 12px;
}

.help-topic-nav {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 18px;
}

.help-topic-nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  color: var(--color-primary-strong);
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  background: rgba(0, 139, 210, .08);
  border: 1px solid rgba(0, 139, 210, .18);
  border-radius: 8px;
}

.help-topic-nav a:hover,
.help-topic-nav a:focus-visible {
  background: rgba(0, 139, 210, .14);
  border-color: rgba(0, 139, 210, .34);
}

.help-topic-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.help-topic-card {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 136px;
  padding: 16px;
  color: var(--color-text);
  text-decoration: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

.help-topic-card:hover,
.help-topic-card:focus-visible {
  border-color: rgba(0, 139, 210, .38);
  box-shadow: 0 12px 30px rgba(0, 95, 144, .10);
}

.help-topic-card strong {
  font-size: 16px;
}

.help-topic-card span {
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.4;
}

.help-topic-sections {
  margin-top: 18px;
  gap: 18px;
}

.help-board-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

.help-board-heading {
  display: grid;
  gap: 6px;
  max-width: 980px;
}

.help-board-heading span {
  color: var(--color-primary-strong);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.help-board-heading h3 {
  margin: 0;
  color: var(--color-text);
  font-size: 22px;
}

.help-board-heading p {
  margin: 0;
  color: var(--color-text-muted);
}

.help-split-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.help-info-panel,
.help-example {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: var(--color-muted-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.help-info-panel h4 {
  margin: 0;
  color: var(--color-text);
  font-size: 15px;
}

.help-info-panel p,
.help-example p {
  margin: 0;
  color: var(--color-text-muted);
}

.help-example {
  background: rgba(0, 139, 210, .06);
  border-color: rgba(0, 139, 210, .18);
}

.help-example strong {
  color: var(--color-text);
}

.help-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.help-section summary {
  min-height: 48px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 800;
  color: var(--color-text);
}

.help-section summary::marker {
  color: var(--color-primary-strong);
}

.help-section-body {
  display: grid;
  gap: 10px;
  padding: 0 16px 16px;
  max-width: 980px;
}

.help-section-body p {
  color: var(--color-text-muted);
}

@media (max-width: 1100px) {
  .lead-quality-context {
    grid-template-columns: 1fr;
  }

  .lead-quality-summary {
    grid-template-columns: 1fr;
  }

  .lead-quality-summary__score {
    text-align: left;
  }

  .lead-data-quality__priority {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .permission-grid-head {
    display: none;
  }

  .permission-row {
    grid-template-columns: 1fr;
  }

  .permission-main {
    grid-template-columns: 1fr;
  }
}

.help-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.help-card {
  padding: 16px;
  display: grid;
  gap: 8px;
}

.version-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.version-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.version-section {
  display: grid;
  gap: 6px;
}

.version-section h4 {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

@media (max-width: 1180px) {
  .dashboard-summary-grid,
  .mini-kpis,
  .help-topic-nav,
  .help-topic-grid,
  .help-split-grid,
  .sales-overview-grid,
  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .employee-card-row--3,
  .employee-card-row--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-offer-traffic-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .dashboard-offer-panel .offer-kpi-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .daily-followup-grid,
  .daily-followup-employees {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(320px, 86vw);
    padding: 18px 14px;
    gap: 18px;
    transform: translateX(-105%);
    transition: transform .18s ease;
    box-shadow: 20px 0 48px rgba(0, 63, 96, .22);
    overflow-y: auto;
  }
  body.mobile-menu-open .sidebar {
    transform: translateX(0);
  }
  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    background: rgba(0, 63, 96, .38);
  }
  .mobile-menu-backdrop[hidden] {
    display: none !important;
  }
  .brand {
    grid-template-columns: 38px 1fr;
  }
  .brand img {
    width: 38px;
    height: 38px;
    border-radius: 9px;
  }
  .brand h1 {
    font-size: 18px;
  }
  .sidebar p {
    font-size: 12px;
    margin-top: 2px;
  }
  nav {
    display: grid;
    gap: 8px;
    overflow: visible;
    padding-bottom: 0;
  }
  .nav {
    min-height: 36px;
    white-space: normal;
    padding: 10px 12px;
  }
  .nav-sub {
    min-height: 32px;
    padding: 8px 10px;
  }
  .nav.active {
    box-shadow: inset 4px 0 0 var(--enrgy-orange);
  }
  .mobile-nav-extra {
    display: flex;
  }
  .topbar {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 0;
    padding: 10px 12px;
    gap: 10px;
    align-items: center;
  }
  .topbar-status {
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
  }
  .topbar-status strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar-status span {
    display: none;
  }
  .mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(0, 139, 210, .10);
    color: var(--enrgy-blue-dark);
    border: 1px solid rgba(0, 139, 210, .20);
  }
  .mobile-top-logo {
    display: block;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--enrgy-white);
  }
  .topbar-actions {
    flex: 0 0 auto;
    min-width: 0;
  }
  .top-link {
    display: none;
  }
  .user-button {
    width: 148px;
    min-height: 44px;
  }
  .user-menu {
    flex: 0 0 auto;
    min-width: 0;
  }
  .user-dropdown {
    left: auto;
    right: 0;
  }
  main {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
  }
  .toolbar, .group-body, .report-row, .settings-grid, .add-user-form,
  .platform-hero,
  .help-topic-nav,
  .help-topic-grid,
  .help-split-grid,
  .sales-overview-grid,
  .tool-grid,
  .dashboard-summary-grid,
  .dashboard-offer-traffic-layout,
  .dashboard-sections,
  .traffic-grid,
  .employee-card-grid,
  .employee-card-row,
  .mini-kpis {
    grid-template-columns: 1fr;
  }
  .platform-hero {
    padding: 18px;
  }
  .platform-hero h3 {
    font-size: 20px;
  }
  .help-board-section {
    padding: 16px;
  }
  .help-topic-card {
    min-height: auto;
  }
  .help-topic-nav a {
    justify-content: flex-start;
    text-align: left;
  }
  .platform-hero img {
    width: 58px;
    height: 58px;
    justify-self: start;
  }
  .tool-card {
    min-height: auto;
    padding: 14px;
  }
  .dashboard-card--kpi,
  .metric-card,
  .traffic-card {
    min-height: 96px;
  }
  .dashboard-offer-panel .mini-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .daily-followup-header {
    display: grid;
  }
  .daily-followup-grid,
  .daily-followup-employees {
    grid-template-columns: 1fr;
  }
  .dashboard-offer-panel .mini-kpis > div {
    min-height: 92px;
    padding: 12px;
  }
  .dashboard-offer-panel .mini-kpis > div:nth-child(3) {
    grid-column: 1 / -1;
  }
  .dashboard-offer-panel .mini-kpis .metric-value {
    font-size: 20px;
  }
  .offer-assignment-notice {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 9px;
    padding: 10px 12px;
  }
  .offer-assignment-notice b {
    grid-column: 2;
    justify-self: start;
  }
  .offer-period-summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .dashboard-quality-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .dashboard-quality-compact-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .dashboard-quality-checks {
    gap: 8px 12px;
  }
  .team-risk-head {
    flex-direction: column;
    align-items: stretch;
  }
  .team-risk-row {
    grid-template-columns: 1fr;
    min-height: 72px;
    gap: 8px;
  }
  .team-risk-row__lead strong,
  .team-risk-row__lead small,
  .team-risk-row__meta small {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .metric-value {
    font-size: 24px;
  }
  .dashboard-row,
  .metric-row {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .dashboard-row .metric-value,
  .metric-row .metric-value {
    grid-column: 2;
    text-align: left;
  }
  .employee-metric-card {
    padding: 14px 16px;
    gap: 8px;
  }
  .employee-metric-card .card-title {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1.2;
    text-transform: uppercase;
  }
  .employee-metric-card .metric-stack {
    gap: 0;
  }
  .employee-metric-card .metric-row,
  .employee-metric-card .employee-activity-row {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 9px;
    min-height: 44px;
    padding: 6px 0;
  }
  .employee-metric-card .employee-next-action {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 44px;
    padding: 8px 0;
    border: 0;
    background: transparent;
  }
  .employee-metric-card .metric-row .metric-icon,
  .employee-metric-card .employee-activity-row .metric-icon,
  .employee-metric-card .employee-next-action .metric-icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
  }
  .employee-metric-card .metric-row .metric-icon svg,
  .employee-metric-card .employee-activity-row .metric-icon svg,
  .employee-metric-card .employee-next-action .metric-icon svg {
    width: 15px;
    height: 15px;
  }
  .employee-metric-card .metric-row .metric-label,
  .employee-metric-card .employee-activity-row span,
  .employee-metric-card .employee-next-action span {
    overflow: hidden;
    color: var(--color-text);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .employee-metric-card .employee-next-action span {
    color: var(--muted);
  }
  .employee-metric-card .metric-row .metric-value,
  .employee-metric-card .employee-activity-row strong,
  .employee-metric-card .employee-next-action strong {
    grid-column: auto;
    color: var(--color-primary-strong);
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
  }
  .employee-metric-card .metric-row .metric-value,
  .employee-metric-card .employee-activity-row strong {
    text-align: right;
  }
  .employee-metric-card .card-divider {
    margin: 6px 0;
  }
  .employee-activity-section {
    gap: 6px;
  }
  .employee-activity-section h5 {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .04em;
    line-height: 1.2;
    text-transform: uppercase;
  }
  .employee-activity-list {
    gap: 0;
  }
  .employee-activity-empty {
    font-size: 13px;
  }
  .activity-timeline-day__head {
    padding: 10px 12px;
  }
  .activity-timeline-day__types {
    padding: 4px 8px 7px;
  }
  .activity-timeline-type-row {
    min-height: 34px;
    gap: 8px;
  }
  .activity-detail-list div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .activity-list { max-height: none; }
  .review-grid { grid-template-columns: 1fr; }
  .modal-head,
  .modal-actions { flex-direction: column; align-items: stretch; }
  header { flex-direction: column; }
}

@media (max-width: 520px) {
  main {
    padding: 12px;
  }
  .topbar-actions {
    display: flex;
    justify-content: flex-end;
  }
  .user-menu {
    width: auto;
  }
  .user-button {
    width: 48px;
    grid-template-columns: 30px;
    padding: 6px 9px;
  }
  .user-summary {
    display: none;
  }
  .user-dropdown {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 62px;
    width: auto;
  }
  header h2 {
    font-size: 20px;
  }
  header p {
    font-size: 14px;
  }
  header > button {
    width: 100%;
  }
  .metric-row .metric-value,
  .dashboard-row .metric-value {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .employee-metric-card .metric-row .metric-value,
  .employee-metric-card .employee-activity-row strong {
    white-space: nowrap;
    overflow-wrap: normal;
  }
  .dashboard-offer-panel .mini-kpis {
    gap: 8px;
  }
  .dashboard-offer-panel .mini-kpis > div {
    min-height: 86px;
    padding: 10px;
  }
  .dashboard-offer-panel .mini-kpis .metric-label {
    font-size: 12px;
  }
  .dashboard-offer-panel .mini-kpis .metric-value {
    font-size: 18px;
  }
  .offer-period-summary {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px 12px;
  }
  .offer-period-summary__count {
    text-align: left;
  }
  .offer-assignment-notice {
    border-radius: 8px;
  }
  .offer-assignment-notice small {
    font-size: 12px;
  }
  .activity-timeline-list {
    gap: 8px;
  }
  .activity-timeline-day__head,
  .activity-timeline-type-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .activity-timeline-day__head strong {
    font-size: 13px;
    text-align: right;
  }
  input,
  select,
  button {
    max-width: 100%;
  }
  .log {
    overflow-x: auto;
  }
  .group-head {
    grid-template-columns: 44px 1fr;
  }
  .group-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
    flex-wrap: wrap;
  }
  .group-actions button {
    flex: 1 1 150px;
  }
  .mini-table {
    display: block;
    overflow-x: auto;
  }
}
