/* Identidad base Bezzure. Los colores personalizados D-288 conservan prioridad. */
@import url("./assets/bezzure/fonts.css");

.analytics-welcome { max-width: 1120px; margin: 32px auto; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); overflow: hidden; color: var(--ink); }
.analytics-welcome-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 290px; align-items: center; gap: 36px; padding: 48px; background: var(--surface-soft); isolation: isolate; }
:root:not([data-theme="dark"]):not([data-analytics-design-active="true"]) .analytics-welcome-hero { background: var(--brand-cream); }
.analytics-welcome-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: url("./assets/bezzure/panal.svg") repeat; background-size: 70px auto; opacity: .22; }
:root[data-theme="dark"] .analytics-welcome-hero::before { display: none; }
.analytics-welcome-copy { max-width: 660px; }
.analytics-welcome-eyebrow { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.analytics-welcome-eyebrow::before { content: ""; width: 24px; height: 3px; background: var(--brand-honey); }
.analytics-welcome h2 { margin: 20px 0 12px; font-family: var(--font-heading); font-size: clamp(30px, 3.5vw, 44px); line-height: 1.16; font-weight: 500; }
.analytics-welcome-intro { margin: 0 0 24px; font-size: 17px; line-height: 1.6; color: var(--muted); }
.analytics-welcome-art { display: grid; place-items: center; min-width: 0; justify-self: center; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.analytics-welcome-art img { display: block; width: 210px; height: auto; max-width: 100%; }
.analytics-welcome-sections { padding: 28px 48px 36px; }
.analytics-welcome-sections h3 { margin: 0; font-size: 19px; }
.analytics-welcome-sections > p { color: var(--muted); margin: 8px 0 20px; line-height: 1.6; }
.analytics-welcome-links { display: flex; flex-wrap: wrap; gap: 12px; }
.analytics-welcome-links .control-button { display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 10px 16px; border-radius: 10px; color: var(--ink); background: var(--surface); font-size: 14px; }
.analytics-welcome-links .control-button:hover { background: var(--primary-soft); }
.analytics-welcome-links .control-button:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.analytics-welcome-links img { object-fit: contain; }
.analytics-welcome-links button span { margin-left: 12px; }
@media (max-width: 680px) {
  .analytics-welcome { margin: 12px 0; border-radius: 16px; }
  .analytics-welcome-hero { grid-template-columns: 1fr; gap: 28px; padding: 28px 22px; }
  .analytics-welcome-art { grid-row: 1; padding: 12px 22px; }
  .analytics-welcome-art img { width: 112px; }
  .analytics-welcome h2 { font-size: 30px; }
  .analytics-welcome-sections { padding: 24px 22px; }
  .analytics-welcome-links .control-button { width: 100%; justify-content: flex-start; }
  .analytics-welcome-links button span { margin-left: auto; }
}

:root {
  --brand-honey: #ebb02d;
  --brand-mint: #5fc9ab;
  --brand-pine: #1e2e2a;
  --brand-cream: #fff9e6;
  --brand-sand: #f3e7c8;
  --brand-mint-soft: #cfede2;
  --bg: #fff;
  --bg-2: var(--brand-sand);
  --surface: #fff;
  --surface-soft: #f7f7ef;
  --surface-strong: var(--brand-sand);
  --ink: var(--brand-pine);
  --muted: #4d625b;
  --muted-2: #60736b;
  --line: #dce2d7;
  --line-strong: #85998e;
  /* Los enlaces pequeños también usan primary: pino mantiene contraste sobre crema. */
  --primary: #3f5c56;
  --primary-soft: var(--brand-mint-soft);
  --teal: var(--brand-mint);
  --shadow: 0 16px 38px rgb(30 46 42 / 9%);
  --shadow-soft: 0 5px 18px rgb(30 46 42 / 6%);
  --radius: 12px;
  --font: "Quicksand", "Segoe UI", Arial, sans-serif;
  --font-heading: "Playfair Display", Georgia, serif;
}

/* Adaptación provisional: el manual no especifica un tema oscuro completo. */
:root[data-theme="dark"] {
  --bg: #202426;
  --bg-2: #25292b;
  --surface: #292e30;
  --surface-soft: #303638;
  --surface-strong: #394043;
  --ink: #e9eeeb;
  --muted: #bdc7c2;
  --muted-2: #a8b4ae;
  --line: #424a4c;
  --line-strong: #74827c;
  --primary: #9bd6c4;
  --primary-soft: #354741;
  --shadow: 0 16px 38px rgb(0 0 0 / 22%);
  --shadow-soft: 0 5px 18px rgb(0 0 0 / 15%);
}

body { font-family: var(--font); background: var(--bg); }
.main, .workspace { background: var(--bg); }
:root:not([data-theme="dark"]):not([data-analytics-design-active="true"]) .main {
  background: linear-gradient(rgb(255 255 255 / 88%), rgb(255 255 255 / 88%)), #fff url("./assets/bezzure/panal.svg") repeat;
  background-size: auto, 100px auto;
}
:root:not([data-theme="dark"]):not([data-analytics-design-active="true"]) .workspace { background: transparent; }
button, input, select, textarea { font-family: inherit; }
h1, h2, .panel-title { font-family: var(--font-heading); font-weight: 500; }
table, .metric-card, .dashboard-widget { font-variant-numeric: tabular-nums; }
.sidebar { background: var(--surface); border-color: var(--line); }
.brand { min-height: 76px; gap: 10px; }
.brand-mark { object-fit: contain; }
.app-shell:not(.sidebar-collapsed) .brand,
.app-shell.sidebar-collapsed.sidebar-hover-expanded .brand { grid-template-columns: minmax(0, 1fr); padding: 12px 16px; min-height: 76px; }
.app-shell:not(.sidebar-collapsed) .brand-mark,
.app-shell.sidebar-hover-expanded .brand-mark { display: none; }
.brand-text { gap: 5px; }
.brand-wordmark { display: block; width: 120px; height: 30px; object-fit: contain; }
.brand-wordmark-dark { display: none; }
:root[data-theme="dark"] .brand-wordmark-light { display: none; }
:root[data-theme="dark"] .brand-wordmark-dark { display: block; }
.brand-text span { letter-spacing: .08em; font-size: 11px; font-weight: 600; }
.topbar { background: var(--surface); border-bottom-color: var(--line); }
@supports (backdrop-filter: blur(12px)) {
  .topbar { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); }
}
.topbar h1 { font-size: 28px; line-height: 1.2; }
.module-button, .module-subnav-button { border-radius: 10px; }
.module-button, .module-subnav-button { color: var(--ink); }
.module-icon-image { background: var(--primary-soft); }
.module-icon-image img { filter: brightness(0) saturate(100%) invert(29%) sepia(16%) saturate(746%) hue-rotate(112deg) brightness(95%) contrast(87%); }
:root[data-theme="dark"] .module-icon-image img { filter: brightness(0) saturate(100%) invert(78%) sepia(19%) saturate(905%) hue-rotate(105deg) brightness(91%) contrast(89%); }
.module-button.active, .module-subnav-button.active { color: var(--ink); background: var(--primary-soft); }
:root[data-theme="dark"] .module-button.active,
:root[data-theme="dark"] .module-subnav-button.active { color: var(--ink); background: var(--primary-soft); }
.module-button:hover:not(.active), .module-subnav-button:hover:not(.active) { background: var(--surface-soft); color: var(--ink); }
.panel, .metric-card, .dashboard-widget, .auth-card { border-radius: var(--radius); }
.control-button, .primary-button, .secondary-button, .icon-button { border-radius: 10px; }
.control-button:hover { background: var(--surface-soft); }
.primary-button { box-shadow: none; }
/* Acciones de apoyo en menta; se reserva el dorado para el envío del formulario. */
:root:not([data-analytics-design-active="true"]) .primary-button {
  background: var(--brand-mint); color: var(--brand-pine); border-color: #3f5c56;
}
:root:not([data-analytics-design-active="true"]) .primary-button:hover:not(:disabled) {
  background: var(--brand-mint-soft); color: var(--brand-pine); border-color: #3f5c56;
}
:root:not([data-analytics-design-active="true"]) .auth-submit {
  background: var(--brand-mint); border-color: var(--line-strong); color: var(--brand-pine);
}
:root:not([data-analytics-design-active="true"]) .auth-submit:hover:not(:disabled) { background: var(--brand-mint-soft); }
button, a, input, select, textarea { transition: background-color .2s ease-out, border-color .2s ease-out, box-shadow .2s ease-out; }
:is(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.input-wrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input, select, textarea { accent-color: var(--primary); }
.input-wrap input::placeholder { color: var(--muted); opacity: 1; }
.password-toggle { color: var(--primary); }
.password-toggle:hover { background: var(--primary-soft); border-color: var(--line); }
.auth-page { background: var(--bg); }
.auth-brand-panel { background: var(--bg); padding: clamp(28px, 4vw, 64px); gap: 32px; }
:root:not([data-theme="dark"]) .auth-brand-panel {
  background-image: linear-gradient(rgb(255 255 255 / 88%), rgb(255 255 255 / 88%)), url("./assets/bezzure/panal.svg");
  background-size: auto, 100px auto;
}
.auth-brand-icon { width: 200px; height: 50px; object-fit: contain; }
.auth-brand-copy h1 { font-size: clamp(36px, 4.3vw, 56px); line-height: 1.15; font-weight: 500; }
.auth-brand-copy p:last-child { color: var(--muted); }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; letter-spacing: .08em; }
.eyebrow::before { content: ""; width: 24px; height: 3px; flex: 0 0 24px; background: var(--brand-honey); }
.auth-login-panel { background: var(--surface-soft); padding: clamp(24px, 4vw, 54px); }
.auth-card { background: var(--surface); padding: 32px; border-color: var(--line); }
.auth-icon { width: 44px; height: 64px; object-fit: contain; border-radius: 0; }
.auth-feature { background: var(--surface); border-color: var(--line); border-radius: 12px; }
.feature-icon { background: var(--brand-mint-soft); color: var(--brand-pine); border-radius: 0; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); width: 28px; height: 32px; }
.auth-language-toggle { background: var(--surface); }
.input-wrap input { background: var(--surface); border-radius: 10px; }
/* Auditoría Analytics: lectura cómoda y paleta consistente en sus paneles. */
:root:not([data-analytics-design-active="true"]) [data-brand-overview="true"] :is(th, td) { color: var(--ink); }
:root:not([data-analytics-design-active="true"]) [data-brand-overview="true"] thead th,
:root:not([data-analytics-design-active="true"]) [data-brand-overview="true"] tfoot td { background: var(--surface-soft); }
:root:not([data-analytics-design-active="true"]) [data-brand-overview="true"] tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bg) 40%, var(--surface)); }
:root:not([data-analytics-design-active="true"]) .workspace:has([data-brand-overview="true"]) .drawer-guardrail.compact { background: var(--primary-soft); color: var(--ink); border-color: var(--line); }
[data-brand-overview="true"] .dashboard-widget-title strong { font-family: var(--font-heading); font-size: 20px; font-weight: 500; }
/* Una celda vacía debe conservar el colspan, no convertirse en un grid de 180px. */
[data-brand-overview="true"] td.table-empty-state {
  display: table-cell; width: auto; height: 110px; white-space: normal;
  text-align: center; vertical-align: middle; overflow-wrap: anywhere;
}
/* Las jerarquías se ajustan al panel mediante bezzure-fit-table. */
[data-brand-overview="true"] :is(.dashboard-hierarchy-toggle > b, .dashboard-hierarchy-leaf) { white-space: normal; overflow-wrap: anywhere; }
:root:not([data-analytics-design-active="true"]) [data-brand-overview="true"] :is(th, td, td button:not(.badge), td a) {
  /* Neutraliza exclusivamente el !important azul/gris del tema legacy. */
  color: var(--ink) !important;
}
:root:not([data-analytics-design-active="true"]) .workspace:has([data-brand-overview="true"]) .dashboard-editor {
  border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.workspace:has([data-brand-overview="true"]) .dashboard-editor-form > label { display: grid; gap: 6px; }
:root:not([data-analytics-design-active="true"]) .workspace:has([data-brand-overview="true"]) .dashboard-editor :is(input:not([type="radio"]):not([type="checkbox"]), select) {
  min-width: 0; min-height: 34px; padding: 6px 8px; border: 1px solid var(--line-strong);
  border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit;
}
:root:not([data-analytics-design-active="true"]) .workspace:has([data-brand-overview="true"]) :is(.dashboard-choice-card, .dashboard-choice-card > span, .dashboard-hierarchy-options label, .dashboard-column-options label, .dashboard-filter-slicer, .dashboard-slicer-options, .dashboard-metric-picker, .dashboard-choice-group, .dashboard-hierarchy-picker, .dashboard-filter-picker) {
  background: var(--surface-soft); color: var(--ink); border-color: var(--line);
}
:root:not([data-analytics-design-active="true"]) .workspace:has([data-brand-overview="true"]) :is(.dashboard-choice-card input:checked + span, .dashboard-hierarchy-options label:has(input:checked), .dashboard-column-options label:has(input:checked)) {
  background: var(--primary-soft); color: var(--ink); border-color: var(--primary);
}
.topbar p { font-size: 13px; line-height: 1.5; }
[data-brand-section="leads"] .dashboard-hierarchy-table { min-width: 720px; }
[data-brand-section="leads"] .dashboard-hierarchy-table th:first-child { width: 45%; }
[data-brand-section="leads"] #leads-override-form .drawer-field { display: grid; gap: 6px; }
[data-brand-section="leads"] #leads-override-form :is(input, textarea) { font: inherit; padding: 9px 12px; min-width: 0; width: 100%; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 10px; }
[data-brand-section="leads"] #leads-override-form .qa-form-actions { display: flex; justify-content: flex-end; gap: 8px; }
:root:not([data-analytics-design-active="true"]) [data-brand-section="leads"] :is(th, td, td button:not(.badge), td a) { color: var(--ink) !important; }
:root:not([data-analytics-design-active="true"]) [data-brand-section="leads"] :is(thead th, tfoot td) { background: var(--surface-soft); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="leads"] :is(.badge.info, .filter-chip) { background: var(--primary-soft); color: var(--ink); border-color: var(--line); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="leads"] :is(.rail-link-button, .page-button, .page-size-control select) { color: var(--ink); background: var(--surface); border-color: var(--line); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="leads"] .page-button.active { background: var(--primary-soft); color: var(--ink); border-color: var(--primary); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="leads"] tbody tr:not(.active):nth-child(even) td { background: color-mix(in srgb, var(--surface-soft) 45%, var(--surface)); }
:root:not([data-analytics-design-active="true"]):has([data-brand-section="leads"]) .drawer-guardrail { background: var(--surface-soft); color: var(--muted); border-color: var(--line); }
/* Transfer: mismos colores de lectura, sin sustituir estados de negocio. */
/* Ventas y rendimiento: presentación aislada de datos, permisos y estados. */
:root:not([data-analytics-design-active="true"]) :is([data-brand-section="performology"], [data-brand-section="lsp"]) :is(th, td, td button:not(.badge), td a) { color: var(--ink) !important; }
:root:not([data-analytics-design-active="true"]) :is([data-brand-section="performology"], [data-brand-section="lsp"]) :is(thead th, tfoot td) { background: var(--surface-soft); }
:root:not([data-analytics-design-active="true"]) :is([data-brand-section="performology"], [data-brand-section="lsp"]) :is(.badge.info, .filter-chip, .result-badge) { background: var(--primary-soft); color: var(--ink); border-color: var(--line); }
:root:not([data-analytics-design-active="true"]) :is([data-brand-section="performology"], [data-brand-section="lsp"]) :is(.rail-link-button, .page-button, .page-size-control select) { color: var(--ink); background: var(--surface); border-color: var(--line); }
:root:not([data-analytics-design-active="true"]) :is([data-brand-section="performology"], [data-brand-section="lsp"]) .page-button.active { background: var(--primary-soft); color: var(--ink); border-color: var(--primary); }
:root:not([data-analytics-design-active="true"]) :is([data-brand-section="performology"], [data-brand-section="lsp"]) tbody tr:not(.active):nth-child(even) td { background: color-mix(in srgb, var(--surface-soft) 45%, var(--surface)); }
:root:not([data-analytics-design-active="true"]):has(:is([data-brand-section="performology"], [data-brand-section="lsp"])) .drawer-guardrail { background: var(--surface-soft); color: var(--muted); border-color: var(--line); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="performology"] :is(.reported-sale-form, .reported-sale-lookup, .reported-sale-inline-form) :is(input:not([type="checkbox"]), select, textarea) { background: var(--surface); color: var(--ink); border-color: var(--line-strong); border-radius: 10px; font: inherit; min-width: 0; }
:root:not([data-analytics-design-active="true"]) [data-brand-section="performology"] .reported-sale-form input[readonly] { background: var(--surface-soft); color: var(--muted); }
[data-brand-section="performology"] .dashboard-hierarchy-table { min-width: 640px; }
[data-brand-section="performology"] .dashboard-hierarchy-table th:first-child { width: 40%; }
:root:not([data-analytics-design-active="true"]) [data-brand-section="lsp"] :is(.lsp-detail-privacy, .lsp-detail-landing .rail-warning) { background: var(--surface-soft); color: var(--muted); border-color: var(--line); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="lsp"] .lsp-call-summary-row.is-expanded td { background: var(--primary-soft); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="lsp"] .lsp-call-expanded-row > td { background: var(--surface-soft); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="lsp"] .lsp-call-detail-grid { border-top-color: var(--primary); }
[data-brand-section="lsp"] .lsp-performance-detail-table th:nth-child(8) { width: 180px; min-width: 180px; }
[data-brand-section="lsp"] .lsp-call-collapse { font: inherit; min-height: 34px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; }
:root:not([data-analytics-design-active="true"]) [data-brand-section="transfer"] :is(th, td, td button:not(.badge), td a) { color: var(--ink) !important; }
:root:not([data-analytics-design-active="true"]) [data-brand-section="transfer"] :is(thead th, tfoot td) { background: var(--surface-soft); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="transfer"] :is(.badge.info, .filter-chip) { background: var(--primary-soft); color: var(--ink); border-color: var(--line); }
[data-brand-section="transfer"] .rq-page-head { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
[data-brand-section="transfer"] .transfer-receivers-panel :is(th, td) { white-space: normal; overflow-wrap: anywhere; }
:root:not([data-analytics-design-active="true"]) [data-brand-section="transfer"] :is(.rail-link-button, .page-button, .page-size-control select) { color: var(--ink); background: var(--surface); border-color: var(--line); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="transfer"] .page-button.active { background: var(--primary-soft); color: var(--ink); border-color: var(--primary); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="transfer"] tbody tr:not(.active):nth-child(even) td { background: color-mix(in srgb, var(--surface-soft) 45%, var(--surface)); }
:root:not([data-analytics-design-active="true"]):has([data-brand-section="transfer"]) .filter-drawer .drawer-guardrail { background: var(--primary-soft); color: var(--ink); border-color: var(--line); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="transfer"] .drawer-guardrail { background: var(--surface-soft); color: var(--muted); border-color: var(--line); }
.dashboard-board-empty { font-size: 14px; line-height: 1.6; padding: 24px; }
.dashboard-board-empty strong { font-size: 20px; }
.source-info-table { font-size: 13px; }
.source-info-table th, .source-info-table td { color: var(--ink); line-height: 1.5; }
.source-info-table thead th,
.source-info-table tbody th[scope="rowgroup"] { background: var(--surface-soft); color: var(--ink); }
.source-info-table td > code, .source-info-table td > small,
.source-info-mode + small { font-size: 11px; line-height: 1.5; color: var(--muted); }
.source-info-mode.is-date, .source-info-mode.is-realtime {
  background: var(--primary-soft); color: var(--ink); border-color: var(--line-strong);
}
.source-info-mode.is-manual { background: var(--surface-soft); color: var(--ink); border-color: var(--line); }
.source-info-mode.is-inactive { background: var(--brand-sand); color: var(--brand-pine); border-color: var(--brand-honey); }
:root[data-theme="dark"] .auth-brand-panel { background: var(--bg); }
:root[data-theme="dark"] .auth-login-panel { background: var(--surface-soft); }
:root[data-theme="dark"] .auth-card, :root[data-theme="dark"] .auth-feature { background: var(--surface); }
:root[data-theme="dark"]:not([data-analytics-design-active="true"]) :is(.module-button, .module-subnav-button):not(.active) { background: transparent; }
:root[data-theme="dark"]:not([data-analytics-design-active="true"]) :is(.module-button, .module-subnav-button):not(.active):hover { background: var(--surface-soft); }
:root[data-theme="dark"]:not([data-analytics-design-active="true"]) :is(.control-button, .secondary-button, .icon-button) { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: none; }
:root[data-theme="dark"]:not([data-analytics-design-active="true"]) .primary-button { background: #9bd6c4; border-color: #9bd6c4; color: var(--brand-pine); }

:root:not([data-analytics-design-active="true"]) [data-brand-section="leads"] .result-badge { background: var(--primary-soft); color: var(--ink); }
@media (max-width: 980px) {
  :root:has(:is([data-brand-section="performology"], [data-brand-section="lsp"])) .sidebar:has(.module-subnav:not([hidden])) { padding-bottom: 54px; }
  :root:has(:is([data-brand-section="performology"], [data-brand-section="lsp"])) :is(.module-nav, .module-nav-group) { position: static; }
  :root:has(:is([data-brand-section="performology"], [data-brand-section="lsp"])) .app-shell .module-subnav:not([hidden]) { display: flex; position: absolute; left: 10px; right: 10px; bottom: 8px; width: auto; margin: 0; padding: 0; gap: 4px; overflow-x: auto; border: 0; background: var(--surface); }
  :root:has(:is([data-brand-section="performology"], [data-brand-section="lsp"])) .module-subnav::before { display: none; }
  :root:has(:is([data-brand-section="performology"], [data-brand-section="lsp"])) .module-subnav-button { flex: 0 0 auto; width: auto; min-height: 36px; padding: 7px 10px; }
  [data-brand-section="performology"] .reported-sale-form-grid-compact { grid-template-columns: minmax(0, 1fr); }
  [data-brand-section="leads"] .leads-dashboard-toolbar.has-board-actions { grid-template-columns: minmax(0, 1fr); }
  [data-brand-section="leads"] .leads-dashboard-toolbar.has-board-actions .dashboard-board-actions { width: 100%; min-width: 0; }
  :root:has([data-brand-section="leads"]) .sidebar:has(.module-subnav:not([hidden])) { padding-bottom: 54px; }
  :root:has([data-brand-section="leads"]) :is(.module-nav, .module-nav-group) { position: static; }
  :root:has([data-brand-section="leads"]) .app-shell .module-subnav:not([hidden]) {
    display: flex; position: absolute; left: 10px; right: 10px; bottom: 8px;
    width: auto; margin: 0; padding: 0; gap: 4px; overflow-x: auto; border: 0; background: var(--surface);
  }
  :root:has([data-brand-section="leads"]) .module-subnav::before { display: none; }
  :root:has([data-brand-section="leads"]) .module-subnav-button { flex: 0 0 auto; width: auto; min-height: 36px; padding: 7px 10px; }
  :root:has([data-brand-section="transfer"]) .sidebar:has(.module-subnav:not([hidden])) { padding-bottom: 54px; }
  :root:has([data-brand-section="transfer"]) .module-nav,
  :root:has([data-brand-section="transfer"]) .module-nav-group { position: static; }
  :root:has([data-brand-section="transfer"]) .app-shell .module-subnav:not([hidden]) {
    display: flex; position: absolute; left: 10px; right: 10px; bottom: 8px;
    width: auto; margin: 0; padding: 0; gap: 4px; overflow-x: auto;
    border: 0; background: var(--surface);
  }
  :root:has([data-brand-section="transfer"]) .module-subnav::before { display: none; }
  :root:has([data-brand-section="transfer"]) .module-subnav-button { flex: 0 0 auto; width: auto; min-height: 36px; padding: 7px 10px; }
  [data-brand-overview="true"] td.table-empty-state { text-align: left; }
  .app-shell { grid-template-rows: auto minmax(0, 1fr); }
  .sidebar { grid-template-rows: auto; }
  .sidebar-control { display: none; }
  .app-shell .brand,
  .app-shell:not(.sidebar-collapsed) .brand,
  .app-shell.sidebar-collapsed.sidebar-hover-expanded .brand { min-height: 40px; padding: 0; }
  .app-shell .brand-mark,
  .app-shell:not(.sidebar-collapsed) .brand-mark,
  .app-shell.sidebar-hover-expanded .brand-mark { display: block; }
}
@media (max-width: 760px) {
  [data-brand-section="lsp"] .lsp-call-detail-grid { grid-template-columns: minmax(0, 1fr); width: calc(100vw - 60px); max-width: 100%; position: sticky; left: 0; }
  [data-brand-section="lsp"] .lsp-call-collapse { position: sticky; left: 16px; }
  .workspace:has([data-brand-overview="true"]) .dashboard-board-actions button { white-space: normal; overflow-wrap: anywhere; height: auto; min-height: 34px; }
  .topbar h1 { font-size: 24px; }
  .auth-brand-panel { padding: 28px 24px; gap: 24px; }
  .auth-brand-icon { width: 160px; height: 40px; }
  .auth-brand-copy h1 { font-size: 36px; }
  .auth-card { padding: 24px; }
}
/* Menú lateral: control permanente y sin mensajes técnicos redundantes. */
.sidebar-footer[hidden] { display: none !important; }
:root:not([data-analytics-design-active="true"]) .app-shell .sidebar-collapse-button { display: flex; align-items: center; justify-content: flex-start; gap: 10px; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); box-shadow: none; font: inherit; cursor: pointer; }
.sidebar-collapse-button > span { display: inline-flex; flex: 0 0 20px; align-items: center; justify-content: center; }
.sidebar-collapse-button svg { display: block; width: 20px; height: 20px; }
.app-shell.sidebar-collapsed .sidebar-collapse-button > span { transform: none; }
.sidebar-collapse-button b { font-size: 12px; font-weight: 600; }
:root:not([data-analytics-design-active="true"]) .app-shell .sidebar-collapse-button:is(:hover, [aria-expanded="true"]) { background: var(--primary-soft); border-color: var(--primary); color: var(--ink); }
:root:not([data-analytics-design-active="true"]) .sidebar-control-menu { background: var(--surface); border-color: var(--line); border-radius: 12px; box-shadow: var(--shadow-soft); }
:root:not([data-analytics-design-active="true"]) .sidebar-control-menu button:is(:hover, .active) { background: var(--primary-soft); color: var(--ink); border-color: transparent; }
.app-shell.sidebar-collapsed:not(.sidebar-hover-expanded) .sidebar-control .sidebar-collapse-button { justify-content: center; padding-inline: 0; }
/* Cotizaciones y QA: fuentes y acciones intactas, presentación Bezzure. */
:root:not([data-analytics-design-active="true"]) :is([data-brand-section="quotes"], [data-brand-section="qa"]) :is(th, td, td button:not(.badge), td a) { color: var(--ink) !important; }
:root:not([data-analytics-design-active="true"]) :is([data-brand-section="quotes"], [data-brand-section="qa"]) :is(thead th, tfoot td) { background: var(--surface-soft); }
:root:not([data-analytics-design-active="true"]) :is([data-brand-section="quotes"], [data-brand-section="qa"]) :is(.badge.info, .filter-chip, .result-badge) { background: var(--primary-soft); color: var(--ink); border-color: var(--line); }
:root:not([data-analytics-design-active="true"]) :is([data-brand-section="quotes"], [data-brand-section="qa"]) :is(.page-button, .label-filter-button, .rail-link-button) { background: var(--surface); color: var(--ink); border-color: var(--line); }
:root:not([data-analytics-design-active="true"]) :is([data-brand-section="quotes"], [data-brand-section="qa"]) :is(.page-button, .label-filter-button, .compact-action-button):is(:hover, .active) { background: var(--primary-soft); color: var(--ink); border-color: var(--primary); }
:root:not([data-analytics-design-active="true"]):has(:is([data-brand-section="quotes"], [data-brand-section="qa"])) :is(.drawer-guardrail, .rail-warning) { background: var(--surface-soft); color: var(--muted); border-color: var(--line); }
:root:not([data-analytics-design-active="true"]):has(:is([data-brand-section="quotes"], [data-brand-section="qa"])) :is(.quote-rail-hero p, .audit-timeline-body p) { color: var(--ink); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="quotes"] .candidate-row:is(:hover, .active) { background: var(--primary-soft); color: var(--ink); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="quotes"] .workbench-detail-hero { background: var(--surface-soft); border-color: var(--line); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="quotes"] .workbench-detail-hero p { color: var(--ink); }
:root:not([data-analytics-design-active="true"]):has(:is([data-brand-section="quotes"], [data-brand-section="qa"])) .protected-detail-summary:not(.error):not(.loading) { background: var(--surface-soft); border-color: var(--line); border-left-color: var(--primary); color: var(--muted); }
[data-brand-section="quotes"] .two-col table { min-width: 680px; }
[data-brand-section="quotes"] .two-col table:has(th:nth-child(7)) { min-width: 1000px; }
[data-brand-section="quotes"] .two-col :is(th, td):first-child { min-width: 160px; white-space: normal; overflow-wrap: anywhere; }
[data-brand-section="quotes"] .two-col td { white-space: normal; overflow-wrap: anywhere; }
[data-brand-section="qa"] .audit-help-modal td { white-space: normal; overflow-wrap: anywhere; }
:root:not([data-analytics-design-active="true"]):has(:is([data-brand-section="quotes"], [data-brand-section="qa"])) .detail-rail .badge.info { background: var(--primary-soft); color: var(--ink); border-color: var(--line); }
:root:not([data-analytics-design-active="true"]):has(:is([data-brand-section="quotes"], [data-brand-section="qa"])) .detail-rail th { background: var(--surface-soft); color: var(--ink); }
:root:not([data-analytics-design-active="true"]):has(:is([data-brand-section="quotes"], [data-brand-section="qa"])) .detail-rail .lead-sensitive-column-header { background: var(--surface-soft); color: var(--ink); }
:root:not([data-analytics-design-active="true"]):has(:is([data-brand-section="quotes"], [data-brand-section="qa"])) .detail-rail :is(.lead-sensitive-column-list, .lead-sensitive-column-row, .lead-sensitive-column-label, .lead-sensitive-column-value) { color: var(--ink); border-color: var(--line); }
:root:not([data-analytics-design-active="true"]) :is([data-brand-section="quotes"], [data-brand-section="qa"]) .admin-user-modal-backdrop { background: rgb(24 32 29 / 48%); }
:root:not([data-analytics-design-active="true"]) :is([data-brand-section="quotes"], [data-brand-section="qa"]) .admin-user-modal { box-shadow: var(--shadow); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="qa"] .audit-help-button.active { background: var(--primary-soft); color: var(--ink); border-color: var(--primary); }
:root:not([data-analytics-design-active="true"]) :is([data-brand-section="quotes"], [data-brand-section="qa"]) tbody tr:not(.selected-row):nth-child(even) td { background: color-mix(in srgb, var(--surface-soft) 45%, var(--surface)); }
[data-brand-section="qa"] :is(.qa-request-card, .qa-review-row, .qa-request-meta, .qa-request-heading) { min-width: 0; overflow-wrap: anywhere; }
[data-brand-section="qa"] :is(.qa-review-actions, .qa-request-meta, .qa-request-heading) { flex-wrap: wrap; }
@media (max-width: 980px) {
  :root:has(:is([data-brand-section="quotes"], [data-brand-section="qa"])) .sidebar:has(.module-subnav:not([hidden])) { padding-bottom: 54px; }
  :root:has(:is([data-brand-section="quotes"], [data-brand-section="qa"])) :is(.module-nav, .module-nav-group) { position: static; }
  :root:has(:is([data-brand-section="quotes"], [data-brand-section="qa"])) .app-shell .module-subnav:not([hidden]) { display: flex; position: absolute; left: 10px; right: 10px; bottom: 8px; width: auto; margin: 0; padding: 0; gap: 4px; overflow-x: auto; border: 0; background: var(--surface); }
  :root:has(:is([data-brand-section="quotes"], [data-brand-section="qa"])) .module-subnav::before { display: none; }
  :root:has(:is([data-brand-section="quotes"], [data-brand-section="qa"])) .module-subnav-button { flex: 0 0 auto; width: auto; min-height: 36px; padding: 7px 10px; }
}
@media (max-width: 760px) {
  [data-brand-section="qa"] :is(.audit-filter-panel, .audit-metrics, .qa-lead-search-form) { grid-template-columns: minmax(0, 1fr); }
  [data-brand-section="qa"] .qa-lead-search-form > * { min-width: 0; width: 100%; }
}
/* Exportaciones y Admin: presentación aislada de reglas, permisos y CUSTOM. */
:root:not([data-analytics-design-active="true"]) :is([data-brand-section="exports"], [data-brand-section="admin"]) :is(thead th, tfoot td) { background: var(--surface-soft); color: var(--ink); }
:root:not([data-analytics-design-active="true"]) :is([data-brand-section="exports"], [data-brand-section="admin"]) tbody tr:not(.selected-row):nth-child(even) td { background: color-mix(in srgb, var(--surface-soft) 45%, var(--surface)); }
:root:not([data-analytics-design-active="true"]) :is([data-brand-section="exports"], [data-brand-section="admin"]) .badge.info:not(.custom-preview-shell *) { background: var(--primary-soft); color: var(--ink); border-color: var(--line); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="exports"] .download-button { background: var(--brand-mint); color: var(--brand-pine); border-color: var(--primary); box-shadow: none; }
:root:not([data-analytics-design-active="true"]) [data-brand-section="exports"] .download-button:hover:not(:disabled) { background: var(--primary-soft); color: var(--ink); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="exports"] .export-progress span { background: var(--primary); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="exports"] .exports-hero-icon { background: var(--primary-soft); color: var(--ink); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="exports"] .exports-hero-icon img { filter: brightness(0) saturate(100%) invert(29%) sepia(16%) saturate(746%) hue-rotate(112deg) brightness(95%) contrast(87%); }
:root[data-theme="dark"]:not([data-analytics-design-active="true"]) [data-brand-section="exports"] .exports-hero-icon img { filter: invert(85%); }
[data-brand-section="exports"] .exports-table :is(th, td):nth-child(2) { min-width: 260px; white-space: normal; overflow-wrap: anywhere; }
:root:not([data-analytics-design-active="true"]) [data-brand-section="admin"] .admin-disposition-inline-editor { background: var(--surface-soft); color: var(--ink); border-color: var(--line); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="admin"] :is(.inline-alert.info, .admin-user-notice, .drawer-guardrail) { background: var(--primary-soft); color: var(--ink); border-color: var(--line); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="admin"] .admin-user-modal-backdrop { background: rgb(24 32 29 / 48%); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="admin"] .admin-user-modal { box-shadow: var(--shadow); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="admin"] :is(.convoso-upload-flow-card, .convoso-upload-flow-level) { border-color: var(--line); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="admin"] .convoso-upload-flow-bar { background: var(--surface-strong); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="admin"] .tree-toggle { background: var(--surface); color: var(--primary); border: 1px solid var(--line-strong); border-radius: 6px; min-width: 26px; min-height: 26px; }
[data-brand-section="admin"] .admin-governance-table { min-width: 950px; }
[data-brand-section="admin"] .admin-users-table { min-width: 1100px; }
[data-brand-section="admin"] .admin-users-table td[colspan] { display: table-cell; white-space: normal; }
[data-brand-section="admin"] .admin-user-modal { scroll-padding: 16px; }
[data-brand-section="admin"] .custom-preview-status small { color: var(--preview-muted); }
@media (max-width: 980px) {
  :root:has([data-brand-section="admin"]) .sidebar:has(.module-subnav:not([hidden])) { padding-bottom: 54px; }
  :root:has([data-brand-section="admin"]) :is(.module-nav, .module-nav-group) { position: static; }
  :root:has([data-brand-section="admin"]) .module-nav-group > .module-subnav:not([hidden]) { display: flex; position: absolute; left: 10px; right: 10px; bottom: 8px; width: auto; margin: 0; padding: 0; gap: 4px; overflow-x: auto; border: 0; background: var(--surface); }
  :root:has([data-brand-section="admin"]) .module-subnav::before { display: none; }
  :root:has([data-brand-section="admin"]) .module-subnav-button { flex: 0 0 auto; width: auto; min-height: 36px; padding: 7px 10px; }
  :root:has([data-brand-section="admin"]) .module-subnav-group { display: flex; flex: 0 0 auto; }
  :root:has([data-brand-section="admin"]) .module-subnav-nested:not([hidden]) { display: flex; flex: 0 0 auto; margin: 0; padding: 0; border: 0; }
}
@media (max-width: 600px) {
  [data-brand-section="admin"] { grid-template-columns: minmax(0, 1fr); }
  [data-brand-section="admin"] > * { min-width: 0; }
  [data-brand-section="admin"] .customization-workspace { grid-template-columns: minmax(0, 1fr); }
  [data-brand-section="admin"] :is(.customization-guardrail > div, .customization-controls, .custom-settings-panel, .custom-preview-panel) { min-width: 0; }
  [data-brand-section="admin"] .admin-filter-panel { grid-template-columns: minmax(0, 1fr); }
  [data-brand-section="admin"] .admin-filter-panel > * { min-width: 0; grid-column: auto; }
  [data-brand-section="exports"] .exports-hero { flex-wrap: wrap; }
  [data-brand-section="admin"] :is(.admin-users-directory-head, .admin-users-toolbar, .customization-guardrail, .convoso-upload-detail-head-actions) { flex-wrap: wrap; }
  [data-brand-section="admin"] .admin-user-modal-backdrop { padding: 8px; }
  [data-brand-section="admin"] .admin-user-modal { max-height: calc(100dvh - 16px); }
}
/* Personal: lectura y navegación; sin cambios en métricas ni turnos. */
:root:not([data-analytics-design-active="true"]) [data-brand-section="agents"] :is(th, td, td button:not(.badge), td a) { color: var(--ink) !important; }
:root:not([data-analytics-design-active="true"]) [data-brand-section="agents"] :is(thead th, tfoot td) { background: var(--surface-soft); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="agents"] tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-soft) 45%, var(--surface)); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="agents"] :is(.badge.info, .result-badge, .filter-chip) { background: var(--primary-soft); color: var(--ink); border-color: var(--line); }
:root:not([data-analytics-design-active="true"]) [data-brand-section="agents"] :is(.workforce-org-branch, .workforce-org-root, .workforce-org-branch > button, .rail-warning) { background: var(--surface-soft); color: var(--ink); border-color: var(--line); }
[data-brand-section="agents"] .workforce-org-people span { white-space: normal; overflow-wrap: anywhere; }
[data-brand-section="agents"] .workforce-people-filters ~ .panel table { min-width: 1100px; }
[data-brand-section="agents"] .workforce-people-filters ~ .panel td { white-space: normal; overflow-wrap: anywhere; }
[data-brand-section="agents"] .metric-grid + .panel table { width: 100%; }
[data-brand-section="agents"] .metric-grid + .panel :is(th, td):nth-child(-n+2) { width: 180px; min-width: 180px; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 980px) {
  :root:has([data-brand-section="agents"]) .sidebar:has(.module-subnav:not([hidden])) { padding-bottom: 54px; }
  :root:has([data-brand-section="agents"]) :is(.module-nav, .module-nav-group) { position: static; }
  :root:has([data-brand-section="agents"]) .app-shell .module-subnav:not([hidden]) { display: flex; position: absolute; left: 10px; right: 10px; bottom: 8px; width: auto; margin: 0; padding: 0; gap: 4px; overflow-x: auto; border: 0; background: var(--surface); }
  :root:has([data-brand-section="agents"]) .module-subnav::before { display: none; }
  :root:has([data-brand-section="agents"]) .module-subnav-button { flex: 0 0 auto; width: auto; min-height: 36px; padding: 7px 10px; }
}
/* Bordes y notificaciones compartidos, incluyendo hover y no leídas. */
.notification-center:has(.notification-toggle[aria-expanded="true"]) { z-index: 81; }
:root:not([data-analytics-design-active="true"]) .app-shell table :is(th, td) { border-color: var(--line); }
:root:not([data-analytics-design-active="true"]) .app-shell .table-sort-indicator { color: var(--muted); }
:root:not([data-analytics-design-active="true"]) .app-shell .notification-popover { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); border-radius: var(--radius); }
:root:not([data-analytics-design-active="true"]) .app-shell .notification-toggle:is(:hover, [aria-expanded="true"]) { background: var(--primary-soft); color: var(--ink); border-color: var(--primary); }
:root:not([data-analytics-design-active="true"]) .app-shell .notification-item { background: var(--surface); color: var(--ink); border-color: var(--line); }
:root:not([data-analytics-design-active="true"]) .app-shell .notification-item:is(:hover, :focus-visible, .unread) { background: var(--primary-soft); color: var(--ink); }
:root:not([data-analytics-design-active="true"]) .app-shell .notification-item :is(small, time) { color: var(--muted); }
/* Estados compartidos: eliminar acentos legacy azules, también al interactuar. */
:root:not([data-analytics-design-active="true"]) { --accent: var(--primary); --accent-soft: var(--primary-soft); }
:root:not([data-analytics-design-active="true"]) .app-shell :is(.icon-button, .dashboard-kpi-help) { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: none; }
:root:not([data-analytics-design-active="true"]) .app-shell :is(.icon-button, .dashboard-kpi-help):hover { background: var(--primary-soft); color: var(--ink); border-color: var(--primary); outline-color: var(--primary-soft); box-shadow: none; }
:root:not([data-analytics-design-active="true"]) .app-shell .dashboard-board-actions :is(.secondary-button:not(.danger-button), .control-button.compact) { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: none; }
:root:not([data-analytics-design-active="true"]) .app-shell .dashboard-board-actions :is(.secondary-button:not(.danger-button), .control-button.compact):hover:not(:disabled) { background: var(--primary-soft); color: var(--ink); border-color: var(--primary); box-shadow: none; }
:root:not([data-analytics-design-active="true"]) .app-shell :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { background-color: var(--surface); color: var(--ink); border-color: var(--line-strong); accent-color: var(--primary); }
:root:not([data-analytics-design-active="true"]) .app-shell :is(option, optgroup) { background: var(--surface); color: var(--ink); }
:root:not([data-analytics-design-active="true"]) .app-shell :is(input, select, textarea):focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
:root:not([data-analytics-design-active="true"]) .app-shell :is(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; box-shadow: 0 0 0 2px var(--primary-soft); }
:root:not([data-analytics-design-active="true"]) .app-shell .workspace table tbody tr:hover td,
:root:not([data-analytics-design-active="true"]) .app-shell .workspace table tbody tr.selected-row td { background: var(--primary-soft); color: var(--ink); }
:root:not([data-analytics-design-active="true"]) .app-shell :is(.dashboard-transfer-detail-link, .lsp-performance-detail-link, .panel-link, .text-link, .rail-link-button) { color: var(--primary); }
/* La lista sigue siendo un select accesible; navegadores anteriores usan su menú nativo. */
@supports (appearance: base-select) {
  :root:not([data-analytics-design-active="true"]) #saved-dashboard-select,
  :root:not([data-analytics-design-active="true"]) #saved-dashboard-select::picker(select) { appearance: base-select; }
  :root:not([data-analytics-design-active="true"]) #saved-dashboard-select::picker(select) { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-soft); padding: 6px; max-height: 60vh; overflow: auto; }
  :root:not([data-analytics-design-active="true"]) #saved-dashboard-select { align-items: center; }
  :root:not([data-analytics-design-active="true"]) #saved-dashboard-select option { border-radius: 6px; padding: 8px 10px; }
  :root:not([data-analytics-design-active="true"]) #saved-dashboard-select option:is(:hover, :focus, :checked) { background: var(--primary-soft); color: var(--ink); outline-color: var(--primary); }
  :root:not([data-analytics-design-active="true"]) #saved-dashboard-select optgroup::picker-label { color: var(--muted); padding: 8px 10px; }
}
/* Ajuste al espacio disponible. El mínimo crece solo con columnas realmente visibles. */
:is(#workspace, #detail-rail) table.bezzure-fit-table {
  width: 100%; min-width: var(--bezzure-table-min, 0) !important; table-layout: fixed;
}
:is(#workspace, #detail-rail) table.bezzure-fit-table :is(th, td) {
  min-width: 0 !important; width: auto; white-space: normal; overflow-wrap: anywhere;
}
:is(#workspace, #detail-rail) table.bezzure-fit-table.dashboard-hierarchy-table :is(th, td):first-child {
  width: var(--bezzure-grouping-width, 14%); min-width: 0; text-align: left;
}
.bezzure-fit-table :is(.dashboard-column-heading, .dashboard-hierarchy-toggle, .dashboard-hierarchy-leaf) { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.bezzure-fit-table .dashboard-hierarchy-toggle > b { white-space: normal; overflow-wrap: anywhere; }
.bezzure-fit-table .dashboard-column-heading { overflow-wrap: normal; word-break: normal; }
:root:not([data-analytics-design-active="true"]) :is(#workspace, #detail-rail) th,
:root:not([data-analytics-design-active="true"]) :is(#workspace, #detail-rail) th :is(button, a, span) { color: var(--ink) !important; }
:root:not([data-analytics-design-active="true"]) :is(#workspace, #detail-rail) thead th { background: var(--surface-soft); }
.crm-version-notice {
  position: fixed; right: 16px; bottom: 16px; z-index: 2147483000;
  width: min(340px, calc(100vw - 32px)); padding: 16px;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--shadow); font: 13px/1.5 var(--font);
}
.crm-version-notice strong { display: block; margin-bottom: 6px; }
.crm-version-notice p { color: var(--muted); margin: 0 0 12px; }
.crm-version-notice .primary-button { font: inherit; font-weight: 700; padding: 8px 12px; cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* Users: preserve table cells and prioritize identity over numeric counts. */
#workspace .admin-users-directory .admin-users-table {
  table-layout: fixed;
  width: 100%;
  min-width: 1120px !important;
}
#workspace .admin-users-directory .admin-users-table :is(th, td) {
  vertical-align: middle;
  padding: 8px;
  line-height: 1.45;
  overflow-wrap: normal;
}
#workspace .admin-users-directory .admin-users-table :is(th, td):first-child { width: 22%; }
#workspace .admin-users-directory .admin-users-table td:first-child { display: table-cell; }
#workspace .admin-users-directory .admin-users-table td:first-child :is(strong, small) { display: block; overflow-wrap: anywhere; }
#workspace .admin-users-directory .admin-users-table td:first-child small { margin-top: 3px; }
#workspace .admin-users-directory .admin-users-table :is(th, td):nth-child(2) { width: 11%; }
#workspace .admin-users-directory .admin-users-table :is(th, td):nth-child(3) { width: 11%; }
#workspace .admin-users-directory .admin-users-table :is(th, td):nth-child(4) { width: 10%; }
#workspace .admin-users-directory .admin-users-table :is(th, td):nth-child(5),
#workspace .admin-users-directory .admin-users-table :is(th, td):nth-child(6),
#workspace .admin-users-directory .admin-users-table :is(th, td):nth-child(7) { width: 7%; text-align: center; }
#workspace .admin-users-directory .admin-users-table :is(th, td):nth-child(8) { width: 13%; }
#workspace .admin-users-directory .admin-users-table :is(th, td):nth-child(9) { width: 12%; }
#workspace .admin-users-directory .admin-user-row-actions { flex-wrap: wrap; }
#workspace .admin-users-directory td:nth-child(3) .badge { display: inline-flex; margin-top: 4px; }
#workspace .admin-users-directory .account-status-switch { display: flex; }
#workspace .admin-users-directory .account-status-switch.active { background: var(--brand-mint); border-color: var(--line); color: var(--brand-pine); }
#workspace .admin-users-directory .account-status-switch.inactive { background: var(--surface-soft); border-color: var(--line); color: var(--ink); }
#workspace .admin-users-directory-head, #workspace .admin-users-directory-actions { flex-wrap: wrap; align-items: center; }
#admin-user-directory-count { color: var(--muted); font-size: 12px; }
.admin-user-modal .admin-scope-mode { padding: 12px; border-bottom: 1px solid var(--line); }
.admin-user-modal .admin-scope-mode label { display: grid; grid-template-columns: minmax(100px, auto) minmax(180px, 1fr); gap: 12px; align-items: center; }
.admin-user-modal .admin-scope-mode select { width: 100%; min-width: 0; min-height: 36px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
.admin-user-modal .admin-scope-mode-note { margin: 8px 0 0; color: var(--muted); line-height: 1.5; font-size: 12px; }
.admin-user-modal .admin-user-boards > header { grid-template-columns: minmax(0, 1fr) auto; padding: 14px; background: var(--surface-soft); }
.admin-user-modal .admin-user-boards > header small { font-size: 12px; margin-top: 6px; max-width: 75ch; line-height: 1.5; }
.admin-user-modal .admin-user-boards .admin-permission-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px; }
.admin-user-modal .admin-user-boards .admin-permission-row { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--surface); align-items: start; }
.admin-user-modal .admin-user-boards .admin-permission-label { min-width: 0; overflow-wrap: anywhere; }
.admin-user-modal .admin-user-boards input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--primary); }
.admin-user-modal .admin-user-boards .admin-permission-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.admin-user-modal .admin-user-boards .admin-permission-actions small { color: var(--muted); line-height: 1.5; }
@media (max-width: 700px) {
  .admin-user-modal .admin-user-boards .admin-permission-rows { grid-template-columns: minmax(0, 1fr); }
  .admin-user-modal .admin-scope-mode label { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}

/* Transfer Detail: filtros locales, con la misma superficie flotante de las pizarras. */
#transfer-filter-drawer.transfer-filter-popover {
  position: fixed; inset: auto; top: var(--transfer-filter-top, 140px);
  right: var(--transfer-filter-right, 20px); width: min(430px, calc(100vw - 24px));
  height: auto; max-height: calc(100dvh - var(--transfer-filter-top, 140px) - 12px);
  border: 1px solid var(--line); border-radius: 10px; transform: none;
  box-shadow: 0 10px 30px rgba(0,0,0,.16); display: none; z-index: 90;
}
#transfer-filter-drawer.transfer-filter-popover.open { display: flex; flex-direction: column; }
.transfer-filter-popover .filter-drawer-body { min-height: 0; overflow-y: auto; padding: 12px; }
.transfer-filter-popover .filter-drawer-header,
.transfer-filter-popover .filter-drawer-footer { flex-shrink: 0; padding: 12px; }
.transfer-filter-popover #filter-drawer-subtitle:empty { display: none; }

