
@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500;600&family=Geist:wght@400;500;600&display=swap');

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

:root {
  color-scheme: dark;

  --pal-white: #ffffff;
  --pal-bubble: #fcfcff;
  --pal-subtle: #f4f4f5;
  --pal-primary: #5a5aad;
  --pal-border: #dbdbff;
  --pal-text: #27272a;
  --pal-muted: #63636e;
  --pal-shadow-sm: rgba(0, 0, 0, 0.17);
  --pal-shadow-md: rgba(0, 0, 0, 0.14);
  --pal-shadow-lg: rgba(0, 0, 0, 0.02);

  --pal-dark-deep: #1e1e2e;
  --pal-dark-base: #252538;
  --pal-dark-mid: #2e2e44;
  --pal-dark-soft: #383852;

  --sb-surface: var(--pal-dark-base);
  --sb-panel: var(--pal-dark-mid);
  --sb-hover: rgba(255, 255, 255, .06);
  --sb-active: rgba(90, 90, 173, .18);
  --sb-border: rgba(219, 219, 255, .14);
  --sb-border-mid: rgba(219, 219, 255, .22);
  --sb-text: #e4e4eb;
  --sb-muted: #9494a3;
  --sb-faint: #686876;

  --brand: #5a5aad;
  --brand-rgb: 90, 90, 173;
  --brand-color: var(--brand);
  --brand-hv: #4e4e99;
  --brand-d: rgba(90, 90, 173, .12);
  --brand-b: rgba(90, 90, 173, .28);

  --bg: var(--pal-dark-deep);
  --surface: #26263a;
  --panel: var(--pal-dark-mid);
  --hover: rgba(255, 255, 255, .055);
  --active: rgba(90, 90, 173, .14);
  --border: rgba(219, 219, 255, .10);

  --text: #e4e4eb;
  --muted: #9494a3;
  --faint: #686876;

  --green: #3ecf8e;
  --purple: #8989c9;
  --amber: #f7a94b;
  --cyan: #8989c9;
  --red: #f7605a;

  --nav-h: 44px;
  --sb-w: 240px;
  --ease: .15s cubic-bezier(.4, 0, .2, 1);
  --slide: .2s cubic-bezier(.4, 0, .2, 1);

  --ctrl-h: 26px;
  --ctrl-h-sm: 22px;
  --ctrl-h-lg: 32px;
  --ctrl-icon: 22px;

  --table-cell-py: 8px;

  --brand-hover: #4e4e99;
  --r-xs: 2px;
  --r-sm: 4px;
  --r-md: 4px;
  --r-lg: 6px;
  --font-mono: 'Geist Mono', ui-monospace, monospace;
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --ring: rgba(90, 90, 173, .22);
  --stroke-btn:
    inset 0 1px 0 rgba(255, 255, 255, .10),
    inset 0 -1px 0 rgba(0, 0, 0, .22),
    inset 1px 0 0 rgba(255, 255, 255, .05),
    inset -1px 0 0 rgba(255, 255, 255, .05);
  --stroke-btn-hover:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    inset 0 -1px 0 rgba(0, 0, 0, .28),
    inset 1px 0 0 rgba(255, 255, 255, .08),
    inset -1px 0 0 rgba(255, 255, 255, .08);
  --s-red: #e53e3e;
  --s-red-bg: rgba(229, 62, 62, .10);
  --border-mid: rgba(219, 219, 255, .14);
  --border-strong: rgba(219, 219, 255, .22);
  --text-h: var(--text);
  --text-body: var(--muted);
  --text-muted: var(--faint);
  --bg-panel: var(--surface);
  --bg-subtle: var(--panel);
  --bg-hover: var(--hover);
  --bg-active: var(--active);
  --bg-input: var(--panel);
  --overlay: rgba(0, 0, 0, .55);
  --shadow-sm: 0 1px 2px var(--pal-shadow-sm);
  --shadow-md: 0 4px 12px var(--pal-shadow-md);
  --shadow-lg: 0 8px 24px var(--pal-shadow-lg);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: var(--pal-bubble);
  --surface: var(--pal-white);
  --panel: var(--pal-subtle);
  --hover: rgba(9, 9, 11, .04);
  --active: rgba(90, 90, 173, .08);
  --border: var(--pal-border);

  --text: var(--pal-text);
  --muted: var(--pal-muted);
  --faint: #93939e;

  --stroke-btn:
    inset 0 1px 0 rgba(255, 255, 255, .90),
    inset 0 -1px 0 rgba(0, 0, 0, .06),
    inset 1px 0 0 rgba(255, 255, 255, .40),
    inset -1px 0 0 rgba(255, 255, 255, .40);
  --stroke-btn-hover:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(0, 0, 0, .08),
    inset 1px 0 0 rgba(255, 255, 255, .60),
    inset -1px 0 0 rgba(255, 255, 255, .60);
  --ring: rgba(90, 90, 173, .20);
  --border-mid: color-mix(in srgb, var(--pal-border) 85%, var(--pal-muted));
  --border-strong: color-mix(in srgb, var(--pal-border) 65%, var(--pal-primary));
  --s-red: #dc2626;
  --s-red-bg: rgba(220, 38, 38, .06);
  --bg-subtle: var(--pal-subtle);
  --bg-input: var(--pal-white);
  --card-shadow: var(--shadow-sm);
  --overlay: rgba(9, 9, 11, .45);
}

[data-theme="light"] .stat-card {
  box-shadow: var(--shadow-sm);
  border-color: var(--pal-border);
}

[data-theme="light"] .drawer {
  box-shadow: -10px 0 30px var(--pal-shadow-lg);
}

[data-theme="light"] .drawer-hd,
[data-theme="light"] .drawer-ft {
  background: var(--pal-bubble);
}

[data-theme="light"] .page-sub {
  color: var(--pal-muted);
}

[data-theme="light"] .card {
  background: var(--pal-white);
  border-color: var(--pal-border);
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .navbar {
  background: var(--pal-white);
}

[data-theme="light"] .note-preview {
  background: rgba(var(--brand-rgb), 0.04);
  border-color: var(--pal-border);
  color: var(--pal-text);
}

[data-theme="light"] .stat-card:hover {
  box-shadow: var(--shadow-md);
}

[data-theme="light"] .input,
[data-theme="light"] .input-stroke,
[data-theme="light"] .select,
[data-theme="light"] select.select-stroke,
[data-theme="light"] .textarea,
[data-theme="light"] textarea.input-stroke {
  box-shadow: inset 0 1px 2px var(--pal-shadow-lg);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 12px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  height: 100dvh;
  overflow: hidden;
}

body.sb-lock {
  overflow: hidden;
}

body.login-body {
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  min-height: 100dvh;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

.layout {
  display: flex;
  height: 100dvh;
  overflow: hidden;
}

/* ---------- Dashboard / % Cierre dentro del navbar (estilo icono+label minimalista) ---------- */
.nav-quick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--ease), background var(--ease), border-color var(--ease);
  background: none;
  border: 1px solid var(--border);
  font-family: inherit;
  cursor: pointer;
}

.nav-quick-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.6;
}

.nav-quick-item:hover {
  color: var(--text);
  background: var(--hover);
  border-color: var(--border-mid);
}

.nav-quick-item.active {
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 640px) {
  .nav-quick-item span {
    display: none;
  }
  .nav-quick-item {
    padding: 6px 8px;
  }
}

.sidebar {

  --surface: var(--sb-surface);
  --panel: var(--sb-panel);
  --hover: var(--sb-hover);
  --active: var(--sb-active);
  --border: var(--sb-border);
  --border-mid: var(--sb-border-mid);
  --text: var(--sb-text);
  --muted: var(--sb-muted);
  --faint: var(--sb-faint);
  --text-h: var(--sb-text);
  --text-body: var(--sb-muted);
  --text-muted: var(--sb-faint);
  --bg-panel: var(--sb-surface);
  --bg-subtle: var(--sb-panel);
  --bg-hover: var(--sb-hover);
  --bg-active: var(--sb-active);
  --bg-input: var(--sb-panel);

  width: var(--sb-w);
  height: 100%;
  background: var(--sb-surface);
  color: var(--sb-text);
  border-right: 1px solid var(--sb-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;

  transition: none;
  will-change: width;

  position: relative;
  z-index: 40;
}

.sb-ready .sidebar {
  transition:
    width var(--slide),
    border-right-color var(--slide),
    background-color var(--slide);
}

/* Colapsado = riel de iconos (68px), no oculto del todo -- se mantiene
   navegable con tooltips, en vez del "ancho 0" anterior que escondia todo
   el sidebar sin dejar forma de navegar sin volver a expandirlo. */
.sidebar.sb-collapsed {
  width: 68px;
}

.sb-pre-collapsed .sidebar {
  width: 68px !important;
  transition: none !important;
}

.sidebar.sb-collapsed .sb-brand-stack,
.sidebar.sb-collapsed .sb-section,
.sidebar.sb-collapsed .sb-item span,
.sidebar.sb-collapsed .sb-user,
.sidebar.sb-collapsed .sb-chev,
.sidebar.sb-collapsed .sb-proj-name,
.sidebar.sb-collapsed .plan-pill {
  display: none;
}

.sidebar.sb-collapsed .sb-hd {
  justify-content: center;
  padding: 0;
}

.sidebar.sb-collapsed .sb-item {
  justify-content: center;
  padding: 8px;
  position: relative;
}

.sidebar.sb-collapsed .sb-profile {
  justify-content: center;
  padding: 8px;
}

/* Tooltip al pasar el mouse sobre un icono colapsado */
.sidebar.sb-collapsed .sb-item[data-label]::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--sb-panel);
  border: 1px solid var(--sb-border-mid);
  color: var(--sb-text);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--r-md);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  z-index: 50;
}

.sidebar.sb-collapsed .sb-item:hover[data-label]::after {
  opacity: 1;
}

.sb-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  height: var(--nav-h);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* Buscador visible bajo el logo -- abre el mismo command palette que el
   icono de la topbar (#btn-global-search). */
.sb-search-trigger {
  flex-shrink: 0;
  padding: 8px 8px 0;
}

.sb-search-trigger button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--faint);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}

.sb-search-trigger button:hover {
  border-color: var(--border-mid);
  color: var(--muted);
  background: var(--hover);
}

.sb-search-trigger svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.sb-search-trigger .sb-search-kbd {
  margin-left: auto;
  font-size: 10px;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  padding: 1px 5px;
  color: var(--faint);
}

.sidebar.sb-collapsed .sb-search-trigger {
  padding: 8px;
}
.sidebar.sb-collapsed .sb-search-trigger button {
  justify-content: center;
  padding: 7px;
}
.sidebar.sb-collapsed .sb-search-trigger span,
.sidebar.sb-collapsed .sb-search-trigger .sb-search-kbd {
  display: none;
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sb-logo {
  width: 22px;
  height: 22px;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sb-logo svg {
  width: 14px;
  height: 14px;
  display: block;
}

.sb-brand-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.15;
  min-width: 0;
}

.sb-brand-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-brand-cloud {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
}

.sb-bd {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(128, 128, 128, .15) transparent;
}

.sb-project {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: var(--r-md);
  margin-bottom: 4px;
}

.sb-proj-icon {
  color: var(--muted);
  flex-shrink: 0;
}

.sb-proj-icon svg {
  width: 13px;
  height: 13px;
}

.sb-proj-name {
  font-size: 12.5px;
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-pill {
  font-size: 10px;
  font-weight: 500;
  flex-shrink: 0;
  padding: 1px 5px;
  border-radius: var(--r-xs);
  border: 1px solid var(--brand-b);
  color: var(--brand);
  background: var(--brand-d);
}

.sb-section {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 10px 8px 4px;
}

.sb-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  height: var(--ctrl-h);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .04);
  color: #9ca3af;
  font-size: 12.5px;
  transition: background var(--ease), color var(--ease);
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: 2px;
}

.sb-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.sb-item:hover {
  background: rgba(255, 255, 255, .07);
  color: #d1d5db;
}

.sb-item.active {
  background: rgba(255, 255, 255, .10);
  color: var(--sb-text);
  font-weight: 500;
  box-shadow: inset 3px 0 0 rgba(156, 163, 175, .55);
}

.sb-item--accent {
  font-weight: 500;
}

.sb-item--purple {
  background: rgba(167, 139, 250, .07);
  color: #a8a3c4;
}
.sb-item--purple:hover {
  background: rgba(167, 139, 250, .11);
  color: #c4bddf;
}
.sb-item--purple.active {
  background: rgba(167, 139, 250, .15);
  color: #ddd8f0;
  box-shadow: inset 3px 0 0 rgba(167, 139, 250, .55);
}

.sb-item--yellow {
  background: rgba(250, 204, 21, .07);
  color: #b8a86a;
}
.sb-item--yellow:hover {
  background: rgba(250, 204, 21, .11);
  color: #d4c48a;
}
.sb-item--yellow.active {
  background: rgba(250, 204, 21, .15);
  color: #e8ddb0;
  box-shadow: inset 3px 0 0 rgba(250, 204, 21, .55);
}

.sb-item--blue {
  background: rgba(96, 165, 250, .07);
  color: #8fa8c4;
}
.sb-item--blue:hover {
  background: rgba(96, 165, 250, .11);
  color: #a8bdd8;
}
.sb-item--blue.active {
  background: rgba(96, 165, 250, .15);
  color: #c5d8ef;
  box-shadow: inset 3px 0 0 rgba(96, 165, 250, .55);
}

.sb-item--tea {
  background: rgba(45, 212, 191, .06);
  color: #7fb0a8;
}
.sb-item--tea:hover {
  background: rgba(45, 212, 191, .10);
  color: #9cc4bc;
}
.sb-item--tea.active {
  background: rgba(45, 212, 191, .14);
  color: #b8d9d2;
  box-shadow: inset 3px 0 0 rgba(45, 212, 191, .50);
}

.sb-item--red {
  background: rgba(248, 113, 113, .07);
  color: #c49a9a;
}
.sb-item--red:hover {
  background: rgba(248, 113, 113, .11);
  color: #d9b0b0;
}
.sb-item--red.active {
  background: rgba(248, 113, 113, .15);
  color: #e8c8c8;
  box-shadow: inset 3px 0 0 rgba(248, 113, 113, .55);
}

.sb-item--orange {
  background: rgba(251, 146, 60, .07);
  color: #c4a080;
}
.sb-item--orange:hover {
  background: rgba(251, 146, 60, .11);
  color: #d9b89a;
}
.sb-item--orange.active {
  background: rgba(251, 146, 60, .15);
  color: #e8cdb5;
  box-shadow: inset 3px 0 0 rgba(251, 146, 60, .55);
}

.sb-item--green {
  background: rgba(74, 222, 128, .06);
  color: #7fb896;
}
.sb-item--green:hover {
  background: rgba(74, 222, 128, .10);
  color: #9ccbb0;
}
.sb-item--green.active {
  background: rgba(74, 222, 128, .14);
  color: #b8ddc8;
  box-shadow: inset 3px 0 0 rgba(74, 222, 128, .50);
}

.sb-item--red-strong {
  background: rgba(248, 113, 113, .13);
  color: #e4aaaa;
}
.sb-item--red-strong:hover {
  background: rgba(248, 113, 113, .20);
  color: #f0bcbc;
}
.sb-item--red-strong.active {
  background: rgba(248, 113, 113, .26);
  color: #f8d4d4;
  box-shadow: inset 3px 0 0 #f87171;
}

.sb-ft {
  padding: 0 8px 10px;
  flex-shrink: 0;
}

.sb-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--r-md);
  transition: background var(--ease);
  margin-top: 2px;
}

.sb-profile:hover {
  background: var(--hover);
}

.sb-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sb-user {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.sb-name {
  font-size: 12px;
  font-weight: 500;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-role {
  font-size: 10px;
  color: var(--faint);
  display: block;
}

.sb-chev {
  color: var(--faint);
  flex-shrink: 0;
}

.sb-chev svg {
  width: 13px;
  height: 13px;
}

.layout-right .qc-bar {
  width: 100%;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  z-index: 31;
}

.qc-bar__inner {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.qc-bar__icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qc-bar__icon svg {
  width: 16px;
  height: 16px;
}

.qc-bar__msg {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.qc-bar__text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  justify-content: center;
  gap: 1px;
}

.qc-bar__text .qc-bar__msg {
  flex: none;
}

.qc-bar__desc {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qc-bar--rich .qc-bar__inner {
  height: auto;
  min-height: 32px;
  padding: 7px 14px;
}

.qc-bar__more {
  flex-shrink: 0;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0.85;
  cursor: pointer;
}

.qc-bar__more:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
}

.qc-bar__close {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: var(--muted);
  background: transparent;
  flex-shrink: 0;
}

.qc-bar__close svg {
  width: 14px;
  height: 14px;
}

.qc-bar__close:hover {
  background: var(--hover);
  color: var(--text);
}

.qc-bar--success {
  background: rgba(62, 207, 142, .12);
  border-bottom-color: rgba(62, 207, 142, .35);
}

.qc-bar--info {
  background: #2160ff69;
  border-bottom-color: rgba(90, 90, 173, .32);
}

.qc-bar--warning {
  background: color-mix(in srgb, #f59e0b 14%, var(--pal-bubble, #fcfcff));
  border-bottom: 2px solid rgba(245, 158, 11, .45);
}

.qc-bar--danger {
  background: rgba(229, 62, 62, .12);
  border-bottom-color: rgba(229, 62, 62, .38);
}

.qc-bar--success .qc-bar__icon {
  color: #22a06b;
}

.qc-bar--info .qc-bar__icon {
  color: var(--brand);
}

.qc-bar--warning .qc-bar__icon {
  color: #d97706;
}

.qc-bar--warning .qc-bar__msg {
  color: color-mix(in srgb, #92400e 75%, var(--pal-text, #27272a));
}

.qc-bar--danger .qc-bar__icon {
  color: #dc2626;
}

.navbar {
  position: sticky;
  top: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 20px;
  margin: 0;
  background: var(--surface);
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
  flex-shrink: 0;
  z-index: 30;
}

[data-theme="light"] .navbar {
  box-shadow: 0 2px 10px rgba(20, 20, 30, .05);
}

.navbar .nav-left {
  gap: 6px;
}

.navbar .nav-right {
  gap: 4px;
}

.navbar .ibtn {
  color: var(--muted);
  width: 34px;
  height: 34px;
  border-radius: 6px;
}

.navbar .ibtn svg {
  width: 17px;
  height: 17px;
}

.navbar .ibtn:hover {
  background: var(--hover);
  color: var(--text);
}

.navbar .nav-divider {
  background: var(--border);
  height: 26px;
}

.navbar .nav-avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
  background: var(--brand);
}

@media (max-width: 640px) {
  .navbar {
    padding: 0 8px;
  }
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.ibtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  color: var(--muted);
  transition: background var(--ease), color var(--ease);
  flex-shrink: 0;
  position: relative;
}

.ibtn svg {
  width: 14px;
  height: 14px;
}

.ibtn:hover {
  background: var(--hover);
  color: var(--text);
}

.nav-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 4px;
  flex-shrink: 0;
}

[data-theme="dark"] .icon-light {
  display: none;
}

[data-theme="light"] .icon-dark {
  display: none;
}

.nav-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 6px;
  flex-shrink: 0;
}

/* ---------- Buscador global (command palette) ---------- */
.gs-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay, rgba(0, 0, 0, .45));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
}

.gs-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.gs-palette {
  width: min(560px, calc(100% - 32px));
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.gs-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.gs-input-row svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.5;
  color: var(--muted);
  flex-shrink: 0;
}

.gs-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.gs-input::placeholder {
  color: var(--muted);
}

.gs-kbd {
  font-size: 10.5px;
  font-family: var(--font-mono);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-xs);
  padding: 1px 5px;
  color: var(--muted);
  flex-shrink: 0;
}

.gs-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
}

.gs-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
}

.gs-item:hover,
.gs-item.hl {
  background: var(--hover);
}

.gs-item-main {
  min-width: 0;
  flex: 1;
}

.gs-item-name {
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gs-item-sub {
  font-size: 11.5px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.gs-item-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
  max-width: 45%;
}

.gs-mod-pill {
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--brand-b);
  color: var(--brand);
  background: var(--brand-d);
  white-space: nowrap;
}

.gs-empty,
.gs-hint {
  padding: 24px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

.view-wrap {
  flex: 1;
  padding: 24px 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.view-content {
  flex: 1;
  padding: 24px 32px;
}

.page-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.page-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 24px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px;
  font-size: 12px;
  color: var(--muted);
}

.site-footer {
  flex-shrink: 0;
  padding: 10px 32px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--faint);
  text-align: center;
}

.site-footer strong {
  color: var(--muted);
  font-weight: 500;
}

.soon-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  min-height: 380px;
  gap: 12px;
}

.soon-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  margin-bottom: 6px;
}

.soon-icon svg {
  width: 24px;
  height: 24px;
}

.soon-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--brand);
}

.soon-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.3px;
}

.soon-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 340px;
}

.soon-dots {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.soon-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-b);
  animation: dot-pulse 1.4s ease-in-out infinite;
}

.soon-dots span:nth-child(2) {
  animation-delay: .2s;
}

.soon-dots span:nth-child(3) {
  animation-delay: .4s;
}

@keyframes dot-pulse {

  0%,
  80%,
  100% {
    transform: scale(.6);
    opacity: .4;
  }

  40% {
    transform: scale(1);
    opacity: 1;
    background: var(--brand);
  }
}

.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .65);
  z-index: 45;
}

.backdrop.show {
  display: block;
}

