/* Estilos do painel de admin (adminsys): métricas, saúde do sistema e auditoria. Cores só por variáveis (tema claro e escuro). */
.as .page-head .row { flex-wrap: wrap; justify-content: flex-end; }
.as-gap { margin-top: 16px; }
.as-gap-b { margin-bottom: 12px; }

/* KPIs */
.as-kpi { display: flex; flex-direction: column; gap: 3px; padding: 16px 18px; }
.as-kpi .l { color: var(--muted); font-size: 13px; font-weight: 600; }
.as-kpi .v { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.15; color: var(--text); font-variant-numeric: tabular-nums; }
.as-kpi .d { font-size: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.as-kpi .s { font-size: 12px; }
.as-delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.as-delta.up { color: var(--ok); }
.as-delta.down { color: var(--bad); }
.as-delta.flat { color: var(--muted); }

.as-access { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: baseline; }
.as-access > div { display: flex; flex-direction: column; }
.as-access .l, .as-money .l { color: var(--muted); font-size: 12px; font-weight: 600; }
.as-access b { font-family: var(--font-display); font-size: 20px; font-variant-numeric: tabular-nums; }
.as-access p { flex-basis: 100%; margin: 0; }

.as-money { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 6px 0 10px; }
.as-money > div { display: flex; flex-direction: column; }
.as-money b { font-family: var(--font-display); font-size: 22px; font-variant-numeric: tabular-nums; }

/* Colunas diárias */
.as-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 140px auto; gap: 4px 8px; }
.as-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.as-cols { display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--line-2); background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 50%; }
.as-col { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; cursor: default; min-width: 0; }
.as-col i { display: block; width: 100%; background: var(--brand-2); border-radius: 3px 3px 0 0; min-height: 0; }
.as-chart.alt .as-col i { background: var(--accent); }
.as-col:hover i { filter: brightness(1.12); }
.as-col:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 2px 8px; border-radius: 6px; font-size: 11px; white-space: nowrap; z-index: 2; pointer-events: none; }
.as-x { grid-column: 2; display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

/* Barras horizontais */
.as-hbars { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; }
.as-hbar { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14px; }
.as-hbar .b { height: 10px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.as-hbar .b i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.as-hbar .n { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 520px) { .as-hbar { grid-template-columns: minmax(0, 1fr) auto; } .as-hbar .b { grid-column: 1 / -1; grid-row: 2; } }

/* Retenção (mapa de calor numa só cor) */
.as-ret td, .as-ret th { text-align: center; }
.as-ret td:first-child, .as-ret th:first-child { text-align: left; }
.as-heat { background: color-mix(in srgb, var(--accent) var(--p), var(--surface)); color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Saúde do sistema */
.callout.as-bad { background: var(--bad-bg); border-color: transparent; color: var(--text); }
.as-err { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface-2); }
.as-err summary { display: flex; gap: 12px; align-items: center; cursor: pointer; list-style: none; }
.as-err summary::-webkit-details-marker { display: none; }
.as-err-n { font-family: var(--font-display); font-weight: 700; font-size: 18px; min-width: 48px; font-variant-numeric: tabular-nums; }
.as-err-m { display: flex; flex-direction: column; min-width: 0; flex: 1; overflow-wrap: anywhere; }
.as-pre { background: var(--bg-2); color: var(--text-2); padding: 10px; border-radius: 8px; font-size: 12px; overflow-x: auto; white-space: pre; margin: 10px 0; }
.as-vol { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.as code, .as-pre { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

/* Auditoria */
.as-filt { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; }
.as-filt-b { align-self: end; }
.as-aud td { vertical-align: top; }
.as-det { display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; max-width: 460px; }
.as-det code { font-size: 12px; }
.as-pag { justify-content: center; margin-top: 12px; }
.bar.as-full > i { background: var(--bad); }
.as code { overflow-wrap: anywhere; }
