/* styles of the reports screens: Relatórios, SLA, Auditoria (prefixes rp- and au-) */

/* period picker */
.rp-period{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:0 0 12px}
.rp-period .seg{flex-wrap:wrap}
.rp-custom{display:none;align-items:flex-end;gap:8px;flex-wrap:wrap;margin:0}
.rp-custom.open,.rp-custom:target{display:flex}
.rp-custom label{display:flex;flex-direction:column;gap:3px;font-size:12px;font-weight:600;color:var(--mut)}
.rp-custom input{height:34px;font-size:13px;margin:0}
.rp-custom button{height:34px}
.rp-range{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600;margin-left:auto}
.rp-range svg.i{width:15px;height:15px}

/* filters */
.rp-filters{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px 12px;margin:0 0 14px;padding:12px 14px}
.rp-fl{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;font-weight:700;color:var(--mut);align-self:center}
.rp-fl svg.i{width:15px;height:15px}
.rp-sel{display:flex;flex-direction:column;gap:3px;font-size:12px;font-weight:600;color:var(--mut);margin:0;min-width:0;flex:1 1 170px;max-width:240px}
.rp-sel select,.rp-sel .osel{width:100%;height:34px;font-size:13px;margin:0;--osel-h:34px;--osel-font-size:13px}
.rp-filters button,.rp-filters .btn{height:34px}
.rp-clear{color:var(--mut)}

/* KPI tiles */
.rp-kpis{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,210px),1fr));gap:12px;margin:0 0 14px}
.rp-kpis .kpi{min-width:0}
.rp-kpis .kpi .v{font-size:25px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rp-kpis .kpi .l{line-height:1.3}
.rp-kpis .kpi .s{flex-wrap:wrap}

/* section header right side */
.rp-right{margin-left:auto;display:inline-flex;align-items:center;gap:8px}
.rp-right .mut{font-size:13px;font-weight:600;color:var(--txt);font-variant-numeric:tabular-nums}
.sec-h h2{min-width:0}
.rp-csv{height:28px;padding:0 9px;font-size:12px}
.rp-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.rp-grid>section.card{margin-top:0;min-width:0}
@media(max-width:1000px){.rp-grid{grid-template-columns:minmax(0,1fr)}}

/* bars: one series, hover tip */
.rp-bars{position:relative}
.rp-bars.dense{gap:1px}
.rp-bars .bar{position:relative;border-radius:4px 4px 0 0}
.rp-bars .bar.zero{min-height:0;height:0}
.rp-bars .bar::after,.rp-hm i::after{content:attr(data-tip);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);white-space:nowrap;padding:4px 8px;border-radius:6px;background:var(--txt);color:var(--card);font-size:11.5px;font-weight:600;pointer-events:none;opacity:0;transition:opacity .1s;z-index:3}
.rp-bars .bar:hover::after,.rp-hm i:hover::after{opacity:1}
.rp-bars .bar:first-child::after,.rp-hm i:nth-child(25n+2)::after{left:0;transform:none}
.rp-bars .bar:last-child::after{left:auto;right:0;transform:none}
.rp-astable{margin-top:10px;font-size:13px}
.rp-astable summary{cursor:pointer;color:var(--mut);font-weight:600}
.rp-astable table{margin-top:8px}