.layout-right {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view-wrap {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.view-wrap.lb-view,
.view-wrap.campaigns-view {
  min-width: 0;
  overflow-x: hidden;
}

.page-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.page-hd>div:first-child {
  min-width: 0;
  flex: 1 1 160px;
}

.page-title {
  font-size: 16px;
  font-weight: 600;
}

.page-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.page-hd--hero-cloud {
  position: relative;
  padding-top: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(165deg, rgba(75, 200, 247, 0.045) 0%, transparent 38%),
    linear-gradient(180deg, rgba(var(--brand-rgb), 0.05) 0%, transparent 48%);
  overflow: hidden;
}

.page-hd--hero-cloud::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(110deg, #000 0%, #000 58%, transparent 92%);
  pointer-events: none;
}

.page-hd--hero-cloud>.cloud-content-panel {
  position: relative;
  z-index: 1;
}

.page-hd--hero-cloud>.case-view-hd-actions {
  position: relative;
  z-index: 1;
}

.cloud-content-panel {
  padding: 16px 18px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(26, 27, 31, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  max-width: 760px;
}

[data-theme="light"] .cloud-content-panel {
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.page-hd--hero-cloud .mod-kicker {
  margin-bottom: 10px;
}

.page-title--hero {
  font-size: clamp(17px, 2.2vw, 21px);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
}

.page-sub--lead {
  font-size: 12.5px;
  line-height: 1.55;
  max-width: 62ch;
  margin-top: 0;
}

.btn-stroke {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  height: var(--ctrl-h);
  border-radius: var(--r-md);
  border: 1px solid var(--border-mid);
  background: var(--bg-subtle);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: .8125rem;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  box-shadow: var(--stroke-btn);
  transition: background var(--ease), border-color var(--ease), color var(--ease),
    box-shadow var(--ease);
}

.btn-stroke svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.btn-stroke:hover {
  background: var(--bg-hover);
  color: var(--text-h);
  border-color: var(--border-strong);
  box-shadow: var(--stroke-btn-hover);
}

.btn-stroke.btn-brand {
  border-color: transparent;
  color: #fff;
  background: var(--brand);
  box-shadow: var(--stroke-btn);
}

.btn-stroke.btn-brand:hover {
  background: var(--brand-hover);
  box-shadow: var(--stroke-btn-hover);
}

.btn-stroke.btn-danger {
  border-color: rgba(229, 62, 62, .22);
  color: var(--s-red);
  background: var(--s-red-bg);
  box-shadow: var(--stroke-btn);
}

.btn-stroke.btn-danger:hover {
  background: var(--s-red);
  color: #fff;
  border-color: transparent;
}

.btn-full {
  width: 100%;
  justify-content: center;
  height: var(--ctrl-h-lg);
  font-size: .875rem;
  border-radius: var(--r-md);
}

.btn-stroke .btn-spinner {
  display: none;
}

.btn-stroke.loading .btn-spinner {
  display: block;
  animation: spin .6s linear infinite;
}

.btn-stroke.loading .btn-text,
.btn-stroke.loading .btn-ico {
  display: none;
}

.btn-stroke.loading {
  opacity: .7;
  pointer-events: none;
  cursor: not-allowed;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.field-hint {
  font-size: 11px;
  color: var(--faint);
}

.req {
  color: var(--brand);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.form-row-2>.field,
.form-row-3>.field {
  margin-bottom: 0;
}

.form-row-span-2 {
  grid-column: 1 / -1;
}

.drawer-bd .drawer-form-foot {
  margin: -2px 0 14px;
  line-height: 1.45;
}

.drawer-bd .btn-verify-ip-full {
  width: 100%;
  justify-content: center;
}

@media (max-width: 860px) {
  .form-row-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

.form-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 0 18px;
}

.form-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 12px;
}

.filters-bar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding: 12px 0 14px;
  flex-shrink: 0;
}

.filters-bar--wrap {
  align-items: flex-end;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-group--search {
  flex: 1 1 200px;
  min-width: 0;
}

.filter-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}

.filter-group--stack {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.filter-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sales-export-loading {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 15, 25, 0.55);
  backdrop-filter: blur(2px);
}

.sales-export-loading[hidden] {
  display: none !important;
}

.sales-export-loading__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 32px;
  border-radius: 8px;
  background: var(--surface, #26263a);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.sales-export-loading__text {
  margin: 0;
  font-size: 13px;
  color: var(--text, #e4e4eb);
}

body.sales-export-busy {
  overflow: hidden;
}

.input-date {
  min-width: 140px;
  max-width: 100%;
}

.filter-sep {
  font-size: 11px;
  color: var(--faint);
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-wrap svg {
  position: absolute;
  left: 8px;
  color: var(--faint);
  width: 13px;
  height: 13px;
  pointer-events: none;
}

.search-wrap .input-stroke {
  padding-left: 28px;
  min-width: 180px;
}

.table-wrap {
  position: relative;
  padding: 0;
  isolation: isolate;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.layout-main .view-wrap.mod-view[data-module="compliance"] {
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-padding-bottom: 28px;
}

.layout-main .view-wrap.mod-view[data-module="compliance"]>.table-wrap {
  flex: 0 0 auto;
  min-height: auto;

  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 6px;
}

.psig-view .table-wrap {
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
  padding-bottom: 6px;
}

.psig-view .mod-filters-shell {
  margin: 0 28px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  border-bottom: 1px solid var(--border);

  margin-bottom: 12px;
}

.psig-view .mod-filters-shell .filters-bar {
  padding: 12px 14px;
}

.table-wrap--fetching::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.table-wrap--fetching::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  pointer-events: none;
}

.table-wrap--fetching:has(tbody .loading-row) {
  opacity: 1;
}

.table-wrap--fetching:has(tbody .loading-row)::before,
.table-wrap--fetching:has(tbody .loading-row)::after {
  display: none;
}

.mod-filters-shell {
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.page-hd-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.page-hd-actions--split {
  justify-content: space-between;
}

.view-wrap.mod-view[data-module="evaluation"] .eval-sticky-hd {
  position: sticky;
  top: 0;
  z-index: 35;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);

}

.view-wrap.mod-view[data-module="evaluation"] .eval-main .eval-sticky-hd {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
  padding-bottom: 0;
  margin-bottom: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.10);
}

.view-wrap.mod-view[data-module="evaluation"] .eval-main .eval-sticky-hd > div:first-child {
  flex: 0 0 50px;
}

.view-wrap.mod-view[data-module="evaluation"] .eval-main .eval-hd-score {
  margin-top: 0;
  width: 100%;
}

.view-wrap.mod-view[data-module="evaluation"] .eval-main .eval-hd-score.perf-dashboard {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0;
  overflow: hidden;
}

.view-wrap.mod-view[data-module="evaluation"] .eval-hd-score .perf-overall {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 116px;
  padding: 12px 14px;
  border-right: 1px solid var(--border);
}

.view-wrap.mod-view[data-module="evaluation"] .eval-hd-score .perf-categories {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.view-wrap.mod-view[data-module="evaluation"] .eval-hd-score .perf-cat-item {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--border);
}

.view-wrap.mod-view[data-module="evaluation"] .eval-hd-score .perf-cat-item:last-child {
  border-right: none;
}

.view-wrap.mod-view[data-module="evaluation"] .eval-hd-score .perf-cat-name {
  margin-bottom: 6px;
}

.view-wrap.mod-view[data-module="evaluation"] .eval-hd-score .perf-cat-score {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 4px;
}

.view-wrap.mod-view[data-module="evaluation"] .eval-hd-score .perf-cat-bar {
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
  margin-bottom: 6px;
}

.view-wrap.mod-view[data-module="evaluation"] .eval-hd-score .perf-cat-bar-fill {
  height: 100%;
}

.bulk-toolbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 28px 0;
  font-size: 12px;
  color: var(--muted);
}

.bulk-toolbar--inline {
  padding: 10px 28px 14px;
  margin-top: 0;
  border-top: 1px solid var(--border);
}

.bulk-toolbar--visible {
  display: flex;
}

.bulk-toolbar-count {
  font-weight: 500;
}

.th-check {
  width: 36px;
  text-align: center;
  vertical-align: middle;
}

.td-check {
  width: 36px;
  text-align: center;
  vertical-align: middle;
}

.data-table .td-check input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--brand);
}

.bulk-country-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.bulk-country-bar[hidden] {
  display: none;
}

.pag-btn:disabled,
.pag-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 1000px;

  line-height: 1.38;
  position: relative;
  z-index: 0;
}

.data-table th {
  text-align: left;
  padding: var(--table-cell-py) 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: var(--table-cell-py) 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 13px;
  text-align: left;
}

.data-table tbody tr:hover {
  background: var(--hover);
}

.data-table tbody tr.mod-group-row td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 82%, var(--bg));
}

[data-theme="light"] .data-table tbody tr.mod-group-row td {
  background: rgba(0, 0, 0, 0.03);
}

.mod-group-row__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.data-table tbody tr.mod-row--affected,
.data-table tbody tr.mod-table-row--affected {
  background-color: color-mix(in srgb, var(--green) 11%, var(--panel));
    transition: background-color 0.55s ease, opacity 0.55s ease;
  }

  .data-table tbody tr.mod-row--affected:hover,
  .data-table tbody tr.mod-table-row--affected:hover {
    background-color: color-mix(in srgb, var(--green) 16%, var(--panel));
  }

  .data-table tbody tr.mod-row--affected,
  .data-table tbody tr.mod-table-row--affected {
    background-color: rgba(62, 207, 142, 0.1);
  }

  .data-table tbody tr.mod-row--affected:hover,
  .data-table tbody tr.mod-table-row--affected:hover {
    background-color: rgba(62, 207, 142, 0.15);
  }
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-d);
  border: 1px solid var(--brand-b);
  color: var(--brand);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mono {
  font-family: ui-monospace, 'Cascadia Mono', monospace;
}

.data-table .mono {
  font-size: 10.5px;
}

.text-sm {
  font-size: 11px;
}

.text-muted {
  color: var(--muted);
}

.muted-sm {
  font-size: 11px;
  color: var(--faint);
}

.data-table tbody tr.loading-row td {
  padding: 80px 10px;
  border-bottom: none;
  vertical-align: middle;
  text-align: center;
}

.table-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--faint);
  font-size: 13px;
  min-height: 200px;
  width: 100%;
}

.table-wrap {
  position: relative;
  transition: opacity 0.2s var(--ease);
}

.table-wrap--fetching {
  opacity: 0.6;
  pointer-events: none;
}

.table-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 64px;
  color: var(--faint);
  font-size: 12px;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.table-empty>svg:first-of-type {
  width: 32px;
  height: 32px;
  opacity: 0.4;
}

.table-empty .pipeline-empty-cta {
  margin-top: 8px;
  height: var(--ctrl-h);
  padding: 0 14px;
  color: var(--brand);
  position: relative;
  z-index: 3;
  pointer-events: auto;
}

.table-empty .pipeline-empty-cta svg {
  width: 14px;
  height: 14px;
  opacity: 1;
}

.spinner-ring {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .03em;
  border: 1px solid transparent;
}

.badge-role {
  background: var(--panel);
  border-color: var(--border);
  color: var(--muted);
}

.badge-active {
  background: rgba(62, 207, 142, .10);
  border-color: rgba(62, 207, 142, .25);
  color: #3ecf8e;
}

.badge-inactive {
  background: rgba(247, 96, 90, .08);
  border-color: rgba(247, 96, 90, .20);
  color: var(--red);
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 10px 0 16px;
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

.pag-toolbar-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-width: 0;
}

.pag-per-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pag-per-label {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.pag-per-select {
  height: var(--ctrl-h-sm);
  min-width: 72px;
  padding: 0 8px;
  font-size: 11.5px;
}

.pag-info {
  font-size: 11.5px;
}

.pag-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.pag-btn {
  height: var(--ctrl-h-sm);
  min-width: var(--ctrl-h-sm);
  padding: 0 6px;
  font-size: 11.5px;
}

.pag-btn.active {
  border-color: var(--brand-b);
  color: var(--brand);
  background: var(--brand-d);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay, rgba(0, 0, 0, .45));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}

[data-theme="light"] .drawer-overlay {
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.drawer-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 440px;
  max-width: 96vw;
  height: 100dvh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 61;
  transform: translateX(100%);
  transition: transform var(--slide);
  will-change: transform;
}

/* Drawer de los items nuevos del navbar (% Cierre, Firmas Pendientes,
   Cancelados) -- ancho fijo a lo que necesita la tabla del reporte "%
   Cierre" (~630px de contenido, ver assets/closing-report.css), en vez de
   la mitad del documento (que sobraba mucho en monitores anchos). */
#xm-drawer {
  width: min(760px, 94vw);
  max-width: 94vw;
}

.drawer.open {
  transform: translateX(0);
}

.side-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay, rgba(0, 0, 0, 0.45));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}

.side-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.side-modal {
  position: fixed;
  top: 0;
  right: 0;
  width: 440px;
  max-width: 96vw;
  height: 100dvh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 61;
  transform: translateX(100%);
  transition: transform var(--slide);
  will-change: transform;
}

.side-modal.active {
  transform: translateX(0);
}

[data-theme="light"] .side-modal-overlay {
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

#report-modal .report-hd {
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

#report-modal .report-title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  min-width: 0;
}

#report-modal .report-title-ico {
  color: var(--brand);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

#report-modal .report-bd {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
}

#report-modal .report-ft {
  flex-shrink: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: var(--surface);
}

#report-modal {
  background: var(--surface);
  opacity: 1;
}

[data-theme="light"] #report-modal .report-hd,
[data-theme="light"] #report-modal .report-bd,
[data-theme="light"] #report-modal .report-ft {
  background: #fff;
}

#report-modal .report-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 14px;
}

#report-modal .report-card--summary {
  background: color-mix(in srgb, var(--brand-d) 45%, var(--surface));
  border-color: color-mix(in srgb, var(--brand-b) 65%, var(--border));
}

#report-modal .report-kicker {
  font-size: 9px;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  font-weight: 800;
}

#report-modal .report-p {
  margin: 0;
  font-size: 12px;
  color: color-mix(in srgb, var(--text) 78%, transparent);
  line-height: 1.55;
}

#report-modal .report-subtitle {
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}

#report-modal .report-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#report-modal .report-btn {
  width: 100%;
  justify-content: flex-start;
  height: var(--ctrl-h);
  gap: 8px;
}

#report-modal .report-btn svg {
  width: 14px;
  height: 14px;
}

#lies-modal {
  background: var(--surface);
  opacity: 1;
}

#lies-modal .report-hd {
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

#lies-modal .report-title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  min-width: 0;
}

#lies-modal .report-title-ico {
  color: var(--brand);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

#lies-modal .report-bd {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
}

#lies-modal .report-ft {
  flex-shrink: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: var(--surface);
}

#lies-modal .report-ft .btn-stroke {
  height: var(--ctrl-h);
  min-height: var(--ctrl-h);
}

#lies-modal .report-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 14px;
}

#lies-modal .report-card--summary {
  background: color-mix(in srgb, var(--brand-d) 45%, var(--surface));
  border-color: color-mix(in srgb, var(--brand-b) 65%, var(--border));
}

#lies-modal .lies-summary__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 4px;
}

#lies-modal .lies-summary__num {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
}

#lies-modal .lies-summary__pct {
  font-size: 14px;
  font-weight: 900;
  opacity: 0.75;
  margin-left: 2px;
}

#lies-modal .lies-summary__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

#lies-modal .lies-summary__meta .pipe-badge {
  letter-spacing: .05em;
}

#lies-modal .lies-summary__meta .muted-sm {
  font-size: 11px;
  line-height: 1.4;
}

#lies-modal .report-kicker {
  font-size: 9px;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  font-weight: 800;
}

#lies-modal .report-subtitle {
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}

#lies-modal .lies-list {
  width: 100%;
}

#lies-modal .lies-list .report-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#lies-modal .lies-btn {
  width: 100%;
  justify-content: flex-start;
  height: auto;
  min-height: 40px;
  padding: 9px 12px;
  text-align: left;
  white-space: normal;
  line-height: 1.35;
  font-size: 12px;
  gap: 10px;
}

#lies-modal .lies-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

#lies-modal .lies-btn.is-on {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
  color: var(--text);
}

#lies-modal .lies-btn.is-on svg {
  color: var(--brand);
}

.view-wrap.mod-view[data-module="evaluation"] .perf-overall--integrity {
  cursor: pointer;
  transition: background var(--ease);
}

.view-wrap.mod-view[data-module="evaluation"] .perf-overall--integrity:hover {
  background: color-mix(in srgb, var(--s-red) 6%, transparent);
}

.view-wrap.mod-view[data-module="evaluation"] .integrity-circle {
  border-color: var(--s-red);
  color: var(--s-red);
}

.view-wrap.mod-view[data-module="evaluation"] .integrity-circle.lvl-good {
  border-color: #10b981;
  color: #10b981;
}

.view-wrap.mod-view[data-module="evaluation"] .integrity-circle.lvl-mid {
  border-color: #3b82f6;
  color: #3b82f6;
}

.view-wrap.mod-view[data-module="evaluation"] .integrity-circle.lvl-warn {
  border-color: #f59e0b;
  color: #f59e0b;
}

.view-wrap.mod-view[data-module="evaluation"] .integrity-circle.lvl-bad {
  border-color: #ef4444;
  color: #ef4444;
}

.drawer-hd {
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}

.drawer-title {
  font-size: 13px;
  font-weight: 600;
}

.drawer-bd {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(128, 128, 128, .15) transparent;
  position: relative;
}

.drawer-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 220px;
  padding: 24px 16px;
  color: var(--muted);
  font-size: 12px;
}

.drawer-loading.drawer-loading--visible {
  display: flex;
}

.drawer-content.drawer-content--hidden {
  display: none;
}

.drawer-bd .field .input-stroke,
.drawer-bd .field .select-stroke,
.drawer-bd .field textarea.input-stroke {
  width: 100%;
  box-sizing: border-box;
}

.drawer-bd .field textarea.input-stroke {
  min-height: 88px;
  padding: 8px 10px;
}

.drawer-ft {
  flex-shrink: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.drawer-ft.drawer-ft--loading #btn-transfer,
.drawer-ft.drawer-ft--loading #btn-save,
.drawer-ft.drawer-ft--loading #btn-return-processing {
  display: none !important;
}

.drawer-ft-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-ft-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.roles-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.role-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  font-size: 11.5px;
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
  user-select: none;
}

.role-check input {
  display: none;
}

.role-check:has(input:checked) {
  border-color: var(--brand-b);
  background: var(--brand-d);
  color: var(--brand);
}

.role-check:hover {
  border-color: var(--brand-b);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: .8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease),
    color var(--ease), box-shadow var(--ease), opacity var(--ease);
  white-space: nowrap;
  height: var(--ctrl-h);
  padding: 0 12px;
  line-height: 1;
}

.btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--stroke-btn);
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-hover);
  box-shadow: var(--stroke-btn-hover);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-body);
  border-color: var(--border-mid);
  box-shadow: var(--stroke-btn);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-h);
  border-color: var(--border-strong);
  box-shadow: var(--stroke-btn-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-body);
  border-color: var(--border-mid);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-h);
  border-color: var(--border-strong);
}

.btn-danger {
  background: var(--s-red-bg);
  color: var(--s-red);
  border-color: rgba(229, 62, 62, .22);
}

.btn-danger:hover:not(:disabled) {
  background: var(--s-red);
  color: #fff;
}

.btn-icon-only {
  width: var(--ctrl-icon);
  height: var(--ctrl-icon);
  padding: 0;
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
  border-radius: var(--r-sm);
  border: none;
}

.btn-icon-only:hover {
  background: var(--bg-hover);
  color: var(--text-h);
}

.btn-icon-only svg {
  width: 14px;
  height: 14px;
}

.btn-sm {
  height: var(--ctrl-h-sm);
  padding: 0 9px;
  font-size: .75rem;
  border-radius: var(--r-sm);
}

.btn-lg {
  height: var(--ctrl-h-lg);
  padding: 0 16px;
  font-size: .875rem;
}

.btn .btn-spinner {
  display: none;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.btn.loading .btn-spinner {
  display: block;
  animation: spin .65s linear infinite;
}

.btn.loading .btn-lbl {
  display: none;
}

.input,
.input-stroke,
.select,
select.select-stroke,
.textarea,
textarea.input-stroke {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-h);
  font-family: var(--font-sans);
  font-size: .8125rem;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--ease), box-shadow var(--ease);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .10);
}

.input,
.input-stroke,
.select,
select.select-stroke {
  padding: 0 10px;
  height: var(--ctrl-h);
}

.textarea,
textarea.input-stroke {
  padding: 8px 10px;
  height: auto;
  resize: vertical;
}

.input::placeholder,
.input-stroke::placeholder,
.select::placeholder,
select.select-stroke::placeholder {
  color: var(--text-muted);
}

.input:focus,
.input-stroke:focus,
.select:focus,
select.select-stroke:focus,
.textarea:focus,
textarea.input-stroke:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--ring);
}

.note-preview {
  width: 100%;
  background: rgba(var(--brand-rgb), 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 12px;
  color: var(--text-body);
  font-size: 12px;
  line-height: 1.6;
}

.ts-link {
  background: rgba(var(--brand-rgb), 0.15);
  color: var(--brand);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid rgba(var(--brand-rgb), 0.3);
  display: inline-block;
  margin: 2px;
  font-size: 11px;
}

.ts-link:hover {
  background: var(--brand);
  color: #000;
  box-shadow: 0 0 10px rgba(var(--brand-rgb), 0.4);
}

.mention-hint {
  position: absolute;
  color: rgba(var(--brand-rgb), 0.5);
  pointer-events: none;
  font-size: 12px;
  font-family: inherit;
  z-index: 5000;
  display: none;
}

select.select-stroke option,
select.select-stroke optgroup {
  background-color: var(--bg-input);
  color: var(--text-h);
}

.login-form-panel .field-label {
  display: block;
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 5px;
}

.select,
select.select-stroke {
  padding-right: 26px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.login-body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-sans);
}

.login-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  max-width: 1280px;
  margin: 0 auto;
  min-height: 100dvh;
  align-items: stretch;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  overflow: hidden;
}

.login-side {
  --text: var(--sb-text);
  --text-h: var(--sb-text);
  --text-body: var(--sb-muted);
  --text-muted: var(--sb-faint);
  --muted: var(--sb-muted);
  --faint: var(--sb-faint);
  --border: var(--sb-border);

  background: linear-gradient(165deg, var(--pal-dark-mid) 0%, var(--pal-dark-base) 50%, var(--pal-dark-deep) 100%);
  color: var(--sb-text);
  border-right: 1px solid var(--sb-border);
  padding: clamp(36px, 6vw, 64px) clamp(32px, 5vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login-side__glow {
  position: absolute;
  inset: -20% -10% auto -20%;
  height: 55%;
  background: radial-gradient(ellipse 70% 60% at 30% 20%, rgba(var(--brand-rgb), 0.22), transparent 70%);
  pointer-events: none;
}

.login-side::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.2;
  mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
  pointer-events: none;
}

.login-side__logo {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.login-side__mark {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(145deg, #6b6bbd, var(--brand));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(var(--brand-rgb), 0.22);
}

.login-side__mark svg {
  width: 22px;
  height: 22px;
}

.login-side__brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.15;
}

.login-side__name {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-h);
  letter-spacing: -0.03em;
}

.login-side__cloud {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}

.login-side__slogan {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 16px;
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
  letter-spacing: -0.01em;
}

.login-side__copy {
  position: relative;
  z-index: 1;
  margin-top: auto;
  margin-bottom: auto;
  text-align: left;
  max-width: 52ch;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.login-side__eyebrow {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--brand);
  margin-bottom: 14px;
}

.login-side__headline {
  font-size: clamp(1.5rem, 2.8vw, 2.05rem);
  font-weight: 600;
  color: var(--text-h);
  line-height: 1.15;
  letter-spacing: -0.035em;
  margin-bottom: 18px;
}

.login-side__headline-accent {
  color: var(--brand);
  font-style: normal;
  font-weight: 600;
}

.login-side__sub {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 42ch;
  margin: 0 0 18px;
}

.login-side__tagline {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-h);
  line-height: 1.5;
  max-width: 40ch;
  margin: 0 0 20px;
}

.login-side__mods {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.login-mod-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
  min-width: 0;
}

.login-mod-card:hover {
  border-color: var(--brand);
  color: var(--text-h);
  background: rgba(255, 255, 255, 0.03);
  transform: translateY(-1px);
}

.login-mod-card i,
.login-mod-card svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--brand);
  stroke-width: 2;
}

.login-mod-card span {
  white-space: normal;
  line-height: 1.25;
}

.login-side__footer {
  position: relative;
  z-index: 1;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 20px;
  opacity: 0.85;
}

.login-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  padding: clamp(36px, 6vw, 64px) clamp(32px, 5vw, 56px);
  max-width: 460px;
  width: 100%;
  margin-inline: auto;
  box-sizing: border-box;
}

.login-mobile-hero {
  display: none;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.login-mobile-hero__title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--text-h);
  margin: 8px 0 0;
}

.login-eyebrow-form {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 8px;
}

.login-title {
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text-h);
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
  max-width: 36ch;
}

.login-error {
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-size: 0.8125rem;
  margin-bottom: 16px;
  background: var(--s-red-bg);
  border: 1px solid rgba(229, 62, 62, 0.28);
  color: var(--s-red);
  line-height: 1.4;
}

.login-error.show {
  display: flex;
}

.login-error svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.login-form-panel .field {
  margin-bottom: 14px;
}

.login-pwd-wrap {
  position: relative;
}

.login-pwd-wrap .input {
  padding-right: 38px;
}

.login-pwd-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
}

.login-pwd-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-h);
}

.login-pwd-toggle svg {
  width: 14px;
  height: 14px;
}

.login-btn {
  width: 100%;
  margin-top: 6px;
}

.login-footer-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 22px;
  line-height: 1.45;
}

.theme-toggle-float {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-muted);
  box-shadow: var(--stroke-btn);
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}

.theme-toggle-float:hover {
  background: var(--bg-hover);
  color: var(--text-h);
  border-color: var(--border-mid);
}

.theme-toggle-float svg {
  width: 16px;
  height: 16px;
}

[data-theme="dark"] #ico-light {
  display: none !important;
}

[data-theme="light"] #ico-dark {
  display: none !important;
}

[data-theme="light"] body.login-body {
  background: var(--pal-subtle);
}

[data-theme="light"] .login-wrap {
  background: var(--pal-white);
  border-color: var(--pal-border);
}

@media (max-width: 900px) {
  .login-wrap {
    grid-template-columns: 1fr;
    max-width: 100%;
    width: 100%;
    min-width: 0;
    margin: 0;
    border-left: none;
    border-right: none;
  }

  .login-side {
    display: none;
  }

  .login-mobile-hero {
    display: block;
  }

  .login-form-panel {
    max-width: 100%;
    width: 100%;
    min-width: 0;
    margin-inline: auto;
    justify-self: center;
    padding: 56px max(16px, env(safe-area-inset-left)) 28px max(16px, env(safe-area-inset-right));
    text-align: center;
  }

  .login-form-panel form,
  .login-form-panel .login-error {
    text-align: left;
  }

  .login-eyebrow-form,
  .login-title,
  .login-subtitle {
    text-align: center;
  }

  .login-subtitle {
    margin-left: auto;
    margin-right: auto;
  }
}

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  overflow: auto;
}

.auth-card {
  width: 100%;
  max-width: 360px;
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.brand-dot {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--brand);
  flex-shrink: 0;
}

.auth-brand-name {
  font-size: 14px;
  font-weight: 700;
}

.auth-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.auth-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
}

.auth-card .field {
  margin-bottom: 12px;
}

.auth-card .input-stroke {
  width: 100%;
}

.auth-card .btn-full {
  margin-top: 6px;
}

.alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 12px;
  margin-bottom: 14px;
  border: 1px solid transparent;
}

.alert-error {
  background: rgba(247, 96, 90, .08);
  border-color: rgba(247, 96, 90, .25);
  color: var(--red);
}

