/* ==============================
   Pet Resort – Il Gelsomino
   Custom Styles
   ============================== */

:root {
  /* Palette allineata alla landing page (salvia + accento oro) */
  --primary:       #5E8C7A;   /* landing --v-600 */
  --primary-mid:   #6F9E8B;   /* landing --v-500 */
  --primary-light: #93B5A7;   /* landing --v-400 */
  --primary-deep:  #375547;   /* landing --v-800 (fondo del gradiente pulsanti) */
  --primary-grad:  linear-gradient(135deg,#5E8C7A,#375547); /* gradiente pulsanti come landing */
  --primary-ultra: #E4EEE9;   /* landing --v-100 */
  --accent:        #C8A24B;   /* landing gold */
  --accent-dark:   #AD8636;   /* landing gold-600 */
  --sidebar-w:     240px;
  --topbar-h:      60px;
  --bg:            #F1F6F3;    /* landing --v-50 (più fredda della vecchia crema) */
  --card-radius:   12px;
  --shadow:        0 1px 6px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #fff;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  transition: transform .28s ease;
}

.sidebar.collapsed {
  transform: translateX(calc(-1 * var(--sidebar-w)));
}

.sidebar-header {
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
}

.logo > i {
  font-size: 2rem;
  color: var(--accent);
  line-height: 1;
}

.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .3px;
}

.brand-sub {
  font-size: .7rem;
  opacity: .65;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 20px;
  color: rgba(255,255,255,.78);
  text-decoration: none;
  font-size: .92rem;
  transition: background .18s, color .18s, border-left .18s;
  border-left: 3px solid transparent;
}

.nav-item i { font-size: 1.05rem; width: 20px; text-align: center; }

.nav-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.nav-item.active {
  background: rgba(255,255,255,.13);
  color: #fff;
  border-left-color: var(--accent);
  font-weight: 600;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .78rem;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  transition: margin .28s ease;
}

.main-content.expanded { margin-left: 0; }

/* ===== TOPBAR ===== */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.page-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  flex: 1;
  color: var(--primary);
}

.sidebar-toggle {
  background: none;
  border: 1px solid #dee2e6;
  border-radius: 7px;
  font-size: 1.15rem;
  cursor: pointer;
  color: #555;
  padding: 4px 9px;
  line-height: 1.4;
}

.sidebar-toggle:hover { background: #f5f5f5; }

/* ===== PAGE CONTENT ===== */
.page-content { padding: 22px 24px; flex: 1; }
.page { display: none; }
.page.active { display: block; }

/* ===== STAT CARDS ===== */
.stat-card {
  background: #fff;
  border-radius: var(--card-radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
}

.bg-primary-soft { background: var(--primary-ultra); color: var(--primary); }
.bg-success-soft  { background: #e8f0ec; color: #5E8C7A; }
.bg-warning-soft  { background: #f5f0e8; color: #8a7a5e; }
.bg-info-soft     { background: #e8ede8; color: #5E8C7A; }

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--primary);
}

.stat-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #6c757d;
}

/* ===== CARDS ===== */
.card {
  border: none !important;
  box-shadow: var(--shadow);
  border-radius: var(--card-radius) !important;
}

.card-header {
  background: #fff !important;
  border-bottom: 1px solid #f0f0f0 !important;
  border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
  font-weight: 600;
  padding: 13px 20px !important;
  font-size: .93rem;
}

/* ===== DOG LIST (dashboard) ===== */
.dog-list {
  list-style: none;
  padding: 0; margin: 0;
}

.dog-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid #f5f5f5;
  font-size: .9rem;
}

.dog-list-item:last-child { border-bottom: none; }

.dog-list-empty {
  padding: 18px;
  text-align: center;
  color: #aaa;
  font-style: italic;
  font-size: .88rem;
}

.dieta-popover {
  border-left: 3px solid #ffc107;
  border-radius: 8px;
  background: #fff;
}

.dieta-quick-btn {
  border-radius: 6px;
  flex-shrink: 0;
}

/* ===== DOG DOT ===== */
.dog-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===== DOG AVATAR ===== */
.dog-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.dog-avatar.lg {
  width: 56px; height: 56px;
  font-size: 1.4rem;
}

/* ===== DOG PREVIEW CARD (booking form) ===== */
.dog-preview-card {
  background: #ffffff;
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 12px 14px;
}

/* ===== FARMACI BADGE ===== */
.farmaci-badge {
  display: inline-block;
  font-size: .78rem;
  color: #dc3545;
  background: #fff0f2;
  border: 1px solid #f5c6cb;
  border-radius: 6px;
  padding: 3px 8px;
}

/* ===== AVAILABILITY CHECK ===== */
#availabilityCheck .alert {
  font-size: .85rem;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 0;
}

