/* Identità Polisportiva Viadana — navy / oro */
:root {
  --pol-navy: #0A2472;
  --pol-navy-mid: #1E3A6E;
  --pol-navy-light: #9DB4E0;
  --pol-gold: #FFD60A;
  --pol-surface: #EAF0FB;
  --pol-border: #D8E0F0;
  --pol-text-muted: #5F7199;
}

/* Bootstrap override primario */
.bg-primary,
.navbar.bg-primary,
.btn-primary {
  --bs-primary: var(--pol-navy);
  --bs-primary-rgb: 10, 36, 114;
}
.btn-primary {
  background-color: var(--pol-navy) !important;
  border-color: var(--pol-navy) !important;
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--pol-navy-mid) !important;
  border-color: var(--pol-navy-mid) !important;
}
.btn-outline-primary {
  --bs-primary: var(--pol-navy);
  color: var(--pol-navy) !important;
  border-color: var(--pol-border) !important;
}
.btn-outline-primary:hover,
.btn-outline-primary.active,
.btn-outline-primary:active {
  background-color: var(--pol-navy) !important;
  border-color: var(--pol-navy) !important;
  color: #fff !important;
}

/* Navbar navy + logo */
.navbar-politop {
  background-color: var(--pol-navy) !important;
  padding: 0.45rem 1rem;
  min-height: 48px;
}
.navbar-politop .navbar-brand,
.navbar-politop .pol-navbar-brand,
.pol-navbar-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0;
  margin-right: 0.75rem;
  background: none !important;
  border: none;
  box-shadow: none;
  text-decoration: none;
}
.pol-logo-symbol {
  height: 40px;
  width: 40px;
  max-height: 44px;
  max-width: 44px;
  object-fit: contain;
  display: block;
  background: transparent;
  flex-shrink: 0;
}
.pol-brand-text {
  color: var(--pol-gold, #FFD60A);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
  line-height: 1.1;
  white-space: nowrap;
}
.pol-navbar-brand-link:hover .pol-brand-text,
.pol-navbar-brand-link:focus .pol-brand-text {
  color: #fff;
}
@media (max-width: 575px) {
  .pol-brand-text {
    font-size: 0.9rem;
  }
}
.pol-top-link-active {
  background-color: rgba(255, 255, 255, 0.22) !important;
}

/* Admin header allineato */
#header.polisportiva-unified-header {
  background: var(--pol-navy) !important;
}