.auth-footer {
  font-size: 11px;
  color: var(--faint);
  text-align: center;
  margin-top: 20px;
}

.not-found-card {
  align-items: center;
  text-align: center;
  gap: 12px;
}

.not-found-code {
  font-size: 72px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
}

.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 28px 28px;
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.settings-card-hd {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.settings-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--panel);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  flex-shrink: 0;
}

.settings-card-icon svg {
  width: 14px;
  height: 14px;
}

.settings-card-title {
  font-size: 13px;
  font-weight: 600;
}

.settings-card-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 1px;
}

.settings-card-bd {
  padding: 14px 16px 8px;
}

.settings-card-ft {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.save-status {
  font-size: 12px;
}

.save-ok {
  color: var(--green);
}

.save-err {
  color: var(--red);
}

.profile-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.profile-label {
  font-size: 11.5px;
  color: var(--faint);
  min-width: 64px;
  flex-shrink: 0;
  padding-top: 1px;
}

.profile-value {
  font-size: 12px;
}

.dash-view {
  --dash-accent: var(--brand);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--brand) 4%, transparent) 0%, transparent 28%),
    var(--bg);
}

.dash-hero {
  padding: 40px 32px 32px;
  border-bottom: 1px solid var(--border);
}

.dash-eyebrow {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brand);
}

.dash-hero-title {
  margin: 0 0 10px;
  font-size: clamp(1.75rem, 3.2vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}

.dash-hero-lead {
  margin: 0 0 22px;
  max-width: 42ch;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--muted);
}

.dash-shortcuts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
}

.dash-shortcut {
  position: relative;
  padding: 4px 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--muted);
  transition: color var(--ease);
}

.dash-shortcut::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--dash-accent);
  transition: width 0.25s var(--ease);
}

.dash-shortcut:hover {
  color: var(--text);
}

.dash-shortcut:hover::after {
  width: 100%;
}

.dash-shortcut--featured {
  color: var(--brand);
  font-weight: 600;
}

.dash-shortcut--featured::after {
  width: 100%;
  background: var(--brand);
}

.dash-body {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px 40px;
}

.dash-section {
  padding-top: 36px;
}

.dash-section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.dash-section-title {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}

.dash-section-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border) 0%, transparent 100%);
}

.dash-section-desc {
  margin: 0 0 18px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.dash-view .mod-module-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.dash-view .mod-module-list--solo {
  grid-template-columns: minmax(0, 1fr);
}

.dash-view .mod-module-list--solo .mod-module-card {
  grid-column: 1 / -1;
}

.dash-view .mod-module-card {
  border: none;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
  padding: 22px 20px;
  transition: background var(--ease);
}

.dash-view .mod-module-card:hover {
  transform: none;
  border-color: transparent;
  background: color-mix(in srgb, var(--panel) 92%, var(--surface));
  box-shadow: none;
}

.dash-view .mod-module-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 2px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.dash-view .mod-module-card-kicker {
  color: var(--brand);
  letter-spacing: 0.14em;
}

.dash-view .mod-module-card-title {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.dash-view .mod-module-card-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.dash-view .mod-module-card-arrow {
  opacity: 0.35;
}

.dash-view .mod-module-card:hover .mod-module-card-arrow {
  opacity: 1;
  color: var(--text);
}

.dash-view .mod-module-card--soon {
  background: color-mix(in srgb, var(--panel) 50%, var(--surface));
}

.dash-view .mod-module-card--feature-new {
  grid-column: 1 / -1;
  background: color-mix(in srgb, var(--brand) 5%, var(--surface));
  animation: dash-card-shine-pulse 2.8s ease-in-out infinite;
}

.mod-module-card--shimmer {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.mod-module-card--shimmer::after {
  content: '';
  position: absolute;
  top: -8%;
  left: -130%;
  width: 48%;
  height: 116%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 36%,
    rgba(255, 255, 255, 0.04) 42%,
    rgba(255, 255, 255, 0.18) 48%,
    rgba(214, 228, 240, 0.42) 50%,
    rgba(255, 255, 255, 0.28) 52%,
    rgba(255, 255, 255, 0.12) 58%,
    transparent 64%,
    transparent 100%
  );
  transform: skewX(-20deg);
  animation: dash-module-shimmer 3.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 3;
}

[data-theme="light"] .mod-module-card--shimmer::after {
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 36%,
    rgba(255, 255, 255, 0.35) 42%,
    rgba(255, 255, 255, 0.75) 48%,
    rgba(220, 232, 245, 0.95) 50%,
    rgba(255, 255, 255, 0.8) 52%,
    rgba(255, 255, 255, 0.45) 58%,
    transparent 64%,
    transparent 100%
  );
}

@keyframes dash-module-shimmer {
  0% {
    left: -130%;
  }

  42%,
  100% {
    left: 145%;
  }
}

.dash-view .mod-module-card--feature-new:hover {
  background: color-mix(in srgb, var(--brand) 9%, var(--panel));
}

.dash-view .mod-module-card-icon--featured {
  background: color-mix(in srgb, var(--brand) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  color: var(--brand);
}

@keyframes dash-card-shine-pulse {
  0%,
  100% {
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 24%, transparent);
  }

  50% {
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 72%, transparent);
  }
}

/** @deprecated usar dash-card-shine-pulse */
@keyframes dash-module-feature-pulse {
  0%,
  100% {
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 24%, transparent);
  }

  50% {
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 72%, transparent);
  }
}

.mod-module-card-badge--new {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
}

.dash-view .dash-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  padding: 0;
  margin: 0;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.dash-view .dash-grid--admin {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.dash-view .dash-card {
  border: none;
  border-radius: 0;
  padding: 20px 18px;
  background: var(--surface);
  box-shadow: none;
}

.dash-view .dash-card--link:hover {
  transform: none;
  box-shadow: none;
  background: color-mix(in srgb, var(--panel) 92%, var(--surface));
}

.dash-view .dash-card-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--faint);
}

.dash-view .dash-card-val {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.dash-view .dash-card-val--sm {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.dash-view .dash-card-label--inline {
  margin: 0;
}

.dash-view .dash-section--admin {
  padding-top: 28px;
}

@media (max-width: 960px) {
  .dash-view .mod-module-list {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 899px) {
  .dash-hero {
    padding: 28px 20px 24px;
  }

  .dash-body {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 560px) {
  .dash-view .dash-grid {
    grid-template-columns: 1fr;
  }
}

.mod-kicker {
  margin: 0 0 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand);
}

.mod-kicker--section {
  margin-bottom: 12px;
}

.mod-headline {
  margin: 0 0 14px;
  font-size: clamp(26px, 3.6vw, 36px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.12;
  color: var(--text);
}

.mod-headline-accent,
.mod-page-title .mod-headline-accent {
  color: var(--brand);
  font-weight: 600;
}

.mod-lead {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 54ch;
}

.dash-modules-wrap {
  padding: 0;
  box-sizing: border-box;
}

.mod-module-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mod-module-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--ease), background var(--ease), transform 0.2s var(--ease);
}

.mod-module-card:hover {
  border-color: var(--border-strong);
  background: var(--panel);
  transform: translateY(-1px);
}

.mod-module-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(var(--brand-rgb), 0.2), rgba(var(--brand-rgb), 0.06));
  border: 1px solid var(--brand-b);
  color: var(--brand);
  flex-shrink: 0;
}

.mod-module-card-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.mod-module-card-icon--muted {
  background: var(--panel);
  border-color: var(--border);
  color: var(--faint);
}

.mod-module-card-body {
  min-width: 0;
}

.mod-module-card-kicker {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 4px;
}

.mod-module-card-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.mod-module-card-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.mod-module-card-arrow {
  color: var(--faint);
  display: flex;
  align-items: center;
  opacity: 0.7;
}

.mod-module-card-arrow svg {
  width: 18px;
  height: 18px;
}

.mod-module-card:hover .mod-module-card-arrow {
  color: var(--brand);
  opacity: 1;
}

.mod-module-card--soon {
  cursor: default;
  opacity: 0.88;
  pointer-events: none;
}

.mod-module-card--soon:hover {
  transform: none;
  border-color: var(--border);
  background: var(--surface);
}

.mod-module-card-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--panel);
  white-space: nowrap;
}

/* Card de acceso directo a Automation -- paleta morada del hub de
   cerebros (autocontenida: automation-brain.css no carga en dashboard.php,
   asi que no se puede depender de sus variables --brain-*). */
.mod-module-card--brain {
  border-color: rgba(124, 92, 252, 0.3);
  background: color-mix(in srgb, #7C5CFC 5%, var(--surface));
}

.dash-view .mod-module-card--brain:hover,
.mod-module-card--brain:hover {
  border-color: rgba(124, 92, 252, 0.5);
  background: color-mix(in srgb, #7C5CFC 9%, var(--panel));
}

.mod-module-card-icon--brain,
.dash-view .mod-module-card-icon--brain {
  position: relative;
  border-radius: 50%;
  background: rgba(124, 92, 252, 0.14);
  border-color: rgba(124, 92, 252, 0.4);
  color: #7C5CFC;
}

/* Mismo halo giratorio que .au-brain-core::before (assets/automation-brain.css)
   -- circular, borde arriba+derecha coloreado, resto transparente. */
.mod-module-card-icon--brain::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #7C5CFC;
  border-right-color: #7C5CFC;
  animation: mod-brain-spin 1.8s linear infinite;
}

@keyframes mod-brain-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.mod-module-card-badge--brain {
  border-color: rgba(124, 92, 252, 0.45);
  color: #7C5CFC;
  background: rgba(124, 92, 252, 0.12);
}

/* Automation encabezando "Reports": a diferencia del resto de acentos (que
   son tintes del 7%), este va con fondo amarillo lleno -- es la puerta al hub
   de cerebros (Leader Board, Campaing, Closing Report) y tiene que cantar
   dentro de la lista, no confundirse con una pagina mas. */
.sb-item--yellow-fill {
  background: #FACC15;
  color: #3A2E05;
  font-weight: 600;
}

.sb-item--yellow-fill:hover {
  background: #FDE047;
  color: #3A2E05;
}

.sb-item--yellow-fill.active {
  background: #FDE047;
  color: #2B2204;
  box-shadow: inset 3px 0 0 rgba(120, 90, 5, .65);
}

.mod-page-hero {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 28px 12px;
  box-sizing: border-box;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: min-content;

  overflow-x: hidden;
  overflow-y: visible;
  background: linear-gradient(165deg, rgba(75, 200, 247, 0.045) 0%, transparent 40%),
    linear-gradient(180deg, rgba(var(--brand-rgb), 0.06) 0%, transparent 50%);
}

.mod-page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.11;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(112deg, #000 0%, #000 54%, transparent 88%);
  pointer-events: none;
}

.mod-page-hero-text {
  position: relative;
  z-index: 1;
  flex: 1 1 280px;
  min-width: 0;
  max-width: 760px;
  padding: 18px 20px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(26, 27, 31, 0.76);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .mod-page-hero-text {
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.mod-page-title {
  margin: 0 0 10px;
  font-size: clamp(22px, 2.8vw, 28px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
}

.mod-page-lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 62ch;
}

.mod-page-lead strong {
  color: var(--text);
  font-weight: 600;
}

.mod-page-hero-actions {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  align-self: center;
}

.mod-page-cta {
  min-height: var(--ctrl-h);
}

.mod-view .page-hd--compact {
  padding-top: 8px;
}

.page-hd--compact .mod-kicker--section {
  margin-bottom: 8px;
}

.page-title--section {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

@media (max-width: 899px) {
  .mod-page-hero {
    padding-left: 16px;
    padding-right: 16px;
  }
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  padding: 18px 28px;
}

.dash-grid--admin {
  padding-top: 0;
}

.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  box-shadow: none;
}

.dash-card--link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--ease), background var(--ease);
}

.dash-card--link:hover {
  border-color: var(--border-strong);
  background: var(--panel);
}

.dash-card-link-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.dash-card-link-hd svg {
  width: 16px;
  height: 16px;
  color: var(--brand);
}

.dash-card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--faint);
  margin-bottom: 6px;
}

.dash-card-val {
  font-size: 22px;
  font-weight: 700;
}

.dash-card-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
}

.pipeline-readonly-block {
  font-size: 12px;
  margin-bottom: 12px;
  line-height: 1.45;
}

.pipe-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  border: 1px solid var(--border);
}

.pipe-badge--sales-pend,
.pipe-badge--sales-signing,
.pipe-badge--sales-signed,
.pipe-badge--sales-tdw,
.pipe-badge--sales-ret,
.pipe-badge--prog-signature,
.pipe-badge--proc-status-processing,
.pipe-badge--proc-doc-sent,
.pipe-badge--proc-status-returned,
.pipe-badge--proc-rejected,
.pipe-badge--proc-transfer,
.pipe-badge--proc-pipeline-return,
.pipe-badge--proc-pipeline-pending,
.pipe-badge--proc-pipeline-en {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
}

.pipe-badge--proc {
  color: var(--cyan);
  border-color: rgba(75, 200, 247, .28);
  background: rgba(75, 200, 247, .09);
}

.pipe-badge--sales {
  color: var(--brand);
  border-color: var(--brand-b);
  background: var(--brand-d);
}

.pipe-badge--comp {
  color: var(--purple);
  border-color: rgba(123, 143, 247, .28);
  background: rgba(123, 143, 247, .09);
}

.pipe-badge--enr {
  color: var(--green);
  border-color: rgba(62, 207, 142, .28);
  background: rgba(62, 207, 142, .09);
}

.pipe-badge--qc,
.pipe-badge--proc-rejected {
  color: var(--amber);
  border-color: rgba(247, 169, 75, .28);
  background: rgba(247, 169, 75, .09);
}

.pipe-badge--sales-pend {
  color: #b4b4be;
  background: #222226;
  border-color: rgba(255, 255, 255, 0.08);
}

.pipe-badge--sales-signing,
.pipe-badge--proc-status-processing,
.pipe-badge--proc-pipeline-en {
  color: #9d86e0;
  background: #1f1a33;
  border-color: rgba(157, 134, 224, 0.22);
}

.pipe-badge--sales-signed,
.pipe-badge--proc-transfer {
  color: #4ade80;
  background: #122116;
  border-color: rgba(74, 222, 128, 0.22);
}

.pipe-badge--sales-tdw,
.pipe-badge--proc-doc-sent,
.pipe-badge--proc-pipeline-pending {
  color: #d9cc41;
  background: #222110;
  border-color: rgba(217, 204, 65, 0.2);
}

.pipe-badge--sales-ret,
.pipe-badge--proc-status-returned,
.pipe-badge--proc-pipeline-return {
  color: #f87171;
  background: #291415;
  border-color: rgba(248, 113, 113, 0.22);
}

.pipe-badge--sales-cancelation {
  color: #fb923c;
  background: #2b1d11;
  border-color: rgba(251, 146, 60, 0.22);
}

.pipe-badge--sales-nsf {
  color: #f7a94b;
  background: #261a10;
  border-color: rgba(247, 169, 75, 0.22);
}

.pipe-badge--sales-cancelled {
  color: #f87171;
  background: #291415;
  border-color: rgba(248, 113, 113, 0.22);
}

.pipe-badge--prog-signature {
  color: #e68a4d;
  background: #2b1d11;
  border-color: rgba(230, 138, 77, 0.22);
}

[data-theme="light"] .pipe-badge--sales-pend {
  color: #5a5a62;
  background: #ececee;
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .pipe-badge--sales-signing,
[data-theme="light"] .pipe-badge--proc-status-processing,
[data-theme="light"] .pipe-badge--proc-pipeline-en {
  color: #6b4fc9;
  background: #f0ecf9;
  border-color: rgba(107, 79, 201, 0.2);
}

[data-theme="light"] .pipe-badge--sales-signed,
[data-theme="light"] .pipe-badge--proc-transfer {
  color: #15803d;
  background: #ecfdf3;
  border-color: rgba(34, 197, 94, 0.28);
}

[data-theme="light"] .pipe-badge--sales-tdw,
[data-theme="light"] .pipe-badge--proc-doc-sent,
[data-theme="light"] .pipe-badge--proc-pipeline-pending {
  color: #854d0e;
  background: #fefce8;
  border-color: rgba(202, 138, 4, 0.28);
}

[data-theme="light"] .pipe-badge--sales-ret,
[data-theme="light"] .pipe-badge--proc-status-returned,
[data-theme="light"] .pipe-badge--proc-pipeline-return {
  color: #b91c1c;
  background: #fef2f2;
  border-color: rgba(248, 113, 113, 0.35);
}

[data-theme="light"] .pipe-badge--sales-cancelation {
  color: #c2410c;
  background: #fff7ed;
  border-color: rgba(234, 88, 12, 0.28);
}

[data-theme="light"] .pipe-badge--sales-nsf {
  color: #b45309;
  background: #fffbeb;
  border-color: rgba(245, 158, 11, 0.35);
}

[data-theme="light"] .pipe-badge--sales-cancelled {
  color: #b91c1c;
  background: #fef2f2;
  border-color: rgba(248, 113, 113, 0.35);
}

[data-theme="light"] .pipe-badge--qc,
[data-theme="light"] .pipe-badge--proc-rejected {
  color: #b45309;
  background: #fffbeb;
  border-color: rgba(245, 158, 11, 0.35);
}

[data-theme="light"] .pipe-badge--prog-signature {
  color: #c2410c;
  background: #fff7ed;
  border-color: rgba(234, 88, 12, 0.28);
}

.pipe-badge--stage-lg {
  font-size: 11px;
  padding: 4px 10px;
  text-transform: lowercase;
}

.data-table th.th-badge-col,
.data-table td.td-badge-col {
  vertical-align: middle;
  min-width: 7.25rem;
}

.pipe-badge-stretch {
  display: block;
  width: 100%;
}

.data-table .td-badge-col .pipe-badge {
  font-size: 9.5px;
  padding: 3px 8px;
}

.data-table td.td-badge-col .pipe-badge {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  justify-content: flex-start;
  align-items: center;
  text-align: left;
  white-space: normal;
  word-break: break-word;
  hyphens: none;
  min-height: 1.65rem;
}

.data-table th.th-pipeline-col,
.data-table td.td-pipeline-col .pipe-badge {
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.view-wrap.lb-view {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.lb-column--av-table .av-matrix-border {
  width: 100%;
  max-width: 100%;
  display: block;
  box-sizing: border-box;
}

.lb-view .lb-matrix-seg {
  width: 100%;
}

.lb-view.av-view .lb-matrix-seg {
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.lb-view.av-view .lb-matrix-seg thead tr:not(.lb-matrix__banner-row) th {
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted, var(--muted));
}

.lb-view.av-view .lb-matrix-seg tbody tr td {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.lb-view.av-view .lb-matrix-seg tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.lb-view.av-view .lb-matrix-seg tbody tr:hover td {
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
}

.lb-view.av-view .lb-matrix-seg .av-cell-num {
  font-weight: 600;
}

.lb-view.av-view .lb-matrix-seg tfoot .lb-row-grand th,
.lb-view.av-view .lb-matrix-seg tfoot .lb-row-grand td {
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  border-top: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border));
}

.lb-view.av-view .lb-matrix-seg tfoot .lb-row-grand .lb-grand-label {
  font-weight: 700;
  color: var(--text-h, var(--text));
}

.lb-view.av-view .lb-matrix-seg .lb-td-agent {
  font-weight: 600;
  color: var(--text-h, var(--text));
}

[data-theme="light"] .lb-view.av-view .lb-matrix-seg tbody tr:hover td {
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
}

[data-theme="light"] .lb-view.av-view .lb-matrix-seg tfoot .lb-row-grand th,
[data-theme="light"] .lb-view.av-view .lb-matrix-seg tfoot .lb-row-grand td {
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
  border-top: 1px solid color-mix(in srgb, var(--brand) 20%, var(--border));
}

.lb-th-agent,
.lb-td-agent {
  text-align: left;
  min-width: 0;
  word-break: break-word;
}

.lb-row-grand .lb-grand-label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 9px;
  color: var(--muted);
  font-weight: 600;
}

.lb-view .lb-matrix-seg tbody tr.lb-card--tier-top3 td {
  background: color-mix(in srgb, var(--green) 22%, var(--surface));
  border-top: 1px solid color-mix(in srgb, var(--green) 35%, transparent);
}

.lb-view .lb-matrix-seg tbody tr.lb-card--tier-next9 td {
  background: color-mix(in srgb, var(--green) 12%, var(--surface));
}

.lb-view .lb-matrix-seg tbody tr.lb-card--tier-rest td {
  background: var(--surface);
}

.lb-view .lb-matrix-seg tbody tr:hover {
  background: transparent;
}

.lb-view .lb-matrix-seg tbody tr:hover td {
  filter: brightness(1.06);
}

.lb-view .lb-totals {
  margin-left: 28px;
  margin-right: 28px;
  margin-bottom: 8px;
  width: auto;
  max-width: calc(100% - 56px);
  min-width: 0;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-wrap: break-word;
}

.lb-view .lb-totals>p {
  max-width: 100%;
}

.lb-view .lb-totals .lb-totals-grid>div {
  min-width: 0;
}

@media (max-width: 899px) {
  .lb-view .lb-totals {
    margin-left: 16px;
    margin-right: 16px;
    max-width: calc(100% - 32px);
  }
}

.lb-bucket-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 8px;
  padding: 0 20px 10px;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  align-items: start;
}

.lb-bucket-board--unified {
  padding-top: 4px;
}

.lb-bucket-board--cols-1 {
  grid-template-columns: minmax(0, 1fr);
  /*max-width: calc((100% - 40px) / 3);*/
}

.lb-bucket-board--cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lb-bucket-board--cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lb-bucket-board--other-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 0;
}

.lb-bucket-board--other-row > .lb-bucket-wrap {
  grid-column: 1;
  max-width: 100%;
}

@media (max-width: 1100px) {
  .lb-bucket-board--cols-1,
  .lb-bucket-board--cols-2,
  .lb-bucket-board--cols-3,
  .lb-bucket-board--other-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }

  .lb-bucket-board--other-row > .lb-bucket-wrap {
    grid-column: auto;
  }
}

.lb-view .lb-bucket-board:not(.lb-bucket-board--single) {
  align-items: stretch;
}

.lb-view .lb-bucket-board:not(.lb-bucket-board--single) .lb-bucket-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  height: 100%;
}

