:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --bg-2: #eef4f6;
  --surface: #ffffff;
  --surface-soft: #f3f7f8;
  --surface-strong: #ffffff;
  --ink: #1f2937;
  --muted: #64748b;
  --muted-2: #8a98aa;
  --line: rgba(31, 41, 55, 0.12);
  --line-strong: rgba(31, 41, 55, 0.2);
  --primary: #4f6bff;
  --teal: #64c6b6;
  --coral: #ff8b7a;
  --green: #1f9d65;
  --amber: #b7791f;
  --red: #d9534f;
  --violet: #6d5dfc;
  --blue: #2563eb;
  --shadow: 0 16px 38px rgba(31, 41, 55, 0.1);
  --shadow-soft: 0 8px 22px rgba(31, 41, 55, 0.08);
  --radius: 8px;
  --font: Inter, Poppins, "Segoe UI", Roboto, Arial, sans-serif;
  --sidebar-width: 196px;
  --sidebar-collapsed-width: 72px;
  --detail-rail-width: 320px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111418;
  --bg-2: #181d22;
  --surface: #1d2329;
  --surface-soft: #252d34;
  --surface-strong: #2b343c;
  --ink: #edf2f7;
  --muted: #aebbc8;
  --muted-2: #8795a3;
  --line: rgba(225, 235, 245, 0.14);
  --line-strong: rgba(225, 235, 245, 0.25);
  --primary: #7c91ff;
  --teal: #59c7b4;
  --coral: #ff9484;
  --green: #4fc38a;
  --amber: #e4ad52;
  --red: #ff7f78;
  --violet: #9a8cff;
  --blue: #6fa3ff;
  --shadow: 0 16px 38px rgba(0, 0, 0, 0.3);
  --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.22);
}

:root[data-theme="dark"] body,
:root[data-theme="dark"] .main,
:root[data-theme="dark"] .workspace,
:root[data-theme="dark"] .auth-page {
  background: var(--bg);
  color: var(--ink);
}

:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .detail-rail,
:root[data-theme="dark"] .filter-drawer,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .metric-card,
:root[data-theme="dark"] .dashboard-widget,
:root[data-theme="dark"] .dashboard-board-toolbar,
:root[data-theme="dark"] .analytics-board-toolbar,
:root[data-theme="dark"] .transfer-dashboard-toolbar,
:root[data-theme="dark"] .dashboard-editor,
:root[data-theme="dark"] .admin-user-modal,
:root[data-theme="dark"] .qa-workflow-modal {
  background: var(--surface);
  color: var(--ink);
}

:root[data-theme="dark"] .module-button,
:root[data-theme="dark"] .module-subnav-button,
:root[data-theme="dark"] .sidebar-collapse-button,
:root[data-theme="dark"] .dashboard-widget th,
:root[data-theme="dark"] table th {
  color: var(--ink);
}

:root[data-theme="dark"] .module-button:not(.active):hover,
:root[data-theme="dark"] .module-subnav-button:not(.active):hover {
  background: var(--surface-soft);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] button.control-button,
:root[data-theme="dark"] button.secondary-button {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  color: var(--ink);
}

:root[data-theme="dark"] table thead,
:root[data-theme="dark"] .table-head,
:root[data-theme="dark"] .dashboard-widget-table thead {
  background: #28323a;
  color: #f5f8fb;
}

:root[data-theme="dark"] table tbody tr:hover,
:root[data-theme="dark"] .dashboard-slicer-options label:hover,
:root[data-theme="dark"] .multi-filter-option:hover {
  background: #2a353e;
}

:root[data-theme="dark"] .dashboard-widget-filter-summary.active,
:root[data-theme="dark"] .view-tab.active,
:root[data-theme="dark"] .module-button.active {
  border-color: #758dff;
  background: #293455;
  color: #dce4ff;
}

:root[data-theme="dark"] .dashboard-widget-contract-warning {
  border-color: #8a6f32;
  background: #3a321f;
  color: #f2d995;
}

.theme-toggle {
  width: 34px;
  height: 34px;
  min-width: 34px;
  font-size: 17px;
}

