/* Archivio referti (archivio.html) e Amministrazione (admin.html) */
.page{ max-width: 880px; margin: 0 auto; padding: var(--s-8) var(--s-5) var(--s-16); }
.toolbar{ display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-3); align-items: center; }
.toolbar .input{ flex: 1; min-width: 200px; width: auto; }
.archive-item{ background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: var(--s-2); overflow: hidden; }
.archive-item:hover{ border-color: var(--border-strong); }
.archive-head{ display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); cursor: pointer; width: 100%; background: none; border: 0; color: inherit; font: inherit; text-align: left; }
.archive-head .esame-name{ font-weight: 600; font-size: var(--fs-sm); flex: 1; }
.archive-head .esame-name.empty{ font-style: italic; color: var(--text-muted); font-weight: 400; border: 0; padding: 0; text-align: left; }
.archive-head .date{ font-size: var(--fs-xs); color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.archive-head .chevron{ color: var(--primary); transition: transform .15s ease; }
.archive-item.open .chevron{ transform: rotate(90deg); }
.archive-body{ display: none; padding: 0 var(--s-4) var(--s-4); border-top: 1px solid var(--border); }
.archive-item.open .archive-body{ display: block; padding-top: var(--s-3); }
.archive-text{ white-space: pre-wrap; font-family: var(--font); font-size: var(--fs-sm); line-height: 1.6; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); padding: var(--s-3); margin: 0 0 var(--s-2); }
.archive-actions{ display: flex; gap: var(--s-2); justify-content: flex-end; flex-wrap: wrap; }
.copy-flash{ position: fixed; bottom: 22px; right: 22px; background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text); padding: 10px 16px; border-radius: var(--r-md); font-size: var(--fs-sm); opacity: 0; transform: translateY(6px); transition: all .18s ease; pointer-events: none; }
.copy-flash.show{ opacity: 1; transform: none; }
.hidden{ display: none !important; }

/* Amministrazione */
.tabs{ display: flex; gap: var(--s-2); margin-bottom: var(--s-4); flex-wrap: wrap; }
.tab-btn{ height: var(--h-sm); padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--border); background: transparent; color: var(--text-muted); font-size: var(--fs-xs); font-weight: 600; cursor: pointer; }
.tab-btn.active{ background: var(--primary-solid); border-color: var(--primary-solid); color: #fff; }
.req-card{ background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-4); margin-bottom: var(--s-3); }
.req-head{ display: flex; justify-content: space-between; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-bottom: var(--s-2); }
.req-email{ font-weight: 600; }
.req-date{ font-size: var(--fs-xs); color: var(--text-subtle); }
.req-status{ display: inline-block; padding: 2px 9px; border-radius: var(--r-pill); font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; margin-bottom: var(--s-2); }
.req-status.in_attesa{ background: var(--warning-bg); color: var(--abnormal); }
.req-status.approvato{ background: rgba(52, 211, 153, .12); color: var(--success); }
.req-status.rifiutato{ background: var(--danger-bg); color: var(--danger); }
.req-actions{ display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.req-note{ flex: 1; min-width: 180px; min-height: var(--h-sm); padding: 4px 8px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); }
.badge-admin{ margin-left: 8px; }

/* Sezione statistiche */
.card{ background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-4); margin-bottom: var(--s-4); }
.section-title{ font-size: var(--fs-lg); margin-top: 0; margin-bottom: var(--s-3); }


/* Stili per le barre */
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: var(--primary);
  opacity: 0.15;
  width: var(--bar-width, 0%);
}

/* Statistiche dell'archivio */
.stats{ margin-bottom: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); }
.stats__head{ display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.stats__head .section-title{ margin: 0; }
.stats__grid{ display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s-5); }
.stats__title{ font-size: var(--fs-sm); font-weight: 600; margin-bottom: var(--s-2); }
.bars{ display: flex; flex-direction: column; gap: 6px; }
.bar{ display: grid; grid-template-columns: minmax(0, 9rem) 1fr 2.5rem; align-items: center; gap: var(--s-2); font-size: var(--fs-xs); }
.bar__label{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.bar__track{ height: 10px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.bar__fill{ display: block; height: 100%; border-radius: var(--r-pill); background: var(--primary); }
.bar__value{ text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }

