* {
  box-sizing: border-box;
}

body,
html {
  font-family: "Inter", sans-serif;
}

.bapp {
  display: grid;
  grid-template-rows: 52px 1fr;
  grid-template-columns: 1fr 268px;
  height: calc(100vh - 72px);
  border-radius: 14px;
  overflow: hidden;
  border: 0.5px solid #dde3ec;
}

.btop {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: #fff;
  border-bottom: 0.5px solid #eef0f4;
  z-index: 10;
}

.btop-l {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btop-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.btop-date {
  font-size: 11px;
  color: #94a3b8;
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #15803d;
  background: #f0fdf4;
  border: 0.5px solid #bbf7d0;
  padding: 3px 9px;
  border-radius: 20px;
}

.ldot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: blink 2s infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.tbtn {
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 8px;
  border: 0.5px solid #e2e8f0;
  background: #fff;
  color: #374151;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tbtn:hover {
  background: #f8fafc;
}

/* Selettore data (stato della spiaggia per un giorno specifico) */
.date-ctrl {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 30px;
}

.date-ctrl__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  border: 0.5px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  padding: 0;
}

.date-ctrl__nav:hover {
  background: #f8fafc;
  color: #0f172a;
}

.date-ctrl__nav--prev {
  border-radius: 8px 0 0 8px;
  border-right: none;
}

.date-ctrl__nav--next {
  border-radius: 0 8px 8px 0;
  border-left: none;
}

.date-ctrl__field {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0.5px solid #e2e8f0;
  border-left: none;
  border-right: none;
  background: #fff;
  padding: 0 10px;
  cursor: pointer;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
}

.date-ctrl__field:hover {
  background: #f8fafc;
}

.date-ctrl.is-open .date-ctrl__field {
  background: #f1f5f9;
}

.date-ctrl__ico {
  color: #94a3b8;
  flex-shrink: 0;
  pointer-events: none;
}

.date-ctrl__today {
  display: flex;
  align-items: center;
  margin-left: 8px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 0 12px;
  border-radius: 8px;
  border: none;
  background: #0f172a;
  color: #fff;
  cursor: pointer;
}

.date-ctrl__today:hover {
  background: #1e293b;
}

/* Pannello calendario personalizzato (sostituisce il picker nativo del browser,
   non stilizzabile in modo coerente col resto dell'interfaccia) */
.date-picker {
  position: fixed;
  z-index: 30;
  width: 232px;
  max-width: calc(100vw - 20px);
  background: #fff;
  border: 0.5px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
  padding: 8px;
}

.date-picker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
  text-transform: capitalize;
}

.date-picker__head button {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #f1f5f9;
  border-radius: 6px;
  color: #64748b;
  cursor: pointer;
}

.date-picker__head button:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.date-picker__dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 2px;
}

.date-picker__dow span {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  padding: 4px 0;
}

.date-picker__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.date-picker__day {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  border-radius: 7px;
  border: none;
  background: transparent;
  font-family: "Inter", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}

.date-picker__day:hover {
  background: #f1f5f9;
}

.date-picker__day.is-muted {
  color: #cbd5e1;
}

.date-picker__day.is-today {
  box-shadow: inset 0 0 0 1.5px #94a3b8;
}

.date-picker__day.is-selected {
  background: #0f172a;
  color: #fff;
}

.date-picker__day.is-selected:hover {
  background: #1e293b;
}

.date-banner {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 7px 16px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

/* Spinner caricamento mappa */
.map-loading {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(180deg, #1f6f8a 0%, #2a8fae 40%, #e8c87a 100%);
  transition: opacity 0.3s ease;
}

.map-loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.map-loading__spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: map-spin 0.8s linear infinite;
}

.map-loading__text {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

@keyframes map-spin {
  to {
    transform: rotate(360deg);
  }
}

/* MAPPA */
.map-col {
  position: relative;
  overflow: hidden;
}

.map-scroll {
  position: absolute;
  inset: 0;
  overflow: auto;
}

.map-scene {
  position: relative;
}

.map-zoom-layer {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
}

.zoom-ctrl {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 0.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 3px;
}

.zbtn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-family: "Inter", sans-serif;
}

.zbtn:hover {
  background: #f1f5f9;
}

.zbtn.zreset {
  width: auto;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 500;
}

.zlabel {
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  width: 38px;
  text-align: center;
}

#lockBtn.is-locked {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.map-bg-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 0;
  pointer-events: none;
}
#walkwayGroup,
#towerGroup {
  pointer-events: all; /* ← abilita solo questi due */
  touch-action: none;
}
.map-canvas {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 0;
  pointer-events: none;
}

#beachMap {
  position: relative;
  width: 100%;
}

/* OMBRELLONE SVG */
.umb {
  position: absolute;
  cursor: pointer;
  user-select: none;
  z-index: 3;
  transition: transform 0.12s;
  pointer-events: auto;
  touch-action: none;
}

.umb:hover {
  transform: scale(1.1);
  z-index: 20;
}

.umb.dragging {
  opacity: 0.75;
  z-index: 100;
  cursor: grabbing;
}

.umb.hidden {
  opacity: 0.12;
  pointer-events: none;
}

/* Mappa bloccata: niente drag su ombrelloni, passerella e torre */
#beachMap.locked .umb {
  cursor: default;
}

.umb-svg {
  display: block;
  /* il bordo del cerchio e il badge ordini escono di qualche px dal viewBox */
  overflow: visible;
}

.umb-name-tag {
  font-family: "Inter", sans-serif;
  font-size: 9px;
  font-weight: 600;
  pointer-events: none;
}

/* MODAL */
.modal-back {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
}