/* D-099: pizarra analitica personal de Leads y Performology. */
.dashboard-board-shell {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.dashboard-board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.dashboard-board-toolbar h2,
.dashboard-editor-head h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.dashboard-board-toolbar p,
.dashboard-editor-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-board-actions,
.dashboard-widget-actions,
.dashboard-editor-buttons {
  display: flex;
  align-items: center;
  gap: 7px;
}

.secondary-button.danger-button {
  border-color: color-mix(in srgb, var(--danger, #c73737) 55%, var(--line));
  color: var(--danger, #c73737);
}

.secondary-button.danger-button:hover,
.secondary-button.danger-button:focus-visible {
  background: color-mix(in srgb, var(--danger, #c73737) 10%, var(--surface));
}

.dashboard-save-status {
  color: var(--muted);
  font-size: 11px;
}

.dashboard-save-status.error,
.dashboard-editor-error {
  color: var(--red);
}

.leads-vendor-refresh-controls {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.leads-vendor-refresh-status {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.leads-vendor-refresh-status.error {
  color: var(--red);
}

.leads-vendor-refresh-controls.compact {
  padding-right: 3px;
  border-right: 1px solid var(--line);
}

.leads-vendor-refresh-controls.compact .leads-vendor-refresh-status {
  max-width: 165px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audit-section-content {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.dashboard-board-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.dashboard-board-empty {
  grid-column: 1 / -1;
  min-height: 220px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
}

.dashboard-board-empty strong {
  color: var(--ink);
  font-size: 18px;
}

.dashboard-widget {
  grid-column: span var(--dashboard-span, 6);
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.dashboard-widget[draggable="true"] {
  cursor: default;
}

.dashboard-widget-compact { min-height: 160px; }
.dashboard-widget-medium { min-height: 290px; }
.dashboard-widget-tall { min-height: 430px; }

.dashboard-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 45px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
}

.dashboard-widget-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.dashboard-widget-title div {
  display: grid;
  min-width: 0;
}

.dashboard-widget-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.dashboard-column-options > label[draggable="true"] {
  cursor: grab;
}

.dashboard-column-options > label[draggable="true"]:active {
  cursor: grabbing;
}

.dashboard-widget-title small {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-widget-filter-summary {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 700;
}

.dashboard-widget-filter-summary.active {
  border-color: #c8d4ff;
  background: #f4f7ff;
  color: #334eaa;
}

.dashboard-drag-handle {
  color: var(--muted);
  cursor: grab;
  font-size: 17px;
  line-height: 1;
}

.dashboard-widget-actions .icon-button {
  width: 27px;
  height: 27px;
  min-width: 27px;
  padding: 0;
}

.dashboard-widget-body {
  flex: 1;
  min-height: 0;
  padding: 9px;
  overflow: auto;
}

.lsp-weekly-kpi-content {
  display: grid;
  gap: 12px;
}

.lsp-weekly-kpi-content .metric-grid {
  min-width: 0;
}

.lsp-weekly-kpi-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lsp-weekly-kpi-toolbar .panel-subtitle {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.lsp-weekly-filter-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 9px;
  border-color: #b7c5e8;
  background: #f6f8ff;
  color: #29469d;
  font-weight: 750;
  white-space: nowrap;
}

.lsp-weekly-filter-trigger:hover,
.lsp-weekly-filter-trigger.is-active {
  border-color: #6f88e8;
  background: #edf1ff;
  box-shadow: 0 0 0 2px rgba(79, 107, 255, 0.1);
}

.lsp-weekly-filter-trigger svg {
  width: 17px;
  height: 17px;
}

.lsp-weekly-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  background: #4f6bff;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
}

.lsp-weekly-filter {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid #cbd5ef;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8faff 0%, var(--surface-soft) 100%);
  box-shadow: 0 8px 24px rgba(24, 39, 75, 0.08);
}

.lsp-weekly-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lsp-weekly-filter-head > div:first-child {
  display: grid;
  gap: 3px;
}

.lsp-weekly-filter-head small {
  color: var(--muted);
  line-height: 1.35;
}

.lsp-weekly-filter-close {
  flex: 0 0 auto;
}

.lsp-weekly-filter-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.lsp-weekly-filter-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.lsp-weekly-filter-actions .is-loading .dashboard-metric-spinner {
  display: inline-block;
  animation: dashboard-metric-spin 0.7s linear infinite;
}

.lsp-weekly-filter-presets {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px;
  border: 1px solid #d5dced;
  border-radius: 9px;
  background: var(--surface);
}

.lsp-weekly-choice-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.lsp-weekly-choice-button:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.lsp-weekly-choice-button.is-selected {
  border-color: #b9c7f5;
  background: #edf2ff;
  color: #29469d;
  box-shadow: 0 1px 2px rgba(41, 70, 157, 0.08);
}

.lsp-weekly-choice-button svg,
.lsp-weekly-apply-icon {
  width: 16px;
  height: 16px;
}

.lsp-weekly-apply-button {
  min-height: 36px;
  padding-inline: 13px;
  border-radius: 8px;
  box-shadow: 0 5px 14px rgba(79, 107, 255, 0.2);
  font-weight: 800;
}

.lsp-weekly-apply-button.is-loading .lsp-weekly-apply-icon {
  display: none;
}

.lsp-weekly-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 1px;
}

.lsp-weekly-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.lsp-weekly-option:hover {
  border-color: #9baee7;
  box-shadow: 0 2px 8px rgba(24, 39, 75, 0.07);
}

.lsp-weekly-option:has(input:checked) {
  border-color: rgba(79, 107, 255, 0.6);
  background: rgba(79, 107, 255, 0.08);
  color: #29469d;
  font-weight: 700;
}

.lsp-weekly-option input {
  margin: 0;
  accent-color: #4f6bff;
}

.lsp-weekly-semantics {
  margin: 0;
}

.lsp-weekly-metric-card {
  position: relative;
  min-height: 126px;
  padding: 13px;
  grid-template-rows: auto minmax(36px, auto) auto;
  gap: 10px;
  overflow: visible;
}

.lsp-kpi-heading {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
}

.lsp-kpi-heading .metric-label {
  color: var(--ink);
  font-weight: 750;
}

.lsp-kpi-icon {
  width: 22px;
  height: 22px;
  color: #29469d;
}

.lsp-weekly-metric-card .metric-value {
  align-self: center;
  font-size: 27px;
}

.lsp-kpi-help-wrap {
  position: relative;
  display: inline-flex;
}

.lsp-kpi-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid #b9c5df;
  border-radius: 50%;
  background: var(--surface);
  color: #49618f;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: help;
}

.lsp-kpi-help:hover,
.lsp-kpi-help:focus-visible {
  border-color: #4f6bff;
  color: #29469d;
  outline: 2px solid rgba(79, 107, 255, 0.16);
  outline-offset: 1px;
}

.lsp-kpi-tooltip {
  position: absolute;
  z-index: 30;
  top: calc(100% + 7px);
  right: -4px;
  width: max-content;
  max-width: min(260px, 70vw);
  padding: 8px 10px;
  border: 1px solid #c8d1e5;
  border-radius: 7px;
  background: #17233b;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.22);
  color: #fff;
  font-size: 11px;
  font-weight: 550;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.lsp-kpi-help-wrap:hover .lsp-kpi-tooltip,
.lsp-kpi-help-wrap:focus-within .lsp-kpi-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.lsp-kpi-comparison {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.lsp-kpi-comparison > span {
  max-width: 92px;
}

.lsp-kpi-comparison-value {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 850;
}

.lsp-kpi-comparison-value.up {
  color: #079447;
}

.lsp-kpi-comparison-value.down {
  color: #c83c3c;
}

.lsp-kpi-comparison-value.neutral {
  color: #667085;
}

.lsp-kpi-comparison-value.unavailable {
  color: var(--muted);
}

:root[data-theme="dark"] .lsp-weekly-filter-trigger {
  border-color: #46577d;
  background: #202b46;
  color: #c8d4ff;
}

:root[data-theme="dark"] .lsp-weekly-filter-trigger:hover,
:root[data-theme="dark"] .lsp-weekly-filter-trigger.is-active,
:root[data-theme="dark"] .lsp-weekly-choice-button.is-selected {
  border-color: #647bd0;
  background: #26365f;
  color: #d9e1ff;
}

:root[data-theme="dark"] .lsp-weekly-filter {
  border-color: #3b4968;
  background: linear-gradient(180deg, #1b2741 0%, var(--surface-soft) 100%);
}

:root[data-theme="dark"] .lsp-weekly-filter-presets {
  border-color: #3b4968;
}

:root[data-theme="dark"] .lsp-weekly-option:has(input:checked) {
  border-color: #647bd0;
  background: #26365f;
  color: #d9e1ff;
}

:root[data-theme="dark"] .lsp-kpi-icon {
  color: #9eb0ff;
}

:root[data-theme="dark"] .lsp-kpi-help {
  border-color: #52617d;
  color: #b6c2dd;
}

@media (max-width: 700px) {
  .lsp-weekly-kpi-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .lsp-weekly-filter-trigger {
    justify-content: center;
  }

  .lsp-weekly-filter-head {
    align-items: stretch;
  }

  .lsp-weekly-filter-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .lsp-weekly-filter-presets {
    display: grid;
    grid-template-columns: 1fr;
  }

  .lsp-weekly-choice-button,
  .lsp-weekly-apply-button {
    justify-content: center;
    width: 100%;
  }
}

.dashboard-widget-contract-warning {
  margin-bottom: 9px;
  padding: 7px 9px;
  border: 1px solid #e7c982;
  border-radius: 6px;
  background: #fff8df;
  color: #705314;
  font-size: 11px;
  line-height: 1.4;
}

.dashboard-widget-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
}

.dashboard-widget-kpi {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(32px, auto) auto;
  align-content: stretch;
  gap: 7px;
  min-height: 116px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 7px 18px rgba(15, 23, 42, 0.06);
  overflow: visible;
}

.dashboard-kpi-heading {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.dashboard-kpi-icon {
  width: 21px;
  height: 21px;
  color: #29469d;
}

.dashboard-kpi-label {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-kpi-value {
  align-self: center;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: 0;
}

.dashboard-kpi-status {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.dashboard-widget-kpi.is-unavailable .dashboard-kpi-value,
.dashboard-widget-kpi.is-unavailable .dashboard-kpi-status {
  color: var(--muted);
}

.dashboard-column-heading {
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  width: 100%;
}

.dashboard-column-help {
  width: 17px;
  height: 17px;
  font-size: 10px;
  flex: 0 0 auto;
}

.dashboard-kpi-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid #b9c5df;
  border-radius: 50%;
  background: var(--surface);
  color: #49618f;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.dashboard-kpi-help:hover,
.dashboard-kpi-help:focus-visible {
  border-color: #4f6bff;
  color: #29469d;
  outline: 2px solid rgba(79, 107, 255, 0.16);
  outline-offset: 1px;
}

.dashboard-column-detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(2px);
}

.dashboard-column-detail-dialog {
  width: min(440px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.28);
  color: var(--ink);
}

.dashboard-column-detail-dialog > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.dashboard-column-detail-dialog small,
.dashboard-column-detail-source > span,
.dashboard-column-detail-description > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.dashboard-column-detail-dialog h3 {
  margin: 4px 0 0;
  font-size: 18px;
}

.dashboard-column-detail-source,
.dashboard-column-detail-description {
  margin: 14px 20px 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.dashboard-column-detail-source strong {
  display: block;
  margin-top: 5px;
}

.dashboard-column-detail-description p {
  margin: 5px 0 0;
  color: var(--ink);
  line-height: 1.5;
}

.dashboard-column-detail-dialog > footer {
  display: flex;
  justify-content: flex-end;
  padding: 16px 20px 20px;
}

.dashboard-column-detail-edit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

:root[data-theme="dark"] .dashboard-kpi-icon {
  color: #9eb0ff;
}

:root[data-theme="dark"] .dashboard-kpi-help {
  border-color: #52617d;
  color: #b6c2dd;
}

.dashboard-widget-table-wrap {
  max-height: none;
}

.dashboard-widget-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.dashboard-widget-table th,
.dashboard-widget-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: top;
}

.dashboard-widget-table th {
  min-width: 122px;
}

.dashboard-widget-table th:first-child,
.dashboard-widget-table td:first-child {
  min-width: 180px;
  text-align: left;
}

.dashboard-widget-table tfoot td {
  background: var(--surface-soft);
  font-weight: 700;
}

.dashboard-transfer-detail-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #17356d;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.dashboard-transfer-detail-link:hover,
.dashboard-transfer-detail-link:focus-visible {
  color: var(--primary);
  text-decoration: underline;
  outline: 0;
}

.dashboard-hierarchy-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-hierarchy-tools > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-hierarchy-tools > div {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
}

.dashboard-hierarchy-table td:first-child {
  padding-left: calc(8px + (var(--dashboard-depth, 0) * 20px));
}

.dashboard-hierarchy-row:nth-child(even) td {
  background: #fbfcfd;
}

.dashboard-hierarchy-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.dashboard-hierarchy-toggle > span {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-hierarchy-toggle > b,
.dashboard-hierarchy-leaf {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-hierarchy-row[style*="--dashboard-depth:0"] td {
  font-weight: 750;
}

.dashboard-matrix-wrap {
  overflow: auto;
}

.dashboard-matrix-table {
  width: max-content;
  min-width: 100%;
}

.dashboard-matrix-table th,
.dashboard-matrix-table td {
  min-width: 82px;
  white-space: nowrap;
}

.dashboard-matrix-table .dashboard-matrix-month-cell {
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  padding-inline: 6px;
  text-align: center;
}

.dashboard-matrix-table .dashboard-matrix-day-cell {
  width: 58px;
  min-width: 58px;
  max-width: 64px;
  padding-inline: 5px;
  text-align: center;
}

.dashboard-matrix-table .dashboard-matrix-total-cell {
  width: 86px;
  min-width: 86px;
  max-width: 104px;
  text-align: center;
}

.dashboard-matrix-table th:first-child,
.dashboard-matrix-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 220px;
  max-width: 320px;
  background: var(--surface);
}

.dashboard-matrix-table thead th:first-child {
  z-index: 4;
  background: var(--surface-soft);
}

.dashboard-matrix-table tfoot td:first-child {
  background: var(--surface-soft);
}

.dashboard-matrix-year {
  text-align: center !important;
  background: var(--surface-soft);
}

.dashboard-matrix-year button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 750;
}

.dashboard-matrix-year button span {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--primary);
}

.dashboard-matrix-month-group {
  text-align: center !important;
  background: var(--surface-soft);
}

.dashboard-matrix-month-group button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 44px;
  padding: 2px 4px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 750;
}

.dashboard-matrix-month-group button span {
  color: var(--primary);
}

.dashboard-matrix-table thead tr:nth-child(2) th {
  text-align: center;
}

.dashboard-matrix-table thead .dashboard-matrix-month-cell > span,
.dashboard-matrix-table thead .dashboard-matrix-day-cell > span {
  display: block;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}

.dashboard-matrix-table thead small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.1;
  text-overflow: ellipsis;
}

.dashboard-dimension-cell {
  overflow-wrap: anywhere;
  white-space: normal;
}

.dashboard-widget-bars {
  display: grid;
  gap: 8px;
}

.dashboard-widget-bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(90px, 2fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.dashboard-widget-bar-label {
  overflow-wrap: anywhere;
}

.dashboard-widget-bar-track {
  height: 8px;
  overflow: hidden;
  background: var(--surface-soft);
}

.dashboard-widget-bar-track i {
  display: block;
  height: 100%;
  background: var(--primary);
}

.dashboard-editor-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 27, 44, 0.48);
}

.dashboard-editor {
  width: min(860px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.28);
}

.dashboard-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.dashboard-editor-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.dashboard-editor-wide {
  grid-column: 1 / -1;
}

.dashboard-metric-picker {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
}

.dashboard-metric-picker legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-metric-picker > p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-column-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.dashboard-column-options label {
  display: grid;
  grid-template-columns: auto 54px minmax(120px, 1fr) minmax(140px, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 5px 7px;
  background: var(--surface-soft);
  font-size: 11px;
}

.dashboard-choice-group,
.dashboard-hierarchy-picker,
.dashboard-filter-picker {
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
}

.dashboard-choice-group legend,
.dashboard-hierarchy-picker legend,
.dashboard-filter-picker legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.dashboard-hierarchy-picker > p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-hierarchy-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.dashboard-hierarchy-options label {
  display: grid;
  grid-template-columns: auto auto 54px minmax(120px, 1fr) minmax(140px, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 48px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.dashboard-hierarchy-options label[draggable="true"] {
  cursor: grab;
}

.dashboard-hierarchy-options label[draggable="true"]:active {
  cursor: grabbing;
}

.dashboard-hierarchy-options .dashboard-hierarchy-drag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
}

.dashboard-hierarchy-options label:has(input:checked) {
  border-color: var(--primary);
  background: #f4f7ff;
}

.dashboard-hierarchy-options label > span {
  display: grid;
  min-width: 0;
}

.dashboard-column-options select,
.dashboard-hierarchy-options select,
.dashboard-column-options input[type="text"],
.dashboard-hierarchy-options input[type="text"] {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.dashboard-hierarchy-options b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.dashboard-hierarchy-options small {
  color: var(--muted);
  font-size: 9px;
}

@media (max-width: 900px) {
  .dashboard-column-options,
  .dashboard-hierarchy-options {
    grid-template-columns: 1fr;
  }
}

.dashboard-hierarchy-order {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e8edff;
  color: #334eaa;
  font-size: 10px;
  font-weight: 800;
}

.dashboard-choice-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 7px;
}

.dashboard-choice-card {
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
}

.dashboard-choice-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.dashboard-choice-card > span {
  display: grid;
  align-content: center;
  min-height: 48px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.dashboard-choice-card b {
  font-size: 12px;
}

.dashboard-choice-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-choice-card input:checked + span {
  border-color: var(--primary);
  background: #f4f7ff;
  box-shadow: inset 3px 0 0 var(--primary);
}

.dashboard-choice-card input:focus-visible + span {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.dashboard-choice-card.is-disabled {
  cursor: not-allowed;
}

.dashboard-choice-card.is-disabled > span {
  opacity: 0.58;
}

.dashboard-weekly-catalog-summary {
  margin: 0;
}

.dashboard-filter-picker > p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-filter-list {
  display: grid;
  gap: 7px;
}

.dashboard-filter-slicer {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.dashboard-filter-slicer > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 7px 10px;
  cursor: pointer;
  list-style: none;
}

.dashboard-filter-slicer > summary::-webkit-details-marker {
  display: none;
}

.dashboard-filter-slicer > summary::before {
  content: "+";
  width: 18px;
  color: var(--primary);
  font-weight: 800;
}

.dashboard-filter-slicer[open] > summary::before {
  content: "-";
}

.dashboard-filter-slicer > summary span {
  flex: 1;
  font-weight: 700;
}

.dashboard-filter-slicer > summary b {
  color: var(--primary);
  font-size: 10px;
}

.dashboard-slicer-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
}

.dashboard-slicer-tools label {
  display: grid;
  flex: 1;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-slicer-tools input {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.dashboard-slicer-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  max-height: 180px;
  padding: 0 10px 10px;
  overflow: auto;
}

.dashboard-slicer-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 30px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
  font-size: 11px;
}

.dashboard-slicer-options label:has(input:checked) {
  border-color: #c8d4ff;
  background: #f4f7ff;
}

.dashboard-slicer-options label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-editor-buttons {
  justify-content: flex-end;
}

@media (max-width: 1100px) {
  .dashboard-widget {
    grid-column: span 12 !important;
  }
}

@media (max-width: 700px) {
  .dashboard-board-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-board-actions {
    flex-wrap: wrap;
  }

  .dashboard-editor-form,
  .dashboard-metric-picker,
  .dashboard-hierarchy-options,
  .dashboard-slicer-options {
    grid-template-columns: 1fr;
  }

  .dashboard-editor-form > * {
    grid-column: 1 / -1;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f6f7f9 0%, #edf3f5 100%);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

img,
svg {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100dvh;
  overflow-y: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  z-index: 18;
  background: #ffffff;
  border-right: 1px solid var(--line);
  color: var(--ink);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brand {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 6px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand-text {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.brand-text strong,
.brand-text span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-text strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.1;
}

.brand-text span {
  color: var(--muted);
  font-size: 12px;
}

.module-nav {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.module-nav-group {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.module-button {
  width: 100%;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #334155;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon badge";
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  text-align: left;
}

.module-button.has-submenu {
  grid-template-columns: 28px minmax(0, 1fr) 14px;
  grid-template-areas:
    "icon label toggle"
    "icon badge toggle";
}

.module-expand-indicator {
  grid-area: toggle;
  width: 8px;
  height: 8px;
  justify-self: center;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.module-nav-group.expanded > .module-button > .module-expand-indicator,
.module-subnav-group.expanded > .module-subnav-button > .module-expand-indicator {
  transform: rotate(225deg) translate(-1px, -1px);
}

.module-subnav {
  position: relative;
  display: grid;
  gap: 2px;
  margin-left: 18px;
  padding-left: 14px;
}

.module-subnav[hidden] {
  display: none;
}

.module-subnav::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 1px;
  background: #d7dfeb;
}

.module-subnav-button {
  min-width: 0;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #526278;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  text-align: left;
  font-size: 11px;
  line-height: 1.15;
}

.module-subnav-button.has-submenu {
  grid-template-columns: 24px minmax(0, 1fr) 10px;
  grid-template-areas: "icon label toggle";
}

.module-subnav-button > .module-subnav-icon {
  grid-area: icon;
}

.module-subnav-label {
  grid-area: label;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.module-subnav-button:hover {
  background: #f4f7fb;
  color: #233557;
}

.module-subnav-button.active {
  border-color: rgba(79, 107, 255, 0.22);
  background: rgba(79, 107, 255, 0.1);
  color: #304fe5;
}

.module-subnav-icon {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #aebbd0;
  justify-self: center;
}

.module-subnav-button.active .module-subnav-icon {
  background: #4f6bff;
}

.module-subnav-group {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.module-subnav-nested {
  margin-left: 10px;
  padding-left: 10px;
}

.module-subnav-button-nested {
  grid-template-columns: 10px minmax(0, 1fr);
  padding-left: 3px;
}

.module-subnav-button-nested .module-subnav-label {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.module-subnav-leaf {
  width: 6px;
  height: 6px;
  border-left: 1px solid #aebbd0;
  border-bottom: 1px solid #aebbd0;
}

.module-button:hover:not(.active) {
  background: #f4f7fb;
  border-color: var(--line);
}

.module-button.active {
  background: #eef4ff;
  border-color: rgba(79, 107, 255, 0.36);
  color: #1f2d5c;
  box-shadow: inset 3px 0 0 var(--primary);
}

.module-button b {
  grid-area: badge;
  justify-self: start;
  min-width: 0;
  border-radius: 999px;
  padding: 4px 7px;
  background: #eef2f7;
  color: #516174;
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
}

.module-button > span:not(.module-icon):not(.module-expand-indicator) {
  grid-area: label;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.18;
}

.module-button.active b {
  background: rgba(79, 107, 255, 0.12);
  color: var(--primary);
}

.module-icon {
  grid-area: icon;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid currentColor;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 14px 8px 2px;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.sidebar-footer strong {
  color: var(--ink);
}

.main {
  min-width: 0;
  grid-column: 2;
  grid-row: 1;
  border-right: 1px solid var(--line);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 64px;
  background: rgba(246, 247, 249, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 10px 16px;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.15;
}

.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.topbar > div:first-child,
.panel-head > div,
.section-title,
.rail-row,
.metric-card,
.mini-card,
.lane-card,
.timeline-card {
  min-width: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.notification-center {
  position: relative;
  display: inline-flex;
  z-index: 80;
}

.notification-toggle {
  position: relative;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.notification-toggle:hover,
.notification-toggle[aria-expanded="true"] {
  border-color: var(--primary);
  background: #f4f7ff;
}

.notification-bell {
  width: 17px;
  height: 17px;
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
  border-radius: 9px;
  background: #d63b3b;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.notification-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(390px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 90px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 18px 45px rgba(21, 35, 60, 0.2);
}

.notification-popover > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.notification-popover > header div {
  display: grid;
  gap: 2px;
}

.notification-popover > header span,
.notification-item small,
.notification-item time {
  color: var(--muted);
  font-size: 11px;
}

.notification-list {
  max-height: 440px;
  overflow-y: auto;
}

.notification-item {
  width: 100%;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.notification-item:hover,
.notification-item.unread {
  background: #f5f8ff;
}

.notification-item > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.notification-item small {
  white-space: normal;
  line-height: 1.35;
}

.notification-status-dot {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: transparent;
}

.notification-item.unread .notification-status-dot {
  background: var(--primary);
}

.notification-empty {
  padding: 24px 14px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.source-info-toggle > span {
  width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.source-info-popover {
  position: fixed;
  top: 64px;
  right: 16px;
  left: auto;
  width: min(900px, calc(100vw - 88px));
  max-height: calc(100vh - 80px);
}

.source-info-list {
  max-height: min(620px, calc(100vh - 160px));
  overflow-y: auto;
  padding: 12px;
}

.source-info-evidence {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--primary) 4%, var(--surface));
}

.source-info-evidence {
  margin-top: 10px;
  gap: 7px;
}

.source-info-evidence > span {
  display: grid;
  grid-template-columns: minmax(110px, 0.65fr) minmax(0, 1fr);
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.source-info-evidence b {
  color: var(--ink);
  font-weight: 600;
}

.source-info-guardrail {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line));
  border-radius: 5px;
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.source-info-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.source-info-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--ink);
  font-size: 11px;
}

.source-info-table thead {
  background: color-mix(in srgb, var(--surface-soft) 78%, var(--surface));
}

.source-info-table th,
.source-info-table td {
  padding: 10px 11px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.source-info-table th:last-child,
.source-info-table td:last-child {
  border-right: 0;
}

.source-info-table tbody tr:last-child > * {
  border-bottom: 0;
}

.source-info-table thead th:nth-child(1) {
  width: 29%;
}

.source-info-table thead th:nth-child(2) {
  width: 21%;
}

.source-info-table thead th:nth-child(3),
.source-info-table thead th:nth-child(4) {
  width: 25%;
}

.source-info-table tbody th[scope="rowgroup"] {
  background: color-mix(in srgb, var(--surface-soft) 55%, var(--surface));
  font-weight: 700;
  line-height: 1.35;
}

.source-info-table td {
  line-height: 1.35;
}

.source-info-table td > strong,
.source-info-table td > time,
.source-info-table td > span:not(.source-info-mobile-information) {
  display: block;
  font-weight: 700;
}

.source-info-table td > code,
.source-info-table td > small,
.source-info-mode + small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.source-info-table td > code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
}

.source-info-mode {
  width: fit-content;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  overflow-wrap: anywhere;
}

.source-info-mode.is-realtime {
  border-color: #b7e3cf;
  background: #eaf8f1;
  color: #08734d;
}

.source-info-mode.is-manual {
  border-color: #d5dce7;
  background: #f5f7fa;
  color: #526074;
}

.source-info-mode.is-inactive {
  border-color: #ecd19f;
  background: #fff6e5;
  color: #8a5b00;
}

.source-info-mode.is-date {
  border-color: #cbd7ff;
  background: #f3f6ff;
  color: #3153bd;
}

.source-info-mode.is-unavailable {
  color: var(--muted);
}

.source-info-mobile-information {
  display: none;
}

.source-info-loading,
.source-info-empty {
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.source-info-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid color-mix(in srgb, var(--primary) 22%, var(--line));
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: source-info-spin 800ms linear infinite;
}

@keyframes source-info-spin {
  to {
    transform: rotate(360deg);
  }
}

.source-info-error {
  margin-top: 10px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #f0b5b5;
  border-radius: 6px;
  background: #fff1f1;
  color: #9b2c2c;
  font-size: 11px;
}

.source-info-contract-notice {
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 720px) {
  .source-info-popover {
    position: fixed;
    top: 64px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 78px);
  }

  .source-info-list {
    max-height: calc(100vh - 150px);
  }

  .source-info-table-wrap {
    overflow: visible;
    border: 0;
  }

  .source-info-table,
  .source-info-table tbody,
  .source-info-table tr,
  .source-info-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .source-info-table thead,
  .source-info-table tbody th[scope="rowgroup"] {
    display: none;
  }

  .source-info-table tr {
    margin-bottom: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
  }

  .source-info-table td {
    display: grid;
    grid-template-columns: minmax(105px, 0.42fr) minmax(0, 1fr);
    gap: 3px 10px;
    padding: 9px 10px;
    border-right: 0;
  }

  .source-info-table td::before {
    content: attr(data-label);
    grid-row: 1 / span 3;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    line-height: 1.3;
  }

  .source-info-mobile-information {
    display: block;
    grid-column: 1 / -1;
    margin: -9px -10px 7px;
    padding: 8px 10px;
    background: color-mix(in srgb, var(--surface-soft) 65%, var(--surface));
    color: var(--ink);
    font-size: 11px;
    font-weight: 700;
  }

  .source-info-table td:first-of-type::before {
    grid-row: 2 / span 3;
  }

  .source-info-error {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .source-info-spinner {
    animation-duration: 1600ms;
  }
}

.auth-slot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.auth-user {
  max-width: 190px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-button,
.primary-button {
  min-height: 34px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 6px;
  padding: 0 10px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.control-button:hover {
  border-color: var(--line-strong);
  background: #f8fbfc;
}

.control-button.compact {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.primary-button {
  background: linear-gradient(90deg, var(--primary), var(--teal));
  border-color: rgba(79, 107, 255, 0.58);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(79, 107, 255, 0.2);
}

.primary-button:disabled {
  opacity: 0.68;
  cursor: wait;
}

.workspace {
  padding: 12px 16px 22px;
  display: grid;
  gap: 12px;
}

.view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.view-tab {
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  padding: 0 12px;
}

.view-tab.active {
  background: #eef4ff;
  border-color: rgba(79, 107, 255, 0.34);
  color: var(--primary);
  font-weight: 800;
}

.filter-panel,
.control-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(132px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

.filter-panel label,
.control-panel label {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.filter-panel span,
.control-panel span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.filter-panel input,
.filter-panel select,
.control-panel input,
.control-panel select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 10px;
}

.filter-panel input:focus,
.filter-panel select:focus,
.control-panel input:focus,
.control-panel select:focus {
  outline: 2px solid rgba(79, 107, 255, 0.22);
  border-color: rgba(79, 107, 255, 0.55);
}

.transfer-date-filter-panel {
  grid-template-columns: repeat(2, minmax(180px, 1fr)) auto auto;
}

.transfer-date-filter-panel .rail-warning {
  grid-column: 1 / -1;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(132px, 1fr));
  gap: 10px;
}

.metric-card,
.panel,
.lane-card,
.timeline-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.metric-card {
  min-height: 96px;
  padding: 10px;
  display: grid;
  grid-template-rows: auto minmax(30px, auto) auto;
  align-content: start;
  gap: 8px;
}

.metric-filter-card {
  width: 100%;
  border: 1px solid var(--line);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.transfer-filter-metrics .metric-filter-card {
  min-height: 86px;
  grid-template-rows: auto minmax(30px, auto);
}

.metric-filter-card:hover,
.metric-filter-card.active {
  border-color: rgba(79, 107, 255, 0.7);
  background: #eef4ff;
  box-shadow: 0 0 0 2px rgba(79, 107, 255, 0.12);
}

.metric-label {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.metric-value {
  min-width: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.05;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.metric-foot {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.metric-foot span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  max-width: 100%;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge.ok {
  color: #146c45;
  background: #e8f7ef;
  border-color: #bfe7d0;
}

.badge.warn {
  color: #895400;
  background: #fff4dc;
  border-color: #f2d493;
}

.badge.info {
  color: #314bdc;
  background: #eef4ff;
  border-color: #cbd6ff;
}

.badge.bad {
  color: #a73532;
  background: #fdecec;
  border-color: #f4c3c0;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 12px;
}

.panel {
  overflow: hidden;
}

.panel-head {
  min-height: 42px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.panel-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.panel-title {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.panel-subtitle {
  min-width: 0;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.panel-body {
  min-width: 0;
  padding: 12px;
  overflow-x: auto;
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(92px, 148px) minmax(90px, 1fr) minmax(42px, auto);
  align-items: center;
  gap: 10px;
  min-height: 28px;
  color: var(--muted);
  font-size: 12px;
}

.bar-row span,
.bar-row b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row b {
  color: var(--ink);
  text-align: right;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e8edf2;
  overflow: hidden;
}

.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.tone-green i { background: linear-gradient(90deg, #1f9d65, #64c6b6); }
.tone-blue i { background: linear-gradient(90deg, #4f6bff, #64c6b6); }
.tone-teal i { background: linear-gradient(90deg, #38b2ac, var(--teal)); }
.tone-amber i { background: linear-gradient(90deg, #d8872f, #ffbf5f); }
.tone-violet i { background: linear-gradient(90deg, #6d5dfc, #9b8cff); }

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

th,
td {
  min-width: 0;
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  color: #42526a;
  background: var(--surface-soft);
  font-weight: 850;
  font-size: 11px;
  text-transform: uppercase;
}

td {
  color: #293548;
}

tr:last-child td {
  border-bottom: 0;
}

.transfer-matrix-panel {
  margin-bottom: 16px;
}

.transfer-matrix-help {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.transfer-matrix-help b {
  color: #263244;
}

.transfer-matrix-scroll {
  overflow-x: auto;
}

.transfer-table-filters {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
}

.transfer-table-filters label {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.transfer-table-filters label span {
  color: var(--muted);
  font-size: 12px;
}

.transfer-table-filters select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 10px;
}

.transfer-powerbi-matrix {
  min-width: 1420px;
  table-layout: fixed;
}

.transfer-powerbi-matrix th,
.transfer-powerbi-matrix td {
  text-align: right;
}

.transfer-powerbi-matrix th:first-child,
.transfer-powerbi-matrix td:first-child {
  width: 220px;
  text-align: left;
}

.transfer-powerbi-matrix .campaign-row td {
  background: #ffffff;
  color: #17356d;
  font-weight: 900;
}

.transfer-powerbi-matrix .agent-row td {
  background: #f7f8fa;
}

.transfer-powerbi-matrix .agent-row:nth-child(odd) td {
  background: #eef1f5;
}

.transfer-powerbi-matrix tfoot td {
  position: sticky;
  bottom: 0;
  background: #eaf0f7;
  color: #18263a;
  font-weight: 900;
  border-top: 2px solid var(--line-strong);
}

.table-sort-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-transform: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  cursor: pointer;
  text-align: right;
}

.transfer-powerbi-matrix th:first-child .table-sort-button {
  justify-content: flex-start;
  text-align: left;
}

.table-sort-button:hover,
.table-sort-button.active {
  color: var(--primary);
}

.matrix-name-cell {
  text-align: left;
}

.matrix-link {
  max-width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: inherit;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matrix-link:hover,
.matrix-link:focus {
  color: var(--primary);
  text-decoration: underline;
  outline: 0;
}

.matrix-link.numeric {
  justify-self: end;
  color: #17356d;
  font-weight: 850;
}

.matrix-link.numeric.ok {
  color: #13754c;
}

.matrix-link.numeric.warn {
  color: #9b5a00;
}

.matrix-link.rate {
  color: #24436d;
}

.matrix-agent {
  padding-left: 22px;
  color: #4a5568;
  font-weight: 650;
}

.panel-footnote {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.qa-summary-table th:first-child,
.qa-summary-table td:first-child {
  width: 27%;
}

.qa-bucket-cell {
  min-width: 0;
  display: grid;
  gap: 3px;
  white-space: normal;
}

.qa-bucket-cell strong,
.qa-bucket-cell small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.qa-bucket-cell strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
}

.qa-bucket-cell small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.qa-summary-note {
  margin-top: 10px;
}

.label-filter-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
  display: grid;
  gap: 10px;
}

.label-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.label-filter-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: #31415b;
  min-height: 34px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
}

.label-filter-button strong {
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  min-width: 22px;
  padding: 2px 6px;
  text-align: center;
}

.label-filter-button:hover,
.label-filter-button.active {
  border-color: var(--primary);
  background: #eef4ff;
  color: var(--primary);
}

.label-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.label-filter-row .label-filter-button b {
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  min-width: 22px;
  padding: 2px 6px;
  text-align: center;
}

.lsp-workbench-metrics {
  grid-template-columns: repeat(4, minmax(132px, 1fr));
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.lsp-workbench-table {
  min-width: 1040px;
}

.lsp-workbench-table td {
  white-space: normal;
  line-height: 1.3;
}

.lsp-workbench-table td small {
  color: var(--muted);
}

.lsp-workbench-table .selected-row td {
  background: #eef4ff;
}

.label-filter-help {
  border-top: 1px solid var(--line);
  padding-top: 9px;
  display: grid;
  grid-template-columns: minmax(130px, auto) minmax(0, 1fr);
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.label-filter-help b {
  color: var(--ink);
}

.label-guide-panel {
  margin-top: 12px;
}

.workbench-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.88fr) minmax(480px, 1.12fr);
  gap: 12px;
  align-items: start;
}

.workbench-queue-panel .panel-body,
.workbench-evidence-panel .panel-body {
  overflow-x: visible;
}

.workbench-evidence-panel {
  position: sticky;
  top: 88px;
}

.workbench-evidence-panel .panel-body {
  max-height: calc(100vh - 124px);
  overflow-y: auto;
}

.candidate-queue {
  display: grid;
  border-bottom: 1px solid var(--line);
}

.candidate-row {
  width: 100%;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(88px, auto);
  gap: 7px 12px;
  padding: 12px 10px;
  text-align: left;
}

.candidate-row:last-child {
  border-bottom: 0;
}

.candidate-row:hover,
.candidate-row.active {
  background: #f8fbff;
}

.candidate-row.active {
  box-shadow: inset 3px 0 0 var(--primary);
}

.candidate-row-main,
.candidate-row-signal,
.candidate-row-detail,
.candidate-tags {
  min-width: 0;
}

.candidate-row-main {
  display: grid;
  gap: 4px;
}

.candidate-row-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.candidate-row-title strong,
.candidate-row-meta,
.candidate-row-detail span,
.candidate-row-signal span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-row-title strong {
  color: var(--ink);
  font-size: 13px;
}

.candidate-row-meta,
.candidate-row-detail,
.candidate-row-signal span {
  color: var(--muted);
  font-size: 12px;
}

.candidate-row-signal {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 3px;
}

.candidate-row-signal b {
  color: var(--ink);
  font-size: 14px;
}

.candidate-row-detail {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.candidate-tags {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.candidate-tags .badge {
  font-size: 10px;
  padding: 3px 7px;
}

.candidate-row-more {
  grid-column: 1 / -1;
  justify-self: end;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.candidate-pagination {
  min-height: 62px;
  padding: 10px 0 0;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
}

.table-pagination {
  min-height: 52px;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
}

.page-size-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.page-size-control select {
  width: 72px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 8px;
}

.pagination-pages {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.page-button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.page-button:disabled {
  color: #a9b5c4;
  background: #f4f7fb;
}

.page-ellipsis,
.pagination-range {
  color: var(--muted);
  font-size: 12px;
}

.workbench-mobile-detail-panel {
  display: none;
  margin-top: 12px;
}

.module-focus-panel {
  margin-bottom: 14px;
}

.workbench-detail {
  display: grid;
}

.protected-detail-summary {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid #4f6ef7;
  background: #f7f9fc;
  color: var(--muted);
  font-size: 12px;
}

.protected-detail-summary strong {
  color: var(--ink);
  font-size: 12px;
}

.protected-detail-summary.ready {
  border-left-color: #229a69;
  background: #f2fbf6;
}

.protected-detail-summary.loading {
  border-left-color: #dc8a22;
  background: #fff9ef;
}

.protected-detail-summary.error {
  border-left-color: #d94a4a;
  background: #fff5f5;
}

.workbench-detail-hero {
  margin: -14px -14px 0;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}

.workbench-detail-hero span,
.workbench-detail-hero strong,
.workbench-detail-hero p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.workbench-detail-hero span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workbench-detail-hero strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 18px;
}

.workbench-detail-hero p {
  margin: 8px 0 0;
  color: #344255;
  font-size: 12px;
  line-height: 1.45;
}

.workbench-detail-status {
  min-width: 0;
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 8px;
}

.workbench-detail-status .candidate-tags {
  justify-content: flex-end;
}

.evidence-section {
  min-width: 0;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.workbench-detail-hero + .evidence-section {
  margin-top: 0;
  border-top: 0;
}

.evidence-head {
  min-width: 0;
  margin-bottom: 11px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.8fr);
  gap: 12px;
  align-items: end;
}

.evidence-head strong,
.evidence-head span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.evidence-head strong {
  color: var(--ink);
  font-size: 13px;
}

.evidence-head span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  line-height: 1.35;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.evidence-item {
  min-width: 0;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.08);
  display: grid;
  gap: 3px;
}

.evidence-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.evidence-item b,
.evidence-item small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.evidence-item b {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.evidence-item small {
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.35;
}

.audit-timeline {
  display: grid;
  gap: 0;
}

.audit-timeline-item {
  min-width: 0;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(116px, 148px) minmax(0, 1fr);
  gap: 12px;
}

.audit-timeline-item:last-child {
  border-bottom: 0;
}

.audit-timeline-time,
.audit-timeline-body {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 4px;
}

.audit-timeline-time strong,
.audit-timeline-time span,
.audit-timeline-title b,
.audit-timeline-body p,
.audit-timeline-body small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.audit-timeline-time strong {
  color: var(--ink);
  font-size: 12px;
}

.audit-timeline-time span,
.audit-timeline-body small {
  color: var(--muted);
  font-size: 11px;
}

.audit-timeline-title {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.audit-timeline-title b {
  color: var(--ink);
  font-size: 12px;
}

.audit-timeline-title span {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.audit-timeline-body p {
  margin: 0;
  color: #344255;
  font-size: 12px;
  line-height: 1.35;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-top: 4px;
}

.section-title h2 {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.section-title span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  overflow-wrap: anywhere;
}

.lane-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}

.lane-card {
  min-height: 154px;
  padding: 13px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.lane-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.lane-card h3 {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.lane-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.checklist {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  color: #344255;
  font-size: 12px;
  line-height: 1.35;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 4px;
  background: var(--line-strong);
}

.dot.ok { background: var(--green); }
.dot.warn { background: var(--amber); }
.dot.info { background: var(--primary); }
.dot.bad { background: var(--red); }

.timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
}

.timeline-card {
  min-height: 132px;
  padding: 12px;
  display: grid;
  gap: 9px;
  align-content: start;
}

.timeline-card small {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 11px;
}

.timeline-card b,
.timeline-card span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.timeline-card b {
  color: var(--ink);
  font-size: 13px;
}

.timeline-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.detail-rail {
  min-width: 0;
  grid-column: 3;
  grid-row: 1;
  background: #ffffff;
  display: none;
  align-content: start;
}

.performology-workbench-table {
  min-width: 1120px;
}

.audit-workbench-table {
  min-width: 1080px;
}

.audit-filter-panel {
  grid-template-columns: repeat(6, minmax(112px, 1fr)) auto;
  gap: 8px;
  padding: 9px 10px;
}

.audit-filter-panel label {
  gap: 3px;
}

.audit-filter-panel span {
  font-size: 11px;
}

.audit-filter-panel input,
.audit-filter-panel select {
  min-height: 32px;
  padding-inline: 8px;
  font-size: 12px;
}

.audit-filter-panel .control-button {
  min-height: 32px;
}

.audit-label-filter-row {
  gap: 6px;
  margin-bottom: 10px;
}

.audit-label-filter-row .label-filter-button {
  min-height: 30px;
  padding: 4px 8px;
  gap: 6px;
  font-size: 11px;
}

.audit-label-filter-row .label-filter-button b {
  min-width: 20px;
  padding: 1px 5px;
  font-size: 11px;
}

.audit-metrics {
  grid-template-columns: repeat(5, minmax(128px, 1fr));
  gap: 8px;
}

.audit-metric-card {
  min-height: 82px;
  padding: 8px 10px;
  grid-template-rows: auto minmax(24px, auto) auto;
  gap: 4px;
}

.audit-metric-card .metric-label,
.audit-metric-card .metric-foot {
  font-size: 11px;
}

.audit-metric-card .metric-value {
  font-size: 20px;
}

.audit-metric-card .badge {
  min-height: 19px;
  padding: 2px 6px;
  font-size: 10px;
}

.audit-workbench-table th,
.audit-workbench-table td {
  vertical-align: top;
  line-height: 1.3;
}

.audit-workbench-table td strong {
  color: var(--ink);
  font-size: 12px;
}

.icon-button.audit-help-button {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-weight: 850;
}

.icon-button.audit-help-button.active {
  border-color: var(--primary);
  background: #eef4ff;
  color: var(--primary);
}

.audit-help-modal {
  width: min(920px, 100%);
  max-height: calc(100dvh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.audit-help-modal-body {
  min-width: 0;
  overflow: auto;
  padding: 14px;
}

.audit-help-modal-body .table-wrap {
  margin: 0;
}

.audit-help-modal-body table {
  min-width: 680px;
}

.admin-report-group-table {
  min-width: 1120px;
}

.admin-preview-table {
  min-width: 1180px;
}

.leads-kpi-grid .metric-filter-card {
  min-height: 96px;
}

.leads-kpi-grid .metric-value {
  font-size: 19px;
  white-space: nowrap;
}

.leads-report-group-table {
  width: 100%;
  table-layout: fixed;
}

.leads-report-group-table th:first-child,
.leads-report-group-table td:first-child {
  width: 34%;
}

.leads-report-group-table tfoot td {
  border-top: 2px solid var(--line-strong);
  background: #f1f5f9;
  color: var(--ink);
  font-weight: 850;
}

.leads-hierarchy-table th:first-child,
.leads-hierarchy-table td:first-child {
  width: 42%;
}

.leads-hierarchy-row.level-group td {
  background: #f7f9fc;
  font-weight: 750;
}

.leads-hierarchy-row.level-source td:first-child {
  padding-left: 28px;
}

.leads-hierarchy-row.level-channel td:first-child {
  padding-left: 58px;
}

.leads-hierarchy-row.level-campaign td:first-child {
  padding-left: 88px;
  color: var(--muted);
}

.hierarchy-toggle {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.hierarchy-toggle > span {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--primary);
  background: #ffffff;
  font-weight: 800;
}

.hierarchy-toggle > b,
.hierarchy-leaf {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-header {
  min-height: 76px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  display: grid;
  align-content: center;
  gap: 4px;
}

.rail-header strong,
.rail-header span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-header strong {
  color: var(--ink);
  font-size: 15px;
}

.rail-header span {
  color: var(--muted);
  font-size: 12px;
}

.rail-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
}

.rail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(78px, auto);
  align-items: center;
  gap: 10px;
  min-height: 34px;
  color: var(--ink);
  font-size: 12px;
}

.rail-row b,
.rail-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-row span {
  color: var(--muted);
  text-align: right;
}

.rail-warning {
  border: 1px solid #f2d493;
  border-radius: 6px;
  background: #fff8e8;
  color: #805000;
  font-size: 12px;
  line-height: 1.35;
  padding: 10px;
}

.rail-action-button,
.rail-action-link {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid #b8c8ff;
  border-radius: 6px;
  background: #f2f6ff;
  color: #2049ca;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.rail-action-button:hover,
.rail-action-link:hover {
  background: #e8efff;
}

.quote-rail-detail {
  display: grid;
  gap: 0;
}

.quote-rail-hero {
  padding: 0 0 12px;
  display: grid;
  gap: 7px;
}

.quote-rail-hero span,
.quote-rail-hero strong,
.quote-rail-hero p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.quote-rail-hero span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.quote-rail-hero strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
}

.quote-rail-hero p {
  margin: 0;
  color: #344255;
  font-size: 12px;
  line-height: 1.4;
}

.quote-rail-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quote-rail-status .candidate-tags {
  display: contents;
}

.quote-rail-section {
  border-top: 1px solid var(--line);
  padding: 12px 0;
  display: grid;
  gap: 8px;
}

.quote-rail-section-head {
  display: grid;
  gap: 3px;
}

.quote-rail-section-head strong {
  color: var(--ink);
  font-size: 13px;
}

.quote-rail-section-head span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.rail-data-section {
  gap: 7px;
}

.rail-technical-section {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  padding: 8px;
}

.rail-technical-section summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.rail-technical-section[open] summary {
  margin-bottom: 8px;
}

.lead-sensitive-export-panel {
  border: 1px solid #b8c8ff;
  border-radius: 6px;
  background: #f5f7ff;
  padding: 10px;
  display: grid;
  gap: 7px;
}

.lead-sensitive-export-panel .control-button {
  width: 100%;
  justify-content: center;
}

.lead-sensitive-export-panel small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.lead-sensitive-column-list {
  margin: 0;
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}

.lead-sensitive-column-header,
.lead-sensitive-column-row {
  display: grid;
  grid-template-columns: minmax(108px, 0.8fr) minmax(0, 1.2fr);
  align-items: start;
}

.lead-sensitive-column-header {
  background: #f2f5f8;
  color: #46566e;
  font-size: 10px;
  font-weight: 800;
  padding: 6px 8px;
}

.lead-sensitive-column-row {
  border-bottom: 1px solid var(--line);
  padding: 0;
}

.lead-sensitive-column-row:last-child {
  border-bottom: 0;
}

.lead-sensitive-column-label,
.lead-sensitive-column-value {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  padding: 6px 7px;
}

.lead-sensitive-column-label {
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
  border-right: 1px solid var(--line);
}

.lead-sensitive-column-value {
  color: #41516a;
  font-size: 11px;
  line-height: 1.3;
  user-select: text;
}

.lead-sensitive-phone-row .lead-sensitive-column-value {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.lead-sensitive-candidate-list {
  display: grid;
  gap: 7px;
}

.lead-sensitive-candidate {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 8px;
}

.lead-sensitive-candidate summary {
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.lead-sensitive-candidate[open] summary {
  margin-bottom: 6px;
}

.quote-rail-timeline {
  display: grid;
  gap: 8px;
}

.quote-rail-timeline-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 9px;
  display: grid;
  gap: 4px;
}

.quote-rail-timeline-item strong,
.quote-rail-timeline-item span,
.quote-rail-timeline-item small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.quote-rail-timeline-item strong {
  color: var(--ink);
  font-size: 12px;
}

.quote-rail-timeline-item span,
.quote-rail-timeline-item small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.rail-link-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  justify-self: start;
  padding: 2px 0;
  font-size: 12px;
  font-weight: 900;
  text-align: left;
}

.panel-more-button {
  justify-self: end;
  align-self: center;
  white-space: nowrap;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.mini-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  padding: 8px;
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 3px;
}

.mini-card b,
.mini-card span {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.mini-card b {
  color: var(--ink);
  font-size: clamp(13px, 4.6vw, 17px);
  line-height: 1.12;
}

.mini-card span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.empty-state,
.loading-state {
  padding: 28px;
  display: grid;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.empty-state h2,
.loading-state h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.empty-state p,
.loading-state p {
  margin: 0;
  color: var(--muted);
  max-width: 760px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.loading-state {
  min-height: 260px;
  place-items: center;
  text-align: center;
}

.loading-state.compact {
  min-height: 150px;
  padding: 18px;
  box-shadow: none;
}

.loading-state.compact .loader-orbit {
  width: 46px;
  height: 46px;
}

.loading-copy {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.loader-orbit {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 2px solid rgba(79, 107, 255, 0.16);
  position: relative;
  animation: spin 2.6s linear infinite;
  box-shadow: inset 0 0 0 1px rgba(100, 198, 182, 0.12);
}

.loader-orbit::before,
.loader-orbit::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.loader-orbit::before {
  border: 2px solid transparent;
  border-top-color: var(--primary);
  border-right-color: rgba(100, 198, 182, 0.72);
}

.loader-orbit::after {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--primary));
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 18px rgba(79, 107, 255, 0.36);
}

.loader-dots {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
}

.loader-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--teal), var(--primary));
  box-shadow: 0 0 12px rgba(79, 107, 255, 0.22);
  animation: pulseDots 1.2s infinite ease-in-out;
}

.loader-dots span:nth-child(2) { animation-delay: 0.15s; }
.loader-dots span:nth-child(3) { animation-delay: 0.3s; }

.loader-progress {
  width: min(280px, 100%);
  display: grid;
  gap: 7px;
}

.crm-linear-progress {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 9px;
  border: 0;
  border-radius: 999px;
  background: #e7edf4;
  overflow: hidden;
}

.crm-linear-progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #e7edf4;
  box-shadow: inset 0 0 0 1px rgba(30, 48, 73, 0.05);
}

.crm-linear-progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--teal) 100%);
  box-shadow: 0 0 20px rgba(79, 107, 255, 0.24);
  transition: width 0.6s ease;
  animation: progressGlow 1.3s ease-in-out infinite alternate;
}

.crm-linear-progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--teal) 100%);
  box-shadow: 0 0 20px rgba(79, 107, 255, 0.24);
  transition: width 0.6s ease;
  animation: progressGlow 1.3s ease-in-out infinite alternate;
}

.loading-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.loading-progress-meta b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

@keyframes progressGlow {
  from { filter: saturate(0.9) brightness(0.96); }
  to { filter: saturate(1.16) brightness(1.08); }
}

.auth-page {
  min-height: 100vh;
  display: grid;
  align-items: stretch;
  color: var(--ink);
  background: linear-gradient(180deg, #f6f7f9 0%, #eaf2f4 100%);
}

.auth-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}

.auth-language-toggle {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
  min-width: 42px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 14px rgba(20, 31, 49, 0.08);
}

.auth-brand-panel,
.auth-login-panel {
  min-width: 0;
}

.auth-brand-panel {
  padding: 54px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 42px;
  border-right: 1px solid var(--line);
  background: linear-gradient(160deg, #ffffff 0%, #f0f6f8 100%);
}

.auth-brand-icon {
  width: 74px;
  height: 74px;
  object-fit: contain;
}

.auth-brand-copy {
  max-width: 660px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.auth-brand-copy h1 {
  max-width: 760px;
  color: var(--ink);
  font-size: 56px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.auth-brand-copy p:last-child {
  margin: 18px 0 0;
  max-width: 560px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.auth-feature-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.auth-feature {
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  display: grid;
  align-content: start;
  gap: 8px;
}

.feature-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  font-size: 13px;
  font-weight: 900;
}

.auth-feature strong,
.auth-feature small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.auth-feature strong {
  color: var(--ink);
  font-size: 14px;
}

.auth-feature small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.auth-login-panel {
  display: grid;
  place-items: center;
  padding: 54px;
  background: #f8fafb;
}

.auth-card {
  width: min(420px, 100%);
  padding: 30px;
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.auth-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
}

.auth-login-header h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.1;
}

.auth-login-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-field > span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap svg {
  position: absolute;
  left: 14px;
  width: 19px;
  height: 19px;
  color: var(--muted);
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 74px 0 44px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

.input-wrap input::placeholder {
  color: #9aa6b5;
}

.input-wrap input:focus {
  border-color: rgba(79, 107, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(79, 107, 255, 0.13);
}

.password-toggle {
  position: absolute;
  right: 9px;
  min-width: 50px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.password-toggle:hover {
  background: #eef4ff;
  border-color: rgba(79, 107, 255, 0.18);
}

.auth-submit {
  width: 100%;
  min-height: 52px;
}

.auth-footnote {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.form-error {
  color: #a73532;
  background: #fdecec;
  border: 1px solid #f4c3c0;
  border-radius: 6px;
  padding: 9px 10px;
  font-size: 12px;
  line-height: 1.4;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulseDots {
  0%, 80%, 100% { transform: scale(0.72); opacity: 0.35; }
  40% { transform: scale(1.18); opacity: 1; }
}

@keyframes shimmer {
  from { filter: brightness(0.96); }
  to { filter: brightness(1.08); }
}

@media (max-width: 1380px) {
  .app-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .detail-rail {
    display: none;
    grid-row: auto;
  }

  .app-shell.leads-detail-rail-active .detail-rail {
    display: grid;
    grid-column: 2;
    min-height: 0;
    border-top: 1px solid var(--line);
  }

  .app-shell.lsp-detail-rail-active .detail-rail {
    display: grid;
    grid-column: 2;
    min-height: 0;
    border-top: 1px solid var(--line);
  }

  .app-shell.performology-detail-rail-active .detail-rail {
    display: grid;
    grid-column: 2;
    min-height: 0;
    border-top: 1px solid var(--line);
  }

  .app-shell.audit-detail-rail-active .detail-rail {
    display: grid;
    grid-column: 2;
    min-height: 0;
    border-top: 1px solid var(--line);
  }

  .app-shell.admin-detail-rail-active .detail-rail {
    display: grid;
    grid-column: 2;
    min-height: 0;
    border-top: 1px solid var(--line);
  }

  .metric-grid,
  .filter-panel,
  .control-panel,
  .transfer-table-filters,
  .transfer-matrix-help,
  .timeline {
    grid-template-columns: repeat(3, minmax(132px, 1fr));
  }

  .transfer-date-filter-panel {
    grid-template-columns: repeat(2, minmax(180px, 1fr)) auto auto;
  }

  .workbench-evidence-panel {
    position: static;
  }

  .workbench-evidence-panel .panel-body {
    max-height: none;
  }

  .workbench-mobile-detail-panel {
    display: block;
  }
}

@media (max-width: 1100px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-brand-panel {
    min-height: 460px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .auth-login-panel {
    padding-top: 28px;
  }
}

@media (max-width: 980px) {
  .notification-popover {
    position: fixed;
    top: 62px;
    right: 12px;
  }
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    left: auto;
    width: auto;
    height: auto;
    overflow: visible;
    scrollbar-gutter: auto;
    grid-column: 1;
    grid-row: 1;
  }

  .main {
    grid-column: 1;
    grid-row: 2;
  }

  .app-shell.leads-detail-rail-active .detail-rail {
    grid-column: 1;
  }

  .app-shell.lsp-detail-rail-active .detail-rail {
    grid-column: 1;
  }

  .app-shell.performology-detail-rail-active .detail-rail {
    grid-column: 1;
  }

  .app-shell.audit-detail-rail-active .detail-rail {
    grid-column: 1;
  }

  .app-shell.admin-detail-rail-active .detail-rail {
    grid-column: 1;
  }

  .topbar,
  .two-col,
  .workbench-layout {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .filter-panel,
  .control-panel,
  .transfer-table-filters,
  .transfer-matrix-help,
  .lane-grid,
  .timeline {
    grid-template-columns: 1fr;
  }

  .transfer-date-filter-panel {
    grid-template-columns: 1fr;
  }

  .lsp-workbench-metrics {
    grid-template-columns: 1fr;
  }

  .label-filter-help,
  .candidate-pagination,
  .table-pagination {
    grid-template-columns: 1fr;
  }

  .pagination-pages {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .bar-row {
    grid-template-columns: minmax(92px, 116px) minmax(80px, 1fr) minmax(42px, auto);
  }

  .candidate-row-detail,
  .evidence-grid,
  .evidence-head,
  .workbench-detail-hero,
  .audit-timeline-item {
    grid-template-columns: 1fr;
  }

  .evidence-head span,
  .workbench-detail-status {
    text-align: left;
    justify-items: start;
  }

  .workbench-detail-status .candidate-tags,
  .audit-timeline-title span {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 14px 16px;
  }

  .workspace {
    padding: 16px;
  }

  .auth-brand-panel,
  .auth-login-panel {
    padding: 26px;
  }

  .auth-login-panel {
    order: -1;
  }

  .auth-brand-copy h1 {
    font-size: 34px;
  }

  .auth-brand-copy p:last-child {
    font-size: 15px;
  }

  .auth-feature-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-brand-icon {
    width: 58px;
    height: 58px;
  }
}

/* D-092: compact density, menu icons and user-resizable data tables. */
:root {
  --sidebar-width: 220px;
  --sidebar-collapsed-width: 58px;
}

.sidebar {
  padding: 8px;
  gap: 6px;
}

.brand {
  grid-template-columns: 30px minmax(0, 1fr);
  min-height: 40px;
  gap: 7px;
  padding: 0 4px;
}

.brand-mark {
  width: 28px;
  height: 28px;
}

.module-nav {
  gap: 3px;
}

.module-button {
  min-height: 38px;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 6px;
  padding: 4px 6px;
}

.module-button.has-submenu {
  grid-template-columns: 24px minmax(0, 1fr) 12px;
}

.module-subnav {
  margin-left: 10px;
  padding-left: 10px;
}

.module-subnav-button {
  min-height: 31px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "label";
  gap: 0;
  padding: 4px 8px;
  font-size: 11px;
  justify-items: stretch;
  text-align: left;
}

.module-subnav-button.has-submenu {
  grid-template-columns: minmax(0, 1fr) 10px;
  grid-template-areas: "label toggle";
}

.module-subnav-button-nested {
  min-height: 36px;
  grid-template-columns: 8px minmax(0, 1fr);
  grid-template-areas: "branch label";
  padding-block: 5px;
}

.module-subnav.module-subnav-nested {
  margin-left: 0;
  padding-left: 8px;
}

.module-subnav-icon {
  display: none;
}

.module-subnav-label {
  width: 100%;
  justify-self: stretch;
  text-align: left;
}

.module-subnav-button .module-expand-indicator {
  justify-self: end;
}

.module-subnav-leaf {
  grid-area: branch;
}

.module-button b {
  padding: 2px 6px;
  font-size: 10px;
}

.module-icon {
  width: 23px;
  height: 23px;
  border-radius: 5px;
  font-size: 10px;
}

.module-icon-image {
  border-color: transparent;
  background: rgba(79, 107, 255, 0.08);
}

.module-icon-image img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  filter: invert(39%) sepia(78%) saturate(2789%) hue-rotate(218deg) brightness(101%) contrast(102%);
}

.app-shell.sidebar-collapsed .sidebar {
  padding-inline: 6px;
}

.app-shell.sidebar-collapsed .module-button {
  min-height: 36px;
  padding: 5px;
}

table.resizable-table {
  table-layout: fixed;
  font-size: 12px;
}

table.resizable-table th,
table.resizable-table td {
  padding: 6px 7px;
  line-height: 1.18;
}

table.resizable-table th {
  position: relative;
  padding-right: 11px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.column-resize-handle {
  position: absolute;
  z-index: 3;
  top: 0;
  right: -3px;
  width: 8px;
  height: 100%;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}

.column-resize-handle::after {
  content: "";
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 3px;
  width: 1px;
  background: var(--line-strong);
}

.column-resize-handle:hover::after,
.column-resize-handle:focus-visible::after,
.resizing-column .column-resize-handle::after {
  width: 2px;
  background: var(--primary);
}

.resizing-column {
  cursor: col-resize;
  user-select: none;
}

th.sortable-column {
  cursor: pointer;
  user-select: none;
}

th.sortable-column:focus-visible {
  z-index: 2;
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.table-sort-indicator {
  display: inline-block;
  min-width: 12px;
  margin-left: 5px;
  color: #7b8ba3;
  font-size: 10px;
  line-height: 1;
  text-align: center;
  vertical-align: middle;
}

th.sortable-column:hover .table-sort-indicator,
th.sortable-column.is-sorted,
th.sortable-column.is-sorted .table-sort-indicator {
  color: var(--primary);
}

.transfer-powerbi-matrix {
  min-width: 1160px;
}

.transfer-powerbi-matrix th:first-child,
.transfer-powerbi-matrix td:first-child {
  width: 210px;
}

.matrix-link,
.hierarchy-toggle > b,
.hierarchy-leaf {
  white-space: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
}

.transfer-detail-table {
  min-width: 1040px;
}

/* D-093: readable headers and separate date/time controls. */
th,
table.resizable-table th {
  text-transform: none;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  line-height: 1.2;
}

.drawer-date-time-range {
  display: grid;
  gap: 10px;
}

.drawer-date-time-group {
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.drawer-date-time-group legend {
  padding: 0 4px;
  color: #42526a;
  font-size: 11px;
  font-weight: 800;
}

.drawer-date-time-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 8px;
}

@media (max-width: 560px) {
  .drawer-date-time-fields {
    grid-template-columns: 1fr;
  }
}

.transfer-detail-table .badge {
  padding-block: 3px;
}

.bar-list {
  gap: 7px;
}

.bar-row {
  grid-template-columns: minmax(130px, 190px) minmax(80px, 1fr) minmax(42px, auto);
  gap: 7px;
  min-height: 22px;
}

.bar-row span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.2;
}

.panel-body,
.transfer-detail-list-body {
  scrollbar-width: thin;
}

@media (max-width: 520px) {
  .auth-brand-panel,
  .auth-login-panel {
    padding: 18px;
  }

  .auth-feature-row {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 22px;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .section-title {
    align-items: start;
    flex-direction: column;
  }

  .section-title span {
    text-align: left;
  }

  .candidate-row {
    grid-template-columns: 1fr;
  }

  .candidate-row-signal {
    justify-items: start;
  }

  .audit-timeline-title {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Transfer workspace D-080 */
.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;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr) var(--detail-rail-width);
}

.app-shell.sidebar-collapsed.transfer-detail-rail-closed {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr) 0;
}

.app-shell.transfer-detail-rail-closed {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) 0;
}

.app-shell.transfer-detail-rail-closed .detail-rail {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
  padding-inline: 10px;
}

.app-shell.sidebar-collapsed .brand {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 0;
}

.app-shell.sidebar-collapsed .brand-text,
.app-shell.sidebar-collapsed .module-button > span:not(.module-icon),
.app-shell.sidebar-collapsed .module-button b,
.app-shell.sidebar-collapsed .module-subnav,
.app-shell.sidebar-collapsed .sidebar-footer,
.app-shell.sidebar-collapsed .sidebar-collapse-button b {
  display: none;
}

.app-shell.sidebar-collapsed .module-button {
  grid-template-columns: 1fr;
  grid-template-areas: "icon";
  justify-items: center;
  padding: 8px;
}

.sidebar-collapse-button {
  width: 100%;
  min-height: 38px;
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: #42526a;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sidebar-collapse-button:hover {
  border-color: rgba(79, 107, 255, 0.45);
  color: var(--primary);
  background: #f4f7ff;
}

.app-shell.sidebar-collapsed .sidebar-collapse-button span {
  transform: rotate(180deg);
}

.icon-button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.icon-button:hover {
  border-color: rgba(79, 107, 255, 0.5);
  color: var(--primary);
  background: #f3f6ff;
}

.detail-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  z-index: 8;
  box-shadow: -8px 0 22px rgba(31, 41, 55, 0.04);
}

.app-shell.transfer-detail-rail-active .detail-rail {
  display: grid;
  position: fixed;
  top: 0;
  right: 0;
  width: var(--detail-rail-width);
  height: 100dvh;
  overflow-y: auto;
}

.app-shell.module-detail-rail-active .detail-rail {
  display: grid;
  position: fixed;
  top: 0;
  right: 0;
  width: var(--detail-rail-width);
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  z-index: 35;
  box-shadow: -18px 0 45px rgba(15, 23, 42, 0.18);
}

.rail-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.rail-header-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.rail-header-actions {
  display: flex;
  gap: 6px;
}

.app-shell.transfer-detail-rail-expanded .detail-rail {
  position: fixed;
  inset: 10px;
  width: auto;
  height: calc(100vh - 20px);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  z-index: 40;
}

.app-shell.transfer-detail-rail-expanded .detail-rail #rail-next {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.app-shell.module-detail-rail-expanded .detail-rail {
  position: fixed;
  inset: 10px;
  width: auto;
  height: calc(100dvh - 20px);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  z-index: 50;
}

.app-shell.module-detail-rail-expanded .detail-rail #rail-next {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 59;
  border: 0;
  border-radius: 0;
  background: rgba(15, 23, 42, 0.34);
  cursor: default;
}

.filter-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 60;
  width: min(390px, 96vw);
  height: 100dvh;
  background: #ffffff;
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 42px rgba(15, 23, 42, 0.15);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  transform: translateX(105%);
  visibility: hidden;
  transition: transform 180ms ease;
}

.filter-drawer.open {
  transform: translateX(0);
  visibility: visible;
}

.filter-drawer[aria-hidden="true"] {
  display: none;
}

.filter-drawer-header,
.filter-drawer-footer {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-drawer-header > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
  margin-right: auto;
}

.filter-drawer-header strong {
  font-size: 14px;
}

.filter-drawer-header span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.filter-drawer-body {
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.filter-drawer-body > * {
  flex: 0 0 auto;
}

.drawer-embedded-filter {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.drawer-embedded-filter > label {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.drawer-embedded-filter input,
.drawer-embedded-filter select {
  width: 100%;
  min-height: 34px;
}

.drawer-embedded-filter > [id$="-clear"] {
  display: none;
}

.filter-drawer .admin-governance-form-grid {
  grid-template-columns: minmax(0, 1fr);
}

.filter-drawer-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}

.drawer-field {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.drawer-field > span {
  color: #42526a;
  font-size: 12px;
  font-weight: 700;
}

.drawer-field select,
.drawer-field input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 10px;
  font-size: 13px;
}

.drawer-field-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.drawer-field-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.matrix-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-align: left;
}

.matrix-toggle-icon {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 16px;
  border: 1px solid #9aa8ba;
  border-radius: 3px;
  background: #ffffff;
  font-size: 13px;
  line-height: 1;
}

.multi-filter-group {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
}

.multi-filter-summary {
  width: 100%;
  border: 0;
  background: #ffffff;
  min-height: 40px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #42526a;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.multi-filter-summary:hover {
  background: #f7f9fc;
}

.multi-filter-summary-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.multi-filter-summary b {
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

.multi-filter-summary i {
  color: var(--muted);
  font-style: normal;
  transition: transform 160ms ease;
}

.multi-filter-summary[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.multi-filter-options {
  max-height: 190px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  padding: 5px;
}

.multi-filter-option {
  min-height: 34px;
  padding: 6px 7px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 4px;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}

.multi-filter-option:hover {
  background: #f4f7ff;
}

.multi-filter-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

.drawer-guardrail {
  border: 1px solid #cdd9ff;
  border-radius: 6px;
  background: #f4f7ff;
  color: #40517a;
  padding: 11px;
  font-size: 12px;
  line-height: 1.4;
}

.drawer-error {
  border: 1px solid #f0b5b5;
  border-radius: 6px;
  background: #fff1f1;
  color: #9b2c2c;
  padding: 10px;
  font-size: 12px;
}

.transfer-dashboard-toolbar {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
}

.transfer-dashboard-toolbar > div:first-child,
.transfer-toolbar-actions,
.active-filter-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.transfer-dashboard-toolbar > div:first-child strong {
  font-size: 14px;
}

.leads-dashboard-toolbar {
  grid-template-columns: minmax(0, 1fr);
}

.leads-dashboard-toolbar.has-board-actions {
  grid-template-columns: minmax(0, 1fr) auto;
}

.leads-dashboard-toolbar.has-board-actions .dashboard-board-actions {
  justify-content: flex-end;
}

.leads-dashboard-toolbar.has-board-actions .active-filter-chips {
  grid-column: 1 / -1;
}

.leads-dashboard-toolbar.has-board-actions .analytics-board-detail {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 12px;
}

.result-badge {
  border-radius: 5px;
  background: #edf2f7;
  color: #526276;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 800;
}

.active-filter-chips {
  grid-column: 1 / -1;
  min-height: 24px;
}

.filter-empty-state {
  color: var(--muted);
  font-size: 12px;
}

.filter-chip {
  min-height: 26px;
  border: 1px solid #c8d4ff;
  border-radius: 999px;
  background: #f4f7ff;
  color: #334eaa;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 9px;
  font-size: 11px;
}

.transfer-filter-metrics {
  width: 100%;
  min-width: 0;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(142px, 1fr);
  overflow-x: auto;
  padding-bottom: 2px;
}

.transfer-filter-metrics .metric-filter-card {
  min-width: 142px;
  min-height: 82px;
}

.transfer-filter-metrics .metric-label {
  color: #334155;
  font-weight: 800;
  line-height: 1.25;
}

.transfer-filter-metrics .metric-value {
  font-size: 22px;
}

.transfer-insight-grid {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(440px, 1.1fr);
  gap: 12px;
}

.receiver-summary-scroll,
.transfer-detail-table-wrap {
  overflow: auto;
}

.receiver-summary-table,
.transfer-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.receiver-summary-table th,
.receiver-summary-table td,
.transfer-detail-table th,
.transfer-detail-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: middle;
}

.receiver-summary-table th:not(:first-child),
.receiver-summary-table td:not(:first-child),
.transfer-detail-table .numeric {
  text-align: right;
}

.receiver-summary-table thead th,
.transfer-detail-table thead th {
  background: #f4f7f9;
  color: #344255;
  font-size: 11px;
  font-weight: 850;
}

.receiver-summary-table tfoot td,
.transfer-detail-table tfoot td {
  background: #eef3f7;
  color: #1f2e40;
  font-weight: 850;
  border-top: 2px solid var(--line-strong);
}

.transfer-detail-list-panel {
  min-width: 0;
}

.transfer-matrix-panel,
.transfer-matrix-scroll,
.transfer-detail-list-panel,
.transfer-detail-table-wrap,
.receiver-summary-panel,
.receiver-summary-scroll {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.transfer-detail-list-body {
  padding: 0;
}

.transfer-detail-table {
  min-width: 1280px;
}

.transfer-detail-table-row {
  cursor: pointer;
}

.transfer-detail-table-row:hover,
.transfer-detail-table-row.active {
  background: #eefbfb;
}

.transfer-detail-table-row.active {
  box-shadow: inset 3px 0 0 #16b8b4;
}

.transfer-detail-table .badge {
  white-space: normal;
  text-align: left;
  line-height: 1.2;
}

.table-open-detail {
  width: 28px;
  height: 28px;
}

.table-empty-state {
  min-height: 110px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1380px) {
  .app-shell.module-detail-rail-active {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--detail-rail-width);
  }

  .app-shell.sidebar-collapsed.module-detail-rail-active {
    grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr) var(--detail-rail-width);
  }

  .app-shell.leads-detail-rail-active {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .app-shell.sidebar-collapsed.leads-detail-rail-active {
    grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
  }

  .app-shell.transfer-detail-rail-active {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--detail-rail-width);
  }

  .app-shell.sidebar-collapsed.transfer-detail-rail-active {
    grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr) var(--detail-rail-width);
  }

  .app-shell.sidebar-collapsed,
  .app-shell.sidebar-collapsed.transfer-detail-rail-closed {
    grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
  }

  .app-shell.transfer-detail-rail-closed {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .app-shell.transfer-detail-rail-active .detail-rail {
    display: grid;
    position: fixed;
    top: 0;
    right: 0;
    width: var(--detail-rail-width);
    height: 100vh;
    z-index: 35;
    box-shadow: -18px 0 45px rgba(15, 23, 42, 0.18);
  }

  .app-shell.transfer-detail-rail-expanded .detail-rail {
    inset: 10px;
    width: auto;
    height: calc(100vh - 20px);
  }

  .transfer-insight-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .app-shell.transfer-detail-rail-active,
  .app-shell.module-detail-rail-active,
  .app-shell.sidebar-collapsed,
  .app-shell.sidebar-collapsed.transfer-detail-rail-closed,
  .app-shell.transfer-detail-rail-closed {
    grid-template-columns: 1fr;
  }

  .sidebar-collapse-button {
    display: none;
  }

  .app-shell.sidebar-collapsed .sidebar {
    width: auto;
  }

  .app-shell.transfer-detail-rail-active .detail-rail {
    width: min(420px, 94vw);
  }

  .app-shell.module-detail-rail-active .detail-rail {
    width: min(420px, 94vw);
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    min-width: 0;
    padding: 8px 10px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 40px;
    padding: 0;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .brand-text,
  .sidebar-footer {
    display: none;
  }

  .module-nav {
    min-width: 0;
    display: flex;
    gap: 5px;
    overflow-y: hidden;
    overflow-x: auto;
  }

  .module-nav-group {
    flex: 0 0 44px;
  }

  .module-subnav {
    display: none;
  }

  .module-button,
  .app-shell.sidebar-collapsed .module-button {
    flex: 0 0 44px;
    width: 44px;
    min-height: 40px;
    grid-template-columns: 1fr;
    grid-template-areas: "icon";
    justify-items: center;
    padding: 5px;
  }

  .module-button > span:not(.module-icon),
  .module-button b {
    display: none;
  }

  .module-icon {
    width: 25px;
    height: 25px;
  }

  .transfer-dashboard-toolbar {
    grid-template-columns: 1fr;
  }

  .transfer-toolbar-actions {
    justify-content: flex-start;
  }

  .active-filter-chips {
    grid-column: 1;
  }

  .transfer-insight-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .drawer-field-pair {
    grid-template-columns: 1fr;
  }

  .transfer-toolbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .transfer-dashboard-toolbar .control-button {
    width: 100%;
  }

  .app-shell.transfer-detail-rail-expanded .detail-rail #rail-next {
    grid-template-columns: 1fr;
  }

  .app-shell.module-detail-rail-expanded .detail-rail #rail-next {
    grid-template-columns: 1fr;
  }
}

/* Keep compact table widths after module-specific declarations. */
.transfer-powerbi-matrix {
  min-width: 1160px;
}

.transfer-detail-table {
  min-width: 1040px;
}

/* D-093 final precedence: desktop rails occupy their own grid column. */
th,
table.resizable-table th {
  text-transform: none;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

@media (min-width: 981px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .app-shell {
    height: 100dvh;
    min-height: 0;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .app-shell.sidebar-collapsed {
    grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
  }

  .main {
    height: 100dvh;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .app-shell.transfer-detail-rail-active:not(.transfer-detail-rail-expanded),
  .app-shell.module-detail-rail-active:not(.module-detail-rail-expanded) {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--detail-rail-width);
  }

  .app-shell.sidebar-collapsed.transfer-detail-rail-active:not(.transfer-detail-rail-expanded),
  .app-shell.sidebar-collapsed.module-detail-rail-active:not(.module-detail-rail-expanded) {
    grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr) var(--detail-rail-width);
  }

  .app-shell.transfer-detail-rail-active:not(.transfer-detail-rail-expanded) .detail-rail,
  .app-shell.module-detail-rail-active:not(.module-detail-rail-expanded) .detail-rail {
    display: grid;
    grid-column: 3;
    grid-row: 1;
    position: sticky;
    inset: auto;
    top: 0;
    right: auto;
    width: auto;
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    z-index: 8;
    box-shadow: -8px 0 22px rgba(31, 41, 55, 0.08);
  }

  .app-shell.filter-drawer-active {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) minmax(340px, 380px);
  }

  .app-shell.sidebar-collapsed.filter-drawer-active {
    grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr) minmax(340px, 380px);
  }

  .app-shell.filter-drawer-active .detail-rail {
    display: none;
  }

  .app-shell.filter-drawer-active .filter-drawer.open {
    display: grid;
    grid-column: 3;
    grid-row: 1;
    position: sticky;
    inset: auto;
    top: 0;
    right: auto;
    width: auto;
    height: 100dvh;
    transform: none;
    visibility: visible;
    z-index: 12;
    box-shadow: -8px 0 22px rgba(31, 41, 55, 0.08);
  }

  .drawer-overlay {
    display: none !important;
  }
}

/* D-117: collapsed sidebar alignment and temporary hover expansion. */
@media (min-width: 981px) {
  .sidebar {
    box-sizing: border-box;
    transition: width 160ms ease, box-shadow 160ms ease;
  }

  .app-shell.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
    padding: 8px;
    overflow-x: hidden;
    scrollbar-gutter: auto;
  }

  .app-shell.sidebar-collapsed .module-nav {
    width: 100%;
    overflow-x: hidden;
    scrollbar-gutter: auto;
    scrollbar-width: none;
  }

  .app-shell.sidebar-collapsed .module-nav::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .app-shell.sidebar-collapsed .module-nav-group,
  .app-shell.sidebar-collapsed .module-button {
    width: 100%;
    min-width: 0;
  }

  .app-shell.sidebar-collapsed .module-button {
    min-height: 40px;
    grid-template-columns: 1fr;
    grid-template-areas: "icon";
    place-items: center;
    gap: 0;
    padding: 0;
  }

  .app-shell.sidebar-collapsed .module-icon {
    width: 24px;
    height: 24px;
    justify-self: center;
  }

  .app-shell.sidebar-collapsed .brand {
    width: 100%;
    min-height: 40px;
    place-items: center;
  }

  .app-shell.sidebar-collapsed .brand-mark {
    width: 26px;
    height: 26px;
  }

  .app-shell.sidebar-collapsed .sidebar-collapse-button {
    width: 40px;
    min-height: 36px;
    align-self: center;
  }

  .app-shell.sidebar-collapsed.sidebar-hover-expanded .sidebar {
    width: var(--sidebar-width);
    padding: 8px;
    overflow-x: hidden;
    z-index: 40;
    box-shadow: 14px 0 30px rgba(15, 23, 42, 0.16);
  }

  .app-shell.sidebar-collapsed.sidebar-hover-expanded .module-nav {
    scrollbar-width: thin;
  }

  .app-shell.sidebar-collapsed.sidebar-hover-expanded .module-nav::-webkit-scrollbar {
    width: 6px;
  }

  .app-shell.sidebar-collapsed.sidebar-hover-expanded .brand {
    grid-template-columns: 30px minmax(0, 1fr);
    justify-items: stretch;
    gap: 7px;
    padding: 0 4px;
  }

  .app-shell.sidebar-collapsed.sidebar-hover-expanded .brand-mark {
    width: 28px;
    height: 28px;
  }

  .app-shell.sidebar-collapsed.sidebar-hover-expanded .brand-text,
  .app-shell.sidebar-collapsed.sidebar-hover-expanded .module-button > span:not(.module-icon),
  .app-shell.sidebar-collapsed.sidebar-hover-expanded .module-button b,
  .app-shell.sidebar-collapsed.sidebar-hover-expanded .sidebar-footer,
  .app-shell.sidebar-collapsed.sidebar-hover-expanded .sidebar-collapse-button b {
    display: grid;
  }

  .app-shell.sidebar-collapsed.sidebar-hover-expanded .module-subnav:not([hidden]) {
    display: grid;
  }

  .app-shell.sidebar-collapsed.sidebar-hover-expanded .module-button {
    min-height: 38px;
    grid-template-columns: 24px minmax(0, 1fr);
    grid-template-areas:
      "icon label"
      "icon badge";
    place-items: initial;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
  }

  .app-shell.sidebar-collapsed.sidebar-hover-expanded .module-button.has-submenu {
    grid-template-columns: 24px minmax(0, 1fr) 12px;
    grid-template-areas:
      "icon label toggle"
      "icon badge toggle";
  }

  .app-shell.sidebar-collapsed.sidebar-hover-expanded .module-icon {
    width: 23px;
    height: 23px;
    justify-self: stretch;
  }

  .app-shell.sidebar-collapsed.sidebar-hover-expanded .sidebar-collapse-button {
    width: 100%;
  }

  .app-shell.sidebar-collapsed.sidebar-hover-expanded .sidebar-collapse-button span {
    transform: rotate(180deg);
  }
}

/* D-094: protected ADMIN user creation. */
.admin-governance-form {
  display: grid;
  gap: 12px;
}

.admin-governance-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}

.admin-governance-wide {
  grid-column: 1 / -1;
}

.is-hidden {
  display: none !important;
}

.agent-schedule-weekdays {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
}

.agent-schedule-weekdays label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-governance-form textarea {
  width: 100%;
  resize: vertical;
}

.admin-governance-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.admin-governance-table th,
.admin-governance-table td {
  max-width: 360px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
}

.admin-governance-table th {
  background: #f2f6f9;
  color: #33465f;
  font-size: 11px;
  font-weight: 800;
}

.admin-governance-table td {
  color: #24354d;
  font-size: 11px;
}

.admin-vendor-campaign-scope-row > td,
.convoso-upload-group-detail > td {
  padding: 12px 18px;
  background: var(--surface-soft);
}

.admin-vendor-campaign-scope-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.admin-vendor-campaign-scope-head small {
  display: block;
  max-width: 820px;
  margin-top: 3px;
  color: var(--muted);
}

.admin-vendor-campaign-scope-table,
.convoso-upload-scope-rule-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.admin-vendor-campaign-modal {
  width: min(900px, 100%);
}

.compact-button {
  min-height: 28px;
  padding: 4px 9px;
}

.admin-governance-entity-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-governance-entity-tabs .active {
  border-color: var(--accent);
  color: var(--accent);
  background: #eef3ff;
}

.admin-disposition-inline-editor {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}

.admin-disposition-inline-editor .panel-subtitle {
  margin: 3px 0 12px;
}

@media (max-width: 1100px) {
  .admin-governance-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .admin-governance-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-governance-wide {
    grid-column: auto;
  }
}

.admin-user-panel {
  max-width: 980px;
}

.admin-user-form {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.admin-user-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.admin-user-wide {
  grid-column: 1 / -1;
}

.admin-user-form .drawer-field small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.admin-user-password {
  min-width: 0;
}

.admin-delivery-mode {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.admin-delivery-mode legend {
  padding: 0 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.admin-delivery-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-delivery-options > label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  cursor: pointer;
}

.admin-delivery-options input {
  margin: 2px 0 0;
}

.admin-delivery-options span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.admin-delivery-options em {
  width: fit-content;
  padding: 2px 7px;
  border-radius: 999px;
  color: #176c46;
  background: #e3f7ed;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
}

.admin-delivery-options small,
.admin-delivery-mode > p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.admin-delivery-mode > p {
  margin: 10px 0 0;
}

.admin-unrestricted-scope {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--surface-soft);
}

.admin-unrestricted-scope input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
}

.admin-unrestricted-scope span {
  display: grid;
  gap: 3px;
}

.admin-unrestricted-scope small {
  color: var(--muted);
  font-size: 10px;
}

.admin-unrestricted-scope.disabled,
.admin-assigned-scope.is-inactive {
  opacity: 0.55;
}

.admin-assigned-scope {
  display: grid;
  gap: 14px;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  width: 100%;
  padding-right: 72px;
}

.password-field .password-toggle {
  top: 50%;
  transform: translateY(-50%);
}

.admin-campaign-fieldset {
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.admin-campaign-fieldset legend {
  padding: 0 5px;
  color: #42526a;
  font-size: 12px;
  font-weight: 800;
}

.admin-campaign-options {
  max-height: 210px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 10px;
  padding: 3px;
}

.admin-campaign-options label {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 6px;
  border-radius: 5px;
  color: #34445a;
  font-size: 11px;
}

.admin-campaign-options label:hover {
  background: #f4f7fb;
}

.admin-campaign-options span {
  overflow-wrap: anywhere;
}

.admin-campaign-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  margin-top: 9px;
}

.admin-user-scope-note,
.admin-user-result {
  padding: 10px;
  border: 1px solid #cbd8e7;
  border-radius: 6px;
  background: #f5f8fc;
  color: #40536b;
  font-size: 11px;
  line-height: 1.45;
}

.admin-user-scope-note.warn {
  border-color: #efcf8c;
  background: #fff8e8;
  color: #7b5200;
}

.admin-user-result {
  display: grid;
  gap: 3px;
  border-color: #a8dcc4;
  background: #eefaf4;
  color: #17643e;
}

.admin-user-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 700px) {
  .admin-user-form-grid,
  .admin-delivery-options,
  .admin-campaign-options,
  .admin-campaign-add {
    grid-template-columns: 1fr;
  }

  .admin-user-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* D-095: CRM user directory, modal creation and stable scope selectors. */
.admin-users-directory {
  min-width: 0;
}

.admin-users-directory-head,
.admin-users-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.admin-users-directory-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-users-toolbar {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.admin-users-toolbar .drawer-field {
  width: min(420px, 100%);
}

.admin-users-table {
  min-width: 1160px;
}

.admin-users-table td:first-child {
  display: grid;
  gap: 2px;
}

.admin-users-table td:first-child small {
  color: var(--muted);
}

.admin-user-result-banner {
  margin-bottom: 10px;
}

.admin-user-directory-error {
  margin-bottom: 10px;
}

.admin-user-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.account-status-switch {
  position: relative;
  width: 92px;
  min-height: 28px;
  padding: 3px 9px 3px 31px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}

.account-status-switch span {
  position: absolute;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.28);
  transition: left 140ms ease;
}

.account-status-switch.active {
  background: #3ba85c;
  border-color: #2f914c;
}

.account-status-switch.inactive {
  padding: 3px 31px 3px 9px;
  background: #df5656;
  border-color: #c84343;
}

.account-status-switch.inactive span {
  left: calc(100% - 25px);
}

.account-status-switch:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.account-status-switch:disabled {
  opacity: 0.62;
  cursor: wait;
}

.control-button.danger {
  border-color: #e8b5b5;
  color: #a52f2f;
}

.control-button.danger:hover:not(:disabled) {
  border-color: #d88b8b;
  background: #fff2f2;
}

.admin-user-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 31, 48, 0.48);
}

.admin-user-modal {
  width: min(1120px, 100%);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 29, 48, 0.28);
}

.dashboard-share-modal {
  width: min(640px, 100%);
}

.global-action-dialog {
  width: min(620px, 100%);
}

.global-action-dialog-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.global-action-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.global-action-dialog-actions button {
  min-width: 118px;
  min-height: 42px;
  border-radius: 10px;
}

.leads-load-confirmation-modal {
  width: min(760px, 100%);
  max-height: calc(100dvh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.leads-load-confirmation-body {
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 18px;
}

.leads-load-confirmation-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(79, 107, 255, 0.2);
  border-radius: 10px;
  background: rgba(79, 107, 255, 0.055);
}

.leads-load-confirmation-heading > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.leads-load-confirmation-heading strong {
  color: var(--ink);
  font-size: 13px;
}

.leads-load-confirmation-heading span:not(.leads-load-confirmation-step) {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.leads-load-confirmation-step {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.leads-load-confirmation-context {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(183, 121, 31, 0.26);
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.08);
}

.leads-load-confirmation-context span {
  color: var(--amber);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.055em;
}

.leads-load-confirmation-context strong {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.leads-load-confirmation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.leads-load-confirmation-grid article {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.leads-load-confirmation-grid span {
  color: var(--muted);
  font-size: 11px;
}

.leads-load-confirmation-grid strong {
  color: var(--ink);
  font-size: 20px;
  overflow-wrap: anywhere;
}

.leads-load-confirmation-note {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
}

.leads-load-confirmation-info {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(79, 107, 255, 0.12);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.leads-load-confirmation-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 2px;
}

.leads-load-confirmation-action {
  min-height: 44px;
  min-width: 142px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.leads-load-confirmation-cancel {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.leads-load-confirmation-cancel:hover,
.leads-load-confirmation-cancel:focus-visible {
  border-color: rgba(79, 107, 255, 0.55);
  background: var(--surface-soft);
}

.leads-load-confirmation-accept {
  min-width: 190px;
  box-shadow: 0 12px 26px rgba(79, 107, 255, 0.24);
}

.leads-load-confirmation-action:hover {
  transform: translateY(-1px);
}

.leads-load-confirmation-action:focus-visible {
  outline: 3px solid rgba(79, 107, 255, 0.22);
  outline-offset: 2px;
}

:root[data-theme="dark"] .leads-load-confirmation-modal,
:root[data-theme="dark"] .leads-load-confirmation-grid article,
:root[data-theme="dark"] .leads-load-confirmation-cancel {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

:root[data-theme="dark"] .leads-load-confirmation-heading {
  background: rgba(124, 145, 255, 0.1);
}

:root[data-theme="dark"] .leads-load-confirmation-context {
  background: rgba(228, 173, 82, 0.1);
}

.admin-profile-manager-modal {
  width: min(1280px, 100%);
}

.admin-profile-manager-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.admin-profile-admin-notice,
.admin-profile-result {
  margin: 0;
}

.admin-profile-manager-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  min-width: 0;
}

.admin-profile-catalog {
  position: sticky;
  top: 76px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.admin-profile-catalog-list {
  display: grid;
  gap: 6px;
  max-height: calc(100dvh - 230px);
  overflow: auto;
}

.admin-profile-catalog-item {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.admin-profile-catalog-item span {
  color: var(--muted);
  font-size: 10px;
}

.admin-profile-catalog-item:hover,
.admin-profile-catalog-item.active {
  border-color: var(--primary);
  background: rgba(79, 107, 255, 0.08);
}

.admin-profile-editor,
.admin-profile-editor form {
  min-width: 0;
}

.admin-profile-editor form {
  display: grid;
  gap: 12px;
}

.admin-profile-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-profile-basic-fields {
  margin: 0;
}

.admin-profile-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
}

.dashboard-share-modal-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.dashboard-share-success {
  padding: 11px 12px;
  border: 1px solid #a8dfbf;
  border-radius: 7px;
  color: #12663a;
  background: #effbf4;
  font-weight: 700;
}

:root[data-theme="dark"] .dashboard-share-success {
  border-color: #2f7852;
  color: #a8e7c3;
  background: #123424;
}

/* D-099: Transfer QA evaluation and change-request workflow. */
.qa-workflow-modal {
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.qa-modal-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.qa-modal-body {
  overflow: auto;
  padding: 16px;
}

/* D-104: masked conversion audit and append-only sales attribution. */
.leads-audit-toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 10px;
}

.leads-audit-toolbar .drawer-field {
  min-width: 220px;
  margin: 0;
}

.leads-audit-table-wrap {
  max-height: 520px;
}

.leads-audit-table th,
.leads-audit-table td,
.leads-unmatched-table th,
.leads-unmatched-table td,
.leads-attribution-history-table th,
.leads-attribution-history-table td {
  padding: 6px 8px;
  vertical-align: middle;
}

.leads-audit-table td:nth-child(12) {
  min-width: 230px;
}

.audit-stage-reason {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.leads-server-pagination {
  margin-top: 8px;
}

.compact-button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11px;
}

.leads-attribution-modal {
  width: min(920px, calc(100vw - 32px));
}

.leads-attribution-modal-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.leads-attribution-targets {
  display: grid;
  gap: 6px;
  max-height: 300px;
  overflow: auto;
}

.leads-attribution-target {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.leads-attribution-target:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.leads-attribution-target span {
  display: grid;
  gap: 2px;
}

.leads-attribution-target small {
  color: var(--muted);
}

@media (max-width: 760px) {
  .leads-audit-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .leads-audit-toolbar .drawer-field {
    width: 100%;
    min-width: 0;
  }
}

.qa-evaluation-form,
.qa-change-form {
  display: grid;
  gap: 14px;
}

.qa-criteria-list {
  display: grid;
  gap: 8px;
}

.qa-criterion {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(130px, 170px) minmax(220px, .8fr);
  align-items: end;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.qa-criterion-copy {
  display: grid;
  gap: 3px;
}

.qa-criterion-copy span,
.qa-answer-select > span,
.qa-observation-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.qa-criterion-copy strong {
  line-height: 1.35;
}

.qa-answer-select,
.qa-observation-field {
  display: grid;
  gap: 5px;
}

.qa-answer-select select,
.qa-observation-field input {
  width: 100%;
  min-height: 36px;
}

.qa-observation,
.qa-evaluation-form textarea,
.qa-change-form textarea {
  width: 100%;
  min-width: 0;
}

.qa-form-actions {
  display: flex;
  justify-content: flex-end;
}

.qa-history-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.qa-history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.qa-history-grid > div,
.qa-review-row,
.qa-request-card {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.qa-history-grid p,
.qa-review-row > div,
.qa-request-card > div {
  display: grid;
  gap: 3px;
}

.qa-history-grid p span,
.qa-review-row span,
.qa-review-row small,
.qa-request-card span {
  color: var(--muted);
}

.qa-review-list,
.qa-request-list {
  display: grid;
  gap: 8px;
}

.qa-review-row,
.qa-request-card {
  display: grid;
  gap: 12px;
}

.qa-request-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.qa-request-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 0;
}

.qa-request-details > div {
  display: grid;
  gap: 3px;
}

.qa-request-details dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.qa-request-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.qa-request-details .qa-request-notes {
  grid-column: span 2;
}

@media (max-width: 760px) {
  .qa-criterion,
  .qa-request-details {
    grid-template-columns: 1fr;
  }

  .qa-request-details .qa-request-notes {
    grid-column: auto;
  }
}

.qa-review-actions,
.qa-request-meta,
.rail-action-stack {
  display: flex;
  gap: 8px;
}

.qa-review-decision {
  display: grid;
  gap: 8px;
  min-width: min(320px, 100%);
}

.qa-review-decision textarea {
  min-height: 54px;
  resize: vertical;
}

.qa-review-actions {
  justify-content: flex-end;
}

.qa-request-status-history {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.qa-request-status-history summary {
  cursor: pointer;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.qa-request-status-history ol {
  display: grid;
  gap: 7px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.qa-request-status-history li {
  display: grid;
  grid-template-columns: minmax(90px, auto) 1fr;
  align-items: start;
  gap: 10px;
  padding-left: 10px;
  border-left: 2px solid var(--line);
}

.qa-request-status-history li > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.qa-request-status-history time,
.qa-request-status-history small {
  color: var(--muted);
  font-size: 11px;
}

.qa-cancel-request-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.rail-action-stack {
  flex-direction: column;
  margin: 12px 0;
}

.qa-entry-actions {
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
}

.qa-entry-actions span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.transfer-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.transfer-detail-actions-cell {
  min-width: 220px !important;
}

.transfer-detail-actions-cell .detail-action-button.table-open-detail {
  width: auto;
  height: auto;
}

.future-followup-load-notice {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
}

.future-followup-load-notice > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.future-followup-load-notice p,
.future-followup-load-notice small {
  margin: 0;
}

.future-followup-load-notice small {
  color: var(--muted);
  line-height: 1.45;
}

.compact-action-button {
  min-width: 34px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid #aebeff;
  background: #f3f6ff;
  color: #3155d9;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.compact-action-button:hover,
.compact-action-button:focus-visible {
  border-color: #4968e8;
  background: #e8edff;
  outline: none;
}

.leads-executive-summary {
  display: grid;
  gap: 14px;
}

.qa-workflow-grid {
  align-items: stretch;
}

.qa-workspace-tabs {
  margin-bottom: 12px;
}

.qa-lead-search-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
}

.qa-lead-search-form .drawer-field {
  margin: 0;
}

@media (max-width: 900px) {
  .qa-lead-search-form {
    grid-template-columns: 1fr;
  }
  .qa-criterion {
    grid-template-columns: 1fr;
  }
  .qa-history-grid,
  .qa-workflow-grid {
    grid-template-columns: 1fr;
  }
  .qa-review-row,
  .qa-request-card {
    align-items: stretch;
    flex-direction: column;
  }
}

.admin-user-modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.admin-scope-selector,
.admin-module-overrides,
.admin-permission-addons {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.admin-permission-list {
  display: grid;
  gap: 6px;
}

.admin-permission-list label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #edf1f5;
  color: #34445a;
  font-size: 11px;
}

.admin-permission-list input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
}

.admin-permission-list label > span {
  display: grid;
  gap: 2px;
}

.admin-permission-list small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.admin-scope-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: #34445a;
  font-size: 12px;
}

.admin-scope-title span {
  color: var(--muted);
  font-size: 10px;
}

.admin-dual-selector {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.admin-dual-selector label {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: #4b5f78;
  font-size: 11px;
  font-weight: 700;
}

.admin-dual-selector select {
  width: 100%;
  min-height: 190px;
  padding: 4px;
  border: 1px solid #cbd6e3;
  border-radius: 5px;
  background: #fff;
  color: #26384f;
  font: inherit;
}

.admin-dual-selector option {
  padding: 5px 7px;
}

.admin-dual-actions {
  display: grid;
  gap: 6px;
}

.admin-dual-actions .control-button {
  width: 78px;
  min-width: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 5px;
  font-size: 10px;
}

.admin-dual-actions .control-button b {
  font-weight: 600;
}

.admin-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
}

.admin-module-grid label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #edf1f5;
}

.admin-module-grid label > span {
  min-width: 0;
  display: grid;
  gap: 2px;
  color: #34445a;
  font-size: 11px;
}

.admin-module-grid small,
.admin-module-warning {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.admin-module-grid select {
  width: 100%;
}

.admin-module-grid .admin-module-check {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
}

.admin-module-check input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
}

.admin-module-warning {
  margin: 9px 0 0;
}

@media (max-width: 760px) {
  .admin-user-modal-backdrop {
    align-items: stretch;
    padding: 0;
  }

  .admin-user-modal {
    width: 100%;
    max-height: 100dvh;
    border-radius: 0;
  }

  .admin-users-directory-head,
  .admin-users-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-users-directory-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-dual-selector {
    grid-template-columns: 1fr;
  }

  .admin-dual-actions {
    grid-template-columns: repeat(4, 38px);
    justify-content: center;
  }

  .admin-module-grid {
    grid-template-columns: 1fr;
  }

  .leads-load-confirmation-grid {
    grid-template-columns: 1fr;
  }

  .leads-load-confirmation-context {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .leads-load-confirmation-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .leads-load-confirmation-action,
  .leads-load-confirmation-accept {
    width: 100%;
    min-width: 0;
  }

  .admin-profile-manager-layout {
    grid-template-columns: 1fr;
  }

  .admin-profile-catalog {
    position: static;
  }

  .admin-profile-catalog-list {
    max-height: 210px;
  }
}

/* D-136b: contraste oscuro transversal. Se mantiene al final para prevalecer
   sobre los estilos claros heredados de cada modulo sin alterar sus estados. */
:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .filter-drawer,
:root[data-theme="dark"] .admin-user-modal-head,
:root[data-theme="dark"] .label-filter-panel,
:root[data-theme="dark"] .view-tabs,
:root[data-theme="dark"] .module-focus-panel,
:root[data-theme="dark"] .multi-filter-group,
:root[data-theme="dark"] .multi-filter-summary,
:root[data-theme="dark"] .dashboard-editor-choice,
:root[data-theme="dark"] .dashboard-hierarchy-picker,
:root[data-theme="dark"] .dashboard-column-picker,
:root[data-theme="dark"] .admin-scope-selector,
:root[data-theme="dark"] .admin-module-overrides,
:root[data-theme="dark"] .admin-permission-addons,
:root[data-theme="dark"] .qa-review-row,
:root[data-theme="dark"] .qa-request-card,
:root[data-theme="dark"] .empty-state,
:root[data-theme="dark"] .table-empty-state {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

:root[data-theme="dark"] .module-button,
:root[data-theme="dark"] .module-subnav-button,
:root[data-theme="dark"] .sidebar-collapse-button,
:root[data-theme="dark"] .icon-button,
:root[data-theme="dark"] .label-filter-button,
:root[data-theme="dark"] .compact-action-button,
:root[data-theme="dark"] .page-button,
:root[data-theme="dark"] .text-button,
:root[data-theme="dark"] .rail-link-button,
:root[data-theme="dark"] .matrix-toggle-icon {
  background: var(--surface-soft);
  border-color: var(--line-strong);
  color: var(--ink);
}

:root[data-theme="dark"] .module-button.active,
:root[data-theme="dark"] .module-subnav-button.active,
:root[data-theme="dark"] .view-tab.active,
:root[data-theme="dark"] .label-filter-button.active,
:root[data-theme="dark"] .page-button.active,
:root[data-theme="dark"] .compact-action-button:hover,
:root[data-theme="dark"] .compact-action-button:focus-visible {
  background: #293455;
  border-color: #758dff;
  color: #f2f5ff;
}

:root[data-theme="dark"] .module-button:hover:not(.active),
:root[data-theme="dark"] .module-subnav-button:hover:not(.active),
:root[data-theme="dark"] .sidebar-collapse-button:hover,
:root[data-theme="dark"] .icon-button:hover,
:root[data-theme="dark"] .label-filter-button:hover,
:root[data-theme="dark"] .multi-filter-summary:hover,
:root[data-theme="dark"] .multi-filter-option:hover {
  background: #2a353e;
  color: #f5f8fb;
}

:root[data-theme="dark"] .view-tab {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--ink);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] .drawer-field input,
:root[data-theme="dark"] .drawer-field select,
:root[data-theme="dark"] .admin-dual-selector select {
  background: #20282f;
  border-color: #52606c;
  color: #f4f7fa;
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
  color: #9eabb7;
  opacity: 1;
}

:root[data-theme="dark"] option {
  background: #20282f;
  color: #f4f7fa;
}

:root[data-theme="dark"] .drawer-field > span,
:root[data-theme="dark"] .admin-permission-list label,
:root[data-theme="dark"] .admin-scope-title,
:root[data-theme="dark"] .admin-dual-selector label,
:root[data-theme="dark"] .admin-module-grid label > span,
:root[data-theme="dark"] .matrix-agent,
:root[data-theme="dark"] .label-filter-help,
:root[data-theme="dark"] .filter-empty-state,
:root[data-theme="dark"] .empty-state,
:root[data-theme="dark"] .table-empty-state,
:root[data-theme="dark"] .pagination-range,
:root[data-theme="dark"] .page-size-control,
:root[data-theme="dark"] small {
  color: var(--muted);
}

:root[data-theme="dark"] a,
:root[data-theme="dark"] .panel-link,
:root[data-theme="dark"] .text-link,
:root[data-theme="dark"] .rail-link-button,
:root[data-theme="dark"] .table-sort-button:hover,
:root[data-theme="dark"] .table-sort-button.active {
  color: #91a7ff;
}

:root[data-theme="dark"] table,
:root[data-theme="dark"] table tbody,
:root[data-theme="dark"] table tfoot,
:root[data-theme="dark"] .table-wrap,
:root[data-theme="dark"] .dashboard-widget-table {
  background: var(--surface);
  color: var(--ink);
}

:root[data-theme="dark"] table th,
:root[data-theme="dark"] table td,
:root[data-theme="dark"] .dashboard-widget-table th,
:root[data-theme="dark"] .dashboard-widget-table td {
  border-color: #39444e;
}

:root[data-theme="dark"] table tbody td,
:root[data-theme="dark"] table tbody th,
:root[data-theme="dark"] .dashboard-widget-table tbody td,
:root[data-theme="dark"] .transfer-powerbi-matrix .campaign-row td,
:root[data-theme="dark"] .transfer-powerbi-matrix .agent-row td,
:root[data-theme="dark"] .transfer-powerbi-matrix .agent-row:nth-child(odd) td,
:root[data-theme="dark"] .leads-hierarchy-row td,
:root[data-theme="dark"] .dashboard-hierarchy-row td {
  background: var(--surface);
  color: var(--ink);
}

:root[data-theme="dark"] table tbody tr:nth-child(even) td,
:root[data-theme="dark"] .dashboard-widget-table tbody tr:nth-child(even) td,
:root[data-theme="dark"] .transfer-powerbi-matrix .agent-row:nth-child(even) td {
  background: #20272d;
}

:root[data-theme="dark"] table tbody tr:hover td,
:root[data-theme="dark"] .dashboard-widget-table tbody tr:hover td,
:root[data-theme="dark"] table tbody tr.selected-row td {
  background: #2a353e;
  color: #ffffff;
}

:root[data-theme="dark"] table tfoot td,
:root[data-theme="dark"] .transfer-powerbi-matrix tfoot td,
:root[data-theme="dark"] .leads-hierarchy-table tfoot td,
:root[data-theme="dark"] .dashboard-widget-table tfoot td {
  background: #28323a;
  color: #f5f8fb;
  border-color: #52606c;
}

:root[data-theme="dark"] .hierarchy-toggle,
:root[data-theme="dark"] .hierarchy-leaf,
:root[data-theme="dark"] .dashboard-hierarchy-toggle,
:root[data-theme="dark"] .dashboard-hierarchy-leaf,
:root[data-theme="dark"] .matrix-link,
:root[data-theme="dark"] .matrix-link.numeric,
:root[data-theme="dark"] .matrix-link.rate,
:root[data-theme="dark"] .dashboard-transfer-detail-link,
:root[data-theme="dark"] .dashboard-dimension-cell {
  color: var(--ink);
}

:root[data-theme="dark"] .metric-card,
:root[data-theme="dark"] .metric-filter-card,
:root[data-theme="dark"] .dashboard-kpi-card {
  background: var(--surface-soft);
  border-color: var(--line-strong);
  color: var(--ink);
}

:root[data-theme="dark"] .metric-label,
:root[data-theme="dark"] .metric-foot,
:root[data-theme="dark"] .panel-subtitle,
:root[data-theme="dark"] .dashboard-widget-filter-summary,
:root[data-theme="dark"] .dashboard-widget small {
  color: var(--muted);
}

:root[data-theme="dark"] .module-subnav::before,
:root[data-theme="dark"] .admin-permission-list label,
:root[data-theme="dark"] .admin-module-grid label {
  border-color: #39444e;
}

:root[data-theme="dark"] .page-button:disabled,
:root[data-theme="dark"] button:disabled {
  background: #252d34;
  border-color: #39444e;
  color: #8795a3;
  opacity: 1;
}

:root[data-theme="dark"] progress,
:root[data-theme="dark"] .progress-track {
  background: #313b44;
}

:root[data-theme="dark"] .table-sort-indicator {
  color: #b7c9de;
}

:root[data-theme="dark"] .account-status-switch.active,
:root[data-theme="dark"] .account-status-switch.active b {
  color: #082f1e;
}

/* D-137: navegacion compacta, filtros de turnos y contraste oscuro completo. */
.module-subnav-button,
.module-subnav-button:hover,
.module-subnav-button.active {
  border-color: transparent;
  box-shadow: none;
}

.module-icon-tint img {
  filter: invert(34%) sepia(82%) saturate(2520%) hue-rotate(220deg) brightness(101%) contrast(101%);
}

:root[data-theme="dark"] .module-icon-tint img {
  filter: invert(73%) sepia(28%) saturate(1167%) hue-rotate(184deg) brightness(102%) contrast(101%);
}

.schedule-filter-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(130px, 0.75fr)) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.schedule-filter-grid .drawer-field {
  margin: 0;
}

.schedule-filter-actions,
.table-row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.schedule-filter-actions {
  justify-content: flex-end;
  padding-bottom: 1px;
}

:root[data-theme="dark"] table thead,
:root[data-theme="dark"] table thead tr,
:root[data-theme="dark"] table thead th,
:root[data-theme="dark"] .dashboard-widget-table thead th {
  background: #27313a;
  color: #f4f8fc;
}

:root[data-theme="dark"] table tbody td,
:root[data-theme="dark"] table tbody th,
:root[data-theme="dark"] table tbody td strong,
:root[data-theme="dark"] table tbody td b,
:root[data-theme="dark"] .dashboard-widget-table tbody td,
:root[data-theme="dark"] .dashboard-dimension-cell,
:root[data-theme="dark"] .hierarchy-toggle,
:root[data-theme="dark"] .dashboard-hierarchy-toggle {
  color: #e8eef5;
}

:root[data-theme="dark"] .qa-criterion,
:root[data-theme="dark"] .dashboard-column-options label,
:root[data-theme="dark"] .dashboard-hierarchy-options label,
:root[data-theme="dark"] .dashboard-choice-card,
:root[data-theme="dark"] .auth-feature,
:root[data-theme="dark"] .auth-card {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  color: var(--ink);
}

:root[data-theme="dark"] .dashboard-hierarchy-options label:has(input:checked),
:root[data-theme="dark"] .dashboard-choice-card:has(input:checked) {
  border-color: #8297ff;
  background: #293455;
  color: #f4f7ff;
}

:root[data-theme="dark"] .dashboard-column-options select,
:root[data-theme="dark"] .dashboard-hierarchy-options select,
:root[data-theme="dark"] .dashboard-column-options input[type="text"],
:root[data-theme="dark"] .dashboard-hierarchy-options input[type="text"] {
  border-color: #52606c;
  background: #20282f;
  color: #f4f7fa;
}

:root[data-theme="dark"] .qa-criterion-copy strong,
:root[data-theme="dark"] .qa-criterion-copy span,
:root[data-theme="dark"] .qa-answer-select > span,
:root[data-theme="dark"] .qa-observation-field > span {
  color: #dce7f2;
}

:root[data-theme="dark"] .auth-page,
:root[data-theme="dark"] .auth-brand-panel,
:root[data-theme="dark"] .auth-login-panel {
  background: #11171c;
  color: var(--ink);
}

:root[data-theme="dark"] .auth-language-toggle,
:root[data-theme="dark"] .input-wrap input {
  border-color: #52606c;
  background: #20282f;
  color: #f4f7fa;
}

@media (max-width: 1100px) {
  .schedule-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-filter-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .schedule-filter-grid {
    grid-template-columns: 1fr;
  }

  .schedule-filter-actions {
    grid-column: auto;
    justify-content: stretch;
  }

  .schedule-filter-actions > button {
    flex: 1;
  }
}

/* D-138: menu adaptable, editor legible y distribucion operativa de Workforce. */
.sidebar-control {
  position: relative;
  z-index: 70;
  margin-top: auto;
}

.sidebar-control .sidebar-collapse-button {
  width: 100%;
  margin-top: 0;
}

.sidebar-control-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  display: grid;
  width: 190px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.sidebar-control-menu[hidden] {
  display: none;
}

.sidebar-control-menu strong {
  padding: 7px 8px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.sidebar-control-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.sidebar-control-menu button::before {
  content: "";
  width: 7px;
  height: 7px;
  border: 1px solid var(--muted);
  border-radius: 50%;
}

.sidebar-control-menu button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.sidebar-control-menu button.active::before {
  border-color: var(--primary);
  background: var(--primary);
}

.app-shell.sidebar-collapsed:not(.sidebar-hover-expanded) .sidebar-control {
  display: grid;
  place-items: center;
}

.app-shell.sidebar-collapsed:not(.sidebar-hover-expanded) .sidebar-control .sidebar-collapse-button {
  width: 38px;
  min-width: 38px;
  padding-inline: 0;
}

.app-shell.sidebar-collapsed:not(.sidebar-hover-expanded) .sidebar-control-menu {
  position: fixed;
  left: 8px;
  bottom: 58px;
}

.module-button,
.module-button.active,
.module-subnav-button,
.module-subnav-button.active {
  border-color: transparent;
  box-shadow: none;
}

.module-button.active {
  box-shadow: inset 3px 0 var(--primary);
}

.module-button:hover,
.module-subnav-button:hover {
  border-color: var(--line-strong);
  box-shadow: none;
}

.schedule-filter-grid {
  grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(150px, 1fr));
  align-items: end;
}

.schedule-filter-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.dashboard-column-options,
.dashboard-hierarchy-options {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
}

.dashboard-column-options label {
  grid-template-columns: 18px 20px 62px minmax(0, 1fr);
  grid-template-areas:
    "drag check order label"
    "rename rename rename rename";
  min-height: 74px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.dashboard-column-options .dashboard-hierarchy-drag {
  grid-area: drag;
}

.dashboard-column-options input[type="checkbox"] {
  grid-area: check;
}

.dashboard-column-options select {
  grid-area: order;
}

.dashboard-column-options label > span:not(.dashboard-hierarchy-drag) {
  grid-area: label;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.dashboard-column-options input[type="text"] {
  grid-area: rename;
}

.dashboard-hierarchy-options label {
  grid-template-columns: 18px 20px 62px minmax(0, 1fr);
  grid-template-areas:
    "drag check order label"
    "rename rename rename rename";
  min-height: 82px;
}

.dashboard-hierarchy-options .dashboard-hierarchy-drag {
  grid-area: drag;
}

.dashboard-hierarchy-options input[type="checkbox"] {
  grid-area: check;
}

.dashboard-hierarchy-options select {
  grid-area: order;
}

.dashboard-hierarchy-options label > span:not(.dashboard-hierarchy-drag) {
  grid-area: label;
}

.dashboard-hierarchy-options input[type="text"] {
  grid-area: rename;
}

.workforce-filter-grid {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
}

/* D-139: navegacion sin contornos persistentes y Workforce separado. */
.module-nav-group,
.module-button,
.module-button.active,
.module-button:hover,
.module-button:hover:not(.active),
.module-subnav-button,
.module-subnav-button.active,
.module-subnav-button:hover {
  border: 0 !important;
  box-shadow: none !important;
}

.module-button,
.module-subnav-button {
  background: transparent;
}

.module-button:hover,
.module-subnav-button:hover {
  background: var(--surface-soft);
}

.module-button.active,
.module-subnav-button.active {
  background: var(--primary-soft);
}

.module-button:focus-visible,
.module-subnav-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.workforce-filter-grid .drawer-field {
  margin: 0;
}

.workforce-filter-grid .schedule-filter-actions {
  grid-column: 1 / -1;
}

.workforce-people-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.75fr);
  gap: 12px;
}

.workforce-org-chart {
  display: grid;
  gap: 10px;
}

.workforce-org-root {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--primary);
  background: var(--surface-soft);
}

.workforce-org-root span,
.workforce-org-branch small {
  color: var(--muted);
}

.workforce-org-branches {
  display: grid;
  gap: 7px;
  padding-left: 14px;
  border-left: 1px solid var(--line-strong);
}

.workforce-org-branch {
  border: 1px solid var(--line);
  background: var(--surface);
}

.workforce-org-branch > button {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: var(--surface-soft);
  color: var(--ink);
  text-align: left;
}

.workforce-org-people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 5px;
  padding: 8px 10px;
}

.workforce-org-people[hidden] {
  display: none;
}

.workforce-org-people span {
  overflow: hidden;
  padding: 5px 7px;
  border-left: 2px solid var(--line-strong);
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

:root[data-theme="dark"] .dashboard-choice-card input:checked + span,
:root[data-theme="dark"] .dashboard-choice-card:has(input:checked) > span {
  border-color: #8297ff;
  background: #293455;
  color: #f4f7ff;
}

:root[data-theme="dark"] .dashboard-choice-card > span,
:root[data-theme="dark"] .dashboard-filter-slicer,
:root[data-theme="dark"] .dashboard-slicer-options,
:root[data-theme="dark"] .dashboard-slicer-options label,
:root[data-theme="dark"] .dashboard-metric-picker,
:root[data-theme="dark"] .dashboard-choice-group,
:root[data-theme="dark"] .dashboard-hierarchy-picker,
:root[data-theme="dark"] .dashboard-filter-picker,
:root[data-theme="dark"] .workforce-org-branch,
:root[data-theme="dark"] .workforce-org-root {
  border-color: #46535f;
  background: #20282f;
  color: #eef4fa;
}

:root[data-theme="dark"] .dashboard-column-options label,
:root[data-theme="dark"] .dashboard-hierarchy-options label,
:root[data-theme="dark"] .dashboard-column-options label > span,
:root[data-theme="dark"] .dashboard-hierarchy-options label > span,
:root[data-theme="dark"] .dashboard-hierarchy-options b,
:root[data-theme="dark"] .dashboard-filter-slicer summary,
:root[data-theme="dark"] .dashboard-filter-slicer summary span,
:root[data-theme="dark"] .dashboard-slicer-options label span {
  color: #eef4fa;
}

:root[data-theme="dark"] .panel-title,
:root[data-theme="dark"] .section-title h2,
:root[data-theme="dark"] table tbody td,
:root[data-theme="dark"] table tbody th,
:root[data-theme="dark"] table tbody td a,
:root[data-theme="dark"] table tbody td button:not(.badge),
:root[data-theme="dark"] .table-empty-state,
:root[data-theme="dark"] .empty-state h2 {
  color: #eef4fa !important;
}

:root[data-theme="dark"] .dashboard-column-options input[type="text"]::placeholder,
:root[data-theme="dark"] .dashboard-hierarchy-options input[type="text"]::placeholder,
:root[data-theme="dark"] input::placeholder {
  color: #aebdca;
}

:root[data-theme="dark"] .sidebar-control-menu,
:root[data-theme="dark"] .workforce-org-branch > button {
  background: #20282f;
  color: #eef4fa;
}

@media (max-width: 1180px) {
  .workforce-people-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .schedule-filter-grid,
  .workforce-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .schedule-filter-grid,
  .workforce-filter-grid,
  .dashboard-column-options,
  .dashboard-hierarchy-options {
    grid-template-columns: 1fr;
  }
}

/* D-151: registro operativo de ventas reportadas en Performology. */
.reported-sale-form-panel,
.reported-sale-detail {
  min-width: 0;
}

.reported-sale-head-actions,
.reported-sale-row-actions,
.reported-sale-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.reported-sale-form {
  display: grid;
  gap: 12px;
}

.reported-sale-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.reported-sale-form legend {
  padding: 0 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.reported-sale-form-grid,
.reported-sale-item-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
}

.reported-sale-items {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.reported-sale-item {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 6px;
  background: var(--surface);
}

.reported-sale-item > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.reported-sale-actions {
  justify-content: flex-end;
  padding-top: 2px;
}

.reported-sale-actions > span {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
}

.rail-success {
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, var(--green) 42%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--green) 11%, var(--surface));
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.reported-sales-filters {
  grid-template-columns: repeat(2, minmax(150px, 0.7fr)) minmax(190px, 1fr) minmax(260px, 1.6fr) auto auto;
}

.reported-status-filter select[multiple] {
  min-height: 76px;
  padding-block: 5px;
}

.reported-sales-table {
  min-width: 1120px;
}

.reported-sales-table td,
.reported-sales-table th {
  padding-block: 7px;
  vertical-align: middle;
}

.reported-sales-table small {
  color: var(--muted);
}

.reported-sale-detail-body {
  display: grid;
  gap: 16px;
}

.reported-sale-detail-body h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 14px;
}

.reported-sale-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.reported-sale-facts > div {
  min-width: 0;
  padding: 9px 10px;
  background: var(--surface);
}

.reported-sale-facts dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.reported-sale-facts dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.reported-sale-inline-form {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(240px, 1.5fr) auto;
  align-items: end;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.reported-sale-attribution-form .reported-sale-inline-form {
  grid-template-columns: minmax(160px, 0.75fr) minmax(200px, 1fr) minmax(260px, 1.5fr) auto;
}

.reported-sale-timeline {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.reported-sale-timeline article {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.reported-sale-timeline article:last-child {
  border-bottom: 0;
}

.reported-sale-timeline time,
.reported-sale-timeline span,
.reported-sale-timeline p {
  color: var(--muted);
  font-size: 12px;
}

.reported-sale-timeline div {
  display: grid;
  grid-template-columns: minmax(150px, auto) minmax(120px, 0.35fr) minmax(0, 1fr);
  gap: 10px;
}

.reported-sale-timeline p {
  margin: 0;
}

:root[data-theme="dark"] .reported-sale-form fieldset,
:root[data-theme="dark"] .reported-sale-inline-form,
:root[data-theme="dark"] .reported-sale-item {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

@media (max-width: 1180px) {
  .reported-sales-filters {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .reported-search-filter {
    grid-column: 1 / -1;
  }

  .reported-sale-form-grid,
  .reported-sale-item-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .reported-sale-facts {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

  .reported-sale-inline-form,
  .reported-sale-attribution-form .reported-sale-inline-form {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 680px) {
  .reported-sales-filters,
  .reported-sale-form-grid,
  .reported-sale-item-grid,
  .reported-sale-facts,
  .reported-sale-inline-form,
  .reported-sale-attribution-form .reported-sale-inline-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .reported-search-filter {
    grid-column: auto;
  }

  .reported-sale-actions > span {
    flex-basis: 100%;
  }

  .reported-sale-timeline article,
  .reported-sale-timeline div {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* D-171: acciones de pizarra consistentes, accesibles y adaptables. */
.dashboard-board-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.dashboard-board-actions .secondary-button,
.dashboard-board-actions .control-button.compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 13px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(31, 41, 55, 0.06);
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.dashboard-board-actions .primary-button {
  min-height: 36px;
  border-radius: 8px;
  padding-inline: 14px;
}

.dashboard-board-actions .secondary-button:hover:not(:disabled),
.dashboard-board-actions .control-button.compact:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--primary) 58%, var(--line-strong));
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
  color: color-mix(in srgb, var(--primary) 82%, var(--ink));
  box-shadow: 0 5px 12px rgba(31, 41, 55, 0.1);
  transform: translateY(-1px);
}

.dashboard-board-actions .secondary-button:focus-visible,
.dashboard-board-actions .control-button.compact:focus-visible,
.dashboard-board-actions .primary-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 32%, transparent);
  outline-offset: 2px;
}

.dashboard-board-actions .secondary-button:disabled,
.dashboard-board-actions .control-button.compact:disabled,
.dashboard-board-actions .primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
  transform: none;
}

.dashboard-board-actions .secondary-button.danger-button {
  border-color: color-mix(in srgb, var(--red) 50%, var(--line-strong));
  background: color-mix(in srgb, var(--red) 4%, var(--surface));
  color: color-mix(in srgb, var(--red) 88%, var(--ink));
}

.dashboard-board-actions .secondary-button.danger-button:hover:not(:disabled),
.dashboard-board-actions .secondary-button.danger-button:focus-visible {
  border-color: color-mix(in srgb, var(--red) 76%, var(--line-strong));
  background: color-mix(in srgb, var(--red) 10%, var(--surface));
  color: var(--red);
}

:root[data-theme="dark"] .dashboard-board-actions .secondary-button,
:root[data-theme="dark"] .dashboard-board-actions .control-button.compact {
  border-color: #52606c;
  background: #20282f;
  color: #f4f7fa;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.22);
}

:root[data-theme="dark"] .dashboard-board-actions .secondary-button:hover:not(:disabled),
:root[data-theme="dark"] .dashboard-board-actions .control-button.compact:hover:not(:disabled) {
  border-color: #8297ff;
  background: #293455;
  color: #f4f7ff;
}

:root[data-theme="dark"] .dashboard-board-actions .secondary-button.danger-button {
  border-color: #8f5355;
  background: #352629;
  color: #ffaaa5;
}

:root[data-theme="dark"] .dashboard-board-actions .secondary-button.danger-button:hover:not(:disabled),
:root[data-theme="dark"] .dashboard-board-actions .secondary-button.danger-button:focus-visible {
  border-color: #d77a79;
  background: #452b2e;
  color: #ffc0bc;
}

:root[data-theme="dark"] .dashboard-board-actions .secondary-button:disabled,
:root[data-theme="dark"] .dashboard-board-actions .control-button.compact:disabled,
:root[data-theme="dark"] .dashboard-board-actions .primary-button:disabled {
  border-color: #39444e;
  background: #252d34;
  color: #8795a3;
  opacity: 1;
}

.dashboard-metric-total-cell {
  vertical-align: middle;
}

.dashboard-metric-load-cell {
  text-align: center !important;
}

.dashboard-metric-load-button.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 86px;
  min-height: 28px;
  border: 1px solid var(--primary);
  border-radius: 7px;
  padding: 0 8px;
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
  color: var(--primary);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.dashboard-metric-load-button.secondary-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 30%, transparent);
  outline-offset: 2px;
}

.dashboard-metric-load-button.secondary-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.dashboard-metric-spinner {
  display: none;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
}

.dashboard-metric-load-button.is-loading .dashboard-metric-spinner {
  display: inline-block;
  animation: dashboard-metric-spin 0.7s linear infinite;
}

@keyframes dashboard-metric-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-metric-load-button.is-loading .dashboard-metric-spinner {
    animation: none;
  }
}

@media (max-width: 900px) {
  .dashboard-board-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-hierarchy-table {
    min-width: 820px;
  }

  .dashboard-board-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .dashboard-board-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-board-actions .dashboard-save-status,
  .dashboard-board-actions .control-button.compact {
    grid-column: 1 / -1;
  }

  .dashboard-board-actions .secondary-button,
  .dashboard-board-actions .primary-button,
  .dashboard-board-actions .control-button.compact {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .dashboard-board-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-board-actions .dashboard-save-status,
  .dashboard-board-actions .control-button.compact {
    grid-column: auto;
  }
}

/* D-187: detalle legible y columnas configurables, sin almacenar datos de filas. */
.detail-table-surface {
  min-width: 0;
}

.detail-table-surface > .table-wrap,
.detail-table-surface > .transfer-detail-table-wrap {
  max-width: 100%;
  overflow: auto;
}

.detail-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0 0 12px;
  min-height: 38px;
  position: relative;
  z-index: 8;
}

.detail-column-count {
  color: var(--muted);
  font-size: 0.78rem;
}

.detail-column-count b {
  color: var(--ink);
  font-weight: 700;
}

.detail-column-picker {
  position: relative;
}

.detail-column-picker > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--line));
  border-radius: 9px;
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
  color: var(--primary);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 750;
  list-style: none;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.detail-column-picker > summary::-webkit-details-marker {
  display: none;
}

.detail-column-picker > summary:hover,
.detail-column-picker[open] > summary {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  box-shadow: 0 5px 16px color-mix(in srgb, var(--primary) 16%, transparent);
}

.detail-column-picker > summary:focus-visible,
.detail-action-button:focus-visible,
.detail-column-menu-head button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent);
  outline-offset: 2px;
}

.detail-column-picker > summary svg {
  width: 16px;
  height: 16px;
}

.detail-column-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  width: min(360px, calc(100vw - 48px));
  max-height: min(480px, calc(100vh - 180px));
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail-column-menu-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 10px;
  border-bottom: 1px solid var(--line);
}

.detail-column-menu-head > div {
  display: grid;
  gap: 2px;
}

.detail-column-menu-head strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.detail-column-menu-head span {
  color: var(--muted);
  font-size: 0.72rem;
}

.detail-column-menu-head button {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
}

.detail-column-menu-head button:hover {
  background: color-mix(in srgb, var(--primary) 9%, transparent);
}

.detail-column-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding-top: 10px;
}

.detail-column-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 7px;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.78rem;
}

.detail-column-options label:hover {
  background: var(--surface-soft);
}

.detail-column-options input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--primary);
}

.detail-column-options input:disabled + span {
  color: var(--muted);
}

.detail-column-options span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table[data-detail-table-key] {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

table[data-detail-table-key] th,
table[data-detail-table-key] td {
  min-width: 124px;
  max-width: 280px;
  padding: 10px 12px;
  vertical-align: middle;
}

table[data-detail-table-key] th:first-child,
table[data-detail-table-key] td:first-child {
  min-width: 150px;
}

table[data-detail-table-key] th:last-child,
table[data-detail-table-key] td:last-child {
  min-width: 180px;
}

table[data-detail-table-key] td {
  overflow-wrap: anywhere;
}

.detail-row-actions,
.detail-table-actions,
.transfer-row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.detail-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.1;
  white-space: nowrap;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.detail-action-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 13px rgba(31, 41, 55, 0.1);
}

.detail-action-button.detail-action-primary {
  border-color: color-mix(in srgb, var(--primary) 52%, var(--line));
  background: color-mix(in srgb, var(--primary) 9%, var(--surface));
  color: var(--primary);
}

.detail-action-button.detail-action-primary:hover:not(:disabled) {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 15%, var(--surface));
}

.detail-action-button.detail-action-secondary:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.detail-action-button:disabled {
  cursor: default;
  opacity: 0.48;
}

.detail-action-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.detail-expanded-row > td {
  max-width: none !important;
  padding: 0 !important;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line)) !important;
  background: color-mix(in srgb, var(--primary) 4%, var(--surface-soft));
}

.detail-expanded-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px 16px;
  padding: 16px;
}

.detail-expanded-item {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.detail-expanded-item > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.detail-expanded-value {
  color: var(--ink);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

:root[data-theme="dark"] .detail-column-menu,
:root[data-theme="dark"] .detail-expanded-item,
:root[data-theme="dark"] .detail-action-button {
  background: var(--surface);
}

@media (max-width: 720px) {
  .detail-table-toolbar {
    align-items: stretch;
    justify-content: space-between;
  }

  .detail-column-menu {
    position: fixed;
    top: 88px;
    right: 16px;
    left: 16px;
    width: auto;
  }

  .detail-column-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-expanded-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* D-210: ADMIN Upload Leads. */
.convoso-upload-tabs {
  padding: 2px 0;
}

.convoso-upload-tab {
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  padding: 0 12px;
}

.convoso-upload-tab.active {
  background: #eef4ff;
  border-color: rgba(79, 107, 255, 0.34);
  color: var(--primary);
  font-weight: 800;
}

.convoso-upload-filter-panel {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  align-items: end;
}

.convoso-upload-filter-panel .convoso-upload-search {
  grid-column: span 3;
}

.convoso-upload-filter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.convoso-upload-filter-actions > button {
  min-height: 40px;
}

.convoso-upload-hierarchy-table {
  min-width: 980px;
  table-layout: fixed;
}

.convoso-upload-hierarchy-table th:first-child,
.convoso-upload-hierarchy-table td:first-child {
  width: 48%;
}

.convoso-upload-hierarchy-row td:first-child {
  padding-left: calc(12px + (var(--dashboard-depth, 0) * 24px));
}

.convoso-upload-error-copy,
.convoso-upload-detail-table td small,
.convoso-upload-scope-table td small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
}

.convoso-upload-error-copy b {
  color: #a52f2f;
}

.convoso-upload-detail-table {
  min-width: 1120px;
}

.convoso-upload-detail-table td {
  max-width: 260px;
  padding: 3px 6px;
  vertical-align: middle;
  font-size: 11.5px;
  line-height: 1.08;
}

.convoso-upload-detail-table code,
.convoso-upload-scope-table code {
  display: inline-block;
  border-radius: 5px;
  background: var(--surface-soft);
  padding: 2px 6px;
  color: var(--ink);
  font-size: 11px;
}

.convoso-upload-detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.convoso-upload-status-filters {
  align-items: center;
  margin: 0;
}

#convoso-upload-detail-column-controls {
  flex: 0 0 auto;
}

#convoso-upload-detail-column-controls .detail-table-toolbar {
  margin: 0;
  min-height: 42px;
}

.convoso-upload-scope-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
}

.convoso-upload-scope-toolbar label {
  width: min(520px, 100%);
  margin: 0;
}

.convoso-upload-scope-actions,
.convoso-upload-analytics-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.convoso-upload-scope-actions > button {
  min-height: 40px;
}

.convoso-upload-scope-table {
  min-width: 1450px;
}

.convoso-upload-scope-table td {
  max-width: 260px;
  padding: 3px 6px;
  vertical-align: middle;
  font-size: 11.5px;
  line-height: 1.08;
}

.convoso-upload-scope-table .account-status-switch {
  min-height: 24px;
  padding-block: 2px;
}

.convoso-upload-conflict-row {
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
}

.convoso-upload-scope-rule-table {
  min-width: 980px;
}

.convoso-upload-scope-rule-table th,
.convoso-upload-scope-rule-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.convoso-upload-metric-pending {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.convoso-upload-rows-hidden {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

.convoso-upload-analytics-panel {
  margin-bottom: 14px;
}

.convoso-upload-analytics-meta {
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.convoso-upload-analytics-hierarchy {
  margin-top: 12px;
}

.convoso-upload-scope-table .account-status-switch:disabled {
  cursor: not-allowed;
}

.convoso-upload-scope-modal {
  width: min(900px, 100%);
}

.convoso-upload-scope-modal textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 10px;
  font: inherit;
}

:root[data-theme="dark"] .convoso-upload-tab.active {
  border-color: #758dff;
  background: #293455;
  color: #dce4ff;
}

:root[data-theme="dark"] .convoso-upload-error-copy b {
  color: #ff9d9d;
}

@media (max-width: 900px) {
  .convoso-upload-filter-panel {
    grid-template-columns: repeat(2, minmax(145px, 1fr));
  }

  .convoso-upload-search {
    grid-column: 1 / -1;
  }

  .convoso-upload-filter-actions {
    grid-column: 1 / -1;
  }

  .convoso-upload-scope-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .convoso-upload-detail-actions {
    align-items: stretch;
    flex-direction: column;
  }

  #convoso-upload-detail-column-controls .detail-table-toolbar {
    justify-content: flex-start;
  }

  .convoso-upload-scope-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* D-229: detalle de Agent Performance legible y cargado bajo demanda. */
.lsp-performance-detail-link {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  width: 100%;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--ink, #111827);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.lsp-performance-detail-link:hover,
.lsp-performance-detail-link:focus-visible {
  color: var(--ink, #111827);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lsp-detail-head { gap: 18px; }

.lsp-detail-context {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(4, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.lsp-detail-context > span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 11px;
  border: 1px solid var(--line, #dfe4ea);
  border-radius: 9px;
  background: var(--surface-soft, #f7f9fc);
}

.lsp-detail-context small {
  overflow: hidden;
  color: var(--muted, #62718a);
  font-size: 10px;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: .04em;
}

.lsp-detail-context strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lsp-detail-privacy { margin: 0 0 12px; }
.lsp-performance-detail-table { min-width: 1180px; }
.lsp-performance-detail-table th:nth-child(1) { min-width: 170px; }
.lsp-performance-detail-table th:nth-child(2),
.lsp-performance-detail-table th:nth-child(3),
.lsp-performance-detail-table th:nth-child(4) { min-width: 155px; }
.lsp-performance-detail-table th:nth-child(5) { min-width: 150px; }
.lsp-performance-detail-table th:nth-child(6) { min-width: 120px; }
.lsp-performance-detail-table th:nth-child(8) { width: 138px; }
.lsp-call-summary-row td { vertical-align: middle; }
.lsp-call-summary-row td > strong,
.lsp-call-summary-row td > small { display: block; }
.lsp-call-summary-row td > small {
  margin-top: 3px;
  color: var(--muted, #62718a);
}
.lsp-call-summary-row.is-expanded td {
  background: color-mix(in srgb, var(--accent, #315efb) 6%, var(--surface, #fff));
}
.lsp-call-expanded-row > td {
  padding: 0 !important;
  background: color-mix(in srgb, var(--accent, #315efb) 3%, var(--surface, #fff));
}
.lsp-call-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
  padding: 16px;
  border-top: 2px solid color-mix(in srgb, var(--accent, #315efb) 28%, transparent);
}
.lsp-call-detail-grid > section {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line, #dfe4ea);
  border-radius: 10px;
  background: var(--surface, #fff);
}
.lsp-call-detail-grid > section > strong {
  display: block;
  margin-bottom: 10px;
}
.lsp-call-comment { grid-column: 1 / -1; }
.lsp-call-comment p {
  margin: 0;
  color: var(--muted, #62718a);
  line-height: 1.5;
  white-space: pre-wrap;
}
.lsp-call-collapse { margin: 0 16px 14px; }
/* D-230: visual comun para errores de ejecucion en todas las superficies. */
.execution-error-host {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: inherit !important;
}

.execution-error-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #f4b4b0;
  border-radius: 12px;
  background: #fff5f4;
  color: #8b1f17;
}

.execution-error-card.is-compact {
  gap: 10px;
  padding: 14px;
}

.execution-error-card.lsp-detail-error {
  margin: 0;
}

.execution-error-summary {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
}

.execution-error-summary strong {
  display: block;
  margin: 1px 0 4px;
  color: #7f1d1d;
  font-size: 14px;
}

.execution-error-summary p,
.execution-error-card details {
  margin: 0;
}

.execution-error-summary p {
  color: #9f2f28;
  line-height: 1.45;
}

.execution-error-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  font-weight: 800;
}

.execution-error-actions {
  display: flex;
  gap: 8px;
  padding-left: 41px;
}

.execution-error-card summary {
  width: max-content;
  max-width: 100%;
  cursor: pointer;
  font-weight: 700;
}

.execution-error-card code {
  display: block;
  margin-top: 7px;
  padding: 10px;
  border: 1px solid rgba(139, 31, 23, .2);
  border-radius: 8px;
  background: rgba(255, 255, 255, .66);
  color: #7f1d1d;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

:root[data-theme="dark"] .execution-error-card {
  border-color: rgba(255, 127, 120, .48);
  background: #342120;
  color: #ffc6c2;
}

:root[data-theme="dark"] .execution-error-summary strong,
:root[data-theme="dark"] .execution-error-summary p,
:root[data-theme="dark"] .execution-error-card code {
  color: #ffc6c2;
}

:root[data-theme="dark"] .execution-error-card code {
  border-color: rgba(255, 198, 194, .2);
  background: rgba(0, 0, 0, .16);
}
.lsp-detail-landing-hero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 4px 0 18px;
}
.lsp-detail-landing-hero > div {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 4px 10px;
  align-items: center;
  padding: 17px;
  border: 1px solid var(--line, #dfe4ea);
  border-radius: 12px;
  background: var(--surface-soft, #f7f9fc);
}
.lsp-detail-landing-hero span {
  display: grid;
  grid-row: 1 / span 2;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent, #315efb);
  color: #fff;
  font-weight: 800;
}
.lsp-detail-landing-hero p {
  margin: 0;
  color: var(--muted, #62718a);
  line-height: 1.4;
}
.lsp-detail-landing-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}
:root[data-theme="dark"] .lsp-detail-error {
  border-color: #82423e;
  background: #331d1c;
  color: #ffb5ae;
}
@media (max-width: 980px) {
  .lsp-detail-context,
  .lsp-detail-landing-hero,
  .lsp-call-detail-grid { grid-template-columns: 1fr 1fr; }
  .lsp-call-comment { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .lsp-detail-context,
  .lsp-detail-landing-hero,
  .lsp-call-detail-grid { grid-template-columns: 1fr; }
  .lsp-call-comment { grid-column: auto; }
}