.lb-view .lb-bucket-board:not(.lb-bucket-board--single) .lb-column.lb-column--av-table {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.lb-view .lb-bucket-board:not(.lb-bucket-board--single) .lb-column.lb-column--av-table .lb-column__scroller {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.lb-view .lb-bucket-board--unified .av-matrix-border {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.lb-view .lb-bucket-board--unified .lb-matrix-seg.av-matrix--by-day {
  flex: 1 1 auto;
  height: 100%;
  table-layout: fixed;
}

.lb-view .lb-bucket-board--unified .lb-matrix-seg.av-matrix--by-day tbody {
  min-height: calc(var(--lb-table-body-rows, 10) * 30px);
}

.lb-view .lb-bucket-board--unified .lb-matrix-seg.av-matrix--by-day tbody tr td,
.lb-view .lb-bucket-board--unified .lb-matrix-seg.av-matrix--by-day tbody tr th {
  height: 30px;
  box-sizing: border-box;
  vertical-align: middle;
}

.lb-bucket-board--single {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

@media (max-width: 640px) {
  .lb-bucket-board {
    grid-template-columns: 1fr;
    padding-left: 14px;
    padding-right: 14px;
  }
}

.lb-view .lb-section-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  vertical-align: middle;
}

.lb-view .lb-column.lb-column--av-table {
  border: none;
  box-shadow: none;
  background: transparent;
}

.lb-view .lb-matrix__banner-inner {
  border-left: none !important;
  box-shadow: none;
  padding-left: 10px;
}

.lb-view .lb-matrix__banner-inner.lb-column__head-inner--split {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.lb-view .lb-column__head-left {
  flex: none;
  width: 100%;
  min-width: 0;
}

.lb-view .lb-column__head-managers {
  flex: none;
  width: 100%;
  max-width: 100%;
  text-align: left;
  padding-top: 4px;
  margin-top: 2px;
  border-top: 1px solid color-mix(in srgb, var(--lb-seg-line, var(--border)) 22%, transparent);
}

.lb-view .lb-column__title {
  font-size: 12px;
  line-height: 1.25;
}

.lb-view .lb-column__meta {
  font-size: 11px;
  line-height: 1.3;
}

.lb-view .lb-column__mgr-v {
  font-size: 9.5px;
  line-height: 1.2;
}

.lb-top-strip {
  display: grid;
  grid-template-columns: minmax(168px, 0.95fr) minmax(0, 1.15fr) minmax(0, 1.15fr) minmax(120px, 0.75fr);
  gap: 8px;
  padding: 6px 20px 10px;
  align-items: stretch;
}

.lb-pipeline-flow {
  padding: 6px 20px 2px;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.lb-pipeline-flow__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 14px 20px 14px;
  min-width: 0;
}

.lb-pipeline-flow__hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.lb-pipeline-flow__title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.lb-pipeline-flow__range {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.lb-pipeline-flow__hero {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text-h, var(--text));
}

.lb-pipeline-flow__split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr) 1px minmax(0, 1fr) 1px minmax(0, 1fr) 1px minmax(0, 1fr);
  gap: 0 20px;
  align-items: start;
}

.lb-pipeline-flow__side--range {
  gap: 6px;
}

.lb-pipeline-flow__range-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-pipeline-flow__range-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lb-pipeline-flow__range-field .filter-label {
  font-size: 11px;
}

.lb-pipeline-flow__range-field .input-date {
  width: 100%;
  box-sizing: border-box;
}

.lb-pipeline-flow__range-btn {
  align-self: flex-start;
  margin-top: 2px;
}

.lb-pipeline-flow__side--total {
  gap: 5px;
}

.lb-pipeline-flow__side--sales,
.lb-pipeline-flow__side--opps {
  gap: 10px;
}

.lb-pipeline-flow__side--debt {
  gap: 6px;
}

.lb-pipeline-flow__side--debt .lb-debt-gauge__hint {
  margin: -2px 0 0;
}

.lb-pipeline-flow__side--debt .lb-debt-gauge__wrap {
  height: 68px;
  min-height: 68px;
  flex: none;
}

.lb-panel-loading.lb-pipeline-flow__side--debt .lb-debt-gauge__val {
  bottom: 28%;
}

.lb-pipeline-flow__divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
  opacity: 0.85;
}

.lb-pipeline-flow__side {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
  min-width: 0;
}

.lb-pipeline-flow__side-top {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.lb-pipeline-flow__big {
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.lb-pipeline-flow__side--sales .lb-pipeline-flow__big {
  color: var(--green, #3ecf8e);
}

.lb-pipeline-flow__side--opps .lb-pipeline-flow__big {
  color: var(--red, #f7605a);
}

.lb-pipeline-flow__tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.lb-pipeline-flow__note {
  margin: -6px 0 0;
  font-size: 11px;
  color: var(--muted);
}

.lb-pipeline-flow__meter {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lb-pipeline-flow__pct {
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.lb-pipeline-flow__pct--sales {
  color: var(--green, #3ecf8e);
}

.lb-pipeline-flow__pct--opps {
  color: var(--red, #f7605a);
}

.lb-pipeline-flow__track {
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 55%, transparent);
  overflow: hidden;
}

.lb-pipeline-flow__fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.35s ease;
}

.lb-pipeline-flow__fill--sales {
  background: var(--green, #3ecf8e);
}

.lb-pipeline-flow__fill--opps {
  background: var(--red, #f7605a);
  opacity: 0.92;
}

[data-theme="light"] .lb-pipeline-flow__card {
  background: #fff;
}

[data-theme="light"] .lb-pipeline-flow__side--sales .lb-pipeline-flow__big {
  color: #15803d;
}

[data-theme="light"] .lb-pipeline-flow__side--opps .lb-pipeline-flow__big {
  color: #dc2626;
}

@media (max-width: 980px) {
  .lb-pipeline-flow__split {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
  }

  .lb-pipeline-flow__side {
    flex: 1 1 220px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
  }

  .lb-pipeline-flow__side--range {
    border-top: none;
    padding-top: 0;
  }

  .lb-pipeline-flow__divider {
    display: none;
  }
}

@media (max-width: 720px) {
  .lb-pipeline-flow {
    padding-left: 14px;
    padding-right: 14px;
  }

  .lb-pipeline-flow__card {
    padding: 14px 16px 16px;
  }

  .lb-pipeline-flow__side {
    flex-basis: 100%;
  }
}

.lb-insight-kpi,
.lb-insight-chart,
.lb-qcard.lb-qcard--compact {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.lb-insight-kpi {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 8px 10px;
}

.lb-insight-kpi__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.lb-insight-kpi__val {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--brand);
}

.lb-insight-kpi--opps .lb-insight-kpi__val {
  color: #4bc8f7;
}

.lb-insight-kpi__hint {
  font-size: 9.5px;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="light"] .lb-insight-kpi--opps .lb-insight-kpi__val {
  color: #0e7490;
}

.lb-insight-chart {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px 4px;
}

.lb-insight-chart__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}

.lb-insight-chart__wrap {
  position: relative;
  min-height: 88px;
  flex: 1 1 auto;
}

.lb-bar-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  min-height: 88px;
}

.lb-bar-list__row {
  display: grid;
  grid-template-columns: minmax(0, 38%) minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.lb-bar-list__name {
  font-size: 10px;
  line-height: 1.2;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-bar-list__track {
  height: 8px;
  background: color-mix(in srgb, var(--muted) 12%, transparent);
  border-radius: 4px;
  overflow: hidden;
  min-width: 0;
}

.lb-bar-list__fill {
  height: 100%;
  border-radius: 4px;
  min-width: 2px;
  transition: width 0.25s ease;
}

.lb-bar-list__val {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  min-width: 1.5em;
  text-align: right;
}

.lb-bar-list__empty {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.lb-stat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
}

.lb-stat-table th {
  text-align: right;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 2px 4px 4px;
  border-bottom: 1px solid var(--border);
}

.lb-stat-table th:first-child,
.lb-stat-table td:first-child {
  text-align: left;
}

.lb-stat-table td {
  padding: 3px 4px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-align: right;
}

.lb-stat-table tbody tr:last-child td {
  border-bottom: none;
}

.lb-stat-table td:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
}

.lb-stat-table__val {
  font-weight: 700;
  color: var(--brand);
}

.lb-stat-table__incomplete {
  font-weight: 700;
  color: var(--red, #f7605a);
}

.lb-stat-table__incomplete--zero {
  color: var(--muted);
  font-weight: 400;
}

.lb-data-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.lb-main-loading {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 60;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0;
  background: color-mix(in srgb, var(--bg, #fcfcff) 72%, transparent);
  backdrop-filter: blur(2px);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}

.lb-main-loading--visible {
  display: flex;
}

.lb-main-loading .spinner-ring {
  width: 34px;
  height: 34px;
  border-width: 3px;
}

.lb-inline-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 32px;
  color: var(--muted);
  font-size: 11px;
}

.lb-inline-loading--sm {
  min-height: 0;
  gap: 0;
}

.lb-inline-loading .spinner-ring {
  width: 18px;
  height: 18px;
}

.lb-inline-loading--sm .spinner-ring {
  width: 16px;
  height: 16px;
}

.lb-panel-loading .lb-insight-kpi__val,
.lb-panel-loading .lb-mini-stat__val,
.lb-panel-loading .lb-qcard__num {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 1.5em;
}

.lb-view {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.lb-view.lb-view--fetching .lb-data-shell {
  pointer-events: none;
  user-select: none;
}

.lb-qcard.lb-qcard--compact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color var(--ease), box-shadow var(--ease);
  min-height: 0;
}

.lb-qcard.lb-qcard--compact:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
}

.lb-qcard.lb-qcard--compact .lb-qcard__hd {
  font-size: 11px;
  gap: 4px;
}

.lb-qcard.lb-qcard--compact .lb-qcard__hd svg {
  width: 12px;
  height: 12px;
}

.lb-qcard.lb-qcard--compact .lb-qcard__num {
  font-size: 18px;
  line-height: 1;
}

.lb-qcard.lb-qcard--compact .lb-qcard__ft {
  font-size: 10px;
  margin-top: auto;
}

.lb-qcard.lb-qcard--compact .lb-qcard__tag {
  font-size: 8px;
  padding: 0 5px;
}

@media (max-width: 1100px) {
  .lb-top-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .lb-top-strip {
    grid-template-columns: 1fr;
    padding-left: 14px;
    padding-right: 14px;
  }

  .lb-bucket-board--cols-1,
  .lb-bucket-board--cols-2,
  .lb-bucket-board--cols-3,
  .lb-bucket-board--other-row {
    grid-template-columns: 1fr;
    max-width: none;
  }
}

.lb-view.av-view .lb-bucket-wrap .lb-matrix-seg.av-matrix--by-day tbody td,
.lb-view.av-view .lb-bucket-wrap .lb-matrix-seg.av-matrix--by-day tbody th,
.lb-view.av-view .lb-bucket-wrap .lb-matrix-seg.av-matrix--by-day tfoot td,
.lb-view.av-view .lb-bucket-wrap .lb-matrix-seg.av-matrix--by-day tfoot th,
.lb-view.av-view .av-matrix-border .av-matrix--by-day>thead>tr:not(.lb-matrix__banner-row)>th {
  padding: 4px 6px;
  font-size: 11px;
  line-height: 1.3;
}

.lb-view .lb-matrix__banner-inner {
  padding: 6px 8px 7px;
}

.lb-column.lb-column--av-table .lb-column__scroller {
  max-height: min(52vh, 520px);
  overflow-x: auto;
}

.lb-view .lb-totals {
  margin-left: 20px;
  margin-right: 20px;
  margin-bottom: 6px;
  padding: 12px 14px;
}

.lb-totals-grid--wide {
  gap: 10px;
}

.lb-total-val {
  font-size: 15px;
}

.lb-view .mod-filters-shell {
  padding: 6px 20px 4px;
}

.lb-bucket-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.lb-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  max-height: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.08));
}

.lb-column.lb-column--av-table {
  max-height: none;
  height: auto;
}

.lb-column.lb-column--av-table .lb-column__scroller {
  flex: 0 1 auto;
  min-height: 0;
  max-height: min(72vh, 780px);
  overflow-y: auto;
  overflow-x: hidden;
}

.lb-column__head {
  flex-shrink: 0;
  padding: 6px 10px 6px;
  border-left: 4px solid var(--lb-seg-line, var(--border-mid));
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.lb-matrix__banner-row .lb-matrix__banner-th {
  padding: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  vertical-align: top;
}

.lb-matrix__banner-inner {
  padding: 10px 12px 11px;
  border-left: 5px solid var(--lb-seg-line, var(--brand));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lb-seg-line) 18%, transparent);
}

.lb-matrix__banner-th.lb-col-head--es-us {
  --lb-seg-line: #f0625c;
  background: color-mix(in srgb, #f0625c 30%, var(--surface));
}

.lb-matrix__banner-th.lb-col-head--es-hn {
  --lb-seg-line: #f0625c;
  background: color-mix(in srgb, #f0625c 30%, var(--surface));
}

.lb-matrix__banner-th.lb-col-head--en {
  --lb-seg-line: #4bc8f7;
  background: color-mix(in srgb, #4bc8f7 28%, var(--surface));
}

.lb-matrix__banner-th.lb-col-head--payday {
  --lb-seg-line: #94a3b8;
  background: color-mix(in srgb, #94a3b8 24%, var(--surface));
}

.lb-matrix__banner-th.lb-col-head--combined-sg {
  --lb-seg-line: #eab308;
  background: color-mix(in srgb, #eab308 32%, var(--surface));
}

.lb-matrix__banner-th.lb-col-head--other {
  --lb-seg-line: #787878;
  background: color-mix(in srgb, #787878 22%, var(--surface));
}

.lb-matrix__banner-th.lb-col-head--other-leads {
  --lb-seg-line: #8a8a8a;
  background: color-mix(in srgb, #8a8a8a 22%, var(--surface));
}

/* P.D.: los 4 bloques que pintaban .lb-matrix__banner-th por manager (con
   !important + mas especificidad que .lb-col-head--es-us/es-hn/en/other-leads)
   se quitaron a proposito -- el titulo del segmento debe reflejar el
   segmento (rojo/azul/gris), no el manager dueno del bucket. El acento del
   manager sigue vivo en el borde de la tabla (.av-matrix-border de abajo) y
   en la fila de agentes (thead tr:not(.lb-matrix__banner-row) mas abajo). */

.lb-view .lb-bucket-wrap--mgr-svarela .av-matrix-border {
  border-color: rgba(230, 100, 100, 0.42);
}

.lb-view .lb-bucket-wrap--mgr-smiller .av-matrix-border {
  border-color: rgba(210, 175, 55, 0.45);
}

.lb-view .lb-bucket-wrap--mgr-gflores .av-matrix-border {
  border-color: rgba(140, 140, 140, 0.45);
}

.lb-view .lb-bucket-wrap--mgr-smiller_gflores .av-matrix-border {
  border-color: rgba(210, 175, 55, 0.45);
}

.lb-view .lb-bucket-wrap--mgr-svarela .lb-matrix-seg.av-matrix--by-day>thead>tr:not(.lb-matrix__banner-row)>th {
  background: linear-gradient(180deg, #2c1818, #1f1414);
  color: #f0a8a8;
  border-bottom: 1px solid rgba(230, 100, 100, 0.35) !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.lb-view .lb-bucket-wrap--mgr-smiller .lb-matrix-seg.av-matrix--by-day>thead>tr:not(.lb-matrix__banner-row)>th {
  background: linear-gradient(180deg, #2e2a16, #221f10);
  color: #e8df68;
  border-bottom: 1px solid rgba(210, 175, 55, 0.38) !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.lb-view .lb-bucket-wrap--mgr-gflores .lb-matrix-seg.av-matrix--by-day>thead>tr:not(.lb-matrix__banner-row)>th {
  background: linear-gradient(180deg, #242424, #1a1a1a);
  color: #c8c8c8;
  border-bottom: 1px solid rgba(130, 130, 130, 0.35) !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.lb-view .lb-bucket-wrap--mgr-smiller_gflores .lb-matrix-seg.av-matrix--by-day>thead>tr:not(.lb-matrix__banner-row)>th {
  background: linear-gradient(180deg, #2e2a16, #221f10);
  color: #e8df68;
  border-bottom: 1px solid rgba(210, 175, 55, 0.38) !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

[data-theme="light"] .lb-view .lb-bucket-wrap--mgr-svarela .lb-matrix-seg.av-matrix--by-day>thead>tr:not(.lb-matrix__banner-row)>th {
  background: linear-gradient(180deg, #fce8e8, #f5d6d6);
  color: #7a2020;
  border-bottom: 1px solid rgba(200, 80, 80, 0.35) !important;
  text-shadow: none;
}

[data-theme="light"] .lb-view .lb-bucket-wrap--mgr-smiller .lb-matrix-seg.av-matrix--by-day>thead>tr:not(.lb-matrix__banner-row)>th {
  background: linear-gradient(180deg, #f8f2d4, #ede2b8);
  color: #5c5410;
  border-bottom: 1px solid rgba(180, 155, 50, 0.4) !important;
  text-shadow: none;
}

[data-theme="light"] .lb-view .lb-bucket-wrap--mgr-gflores .lb-matrix-seg.av-matrix--by-day>thead>tr:not(.lb-matrix__banner-row)>th {
  background: linear-gradient(180deg, #ececec, #e0e0e0);
  color: #333;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12) !important;
  text-shadow: none;
}

[data-theme="light"] .lb-view .lb-bucket-wrap--mgr-smiller_gflores .lb-matrix-seg.av-matrix--by-day>thead>tr:not(.lb-matrix__banner-row)>th {
  background: linear-gradient(180deg, #f8f2d4, #ede2b8);
  color: #5c5410;
  border-bottom: 1px solid rgba(180, 155, 50, 0.4) !important;
  text-shadow: none;
}

.lb-column--merged-head .lb-column__title {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 4px;
}

.lb-column__head.lb-col-head--es-us {

  --lb-seg-line: #f0908c;
  background: color-mix(in srgb, #f0625c 12%, var(--panel));
}

.lb-column__head.lb-col-head--es-hn {

  --lb-seg-line: #f0908c;
  background: color-mix(in srgb, #f0625c 12%, var(--panel));
}

.lb-column__head.lb-col-head--en {

  --lb-seg-line: #5fd4ff;
  background: color-mix(in srgb, #4bc8f7 12%, var(--panel));
}

.lb-column__head.lb-col-head--payday {

  --lb-seg-line: #b8b8b8;
  background: color-mix(in srgb, #888 12%, var(--panel));
}

.lb-column__head.lb-col-head--other {
  --lb-seg-line: #9a9a9a;
  background: color-mix(in srgb, #777 12%, var(--panel));
}

.lb-column__head.lb-col-head--other-leads {
  --lb-seg-line: #b0b0b0;
  background: color-mix(in srgb, #8a8a8a 12%, var(--panel));
}

.lb-other-leads-hint {
  margin: 0 0 12px;
  font-size: 12px;
  max-width: 720px;
}

.lb-column__title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.2;
}

.lb-column__meta {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.25;
}

.lb-column__head-inner--split {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px 12px;
  flex-wrap: wrap;
}

.lb-column__head-left {
  min-width: 0;
  flex: 1 1 120px;
}

.lb-column__head-managers {
  flex: 0 1 46%;
  min-width: 6rem;
  max-width: 100%;
  text-align: right;
}

.lb-column__mgr-k {
  display: block;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}

.lb-column__mgr-v {
  display: block;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  word-break: break-word;
}

.lb-column__scroller {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 0 6px;
  -webkit-overflow-scrolling: touch;
}

@supports not (background: color-mix(in srgb, red, blue)) {
  .lb-column__head.lb-col-head--es-us {
    background: rgba(240, 98, 92, 0.12);
  }

  .lb-column__head.lb-col-head--es-hn {
    background: rgba(240, 98, 92, 0.12);
  }

  .lb-column__head.lb-col-head--en {
    background: rgba(75, 200, 247, 0.12);
  }

  .lb-column__head.lb-col-head--payday {
    background: rgba(136, 136, 136, 0.1);
  }

  .lb-column__head.lb-col-head--other {
    background: rgba(119, 119, 119, 0.1);
  }

  .lb-column__head.lb-col-head--other-leads {
    background: rgba(138, 138, 138, 0.12);
  }

  .lb-matrix__banner-th.lb-col-head--es-us {
    background: rgba(240, 98, 92, 0.30);
  }

  .lb-matrix__banner-th.lb-col-head--es-hn {
    background: rgba(240, 98, 92, 0.30);
  }

  .lb-matrix__banner-th.lb-col-head--en {
    background: rgba(75, 200, 247, 0.28);
  }

  .lb-matrix__banner-th.lb-col-head--payday {
    background: rgba(136, 136, 136, 0.12);
  }

  .lb-matrix__banner-th.lb-col-head--other {
    background: rgba(119, 119, 119, 0.12);
  }

  .lb-matrix__banner-th.lb-col-head--other-leads {
    background: rgba(138, 138, 138, 0.22);
  }

  .lb-view .lb-matrix-seg tbody tr.lb-card--tier-top3 td {
    background: rgba(62, 207, 142, 0.12);
  }

  .lb-view .lb-matrix-seg tbody tr.lb-card--tier-next9 td {
    background: rgba(62, 207, 142, 0.07);
  }

  .lb-view .lb-matrix-seg tbody tr.lb-card--tier-rest td {
    background: rgba(26, 26, 26, 0.55);
  }
}

.lb-view .lb-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 10px 0 6px;
  padding-left: 20px;
  padding-right: 20px;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

.lb-view .lb-other-leads-hint {
  margin-left: 28px;
  margin-right: 28px;
  max-width: min(720px, calc(100% - 56px));
  box-sizing: border-box;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.45;
}

.lb-view .lb-board-hint {
  margin: 0 28px 12px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

.lb-view .lb-other-leads-hint--below {
  margin-top: -4px;
  margin-bottom: 14px;
}

@media (max-width: 899px) {
  .lb-view .lb-section-title {
    padding-left: 16px;
    padding-right: 16px;
  }

  .lb-view .lb-board-hint {
    margin-left: 16px;
    margin-right: 16px;
  }

  .lb-view .lb-other-leads-hint {
    max-width: min(720px, calc(100% - 32px));
    margin-left: 16px;
    margin-right: 16px;
  }
}

.lb-view .lb-tier:first-of-type .lb-section-title {
  margin-top: 4px;
}

.lb-view .lb-totals .lb-section-title {
  padding-left: 0;
  padding-right: 0;
}

.lb-totals-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 8px;
  min-width: 0;
}

.lb-totals-grid--wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .lb-totals-grid--wide {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .lb-totals-grid {
    grid-template-columns: 1fr;
  }

  .lb-totals-grid--wide {
    grid-template-columns: 1fr;
  }
}

.lb-total-val {
  font-size: 18px;
  font-weight: 700;
  margin: 4px 0 0;
}

/* Leaderboard — totales del periodo (cards compactas al final) */
.lb-view .lb-period-totals {
  margin: 14px 20px 16px;
  padding: 0;
  min-width: 0;
}

.lb-period-totals__head {
  margin-bottom: 8px;
}

.lb-period-totals__title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.lb-period-totals__hint {
  margin: 3px 0 0;
  font-size: 10px;
  line-height: 1.35;
  color: var(--muted);
}

.lb-period-totals__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.lb-mini-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-sm, 4px);
  background: var(--panel);
  min-width: 0;
}

.lb-mini-stat__label {
  font-size: 9px;
  line-height: 1.25;
  font-weight: 600;
  color: var(--text);
  opacity: 0.82;
  text-transform: none;
  letter-spacing: 0;
}

.lb-mini-stat__val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-mini-stat--purple {
  background: rgba(137, 137, 201, 0.38);
  border-color: rgba(137, 137, 201, 0.55);
}

.lb-mini-stat--brand {
  background: rgba(90, 90, 173, 0.34);
  border-color: rgba(90, 90, 173, 0.52);
}

.lb-mini-stat--orange {
  background: rgba(245, 158, 11, 0.34);
  border-color: rgba(245, 158, 11, 0.52);
}

.lb-mini-stat--yellow {
  background: rgba(230, 194, 0, 0.38);
  border-color: rgba(230, 194, 0, 0.55);
}

.lb-mini-stat--green {
  background: rgba(34, 197, 94, 0.28);
  border-color: rgba(34, 197, 94, 0.48);
}

.lb-mini-stat--red {
  background: rgba(247, 96, 90, 0.28);
  border-color: rgba(247, 96, 90, 0.48);
}

.lb-mini-stat--teal {
  background: rgba(20, 184, 166, 0.28);
  border-color: rgba(20, 184, 166, 0.48);
}

/* Leaderboard — ventas firmadas (detalle bajo totales) */
.lb-view .lb-signed-sales {
  margin: 0 20px 20px;
  min-width: 0;
}

.lb-signed-sales__head {
  margin-bottom: 8px;
}

.lb-signed-sales__title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.lb-signed-sales__hint {
  margin: 3px 0 0;
  font-size: 10px;
  line-height: 1.35;
}

.lb-signed-sales__wrap {
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm, 4px);
  background: var(--panel);
  overflow: auto;
  max-height: min(52vh, 520px);
}

.lb-signed-sales__table {
  font-size: 11px;
}

.lb-signed-sales__table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
}

.lb-signed-sales__table .lb-th-num,
.lb-signed-sales__table .lb-td-num {
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .lb-view .lb-signed-sales {
    margin-inline: 12px;
  }
}

[data-theme="light"] .lb-mini-stat--purple {
  background: rgba(137, 137, 201, 0.22);
}

[data-theme="light"] .lb-mini-stat--orange {
  background: rgba(245, 158, 11, 0.2);
}

[data-theme="light"] .lb-mini-stat--yellow {
  background: rgba(230, 194, 0, 0.24);
}

[data-theme="light"] .lb-mini-stat--green {
  background: rgba(34, 197, 94, 0.16);
}

[data-theme="light"] .lb-mini-stat--red {
  background: rgba(247, 96, 90, 0.16);
}

.lb-mini-stat--muted {
  background: color-mix(in srgb, var(--hover) 65%, var(--panel));
  border-color: color-mix(in srgb, var(--border) 80%, transparent);
}

.lb-debt-gauge {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.lb-debt-gauge__title {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.lb-debt-gauge__hint {
  margin: 0 0 2px;
  font-size: 9px;
  line-height: 1.3;
  color: var(--muted);
}

.lb-debt-gauge__wrap {
  position: relative;
  height: 92px;
  flex: 1 1 auto;
  min-height: 80px;
}

.lb-debt-gauge__wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.lb-debt-gauge__val {
  position: absolute;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--green);
  pointer-events: none;
  white-space: nowrap;
}

.lb-panel-loading.lb-debt-gauge .lb-debt-gauge__val {
  bottom: 28%;
}


@media (max-width: 1100px) {
  .lb-period-totals__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .lb-view .lb-period-totals {
    margin-left: 16px;
    margin-right: 16px;
  }

  .lb-period-totals__grid {
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }

  .lb-mini-stat {
    padding: 6px 8px;
  }

  .lb-mini-stat__val {
    font-size: 12px;
  }
}

.layout-main .view-wrap.av-view .table-wrap {
  flex: 0 0 auto;
  min-height: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.av-view {
  min-width: 0;
}

.layout-main .view-wrap.av-view {
  overflow-x: hidden;
}

.av-view .av-table-wrap {
  margin-top: 8px;

  -webkit-overflow-scrolling: touch;
}

.av-view .av-matrix.av-matrix--by-day {
  width: max-content;
  max-width: 100%;
  table-layout: auto;
}

.av-view .av-matrix-border {

  display: inline-block;
  width: fit-content;
  max-width: 100%;
  vertical-align: top;
  border: 1px solid rgba(217, 204, 65, 0.38);
  border-radius: var(--r-md, 6px);
  overflow: hidden;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .av-view .av-matrix-border {
  border-color: rgba(180, 155, 40, 0.45);
  background: rgba(255, 252, 235, 0.35);
}

.av-view .av-matrix-border .av-matrix--by-day {
  border-collapse: collapse;
}

.av-view .av-matrix-border .av-matrix--by-day>thead>tr>th,
.av-view .av-matrix-border .av-matrix--by-day>tbody>tr>th,
.av-view .av-matrix-border .av-matrix--by-day>tbody>tr>td,
.av-view .av-matrix-border .av-matrix--by-day>tfoot>tr>th,
.av-view .av-matrix-border .av-matrix--by-day>tfoot>tr>td {
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .av-view .av-matrix-border .av-matrix--by-day>thead>tr>th,
[data-theme="light"] .av-view .av-matrix-border .av-matrix--by-day>tbody>tr>th,
[data-theme="light"] .av-view .av-matrix-border .av-matrix--by-day>tbody>tr>td,
[data-theme="light"] .av-view .av-matrix-border .av-matrix--by-day>tfoot>tr>th,
[data-theme="light"] .av-view .av-matrix-border .av-matrix--by-day>tfoot>tr>td {
  border-color: rgba(0, 0, 0, 0.1);
}

.av-view .av-matrix-border .av-matrix--by-day>tbody>tr>th,
.av-view .av-matrix-border .av-matrix--by-day>tbody>tr>td,
.av-view .av-matrix-border .av-matrix--by-day>tfoot>tr>th,
.av-view .av-matrix-border .av-matrix--by-day>tfoot>tr>td {
  font-size: 11px;
  padding: 5px 7px;
  line-height: 1.35;
}

.av-view .av-matrix-border .av-matrix--by-day>thead>tr:not(.lb-matrix__banner-row)>th {
  font-size: 10px;
  padding: 6px 7px;
  line-height: 1.3;
}

.av-view .av-matrix--by-day .av-matrix__thead tr:not(.lb-matrix__banner-row) th {
  background: linear-gradient(180deg, #2e2a16, #222110);
  color: #d9cc41;
  border-bottom: 1px solid rgba(217, 204, 65, 0.35) !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.av-view .av-matrix--by-day .av-matrix__thead .av-mgr-head {
  color: #d9cc41;
}

.av-view .av-matrix--by-day .av-matrix__thead .av-th-day {
  color: #e8df68;
}

[data-theme="light"] .av-view .av-matrix--by-day .av-matrix__thead tr:not(.lb-matrix__banner-row) th {
  background: linear-gradient(180deg, #f3edd4, #e8dfba);
  color: #5c5410;
  border-bottom: 1px solid rgba(180, 155, 50, 0.4) !important;
  text-shadow: none;
}

[data-theme="light"] .av-view .av-matrix--by-day .av-matrix__thead .av-mgr-head,
[data-theme="light"] .av-view .av-matrix--by-day .av-matrix__thead .av-th-day {
  color: #5c5410;
}

.lb-view.av-view .lb-bucket-wrap .lb-column.lb-column--av-table .av-matrix-border {
  display: block;
  width: 100%;
  max-width: 100%;
}

.lb-view.av-view .lb-bucket-wrap .lb-column.lb-column--av-table .lb-matrix-seg.av-matrix.av-matrix--by-day {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.lb-view.av-view .lb-bucket-wrap .lb-column.lb-column--av-table .lb-matrix-seg col.lb-col-pct {
  width: 9%;
}

.lb-view.av-view .lb-bucket-wrap .lb-column.lb-column--av-table .lb-matrix-seg col.lb-col-agent {
  width: 43%;
}

.lb-view.av-view .lb-bucket-wrap .lb-column.lb-column--av-table .lb-matrix-seg col.lb-col-deals {
  width: 10%;
}

.lb-view.av-view .lb-bucket-wrap .lb-column.lb-column--av-table .lb-matrix-seg col.lb-col-opps {
  width: 14%;
}

.lb-view.av-view .lb-bucket-wrap .lb-column.lb-column--av-table .lb-matrix-seg col.lb-col-debt {
  width: 24%;
}

.lb-view.av-view .lb-matrix-seg .av-th-num.lb-th-compact,
.lb-view.av-view .lb-matrix-seg .av-cell-num.lb-td-compact {
  min-width: 0;
  max-width: none;
  padding-left: 3px;
  padding-right: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-view.av-view .lb-matrix-seg thead tr:not(.lb-matrix__banner-row) th,
.lb-view.av-view .lb-matrix-seg tbody td,
.lb-view.av-view .lb-matrix-seg tfoot td,
.lb-view.av-view .lb-matrix-seg tfoot th {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* % column: keep it inside even on narrow cards */
.lb-view.av-view .lb-matrix-seg thead tr:not(.lb-matrix__banner-row) th:nth-child(1),
.lb-view.av-view .lb-matrix-seg tbody td:nth-child(1),
.lb-view.av-view .lb-matrix-seg tfoot th:nth-child(1) {
  font-size: 10px;
  padding-left: 2px;
  padding-right: 2px;
  white-space: nowrap;
}

.lb-view.av-view .lb-matrix-seg .lb-th-compact.lb-th-opps {
  white-space: normal;
  line-height: 1.15;
  font-size: 9px;
  letter-spacing: 0.01em;
  vertical-align: bottom;
  text-transform: none;
}

.lb-view.av-view .lb-matrix-seg .lb-th-compact.lb-th-debt,
.lb-view.av-view .lb-matrix-seg .lb-td-debt {
  font-size: 10px;
}

.lb-view.av-view .lb-matrix-seg .lb-td-agent {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .lb-view.av-view .lb-bucket-wrap .lb-column.lb-column--av-table .lb-matrix-seg col.lb-col-agent {
    width: 42%;
  }

  .lb-view.av-view .lb-bucket-wrap .lb-column.lb-column--av-table .lb-matrix-seg col.lb-col-debt {
    width: 26%;
  }
}

@media (max-width: 640px) {
  .lb-view.av-view .lb-matrix-seg .lb-td-agent {
    white-space: normal;
    text-overflow: clip;
  }

  .lb-view.av-view .lb-bucket-wrap .lb-column.lb-column--av-table .lb-matrix-seg col.lb-col-pct {
    width: 10%;
  }

  .lb-view.av-view .lb-bucket-wrap .lb-column.lb-column--av-table .lb-matrix-seg col.lb-col-agent {
    width: 38%;
  }

  .lb-view.av-view .lb-bucket-wrap .lb-column.lb-column--av-table .lb-matrix-seg col.lb-col-opps {
    width: 16%;
  }
}

.lb-view .lb-matrix-seg tbody tr.lb-row-filler td {
  background: color-mix(in srgb, var(--panel) 88%, var(--surface));
  border-color: rgba(255, 255, 255, 0.06);
  height: 2.25rem;
  padding-top: 4px;
  padding-bottom: 4px;
}

[data-theme="light"] .lb-view .lb-matrix-seg tbody tr.lb-row-filler td {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
}

.av-tabs {
  margin-top: 16px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
  max-width: 100%;
}

.av-tabs__scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0;
  scrollbar-width: thin;
}

.av-tab {
  flex: 0 0 auto;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted, #94a3b8);
  text-decoration: none;
  border-radius: var(--r-sm, 4px) var(--r-sm, 4px) 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  white-space: nowrap;
  transition: color 0.12s ease, background 0.12s ease;
}

.av-tab:hover {
  color: var(--fg, #e2e8f0);
  background: rgba(255, 255, 255, 0.04);
}

.av-tab--active {
  color: var(--fg, #f1f5f9);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
  border-bottom: 1px solid var(--panel, #0f1117);
  margin-bottom: -1px;
  padding-bottom: 9px;
}

.av-section-title {
  margin: 14px 28px 0;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-body, #cbd5e1);
}

.av-section-sub {
  margin: 4px 28px 0;
  font-size: 12px;
  color: var(--muted);
}

.av-matrix--by-day .av-th-day,
.av-matrix--by-day .av-cell-day {
  text-align: left;
  min-width: 6.5rem;
  white-space: nowrap;
}

.av-matrix .av-th-manager,
.av-matrix .av-cell-manager {
  text-align: left;
  min-width: 11rem;
}

.av-matrix .av-th-num,
.av-matrix .av-cell-num {
  text-align: right;
  white-space: nowrap;
  min-width: 5.5rem;
  max-width: 12rem;
}

.av-mgr-head {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 7px 6px !important;
  color: var(--muted, #94a3b8);
  border-bottom: 1px solid var(--border) !important;
}

.av-view .av-matrix-border .av-mgr-head {
  border-bottom-color: rgba(217, 204, 65, 0.28) !important;
}

.av-cell-num {
  vertical-align: middle;
}

.av-cell-avg {
  display: inline;
  font-weight: 500;
}

.av-row-total th,
.av-row-total td {
  border-top: 1px solid var(--border);
  font-weight: 600;
}

.av-sales-section {
  margin-top: 20px;
  flex: 0 0 auto;
}

.av-sales-section>.page-title--section,
.av-sales-section>.page-sub {
  margin-left: 28px;
  margin-right: 28px;
}

@media (max-width: 899px) {
  .av-tabs {
    padding-left: 16px;
    padding-right: 16px;
  }

  .av-view .av-section-title {
    margin-left: 16px;
    margin-right: 16px;
  }

  .av-view .av-section-sub {
    margin-left: 16px;
    margin-right: 16px;
  }

  .av-sales-section>.page-title--section,
  .av-sales-section>.page-sub {
    margin-left: 16px;
    margin-right: 16px;
  }
}

.av-detail-wrap {
  margin-top: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;

}

.av-view .av-detail-border {
  border: 1px solid var(--border);
  border-radius: var(--r-md, 6px);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.12);
  max-width: 100%;
  box-sizing: border-box;
}

[data-theme="light"] .av-view .av-detail-border {
  background: rgba(255, 255, 255, 0.5);
}

.av-view .av-detail-border .av-detail-table {
  margin: 0;
}

.av-detail-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel, #12141a);
  box-shadow: 0 1px 0 var(--border);
}

.case-history-field {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.case-history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 220px;
  overflow-y: auto;
  font-size: 12.5px;
  line-height: 1.4;
}

.case-history-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.case-history-item:last-child {
  border-bottom: none;
}

.case-history-meta {
  color: var(--muted);
  font-size: 11px;
}

.case-history-sum {
  display: inline-block;
  margin-top: 2px;
}

.field-hint {
  font-size: 11.5px;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: 6px;
  margin: 10px 0 0;
  border: 1px solid transparent;
}

.field-hint--amber {
  color: #d4a20f;
  background: rgba(247, 169, 75, 0.12);
  border-color: rgba(247, 169, 75, 0.38);
}

.field-hint--orange {
  color: #e07020;
  background: rgba(230, 112, 32, 0.11);
  border-color: rgba(230, 112, 32, 0.38);
}

.field-hint--transfer-green {
  color: #4ade80;
  background: #122116;
  border-color: rgba(74, 222, 128, 0.22);
}

[data-theme="light"] .field-hint--transfer-green {
  color: #15803d;
  background: #ecfdf3;
  border-color: rgba(34, 197, 94, 0.28);
}

.field-hint--doc-yellow {
  color: #d9cc41;
  background: rgba(34, 33, 16, 0.92);
  border-color: rgba(217, 204, 65, 0.22);
}

[data-theme="light"] .field-hint--doc-yellow {
  color: #5c4f20;
  background: rgba(254, 249, 195, 0.55);
  border-color: rgba(234, 179, 8, 0.35);
}

.field-hint--red {
  color: var(--red);
  background: rgba(247, 96, 90, 0.1);
  border-color: rgba(247, 96, 90, 0.28);
}

[data-theme="light"] .field-hint--amber {
  color: #9a6b00;
}

[data-theme="light"] .field-hint--orange {
  color: #b8570e;
}

.pipe-actions-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  white-space: nowrap;
}

.pipe-actions-cell--2 {
  gap: 6px;
}

.case-open-full-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
}

#proc-case-open-wrap,
#sales-case-open-wrap {
  margin-top: 1.35rem;
  padding-top: 2px;
}

.case-view-wrap {
  --case-proc: #4bc8f7;
  --case-proc-dim: rgba(75, 200, 247, 0.22);
  --case-sales: #9b86f0;
  --case-sales-dim: rgba(155, 134, 240, 0.24);
}

.case-view-main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px 40px;
  box-sizing: border-box;
}

.case-view-hd {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.case-view-breadcrumb a {
  color: var(--brand);
  text-decoration: none;
}

.case-view-breadcrumb a:hover {
  text-decoration: underline;
}

.case-view-breadcrumb--hero {
  margin: 0 0 10px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}

.case-view-breadcrumb--hero span:not([aria-hidden]) {
  color: var(--text);
  font-weight: 500;
}

.case-view-hero-panel {
  flex: 1 1 280px;
  max-width: 760px;
}

.case-view-hd-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.case-info-section {
  margin-top: 24px;
}

.case-stepper.case-card {
  margin-bottom: 0;
}

.case-section-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 12px;
}

.case-view-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.case-view-kv {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 500;
}

.case-timeline-title {
  margin: 28px 0 4px;
  font-size: 18px;
}

.case-timeline-sub {
  margin: 0 0 16px;
}

.case-timeline-body {
  max-width: 720px;
  padding-bottom: 8px;
}

.case-timeline.case-timeline--vertical {
  min-height: 0;
}

.case-stepper__heading {
  margin: 0 0 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.case-stepper__track {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  flex-wrap: nowrap;
  width: 100%;
}

.case-stepper__segment {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 0 1 200px;
  min-width: 120px;
}

.case-stepper__connector {
  flex: 1 1 48px;
  min-width: 32px;
  max-width: 120px;
  height: 2px;
  align-self: center;
  margin-top: 15px;
  background: var(--border);
  border-radius: 1px;
  transition: background 0.2s var(--ease);
}

.case-stepper__connector--active {
  background: linear-gradient(90deg, var(--case-proc), var(--case-sales));
  opacity: 0.85;
}

.case-stepper__node {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.case-stepper__node svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.25;
}

.case-stepper__node--processing.case-stepper__node--current {
  background: var(--case-proc-dim);
  color: var(--case-proc);
  border: 2px solid var(--case-proc);
  box-shadow: 0 0 0 4px rgba(75, 200, 247, 0.12);
}

.case-stepper__node--processing.case-stepper__node--complete {
  background: var(--case-proc);
  color: #0a1620;
  border: 2px solid var(--case-proc);
}

.case-stepper__node--sales.case-stepper__node--pending {
  background: var(--panel);
  color: var(--faint);
  border: 2px dashed var(--border-strong);
}

.case-stepper__node--sales.case-stepper__node--current {
  background: var(--case-sales-dim);
  color: var(--case-sales);
  border: 2px solid var(--case-sales);
  box-shadow: 0 0 0 4px rgba(155, 134, 240, 0.12);
}

.case-stepper__node--sales.case-stepper__node--complete {
  background: var(--case-sales);
  color: #121018;
  border: 2px solid var(--case-sales);
}

.case-stepper__node--sales.case-stepper__node--returned {
  background: rgba(247, 96, 90, 0.14);
  color: var(--red);
  border: 2px solid rgba(247, 96, 90, 0.55);
}

.case-stepper__labels {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  max-width: 220px;
}

.case-stepper__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.case-stepper__state {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
  word-break: break-word;
}

.case-stepper__future {
  margin: 20px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  line-height: 1.45;
}

.case-timeline-v {
  margin: 0;
  padding: 0;
}

.case-timeline-v__step {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 18px;
  margin: 0 0 8px;
}

.case-timeline-v__step:last-child {
  margin-bottom: 0;
}

.case-timeline-v__axis {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 36px;
  flex-shrink: 0;
}

.case-timeline-v__glyph {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-top: 2px;
  box-sizing: border-box;
}

.case-timeline-v__glyph svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
}

.case-timeline-v__glyph--proc.case-timeline-v__glyph--done {
  background: var(--case-proc);
  color: #0a1620;
  border: none;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

.case-timeline-v__glyph--sales.case-timeline-v__glyph--done {
  background: var(--case-sales);
  color: #121018;
  border: none;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

.case-timeline-v__glyph--proc.case-timeline-v__glyph--latest {
  background: transparent;
  color: var(--case-proc);
  border: 2px solid var(--case-proc);
}

.case-timeline-v__glyph--sales.case-timeline-v__glyph--latest {
  background: transparent;
  color: var(--case-sales);
  border: 2px solid var(--case-sales);
}

.case-timeline-v__rail {
  flex: 1;
  width: 2px;
  min-height: 20px;
  margin-top: 8px;
  background: var(--border);
  border-radius: 1px;
}

.case-timeline-v__step:last-child .case-timeline-v__rail {
  display: none;
}

.case-timeline-v__panel {
  flex: 1;
  min-width: 0;
  padding-bottom: 20px;
}

.case-timeline-v__step:last-child .case-timeline-v__panel {
  padding-bottom: 0;
}

.case-timeline-v__date {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--faint);
  line-height: 1.3;
}

.case-timeline-v__title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.case-timeline-v__title--proc {
  color: var(--case-proc);
}

.case-timeline-v__title--sales {
  color: var(--case-sales);
}

.case-timeline-v__desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--faint);
}

[data-theme="light"] .case-timeline-v__desc {
  color: #5c5c66;
}

.case-view-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 0;
}

.case-view-error {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 0;
  text-align: center;
}

.case-profile-wrap {
  padding-bottom: 24px;
}

.case-profile-wrap .page-hd {
  align-items: center;
}

.case-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0 28px 28px;
}

@media (max-width: 960px) {
  .case-profile-grid {
    grid-template-columns: 1fr;
  }
}

.case-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
}

.case-card-title {
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--faint);
}

.case-dl {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 2fr;
  gap: 8px 12px;
  font-size: 12px;
  margin: 0;
}

.case-dl dt {
  color: var(--faint);
  margin: 0;
}

.case-dl dd {
  margin: 0;
  word-break: break-word;
}

.case-timeline {
  min-height: 120px;
}

.case-timeline-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 4px;
  border-left: 2px solid var(--border);
}

.case-timeline-item {
  position: relative;
  padding: 0 0 16px 16px;
}

.case-timeline-dot {
  position: absolute;
  left: -7px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}

.case-timeline-meta {
  color: var(--faint);
  margin-bottom: 4px;
}

.case-timeline-action {
  font-weight: 500;
  font-size: 12px;
}

.case-timeline-payload {
  margin-top: 4px;
  line-height: 1.4;
}

.field-hint--green {
  color: var(--green);
}

.mod-chrono-bar {
  margin: 0 0 2px 0;
}

.mod-chrono-strip {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.mod-chrono {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 12px 10px;
  border-radius: var(--r-md);
  background:
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(var(--brand-rgb), 0.12) 0%, transparent 55%),
    linear-gradient(165deg, var(--pal-dark-base) 0%, var(--pal-dark-mid) 45%, var(--pal-dark-deep) 100%);
  border: 1px solid rgba(var(--brand-rgb), 0.22);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.14);
  overflow: hidden;
}

.mod-chrono__dots {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 10px 10px;
  pointer-events: none;
}

.mod-chrono__ring-wrap {
  position: relative;
  width: 132px;
  height: 132px;
  flex-shrink: 0;
}

.mod-chrono__svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 3px rgba(var(--brand-rgb), 0.2));
}

.mod-chrono__track {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 5;
}

.mod-chrono__progress {
  stroke: var(--brand);
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.08s linear;
}

.mod-chrono__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.mod-chrono__bolt {
  font-size: 14px;
  line-height: 1;
  margin-bottom: 2px;
  filter: drop-shadow(0 0 2px rgba(62, 207, 142, 0.28));
}

.mod-chrono__value {
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1;
  font-family: var(--font-mono, ui-monospace, monospace);
}

.mod-chrono__unit {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 2px;
}

.mod-chrono__foot {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  max-width: 280px;
}

.mod-chrono__foot--warn {
  color: var(--amber);
  font-weight: 500;
}

.mod-chrono--sales .mod-chrono__ring-wrap {
  width: 120px;
  height: 120px;
}

.mod-chrono--inline {
  align-items: stretch;
  padding: 6px 10px 7px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mod-chrono--inline .mod-chrono__main {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.mod-chrono--inline .mod-chrono__text {
  flex: 1;
  min-width: 0;
}

.mod-chrono--inline .mod-chrono__ring-wrap {
  width: 68px;
  height: 68px;
}

.mod-chrono--inline.mod-chrono--sales .mod-chrono__ring-wrap {
  width: 62px;
  height: 62px;
}

.mod-chrono--inline .mod-chrono__svg {
  filter: drop-shadow(0 0 2px rgba(var(--brand-rgb), 0.18));
}

.mod-chrono--inline .mod-chrono__value {
  font-size: 16px;
}

.mod-chrono--inline .mod-chrono__unit {
  font-size: 9px;
  margin-top: 0;
}

.mod-chrono--inline .mod-chrono__bolt {
  font-size: 10px;
  margin-bottom: 0;
}

.mod-chrono--inline .mod-chrono__foot {
  margin: 0;
  text-align: left;
  max-width: none;
  font-size: 11px;
  line-height: 1.35;
}

.mod-chrono--inline .mod-chrono__foot+.mod-chrono__foot {
  margin-top: 4px;
}

[data-theme="light"] .mod-chrono--inline {
  background: linear-gradient(165deg, #fafafa 0%, #ececec 100%);
  border-color: rgba(var(--brand-rgb), 0.2);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.proc-xfer-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.proc-xfer-modal.proc-xfer-modal--open {
  display: flex;
}

.proc-xfer-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.proc-xfer-modal__card {
  position: relative;
  z-index: 1;
  max-width: 420px;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
}

.proc-xfer-modal__title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.proc-xfer-modal__greet {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.35;
}

.proc-xfer-modal__verify {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.35;
}

.proc-xfer-modal__kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 12px;
}

.proc-xfer-modal__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

body.rt-banner-visible {
  padding-top: 36px;
  box-sizing: border-box;
}

.rt-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10050;
  display: none;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.3;
  border-bottom: 1px solid rgba(34, 197, 94, 0.4);
  background: #14532d;
  color: #bbf7d0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .rt-banner {
  background: #ecfdf5;
  color: #14532d;
  border-bottom-color: #86efac;
}

.rt-banner__shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 5px 40px 5px 38px;
  box-sizing: border-box;
}

.rt-banner__icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #22c55e;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

[data-theme="light"] .rt-banner__icon {
  background: #16a34a;
  color: #fff;
}

.rt-banner__center {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
}

.rt-banner__line {
  display: block;
  font-weight: 500;
  word-break: break-word;
}

.rt-banner__tag {
  font-weight: 600;
  color: #86efac;
}

[data-theme="light"] .rt-banner__tag {
  color: #15803d;
}

.rt-banner__dot {
  opacity: 0.65;
  user-select: none;
}

.rt-banner__kind {
  font-weight: 600;
  opacity: 0.95;
}

.rt-banner__msg {
  font-weight: 500;
  opacity: 0.98;
}

.rt-banner__meta {
  margin-top: 2px;
  font-size: 10px;
  opacity: 0.72;
  font-family: var(--font-mono);
}

.rt-banner__close {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="light"] .rt-banner__close {
  color: rgba(21, 83, 45, 0.55);
}

.rt-banner__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

[data-theme="light"] .rt-banner__close:hover {
  background: rgba(21, 83, 45, 0.08);
  color: #14532d;
}

.insights-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 28px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.insights-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.insights-field {
  margin-bottom: 0;
  min-width: 140px;
}

.insights-meta {
  padding: 0 28px 8px;
}

.insights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0 28px 24px;
  align-items: stretch;
}

.insights-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 18px;
  min-height: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.insights-panel--wide {
  grid-column: 1 / -1;
}

.insights-panel-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text);
}

.insights-chart-wrap {
  position: relative;
  height: 260px;
  border-radius: 6px;
  overflow: hidden;
}

.insights-chart-wrap--bars {
  height: min(360px, 55vh);
}

.insights-panel-hint {
  margin: -4px 0 10px;
  font-size: 11px;
  line-height: 1.45;
}

.insights-chart-wrap--agents {
  width: 100%;
  min-height: clamp(200px, 32vh, 480px);
  height: auto;
}

.insights-panel--agents {
  min-width: 0;
}

.insights-gauge-wrap {
  position: relative;
  height: 200px;
}

.insights-gauge-value {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  pointer-events: none;
}

.insights-foot {
  padding: 0 28px 16px;
  color: var(--red);
}

.campaigns-view {
  min-width: 0;
}

.campaigns-view .cp-access-info {
  margin: 4px 28px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.campaigns-view .cp-access-info__preview {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 16%, var(--border));
  background: color-mix(in srgb, var(--brand) 5%, var(--surface));
  animation: dash-card-shine-pulse 2.8s ease-in-out infinite;
}

.campaigns-view .cp-access-info__content {
  padding: 14px 18px 16px;
}

.campaigns-view .cp-access-info__icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 40%, var(--border));
}

.campaigns-view .cp-access-info__icon svg {
  width: 20px;
  height: 20px;
}

.campaigns-view .cp-access-info__kicker {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}

.campaigns-view .cp-access-info__title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.campaigns-view .cp-access-info__heading {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.campaigns-view .cp-access-info__text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.campaigns-view .cp-access-info__features {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.campaigns-view .cp-access-info__features li {
  margin-bottom: 4px;
}

.campaigns-view .cp-access-info__features li:last-child {
  margin-bottom: 0;
}

.campaigns-view .cp-access-info__campaigns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.campaigns-view .cp-access-info__campaign-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--border));
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

@media (max-width: 720px) {
  .campaigns-view .cp-access-info__preview {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .campaigns-view .cp-access-info__preview .mod-module-card-badge--new {
    justify-self: start;
  }
}

.campaigns-view .cp-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 16px;
  padding: 8px 28px 8px;
  min-width: 0;
  box-sizing: border-box;
}

.campaigns-view a.cp-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.campaigns-view .cp-card-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.campaigns-view .cp-card-opps-btn {
  align-self: flex-start;
  font-size: 12px;
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.5);
}

.campaigns-view .cp-card-opps-btn:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

.campaigns-view .cp-card--clickable {
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.campaigns-view a.cp-card-link:hover .cp-card--clickable,
.campaigns-view a.cp-card-link:focus-visible .cp-card--clickable {
  border-color: var(--brand, #3b82f6);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand, #3b82f6) 35%, transparent);
  transform: translateY(-1px);
}

.campaigns-detail-view .cp-detail-hd {
  padding: 0;
  margin: 0;
}

.campaigns-detail-view .cp-detail-top {
  margin: 12px 28px 10px;
  padding: 12px 14px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 88%, var(--bg));
  flex-shrink: 0;
}

[data-theme="light"] .campaigns-detail-view .cp-detail-top {
  background: var(--surface);
}

.campaigns-detail-view .cp-detail-back {
  margin: 0 0 4px;
  font-size: 12px;
}

.campaigns-detail-view .cp-detail-hd--minimal {
  margin: 0;
  padding: 0;
}

.campaigns-detail-view .cp-detail-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 90%, var(--bg));
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.campaigns-detail-view .cp-detail-back-btn:hover {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  background: color-mix(in srgb, var(--brand) 10%, var(--panel));
}

.campaigns-detail-view .cp-detail-hd__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
}

.campaigns-detail-view .cp-detail-hd__title {
  min-width: 0;
  flex: 1 1 220px;
}

.campaigns-detail-view .cp-detail-hd__title .page-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}

.campaigns-detail-view .cp-detail-hd__title .page-sub {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.35;
}

.campaigns-detail-view .cp-detail-meta {
  opacity: 0.85;
}

.campaigns-detail-view .cp-detail-filters {
  margin: 0;
  padding: 0;
  border: none;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 6px;
}

.campaigns-detail-view .cp-detail-filters--inline .cp-detail-filters__row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.campaigns-detail-view .cp-detail-filters--inline .cp-filter-inline {
  flex: 0 0 auto;
  margin: 0;
}

.campaigns-detail-view .cp-detail-filters--inline .cp-filter-search {
  flex: 1 1 10rem;
  min-width: 8rem;
  max-width: 14rem;
}

.campaigns-detail-view .cp-program-filter {
  position: relative;
}

.campaigns-detail-view .cp-program-filter__btn {
  min-width: 8rem;
  text-align: left;
  cursor: pointer;
}

/* No prefijadas con .campaigns-detail-view a proposito: bindProgramFilterPanel()
   mueve este panel a document.body al abrirlo (para escapar el recorte del
   overflow-x:auto de la barra de filtros), asi que deja de ser descendiente
   de esa clase -- si el selector la exige, el panel pierde todo su estilo
   apenas se reparenta. */
.cp-program-filter__panel {
  position: fixed;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 220px;
  max-height: 280px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.cp-program-filter__panel[hidden] {
  display: none;
}

.cp-program-filter__opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.cp-program-filter__opt:hover {
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}

.campaigns-detail-view .cp-detail-filters--inline .input-stroke,
.campaigns-detail-view .cp-detail-filters--inline .select-stroke {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 11px;
}

.campaigns-detail-view .cp-detail-filters--inline .cp-filter-submit .btn-stroke {
  min-height: 30px;
  padding: 4px 12px;
  font-size: 11px;
  white-space: nowrap;
}

.campaigns-detail-view .cp-detail-filters--inline .cp-filter-per-page {
  min-width: 4.2rem;
}

.campaigns-detail-view .cp-detail-analytics {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 92%, var(--text) 8%);
}

.campaigns-detail-view .cp-detail-analytics__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  margin-bottom: 8px;
}

.campaigns-detail-view .cp-detail-analytics__title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.campaigns-detail-view .cp-grand-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.campaigns-detail-view .cp-grand-total__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.65;
}

.campaigns-detail-view .cp-grand-total__value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--brand);
}

.campaigns-detail-view .cp-detail-analytics__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px 24px;
  align-items: start;
}

.campaigns-detail-view .cp-cancel-inline {
  min-width: 0;
  border-left: 1px solid var(--border);
  padding-left: 24px;
}

.campaigns-detail-view .cp-cancel-inline__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.campaigns-detail-view .cp-cancel-inline__head--btn {
  align-items: center;
  margin-bottom: 14px;
}

.campaigns-detail-view .cp-cancel-inline__title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.campaigns-detail-view .cp-cancel-inline__table-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  color: var(--brand);
  cursor: pointer;
  white-space: nowrap;
}

.campaigns-detail-view .cp-cancel-inline__table-link:hover {
  text-decoration: underline;
}

.campaigns-detail-view .cp-status-inline {
  min-width: 0;
}

/* No prefijado con .campaigns-detail-view: el contenido de la gráfica
   pastel vive en un modal fijo a document.body-level (fuera de esa vista),
   igual que el panel de programas. */
.cp-status-chart-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  background: rgba(10, 10, 18, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
}

.cp-status-chart-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.cp-status-chart-open {
  overflow: hidden;
}

.cp-status-chart-modal__panel {
  width: 100%;
  height: 100vh;
  max-height: 100vh;
  overflow: auto;
  border: none;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
  transform: none;
  transition: none;
}

.cp-status-chart-modal.is-open .cp-status-chart-modal__panel {
  transform: translateY(0) scale(1);
}

.cp-status-chart-modal-canvas-wrap {
  position: relative;
  height: min(75vh, 780px);
}

.cp-status-corner-legend {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: calc(100% - 16px);
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.cp-status-corner-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  white-space: nowrap;
}

.cp-status-corner-legend__swatch {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.cp-status-corner-legend__label {
  flex: 0 0 auto;
}

.cp-status-corner-legend__value {
  flex: 0 0 auto;
  font-weight: 600;
  opacity: 0.85;
}

.campaigns-detail-view .cp-detail-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.campaigns-detail-view .cp-detail-bar-row {
  display: grid;
  grid-template-columns: minmax(9rem, 1.35fr) minmax(0, 1fr) 2.5rem 2.5rem;
  gap: 8px 6px;
  align-items: center;
  font-size: 11px;
}

.campaigns-detail-view .cp-detail-bar-row__label {
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
  overflow: visible;
  text-overflow: unset;
}

.campaigns-detail-view .cp-detail-bar-row--clickable {
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s;
}

.campaigns-detail-view .cp-detail-bar-row--clickable:hover {
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}

.campaigns-detail-view .cp-detail-bar-row--clickable .cp-detail-bar-row__label {
  text-decoration: underline dashed;
  text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, var(--text) 40%, transparent);
}

.campaigns-detail-view .cp-detail-bar-row__hint {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
  margin-left: 4px;
  vertical-align: middle;
}

.campaigns-detail-view .cp-detail-bar-row__hint-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}

.campaigns-detail-view .cp-detail-bar-row__hint-dot::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--brand);
  animation: cpBarRowPulse 1.6s ease-out infinite;
}

@keyframes cpBarRowPulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

/* No prefijado con .campaigns-detail-view: el popover se agrega directo a
   document.body (ver showStatusDetailPopover en el JS). */
.cp-status-detail-popover {
  display: none;
  position: fixed;
  z-index: 999999;
  min-width: 200px;
  max-width: 260px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.cp-status-detail-popover__title {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

.cp-status-detail-popover__row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 12px;
}

.cp-status-detail-popover__swatch {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.cp-status-detail-popover__label {
  flex: 1 1 auto;
  min-width: 0;
}

.cp-status-detail-popover__value {
  flex: 0 0 auto;
  font-weight: 700;
}

.campaigns-detail-view .cp-detail-bar-row__track {
  height: 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 70%, transparent);
  overflow: hidden;
}

.campaigns-detail-view .cp-detail-bar-row__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  min-width: 2px;
}

.campaigns-detail-view .cp-detail-bar-row__count,
.campaigns-detail-view .cp-detail-bar-row__pct {
  text-align: right;
  font-size: 10px;
  opacity: 0.9;
}

.campaigns-detail-view .cp-detail-filters--inline .cp-filter-export {
  display: flex;
  gap: 6px;
}

.campaigns-detail-view .cp-detail-filters--inline .cp-filter-export .btn-stroke {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 11px;
}

.campaigns-detail-view a.cp-detail-back-btn.is-disabled {
  pointer-events: none;
  opacity: 0.45;
}

.cp-detail-export-loading {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 15, 25, 0.55);
  backdrop-filter: blur(2px);
}

.cp-detail-export-loading[hidden] {
  display: none !important;
}

.cp-detail-export-loading__inner {
  width: min(360px, calc(100% - 32px));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 22px 24px;
  border-radius: 10px;
  background: var(--surface, #26263a);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.cp-detail-export-loading__text {
  margin: 0;
  font-size: 13px;
  color: var(--text, #e4e4eb);
  text-align: center;
}

.cp-detail-export-loading__track {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--border) 70%, transparent);
}

.cp-detail-export-loading__bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand, #5a5aad), color-mix(in srgb, var(--brand) 70%, #8b8bff));
  transition: width 0.15s ease-out;
}

.cp-detail-export-loading__pct {
  text-align: center;
  font-size: 11px;
  opacity: 0.85;
}

body.cp-detail-export-busy {
  overflow: hidden;
}

.campaigns-detail-view .cp-analytics-card.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.campaigns-detail-view .cp-analytics-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--brand) 12%, var(--surface)), var(--surface));
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.campaigns-detail-view .cp-analytics-card:hover {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--border));
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.campaigns-detail-view .cp-analytics-card__kicker {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

.campaigns-detail-view .cp-analytics-card__title {
  font-size: 13px;
  font-weight: 600;
}

.campaigns-detail-view .cp-analytics-card__desc {
  font-size: 10px;
  line-height: 1.35;
  opacity: 0.82;
  flex: 1;
}

.campaigns-detail-view .cp-analytics-card__cta {
  font-size: 10px;
  color: var(--brand);
  margin-top: 2px;
}

.cp-cancel-stats-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
}

.cp-cancel-stats-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.cp-cancel-stats-open {
  overflow: hidden;
}

.cp-cancel-stats-modal__panel {
  width: min(640px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s;
}

.cp-cancel-stats-modal.is-open .cp-cancel-stats-modal__panel {
  transform: translateY(0) scale(1);
}

.cp-cancel-stats-modal__hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 10px;
  border-bottom: 1px solid var(--border);
}

.cp-cancel-stats-modal__kicker {
  margin: 0 0 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

.cp-cancel-stats-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.cp-cancel-stats-modal__lead {
  margin: 6px 0 0;
  font-size: 12px;
}

.cp-cancel-stats-modal__body {
  padding: 12px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cp-cancel-stats-table-wrap {
  max-height: 220px;
  overflow: auto;
}

.cp-cancel-stats-table .th-num {
  text-align: right;
  width: 4.5rem;
}

.cp-cancel-stats-table td:last-child,
.cp-cancel-stats-table td:nth-child(2) {
  text-align: right;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
}

.cp-cancel-stats-table td:first-child {
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}

.cp-cancel-stats-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  max-height: 280px;
  overflow-y: auto;
}

.cp-cancel-stats-bars .cp-detail-bar-row {
  font-size: 12px;
  grid-template-columns: minmax(10rem, 1.4fr) minmax(0, 1fr) 2.5rem 2.5rem;
}

.cp-cancel-stats-bars .cp-detail-bar-row__label {
  white-space: normal;
  word-break: break-word;
}

.cp-cancel-stats-bars .cp-detail-bar-row__track {
  height: 8px;
}

@media (max-width: 900px) {
  .campaigns-detail-view .cp-detail-analytics__grid {
    grid-template-columns: 1fr;
  }

  .campaigns-detail-view .cp-cancel-inline {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 12px;
  }
}

.campaigns-detail-view .cp-detail-filters__grid {
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) repeat(3, minmax(7rem, 0.7fr)) auto;
  gap: 8px 10px;
  padding: 0;
  align-items: end;
}

.campaigns-detail-view .cp-detail-filters__grid .cp-filter-search {
  grid-column: 1;
}

.campaigns-detail-view .cp-detail-filters__grid .cp-filter-submit {
  grid-column: -1;
  align-self: end;
}

.campaigns-detail-view .cp-filter-compact .filter-label {
  font-size: 9px;
  margin-bottom: 0;
}

.campaigns-detail-view .cp-filter-compact .input-stroke,
.campaigns-detail-view .cp-filter-compact .select-stroke,
.campaigns-detail-view .cp-filter-search .input-stroke {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12px;
}

.campaigns-detail-view .cp-filter-per-page {
  min-width: 4.5rem;
}

.campaigns-detail-view .cp-filter-status,
.campaigns-detail-view .cp-filter-final-status {
  min-width: 10rem;
}

.campaigns-detail-view .cp-filter-status {
  grid-column: span 2;
}

.campaigns-detail-view .cp-filter-submit .btn-stroke {
  min-height: 32px;
  padding: 5px 14px;
  font-size: 12px;
}

.campaigns-detail-view .cp-col--hidden,
.campaigns-detail-view .cp-filter--hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .campaigns-detail-view .cp-detail-filters__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .campaigns-detail-view .cp-detail-filters__grid .cp-filter-search {
    grid-column: 1 / -1;
  }

  .campaigns-detail-view .cp-detail-filters__grid .cp-filter-status {
    grid-column: span 2;
  }

  .campaigns-detail-view .cp-detail-filters__grid .cp-filter-submit {
    grid-column: -1;
  }
}

