.wrap-invoice {
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid #DEDEDE;
}
.wrap-invoice .label-detail {
  width: calc(100% - 250px);
  display: block;
}
.wrap-invoice .label-detail h4{
  margin-top: 0;
}
.wrap-invoice .num {
  width: 250px;
  text-align: right;
  font-size: 20px;
  font-weight: bold;
}
.wrap-invoice:first-of-type{
  border-top: 1px solid #DEDEDE;
}
.wrap-invoice h4{
  font-weight: bold;
}
.cpmd-total-global {
  width: 100%;
  font-weight: bold;
  font-size: 20px;
  padding: 15px 0;
  display: flex;
  justify-content: flex-end;
}

.cpmd-subline-toggle {
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s;
}
.cpmd-subline-toggle:hover {
  opacity: 0.7;
}
.cpmd-subline-toggle::after {
  content: ' ▼';
  font-size: 0.8em;
  opacity: 0.6;
}
.cpmd-subline-toggle.active::after {
  content: ' ▲';
}

.cpmd-prestas-detail {
  margin-left: 20px;
  margin-top: 10px;
  margin-bottom: 20px;
  border-left: 3px solid #2271b1;
  padding-left: 15px;
}
.cpmd-prestas-detail h5 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
}
.cpmd-prestas-detail table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.cpmd-prestas-detail thead tr {
  border-bottom: 1px solid #ddd;
}
.cpmd-prestas-detail th {
  text-align: left;
  padding: 8px 5px;
  font-weight: 600;
}
.cpmd-prestas-detail th:nth-child(3),
.cpmd-prestas-detail th:nth-child(4),
.cpmd-prestas-detail th:nth-child(5),
.cpmd-prestas-detail td:nth-child(3),
.cpmd-prestas-detail td:nth-child(4),
.cpmd-prestas-detail td:nth-child(5) {
  text-align: right;
}
.cpmd-prestas-detail th:last-child,
.cpmd-prestas-detail td:last-child {
  text-align: left;
}
.cpmd-prestas-detail tbody tr {
  border-bottom: 1px solid #f0f0f0;
}
.cpmd-prestas-detail tbody tr:hover {
  background-color: #f9f9f9;
}
.cpmd-prestas-detail td {
  padding: 6px 5px;
}
.cpmd-prestas-detail td a {
  color: #2271b1;
  text-decoration: none;
  transition: color 0.2s;
}
.cpmd-prestas-detail td a:hover {
  color: #135e96;
  text-decoration: underline;
}
.cpmd-price-editable {
  position: relative;
}
.cpmd-price-editable:hover {
  background-color: #f0f0f0;
}
.cpmd-price-input {
  border: 1px solid #2271b1;
  padding: 2px 4px;
  font-size: inherit;
}

@media (max-width:767px){
  .wrap-invoice .label-detail {
    width: calc(100% - 200px);
  }
  .wrap-invoice .num {
    width: 200px;
  }
  .cpmd-prestas-detail {
    margin-left: 10px;
    padding-left: 10px;
  }
  .cpmd-prestas-detail table {
    font-size: 12px;
  }
  .cpmd-prestas-detail th,
  .cpmd-prestas-detail td {
    padding: 4px 3px;
  }
}

/* Dashboard Styles */
.cpmd-stats-dashboard {
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100vh;
}

.cpmd-dashboard-title {
  font-size: 28px;
  font-weight: 600;
  color: #1f2937 !important;
  margin: 0 0 30px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.cpmd-dashboard-total {
  font-size: 24px;
  font-weight: 700;
  color: #ec4899;
  background: linear-gradient(135deg, #fef3f2 0%, #fff 100%);
  padding: 12px 24px;
  border-radius: 12px;
  border: 2px solid #ec4899;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.15);
}

/* KPI Row */
.cpmd-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.cpmd-kpi-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cpmd-kpi-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cpmd-kpi-content {
  flex: 1;
}

.cpmd-kpi-label {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 8px;
  font-weight: 500;
}

.cpmd-kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
}

.cpmd-kpi-value.positive {
  color: #22c55e;
}

.cpmd-kpi-value.negative {
  color: #ef4444;
}

/* Charts Row */
.cpmd-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.cpmd-chart-card,
.cpmd-table-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cpmd-table-card-mobile-title {
  display: none;
}

/* Bar Chart */
.cpmd-bar-chart {
  display: flex;
  align-items: flex-end;
  height: 260px;
  gap: 40px;
  padding-left: 60px;
  position: relative;
}

.cpmd-chart-y-axis {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 50px;
  font-size: 12px;
  color: #6b7280;
}

.cpmd-y-label {
  text-align: right;
  padding-right: 8px;
}

.cpmd-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 40px;
  flex: 1;
  height: 100%;
}

