#grafico_dashboard_crm{
width:100%;
height: calc(30vh);
}

#dashboard_crm *{
     font-family: 'Poppins', sans-serif;
}
.fa, .fa-solid, .fa-regular, .fa-brands {
  font-family: "Font Awesome 6 Free" !important;
}

#dashboard_crm .pulsante{
    width: calc( 100% - 6px);
}


.event-card {
    background-color: white;
    display: flex;
    padding: 10px;
    margin: 10px 0;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    align-items: center;
    cursor: pointer;
    font-size: 1.2em;
}

.date-box {
    color: white;
    text-align: center;
    border-radius: 6px;
    border:1px solid #98a0ab;
    font-size: 12px;
    margin-right: 10px;
    min-width: 65px;
    max-width: 65px;
    width: 65px;
}

.date-box .mese {
background-color: #2e7d32;
font-size: 10px;
text-transform: uppercase;
height: 15px;
font-weight: bold;
line-height: 15px;
border-radius: 6px;
}

.anno{
    background-color: #00B0F0;
}

.date-box .giorno {
font-size: 30px;
font-weight: bold;
background: white;
padding: 10px;
color:#444;
}


.date-box .giorno_settimana {
font-size: 11px;
font-weight: bold;
color:#98a0ab;
text-transform: uppercase;
}

.event-details {
flex-grow: 1;
}

.event-title {
font-weight: bold;
font-size: 16px;
}

.event-subtitle {
color: #666;
font-size: 14px;
margin: 2px 0;
}

.event-meta {
color: gray;
font-size: 12px;
}

.badge {
background-color: #ff9800;
color: white;
border-radius: 20px;
padding: 2px 8px;
font-size: 12px;
margin-top: 5px;
display: inline-block;
float:right;
}

.tab-bar {
position: fixed;
bottom: 0;
width: 100%;
background: #f2f2f2;
border-top: 1px solid #ccc;
display: flex;
justify-content: space-around;
padding: 5px 0;
z-index: 1000;
}

.tab-item {
flex: 1;
text-align: center;
color: #888;
font-size: 12px;
text-decoration: none;
}

.tab-item i{
display: block;
}

a.tab-item, a.pulsante_medium{
    text-decoration: none;
}

.tab-item.active {
color: #009688;
font-weight: bold;
}

.chart-container {
display: flex;
justify-content: space-between; /* o space-around */
flex-wrap: wrap; /* per andare a capo se serve */
padding: 10px 0;
}

.chart-box {
flex: 0 0 33.33%;
max-width: 33.33%;
text-align: center;
box-sizing: border-box;
padding: 5px;
}

.chart-box b{
  background: #eee;
  width: fit-content;
  padding: 5px;
  border-radius: 25px;
}

.chart-box canvas {
width: 100% !important;
height: auto !important;
aspect-ratio: 1 / 1;
}

    
.separatore_gray{
    height: 1px; 
    width: 100%; 
    background: lightgrey;
    margin-top: 10px;
    margin-bottom: 10px;
    clear: both;
}

#dashboard_crm h1{
    padding: 5px !important;
    width:fit-content;
    margin:5px 0 15px 0;
    color:black;
    text-align: left;
    font-size: 30px;
    height: fit-content;
}

#dashboard_crm h3{
    padding: 5px !important;
    width:fit-content;
    margin: 0px;
    border-bottom: none;
}

 .evento_info {
    padding: 15px;
    border-radius: 10px;
    background-color: #f8f9fa;
    box-shadow: 0 0 8px rgba(0,0,0,0.05);
    margin-bottom: 15px;
    width: calc(100% - 30px);
    display: none;
    border: 0.5px solid lightgray;
    font-size: 13px;
  }

  .evento_riga {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .evento_icon {
    width: 32px; /* larghezza fissa per la colonna delle icone */
    text-align: center;
    color: #555; /* colore uniforme per tutte le icone */
    margin-top: 0px;
    flex-shrink: 0;
  }

  .evento_testo {
    flex: 1;
  }

  #dashboard_crm .evento_testo strong {
    display: block;
    margin-bottom: 2px;
    color: #222;
    font-size: 1.2em;
  }

  #dashboard_crm .evento_testo span {
    color: #444;
    display: block;
    font-size: 1.1em;
  }
  
  #dashboard_crm .pulsante_medium, #dashboard_crm .pulsante{
      font-size: 1.1em;
  }
  
  #dashboard_crm input[type="text"]{
      min-height: 40px !important;
      font-size: 1.5em;
  }
  
