/* ==========================================================================
   PRISMA FESTIVAL - ADMIN CMS STYLESHEET (PROFESSIONAL FULL-SCREEN SUITE)
   Colori Moderni (Navy Slate, Indigo, Cyan, Amber, Rose), Zero Scroll Orizzontale,
   Modali Pop-up Eleganti per Modifica e Aggiunta Contenuti.
   ========================================================================== */

/* 1. Reset & Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 29, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 16px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* 2. Login Card */
.admin-login-card,
.admin-login-box {
  width: 100%;
  max-width: 440px;
  background: #0f172a;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 24px;
  padding: 36px 30px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.8), 0 0 40px rgba(59, 130, 246, 0.15);
  text-align: center;
  position: relative;
  transform: scale(0.94);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .admin-login-card,
.modal-overlay.active .admin-login-box {
  transform: scale(1);
}

.login-icon-box {
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(168, 85, 247, 0.25));
  border: 2px solid #3b82f6;
  border-radius: 50%;
  margin: 0 auto 18px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #60a5fa;
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.35);
}

.admin-login-card h2 {
  font-family: var(--font-heading, 'Inter', sans-serif);
  font-size: 1.5rem;
  letter-spacing: 1px;
  color: #ffffff;
  margin-bottom: 6px;
  font-weight: 700;
}

.admin-login-card p {
  font-size: 0.88rem;
  color: #94a3b8;
  margin-bottom: 24px;
  line-height: 1.5;
}

.login-input-group {
  position: relative;
  margin-bottom: 20px;
}

.login-input-group input {
  width: 100%;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 14px 18px;
  color: #fff;
  font-size: 1.05rem;
  outline: none;
  transition: all 0.25s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.login-input-group input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.4);
}

.btn-primary-action {
  width: 100%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-primary-action:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.55);
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: #ef4444;
}

/* ==========================================================================
   3. FULL ADMIN CMS DASHBOARD CONTAINER (WIDE & NO SCROLLBAR)
   ========================================================================== */
.admin-dashboard-container {
  width: 96vw;
  max-width: 1440px;
  height: 94vh;
  background: #0b1120;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 22px;
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.9), 0 0 50px rgba(15, 23, 42, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Header */
.dashboard-header {
  padding: 18px 28px;
  background: #090e1a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.dashboard-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dashboard-brand i {
  font-size: 1.6rem;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.dashboard-brand h3 {
  font-size: 1.3rem;
  letter-spacing: 0.5px;
  color: #ffffff;
  font-weight: 700;
  margin: 0;
}

.user-badge {
  font-size: 0.78rem;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.btn-cms-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-cms-secondary:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #94a3b8;
  border-radius: 10px;
  width: 38px;
  height: 38px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-close-modal:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: #ef4444;
}

/* Tabs Navigation Bar (Zero scrollbar visibile) */
.dashboard-tabs {
  display: flex;
  flex-wrap: wrap;
  background: #080c16;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  gap: 4px;
  flex-shrink: 0;
}

.tab-item {
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 8px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
  user-select: none;
}

.dashboard-tabs::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.tab-item {
  padding: 13px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.tab-item:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.03);
}

.tab-item.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

/* Dashboard Body & Panels */
.dashboard-content-body {
  flex: 1;
  padding: 28px 34px;
  overflow-y: auto;
  background: #0b1120;
}

/* Scrollbar personalizzata ultra-sottile per il contenuto interno */
.dashboard-content-body::-webkit-scrollbar {
  width: 6px;
}
.dashboard-content-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
.dashboard-content-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.dashboard-content-body::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.4);
}

.tab-pane {
  display: none;
  animation: fadeInPane 0.25s ease-out forwards;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeInPane {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Section Title & Header in Panels */
.form-section-title {
  font-size: 1.25rem;
  color: #ffffff;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
  font-weight: 700;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 16px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 7px;
}

.form-control {
  width: 100%;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 11px 15px;
  color: #ffffff;
  font-size: 0.92rem;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.form-control:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
  background: #111c34;
}

textarea.form-control {
  resize: vertical;
  min-height: 85px;
  line-height: 1.5;
}

/* Footer / Save Bar */
.dashboard-footer {
  padding: 16px 28px;
  background: #090e1a;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.auto-save-status {
  font-size: 0.82rem;
  color: #34d399;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-cms-save {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  padding: 10px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
}

.btn-cms-save:hover {
  background: linear-gradient(135deg, #34d399, #10b981);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.5);
}

/* ==========================================================================
   4. CARDS & ITEMS (GUESTS, VIDEOS, GALLERY, POSTERS, EVENTS)
   ========================================================================== */
.admin-item-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.2s ease;
}

.admin-item-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
  background: #131d35;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.admin-item-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.admin-item-thumb {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  object-fit: cover;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.admin-item-info h5 {
  margin: 0 0 4px 0;
  font-size: 1.05rem;
  color: #ffffff;
  font-weight: 700;
}

.admin-item-info p {
  margin: 0;
  font-size: 0.84rem;
  color: #94a3b8;
  line-height: 1.4;
}

.admin-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-item-action {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-item-action:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  transform: translateY(-1px);
}

.btn-item-delete {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.28);
}

