/* ===== USER DROPDOWN CUSTOM ===== */
.dropdown-menu {
  border-radius: 14px !important;
  border: 1px solid #eee !important;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.12) !important;
  overflow: hidden;
}

/* Elementi del menu */
.dropdown-menu .dropdown-item {
  padding: 8px 14px !important;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

/* Hover effetto verde/limone */
.dropdown-menu .dropdown-item:hover {
  background-color: #e8ffb2 !important; /* verde lime pastello */
  color: #3b5b00 !important;
}

/* Icone generiche */
.dropdown-menu .dropdown-item i {
  font-size: 1.1rem;
  opacity: 0.85;
}

/* Logout rosso */
.dropdown-menu .dropdown-item.text-danger {
  color: #d9534f !important;
}

.dropdown-menu .dropdown-item.text-danger:hover {
  background-color: #ffe4e4 !important;
  color: #c9302c !important;
}

/* Divider più elegante */
.dropdown-divider {
  margin: 0 0 !important;
  border-top: 1px solid #ddd !important;
}

/* 🔴 Abbonamento scaduto */
.alert-badge-expired {
  width: 12px;
  height: 12px;
  background-color: red;
  border-radius: 50%;
  position: absolute;
  top: -2px;
  right: -5px;
  box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.7);
}

/* 🔔 Abbonamento in scadenza */
.alert-badge-warning {
  color: orange;
  font-size: 0.9rem;
  position: absolute;
  top: -5px;
  right: -8px;
  text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.7);
}

/* Messaggi chat compatti */
.chat-msg {
  max-width: 55%;
  padding: 6px 10px !important;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.2;
  margin-bottom: 4px;
  word-break: break-word;
}

.chat-right {
  background: #0d6efd;
  color: white;
  align-self: flex-end;
}

.chat-left {
  background: #f5f5f5;
  color: #222;
  align-self: flex-start;
}

/* badge rosso pieno */
.alert-badge-expired {
  width: 12px;
  height: 12px;
  background: red;
  border-radius: 50%;
  position: absolute;
  top: -3px;
  right: -3px;
  border: 2px solid #fff;
}

/* campanella gialla */
.alert-badge-warning {
  color: #ffeb00 !important;
  font-size: 18px;
  position: absolute;
  top: -5px;
  right: -5px;
}

select[disabled] {
  background-color: #e9ecef;
  cursor: not-allowed;
}

.text-prewrap {
  white-space: pre-wrap;
}

.qr-whatsapp {
  width: 100%;
  max-width: 320px; /* 🔥 dimensione ideale QR */
  height: auto;
  padding: 12px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e6e6e6;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.mini-agenda {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px 12px;
  max-width: 600px;
}

.mini-agenda-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}

.mini-agenda-time {
  font-weight: 600;
  color: #2563eb;
  min-width: 55px;
}

.mini-agenda-title {
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-agenda-empty {
  color: #9ca3af;
  font-size: 0.8rem;
}

.mini-agenda-card {
  border-left: 4px solid #2563eb;
}

.mini-agenda-item {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}

.mini-agenda-time {
  font-weight: 600;
  color: #2563eb;
  white-space: nowrap;
}

.mini-agenda-title {
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-agenda-empty {
  color: #9ca3af;
  font-size: 0.8rem;
}

/* Periodo A */
.cmp-a {
  background: rgba(13, 110, 253, 0.08); /* blu chiaro */
  color: #0d6efd;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-block;
}

/* Periodo B */
.cmp-b {
  background: rgba(255, 193, 7, 0.15); /* arancio chiaro */
  color: #d39e00;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-block;
}

/* layout valori confronto */
.cmp-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}

.cmp-arrow {
  color: #6c757d;
  font-weight: 500;
  margin: 0 4px;
}

.cmp-a {
  background: rgba(13, 110, 253, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-block;
}

.cmp-b {
  background: rgba(255, 193, 7, 0.15);
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-block;
}

.cmp-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}

#suggestionsBox {
  position: absolute;
  z-index: 2000; /* sopra le card */
  background: #fff;
}