#dashboard_crm .pulsante_ricerca{
      width:40px;
      height: 40px;
      padding: 5px;
      border: none;
      background: #009688;   
      text-align: center;
      margin-left: 3px;
  }
  
  #dashboard_crm .pulsante_ricerca img{
      width:30px;
  }
 
@media screen and (max-width: 768px) {
    #container {
        padding-bottom: 50px;
    }
}
/* =========================================================
   DASHBOARD CRM
   ========================================================= */
#crm_dashboard{
    width:100%;
    clear:both;
    margin:5px 0 15px 0;
}

.crm_dashboard_statistiche{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:10px;
    margin-bottom:10px;
}

.crm_dashboard_card{
    min-width:0;
    min-height:95px;
    display:flex;
    align-items:center;
    gap:12px;
    box-sizing:border-box;
    padding:14px;
    background:#fff;
    border:1px solid #e8ebef;
    border-radius:12px;
    box-shadow:0 2px 8px rgba(0,0,0,.06);
}

.crm_dashboard_card_icona{
    width:48px;
    min-width:48px;
    height:48px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:12px;
    font-size:20px;
}

.crm_dashboard_card_testo{
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:4px;
}

.crm_dashboard_card_testo span{
    color:#68717d;
    font-size:12px;
    font-weight:600;
    text-transform:uppercase;
}