.cpmd-bar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
}

.cpmd-bar {
  width: 100%;
  max-width: 60px;
  border-radius: 4px 4px 0 0;
  transition: opacity 0.2s;
  cursor: pointer;
  min-height: 4px;
}

.cpmd-bar:hover {
  opacity: 0.8;
}

.cpmd-bar-label {
  margin-top: 8px;
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

/* Prestation Table - Same styles as cpmd-assurance-table-minimal */
.cpmd-prestation-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  margin-bottom: 24px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.cpmd-prestation-table thead {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 2px solid #e2e8f0;
}

.cpmd-prestation-table thead th {
  padding: 16px 20px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: #FFFFFF !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: #111827;
  border: none;
}

.cpmd-prestation-table thead th:first-child {
  padding-left: 20px;
}

.cpmd-prestation-table thead th:not(:first-child) {
  text-align: right;
}

.cpmd-prestation-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: all 0.2s ease;
  background: #fff;
}

.cpmd-prestation-table tbody tr:hover {
  background: linear-gradient(90deg, #fef3f2 0%, #fff 100%);
  transform: translateX(2px);
  box-shadow: -2px 0 0 0 #ec4899;
}

.cpmd-prestation-table tbody tr:last-child {
  border-bottom: none;
}

.cpmd-prestation-table td {
  padding: 18px 20px;
  font-size: 14px;
  color: #1e293b;
  vertical-align: middle;
  border: none;
  font-weight: 500;
}

.cpmd-prestation-table td:not(:first-child) {
  text-align: right;
}

.cpmd-diff {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
}

.cpmd-diff.positive {
  background-color: #22c55e;
  color: #ffffff;
}

.cpmd-diff.negative {
  background-color: #ef4444;
  color: #ffffff;
}

/* Prestation Toggle */
.cpmd-prestation-toggle-row {
  border-top: 2px solid #e5e7eb;
}

.cpmd-prestation-toggle-cell {
  padding: 0 !important;
  text-align: center !important;
}

.cpmd-prestation-toggle {
  width: 100%;
  padding: 16px 20px;
  background: transparent ! important;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280 ! important;
  transition: all 0.2s ease;
}

.cpmd-prestation-toggle:hover {
  background: linear-gradient(90deg, #fef3f2 0%, #fff 100%);
  color: #ec4899;
}

.cpmd-prestation-toggle-text {
  user-select: none;
}

.cpmd-prestation-toggle-arrow {
  font-size: 12px;
  transition: transform 0.2s ease;
  user-select: none;
}

.cpmd-prestation-other tr {
  border-bottom: 1px solid #f1f5f9;
  transition: all 0.2s ease;
  background: #fff;
}

.cpmd-prestation-other tr:hover {
  background: linear-gradient(90deg, #fef3f2 0%, #fff 100%);
  transform: translateX(2px);
  box-shadow: -2px 0 0 0 #ec4899;
}

/* Responsive */
@media (max-width: 1024px) {
  .cpmd-charts-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .cpmd-table-card-mobile-title {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 33px 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
    
  }
  .cpmd-prestation-table tbody tr:hover,
  table tbody>tr:nth-child(odd)>td, table tbody>tr:nth-child(odd)>th,
  .cpmd-table-card {
    padding: 0 ! important;
    box-shadow: none ! important;
    background-color: transparent ! important;
}
.cpmd-prestation-toggle:hover {
  background: transparent ! important;
  color: #ec4899;
}
  .cpmd-kpi-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .cpmd-kpi-card {
    padding: 20px;
  }

  .cpmd-bar-chart {
    padding-left: 50px;
    gap: 20px;
  }

  .cpmd-chart-y-axis {
    width: 40px;
    font-size: 11px;
  }

  .cpmd-chart-bars {
    gap: 20px;
  }

  .cpmd-bar {
    max-width: 40px;
  }

  .cpmd-prestation-table {
    font-size: 12px;
    display: block;
    box-shadow: none;
  }

  .cpmd-prestation-table thead {
    display: none;
  }

  .cpmd-prestation-table tbody {
    display: block;
    border-block-start: 0;
  }

  .cpmd-prestation-table tbody.cpmd-prestation-main tr {
    display: flex;
    align-items: baseline;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    gap: 0;
    flex-wrap: wrap;
  }

  .cpmd-prestation-table tbody.cpmd-prestation-main tr:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .cpmd-prestation-table tbody.cpmd-prestation-main td {
    display: inline-flex;
    align-items: baseline;
    padding: 0;
    text-align: left !important;
    border: none;
    line-height: 1.5;
    background-color: transparent ! important;
  }

  .cpmd-prestation-table tbody.cpmd-prestation-main td:first-child {
    font-weight: 700;
    font-size: 14px;
    color: #111827;
    min-width: 125px;
    flex: 0 0 auto;
    margin-right: 8px;
  }

  .cpmd-prestation-table tbody.cpmd-prestation-main td:not(:first-child) {
    font-size: 14px;
    color: #1e293b;
    flex: 0 0 50px;
    width: 50px;
    white-space: nowrap;
    text-align: center;
  }

  .cpmd-prestation-table tbody.cpmd-prestation-main td:nth-child(2),
  .cpmd-prestation-table tbody.cpmd-prestation-main td:nth-child(3),
  .cpmd-prestation-table tbody.cpmd-prestation-main td:nth-child(4) {
    margin: 0 4px;
  }

  .cpmd-prestation-table tbody.cpmd-prestation-main td:before {
    display: none;
  }

  .cpmd-prestation-table tbody.cpmd-prestation-main .cpmd-diff {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 3px;
    vertical-align: super;
    font-size: 9px;
    line-height: 1;
    position: relative;
    top: -0.5em;
    min-width: 18px;
    height: 14px;
    padding: 0 3px;
  }

  /* Autres tbody (other prestations) - même style en ligne */
  .cpmd-prestation-table tbody.cpmd-prestation-other tr {
    display: flex;
    align-items: baseline;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    gap: 0;
    flex-wrap: wrap;
  }

  .cpmd-prestation-table tbody.cpmd-prestation-other tr:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .cpmd-prestation-table tbody.cpmd-prestation-other td {
    display: inline-flex;
    align-items: baseline;
    padding: 0;
    text-align: left !important;
    border: none;
    line-height: 1.5;
  }

  .cpmd-prestation-table tbody.cpmd-prestation-other td:first-child {
    font-weight: 700;
    font-size: 14px;
    color: #111827;
    flex: 0 0 auto;
    min-width: 125px;
    margin-right: 8px;
  }

  .cpmd-prestation-table tbody.cpmd-prestation-other td:not(:first-child) {
    font-size: 14px;
    color: #1e293b;
    flex: 0 0 50px;
    width: 50px;
    white-space: nowrap;
    text-align: center;
  }

  .cpmd-prestation-table tbody.cpmd-prestation-other td:nth-child(2),
  .cpmd-prestation-table tbody.cpmd-prestation-other td:nth-child(3),
  .cpmd-prestation-table tbody.cpmd-prestation-other td:nth-child(4) {
    margin: 0 4px;
  }

  .cpmd-prestation-table tbody.cpmd-prestation-other td:before {
    display: none;
  }

  .cpmd-prestation-table tbody.cpmd-prestation-other .cpmd-diff {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 3px;
    vertical-align: super;
    font-size: 9px;
    line-height: 1;
    position: relative;
    top: -0.5em;
    min-width: 18px;
    height: 14px;
    padding: 0 3px;
  }

  .cpmd-prestation-toggle-row {
    border-top: none !important;
  }

  .cpmd-prestation-toggle-cell {
    padding: 12px 0 !important;
  }

  .cpmd-prestation-toggle {
    width: 100%;
    padding: 12px 16px;
  }
}