: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;
}

/* Nota informativa, no una alerta: el desglose por perfil todavia no existe en esas respuestas. */
.dashboard-widget-breakdown-note {
  margin-bottom: 9px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

/* Celda sin desglose compatible: se lee como estado, no como dato ni como fallo. */
.dashboard-metric-no-breakdown {
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
  white-space: nowrap;
}

.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-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;
  }
}

.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: var(--primary);
  border-color: var(--primary);
  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: 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-rule-panel-body {
  padding: 12px;
}

.admin-rule-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-rule-header-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.admin-rule-header-actions button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.admin-rule-group-list {
  display: grid;
  gap: 9px;
}

.admin-rule-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.admin-rule-group > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  background: var(--surface-soft);
}

.admin-rule-group > summary::-webkit-details-marker {
  display: none;
}

.admin-rule-group > summary > span:last-child {
  display: grid;
  gap: 2px;
}

.admin-rule-group > summary b {
  color: var(--ink);
  font-size: 0.92rem;
}

.admin-rule-group > summary small {
  color: var(--muted);
  font-size: 0.74rem;
}

.admin-rule-group-toggle {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  background: var(--surface);
  font-size: 1.25rem;
  transition: transform 160ms ease;
}

.admin-rule-group[open] .admin-rule-group-toggle {
  transform: rotate(90deg);
}

.admin-rule-group-body {
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

.admin-report-group-rule-table {
  table-layout: fixed;
}

.admin-report-group-rule-table th:nth-child(1) { width: 16%; }
.admin-report-group-rule-table th:nth-child(2) { width: 55%; }
.admin-report-group-rule-table th:nth-child(3) { width: 17%; }
.admin-report-group-rule-table th:nth-child(4) { width: 12%; }

.admin-report-group-rule-table td:first-child small,
.admin-rule-always + small {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
}

.admin-rule-filters {
  display: grid;
  gap: 6px;
}

.admin-rule-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-rule-filter {
  display: grid;
  grid-template-columns: minmax(88px, auto) minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  overflow-wrap: anywhere;
  font-size: 0.76rem;
}

.admin-rule-filter > b,
.admin-rule-filter > summary b {
  white-space: nowrap;
  color: var(--muted);
}

.admin-rule-filter-list {
  display: block;
}

.admin-rule-filter-list > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.admin-rule-filter-list > summary::-webkit-details-marker {
  display: none;
}

.admin-rule-filter-list > summary span {
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}

.admin-rule-filter-values {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.admin-rule-filter-values span {
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
}

.admin-rule-filter-generic {
  display: inline-flex;
  color: var(--muted);
}

.admin-rule-always {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  color: #17754c;
  background: #eaf8f1;
  font-weight: 800;
}

.admin-rule-date {
  display: grid;
  gap: 2px;
  margin-bottom: 7px;
}

.admin-rule-date b {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.admin-user-modal.admin-report-group-rule-modal {
  width: min(62rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: hidden;
}

.admin-rule-form {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  max-height: calc(100dvh - 92px);
}

.admin-rule-modal-body {
  display: grid;
  gap: 12px;
  overflow-y: auto;
  padding: 14px;
}

.admin-rule-form-section {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.admin-rule-form-section-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 11px;
}

.admin-rule-form-section-head > span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
}

.admin-rule-form-section-head h4,
.admin-rule-form-section-head small {
  margin: 0;
}

.admin-rule-form-section-head h4 {
  font-size: 0.88rem;
}

.admin-rule-form-section-head small,
.admin-rule-campaign-picker > small {
  color: var(--muted);
  font-size: 0.72rem;
}

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

.admin-rule-filter-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-rule-span-2 {
  grid-column: 1 / -1;
}

.admin-rule-campaign-picker {
  display: grid;
  gap: 8px;
  margin-top: 11px;
}

.admin-rule-campaign-picker-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.admin-rule-campaign-count {
  display: grid;
  justify-items: center;
  min-width: 90px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-rule-campaign-count b {
  color: var(--accent);
  font-size: 1rem;
}

.admin-rule-campaign-count span {
  color: var(--muted);
  font-size: 0.67rem;
}

.admin-rule-campaign-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-rule-campaign-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-width: 0;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
}

.admin-rule-campaign-option:hover {
  border-color: var(--line);
  background: var(--surface-soft);
}

.admin-rule-campaign-option input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
}

.admin-rule-campaign-option span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.admin-rule-campaign-option b,
.admin-rule-campaign-option small {
  overflow-wrap: anywhere;
}

.admin-rule-campaign-option b {
  font-size: 0.76rem;
}

.admin-rule-campaign-option small,
.admin-rule-campaign-empty {
  color: var(--muted);
  font-size: 0.68rem;
}

.admin-rule-campaign-empty {
  padding: 12px;
  text-align: center;
}

.admin-rule-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

@media (max-width: 800px) {
  .admin-rule-filter-grid,
  .admin-rule-campaign-list {
    grid-template-columns: 1fr;
  }

  .admin-report-group-rule-table {
    min-width: 760px;
  }
}

@media (max-width: 600px) {
  .admin-rule-form-grid,
  .admin-rule-campaign-picker-head {
    grid-template-columns: 1fr;
  }

  .admin-rule-span-2 {
    grid-column: auto;
  }

  .admin-rule-campaign-count {
    justify-items: start;
  }
}

.admin-rule-confirm-modal {
  width: min(34rem, calc(100vw - 2rem));
}

.admin-rule-campaign-notice {
  width: min(36rem, calc(100vw - 2rem));
}

.admin-rule-campaign-notice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.admin-rule-campaign-notice-grid > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.admin-rule-campaign-notice-grid span {
  color: var(--muted);
  font-size: 0.72rem;
}

.admin-rule-campaign-notice-grid b {
  color: var(--ink);
  font-size: 1.35rem;
}

.admin-rule-campaign-notice > .inline-alert {
  margin: 0 14px 14px;
}

.admin-rule-campaign-notice > .admin-user-actions {
  padding: 0 14px 14px;
}

@media (max-width: 600px) {
  .admin-rule-header-actions,
  .admin-rule-header-actions button {
    width: 100%;
  }

  .admin-rule-campaign-notice-grid {
    grid-template-columns: 1fr;
  }
}

.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-grid.is-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.leads-load-confirmation-items {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.leads-load-confirmation-items li {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.leads-load-confirmation-hint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.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;
}

/* D-287: propuestas de producto completas y dos distribuciones finales. */
.custom-theme-heading {
  align-items: end;
  gap: 12px;
}

.custom-theme-heading p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.45;
  text-align: right;
}

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

.custom-palette-card {
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 94%, var(--bg));
}

.custom-palette-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(27, 39, 58, .1);
}

.custom-palette-card.is-active {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent), 0 12px 28px rgba(38, 66, 122, .1);
}

.custom-palette-card-head {
  align-items: flex-start;
}

.custom-palette-card-head > span:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.custom-palette-card-head small {
  color: var(--muted);
  font-size: .61rem;
  font-weight: 600;
  line-height: 1.3;
}

.custom-palette-product {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr);
  width: 100%;
  min-height: 112px;
  overflow: hidden;
  border: 1px solid var(--preview-border);
  border-radius: 10px;
  background: var(--preview-bg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--preview-panel) 35%, transparent);
}

.custom-palette-product-nav {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 7px;
  padding: 10px 5px;
  background: var(--preview-nav);
}

.custom-palette-product-nav::before,
.custom-palette-product-nav em {
  width: 9px;
  height: 9px;
  border: 1px solid color-mix(in srgb, var(--preview-nav-text) 40%, transparent);
  border-radius: 3px;
  content: "";
}

.custom-palette-product-nav::before {
  margin-bottom: 4px;
  background: var(--preview-accent);
}

.custom-palette-product-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32%;
  grid-template-rows: 18px 28px 1fr;
  gap: 5px;
  padding: 7px;
}

.custom-palette-product-top {
  grid-column: 1 / -1;
  border-bottom: 1px solid var(--preview-border);
}

.custom-palette-product-top::before,
.custom-palette-product-top::after {
  display: inline-block;
  width: 35%;
  height: 5px;
  margin: 2px 3px 0 0;
  border-radius: 999px;
  background: var(--preview-text);
  content: "";
  opacity: .75;
}

.custom-palette-product-top::after {
  width: 16%;
  background: var(--preview-accent);
}

.custom-palette-product-kpis {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.custom-palette-product-kpis b,
.custom-palette-product-chart,
.custom-palette-product-side {
  border: 1px solid var(--preview-border);
  border-radius: 4px;
  background: var(--preview-panel);
  box-shadow: 0 3px 8px var(--preview-shadow);
}

.custom-palette-product-kpis b::before {
  display: block;
  width: 55%;
  height: 4px;
  margin: 7px 5px;
  border-radius: 999px;
  background: var(--preview-accent);
  content: "";
}

.custom-palette-product-chart {
  display: flex;
  align-items: end;
  justify-content: space-evenly;
  gap: 2px;
  padding: 7px 5px 4px;
}

.custom-palette-product-chart b {
  width: 8%;
  height: 45%;
  border-radius: 2px 2px 0 0;
  background: var(--preview-accent);
}

.custom-palette-product-chart b:nth-child(2) { height: 72%; background: var(--preview-accent-2); }
.custom-palette-product-chart b:nth-child(3) { height: 58%; background: var(--custom-color-3); }
.custom-palette-product-chart b:nth-child(4) { height: 84%; background: var(--custom-color-4); }
.custom-palette-product-chart b:nth-child(5) { height: 66%; background: var(--custom-color-5); }

.custom-palette-product-side::before,
.custom-palette-product-side::after {
  display: block;
  width: 65%;
  height: 5px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: var(--preview-accent-soft);
  content: "";
}

.custom-palette-product-side::after {
  width: 40%;
  margin-top: 6px;
  background: var(--preview-success);
}

.custom-palette-swatches {
  height: 7px;
  border: 0;
  border-radius: 999px;
}

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

.custom-layout-proposal {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.custom-layout-proposal:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
}

.custom-layout-proposal.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 12%, transparent);
}

.custom-layout-proposal .status-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  backdrop-filter: blur(8px);
}

.custom-layout-proposal-preview {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 32%;
  grid-template-rows: 22px 54px;
  gap: 5px;
  min-height: 88px;
  padding: 7px;
  overflow: hidden;
  border-radius: 9px;
  background: #eef2f7;
}