.crm_dashboard_card_testo strong{
    color:#202733;
    font-size:23px;
    line-height:25px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.crm_dashboard_card_testo small{
    color:#8a929d;
    font-size:11px;
    line-height:14px;
}

.crm_dashboard_card_blue .crm_dashboard_card_icona{background:#e5f4fc;color:#039be6;}
.crm_dashboard_card_green .crm_dashboard_card_icona{background:#e6f6f0;color:#21975b;}
.crm_dashboard_card_orange .crm_dashboard_card_icona{background:#fff3dd;color:#e39a11;}
.crm_dashboard_card_red .crm_dashboard_card_icona{background:#fde9ed;color:#d93659;}

.crm_dashboard_colonne{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    gap:10px;
}

.crm_dashboard_pannello{
    min-width:0;
    background:#fff;
    border:1px solid #e8ebef;
    border-radius:12px;
    box-shadow:0 2px 8px rgba(0,0,0,.06);
    overflow:hidden;
}

.crm_dashboard_pannello_titolo{
    min-height:48px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    box-sizing:border-box;
    padding:8px 12px;
    border-bottom:1px solid #edf0f3;
}

.crm_dashboard_pannello_titolo > div{
    min-width:0;
    display:flex;
    align-items:center;
    gap:8px;
    color:#29313c;
    font-weight:600;
}

.crm_dashboard_pannello_titolo > div i{color:#039be6;}
.crm_dashboard_pannello_titolo .pulsante{float:none;margin:0;height:28px;line-height:28px;}

.crm_dashboard_situazioni,
.crm_dashboard_eventi{
    max-height:330px;
    overflow-y:auto;
    padding:10px 12px;
}

.crm_dashboard_situazione_riga{margin-bottom:12px;}
.crm_dashboard_situazione_riga:last-child{margin-bottom:0;}

.crm_dashboard_situazione_testo{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-bottom:5px;
}

.crm_dashboard_situazione_testo span{color:#4d5662;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.crm_dashboard_situazione_testo strong{color:#202733;}

.crm_dashboard_barra{
    width:100%;
    height:7px;
    background:#edf0f3;
    border-radius:10px;
    overflow:hidden;
}

.crm_dashboard_barra span{
    display:block;
    min-width:3px;
    height:100%;
    background:#039be6;
    border-radius:10px;
}

.crm_dashboard_giorno{
    padding:5px 0 6px 0;
    color:#6e7681;
    font-size:11px;
    font-weight:700;
    text-transform:uppercase;
}

.crm_dashboard_evento{
    display:flex;
    align-items:center;
    gap:10px;
    min-height:48px;
    box-sizing:border-box;
    padding:7px 8px;
    margin-bottom:6px;
    background:#f8fafc;
    border:1px solid #eef1f4;
    border-radius:9px;
    color:#333;
    text-decoration:none;
}

.crm_dashboard_evento:hover{background:#eef8fd;text-decoration:none;}
.crm_dashboard_evento_ora{min-width:43px;color:#039be6;font-weight:700;text-align:center;}
.crm_dashboard_evento_contenuto{min-width:0;flex:1;display:flex;flex-direction:column;gap:3px;}
.crm_dashboard_evento_contenuto strong,.crm_dashboard_evento_contenuto span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.crm_dashboard_evento_contenuto strong{color:#27303b;}
.crm_dashboard_evento_contenuto span{color:#747d88;font-size:11px;}
.crm_dashboard_evento > i{color:#a6adb6;}

.crm_dashboard_vuoto{
    padding:25px 10px;
    color:#8b939d;
    text-align:center;
    background:#f8fafc;
    border-radius:8px;
}

@media screen and (max-width:1200px){
    .crm_dashboard_statistiche{grid-template-columns:repeat(2,minmax(0,1fr));}
}

@media screen and (max-width:900px){
    .crm_dashboard_colonne{grid-template-columns:1fr;}
}

@media screen and (max-width:600px){
    .crm_dashboard_statistiche{grid-template-columns:1fr;}
    .crm_dashboard_card{min-height:82px;padding:11px;}
    .crm_dashboard_card_icona{width:42px;min-width:42px;height:42px;}
    .crm_dashboard_card_testo strong{font-size:20px;line-height:22px;}
    .crm_dashboard_pannello_titolo{align-items:flex-start;flex-direction:column;}
    .crm_dashboard_pannello_titolo .pulsante{width:100%;box-sizing:border-box;}
    .crm_dashboard_situazioni,.crm_dashboard_eventi{max-height:none;}
}

/* =========================================================
   ELENCO OPPORTUNITA CRM - VERSIONE COMPATTA
   ========================================================= */
.crm_elenco_header{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:18px 0 8px 0}.crm_elenco_header h3{width:auto;height:auto;line-height:normal;margin:0;padding:0;border:0;font-size:18px;color:#202733}.crm_elenco_header span{display:block;margin-top:4px;color:#7a8491;font-size:12px}.crm_elenco_colonne,.crm_opportunita_principale{display:grid;grid-template-columns:minmax(250px,2fr) minmax(150px,1.05fr) minmax(190px,1.35fr) minmax(90px,.65fr) minmax(105px,.75fr) minmax(165px,1fr);align-items:center;gap:12px}.crm_elenco_colonne{padding:8px 16px;color:#7a8491;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.45px}.crm_elenco_opportunita{display:flex;flex-direction:column;gap:7px}.crm_opportunita_riga{position:relative;background:#fff;border:1px solid #e4e8ed;border-left:4px solid #98a0ab;border-radius:10px;box-shadow:0 1px 4px rgba(30,40,55,.05);overflow:hidden;transition:box-shadow .2s ease,border-color .2s ease}.crm_opportunita_riga:hover{box-shadow:0 4px 12px rgba(30,40,55,.09)}.crm_opportunita_riga.crm_priorita_rossa{border-left-color:#e54c34}.crm_opportunita_riga.crm_priorita_arancio{border-left-color:#ffae19}.crm_opportunita_riga.crm_priorita_verde{border-left-color:#66a653}.crm_opportunita_principale{min-height:76px;padding:10px 12px;box-sizing:border-box}.crm_opportunita_cliente,.crm_opportunita_situazione,.crm_opportunita_attivita,.crm_opportunita_importo,.crm_opportunita_probabilita,.crm_opportunita_azioni{min-width:0}.crm_opportunita_cliente_riga{display:flex;align-items:center;gap:6px;margin-bottom:3px}.crm_badge_lead{display:inline-flex;align-items:center;height:18px;padding:0 6px;border-radius:9px;background:#46bcb6;color:#fff;font-size:9px;font-weight:700;text-transform:uppercase}.crm_opportunita_numero{color:#98a0ab;font-size:10px;font-weight:600}.crm_opportunita_denominazione{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#1f2937;font-size:14px;font-weight:700;line-height:18px}.crm_opportunita_denominazione:hover{text-decoration:none;color:#039be6}.crm_opportunita_titolo{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:2px;color:#4f5966;font-size:12px;line-height:16px}.crm_opportunita_secondario{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:5px;color:#8a949f;font-size:10px}.crm_situazione_badge{display:inline-block;max-width:100%;box-sizing:border-box;padding:5px 8px;border-radius:12px;color:#fff;font-size:9px;font-weight:700;text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.crm_data_chiusura{display:block;width:fit-content;margin-top:6px;padding:3px 6px;border-radius:8px;background:#f1f3f5;color:#68717d;font-size:9px;font-weight:600}.crm_data_chiusura.scaduta{background:#ffe6e3;color:#c63e2a}.crm_attivita_prossima,.crm_attivita_assente{width:100%;min-width:0;margin:0;padding:0;background:transparent;border:0;text-align:left;cursor:pointer}.crm_attivita_prossima span,.crm_attivita_prossima strong,.crm_attivita_prossima small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crm_attivita_tipo{font-size:9px;font-weight:800;text-transform:uppercase}.crm_attivita_prossima strong{margin-top:2px;color:#303947;font-size:11px}.crm_attivita_prossima small{margin-top:2px;color:#7d8793;font-size:10px}.crm_attivita_assente{display:inline-flex;align-items:center;gap:6px;padding:7px 9px;border:1px dashed #ffae19;border-radius:8px;color:#b97900;font-size:10px;font-weight:700}.crm_opportunita_importo strong{display:block;color:#26313f;font-size:14px;text-align:right}.crm_opportunita_importo span{display:block;color:#adb4bc;text-align:right}.crm_probabilita_valore{color:#303947;font-size:12px;font-weight:700;text-align:center}.crm_probabilita_barra{height:6px;margin-top:5px;background:#e4e7eb;border-radius:6px;overflow:hidden}.crm_probabilita_barra span{display:block;height:100%;max-width:100%;background:#349480;border-radius:6px}.crm_opportunita_azioni{display:flex;align-items:center;justify-content:flex-end;gap:5px}.crm_opportunita_azioni button,.crm_opportunita_azioni a{display:inline-flex;align-items:center;justify-content:center;height:30px;box-sizing:border-box;border:0;border-radius:7px;cursor:pointer;text-decoration:none;transition:transform .15s ease,opacity .15s ease}.crm_opportunita_azioni button:hover,.crm_opportunita_azioni a:hover{transform:translateY(-1px);text-decoration:none}.crm_azione_seleziona,.crm_azione_evento,.crm_azione_espandi{width:30px}.crm_azione_seleziona{background:#64994e;color:#fff}.crm_azione_evento{background:#e9f7fb;color:#039be6}.crm_azione_dettagli{gap:5px;padding:0 9px;background:#039be6;color:#fff!important;font-size:10px;font-weight:700;text-transform:uppercase}.crm_azione_espandi{background:#f0f2f4;color:#68717d}.crm_opportunita_dettagli{display:none;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:12px 14px 14px;border-top:1px solid #edf0f3;background:#fafbfc}.crm_opportunita_dettagli[style*="display: block"]{display:grid!important}.crm_dettaglio_blocco{min-width:0;padding:10px;background:#fff;border:1px solid #e9edf1;border-radius:8px}.crm_dettaglio_blocco h4{width:auto;height:auto;line-height:normal;margin:0 0 8px;padding:0 0 7px;border-bottom:1px solid #edf0f3;color:#4c5663;font-size:11px;text-transform:uppercase}.crm_dettaglio_blocco>div{display:grid;grid-template-columns:75px minmax(0,1fr);gap:7px;margin-top:6px}.crm_dettaglio_blocco>div span{color:#929ba5;font-size:9px}.crm_dettaglio_blocco>div strong,.crm_dettaglio_blocco>div a{min-width:0;overflow-wrap:anywhere;color:#374151;font-size:10px;font-weight:600}.crm_dettaglio_evento{display:grid;width:100%;grid-template-columns:auto 1fr;gap:4px 7px;margin:0;padding:0;background:transparent;border:0;text-align:left;cursor:pointer}.crm_dettaglio_evento>span{grid-row:1/3;align-self:start;padding:4px 6px;border-radius:8px;color:#fff!important;font-size:8px!important;font-weight:700;text-transform:uppercase}.crm_dettaglio_evento strong{font-size:10px}.crm_dettaglio_evento small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#7d8793;font-size:9px}.crm_dettaglio_vuoto{display:block!important;color:#98a0ab;font-size:10px}.crm_dettaglio_aggiungi{display:inline-flex;align-items:center;gap:6px;padding:7px 9px;border:0;border-radius:7px;background:#1bc5bd;color:#fff;font-size:10px;font-weight:700;cursor:pointer}

@media screen and (max-width:1180px){.crm_elenco_colonne,.crm_opportunita_principale{grid-template-columns:minmax(230px,2fr) minmax(145px,1fr) minmax(175px,1.25fr) 90px 95px 135px}.crm_azione_dettagli span{display:none}.crm_azione_dettagli{width:30px;padding:0}.crm_opportunita_dettagli{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media screen and (max-width:900px){.crm_elenco_colonne{display:none}.crm_opportunita_principale{grid-template-columns:minmax(0,1.6fr) minmax(135px,1fr) minmax(165px,1.2fr) 80px 90px;gap:10px}.crm_opportunita_azioni{grid-column:1/-1;justify-content:flex-end;padding-top:7px;border-top:1px solid #f0f2f4}.crm_azione_dettagli{width:auto;padding:0 10px}.crm_azione_dettagli span{display:inline}.crm_opportunita_importo strong{font-size:12px}}
@media screen and (max-width:768px){.crm_elenco_header{align-items:flex-end}.crm_elenco_header .pulsante{width:auto!important}.crm_opportunita_riga{border-radius:10px}.crm_opportunita_principale{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;padding:12px}.crm_opportunita_cliente{grid-column:1/2}.crm_opportunita_situazione{grid-column:2/3;text-align:right}.crm_opportunita_situazione .crm_data_chiusura{margin-left:auto}.crm_opportunita_attivita{grid-column:1/-1;padding:9px 0;border-top:1px solid #edf0f3;border-bottom:1px solid #edf0f3}.crm_opportunita_importo{grid-column:1/2}.crm_opportunita_importo strong,.crm_opportunita_importo span{text-align:left}.crm_opportunita_probabilita{grid-column:2/3;min-width:85px}.crm_opportunita_azioni{grid-column:1/-1;padding-top:8px;border-top:0}.crm_opportunita_azioni button,.crm_opportunita_azioni a{height:34px}.crm_azione_seleziona,.crm_azione_evento,.crm_azione_espandi{width:34px}.crm_azione_dettagli{flex:1}.crm_opportunita_dettagli,.crm_opportunita_dettagli[style*="display: block"]{grid-template-columns:1fr}.crm_opportunita_denominazione{font-size:15px}.crm_opportunita_titolo{white-space:normal}.crm_situazione_badge{max-width:145px}}
@media screen and (max-width:420px){.crm_elenco_header{display:block}.crm_elenco_header .pulsante{margin-top:8px!important}.crm_opportunita_principale{grid-template-columns:minmax(0,1fr)}.crm_opportunita_cliente,.crm_opportunita_situazione,.crm_opportunita_attivita,.crm_opportunita_importo,.crm_opportunita_probabilita,.crm_opportunita_azioni{grid-column:1/-1}.crm_opportunita_situazione{text-align:left}.crm_opportunita_situazione .crm_data_chiusura{margin-left:0}.crm_probabilita_valore{text-align:left}.crm_opportunita_probabilita{min-width:0}.crm_situazione_badge{max-width:100%}}


/* =========================================================
   ELENCO OPPORTUNITA - REGOLE FINALI DI SICUREZZA
   Queste regole restano in fondo al file per prevalere sugli
   stili generali e responsive di Gestendo.
   ========================================================= */
#crm_elenco_opportunita{
    display:flex !important;
    flex-direction:column !important;
    gap:8px !important;
    width:100% !important;
    clear:both !important;
}

#crm_elenco_opportunita .crm_opportunita_riga{
    display:block !important;
    width:100% !important;
    box-sizing:border-box !important;
    margin:0 !important;
    padding:0 !important;
    background:#fff !important;
}

#crm_elenco_opportunita .crm_opportunita_principale{
    display:grid !important;
    box-sizing:border-box !important;
}

#crm_elenco_opportunita .crm_opportunita_cliente,
#crm_elenco_opportunita .crm_opportunita_situazione,
#crm_elenco_opportunita .crm_opportunita_attivita,
#crm_elenco_opportunita .crm_opportunita_importo,
#crm_elenco_opportunita .crm_opportunita_probabilita,
#crm_elenco_opportunita .crm_opportunita_azioni{
    display:block;
    width:auto !important;
    min-width:0 !important;
    max-width:none !important;
    margin:0 !important;
    padding:0;
    float:none !important;
    clear:none !important;
}

#crm_elenco_opportunita .crm_opportunita_azioni{
    display:flex !important;
}

#crm_elenco_opportunita .crm_opportunita_dettagli{
    float:none !important;
    clear:both !important;
    width:auto !important;
    box-sizing:border-box !important;
}

@media screen and (max-width:900px){
    #crm_elenco_opportunita .crm_opportunita_principale{
        grid-template-columns:minmax(0,1.6fr) minmax(135px,1fr) minmax(165px,1.2fr) 80px 90px !important;
    }
    #crm_elenco_opportunita .crm_opportunita_azioni{
        grid-column:1/-1 !important;
    }
}

@media screen and (max-width:768px){
    #crm_elenco_opportunita .crm_opportunita_principale{
        grid-template-columns:minmax(0,1fr) auto !important;
    }
    #crm_elenco_opportunita .crm_opportunita_cliente{grid-column:1/2 !important;}
    #crm_elenco_opportunita .crm_opportunita_situazione{grid-column:2/3 !important;}
    #crm_elenco_opportunita .crm_opportunita_attivita{grid-column:1/-1 !important;}
    #crm_elenco_opportunita .crm_opportunita_importo{grid-column:1/2 !important;}
    #crm_elenco_opportunita .crm_opportunita_probabilita{grid-column:2/3 !important;}
    #crm_elenco_opportunita .crm_opportunita_azioni{grid-column:1/-1 !important;}
}

@media screen and (max-width:420px){
    #crm_elenco_opportunita .crm_opportunita_principale{
        grid-template-columns:minmax(0,1fr) !important;
    }
    #crm_elenco_opportunita .crm_opportunita_cliente,
    #crm_elenco_opportunita .crm_opportunita_situazione,
    #crm_elenco_opportunita .crm_opportunita_attivita,
    #crm_elenco_opportunita .crm_opportunita_importo,
    #crm_elenco_opportunita .crm_opportunita_probabilita,
    #crm_elenco_opportunita .crm_opportunita_azioni{
        grid-column:1/-1 !important;
    }
}

/* Elenco completo eventi nell'espansione opportunita */
#crm_elenco_opportunita .crm_dettaglio_eventi_completo{
    grid-column:1 / -1;
    width:auto;
}

#crm_elenco_opportunita .crm_eventi_titolo{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-bottom:8px;
}

#crm_elenco_opportunita .crm_eventi_titolo h4{
    margin:0;
    padding:0 0 8px 0;
    width:auto;
    flex:1;
}

#crm_elenco_opportunita .crm_eventi_titolo .crm_dettaglio_aggiungi{
    flex:0 0 auto;
    margin:0 0 8px 0;
}

#crm_elenco_opportunita .crm_eventi_lista_completa{
    display:flex;
    flex-direction:column;
    gap:6px;
    max-height:320px;
    overflow-y:auto;
    padding-right:4px;
}

#crm_elenco_opportunita .crm_evento_riga_completa{
    display:grid;
    grid-template-columns:10px 105px minmax(0,1fr) auto 14px;
    align-items:center;
    gap:10px;
    width:100%;
    min-height:48px;
    padding:8px 10px;
    border:1px solid #e5e9ef;
    border-radius:8px;
    background:#fff;
    color:#333;
    text-align:left;
    cursor:pointer;
    transition:background .2s ease,border-color .2s ease,box-shadow .2s ease;
}

#crm_elenco_opportunita .crm_evento_riga_completa:hover{
    background:#f8fbfd;
    border-color:#bcdff2;
    box-shadow:0 2px 6px rgba(0,0,0,.06);
}

#crm_elenco_opportunita .crm_evento_pallino{
    width:9px;
    height:9px;
    border-radius:50%;
}