/* heatmap: weekday × hour, one hue light→dark */
.rp-hm{display:grid;grid-template-columns:34px repeat(24,minmax(0,1fr));gap:2px;align-items:center;font-size:10.5px}
.rp-hm .hh{color:var(--mut);text-align:left;font-variant-numeric:tabular-nums;height:14px}
.rp-hm .dd{color:var(--mut);font-weight:600;text-transform:capitalize;font-size:11px}
.rp-hm i,.rp-hm-leg i{display:block;aspect-ratio:1;min-height:10px;border-radius:3px;position:relative;background:var(--hover-btn)}
.rp-hm i[data-l="1"],.rp-hm-leg i[data-l="1"]{background:color-mix(in srgb,var(--acc) 22%,var(--card))}
.rp-hm i[data-l="2"],.rp-hm-leg i[data-l="2"]{background:color-mix(in srgb,var(--acc) 45%,var(--card))}
.rp-hm i[data-l="3"],.rp-hm-leg i[data-l="3"]{background:color-mix(in srgb,var(--acc) 70%,var(--card))}
.rp-hm i[data-l="4"],.rp-hm-leg i[data-l="4"]{background:var(--acc)}
.rp-hm i:hover{outline:2px solid var(--txt);outline-offset:-1px}
.rp-hm-leg{display:flex;align-items:center;gap:4px;margin-top:12px;font-size:11.5px;color:var(--mut);flex-wrap:wrap}
.rp-hm-leg i{width:12px;min-height:12px}
.rp-hm-leg .mut{margin-left:auto}

/* tables */
.rp-who{display:inline-flex;align-items:center;gap:8px;min-width:0}
.rp-who>span:last-child{min-width:0;overflow-wrap:anywhere}
.rp-who .avatar{margin:0}
.rp-who .avatar.rp-none{background:var(--hover-btn);color:var(--mut)}
.rp-who .avatar.rp-none svg.i{width:13px;height:13px}
.rp-rate{font-weight:600}
.rp-share{display:inline-flex;align-items:center;gap:8px;width:100%;min-width:110px}
.rp-track{flex:1;height:8px;border-radius:6px;background:var(--hover-btn);overflow:hidden;min-width:50px}
.rp-track span{display:block;height:100%;width:var(--w,0);border-radius:6px;background:var(--bar)}
.rp-track span.ok{background:var(--ok)}.rp-track span.warn{background:var(--amber)}.rp-track span.bad{background:var(--bad)}
.rp-share .mut,.rp-share b{font-size:12.5px;font-variant-numeric:tabular-nums;min-width:36px;text-align:right}
.rp-tbl tr.rp-off td{opacity:.6}
.rp-tbl td .small{font-size:12px}
.rp-foot{display:flex;align-items:flex-start;gap:7px;font-size:12.5px;margin:16px 2px 4px;line-height:1.5}
.rp-foot svg.i{width:15px;height:15px;flex:none;margin-top:2px}
.rp-deny>svg.i{color:var(--warn)}
.rp-fail>svg.i{color:var(--bad)}

/* SLA */
.rp-conv{display:flex;flex-direction:column;color:var(--txt);text-decoration:none!important;min-width:0}
.rp-conv b{overflow-wrap:anywhere}
.rp-more{margin:10px 4px 4px}
.rp-good{display:flex;align-items:center;justify-content:center;gap:8px;color:var(--ok)}
.rp-inline{display:inline-flex;margin:0}
.rp-form{border-color:var(--acc-line)}
.rp-fgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,220px),1fr));gap:12px 16px;margin:0;align-items:start}
.rp-fgrid label.f{display:flex;flex-direction:column;gap:4px;font-size:12.5px;font-weight:600;color:var(--mut);margin:0;min-width:0}
.rp-fgrid label.f input,.rp-fgrid label.f select,.rp-fgrid label.f .osel{width:100%;margin:0}
.rp-fgrid label.f small{font-weight:500;font-size:11.5px}
.rp-fgrid .wide{grid-column:1/-1}
.rp-bh{align-self:center;height:auto;min-height:34px;padding:6px 12px;border-radius:12px;white-space:normal}
.rp-bh span{white-space:normal}
.rp-factions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.rp-upsell{display:flex;align-items:flex-start;gap:16px;flex-wrap:wrap;border-color:var(--acc-line);background:linear-gradient(135deg,color-mix(in srgb,var(--acc) 7%,var(--card)),var(--card) 70%)}
.rp-upsell>div{flex:1;min-width:min(100%,260px)}
.rp-upsell b{font-size:16px}
.rp-upsell p{margin:4px 0 10px}
.rp-upsell form{margin:0;align-self:center}
.rp-bul{list-style:none;margin:0;padding:0;display:grid;gap:6px;font-size:13.5px}
.rp-bul li{display:flex;gap:7px;align-items:flex-start}
.rp-bul svg.i{width:15px;height:15px;color:var(--em);flex:none;margin-top:2px}