.section-anagrafica {
  position: relative;
  z-index: 10;
}

.table-success-dark td {
  background-color: #75a58f !important;
  color: white;
}

/* ======================================
   BARRA LATERALE STATO VISITA
====================================== */

/* base: serve per posizionare la pseudo-barra */
.visit-row td:first-child {
  position: relative;
}

/* VERDE SCURO – pagamento anticipato */
.visit-row.table-success-dark td:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 5px;
  border-radius: 8px;
  background: linear-gradient(to bottom, #0f5132, #157347);
}

/* VERDE CHIARO – accettato */
.visit-row.table-success td:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 5px;
  border-radius: 8px;
  background: linear-gradient(to bottom, #157347, #198754);
}

/* GIALLO – in decisione */
.visit-row.table-warning td:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 5px;
  border-radius: 8px;
  background: linear-gradient(to bottom, #b58105, #ffc107);
}

/* ROSSO – non accettato */
.visit-row.table-danger td:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 5px;
  border-radius: 8px;
  background: linear-gradient(to bottom, #842029, #dc3545);
}

/* ===== USER DROPDOWN CUSTOM ===== */
.dropdown-menu {
  border-radius: 14px !important;
  border: 1px solid #eee !important;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.12) !important;
  overflow: hidden;
}

/* Elementi del menu */
.dropdown-menu .dropdown-item {
  padding: 8px 14px !important;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

/* Hover effetto verde/limone */
.dropdown-menu .dropdown-item:hover {
  background-color: #e8ffb2 !important; /* verde lime pastello */
  color: #3b5b00 !important;
}

/* Icone generiche */
.dropdown-menu .dropdown-item i {
  font-size: 1.1rem;
  opacity: 0.85;
}

/* Logout rosso */
.dropdown-menu .dropdown-item.text-danger {
  color: #d9534f !important;
}

.dropdown-menu .dropdown-item.text-danger:hover {
  background-color: #ffe4e4 !important;
  color: #c9302c !important;
}

/* Divider più elegante */
.dropdown-divider {
  margin: 0 0 !important;
  border-top: 1px solid #ddd !important;
}

/* 🔴 Abbonamento scaduto */
.alert-badge-expired {
  width: 12px;
  height: 12px;
  background-color: red;
  border-radius: 50%;
  position: absolute;
  top: -2px;
  right: -5px;
  box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.7);
}

/* 🔔 Abbonamento in scadenza */
.alert-badge-warning {
  color: orange;
  font-size: 0.9rem;
  position: absolute;
  top: -5px;
  right: -8px;
  text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.7);
}

/* Messaggi chat compatti */
.chat-msg {
  max-width: 55%;
  padding: 6px 10px !important;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.2;
  margin-bottom: 4px;
  word-break: break-word;
}

.chat-right {
  background: #0d6efd;
  color: white;
  align-self: flex-end;
}

.chat-left {
  background: #f5f5f5;
  color: #222;
  align-self: flex-start;
}

/* badge rosso pieno */
.alert-badge-expired {
  width: 12px;
  height: 12px;
  background: red;
  border-radius: 50%;
  position: absolute;
  top: -3px;
  right: -3px;
  border: 2px solid #fff;
}

/* campanella gialla */
.alert-badge-warning {
  color: #ffeb00 !important;
  font-size: 18px;
  position: absolute;
  top: -5px;
  right: -5px;
}

select[disabled] {
  background-color: #e9ecef;
  cursor: not-allowed;
}

.text-prewrap {
  white-space: pre-wrap;
}

.qr-whatsapp {
  width: 100%;
  max-width: 320px; /* 🔥 dimensione ideale QR */
  height: auto;
  padding: 12px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e6e6e6;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.mini-agenda {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px 12px;
  max-width: 600px;
}

.mini-agenda-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}

.mini-agenda-time {
  font-weight: 600;
  color: #2563eb;
  min-width: 55px;
}

