/* attendance: Relatórios de atendimento (#/atendimento). Cores dos gráficos: série 1 azul (--s1), 2 laranja (--s2), 3 verde-água;
   escala de uma cor só (azul) para mapa de calor e notas, com passos próprios no tema escuro; vermelho só para "sem resposta". */
.att {
  --att-h0: var(--hover);
  --att-h1: #cde2fb; --att-h2: #9ec5f4; --att-h3: #6da7ec; --att-h4: #3987e5; --att-h5: #256abf; --att-h6: #184f95;
  --att-i1: #0b0b0b; --att-i2: #0b0b0b; --att-i3: #0b0b0b; --att-i4: #0b0b0b; --att-i5: #ffffff; --att-i6: #ffffff;
  --att-s3: #1baf7a; --att-crit: #d03b3b;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .att {
    --att-h1: #133766; --att-h2: #184f95; --att-h3: #1c5cab; --att-h4: #2a78d6; --att-h5: #5598e7; --att-h6: #9ec5f4;
    --att-i1: #ffffff; --att-i2: #ffffff; --att-i3: #ffffff; --att-i4: #ffffff; --att-i5: #0b0b0b; --att-i6: #0b0b0b; --att-s3: #199e70;
  }
}
:root[data-theme="dark"] .att {
  --att-h1: #133766; --att-h2: #184f95; --att-h3: #1c5cab; --att-h4: #2a78d6; --att-h5: #5598e7; --att-h6: #9ec5f4;
  --att-i1: #ffffff; --att-i2: #ffffff; --att-i3: #ffffff; --att-i4: #ffffff; --att-i5: #0b0b0b; --att-i6: #0b0b0b; --att-s3: #199e70;
}

/* filtros e abas */
.att-bar { gap: 10px 14px; align-items: flex-end; }
.att-f { display: inline-flex; flex-direction: column; gap: 3px; }
.att-f > span { font-size: 11px; font-weight: 600; color: var(--muted); }
.att-f select, .att-f input { width: auto; height: 32px; }
.att-chk { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--text2); height: 32px; cursor: pointer; }
.att-chk input { width: auto; height: auto; }
.att-off { opacity: .5; }
.att-tabs { background: var(--bg2); padding: 0 18px; scrollbar-width: thin; }
.att-tabs button svg.i { width: 15px; height: 15px; }