#crm_elenco_opportunita .crm_evento_data{
    display:flex;
    flex-direction:column;
    gap:3px;
}

#crm_elenco_opportunita .crm_evento_data strong{
    font-size:12px;
    white-space:nowrap;
}

#crm_elenco_opportunita .crm_evento_data small{
    color:#788593;
    font-size:11px;
}

#crm_elenco_opportunita .crm_evento_contenuto{
    display:flex;
    align-items:center;
    min-width:0;
    gap:8px;
}

#crm_elenco_opportunita .crm_evento_contenuto > strong{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:12px;
}

#crm_elenco_opportunita .crm_evento_tipo,
#crm_elenco_opportunita .crm_evento_situazione{
    display:inline-flex;
    align-items:center;
    min-height:20px;
    padding:0 7px;
    border-radius:10px;
    color:#fff;
    font-size:9px;
    font-weight:600;
    text-transform:uppercase;
    white-space:nowrap;
}

#crm_elenco_opportunita .crm_evento_riga_completa > i{
    color:#9aa7b3;
}

@media screen and (max-width:768px){
    #crm_elenco_opportunita .crm_eventi_titolo{
        align-items:flex-start;
        flex-direction:column;
    }

    #crm_elenco_opportunita .crm_evento_riga_completa{
        grid-template-columns:8px 82px minmax(0,1fr) 12px;
        gap:7px;
        padding:9px 8px;
    }

    #crm_elenco_opportunita .crm_evento_contenuto{
        align-items:flex-start;
        flex-direction:column;
        gap:4px;
    }

    #crm_elenco_opportunita .crm_evento_situazione{
        grid-column:3;
        width:fit-content;
    }

    #crm_elenco_opportunita .crm_evento_riga_completa > i{
        grid-column:4;
        grid-row:1 / span 2;
    }
}


