/* Tela "Atendimentos encerrados". BI executivo com drill visual por dimensão.
   Reaproveito tokens do app.css (--vault, --steel, --line, etc). */
.am-wrap { display: flex; flex-direction: column; gap: 20px }

/* HERO: mês grande + delta vs anterior */
.am-hero { display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  padding: 22px 26px; background: linear-gradient(135deg, var(--vault) 0%, #1e293b 100%);
  color: #fff; border-radius: 12px; box-shadow: 0 6px 20px rgba(15,23,42,.15) }
.am-hero-mes { font-family: var(--disp); font-size: 40px; font-weight: 700;
  letter-spacing: -1.5px; text-transform: capitalize; line-height: 1 }
.am-hero-ano { font-size: 15px; font-weight: 500; opacity: .55; margin-left: 2px }
.am-hero-sub { font-size: 11px; opacity: .7; letter-spacing: .8px; margin-bottom: 6px;
  text-transform: uppercase; font-weight: 600 }
.am-delta { margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 22px; font-size: 13px; font-weight: 600 }
.am-delta.up   { background: rgba(220,38,38,.18); color: #fca5a5 }
.am-delta.down { background: rgba(5,150,105,.22); color: #6ee7b7 }
.am-delta.flat { background: rgba(255,255,255,.1);  color: rgba(255,255,255,.75) }

/* Navegador de 6 meses (sparkline) */
.am-trend { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px }
.am-tcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 10px 11px; cursor: pointer; display: flex; flex-direction: column;
  gap: 6px; text-align: center; transition: all .18s; color: inherit }
.am-tcard:hover { border-color: var(--steel); transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37,99,235,.1) }
.am-tcard.on { background: var(--vault); border-color: var(--vault); color: #fff;
  box-shadow: 0 8px 24px rgba(15,23,42,.22) }
.am-tcard .mn { font-size: 10px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; opacity: .7 }
.am-tcard .bar { height: 28px; display: flex; align-items: flex-end; justify-content: center }
.am-tcard .bar i { display: block; width: 55%; background: var(--steel);
  border-radius: 3px 3px 0 0; min-height: 3px }
.am-tcard.on .bar i { background: #fff }
.am-tcard .vl { font-family: var(--disp); font-size: 22px; font-weight: 700; letter-spacing: -.5px }

/* KPIs */
.am-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px }
.am-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; position: relative; overflow: hidden }
.am-kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--steel) }
.am-kpi.k2::before { background: var(--warn) }
.am-kpi.k3::before { background: var(--ok) }
.am-kpi.k4::before { background: var(--vault) }
.am-kpi .lbl { font-size: 10.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .6px }
.am-kpi .val { font-family: var(--disp); font-size: 28px; font-weight: 700;
  color: var(--vault); letter-spacing: -.6px; margin: 6px 0 2px }
.am-kpi .sub { font-size: 11.5px; color: var(--muted); font-weight: 500 }

/* Toggle de métrica + chip de foco */
.am-metric { display: flex; align-items: center; gap: 10px; padding: 4px 2px 0 }
.am-metric-lbl { font-size: 10.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .6px; margin-right: 4px }
.am-chip { padding: 7px 14px; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); border-radius: 20px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s }
.am-chip:hover { color: var(--txt); border-color: var(--faint) }
.am-chip.on { background: var(--steel); color: #fff; border-color: var(--steel) }
.am-foco { margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  background: var(--steel); color: #fff; border-radius: 14px; padding: 5px 12px;
  font-size: 11.5px; font-weight: 600; max-width: 60% }
.am-foco span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.am-foco b { cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px }

/* Grid 2x2 de painéis */
.am-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px }
.am-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 20px; box-shadow: 0 2px 8px rgba(0,0,0,.02) }
.am-panel h3 { font-family: var(--disp); font-size: 14px; font-weight: 600;
  color: var(--vault); margin: 0 0 3px; display: flex; align-items: center;
  justify-content: space-between; gap: 10px }
.am-panel h3 small { font-size: 10.5px; color: var(--faint); font-weight: 500;
  font-family: var(--ui); text-transform: uppercase; letter-spacing: .5px }
.am-panel .subt { font-size: 11px; color: var(--muted); margin-bottom: 12px }

/* Barras (drill visual) */
.am-bars { display: flex; flex-direction: column; gap: 3px; max-height: 480px; overflow-y: auto;
  margin: 6px -6px 0; padding: 0 6px }
.am-bars::-webkit-scrollbar { width: 6px }
.am-bars::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px }
.am-bar { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
  padding: 7px 10px 5px; border-radius: 7px; cursor: pointer; transition: background .15s }
.am-bar:hover { background: var(--surface2) }
.am-bar.on { background: rgba(37,99,235,.08); box-shadow: inset 0 0 0 1px var(--steel) }
.am-bar .nm { font-size: 12.5px; font-weight: 500; color: var(--txt); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; line-height: 1.3 }
.am-bar .n { font-family: var(--mono); font-size: 12.5px; font-weight: 700;
  color: var(--vault); text-align: right; line-height: 1.15 }
.am-bar .n small { font-size: 10px; font-weight: 500; color: var(--muted); display: block;
  margin-top: 1px }
.am-bar.on .n { color: var(--steel) }
.am-bar .track { grid-column: 1 / -1; height: 4px; background: var(--surface2);
  border-radius: 2px; overflow: hidden; margin-top: 4px }
.am-bar .fill { height: 100%; border-radius: 2px; transition: width .3s }

/* Insight sob cada painel */
.am-ins { margin-top: 12px; padding: 10px 12px; background: var(--surface2);
  border-left: 3px solid var(--steel); border-radius: 4px; font-size: 12px;
  color: var(--txt); line-height: 1.5 }
.am-ins b { color: var(--vault); font-weight: 700 }
.am-empty { padding: 32px; text-align: center; color: var(--faint); font-size: 13px }

@media (max-width: 1100px) {
  .am-grid  { grid-template-columns: 1fr }
  .am-kpis  { grid-template-columns: repeat(2, 1fr) }
  .am-trend { grid-template-columns: repeat(3, 1fr) }
}