/* ===== SECTION LABEL (modal) ===== */
.section-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #868e96;
  font-weight: 700;
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 6px;
}

/* ===== TABLE ===== */
.table thead th {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #868e96;
  font-weight: 700;
  border-top: none;
  background: #fafafa;
  padding: 10px 14px;
}

.table tbody td {
  vertical-align: middle;
  padding: 10px 14px;
  font-size: .88rem;
}

.table-hover tbody tr:hover { background: #f2f5f3 !important; }

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--primary-grad) !important;
  border-color: transparent !important;
  color: #fff !important;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #557f6e, #2e4a3c) !important;
  border-color: transparent !important;
}

/* ===== CALENDAR ===== */
#calendar { min-height: 580px; }

.fc-toolbar-title { font-size: 1.1rem !important; font-weight: 700 !important; }

.fc-button-primary {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}

.fc-button-primary:hover {
  background-color: var(--primary-deep) !important;
  border-color: var(--primary-deep) !important;
}

.fc-button-primary:not(:disabled).fc-button-active,
.fc-button-primary:not(:disabled):active {
  background-color: var(--primary-deep) !important;
  border-color: var(--primary-deep) !important;
}

/* Full day highlight */
.fc-day-full { background: rgba(220,53,69,.06) !important; }

.fc-event {
  border-radius: 5px !important;
  font-size: .8rem !important;
  font-weight: 500 !important;
  padding: 1px 5px !important;
  border: none !important;
  cursor: pointer;
}

/* ===== TOM SELECT ===== */
.ts-control {
  border-radius: 8px !important;
  min-height: 38px;
}

.ts-dropdown { border-radius: 8px !important; box-shadow: 0 4px 16px rgba(0,0,0,.1) !important; }

.ts-no-results-custom {
  border-top: 1px solid #f0f0f0;
}

/* Sovrascrive il messaggio di default "No results" di Tom Select */
.ts-dropdown .no-results { display: none !important; }

