/* ── Stats grid ──────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}
.stat-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-val  { font-size: 26px; font-weight: 800; color: var(--gray-900); line-height: 1; }
.stat-lbl  { font-size: 11px; color: var(--gray-500); margin-top: 3px; font-weight: 500; }
.stat-trend{ font-size: 11px; margin-top: 2px; font-weight: 600; }
.stat-trend.up   { color: var(--green-700); }
.stat-trend.down { color: var(--red-700); }

/* ── Grafici a barre semplici ────────────────────────────────────────────────── */
.bar-chart { margin-bottom: 20px; }
.bar-chart-title { font-size: 13px; font-weight: 700; color: var(--gray-700); margin-bottom: 12px; }
.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.bar-label { font-size: 12px; color: var(--gray-600); width: 140px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 8px; background: var(--gray-100); border-radius: 99px; overflow: hidden; }
.bar-fill  { height: 100%; border-radius: 99px; transition: width .4s ease; }
.bar-count { font-size: 12px; font-weight: 700; color: var(--gray-600); width: 24px; text-align: right; flex-shrink: 0; }

/* ── Categorie richieste ─────────────────────────────────────────────────────── */
.cat-section {
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}
.cat-hdr {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid;
}
.cat-hdr-left  { display: flex; align-items: center; gap: 7px; }
.cat-hdr-right { display: flex; align-items: center; gap: 8px; }

/* ── Request card ────────────────────────────────────────────────────────────── */
.req-card {
  background: white;
  padding: 14px 16px;
  border-left: 4px solid;
  border-bottom: 1px solid var(--gray-100);
  transition: var(--transition);
}
.req-card:last-child { border-bottom: none; }
.req-card:hover      { background: var(--blue-50); }

.req-top     { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 5px; gap: 12px; }
.req-meta    { min-width: 0; flex: 1; }
.req-name    { font-weight: 700; font-size: 14px; color: var(--gray-900); }
.req-email   { font-size: 11px; color: var(--gray-400); margin-top: 1px; }
.req-subject { font-size: 12px; color: var(--gray-400); font-style: italic; margin-bottom: 5px; }
.req-summary { font-size: 13px; color: var(--gray-700); line-height: 1.5; margin-bottom: 10px; }
.req-btns    { display: flex; gap: 7px; flex-wrap: wrap; }
.req-date    { font-size: 11px; color: var(--gray-400); white-space: nowrap; flex-shrink: 0; }

/* ── Pulsanti azione richiesta ───────────────────────────────────────────────── */
.btn-prescribe {
  background: var(--green-100);
  color: var(--green-700);
  border: 1.5px solid #86efac;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex; align-items: center; gap: 5px;
}
.btn-prescribe:hover { background: #bbf7d0; }

.btn-consult {
  background: var(--red-100);
  color: var(--red-700);
  border: 1.5px solid #fca5a5;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex; align-items: center; gap: 5px;
}
.btn-consult:hover { background: #fee2e2; }

/* ── Filtri storico/riepilogo ────────────────────────────────────────────────── */
.filter-bar {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-label { font-size: 11px; font-weight: 600; color: var(--gray-500); letter-spacing: .03em; }
.filter-control {
  padding: 7px 10px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 13px;
  background: white;
  color: var(--gray-800);
  outline: none;
  transition: var(--transition);
}
.filter-control:focus { border-color: var(--blue-700); }

/* ── Paginazione ─────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 0 0;
}
.page-btn {
  width: 32px; height: 32px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  background: white;
  color: var(--gray-600);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.page-btn:hover  { border-color: var(--blue-700); color: var(--blue-700); }
.page-btn.active { background: var(--blue-800); color: white; border-color: var(--blue-800); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-info { font-size: 12px; color: var(--gray-500); padding: 0 8px; }

/* ── Riepilogo cumulativo ────────────────────────────────────────────────────── */
.summary-header {
  background: linear-gradient(135deg, var(--blue-900), var(--blue-800));
  color: white;
  padding: 16px 18px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin: -18px -18px 18px;
}
.summary-header h3 { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.summary-header p  { font-size: 12px; opacity: .7; }
.summary-section   { margin-bottom: 16px; }
.summary-section-title {
  font-size: 12px; font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--gray-200);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--gray-100);
}
.summary-row:last-child { border-bottom: none; }
.summary-row-label { color: var(--gray-700); }
.summary-row-val   { font-weight: 700; color: var(--gray-900); }

/* ── Notifica monitoraggio ───────────────────────────────────────────────────── */
.mon-notification {
  position: fixed;
  top: 80px; right: 20px;
  background: var(--blue-800);
  color: white;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: 13px; font-weight: 600;
  z-index: 999;
  animation: slideIn .3s ease;
  display: flex; align-items: center; gap: 8px;
  max-width: 300px;
}
.mon-notification.success { background: var(--green-700); }
.mon-notification.warning { background: var(--amber-700); }

@media(max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .bar-label  { width: 100px; }
}
