/* admin/admin.css - Stili ufficiali per il Pannello di Amministrazione (Desktop, iPad & Mobile) */
body {
  background: #040914;
  color: #fff;
  padding: 20px;
  font-family: sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0;
  box-sizing: border-box;
}

.admin-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  background: #101c3d;
  border: 1px solid #d4af37;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  box-sizing: border-box;
}

input {
  color: #000 !important;
  background: #fff !important;
}

textarea {
  color: #000 !important;
  background: #fff !important;
}

h1 {
  color: #d4af37;
  font-family: serif;
  margin-bottom: 10px;
}

.alert {
  background: rgba(46, 204, 113, 0.2);
  border: 1px solid #2ecc71;
  color: #2ecc71;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.error {
  background: rgba(231, 76, 60, 0.2);
  border: 1px solid #e74c3c;
  color: #e74c3c;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  border-bottom: 1px solid rgba(212,175,55,0.3);
  padding-bottom: 15px;
}


.top-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
	
}

.btn-logout {
  background: #e74c3c;
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: bold;
}

.btn-password {
  background: #3498db;
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: bold;
  border: none;
  cursor: pointer;
  display: inline-block;
}

.btn-change {
  background: #d4af37;
  color: #040914;
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: bold;
  display: inline-block;
}

.tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(212,175,55,0.2);
  padding-bottom: 15px;
}

.tab-btn {
  background: #040914;
  border: 1px solid rgba(212,175,55,0.3);
  color: #b2bed2;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.85rem;
  text-decoration: none;
  display: inline-block;
}

.tab-btn.active, .tab-btn:hover {
  background: #d4af37;
  color: #040914;
}

.subtabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 25px;
  background: rgba(4,9,20,0.4);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(212,175,55,0.15);
}

.subtab-btn {
  background: #040914;
  border: 1px solid rgba(212,175,55,0.25);
  color: #b2bed2;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
}

.subtab-btn.active, .subtab-btn:hover {
  background: #f6eaaf;
  color: #040914;
}

.tab-content { display: none; }
.tab-content.active { display: block; }
.sub-content, .sub-gal-content, .sub-spo-content { display: none; }
.sub-content.active, .sub-gal-content.active, .sub-spo-content.active { display: block; }

.section-title {
  color: #f6eaaf;
  border-bottom: 1px dashed rgba(212,175,55,0.3);
  padding-bottom: 6px;
  margin: 15px 0;
  font-size: 1.2rem;
}

.admin-card {
  display: flex;
  gap: 20px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(212,175,55,0.8);
  border-radius: 8px;
  padding: 15px;
  margin: 25px 0 !important;
  align-items: flex-start !important;
}

.admin-card > div:first-child {
  align-self: flex-start !important;
}

.admin-card img {
  width: 180px;
  height: 160px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #d4af37;
  flex-shrink: 0;
  object-position: top;
}

.admin-card-gallery {
  background: rgba(4,9,20,0.7); 
  border: 1px solid rgba(212,175,55,0.35); 
  padding: 15px;
  border-radius: 10px;
}

.admin-card-gallery img {
  width: 100%; 
  height: 180px; 
  object-fit: cover; 
  border-radius: 6px; 
  margin-bottom: 10px;
  object-position: top;
}

.admin-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex-grow: 1;
}

.admin-fields .full-width {
  grid-column: span 2;
}

.upload-box {
  background: rgba(212,175,55,0.08);
  border: 1px dashed rgba(212,175,55,0.4);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #d4af37;
  display: block;
  margin-bottom: 3px;
}

input[type="text"], input[type="password"], input[type="number"], input[type="file"], textarea, select {
  width: 100%;
  background: #040914;
  border: 1px solid rgba(212,175,55,0.3);
  color: #fff;
  padding: 8px;
  border-radius: 4px;
  font-size: 0.9rem;
  box-sizing: border-box;
}

textarea {
  height: 55px;
  resize: vertical;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
}