.mini-agenda-title {
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-agenda-empty {
  color: #9ca3af;
  font-size: 0.8rem;
}

.mini-agenda-card {
  border-left: 4px solid #2563eb;
}

.mini-agenda-item {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}

.mini-agenda-time {
  font-weight: 600;
  color: #2563eb;
  white-space: nowrap;
}

.mini-agenda-title {
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-agenda-empty {
  color: #9ca3af;
  font-size: 0.8rem;
}

/* Periodo A */
.cmp-a {
  background: rgba(13, 110, 253, 0.08); /* blu chiaro */
  color: #0d6efd;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-block;
}

/* Periodo B */
.cmp-b {
  background: rgba(255, 193, 7, 0.15); /* arancio chiaro */
  color: #d39e00;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-block;
}

/* layout valori confronto */
.cmp-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}

.cmp-arrow {
  color: #6c757d;
  font-weight: 500;
  margin: 0 4px;
}

.cmp-a {
  background: rgba(13, 110, 253, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-block;
}

.cmp-b {
  background: rgba(255, 193, 7, 0.15);
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-block;
}

.cmp-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}

#suggestionsBox {
  position: absolute;
  z-index: 2000; /* sopra le card */
  background: #fff;
}

.section-anagrafica {
  position: relative;
  z-index: 10;
}

.table-success-dark td {
  background-color: #75a58f !important;
  color: white;
}

/* ======================================
   BARRA LATERALE STATO VISITA
====================================== */

/* base: serve per posizionare la pseudo-barra */
.visit-row td:first-child {
  position: relative;
}

/* VERDE SCURO – pagamento anticipato */
.visit-row.table-success-dark td:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 5px;
  border-radius: 8px;
  background: linear-gradient(to bottom, #0f5132, #157347);
}

/* VERDE CHIARO – accettato */
.visit-row.table-success td:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 5px;
  border-radius: 8px;
  background: linear-gradient(to bottom, #157347, #198754);
}

/* GIALLO – in decisione */
.visit-row.table-warning td:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 5px;
  border-radius: 8px;
  background: linear-gradient(to bottom, #b58105, #ffc107);
}

/* ROSSO – non accettato */
.visit-row.table-danger td:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 5px;
  border-radius: 8px;
  background: linear-gradient(to bottom, #842029, #dc3545);
}

/* ===============================
   💰 CASSA - KPI CARD
================================= */
.cassa-card {
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: 14px;
}

.cassa-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(247, 143, 30, 0.08),
    rgba(198, 227, 0, 0.08)
  );
  z-index: 0;
}

.cassa-card .card-body {
  position: relative;
  z-index: 1;
}

/* ===============================
   💰 BADGE PAGAMENTI
================================= */
.badge-soft {
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
  border: 1px solid transparent;
  font-size: 0.8rem;
}

/* Varianti */
.badge-soft-success {
  background: rgba(25, 135, 84, 0.1);
  color: #198754;
  border-color: rgba(25, 135, 84, 0.3);
}

.badge-soft-primary {
  background: rgba(13, 110, 253, 0.1);
  color: #0d6efd;
  border-color: rgba(13, 110, 253, 0.3);
}

.badge-soft-info {
  background: rgba(13, 202, 240, 0.1);
  color: #0dcaf0;
  border-color: rgba(13, 202, 240, 0.3);
}

.badge-soft-secondary {
  background: rgba(108, 117, 125, 0.1);
  color: #6c757d;
  border-color: rgba(108, 117, 125, 0.3);
}

/* ===============================
   💰 TABLE UX
================================= */
.table-hover tbody tr {
  transition: all 0.15s ease;
}

