/* ======================================================
   mio CRM – LAYOUT PAGINA
   ====================================================== */

.mio-crm-page {
  background: #f4f6f8;
  padding: 32px 0;
}


.mio-crm-form {
  max-width: 100%;
  width:100%;
  background: #fff;
  border-radius: 8px;
  padding:20px;
  box-sizing: border-box;
}


/* ======================================================
   mio CRM – FORM GRID
   ====================================================== */

.mio-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.mio-field {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.mio-field label {
  font-weight: 600;
  margin-bottom: 6px;
}

.mio-field input,
.mio-field select,
.mio-field textarea {
  padding: 8px 10px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid #ccc;
}


/* ======================================================
   MIO CRM – LARGHEZZE CAMPI (12 COLONNE)
   ====================================================== */

.field-xxsmall { grid-column: span 1; }
.field-xsmall  { grid-column: span 2; }
.field-small   { grid-column: span 3; }
.field-medium  { grid-column: span 4; }
.field-large   { grid-column: span 6; }
.field-xlarge  { grid-column: span 8; }
.field-full    { grid-column: span 12; }


/* ======================================================
   MIO CRM – BOTTONI
   ====================================================== */

.mio-btn-primary {
  padding: 10px 20px;
  font-size: 15px;
  cursor: pointer;
  border-radius: 6px;
  border: none;
  background: #1976d2;
  color: #fff;
}

.mio-btn-primary:hover {
  background: #125aa3;
}


/* ======================================================
   MIO CRM – FEEDBACK / ALERT
   ====================================================== */

.mio-form-feedback {
  margin-bottom: 16px;
}

.mio-alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
}

/* SUCCESS */
.mio-alert-success {
  background: #e8f5e9;
  border: 1px solid #81c784;
  color: #1b5e20;
}

/* ERROR */
.mio-alert-error {
  background: #fdecea;
  border: 1px solid #e57373;
  color: #b71c1c;
}


/* ======================================================
   mio CRM – AVANZAMENTI / ALLEGATI
   ====================================================== */

.mio-avanzamenti {
  list-style: none;
  padding-left: 0;
}

.mio-avanzamento {
    padding: 20px 24px;
    border-left: 4px solid #8B2E1C;  /* richiamo al titolo */
    background: #fafafa;
    margin-bottom: 16px;
    border-radius: 6px;
}

.mio-av-toggle {
    margin-right: 8px;
}

.mio-av-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mio-av-title {
    color: #8B2E1C;
    font-weight: 600;
}

.mio-av-meta {
    margin-left: auto;
    font-size: 13px;
    color: #777;
}


.mio-av-body {
  display: none;
  padding: 12px;
  background: #fff;
}

.mio-avanzamento.open .mio-av-body {
  display: block;
}

.mio-avanzamento.open .mio-av-toggle {
  transform: rotate(180deg);
}

.mio-avanzamento-allegati ul {
  list-style: none;
  padding-left: 0;
  margin: 6px 0;
}

.mio-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.mio-file-name {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mio-delete-file {
  border: none;
  background: none;
  cursor: pointer;
  color: #c00;
  font-size: 16px;
  padding: 2px;
}

.mio-delete-file:hover {
  color: #ff0000;
}


/* ======================================================
   mio CRM – MOBILE
   ====================================================== */

@media (max-width: 768px) {
  .mio-row {
    grid-template-columns: 1fr;
  }

  .field-xxsmall,
  .field-xsmall,
  .field-small,
  .field-medium,
  .field-large,
  .field-xlarge,
  .field-full {
    grid-column: span 1;
  }
}



/* ======================================================
   mio CRM – TRATTATIVA
   ====================================================== */


.mio-trattativa {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #374151;
}


/* Titolo principale */
.mio-trattativa h2 {
    color: #0175F2;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
}


/* Titoli sezione */
.mio-trattativa h3 {
    color: #449C2A;
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 12px;
}

.mio-trattativa-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}


/* Meta dati */
.mio-trattativa-meta strong {
    color: #111827;
    font-weight: 600;
}


