/* ===== RESET BASE ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #f3f4f6;
  color: #111827;
}

/* Nasconde gli elementi con classe .hidden (es. overlay all'inizio) */
.hidden {
  display: none !important;
}

/* ===== HEADER ===== */
.header {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  padding: 1.2rem 0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
}

.header-brand {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  justify-content: center;
}

.logo-img {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  padding: 6px;
}

.header-brand h1 {
  margin: 0;
  font-size: 1.7rem;
}

.header-brand p {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  opacity: 0.95;
}

/* ===== LAYOUT PRINCIPALE ===== */

.container {
  max-width: 1100px;
  margin: 1.5rem auto 2.5rem;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.9fr);
  grid-template-areas:
    "auth list"
    "booking list"
    "my list";
  gap: 1.5rem;
}

.auth-card {
  grid-area: auth;
}

.booking-card {
  grid-area: booking;
}

.my-bookings-card {
  grid-area: my;
}

.list-card {
  grid-area: list;
}

/* Mobile: colonne una sotto l'altra */
@media (max-width: 900px) {
  .container {
    grid-template-columns: 1fr;
    grid-template-areas:
      "auth"
      "booking"
      "my"
      "list";
  }
}

/* ===== CARD GENERALI ===== */

.auth-card,
.booking-card,
.list-card,
.my-bookings-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 1rem 1.2rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.auth-card:hover,
.booking-card:hover,
.list-card:hover,
.my-bookings-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.12);
}

.auth-card h2,
.booking-card h2,
.list-card h2,
.my-bookings-card h2 {
  margin-top: 0;
  margin-bottom: 0.6rem;
}

/* ===== BOTTONI ===== */

button {
  font-family: inherit;
}

.primary,
button.primary {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: none;
  color: white;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.15s ease, box-shadow 0.15s ease,
    transform 0.05s ease;
}

.primary:hover,
button.primary:hover {
  background: linear-gradient(135deg, #16a34a, #15803d);
  box-shadow: 0 6px 14px rgba(22, 163, 74, 0.4);
  transform: translateY(-1px);
}

.secondary,
button.secondary {
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: #111827;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease,
    transform 0.05s ease;
}

.secondary:hover,
button.secondary:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  transform: translateY(-1px);
}

button.disabled,
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

/* bottone rosso per cancella */
button.danger-btn {
  border-color: #ef4444;
  color: #b91c1c;
}

button.danger-btn:hover {
  background: #fee2e2;
  border-color: #dc2626;
}

/* ===== RIGHE LOGIN ===== */

.auth-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0 0.5rem;
}

.auth-status {
  font-size: 0.9rem;
  color: #4b5563;
}

/* ===== FORM ===== */

.form-row {
  margin-bottom: 0.7rem;
}

.form-row label {
  display: block;
  font-size: 0.9rem;
  color: #374151;
  margin-bottom: 0.15rem;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 2.2rem;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.4);
}

/* messaggi form */
.form-message {
  font-size: 0.9rem;
  margin-top: 0.4rem;
}

.form-message.error {
  color: #b91c1c;
}

.form-message.success {
  color: #16a34a;
}

/* testo info */
.info {
  font-size: 0.85rem;
  color: #4b5563;
}

/* ===== LISTE PRENOTAZIONI ===== */

.bookings-list {
  margin-top: 0.5rem;
}

.bookings-list .empty {
  font-size: 0.9rem;
  color: #6b7280;
}

.booking-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.7rem 0.75rem;
  margin-bottom: 0.55rem;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
  transition: background 0.15s ease, box-shadow 0.15s ease,
    transform 0.05s ease;
}

.booking-item:hover {
  background: #f9fafb;
  box-shadow: 0 7px 16px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.booking-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.booking-header span:last-child {
  font-weight: 500;
  color: #4b5563;
}

.booking-meta {
  margin-bottom: 0.35rem;
}
.closure-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 1rem 1.2rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  margin-top: 1rem;
}