.custom-layout-proposal-preview > i { grid-row: 1 / -1; border-radius: 5px; background: #1b2a3d; }
.custom-layout-proposal-preview > em { display: grid; grid-column: 2 / -1; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.custom-layout-proposal-preview > em b { border-radius: 3px; background: #fff; }
.custom-layout-proposal-preview > strong,
.custom-layout-proposal-preview > small { border-radius: 4px; background: #fff; }
.custom-layout-proposal-preview > strong { grid-column: 2; }
.custom-layout-proposal-preview > small { grid-column: 3; }
.custom-layout-proposal-preview.variant-command {
  grid-template-columns: 31% minmax(0, 1fr);
  grid-template-rows: 18px 28px 37px;
  background: #151c2c;
}
.custom-layout-proposal-preview.variant-command > i { grid-column: 1 / -1; grid-row: 1; background: #29344e; }
.custom-layout-proposal-preview.variant-command > em { grid-column: 1; grid-row: 2 / -1; grid-template-columns: 1fr 1fr; }
.custom-layout-proposal-preview.variant-command > em b { background: #27324a; }
.custom-layout-proposal-preview.variant-command > strong { grid-column: 2; grid-row: 2 / -1; background: linear-gradient(145deg, #293859, #202a40); }
.custom-layout-proposal-preview.variant-command > small { display: none; }

.custom-layout-proposal-copy {
  display: grid;
  gap: 3px;
  padding-right: 2px;
}

.custom-layout-proposal-copy b { font-size: .76rem; }
.custom-layout-proposal-copy small { color: var(--muted); font-size: .63rem; line-height: 1.4; }

.custom-preview-shell {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  min-height: 690px;
  overflow: hidden;
  border-color: var(--preview-border);
  border-radius: 18px;
  background: var(--preview-bg);
  color: var(--preview-text);
  box-shadow: 0 22px 50px var(--preview-shadow);
}

.custom-preview-navigation {
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 14px 8px;
  background: var(--preview-nav);
  color: var(--preview-nav-text);
}

.custom-preview-brand {
  display: grid;
  justify-items: center;
  gap: 4px;
}
.custom-preview-brand i { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid color-mix(in srgb, var(--preview-nav-text) 28%, transparent); border-radius: 8px; background: color-mix(in srgb, var(--preview-accent) 28%, transparent); font-style: normal; }
.custom-preview-brand b { font-size: .46rem; letter-spacing: .04em; text-transform: uppercase; }
.custom-preview-navigation nav { display: grid; gap: 8px; margin-top: 8px; }
.custom-preview-navigation nav span { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; color: color-mix(in srgb, var(--preview-nav-text) 67%, transparent); font-size: .74rem; }
.custom-preview-navigation nav span.active { background: var(--preview-accent-soft); color: var(--preview-accent); }
.custom-preview-avatar { display: grid; place-items: center; width: 29px; height: 29px; margin-top: auto; border: 2px solid color-mix(in srgb, var(--preview-nav-text) 55%, transparent); border-radius: 50%; font-size: .55rem; font-weight: 800; }

.custom-preview-stage { min-width: 0; background: var(--preview-bg); }
.custom-preview-topbar {
  display: grid;
  grid-template-columns: minmax(120px, .7fr) minmax(180px, 1.3fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--preview-border);
  background: var(--preview-panel);
}
.custom-preview-topbar > div:first-child { display: grid; gap: 1px; }
.custom-preview-topbar span { color: var(--preview-muted); font-size: .56rem; }
.custom-preview-topbar strong { color: var(--preview-text); font-size: .72rem; }
.custom-preview-topbar label { display: flex; align-items: center; gap: 7px; min-height: 31px; padding: 0 10px; border: 1px solid var(--preview-border); border-radius: 8px; background: var(--preview-bg); }
.custom-preview-topbar label i { color: var(--preview-muted); font-style: normal; }
.custom-preview-topbar-actions { display: flex; align-items: center; gap: 6px; }
.custom-preview-topbar-actions i { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid var(--preview-border); border-radius: 8px; color: var(--preview-muted); font-style: normal; }
.custom-preview-topbar-actions button,
.custom-preview-hero button { min-height: 30px; padding: 0 10px; border: 1px solid var(--preview-accent); border-radius: 8px; background: var(--preview-accent); color: #fff; font-size: .58rem; font-weight: 800; }

.custom-preview-canvas { display: block; padding: 20px; background: var(--preview-bg); }
.custom-preview-hero { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.custom-preview-hero > div:first-child { display: grid; gap: 4px; }
.custom-preview-hero > div:first-child > span { color: var(--preview-accent); font-size: .52rem; font-weight: 900; letter-spacing: .11em; }
.custom-preview-hero h3 { margin: 0; color: var(--preview-text); font-size: 1.18rem; line-height: 1.1; letter-spacing: -.025em; }
.custom-preview-hero p { margin: 0; color: var(--preview-muted); font-size: .62rem; }
.custom-preview-hero > div:last-child { display: flex; gap: 6px; }
.custom-preview-hero button.ghost { border-color: var(--preview-border); background: var(--preview-panel); color: var(--preview-text); }

.custom-preview-status {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
  padding: 10px 12px;
  border: 1px solid var(--preview-border);
  border-left: 3px solid var(--preview-success);
  border-radius: 10px;
  background: var(--preview-panel);
  box-shadow: 0 8px 22px var(--preview-shadow);
}
.custom-preview-status > i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--preview-accent-soft); color: var(--preview-accent); font-style: normal; font-weight: 900; }
.custom-preview-status > span { display: grid; gap: 2px; }
.custom-preview-status b { font-size: .65rem; }
.custom-preview-status small { color: var(--preview-muted); font-size: .54rem; }
.custom-preview-status em { padding: 5px 7px; border-radius: 999px; background: var(--preview-accent-soft); color: var(--preview-accent); font-size: .48rem; font-style: normal; font-weight: 900; letter-spacing: .04em; }

.custom-preview-content {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.custom-preview-content > [data-custom-preview-element="metrics"] { grid-column: 1 / -1; }
.custom-preview-content > [data-custom-preview-element="main_chart"] { grid-column: 1 / span 3; }
.custom-preview-content > [data-custom-preview-element="distribution"] { grid-column: 4; }
.custom-preview-content > [data-custom-preview-element="legend"] { grid-column: 1 / -1; }
.custom-preview-block { border-color: var(--preview-border); background: var(--preview-panel); box-shadow: 0 8px 22px var(--preview-shadow); }
.custom-preview-metrics article { background: color-mix(in srgb, var(--preview-panel) 93%, var(--preview-accent-soft)); }
.custom-preview-metrics article:first-child { border-left: 3px solid var(--preview-accent); }
.custom-preview-shell.layout-balanced .custom-preview-stage { display: block; }

.custom-preview-shell.layout-immersive {
  grid-template-columns: 1fr;
  grid-template-rows: 54px minmax(0, 1fr);
  border-radius: 24px;
  background: linear-gradient(145deg, var(--preview-bg), color-mix(in srgb, var(--preview-bg) 82%, var(--preview-accent)));
}
.custom-preview-shell.layout-immersive .custom-preview-navigation { flex-direction: row; grid-row: 1; padding: 8px 14px; }
.custom-preview-shell.layout-immersive .custom-preview-brand { display: flex; align-items: center; }
.custom-preview-shell.layout-immersive .custom-preview-navigation nav { display: flex; gap: 5px; margin: 0 0 0 18px; }
.custom-preview-shell.layout-immersive .custom-preview-avatar { margin: 0 0 0 auto; }
.custom-preview-shell.layout-immersive .custom-preview-stage { grid-row: 2; }
.custom-preview-shell.layout-immersive .custom-preview-topbar { grid-template-columns: minmax(180px, 1fr) auto; margin: 12px 16px 0; border: 1px solid var(--preview-border); border-radius: 12px; background: color-mix(in srgb, var(--preview-panel) 92%, transparent); backdrop-filter: blur(12px); }
.custom-preview-shell.layout-immersive .custom-preview-topbar label { display: none; }
.custom-preview-shell.layout-immersive .custom-preview-canvas { padding: 18px 16px 22px; }
.custom-preview-shell.layout-immersive .custom-preview-hero { align-items: center; padding: 7px 5px 3px; }
.custom-preview-shell.layout-immersive .custom-preview-hero h3 { font-size: 1.55rem; }
.custom-preview-shell.layout-immersive .custom-preview-status { border: 0; background: linear-gradient(100deg, var(--preview-accent-soft), var(--preview-panel)); }
.custom-preview-shell.layout-immersive .custom-preview-content { grid-template-columns: minmax(150px, .78fr) minmax(0, 1.35fr) minmax(180px, .9fr); grid-template-rows: auto auto auto; }
.custom-preview-shell.layout-immersive .custom-preview-content > [data-custom-preview-element="main_chart"] { grid-column: 2 / 4; grid-row: 1 / 3; }
.custom-preview-shell.layout-immersive .custom-preview-content > [data-custom-preview-element="metrics"] { grid-column: 1; grid-row: 1; grid-template-columns: 1fr 1fr; }
.custom-preview-shell.layout-immersive .custom-preview-content > [data-custom-preview-element="distribution"] { grid-column: 1; grid-row: 2; }
.custom-preview-shell.layout-immersive .custom-preview-content > [data-custom-preview-element="legend"] { grid-column: 1 / -1; grid-row: 3; }
.custom-preview-shell.layout-immersive .custom-preview-metrics article { min-height: 76px; }
.custom-preview-shell.layout-immersive .custom-bar-chart { height: 286px; }
.custom-preview-shell.layout-immersive [data-custom-preview-element="main_chart"] { border-color: color-mix(in srgb, var(--preview-accent) 40%, var(--preview-border)); box-shadow: 0 20px 42px var(--preview-shadow); }

@media (max-width: 980px) {
  .custom-palette-grid,
  .custom-layout-proposals { grid-template-columns: 1fr; }
  .custom-theme-heading { align-items: flex-start; flex-direction: column; }
  .custom-theme-heading p { text-align: left; }
  .custom-preview-shell { min-width: 700px; }
  .custom-preview-panel .panel-body { overflow-x: auto; }
}

@media (max-width: 620px) {
  .custom-palette-product { min-height: 126px; }
  .custom-preview-shell { min-width: 620px; }
}

.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,
  .leads-load-confirmation-grid.is-two {
    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-lookup {
  display: grid;
  gap: 11px;
  margin-bottom: 14px;
  padding: 13px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
}

.reported-sale-lookup-copy {
  display: grid;
  gap: 3px;
}

.reported-sale-lookup-copy strong {
  color: var(--ink);
  font-size: 14px;
}

.reported-sale-lookup-copy span {
  color: var(--muted);
  font-size: 12px;
}

.reported-sale-lookup-controls {
  display: grid;
  grid-template-columns: minmax(180px, 0.55fr) minmax(280px, 1.45fr) auto;
  align-items: end;
  gap: 10px;
}

.reported-sale-lookup-empty {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 88%, var(--accent-soft));
  color: var(--muted);
  font-size: 13px;
}

.reported-sale-lookup-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.reported-sale-lookup-result {
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) minmax(0, 1.5fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.reported-sale-lookup-result.is-applied {
  border-color: color-mix(in srgb, var(--green) 58%, var(--line));
  box-shadow: inset 3px 0 0 var(--green);
}

.reported-sale-lookup-identity {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.reported-sale-lookup-identity strong,
.reported-sale-lookup-identity span,
.reported-sale-lookup-result dd {
  overflow-wrap: anywhere;
}

.reported-sale-lookup-identity span,
.reported-sale-lookup-result dt {
  color: var(--muted);
  font-size: 11px;
}

.reported-sale-lookup-result dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 10px;
  margin: 0;
}

.reported-sale-lookup-result dl > div {
  min-width: 0;
}

.reported-sale-lookup-result dt,
.reported-sale-lookup-result dd {
  margin: 0;
}

.reported-sale-lookup-result dd {
  margin-top: 2px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.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,
:root[data-theme="dark"] .reported-sale-lookup,
:root[data-theme="dark"] .reported-sale-lookup-result {
  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-lookup-results {
    grid-template-columns: minmax(0, 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-lookup-controls,
  .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-sale-lookup-result {
    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;
}

.reported-sale-form-grid-compact {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.reported-sale-form input[readonly] {
  border-color: color-mix(in srgb, var(--primary) 22%, var(--line));
  background: color-mix(in srgb, var(--primary) 4%, var(--surface));
  color: var(--ink);
  cursor: default;
}

.reported-sale-origin-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}

.reported-sale-origin-status.is-linked {
  border-style: solid;
  border-color: color-mix(in srgb, var(--green) 46%, var(--line));
  box-shadow: inset 3px 0 0 var(--green);
}

.reported-sale-origin-status > div,
.reported-sale-policyholder-toggle span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.reported-sale-origin-status span,
.reported-sale-policyholder-toggle small {
  color: var(--muted);
  font-size: 12px;
}

.reported-sale-policyholder-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.reported-sale-policyholder-toggle input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--primary);
}

.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; }
}

/* D-275: bandeja compartida y liviana de exportaciones. */
.exports-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--line, #dfe4ea);
  border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent, #315efb) 8%, var(--surface, #fff)), var(--surface, #fff));
}
.exports-hero > div { display: flex; gap: 13px; align-items: center; min-width: 0; }
.exports-hero h2, .exports-hero p { margin: 0; }
.exports-hero p { margin-top: 4px; color: var(--muted, #62718a); line-height: 1.4; }
.exports-hero-icon {
  display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px;
  border-radius: 12px; background: var(--accent, #315efb); color: #fff; font-size: 24px;
}
.exports-hero-icon img {
  width: 25px;
  height: 25px;
  object-fit: contain;
  filter: invert(1);
}
.exports-filters {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(170px, .8fr) minmax(240px, 1.5fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}
.exports-filters label { display: grid; gap: 5px; color: var(--muted, #62718a); font-size: 12px; font-weight: 700; }
.exports-filters select, .exports-filters input {
  min-height: 38px; padding: 8px 10px; border: 1px solid var(--line, #dfe4ea);
  border-radius: 9px; background: var(--surface, #fff); color: var(--text, #14213d);
}
.exports-table-wrap { overflow: auto; }
.exports-table { width: 100%; min-width: 1050px; border-collapse: collapse; }
.exports-table th, .exports-table td { padding: 11px 10px; border-bottom: 1px solid var(--line, #dfe4ea); text-align: left; vertical-align: middle; }
.exports-table th { color: var(--muted, #62718a); font-size: 12px; }
.exports-table td strong, .exports-table td small { display: block; }
.exports-table td small { margin-top: 4px; color: var(--muted, #62718a); }
.export-progress { width: 120px; height: 7px; overflow: hidden; border-radius: 999px; background: var(--surface-soft, #edf1f5); }
.export-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #315efb, #45c5b5); }
.download-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 7px 12px; border: 1px solid #315efb; border-radius: 9px;
  background: #315efb; color: #fff; font-weight: 700; cursor: pointer;
}
.download-button:disabled { opacity: .55; cursor: wait; }
.export-wait { color: var(--muted, #62718a); font-size: 12px; }
.export-error { max-width: 260px; color: #b42318 !important; overflow-wrap: anywhere; }
@media (max-width: 780px) {
  .exports-hero { align-items: flex-start; }
  .exports-filters { grid-template-columns: 1fr; }
}
.custom-page-title {
  align-items: flex-start;
}

.customization-guardrail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 36%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
}

.customization-guardrail > div {
  display: grid;
  gap: 4px;
}

.customization-guardrail b {
  color: var(--text);
  font-size: 0.9rem;
}

.customization-guardrail span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.customization-guardrail > span {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  border-radius: 999px;
  color: var(--primary);
  background: var(--surface);
  font-weight: 800;
}

.customization-success {
  margin-bottom: 14px;
  padding: 11px 14px;
  border: 1px solid #a7e3c6;
  border-radius: 12px;
  color: #11764b;
  background: #effbf5;
  font-weight: 700;
}

.customization-workspace {
  display: grid;
  grid-template-columns: minmax(420px, 0.92fr) minmax(520px, 1.08fr);
  align-items: start;
  gap: 18px;
}

.customization-controls {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.custom-settings-panel,
.custom-preview-panel {
  margin: 0;
  overflow: hidden;
}

.custom-settings-panel .panel-body,
.custom-preview-panel .panel-body {
  padding: 16px;
}

.custom-preview-panel {
  position: sticky;
  top: 12px;
}

.custom-theme-section + .custom-theme-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.custom-theme-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.custom-theme-heading > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.custom-theme-heading b {
  font-size: 0.88rem;
}

.custom-theme-heading span {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.custom-palette-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.custom-palette-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.custom-palette-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
}

.custom-palette-card.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 15%, transparent);
}

.custom-palette-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-width: 0;
}

.custom-palette-card-head b {
  overflow: hidden;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-palette-card-head .badge {
  padding: 2px 5px;
  font-size: 0.55rem;
}

.custom-palette-swatches {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 22px;
  overflow: hidden;
  border-radius: 7px;
}

.custom-palette-swatches i {
  background: var(--swatch);
}

.custom-color-details {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
}

.custom-color-details summary {
  padding: 9px 11px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
}

.custom-color-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  padding: 0 10px 10px;
}

.custom-color-input {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.64rem;
}

.custom-color-input > span:last-child {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.custom-color-input input {
  width: 28px;
  height: 28px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}

.custom-color-input code {
  overflow: hidden;
  color: var(--text);
  font-family: inherit;
  font-size: 0.61rem;
  text-overflow: ellipsis;
}

.custom-layout-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 14px;
}

.custom-layout-card {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.custom-layout-card.is-active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 12%, transparent);
}

.custom-layout-card b {
  font-size: 0.76rem;
}

.custom-layout-card > span {
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.35;
}

.custom-layout-icon {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  grid-template-rows: repeat(2, 10px);
  gap: 3px;
  width: 54px;
}

.custom-layout-icon span {
  border-radius: 3px;
  background: color-mix(in srgb, var(--primary) 30%, var(--surface-soft));
}

.custom-layout-icon span:first-child {
  grid-row: 1 / 3;
}

.custom-layout-icon.layout-compact {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 10px;
}

.custom-layout-icon.layout-compact span:first-child {
  grid-row: auto;
}

.custom-layout-icon.layout-immersive {
  grid-template-columns: 2fr 0.6fr;
}

.custom-order-list {
  display: grid;
  gap: 7px;
}

.custom-order-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 26px auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
}

.custom-order-row b {
  font-size: 0.75rem;
}

.custom-order-row > span:nth-child(3) {
  color: var(--muted);
  font-size: 0.7rem;
  text-align: center;
}

.custom-order-row > div {
  display: flex;
  gap: 4px;
}

.custom-order-row .icon-button {
  width: 28px;
  height: 28px;
  min-height: 28px;
}

.custom-order-handle {
  color: var(--muted);
  letter-spacing: -3px;
}

.custom-preview-theme-toggle {
  display: flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
}

.custom-preview-theme-toggle button {
  padding: 6px 9px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 0.69rem;
  font-weight: 800;
  cursor: pointer;
}

.custom-preview-theme-toggle button.active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.08);
}

.custom-preview-shell {
  --preview-bg: #f4f7fb;
  --preview-panel: #ffffff;
  --preview-text: #14213d;
  --preview-muted: #71809a;
  --preview-border: #dfe5ee;
  min-height: 580px;
  overflow: hidden;
  border: 1px solid var(--preview-border);
  border-radius: 18px;
  color: var(--preview-text);
  background: var(--preview-bg);
  box-shadow: 0 18px 40px rgba(24, 39, 75, 0.12);
}

.custom-preview-shell.theme-dark {
  --preview-bg: #111722;
  --preview-panel: #1a2331;
  --preview-text: #f4f7fd;
  --preview-muted: #9caac0;
  --preview-border: #2d394b;
  box-shadow: 0 18px 40px rgba(4, 8, 15, 0.35);
}

.custom-preview-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--preview-border);
  background: var(--preview-panel);
}

.custom-preview-topbar > div:first-child {
  display: grid;
  gap: 2px;
}

.custom-preview-topbar span,
.custom-preview-block-title span {
  color: var(--preview-muted);
  font-size: 0.62rem;
}

.custom-preview-topbar strong {
  font-size: 0.9rem;
}

.custom-preview-topbar-actions {
  display: flex;
  gap: 6px;
}

.custom-preview-topbar-actions i {
  width: 26px;
  height: 26px;
  border: 1px solid var(--preview-border);
  border-radius: 8px;
  background: var(--preview-bg);
}

.custom-preview-canvas {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.custom-preview-block {
  min-width: 0;
  border: 1px solid var(--preview-border);
  border-radius: 13px;
  background: var(--preview-panel);
}

.custom-preview-block-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 13px 0;
}

.custom-preview-block-title > div {
  display: grid;
  gap: 2px;
}

.custom-preview-block-title b {
  font-size: 0.75rem;
}

.custom-preview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  border: 0;
  background: transparent;
}

.custom-preview-metrics article {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--preview-border);
  border-radius: 12px;
  background: var(--preview-panel);
}

.custom-preview-metrics span {
  overflow: hidden;
  color: var(--preview-muted);
  font-size: 0.61rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-preview-metrics strong {
  font-size: 1rem;
}

.custom-preview-metrics small {
  width: fit-content;
  padding: 2px 5px;
  border-radius: 999px;
  color: var(--metric-color);
  background: color-mix(in srgb, var(--metric-color) 12%, transparent);
  font-size: 0.56rem;
  font-weight: 800;
}

.custom-bar-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  height: 188px;
  padding: 20px 16px 13px;
}

.custom-bar-chart > div {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 5px;
  height: 100%;
  text-align: center;
}

.custom-bar-chart i {
  display: block;
  width: min(100%, 34px);
  height: var(--bar-height);
  margin: 0 auto;
  border-radius: 7px 7px 3px 3px;
  background: var(--bar-color);
  opacity: 0.92;
}

.custom-bar-chart span {
  color: var(--preview-muted);
  font-size: 0.55rem;
}

.custom-donut-wrap {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 18px;
}

.custom-donut {
  display: grid;
  place-items: center;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: conic-gradient(var(--custom-color-1) 0 35%, var(--custom-color-2) 35% 62%, var(--custom-color-3) 62% 82%, var(--custom-color-4) 82% 92%, var(--custom-color-5) 92%);
}

.custom-donut::before {
  grid-area: 1 / 1;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--preview-panel);
  content: "";
}

.custom-donut span {
  z-index: 1;
  display: grid;
  grid-area: 1 / 1;
  color: var(--preview-text);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.custom-donut small {
  color: var(--preview-muted);
  font-size: 0.52rem;
  font-weight: 600;
}

.custom-distribution-list {
  display: grid;
  gap: 8px;
}

.custom-distribution-list > div {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--preview-border);
  font-size: 0.65rem;
}

.custom-distribution-list i,
.custom-preview-legend-items i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot);
}

.custom-preview-legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 13px;
}

.custom-preview-legend-items span {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid var(--preview-border);
  border-radius: 999px;
  color: var(--preview-muted);
  font-size: 0.58rem;
}

.custom-preview-shell.layout-compact {
  min-height: 470px;
}

.custom-preview-shell.layout-compact .custom-preview-canvas {
  gap: 8px;
  padding: 10px;
}

.custom-preview-shell.layout-compact .custom-bar-chart {
  height: 130px;
}

.custom-preview-shell.layout-compact .custom-donut {
  width: 88px;
  height: 88px;
}

.custom-preview-shell.layout-compact .custom-donut::before {
  width: 54px;
  height: 54px;
}

.custom-preview-shell.layout-compact .custom-donut-wrap {
  grid-template-columns: 96px minmax(0, 1fr);
  padding: 12px;
}

.custom-preview-shell.layout-immersive .custom-bar-chart {
  height: 270px;
}

.custom-preview-shell.layout-immersive [data-custom-preview-element="main_chart"] {
  border-color: color-mix(in srgb, var(--custom-color-1) 42%, var(--preview-border));
  box-shadow: 0 12px 26px color-mix(in srgb, var(--custom-color-1) 12%, transparent);
}

.custom-save-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 2px 0;
  color: var(--muted);
  font-size: 0.68rem;
}

.custom-save-meta span {
  display: grid;
  gap: 2px;
}

.custom-save-meta b {
  color: var(--text);
}

.customization-actions {
  position: sticky;
  z-index: 10;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
}

.custom-page-title-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.custom-layout-proposal.is-disabled {
  cursor: not-allowed;
  opacity: .62;
}

.custom-layout-proposal.is-disabled:hover {
  transform: none;
  box-shadow: none;
}

/* D-288: diseño CUSTOM activo y reversible para toda la aplicación. */
:root[data-analytics-design-active="true"] body,
:root[data-analytics-design-active="true"] .main,
:root[data-analytics-design-active="true"] .workspace {
  background: var(--bg);
  color: var(--ink);
}

:root[data-analytics-design-active="true"] .sidebar {
  border-color: color-mix(in srgb, var(--custom-navigation-text) 18%, transparent);
  background: var(--custom-navigation);
  color: var(--custom-navigation-text);
  box-shadow: 12px 0 34px color-mix(in srgb, var(--custom-navigation) 18%, transparent);
}

:root[data-analytics-design-active="true"] .brand-text strong,
:root[data-analytics-design-active="true"] .sidebar-footer strong,
:root[data-analytics-design-active="true"] .sidebar-collapse-button,
:root[data-analytics-design-active="true"] .module-button,
:root[data-analytics-design-active="true"] .module-subnav-button {
  color: var(--custom-navigation-text);
}

:root[data-analytics-design-active="true"] .brand-text span,
:root[data-analytics-design-active="true"] .sidebar-footer {
  color: color-mix(in srgb, var(--custom-navigation-text) 70%, transparent);
}

:root[data-analytics-design-active="true"] .module-button:hover:not(.active),
:root[data-analytics-design-active="true"] .module-subnav-button:hover {
  border-color: color-mix(in srgb, var(--custom-navigation-text) 16%, transparent);
  background: color-mix(in srgb, var(--custom-navigation-text) 9%, transparent);
  color: var(--custom-navigation-text);
}

:root[data-analytics-design-active="true"] .module-button.active,
:root[data-analytics-design-active="true"] .module-subnav-button.active {
  border-color: color-mix(in srgb, var(--primary) 60%, var(--custom-navigation));
  background: color-mix(in srgb, var(--primary) 24%, var(--custom-navigation));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--primary);
}

:root[data-analytics-design-active="true"] .module-icon,
:root[data-analytics-design-active="true"] .module-subnav-button.active .module-subnav-icon {
  color: var(--primary);
  background-color: var(--primary);
}

:root[data-analytics-design-active="true"] .module-icon {
  background: color-mix(in srgb, var(--primary) 16%, transparent);
}

:root[data-analytics-design-active="true"] .panel,
:root[data-analytics-design-active="true"] .metric-card,
:root[data-analytics-design-active="true"] .dashboard-widget,
:root[data-analytics-design-active="true"] .dashboard-board-toolbar,
:root[data-analytics-design-active="true"] .analytics-board-toolbar,
:root[data-analytics-design-active="true"] .transfer-dashboard-toolbar {
  border-color: var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

:root[data-analytics-design-active="true"] .primary-button {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 22%, transparent);
}

:root[data-analytics-design-active="true"] .topbar {
  border-color: var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}

:root[data-analytics-design="immersive"] .app-shell,
:root[data-analytics-design="immersive"] .app-shell.sidebar-collapsed,
:root[data-analytics-design="immersive"] .app-shell.transfer-detail-rail-closed,
:root[data-analytics-design="immersive"] .app-shell.module-detail-rail-active {
  grid-template-columns: minmax(0, 1fr) 0 !important;
  grid-template-rows: 72px minmax(0, 1fr);
}

:root[data-analytics-design="immersive"] .sidebar,
:root[data-analytics-design="immersive"] .app-shell.sidebar-collapsed .sidebar {
  position: fixed;
  inset: 0 0 auto 0;
  width: 100vw;
  height: 72px;
  padding: 8px 14px;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  overflow: visible;
  border-right: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--custom-navigation-text) 18%, transparent);
  box-shadow: 0 14px 32px color-mix(in srgb, var(--custom-navigation) 22%, transparent);
}

:root[data-analytics-design="immersive"] .brand {
  flex: 0 0 170px;
  min-height: 48px;
}

:root[data-analytics-design="immersive"] .module-nav {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
}

:root[data-analytics-design="immersive"] .module-nav::-webkit-scrollbar {
  display: none;
}

:root[data-analytics-design="immersive"] .module-nav-group {
  position: relative;
  display: block;
  flex: 0 0 auto;
}

:root[data-analytics-design="immersive"] .module-button,
:root[data-analytics-design="immersive"] .module-button.has-submenu {
  width: auto;
  min-width: 44px;
  min-height: 46px;
  grid-template-columns: 25px auto 10px;
  grid-template-areas: "icon label toggle";
  padding: 6px 9px;
}

:root[data-analytics-design="immersive"] .module-button b,
:root[data-analytics-design="immersive"] .sidebar-footer,
:root[data-analytics-design="immersive"] .sidebar-control {
  display: none;
}

:root[data-analytics-design="immersive"] .module-subnav {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 40;
  width: max-content;
  min-width: 210px;
  max-width: 320px;
  margin: 0;
  padding: 9px;
  border: 1px solid color-mix(in srgb, var(--custom-navigation-text) 18%, transparent);
  border-radius: 12px;
  background: var(--custom-navigation);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .28);
}

:root[data-analytics-design="immersive"] .module-subnav::before {
  display: none;
}

:root[data-analytics-design="immersive"] .main {
  grid-column: 1;
  grid-row: 2;
  border-right: 0;
}

:root[data-analytics-design="immersive"] .topbar {
  top: 72px;
  margin: 12px 16px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}

:root[data-analytics-design="immersive"] .workspace {
  padding-top: 18px;
}

:root[data-analytics-design="immersive"] .detail-rail {
  position: fixed;
  top: 84px;
  right: 0;
  bottom: 0;
  z-index: 30;
  width: var(--detail-rail-width);
  box-shadow: -18px 0 40px rgba(0, 0, 0, .16);
}

.customization-guardrail.is-publishable {
  border-color: color-mix(in srgb, var(--primary) 32%, var(--line));
  background: linear-gradient(100deg, color-mix(in srgb, var(--primary) 9%, var(--surface)), var(--surface));
}

@media (max-width: 980px) {
  :root[data-analytics-design="immersive"] .brand {
    flex-basis: 58px;
  }

  :root[data-analytics-design="immersive"] .brand-text,
  :root[data-analytics-design="immersive"] .module-button > span:not(.module-icon):not(.module-expand-indicator) {
    display: none;
  }

  :root[data-analytics-design="immersive"] .module-button,
  :root[data-analytics-design="immersive"] .module-button.has-submenu {
    grid-template-columns: 26px 9px;
    grid-template-areas: "icon toggle";
  }
}

@media (max-width: 1240px) {
  .customization-workspace {
    grid-template-columns: 1fr;
  }

  .custom-preview-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .customization-guardrail,
  .custom-save-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .custom-palette-grid,
  .custom-layout-grid {
    grid-template-columns: 1fr;
  }

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

  .custom-preview-panel .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .custom-preview-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .custom-donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .custom-distribution-list {
    width: 100%;
  }
}

/* Contactabilidad de Leads Unicos: encabezado, popover de filtros y estado de carga.
   El resumen del periodo vive a la IZQUIERDA, bajo el titulo; a la derecha solo quedan la chapa de
   actualizacion y el boton. Antes competian los cinco por la misma linea horizontal. */
.wulc-runtime { position: relative; display: inline-flex; align-items: center; }
.wulc-runtime-summary { font-variant-numeric: tabular-nums; }

.wulc-runtime-toggle { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.wulc-funnel {
  width: 11px; height: 11px; flex: 0 0 11px;
  clip-path: polygon(0 0, 100% 0, 62% 48%, 62% 100%, 38% 86%, 38% 48%);
  background: currentColor;
}
.wulc-runtime-count {
  min-width: 1.05rem; padding: 0 .25rem; border-radius: 999px;
  font-size: .68rem; line-height: 1.05rem; text-align: center;
  background: currentColor; color: var(--surface, #fff);
}
.wulc-runtime-toggle.active { border-color: currentColor; }

/* Estado de actualizacion: DOS filas. Arriba cuando toca la proxima, abajo cuando fue la ultima.
   Una sola de las dos contaba media verdad. */
.wulc-refresh-block {
  display: inline-grid; gap: .05rem; justify-items: end;
  padding: .18rem .5rem; border-radius: .4rem;
  border: 1px solid var(--border, rgba(0,0,0,.14));
  font-size: .7rem; line-height: 1.25; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.wulc-refresh-next { font-weight: 600; }
.wulc-refresh-last { opacity: .65; }
.wulc-refresh-last:empty { display: none; }
.wulc-refresh-block.error { border-color: #c2410c; color: #c2410c; }

/* Los cuatro botones -Filtros, Restablecer, Expandir todo, Contraer todo- son la misma pieza:
   mismo alto, radio, relleno, tipografia, hover, foco y estado deshabilitado. */
.wulc-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  height: 1.75rem; padding: 0 .55rem;
  border: 1px solid var(--border, rgba(0,0,0,.18)); border-radius: .4rem;
  background: var(--surface, #fff); color: inherit;
  font: inherit; font-size: .74rem; white-space: nowrap; cursor: pointer;
}
.wulc-chip:hover { border-color: currentColor; }
.wulc-chip:focus-visible { outline: 2px solid Highlight; outline-offset: 1px; }
.wulc-chip:disabled { opacity: .55; cursor: not-allowed; }
.wulc-chip.active { border-color: currentColor; background: rgba(0,0,0,.05); }
.wulc-chip-icon { width: 10px; height: 10px; flex: 0 0 10px; background: currentColor; }
.wulc-icon-funnel { clip-path: polygon(0 0, 100% 0, 62% 48%, 62% 100%, 38% 86%, 38% 48%); }
.wulc-icon-reset { clip-path: polygon(50% 0, 50% 22%, 100% 22%, 100% 100%, 0 100%, 0 22%, 50% 22%, 20% 0); }
.wulc-icon-expand { clip-path: polygon(50% 100%, 0 40%, 22% 22%, 50% 55%, 78% 22%, 100% 40%); }
.wulc-icon-collapse { clip-path: polygon(50% 0, 100% 60%, 78% 78%, 50% 45%, 22% 78%, 0 60%); }
.dashboard-hierarchy-tools > div { display: inline-flex; gap: .35rem; }

.wulc-runtime-popover {
  position: absolute; top: calc(100% + .4rem); right: 0; z-index: 40;
  width: 336px; max-width: calc(100vw - 2rem);
  display: grid; gap: .6rem; padding: .85rem;
  border: 1px solid var(--border, rgba(0,0,0,.15)); border-radius: .6rem;
  background: var(--surface, #fff); box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.wulc-runtime-popover[hidden] { display: none; }
.wulc-runtime-head {
  font-weight: 600; font-size: .82rem;
  padding-bottom: .5rem; border-bottom: 1px solid var(--border, rgba(0,0,0,.12));
}
.wulc-field { display: grid; gap: .25rem; }
.wulc-field-label { font-size: .72rem; opacity: .75; }

/* Los cuatro controles comparten alto, relleno, radio y foco. */
.wulc-select, .wulc-segment {
  height: 2.15rem; padding: 0 .55rem;
  border: 1px solid var(--border, rgba(0,0,0,.18)); border-radius: .4rem;
  background: var(--surface, #fff); color: inherit; font-size: .8rem;
}
.wulc-select { width: 100%; }
.wulc-select:hover, .wulc-segment:hover { border-color: currentColor; }
.wulc-select:focus-visible, .wulc-segment:focus-visible, .wulc-runtime-toggle:focus-visible {
  outline: 2px solid Highlight; outline-offset: 1px;
}
.wulc-select:disabled, .wulc-segment:disabled { opacity: .55; cursor: not-allowed; }

.wulc-segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .3rem; }
.wulc-segment { cursor: pointer; }
.wulc-segment.active { background: rgba(0,0,0,.06); border-color: currentColor; font-weight: 600; }

.wulc-runtime-actions {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  padding-top: .6rem; border-top: 1px solid var(--border, rgba(0,0,0,.12));
}

/* Encabezado generico por visual. Mismas piezas que Contactabilidad, pero una fuente puede
   declarar cinco filtros en vez de cuatro: con un viewport bajo el pie con Aplicar quedaba por
   debajo del borde. Aqui cabecera y pie se quedan fijos y solo los campos desplazan. El
   modificador no toca el popover de Contactabilidad. */
.wulc-runtime-popover--scroll {
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(calc(100vh - 7rem), 34rem);
}
.wulc-runtime-body {
  display: grid; gap: .6rem; min-height: 0; overflow-y: auto;
  /* Deja sitio al anillo de foco de los controles, que overflow recortaria. */
  padding: 2px; margin: -2px;
}
/* Desde y Hasta son un rango: en una fila ocupan lo que un solo campo. */
.wulc-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.wulc-field-row > .wulc-select { min-width: 0; }

/* Multiseleccion universal: la misma familia que los selects de Contactabilidad. La lista se abre
   dentro del cuerpo desplazable del popover, con su propio alto maximo: un catalogo largo no empuja
   el pie con Aplicar fuera del viewport. */
.wulc-multi { position: relative; }
.wulc-multi-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: .4rem;
  text-align: left; cursor: pointer; min-width: 0;
}
.wulc-multi-summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.wulc-multi-trigger[aria-expanded="true"] { border-color: currentColor; }
.wulc-multi-panel {
  display: grid; gap: .35rem; margin-top: .25rem; padding: .45rem;
  border: 1px solid var(--border, rgba(0,0,0,.18)); border-radius: .4rem;
  background: var(--surface, #fff);
}
.wulc-multi-panel[hidden] { display: none; }
.wulc-multi-bulk { display: flex; justify-content: space-between; gap: .5rem; font-size: .74rem; }
.wulc-multi-options { display: grid; gap: .1rem; max-height: 11rem; overflow-y: auto; padding: 2px; }
.wulc-multi-option {
  display: flex; align-items: center; gap: .45rem; padding: .22rem .3rem;
  border-radius: .3rem; font-size: .78rem; cursor: pointer; min-width: 0;
}
.wulc-multi-option[hidden] { display: none; }
.wulc-multi-option span { overflow-wrap: anywhere; }
.wulc-multi-option:hover { background: rgba(0,0,0,.05); }
.wulc-multi-option input:focus-visible { outline: 2px solid Highlight; outline-offset: 1px; }
.wulc-multi-empty { font-size: .74rem; opacity: .7; padding: .2rem .3rem; }
.wulc-runtime-error { margin: 0; font-size: .75rem; color: var(--danger, #b42318); }
.wulc-apply { display: inline-flex; align-items: center; gap: .35rem; }
.wulc-apply:disabled { opacity: .7; cursor: progress; }

/* Estado de carga: el overlay se pone ENCIMA, nunca en lugar de, los datos anteriores. */
.dashboard-widget-body.is-busy { position: relative; }
.wulc-loading-overlay {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  font-size: .8rem; font-weight: 500;
  background: color-mix(in srgb, var(--surface, #fff) 72%, transparent);
  backdrop-filter: blur(1px);
}
.wulc-spinner {
  width: 14px; height: 14px; flex: 0 0 14px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: dashboard-metric-spin .7s linear infinite;
}
.wulc-spinner-inline { display: none; width: 11px; height: 11px; flex: 0 0 11px; }
.wulc-apply.is-loading .wulc-spinner-inline { display: inline-block; }

/* En visuales estrechas se sacrifica el resumen, luego la etiqueta de la chapa, y nunca el boton.
   La consulta es sobre el ANCHO DE LA VISUAL: una de un tercio aprieta igual en una pantalla
   grande, y con @media eso no se veia. */
.wulc-widget .dashboard-widget-head { container-type: inline-size; }
.dashboard-widget .dashboard-widget-head { container-type: inline-size; }

/* Contrato 09: TODA visual muestra las dos filas -proxima y actualizado hace-, tambien estrecha.
   En vez de esconder una, las acciones pasan a su propia linea bajo el titulo y el bloque de
   frescura va primero, sin montarse sobre Filtros ni sobre los botones de edicion. */
.dashboard-widget-head { flex-wrap: wrap; row-gap: 6px; }
@container (max-width: 620px) {
  .dashboard-widget-actions { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; position: relative; }
  .dashboard-widget-actions .wulc-refresh-block { margin-right: auto; justify-items: start; }
  /* Con las acciones en su propia linea, el popover se ancla a esa linea y no al boton: si el
     boton queda a la izquierda, anclarlo a el sacaba el popover por el borde izquierdo (430 px). */
  .dashboard-widget-actions .wulc-runtime { position: static; }
  .dashboard-widget-actions .wulc-runtime-popover { right: 0; left: auto; max-width: 100%; }
}
@container (max-width: 480px) {
  .wulc-runtime-summary { display: none; }
}

/* Sin soporte de container queries se conserva el comportamiento anterior. */
@supports not (container-type: inline-size) {
  @media (max-width: 900px) { .wulc-runtime-summary { display: none; } }
}

.wulc-error-notice {
  display: flex; align-items: center; gap: .5rem;
  margin: 0 0 .5rem; padding: .35rem .55rem;
  border: 1px solid #c2410c; border-radius: .35rem;
  color: #c2410c; font-size: .74rem;
}

/* Admin Listas y Campanas. Reutiliza la familia de Admin > Usuarios: mismo panel, misma toolbar,
   misma tabla, mismo modal. Aqui solo vive lo especifico de esta pantalla. */

/* La tabla es mas estrecha que la de usuarios: ocho columnas, ninguna de ellas ancha. */
.admin-listmap-table { min-width: 980px; }

/* Densidad: la de Admin > Usuarios, sin retoques. Medido con pixeles reales, una fila de
   Usuarios con badge y accion mide 52px y esta hereda 51px. Bajarla a 6px de relleno daba 43px
   -mas compacta, si, pero era inventarse una densidad nueva para esta pantalla sola. */

.listmap-id { font-variant-numeric: tabular-nums; white-space: nowrap; }
.listmap-secundaria { color: var(--muted); white-space: nowrap; }
.listmap-vacio { color: var(--muted); font-style: italic; }

/* Las que piden trabajo se ven sin tener que leer la tabla entera. Ambar, no rojo: quedan por
   asignar, no estan rotas. */
.listmap-pendiente > th,
.listmap-pendiente > td { background: rgba(180, 83, 9, .05); }

/* El contador de pendientes es tambien el atajo para verlas. */
.listmap-badge-filtro {
  border: 0; background: none; padding: 0; cursor: pointer; line-height: 1;
  border-radius: 999px;
}
.listmap-badge-filtro:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 2px; }
.listmap-badge-filtro:hover .badge { filter: brightness(.96); }

.admin-listmap-toolbar { flex-wrap: wrap; justify-content: flex-start; }
.admin-listmap-toolbar .drawer-field { width: min(320px, 100%); }
/* El buscador ocupa el hueco sobrante, pero SIN flex-basis: en movil la familia pone la toolbar
   en columna, y una base de 260px deja de ser ancho para convertirse en ALTO. El buscador crecia
   a 136px frente a los 34px de los dos desplegables, con un hueco enorme bajo su etiqueta.
   min-width hace el mismo trabajo en horizontal y no significa nada en vertical. */
.admin-listmap-toolbar .drawer-field:first-child {
  width: min(420px, 100%);
  flex-grow: 1;
  min-width: min(260px, 100%);
}

/* Reutilizar la familia de Usuarios trae una regla que aqui estorba: alli la primera celda apila
   nombre y correo con display:grid, y una celda en grid deja de ser celda -- el colspan de la fila
   de vacio se perdia y su contenido se encajonaba en 171px, con el boton fuera de la vista.
   No se ve leyendo el DOM: el colspan estaba puesto y el boton existia. Se vio midiendo. */
.admin-listmap-table td:first-child { display: table-cell; }

/* Los dos vacios de esta pantalla necesitan aire: heredados tal cual quedaban como una linea de
   texto gris pegada al borde, indistinguible de una tabla que no cargo. */
.admin-listmap .filter-empty-state {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 28px 16px; text-align: center;
}
/* Que no quede ninguna sin mapear es una buena noticia, no un resultado vacio. */
.admin-listmap .filter-empty-state.listmap-vacio-ok { color: var(--ok, #15803d); font-weight: 500; }

/* El ID de lista se ve, pero no se toca. Sin esto se dibujaba igual que los dos campos de al
   lado -mismo fondo, mismo color- e invitaba a escribir justo en el campo que es la identidad. */
.admin-listmap-modal input[readonly] {
  background: var(--soft, rgba(15, 23, 42, .04));
  color: var(--muted);
  cursor: default;
}

/* Campos informativos del modal: tienen la altura de un input para que la rejilla no salte. */
.listmap-informativo {
  display: flex; align-items: center; min-height: 34px;
  color: var(--muted); font-size: .82rem;
}

.listmap-spinner {
  display: inline-block; width: .72rem; height: .72rem; margin-right: .4rem;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  vertical-align: -.1rem; animation: listmap-gira .7s linear infinite;
}
@keyframes listmap-gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .listmap-spinner { animation: none; }
}

/* En pantallas estrechas se retiran las columnas de apoyo -origen, deteccion, actualizado- y
   quedan las cinco que permiten trabajar: ID, nombre, campana, estado y la accion. */
@media (max-width: 900px) {
  .admin-listmap-table { min-width: 0; }
  .admin-listmap-table .listmap-secundaria { display: none; }
  .admin-listmap-toolbar .drawer-field,
  .admin-listmap-toolbar .drawer-field:first-child { width: 100%; }
}

/* Upload Leads vNext (pase 21): cabecera compacta, KPIs con drill-through, proceso y filtros por fecha y hora.
   Mismo sistema visual que el resto de Analytics: metric-card, badge, wulc-field y wulc-refresh-block. */
.convoso-upload-monitor-header { padding: 8px 12px; }
.convoso-upload-monitor-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.convoso-upload-monitor-range { min-width: 0; overflow-wrap: anywhere; }
.convoso-upload-monitor-actions { display: inline-flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.convoso-upload-monitor-filters { margin-top: 10px; border-top: 1px solid var(--line, #e5e7eb); padding-top: 10px; }
.convoso-upload-monitor-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 10px;
}
.convoso-upload-datetime { display: flex; gap: 6px; min-width: 0; }
.convoso-upload-datetime input { min-width: 0; flex: 1 1 0; }
.convoso-upload-kpis { grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr)); }
.convoso-upload-drill {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.convoso-upload-drill:disabled { cursor: default; text-decoration: none; }
.convoso-upload-drill:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 2px; }
.convoso-upload-process-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.convoso-upload-process-node {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 4px 8px 4px calc(8px + var(--convoso-upload-depth, 0) * 18px);
  border-left: 2px solid var(--line, #e5e7eb);
}
.convoso-upload-process-label { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .convoso-upload-monitor-actions { margin-left: 0; }
  .convoso-upload-process-node { padding-left: calc(6px + var(--convoso-upload-depth, 0) * 10px); }
}

/* Pase 24 — paneles flotantes genericos: listas categoricas y menu de columnas no participan del flujo. */
.crm-floating-panel {
  position: fixed;
  z-index: 1400;
  margin: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #d8dee8);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}
.wulc-multi-panel.crm-floating-panel { padding: .5rem; }
.wulc-multi-panel.crm-floating-panel .wulc-multi-options { max-height: none; }
.detail-column-menu.crm-floating-panel { top: auto; right: auto; }

/* Detalle error: una sola linea, sin salto; el detalle tecnico queda para auditoria. */
.convoso-upload-error-cell { white-space: nowrap; max-width: 260px; }
.convoso-upload-error-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Detalle de compras: el contador y Columnas a la derecha de la cabecera. */
.convoso-upload-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.convoso-upload-detail-head-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.convoso-upload-detail-head-actions .detail-table-toolbar { position: static; margin: 0; padding: 0; border: 0; background: none; display: flex; align-items: center; gap: 10px; }
.convoso-upload-export-notice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 10px; border-radius: 6px; background: var(--surface-muted, #f3f6fa); }
.detail-column-global { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px 0 8px; border-bottom: 1px solid var(--border, #d8dee8); }
.detail-column-global-status { font-size: 12px; color: var(--muted, #5b6472); }

/* Proceso de carga: tarjetas en cascada con barra proporcional (sin Sankey). */
.convoso-upload-flow-level { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.convoso-upload-flow-level[data-depth]:not([data-depth="0"]) { padding-left: 18px; margin-top: 8px; border-left: 2px solid var(--border, #d8dee8); }
.convoso-upload-flow-card { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 12px; padding: 8px 12px; border: 1px solid var(--border, #d8dee8); border-radius: 8px; background: var(--surface, #fff); }
.convoso-upload-flow-label { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.convoso-upload-flow-share { font-size: 12px; color: var(--muted, #5b6472); }
.convoso-upload-flow-bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--surface-muted, #eef2f7); overflow: hidden; }
.convoso-upload-flow-bar i { display: block; height: 100%; background: var(--accent, #3b6fd8); }
.convoso-upload-flow-card[data-tone="ok"] .convoso-upload-flow-bar i { background: var(--ok, #2f8f5b); }
.convoso-upload-flow-card[data-tone="warn"] .convoso-upload-flow-bar i { background: var(--warn, #b7791f); }
.convoso-upload-flow-card[data-tone="bad"] .convoso-upload-flow-bar i { background: var(--bad, #c24141); }
.convoso-upload-flow-compact .convoso-upload-flow-card { padding: 6px 10px; }

/* Visual de Analytics "Carga de leads". */
.lead-upload-flow-widget { display: grid; gap: 12px; }
.lead-upload-flow-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.lead-upload-flow-kpi { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--border, #d8dee8); border-radius: 8px; }
.lead-upload-flow-kpi-label { font-size: 12px; color: var(--muted, #5b6472); }
.lead-upload-flow-kpi-value { font-size: 18px; font-weight: 700; }

@media (max-width: 640px) {
  .convoso-upload-detail-head-actions { margin-left: 0; justify-content: flex-start; }
  .convoso-upload-flow-level[data-depth]:not([data-depth="0"]) { padding-left: 10px; }
  .convoso-upload-flow-card { grid-template-columns: minmax(0, 1fr) auto; }
  .convoso-upload-flow-share { display: none; }
}

/* ------------------------------------------------------------------------------------------
   Centro de Transferencias · rediseno de Detalle, cajon, QA y solicitudes (d344).
   Referencia: detalle_transferencia_manager_v4.html (jerarquia, espacios y distribucion; nunca
   datos). Solo presentacion: ningun id, data-* ni contrato de formulario cambia.
   ------------------------------------------------------------------------------------------ */

/* Tabla de detalle */
.transfer-detail-list-panel { border-radius: 12px; overflow: hidden; }
.transfer-detail-list-panel .transfer-detail-table thead th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}
.transfer-detail-list-panel .transfer-detail-table td { padding: 11px 12px; vertical-align: middle; }
.transfer-detail-list-panel .transfer-detail-table td:first-child strong { color: var(--primary); font-weight: 780; font-variant-numeric: tabular-nums; }
.transfer-detail-list-panel .transfer-detail-table td:nth-child(4) { font-weight: 650; }
.transfer-detail-list-panel .transfer-detail-table-row.active td { background: var(--primary-soft, rgba(79, 107, 255, 0.08)); }
.transfer-detail-list-panel .transfer-detail-table-row.active td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
/* Cotizacion y Venta: texto Si/No como en la referencia (mismo valor, mismo dato). */
.transfer-detail-list-panel .transfer-detail-table td:nth-child(9) .badge,
.transfer-detail-list-panel .transfer-detail-table td:nth-child(10) .badge {
  background: transparent;
  border: 0;
  padding: 0;
  font-weight: 650;
  color: var(--muted);
}
.transfer-detail-list-panel .transfer-detail-table td:nth-child(9) .badge.ok,
.transfer-detail-list-panel .transfer-detail-table td:nth-child(10) .badge.ok { color: var(--green); font-weight: 750; }
.transfer-detail-list-panel .transfer-detail-actions-cell { display: flex; gap: 6px; }
.transfer-detail-list-panel .transfer-detail-actions-cell .detail-action-button { padding: 6px 9px; font-size: 12px; border-radius: 8px; }

/* Cajon de detalle: superpuesto con fondo, anchura segun pantalla */
.transfer-rail-backdrop { position: fixed; inset: 0; z-index: 45; background: rgba(15, 32, 72, 0.22); }
@media (min-width: 981px) {
  .app-shell.transfer-detail-rail-active:not(.transfer-detail-rail-expanded) { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .app-shell.sidebar-collapsed.transfer-detail-rail-active:not(.transfer-detail-rail-expanded) { grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr); }
  .app-shell.transfer-detail-rail-active:not(.transfer-detail-rail-expanded) .detail-rail {
    position: fixed;
    grid-column: auto;
    top: 0;
    right: 0;
    width: 500px;
    height: 100dvh;
    z-index: 50;
    background: var(--surface);
    box-shadow: 0 16px 44px rgba(16, 32, 72, 0.15);
  }
}
@media (min-width: 1440px) {
  .app-shell.transfer-detail-rail-active:not(.transfer-detail-rail-expanded) .detail-rail { width: 620px; }
}
@media (min-width: 1800px) {
  .app-shell.transfer-detail-rail-active:not(.transfer-detail-rail-expanded) .detail-rail { width: 720px; }
  .app-shell.transfer-detail-rail-active .tdr-layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); column-gap: 32px; }
  .app-shell.transfer-detail-rail-active .tdr-layout .tdr-section { border-top: 0; }
}
@media (max-width: 980px) {
  .app-shell.transfer-detail-rail-active .detail-rail { width: min(500px, 100vw); z-index: 50; }
}
@media (max-width: 640px) {
  .app-shell.transfer-detail-rail-active .detail-rail { width: 100vw; }
}

/* Contenido del cajon */
.tdr-result { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.tdr-result-copy small { display: block; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 5px; }
.tdr-result-copy strong { font-size: 20px; line-height: 1.25; }
.tdr-duration { text-align: right; min-width: 92px; }
.tdr-duration span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.tdr-duration strong { font-size: 19px; font-variant-numeric: tabular-nums; }
.tdr-tracking { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 0; }
.tdr-tracking-item { border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: var(--surface-soft); }
.tdr-tracking-item span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.tdr-tracking-item strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.tdr-layout { display: grid; grid-template-columns: minmax(0, 1fr); }
.tdr-section { padding: 16px 0; border-top: 1px solid var(--line); }
.tdr-section:first-child { border-top: 0; }
.tdr-full { grid-column: 1 / -1; display: grid; gap: 10px; padding-top: 8px; }
.tdr-section-title { font-size: 13px; font-weight: 780; margin: 0 0 11px; }
.tdr-participants { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: center; }
.tdr-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tdr-person strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tdr-person span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.tdr-avatar { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; background: var(--primary-soft, rgba(79, 107, 255, 0.12)); color: var(--primary); display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.tdr-handoff { color: var(--muted); font-size: 18px; }
.tdr-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.tdr-info-item { padding: 9px 0; border-bottom: 1px solid var(--line); }
.tdr-info-grid .tdr-info-item:nth-last-child(-n+2) { border-bottom: 0; }
.tdr-info-item span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.tdr-info-item strong { font-size: 13px; font-weight: 680; }
.tdr-yes { color: var(--green); }
.tdr-no { color: var(--muted); }
.tdr-review-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tdr-review-summary { display: grid; grid-template-columns: 1fr 1fr; }
.tdr-review-state { padding: 12px 13px; }
.tdr-review-state + .tdr-review-state { border-left: 1px solid var(--line); }
.tdr-review-state span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.tdr-review-state strong { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.tdr-dot { width: 8px; height: 8px; border-radius: 50%; background: #a8b0bd; }
.tdr-dot.good { background: var(--green); }
.tdr-dot.warning { background: var(--amber); }
.tdr-review-details { border-top: 1px solid var(--line); padding: 4px 13px; background: var(--surface-soft); display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.tdr-review-details .tdr-info-item { border-bottom: 0; }
.tdr-review-empty { border-top: 1px solid var(--line); padding: 11px 13px; color: var(--muted); font-size: 12px; background: var(--surface-soft); }
.tdr-qa-entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px; }
.tdr-qa-entry strong { display: block; font-size: 13px; }
.tdr-qa-entry span { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
@media (max-width: 640px) {
  .tdr-participants { grid-template-columns: 1fr; }
  .tdr-handoff { display: none; }
  .tdr-info-grid, .tdr-review-summary, .tdr-review-details { grid-template-columns: 1fr; }
  .tdr-review-state + .tdr-review-state { border-left: 0; border-top: 1px solid var(--line); }
  .tdr-qa-entry { flex-direction: column; align-items: flex-start; }
  .tdr-qa-entry .primary-button { width: 100%; }
}

/* Modal QA y solicitudes */
.qa-workflow-modal { border-radius: 14px; }
@media (min-width: 1440px) { .qa-workflow-modal { width: min(1120px, 88vw); } }
@media (min-width: 1800px) { .qa-workflow-modal { width: min(1240px, 82vw); } }
.qa-modal-tabs { gap: 2px; padding: 0 18px; }
.qa-modal-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 11px 12px;
  font-weight: 720;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.qa-modal-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.qa-modal-tab-count { padding: 2px 6px; border-radius: 999px; font-size: 11px; background: var(--primary-soft, rgba(79, 107, 255, 0.12)); color: var(--primary); }
.qa-modal-body { padding: 16px 18px 20px; }
.qa-evaluation-form .qa-criteria-list { display: grid; }
.qa-evaluation-form .qa-criterion {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px minmax(0, 240px);
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.qa-evaluation-form .qa-criterion:last-child { border-bottom: 0; }
.qa-evaluation-form .qa-criterion-copy strong { display: block; font-size: 13px; }
.qa-evaluation-form .qa-criterion-copy span { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.qa-history-section { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.qa-history-list { display: grid; gap: 6px; }
.qa-request-workspace { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 18px; align-items: start; }
.qa-request-form-card, .qa-request-list-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.qa-request-form-card { padding: 16px; position: sticky; top: 0; }
.qa-request-form-card h4, .qa-request-list-head h3 { margin: 0; font-size: 14px; }
.qa-request-form-card > p, .qa-request-list-head p { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.qa-request-form-stack { display: grid; gap: 12px; margin-top: 15px; }
.qa-request-list-card { overflow: hidden; }
.qa-request-list-head { padding: 14px 15px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.qa-request-list-head .result-count { white-space: nowrap; flex-shrink: 0; }
.qa-request-list { padding: 12px 14px 14px; display: grid; gap: 10px; }
.qa-request-list .qa-review-row { border: 1px solid var(--line); border-radius: 10px; padding: 0; overflow: hidden; }
.qa-request-list .qa-request-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 13px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.qa-request-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.qa-request-title small { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.qa-request-list .qa-request-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; padding: 12px 13px; margin: 0; }
.qa-request-list .qa-request-details dt { color: var(--muted); font-size: 10.5px; margin-bottom: 3px; }
.qa-request-list .qa-request-details dd { margin: 0; font-size: 11.5px; font-weight: 660; overflow-wrap: anywhere; }
.qa-request-list .qa-request-status-history,
.qa-request-list .qa-review-decision,
.qa-request-list .qa-cancel-request-form,
.qa-request-list .qa-form-actions { margin: 0 13px 12px; }
@media (max-width: 980px) {
  .qa-request-workspace { grid-template-columns: 1fr; }
  .qa-request-form-card { position: static; }
  .qa-request-list .qa-request-details { grid-template-columns: 1fr 1fr; }
  .qa-evaluation-form .qa-criterion { grid-template-columns: 1fr 180px; }
  .qa-evaluation-form .qa-observation-field { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .qa-request-list .qa-request-details { grid-template-columns: 1fr; }
  .qa-evaluation-form .qa-criterion { grid-template-columns: 1fr; gap: 9px; }
  .qa-modal-tabs { overflow: auto; }
}

/* ------------------------------------------------------------------------------------------
   Esqueletos de carga (d346). GENERICO NEUTRO por defecto: piezas grises abstractas, bordes
   redondeados y un brillo suave, sin prometer tabla, grafico ni formulario. ESTRUCTURAL solo para
   piezas simples y fijas. Sin porcentajes ni barras. Spinners de boton y velo de filtros aparte.
   ------------------------------------------------------------------------------------------ */
:root { --skeleton-base: #e8ebef; --skeleton-base-soft: #eff1f4; --skeleton-shine: rgba(255, 255, 255, 0.72); }
:root[data-theme="dark"] { --skeleton-base: rgba(225, 235, 245, 0.09); --skeleton-base-soft: rgba(225, 235, 245, 0.055); --skeleton-shine: rgba(255, 255, 255, 0.06); }
@keyframes crm-skeleton-shimmer { 100% { transform: translateX(100%); } }
@keyframes crm-skeleton-breathe { 50% { opacity: 0.86; } }
.neutral-skeleton { min-width: 0; padding: 12px 14px; }
.ns-surface { display: grid; gap: 14px; min-width: 0; }
.ns-piece { position: relative; display: block; overflow: hidden; min-width: 0; background: var(--skeleton-base); border-radius: 12px; animation: crm-skeleton-breathe 2.4s ease-in-out infinite; }
.ns-piece::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(110deg, transparent 30%, var(--skeleton-shine) 50%, transparent 70%);
  animation: crm-skeleton-shimmer 1.65s linear infinite;
}
.ns-block { width: 100%; height: 56px; background: var(--skeleton-base-soft); }
.ns-block-medium { width: 72%; height: 88px; }
.ns-lines { display: grid; gap: 9px; }
.ns-line { height: 10px; border-radius: 999px; }
.ns-line-short { width: 26%; }
.ns-line-long { width: 52%; }
.ns-tiles { display: flex; flex-wrap: wrap; gap: 12px; min-width: 0; }
.ns-tile { height: 44px; flex: 1 1 var(--ns-basis, 30%); }
.ns-w1 { --ns-basis: 44%; } .ns-w2 { --ns-basis: 28%; } .ns-w3 { --ns-basis: 56%; } .ns-w4 { --ns-basis: 34%; }
.ns-w5 { --ns-basis: 62%; } .ns-w6 { --ns-basis: 24%; } .ns-w7 { --ns-basis: 40%; } .ns-w8 { --ns-basis: 50%; }
.neutral-skeleton-compact .ns-surface { gap: 11px; }
.neutral-skeleton-compact .ns-block { height: 40px; }
.neutral-skeleton-compact .ns-tile { height: 34px; }
.neutral-skeleton-large { padding: 18px 14px; }
.neutral-skeleton-large .ns-surface { gap: 18px; }
.neutral-skeleton-large .ns-block { height: 72px; }
.neutral-skeleton-large .ns-block-medium { height: 132px; }
.neutral-skeleton-large .ns-tile { height: 64px; }
.ss-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.ss-field { display: grid; gap: 8px; min-width: 0; }
.ss-value { width: 70%; height: 16px; border-radius: 8px; }
.source-info-loading.source-info-skeleton { display: block; min-height: 0; }
@media (max-width: 640px) {
  .ns-block-medium { width: 100%; }
  .ns-tile { flex-basis: 40%; }
}
@media (prefers-reduced-motion: reduce) {
  .ns-piece, .ns-piece::after { animation: none; }
}

/* ------------------------------------------------------------------------------------------
   Centro de Transferencias · pase correctivo de cumplimiento visual (d345).
   ------------------------------------------------------------------------------------------ */

/* Botones solidos: hover y foco con el mismo color del tema, sin degradados. */
.primary-button:hover:not(:disabled) { background: color-mix(in srgb, var(--primary) 86%, #000); border-color: color-mix(in srgb, var(--primary) 86%, #000); }
.primary-button:focus-visible { outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; }

/* Cabecera del Detalle: resultados + "X de Y columnas" + Columnas, fuera de la tabla. */
.transfer-detail-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.transfer-detail-columns-slot { display: flex; align-items: center; }
.transfer-detail-columns-slot .detail-table-toolbar { position: static; margin: 0; padding: 0; min-height: 0; border: 0; background: none; display: flex; align-items: center; gap: 10px; z-index: auto; }
.transfer-detail-list-panel .panel-head { flex-wrap: wrap; row-gap: 10px; }
@media (max-width: 760px) {
  .transfer-detail-head-actions { width: 100%; justify-content: flex-start; }
}

/* Cajon: accion a Convoso */
.tdr-convoso { display: flex; justify-content: flex-start; padding-top: 4px; }
.tdr-convoso-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.tdr-convoso-link .detail-action-icon { width: 16px; height: 16px; }
.tdr-convoso-link[disabled] { opacity: 0.55; cursor: not-allowed; }
#rail-expand .detail-action-icon { width: 16px; height: 16px; }
#rail-expand:disabled { opacity: 0.45; cursor: not-allowed; }

/* QA: fila = informacion de la pregunta | Resultado | Observacion */
.qa-workflow-modal { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.qa-evaluation-form .qa-criterion { grid-template-columns: minmax(0, 1fr) minmax(0, 460px); }
:root[data-theme="dark"] .qa-evaluation-form .qa-criterion { border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.qa-evaluation-form .qa-criterion-copy { gap: 4px; }
.qa-evaluation-form .qa-criterion-category { order: -1; color: var(--muted); font-size: 11px; font-weight: 650; }
.qa-evaluation-form .qa-criterion-copy strong { font-size: 13px; }
.qa-criterion-controls { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px; align-items: end; }
.qa-evaluation-form > .drawer-field:first-child { max-width: 520px; margin-bottom: 6px; }
.qa-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface); }
@media (max-width: 980px) {
  .qa-evaluation-form .qa-criterion { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 640px) {
  .qa-criterion-controls { grid-template-columns: 1fr; }
  .qa-modal-foot .control-button, .qa-modal-foot .primary-button { flex: 1; }
}

/* Solicitudes: tarjeta compacta con la jerarquia de la referencia */
.qa-request-list .qa-review-row { display: block; }
.qa-request-body { padding: 12px 13px; display: grid; gap: 11px; }
.qa-request-change { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.qa-request-change span { display: block; color: var(--muted); font-size: 10.5px; margin-bottom: 3px; }
.qa-request-change strong { font-size: 13px; }
.qa-request-change > div:last-child { text-align: right; }
.qa-request-reason { font-size: 12px; line-height: 1.45; color: var(--ink); background: var(--surface-soft); border-radius: 8px; padding: 9px 10px; }
.qa-request-list .qa-request-details { padding: 0; }
.qa-request-progress { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10.5px; }
.qa-request-progress b { color: var(--ink); font-weight: 650; }
.qa-request-progress i { width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); }
.qa-request-list .qa-request-status-history,
.qa-request-list .qa-review-decision,
.qa-request-list .qa-cancel-request-form,
.qa-request-list .qa-form-actions { margin: 0; }
.qa-request-status-history summary { cursor: pointer; color: var(--muted); font-size: 11px; font-weight: 650; }
@media (max-width: 640px) {
  .qa-request-change { flex-direction: column; }
  .qa-request-change > div:last-child { text-align: left; }
}


/* ------------------------------------------------------------------------------------------
   Solicitudes y aprobaciones (Transfer > Revision QA, d347). Jerarquia de la referencia Operations
   Center: cabecera, KPIs, pestanas de estado, filtros compactos, tabla y cajon lateral.
   ------------------------------------------------------------------------------------------ */
.rq-page { display: grid; gap: 16px; min-width: 0; }
.rq-page-head h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -0.01em; color: var(--ink); }
.rq-page-head p { margin: 0; color: var(--muted); font-size: 12.5px; }
.rq-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rq-kpi { display: grid; gap: 4px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.rq-kpi span { color: var(--muted); font-size: 12px; font-weight: 700; }
.rq-kpi strong { font-size: 26px; font-weight: 780; letter-spacing: -0.03em; color: var(--ink); }
.rq-kpi small { color: var(--muted); font-size: 12px; }
.rq-workspace { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); overflow: hidden; min-width: 0; }
.rq-tabs { display: flex; padding: 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.rq-tab { display: inline-flex; align-items: center; gap: 7px; padding: 14px 12px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 650; font-size: 13px; cursor: pointer; white-space: nowrap; }
.rq-tab span { min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: 11px; font-weight: 700; text-align: center; }
.rq-tab.active { color: var(--ink); border-bottom-color: var(--primary); }
.rq-tab:focus-visible { outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: -2px; }
.rq-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.rq-filters .rq-search { flex: 1 1 260px; min-width: 0; }
.rq-filters select { flex: 0 1 auto; min-width: 0; }
.rq-table-wrap { overflow-x: auto; }
.rq-table-wrap.is-refreshing { opacity: 0.6; transition: opacity 0.15s ease; }
.rq-table { width: 100%; min-width: 920px; border-collapse: collapse; }
.rq-table thead th { padding: 11px 13px; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); background: var(--surface-soft); border-bottom: 1px solid var(--line); white-space: nowrap; }
.rq-table tbody td { padding: 12px 13px; font-size: 13px; color: var(--ink); border-bottom: 1px solid var(--line); vertical-align: middle; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.rq-table tbody td:nth-child(4) { min-width: 220px; }
.rq-table tbody td:nth-child(7) { white-space: nowrap; }
.rq-table tbody td small { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.rq-table tbody tr { cursor: pointer; }
.rq-table tbody tr:hover, .rq-table tbody tr.is-selected { background: var(--surface-soft); }
.rq-table tbody tr:focus-visible { outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: -2px; }
.rq-id { font-weight: 760; }
.rq-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); font-size: 11px; font-weight: 750; white-space: nowrap; color: var(--muted); background: var(--surface-soft); }
.rq-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rq-status-requested { color: var(--amber); background: color-mix(in srgb, var(--amber) 10%, var(--surface)); border-color: color-mix(in srgb, var(--amber) 28%, transparent); }
.rq-status-approved { color: var(--green); background: color-mix(in srgb, var(--green) 10%, var(--surface)); border-color: color-mix(in srgb, var(--green) 28%, transparent); }
.rq-status-rejected { color: var(--red); background: color-mix(in srgb, var(--red) 9%, var(--surface)); border-color: color-mix(in srgb, var(--red) 26%, transparent); }
.rq-status-cancelled { color: var(--muted); }
.rq-message { padding: 38px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.rq-message.rq-error { color: var(--red); }
.rq-drawer .rq-message { padding: 12px; }
.rq-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; color: var(--muted); font-size: 12px; }
.rq-pager div { display: flex; gap: 8px; }
.rq-drawer-wrap { position: fixed; inset: 0; z-index: 60; }
.rq-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.26); }
.rq-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); display: flex; flex-direction: column; background: var(--surface); box-shadow: -18px 0 44px rgba(15, 23, 42, 0.15); }
.rq-drawer-head { display: flex; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.rq-drawer-head small { color: var(--muted); font-size: 12px; }
.rq-drawer-head h3 { margin: 3px 0 7px; font-size: 19px; color: var(--ink); }
.rq-drawer-body { flex: 1; overflow-y: auto; padding: 4px 20px 18px; }
.rq-section { padding: 16px 0; border-bottom: 1px solid var(--line); }
.rq-section:last-child { border-bottom: 0; }
.rq-section h4 { margin: 0 0 12px; font-size: 11px; font-weight: 800; letter-spacing: 0.065em; text-transform: uppercase; color: var(--muted); }
.rq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.rq-grid strong { display: block; margin-top: 3px; font-size: 13px; font-weight: 650; color: var(--ink); overflow-wrap: anywhere; }
.rq-label { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.rq-change { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; }
.rq-change.single { grid-template-columns: minmax(0, 1fr); }
.rq-change-box { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.rq-change-box strong { display: block; margin-top: 3px; font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.rq-arrow { color: var(--muted); }
.rq-reason { margin-top: 13px; }
.rq-reason p, .rq-note { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink); }
.rq-note { padding: 10px 12px; border-radius: 10px; background: var(--surface-soft); }
.rq-muted { margin: 0; color: var(--muted); font-size: 12.5px; }
.rq-audit { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
.rq-audit li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 9px; }
.rq-audit i { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--primary); }
.rq-audit strong { font-size: 13px; color: var(--ink); }
.rq-audit small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.rq-drawer-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface); }
.rq-danger { color: var(--red); }
@media (max-width: 900px) {
  .rq-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .rq-kpis, .rq-grid, .rq-change { grid-template-columns: minmax(0, 1fr); }
  .rq-arrow { transform: rotate(90deg); text-align: center; }
  .rq-drawer-actions .control-button, .rq-drawer-actions .primary-button { flex: 1 1 auto; }
}

/* ------------------------------------------------------------------------------------------
   Solicitudes · pase correctivo d348: barra de filtros, notas y campos editables.
   ------------------------------------------------------------------------------------------ */
.rq-filters { display: grid; grid-template-columns: minmax(240px, 1fr) auto auto auto; gap: 10px; align-items: end; padding: 14px 16px; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.rq-search-field { position: relative; display: block; min-width: 0; }
.rq-search-field svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.rq-filters .rq-search { width: 100%; height: 38px; padding: 0 12px 0 36px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: 13px; }
.rq-select-field { display: grid; gap: 4px; min-width: 0; }
.rq-select-field > span { color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.rq-select-field select { height: 38px; min-width: 170px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: 13px; }
.rq-search-button { height: 38px; padding: 0 18px; }
.rq-filters .rq-search:focus, .rq-select-field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.rq-note-card { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid color-mix(in srgb, var(--primary) 55%, var(--line)); border-radius: 10px; background: var(--surface-soft); }
.rq-note-label { color: var(--muted); font-size: 10.5px; font-weight: 750; letter-spacing: 0.05em; text-transform: uppercase; }
.rq-note-card p { margin: 0; color: var(--ink); font-size: 13.5px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.rq-note-card small { color: var(--muted); font-size: 11.5px; }
.rq-section .rq-grid + .rq-note-card { margin-top: 12px; }
.rq-audit-note { margin: 6px 0 0; padding: 7px 10px; border-radius: 8px; background: var(--surface-soft); color: var(--ink); font-size: 12px; line-height: 1.45; }
.rq-field { display: grid; gap: 5px; }
.rq-field-label { color: var(--ink); font-size: 12.5px; font-weight: 700; }
.rq-field-hint { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.rq-field textarea { width: 100%; min-height: 96px; margin-top: 3px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; line-height: 1.5; resize: vertical; }
.rq-field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.rq-section form .drawer-guardrail { margin-top: 10px; }
/* Notas de las tarjetas de solicitud del expediente QA: mismo tratamiento de nota. */
.qa-request-reason { padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid color-mix(in srgb, var(--primary) 55%, var(--line)); border-radius: 10px; font-size: 13px; line-height: 1.55; white-space: pre-line; }
.qa-request-list .qa-request-notes { grid-column: 1 / -1; padding: 9px 11px; border-radius: 9px; background: var(--surface-soft); }
.qa-request-list .qa-request-notes dd { white-space: pre-line; line-height: 1.5; }
@media (max-width: 900px) {
  .rq-filters { grid-template-columns: 1fr 1fr; }
  .rq-search-field { grid-column: 1 / -1; }
  .rq-select-field select { min-width: 0; width: 100%; }
  .rq-search-button { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .rq-filters { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------------------------------
   QA · Evaluacion con la jerarquia de la referencia (d349): cabecera Pregunta | Resultado |
   Observacion, filas limpias con pregunta arriba y categoria debajo, y comentario por pregunta.
   ------------------------------------------------------------------------------------------ */
.qa-template-field { display: grid; gap: 6px; max-width: 520px; margin-bottom: 16px; }
.qa-template-field > span { color: var(--muted); font-size: 11.5px; font-weight: 700; }
.qa-template-field select { height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); }
.qa-criteria-head { display: grid; grid-template-columns: minmax(0, 1fr) 170px 260px; gap: 16px; padding: 0 0 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10.5px; font-weight: 750; letter-spacing: 0.05em; text-transform: uppercase; }
.qa-evaluation-form .qa-criterion { display: grid; grid-template-columns: minmax(0, 1fr) 446px; gap: 16px; align-items: center; margin: 0; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.qa-evaluation-form .qa-criterion-copy { display: grid; gap: 3px; min-width: 0; }
.qa-evaluation-form .qa-criterion-copy strong { color: var(--ink); font-size: 13.5px; font-weight: 650; line-height: 1.35; }
.qa-evaluation-form .qa-criterion-category { order: 0; color: var(--muted); font-size: 11.5px; font-weight: 500; }
.qa-evaluation-form .qa-criterion-controls { display: grid; grid-template-columns: 170px 260px; gap: 16px; align-items: center; }
.qa-evaluation-form .qa-answer-select, .qa-evaluation-form .qa-observation-field { display: grid; gap: 4px; min-width: 0; }
.qa-evaluation-form .qa-control-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.qa-evaluation-form .qa-answer-select select, .qa-evaluation-form .qa-observation-field input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 13px; }
.qa-evaluation-form select:focus, .qa-evaluation-form input:focus, .qa-evaluation-form textarea:focus,
.qa-reason-block textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.qa-evaluation-notes { margin-top: 16px; }
.qa-evaluation-notes textarea { border-radius: 10px; line-height: 1.5; }
/* Motivo de la solicitud: entrada principal del formulario, con su nota informativa pegada. */
.qa-reason-block { display: grid; gap: 0; padding-top: 2px; }
.qa-reason-field { display: grid; gap: 3px; margin-bottom: 7px; }
.qa-reason-label { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 700; }
.qa-reason-label em { padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary); font-size: 10.5px; font-style: normal; font-weight: 700; }
.qa-reason-hint { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.qa-reason-block textarea { width: 100%; min-height: 124px; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 10px 10px 0 0; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; line-height: 1.5; resize: vertical; }
.qa-reason-block .drawer-guardrail { margin: 0; border: 1px solid var(--line-strong); border-top: 0; border-radius: 0 0 10px 10px; font-size: 11.5px; }
@media (max-width: 980px) {
  .qa-criteria-head { display: none; }
  .qa-evaluation-form .qa-criterion { grid-template-columns: 1fr; gap: 10px; }
  .qa-evaluation-form .qa-criterion-controls { grid-template-columns: 170px minmax(0, 1fr); }
  .qa-evaluation-form .qa-control-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; color: var(--muted); font-size: 11px; font-weight: 700; }
}
@media (max-width: 640px) {
  .qa-evaluation-form .qa-criterion-controls { grid-template-columns: 1fr; }
}

/* ================================================================================================
   Task 19 Entrega 1 — pantalla de permisos agrupada, con modos Simple y Avanzado.
   Reutiliza los tokens existentes (--line, --ink, --muted) para no introducir una paleta paralela.
   ================================================================================================ */
.admin-permission-groups {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.admin-permission-modes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-permission-mode-switch {
  display: inline-flex;
  gap: 4px;
}

.admin-permission-mode-switch .secondary-button {
  padding: 4px 10px;
  font-size: 11px;
}

.admin-permission-mode-switch .secondary-button.is-active {
  border-color: var(--ink, #1f2a37);
  font-weight: 600;
}

.admin-permission-group {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.admin-permission-group > header {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f7f9fb;
  border-bottom: 1px solid var(--line);
}

.admin-permission-group > header strong {
  display: block;
  font-size: 12px;
}

.admin-permission-group > header small {
  display: block;
  color: var(--muted, #6b7a90);
  font-size: 10px;
  line-height: 1.35;
}

.admin-permission-group-toggle {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.admin-permission-count {
  font-size: 10px;
  color: var(--muted, #6b7a90);
  white-space: nowrap;
}

/* Selección parcial: el contador se marca, de modo que un grupo a medias se distingue de un grupo
   completo sin tener que abrirlo. */
.admin-permission-count.is-partial {
  color: #8a5a00;
  font-weight: 600;
}

.admin-permission-bulk {
  display: inline-flex;
  gap: 4px;
}

.admin-permission-bulk .secondary-button {
  padding: 3px 8px;
  font-size: 10px;
}

.admin-permission-rows {
  display: grid;
  gap: 2px;
  padding: 6px 10px 10px;
}

.admin-permission-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #edf1f5;
  color: #34445a;
  font-size: 11px;
}

.admin-permission-row:last-child {
  border-bottom: 0;
}

.admin-permission-row input {
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.admin-permission-row b {
  display: block;
  font-weight: 600;
}

.admin-permission-row small {
  display: block;
  color: var(--muted, #6b7a90);
  font-size: 10px;
  line-height: 1.35;
}

/* Heredado del rol: insignia en lugar de casilla. No es una casilla desmarcada ni una casilla
   deshabilitada; es que ahi no hay nada que decidir. */
.admin-permission-inherited {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.admin-permission-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 10px;
  background: #e8f0fb;
  color: #2a4b7c;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.admin-permission-effective {
  font-size: 10px;
  color: var(--muted, #6b7a90);
  white-space: nowrap;
}

:root[data-theme="dark"] .admin-permission-group,
:root[data-theme="dark"] .admin-permission-group-toggle {
  border-color: rgba(255, 255, 255, 0.14);
}

:root[data-theme="dark"] .admin-permission-group > header {
  background: rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .admin-permission-group-toggle {
  background: rgba(255, 255, 255, 0.06);
  color: #e8edf5;
}

:root[data-theme="dark"] .admin-permission-row {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  color: #cfd8e6;
}

:root[data-theme="dark"] .admin-permission-badge {
  background: rgba(90, 150, 230, 0.2);
  color: #cfe0f8;
}

/* Subgrupos dentro de un grupo de permisos: las 34 subsecciones necesitan estructura para ser
   legibles, no una lista larga. */
.admin-permission-subgroup {
  margin: 6px 0 2px;
  padding: 6px 8px;
  border: 1px dashed var(--line);
  border-radius: 5px;
}

.admin-permission-subgroup-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
  margin-bottom: 2px;
  border-bottom: 1px solid #edf1f5;
}

.admin-permission-subgroup-head strong {
  font-size: 11px;
  flex: 1 1 auto;
}

:root[data-theme="dark"] .admin-permission-subgroup {
  border-color: rgba(255, 255, 255, 0.14);
}

:root[data-theme="dark"] .admin-permission-subgroup-head {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
