/* === DOCUMENT MANAGER FIBEM - STYLES CSS AMÉLIORÉS === */
/* Version: 3.2 - Styles professionnels avec entête et pied de page */

:root {
  /* Palette de couleurs professionnelle */
  --primary-color: #2c3e50;
  --primary-dark: #1f2b33;
  --secondary-color: #34495e;
  --accent-color: #e74c3c;
  --success-color: #27ae60;
  --warning-color: #f39c12;
  --info-color: #3498db;
  --light-color: #ecf0f1;
  --dark-color: #2c3e50;
  --border-color: #bdc3c7;
  --text-color: #2c3e50;
  --text-light: #7f8c8d;
  --shadow: 0 2px 4px rgba(0,0,0,0.1);
  
  /* Couleurs spécifiques SEN FIBEM */
  --fibem-blue: #0056b3;
  --fibem-dark-blue: #003f7f;
  --fibem-light-blue: #f1f5ff;
}

/* === STYLES INTERFACE UTILISATEUR === */

.dmpf-root {
    max-width: 1200px;
    margin: 18px auto;
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* === SYSTÈME D'ONGLETS AMÉLIORÉ === */
.dmpf-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
    flex-wrap: wrap;
    background: linear-gradient(135deg, var(--fibem-blue), var(--fibem-dark-blue));
    padding: 15px 15px 0;
    border-radius: 12px 12px 0 0;
}

.dmpf-tab {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    font-weight: 600;
    color: var(--text-color);
    position: relative;
    overflow: hidden;
}

.dmpf-tab:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.dmpf-tab.active {
    background: #ffffff;
    color: var(--fibem-blue);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.dmpf-tab.active::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--fibem-blue);
}

/* === PANELS AMÉLIORÉS === */
.dmpf-panel {
    display: none;
    padding: 25px;
    background: #ffffff;
    border-radius: 0 0 12px 12px;
    min-height: 500px;
}

.dmpf-panel.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === FORMULAIRES AMÉLIORÉS === */
.dmpf-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
}

.dmpf-row input,
.dmpf-row textarea,
.dmpf-row select {
    flex: 1;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #ffffff;
}

.dmpf-row input:focus,
.dmpf-row textarea:focus,
.dmpf-row select:focus {
    outline: none;
    border-color: var(--fibem-blue);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
    background: #fafbff;
}

.dmpf-row textarea {
    min-height: 80px;
    resize: vertical;
    line-height: 1.5;
}

/* === BOUTONS AMÉLIORÉS === */
.dmpf-submit {
    background: linear-gradient(135deg, var(--fibem-blue), var(--fibem-dark-blue));
    color: #ffffff;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0, 86, 179, 0.2);
    position: relative;
    overflow: hidden;
}

.dmpf-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 86, 179, 0.3);
}

.dmpf-submit:active {
    transform: translateY(0);
}

.dmpf-smallbtn {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    transition: all 0.2s ease;
    color: var(--text-color);
}

.dmpf-smallbtn:hover {
    background: #f8f9fa;
    border-color: var(--fibem-blue);
    color: var(--fibem-blue);
    transform: translateY(-1px);
}