.table-hover tbody tr:hover {
  transform: scale(1.01);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.users-page .page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.users-page .page-title {
  margin: 0;
  font-weight: 700;
  color: #1f2937;
}

.users-page .page-subtitle {
  margin: 0.2rem 0 0;
  color: #6b7280;
  font-size: 0.95rem;
}

.users-page .card-soft {
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.users-page .card-soft .card-body {
  padding: 1rem 1.25rem;
}

.users-page .toolbar-form .form-control {
  border-radius: 0.8rem;
  min-height: 44px;
}

.users-page .toolbar-form .btn {
  min-height: 44px;
  border-radius: 0.8rem;
}

.users-page .table-wrap {
  border-radius: 1rem;
  overflow: hidden;
}

.users-page .table {
  margin-bottom: 0;
}

.users-page .table thead th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}

.users-page .table tbody tr:hover {
  background: #f8fbff;
}

.users-page .table td {
  vertical-align: middle;
}

.users-page .user-name {
  font-weight: 600;
  color: #111827;
}

.users-page .user-email {
  color: #6b7280;
  font-size: 0.92rem;
}

.users-page .badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.users-page .badge-role {
  background: #eff6ff;
  color: #1d4ed8;
}

.users-page .badge-active {
  background: #ecfdf5;
  color: #047857;
}

.users-page .badge-inactive {
  background: #fef2f2;
  color: #b91c1c;
}

.users-page .badge-report-on {
  background: #f0fdf4;
  color: #15803d;
}

.users-page .badge-report-off {
  background: #f8fafc;
  color: #64748b;
}

.users-page .actions-col {
  white-space: nowrap;
}

.users-page .actions-col .btn {
  border-radius: 0.7rem;
}

.users-page .empty-state {
  text-align: center;
  padding: 3rem 1.25rem;
  color: #6b7280;
}

.users-page .pagination-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 1.25rem;
}

.users-page .pagination {
  gap: 0.35rem;
  flex-wrap: wrap;
}

.users-page .pagination .page-link {
  border: 0;
  min-width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem !important;
  color: #334155;
  background: #f8fafc;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.users-page .pagination .page-item.active .page-link {
  background: #0d6efd;
  color: #fff;
}

.users-page .pagination .page-item.disabled .page-link {
  background: #f1f5f9;
  color: #94a3b8;
  box-shadow: none;
}

@media (max-width: 768px) {
  .users-page .page-header {
    align-items: stretch;
  }

  .users-page .page-header .btn {
    width: 100%;
  }

  .users-page .table thead {
    display: none;
  }

  .users-page .table,
  .users-page .table tbody,
  .users-page .table tr,
  .users-page .table td {
    display: block;
    width: 100%;
  }

  .users-page .table tbody tr {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
  }

  .users-page .table td {
    border: 0;
    padding: 0.35rem 0;
    text-align: left !important;
  }

  .users-page .table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 0.15rem;
  }

  .users-page .actions-col {
    padding-top: 0.75rem !important;
  }
}

/* ===============================
   CALENDARIO TURNI
================================ */

.calendario-turni-table th,
.calendario-turni-table td {
  vertical-align: top;
}

.turno-box {
  border: 1px solid #e9ecef;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
}

/* Contenitore cella */
.posizione-cella-turno {
  position: relative;
}

/* Pulsante "+" minimal */
.btn-add-turno {
  position: absolute;
  top: 6px;
  right: 6px;

  width: 20px;
  height: 20px;

  padding: 0;
  border-radius: 50%;

  font-size: 13px;
  font-weight: 600;
  line-height: 1;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #f1f3f5;
  color: #6c757d;
  border: 1px solid #dee2e6;

  transition: all 0.15s ease;
  z-index: 3;
}

/* Hover elegante */
.btn-add-turno:hover {
  background: #d1fae5; /* verde soft */
  color: #059669; /* verde principale */
  border-color: #a7f3d0;
  transform: scale(1.1);
}

/* Click */
.btn-add-turno:active {
  transform: scale(0.95);
}

/* Highlight cella turno */
.highlight-turno {
  animation: highlightFade 3s ease;
}

@keyframes highlightFade {
  0% {
    background-color: #d1fae5; /* verde chiaro */
  }
  50% {
    background-color: #ecfdf5;
  }
  100% {
    background-color: transparent;
  }
}