.mio-trattativa-meta ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(430px, 1fr));
    gap: 12px 24px;
}


.mio-trattativa-meta li {
    width: 100%;
    padding: 6px 0;
}


/* Stato archiviata */
.mio-readonly-notice {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* Salvato con successo */
.mio-success {
    background: #A4CC2A;
    color: #92400E;
    border: 1px solid #FDE68A;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    text-align: center;
}

.mio-crm-table {
    width: 100%;
    border-collapse: collapse;
}

/* ======================================================
   NOTE TRATTATIVA
   ====================================================== */

.mio-trattativa-note {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8fafc;
    border-left: 4px solid #1f2d3d;
    border-radius: 8px;
}

.mio-trattativa-note strong {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #1f2d3d;
}

.mio-note-content {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}




/* ======================================================
   =============  MIO DASHBOARD CSS  ====================
   ======================================================
 */


.mio-dashboard {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.mio-card {
    background: #ffffff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    flex: 1;
    min-width: 200px;
    text-align: center;
}

.mio-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #1D570B;
}

.mio-card p {
    font-size: 28px;
    font-weight: bold;
    margin: 0;
}



/*
 ============================================================
 ============== GRAFICO DASHBOARD OVERVIEW ==================
 ============================================================
*/

.mio-chart-wrapper {
    max-width: 600px;   /* scegli tu la dimensione */
    margin: 40px auto;  /* centrato */
}

.mio-chart-wrapper canvas {
    width: 100% !important;
    height: 570px !important;
}


/*
 ============================================================
 ============ GRAFICO AVANZAMENTI X TRATTATIVA ==============
 ============================================================
*/

#mio_dashboard_avanzamenti_trattativa_wrapper {
f    width: 100%;
    max-width: 900px;
    height: 400px;
    margin: 40px auto;
}

#mio_dashboard_avanzamenti_trattativa_wrapper h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #1f2d3d;
    font-weight: 600;
}



/*
 ============================================================
 ================== GRAFICO TRATTATIVE PER STATO ============
 ============================================================
*/

#mio-grafico-trattative-stato-owner {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    height: 550px;   
}

#mio-grafico-trattative-stato-owner canvas {
    max-width: 100%;
}

#mio-grafico-trattative-stato-owner h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #1f2d3d;
    font-weight: 600;
}

/*
 ============================================================
 ============ CSS GRAFICO TRATTATIVE PER OWNER =============
 ============================================================
*/

#mio-grafico-trattative-owner {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    height: 550px;   
}

#mio-grafico-trattative-owner canvas {
    max-width: 100%;
}

#mio-grafico-trattative-owner h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #1f2d3d;
    font-weight: 600;
}


/*
 ============================================================
 ============ CSS GRAFICO ANDAMENTO MENSILE =================
 ============================================================
*/

#mio-grafico-andamento-mensile {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    margin-top: 40px;
}

#mio-grafico-andamento-mensile h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #1f2d3d;
    font-weight: 600;
}

/*
 ============================================================
 ===== CSS GRAFICO ATTIVE VS ARCHIVIATE MENSILE =============
 ============================================================
*/

#mio-grafico-attive-archiviate-mensile {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    margin-top: 40px;
}

#mio-grafico-attive-archiviate-mensile h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #1f2d3d;
    font-weight: 600;
}


/* ============================================================
   ================== FILTRO GENERALE =========================
   ============================================================ */

.mio-filter-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 25px;
}

.mio-filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.mio-filter-group select {
    width: 150px;
    padding: 6px 10px;
    font-size: 14px;
}

.mio-filter-group input {
    width: 180px;
    padding: 6px 10px;
    font-size: 14px;
}

.mio-btn-small {
    padding: 6px 14px;
    font-size: 14px;
    background: #1f2d3d;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.mio-btn-small:hover {
    background: #2f4157;
}

.mio-btn-reset {
    font-size: 14px;
    color: #777;
    text-decoration: none;
}

.mio-btn-reset:hover {
    text-decoration: underline;
}
