/* ============================================================
   06-admin.css — Login, dashboard, sidebar, stats, agenda, tools, badges
   ============================================================ */

/* ---- login ---- */
.login-shell {
  min-height: calc(100vh - 76px);
  display: grid;
  place-items: center;
  padding: 2rem;
}
.login-card {
  width: 100%;
  max-width: 380px;
  padding: 2.5rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

/* ---- dashboard ---- */
.dash-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 76px);
}
@media (max-width: 900px) { .dash-shell { grid-template-columns: 1fr; } }
.dash-side {
  border-right: 1px solid var(--line);
  padding: 1.5rem 1rem;
  background: var(--bg-elev);
}
.dash-side-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0 0.6rem 0.6rem;
}
.dash-side-link {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.6rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  color: var(--ink-2);
  transition: all 0.12s;
  cursor: pointer;
  margin-bottom: 2px;
}
.dash-side-link:hover { background: var(--bg-sunk); color: var(--ink); }
.dash-side-link.active { background: var(--ink); color: var(--bg); }
.dash-side-link.active .dash-side-glyph { background: var(--bg); color: var(--ink); }
.dash-side-glyph {
  width: 20px; height: 20px;
  border-radius: 4px;
  display: grid; place-items: center;
  background: var(--bg-sunk);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-2);
}
.dash-main { padding: 2rem 2.5rem; overflow-y: auto; }

.dash-header {
  display: flex; justify-content: space-between; align-items: end;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (max-width: 900px) { .dash-stats { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  display: flex; flex-direction: column; gap: 0.4rem;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.stat-num {
  font-family: var(--font-display);
  font-size: 2.25rem;
  line-height: 1;
}
.stat-delta { font-size: 0.78rem; color: var(--accent); font-family: var(--font-mono); }

.dash-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 900px) { .dash-cols { grid-template-columns: 1fr; } }

.appt-list { display: flex; flex-direction: column; }
.appt {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
  align-items: center;
}
.appt:last-child { border-bottom: 1px solid var(--line); }
.appt-time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink);
}
.appt-info { display: flex; flex-direction: column; gap: 2px; }
.appt-name { font-weight: 500; }
.appt-matter {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.appt-badge {
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--line);
}
.appt-badge.confirmed { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.appt-badge.pending { background: var(--bg-sunk); }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.tool-card {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  cursor: pointer;
  transition: all 0.18s;
  display: flex; flex-direction: column; gap: 0.5rem;
  min-height: 140px;
}
.tool-card:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tool-card:hover .tool-arrow { transform: translateX(4px); }
.tool-icon {
  width: 28px; height: 28px;
  border: 1px solid currentColor;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  opacity: 0.7;
}
.tool-name { font-weight: 500; margin-top: auto; }
.tool-desc { font-size: 0.8rem; opacity: 0.7; line-height: 1.45; }
.tool-arrow { transition: transform 0.18s; margin-top: 0.4rem; }

/* ---- prenotazioni ---- */
.prenotazioni-header {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line);
}
.prenotazioni-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.pren-filter-select, .pren-filter-input {
  padding: 0.4rem 0.6rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-elev); color: var(--ink); font-size: 0.85rem;
}
.prenotazioni-list { min-height: 200px; }
.prenotazioni-loading, .prenotazioni-empty, .prenotazioni-error {
  padding: 2rem; text-align: center; color: var(--ink-3); font-size: 0.9rem;
}
.prenotazioni-error { color: var(--ink-3); }

.prenotazioni-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.prenotazioni-table th {
  text-align: left; padding: 0.6rem 0.8rem; border-bottom: 2px solid var(--line);
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3);
}
.prenotazioni-table td {
  padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: middle;
}
.prenotazioni-table a { color: var(--accent); text-decoration: none; }
.prenotazioni-table a:hover { text-decoration: underline; }

.pren-badge {
  display: inline-block; padding: 0.2rem 0.5rem; border-radius: var(--radius);
  font-size: 0.72rem; font-weight: 500;
}
.pren-badge-pending { background: #f0ad4e22; color: #f0ad4e; }
.pren-badge-confirmed { background: #4caf5022; color: #4caf50; }
.pren-badge-rejected { background: #f4433622; color: #f44336; }
.pren-badge-cancelled { background: #9e9e9e22; color: #9e9e9e; }

.pren-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.pren-actions .btn-sm { padding: 0.3rem 0.6rem; font-size: 0.75rem; }
.btn-approve { background: var(--accent); color: var(--bg); border: none; }
.btn-approve:hover { opacity: 0.85; }
.btn-reject { background: transparent; color: #f44336; border: 1px solid #f44336; }
.btn-reject:hover { background: #f4433622; }
.btn-delete { background: transparent; color: var(--ink-3); border: 1px solid var(--line); }
.btn-delete:hover { color: #f44336; border-color: #f44336; }

.pren-modal {
  position: fixed; inset: 0; z-index: 10000; display: flex; place-items: center;
}
.pren-modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.5);
}
.pren-modal-content {
  position: relative; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 2rem; max-width: 420px; width: 90%;
}
.pren-modal-content h3 { margin: 0 0 1rem; font-size: 1.1rem; }
.pren-modal-content textarea {
  width: 100%; padding: 0.6rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--ink); font-size: 0.9rem; resize: vertical;
  margin-bottom: 1rem;
}
.pren-modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