.btn-item-delete:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

/* Day Box / Program */
.admin-day-box {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 20px;
}

.admin-day-box-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.admin-day-tag {
  font-size: 0.78rem;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 3px 10px;
  border-radius: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-timeline-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #090e1a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  margin-bottom: 6px;
  gap: 12px;
}

.admin-timeline-text {
  font-size: 0.85rem;
  color: #e2e8f0;
}

/* Partners Flex */
.admin-partners-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.admin-partner-pill {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.admin-partner-delete {
  cursor: pointer;
  color: #f87171;
  font-size: 14px;
  transition: transform 0.2s ease;
}

.admin-partner-delete:hover {
  transform: scale(1.2);
}

/* ==========================================================================
   5. MODALE POP-UP DI MODIFICA UNIVERSALE (MODAL DI DIALOGO)
   ========================================================================== */
.cms-edit-modal-box {
  width: 100%;
  max-width: 620px;
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.9), 0 0 40px rgba(56, 189, 248, 0.15);
  position: relative;
  transform: scale(0.95);
  transition: transform 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.active .cms-edit-modal-box {
  transform: scale(1);
}

.cms-modal-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
}

.cms-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 18px;
}

/* ==========================================================================
   6. TAB REGISTRO QUOTE SOCI & QR CODE GENERATOR
   ========================================================================== */
/* Tabella Quote Soci */
.cms-table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: #0f172a;
  margin-top: 14px;
}

.cms-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.cms-table th {
  background: #090e1a;
  color: #94a3b8;
  padding: 12px 16px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cms-table td {
  padding: 12px 16px;
  color: #f1f5f9;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cms-table tr:hover td {
  background: rgba(56, 189, 248, 0.04);
}

.stats-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stats-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
}

.stats-card .stat-label {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-card .stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: #38bdf8;
  margin-top: 4px;
}

/* QR Code Section */
.qrcode-display-box {
  background: #ffffff;
  padding: 24px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 18px 0;
}

/* Toast */
.cms-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #34d399;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
  padding: 14px 22px;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 600;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideToast 0.3s ease-out;
}

@keyframes slideToast {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 992px) {
  .admin-dashboard-container {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    max-width: none;
  }
  .form-grid-2, .form-grid-3 {
    grid-template-columns: 1fr;
  }
  .dashboard-content-body {
    padding: 18px;
  }
}

#cms-dynamic-modal {
  z-index: 99999999 !important;
}
#cms-dynamic-modal .cms-edit-modal-box {
  max-height: 90vh;
  overflow-y: auto;
}


/* ==========================================================================
   OTTIMIZZAZIONE TOTALE GESTIONALE ADMIN PER MOBILE & SMARTPHONE
   ========================================================================== */
@media (max-width: 768px) {
  .modal-overlay#admin-dashboard-modal {
    padding: 0 !important;
  }

  .admin-dashboard-container {
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
  }

  .dashboard-header {
    padding: 12px 14px !important;
  }

  .dashboard-brand h3 {
    font-size: 1.05rem !important;
    line-height: 1.2 !important;
  }

  .dashboard-brand i {
    font-size: 1.2rem !important;
    padding: 6px !important;
  }

  .user-badge {
    display: none !important;
  }

  /* Barra schede orizzontale scrollabile con un dito senza invadere lo schermo */
  .dashboard-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 8px 10px !important;
    gap: 8px !important;
    background: #090e1a !important;
  }

  .tab-item {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    padding: 8px 14px !important;
    font-size: 0.85rem !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border-bottom: none !important;
  }

  .tab-item.active {
    background: #3b82f6 !important;
    color: #ffffff !important;
  }

  /* Corpo del gestionale scrollabile fluidamente */
  .dashboard-content-body {
    padding: 14px 12px !important;
    padding-bottom: 90px !important; /* Spazio per non coprire l'ultimo elemento col footer */
  }

  /* Footer fisso compatto e ben allineato */
  .dashboard-footer {
    padding: 10px 14px !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: #090e1a !important;
    z-index: 50 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
  }

  .auto-save-status {
    display: none !important; /* Rimuovi testo lungo su mobile per salvare spazio */
  }

  .dashboard-footer > div:last-child {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    gap: 10px !important;
  }

  .btn-cms-primary, .btn-cms-secondary {
    flex: 1 !important;
    padding: 10px 12px !important;
    font-size: 0.88rem !important;
    justify-content: center !important;
    white-space: nowrap !important;
  }

  /* Modali pop-up secondari su mobile (modifica riga, aggiungi relatore, ecc.) */
  .cms-edit-modal-box {
    width: 95vw !important;
    max-height: 92vh !important;
    padding: 16px !important;
  }
}