/* FIX VISUALIZZAZIONE ELENCO COMPLETO EVENTI */
#crm_elenco_opportunita .crm_opportunita_dettagli.crm_aperto{
    display:grid !important;
}
#crm_elenco_opportunita .crm_dettaglio_eventi_completo{
    display:block !important;
    grid-column:1 / -1 !important;
    width:100% !important;
    min-width:0 !important;
    box-sizing:border-box !important;
    clear:both !important;
}
#crm_elenco_opportunita .crm_eventi_lista_completa{
    display:flex !important;
}


/* APERTURA DETTAGLI OPPORTUNITA - VERSIONE STABILE */
#crm_elenco_opportunita .crm_opportunita_dettagli{
    display:none !important;
}
#crm_elenco_opportunita .crm_opportunita_dettagli.crm_aperto{
    display:grid !important;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:12px;
    width:100%;
    box-sizing:border-box;
}
#crm_elenco_opportunita .crm_dettaglio_eventi_completo{
    display:block !important;
    grid-column:1 / -1 !important;
    width:100% !important;
    box-sizing:border-box !important;
}
#crm_elenco_opportunita .crm_eventi_lista_completa{
    display:flex !important;
    flex-direction:column !important;
    gap:7px !important;
    width:100% !important;
    max-height:360px;
    overflow-y:auto;
}
@media screen and (max-width:1180px){
    #crm_elenco_opportunita .crm_opportunita_dettagli.crm_aperto{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}
@media screen and (max-width:768px){
    #crm_elenco_opportunita .crm_opportunita_dettagli.crm_aperto{
        grid-template-columns:1fr;
    }
}


/* Stato vuoto prossima attività: il pulsante di creazione resta solo in Eventi e attività */
#crm_elenco_opportunita .crm_dettaglio_blocco .crm_dettaglio_vuoto{padding:8px 0;color:#98a0ab;background:transparent;text-align:left;}