/* Shell calendario compatto (mockup Claude) */
main.container-fluid.pol-main-compact {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.pol-cal-shell {
  background: #fff;
  border: 0.5px solid var(--pol-border);
  border-radius: 10px;
  overflow: hidden;
}
.pol-cal-body {
  padding: 0.65rem 1rem 0.75rem;
}
.pol-cal-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.65rem;
}
.pol-cal-toolbar-modes {
  flex: 1 1 100%;
  margin-bottom: 0.35rem;
}
/* Toolbar calendario: sinistra (modalità + palestre) | destra (data + zoom) */
.pol-cal-toolbar-unified {
  --pol-cal-tb-fs: 0.8125rem;
  --pol-cal-tb-h: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  font-size: var(--pol-cal-tb-fs);
  line-height: 1.2;
}
.pol-cal-toolbar-unified .pol-cal-toolbar-left-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
}
.pol-cal-toolbar-unified .pol-cal-toolbar-palestre-block {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.pol-cal-toolbar-unified .pol-cal-toolbar-right-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.pol-cal-toolbar-unified .pol-cal-mode-tabs {
  flex-shrink: 0;
}
.pol-cal-toolbar-unified .pol-cal-palestre-wrap {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.pol-cal-toolbar-unified .pol-cal-palestre-inline {
  flex-wrap: nowrap !important;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.pol-cal-toolbar-unified .pol-cal-palestre-inline::-webkit-scrollbar {
  display: none;
}
.pol-cal-toolbar-unified .pol-cal-palestra-btn,
.pol-cal-toolbar-unified .pol-cal-nuova-btn {
  flex-shrink: 0;
}
/* Stessa dimensione testo su tutta la toolbar */
.pol-cal-toolbar-unified .pol-cal-tab,
.pol-cal-toolbar-unified .pol-cal-palestra-btn,
.pol-cal-toolbar-unified .pol-cal-nuova-btn,
.pol-cal-toolbar-unified .pol-cal-date-title,
.pol-cal-toolbar-unified .pol-cal-today-btn,
.pol-cal-toolbar-unified .pol-cal-fc-view-btn,
.pol-cal-toolbar-unified .pol-cal-nav-btn,
.pol-cal-toolbar-unified .pol-cal-date-arrow {
  font-size: var(--pol-cal-tb-fs);
}
.pol-cal-toolbar-unified .pol-cal-tab,
.pol-cal-toolbar-unified .pol-cal-palestra-btn,
.pol-cal-toolbar-unified .pol-cal-nuova-btn,
.pol-cal-toolbar-unified .pol-cal-today-btn,
.pol-cal-toolbar-unified .pol-cal-fc-view-btn,
.pol-cal-toolbar-unified .pol-cal-nav-btn {
  line-height: 1.2;
}
.pol-cal-toolbar-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem 0.75rem;
  width: 100%;
}
.pol-cal-toolbar-actions--multi {
  grid-template-columns: 1fr;
  justify-items: center;
}
.pol-cal-toolbar-left {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  justify-self: start;
}
.pol-cal-toolbar-center {
  justify-self: center;
  min-width: 0;
}
.pol-cal-toolbar-actions .pol-cal-toolbar-right {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  justify-self: end;
  margin-left: 0;
}
.pol-cal-palestre-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
}
.pol-cal-palestre-inline {
  min-width: 0;
}
.pol-cal-nuova-btn {
  white-space: nowrap;
}
/* Navigazione date — stile Google Calendar */
.pol-cal-date-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.pol-cal-date-nav-core {
  display: grid;
  grid-template-columns: var(--pol-cal-tb-h, 2rem) minmax(0, 1fr) var(--pol-cal-tb-h, 2rem);
  align-items: center;
  width: 17.5rem;
  flex-shrink: 0;
}
.pol-cal-date-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--pol-cal-tb-h, 2rem);
  height: var(--pol-cal-tb-h, 2rem);
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--pol-navy);
  color: #fff;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  justify-self: center;
  transition: background-color 0.15s ease;
}
.pol-cal-date-arrow:hover,
.pol-cal-date-arrow:focus {
  background: var(--pol-navy-mid);
  color: #fff;
}
.pol-cal-date-title {
  font-weight: 600;
  color: var(--pol-navy);
  padding: 0 0.25rem;
  min-width: 0;
  width: 100%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pol-cal-today-btn {
  margin-left: 0;
  padding: 0.35rem 0.75rem;
  border: 0.5px solid var(--pol-border);
  border-radius: 999px;
  background: #fff;
  color: var(--pol-navy);
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.pol-cal-today-btn:hover {
  background: var(--pol-surface);
}
/* Zoom FullCalendar (solo Singola palestra) */
.pol-cal-fc-view-tabs {
  display: inline-flex;
  background: #fff;
  border: 0.5px solid var(--pol-border);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}
.pol-cal-fc-view-btn {
  font-size: 0.75rem;
  padding: 5px 9px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--pol-navy);
  cursor: pointer;
  white-space: nowrap;
}
.pol-cal-fc-view-btn:hover {
  background: var(--pol-surface);
}
.pol-cal-fc-view-btn.pol-cal-fc-view-active {
  background: var(--pol-gold);
  color: var(--pol-navy);
  font-weight: 600;
}
.pol-cal-night-btn {
  min-width: 3.5rem;
  flex-shrink: 0;
  text-align: center;
}
.pol-cal-night-btn .pol-cal-night-prefix {
  font-weight: 500;
}
@media (max-width: 1199px) {
  .pol-cal-toolbar-unified .pol-cal-toolbar-right-group {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.35rem;
  }
  .pol-cal-night-btn {
    order: 10;
    flex: 0 0 auto;
  }
}
@media (max-width: 1199px) {
  .pol-cal-toolbar-unified {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }
  .pol-cal-toolbar-unified .pol-cal-toolbar-left-group {
    flex: 1 1 100%;
  }
  .pol-cal-toolbar-unified .pol-cal-toolbar-right-group {
    flex: 1 1 100%;
    justify-content: flex-end;
  }
  .pol-cal-date-nav-core {
    width: min(17.5rem, 100%);
  }
  .pol-cal-toolbar-actions {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }
  .pol-cal-toolbar-left {
    justify-self: stretch;
    flex-wrap: wrap;
  }
  .pol-cal-toolbar-center {
    justify-self: center;
  }
  .pol-cal-toolbar-actions .pol-cal-toolbar-right {
    justify-self: center;
    flex-wrap: wrap;
    justify-content: center;
  }
  .pol-cal-date-title {
    font-size: 1rem;
    min-width: 7rem;
  }
}
@media (max-width: 575px) {
  .pol-cal-date-arrow {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.35rem;
  }
  .pol-cal-date-title {
    font-size: 0.9375rem;
    min-width: 5.5rem;
    max-width: 10rem;
  }
  .pol-cal-toolbar-unified .pol-cal-date-arrow {
    width: var(--pol-cal-tb-h);
    height: var(--pol-cal-tb-h);
    font-size: var(--pol-cal-tb-fs);
  }
  .pol-cal-toolbar-unified .pol-cal-date-title {
    font-size: var(--pol-cal-tb-fs);
    max-width: none;
  }
}
.pol-cal-mode-tabs {
  flex-wrap: wrap;
  max-width: 100%;
}
.pol-cal-mode-tabs .pol-cal-tab {
  font-size: 0.8125rem;
  padding: 5px 10px;
}
.pol-cal-toolbar-row .pol-cal-tabs {
  flex: 0 0 auto;
}
.pol-cal-toolbar-mid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-width: 0;
}
.pol-cal-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}
.pol-cal-tabs {
  display: inline-flex;
  background: var(--pol-surface);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.pol-cal-tab {
  font-size: 0.8125rem;
  padding: 5px 12px;
  border-radius: 6px;
  color: var(--pol-navy);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 500;
}
.pol-cal-tab:hover {
  color: var(--pol-navy);
  background: rgba(255, 255, 255, 0.6);
}
.pol-cal-tab-active {
  background: var(--pol-navy) !important;
  color: #fff !important;
}
.pol-cal-nav-btn {
  border: 0.5px solid var(--pol-border);
  background: #fff;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 0.8125rem;
  color: var(--pol-navy);
  line-height: 1;
  cursor: pointer;
}
.pol-cal-nav-btn:hover {
  background: var(--pol-surface);
}
.pol-cal-date-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--pol-navy);
  min-width: 7rem;
  text-align: center;
}
.pol-cal-palestra-btn {
  font-size: 0.8125rem;
  padding: 5px 11px;
  border-radius: 6px;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pol-cal-palestra-active {
  background: var(--pol-navy) !important;
  color: #fff !important;
  border-color: var(--pol-navy) !important;
}
.pol-cal-footnote {
  margin-top: 0.5rem;
  font-size: 0.6875rem;
  color: var(--pol-text-muted);
}
.pol-cal-footnote a {
  color: var(--pol-navy);
}

/* Blocchi prenotazione due livelli */
.pol-event-block {
  display: flex;
  height: 100%;
  min-height: 100%;
  border-radius: 4px;
  overflow: hidden;
  box-sizing: border-box;
}
.pol-event-bar-soc {
  width: 6px;
  flex-shrink: 0;
}
.pol-event-body {
  flex: 1;
  min-width: 0;
  padding: 1px 4px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  line-height: 1.15;
  overflow: hidden;
}
.pol-event-tag-soc {
  font-size: 0.625rem;
  font-weight: 700;
  opacity: 0.95;
  letter-spacing: 0.03em;
}
.pol-event-title {
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pol-event-sub {
  display: block;
  font-size: 0.625rem;
  font-weight: 500;
  line-height: 1.15;
  opacity: 0.92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* FullCalendar eventi due livelli */
.fc-event.pol-fc-event .fc-event-main {
  padding: 0 !important;
}
.fc-event.pol-fc-event {
  border: none !important;
  padding: 0 !important;
}

/* FC toolbar integrata nel tema */
#calendar-wrap .fc-toolbar {
  margin-bottom: 0.4rem !important;
}
#calendar-wrap .fc .fc-button-primary {
  background-color: var(--pol-navy);
  border-color: var(--pol-navy);
}
#calendar-wrap .fc .fc-button-primary:not(:disabled).fc-button-active,
#calendar-wrap .fc .fc-button-primary:not(:disabled):active {
  background-color: var(--pol-navy-mid);
  border-color: var(--pol-navy-mid);
}
#calendar-wrap .fc .fc-col-header-cell {
  background: var(--pol-navy);
  color: #fff;
}
#calendar-wrap .fc .fc-col-header-cell-cushion {
  color: #fff !important;
}
/* Giorno/data: +50% rispetto a 0.8rem base; solo testo, striscia navy altezza fissa */
#calendar-wrap .fc .fc-col-header-cell-cushion,
#calendar-wrap .fc .fc-day-header-content,
#calendar .fc .fc-col-header-cell-cushion,
#calendar .fc .fc-day-header-content {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.15;
}

