/* ==========================================================================
   Pannello di amministrazione
   Colori degli utenti: tavolozza categoriale validata (ordine fisso, chiaro e scuro).
   ========================================================================== */
:root[data-theme="light"] {
  --adm-1: #2a78d6; --adm-2: #eb6834; --adm-3: #1baf7a; --adm-4: #eda100;
  --adm-5: #e87ba4; --adm-6: #008300; --adm-7: #4a3aa7; --adm-8: #e34948;
  --adm-seq: #2a78d6;
}
:root[data-theme="dark"] {
  --adm-1: #3987e5; --adm-2: #d95926; --adm-3: #199e70; --adm-4: #c98500;
  --adm-5: #d55181; --adm-6: #008300; --adm-7: #9085e9; --adm-8: #e66767;
  --adm-seq: #3987e5;
}

.adm { display: flex; flex-direction: column; gap: 18px; padding-bottom: 40px; }
.adm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.adm-head h1 { font-size: 34px; display: flex; align-items: center; gap: 12px; margin: 0; }
.adm-sub { margin: 4px 0 0; color: var(--ink-3); font-size: 14.5px; }
.adm-back { display: inline-block; margin-bottom: 8px; font-size: 14px; color: var(--ink-3); text-decoration: none; }
.adm-back:hover { color: var(--ink); }
.adm-user-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.adm-muted { color: var(--ink-3); font-size: 13px; }
.adm-empty { color: var(--ink-3); margin: 0; }
.adm-note { color: var(--ink-3); font-size: 13px; margin: 0; max-width: 760px; }

.adm-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.adm-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--stroke); border-radius: 14px; background: var(--sheet); min-width: 0; }
.adm-tile small { font-size: 12.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.adm-tile b { font-size: 26px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.adm-tile span { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }

.adm-card { padding: 16px 18px 18px; border: 1px solid var(--stroke); border-radius: var(--r-tray); background: var(--sheet); min-width: 0; }
.adm-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.adm-card-h h2 { font-size: 18px; margin: 0; }
.adm-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .adm-two { grid-template-columns: 1fr; } }

.adm-chips { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--fill-2); }
.adm-chip { border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.adm-chip.on { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }

.adm-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 8px; font-size: 13px; color: var(--ink-2); }
.adm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.adm-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.adm-legend i.adm-login-key, .adm-login-key { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }

.adm-chart { width: 100%; min-height: 220px; }
.adm-chart svg { display: block; max-width: 100%; height: auto; touch-action: pan-y; }
.adm-grid { stroke: var(--stroke); stroke-width: 1; }
.adm-base { stroke: var(--stroke-2, var(--stroke)); stroke-width: 1; }
.adm-ax { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.adm-login { fill: var(--ink); stroke: var(--sheet); stroke-width: 2; }

.adm-tt { position: absolute; z-index: 5; pointer-events: none; min-width: 150px; max-width: 260px; padding: 8px 10px; border-radius: 10px; background: var(--sheet); border: 1px solid var(--stroke); box-shadow: 0 8px 24px rgba(0, 0, 0, .22); font-size: 13px; color: var(--ink); }
.adm-tt[hidden] { display: none; }
.adm-tt-h { display: block; margin-bottom: 4px; font-weight: 600; }
.adm-tt-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--ink-2); }
.adm-tt-row i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.adm-tt-row span { flex: 1; }
.adm-tt-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.adm-tt-row small { width: 100%; padding-left: 14px; color: var(--ink-3); }
.adm-tt-tot { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--stroke); color: var(--ink-2); }

.adm-heat { display: flex; flex-direction: column; gap: 4px; }
.adm-heat-row { display: grid; grid-template-columns: minmax(70px, 140px) 1fr; gap: 10px; align-items: center; }
.adm-heat-name { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-heat-cells { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; }
.adm-hc { height: 26px; border-radius: 4px; background: color-mix(in srgb, var(--adm-seq) calc(var(--k) * 100%), var(--fill-2)); }
.adm-hc[data-zero] { background: var(--fill-2); }
.adm-heat-axis .adm-heat-cells span { font-size: 10.5px; color: var(--ink-3); text-align: left; }
.adm-heat-key { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.adm-heat-key i { width: 16px; height: 10px; border-radius: 3px; background: color-mix(in srgb, var(--adm-seq) calc(var(--k) * 100%), var(--fill-2)); }
.adm-heat-key span { margin: 0 4px; }
@media (max-width: 560px) { .adm-heat-row { grid-template-columns: 1fr; gap: 4px; } .adm-hc { height: 20px; } }

.adm-hbars { display: flex; flex-direction: column; gap: 8px; }
.adm-hbar { display: grid; grid-template-columns: 100px 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.adm-hbar-k { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-hbar-t { height: 12px; }
.adm-hbar-t i { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.adm-hbar b { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }

.adm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; border-bottom: 1px solid var(--stroke); white-space: nowrap; }
.adm-table td { padding: 10px; border-bottom: 1px solid var(--stroke); white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink); }
.adm-table tbody tr { cursor: pointer; }
.adm-table tbody tr:hover, .adm-table tbody tr:focus-visible { background: var(--fill-2); outline: none; }
.adm-user { display: inline-flex; align-items: center; gap: 10px; }
.adm-user > i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.adm-user span { display: flex; flex-direction: column; }
.adm-user small { color: var(--ink-3); font-size: 12px; }
.adm-yes { color: var(--ok); font-weight: 600; }
.adm-no { color: var(--ink-3); }

.adm-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.adm-stat { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 12px; background: var(--fill-2); min-width: 0; }
.adm-stat small { font-size: 12.5px; color: var(--ink-3); }
.adm-stat b { font-size: 19px; font-weight: 650; color: var(--ink); }
.adm-stat span { font-size: 12.5px; color: var(--ink-3); }