/* giorno chiuso nel calendario */
.calendar-day.closed {
  background: #fecaca;
  color: #7f1d1d;
  border: 1px solid #fca5a5;
}

/* tag generici */
.tag {
  display: inline-block;
  padding: 0.20rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  font-size: 0.75rem;
  margin-right: 0.25rem;
  margin-top: 0.15rem;
  background: #f9fafb;
}

.tag-small {
  border-color: #0ea5e9;
  background: #e0f2fe;
  color: #075985;
}

.tag-big {
  border-color: #f97316;
  background: #ffedd5;
  color: #9a3412;
}

.tag-user {
  border-color: #22c55e;
  background: #dcfce7;
  color: #15803d;
}

.booking-note {
  font-size: 0.85rem;
  color: #4b5563;
  margin: 0.25rem 0 0.1rem;
}

/* azioni (es. cancella) sotto alla prenotazione */
.booking-actions {
  margin-top: 0.25rem;
  display: flex;
  justify-content: flex-end;
}

/* ===== FOOTER ===== */

.footer {
  text-align: center;
  font-size: 0.8rem;
  color: #6b7280;
  padding: 0.9rem 0 1.2rem;
}

/* ===== OVERLAY (conferma + successo) ===== */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.overlay-card {
  background: #ffffff;
  padding: 1.3rem 1.4rem;
  border-radius: 16px;
  max-width: 430px;
  width: 100%;
  border: 1px solid #e5e7eb;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.35);
}

.overlay-card h2 {
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.summary-list {
  list-style: none;
  padding-left: 0;
  font-size: 0.9rem;
}

.summary-list li {
  margin-bottom: 0.2rem;
}

.overlay-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.7rem;
}

.success-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #dcfce7;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.4rem;
  margin-bottom: 0.4rem;
}
/* ===== LAYOUT GESTORE ===== */

.gestore-container {
  max-width: 1100px;
  margin: 1.5rem auto 2rem;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.9fr);
  gap: 1.5rem;
}

.calendar-card,
.day-details-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 1rem 1.2rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.day-details-card h2 {
  margin-top: 0;
  margin-bottom: 0.4rem;
}

@media (max-width: 900px) {
  .gestore-container {
    grid-template-columns: 1fr;
  }
}

/* ===== CALENDARIO ===== */

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.month-label {
  font-weight: 600;
  font-size: 1rem;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 0.8rem;
  text-align: center;
  color: #6b7280;
  margin-bottom: 0.2rem;
}

.calendar-weekdays div {
  padding: 0.2rem 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
}

.calendar-day {
  border: none;
  background: #f9fafb;
  border-radius: 8px;
  padding: 0.45rem 0;
  text-align: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease,
    box-shadow 0.12s ease, transform 0.05s ease;
  min-height: 40px;
}

.calendar-day.other-month {
  color: #9ca3af;
  background: #f3f4f6;
}

.calendar-day.today {
  border: 1px solid #22c55e;
}

.calendar-day.has-bookings {
  background: #dcfce7;
  color: #166534;
}

.calendar-day.selected {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.5);
}

.calendar-day:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}
.availability-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 0.6rem;
}
.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.calendar-month-label {
  font-weight: 600;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 1rem;
}

.calendar-cell {
  border-radius: 6px;
  padding: 0.35rem;
  text-align: center;
  font-size: 0.85rem;
  border: 1px solid #e0e0e0;
}

.calendar-header {
  font-weight: 600;
  background: #f4f4f4;
}

.day-cell {
  cursor: pointer;
  background: #ffffff;
}

.day-cell:hover {
  outline: 2px solid #2e7d32;
}

.cell-closure {
  background: #ffe0e0;
  border-color: #ffb3b3;
}

.cell-block {
  background: #fff5cc;
  border-color: #ffe08a;
}

.day-details-card {
  margin-top: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid #ddd;
}
.manager-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.manager-toolbar .info { margin:0; }