/* Acceso: marca y formulario, sin notas internas de implementación. */
.auth-brand-refined .auth-brand-copy { margin-block: auto; padding-block: 64px; }
.auth-brand-refined .auth-brand-copy h1 { font-size: clamp(40px, 4.7vw, 72px); line-height: 1.08; letter-spacing: -.025em; overflow-wrap: normal; }
.auth-brand-refined .auth-brand-copy p:last-child { max-width: 380px; font-size: 17px; }
.auth-brand-signature { height: 1px; width: 80px; background: var(--line); }
.auth-brand-signature span { display: block; width: 28px; height: 3px; background: var(--brand-mint); }
.auth-login-panel .auth-card { width: min(100%, 420px); border-radius: 18px; box-shadow: 0 16px 48px rgb(25 48 43 / 7%); }
@media (max-width: 1100px) {
  .auth-brand-refined { min-height: 0; }
  .auth-brand-refined .auth-brand-copy { padding-block: 20px; }
}
@media (max-width: 760px) {
  .auth-brand-refined { padding: 28px 24px; gap: 20px; }
  .auth-brand-refined .auth-brand-copy { padding-block: 8px; }
  .auth-brand-refined .auth-brand-copy h1 { font-size: 38px; }
  .auth-brand-refined .auth-brand-copy p:last-child { font-size: 15px; }
  .auth-brand-signature { display: none; }
  .auth-login-panel .auth-card { padding: 26px; }
}

