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

: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-honey); border-color: #876310; color: var(--brand-pine);
}
:root:not([data-analytics-design-active="true"]) .auth-submit:hover:not(:disabled) { background: #f1c45b; }
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; }
}
