/* ═══════════════════════════════════════════════
   Banco Alimentare — App CSS
   ═══════════════════════════════════════════════ */

/* ── Reset / base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  color: #1e293b;
  background: #f0f4f8;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ═══════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════ */
.card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 12px 12px 0 0 !important;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 0.92rem;
  color: #334155;
}

/* ── Stat cards ── */
.stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transition: box-shadow .2s;
}
.stat-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: #0f172a;
}
.stat-card .stat-label {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.stat-card .stat-sub {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 2px;
}

/* icon colour variants */
.icon-blue   { background: #dbeafe; color: #2563eb; }
.icon-green  { background: #dcfce7; color: #16a34a; }
.icon-orange { background: #ffedd5; color: #ea580c; }
.icon-red    { background: #fee2e2; color: #dc2626; }
.icon-purple { background: #ede9fe; color: #7c3aed; }
.icon-teal   { background: #ccfbf1; color: #0d9488; }

/* ═══════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════ */
.table-container {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.table {
  margin-bottom: 0;
  font-size: 0.875rem;
}
.table thead th {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 10px 14px;
  white-space: nowrap;
}
.table tbody tr {
  transition: background .12s;
}
.table tbody tr:hover {
  background: #f8fafc;
}
.table tbody td {
  padding: 10px 14px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}
.table tbody tr:last-child td {
  border-bottom: none;
}

/* row highlight */
.row-warning td { background: #fffbeb !important; }
.row-danger  td { background: #fff1f2 !important; }
.row-success td { background: #f0fdf4 !important; }

/* ═══════════════════════════════════════════════
   BADGES / STATUS
   ═══════════════════════════════════════════════ */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-attivo   { background: #dcfce7; color: #15803d; }
.status-sospeso  { background: #fef9c3; color: #a16207; }
.status-aperta   { background: #dbeafe; color: #1d4ed8; }
.status-chiusa   { background: #f1f5f9; color: #64748b; }
.status-preparata { background: #ede9fe; color: #6d28d9; }
.status-consegnata { background: #dcfce7; color: #15803d; }
.status-assente  { background: #fee2e2; color: #b91c1c; }
.status-prenotata { background: #e0f2fe; color: #0369a1; }

/* ═══════════════════════════════════════════════
   FILTER BAR
   ═══════════════════════════════════════════════ */
.filter-bar {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.filter-bar .form-control,
.filter-bar .form-select {
  font-size: 0.875rem;
  border-color: #e2e8f0;
  border-radius: 8px;
}
.filter-bar .form-control:focus,
.filter-bar .form-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* ═══════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════ */
.btn {
  font-size: 0.85rem;
  border-radius: 8px;
  font-weight: 500;
  transition: all .15s;
}
.btn-primary {
  background: #2563eb;
  border-color: #2563eb;
}
.btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}
.btn-sm { font-size: 0.78rem; padding: 4px 10px; }
.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

/* ═══════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════ */
.modal-header {
  background: #1a2942;
  color: #fff;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
}
.modal-header .btn-close {
  filter: invert(1);
}
.modal-content {
  border: none;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal-footer {
  border-top: 1px solid #e2e8f0;
  padding: 12px 20px;
}

/* ═══════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════ */
.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}
.form-control, .form-select {
  border-color: #e2e8f0;
  border-radius: 8px;
  font-size: 0.875rem;
}
.form-control:focus, .form-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #94a3b8;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 6px;
  margin-bottom: 14px;
  margin-top: 20px;
}

/* ═══════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════ */
.alert-expiring {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.85rem;
  color: #92400e;
}
.alert-expired {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-left: 4px solid #f43f5e;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.85rem;
  color: #881337;
}

/* ═══════════════════════════════════════════════
   PANIERI CARDS
   ═══════════════════════════════════════════════ */
.paniere-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  height: 100%;
  transition: box-shadow .2s;
}
.paniere-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.paniere-card .paniere-name {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}
.paniere-card .paniere-desc {
  font-size: 0.82rem;
  color: #64748b;
  min-height: 36px;
}
.paniere-card .paniere-meta {
  font-size: 0.78rem;
  color: #94a3b8;
}

/* ═══════════════════════════════════════════════
   DISTRIBUZIONE SESSIONS
   ═══════════════════════════════════════════════ */
.session-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.session-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  border-color: #2563eb;
}
.session-card.active-session {
  border-color: #2563eb;
  border-left: 4px solid #2563eb;
}

.stats-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.stats-bar .stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════ */
.pagination .page-link {
  border-color: #e2e8f0;
  color: #475569;
  font-size: 0.85rem;
  padding: 5px 12px;
}
.pagination .page-item.active .page-link {
  background: #2563eb;
  border-color: #2563eb;
}
.pagination .page-link:hover {
  background: #f8fafc;
  color: #1e293b;
}

/* ═══════════════════════════════════════════════
   TOASTS
   ═══════════════════════════════════════════════ */
.toast-item {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideIn .25s ease;
  min-width: 280px;
}
.toast-item.toast-success { border-left: 4px solid #22c55e; }
.toast-item.toast-error   { border-left: 4px solid #ef4444; }
.toast-item.toast-warning { border-left: 4px solid #f59e0b; }
.toast-item.toast-info    { border-left: 4px solid #3b82f6; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ═══════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}
.empty-state i {
  font-size: 3rem;
  margin-bottom: 12px;
  display: block;
  opacity: .4;
}
.empty-state p {
  font-size: 0.9rem;
  margin: 0;
}

/* ═══════════════════════════════════════════════
   CHART CONTAINER
   ═══════════════════════════════════════════════ */
.chart-container {
  position: relative;
  height: 260px;
}

/* ═══════════════════════════════════════════════
   BREADCRUMB / BACK LINK
   ═══════════════════════════════════════════════ */
.page-breadcrumb {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-bottom: 16px;
}
.page-breadcrumb a {
  color: #2563eb;
  text-decoration: none;
}
.page-breadcrumb a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .main-content { margin-left: 0; }
  #page-content { padding: 12px !important; }
  .stat-card .stat-value { font-size: 1.5rem; }
  .top-bar { padding: 0 12px; }
}