/* Turni cliccabili nel calendario */
.turno-box-link {
  transition: all 0.15s ease;
}

.turno-box-link:hover {
  border-color: #cfd4da;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
  cursor: pointer;
}

.cella-ferie-bloccata {
  background: #6c757d !important;
  color: #fff;
}

.cella-ferie-bloccata .text-muted,
.cella-ferie-bloccata .small {
  color: rgba(255, 255, 255, 0.85) !important;
}

.cella-ferie-bloccata .turno-box {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.ferie-calendar-table {
  white-space: nowrap;
  width: max-content;
  min-width: 100%;
}

.ferie-calendar-table th,
.ferie-calendar-table td {
  vertical-align: middle;
  text-align: center;
  font-size: 0.8rem;
  padding: 0.25rem;
}

.ferie-calendar-table td.bg-success-subtle,
.ferie-calendar-table td.bg-warning-subtle,
.ferie-calendar-table td.bg-danger-subtle,
.ferie-calendar-table td.bg-secondary-subtle {
  cursor: pointer;
}

.sticky-user-cell {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
}

.ferie-calendar-scroll {
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.5rem;
  background: #fff;

  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge legacy */
}

.ferie-calendar-scroll::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

.ferie-top-scrollbar {
  overflow-x: auto;
  overflow-y: hidden;
  height: 22px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.5rem;
  background: #f8f9fa;
}

.ferie-top-scrollbar-inner {
  height: 1px;
}

.ferie-top-scrollbar::-webkit-scrollbar {
  height: 12px;
}

.ferie-top-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 999px;
}

.ferie-top-scrollbar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
}

#ferieTabs {
  border-bottom: none;
  gap: 0.35rem;
}

#ferieTabs .nav-link {
  border: 1px solid transparent;
  border-radius: 0.6rem;
  color: #0d6efd;
  font-weight: 500;
  padding: 0.65rem 1rem;
  background: transparent;
}

#ferieTabs .nav-link.active {
  background: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
  box-shadow: 0 0.25rem 0.75rem rgba(13, 110, 253, 0.15);
}

#ferieTabs .nav-link:hover:not(.active) {
  background: rgba(13, 110, 253, 0.06);
  border-color: rgba(13, 110, 253, 0.15);
}

/* =========================
   HOME MODULI - NEW STYLE
========================= */

.home-modules-wrapper {
  max-width: 1180px;
  margin: 0 auto;
  padding-top: 0.5rem;
  padding-bottom: 2rem;
}

/* SALUTO */
.home-welcome-card {
  max-width: 980px;
  margin: 0 auto 2rem auto;
  background: #ffffff;
  border-radius: 26px;
  padding: 2.2rem 2rem;
  text-align: center;
  box-shadow: 0 10px 35px rgba(15, 23, 42, 0.06);
}

.home-welcome-title {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 800;
  color: #14213d;
  letter-spacing: -0.02em;
}

.home-welcome-subtitle {
  margin-top: 0.7rem;
  font-size: 1.2rem;
  color: #4b5563;
}

/* INTRO */
.home-modules-intro {
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 18px;
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.8rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.home-modules-intro-title {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1.9rem;
  font-weight: 800;
  color: #14213d;
  margin-bottom: 0.4rem;
}

.home-modules-intro-title i {
  color: #0d6efd;
  font-size: 1.5rem;
}

.home-modules-intro-text {
  color: #4b5563;
  font-size: 1.02rem;
}

/* CARD MODULO */
.module-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 140px;
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.06);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease;
  color: inherit;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.module-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 42px rgba(15, 23, 42, 0.1);
}

.module-box-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.25rem 0 1.25rem;
}

.module-box-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(4px);
  font-size: 1.6rem;
}

.module-box-title {
  padding: 1rem 1.25rem 0.8rem 1.25rem;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  color: #14213d;
  letter-spacing: -0.02em;
}

.module-box-footer {
  margin-top: auto;
  padding: 1rem 1.25rem 1.15rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #243b53;
}