/* Auditoria */
.au-filters .au-q{flex:2 1 260px;max-width:420px;margin:0;display:block}
.au-filters .au-q input{width:100%;height:34px;background:var(--card);border-color:var(--line)}
.au-count{font-size:12.5px;margin:0 2px 8px;font-weight:600}
.au-item{display:flex;flex-direction:column;min-width:0}
.au-item b{font-weight:600;overflow-wrap:anywhere}
.au-tbl td.mono{font-size:13px}
.au-bg{align-items:flex-start}
.au-modal{max-width:640px;padding:18px 20px;box-shadow:0 20px 50px rgba(0,0,0,.25)}
.au-mh{display:flex;align-items:center;gap:10px;margin-bottom:14px}
.au-mh h3{margin:0;font-size:17px;font-weight:700;flex:1;min-width:0;overflow-wrap:anywhere}
.au-x{width:32px;padding:0;justify-content:center;flex:none}
.au-dl{margin-bottom:14px}
.au-dl dd{overflow-wrap:anywhere}
.au-jh{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:700;color:var(--mut);margin-bottom:6px;text-transform:uppercase;letter-spacing:.4px}
.au-jh svg.i{width:14px;height:14px}
.au-json{margin:0;max-height:min(50vh,420px);overflow:auto;padding:12px 14px;border-radius:10px;border:1px solid var(--line);background:var(--bg);font:12.5px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--txt)}

@media(max-width:640px){
  .rp-range{margin-left:0;width:100%}
  .rp-sel{max-width:none;flex-basis:100%}
  .au-filters .au-q{max-width:none;flex-basis:100%}
  .rp-filters button,.rp-filters .btn{flex:1;justify-content:center}
  .rp-hm{grid-template-columns:28px repeat(24,minmax(0,1fr));gap:1px}
  .rp-hm .hh{font-size:9px}
  .rp-share{min-width:0}
  .rp-hm-leg .mut{margin-left:0;width:100%}
}

/* every column of these tables matters: undo the contacts list's "hide columns 3 and 5" on narrow screens */
@media(max-width:820px){table.rp-tbl th:nth-child(3),table.rp-tbl td:nth-child(3),table.rp-tbl th:nth-child(5),table.rp-tbl td:nth-child(5){display:table-cell}}
@media(max-width:640px){table.rp-tbl.stk td:nth-child(3),table.rp-tbl.stk td:nth-child(5){display:flex}table.rp-tbl.stk th{display:none}}
@media(max-width:640px){
  .rp-kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .rp-kpis .kpi{padding:12px 12px}
  .rp-kpis .kpi .chip{width:26px;height:26px}
  .rp-kpis .kpi .kh{gap:7px;align-items:flex-start}
  .rp-kpis .kpi .l{font-size:11px}
  .rp-kpis .kpi .v{font-size:21px;margin-top:6px}
  .rp-kpis .kpi .s{font-size:11px}
  .rp-period .seg a{padding:5px 10px}
}
/* audit trail: before → after table, include-reads toggle (2026-11-10) */
.au-filters .au-reads{display:flex;align-items:center;gap:6px;font-size:13px;white-space:nowrap}
.au-diffw{max-height:min(40vh,360px);overflow:auto;margin-bottom:14px;border:1px solid var(--line);border-radius:10px}
.au-diff{margin:0;font-size:12.5px}
.au-diff td{vertical-align:top;overflow-wrap:anywhere}
.au-diff td.au-from{color:var(--mut);text-decoration:line-through;text-decoration-color:color-mix(in srgb,var(--mut) 40%,transparent)}
.au-diff td.au-to{font-weight:600}
.au-note{display:flex;align-items:center;gap:6px;margin:10px 0 0}
.au-note svg.i{width:14px;height:14px;flex:none}
