/* ===================================
   ARPA COMPONENTS - CSS RÉUTILISABLE
   =================================== */

/* Import de la police Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ===================================
   VARIABLES CSS GLOBALES
   =================================== */
:root {
    /* Couleurs ARPA */
    --arpa-orange: #f59f1d;
    --arpa-blue: #13303a;
    --arpa-grey: #f7f8fa;
    --arpa-green: #10B981;
    
    /* Couleurs système */
    --arpa-text-primary: #374151;
    --arpa-text-secondary: #6b7280;
    --arpa-text-muted: #9ca3af;
    --arpa-border: #e5e7eb;
    --arpa-border-light: #f3f4f6;
    --arpa-bg-subtle: #f9fafb;
    
    /* Transitions */
    --arpa-transition: all 0.15s ease-in-out;
    --arpa-transition-slow: all 0.3s ease-in-out;
    
    /* Shadows */
    --arpa-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --arpa-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --arpa-shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Border radius */
    --arpa-radius: 0.375rem;
    --arpa-radius-lg: 0.5rem;

    /* Police par défaut */
    --arpa-font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Définition de la police globale pour ARPA */
body,
.arpa-font,
.arpa-components {
    font-family: var(--arpa-font-family);
}

/* ===================================
   CLASSES UTILITAIRES ARPA
   =================================== */
.bg-arpa-orange { background-color: var(--arpa-orange); }
.text-arpa-orange { color: var(--arpa-orange); }
.border-arpa-orange { border-color: var(--arpa-orange); }

.bg-arpa-blue { background-color: var(--arpa-blue); }
.text-arpa-blue { color: var(--arpa-blue); }
.border-arpa-blue { border-color: var(--arpa-blue); }

.bg-arpa-grey { background-color: var(--arpa-grey); }
.text-arpa-grey { color: var(--arpa-grey); }
.border-arpa-grey { border-color: var(--arpa-grey); }

/* ===================================
   COMPOSANTS BOUTONS
   =================================== */
.arpa-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--arpa-radius);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--arpa-transition);
    text-align: center;
}

.arpa-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(245, 159, 29, 0.1);
}

.arpa-btn-primary {
    background-color: var(--arpa-orange);
    color: white;
    border-color: var(--arpa-orange);
}

.arpa-btn-primary:hover {
    background-color: #e8940f;
    border-color: #e8940f;
    transform: translateY(-1px);
    box-shadow: var(--arpa-shadow-md);
}

.arpa-btn-secondary {
    background-color: var(--arpa-blue);
    color: white;
    border-color: var(--arpa-blue);
}

.arpa-btn-secondary:hover {
    background-color: #0f242a;
    border-color: #0f242a;
    transform: translateY(-1px);
    box-shadow: var(--arpa-shadow-md);
}

.arpa-btn-outline {
    background-color: transparent;
    color: var(--arpa-text-primary);
    border-color: var(--arpa-border);
}

.arpa-btn-outline:hover {
    background-color: var(--arpa-bg-subtle);
    border-color: var(--arpa-orange);
    color: var(--arpa-orange);
}

.arpa-btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.arpa-btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* ===================================
   COMPOSANTS FILTRES
   =================================== */
.arpa-filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: var(--arpa-radius);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--arpa-transition);
}

.arpa-filter-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--arpa-shadow-sm);
}

.arpa-filter-btn.active {
    background-color: var(--arpa-orange);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(245, 159, 29, 0.2);
}

.arpa-filter-btn:not(.active) {
    background-color: #f3f4f6;
    color: var(--arpa-text-secondary);
}

.arpa-filter-btn:not(.active):hover {
    background-color: #e5e7eb;
    color: var(--arpa-text-primary);
}

/* ===================================
   COMPOSANTS CARTES
   =================================== */
.arpa-card {
    background-color: white;
    border-radius: var(--arpa-radius-lg);
    box-shadow: var(--arpa-shadow-sm);
    border: 1px solid var(--arpa-border-light);
    transition: var(--arpa-transition);
}

.arpa-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--arpa-shadow-lg);
}

.arpa-card-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid var(--arpa-border-light);
}

.arpa-card-body {
    padding: 1.5rem;
}

.arpa-card-footer {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid var(--arpa-border-light);
}