/* ===== PROGRESS BAR ===== */
.progress { background: #e9ecef; }
.progress-bar { background: var(--primary-light) !important; }
.progress-bar.bg-danger { background: #dc3545 !important; }

/* ===== MODAL ===== */
.modal-content { border-radius: 14px !important; border: none !important; }
.modal-header { border-bottom: 1px solid #f0f0f0; }
.modal-footer { border-top: 1px solid #f0f0f0; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  /* Sidebar */
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
    box-shadow: 4px 0 16px rgba(0,0,0,.2);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }

  /* Spacing */
  .page-content { padding: 12px 10px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .page-title { font-size: .95rem; }

  /* Stat cards: 2 colonne su mobile */
  .stat-card { padding: 14px 12px; }
  .stat-value { font-size: 1.6rem; }

  /* Card headers wrappable */
  .card-header { padding: 10px 14px !important; }

  /* Tabelle: testo più piccolo su mobile */
  .table tbody td { padding: 8px 10px; font-size: .82rem; }
  .table thead th { padding: 8px 10px; font-size: .7rem; }

  /* Pulsanti azione più grandi (touch target) */
  .btn-sm { padding: .35rem .55rem; font-size: .82rem; }

  /* Calendar: toolbar compatta */
  .fc .fc-toolbar { flex-wrap: wrap; gap: 6px; }
  .fc .fc-toolbar-title { font-size: .95rem !important; }
  .fc .fc-button { padding: .25rem .5rem !important; font-size: .78rem !important; }
  .fc .fc-button-group .fc-button { padding: .25rem .45rem !important; }

  /* Form prenotazione: campi full width */
  #formPrenotazione .row .col-6 { width: 50%; }

  /* Dog preview card compatta */
  .dog-preview-card { padding: 10px; }

  /* Topbar: nascondi testo "Nuova prenotazione" su schermi molto piccoli */
}

@media (max-width: 400px) {
  .page-content { padding: 8px 8px; }
  .stat-value { font-size: 1.4rem; }
}

/* ===== BRAND OVERRIDES ===== */
.stat-value.text-success { color: var(--primary) !important; }
.stat-value.text-warning { color: var(--accent-dark) !important; }
.stat-value.text-info    { color: var(--primary-mid) !important; }

.badge.bg-success { background: var(--primary-light) !important; }
.btn-outline-success { color: var(--primary) !important; border-color: var(--primary-light) !important; }
.btn-outline-success:hover { background: var(--primary-light) !important; color: #fff !important; border-color: var(--primary-light) !important; }

/* ===== PERMESSI UTENTE ===== */
.perm-item {
  padding: 6px 0;
  border-bottom: 1px solid #f5f5f5;
}
.perm-item:last-child { border-bottom: none; }
.perm-item .form-check-label {
  font-size: .88rem;
  cursor: pointer;
}
.form-check-input:checked {
  background-color: var(--primary-light) !important;
  border-color: var(--primary-light) !important;
}

/* Nasconde elementi in base ai permessi granulari */
body.no-perm-edit-pren .btn-action-edit    { display: none !important; }
body.no-perm-checkin .btn-action-checkin   { display: none !important; }
body.no-perm-checkin .btn-action-checkout  { display: none !important; }
body.no-perm-del-pren .btn-action-delete   { display: none !important; }
body.no-perm-edit-anag .btn-action-edit-anag { display: none !important; }
body.no-perm-del-anag .btn-action-del-anag   { display: none !important; }

/* ===== RICHIESTE WEB ===== */
.richiesta-item {
  transition: background .15s;
}
.richiesta-item:hover {
  background: #fefcf5;
}
.richiesta-item:last-child {
  border-bottom: none !important;
}

/* ===== SIDEBAR USER / PROFILE ===== */
.sidebar-user-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 8px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  border-radius: 8px;
  padding: 2px;
  transition: background .2s;
}
.sidebar-user:hover {
  background: rgba(255,255,255,.08);
}

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-user-info { min-width: 0; flex: 1; }

.sidebar-user-name {
  font-weight: 600;
  font-size: .82rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.sidebar-user-role {
  font-size: .65rem;
  color: rgba(255,255,255,.6);
  line-height: 1.2;
}

.sidebar-logout-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.45);
  cursor: pointer;
  font-size: .95rem;
  padding: 4px 6px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: color .2s, background .2s;
}
.sidebar-logout-btn:hover {
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.9);
}

/* Profile avatar (modal) */
.profile-avatar-lg {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--primary-light);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  overflow: hidden;
}

.profile-avatar-edit {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  cursor: pointer;
  border: 2px solid #fff;
  transition: background .2s;
}
.profile-avatar-edit:hover {
  background: var(--primary-mid);
}

/* ===== LOGIN SCREEN ===== */
#loginScreen input:focus {
  border-color: #93B5A7 !important;
  box-shadow: 0 0 0 3px rgba(147,181,167,.2) !important;
}

#loginBtn:hover { opacity: .9; }
#loginBtn:active { transform: scale(.98); }

#togglePassword:hover { color: #5E8C7A !important; }

/* Sidebar logout button */
.sidebar-footer button:hover { color: rgba(255,255,255,.85) !important; }

/* ===== CHAT ===== */
.chat-layout {
  background: #fff;
}