@media (max-width: 640px) {
  .campaigns-detail-view .cp-detail-top {
    margin-left: 16px;
    margin-right: 16px;
  }

  .campaigns-detail-view .cp-detail-kpis {
    width: 100%;
    justify-content: flex-start;
  }

  .campaigns-detail-view .cp-detail-filters__grid {
    grid-template-columns: 1fr 1fr;
  }

  .campaigns-detail-view .cp-detail-filters__grid .cp-filter-status {
    grid-column: 1 / -1;
  }
}

.campaigns-detail-view {
  overflow-x: hidden;
}

.main .view-wrap.campaigns-detail-view {
  display: block;
  flex: 1 1 0%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-padding-bottom: 28px;
  padding-bottom: 24px;
}

.campaigns-detail-view .cp-detail-table-wrap {
  margin: 8px 28px 20px;
  flex: 0 0 auto;
  min-height: auto;
  height: auto;
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.automation-campaing-view .cp-detail-table-wrap {
  margin: 8px 0 20px;
}

.table-edge-scroll-host {
  position: relative;
}

.table-edge-scroll-host::before,
.table-edge-scroll-host::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 56px;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.table-edge-scroll-host::before {
  left: 0;
  background: linear-gradient(to right, color-mix(in srgb, var(--brand) 18%, transparent), transparent);
}

.table-edge-scroll-host::after {
  right: 0;
  background: linear-gradient(to left, color-mix(in srgb, var(--brand) 18%, transparent), transparent);
}

.table-edge-scroll-host.table-edge-scroll--left {
  cursor: w-resize;
}

.table-edge-scroll-host.table-edge-scroll--right {
  cursor: e-resize;
}

.table-edge-scroll-host.table-edge-scroll--left::before,
.table-edge-scroll-host.table-edge-scroll--right::after {
  opacity: 1;
}

.campaigns-detail-view .cp-total-quotes-col .cp-inline-field {
  min-width: 5rem;
  max-width: 6.5rem;
}

.campaigns-detail-view .cp-detail-table-scroll .cp-detail-table {
  border: none;
  margin: 0;
}

.campaigns-detail-view .cp-detail-table-wrap .data-table {
  width: max-content;
  min-width: 100%;
}

.campaigns-detail-view .cp-detail-table {
  border-collapse: collapse;
}

.campaigns-detail-view .cp-detail-table th,
.campaigns-detail-view .cp-detail-table td {
  border-right: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.campaigns-detail-view .cp-detail-table th:last-child,
.campaigns-detail-view .cp-detail-table td:last-child {
  border-right: none;
}

.campaigns-detail-view .cp-notes-col {
  min-width: 96px;
  max-width: 110px;
}

.campaigns-detail-view .cp-notes-col .cp-notes-btn {
  display: block;
  width: 100%;
}

.campaigns-detail-view .cp-notes-btn--has-note {
  border-color: color-mix(in srgb, #22c55e 50%, var(--border));
  background: color-mix(in srgb, #22c55e 14%, var(--surface));
  color: color-mix(in srgb, #22c55e 88%, var(--text));
  font-weight: 600;
}

[data-theme="light"] .campaigns-detail-view .cp-notes-btn--has-note {
  border-color: rgba(34, 197, 94, 0.45);
  background: #ecfdf3;
  color: #15803d;
}

.campaigns-detail-view .cp-notes-btn--has-note:hover {
  border-color: color-mix(in srgb, #22c55e 65%, var(--border));
  background: color-mix(in srgb, #22c55e 20%, var(--surface));
}

.campaigns-detail-view .cp-notes-textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  box-sizing: border-box;
}

.campaigns-detail-view .cp-detail-pagination {
  margin: 0 28px 24px;
}

.campaigns-detail-view .cp-detail-hd,
.campaigns-detail-view .cp-detail-top,
.campaigns-detail-view .mod-filters-shell,
.campaigns-detail-view .cp-detail-pagination {
  flex-shrink: 0;
}

.campaigns-detail-view .mod-filters-shell {
  margin-bottom: 0;
}

.campaigns-detail-view .filter-group--grow {
  flex: 1 1 220px;
  min-width: 180px;
}

.campaigns-detail-view .cp-detail-pagination .pag-btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.campaigns-detail-view .cp-status-select.cp-tone-good {
  color: #4ade80;
  background: color-mix(in srgb, #122116 88%, var(--surface));
  border-color: rgba(74, 222, 128, 0.35);
  font-weight: 600;
}

.campaigns-detail-view .cp-status-select.cp-tone-bad {
  color: #f87171;
  background: color-mix(in srgb, #291415 88%, var(--surface));
  border-color: rgba(248, 113, 113, 0.35);
  font-weight: 600;
}

.campaigns-detail-view .cp-status-select.cp-tone-warn {
  color: #d9cc41;
  background: color-mix(in srgb, #222110 88%, var(--surface));
  border-color: rgba(217, 204, 65, 0.35);
  font-weight: 600;
}

.campaigns-detail-view .cp-status-select.cp-tone-risk {
  color: #f7a94b;
  background: color-mix(in srgb, #261a10 88%, var(--surface));
  border-color: rgba(247, 169, 75, 0.35);
  font-weight: 600;
}

[data-theme="light"] .campaigns-detail-view .cp-status-select.cp-tone-good {
  color: #15803d;
  background: #ecfdf3;
  border-color: rgba(34, 197, 94, 0.35);
}

[data-theme="light"] .campaigns-detail-view .cp-status-select.cp-tone-bad {
  color: #b91c1c;
  background: #fef2f2;
  border-color: rgba(239, 68, 68, 0.35);
}

[data-theme="light"] .campaigns-detail-view .cp-status-select.cp-tone-warn {
  color: #a16207;
  background: #fefce8;
  border-color: rgba(234, 179, 8, 0.35);
}

[data-theme="light"] .campaigns-detail-view .cp-status-select.cp-tone-risk {
  color: #c2410c;
  background: #fff7ed;
  border-color: rgba(249, 115, 22, 0.35);
}

.campaigns-detail-view .cp-cell-final-status {
  position: relative;
  overflow: hidden;
  max-width: 11rem;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.campaigns-detail-view .cp-cell-final-status .cp-status-select {
  width: 100%;
  min-width: 0;
}

.campaigns-detail-view .cp-cell-final-status.cp-cell-tone-good {
  background: color-mix(in srgb, #122116 88%, var(--surface));
}

.campaigns-detail-view .cp-cell-final-status.cp-cell-tone-bad {
  background: color-mix(in srgb, #291415 88%, var(--surface));
}

.campaigns-detail-view .cp-cell-final-status.cp-cell-tone-warn {
  background: color-mix(in srgb, #222110 88%, var(--surface));
}

.campaigns-detail-view .cp-cell-final-status.cp-cell-tone-risk {
  background: color-mix(in srgb, #261a10 88%, var(--surface));
}

.campaigns-detail-view .cp-cell-final-status.cp-cell-tone-good .cp-status-select {
  background: transparent;
  border-color: rgba(74, 222, 128, 0.35);
}

.campaigns-detail-view .cp-cell-final-status.cp-cell-tone-bad .cp-status-select {
  background: transparent;
  border-color: rgba(248, 113, 113, 0.35);
}

.campaigns-detail-view .cp-cell-final-status.cp-cell-tone-warn .cp-status-select {
  background: transparent;
  border-color: rgba(217, 204, 65, 0.35);
}

.campaigns-detail-view .cp-cell-final-status.cp-cell-tone-risk .cp-status-select {
  background: transparent;
  border-color: rgba(247, 169, 75, 0.35);
}

[data-theme="light"] .campaigns-detail-view .cp-cell-final-status.cp-cell-tone-good {
  background: #ecfdf3;
}

[data-theme="light"] .campaigns-detail-view .cp-cell-final-status.cp-cell-tone-bad {
  background: #fef2f2;
}

[data-theme="light"] .campaigns-detail-view .cp-cell-final-status.cp-cell-tone-warn {
  background: #fefce8;
}

[data-theme="light"] .campaigns-detail-view .cp-cell-final-status.cp-cell-tone-risk {
  background: #fff7ed;
}

[data-theme="light"] .campaigns-detail-view .cp-cell-final-status.cp-cell-tone-good .cp-status-select {
  background: transparent;
}

[data-theme="light"] .campaigns-detail-view .cp-cell-final-status.cp-cell-tone-bad .cp-status-select {
  background: transparent;
}

[data-theme="light"] .campaigns-detail-view .cp-cell-final-status.cp-cell-tone-warn .cp-status-select {
  background: transparent;
}

[data-theme="light"] .campaigns-detail-view .cp-cell-final-status.cp-cell-tone-risk .cp-status-select {
  background: transparent;
}

.campaigns-detail-view .td-badge-col .pipe-badge {
  display: inline-flex;
  width: auto;
  min-width: 5.5rem;
  max-width: 100%;
  justify-content: flex-start;
  font-size: 9.5px;
  padding: 3px 8px;
}

.campaigns-detail-view .cp-inline-field {
  width: 100%;
  min-width: 7.5rem;
  max-width: 14rem;
  font-size: 12px;
  padding: 4px 6px;
}

.campaigns-detail-view .cp-detail-table td.cp-cell-editable {
  overflow: hidden;
  vertical-align: middle;
}

.campaigns-detail-view .cp-detail-table td.cp-cell-editable .cp-inline-field,
.campaigns-detail-view .cp-detail-table td.cp-cell-editable .cp-status-select {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.campaigns-detail-view .cp-inline-field.input-date {
  min-width: 8.5rem;
}

.campaigns-detail-view .cp-detail-row {
  /* Sin position:relative en <tr>: rompe alineación de columnas en la tabla */
}

.campaigns-detail-view .cp-detail-save-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 32px));
  z-index: 1100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--red) 45%, var(--border));
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--red) 10%, var(--surface));
  box-shadow: var(--shadow-md);
}

body.cp-detail-has-pending .campaigns-detail-view {
  padding-bottom: 88px;
}

.campaigns-detail-view .cp-detail-save-bar.is-pending {
  border-color: color-mix(in srgb, var(--red) 45%, var(--border));
  background: color-mix(in srgb, var(--red) 10%, var(--surface));
}

.campaigns-detail-view .cp-detail-save-bar.is-confirm {
  animation: cp-save-bar-pulse 1.2s ease-in-out 2;
}

@keyframes cp-save-bar-pulse {
  0%, 100% { box-shadow: var(--shadow-md); }
  50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 25%, transparent), var(--shadow-md); }
}

.campaigns-detail-view .cp-detail-save-bar__danger {
  margin: 0;
  flex: 1;
  min-width: 180px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--red);
}

.campaigns-detail-view .cp-detail-save-bar #cp-detail-save-all {
  min-width: 7.5rem;
  flex-shrink: 0;
}

.campaigns-detail-view .cp-save-btn {
  min-width: 5.5rem;
}

.campaigns-detail-view .cp-detail-save-bar[hidden] {
  display: none !important;
}

.campaigns-detail-view .cp-detail-save-bar.is-saving {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--border));
}

.campaigns-detail-view .cp-detail-save-bar.is-done {
  border-color: color-mix(in srgb, var(--green) 50%, var(--border));
  background: color-mix(in srgb, var(--green) 12%, var(--surface));
}

.campaigns-detail-view .cp-detail-save-bar.is-partial {
  border-color: color-mix(in srgb, var(--amber) 50%, var(--border));
  background: color-mix(in srgb, var(--amber) 10%, var(--surface));
}

.campaigns-detail-view .cp-detail-save-bar__main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 200px;
}

.campaigns-detail-view .cp-detail-save-bar__count {
  font-size: 12px;
  font-weight: 600;
}

.campaigns-detail-view .cp-detail-save-bar__progress {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 420px;
}

.campaigns-detail-view .cp-detail-save-bar__progress[hidden] {
  display: none !important;
}

.campaigns-detail-view .cp-detail-save-bar__track {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--border) 70%, transparent);
}