/* Titre de section */
.arpa-subtitle {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--arpa-text-primary);
    line-height: 1.5;
}

/* Titre de carte */
.arpa-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--arpa-text-primary);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

/* ===================================
   COMPOSANTS BADGES
   =================================== */
.arpa-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.arpa-badge-info {
    background-color: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
}

.arpa-badge-success {
    background-color: #d1fae5;
    color: #059669;
    border-color: #a7f3d0;
}

.arpa-badge-warning {
    background-color: #fef3c7;
    color: #d97706;
    border-color: #fde68a;
}

.arpa-badge-secondary {
    background-color: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

/* ===================================
   COMPOSANTS STATISTIQUES
   =================================== */
.arpa-stat-card {
    background-color: white;
    border-radius: var(--arpa-radius-lg);
    box-shadow: var(--arpa-shadow-sm);
    border: 1px solid var(--arpa-border-light);
    padding: 1.5rem;
    transition: var(--arpa-transition);
}

.arpa-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--arpa-shadow-lg);
}

.arpa-stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--arpa-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.arpa-stat-icon.blue {
    background-color: #dbeafe;
    color: var(--arpa-blue);
}

.arpa-stat-icon.green {
    background-color: #d1fae5;
    color: var(--arpa-green);
}

.arpa-stat-icon.orange {
    background-color: #fed7aa;
    color: var(--arpa-orange);
}

.arpa-stat-icon.purple {
    background-color: #e9d5ff;
    color: #8b5cf6;
}

.arpa-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--arpa-text-primary);
    line-height: 1;
}

.arpa-stat-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--arpa-text-secondary);
}

/* ===================================
   COMPOSANTS DATATABLES
   =================================== */
.arpa-datatable {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    background-color: white;
    color: var(--arpa-text-primary);
}

.arpa-datatable thead th {
    background-color: var(--arpa-bg-subtle);
    color: var(--arpa-text-primary);
    border-bottom: 2px solid var(--arpa-border);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
}

.arpa-datatable tbody tr {
    background-color: white;
    border-bottom: 1px solid var(--arpa-border-light);
    color: var(--arpa-text-primary);
    transition: var(--arpa-transition);
}

.arpa-datatable tbody tr:hover {
    background-color: var(--arpa-bg-subtle);
}

.arpa-datatable tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    color: var(--arpa-text-primary);
}

/* ===================================
   LAYOUT DATATABLES - CONTRÔLES EN LIGNE
   =================================== */

/* Version moderne avec Flexbox (optionnelle) */
.arpa-datatable-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.arpa-datatable-controls .dataTables_length {
    margin: 0;
}

.arpa-datatable-controls .dataTables_filter {
    margin: 0;
}

/* Classe pour forcer l'alignement en ligne sur les DataTables existantes */
.arpa-datatable-inline-controls .dataTables_wrapper .dataTables_length {
    float: left !important;
    display: inline-block !important;
    margin-bottom: 1rem !important;
}

.arpa-datatable-inline-controls .dataTables_wrapper .dataTables_filter {
    float: right !important;
    display: inline-block !important;
    margin-bottom: 1rem !important;
}

/* Version classique avec float (fallback) */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    display: inline-block;
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_length {
    float: left;
}

.dataTables_wrapper .dataTables_filter {
    float: right;
}

/* Clearfix pour les éléments flottants */
.dataTables_wrapper::after {
    content: "";
    display: table;
    clear: both;
}

.dataTables_wrapper .dataTables_info {
    clear: both;
    padding-top: 0.5rem;
}

/* Amélioration du style des contrôles */
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--arpa-text-primary);
}

.dataTables_wrapper .dataTables_length select {
    min-width: 4rem;
}

.dataTables_wrapper .dataTables_filter input {
    min-width: 12rem;
}

/* Classes de colonnes standardisées */
.arpa-col-sm { width: 80px !important; min-width: 80px !important; }
.arpa-col-md { width: 100px !important; min-width: 100px !important; }
.arpa-col-lg { width: 120px !important; min-width: 120px !important; }
.arpa-col-xl { width: 300px !important; min-width: 300px !important; }
.arpa-col-actions { width: 120px !important; min-width: 120px !important; }