/* === TABLEAUX AMÉLIORÉS === */
table.dmpf-list {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 14px;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

table.dmpf-list th,
table.dmpf-list td {
    border: 1px solid #e5e7eb;
    padding: 12px;
    text-align: left;
}

table.dmpf-list th {
    background: linear-gradient(135deg, var(--fibem-blue), var(--fibem-dark-blue));
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

table.dmpf-list tr:nth-child(even) {
    background: #f8f9fa;
}

table.dmpf-list tr:hover {
    background: #e8f4fd;
}

.dmpf-table-details {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 13px;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dmpf-table-details th {
    background: linear-gradient(135deg, var(--fibem-blue), var(--fibem-dark-blue));
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.dmpf-table-details td {
    padding: 10px 8px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
}

.dmpf-table-details input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.dmpf-table-details input:focus {
    outline: none;
    border-color: var(--fibem-blue);
    box-shadow: 0 0 0 2px rgba(0, 86, 179, 0.1);
}

/* === ÉLÉMENTS D'INTERFACE AMÉLIORÉS === */
.dmpf-search {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
}

label.dmpf-filelabel {
    min-width: 180px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

.dmpf-add-row {
    background: linear-gradient(135deg, var(--success-color), #219653);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin: 8px 0;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dmpf-add-row:hover {
    background: linear-gradient(135deg, #219653, #1e8449);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
}

.dmpf-remove-row {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dmpf-remove-row:hover {
    background: linear-gradient(135deg, #c82333, #a71e2a);
    transform: scale(1.05);
}

/* === SECTIONS AMÉLIORÉES === */
.dmpf-section {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 10px;
    border-left: 4px solid var(--fibem-blue);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.dmpf-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--fibem-blue), transparent);
}

.dmpf-section h4 {
    color: var(--fibem-blue);
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dmpf-half {
    width: 48%;
    display: inline-block;
    vertical-align: top;
}

.dmpf-left {
    float: left;
}

.dmpf-right {
    float: right;
}

/* === SIGNATURES AMÉLIORÉES === */
.dmpf-signature-container {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #d1d5db;
}

.dmpf-signature-pad {
    width: 100%;
    height: 200px;
    border: 2px dashed #9ca3af;
    border-radius: 8px;
    background: #ffffff;
    cursor: crosshair;
    transition: all 0.3s ease;
}

.dmpf-signature-pad:hover {
    border-color: var(--fibem-blue);
    background: #fafbff;
}

.dmpf-signature-actions {
    margin-top: 15px;
    display: flex;
    gap: 12px;
}

.dmpf-signature-clear {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.dmpf-signature-clear:hover {
    background: linear-gradient(135deg, #c82333, #a71e2a);
    transform: translateY(-2px);
}

.dmpf-signature-save {
    background: linear-gradient(135deg, var(--success-color), #219653);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.dmpf-signature-save:hover {
    background: linear-gradient(135deg, #219653, #1e8449);
    transform: translateY(-2px);
}

/* === TAMPONS AMÉLIORÉS - TAILLES RÉDUITES === */
.dmpf-tampon-upload {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #d1d5db;
}

/* TAILLES RÉDUITES POUR TOUTES LES IMAGES */
.dmpf-tampon-preview {
    max-width: 50px;  /* Réduit de 200px */
    max-height: 60px;  /* Réduit de 100px */
    margin-top: 10px;
    border: 2px solid #e5e7eb;
    padding: 6px;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dmpf-signature-preview {
    max-width: 50px;  /* Réduit de 300px */
    max-height: 90px;  /* Réduit de 150px */
    margin-top: 10px;
    border: 2px solid #e5e7eb;
    padding: 6px;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dmpf-cv-photo-preview {
    max-width: 50px;   /* Réduit de 300px */
    max-height: 50px;  /* Réduit de 150px */
    margin-top: 10px;
    border: 2px solid #e5e7eb;
    padding: 4px;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

/* Logo entreprise réduit */
.dmpf-logo-preview {
    max-width: 50px;  /* Taille réduite pour le logo */
    max-height: 50px;
    margin-top: 10px;
    border: 2px solid #e5e7eb;
    padding: 4px;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* === FILTRES AMÉLIORÉS === */
.dmpf-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.dmpf-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dmpf-filter-label {
    font-weight: 600;
    min-width: 100px;
    font-size: 14px;
    color: var(--text-color);
}

/* === BADGES AMÉLIORÉS === */
.dmpf-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dmpf-badge-facture {
    background: linear-gradient(135deg, #007cba, #005a87);
    color: white;
}

.dmpf-badge-devis {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
}

.dmpf-badge-avoir {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #000000;
}

.dmpf-badge-feuille {
    background: linear-gradient(135deg, #6f42c1, #59359a);
    color: white;
}

.dmpf-badge-cv {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

/* === MESSAGES D'ALERTE AMÉLIORÉS === */
.dmpf-notice-success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    padding: 16px 20px;
    border-radius: 8px;
    border: 1px solid #c3e6cb;
    margin-bottom: 20px;
    border-left: 4px solid var(--success-color);
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.2);
}

.dmpf-notice-error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    padding: 16px 20px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    margin-bottom: 20px;
    border-left: 4px solid #dc3545;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

/* === TITRES AMÉLIORÉS === */
.dmpf-panel h3 {
    color: var(--fibem-blue);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid #f0f0f0;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dmpf-panel h4 {
    color: var(--text-color);
    margin: 15px 0;
    font-size: 16px;
    font-weight: 600;
}

/* === STYLES PDF PROFESSIONNELS === */

.dmpf-pdf-container {
  font-family: 'Helvetica', 'Arial', sans-serif;
  color: var(--text-color);
  line-height: 1.4;
  font-size: 10px;
  max-width: 210mm;
  margin: 0 auto;
  padding: 15mm;
  position: relative;
  background: #ffffff;
}

/* EN-TÊTE PROFESSIONNEL SEN FIBEM */
.dmpf-pdf-header {
  border-bottom: 4px solid var(--fibem-blue);
  padding-bottom: 12px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 25px;
}

.dmpf-pdf-header-main {
  flex: 1;
}

.dmpf-pdf-company-info {
  margin-bottom: 10px;
}

.dmpf-pdf-company-name {
  font-size: 18px;
  font-weight: bold;
  color: var(--fibem-blue);
  margin: 0 0 5px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dmpf-pdf-company-details {
  font-size: 9px;
  color: var(--text-light);
  line-height: 1.4;
  margin: 0;
}

.dmpf-pdf-company-details strong {
  color: var(--text-color);
}

.dmpf-pdf-document-title-section {
  text-align: right;
  border: 2px solid var(--fibem-blue);
  padding: 10px 12px;
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
  border-radius: 6px;
  min-width: 200px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dmpf-pdf-document-title {
  font-size: 14px;
  font-weight: bold;
  color: var(--fibem-blue);
  margin: 0 0 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dmpf-pdf-document-ref {
  font-size: 11px;
  color: var(--text-light);
  margin: 0 0 4px 0;
  font-weight: 600;
}

.dmpf-pdf-document-date {
  font-size: 10px;
  color: var(--text-color);
  margin: 0;
  font-weight: bold;
}

/* Tableau d'informations client professionnel */
.dmpf-pdf-client-info-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 9px;
  border: 2px solid var(--fibem-blue);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dmpf-pdf-client-info-table th {
  background: linear-gradient(135deg, var(--fibem-blue), var(--fibem-dark-blue));
  color: white;
  padding: 8px 10px;
  text-align: left;
  font-weight: bold;
  text-transform: uppercase;
  border: 1px solid var(--fibem-dark-blue);
  font-size: 8px;
  width: 25%;
}

.dmpf-pdf-client-info-table td {
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  vertical-align: top;
  width: 75%;
  background: #ffffff;
}

/* Mode de règlement professionnel */
.dmpf-pdf-payment-mode {
  margin: 12px 0;
  padding: 10px;
  background: linear-gradient(135deg, #e8f4fd, #ffffff);
  border: 2px solid var(--info-color);
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

.dmpf-pdf-payment-title {
  font-size: 10px;
  font-weight: bold;
  color: var(--info-color);
  margin: 0 0 5px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dmpf-pdf-payment-value {
  font-size: 11px;
  color: var(--text-color);
  margin: 0;
  font-weight: bold;
}

/* Références et commande professionnelles */
.dmpf-pdf-references {
  margin: 12px 0;
  padding: 10px;
  background: linear-gradient(135deg, #e8f4fd, #ffffff);
  border-radius: 6px;
  border-left: 4px solid var(--info-color);
  font-size: 9px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dmpf-pdf-reference-item {
  margin: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dmpf-pdf-reference-label {
  font-weight: bold;
  color: var(--text-color);
  min-width: 80px;
}

.dmpf-pdf-reference-value {
  color: var(--text-light);
  flex: 1;
}

/* Tableau principal des prestations professionnel */
.dmpf-pdf-main-table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
  font-size: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 2px solid var(--fibem-blue);
  border-radius: 6px;
  overflow: hidden;
}

.dmpf-pdf-main-table th {
  background: linear-gradient(135deg, var(--fibem-blue), var(--fibem-dark-blue));
  color: white;
  padding: 10px 6px;
  text-align: center;
  font-weight: bold;
  text-transform: uppercase;
  border: 1px solid var(--fibem-dark-blue);
  font-size: 7px;
  letter-spacing: 0.5px;
}

.dmpf-pdf-main-table td {
  padding: 8px 6px;
  border: 1px solid #e5e7eb;
  vertical-align: top;
  background-color: #ffffff;
}

.dmpf-pdf-main-table tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

.dmpf-pdf-main-table tbody tr:hover {
  background-color: #e8f4fd;
}

/* Styles spécifiques pour les colonnes */
.dmpf-pdf-col-reference {
  text-align: center;
  width: 12%;
  font-weight: bold;
  background: #f8f9fa;
}

.dmpf-pdf-col-designation {
  width: 40%;
  text-align: left;
  line-height: 1.4;
}

.dmpf-pdf-col-hours {
  text-align: center;
  width: 10%;
  background: #f8f9fa;
}

.dmpf-pdf-col-unitprice {
  text-align: right;
  width: 12%;
  font-family: 'Courier New', monospace;
}

.dmpf-pdf-col-discount {
  text-align: center;
  width: 10%;
  background: #f8f9fa;
}

.dmpf-pdf-col-discount-amount {
  text-align: right;
  width: 12%;
  font-family: 'Courier New', monospace;
}

.dmpf-pdf-col-amount {
  text-align: right;
  width: 12%;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  background: #e8f4fd;
}

.dmpf-pdf-col-vat {
  text-align: right;
  width: 12%;
  font-family: 'Courier New', monospace;
}

/* Cellules avec données financières */
.dmpf-pdf-currency-cell {
  font-family: 'Courier New', monospace;
  font-weight: bold;
  color: var(--text-color);
}

.dmpf-pdf-percent-cell {
  font-family: 'Courier New', monospace;
  color: var(--warning-color);
  font-weight: bold;
}

/* Remarques TVA professionnelles */
.dmpf-pdf-vat-notes {
  margin: 15px 0;
  padding: 12px;
  background: linear-gradient(135deg, #fff3cd, #ffffff);
  border-radius: 6px;
  border: 2px solid var(--warning-color);
  font-size: 8px;
  line-height: 1.4;
  box-shadow: 0 2px 4px rgba(243, 156, 18, 0.2);
}

.dmpf-pdf-vat-title {
  font-weight: bold;
  color: var(--warning-color);
  margin: 0 0 6px 0;
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.5px;
}

.dmpf-pdf-vat-rates {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 6px 0;
}

.dmpf-pdf-vat-rate {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: #ffffff;
  border-radius: 3px;
  border: 1px solid #e5e7eb;
}

.dmpf-pdf-vat-number {
  font-weight: bold;
  color: var(--text-color);
  min-width: 12px;
}

.dmpf-pdf-vat-value {
  color: var(--text-light);
  font-size: 7px;
}

.dmpf-pdf-vat-special {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 2px dotted var(--border-color);
  font-style: italic;
  color: var(--text-light);
  text-align: center;
}

/* PIED DE PAGE PROFESSIONNEL SEN FIBEM */
.dmpf-pdf-footer {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 3px solid var(--fibem-blue);
  position: relative;
}

.dmpf-pdf-legal-info {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  padding: 12px 15px;
  border-radius: 6px;
  border: 2px solid var(--border-color);
  margin-bottom: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dmpf-pdf-legal-title {
  font-size: 10px;
  font-weight: bold;
  color: var(--fibem-blue);
  margin: 0 0 6px 0;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.5px;
}

.dmpf-pdf-legal-details {
  font-size: 8px;
  color: var(--text-light);
  text-align: center;
  line-height: 1.3;
  margin: 0;
}

.dmpf-pdf-legal-details strong {
  color: var(--text-color);
}

/* Signatures professionnelles */
.dmpf-pdf-signatures {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid var(--border-color);
}

.dmpf-pdf-signature-box {
  text-align: center;
  padding: 15px;
  position: relative;
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border-radius: 6px;
  border: 2px solid var(--border-color);
}

.dmpf-pdf-signature-label {
  font-weight: bold;
  margin-bottom: 30px;
  font-size: 10px;
  color: var(--text-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dmpf-pdf-signature-line {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
  margin: 0 0 12px 0;
  position: relative;
}

.dmpf-pdf-signature-line::after {
  content: '';
  position: absolute;
  top: -15px;
  left: 0;
  right: 0;
  height: 30px;
  border-bottom: 2px solid var(--border-color);
}

.dmpf-pdf-signature-name {
  font-size: 9px;
  color: var(--text-light);
  margin-top: 8px;
  font-style: italic;
}

.dmpf-pdf-signature-company {
  font-size: 9px;
  color: var(--fibem-blue);
  font-weight: bold;
  margin-top: 4px;
  text-transform: uppercase;
}

/* Informations bancaires professionnelles */
.dmpf-pdf-bank-info {
  margin: 15px 0;
  padding: 12px;
  background: linear-gradient(135deg, #e8f5e8, #ffffff);
  border-radius: 6px;
  border-left: 4px solid var(--success-color);
  font-size: 8px;
  box-shadow: 0 2px 4px rgba(39, 174, 96, 0.2);
}

.dmpf-pdf-bank-title {
  font-weight: bold;
  color: var(--success-color);
  margin: 0 0 6px 0;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.dmpf-pdf-bank-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px;
}

.dmpf-pdf-bank-item {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 3px 0;
}

.dmpf-pdf-bank-label {
  font-weight: bold;
  color: var(--text-color);
  min-width: 60px;
  font-size: 7px;
  text-transform: uppercase;
}

.dmpf-pdf-bank-value {
  color: var(--text-light);
  font-family: 'Courier New', monospace;
  font-size: 8px;
  font-weight: bold;
}

/* Totaux et récapitulatifs professionnels */
.dmpf-pdf-totals-section {
  margin-top: 20px;
  padding: 15px;
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border-radius: 6px;
  border: 2px solid var(--fibem-blue);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dmpf-pdf-totals-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  font-size: 9px;
}

.dmpf-pdf-total-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dotted var(--border-color);
  align-items: center;
}

.dmpf-pdf-total-label {
  font-weight: bold;
  color: var(--text-color);
  text-transform: uppercase;
  font-size: 8px;
  letter-spacing: 0.3px;
}

.dmpf-pdf-total-value {
  font-weight: bold;
  color: var(--fibem-blue);
  font-family: 'Courier New', monospace;
  font-size: 10px;
}

.dmpf-pdf-grand-total {
  background: linear-gradient(135deg, var(--fibem-blue), var(--fibem-dark-blue));
  color: white;
  padding: 12px 16px;
  border-radius: 6px;
  margin-top: 10px;
  font-weight: bold;
  text-align: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Styles pour les nouvelles fonctionnalités JS */

/* Notifications */
.dmpf-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
}

.dmpf-notification-success {
    background: linear-gradient(135deg, #27ae60, #219653);
    border-left: 4px solid #1e8449;
}

.dmpf-notification-error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-left: 4px solid #a93226;
}

.dmpf-notification-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border-left: 4px solid #d35400;
}

.dmpf-notification-info {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-left: 4px solid #1f618d;
}

.dmpf-notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.dmpf-notification-close:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* États de chargement */
.dmpf-loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.dmpf-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Champs invalides */
.dmpf-invalid {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

.dmpf-row-error {
    position: relative;
}

.dmpf-row-error::after {
    content: '⚠️ Champ requis';
    position: absolute;
    top: -8px;
    right: 10px;
    background: #e74c3c;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
}

/* Lignes de produits */
.dmpf-product-row {
    transition: all 0.3s ease;
}

.dmpf-product-row:hover {
    background-color: #f8f9fa;
}

.dmpf-product-row.fade-out {
    opacity: 0;
    transform: translateX(-10px);
}

/* Responsive amélioré */
@media (max-width: 768px) {
    .dmpf-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .dmpf-product-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .dmpf-product-row td {
        border: none !important;
        padding: 5px !important;
    }
    
    .dmpf-product-row td:last-child {
        grid-column: 1 / -1;
        text-align: center;
    }
}

/* Améliorations d'accessibilité */
.dmpf-tab:focus {
    outline: 2px solid #0056b3;
    outline-offset: 2px;
}

.dmpf-submit:focus {
    outline: 2px solid #0056b3;
    outline-offset: 2px;
}

/* Impression */
@media print {
    .dmpf-notification,
    .dmpf-tabs,
    .dmpf-add-row,
    .dmpf-remove-row {
        display: none !important;
    }
    
    .dmpf-panel {
        display: block !important;
        box-shadow: none !important;
    }
}

/* === RESPONSIVE AMÉLIORÉ === */
@media (max-width: 768px) {
  .dmpf-root {
      margin: 10px;
      max-width: none;
      border-radius: 8px;
  }
  
  .dmpf-tabs {
      flex-direction: column;
      padding: 10px 10px 0;
      gap: 2px;
  }
  
  .dmpf-tab {
      border-radius: 6px 6px 0 0;
      padding: 10px 15px;
      text-align: center;
  }
  
  .dmpf-panel {
      padding: 15px;
  }
  
  .dmpf-row {
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
  }
  
  .dmpf-filters {
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
  }
  
  .dmpf-filter-group {
      flex-direction: column;
      align-items: stretch;
      gap: 5px;
  }
  
  .dmpf-half {
      width: 100%;
      float: none;
      margin-bottom: 15px;
  }
  
  table.dmpf-list,
  .dmpf-table-details {
      font-size: 12px;
  }
  
  .dmpf-table-details th,
  .dmpf-table-details td {
      padding: 6px 4px;
  }
  
  .dmpf-pdf-container {
      padding: 10mm;
      font-size: 9px;
  }
}

@media (max-width: 480px) {
  .dmpf-root {
      margin: 5px;
      border-radius: 6px;
  }
  
  .dmpf-tabs {
      padding: 8px 8px 0;
  }
  
  .dmpf-tab {
      padding: 8px 12px;
      font-size: 13px;
  }
  
  .dmpf-panel {
      padding: 10px;
  }
  
  .dmpf-section {
      padding: 15px;
      margin: 15px 0;
  }
  
  .dmpf-submit {
      padding: 12px 20px;
      font-size: 14px;
      width: 100%;
  }
}

/* Styles d'impression */
@media print {
  .dmpf-pdf-container {
      padding: 0;
      margin: 0;
      font-size: 9px;
      box-shadow: none;
  }
  
  .dmpf-pdf-page-break {
      page-break-before: always;
  }
  
  .dmpf-pdf-avoid-break {
      page-break-inside: avoid;
  }
  
  .dmpf-pdf-header,
  .dmpf-pdf-footer {
      position: fixed;
      left: 15mm;
      right: 15mm;
  }
  
  .dmpf-pdf-header {
      top: 15mm;
  }
  
  .dmpf-pdf-footer {
      bottom: 15mm;
  }
  
  .dmpf-pdf-content {
      margin-top: 50mm;
      margin-bottom: 30mm;
  }
}

/* Utilitaires d'alignement */
.dmpf-pdf-text-right {
  text-align: right;
}

.dmpf-pdf-text-center {
  text-align: center;
}

.dmpf-pdf-text-left {
  text-align: left;
}

.dmpf-pdf-text-bold {
  font-weight: bold;
}

.dmpf-pdf-text-uppercase {
  text-transform: uppercase;
}

.dmpf-pdf-text-primary {
  color: var(--fibem-blue);
}

.dmpf-pdf-bg-light {
  background-color: var(--light-color);
}

.dmpf-pdf-border {
  border: 1px solid var(--border-color);
}

/* Styles pour les montants */
.dmpf-pdf-currency {
  font-family: 'Courier New', monospace;
  font-weight: bold;
}

.dmpf-pdf-amount {
  font-family: 'Courier New', monospace;
  text-align: right;
  font-weight: bold;
}

/* États des documents */
.dmpf-pdf-status-paid {
  color: var(--success-color);
  font-weight: bold;
}

.dmpf-pdf-status-pending {
  color: var(--warning-color);
  font-weight: bold;
}

.dmpf-pdf-status-overdue {
  color: var(--accent-color);
  font-weight: bold;
}

/* Numéro de page */
.dmpf-pdf-page-number {
  position: absolute;
  bottom: 8mm;
  right: 15mm;
  font-size: 8px;
  color: var(--text-light);
  font-family: 'Courier New', monospace;
}

/* Cache pour les bords de page */
.dmpf-pdf-margin-guide {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 1mm solid transparent;
  pointer-events: none;
}

/* Animation de chargement */
.dmpf-loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--fibem-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Tooltips */
.dmpf-tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.dmpf-tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark-color);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dmpf-tooltip:hover::before {
  content: '';
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--dark-color);
}