/* ============================================================
   🌐 WRAPPER GLOBAL
   ============================================================ */

.charges-repart {
  margin-top: 16px;
  width: 100%;
}

/* ============================================================
   🧱 TABLE
   ============================================================ */

.charges-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  font-size: 0.8rem;
}

/* ============================================================
   🏷️ EN-TÊTE DU TABLEAU
   ============================================================ */



/* Largeurs intelligentes */
.charges-table th:nth-child(1) { width: 38%; }
.charges-table th:nth-child(2) { width: 12%; text-align: right; }
.charges-table th:nth-child(3) { width: 50%; }

/* ============================================================
   📄 LIGNES
   ============================================================ */

.charges-table tbody tr {
  transition: background 0.2s ease;
}

.charges-table tbody tr:hover {
  background: var(--hover, #f9fafb);
}

/* Séparateurs entre lignes */
.charges-table tbody tr + tr td {
  border-top: 1px solid var(--border, #e5e5e5);
}

/* ============================================================
   📌 COLONNES
   ============================================================ */

.repart-charge {
  padding: 14px 18px;
  vertical-align: top;
}

.repart-total {
  padding: 14px 18px;
  text-align: right;
  font-weight: 600;
  color: var(--accent, #2563eb);
  white-space: nowrap;
}

.repart-detail {
  padding: 12px 18px;
}

/* ============================================================
   🧾 CONTENU : TITRE + METADATA
   ============================================================ */


.charge-meta {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Icônes inline */
.charge-meta .meta-icon {
  width: 15px;
  height: 15px;
  opacity: 0.7;
}

/* ============================================================
   📊 LISTE DES RÉPARTITIONS
   ============================================================ */

.repart-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.repart-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--text, #333);
  padding: 4px 0;
}

/* Séparateur "•" */
.repart-sep {
  color: var(--muted, #aaa);
}

/* Pourcentage */
.repart-part {
  background: var(--accent, #2563eb);
  color: white;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
}

/* Montant */
.repart-montant {
  font-weight: 600;
  color: var(--text);
}

/* ============================================================
   🔧 ÉTAT "VIDE"
   ============================================================ */

#repartMoisEmpty {
  padding: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--muted, #777);
}

/* Masquer tableau si aucune donnée */
.hidden {
  display: none !important;
}

/* ============================================================
   📱 Responsive Mobile
   ============================================================ */

@media (max-width: 720px) {
  .charges-table thead {
    display: none;
  }

  .charges-table tbody tr {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
  }

  .repart-charge,
  .repart-total,
  .repart-detail {
    display: block;
    padding: 6px 0;
  }

  .repart-total {
    margin-top: 8px;
    font-size: 15px;
  }

  .repart-detail {
    margin-top: 10px;
  }

  .repart-list .repart-line {
    padding: 6px 0;
  }
}


/* ============================================================
   🧾 TABLEAU RÉPARTITION — STYLE ERP ÉPURÉ
   ============================================================ */

.charges-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: var(--text, #333);
}

/* ----------- Titles (thead) ----------- */


/* ----------- Rows ----------- */
.charges-table tbody tr {
  border-bottom: 1px solid var(--border-light, #ececec);
}

.repart-charge {
  padding: 10px 8px;
  vertical-align: top;
  width: 240px;
}

.charge-meta {
  font-size: 12px;
  color: var(--muted, #666);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ----------- Total column ----------- */
.repart-total {
  padding: 10px 8px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  vertical-align: top;
}

/* ============================================================
   🎯 RÉPARTITION PAR ARTISTE – ALIGNEMENT PRO STYLE
   ============================================================ */

.repart-detail {
  padding: 10px 4px;
  vertical-align: top;
}

.repart-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}

/* Ligne artiste = grille 3 colonnes :
   Nom | % | Montant
*/
.repart-line {
  display: grid;
  grid-template-columns: 1fr 40px 80px;
  align-items: center;
  font-size: 13px;
  padding: 2px 0;
}


/* Pourcentage = centré */
.repart-part {
  text-align: center;
}

/* Montant = aligné à droite */
.repart-montant {
  text-align: right;
  font-weight: 600;
  color: var(--text);
}

/* Séparateur "•" retiré → plus propre */
.repart-sep {
  display: none;
}

.charges-table th:nth-child(1) {
  width: 60%;   /* Charge */
}

.charges-table th:nth-child(2) {
  width: 15%;   /* Total */
}

.charges-table th:nth-child(3) {
  width: 25%;   /* Répartition par artiste */
}



/* ============================
   🧮 KPI GRID
   ============================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

/* ============================
   📦 KPI CARD
   ============================ */
.kpi-card {
  background: var(--panel, #fff);
  padding: 16px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow-soft, 0 2px 6px rgba(0,0,0,0.08));
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  transition: 0.15s ease;
}

.kpi-card:hover {
  box-shadow: var(--shadow-soft, 0 4px 12px rgba(0,0,0,0.12));
}

/* ============================
   🖼️ Icons
   ============================ */
.kpi-icon .lucide {
  width: 24px;
  height: 24px;
  color: var(--accent, #4f46e5);
  stroke-width: 1.7;
}

/* ============================
   🏷️ Label
   ============================ */
.kpi-label {
  font-size: 0.85rem;
  color: var(--muted, #777);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================
   💶 Value
   ============================ */
.kpi-value {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text, #111);
  margin-top: 2px;
}



/* ============================================================
   🧾 FORMULAIRE UNIQUE — GESTION DES CHARGES COMMUNES
   Style ERP clean / cohérent avec les autres formulaires HD
   ============================================================ */

/* Wrapper général */
.form-inline-charge {
  background: var(--panel, #fff);
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgb(0 0 0 / 6%);
  border: 1px solid var(--border, #e5e7eb);
  margin-bottom: 20px;
}

/* Container lignes */
.form-inline-charge .ligne-champs {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* Champ générique */
.form-inline-charge .champ-flex {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Labels */
.form-inline-charge label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  display: flex;
  gap: 6px;
  align-items: center;
}

.form-inline-charge label .icon-inline {
  width: 15px;
  height: 15px;
  color: var(--text-muted, #6b7280);
}

/* Inputs / Select */
.form-inline-charge input,
.form-inline-charge select {
  width: 100%;
  padding: 9px 10px;
  font-size: 0.9rem;

  background: var(--bg, #f9fafb);
  border: 1px solid var(--border, #d1d5db);
  border-radius: 8px;

  transition: border-color 0.18s ease, background 0.18s ease;
}

.form-inline-charge input:focus,
.form-inline-charge select:focus {
  outline: none;
  border-color: var(--accent, #2563eb);
  background: #fff;
}

/* Bouton Ajouter */
.form-inline-charge button.btn-small {
  padding: 8px 14px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-inline-charge button .icon-inline {
  width: 15px;
  height: 15px;
}

/* ----- Responsive ----- */
@media (max-width: 720px) {
  .form-inline-charge {
    padding: 14px;
  }
  .form-inline-charge .ligne-champs {
    gap: 12px;
  }
}




.meta-charge {
    color: var(--muted);
    font-size: 0.8rem;
    display: grid;
    grid-template-columns: 80px 20px 1fr;
    gap: 6px;
    
}
.meta-charge .lucide {
    height: 16px;
    width: 16px;
}









.rowChargeEdit {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 10px;
    align-items: end;
    /* border: 1px solid var(--border); */
    padding: 16px;
    border-radius: var(--radius);
    background: var(--accent-200);
}


.rowChargeMensPonct,
.rowChargeProjet {
  display: grid !important;
  grid-template-columns: 1fr 30% 80px;
}

.montantCharge {
  color: var(--accent);
  font-size: 1rem;
}

/* Header de bloc + total */
.charges-block-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 6px;
}

.charges-total{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 999px;
    background: var(--accent-200);
    color: var(--accent);
    font-size: 1rem;
    letter-spacing: .2px;
    white-space: nowrap;
}

/* Responsive : total sous le titre si pas de place */
@media (max-width: 520px){
  .charges-block-header{
    flex-direction: column;
    align-items: flex-start;
  }
}


/* ============================================================
   ✅ Dot accent au début de chaque charge (mensuelles/ponctuelles)
   Cible : #chargesMensuellesList + #chargesPonctuellesList
   ============================================================ */

#chargesMensuellesList > li.card-item,
#chargesPonctuellesList > li.card-item {
  position: relative;
  padding-left: 8px; /* espace pour la dot */
}

#chargesMensuellesList > li.card-item::before,
#chargesPonctuellesList > li.card-item::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 16px; /* ajuste si besoin selon ta hauteur de ligne */
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent); /* accent thème */
}

/* Option : ne pas afficher la dot sur la ligne "ajout inline" */
#chargesMensuellesList > li.card-item:has(form.rowHome-add)::before,
#chargesPonctuellesList > li.card-item:has(form.rowHome-add)::before,
#chargesMensuellesList > li.card-item:has(form.rowChargeEdit)::before,
#chargesPonctuellesList > li.card-item:has(form.rowChargeEdit)::before {
  display: none;
}


.cell-amt{
  display:inline-flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  white-space:nowrap;
}

.wbadge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:2px 6px;
  border-radius:999px;
  font-size:11px;
  line-height:1;
  border:1px solid rgba(255,255,255,0.14);
  background:rgba(255,255,255,0.07);
  opacity:.9;
}

.wbadge.w0{ opacity:.5; text-decoration:line-through; }
.wbadge.w1{ opacity:.70; }
.wbadge.w2{ opacity:.85; }
.wbadge.w3{ opacity:1.0; font-weight:600; }
.wbadge.w4{ opacity:1.0; font-weight:800; }



#repartMatrixTable{
  width: 100%;
  table-layout: fixed;
  
    font-size: 0.8rem;
}


/* 1ère colonne (Charge) : prend le reste */
#repartMatrixTable th:first-child,
#repartMatrixTable td:first-child{
  width: 300px;        /* ✅ colonne "Charge" fixe */
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* Dernière colonne (Total) : fixe */
#repartMatrixTable th:last-child,
#repartMatrixTable td:last-child{
  width: 140px;
  white-space: nowrap;
  color: var(--accent);

}

/* Colonnes artistes : toutes identiques */
#repartMatrixTable th:not(:first-child):not(:last-child),
#repartMatrixTable td:not(:first-child):not(:last-child){
  width: calc((100% - 300px - 140px) / var(--nb-art-cols, 1));
  white-space: nowrap;
  height: 2.5rem;
}
#repartMatrixTable .montantCharge{
  font-size: 0.8rem !important;
  font-weight: 600;
}


.charge-title {
  font-size: 0.9rem ;
  position: relative;
  padding-left: 20px;
}


.charge-title span::before {
    content: "";
    position: absolute;
    left: 0px;
    top: 9px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--accent);
}