.campaigns-detail-view .cp-detail-save-bar__fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 65%, #8b8bff));
  transition: width 0.18s ease-out;
}

.campaigns-detail-view .cp-detail-save-bar.is-done .cp-detail-save-bar__fill {
  background: linear-gradient(90deg, var(--green), color-mix(in srgb, var(--green) 70%, #6ee7a8));
}

.campaigns-detail-view .cp-detail-save-bar__status {
  font-size: 11px;
  white-space: nowrap;
  color: var(--muted);
}

.campaigns-detail-view .cp-detail-save-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

@media (max-width: 899px) {
  .campaigns-detail-view .cp-detail-save-bar {
    width: calc(100% - 24px);
    bottom: 12px;
  }

  body.cp-detail-has-pending .campaigns-detail-view {
    padding-bottom: 120px;
  }
}

.campaigns-detail-view .cp-detail-row.cp-row-dirty {
  background: color-mix(in srgb, #f59e0b 14%, var(--panel));
}

.campaigns-detail-view .cp-detail-row.cp-row-selected {
  box-shadow: inset 3px 0 0 var(--brand);
}

.campaigns-detail-view .cp-detail-row.cp-row-selected.cp-row-dirty {
  background: color-mix(in srgb, #f59e0b 14%, var(--panel));
}

.campaigns-detail-view .cp-detail-row.cp-row-dirty:hover {
  background: color-mix(in srgb, #f59e0b 20%, var(--panel));
}

[data-theme="light"] .campaigns-detail-view .cp-detail-row.cp-row-dirty {
  background: rgba(245, 158, 11, 0.12);
}

[data-theme="light"] .campaigns-detail-view .cp-detail-row.cp-row-dirty:hover {
  background: rgba(245, 158, 11, 0.18);
}

.campaigns-detail-view .cp-detail-row.cp-row-saved {
  background: color-mix(in srgb, var(--green) 18%, var(--panel));
  transition: background 0.35s ease;
}

.campaigns-detail-view .cp-detail-row.cp-row-saved:hover {
  background: color-mix(in srgb, var(--green) 24%, var(--panel));
}

[data-theme="light"] .campaigns-detail-view .cp-detail-row.cp-row-saved {
  background: rgba(62, 207, 142, 0.14);
}

[data-theme="light"] .campaigns-detail-view .cp-detail-row.cp-row-saved:hover {
  background: rgba(62, 207, 142, 0.2);
}

.campaigns-detail-view .cp-detail-row.cp-row-error {
  background: color-mix(in srgb, var(--red) 14%, var(--panel));
}

.campaigns-detail-view .cp-actions-col {
  white-space: nowrap;
  min-width: 11rem;
}

.campaigns-detail-view .cp-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.campaigns-detail-view .cp-save-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.campaigns-detail-view .btn-sm {
  font-size: 11px;
  padding: 4px 8px;
}

#cp-history-drawer {
  width: 720px;
  max-width: 92vw;
}

#cp-history-drawer .cp-history-table {
  width: 100%;
  table-layout: fixed;
}

#cp-history-drawer .cp-history-table th,
#cp-history-drawer .cp-history-table td {
  text-align: left;
  white-space: normal;
  word-break: break-word;
  vertical-align: top;
}

#cp-history-drawer .cp-history-table th:nth-child(1),
#cp-history-drawer .cp-history-table td:nth-child(1) {
  width: 16%;
}

#cp-history-drawer .cp-history-table th:nth-child(2),
#cp-history-drawer .cp-history-table td:nth-child(2),
#cp-history-drawer .cp-history-table th:nth-child(3),
#cp-history-drawer .cp-history-table td:nth-child(3) {
  width: 22%;
}