.module-box-arrow {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(4px);
}

.module-box-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 1.2rem;
}

.module-box-title {
  padding: 0.6rem 0.9rem 0.4rem 0.9rem;
  font-size: 1.25rem; /* prima 2rem 🔴 troppo grande */
  font-weight: 700;
  letter-spacing: -0.01em;
}

.module-box-footer {
  padding: 0.7rem 0.9rem 0.9rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.8;
}

.module-box-arrow {
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
}

.home-welcome-title {
  font-size: 2rem; /* prima troppo grande */
}

.home-welcome-subtitle {
  font-size: 0.95rem;
}
.module-box-locked {
  opacity: 0.7;
}

.module-box-top {
  padding: 0.8rem 0.9rem 0 0.9rem;
}

/* TEMI COLORI */
.module-theme-orange {
  background: linear-gradient(135deg, #ffd36a 0%, #f6c453 100%);
}
.module-theme-orange .module-box-icon,
.module-theme-orange .module-box-arrow {
  color: #d97706;
}

.module-theme-blue {
  background: linear-gradient(135deg, #cfeeff 0%, #bddff3 100%);
}
.module-theme-blue .module-box-icon,
.module-theme-blue .module-box-arrow {
  color: #0ea5e9;
}

.module-theme-purple {
  background: linear-gradient(135deg, #e1c7ff 0%, #d2b0f0 100%);
}
.module-theme-purple .module-box-icon,
.module-theme-purple .module-box-arrow {
  color: #7c3aed;
}

.module-theme-sky {
  background: linear-gradient(135deg, #d9ecff 0%, #c7e0f5 100%);
}
.module-theme-sky .module-box-icon,
.module-theme-sky .module-box-arrow {
  color: #2563eb;
}

.module-theme-green {
  background: linear-gradient(135deg, #dcedb3 0%, #cfe49d 100%);
}
.module-theme-green .module-box-icon,
.module-theme-green .module-box-arrow {
  color: #4d7c0f;
}

.module-theme-red {
  background: linear-gradient(135deg, #ffd0b7 0%, #f6bb94 100%);
}
.module-theme-red .module-box-icon,
.module-theme-red .module-box-arrow {
  color: #ea580c;
}

.module-theme-teal {
  background: linear-gradient(135deg, #c9f1e7 0%, #b6e4d8 100%);
}
.module-theme-teal .module-box-icon,
.module-theme-teal .module-box-arrow {
  color: #0f766e;
}

/* BLOCCATO */
.module-box-locked {
  min-height: 185px;
  background: rgba(255, 255, 255, 0.55);
  border: 1.5px dashed #d4d4d8;
  box-shadow: none;
  opacity: 0.85;
  cursor: not-allowed;
}

.module-box-locked:hover {
  transform: none;
  box-shadow: none;
}

.module-box-icon-locked {
  background: rgba(0, 0, 0, 0.04);
  color: #9ca3af;
}

.module-box-lock {
  background: #d4d4d8;
  color: #6b7280;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.module-box-locked .module-box-title {
  color: #6b7280;
}

.module-box-footer.locked {
  color: #8b949e;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .home-welcome-card {
    padding: 1.7rem 1rem;
    border-radius: 20px;
  }

  .home-welcome-subtitle {
    font-size: 1rem;
  }

  .module-box-title {
    font-size: 1.6rem;
  }
}

.module-home-badge {
  min-width: 28px;
  height: 28px;
  padding: 0 0.55rem;
  border-radius: 999px;
  background: #dc3545;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(220, 53, 69, 0.28);
}

.menu-locked-item {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  opacity: 0.58;
  color: #6c757d !important;
  cursor: not-allowed;
  pointer-events: none;
}

.menu-locked-item:hover,
.menu-locked-item:focus {
  background-color: transparent !important;
  color: #6c757d !important;
}

.menu-lock-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #e9ecef;
  color: #6c757d;
  white-space: nowrap;
}

/* =========================
   MODALE INCASSO - FIX MOBILE
   ========================= */

#modalNuovoIncasso .modal-dialog {
  margin: 0.75rem auto;
}

#modalNuovoIncasso .modal-content {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 1.5rem);
  max-height: calc(100vh - 1.5rem);
  overflow: hidden;
}

#modalNuovoIncasso form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

#modalNuovoIncasso .modal-header,
#modalNuovoIncasso .modal-footer {
  flex-shrink: 0;
  background: #fff;
}

#modalNuovoIncasso .modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1rem;
}

@media (max-width: 576px) {
  #modalNuovoIncasso .modal-dialog {
    margin: 0.5rem;
  }

  #modalNuovoIncasso .modal-content {
    max-height: calc(100dvh - 1rem);
    max-height: calc(100vh - 1rem);
    border-radius: 0.75rem;
  }

  #modalNuovoIncasso .modal-body {
    padding: 1rem;
  }

  #modalNuovoIncasso .modal-footer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  }

  #modalNuovoIncasso .modal-footer .btn {
    width: 100%;
    margin: 0;
  }
}

