:root { color-scheme: light; font-family: Calibri, Arial, sans-serif; color: #222; background: #ececec; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { padding: 3px; }
.login-screen { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; background: #ececec; }
.login-window { width: 330px; border: 1px solid #aaa; border-radius: 4px; background: #f5f5f5; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.login-title { height: 29px; padding: 7px 10px; border-bottom: 1px solid #b6b6b6; background: linear-gradient(#dddddd, #bfbfbf); color: #222; font-size: 11px; font-weight: 700; }
.login-body { padding: 16px; }
.login-body label { display: block; margin-bottom: 4px; }
.login-body .tool-button { margin-top: 14px; min-width: 95px; }
.app-shell { height: 100%; min-width: 940px; }
.app-tabs { display: flex; height: 29px; align-items: end; border: 1px solid #b6b6b6; border-bottom: 0; background: linear-gradient(#f4f4f4, #dfdfdf); padding-left: 12px; }
.app-tab { height: 27px; min-width: 118px; padding: 0 13px; border: 1px solid transparent; border-bottom: 0; border-radius: 3px 3px 0 0; background: transparent; color: #343434; font-family: Calibri, Arial, sans-serif; font-size: 11px; cursor: pointer; }
.app-tab:hover { background: #e6e6e6; }
.app-tab.is-active { position: relative; top: 1px; border-color: #b6b6b6; background: #fff; color: #0a4b8d; font-weight: 700; }
.tab-panel { display: none; height: calc(100% - 29px); border: 1px solid #b6b6b6; background: #fff; overflow: hidden; }
.tab-panel.is-active { display: flex; flex-direction: column; }
.toolbar { height: 39px; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid #d0d0d0; background: #f4f4f4; font-size: 11px; }
.toolbar strong { margin-right: 12px; color: #222; }
.toolbar .scope-store { display: inline-block; width: auto; min-width: 200px; margin: 0 0 0 10px; font-weight: 700; }
.autosave-status { margin-left: 8px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.autosave-status[data-state="saving"] { color: #0a4b8d; }
.autosave-status[data-state="saved"] { color: #15742a; }
.autosave-status[data-state="error"] { color: #b42318; }
.readonly-badge { padding: 3px 8px; border: 1px solid #b54708; border-radius: 3px; background: #fff4e5; color: #b54708; font-weight: 700; }
.tool-button { height: 26px; padding: 0 10px; border: 1px solid #8e8e97; border-radius: 3px; background: linear-gradient(to bottom, #ffffff 0%, #efeff1 2%, #ededf0 5%, #d2d2d8 100%); box-shadow: 0 2px 3px rgba(0,0,0,.15); color: #000; font-family: Calibri, Arial, sans-serif; font-size: 11px; cursor: pointer; }
.tool-button:hover { border-color: #5a5e64; background: linear-gradient(to bottom, #cacdd5 0%, #a3a7b4 93%, #a6aab7 100%); }
.tool-button:active { border-color: #014ab8; background: linear-gradient(to bottom, #058cf5 0%, #0167e9 72%, #015de6 100%); color: #fff; }
label { color: #222; font-family: Calibri, Arial, sans-serif; font-size: 11px; font-weight: 700; }
input, select { display: block; width: 100%; height: 26px; margin-top: 3px; border: 1px solid #ababab; border-radius: 2px; background: #fff; color: #222; font-family: Calibri, Arial, sans-serif; font-size: 11px; padding: 3px 6px; }
input:focus, select:focus { outline: 1px solid #4296d2; border-color: #3682bc; }
/* Barra de período, estilo BigQ: combo + Inicio + Fin + VIEW + texto verde de estado */
.filter-bar { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-bottom: 1px solid #d0d0d0; background: #fff; font-size: 11px; }
.filter-bar select, .filter-bar input { display: inline-block; width: auto; margin: 0; height: 26px; }
.filter-bar select { width: 110px; font-weight: 700; }
.filter-bar input[type="date"] { width: 130px; }
.filter-bar input[readonly] { background: #f0f0f0; color: #555; }
.filter-bar .filter-label { margin-left: 6px; font-weight: 700; color: #444; }
.filter-bar .view-button { min-width: 80px; margin-left: 6px; }
/* Fila "Meta semanal (central)" dentro del bloque editable de la tabla */
.weekly-table .target-row td.target-cell { text-align: left; background: #f1f7fd; }
.weekly-table .target-row #weekly-target-input { display: inline-block; width: 160px; text-align: right; font-weight: 700; border-color: #3682bc; }
.weekly-table .target-row #weekly-target-input[readonly] { border-color: #d6d6d6; background: #f0f0f0; font-weight: 400; }
.weekly-table .target-row .target-hint { margin-left: 10px; color: #52514e; font-size: 10px; }
.range-info {margin-left: 10px; color: #15742a; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.weekly-entry { display: grid; grid-template-columns: minmax(0, 1fr) 190px; border-bottom: 1px solid #d0d0d0; }
/* Sin relleno lateral dentro del área con scroll: si no, los días se verían pasar por detrás de las columnas fijas. */
.weekly-table-wrap { min-width: 0; overflow-x: auto; padding: 8px 0; margin: 0 10px; }
.weekly-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11px; table-layout: fixed; }
.weekly-table th, .weekly-table td { overflow: hidden; text-overflow: ellipsis; }
/* Columnas fijas: nombres de fila a la izquierda y TOTAL a la derecha; los días del medio se desplazan. */
.weekly-table .row-label { position: sticky; left: 0; z-index: 2; min-width: 150px; box-shadow: 1px 0 0 #b6b6b6; }
.weekly-table .row-total { position: sticky; right: 0; z-index: 2; min-width: 95px; box-shadow: -1px 0 0 #b6b6b6; }
.weekly-table .day { min-width: 92px; }
.weekly-table .week-start { border-left: 2px solid #9fb6cc; }
.weekly-table th, .weekly-table td { height: 26px; border-right: 1px solid #d0d0d0; border-bottom: 1px solid #d0d0d0; padding: 3px 5px; text-align: right; white-space: nowrap; }
.weekly-table tr > :first-child { border-left: 1px solid #d0d0d0; }
.weekly-table thead th { border-top: 1px solid #d0d0d0; }
.weekly-table thead th { background: #e6e6e6; color: #222; text-align: center; font-weight: 700; }
.weekly-table tbody th { width: 175px; background: #f2f2f2; text-align: left; font-weight: 700; }
.weekly-table td:last-child { background: #f5f5f5; font-weight: 700; }
.weekly-table .manual-row th { background: #e9f2fa; }
.weekly-table input { height: 20px; margin: 0; padding: 1px 4px; text-align: right; }
.weekly-table .manual-row td { background: #f1f7fd; }
.weekly-table .manual-row td.is-today { background: #dcebf9; }
.weekly-table .manual-row td:last-child { background: #e9f2fa; }
/* Marco grueso alrededor de las filas que llena la tienda */
.weekly-table .manual-row > td:first-of-type { box-shadow: inset 2px 0 0 #3682bc; }
.weekly-table .manual-row > td:last-child { box-shadow: -1px 0 0 #b6b6b6, inset -2px 0 0 #3682bc; }
.weekly-table .entry-first > td { border-top: 2px solid #3682bc; }
.weekly-table tr:has(+ .entry-first) > * { border-bottom: 0; }
.weekly-table .entry-last > td { border-bottom: 2px solid #3682bc; }
.weekly-table input:disabled { background: #f0f0f0; border-color: #d6d6d6; }
.weekly-table .day-date { font-weight: 400; color: #555; }
.weekly-table .is-today { background: #e8f1fb; }
.weekly-table thead th.is-today { background: #cfe2f6; color: #0a4b8d; }
.weekly-table [data-state="negative"] { color: #b42318; }
.weekly-table [data-state="positive"] { color: #15742a; }
.weekly-table [data-state="ok"] { color: #15742a; font-weight: 700; }
.weekly-table [data-state="pending"] { color: #b54708; font-weight: 700; }
.weekly-table [data-state="dirty"] { color: #0a4b8d; font-weight: 700; }
/* Sugerencia histórica: % que difiere de lo cargado, y lo que falta vender para el 100 % */
.weekly-table [data-state="suggest-diff"] { color: #0a4b8d; font-weight: 700; }
/* Vista previa con una meta semanal digitada sin guardar */
.weekly-table [data-state="preview"] { color: #0a4b8d; font-style: italic; background: repeating-linear-gradient(135deg, #eaf2fb 0 6px, #f6f9fd 6px 12px); }
.weekly-table [data-state="needed"] { color: #6a4c00; }
/* Venta esperada (mediana histórica) de los días que faltan */
.weekly-table [data-state="expected"] { color: #0a4b8d; font-weight: 700; }
.weekly-table [data-state="negative"] { font-weight: 700; }
/* Meta ajustada: sube (▲, vas bajo el plan) o baja (▼, vas sobre el plan) */
.weekly-table [data-state="needed-up"] { color: #b42318; font-weight: 700; }
.weekly-table [data-state="needed-down"] { color: #15742a; font-weight: 700; }
.weekly-table [data-state="needed-today"] { color: #fff; background: #b54708 !important; font-weight: 700; }

.tabulator .tabulator-row.tabulator-selected { background: #cfe2f6; }
.tabulator .tabulator-cell.cell-pending { color: #b54708; font-weight: 700; }
.weekly-indicators {padding: 8px 10px; border-left: 1px solid #d0d0d0; background: #f8f8f8; }
.weekly-indicators label { display: block; margin-bottom: 8px; }
.weekly-indicators div { padding: 6px 0; border-top: 1px solid #ddd; }
.weekly-indicators span { display: block; color: #555; font-size: 11px; }
.weekly-indicators strong { display: block; margin-top: 3px; color: #113f68; font-size: 13px; }
.grid-area { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; padding: 8px 10px 10px; }
.grid-area #weekly-grid { flex: 1 1 auto; min-height: 0; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 5px; font-size: 11px; }
.section-title strong { color: #0a4b8d; font-size: 12px; }
.section-title span { color: #555; }
.section-title .history-select { display: inline-block; width: auto; height: 22px; margin: 0; padding: 1px 4px; font-size: 10px; font-weight: 700; }
.tabulator .tabulator-row.row-nodata .tabulator-cell { color: #9a9a9a; }
.tabulator .tabulator-row.row-nodata { background: #fafafa; }
.tabulator .tabulator-row.row-future .tabulator-cell { color: #c3c2b7; font-style: italic; }
.status { color: #15742a; font-size: 11px; font-weight: 700; min-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status.error { color: #b42318; }
.tabulator { height: 100%; border: 1px solid #c5c5c5; font-family: Calibri, Arial, sans-serif; font-size: 11px; }
.tabulator .tabulator-header { background: #e6e6e6; border-bottom: 1px solid #b8b8b8; color: #222; font-weight: 700; }
.tabulator .tabulator-header .tabulator-col { min-height: 24px; background: #e6e6e6; border-right: 1px solid #c9c9c9; }
.tabulator .tabulator-header .tabulator-col .tabulator-col-content { padding: 5px 6px; }
.tabulator .tabulator-row { min-height: 30px; background: #fff; border-bottom: 0; }
.tabulator .tabulator-row:nth-child(even) { background: #f5f5f5; }
.tabulator .tabulator-row:hover { background: #eaf4ff; }
.tabulator .tabulator-row .tabulator-cell { height: 30px; padding: 8px 6px; border-right: 1px solid #e4e4e4; }
/* Meta vs alcanzado (panel derecho y grilla) */
.weekly-indicators .target-vs-actual { padding: 4px 0 0; border-top: 0; }
.target-vs-actual .tva-row { display: flex; justify-content: space-between; padding: 1px 0; border: 0; font-size: 11px; color: #555; }
.target-vs-actual .tva-row span { display: inline; }
.target-vs-actual .tva-row b { color: #222; }
.target-vs-actual .meta-bars { display: block; margin-top: 4px; }
.target-vs-actual .tva-note { padding: 3px 0 0; border: 0; color: #898781; font-size: 10px; line-height: 1.3; }
.weekly-indicators .panel-period { padding: 4px 0 6px; border-top: 0; border-bottom: 2px solid #3682bc; }
.weekly-indicators .panel-period strong { color: #0a4b8d; font-size: 14px; }
.weekly-indicators .panel-period small { display: block; color: #52514e; font-size: 11px; font-weight: 700; }
.tabulator .tabulator-cell .meta-bars { display: block; margin-top: -1px; }

/* Gráficos pequeños */
.weekly-indicators .week-trend { padding: 4px 0 0; border-top: 0; }
.week-trend svg { display: block; overflow: visible; }
.week-trend .trend-point { cursor: pointer; }
.week-trend .trend-ref { font-family: Calibri, Arial, sans-serif; font-size: 9px; fill: #777; }
.week-trend .trend-empty { color: #999; }
.tabulator .tabulator-cell .spark { display: block; margin-top: -5px; }

/* Espacio sobrante de la grilla en blanco, no gris */
.tabulator, .tabulator .tabulator-tableholder { background-color: #fff; }

/* ================================================================
   AVISOS (iziToast) — mismo aspecto que la app BigQ (WORKF, .mxi-toast)
   ================================================================ */
.iziToast.sf-toast {
  width: 520px; max-width: calc(100vw - 32px); min-height: auto; padding: 10px 13px;
  font-family: Calibri, Arial, sans-serif; font-size: 11px; color: #333;
  background: linear-gradient(90deg, rgba(248, 248, 248, .97), rgba(214, 214, 214, .93));
  box-shadow: 0 6px 18px rgba(0, 0, 0, .30); backdrop-filter: blur(4px);
}
.iziToast.sf-toast .iziToast-title { font-family: Calibri, Arial, sans-serif; font-size: 12px; color: #07521b; }
.iziToast.sf-error-toast .iziToast-title { color: #c40000; }
.iziToast.sf-toast .iziToast-message { display: block; float: none; width: 100%; text-align: left; font-size: 12px; color: #333; }
.iziToast.sf-toast .iziToast-title, .iziToast.sf-toast .iziToast-message { user-select: text; cursor: text; }
.iziToast.sf-toast .sf-toast-button {
  margin-left: 6px; padding: 4px 8px; border: 0; background: rgba(190, 190, 190, .75);
  color: #333; font-family: Calibri, Arial, sans-serif; font-size: 11px; cursor: pointer;
}
.iziToast.sf-progress-toast, .iziToast-capsule .iziToast.sf-progress-toast { animation-duration: .25s !important; animation-delay: 0s !important; }
.iziToast.sf-progress-toast > .iziToast-close { top: 4px; right: 4px; width: 26px; height: 26px; background-position: center center; }
.iziToast.sf-toast .sf-progress-box { width: 430px; max-width: 100%; height: 76px; overflow: hidden; }
.iziToast.sf-toast .sf-progress-text { height: 20px; line-height: 20px; font-size: 12px; font-weight: 700; color: #333; white-space: nowrap; overflow: hidden; }
.iziToast.sf-toast .sf-progress-track { height: 14px; margin-top: 8px; overflow: hidden; background: #8f8f8f; border: 1px solid #6e6e6e; border-radius: 3px; }
.iziToast.sf-toast .sf-progress-fill { width: 100%; height: 100%; background: #1e9e3a; transform-origin: left center; transform: scaleX(0); }
.iziToast.sf-toast .sf-progress-meta { display: flex; justify-content: space-between; margin-top: 10px; height: 20px; line-height: 20px; font-size: 12px; color: #666; white-space: nowrap; }
.iziToast.sf-toast .sf-elapsed { color: #d00000; font-weight: 700; }

/* ================================================================
   DASHBOARD (resumen ejecutivo)
   ================================================================ */
.dash-panel { background: #f4f4f2; }
.dash-filters select { width: auto; min-width: 90px; }
.dash-filters .dash-store { min-width: 190px; }
.dash-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 10px 12px 16px; }
.dash-title { margin: 2px 0 10px; color: #0a4b8d; font-size: 15px; letter-spacing: .3px; }
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-bottom: 8px; }
.kpi { padding: 10px 12px; border: 1px solid #d6d6d2; border-radius: 4px; background: #fcfcfb; }
.kpi-title { color: #52514e; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.kpi-value { margin: 4px 0 2px; color: #0b0b0b; font-size: 22px; font-weight: 700; }
.kpi-detail { min-height: 16px; }
.kpi-delta { color: #52514e; font-size: 11px; }
.kpi-delta.up { color: #006300; font-weight: 700; }
.kpi-delta.down { color: #d03b3b; font-weight: 700; }
.kpi-delta small { font-weight: 400; color: #52514e; }
.kpi-note { margin-top: 3px; color: #898781; font-size: 10px; }
.kpi .meta-bars { display: block; margin-top: 6px; }
.kpi-badge { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 8px; background: #fff4e5; border: 1px solid #b54708; color: #b54708; font-size: 9px; vertical-align: 1px; }
.kpi-badge.est { background: #eaf2fb; border-color: #2a78d6; color: #0a4b8d; }
.dash-legend i.proj-swatch { background: rgba(42, 120, 214, .12); border: 1.5px dashed #2a78d6; box-sizing: border-box; }
.dash-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 8px; margin-bottom: 8px; }
.dash-card { padding: 10px 12px; margin-bottom: 8px; border: 1px solid #d6d6d2; border-radius: 4px; background: #fcfcfb; overflow-x: auto; }
.dash-row .dash-card { margin-bottom: 0; }
.dash-card-title { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; color: #0b0b0b; font-size: 12px; font-weight: 700; }
.dash-chart svg { display: block; }
.dash-chart .axis { font-family: Calibri, Arial, sans-serif; font-size: 10px; fill: #898781; }
.dash-chart .axis.strong { fill: #0b0b0b; font-weight: 700; }
.dash-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; color: #52514e; font-size: 10px; font-weight: 400; }
.dash-legend.inline { margin: 0; }
.dash-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 4px; border-radius: 2px; vertical-align: -1px; }
.dash-empty, .dash-note { color: #898781; font-size: 11px; }
.dash-note { margin-top: 6px; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
.dash-table th, .dash-table td { padding: 5px 6px; border-bottom: 1px solid #e1e0d9; text-align: right; white-space: nowrap; }
.dash-table thead th { color: #52514e; background: #efefec; font-weight: 700; }
.dash-table tbody th { text-align: left; color: #0b0b0b; }
.dash-table .up { color: #006300; font-weight: 700; }
.dash-table .down { color: #d03b3b; font-weight: 700; }
.dash-table .muted, .muted { color: #898781; font-weight: 400; }
.dash-table .bar-cell { width: 120px; }
.div-bar { position: relative; width: 120px; height: 10px; }
.div-bar .axis-mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: #898781; }
.div-bar .fill { position: absolute; top: 1px; height: 8px; border-radius: 2px; }
.div-bar .fill.pos { background: #2a78d6; }
.div-bar .fill.neg { background: #d03b3b; }
.heatmap { border-collapse: separate; border-spacing: 2px; font-size: 10px; font-variant-numeric: tabular-nums; }
.heatmap th { padding: 2px 6px; color: #52514e; font-weight: 700; text-align: right; white-space: nowrap; }
.heatmap thead th { text-align: center; }
.heatmap td { min-width: 38px; padding: 5px 4px; border-radius: 2px; text-align: center; }
.heatmap td.empty { color: #c3c2b7; }
.wd-row { display: grid; grid-template-columns: 70px 1fr 56px; align-items: center; gap: 6px; margin: 5px 0; font-size: 11px; }
.wd-name { color: #52514e; }
.wd-track { position: relative; height: 12px; background: #efefec; border-radius: 2px; }
.wd-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; }
.wd-ref { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #0b0b0b; z-index: 1; }
.wd-value { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
/* Cobertura de metas: qué parte del período tiene meta cargada */
.coverage { margin: 2px 0 10px; }
.coverage.compact { margin: 8px 0 0; }
.cov-text { color: #52514e; font-size: 11px; line-height: 1.4; }
.coverage.compact .cov-text { font-size: 10px; }
.cov-missing { color: #d03b3b; }
.cov-bar { position: relative; height: 10px; margin-top: 4px; border-radius: 2px; border: 1px solid #c3c2b7;
  background: repeating-linear-gradient(135deg, #f6c6c3 0 4px, #fcfcfb 4px 8px); }
.coverage.compact .cov-bar { height: 7px; }
.cov-bar .cov-on { position: absolute; top: 0; bottom: 0; background: #2a78d6; }
.cov-bar .cov-future { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(90deg, #e1e0d9 0 3px, #fcfcfb 3px 6px); }
.cov-scale { display: flex; justify-content: space-between; color: #898781; font-size: 9px; }
.coverage.compact .cov-scale { display: none; }
.cov-legend { margin-top: 2px; }
.cov-swatch.on { background: #2a78d6; }
.cov-swatch.off { background: repeating-linear-gradient(135deg, #f6c6c3 0 3px, #fff 3px 6px); border: 1px solid #c3c2b7; }
.cov-swatch.future { background: repeating-linear-gradient(90deg, #c3c2b7 0 2px, #fff 2px 4px); border: 1px solid #c3c2b7; }
.cov-flag { color: #d03b3b; font-weight: 400; }
.dash-table .group-head th { background: #fcfcfb; color: #52514e; font-size: 10px; font-weight: 700; text-align: center; border-bottom: 2px solid #c3c2b7; }
.dash-table .group-head th.meta-group { border-bottom-color: #2a78d6; color: #0a4b8d; }
.dash-table thead th.meta-group { background: #eaf2fb; }
.dash-table .trend { color: #52514e; font-size: 10px; }
.dash-table .meta-req { color: #0a4b8d; font-weight: 700; }
.dash-table .trend.up { color: #006300; font-weight: 700; }
.dash-table .trend.down { color: #d03b3b; font-weight: 700; }
/* Comportamiento de venta por día de la semana */
.mix-map td.mix { min-width: 52px; font-weight: 700; }
.mix-map td.best { outline: 2px solid #0b0b0b; outline-offset: -2px; }
.mix-map td.worst { outline: 2px dashed #52514e; outline-offset: -2px; }
.mix-map tbody tr { cursor: pointer; }
.mix-map tbody tr:hover th { color: #0a4b8d; text-decoration: underline; }
.mix-map tbody tr.is-selected th { color: #0a4b8d; }
.mix-map tbody tr.mix-total th { font-weight: 700; color: #0b0b0b; }
.mix-map tbody tr.mix-total td { border-bottom: 2px solid #0b0b0b; }
.mix-row { display: grid; grid-template-columns: 70px 1fr 92px 96px; align-items: center; gap: 6px; margin: 6px 0; font-size: 11px; }
.mix-bars { display: flex; flex-direction: column; gap: 2px; }
.mix-bar { display: block; height: 7px; border-radius: 2px; }
.mix-bar.target { background: #b9b8b2; }
.mix-bar.sales { background: #2a78d6; }
.mix-values { text-align: right; font-variant-numeric: tabular-nums; color: #52514e; }
.mix-gap { font-size: 10px; color: #52514e; white-space: nowrap; }
.mix-gap.down { color: #d03b3b; font-weight: 700; }
.mix-gap.up { color: #006300; font-weight: 700; }
.mix-suggest { margin-top: 8px; padding: 6px 8px; border-left: 3px solid #2a78d6; background: #eaf2fb; font-size: 11px; }
.dash-findings ul { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.6; }

/* ================================================================
   CALIDAD DE DATOS
   ================================================================ */
.dq-panel .filter-bar select { width: auto; min-width: 150px; }
.dq-top { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 10px; padding: 8px 10px 0; }
.dq-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-content: start; }
.dq-tile { display: flex; flex-direction: column; align-items: flex-start; padding: 7px 9px; border: 1px solid #d6d6d2; border-left: 4px solid var(--sev); border-radius: 3px; background: #fcfcfb; font-family: Calibri, Arial, sans-serif; text-align: left; cursor: pointer; }
.dq-tile:hover { background: #f2f6fb; }
.dq-tile.is-selected { outline: 2px solid #3682bc; background: #eaf2fb; }
.dq-tile-title { color: #52514e; font-size: 11px; font-weight: 700; }
.dq-tile-value { color: #0b0b0b; font-size: 20px; font-weight: 700; line-height: 1.2; }
.dq-tile-text { color: #898781; font-size: 10px; }
.dq-chip { display: inline-block; padding: 1px 6px; border-radius: 9px; background: color-mix(in srgb, var(--sev) 18%, #fff); border: 1px solid var(--sev); color: #0b0b0b; font-size: 10px; font-weight: 700; white-space: nowrap; }
.dq-matrix-wrap { max-height: 210px; overflow: auto; border: 1px solid #d6d6d2; border-radius: 3px; background: #fcfcfb; }
.dq-matrix { width: 100%; border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
.dq-matrix th, .dq-matrix td { padding: 4px 6px; border-bottom: 1px solid #e1e0d9; text-align: center; white-space: nowrap; }
.dq-matrix thead th { position: sticky; top: 0; z-index: 1; background: #efefec; }
.dq-matrix tbody th { text-align: left; }
.dq-matrix tbody tr { cursor: pointer; }
.dq-matrix tbody tr:hover { background: #eaf4ff; }
.dq-matrix tbody tr.is-selected { outline: 2px solid #3682bc; outline-offset: -2px; }
.dq-matrix .dq-total { font-weight: 700; }
.dq-matrix .dq-checks { text-align: left; color: #52514e; white-space: normal; }
.dq-panel .grid-area #dq-grid { flex: 1 1 auto; min-height: 0; }
.dq-group-count { color: #898781; font-weight: 400; }
.dq-open { color: #0a4b8d; font-weight: 700; cursor: pointer; }
.dq-other { color: #898781; }
#dq-grid .tabulator-row { min-height: 26px; }
#dq-grid .tabulator-row .tabulator-cell { height: auto; padding: 5px 6px; white-space: normal; }

/* Elementos que solo aparecen al imprimir */
.print-only { display: none; }

/* Presentación: imprimir / guardar PDF la pestaña pedida (body[data-print]) o, con Ctrl+P, la pestaña activa */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  /* :root define el fondo gris de pantalla; hay que pisarlo aquí o se imprime gris donde no hay contenido. */
  :root, html, body { height: auto !important; overflow: visible !important; background: #fff !important; }
  body { padding: 0; }
  .app-shell, .tab-panel, .dash-scroll, .dq-matrix-wrap { height: auto !important; max-height: none !important; min-height: 0 !important; overflow: visible !important; }
  .app-shell { min-width: 0; }
  .app-tabs, .filter-bar, .login-screen, .iziToast-wrapper { display: none !important; }
  .tab-panel { display: none !important; }
  body:not([data-print]) .tab-panel.is-active, body[data-print="dash"] #tab-dash, body[data-print="dq"] #tab-dq { display: block !important; border: 0; background: #fff; }
  .print-only { display: block !important; }
  .dash-scroll { padding: 0; }
  .dash-card, .kpi, .dq-tile { break-inside: avoid; }
  /* Calidad de datos: la grilla interactiva se reemplaza por la tabla completa */
  #tab-dq .grid-area { display: none !important; }
  .dq-top { grid-template-columns: 300px minmax(0, 1fr); padding: 0 0 8px; }
  .dq-print { width: 100%; border-collapse: collapse; font-size: 10px; }
  .dq-print th, .dq-print td { padding: 4px 6px; border-bottom: 1px solid #e1e0d9; text-align: left; vertical-align: top; }
  .dq-print thead th { background: #efefec; }
  .dq-print thead { display: table-header-group; }
  .dq-print tr { break-inside: avoid; }
  .dq-print .dq-print-group th { padding-top: 8px; color: #0a4b8d; font-size: 11px; border-bottom: 1px solid #9fb6cc; }
  .dq-print td:first-child { white-space: nowrap; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.available-panel { align-items: center; justify-content: center; color: #777; font-size: 12px; }