/* ==========================================================================
   PERFEZIONAMENTO RESPONSIVE TOTALE GESTIONALE (TUTTE LE SEZIONI SU MOBILE)
   ========================================================================== */
@media (max-width: 768px) {
  /* 1. Modal Overlay e Finestra a Schermo Pieno */
  .modal-overlay#admin-dashboard-modal {
    padding: 0 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 999999 !important;
  }

  .admin-dashboard-container {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    display: flex !important;
    flex-direction: column !important;
  }

  /* 2. Header compatto con tasto Esci e Chiudi ben distanziati */
  .dashboard-header {
    padding: 12px 14px !important;
    flex-shrink: 0 !important;
  }
  .dashboard-brand i {
    font-size: 1.15rem !important;
    padding: 6px !important;
  }
  .dashboard-brand h3 {
    font-size: 0.98rem !important;
    font-weight: 700 !important;
  }
  .user-badge {
    display: none !important;
  }

  /* 3. Barra Schede a Scorrimento Orizzontale Touch */
  .dashboard-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 8px 12px !important;
    gap: 8px !important;
    background: #070c18 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    flex-shrink: 0 !important;
  }
  .dashboard-tabs::-webkit-scrollbar {
    display: none !important;
  }
  .tab-item {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    padding: 8px 14px !important;
    font-size: 0.84rem !important;
    border-radius: 20px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-bottom: none !important;
  }
  .tab-item.active {
    background: #3b82f6 !important;
    color: #ffffff !important;
    border-color: #3b82f6 !important;
  }

  /* 4. Corpo del Gestionale con Scrolling Fluido */
  .dashboard-content-body {
    flex: 1 !important;
    padding: 14px 12px !important;
    padding-bottom: 110px !important; /* Spazio per evitare che il footer copra l'ultima riga */
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* 5. Griglie e Campi Input su Colonna Singola */
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .form-group {
    margin-bottom: 14px !important;
  }
  .form-control {
    font-size: 0.92rem !important;
    padding: 10px 12px !important;
  }

  /* 6. Intestazioni Sezioni con Pulsanti Azione */
  .form-section-title {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
  }
  .form-section-title button {
    width: 100% !important;
    justify-content: center !important;
    padding: 10px !important;
  }

  /* 7. Schede Programma Giornate & Timeline */
  .admin-day-box {
    padding: 14px 12px !important;
    margin-bottom: 16px !important;
  }
  .admin-day-box-header {
    flex-direction: column !important;
    gap: 10px !important;
    align-items: flex-start !important;
  }
  .admin-day-box-header > div:last-child {
    width: 100% !important;
    display: flex !important;
    gap: 8px !important;
  }
  .admin-day-box-header > div:last-child button {
    flex: 1 !important;
    justify-content: center !important;
  }
  .admin-timeline-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    padding: 10px !important;
  }
  .admin-timeline-text {
    width: 100% !important;
    font-size: 0.86rem !important;
  }
  .admin-timeline-row > div:last-child {
    width: 100% !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 8px !important;
  }

  /* 8. Schede Elementi (Ospiti, Video, Foto, Manifesti, Eventi) */
  .admin-item-card {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    padding: 14px 12px !important;
  }
  .admin-item-preview {
    width: 100% !important;
    gap: 12px !important;
  }
  .admin-item-preview img {
    width: 60px !important;
    height: 60px !important;
    flex-shrink: 0 !important;
  }
  .admin-item-actions {
    width: 100% !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
    padding-top: 10px !important;
  }
  .admin-item-actions button {
    flex: 1 !important;
    justify-content: center !important;
    padding: 8px !important;
  }

  /* 9. Registro Quote Soci (Tabella Responsiva a Carte) */
  .stats-card-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .fees-table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 10px !important;
  }
  .fees-table th, .fees-table td {
    padding: 10px 8px !important;
    font-size: 0.82rem !important;
    white-space: nowrap !important;
  }

  /* 10. Footer Fisso con Pulsanti Perfettamente Spaziati */
  .dashboard-footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: #080d1a !important;
    padding: 12px 14px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.7) !important;
    z-index: 9999999 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }
  .auto-save-status {
    display: none !important;
  }
  .dashboard-footer > div:last-child {
    width: 100% !important;
    display: flex !important;
    gap: 10px !important;
  }
  .dashboard-footer button {
    flex: 1 !important;
    padding: 12px 14px !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  /* 11. Modali Pop-up di Modifica Righe e Aggiunta Dati */
  #cms-dynamic-modal .cms-edit-modal-box {
    width: 95vw !important;
    max-height: 90vh !important;
    max-height: 90dvh !important;
    padding: 18px 14px !important;
    border-radius: 18px !important;
  }
  .modal-actions {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .modal-actions button {
    width: 100% !important;
    padding: 12px !important;
  }
}
