/* =========================
   BASE / LAYOUT
========================= */
html,
body {
  height: 100%;
  margin: 0;
}

.wrap {
  height: calc(100vh - 90px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: #f6f7fb;
  box-sizing: border-box;
}

/* =========================
   TOOLBAR
========================= */
.toolbar {
  padding: 10px 18px;
  background: #fff;
  border: 1px solid #e7e9ee;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-sizing: border-box;
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.toolbar-left {
  flex: 0 0 auto;
}

.toolbar-center {
  flex: 1;
  justify-content: center;
}

.toolbar-right {
  flex: 0 0 auto;
}

.toolbar .group {
  display: flex;
  gap: 8px;
  align-items: center;
}

#calendarTitle {
  font-size: 20px;
  font-weight: 800;
  min-width: 240px;
  text-align: center;
  color: #111827;
  letter-spacing: .2px;
}

#cameraSel {
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid #dfe3ec;
  background: #fff;
  outline: none;
}

#cameraSel:focus {
  box-shadow: 0 0 0 3px rgba(255, 165, 0, .18);
  border-color: #ffbf4d;
}

.search-box {
  display: flex;
  gap: 6px;
  align-items: center;
}

.search-box input {
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid #dfe3ec;
  background: #fff;
  outline: none;
}

.search-box input:focus {
  box-shadow: 0 0 0 3px rgba(255, 165, 0, .16);
  border-color: #ffbf4d;
}

.legend {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: #6b7280;
  white-space: nowrap;
}

/* Segmented */
.segmented {
  display: inline-flex;
  border: 1px solid #dfe3ec;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.segmented button {
  padding: 8px 12px;
  border: 0;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  color: #111827;
}

.segmented button+button {
  border-left: 1px solid #eef0f4;
}

.segmented button.active {
  background: #FFA500;
  color: #fff;
}

/* Buttons */
.btn {
  padding: 8px 12px;
  border-radius: 10px;
  background: #FFA500;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 800;
}

.btn:hover {
  filter: brightness(.98);
}

.btn:active {
  transform: translateY(1px);
}

.btn-ghost {
  background: #fff;
  color: #111827;
  border: 1px solid #dfe3ec;
}

.btn-ghost:hover {
  background: #fafafa;
  border-color: #d3d7e2;
}