/* corpo: ao recarregar, o desenho anterior fica mais claro (sem piscar) */
.att { transition: opacity .15s; }
.att.busy { opacity: .55; pointer-events: none; }
.att-head { margin: -4px 0 12px; line-height: 1.6; }
.att-head b { color: var(--text2); }
.att-g { margin-top: 14px; align-items: start; }
.att-card { margin-top: 14px; min-width: 0; }
.att-g > .att-card { margin-top: 0; }
.att-ch { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.att-ch h3 { margin: 0; }
.att-mini .att-ch { margin-bottom: 4px; }
.att-i { display: inline-flex; color: var(--faint); cursor: help; border-radius: 50%; }
.att-i:hover, .att-i:focus-visible { color: var(--text2); outline: none; }
.att-i svg.i { width: 14px; height: 14px; }
.att-kpis { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.att-kpis .kpi .v { font-variant-numeric: normal; }
.att-dw { font-family: var(--font); font-size: 12px; font-weight: 700; vertical-align: middle; letter-spacing: 0; }
.att-d { font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.att-d.up { color: var(--green); } .att-d.down { color: var(--red2); }
.att-empty { padding: 8px 0; }
.att-h4 { font-size: 12px; color: var(--muted); font-weight: 700; margin: 16px 0 10px; }
.att-hint { margin-top: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* aviso das conversas esperando agora */
.att-wait { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--r2); margin-bottom: 14px; font-size: 13px; border: 1px solid var(--line); background: var(--panel); }
.att-wait.amber { background: var(--amber-bg); border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.att-wait.red { background: var(--red-bg); border-color: var(--red-line); }
.att-wait.ok { color: var(--muted); }
.att-wait.ok svg.i { color: var(--green); }
.att-wait.amber > svg.i { color: var(--amber); } .att-wait.red > svg.i { color: var(--red2); }
.att-pills { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

/* gráficos */
.att-svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.att-col { fill: var(--s1); }
.att-ln { stroke: var(--s1); }
.att-dot { fill: var(--s1); stroke: var(--panel); stroke-width: 2; }
.att-svg rect[data-tip]:focus { outline: none; }
.att-svg rect[data-tip]:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.att .bar:focus-visible, .att .sb:focus-visible, .att .hc:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.att .bar { cursor: default; }
.att .bar:hover .fl { filter: brightness(1.08); }
.att-tv { margin-top: 8px; }
.att-tv summary, .att-defs summary { cursor: pointer; color: var(--muted); }

/* barra dividida em partes */
.att-seg { display: flex; gap: 2px; height: 28px; margin: 6px 0 12px; }
.att-seg .sb { border-radius: 4px; display: flex; align-items: center; padding: 0 6px; font-size: 12px; font-weight: 700; color: #ffffff; min-width: 4px; white-space: nowrap; }
.att-seg .sb:hover { filter: brightness(1.08); }
.att .c1 { background: var(--s1); } .att .c2 { background: var(--s2); } .att .c3 { background: var(--att-s3); }
.att .cbad { background: var(--att-crit); } .att .cwait { background: var(--line2); }
.att-seg .cwait { color: var(--text); }
.att-leg { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--text2); }
.att-leg > span { display: inline-flex; align-items: center; gap: 5px; }
.att-leg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.att-leg svg.i { width: 13px; height: 13px; color: var(--att-crit); }

/* mapa de calor (dia da semana × hora) */
.att-heatw { overflow-x: auto; padding-bottom: 4px; }
.att-heat { display: grid; grid-template-columns: 34px repeat(24, minmax(15px, 1fr)); gap: 2px; min-width: 470px; }
.att-heat .hh { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: visible; }
.att-heat .hd { font-size: 11px; color: var(--muted); align-self: center; font-weight: 600; }
.att .hc { height: 22px; border-radius: 3px; background: var(--att-h0); }
.att .hc.hn { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.att .hc.biz { box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--text) 22%, transparent); }
.att .hc.hn.biz { box-shadow: inset 0 0 0 1px var(--line), inset 0 -2px 0 color-mix(in srgb, var(--text) 22%, transparent); }
.att .h1 { background: var(--att-h1); } .att .h2 { background: var(--att-h2); } .att .h3 { background: var(--att-h3); }
.att .h4 { background: var(--att-h4); } .att .h5 { background: var(--att-h5); } .att .h6 { background: var(--att-h6); }
.att .hc.h0 { background: var(--att-h0); }
.att-scale { display: flex; align-items: center; gap: 4px; margin-top: 10px; flex-wrap: wrap; }
.att-scale > i { width: 18px; height: 10px; border-radius: 2px; display: inline-block; }
.att-bizk { margin-left: 14px; display: inline-flex; align-items: center; gap: 6px; }
.att-scale-top { margin: -4px 0 12px; }
.att-bizk .hc { width: 18px; height: 14px; display: inline-block; }

/* tabelas largas: rolam dentro do cartão, com a 1ª coluna fixa */
.att-tblw { overflow-x: auto; margin: 0 -18px -18px; border-top: 1px solid var(--line); }
.att-tbl th, .att-tbl td { white-space: nowrap; }
.att-tbl th:first-child, .att-tbl td:first-child { position: sticky; left: 0; background: var(--panel); z-index: 1; padding-left: 18px; }
.att-tbl thead th:first-child { z-index: 2; }
.att-tbl tfoot td:first-child { background: var(--panel2); }
.att-tbl td.red { color: var(--red2); font-weight: 600; } .att-tbl td.amber { color: var(--amber); font-weight: 600; }
.att-tv .att-tblw, .att-card .att-tv .att-tblw { margin: 6px 0 0; border: 1px solid var(--line); border-radius: 8px; }
.att-q { font-weight: 700; }
.att .q1 { background: var(--att-h1); color: var(--att-i1); } .att .q2 { background: var(--att-h2); color: var(--att-i2); } .att .q3 { background: var(--att-h3); color: var(--att-i3); }
.att .q4 { background: var(--att-h4); color: var(--att-i4); } .att .q5 { background: var(--att-h5); color: var(--att-i5); } .att .q6 { background: var(--att-h6); color: var(--att-i6); }
.att .q0 { background: var(--att-h0); color: var(--text); }

/* melhores e piores atendimentos */
.att-revs { display: flex; flex-direction: column; }
.att-rev { display: flex; gap: 10px; padding: 9px 6px; border-bottom: 1px solid var(--line); color: inherit; border-radius: 8px; }
.att-rev:last-child { border-bottom: 0; }
.att-rev:hover { background: var(--hover); }
.att-sc { min-width: 40px; height: 30px; border-radius: 7px; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.att-res { color: var(--text2); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }

/* como os números são calculados */
.att-defs { margin-top: 20px; }
.att-defs ul { margin: 10px 0 0; padding-left: 18px; color: var(--text2); line-height: 1.55; display: flex; flex-direction: column; gap: 6px; }

@media (max-width: 820px) {
  .att-bar { padding: 10px 14px; }
  .att-tabs { padding: 0 8px; }
  .att-f select, .att-f input { max-width: 46vw; }
  .att-tblw { margin: 0 -18px -18px; }
  .att-pills { margin-left: 0; }
  .att-kpis { grid-template-columns: 1fr 1fr; }
  .att-kpis .kpi .v { font-size: 21px; }
}