.cella-ferie-bloccata {
  background: repeating-linear-gradient(
    45deg,
    #f8f9fa,
    #f8f9fa 8px,
    #eef0f2 8px,
    #eef0f2 16px
  ) !important;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .calendario-turni-table {
    min-width: 980px;
    font-size: 0.85rem;
  }

  .calendario-turni-table th:first-child,
  .calendario-turni-table td:first-child,
  .sticky-col {
    position: static !important;
    left: auto !important;
    z-index: auto !important;
    min-width: 150px !important;
    width: 150px !important;
    max-width: 150px !important;
    white-space: normal;
  }

  .calendario-turni-table th:not(:first-child),
  .calendario-turni-table td:not(:first-child) {
    min-width: 165px !important;
    width: 165px !important;
  }

  .turno-box {
    max-width: 145px;
    overflow: hidden;
  }

  .turno-box .badge {
    max-width: 135px;
    white-space: normal;
    line-height: 1.15;
  }

  .btn-add-turno {
    position: relative;
    z-index: 1;
  }
}

.riga-utente-loggato > td {
  background: #fff3cd !important;
}

.riga-utente-loggato .sticky-col {
  background: #ffe69c !important;
  border-left: 5px solid #ffc107 !important;
}

.turno-utente-loggato {
  background: #fff3cd !important;
  border: 2px solid #ffc107 !important;
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.25);
  position: relative;
}

.turno-utente-loggato::after {
  content: "Tu";
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 10px;
  font-weight: 700;
  background: #ffc107;
  color: #000;
  padding: 1px 6px;
  border-radius: 999px;
}

.ferie-card-dottore_igenista,
.ferie-header-dottore_igenista,
.ferie-row-dottore_igenista td.sticky-user-cell,
.ferie-group-dottore_igenista td {
  background: #e7f1ff !important;
  border-left: 5px solid #0d6efd !important;
}

.ferie-card-assistente,
.ferie-header-assistente,
.ferie-row-assistente td.sticky-user-cell,
.ferie-group-assistente td {
  background: #e8f8ef !important;
  border-left: 5px solid #198754 !important;
}

.ferie-card-segreteria,
.ferie-header-segreteria,
.ferie-row-segreteria td.sticky-user-cell,
.ferie-group-segreteria td {
  background: #fff3cd !important;
  border-left: 5px solid #ffc107 !important;
}

.ferie-card-non_specificato,
.ferie-header-non_specificato,
.ferie-row-non_specificato td.sticky-user-cell,
.ferie-group-non_specificato td {
  background: #f8f9fa !important;
  border-left: 5px solid #6c757d !important;
}

.ferie-nome-dottore_igenista,
.ferie-header-dottore_igenista {
  background: #e7f1ff !important;
  border-left: 5px solid #0d6efd !important;
}

.ferie-nome-assistente,
.ferie-header-assistente {
  background: #e6f4ec !important;
  border-left: 5px solid #198754 !important;
}