/* El encabezado y las acciones comparten el límite de altura del diálogo. */
.admin-user-modal.admin-report-group-rule-modal {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 32px);
  overflow: hidden;
}
.admin-report-group-rule-modal > .admin-user-modal-head { flex: 0 0 auto; }
.admin-report-group-rule-modal .admin-rule-form {
  min-height: 0;
  max-height: none;
  overflow: hidden;
}
.admin-report-group-rule-modal .admin-rule-modal-body { min-height: 0; overscroll-behavior: contain; }
.admin-report-group-rule-modal .admin-rule-modal-actions { flex-wrap: wrap; }

.admin-rule-modal-actions > .execution-error-card { flex: 1 0 100%; max-height: 22dvh; overflow-y: auto; }

/* Acciones de exports y copia de pizarras. */
.exports-header-actions { display:flex; align-items:center; gap:12px; margin-left:auto; flex-shrink:0; }
.exports-table :is(th, td):nth-child(4) { min-width:250px; white-space:nowrap; overflow-wrap:normal; }
.board-copy-button { display:inline-flex; align-items:center; justify-content:center; gap:6px; }
.board-copy-button svg { flex-shrink:0; }
.board-copy-notice { position:fixed; z-index:10000; bottom:24px; right:24px; max-width:min(580px,calc(100vw - 48px)); display:flex; align-items:center; flex-wrap:wrap; gap:12px; padding:16px; border:1px solid #91aaa1; border-radius:12px; background:#fff; color:#21342f; box-shadow:0 8px 30px #19332a24; }
.board-copy-sheet { position:absolute; left:-100000px; top:0; padding:32px; box-sizing:border-box; background:#fff !important; color:#123b38 !important; font-family:Arial,sans-serif; }
.board-copy-letterhead { display:flex; align-items:center; gap:28px; padding:0 0 22px; margin-bottom:24px; border-bottom:4px solid #60c5ab; }
.board-copy-letterhead img { width:170px; height:auto; object-fit:contain; }
.board-copy-letterhead h1 { margin:0 0 8px; font-family:Georgia,serif; font-size:30px; color:#20332e; }
.board-copy-letterhead p { margin:0; color:#526c64; font-size:13px; }
.board-copy-sheet .board-copy-visual { margin:0 0 24px; display:block; background:#fff; border:1px solid #d7dfd4; border-radius:10px; box-shadow:none; }
.board-copy-sheet .dashboard-widget-head { padding:16px; background:#fff; }
.board-copy-sheet .dashboard-widget-title { min-width:0; }
.board-copy-sheet .dashboard-widget-title strong { color:#21342f; font-size:22px; }
.board-copy-sheet .dashboard-widget-body { padding:16px; height:auto !important; max-height:none !important; min-height:0 !important; overflow:visible !important; }
.board-copy-sheet table { width:100% !important; min-width:max-content; table-layout:auto !important; border-collapse:collapse; }
.board-copy-sheet :is(td, th) { height:auto !important; max-width:none !important; white-space:normal !important; overflow:visible !important; text-overflow:clip !important; overflow-wrap:normal !important; word-break:normal !important; padding:10px 12px; }
.board-copy-sheet :is(td, th):first-child { min-width:240px; }
.board-copy-sheet th { background:#f6f6ed; }
.board-copy-sheet td { background:#fff; color:#123b38; }
.board-copy-sheet tr:nth-child(even) td { background:#f9faf7; }
.board-copy-sheet tfoot td { background:#e0f1e9; font-weight:700; }
.board-copy-sheet footer { border-top:1px solid #d7dfd4; padding-top:14px; color:#526c64; font-size:12px; }

.board-copy-sheet { color-scheme:light; --surface:#fff; --surface-soft:#f7f7ef; --surface-strong:#e0f1e9; --ink:#21342f; --muted:#4d625b; --muted-2:#60736b; --line:#dce2d7; --primary:#3f5c56; --primary-soft:#cfede2; }

.board-copy-sheet .board-copy-expand-sign { display:inline-flex !important; align-items:center; justify-content:center; width:18px !important; height:18px !important; min-width:18px; padding:0 !important; border:0 !important; background:transparent !important; line-height:0 !important; vertical-align:middle; }
.board-copy-expand-sign svg { display:block; flex:none; }

.board-copy-layout-horizontal { display:flex; align-items:flex-start; gap:24px; }
.board-copy-layout-horizontal > .board-copy-visual { flex:0 0 auto; }

/* Los filtros completos pertenecen a cada visual compartida, sin truncamiento. */
.board-copy-sheet .board-copy-filters { display:block!important; white-space:normal!important; overflow:visible!important; max-width:none!important; line-height:1.6; overflow-wrap:anywhere; }

/* Fallback sin biblioteca y personalizacion minima del componente oficial. */
.crm-sileo-action-button { background:var(--mint-soft,#d0eee4)!important;color:var(--ink)!important;font-family:var(--font)!important; }
.crm-sileo-title { font-family:var(--font)!important; }
.crm-version-notice .crm-action-toast-button { width:100%;padding:10px;border:0;border-radius:16px;background:var(--mint-soft,#d0eee4);color:var(--ink);cursor:pointer; }
.crm-version-notice .crm-action-toast-label { display:block;margin-top:12px;text-align:right; }

.notification-popover > header .notification-header-actions { display:flex;flex-direction:row;align-items:center;gap:8px;margin-left:auto;flex-shrink:0; }
.notification-header-actions .control-button { white-space:nowrap; }
[data-sileo-toast] { filter:drop-shadow(0 6px 12px rgba(22,61,50,.23)) drop-shadow(0 0 1px rgba(22,61,50,.55)); }
:root { --sileo-state-action:#26665a; }

.notification-header-actions #notification-sound-toggle[aria-pressed="true"] { background:var(--accent-soft,#d0eee4); color:var(--ink,#245b50); }

.notification-preference-message { margin:10px 12px; padding:10px 12px; border-radius:8px; background:#fff5de; color:#694a16; font-size:12px; line-height:1.5; }

/* Flujo horario: estilos confinados al bloque, sin alterar otras pizarras. */
.vendor-hour-flow { color:var(--ink); font-size:13px;line-height:1.45; }
.vendor-hour-flow .vf-controls { display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:10px 0; }
.vendor-hour-flow button,.vendor-hour-flow select { border:1px solid var(--line);border-radius:8px;background:var(--panel,#fff);color:inherit;padding:6px 9px;font:inherit;cursor:pointer; }
.vendor-hour-flow button[aria-pressed] { border-left:5px solid var(--vf-series); }
.vendor-hour-flow button[aria-pressed="false"] { opacity:.5; }
.vendor-hour-flow button:disabled { opacity:.45;cursor:default; }
.vendor-hour-flow .vf-tiles { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px; }
.vendor-hour-flow .vf-tiles>div,.vendor-hour-flow .vf-card { border:1px solid var(--line);border-radius:10px;padding:12px;margin:10px 0; }
.vendor-hour-flow .vf-tiles strong { display:block;font-size:23px;overflow-wrap:anywhere; }
.vendor-hour-flow small,.vendor-hour-flow p { color:var(--muted);font-size:12px; }
.vendor-hour-flow .vf-scroll { overflow-x:auto; }
.vendor-hour-flow svg { display:block;width:100%;height:auto;touch-action:pan-y;user-select:none;cursor:crosshair; }
.vendor-hour-flow svg text { font:11px sans-serif;fill:currentColor; }
.vendor-hour-flow .vf-grid line { stroke:currentColor;opacity:.1; }
.vendor-hour-flow table { width:100%;border-collapse:collapse;font-size:12px; }
.vendor-hour-flow td,.vendor-hour-flow th { padding:7px;text-align:right;border-bottom:1px solid var(--line);white-space:nowrap; }
.vendor-hour-flow td:first-child,.vendor-hour-flow th:first-child { text-align:left; }
.vendor-hour-flow .vf-heat td { padding:2px; }
.vendor-hour-flow .vf-heat button { width:28px;height:28px;border:0;padding:0; }
@media(max-width:760px){.vendor-hour-flow .vf-tiles{grid-template-columns:repeat(2,minmax(0,1fr));}}

.vendor-hour-flow .vf-chart-wrap{position:relative}
.vendor-hour-flow .vf-tooltip{position:absolute;z-index:4;pointer-events:none;min-width:180px;padding:10px;border:1px solid var(--line);border-radius:9px;background:var(--panel,#fff);box-shadow:0 4px 18px #0003}
.vendor-hour-flow .vf-tooltip[hidden]{display:none}
.vendor-hour-flow .vf-tooltip div{display:flex;gap:7px;align-items:center;margin-top:4px}.vendor-hour-flow .vf-tooltip b{margin-left:auto}.vendor-hour-flow .vf-tooltip i{width:12px;height:3px}
.vendor-hour-flow .vf-legend{display:flex;flex-wrap:wrap;justify-content:center;gap:10px 20px;margin:8px 0 14px}.vendor-hour-flow .vf-legend span{display:inline-flex;align-items:center;gap:6px}.vendor-hour-flow .vf-legend i{width:20px;display:inline-block}
.vendor-hour-flow .vf-heat-grid{display:grid;grid-template-columns:minmax(110px,1.8fr) repeat(24,minmax(0,1fr));gap:2px;min-width:650px;align-items:center;font-size:10px}.vendor-hour-flow .vf-heat-hour{text-align:center}.vendor-hour-flow .vf-heat-label{font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vendor-hour-flow .vf-heat-cell{display:block;width:100%;height:30px;min-width:0;padding:0;border-radius:2px;text-align:center;line-height:28px;box-sizing:border-box}.vendor-hour-flow .vf-card:has(.vf-heat-grid){padding:8px}

.vendor-hour-flow .vf-legend button{display:inline-flex;align-items:center;gap:6px;border:0!important;background:transparent;padding:4px;cursor:pointer}.vendor-hour-flow .vf-legend button[aria-pressed="false"]{text-decoration:line-through}.vendor-hour-flow .vf-legend>span{display:inline-flex;gap:6px;align-items:center}
.vendor-hour-flow table{table-layout:fixed;width:100%}.vendor-hour-flow th{background:var(--soft,#f7f7ef);border-bottom:1px solid var(--line);font-weight:600;white-space:normal}.vendor-hour-flow td{white-space:normal}.vendor-hour-flow th:first-child{width:20%}.vendor-hour-flow .column-resize-handle{display:none}

.vendor-hour-flow .vf-totals th,.vendor-hour-flow .vf-totals td{font-weight:700;border-top:2px solid var(--line);background:var(--soft,#f7f7ef)}

/* La exportacion no debe recalcular las columnas horarias por el largo del titulo. */
.board-copy-sheet .vendor-hour-flow table{table-layout:fixed!important;min-width:0!important}
.board-copy-sheet .vendor-hour-flow :is(th,td):first-child{min-width:0!important}
.board-copy-sheet .vendor-hour-flow th:first-child{width:auto}