/* -- Sidebar contatti -- */
.chat-sidebar {
  width: 280px;
  min-width: 280px;
  border-right: 1px solid #dee2e6;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: #fff;
}
.chat-sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
  font-size: .95rem;
}
.chat-sidebar-divider {
  padding: 8px 16px 4px;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #999;
  font-weight: 600;
}
.chat-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background .15s;
  border-bottom: 1px solid #f5f5f5;
}
.chat-contact:hover { background: #f8f9fa; }
.chat-contact.active { background: var(--primary-ultra); }
.chat-contact-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .82rem;
}
.chat-contact-info {
  flex: 1;
  min-width: 0;
}
.chat-contact-name {
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-contact-preview {
  font-size: .72rem;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-contact-badge {
  font-size: .6rem !important;
  flex-shrink: 0;
}

/* -- Area messaggi -- */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chat-main-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #eee;
  background: #fff;
}
.chat-main-header-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .78rem;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  background: #f8f9fa;
}
.chat-input-bar {
  padding: 10px 12px;
  border-top: 1px solid #eee;
  background: #fff;
}

/* -- Bolle messaggi -- */
.chat-date-divider {
  text-align: center;
  margin: 16px 0 8px;
}
.chat-date-divider span {
  background: #e9ecef;
  padding: 2px 12px;
  border-radius: 10px;
  font-size: .72rem;
  color: #6c757d;
}

.chat-bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin-bottom: 4px;
  max-width: 75%;
}
.chat-bubble-row.mine {
  margin-left: auto;
  flex-direction: row-reverse;
}
.chat-bubble-row.other {
  margin-right: auto;
}

.chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}
.chat-avatar-initial {
  background: var(--primary-light);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-avatar-spacer {
  width: 28px;
  flex-shrink: 0;
}

.chat-bubble {
  padding: 8px 12px;
  border-radius: 14px;
  max-width: 100%;
  word-break: break-word;
}
.bubble-mine {
  background: var(--primary-light);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.bubble-other {
  background: #fff;
  color: #333;
  border: 1px solid #e9ecef;
  border-bottom-left-radius: 4px;
}

.chat-author {
  font-size: .68rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}
.bubble-mine .chat-author {
  color: rgba(255,255,255,.7);
}

.chat-text {
  font-size: .88rem;
  line-height: 1.35;
}

.chat-time {
  font-size: .62rem;
  opacity: .55;
  text-align: right;
  margin-top: 2px;
}

#chatInput {
  border-radius: 20px;
  padding-left: 16px;
}
#chatForm .btn {
  border-radius: 50%;
  width: 38px;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* -- Mobile chat: sidebar/messaggi toggle -- */
@media (max-width: 767px) {
  .chat-layout {
    height: calc(100vh - 120px) !important;
  }
  .chat-sidebar {
    width: 100%;
    min-width: 100%;
  }
  .chat-main {
    display: none;
  }
  .chat-main.chat-main-visible {
    display: flex;
    position: absolute;
    inset: 0;
    z-index: 2;
    background: #fff;
  }
  .chat-sidebar.chat-sidebar-hidden {
    display: none;
  }
  .chat-bubble-row {
    max-width: 88%;
  }
  .chat-layout {
    position: relative;
  }
}

/* ===== STRUTTURA SWITCHER ===== */
.struttura-switcher {
  display: flex;
  gap: 6px;
  padding: 10px 12px 6px;
}
.str-btn {
  flex: 1;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.7);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}
.str-btn:hover {
  background: rgba(255,255,255,.18);
  color: #fff;
}
.str-btn.active {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.4);
  color: #fff;
}

/* ===== UTILITIES ===== */
.cursor-pointer { cursor: pointer; }
.font-monospace { font-family: 'Consolas', monospace; letter-spacing: .5px; }

/* ================================================================
   WOW ANIMATIONS
   ================================================================ */

/* ── Keyframes ── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideRight {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(147,181,167,.5); }
  50%       { box-shadow: 0 0 0 8px rgba(147,181,167,0); }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px) scale(.85); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes rippleOut {
  from { transform: scale(0); opacity: .5; }
  to   { transform: scale(2.5); opacity: 0; }
}
@keyframes slideInFromTop {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes stretchIn {
  from { opacity: 0; transform: scaleX(.6); }
  to   { opacity: 1; transform: scaleX(1); }
}
@keyframes spin360 {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Page transition ── */
.page.active {
  animation: fadeSlideIn .32s cubic-bezier(.25,.8,.25,1) both;
}