/* Styles de lignes pour les statuts de relais */
.arpa-datatable tbody tr.bg-red-50,
table.dataTable tbody tr.bg-red-50,
#relaisTable tbody tr.bg-red-50 {
    background-color: rgb(254 242 242) !important;
}

.arpa-datatable tbody tr.bg-red-50:hover,
table.dataTable tbody tr.bg-red-50:hover,
#relaisTable tbody tr.bg-red-50:hover {
    background-color: rgb(254 226 226) !important;
}

.arpa-datatable tbody tr.bg-gray-50,
table.dataTable tbody tr.bg-gray-50,
#relaisTable tbody tr.bg-gray-50 {
    background-color: rgb(249 250 251) !important;
    opacity: 0.75;
}

.arpa-datatable tbody tr.bg-gray-50:hover,
table.dataTable tbody tr.bg-gray-50:hover,
#relaisTable tbody tr.bg-gray-50:hover {
    background-color: rgb(243 244 246) !important;
}

/* Cellules héritent du fond de la ligne */
.arpa-datatable tbody tr.bg-red-50 td,
table.dataTable tbody tr.bg-red-50 td,
#relaisTable tbody tr.bg-red-50 td {
    background-color: inherit !important;
}

.arpa-datatable tbody tr.bg-gray-50 td,
table.dataTable tbody tr.bg-gray-50 td,
#relaisTable tbody tr.bg-gray-50 td {
    background-color: inherit !important;
}

/* Textes et spans transparents pour voir le fond coloré */
.arpa-datatable tbody tr.bg-red-50 td span:not([class*="bg-"]):not([class*="progress-"]),
.arpa-datatable tbody tr.bg-red-50 td div:not([class*="bg-"]):not([class*="progress-"]),
.arpa-datatable tbody tr.bg-red-50 td p:not([class*="bg-"]):not([class*="progress-"]),
.arpa-datatable tbody tr.bg-red-50 td strong:not([class*="bg-"]):not([class*="progress-"]),
table.dataTable tbody tr.bg-red-50 td span:not([class*="bg-"]):not([class*="progress-"]),
table.dataTable tbody tr.bg-red-50 td div:not([class*="bg-"]):not([class*="progress-"]),
table.dataTable tbody tr.bg-red-50 td p:not([class*="bg-"]):not([class*="progress-"]),
table.dataTable tbody tr.bg-red-50 td strong:not([class*="bg-"]):not([class*="progress-"]),
#relaisTable tbody tr.bg-red-50 td span:not([class*="bg-"]):not([class*="progress-"]),
#relaisTable tbody tr.bg-red-50 td div:not([class*="bg-"]):not([class*="progress-"]),
#relaisTable tbody tr.bg-red-50 td p:not([class*="bg-"]):not([class*="progress-"]),
#relaisTable tbody tr.bg-red-50 td strong:not([class*="bg-"]):not([class*="progress-"]) {
    background-color: transparent !important;
}

.arpa-datatable tbody tr.bg-gray-50 td span:not([class*="bg-"]):not([class*="progress-"]),
.arpa-datatable tbody tr.bg-gray-50 td div:not([class*="bg-"]):not([class*="progress-"]),
.arpa-datatable tbody tr.bg-gray-50 td p:not([class*="bg-"]):not([class*="progress-"]),
.arpa-datatable tbody tr.bg-gray-50 td strong:not([class*="bg-"]):not([class*="progress-"]),
table.dataTable tbody tr.bg-gray-50 td span:not([class*="bg-"]):not([class*="progress-"]),
table.dataTable tbody tr.bg-gray-50 td div:not([class*="bg-"]):not([class*="progress-"]),
table.dataTable tbody tr.bg-gray-50 td p:not([class*="bg-"]):not([class*="progress-"]),
table.dataTable tbody tr.bg-gray-50 td strong:not([class*="bg-"]):not([class*="progress-"]),
#relaisTable tbody tr.bg-gray-50 td span:not([class*="bg-"]):not([class*="progress-"]),
#relaisTable tbody tr.bg-gray-50 td div:not([class*="bg-"]):not([class*="progress-"]),
#relaisTable tbody tr.bg-gray-50 td p:not([class*="bg-"]):not([class*="progress-"]),
#relaisTable tbody tr.bg-gray-50 td strong:not([class*="bg-"]):not([class*="progress-"]) {
    background-color: transparent !important;
}