#cp-history-drawer .cp-history-table th:nth-child(4),
#cp-history-drawer .cp-history-table td:nth-child(4) {
  width: 20%;
}

#cp-history-drawer .cp-history-table th:nth-child(5),
#cp-history-drawer .cp-history-table td:nth-child(5) {
  width: 20%;
}

.cp-signed-warn {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
}

.cp-signed-warn[hidden] {
  display: none !important;
}

.cp-signed-warn__panel {
  width: min(380px, 94vw);
  padding: 16px 18px 14px;
  border-radius: 10px;
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: color-mix(in srgb, #291415 72%, var(--panel));
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .cp-signed-warn__panel {
  background: #fff5f5;
  border-color: rgba(239, 68, 68, 0.35);
}

.cp-signed-warn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: 8px;
  border-radius: 8px;
  color: #f87171;
  background: rgba(248, 113, 113, 0.14);
}

.cp-signed-warn__title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: #fca5a5;
}

[data-theme="light"] .cp-signed-warn__title {
  color: #b91c1c;
}

.cp-signed-warn__text {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
}

.cp-signed-warn__meta {
  margin: 0 0 12px;
  font-size: 11px;
}

.cp-signed-warn__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.cp-signed-warn__actions .btn-stroke {
  min-height: 32px;
  padding: 5px 12px;
  font-size: 12px;
}

.campaigns-view .insights-panel {
  margin-left: 28px;
  margin-right: 28px;
  max-width: calc(100% - 56px);
  box-sizing: border-box;
  min-width: 0;
}

.campaigns-view .cp-card--campaign.case-card {
  padding: 0;
}

.campaigns-view .cp-card--campaign {
  margin-bottom: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid rgba(217, 204, 65, 0.22);
  background: var(--surface);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 24px rgba(0, 0, 0, 0.18);
}

[data-theme="light"] .campaigns-view .cp-card--campaign {
  border-color: rgba(180, 155, 40, 0.35);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.campaigns-view .cp-card__head {
  margin: 0;
  padding: 12px 14px 11px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(165deg,
      color-mix(in srgb, #d9cc41 12%, var(--panel)) 0%,
      var(--panel) 72%);
}

[data-theme="light"] .campaigns-view .cp-card__head {
  background: linear-gradient(165deg, rgba(243, 237, 212, 0.95) 0%, var(--panel) 75%);
}

.campaigns-view .cp-card__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text);
  margin: 0 0 2px;
  line-height: 1.3;
  word-break: break-word;
}

.campaigns-view .cp-card__kicker {
  margin: 0;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.campaigns-view .cp-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.campaigns-view .cp-metrics-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}

.campaigns-view .cp-metrics-table thead th {
  padding: 7px 5px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e8df68;
  text-align: center;
  vertical-align: middle;
  background: linear-gradient(180deg, #2e2a16 0%, #1e1c12 100%);
  border-bottom: 1px solid rgba(217, 204, 65, 0.32);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .campaigns-view .cp-metrics-table thead th {
  color: #4a4518;
  background: linear-gradient(180deg, #ede6c8 0%, #e0d8b6 100%);
  border-bottom-color: rgba(140, 120, 40, 0.35);
  text-shadow: none;
}

.campaigns-view .cp-metrics-table tbody td {
  padding: 8px 6px;
  text-align: center;
  vertical-align: middle;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: color-mix(in srgb, var(--panel) 55%, var(--surface));
}

[data-theme="light"] .campaigns-view .cp-metrics-table tbody td {
  border-color: rgba(0, 0, 0, 0.07);
  background: var(--surface);
}

.campaigns-view .cp-metrics-table tbody tr:hover td {
  background: color-mix(in srgb, var(--green) 6%, var(--surface));
}

[data-theme="light"] .campaigns-view .cp-metrics-table tbody tr:hover td {
  background: rgba(62, 207, 142, 0.06);
}

.campaigns-view .cp-cell-num {
  font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.campaigns-view .cp-cell-num--accent {
  color: color-mix(in srgb, var(--green) 88%, var(--text));
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
}

.campaigns-view .cp-cell-money {
  font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--text);
}

@supports not (background: color-mix(in srgb, red, blue)) {
  .campaigns-view .cp-card__head {
    background: rgba(217, 204, 65, 0.1);
  }

  .campaigns-view .cp-metrics-table tbody td {
    background: var(--panel);
  }

  .campaigns-view .cp-cell-num--accent {
    color: var(--green);
  }
}

.main .view-wrap.retention-view {
  display: block;
  flex: 1 1 0%;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  overflow-x: visible;
  overflow-y: auto;
  padding-bottom: 12px;
}

.retention-view .insights-panel--wide .insights-chart-wrap#rt-cancel-day-wrap {
  height: min(200px, 28vh);
}

.retention-view .rt-below-table-block {
  display: block;
  box-sizing: border-box;
  width: calc(100% - 56px);
  max-width: calc(100% - 56px);
  min-width: 0;
  margin: 32px 28px 0;
}

.retention-view .rt-below-table-block .rt-cancel-agent-section {
  margin: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.retention-view .rt-cancel-agent-chart-wrap {
  position: relative;
  height: auto !important;
  min-height: 220px;
  max-height: none;
  overflow: visible !important;
  margin-top: 8px;
  margin-bottom: 24px;
}

.retention-view .rt-agent-cancel-total {
  margin: 0 0 4px;
  font-size: 12px;
}

.main .view-wrap.retention-view > .table-wrap,
.retention-view .rt-table-wrap {
  display: block;
  box-sizing: border-box;
  width: calc(100% - 56px);
  max-width: calc(100% - 56px);
  min-width: 0;
  margin: 80px 28px 20px;
  clear: both;
  padding: 14px 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--panel) 92%, var(--bg));
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
  flex: 0 0 auto;
  min-height: auto;

  overflow-x: visible;
  overflow-y: visible;
  isolation: isolate;
}

[data-theme="light"] .main .view-wrap.retention-view > .table-wrap {
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.retention-view .rt-table-x {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

@supports (overflow: clip) {
  .retention-view .rt-table-x {
    overflow-y: clip;
  }
}

.retention-view .table-wrap .data-table {
  width: max-content;
  min-width: 100%;
  margin: 0;
}

.retention-view .table-wrap .data-table thead th {
  position: sticky;
  top: 0;

  z-index: 2;
  background: color-mix(in srgb, var(--panel) 96%, var(--bg));
  box-shadow: 0 1px 0 var(--border);
}

[data-theme="light"] .retention-view .table-wrap .data-table thead th {
  background: var(--surface);
}

.retention-view .table-wrap #rt-table .th-actions {
  min-width: 400px;
}

@supports not (background: color-mix(in srgb, red, blue)) {
  .main .view-wrap.retention-view > .table-wrap {
    background: var(--panel);
  }

  .retention-view .table-wrap .data-table thead th {
    background: var(--panel);
  }
}

.retention-view .rt-op-form {
  display: grid;
  grid-template-columns: 110px 120px 100px 140px auto;
  gap: 4px;
  align-items: center;
}

.retention-view .rt-reason-cell {
  max-width: min(420px, 36vw);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.retention-view .td-badge-col .pipe-badge {
  white-space: nowrap;
}

.retention-view .rt-op-form .rt-op-btn {
  padding-left: 10px;
  padding-right: 10px;
}

@media (max-width: 920px) {
  .retention-view .rt-op-form {
    grid-template-columns: 1fr;
  }
}

.retention-view .rt-review-col {
  width: 52px;
  text-align: center;
  vertical-align: middle;
  padding-left: 6px;
  padding-right: 6px;
}

.retention-view .rt-review-cb {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--green, #22c55e);
}

.retention-view #rt-table tbody tr.rt-row--reviewed {
  background: rgba(34, 197, 94, 0.1);
}

[data-theme="light"] .retention-view #rt-table tbody tr.rt-row--reviewed {
  background: rgba(34, 197, 94, 0.14);
}

.retention-view #rt-table tbody tr.rt-row--reviewed:hover {
  background: rgba(34, 197, 94, 0.16);
}

.rt-review-resume {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.rt-review-resume.rt-review-resume--open {
  display: flex;
}

.rt-review-resume__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.rt-review-resume__card {
  position: relative;
  z-index: 1;
  max-width: 440px;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
}

.rt-review-resume__title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
}

.rt-review-resume__text {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted, #94a3b8);
}

.rt-review-resume__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.audit-log-view .audit-log-meta {
  padding: 4px 28px 10px;
  font-size: 11.5px;
}

.audit-log-view .audit-log-error {
  padding: 8px 28px;
}

.audit-log-table-wrap {
  padding-bottom: 8px;
}

.audit-log-table th,
.audit-log-table td {
  vertical-align: top;
}

.audit-log-table td:nth-child(1),
.audit-log-table th:nth-child(1),
.audit-log-table td:nth-child(2),
.audit-log-table th:nth-child(2),
.audit-log-table td:nth-child(3),
.audit-log-table th:nth-child(3),
.audit-log-table td:nth-child(4),
.audit-log-table th:nth-child(4),
.audit-log-table td:nth-child(5),
.audit-log-table th:nth-child(5),
.audit-log-table td:nth-child(6),
.audit-log-table th:nth-child(6),
.audit-log-table td:nth-child(7),
.audit-log-table th:nth-child(7),
.audit-log-table td:nth-child(9),
.audit-log-table th:nth-child(9),
.audit-log-table td:nth-child(10),
.audit-log-table th:nth-child(10) {
  white-space: nowrap;
}

.audit-log-table td:nth-child(8),
.audit-log-table th:nth-child(8) {
  white-space: normal;
  min-width: 140px;
  max-width: 360px;
  word-break: break-word;
}

.audit-log-table td:nth-child(11),
.audit-log-table th:nth-child(11),
.audit-log-table td:nth-child(12),
.audit-log-table th:nth-child(12) {
  white-space: normal;
  max-width: 280px;
  word-break: break-word;
}

.audit-log-filters .filter-group--stack {
  min-width: 140px;
}

@media (max-width: 899px) {
  .insights-grid {
    grid-template-columns: 1fr;
    padding-left: 16px;
    padding-right: 16px;
    gap: 12px;
  }

  .insights-panel--wide {
    grid-column: 1;
  }

  .insights-chart-wrap--bars {
    height: min(320px, 50vh);
  }

  .insights-chart-wrap--agents {
    min-height: 220px;
    max-height: 70vh;
  }
}

@media (max-width: 899px) {

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: var(--sb-w) !important;

    transform: translateX(-100%);
    transition: none;

    z-index: 55;
    will-change: transform;
  }

  .sb-ready .sidebar {
    transition: transform var(--slide);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .view-content {
    padding: 20px 16px;
  }

  .site-footer {
    padding: 10px 16px;
  }

  .case-view-main {
    padding-left: 16px;
    padding-right: 16px;
  }
}

.comp-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 8px;
  padding: 0 28px;
  margin: 6px 0 14px;
}

.comp-card {
  padding: 14px 16px;
  background: var(--panel, #1c1f24);
  border: 1px solid var(--border, rgba(255, 255, 255, .07));
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 72px;
  transition: border-color .15s ease, background .15s ease;
}

.comp-card:hover {
  border-color: rgba(255, 255, 255, .14);
}

.comp-card-label {
  font-size: 12px;
  letter-spacing: .2px;
  color: var(--muted, #9ca3af);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.comp-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.comp-dot--total {
  background: #60a5fa;
}

.comp-dot--pending {
  background: #9ca3af;
}

.comp-dot--checking {
  background: #f59e0b;
}

.comp-dot--completed {
  background: #3ecf8e;
}

.comp-dot--cancelled {
  background: #ef4444;
}

.comp-card-value {
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text, #e6e6e6);
  letter-spacing: -.5px;
}

.comp-chart-panel {
  margin: 0 28px 14px;
  padding: 16px 18px;
}

.comp-chart-hd {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.comp-chart-body {
  position: relative;
  min-height: 220px;
}

.comp-chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--muted, #888);
  font-size: 13px;
}

@media (max-width: 720px) {
  .comp-stats {
    padding: 0 16px;
  }

  .comp-chart-panel {
    margin: 0 16px 14px;
  }
}

.toast-host {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(92vw, 380px);
}

.toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28), 0 1px 2px rgba(0, 0, 0, .4);
  pointer-events: auto;
  font-size: 13px;
  line-height: 1.45;
  animation: toastIn .18s ease-out both;
  backdrop-filter: blur(10px);
}

.toast--leaving {
  animation: toastOut .16s ease-in both;
}

@keyframes toastIn {
  from {
    transform: translateY(8px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes toastOut {
  from {
    transform: translateY(0);
    opacity: 1;
  }

  to {
    transform: translateY(8px);
    opacity: 0;
  }
}

.toast-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.toast-body {
  min-width: 0;
}

.toast-title {
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 2px;
  color: #ededed;
  letter-spacing: -.1px;
}

.toast-msg {
  color: rgba(237, 237, 237, .62);
  font-size: 12.5px;
  word-wrap: break-word;
}

.toast-close {
  background: transparent;
  border: 0;
  cursor: pointer;
  color: rgba(237, 237, 237, .4);
  padding: 2px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .12s ease, background .12s ease;
}

.toast-close:hover {
  background: rgba(255, 255, 255, .06);
  color: #ededed;
}

.toast-close svg {
  width: 14px;
  height: 14px;
}

.toast--success .toast-ico {
  color: #3ecf8e;
}

.toast--error .toast-ico {
  color: #ef4444;
}

.toast--warning .toast-ico {
  color: #f59e0b;
}

.toast--info .toast-ico {
  color: #60a5fa;
}

.checklist-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checklist-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color var(--ease), box-shadow var(--ease);
}

.checklist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.checklist-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.checklist-status {
  width: 160px;
}

.checklist-notes {
  width: 100%;
  height: 60px;
  min-height: 60px;
  resize: vertical;
}

.item--fail {
  border-color: var(--s-red);
  box-shadow: 0 0 0 1px var(--s-red-bg);
}

.item--fail .checklist-notes {
  border-color: var(--s-red);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border);
  transition: .25s cubic-bezier(.4, 0, .2, 1);
  border-radius: 34px;
  border: 1px solid var(--border-mid);
}

.toggle-slider:hover {
  border-color: var(--border-strong);
  background-color: var(--hover);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 2px;
  bottom: 2px;
  background-color: #fff;
  transition: .25s cubic-bezier(.4, 0, .2, 1);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

input:checked + .toggle-slider {
  background-color: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 0 8px rgba(var(--brand-rgb), 0.4);
}

input:checked + .toggle-slider:before {
  transform: translateX(14px);
}

[data-theme="light"] .toggle-slider:before {
  background-color: #fff;
}

.mod-view[data-module="sales"] #mod-table tbody td {
  padding-top: 4px;
  padding-bottom: 4px;
  text-transform: uppercase;
}

.mod-view[data-module="sales"].sales-hide-created-col #mod-table .col-created-at {
  display: none;
}

.pipe-badge--date-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-d);
  color: var(--brand);
  border: 1px solid var(--brand-b);
  padding: 5px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--r-md);
  letter-spacing: 0.03em;
}

.mod-filters-summary {
  margin: 0 0 12px;
}

[data-theme="light"] .pipe-badge--date-range {
  background: rgba(var(--brand-rgb), 0.08);
}

.pag-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: auto;
  flex-shrink: 0;
}

.pag-toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pag-info {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pag-info .muted-sm {
  color: var(--faint);
  font-size: 10px;
}

.pag-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pag-btn {
  height: 24px;
  min-width: 24px;
  padding: 0 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all var(--ease);
}

.pag-btn:hover:not(:disabled) {
  background: var(--hover);
  border-color: var(--border-mid);
  color: var(--text);
}

.pag-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}

.pag-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pag-per-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pag-per-label {
  font-size: 11px;
  color: var(--faint);
  white-space: nowrap;
}

.pag-per-select {
  height: 24px !important;
  padding: 0 24px 0 8px !important;
  font-size: 11px !important;
  font-family: var(--font-mono) !important;
  background-position: right 4px center !important;
  min-width: 60px;
}

#mod-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.main .view-wrap.mod-view[data-module="quality_control"] {
  display: block;
  flex: 1 1 0%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-padding-bottom: 28px;
}

.main .view-wrap.mod-view[data-module="quality_control"] .table-wrap {
  flex: 0 0 auto;
  min-height: 0;
  overflow-x: auto;
  overflow-y: visible;
}

.mod-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.sales-stats-grid {
  margin: 0 28px 16px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
  position: relative;
  overflow: hidden;
  box-shadow: var(--card-shadow, none);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-mid);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12), 0 4px 6px rgba(0, 0, 0, 0.08);
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--brand);
  opacity: 0.3;
}

.stat-card.stat-pending::before { background: #f59e0b; opacity: 0.6; }
.stat-card.stat-critical::before { background: #ef4444; opacity: 0.6; }
.stat-card.stat-risk::before { background: #f97316; opacity: 0.6; }
.stat-card.stat-grand::before { background: #6366f1; opacity: 0.85; }
.stat-card.stat-grand .stat-value { color: #6366f1; }

.stat-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--faint);
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  font-family: var(--font-mono);
  line-height: 1;
}

.stat-hint {
  margin-top: 6px;
  font-size: 10px;
  line-height: 1.3;
}

.pipe-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  min-width: 90px;
  border: 1px solid transparent;
}

.badge-pending {
  background: rgba(245, 158, 11, 0.1) !important;
  color: #f59e0b !important;
  border-color: rgba(245, 158, 11, 0.2) !important;
}

.badge-completed {
  background: rgba(16, 185, 129, 0.1) !important;
  color: #10b981 !important;
  border-color: rgba(16, 185, 129, 0.2) !important;
}

.badge-critical {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
}

.badge-risk {
  background: rgba(249, 115, 22, 0.1) !important;
  color: #f97316 !important;
  border-color: rgba(249, 115, 22, 0.2) !important;
}

.badge-info {
  background: rgba(59, 130, 246, 0.1) !important;
  color: #3b82f6 !important;
  border-color: rgba(59, 130, 246, 0.2) !important;
}

.badge-advanced {
  background: rgba(139, 92, 246, 0.12) !important;
  color: #a78bfa !important;
  border-color: rgba(139, 92, 246, 0.25) !important;
}

[data-theme="light"] .badge-advanced {
  background: rgba(139, 92, 246, 0.1) !important;
  color: #7c3aed !important;
  border-color: rgba(139, 92, 246, 0.22) !important;
}

body:has([data-module="quality_control"]) .mod-stats-grid {
  gap: 10px;
  margin-bottom: 14px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

body:has([data-module="quality_control"]) .stat-card {
  padding: 12px 14px;
  gap: 4px;
  border-radius: var(--r-md);
}

body:has([data-module="quality_control"]) .stat-card:hover {
  transform: none;
  box-shadow: var(--card-shadow, none);
}

body:has([data-module="quality_control"]) .stat-value {
  font-size: 22px;
}

body:has([data-module="quality_control"]) .filters-bar {
  padding: 8px 0;
  gap: 8px 10px;
}

body:has([data-module="quality_control"]) .filters-bar .input-stroke,
body:has([data-module="quality_control"]) .filters-bar .select-stroke {
  height: 26px;
  min-height: 26px;
  font-size: 11px;
  padding-top: 0;
  padding-bottom: 0;
}

body:has([data-module="quality_control"]) .filters-bar .btn-stroke {
  min-height: 26px;
  height: 26px;
  padding: 0 10px;
  font-size: 11px;
}

body:has([data-module="quality_control"]) .filters-bar .btn-stroke svg {
  width: 13px;
  height: 13px;
}

body:has([data-module="quality_control"]) #mod-table thead th,
body:has([data-module="quality_control"]) #mod-table tbody td {
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 11px;
}

body:has([data-module="quality_control"]) #mod-table thead th {
  font-size: 10px;
}

body:has([data-module="quality_control"]) #mod-table .ibtn {
  width: 26px;
  height: 26px;
}