/* ── Cards: staggered entrance ── */
.wow-card {
  animation: scaleIn .28s cubic-bezier(.25,.8,.25,1) both;
}
.wow-card:nth-child(1) { animation-delay: .04s; }
.wow-card:nth-child(2) { animation-delay: .09s; }
.wow-card:nth-child(3) { animation-delay: .14s; }
.wow-card:nth-child(4) { animation-delay: .19s; }

/* ── Dashboard stat values animated ── */
.stat-value {
  animation: countUp .45s cubic-bezier(.34,1.56,.64,1) both;
}

/* ── List items stagger ── */
.dog-list-item {
  animation: fadeSlideRight .22s ease both;
}
.dog-list-item:nth-child(1)  { animation-delay: .04s; }
.dog-list-item:nth-child(2)  { animation-delay: .08s; }
.dog-list-item:nth-child(3)  { animation-delay: .12s; }
.dog-list-item:nth-child(4)  { animation-delay: .16s; }
.dog-list-item:nth-child(5)  { animation-delay: .20s; }
.dog-list-item:nth-child(6)  { animation-delay: .24s; }
.dog-list-item:nth-child(7)  { animation-delay: .28s; }
.dog-list-item:nth-child(8)  { animation-delay: .32s; }
.dog-list-item:nth-child(9)  { animation-delay: .36s; }
.dog-list-item:nth-child(10) { animation-delay: .40s; }

/* ── Table rows stagger ── */
tbody tr {
  animation: fadeSlideRight .2s ease both;
}
tbody tr:nth-child(1)  { animation-delay: .03s; }
tbody tr:nth-child(2)  { animation-delay: .06s; }
tbody tr:nth-child(3)  { animation-delay: .09s; }
tbody tr:nth-child(4)  { animation-delay: .12s; }
tbody tr:nth-child(5)  { animation-delay: .15s; }
tbody tr:nth-child(6)  { animation-delay: .18s; }
tbody tr:nth-child(7)  { animation-delay: .21s; }
tbody tr:nth-child(8)  { animation-delay: .24s; }
tbody tr:nth-child(9)  { animation-delay: .27s; }
tbody tr:nth-child(10) { animation-delay: .30s; }

/* ── Badge "In struttura": pulse continuo ── */
.badge.bg-success {
  animation: pulseGlow 2.4s ease-in-out infinite;
}

/* ── Nav item: highlight slide ── */
.nav-item {
  position: relative;
  overflow: hidden;
}
.nav-item::after {
  content: '';
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 0;
  background: #fff;
  border-radius: 0 3px 3px 0;
  transition: height .2s ease;
}
.nav-item.active::after { height: 60%; }

/* ── Struttura switcher morph ── */
.str-btn {
  transition: all .25s cubic-bezier(.34,1.56,.64,1) !important;
}
.str-btn.active {
  transform: scale(1.05);
}

/* ── Ripple on buttons ── */
.btn { position: relative; overflow: hidden; }
.ripple-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  pointer-events: none;
  animation: rippleOut .55s ease-out forwards;
  transform-origin: center;
}

/* ── Toast animation ── */
.toast-container .toast {
  animation: slideInFromTop .3s cubic-bezier(.25,.8,.25,1) both;
}

/* ── Stat number count-up helper ── */
.stat-value[data-count] {
  animation: countUp .5s cubic-bezier(.34,1.56,.64,1) both;
}

/* ── Skeleton loader ── */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 400px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 6px;
  color: transparent !important;
  user-select: none;
}
.skeleton * { visibility: hidden; }

/* ── Sidebar logo spin on struttura switch ── */
.sidebar-logo.spin {
  animation: spin360 .5s cubic-bezier(.34,1.56,.64,1);
}

/* ── Card hover lift ── */
.card {
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.10);
  transform: translateY(-1px);
}

/* ── Richiesta item entrance ── */
.richiesta-item {
  animation: fadeSlideIn .25s ease both;
}

/* ── Accessibility: rispetta preferenze utente ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