/* Solution plus large : tous les éléments texte sans classes spécifiques */
.arpa-datatable tbody tr.bg-red-50 td *:not(button):not([class*="bg-"]):not([class*="progress-"]):not([class*="border-"]):not(.arpa-status-badge),
table.dataTable tbody tr.bg-red-50 td *:not(button):not([class*="bg-"]):not([class*="progress-"]):not([class*="border-"]):not(.arpa-status-badge),
#relaisTable tbody tr.bg-red-50 td *:not(button):not([class*="bg-"]):not([class*="progress-"]):not([class*="border-"]):not(.arpa-status-badge) {
    background-color: transparent !important;
}

.arpa-datatable tbody tr.bg-gray-50 td *:not(button):not([class*="bg-"]):not([class*="progress-"]):not([class*="border-"]):not(.arpa-status-badge),
table.dataTable tbody tr.bg-gray-50 td *:not(button):not([class*="bg-"]):not([class*="progress-"]):not([class*="border-"]):not(.arpa-status-badge),
#relaisTable tbody tr.bg-gray-50 td *:not(button):not([class*="bg-"]):not([class*="progress-"]):not([class*="border-"]):not(.arpa-status-badge) {
    background-color: transparent !important;
}

/* Boutons gardent leurs couleurs exactes */
.arpa-datatable tbody tr.bg-red-50 button.bg-arpa-orange,
table.dataTable tbody tr.bg-red-50 button.bg-arpa-orange,
#relaisTable tbody tr.bg-red-50 button.bg-arpa-orange {
    background-color: var(--arpa-orange) !important;
}

.arpa-datatable tbody tr.bg-red-50 button.bg-arpa-blue,
table.dataTable tbody tr.bg-red-50 button.bg-arpa-blue,
#relaisTable tbody tr.bg-red-50 button.bg-arpa-blue {
    background-color: var(--arpa-blue) !important;
}

.arpa-datatable tbody tr.bg-red-50 button.bg-green-500,
table.dataTable tbody tr.bg-red-50 button.bg-green-500,
#relaisTable tbody tr.bg-red-50 button.bg-green-500 {
    background-color: #10b981 !important;
}

.arpa-datatable tbody tr.bg-red-50 button.bg-gray-500,
table.dataTable tbody tr.bg-red-50 button.bg-gray-500,
#relaisTable tbody tr.bg-red-50 button.bg-gray-500 {
    background-color: #6b7280 !important;
}

.arpa-datatable tbody tr.bg-red-50 button.bg-red-500,
table.dataTable tbody tr.bg-red-50 button.bg-red-500,
#relaisTable tbody tr.bg-red-50 button.bg-red-500 {
    background-color: #ef4444 !important;
}

/* Même règles pour les lignes grises */
.arpa-datatable tbody tr.bg-gray-50 button.bg-arpa-orange,
table.dataTable tbody tr.bg-gray-50 button.bg-arpa-orange,
#relaisTable tbody tr.bg-gray-50 button.bg-arpa-orange {
    background-color: var(--arpa-orange) !important;
}

.arpa-datatable tbody tr.bg-gray-50 button.bg-arpa-blue,
table.dataTable tbody tr.bg-gray-50 button.bg-arpa-blue,
#relaisTable tbody tr.bg-gray-50 button.bg-arpa-blue {
    background-color: var(--arpa-blue) !important;
}

.arpa-datatable tbody tr.bg-gray-50 button.bg-green-500,
table.dataTable tbody tr.bg-gray-50 button.bg-green-500,
#relaisTable tbody tr.bg-gray-50 button.bg-green-500 {
    background-color: #10b981 !important;
}

.arpa-datatable tbody tr.bg-gray-50 button.bg-gray-500,
table.dataTable tbody tr.bg-gray-50 button.bg-gray-500,
#relaisTable tbody tr.bg-gray-50 button.bg-gray-500 {
    background-color: #6b7280 !important;
}