/* SweetAlert deve poter comparire sopra la modale di assegnazione (es. avviso di conflitto) */
.swal2-container {
  z-index: 9500 !important;
}

.modal-back.open {
  display: flex;
}

.modal-box {
  background: #fff;
  border-radius: 14px;
  width: 320px;
  border: 0.5px solid #e2e8f0;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.14);
  overflow: hidden;
}

.mh {
  padding: 14px 16px;
  border-bottom: 0.5px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mh-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.mh-close {
  font-size: 18px;
  cursor: pointer;
  color: #94a3b8;
  background: none;
  border: none;
  line-height: 1;
  padding: 2px;
}

.mb {
  padding: 14px 16px;
}

.mb-info {
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mb-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #374151;
}

.mb-info-row i {
  color: #94a3b8;
  font-size: 14px;
  flex-shrink: 0;
  width: 16px;
}

.mb-sec {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 7px;
}

.form-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.form-label {
  font-size: 11px;
  font-weight: 500;
  color: #374151;
}

.form-input {
  padding: 6px 9px;
  border-radius: 7px;
  border: 0.5px solid #d1d5db;
  font-size: 12px;
  color: #0f172a;
  font-family: "Inter", sans-serif;
  outline: none;
  width: 100%;
}

.form-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
}

.mb-hint {
  font-size: 10.5px;
  color: #94a3b8;
  line-height: 1.4;
  margin: -2px 0 10px;
}

.divider {
  border: none;
  border-top: 0.5px solid #f1f5f9;
  margin: 10px 0;
}

.mb-slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 0.5px solid #e2e8f0;
  background: #fff;
  font-size: 12px;
  color: #374151;
  margin-bottom: 6px;
}

.mf {
  padding: 10px 16px;
  border-top: 0.5px solid #f1f5f9;
  display: flex;
  gap: 6px;
}

.mfbtn {
  flex: 1;
  padding: 7px;
  border-radius: 8px;
  border: 0.5px solid #e2e8f0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  background: #fff;
  color: #374151;
  font-family: "Inter", sans-serif;
}

.mfbtn:hover {
  background: #f8fafc;
}

.mfbtn.primary {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

.mfbtn.primary:hover {
  background: #1e293b;
}

.mfbtn.danger {
  color: #dc2626;
  border-color: #fecaca;
}

.mfbtn.danger:hover {
  background: #fff5f5;
}

.mfbtn.violet {
  color: #6366f1;
  border-color: #c7d2fe;
}

.mfbtn.violet:hover {
  background: #eef2ff;
}

.mfbtn.sm {
  flex: 0 0 auto;
  padding: 4px 9px;
  font-size: 11px;
}

/* SIDEBAR */
.bsidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-left: 0.5px solid #eef0f4;
}

.sb-blk {
  padding: 10px 14px;
  border-bottom: 0.5px solid #f1f5f9;
}

.sb-h {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1px;
}

.sb-s {
  font-size: 11px;
  color: #94a3b8;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 9px 12px;
  border-bottom: 0.5px solid #f1f5f9;
}

.sc {
  background: #f8fafc;
  border-radius: 8px;
  padding: 7px;
  text-align: center;
}

.sc-n {
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
}

.sc-l {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 1px;
}

.leg {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 14px;
  border-bottom: 0.5px solid #f1f5f9;
}

.li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: #374151;
}

.ld {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fltrs {
  display: flex;
  gap: 3px;
  padding: 7px 12px;
  border-bottom: 0.5px solid #f1f5f9;
  flex-wrap: wrap;
}

.fb {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 20px;
  border: 0.5px solid #e2e8f0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-weight: 500;
  font-family: "Inter", sans-serif;
}

.fb:hover {
  background: #f8fafc;
}

.fb.f-all {
  background: #dbeafe;
  color: #1e40af;
  border-color: #dbeafe;
}

.fb.f-free {
  background: #dcfce7;
  color: #166534;
  border-color: #dcfce7;
}

.fb.f-occ {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fee2e2;
}

.fb.f-ord {
  background: #ffedd5;
  color: #9a3412;
  border-color: #fdba74;
}

.sb-lbl {
  padding: 8px 14px 3px;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.orders-area {
  flex: 0 0 auto;
  max-height: 185px;
  overflow-y: auto;
  padding: 0 10px 6px;
}

.oc {
  border-left: 2px solid #fb923c;
  border-radius: 0 8px 8px 0;
  padding: 6px 9px;
  margin-bottom: 4px;
  background: #fff7ed;
}

.oc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1px;
}

.oc-code {
  font-size: 12px;
  font-weight: 700;
  color: #9a3412;
}

.oc-name {
  font-size: 11px;
  color: #6b7280;
}

.oc-det {
  font-size: 11px;
  color: #374151;
}

.oc-time {
  font-size: 10px;
  color: #ea580c;
  margin-top: 2px;
}

.unplaced-area {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px 10px;
}

.up {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border-radius: 8px;
  border: 0.5px solid #e2e8f0;
  background: #f8fafc;
  margin-bottom: 3px;
  cursor: grab;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  user-select: none;
  font-family: "Inter", sans-serif;
}

.up:hover {
  background: #fff;
  border-color: #c7d2fe;
}

.empty-msg {
  text-align: center;
  padding: 12px;
  font-size: 12px;
  color: #94a3b8;
}


.sb-hint {
  padding: 6px 14px;
  font-size: 10px;
  color: #94a3b8;
  border-top: 0.5px solid #f1f5f9;
}

.btoast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #0f172a;
  color: #fff;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 12px;
  z-index: 9999;
  pointer-events: none;
  transition: opacity 0.4s;
  font-family: "Inter", sans-serif;
}