.ferie-nome-segreteria,
.ferie-header-segreteria {
  background: #fff3cd !important;
  border-left: 5px solid #ffc107 !important;
}

.ferie-nome-non_specificato,
.ferie-header-non_specificato {
  background: #f1f3f5 !important;
  border-left: 5px solid #6c757d !important;
}

.pv-page-header {
  background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
  border-radius: 24px;
  padding: 1.4rem 1.6rem;
  color: #fff;
  box-shadow: 0 18px 45px rgba(13, 110, 253, 0.18);
  margin-bottom: 1.5rem;
}

.pv-form-card {
  border: 0;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.1);
  background: #fff;
}

.pv-section {
  border: 1px solid #eef2f7;
  border-radius: 22px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.pv-section-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #334155;
  margin-bottom: 1rem;
}

.pv-section-title i {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef6ff;
  color: #0d6efd;
  font-size: 1rem;
}

.pv-soft-box {
  border: 1px solid #eef2f7;
  background: #f8fafc;
  border-radius: 18px;
  padding: 1rem;
}

.pv-switch-card {
  height: 100%;
  border: 1px solid #eef2f7;
  border-radius: 18px;
  padding: 1rem;
  background: #fff;
  transition: 0.15s ease;
}

.pv-switch-card:hover {
  border-color: #b6d4fe;
  box-shadow: 0 10px 25px rgba(13, 110, 253, 0.08);
}

.form-control,
.form-select {
  border-radius: 14px;
  padding: 0.65rem 0.85rem;
}

.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.22rem rgba(13, 110, 253, 0.12);
}

.form-check-input {
  cursor: pointer;
}

.pv-footer {
  background: #f8fafc;
  border-top: 1px solid #eef2f7;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  position: sticky;
  bottom: 0;
  z-index: 5;
}

.pv-btn-primary {
  border-radius: 14px;
  padding: 0.65rem 1.25rem;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(13, 110, 253, 0.2);
}

.pv-btn-light {
  border-radius: 14px;
  padding: 0.65rem 1.25rem;
  font-weight: 700;
}

.pv-table-permissions {
  border-radius: 18px;
  overflow: hidden;
}

.pv-muted-help {
  color: #64748b;
  font-size: 0.84rem;
}

.pv-mini-badge {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 18px;
  padding: 0.65rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.modal-content {
  border: 0;
  border-radius: 24px;
  overflow: hidden;
}

.modal-header {
  background: #f8fafc;
  border-bottom: 1px solid #eef2f7;
}

.modal-footer {
  background: #f8fafc;
  border-top: 1px solid #eef2f7;
}

@media (max-width: 768px) {
  .pv-page-header {
    border-radius: 18px;
    padding: 1rem;
  }

  .pv-section {
    padding: 1rem;
  }

  .pv-footer {
    flex-direction: column-reverse;
  }

  .pv-footer .btn {
    width: 100%;
  }
}

.ferie-imminente td {
  animation: lampeggioFerie 2s ease-in-out infinite;
}

@keyframes lampeggioFerie {
  0% {
    background-color: #ffffff;
  }

  50% {
    background-color: #ffcc80;
  }

  100% {
    background-color: #ffffff;
  }
}

.turno-box.turno-oscurato {
  opacity: 0.18;
  filter: grayscale(1);
}

.turno-box.turno-risultato {
  opacity: 1;
  filter: none;
  border: 2px solid #ffc107 !important;
  background: #fff3cd !important;
  box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.25);
  transform: scale(1.02);
}

.posizione-cella-turno.cella-con-risultato {
  background: #fff8e1 !important;
}


#modalVerificaFerie .modal-content {
    height: 85vh;
}

#modalVerificaFerie .modal-body.modal-verifica-ferie-body {
    overflow-y: auto;
}

#modalVerificaFerie .modal-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #dee2e6;
    z-index: 10;
}

#modalVerificaFerie .modal-header {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
    border-bottom: 1px solid #dee2e6;
}