.arpa-datatable tbody tr.bg-gray-50 button.bg-red-500,
table.dataTable tbody tr.bg-gray-50 button.bg-red-500,
#relaisTable tbody tr.bg-gray-50 button.bg-red-500 {
    background-color: #ef4444 !important;
}
/* Correction générale pour tous les éléments texte dans la table */
.arpa-datatable tbody td *:not(button):not([class*="bg-"]):not([class*="progress-"]):not([class*="border-"]):not(.arpa-status-badge):not(.progress-fill),
table.dataTable tbody td *:not(button):not([class*="bg-"]):not([class*="progress-"]):not([class*="border-"]):not(.arpa-status-badge):not(.progress-fill),
#relaisTable tbody td *:not(button):not([class*="bg-"]):not([class*="progress-"]):not([class*="border-"]):not(.arpa-status-badge):not(.progress-fill) {
    background-color: transparent !important;
}

/* Correction spécifique pour les éléments de progression qui peuvent avoir des fonds blancs */
.arpa-datatable .progress-container,
.arpa-datatable .progress-container *:not(.progress-fill):not(.progress-bar),
.arpa-datatable .progress-label,
.arpa-datatable .progress-text,
table.dataTable .progress-container,
table.dataTable .progress-container *:not(.progress-fill):not(.progress-bar),
table.dataTable .progress-label,
table.dataTable .progress-text,
#relaisTable .progress-container,
#relaisTable .progress-container *:not(.progress-fill):not(.progress-bar),
#relaisTable .progress-label,
#relaisTable .progress-text {
    background-color: transparent !important;
}

/* S'assurer que les conteneurs de formations n'ont pas de fond blanc */
.arpa-datatable tbody td .space-y-2,
.arpa-datatable tbody td .space-y-2 > div:not([class*="bg-"]),
table.dataTable tbody td .space-y-2,
table.dataTable tbody td .space-y-2 > div:not([class*="bg-"]),
#relaisTable tbody td .space-y-2,
#relaisTable tbody td .space-y-2 > div:not([class*="bg-"]) {
    background-color: transparent !important;
}

.arpa-col-auto { min-width: 200px !important; }

/* Responsive pour DataTables */
@media (max-width: 768px) {
    .arpa-col-actions { width: 100px !important; min-width: 100px !important; }
    .arpa-col-sm,
    .arpa-col-md,
    .arpa-col-lg { width: 70px !important; min-width: 70px !important; }
    .arpa-col-xl { width: 150px !important; min-width: 150px !important; }
    
    /* Version Flexbox responsive */
    .arpa-datatable-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .dataTables_wrapper .dataTables_filter input {
        min-width: auto;
        width: 100%;
    }
    
    /* Version classique responsive (fallback) */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none !important;
        display: block !important;
        text-align: left !important;
        margin-bottom: 0.5rem !important;
        width: 100% !important;
    }
    
    .dataTables_wrapper .dataTables_filter {
        margin-top: 0.5rem;
    }
}

/* ===================================
   COMPOSANTS MODALES
   =================================== */
.arpa-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(75, 85, 99, 0.5);
    z-index: 40;
}

.arpa-modal {
    background-color: white;
    border-radius: var(--arpa-radius-lg);
    box-shadow: var(--arpa-shadow-lg);
    max-width: 48rem;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
}

.arpa-modal-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid var(--arpa-border-light);
}

.arpa-modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--arpa-text-primary);
}

.arpa-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.arpa-modal-footer {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid var(--arpa-border-light);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ===================================
   COMPOSANTS FORMULAIRES
   =================================== */
.arpa-form-group {
    margin-bottom: 1rem;
}

.arpa-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--arpa-text-primary);
    margin-bottom: 0.5rem;
}

.arpa-form-input {
    width: 100%;
    border: 1px solid var(--arpa-border);
    border-radius: var(--arpa-radius);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--arpa-text-primary);
    background-color: white;
    transition: var(--arpa-transition);
}

.arpa-form-input:focus {
    outline: none;
    border-color: var(--arpa-orange);
    box-shadow: 0 0 0 3px rgba(245, 159, 29, 0.1);
}

.arpa-form-input-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.arpa-form-select {
    width: 100%;
    border: 1px solid var(--arpa-border);
    border-radius: var(--arpa-radius);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--arpa-text-primary);
    background-color: white;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    transition: var(--arpa-transition);
}

.arpa-form-select:focus {
    outline: none;
    border-color: var(--arpa-orange);
    box-shadow: 0 0 0 3px rgba(245, 159, 29, 0.1);
}