body:has([data-module="quality_control"]) .pagination-bar {
  padding: 6px 16px 10px;
  font-size: 11px;
  gap: 8px 12px;
}

body:has([data-module="quality_control"]) #mod-pagination .pag-per-select {
  height: 26px;
  min-height: 26px;
  font-size: 11px;
}

body:has([data-module="quality_control"]) #mod-pagination .btn-stroke {
  height: 26px;
  min-height: 26px;
  font-size: 11px;
}

body:has([data-module="quality_control"]) #mod-pagination .pag-btn {
  height: 26px;
  min-height: 26px;
  min-width: 26px;
}

body:has([data-module="quality_control"]) #mod-drawer {
  width: min(520px, 95vw);
}

body:has([data-module="quality_control"]) #mod-drawer .drawer-hd {
  height: 40px;
  padding: 0 12px;
}

body:has([data-module="quality_control"]) #mod-drawer .drawer-hd .ibtn {
  width: 26px;
  height: 26px;
}

body:has([data-module="quality_control"]) #mod-drawer .drawer-title {
  font-size: 12px;
}

body:has([data-module="quality_control"]) #mod-drawer .drawer-bd {
  padding: 12px 12px 6px;
}

body:has([data-module="quality_control"]) #mod-drawer .drawer-ft {
  padding: 8px 12px;
}

body:has([data-module="quality_control"]) #mod-drawer .drawer-ft .btn-stroke {
  min-height: 26px;
  height: 26px;
  padding: 0 10px;
  font-size: 11px;
}

body:has([data-module="quality_control"]) #mod-drawer .insights-panel {
  padding: 10px 12px !important;
}

body:has([data-module="quality_control"]) #mod-drawer .drawer-section.mb-12 {
  margin-bottom: 8px !important;
}

body:has([data-module="quality_control"]) #mod-drawer .drawer-section h4 {
  font-size: 12px !important;
  padding: 8px 0 6px 0 !important;
}

body:has([data-module="quality_control"]) #mod-drawer .field .field-label {
  font-size: 10px;
  margin-bottom: 4px;
}

body:has([data-module="quality_control"]) #mod-drawer .field textarea.input-stroke {
  min-height: 72px;
  padding: 6px 10px;
  font-size: 12px;
}

body:has([data-module="quality_control"]) #mod-drawer .field .select-stroke,
body:has([data-module="quality_control"]) #mod-drawer #f-audio-file.input-stroke {
  height: 26px;
  min-height: 26px;
  font-size: 12px;
}

body:has([data-module="quality_control"]) #mod-btn-upload-audio {
  height: 26px !important;
  min-height: 26px !important;
  padding: 0 8px !important;
  font-size: 11px !important;
}

body:has([data-module="quality_control"]) #mod-drawer .field.mb-12 {
  margin-bottom: 8px !important;
}

body:has([data-module="quality_control"]) .qc-upload__bar {
  height: 6px;
  background: rgba(127, 127, 127, 0.18);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

body:has([data-module="quality_control"]) .qc-upload__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #fff));
  transition: width 120ms linear;
}

body:has([data-module="quality_control"]) .qc-upload__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  font-size: 10px;
  color: var(--muted);
}

body:has([data-module="quality_control"]) .qc-upload__pct {
  font-family: var(--font-mono);
  color: var(--text);
}

body:has([data-module="evaluation"]) .eval-layout {
  gap: 14px;
}

body:has([data-module="evaluation"]) .eval-sidebar {
  width: 400px;
  top: 14px;
  gap: 14px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 12px;
}

body:has([data-module="evaluation"]) .perf-dashboard {
  margin-bottom: 18px;
  border-radius: var(--r-sm);
}

body:has([data-module="evaluation"]) .perf-overall {
  padding: 12px 14px;
  gap: 6px;
  min-width: 116px;
}

body:has([data-module="evaluation"]) .overall-circle {
  width: 52px;
  height: 52px;
}

body:has([data-module="evaluation"]) .overall-circle.integrity-circle {
  border-width: 3px;
}

body:has([data-module="evaluation"]) .overall-circle:not(.integrity-circle)::after {
  inset: 3px;
}

body:has([data-module="evaluation"]) .overall-circle .num {
  font-size: 16px;
}

body:has([data-module="evaluation"]) .perf-cat-item {
  padding: 10px 12px;
}

body:has([data-module="evaluation"]) .perf-cat-name {
  margin-bottom: 6px;
}

body:has([data-module="evaluation"]) .perf-cat-score {
  font-size: 15px;
  margin-bottom: 4px;
}

body:has([data-module="evaluation"]) .perf-cat-bar {
  margin-bottom: 6px;
}

body:has([data-module="evaluation"]) .audio-card {
  padding: 12px 14px;
  margin-bottom: 8px;
}

body:has([data-module="evaluation"]) .eval-sidebar-save {
  margin-top: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

body:has([data-module="evaluation"]) .player-ui {
  margin-top: 12px;
  padding: 12px 14px;
}

body:has([data-module="evaluation"]) .player-header {
  gap: 8px;
  margin-bottom: 10px;
}

body:has([data-module="evaluation"]) .speed-select {
  height: 26px;
  min-height: 26px;
  padding: 0 6px;
  line-height: 1;
}

body:has([data-module="evaluation"]) .waveform-wrap {
  height: 32px;
  margin: 10px 0;
  gap: 2px;
}

body:has([data-module="evaluation"]) .player-controls {
  gap: 12px;
}

body:has([data-module="evaluation"]) .ctrl-btn {
  width: 26px;
  height: 26px;
}

body:has([data-module="evaluation"]) .play-btn {
  width: 26px;
  height: 26px;
}

body:has([data-module="evaluation"]) .eval-profile-card.agent-card {
  padding: 14px 16px;
  text-align: left;
}

body:has([data-module="evaluation"]) .eval-profile-card .eval-profile-avatar {
  width: 48px;
  height: 48px;
  margin: 0;
  font-size: 16px;
}

body:has([data-module="evaluation"]) .eval-profile-card .agent-name {
  font-size: 15px;
}

body:has([data-module="evaluation"]) .eval-profile-actions {
  grid-template-columns: 1fr 1fr;
}

body:has([data-module="evaluation"]) .eval-profile-actions .btn-stroke {
  height: 26px;
  min-height: 26px;
  font-size: 10px;
  gap: 6px;
  padding: 0 8px;
}

body:has([data-module="evaluation"]) .eval-case-table-wrap {
  border: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.1);
}

body:has([data-module="evaluation"]) .eval-case-table th {
  width: 34%;
  padding: 4px 8px;
  font-size: 8px;
  background: rgba(255, 255, 255, 0.03);
}

body:has([data-module="evaluation"]) .eval-case-table td {
  padding: 4px 8px;
  font-size: 10px;
  line-height: 1.15;
}

body:has([data-module="evaluation"]) .eval-case-table th,
body:has([data-module="evaluation"]) .eval-case-table td {
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}

body:has([data-module="evaluation"]) .eval-case-table tr:last-child th,
body:has([data-module="evaluation"]) .eval-case-table tr:last-child td {
  border-bottom: none;
}

body:has([data-module="evaluation"]) .eval-section-card {
  margin-bottom: 14px;
  border-radius: var(--r-sm);
}

body:has([data-module="evaluation"]) .eval-section-card-hd {
  padding: 10px 14px;
}

body:has([data-module="evaluation"]) .eval-section-card-hd h3 {
  font-size: 12px;
}

body:has([data-module="evaluation"]) .eval-question-item {
  padding: 12px 14px;
}

body:has([data-module="evaluation"]) .eval-question-txt {
  font-size: 12px;
  margin-bottom: 10px;
  line-height: 1.45;
}

body:has([data-module="evaluation"]) .eval-answer-btns {
  gap: 6px;
}

body:has([data-module="evaluation"]) .eval-ans-btn {
  height: 26px;
  min-height: 26px;
  font-size: 9px;
  border-radius: 999px;
  box-shadow: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: color-mix(in srgb, var(--text) 72%, var(--muted));
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

body:has([data-module="evaluation"]) .eval-ans-btn::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.18);
  background: transparent;
  flex-shrink: 0;
}

body:has([data-module="evaluation"]) .eval-ans-btn:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--border-mid);
  color: var(--text);
}

body:has([data-module="evaluation"]) .eval-ans-btn.active-PASS {
  background: rgba(62, 207, 142, 0.22) !important;
  border-color: rgba(62, 207, 142, 0.55) !important;
  color: #dffcef !important;
}
body:has([data-module="evaluation"]) .eval-ans-btn.active-PASS::before {
  border-color: rgba(62, 207, 142, 0.85);
  background: #3ecf8e;
}

body:has([data-module="evaluation"]) .eval-ans-btn.active-FAIL {
  background: rgba(247, 96, 90, 0.22) !important;
  border-color: rgba(247, 96, 90, 0.55) !important;
  color: #ffe1df !important;
}
body:has([data-module="evaluation"]) .eval-ans-btn.active-FAIL::before {
  border-color: rgba(247, 96, 90, 0.85);
  background: #f7605a;
}

body:has([data-module="evaluation"]) .eval-ans-btn.active-NEEDS {
  background: rgba(247, 169, 75, 0.22) !important;
  border-color: rgba(247, 169, 75, 0.60) !important;
  color: #ffefd7 !important;
}
body:has([data-module="evaluation"]) .eval-ans-btn.active-NEEDS::before {
  border-color: rgba(247, 169, 75, 0.95);
  background: #f7a94b;
}

body:has([data-module="evaluation"]) .eval-ans-btn.active-NA {
  background: rgba(255,255,255,0.16) !important;
  border-color: rgba(255,255,255,0.28) !important;
  color: rgba(255,255,255,0.92) !important;
}

.view-wrap.mod-view[data-module="evaluation"] .eval-ans-btn.active-PASS { background: rgba(62, 207, 142, 0.22) !important; border-color: rgba(62, 207, 142, 0.55) !important; color: #dffcef !important; }
.view-wrap.mod-view[data-module="evaluation"] .eval-ans-btn.active-FAIL { background: rgba(247, 96, 90, 0.22) !important; border-color: rgba(247, 96, 90, 0.55) !important; color: #ffe1df !important; }
.view-wrap.mod-view[data-module="evaluation"] .eval-ans-btn.active-NEEDS { background: rgba(247, 169, 75, 0.22) !important; border-color: rgba(247, 169, 75, 0.60) !important; color: #ffefd7 !important; }
.view-wrap.mod-view[data-module="evaluation"] .eval-ans-btn.active-NA { background: rgba(255,255,255,0.16) !important; border-color: rgba(255,255,255,0.28) !important; color: rgba(255,255,255,0.92) !important; }
body:has([data-module="evaluation"]) .eval-ans-btn.active-NA::before {
  border-color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.55);
}

.view-wrap.mod-view[data-module="evaluation"] .perf-cat-dots .dot,
body:has([data-module="evaluation"]) .perf-cat-dots .dot {
  background: rgba(255,255,255,0.10);
}

.view-wrap.mod-view[data-module="evaluation"] .perf-cat-dots .dot.pass,
body:has([data-module="evaluation"]) .perf-cat-dots .dot.pass {
  background: #3ecf8e;
}

.view-wrap.mod-view[data-module="evaluation"] .perf-cat-dots .dot.fail,
body:has([data-module="evaluation"]) .perf-cat-dots .dot.fail {
  background: #f7605a;
}

.view-wrap.mod-view[data-module="evaluation"] .perf-cat-dots .dot.needs,
body:has([data-module="evaluation"]) .perf-cat-dots .dot.needs {
  background: #f7a94b;
}

.view-wrap.mod-view[data-module="evaluation"] .perf-cat-dots .dot.na,
body:has([data-module="evaluation"]) .perf-cat-dots .dot.na {
  background: rgba(255,255,255,0.55);
}

.view-wrap.mod-view[data-module="evaluation"] .eval-ans-btn,
.view-wrap.mod-view[data-module="evaluation"] .eval-ans-btn[class*="active-"] {
  box-shadow: none !important;
  text-shadow: none !important;
}

.view-wrap.mod-view[data-module="evaluation"] .eval-ans-btn {
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: color-mix(in srgb, var(--text) 72%, var(--muted));
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.view-wrap.mod-view[data-module="evaluation"] .eval-ans-btn::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.18);
  background: transparent;
  flex-shrink: 0;
}

.view-wrap.mod-view[data-module="evaluation"] .eval-ans-btn.active-PASS::before { border-color: rgba(62, 207, 142, 0.85); background: #3ecf8e; }
.view-wrap.mod-view[data-module="evaluation"] .eval-ans-btn.active-FAIL::before { border-color: rgba(247, 96, 90, 0.85); background: #f7605a; }
.view-wrap.mod-view[data-module="evaluation"] .eval-ans-btn.active-NEEDS::before { border-color: rgba(247, 169, 75, 0.95); background: #f7a94b; }
.view-wrap.mod-view[data-module="evaluation"] .eval-ans-btn.active-NA::before { border-color: rgba(255,255,255,0.55); background: rgba(255,255,255,0.55); }

body:has([data-module="evaluation"]) .btn-note-toggle {
  width: 26px;
  height: 26px;
}

body:has([data-module="evaluation"]) .note-area {
  padding: 10px;
  font-size: 11px;
  margin-top: 10px;
  min-height: 64px;
}

body:has([data-module="evaluation"]) .note-preview {
  padding: 10px;
  font-size: 11px;
  margin-top: 8px;
}

body:has([data-module="evaluation"]) .eval-sidebar-save .btn-stroke.btn-brand {
  height: 26px;
  min-height: 26px;
  font-size: 10px;
}

body:has([data-module="evaluation"]) .side-modal {
  width: min(460px, 96vw);
  padding: 0;
}

.view-wrap.mod-view[data-module="evaluation"] ~ .side-modal,
body .side-modal#lies-modal,
body .side-modal#report-modal {
  padding: 0;
}

body:has([data-module="evaluation"]) .ts-link {
  font-size: 10px;
  padding: 1px 6px;
}

body:has([data-module="evaluation"]) .mention-menu__btn {
  padding: 6px 10px;
  font-size: 11px;
}

body:has([data-module="qc_report"]) .qcr-table th,
body:has([data-module="qc_report"]) .qcr-table td,
.view-wrap.qcr-view .qcr-table th,
.view-wrap.qcr-view .qcr-table td {
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.15;
}

body:has([data-module="qc_report"]) .qcr-table thead th.qcr-th-sort,
.view-wrap.qcr-view .qcr-table thead th.qcr-th-sort {
  padding: 0;
  cursor: pointer;
  user-select: none;
}

body:has([data-module="qc_report"]) .qcr-table thead th.qcr-th-sort .qcr-th-sort-link,
.view-wrap.qcr-view .qcr-table thead th.qcr-th-sort .qcr-th-sort-link {
  display: block;
  width: 100%;
  padding: 5px 8px;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  box-sizing: border-box;
}

body:has([data-module="qc_report"]) .qcr-table thead th.qcr-th-sort.num .qcr-th-sort-link,
.view-wrap.qcr-view .qcr-table thead th.qcr-th-sort.num .qcr-th-sort-link {
  text-align: right;
}

body:has([data-module="qc_report"]) .qcr-table thead th,
.view-wrap.qcr-view .qcr-table thead th {
  padding: 5px 8px;
  font-size: 8px;
}

body:has([data-module="qc_report"]) .qcr-rank,
.view-wrap.qcr-view .qcr-rank {
  width: 14px;
  height: 14px;
  line-height: 14px;
  margin-right: 5px;
  font-size: 8px;
}

body:has([data-module="qc_report"]) .qcr-pill,
.view-wrap.qcr-view .qcr-pill {
  padding: 0 5px;
  font-size: 8px;
  min-width: 40px;
  line-height: 1.2;
}

body:has([data-module="qc_report"]) #qcr-drawer .data-table th,
body:has([data-module="qc_report"]) #qcr-drawer .data-table td,
.view-wrap.qcr-view #qcr-drawer .data-table th,
.view-wrap.qcr-view #qcr-drawer .data-table td {
  padding: 4px 8px;
  font-size: 10px;
  line-height: 1.15;
}

body:has([data-module="qc_report"]) .qcr-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

body:has([data-module="qc_report"]) .qcr-kpi {
  padding: 10px 12px;
}

body:has([data-module="qc_report"]) .qcr-kpi-value {
  font-size: 18px;
}

@media (max-width: 1100px) {
  body:has([data-module="qc_report"]) .qcr-filters .filters-bar {
    flex-wrap: wrap;
  }

  body:has([data-module="qc_report"]) .qcr-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

@media (max-width: 720px) {
  body:has([data-module="qc_report"]) .qcr-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body:has([data-module="qc_report"]) .qcr-table {
    min-width: 640px;
  }

  body:has([data-module="qc_report"]) .qcr-pagination,
  .view-wrap.qcr-view .qcr-pagination {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  body:has([data-module="qc_report"]) .qcr-pagination .pag-btns {
    justify-content: center;
    flex-wrap: wrap;
  }

  body:has([data-module="qc_report"]) .qcr-page-hd {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

@media (max-width: 1100px) {
  body:has([data-module="evaluation"]) .eval-layout,
  .view-wrap.mod-view[data-module="evaluation"] .eval-layout {
    flex-direction: column;
    gap: 16px;
  }

  body:has([data-module="evaluation"]) .eval-sidebar,
  .view-wrap.mod-view[data-module="evaluation"] .eval-sidebar {
    width: 100%;
    max-width: none;
    position: static;
    max-height: none;
    order: -1;
    margin-top: 0;
  }

  body:has([data-module="evaluation"]) .eval-main {
    margin-top: 0;
  }

  .view-wrap.mod-view[data-module="evaluation"] .eval-hd-score.perf-dashboard {
    flex-wrap: wrap;
  }

  .view-wrap.mod-view[data-module="evaluation"] .eval-hd-score .perf-categories {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  }
}

@media (max-width: 720px) {
  body:has([data-module="evaluation"]) .eval-profile-actions {
    grid-template-columns: 1fr;
  }

  body:has([data-module="evaluation"]) .eval-notes-grid,
  .view-wrap.mod-view[data-module="evaluation"] .eval-notes-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .view-wrap.mod-view[data-module="evaluation"] .page-hd-actions--split {
    flex-direction: column;
    align-items: stretch !important;
    gap: 8px;
  }

  .view-wrap.mod-view[data-module="evaluation"] .page-hd-actions--split > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .view-wrap.mod-view[data-module="evaluation"] .eval-hd-score .perf-overall {
    min-width: 0;
    flex: 1 1 45%;
  }

  body:has([data-module="evaluation"]) .eval-answer-btns {
    flex-wrap: wrap;
  }

  body:has([data-module="evaluation"]) .eval-ans-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 72px;
  }

  body:has([data-module="evaluation"]) .side-modal {
    width: 100%;
    max-width: 100%;
    right: -100%;
  }

  body:has([data-module="evaluation"]) .side-modal.active {
    right: 0;
  }
}

/* Leads Intake: fila expandible con el detalle parseado del payload del bot */
.li-td-toggle {
  width: 32px;
  text-align: center;
}

.li-toggle-btn {
  transition: transform 0.15s ease;
}

.li-toggle-btn.li-toggle-open {
  transform: rotate(90deg);
}

.li-detail-row td {
  background: color-mix(in srgb, var(--surface) 92%, var(--text) 8%);
  padding: 12px 16px;
}

.li-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px 16px;
}

.li-detail-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.li-detail-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.65;
}

.li-detail-value {
  font-size: 12px;
  word-break: break-word;
}

/* ============================================================
   Feedback nudge modal (recordatorio global, ver templates/header.php +
   assets/feedback-nudge.js). Aparece cada 3 horas / al primer login del
   dia -- estado en localStorage, nunca en el servidor.
   ============================================================ */

.fb-nudge-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 16, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9997;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.fb-nudge-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.fb-nudge-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%) scale(0.96);
  width: min(440px, calc(100% - 32px));
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 94%, transparent) 0%, var(--surface) 100%);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-lg, 12px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.fb-nudge-modal.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.fb-nudge-modal::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #5a5aad, #8f7ee8, #5a5aad);
  background-size: 200% 100%;
  animation: fb-nudge-sheen 6s linear infinite;
}

@keyframes fb-nudge-sheen {
  to { background-position: 200% 0; }
}

.fb-nudge-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.fb-nudge-close:hover {
  background: var(--hover);
  color: var(--text);
}

.fb-nudge-body {
  padding: 30px 26px 22px;
}

.fb-nudge-kicker {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 8px;
}

.fb-nudge-greeting {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.fb-nudge-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.fb-nudge-text {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.fb-nudge-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fb-nudge-form select,
.fb-nudge-form textarea {
  width: 100%;
  font-size: 13px;
  resize: vertical;
}

.fb-nudge-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.fb-nudge-skip {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  padding: 6px 4px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fb-nudge-skip:hover {
  color: var(--text);
}

.fb-nudge-submit {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.fb-nudge-submit:hover {
  filter: brightness(1.08);
}

.fb-nudge-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.fb-nudge-result {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 480px) {
  .fb-nudge-modal {
    width: calc(100% - 24px);
  }

  .fb-nudge-body {
    padding: 24px 18px 18px;
  }
}

/* ===========================================================
   STATUS TIMELINE (.stl)
   Linea de tiempo HORIZONTAL de estados de una venta dentro de una
   celda de tabla -- se usa en Campaign detail y en Automation >
   Campaing. Lo pinta templates/status-timeline.php desde
   sales.status_timeline. Los colores salen de las variables del tema,
   asi que dentro del panel de Automation (que repaletea) se adapta solo.
=========================================================== */

.stl {
  --stl-gap: 12px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: var(--stl-gap);
  margin: 0;
  padding: 1px 0;
  list-style: none;
}

/* Cada paso: punto arriba, etiqueta centrada debajo. La fecha no se
   pinta -- va en el title de cada paso, ver status-timeline.php. */
.stl__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
  max-width: 110px;
}

/* La linea va de punta a punta ENTRE LOS PUNTOS, no entre las cajas: cada
   paso dibuja media linea a cada lado del punto, y como el gap las une, el
   resultado es un trazo continuo de circulo a circulo. Hace falta hacerlo
   asi porque la caja de cada paso es tan ancha como su etiqueta (que varia),
   asi que una sola linea en el hueco quedaria despegada de los puntos.
   Los extremos de la fila no llevan su mitad exterior. */
.stl__item::before,
.stl__item::after {
  content: "";
  position: absolute;
  top: 2px;
  height: 1px;
  background: var(--border-mid, var(--border));
}

/* Mitad izquierda: desde el paso anterior hasta el borde del punto. */
.stl__item::before {
  left: calc(-1 * var(--stl-gap));
  right: 50%;
  margin-right: 3px;
}

/* Mitad derecha: desde el borde del punto hasta el paso siguiente. */
.stl__item::after {
  left: 50%;
  right: calc(-1 * var(--stl-gap));
  margin-left: 3px;
}

.stl__item:first-child::before,
.stl__item:last-child::after {
  content: none;
}

.stl__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

.stl__dot--good    { background: #22C55E; }
.stl__dot--bad     { background: #EF4444; }
.stl__dot--risk    { background: #F97316; }
.stl__dot--warn    { background: #EAB308; }
.stl__dot--neutral { background: var(--muted); }

.stl__label {
  max-width: 110px;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Client status en cursiva: en la misma columna conviven los dos
   vocabularios (status de la venta y estado del cliente) y de un
   vistazo hay que poder decir cual es cual. */
.stl__label--client {
  font-style: italic;
  font-weight: 500;
}


/* Estado deducido por el backfill: nadie lo registro, se marca punteado
   para que no se lea igual que un dato real. */
.stl__item--deduced .stl__label {
  color: var(--muted);
  border-bottom: 1px dashed var(--border-mid, var(--border));
}

.stl__item--more .stl__label {
  color: var(--muted);
  font-weight: 500;
}

/* La celda no envuelve la linea de tiempo: si no cabe, la tabla scrollea
   horizontal (que ya lo hace) en vez de partir la secuencia en dos
   renglones, que se leeria como si hubiera dos historiales. */
.cp-timeline-col {
  white-space: nowrap;
  vertical-align: middle;
}