.btn-action {
  background: #d4af37;
  color: #040914;
  font-weight: bold;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.login-box, .edition-box, .password-box {
  max-width: 450px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
  background: #101c3d;
  border: 1px solid #d4af37;
  padding: 40px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  box-sizing: border-box;
}

.btn-hero {
  background: transparent;
  border: 2px solid #d4af37;
  color: #d4af37;
  font-weight: bold;
  padding: 12px 20px;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  text-transform: uppercase;
  font-size: 0.95rem;
  margin-top: 15px;
  box-sizing: border-box;
}
.btn-hero:hover { background: #d4af37; color: #040914; }

/* --- STILI DASHBOARD ADMIN --- */
.admin-body-login { align-items: center; }
.admin-body-dashboard { align-items: center; justify-content: flex-start; padding-top: 40px; padding-bottom: 40px; }
.admin-login-title { color: #d4af37; font-family: serif; line-height: 1.3; margin-bottom: 25px; font-size: 1.8rem; }
.admin-form-group { margin-bottom: 15px; text-align: left; }
.admin-form-label { font-size: 0.75rem; color: #d4af37; display: block; margin-bottom: 5px; }
.admin-form-input { width: 100%; background: #fff; color: #000; padding: 10px; border-radius: 4px; box-sizing: border-box; }
.admin-login-link-wrap { text-align: right; margin-top: 5px; }
.admin-login-link { color: #f6eaaf; font-size: 0.75rem; text-decoration: underline; }
.admin-top-bar { margin-bottom: 15px; }
.admin-top-title { font-size: 2.2rem; margin: 0}
.admin-top-title-MissGolfoDeiPoeti{ font-size: 1.3rem; margin-bottom: 0!important; }
.admin-welcome-text { color: #fff; font-size: 1.3rem; margin-top: 4px; }
.admin-welcome-text span{ color: rgba(256, 256, 256, 0.6)!important; font-size: 0.9rem!important; }
.admin-top-right-group { display: flex; gap: 10px; align-items: center; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin-top: 20px; }

.admin-section-box {
  background: rgba(4, 9, 20, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 10px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  box-sizing: border-box;
}

.admin-section-title {
  color: #f6eaaf;
  font-size: 1.1rem;
  font-family: serif;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.3);
  padding-bottom: 10px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-box-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.stat-card { background: rgba(4, 9, 20, 0.8); border: 1px solid rgba(212, 175, 55, 0.2); border-radius: 8px; padding: 12px 8px; text-align: center; }
.stat-number { font-size: 1.3rem; font-weight: bold; color: #f6eaaf; margin-bottom: 2px; }
.stat-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.5px; color: #b2bed2; }

/* --- WORKSPACE ADMIN (NOTE, CALENDARIO, CHAT) --- */
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 15px; }
.note-card { background: rgba(4, 9, 20, 0.8); border: 1px solid rgba(212, 175, 55, 0.2); border-top-width: 4px; padding: 15px; border-radius: 6px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; transition: opacity 0.3s ease; }
.note-card.resolved { opacity: 0.6; }
.note-text { color: #fff; font-size: 0.9rem; margin: 0; white-space: pre-wrap; word-break: break-word; }
.note-card.resolved .note-text { text-decoration: line-through; }
.note-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(212, 175, 55, 0.15); padding-top: 8px; font-size: 0.7rem; color: #b2bed2; }
.note-actions { display: flex; gap: 8px; align-items: center; }
.note-btn-icon { background: none; border: none; cursor: pointer; font-size: 0.8rem; padding: 0; }
.note-btn-resolve { color: #b2bed2; font-size: 0.85rem; }
.note-btn-resolve.active { color: #2ecc71; }
.note-btn-edit { color: #3498db; }
.note-btn-delete { color: #e74c3c; }
.note-textarea { width: 100%; height: 80px; background: #040914; color: #fff; border: 1px solid rgba(212, 175, 55, 0.3); padding: 10px; border-radius: 4px; margin-bottom: 10px; box-sizing: border-box; }
.note-textarea-edit { width: 100%; height: 70px; background: #040914; color: #fff; border: 1px solid rgba(212, 175, 55, 0.3); padding: 8px; border-radius: 4px; font-size: 0.85rem; margin-bottom: 8px; box-sizing: border-box; }
.note-color-picker { background: none; border: none; cursor: pointer; vertical-align: middle; }

/* --- PROFILO & PASSWORD --- */
.profile-container { max-width: 700px; }
.profile-header-desc { color: #b2bed2; font-size: 0.8rem; margin-top: 4px; }
.profile-card { background: rgba(4, 9, 20, 0.6); border: 1px solid rgba(212, 175, 55, 0.3); padding: 25px; border-radius: 8px; }
.profile-form-group { margin-bottom: 15px; }
.profile-form-group-mb { margin-bottom: 25px; }
.profile-input-disabled { background: rgba(255, 255, 255, 0.1) !important; color: #b2bed2 !important; cursor: not-allowed; }
.profile-textarea { height: 90px; }
.profile-submit-wrap { text-align: right; }
.profile-btn-save { width: auto; padding: 10px 25px; }
.profile-actions-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }

.btn-password-outline {
  background: transparent;
  border: 1px solid #3498db;
  color: #3498db;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: bold;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}
.btn-password-outline:hover { background: #3498db; color: #fff; }

.password-container { max-width: 600px; }
.password-form-group { margin-bottom: 15px; }
.password-form-group-mb { margin-bottom: 25px; }

/* --- CANDIDATURE-ADMIN.PHP --- */
.admin-container-candidature { max-width: 1200px; }
.text-highlight { color: #f6eaaf; }
.admin-subtitle { color: #b2bed2; font-size: 0.8rem; margin-top: 4px; }

.tab-nav-candidature {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  border-bottom: 1px solid rgba(212,175,55,0.2);
  padding-bottom: 15px;
  flex-wrap: wrap;
}

.btn-tab {
  background: #040914;
  border: 1px solid rgba(212,175,55,0.3);
  color: #b2bed2;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.85rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
}
.btn-tab.active, .btn-tab:hover { background: #d4af37; color: #040914; border-color: #d4af37; }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

.cand-empty-msg { text-align: center; padding: 40px; color: #b2bed2; font-style: italic; }
.cand-sub-empty { color: #888; font-style: italic; padding: 20px 0; }
.cand-list-flex { display: flex; flex-direction: column; gap: 20px; }

.cand-card {
  background: rgba(4, 9, 20, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
  box-sizing: border-box;
}
.card-approved { border-color: #2ecc71; }
.cand-info-col { flex: 2; min-width: 280px; }
.cand-actions-col { flex: 1; min-width: 220px; }
.cand-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.cand-header-badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.badge-categoria {
  background: #d4af37;
  color: #040914;
  font-weight: bold;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-approved {
  background: rgba(46, 204, 113, 0.2);
  border: 1px solid #2ecc71;
  color: #2ecc71;
  font-weight: bold;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
}

.cand-date { color: #888; font-size: 0.75rem; }
.cand-name { color: #f6eaaf; font-family: serif; font-size: 1.3rem; margin-bottom: 10px; }
.cand-grid-details { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 0.85rem; color: #b2bed2; margin-bottom: 12px; }
.text-gold { color: #d4af37; }
.text-green { color: #2ecc71; }
.cand-link { color: #fff; text-decoration: underline; word-break: break-all; }

.cand-note-box { background: rgba(0, 0, 0, 0.3); padding: 10px; border-radius: 6px; font-size: 1.0rem; color: #fff; margin-top: 10px; }
.cand-note-title { color: #d4af37; display: block; margin-bottom: 3px; font-size: 0.75rem; text-transform: uppercase; }

.cand-photos-label { font-size: 0.72rem; text-transform: uppercase; color: #d4af37; display: block; margin-bottom: 8px; }
.cand-photos-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 15px; }
.cand-thumb { width: 70px; height: 90px; object-fit: cover; border-radius: 4px; border: 1px solid #d4af37; transition: transform 0.2s; }
.cand-thumb:hover { transform: scale(1.05); }

.cand-buttons-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn-cand-approve { background: #2ecc71; color: #fff; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 0.75rem; font-weight: bold; }
.btn-cand-delete { background: #e74c3c; color: #fff; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 0.75rem; font-weight: bold; }
.btn-cand-email { background: #3498db; color: #fff; text-decoration: none; padding: 6px 10px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; display: inline-flex; align-items: center; gap: 4px; }
.btn-cand-whatsapp { background: #25d366; color: #fff; text-decoration: none; padding: 6px 10px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; display: inline-flex; align-items: center; gap: 4px; }
.btn-cand-call { background: #34495e; color: #fff; text-decoration: none; padding: 6px 10px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; display: inline-flex; align-items: center; gap: 4px; }
.btn-cand-cancel { background: #f39c12; color: #fff; border: none; padding: 6px 10px; border-radius: 4px; cursor: pointer; font-size: 0.75rem; font-weight: bold; }


/* --- Riprogettazione Ergonomica Elenco Candidature & Dettaglio Espanso --- */
.cand-list-blocks {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cand-accordion-card {
  background: rgba(4, 9, 20, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.cand-accordion-card.card-approved {
  border-color: #2ecc71;
}

.cand-accordion-card[open] {
  background: rgba(4, 9, 20, 0.9);
  border-color: #d4af37;
  box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

.cand-accordion-card[open].card-approved {
  border-color: #2ecc71;
}

/* Riga di sintesi (Sempre visibile) */
.cand-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none; /* Rimuove il triangolo di default del browser */
  user-select: none;
  gap: 15px;
}

.cand-summary-row::-webkit-details-marker {
  display: none;
}

.cand-sum-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cand-sum-name {
  color: #f6eaaf;
  font-size: 1.15rem;
  font-family: serif;
  font-weight: bold;
}

.cand-sum-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  color: #b2bed2;
  font-size: 0.9rem;
}

.badge-photos {
  background: rgba(212, 175, 55, 0.15);
  color: #d4af37;
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
}

.cand-chevron {
  transition: transform 0.3s ease;
  color: #d4af37;
}

.cand-accordion-card[open] .cand-chevron {
  transform: rotate(180deg);
}

/* Contenuto Espanso a Due Colonne */
.cand-expanded-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 25px;
  padding: 20px 25px 25px 25px;
  border-top: 1px dashed rgba(212, 175, 55, 0.25);
  background: rgba(0, 0, 0, 0.3);
}

.cand-col-left {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.cand-detail-title {
  color: #f6eaaf;
  font-family: serif;
  font-size: 1.4rem;
  margin: 0 0 2px 0;
}

.cand-date-sent {
  color: #888;
  font-size: 0.75rem;
}

.cand-info-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.95rem;
  color: #b2bed2;
}

.cand-col-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Griglia Foto a Destra */
.cand-grid-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.cand-photo-link {
  display: block;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #d4af37;
  transition: transform 0.2s;
}

.cand-photo-link:hover {
  transform: scale(1.03);
}

.cand-thumb-grid {
  width: 100%;
  height: 200px;
  object-fit: cover;
	object-position: top;
  display: block;
}


/* ==========================================================
   OTTIMIZZAZIONE ERGONOMICA PER MOBILE (Smartphone)
   ========================================================== */
@media (max-width: 768px) {
  .cand-summary-row {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px;
    gap: 10px;
  }

  .cand-sum-main {
    width: 100%;
    justify-content: space-between;
  }

  .cand-sum-meta {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.85rem;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    padding-top: 8px;
  }

  /* Passaggio a singola colonna per il dettaglio espanso su mobile */
  .cand-expanded-grid {
    grid-template-columns: 1fr !important;
    padding: 15px !important;
    gap: 20px;
  }

  .cand-buttons-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .cand-buttons-row form {
    margin: 0;
  }

  .cand-buttons-row button,
  .cand-buttons-row a {
    width: 100% !important;
    padding: 10px !important;
    font-size: 0.85rem !important;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
  }

  .cand-grid-photos {
    grid-template-columns: repeat(2, 1fr);
  }

  .cand-thumb-grid {
    height: 150px!important;
  }
	
	
	
	
}

/* --- Evidenziazione Candidati Minorenni (< 18 anni) --- */
.cand-accordion-card.card-minorenne {
  border-left: 4px solid #f39c12 !important; /* Bordo laterale d'attenzione */
  //background: rgba(243, 156, 18, 0.04);
}

.badge-minorenne {
  background: rgba(243, 156, 18, 0.2);
  color: #f39c12;
  border: 1px solid rgba(243, 156, 18, 0.4);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.text-alert-minorenne {
  color: #f39c12;
  font-weight: bold;
  font-size: 0.85rem;
  background: rgba(243, 156, 18, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 5px;
}





/* --- CALENDARIO --- */
.admin-container-calendar { max-width: 900px; }
.form-grid-calendar { display: grid; grid-template-columns: 1.5fr 1fr 2fr 120px; gap: 15px; align-items: flex-end; }
.input-datetime { background: #040914; color: #fff; border: 1px solid rgba(212,175,55,0.3); padding: 8px; border-radius: 4px; width: 100%; box-sizing: border-box; }
.btn-fixed-height { height: 38px; }
.calendar-list { display: flex; flex-direction: column; gap: 10px; }
.calendar-empty { color: #b2bed2; font-style: italic; }
.calendar-item-card { background: rgba(256, 256, 256, 1); border: 1px solid rgba(212, 175, 55, 0.2); padding: 15px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; gap: 15px; flex-wrap: wrap;}
.calendar-item-left { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.calendar-date-badge { background: rgba(4, 9, 20, 0.25); border: 0px solid #d4af37; font-size: 1.0rem;  padding: 10px 15px; border-radius: 6px; text-align: center; min-width: 110px; }
.calendar-date-day { font-size: 1.0rem; color: rgba(4, 9, 20, 0.75); font-weight: bold; }
.calendar-date-time { font-size: 0.890rem; color: rgba(4, 9, 20, 0.75); }
.calendar-item-title { color: rgba(4, 9, 20, 0.75) !important; margin: 0 0 4px 0; font-size: 1.34rem; }
.calendar-item-desc { color: rgba(4, 9, 20, 0.75); margin: 0; font-size: 1.1rem; }
.calendar-author { color: rgba(4, 9, 20, 0.55); font-style: italic; }
.btn-delete-calendar { background: #e74c3c; color: #fff; border: none; padding: 8px 12px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; }

/* --- CHAT STILE WHATSAPP --- */
.whatsapp-chat-body {
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
  background: #040914;
  font-family: sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
}

.whatsapp-container {
  max-width: 800px;
  width: 100%;
  height: 100vh;
  background: #101c3d;
  border-left: 1px solid rgba(212, 175, 55, 0.3);
  border-right: 1px solid rgba(212, 175, 55, 0.3);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 15px;
}

.whatsapp-header { flex-shrink: 0; margin-bottom: 10px !important; }

.whatsapp-messages-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px;
  background: rgba(4, 9, 20, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 8px;
  margin-bottom: 10px;
}

.whatsapp-form {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  margin: 0;
  background: rgba(4, 9, 20, 0.6);
  padding: 10px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
}

.chat-empty-msg { color: #b2bed2; text-align: center; font-style: italic; margin: auto; }
.chat-message-wrapper { display: flex; flex-direction: column; }
.chat-msg-right { align-items: flex-end; }
.chat-msg-left { align-items: flex-start; }
.chat-msg-meta { font-size: 0.7rem; color: #f6eaaf; margin-bottom: 2px; }
.chat-msg-date { color: #b2bed2; font-size: 0.65rem; }

.chat-bubble {
  padding: 10px 14px;
  border-radius: 8px;
  max-width: 75%;
  color: #fff;
  font-size: 0.9rem;
  word-break: break-word;
}
.chat-bubble-mine { background: rgba(212, 175, 55, 0.2); border: 1px solid #d4af37; }
.chat-bubble-other { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(212, 175, 55, 0.2); }

.chat-input-field { flex: 1; background: #040914; color: #fff; border: 1px solid rgba(212, 175, 55, 0.3); padding: 10px; border-radius: 4px; box-sizing: border-box; }
.chat-btn-submit { width: auto; padding: 10px 20px; }

/* Utility Classes */
.m-0 { margin: 0; }
.mb-5 { margin-bottom: 5px; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.d-none { display: none; }
.btn-full-width { width: 100%; }
.btn-recovery-submit { background: #3498db; color: #fff; }
.admin-small-notice { color: #f6eaaf; font-size: 0.7rem; display: block; margin-top: 4px; }
.admin-section-desc { color: #b2bed2; font-size: 0.85rem; line-height: 1.4; }
.admin-actions-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 5px; }
.admin-actions-stack-auto { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.btn-w-100 { width: 100%; margin: 0; }
.admin-edition-form { margin-top: 5px; }
.admin-no-edition { color: #e74c3c; font-size: 0.85rem; font-style: italic; margin-bottom: 15px; }
.admin-new-edition-form { margin-top: auto; border-top: 1px dashed rgba(212, 175, 55, 0.3); padding-top: 15px; }
.btn-green-gradient { background: linear-gradient(135deg, #27ae60 0%, #219653 100%); width: 100%; }
.btn-candidature-custom { margin: 0; border-color: #2ecc71; color: #2ecc71; width: 100%; padding: 12px 20px; font-size: 0.95rem; text-transform: uppercase; }


/* ==========================================================
   OTTIMIZZAZIONE PER TABLET / IPAD (769px - 1024px)
   ========================================================== */
@media (min-width: 769px) and (max-width: 1024px) {
  body { padding: 15px; }
  .admin-container { padding: 22px; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .form-grid-calendar { grid-template-columns: 1fr 1fr; }
  .whatsapp-container { max-width: 720px; }
}


/* ==========================================================
   OTTIMIZZAZIONE PER SMARTPHONE / MOBILE (fino a 768px)
   ========================================================== */
@media (max-width: 768px) {
  body.admin-body-dashboard { padding: 6px !important; }

  .admin-container, .admin-container-candidature {
    padding: 10px !important;
    border-radius: 8px;
    max-width: 100% !important;
	  border: none;
  }

  .top-bar.admin-top-bar, .admin-container-candidature .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .admin-top-right-group, .admin-container-candidature .top-bar-right {
    width: 100%;
    justify-content: space-between;
  }
	
  .top-bar h1{
	  font-size: 1.4rem!important;
  }

  .dashboard-grid { grid-template-columns: 1fr !important; gap: 15px; }
  .admin-section-box { padding: 15px; }
  .stats-box-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .form-grid-calendar { grid-template-columns: 1fr; }

  /* --- SCHEDE CANDIDATURE INGRANDITE ED ERGONOMICHE SU MOBILE --- */
  .tab-nav-candidature { 
    gap: 8px; 
    margin-bottom: 20px;
  }
  
  .btn-tab { 
    padding: 14px 18px !important; 
    font-size: 1rem !important;
    flex: 1; 
    justify-content: center; 
    text-align: center;
    border-radius: 8px;
  }
  
  .cand-list-flex {
    gap: 20px;
  }

  .cand-card {
    flex-direction: column;
    padding: 22px !important;
    gap: 22px;
    border-radius: 12px;
    border-width: 2px;
  }

  .cand-info-col, .cand-actions-col {
    width: 100%;
    min-width: 0 !important;
  }

  .cand-name {
    font-size: 1.8rem !important;
    margin-bottom: 15px;
    line-height: 1.2;
  }

  .badge-categoria, .badge-approved {
    font-size: 0.95rem !important;
    padding: 6px 12px !important;
  }

  .cand-grid-details {
    grid-template-columns: 1fr !important;
    gap: 12px;
    font-size: 1.1rem !important;
  }

  .cand-note-box {
    font-size: 1.05rem !important;
    padding: 16px;
    margin-top: 18px;
    line-height: 1.4;
  }

  .cand-photos-label {
    font-size: 0.95rem !important;
    margin-bottom: 12px;
    font-weight: bold;
  }

  .cand-photos-grid {
    gap: 15px;
    margin-bottom: 25px;
  }

  .cand-thumb {
    width: 110px !important;
    height: 150px !important;
    border-radius: 8px;
    border-width: 2px;
  }

  .cand-buttons-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
  }

  .cand-buttons-row form {
    width: 100%;
    margin: 0;
  }

  .cand-buttons-row button, 
  .cand-buttons-row a {
    width: 100% !important;
    padding: 16px 20px !important;
    font-size: 1.05rem !important;
    justify-content: center;
    border-radius: 8px;
    box-sizing: border-box;
    font-weight: bold;
  }

  /* Chat Mobile Fullscreen e Layout WhatsApp */
  .whatsapp-chat-body {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }
  
  .whatsapp-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh;
    height: 100dvh;
    border: none;
    border-radius: 0;
    padding: 6px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }

  .whatsapp-header {
    flex-shrink: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 6px !important;
    padding-bottom: 6px !important;
  }

  .whatsapp-header h1 {
    font-size: 1rem !important;
    line-height: 1.1;
    margin: 0;
  }

  .whatsapp-messages-scroll {
    flex: 1;
    min-height: 0;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 6px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .chat-bubble {
    max-width: 85%;
    font-size: 1rem;
    padding: 10px 14px;
  }

  .whatsapp-form {
    flex-shrink: 0;
    padding: 6px 8px;
    gap: 6px;
    background: #101c3d;
    margin-bottom: env(safe-area-inset-bottom, 0px);
  }

  .chat-input-field {
    padding: 8px;
    font-size: 0.9rem;
  }

  .chat-btn-submit {
    padding: 8px 14px;
    font-size: 0.85rem;
  }
}


/* --- Ottimizzazione Ergonomica Pagina Profilo per Mobile e Tablet --- */
.admin-container-profilo {
  max-width: 700px;
}

@media (max-width: 768px) {
  body {
    padding: 10px !important;
  }

  .admin-container-profilo {
    padding: 15px !important;
    border-radius: 8px;
    max-width: 100% !important;
  }

  .admin-container-profilo .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
	
	.admin-container-profilo .top-bar h1{
    font-size: 1.1em;
  }

  .admin-container-profilo .top-bar-right {
    width: 100%;
    justify-content: space-between;
  }

  .profile-card {
    padding: 15px !important;
  }

  /* Azioni del profilo disposte a colonna o larghezza piena su mobile per massima ergonomia */
  .profile-actions-bar {
    flex-direction: column-reverse;
    gap: 12px;
    align-items: stretch;
  }

  .btn-password-outline,
  .profile-btn-save {
    width: 100% !important;
    justify-content: center;
    padding: 14px 20px !important;
    font-size: 1rem !important;
    box-sizing: border-box;
    text-align: center;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .admin-container-profilo {
    max-width: 90%;
    padding: 25px;
  }
}

/* --- SOLUZIONE DEFINITIVA LOGIN MOBILE (Larghezza fluida e campi grandi) --- */
@media (max-width: 768px) {
  body.admin-body-login {
    padding: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    box-sizing: border-box !important;
  }

  .login-box-mobile {
    width: 95% !important;
    max-width: 95% !important;
    margin: 0 auto !important;
    padding: 25px 15px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
    box-shadow: 0 5px 25px rgba(0,0,0,0.6) !important;
  }

  .admin-login-title {
    font-size: 1.5rem !important;
    margin-bottom: 20px !important;
  }

  .admin-form-group {
    margin-bottom: 16px !important;
  }

  .admin-form-label {
    font-size: 0.8rem !important;
    margin-bottom: 5px !important;
  }

  .admin-form-input {
    padding: 12px !important;
    font-size: 1rem !important;
  }

  .login-box-mobile .btn-action {
    padding: 14px !important;
    font-size: 1.05rem !important;
    width: 100% !important;
    border-radius: 6px !important;
    margin-top: 5px !important;
    margin-bottom: 10px !important;
  }

  .admin-login-link {
    font-size: 0.9rem !important;
  }
}

/* --- Ottimizzazione Ergonomica Bacheca Note per Mobile --- */
@media (max-width: 768px) {
  .admin-container-note {
    padding: 12px !important;
    max-width: 100% !important;
    border-radius: 8px;
  }

  .admin-top-bar-note {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
	  font-size: 0.8em;
  }

  .admin-top-bar-note .top-bar-right {
    width: 100%;
    justify-content: space-between;
  }
	
  .admin-top-bar-note .top-bar-right {
    width: 100%;
    justify-content: space-between;
  }
	
  .top-bar .top-bar-right {
    width: 100%;
    justify-content: space-between;
  }

  /* Form inserimento nota a colonna per comodità mobile */
  .note-form-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .note-color-wrapper {
    justify-content: space-between;
  }

  .note-form-footer .btn-action {
    width: 100% !important;
    padding: 12px !important;
    font-size: 1rem !important;
  }

  .note-textarea {
    height: 100px !important;
    font-size: 1rem !important;
  }

  /* Griglia note a colonna singola su smartphone */
  .note-grid {
    grid-template-columns: 1fr !important;
    gap: 15px;
  }

  .note-card {
    padding: 16px !important;
  }

  .note-text {
    font-size: 1rem !important;
    line-height: 1.4;
  }

  /* Azioni e icone grandi e facili da premere con le dita */
  .note-footer {
    padding-top: 12px;
    font-size: 0.8rem !important;
  }

  .note-actions {
    gap: 15px !important;
  }

  .note-btn-icon {
    font-size: 1.1rem !important;
    padding: 6px !important;
  }
}

/* --- Stili Raffinati per Bacheca Note (Modifica & Nuova Nota) --- */

/* Sezione "Scrivi una nuova nota" più spaziosa e rifinita */
.admin-card .note-textarea {
  width: 100%;
  height: 90px;
  background: #040914;
  color: #fff;
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.note-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.note-color-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.note-color-label {
  font-size: 0.75rem;
  color: #f6eaaf;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Box di modifica della nota */
.note-edit-box {
  margin-top: 5px;
}

.note-textarea-edit {
  width: 100%;
  height: 80px;
  background: #040914;
  color: #fff;
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.note-edit-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.note-color-picker-small {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  vertical-align: middle;
}

/* Gruppo pulsanti Salva e Annulla ben distanziati */
.note-edit-buttons {
  display: flex;
  gap: 12px; /* Spaziatura generosa tra Salva e Annulla */
  align-items: center;
}

.btn-note-save {
  background: #2ecc71;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  text-transform: uppercase;
  transition: background 0.2s;
}

.btn-note-save:hover {
  background: #27ae60;
}

.btn-note-cancel {
  background: #7f8c8d;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  text-transform: uppercase;
  transition: background 0.2s;
}

.btn-note-cancel:hover {
  background: #707b7c;
}

/* Adattamento Mobile per i bottoni di modifica */
@media (max-width: 768px) {
  .note-edit-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .note-edit-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .btn-note-save, .btn-note-cancel {
    width: 100%;
    padding: 10px;
    text-align: center;
  }
}

/* --- Ottimizzazione Box "Scrivi una nuova nota" (Desktop & Mobile) --- */
.admin-card-note-new {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 15px !important;
  padding: 22px !important;
}

.section-title-top {
  color: #f6eaaf;
  font-family: serif;
  font-size: 1.25rem;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.3);
  padding-bottom: 10px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.note-textarea-large {
  width: 100% !important;
  height: 130px !important; /* Molto più grande e comoda */
  background: #040914 !important;
  color: #fff !important;
  border: 1px solid rgba(212, 175, 55, 0.4) !important;
  padding: 15px !important;
  border-radius: 8px !important;
  font-size: 1rem !important;
  resize: vertical;
  box-sizing: border-box !important;
  line-height: 1.5;
}

/* Adattamento specifico per smartphone */
@media (max-width: 768px) {
  .admin-card-note-new {
    padding: 16px !important;
    gap: 12px !important;
  }

  .section-title-top {
    font-size: 1.1rem !important;
  }

  .note-textarea-large {
    height: 120px !important;
    font-size: 0.95rem !important;
    padding: 12px !important;
  }

  .note-form-footer {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .note-color-wrapper {
    justify-content: space-between;
  }

  .note-form-footer .btn-action {
    width: 100% !important;
    padding: 14px !important;
    font-size: 1rem !important;
    text-align: center;
  }
}

/* --- Stile Ottimizzato Box "Scrivi una nuova nota" --- */
.admin-card-note-new {
  flex-direction: column !important;
  align-items: stretch !important;
  padding: 25px !important;
  background: rgba(4, 9, 20, 0.75) !important;
  border: 1px solid rgba(212, 175, 55, 0.5) !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.section-title-top {
  color: #f6eaaf;
  font-family: serif;
  font-size: 1.3rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  padding-bottom: 12px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: 0.5px;
}

.note-form-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

.note-textarea-large {
  width: 100% !important;
  height: 150px !important;
  background: #040914 !important;
  color: #fff !important;
  border: 1px solid rgba(212, 175, 55, 0.4) !important;
  padding: 15px !important;
  border-radius: 8px !important;
  font-size: 1.05rem !important;
  resize: vertical;
  box-sizing: border-box !important;
  line-height: 1.5;
}

.note-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.note-color-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.note-color-label {
  font-size: 0.8rem;
  color: #f6eaaf;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: bold;
}

/* Adattamento Responsive per Smartphone */
@media (max-width: 768px) {
	
  .admin-top-title { font-size: 1.4rem; }
  .admin-top-title-MissGolfoDeiPoeti{ font-size: 1.0rem; margin-bottom: 0!important; }	
	
  .admin-card-note-new {
    padding: 16px !important;
  }

  .section-title-top {
    font-size: 1.1rem !important;
    margin-bottom: 12px;
  }

  .note-textarea-large {
    height: 130px !important;
    font-size: 1rem !important;
    padding: 12px !important;
  }

  .note-form-footer {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .note-color-wrapper {
    justify-content: space-between;
  }

  .note-form-footer .btn-action {
    width: 100% !important;
    padding: 14px !important;
    font-size: 1rem !important;
    text-align: center;
  }
}

/* --- Ottimizzazione Calendario per Mobile --- */
@media (max-width: 768px) {
  .admin-container-calendar {
    padding: 12px !important;
    max-width: 100% !important;
    border-radius: 8px;
  }

  .admin-top-bar-calendar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .admin-top-bar-calendar .top-bar-right {
    width: 100%;
    justify-content: space-between;
  }
	
	.admin-card{
		display: block!important;
  }


  .form-grid-calendar {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .btn-fixed-height {
    height: auto !important;
    width: 100% !important;
    padding: 12px !important;
    font-size: 1rem !important;
  }

  .calendar-item-card {
    flex-direction: column;
    align-items: stretch !important;
    gap: 15px;
    padding: 15px !important;
	  
  }

  .calendar-item-left {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px;
  }

  .calendar-date-badge {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px !important;
    box-sizing: border-box;
	  
  }

  .btn-delete-calendar {
    width: 100% !important;
    padding: 12px !important;
    text-align: center;
    font-size: 0.9rem !important;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
  }
}

/* --- Sezione Ergonomica Creazione Nuovo Evento Calendario --- */
.calendar-new-card {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
  padding: 25px !important;
  background: rgba(4, 9, 20, 0.75) !important;
  border: 1px solid rgba(212, 175, 55, 0.4) !important;
  border-radius: 12px !important;
}

.calendar-card-header {
  color: #f6eaaf;
  font-family: serif;
  font-size: 1.25rem;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.3);
  padding-bottom: 10px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.calendar-form-stack {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr auto;
  gap: 15px;
  align-items: flex-end;
}

.calendar-field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.calendar-text-input,
.calendar-datetime-input {
  width: 100%;
  background: #040914 !important;
  color: #fff !important;
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.calendar-submit-wrap {
  display: flex;
  align-items: flex-end;
}

.btn-calendar-save {
  height: 42px;
  padding: 0 24px;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

/* Ottimizzazione Specifica per Mobile */
@media (max-width: 768px) {
  .calendar-new-card {
    padding: 16px !important;
    gap: 15px !important;
  }

  .calendar-form-stack {
    grid-template-columns: 1fr !important; /* Tutti i campi in colonna verticale singola */
    gap: 12px;
  }

  .calendar-text-input,
  .calendar-datetime-input {
    padding: 12px !important;
    font-size: 1rem !important; /* Campi grandi e comodi al tocco */
  }

  .btn-calendar-save {
    width: 100% !important;
    height: 46px !important;
    font-size: 1rem !important;
    margin-top: 5px;
  }
}

/* --- Stili Modale Inserimento Nuovo Evento Calendario --- */
.calendar-action-bar {
  margin-bottom: 25px;
}

.btn-open-modal {
  padding: 12px 24px !important;
  font-size: 1rem !important;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.calendar-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(4, 9, 20, 0.85);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 15px;
  box-sizing: border-box;
}

.calendar-modal-overlay.active {
  display: flex;
}

.calendar-modal-box {
  width: 100%;
  max-width: 550px;
  background: #101c3d;
  border: 1px solid #d4af37;
  border-radius: 14px;
  padding: 30px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}

.calendar-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.3);
  padding-bottom: 12px;
}

.calendar-modal-header h3 {
  color: #f6eaaf;
  font-family: serif;
  font-size: 1.25rem;
  margin: 0;
}

.calendar-modal-close {
  background: none;
  border: none;
  color: #b2bed2;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 5px;
  transition: color 0.2s;
}

.calendar-modal-close:hover {
  color: #e74c3c;
}

.calendar-modal-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.calendar-textarea-input {
  width: 100%;
  height: 90px;
  background: #040914 !important;
  color: #fff !important;
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.95rem;
  box-sizing: border-box;
  resize: vertical;
}

.calendar-modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 10px;
}

@media (max-width: 768px) {
  .calendar-modal-box {
    padding: 20px;
    max-width: 100%;
  }

  .calendar-modal-footer {
    flex-direction: column-reverse;
  }

  .calendar-modal-footer button {
    width: 100% !important;
    padding: 12px !important;
    text-align: center;
    justify-content: center;
  }
}

/* --- Modale Inserimento/Modifica Evento Calendario (Ingrandita) --- */
.calendar-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(4, 9, 20, 0.85);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.calendar-modal-overlay.active {
  display: flex;
}

.calendar-modal-box {
  width: 100%;
  max-width: 750px; /* Modale molto più larga e grande su desktop */
  background: #101c3d;
  border: 1px solid #d4af37;
  border-radius: 14px;
  padding: 35px; /* Spaziatura interna generosa */
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: modalFadeIn 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}

.calendar-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.3);
  padding-bottom: 15px;
}

.calendar-modal-header h3 {
  color: #f6eaaf;
  font-family: serif;
  font-size: 1.4rem;
  margin: 0;
}

.calendar-modal-close {
  background: none;
  border: none;
  color: #b2bed2;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
  transition: color 0.2s;
}

.calendar-modal-close:hover {
  color: #e74c3c;
}

.calendar-modal-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.calendar-text-input,
.calendar-datetime-input {
  width: 100%;
  background: #040914 !important;
  color: #fff !important;
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 12px 15px;
  border-radius: 6px;
  font-size: 1rem;
  box-sizing: border-box;
}

.calendar-textarea-input {
  width: 100%;
  height: 140px; /* Area di descrizione molto più ampia e comoda */
  background: #040914 !important;
  color: #fff !important;
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 12px 15px;
  border-radius: 6px;
  font-size: 1rem;
  box-sizing: border-box;
  resize: vertical;
}

.calendar-modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 10px;
}

/* Ottimizzazione Specifica per Smartphone (Modale grande ma adattata allo schermo) */
@media (max-width: 768px) {
  .calendar-modal-overlay {
    padding: 10px;
  }

  .calendar-modal-box {
    width: 98vw !important;
    max-width: 98vw !important;
    padding: 20px !important;
    max-height: 92vh;
  }

  .calendar-modal-header h3 {
    font-size: 1.2rem;
  }

  .calendar-textarea-input {
    height: 120px;
  }

  .calendar-modal-footer {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .calendar-modal-footer button {
    width: 100% !important;
    padding: 14px !important;
    font-size: 1rem !important;
    text-align: center;
    justify-content: center;
  }
}

/* --- Pulsanti Modifica ed Elimina Compatti per gli Eventi del Calendario --- */
.calendar-actions-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.calendar-actions-group .btn-action,
.calendar-actions-group .btn-delete-calendar {
  padding: 5px 10px !important;
  font-size: 0.75rem !important;
  border-radius: 4px !important;
  height: auto !important;
  line-height: 1.2;
}

.calendar-actions-group .btn-action {
  background: #3498db;
  color: #fff;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  font-weight: bold;
}

.calendar-actions-group .btn-action:hover {
  background: #2980b9;
}

.calendar-actions-group .btn-delete-calendar {
  background: #e74c3c;
  color: #fff;
  border: none;
  cursor: pointer;
}

.calendar-actions-group .btn-delete-calendar:hover {
  background: #c0392b;
}

/* Adattamento per dispositivi mobili */
@media (max-width: 768px) {
  .calendar-actions-group {
    width: 100%;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 5px;
  }

  .calendar-actions-group .btn-action,
  .calendar-actions-group .btn-delete-calendar {
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
  }
}

/* --- Evidenziazione Eventi in Scadenza (entro 3 giorni) --- */
.calendar-item-card.calendar-item-scadenza {
  border-left: 5px solid #f39c12 !important;
  //background: rgba(243, 156, 18, 0.08) !important;
}

.badge-scadenza {
  background: rgba(243, 156, 18, 1);
  color: #000;
  border: 1px solid rgba(243, 156, 18, 0.4);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: bold;
  text-transform: uppercase;
  margin-left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: middle;
}

/* --- Stile Selettore Anno Calendario --- */
.calendar-year-select {
  background: #040914 !important;
  color: #f6eaaf !important;
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
}

/* --- Header Archivio con Selettore Anno --- */
.archive-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 15px 0;
  gap: 15px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .archive-header-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* --- Stili per Immagini e Link nelle Note --- */
.note-inline-link {
  color: #f6eaaf;
  text-decoration: underline;
  word-break: break-all;
}

.note-inline-link:hover {
  color: #d4af37;
}

.note-upload-group {
  background: rgba(212, 175, 55, 0.05);
  border: 1px dashed rgba(212, 175, 55, 0.3);
  padding: 10px 12px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.note-upload-group-edit {
  margin-bottom: 12px;
}

.note-upload-label,
.note-upload-label-small {
  font-size: 0.75rem;
  color: #d4af37;
  text-transform: uppercase;
}

.note-file-input {
  background: #040914 !important;
  color: #fff !important;
  padding: 6px !important;
  font-size: 0.85rem !important;
}

.note-img-container {
  margin-top: 12px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.3);
  max-height: 220px;
}

.note-card-thumb {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.note-card-thumb:hover {
  transform: scale(1.02);
}

/* --- Classi per eliminazione stili in linea nelle note --- */
.note-hidden-box {
  display: none;
}

.note-view-block {
  display: block;
}

/* --- Stili per Gallerie Immagini e File Scaricabili nelle Note --- */
.note-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.note-files-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.note-file-item {
  background: rgba(4, 9, 20, 0.4);
  border: 1px solid rgba(212, 175, 55, 0.2);
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.2s;
}

.note-file-item:hover {
  background: rgba(212, 175, 55, 0.1);
}

.note-file-link {
  color: #f6eaaf;
  font-size: 0.9rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  word-break: break-all;
}

.note-file-link:hover {
  color: #d4af37;
}

.note-removable-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 12px;
}

.note-remove-tag {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.note-remove-tag button {
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
  display: flex;
  align-items: center;
}

.note-remove-tag button:hover {
  color: #c0392b;
}

/* --- Stili per Anteprime e Pulsante Carica Altri File nella Modale Nota --- */
.note-preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 10px;
}

.note-preview-item {
  position: relative;
  width: 75px;
  height: 75px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: #040914;
  display: flex;
  align-items: center;
  justify-content: center;
}

.note-preview-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.note-preview-file-icon {
  font-size: 1.2rem;
  color: #d4af37;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px;
}

.note-preview-file-icon span {
  font-size: 0.55rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 65px;
  margin-top: 3px;
  color: #fff;
}

.note-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(231, 76, 60, 0.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.note-preview-remove:hover {
  background: #c0392b;
}

.btn-upload-more {
  background: rgba(212, 175, 55, 0.12) !important;
  color: #f6eaaf !important;
  border: 1px dashed rgba(212, 175, 55, 0.5) !important;
  padding: 10px 15px !important;
  font-size: 0.9rem !important;
  width: 100%;
  justify-content: center;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.btn-upload-more:hover {
  background: rgba(212, 175, 55, 0.25) !important;
  color: #fff !important;
}

/* --- Anteprime Documenti e File Ottimizzate nella Modale Nota --- */
.note-preview-item {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: #040914;
  display: flex;
  align-items: center;
  justify-content: center;
}

.note-preview-file-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.note-preview-file-box i {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.note-preview-filename {
  font-size: 0.65rem;
  color: #fff;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: 1.1;
}

/* Colori icone file specifici */
.file-icon-pdf { color: #e74c3c; }
.file-icon-word { color: #3498db; }
.file-icon-excel { color: #2ecc71; }
.file-icon-zip { color: #f39c12; }
.file-icon-default { color: #b2bed2; }