/* ===================================
   COMPOSANTS ONGLETS
   =================================== */
.arpa-tabs {
    border-bottom: 1px solid var(--arpa-border-light);
}

.arpa-tab {
    display: inline-flex;
    align-items: center;
    padding: 1rem 0.25rem;
    margin-right: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--arpa-text-secondary);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: var(--arpa-transition);
}

.arpa-tab:hover {
    color: var(--arpa-text-primary);
}

.arpa-tab.active {
    color: var(--arpa-orange);
    border-bottom-color: var(--arpa-orange);
}

.arpa-tab-content {
    padding: 1.5rem 0;
}

.arpa-tab-content.hidden {
    display: none;
}

/* ===================================
   UTILITAIRES RESPONSIVE
   =================================== */
@media (max-width: 768px) {
    .arpa-modal {
        max-width: 95vw;
        margin: 1rem;
    }
    
    .arpa-modal-header,
    .arpa-modal-body,
    .arpa-modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .arpa-btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    
    .arpa-stat-card {
        padding: 1rem;
    }
    
    .arpa-stat-value {
        font-size: 1.5rem;
    }
}

/* ===================================
   ANIMATIONS ET TRANSITIONS
   =================================== */
@keyframes arpa-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.arpa-fade-in {
    animation: arpa-fade-in 0.3s ease-in-out;
}

.arpa-transition {
    transition: var(--arpa-transition);
}

.arpa-transition-slow {
    transition: var(--arpa-transition-slow);
}

/* ===================================
   ÉTATS ET VARIATIONS
   =================================== */
.arpa-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.arpa-loading {
    position: relative;
    color: transparent !important;
}

.arpa-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ===================================
   SYSTÈME DE BADGES STATUT
   =================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--arpa-transition);
}

/* Badge Validé - Vert */
.status-badge-valide {
    background-color: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* Badge En attente - Orange */
.status-badge-attente {
    background-color: #fff7ed;
    color: #ea580c;
    border: 1px solid #fdba74;
}

/* Badge Proposé - Bleu */
.status-badge-propose {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Badge Programmé - Orange */
.status-badge-programme {
    background-color: #fed7aa;
    color: #c2410c;
    border: 1px solid #fdba74;
}

/* Badge En cours - Orange */
.status-badge-encours {
    background-color: #fffbeb;
    color: #d97706;
    border: 1px solid #fed7aa;
}

/* Badge Terminé - Vert foncé */
.status-badge-termine {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Badge Archivé - Gris */
.status-badge-archive {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

/* Badge Annulé - Rouge */
.status-badge-annule {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* ===================================
   CLASSES D'ESPACEMENT COHÉRENTES
   =================================== */
.arpa-spacing-xs { gap: 0.25rem; }
.arpa-spacing-sm { gap: 0.5rem; }
.arpa-spacing-md { gap: 0.75rem; }
.arpa-spacing-lg { gap: 1rem; }
.arpa-spacing-xl { gap: 1.5rem; }

.arpa-padding-sm { padding: 0.5rem; }
.arpa-padding-md { padding: 1rem; }
.arpa-padding-lg { padding: 1.5rem; }
.arpa-padding-xl { padding: 2rem; }

.arpa-margin-sm { margin: 0.5rem; }
.arpa-margin-md { margin: 1rem; }
.arpa-margin-lg { margin: 1.5rem; }
.arpa-margin-xl { margin: 2rem; }

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Skeleton loaders */
.arpa-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: arpa-skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 0.375rem;
}

@keyframes arpa-skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.arpa-skeleton-card {
    height: 120px;
    border-radius: 0.5rem;
}

.arpa-skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    width: 75%;
}

.arpa-skeleton-text-short {
    height: 1rem;
    width: 40%;
}

.arpa-skeleton-table-row {
    height: 2.5rem;
    margin-bottom: 0.25rem;
}

/* Mobile: cards plus larges (moins de padding interne) */
@media (max-width: 640px) {
    .arpa-card-header {
        padding: 0.75rem 0.75rem 0.5rem 0.75rem;
    }
    .arpa-card-body {
        padding: 0.75rem;
    }
    .arpa-card-footer {
        padding: 0.5rem 0.75rem;
    }
}