@media (max-width: 768px) {
  .pol-cal-toolbar-row {
    flex-direction: column;
    align-items: stretch;
  }
  .pol-cal-toolbar-right {
    margin-left: 0;
    justify-content: flex-start;
  }
}

/* Tab viste calendario: etichette brevi su mobile */
.pol-cal-tab-short {
  display: none;
}

/* Calendario su smartphone: full-width, toolbar impilata, tab scrollabili */
@media (max-width: 767.98px) {
  main.container-fluid.pol-main-compact {
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
  }
  .pol-cal-shell {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .pol-cal-body {
    padding: 0.4rem 0.35rem 0.5rem;
  }
  .pol-cal-tab-long {
    display: none;
  }
  .pol-cal-tab-short {
    display: inline;
  }
  .pol-cal-toolbar-unified {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }
  .pol-cal-toolbar-unified .pol-cal-toolbar-left-group {
    flex-wrap: wrap;
    width: 100%;
    min-width: 0;
  }
  .pol-cal-toolbar-unified .pol-cal-toolbar-right-group {
    flex-wrap: wrap;
    width: 100%;
    justify-content: space-between;
    gap: 0.35rem;
  }
  .pol-cal-mode-tabs {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 1;
  }
  .pol-cal-mode-tabs::-webkit-scrollbar {
    display: none;
  }
  .pol-cal-toolbar-palestre-block {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }
  .pol-cal-toolbar-ambito {
    flex: 1 1 100%;
    width: 100%;
  }
  .pol-cal-toolbar-ambito .pol-cal-ambito-tabs {
    width: 100%;
  }
  .pol-cal-mobile-filter-row {
    display: flex;
    align-items: stretch;
    gap: 0.35rem;
    width: 100%;
    margin-bottom: 0.35rem;
  }
  .pol-cal-mobile-filter-row.pol-cal-toolbar-ambito .pol-cal-ambito-nav {
    flex: 0 0 auto;
  }
  .pol-cal-mobile-filter-row .pol-cal-ambito-tabs {
    width: auto;
  }
  .pol-cal-palestra-select-mobile {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.8125rem;
  }
  .pol-cal-mobile-nuova-row {
    width: 100%;
    margin-bottom: 0.35rem;
  }
  .pol-cal-toolbar-palestre-block {
    width: 100%;
  }
  .pol-cal-palestre-dropdown {
    width: 100%;
  }
  .pol-cal-palestre-dropdown .pol-cal-palestra-btn {
    width: 100%;
    text-align: left;
  }
  .pol-cal-nuova-btn {
    width: 100%;
  }
  .pol-cal-date-nav-core {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
  }
  .pol-cal-fc-view-tabs {
    flex-wrap: wrap;
  }
  #calendar-wrap .fc .fc-col-header-cell-cushion,
  #calendar-wrap .fc .fc-day-header-content,
  #calendar .fc .fc-col-header-cell-cushion,
  #calendar .fc .fc-day-header-content {
    font-size: 0.7rem;
    padding: 0.15rem 0.1rem;
  }
  #calendar-wrap .fc .fc-timegrid-slot-label-cushion {
    font-size: 0.65rem;
  }
  .pol-cal-mobile-hint {
    padding-left: 0.35rem !important;
    padding-right: 0.35rem !important;
  }
}
