/* Pivot Analysis page. Everything is scoped under .pv so the kiosk's big touch-sized inputs do not leak in. */
.pv h2 { margin-bottom: 4px; }
.pv input, .pv select, .pv button { padding: 8px 10px; font-size: 13px; border-radius: 10px; }
.pv button { width: auto; }
.pv label { font-size: 12px; margin: 10px 0 4px; }
.pv .pv-tabs, .pv .pv-presets, .pv .pv-viewbar, .pv .pv-quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pv .pv-tabs { margin: 12px 0 8px; }
.pv .pv-tabs button.active, .pv .pv-presets button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pv .pv-presets button { font-weight: 600; border-radius: 999px; padding: 6px 12px; }
.pv .pv-viewbar select { min-width: 200px; width: auto; }
.pv .pv-viewbar label { margin: 0; display: inline-flex; align-items: center; font-weight: 600; }
.pv .pv-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.pv .pv-config { position: sticky; top: 8px; max-height: calc(100vh - 16px); overflow: auto; margin-bottom: 0; }
.pv .pv-config h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 0 4px; }
.pv .pv-config h3:first-child { margin-top: 0; }
.pv .pv-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pv .pv-stack { display: grid; gap: 6px; }
.pv .pv-checks label { display: flex; align-items: center; margin: 2px 0; font-weight: 600; }
.pv .pv-checks input { margin-right: 8px; }
.pv .pv-quick button { padding: 4px 9px; font-size: 12px; font-weight: 600; }
.pv .pv-filter { border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin: 6px 0; background: #f8fafc; }
.pv .pv-filter-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 12px; }
.pv .pv-filter-list { max-height: 150px; overflow: auto; margin-top: 6px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }
.pv .pv-filter-list label { display: flex; align-items: center; margin: 3px 0; font-weight: 500; }
.pv .pv-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.pv .pv-kpi { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; }
.pv .pv-kpi span { display: block; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pv .pv-kpi strong { display: block; font-size: 22px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.pv .pv-kpi.bad strong { color: var(--danger); }
.pv .pv-kpi.good strong { color: var(--primary); }
.pv .pv-scn { border: 2px solid #99f6e4; background: #f0fdfa; }
.pv .pv-scn-table { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.pv .pv-scn-table table { width: 100%; min-width: 0; }
.pv .pv-scn-table input { width: 110px; text-align: right; }
.pv .pv-result-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pv table.pv-table { width: max-content; min-width: 100%; }
.pv table.pv-table th, .pv table.pv-table td { white-space: nowrap; }
.pv table.pv-table thead th { text-align: center; }
.pv table.pv-table thead th.pv-corner { text-align: left; }
.pv table.pv-table td.pv-label { position: sticky; left: 0; background: #fff; z-index: 2; font-weight: 600; min-width: 180px; }
.pv table.pv-table td.pv-num { text-align: right; font-variant-numeric: tabular-nums; cursor: pointer; }
.pv table.pv-table td.pv-num:hover { outline: 2px solid var(--primary); outline-offset: -2px; }
.pv table.pv-table tr.pv-sub td { background: #f1f5f9; font-weight: 700; }
.pv table.pv-table tr.pv-sub td.pv-label { background: #f1f5f9; }
.pv table.pv-table tr.pv-grand td { background: #e2e8f0; font-weight: 800; border-top: 2px solid #94a3b8; }
.pv table.pv-table td.pv-total { font-weight: 700; border-left: 2px solid #cbd5e1; }
.pv .pv-caret { display: inline-block; width: 18px; cursor: pointer; color: var(--muted); user-select: none; }
.pv .pv-nil { color: #cbd5e1; }
.pv .pv-note { font-size: 12px; color: var(--muted); margin: 8px 0 0; line-height: 1.5; }
.pv .pv-warn { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 10px; padding: 8px 12px; margin: 8px 0; font-weight: 700; font-size: 13px; }
.pv-modal { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(15, 23, 42, .55); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 18px; }
.pv-modal .pv-modal-body { background: #fff; border-radius: 18px; width: min(1100px, 100%); max-height: 90vh; display: flex; flex-direction: column; padding: 18px; box-shadow: var(--shadow); }
.pv-modal .pv-modal-body .table-wrap { overflow: auto; flex: 1; }
.pv-modal button { width: auto; padding: 8px 12px; font-size: 13px; }
@media (max-width: 1000px) { .pv .pv-grid { grid-template-columns: 1fr; } .pv .pv-config { position: static; max-height: none; } }

/* phones */
@media (max-width: 700px) {
  .pv input, .pv select, .pv button { font-size: 16px; min-height: 40px; }
  .pv .pv-two { grid-template-columns: 1fr; }
  .pv .pv-kpis { grid-template-columns: repeat(2, 1fr); }
  .pv .pv-viewbar select { min-width: 0; width: 100%; }
  .pv .pv-grid { display: flex; flex-direction: column-reverse; }     /* results first, settings below */
  .pv .pv-grid > section { margin-bottom: 14px; }
  .pv .pv-presets { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .pv .pv-presets button { flex: 0 0 auto; }
  .pv-modal { padding: 8px; } .pv-modal .pv-modal-body { max-height: 94vh; padding: 12px; }
}