.btn-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Responsive toolbar */
@media (max-width: 1100px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-center {
    order: -1;
    justify-content: center;
  }

  .toolbar-right {
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

/* =========================
   HINT BAR
========================= */
.hint-bar {
  padding: 10px 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  color: #7c2d12;
  font-size: 12px;
  font-weight: 800;
}

/* =========================
   CALENDAR CONTAINER
========================= */
#calendar {
  flex: 1;
  background: #fff;
  border: 1px solid #e7e9ee;
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

/* FullCalendar: reset bordi più soft */
.fc-theme-standard .fc-scrollgrid,
.fc-theme-standard td,
.fc-theme-standard th {
  border-color: #e7e9ee !important;
}

/* Header (lun–dom) */
.fc .fc-col-header-cell {
  background: #fbfcfe;
  border-color: #e7e9ee;
}

.fc .fc-col-header-cell-cushion {
  color: #111827;
  font-weight: 900;
  text-transform: capitalize;
  padding: 10px 6px;
  font-size: 12px;
  letter-spacing: .3px;
}

/* Griglia mese: spazio e rounding */
.fc .fc-daygrid-day-frame {
  border-radius: 14px;
  margin: 6px;
  padding: 8px;
  background: #fff;
  transition: box-shadow .15s, transform .15s, background .15s;
}

/* Hover */
.fc .fc-daygrid-day:hover .fc-daygrid-day-frame {
  box-shadow: 0 0 0 2px rgba(147, 197, 253, .40) inset;
  transform: translateY(-1px);
}

/* Today */
.fc .fc-day-today .fc-daygrid-day-frame {
  box-shadow: 0 0 0 2px rgba(255, 165, 0, .35) inset;
}

/* Giorni fuori mese */
.fc-day-other .fc-daygrid-day-frame {
  background: #f3f4f7;
}

.fc-day-other .fc-daygrid-day-number {
  color: #9ca3af !important;
  opacity: 1;
}

/* Weekend base */
.fc-daygrid-day.is-weekend-cell .fc-daygrid-day-frame {
  background: #fff6ec;
}

/* Override/Festività (se li userai in futuro) */
.fc-daygrid-day.has-fest .fc-daygrid-day-frame {
  background: #fff0f0 !important;
}

.fc-daygrid-day.has-override:not(.has-fest) .fc-daygrid-day-frame {
  background: #fff8ee;
}

/* Fascia numero giorno */
.fc-daygrid-day-top {
  background: #FFA500;
  padding: 3px 6px;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.fc-day-other .fc-daygrid-day-top {
  background: transparent;
}

.fc-daygrid-day-number {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 900;
  color: #111827;
}

/* Label mese */
.month-label {
  font-size: 10px;
  color: #fff;
  text-transform: lowercase;
  opacity: 0.95;
}

/* Iconcine weekend/fest */
.day-icons-auto,
.day-icons-override,
.head-icons-auto,
.head-icons-override {
  font-size: 12px;
  opacity: .78;
}

/* Rimuove rettangoli blu degli eventi */
.fc-daygrid-event {
  background: transparent !important;
  border: 0 !important;
}

.fc-daygrid-event,
.fc-event,
.fc-daygrid-day {
  cursor: pointer;
}

.fc-h-event .fc-event-main {
  color: inherit;
}

/* Prezzo chip */
.price-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.price-chip {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 900;
  padding: 10px 20px;
  border-radius: 999px;
  background: #f8fafc;
  color: #111827;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
  white-space: nowrap;
}

.price-chip.base {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fed7aa;
}

.price-chip.override {
  background: #ffedd5;
  color: #9a3412;
  border-color: #fdba74;
}

.price-chip.discount {
  background: #ecfeff;
  color: #155e75;
  border-color: #a5f3fc;
}

.price-chip.surcharge {
  background: #ffe4e6;
  color: #9f1239;
  border-color: #fecdd3;
}

.price-chip.festivita {
  background: #ede9fe;
  color: #5b21b6;
  border-color: #c4b5fd;
}

/* Prezzi giorni fuori mese */
.fc-day-other .price-chip {
  opacity: 0.55;
  filter: saturate(0.6);
}

/* Week view: col header più pulito */
.fc .fc-col-header-cell-cushion {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Scrollbar (se compare in alcune viste) */
.fc-scroller {
  scrollbar-width: thin;
}

.fc-scroller::-webkit-scrollbar {
  width: 10px;
}

.fc-scroller::-webkit-scrollbar-thumb {
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: content-box;
  background-color: rgba(17, 24, 39, .20);
}

/* =========================
   DOTS (se li userai)
========================= */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-wk-auto {
  border: 1px solid #f0b98a;
  background: transparent;
}

.dot-wk-flag {
  background: #FFA500;
}

.dot-fest {
  background: #EF4444;
}

.dot-fest-auto {
  border: 1px solid #e33;
  background: transparent;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.pointer,
.pointer input[type="checkbox"] {
  cursor: pointer !important;
}

/* =========================
   MODALE
========================= */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 9998;
}

.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  width: 390px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .2);
  border: 1px solid #eef0f4;
}

.modal h3 {
  margin: 0 0 12px;
  color: #111827;
  font-weight: 900;
}

.modal .actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.modal input[type="date"],
.modal input[type="number"],
.modal textarea,
.modal select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #dfe3ec;
  border-radius: 10px;
  outline: none;
}

.modal input:focus,
.modal textarea:focus,
.modal select:focus {
  border-color: #ffbf4d;
  box-shadow: 0 0 0 3px rgba(255, 165, 0, .14);
}

label {
  font-size: 12px;
  color: #374151;
  display: block;
  margin: 8px 0 6px;
  font-weight: 700;
}

.inline-price-input {
  width: 80px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 13px;
  text-align: center;
}