/* Performance (/forecast-metrics): the level view. Prefix pf-. Sizes are
 * Flutter logical px (level_view.dart, level_pickers.dart, level_charts.dart). */

.pf-page { padding: 0; overflow: hidden; }
.pf-body { position: absolute; inset: 0; padding: 12px 24px 16px; display: flex; flex-direction: column; min-height: 0; }
.pf-main { flex: 1; min-height: 0; display: flex; gap: 16px; }
.pf-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.pf-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.pf-sp { flex: 1; min-width: 0; }
.pf-muted { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pf-title { font-size: 16px; font-weight: 600; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-flabel { font-size: 11px; font-weight: 600; letter-spacing: .5px; color: var(--muted); }
.g-good { color: var(--success); } .g-watch { color: var(--warning); } .g-bad { color: var(--error); }
.g-none { color: var(--text); } .g-muted { color: var(--muted); }

/* ── top bar ── */
.pf-actions { display: flex; align-items: center; gap: 8px; }
.pf-anchor { position: relative; }
.pf-pick, .pf-run { height: 32px; display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; color: var(--text); white-space: nowrap; }
.pf-pick { padding: 0 8px 0 12px; font-size: 12.5px; }
.pf-pick:hover, .pf-run:hover { background: var(--hover); }
.pf-pick-cap { color: var(--muted); margin-right: 6px; }
.pf-pick-val { font-weight: 600; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.pf-pick-star { margin-left: 4px; color: var(--text-2); }
.pf-pick-chev { margin-left: 4px; color: var(--muted); transition: transform 180ms var(--ease-out-cubic); }
.pf-pick.is-open .pf-pick-chev { transform: rotate(180deg); }
.pf-run { gap: 8px; padding: 0 12px; font-size: 14px; font-weight: 500; color: var(--text-2); max-width: 340px; }
.pf-run .busy-spin { margin-right: 0; }
.pf-run-txt { display: inline-flex; align-items: baseline; gap: 8px; min-width: 0; }
.pf-run-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 600; color: var(--text); }
.pf-run-date { flex: none; font-size: 12.5px; color: var(--muted); }
.pf-seg { display: inline-flex; padding: 3px; border-radius: 8px; background: var(--hover); border: 1px solid var(--border); }
.pf-seg button { padding: 7px 12px; border-radius: 6px; font-size: 12.5px; color: var(--text-2); border: 1px solid transparent; line-height: 1.2; transition: background-color 120ms linear; }
.pf-seg button.is-on { background: var(--surface); border-color: var(--border); box-shadow: 0 1px 2px var(--shadow); color: var(--text); font-weight: 600; }
/* "Agrupar por mes" (live runs finer than a month): a toggle beside the views. */
.pf-month { height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.pf-month:hover { background: var(--hover); }
.pf-month.is-on { background: var(--surface); color: var(--text); font-weight: 600; border-color: var(--text-2); }
.pf-month-note { display: flex; align-items: flex-start; gap: 6px; margin: 0 0 10px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.pf-month-note svg { flex: none; margin-top: 1px; }
@media (max-width: 767.98px) {
  .pf-month { padding: 0 10px; min-height: 44px; } .pf-month-txt { display: none; }
  .pf-month-note span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
}

/* menus (MenuAnchor with _menuStyle) */
.pf-menu { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; padding: 8px 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--menu-shadow); transform-origin: top left; }
.pf-menu-right { left: auto; right: 0; transform-origin: top right; }
.pf-lmenu { min-width: 300px; }
.pf-litem { display: flex; align-items: center; width: 100%; min-height: 34px; padding: 0 18px; font-size: 13px; text-align: left; color: var(--text); }
.pf-litem:hover { background: var(--hover); }
.pf-litem.is-on { background: var(--selected); font-weight: 600; }
.pf-lname { flex: 1; display: inline-flex; align-items: center; gap: 6px; }
.pf-lname .ic { color: var(--text-2); }
.pf-lcount { margin-left: 28px; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.pf-lsep { height: 1px; background: var(--border); margin: 7px 0 6px; }
.pf-lhead { padding: 10px 18px 4px; font-size: 11px; color: var(--muted); }
.pf-chint { max-width: 280px; line-height: 1.4; padding-bottom: 8px; }
.pf-menu .pf-mitem { display: flex; align-items: center; gap: 8px; width: 316px; min-height: 36px; padding: 2px 12px 2px 6px; text-align: left; color: var(--text); line-height: 1.3; }
.pf-mitem:hover { background: var(--hover); }
.pf-mitem.is-locked { cursor: default; }
.pf-mitem.is-locked .pf-mtext { opacity: .45; }
.pf-cb { display: grid; place-items: center; width: 28px; height: 28px; color: var(--text-2); flex: none; }
.pf-cb.is-on { color: var(--primary); }
.pf-mtext { display: flex; flex-direction: column; min-width: 0; }
.pf-mname { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.pf-mname .ic { color: var(--text-2); }
.pf-mdesc { font-size: 11px; color: var(--muted); line-height: 1.3; }
.pf-msep { height: 1px; background: var(--border); margin: 4px 0 5px; }
.pf-mfoot { display: flex; align-items: center; gap: 8px; padding: 2px 6px 2px 12px; font-size: 11.5px; color: var(--muted); width: 316px; white-space: nowrap; }
.pf-mfoot > span { flex: 1; }
.pf-tbtn { padding: 8px 12px; border-radius: 16px; font-size: 12px; font-weight: 500; color: var(--primary); white-space: nowrap; }
.pf-tbtn:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.pf-tbtn[disabled] { color: var(--muted); opacity: .6; pointer-events: none; }
.pf-tbtn-ic { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }

/* ── level summary card ── */
.pf-sum { flex: none; padding: 12px 14px 14px 18px; }
.pf-sum-head { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.pf-star { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); margin-left: -4px; }
.pf-star:hover { background: var(--hover); }
.pf-star.is-on { color: var(--text-2); cursor: default; }
.pf-star.is-on:hover { background: none; }
.pf-brief { overflow: hidden; text-overflow: ellipsis; }
.pf-strip { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.pf-strip > span { display: inline-flex; align-items: baseline; gap: 8px; }
.pf-strip b { font-size: 15px; font-weight: 700; line-height: 1.1; }

/* --cols tracks while each is at least 150px, fewer below and one on a
 * column narrower than that (auto-fill keeps a lone tile a third wide). The
 * 0.1px keeps rounding from dropping a track. */
.pf-tiles { margin-top: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(max(min(150px, 100%), calc((100% - (var(--cols) - 1) * 8px) / var(--cols) - .1px)), 1fr)); gap: 8px; }
.pf-u { font-size: 13px; font-weight: 600; letter-spacing: 0; white-space: nowrap; }
.pf-strip .pf-u { font-size: 12px; }
.pf-tile { display: flex; flex-direction: column; align-items: flex-start; padding: 10px 12px 10px 14px; border: 1px solid var(--border); border-radius: 10px; text-align: left; transition: background-color 160ms linear; }
button.pf-tile:hover { background: var(--hover); }
.pf-tile.is-active { background: var(--selected); }
.pf-tile.is-active .pf-flabel { color: var(--text); }
.pf-fig { margin-top: 6px; font-weight: 700; line-height: 1.1; }
.pf-tsub { margin-top: 4px; font-size: 11px; color: var(--muted); display: flex; align-items: center; white-space: nowrap; overflow: hidden; max-width: 100%; }
.pf-tbar { margin-top: 8px; height: 2px; width: 0; border-radius: 1px; background: var(--text-2); transition: width 180ms var(--ease-out-cubic); }
.pf-tile.is-active .pf-tbar { width: 28px; }
.pf-tiles-all { --cols: 4; margin: 0 0 8px; }
.pf-delta { color: var(--muted); display: inline-flex; align-items: center; }
.pf-delta.is-worse { color: var(--error); } .pf-delta.is-better { color: var(--success); }
.pf-tri { width: 0; height: 0; margin: 0 3px; border-left: 4px solid transparent; border-right: 4px solid transparent; }
.pf-tri.up { border-bottom: 5px solid currentColor; } .pf-tri.down { border-top: 5px solid currentColor; }

/* ── pills ── */
.pf-pill { --c: var(--muted); flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 4px; background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c); }
.pf-pill b { font-size: 9px; font-weight: 700; letter-spacing: .4px; opacity: .85; }
.pf-pill span { font-size: 11px; font-weight: 600; }
.pf-pill.g-good { --c: var(--success); } .pf-pill.g-watch { --c: var(--warning); } .pf-pill.g-bad { --c: var(--error); }
.pf-pill.is-faded { background: color-mix(in srgb, var(--c) 8%, transparent); border: .8px solid color-mix(in srgb, var(--c) 35%, transparent); color: color-mix(in srgb, var(--c) 70%, transparent); }

/* ── plot area ── */
.pf-plot { flex: 1; min-height: 0; position: relative; }
.pf-detail, .pf-charts { position: absolute; inset: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; }
.pf-cc { flex: none; height: clamp(320px, calc(100% - 224px), 900px); }
/* Two rows of tiles under it (more than four metrics): the chart gives up a row. */
.pf-detail.is-rows2 .pf-cc { height: clamp(320px, calc(100% - 272px), 900px); }
.pf-cc-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-cc .cc-plot { flex: 1; }
/* The events list open: the card grows under the plot, which keeps the
   height it had (ChartCard with eventsBelowPlot). */
.pf-cc.has-ev { height: auto; }
.pf-cc.has-ev .cc-plot { flex: none; height: var(--pf-plot-h, 340px); }
.pf-dcard { flex: none; padding: 8px 12px 4px; }
.pf-dhead { display: flex; align-items: center; gap: 10px; padding: 0 0 8px 4px; }
.pf-dtitle { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-dcard .pf-tiles { margin-top: 0; }
.pf-obtn { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 16px; border: 1px solid var(--border); border-radius: 18px; font-size: 12.5px; font-weight: 500; color: var(--text); }
.pf-obtn:hover { background: var(--hover); }
.pf-more { margin-top: 8px; }
.pf-more-head { display: flex; align-items: center; width: 100%; min-height: 48px; padding: 0 6px; font-size: 12.5px; color: var(--primary); }
.pf-more-head > span:first-child { flex: 1; text-align: left; }
.pf-more-chev { color: var(--text-2); display: grid; transition: transform 200ms var(--ease-out-cubic); }
.pf-more-chev.is-open { transform: rotate(180deg); }
.pf-brief-card { flex: none; padding: 14px 16px; }
.pf-brief-head { display: flex; align-items: baseline; margin-bottom: 6px; }
.pf-brief-head b { flex: 1; font-size: 13px; font-weight: 600; }
.pf-brief-head span { font-size: 11px; color: var(--muted); }
.pf-brief-card p { margin: 0 0 6px; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }

/* level charts */
.pf-charts { min-height: 0; }
.pf-charts > * { flex: none; }
.pf-summary { display: flex; gap: 28px; padding: 16px 20px; }
.pf-summary-text { flex: 1; min-width: 0; }
.pf-summary-text .pf-flabel { display: block; margin-bottom: 8px; }
.pf-summary-text p { margin: 0 0 6px; font-size: 14px; line-height: 1.5; color: var(--text); }
.pf-summary-text small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.pf-where { width: 340px; flex: none; }
.pf-where .pf-flabel { display: block; margin-bottom: 6px; }
.pf-where-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 4px; border-radius: 6px; text-align: left; }
.pf-where-row:hover { background: var(--hover); }
.pf-where-name { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-where-share { width: 44px; text-align: right; font-size: 12px; color: var(--text-2); }
.pf-chart-row { flex: 1 0 auto !important; min-height: 260px; display: flex; gap: 12px; }
.pf-charts { justify-content: flex-start; }
.pf-chart { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pf-chart-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px 6px; }
.pf-chart-head span { flex: 1; font-size: 12.5px; font-weight: 500; }
.pf-chart-head small { font-size: 11.5px; color: var(--muted); }
.pf-svg { position: relative; flex: 1; min-height: 120px; margin: 0 12px; }
.pf-svg-hist { margin: 0 10px 14px; }
.pf-svg-empty { flex: 1; display: grid; place-items: center; font-size: 11.5px; color: var(--muted); }
.pf-svgc { position: absolute; inset: 0; overflow: visible; }
.pf-ax { font-size: 10.5px; fill: var(--muted); }
.pf-grid { stroke: var(--border); stroke-width: 1; }
.pf-guide { stroke: color-mix(in srgb, var(--muted) 50%, transparent); stroke-width: 1; }
.pf-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: pf-draw 850ms var(--ease-out-cubic) forwards; }
@keyframes pf-draw { to { stroke-dashoffset: 0; } }
.pf-dot { opacity: 0; animation: pf-fade 200ms linear forwards; }
@keyframes pf-fade { to { opacity: 1; } }
.pf-bar { fill: var(--text-2); fill-opacity: .45; transform-box: fill-box; transform-origin: bottom; transform: scaleY(0); animation: pf-grow 700ms var(--ease-out-cubic) forwards; }
.pf-bar.is-hover { fill-opacity: .8; }
@keyframes pf-grow { to { transform: scaleY(1); } }
.pf-legend { display: flex; gap: 16px; padding: 4px 18px 12px; font-size: 11.5px; color: var(--text-2); }
.pf-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pf-lg { width: 16px; height: 2px; background: var(--primary); }
.pf-lg.is-real { background: #8E24AA; }
.pf-lg.is-ref { height: 0; background: none; border-top: 1.5px dashed var(--muted); }
.pf-tip { position: absolute; z-index: 5; pointer-events: none; padding: 7px 10px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 3px 10px rgba(0, 0, 0, .14); white-space: nowrap; }
.pf-tip div { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12px; font-weight: 500; color: var(--text); }
.pf-tip div.pf-tip-h { margin-top: 0; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.pf-tip i { width: 8px; height: 8px; border-radius: 50%; }

/* ── series list ── */
.pf-list { flex: none; width: 400px; display: flex; flex-direction: column; overflow: hidden; transition: width 280ms var(--ease-out-cubic); }
.pf-list.is-collapsed { width: 48px !important; }
.pf-list-in { width: 400px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pf-rail { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 12px; height: 100%; color: var(--text-2); font-size: 12px; }
.pf-rail:hover { background: var(--hover); }
.pf-rail span { writing-mode: vertical-rl; transform: rotate(180deg); }
.pf-search { display: flex; align-items: center; gap: 4px; padding: 12px 4px 4px 12px; }
.pf-q { flex: 1; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-light); color: var(--muted); }
.pf-q:focus-within { border-color: var(--primary); }
.pf-q input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 13px; color: var(--text); }
.pf-q input::placeholder { color: var(--muted); font-style: italic; }
.pf-ib { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--text-2); flex: none; }
.pf-ib:hover { background: var(--hover); }
.pf-ib[disabled] { color: var(--muted); opacity: .4; pointer-events: none; }
/* _Freshness: "Ventas cerradas hasta …" + ⟳, in the card's title row (Real only). */
.pf-fresh { display: inline-flex; align-items: center; gap: 10px; max-width: 300px; min-width: 0; margin-right: 16px; }
.pf-fresh .pf-muted { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-fresh .pf-ib { width: 32px; height: 32px; }
/* Período actual: what it could not measure (series of channels gone from the sales). */
.pf-note { margin: 6px 0 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
.pf-lhdr { display: flex; align-items: center; gap: 0; padding: 8px 14px 6px; border-bottom: 1px solid var(--border); font-size: 11.5px; font-weight: 500; color: var(--text-2); }
.pf-sort { display: inline-flex; align-items: center; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.pf-sort.is-on { color: var(--text); }
.pf-sort.pf-share { width: 50px; justify-content: flex-end; }
.pf-rows { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.pf-row { display: flex; align-items: center; gap: 0; width: 100%; padding: 10px 14px 10px 12px; border-left: 2px solid transparent; border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent); text-align: left; animation: pf-row 260ms var(--ease-out-cubic) both; animation-delay: calc(min(var(--i) * 18ms, 300ms)); }
@keyframes pf-row { from { opacity: 0; transform: translateY(6px); } }
.pf-row.pf-still { animation: none; }
.pf-row:hover { background: var(--hover); }
.pf-row.is-sel { background: var(--selected); border-left-color: var(--text); }
.pf-row-name { flex: 1; min-width: 0; margin-right: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-row.is-sel .pf-row-name { color: var(--text); font-weight: 600; }
/* A picked series, before its column arrives (performance.js): the chart
   and the series' figures show their shimmer, so nothing of the previous
   series sits under the new name; the level's charts only dim. */
.pf-picking .cc-shimmer { display: flex !important; }
.pf-picking .cc-canvas, .pf-picking .cc-alert, .pf-picking .pf-dcard .pf-muted { visibility: hidden; }
.pf-picking .pf-dcard .pf-tile { background: linear-gradient(100deg, var(--shimmer-base) 0%, var(--shimmer-base) 35%, var(--shimmer-hi) 50%, var(--shimmer-base) 65%, var(--shimmer-base) 100%); background-size: 300vw 100%; background-attachment: fixed; animation: shimmer 1.5s linear infinite; border-color: transparent; }
.pf-picking .pf-dcard .pf-tile > * { visibility: hidden; }
.pf-picking .pf-charts, .pf-picking .pf-strip { opacity: .45; transition: opacity 120ms linear; }
.pf-row .pf-pill + .pf-pill { margin-left: 4px; }
.pf-row .pf-share { width: 50px; flex: none; text-align: right; font-size: 12px; color: var(--text-2); }
.pf-list-empty { margin: 0; padding: 14px; font-size: 12px; color: var(--muted); }
.pf-lfoot { flex: none; border-top: 1px solid var(--border); padding-top: 4px; }
.pf-fline { margin: 0; padding: 2px 14px 4px; font-size: 11.5px; color: var(--muted); }
.pf-fline u { cursor: help; }
.pf-checks { display: flex; flex-wrap: wrap; padding: 0 4px; }
.pf-check { display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px; border-radius: 6px; font-size: 12px; color: var(--text-2); }
.pf-check .pf-cb { width: 28px; height: 28px; place-items: center; margin: 0; }
.pf-check:hover { background: var(--hover); }
.pf-pager { display: flex; align-items: center; padding: 0 14px 4px 4px; font-size: 11.5px; color: var(--muted); }
.pf-pager .pf-ib { width: 32px; height: 32px; }
.pf-range { margin-left: 6px; flex: 1; }

/* ── all levels ── */
.pf-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.pf-all-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px 10px; }
.pf-all-head .pf-title { flex: 1; }
.pf-all-row { display: flex; align-items: center; width: 100%; padding: 10px 18px; border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent); text-align: left; }
button.pf-all-row:hover { background: var(--hover); }
.pf-all-cols { padding: 8px 18px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 11.5px; font-weight: 500; color: var(--text-2); }
.pf-c-name { flex: 3; min-width: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.pf-all-cols .pf-c-name { font-size: 11.5px; }
.pf-c-name b { font-weight: 500; }
.pf-c-name .ic { color: var(--text-2); }
.pf-c-name small, .pf-c-dist small { font-size: 11px; color: var(--muted); }
.pf-c-n { width: 70px; text-align: right; font-size: 12.5px; color: var(--muted); }
.pf-all-cols .pf-c-n, .pf-all-cols .pf-c-m { font-size: 11.5px; color: var(--text-2); }
.pf-c-m { width: 110px; display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; }
.pf-c-u { font-size: 10.5px; font-weight: 500; }
.pf-c-dist { flex: 3; margin-left: 18px; min-width: 0; }
.pf-spark { display: block; width: 100%; height: 30px; }
.pf-spark rect { fill: var(--text-2); fill-opacity: .45; }
.pf-spark .pf-base { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }

/* ── empty states ── */
.pf-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 32px; color: var(--muted); text-align: center; }
.pf-center p { margin: 0; max-width: 440px; font-size: 13px; }
.pf-center .pf-empty-text { color: var(--text-2); max-width: none; }
.pf-center .pf-empty-why { color: var(--muted); font-size: 12.5px; max-width: 640px; text-align: center; margin: 0; }

/* ── forecast picker (showArtifactPicker) ── */
.pf-pk { position: fixed; z-index: calc(var(--z-drawer) + 1); top: 0; right: 0; bottom: 0; width: 360px; height: calc(100dvh / var(--zoom)); background: var(--card); border-left: 1px solid var(--border); box-shadow: -4px 0 16px rgba(0, 0, 0, .3); display: flex; flex-direction: column; }
.pf-pk-scrim { background: transparent; }
.pf-sw { display: grid; }
.pf-pk-head { display: flex; align-items: center; gap: 8px; padding: 16px 8px 12px 16px; color: var(--muted); }
.pf-pk-head > span { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: .1px; }
.pf-pk-x { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.pf-pk-x:hover { background: var(--hover); }
.pf-pk-search { margin: 0 16px; height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-light); color: var(--muted); }
.pf-pk-search:focus-within { border-color: var(--primary); }
.pf-pk-search input { flex: 1; border: 0; outline: 0; background: none; font-size: 12px; color: var(--text); }
.pf-pk-chips { display: flex; gap: 6px; padding: 8px 16px; border-bottom: 1px solid var(--border); }
.pf-pk-chips button { padding: 4px 10px; border-radius: 12px; border: 1px solid var(--border); font-size: 11px; color: var(--muted); }
.pf-pk-chips button.is-on { background: rgba(var(--tint-rgb), .1); border-color: rgba(var(--tint-rgb), .25); color: var(--text); font-weight: 600; }
.pf-pk-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 12px; }
.pf-pk-item { display: flex; flex-direction: column; gap: 3px; width: 100%; margin-bottom: 8px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); text-align: left; cursor: pointer; }
.pf-pk-item:hover { background-image: linear-gradient(var(--hover), var(--hover)); }
.pf-pk-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.pf-pk-item.is-on { border-color: color-mix(in srgb, var(--primary) 50%, transparent); }
.pf-pk-top { display: flex; align-items: center; gap: 8px; }
.pf-pk-title { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-pk-badge { flex: none; font-size: 10px; font-weight: 600; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); padding: 2px 7px; border-radius: 10px; }
.pf-pk-date { flex: none; font-size: 10px; color: var(--muted); }
.pf-pk-last { flex: none; font-size: 10px; font-weight: 500; color: var(--text-2); background: var(--hover); padding: 2px 7px; border-radius: 10px; }
.pf-pk-sub { font-size: 11px; color: var(--muted); }
.pf-pk-desc { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-pk-id { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.pf-pk-id code { font: 10.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.pf-pk-copy { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); }
.pf-pk-copy:hover { background: var(--hover); color: var(--text); }
.pf-pk-embed { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pf-pk-sk { display: flex; flex-direction: column; gap: 4px; }
.pf-pk-skrow { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.pf-pk-skrow .sk { height: 10px; }
.pf-pk-empty { text-align: center; font-size: 12px; color: var(--muted); }
.pf-toast { position: fixed; z-index: var(--z-toast); left: 50%; bottom: 28px; transform: translateX(-50%); padding: 10px 16px; border-radius: 8px; background: var(--tooltip-bg); color: #fff; font-size: 13px; }

/* ── run diagnostics (_diag.html): composition, reconciliation, stability ──
   Under the all-levels table. Material 3 body text: bodyMedium's 1.43 line height. */
.pf-sc { box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.pf-diag { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; line-height: 1.43; }
.pf-dg { padding: 14px 16px; }
.pf-dg-head { display: flex; align-items: center; gap: 6px; min-height: 24px; color: var(--muted); }
.pf-dg-head > b { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.pf-dg-head > small { margin-left: 2px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.pf-sa { flex: none; font-size: 9.5px; font-weight: 500; color: var(--text-2); background: rgba(106, 106, 106, .18); padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.pf-dg-ic { display: grid; color: var(--muted); flex: none; }
.pf-dg-ic.is-sec { color: var(--secondary); margin-right: 2px; }
.pf-dg-ic.is-text2 { color: var(--text-2); margin-right: 2px; }
.pf-dg-lead { margin: 4px 0 0; font-size: 11px; color: var(--text-2); }
.pf-comp-policy { display: flex; align-items: center; gap: 5px; margin: 6px 0 0; font-size: 11px; font-weight: 600; color: var(--text-2); }
.pf-comp-policy .ic { color: var(--muted); }
.pf-comp-sub { margin: 12px 0 6px; font-size: 11px; font-weight: 600; color: var(--text-2); }
.pf-comp .pf-dg-lead + .pf-chips, .pf-comp-policy + .pf-chips { margin-top: 12px; }
.pf-chips { display: grid; grid-auto-flow: column; grid-template-rows: repeat(3, auto); justify-content: start; justify-items: start; gap: 4px 6px; overflow-x: auto; scrollbar-width: none; }
.pf-chip { --mc: #66BB6A; display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 4px; background: color-mix(in srgb, var(--mc) 15%, transparent); font-size: 10px; font-weight: 500; color: var(--text); white-space: nowrap; }
.pf-chip i { width: 7px; height: 7px; border-radius: 2px; background: var(--mc); }
.pf-chip small { font-size: 10px; font-weight: 400; color: var(--muted); }
.pf-recon .pf-dg-head { gap: 8px; }
.pf-recon-applied { display: flex; align-items: center; gap: 4px; margin: 6px 0 0; color: var(--secondary); }
.pf-recon-applied small { font-size: 11px; color: var(--muted); }
.pf-recon-applied b { font-size: 12px; font-weight: 600; color: var(--text); }
.pf-recon-note { margin: 4px 0 12px; font-size: 11px; font-style: italic; color: var(--muted); }
.pf-recon-note.is-empty { margin: 8px 0; }
.pf-recon-row { display: flex; align-items: center; padding: 5px 0; }
.pf-recon-lv { width: 90px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.pf-recon-vs { font-size: 11px; color: var(--muted); }
.pf-recon-dash { font-size: 11px; color: var(--muted); }
.pf-dchip { --c: var(--success); display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 10px; background: color-mix(in srgb, var(--c) 12%, transparent); border: .8px solid color-mix(in srgb, var(--c) 45%, transparent); color: var(--c); font-size: 10px; font-weight: 600; }
.pf-dchip.g-bad { --c: var(--error); }
.pf-stab .pf-dg-head { gap: 8px; align-items: center; }
.pf-stab-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pf-stab-t b { font-size: 14px; font-weight: 600; color: var(--text); }
.pf-stab-t small { font-size: 11px; color: var(--muted); }
.pf-stab-na { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 14px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.pf-stab-na > span:first-child { display: grid; }
.pf-stab-blocks { display: grid; grid-template-columns: 1fr 1fr; margin-top: 14px; }
.pf-stab-blocks > div { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.pf-stab-blocks small { font-size: 11px; color: var(--muted); }
.pf-stab-blocks small.pf-stab-hint { font-size: 10px; margin-top: -2px; }
.pf-stab-fig { display: flex; align-items: baseline; gap: 8px; }
.pf-stab-fig b { font-size: 26px; font-weight: 700; }
.pf-stab-fig span { font-size: 11px; font-weight: 600; }
.pf-stab-h { margin: 18px 0 2px; font-size: 11px; font-weight: 600; color: var(--text-2); }
.pf-stab-h.is-tr { margin: 16px 0 6px; }
.pf-stab-hh { margin: 0 0 8px; font-size: 10px; color: var(--muted); }
.pf-stab-tr { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-stab-tr span { padding: 4px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--border); font-size: 11px; color: var(--text-2); }
.pf-stab-foot { margin: 14px 0 0; font-size: 10px; color: var(--muted); }

/* a bar with its label and value (StabilityCard) */
.pf-hbar { display: flex; align-items: center; margin-bottom: 6px; font-size: 11px; }
.pf-hbar-l { flex: none; color: var(--text-2); }
.pf-hbar-t { flex: 1; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.pf-hbar-t i { display: block; height: 100%; }
.pf-hbar-v { flex: none; margin-left: 10px; text-align: right; font-weight: 600; color: var(--text-2); }
.tone-good { background: var(--success); } .tone-watch { background: var(--warning); } .tone-bad { background: var(--error); } .tone-muted { background: var(--muted); }

/* A level, column or view change on its way (performance.js): the old body
   stays laid out but hidden, the skeleton sits over it. */
.pf-body.pf-reloading { position: relative; }
.pf-body.pf-reloading > :not(.pf-skel-ov) { visibility: hidden; }
.pf-skel-ov { position: absolute; inset: 0; padding: inherit; display: flex; flex-direction: column; }

/* ── Resumen (summary.py, _summary.html) ── */
.pf-sm { display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; }
.pf-sm-head { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-height: 36px; }
.pf-sm-head .pf-fresh { margin-right: 0; }
/* The tab fills the screen's height: the day-by-day chart takes what the
   cards and tables leave, never under its minimum (Lucas, 2026-11-04: "al
   pedo el whitespace"); on a short screen the tab scrolls instead.
   The chart's two colours are the theme's tokens: the sales in the app's
   primary blue, the plan in its green (Lucas, 2026-11-04: no violet, it is
   not an app colour). */
.pf-sm { --pf-real: var(--primary); --pf-plan: var(--secondary); }
.pf-sm-kpis { flex: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
/* Every card's rows line up with its neighbours' (head, number, figures,
   bar), so the numbers and the bars sit at the same height in all four. */
.pf-sm-kpi { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 12px; align-content: start; padding: 14px 16px 16px; }
.pf-sm-khead { display: flex; align-items: center; gap: 6px; min-height: 18px; }
.pf-sm-khead .pf-flabel { white-space: nowrap; }
.pf-sm-info { display: inline-flex; color: var(--muted); cursor: help; border-radius: 50%; }
.pf-sm-info:hover, .pf-sm-info:focus-visible { color: var(--text-2); }
.pf-sm-kdate { margin-left: auto; font-size: 12px; white-space: nowrap; }
.pf-sm-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; align-self: end; }
.pf-sm-stats > span { display: flex; flex-direction: column; gap: 2px; }
.pf-sm-stats .pf-flabel { font-size: 10.5px; }
.pf-sm-stats b { font-size: 14px; font-weight: 500; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pf-sm-stats b.g-good { color: var(--success); } .pf-sm-stats b.g-watch { color: var(--warning); } .pf-sm-stats b.g-bad { color: var(--error); }
.pf-sm-big { display: flex; align-items: baseline; gap: 10px; margin-top: 2px; }
.pf-sm-big b { font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: -1px; }
.pf-sm-track { position: relative; height: 8px; border-radius: 4px; background: var(--surface-light); overflow: hidden; }
.pf-sm-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.pf-sm-kpi > .pf-sm-track { align-self: end; margin-top: 4px; }
.pf-sm-line { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--text-2); }
.pf-sm-empty { color: var(--muted); }
.pf-sm-pair { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; min-height: 6px; font-size: 13px; }
.pf-sm-kfoot { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; align-self: end; padding-top: 8px; border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent); font-size: 12.5px; }
.pf-sm-lower { flex: none; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; align-items: stretch; }
.pf-sm-pins, .pf-sm-levels { padding: 12px 0 6px; min-width: 0; }
.pf-sm-thead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 0 16px 8px; min-height: 36px; }
.pf-sm-tscroll { overflow-x: auto; }
.pf-sm-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pf-sm-table th { padding: 8px 12px; font-size: 11px; font-weight: 500; color: var(--muted); text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); }
.pf-sm-table td { padding: 6px 12px; white-space: nowrap; border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
.pf-sm-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.pf-sm-table tr.is-sel td { background: var(--selected); }
.pf-sm-table tr.is-dim td { color: var(--text-2); }
.pf-sm-table td small { display: block; font-size: 11px; }
.pf-sm-star { width: 40px; padding: 2px 0 2px 8px !important; }
.pf-sm-star .pf-star { margin-left: 0; }
.pf-sm-star .pf-star.is-pin { color: var(--text-2); }
.pf-sm-name { display: block; padding: 2px 0; font-weight: 500; text-align: left; color: var(--text); }
.pf-sm-name:hover { text-decoration: underline; }
.pf-sm-sep td { padding: 14px 16px 4px; border-bottom: 0; }
.pf-sm-tfoot { display: flex; justify-content: flex-end; padding: 10px 16px 6px; }
.pf-sm-tick { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--text); }
.pf-sm-track:has(.pf-sm-tick) { overflow: visible; }
.pf-sm-track .pf-sm-tick { top: -3px; bottom: -3px; border-radius: 1px; }
.pf-sm-wk { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.pf-sm-mini { display: inline-block; width: 90px; flex: none; }
/* the day-by-day chart: a bar per day, the day's plan as a mark */
.pf-sm-chart { flex: 1 0 auto; min-height: 320px; display: flex; flex-direction: column; padding: 12px 0 8px; }
.pf-sm-chart-sk { flex: 1; margin: 0 16px 12px; min-height: 200px; }
.pf-sm-lg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.pf-sm-lg i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
.pf-sm-lg-real { background: var(--pf-real); }
.pf-sm-lg-plan { height: 2px !important; width: 14px !important; background: var(--pf-plan); }
.pf-sm-lg-left { border: 1.5px dashed var(--pf-plan); box-sizing: border-box; }
.pf-sm-plot { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 18px 16px 0 60px; }
.pf-sm-barbox { position: relative; flex: 1; min-height: 200px; display: flex; }
.pf-sm-axis { position: absolute; left: -48px; top: 0; bottom: 0; width: 40px; }
.pf-sm-axis span { position: absolute; right: 0; transform: translateY(-50%); font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pf-sm-bars { flex: 1; display: grid; grid-template-columns: repeat(var(--n, 21), minmax(0, 1fr)); border-bottom: 1px solid var(--border); background: linear-gradient(to bottom, color-mix(in srgb, var(--border) 50%, transparent) 1px, transparent 1px) 0 0 / 100% 50%; }
.pf-sm-day { position: relative; height: 100%; }
.pf-sm-day.is-wk { border-left: 1px solid var(--border); }
.pf-sm-real, .pf-sm-left { position: absolute; left: 18%; right: 18%; bottom: 0; border-radius: 3px 3px 0 0; }
.pf-sm-real { background: var(--pf-real); }
.pf-sm-left { border: 1.5px dashed var(--pf-plan); border-bottom: 0; background: color-mix(in srgb, var(--pf-plan) 8%, transparent); }
.pf-sm-plan { position: absolute; left: 10%; right: 10%; height: 2px; margin-bottom: -1px; background: var(--pf-plan); border-radius: 1px; }
.pf-sm-today { position: absolute; top: -16px; bottom: 0; left: -1px; border-left: 1.5px dotted var(--text-2); }
.pf-sm-today span { position: absolute; top: 0; left: 4px; white-space: nowrap; font-size: 10.5px; font-style: normal; color: var(--text-2); }
.pf-sm-days { flex: none; display: grid; grid-template-columns: repeat(var(--n, 21), minmax(0, 1fr)); margin-top: 4px; }
.pf-sm-days span { text-align: center; font-size: 10.5px; color: var(--muted); }
.pf-sm-weeks { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 6px; }
.pf-sm-weeks > span { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px; border-left: 1px solid var(--border); font-size: 12px; color: var(--text); }
.pf-sm-weeks small, .pf-sm-wklabels small { font-size: 11.5px; color: var(--text-2); }
.pf-sm-by { margin-left: 6px; }
.pf-sm-by button { padding: 5px 10px; }
.pf-sm-wkcol .pf-sm-real, .pf-sm-wkcol .pf-sm-left { left: 22%; right: 22%; }
.pf-sm-wkcol.is-next .pf-sm-left { background: transparent; }
.pf-sm-wklabels { flex: none; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); margin-top: 6px; }
.pf-sm-wklabels > span { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11.5px; color: var(--text); text-align: center; }
.pf-sm-wklabels b { font-weight: 500; }
.pf-sm-note { padding: 4px 16px 4px; }
.pf-sm-plot .pf-sm-note { padding: 10px 0 2px; }
.pf-sm-pad { padding: 0 16px 8px; }
@media (max-width: 1280px) { .pf-sm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .pf-sm-lower { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 767.98px) { .pf-sm-kpis { grid-template-columns: minmax(0, 1fr); } .pf-sm-star .pf-star { width: 44px; height: 44px; } .pf-sm-plot { margin-left: 48px; } .pf-sm-weeks span { font-size: 10.5px; } .pf-sm-wklabels > span { font-size: 9.5px; } .pf-sm-wklabels small { display: none; } .pf-sm-thead .pf-sm-lg { display: none; } }
