/* ============================================
   RAPHAËL PERRIER ACADEMY - Dashboard CSS
   ============================================ */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Montserrat:wght@300;400;500;600&display=swap');

/* ============================================
   VARIABLES
   ============================================ */
:root {
    --gold: #C9A050;
    --gold-light: #D4B56A;
    --gold-dark: #A67C00;
    --dark: #1a1a2e;
    --dark-light: #16213e;
    --dark-blue: #0f3460;
}

/* ============================================
   HEADER
   ============================================ */
.rpa-header {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 50%, var(--dark-blue) 100%);
    padding: 8px 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.rpa-logo {
    height: 55px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(201, 160, 80, 0.4));
}

.rpa-title-block {
    border-left: 1px solid rgba(201, 160, 80, 0.3);
    padding-left: 15px;
    margin-left: 15px;
}

.rpa-title {
    font-family: 'Cormorant Garamond', serif !important;
    font-weight: 600;
    font-size: 1.3rem;
    letter-spacing: 3px;
    color: var(--gold) !important;
    margin: 0;
    text-transform: uppercase;
}

.rpa-subtitle {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 300;
    font-size: 0.6rem;
    letter-spacing: 1px;
    color: #888;
    margin: 0;
    text-transform: uppercase;
}

.rpa-env-badge {
    font-size: 0.55rem !important;
    padding: 2px 6px !important;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.rpa-username {
    color: #ccc;
    font-size: 0.8rem;
    font-family: 'Montserrat', sans-serif;
}

.btn-header {
    font-size: 0.7rem !important;
    padding: 4px 10px !important;
    border: 1px solid rgba(201, 160, 80, 0.5) !important;
    color: var(--gold) !important;
    background: transparent !important;
    transition: all 0.2s ease;
}

.btn-header:hover {
    background: var(--gold) !important;
    color: var(--dark) !important;
}

/* ============================================
   STATS BAR
   ============================================ */
.rpa-stats-bar {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 6px 20px;
}

.rpa-stat-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 6px;
    background: #f8f9fa;
    border: 1px solid #eee;
    margin-right: 10px;
}

.rpa-stat-value {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1rem;
}

.rpa-stat-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.6rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rpa-stat-dots {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

/* ============================================
   MAIN CONTAINER
   ============================================ */
.rpa-main-container {
    display: flex;
    height: calc(100vh - 100px);
    overflow: hidden;
}

/* ============================================
   SIDEBAR
   ============================================ */
.rpa-sidebar {
    width: 190px;
    min-width: 190px;
    background: linear-gradient(180deg, #fafafa 0%, #f0f0f0 100%);
    border-right: 1px solid #e0e0e0;
    padding: 12px;
    overflow-y: auto;
}

.rpa-sidebar-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--dark);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--gold);
}

.rpa-filter-group {
    margin-bottom: 12px;
}

.rpa-filter-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.6rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
}

.rpa-input {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 0.72rem !important;
}

.rpa-input:focus {
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 2px rgba(201, 160, 80, 0.15) !important;
}

.result-count {
    text-align: center;
    padding: 8px;
    background: linear-gradient(135deg, var(--dark), var(--dark-light));
    border-radius: 6px;
    margin-top: 10px;
}

.result-count-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--gold);
}

.result-count-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.55rem;
    color: #888;
    text-transform: uppercase;
}

/* ============================================
   SIDEBAR - ESPACEMENT COMPACT
   ============================================ */
.rpa-filter-group {
    margin-bottom: 8px !important;
}

.rpa-filter-label {
    margin-bottom: 2px !important;
    font-size: 0.7rem !important;
}

.rpa-sidebar {
    padding: 10px !important;
}


/* ============================================
   DATEPICKER - OUVRIR VERS LE HAUT + Z-INDEX
   ============================================ */
#filter-date-inscription .SingleDatePicker_picker,
#filter-date-formation .SingleDatePicker_picker,
#filter-suivi-prochaine-adf .SingleDatePicker_picker,
#filter-suivi-derniere-insc .SingleDatePicker_picker,
#filter-suivi-date-rdv .SingleDatePicker_picker,
#filter-entreprise-date-adf .SingleDatePicker_picker {
    top: auto !important;
    bottom: 100% !important;
    margin-bottom: 5px;
    z-index: 1000 !important;
}

/* Style homogène pour les DatePicker */
.rpa-sidebar .SingleDatePickerInput {
    height: 31px !important;
    border-radius: 0.25rem !important;
    border: 1px solid #ced4da !important;
}

.rpa-sidebar .DateInput {
    width: 100% !important;
}

.rpa-sidebar .DateInput_input {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 0.72rem !important;
    padding: 4px 8px !important;
    height: 29px !important;
    line-height: 1.5 !important;
}

.rpa-sidebar .DateInput_input::placeholder {
    font-size: 0.72rem !important;
    color: #6c757d !important;
}

.rpa-sidebar .SingleDatePickerInput__withBorder {
    border-radius: 0.25rem !important;
}

.rpa-sidebar .SingleDatePicker {
    display: block !important;
    width: 100% !important;
}



/* ============================================
   CALENDRIER DATEPICKER - DÉBORDEMENT
   ============================================ */
.rpa-sidebar {
    overflow: visible !important;
}
 .rpa-sidebar {
    max-height: calc(100vh - 160px);
    overflow-y: auto !important;
}

.rpa-sidebar .DateRangePicker {
    position: relative;
}

.rpa-sidebar .DateRangePicker_picker {
    z-index: 1000 !important;
    left: 0 !important;
}

/* Optionnel: réduire la taille du calendrier pour mieux s'adapter */
.rpa-sidebar .DayPicker {
    font-size: 0.75rem;
}

.rpa-sidebar .CalendarMonth_caption {
    font-size: 0.8rem;
}


/* ============================================
   CONTENT
   ============================================ */
.rpa-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
}

/* ============================================
   TABS
   ============================================ */
.rpa-tabs .nav-tabs {
    border-bottom: 2px solid #e0e0e0;
    padding: 0 15px;
    background: #fafafa;
}

.rpa-tabs .nav-link {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 0.75rem !important;
    font-weight: 500;
    color: #666 !important;
    border: none !important;
    padding: 8px 14px !important;
    margin-bottom: -2px;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
}

.rpa-tabs .nav-link:hover {
    color: var(--gold) !important;
    background: transparent !important;
}

.rpa-tabs .nav-link.active {
    color: var(--gold) !important;
    background: rgba(201, 160, 80, 0.05) !important;
    border-bottom: 2px solid var(--gold) !important;
}

/* ============================================
   TABLE
   ============================================ */
.rpa-table-container {
    flex: 1;
    overflow: auto;
    padding: 0;
}

.rpa-table {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.78rem;
    margin-bottom: 0;
    table-layout: auto;
    width: 100%;
}

/* Limiter les colonnes larges par défaut */
.rpa-table tbody td:nth-child(1),
.rpa-table thead th:nth-child(1) { max-width: 110px; }  /* Participant */

.rpa-table tbody td:nth-child(2),
.rpa-table thead th:nth-child(2) { max-width: 140px; }  /* Entreprise */

.rpa-table tbody td:nth-child(3),
.rpa-table thead th:nth-child(3) { max-width: 160px; }  /* Module */


.rpa-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.rpa-table thead th {
    background: linear-gradient(135deg, var(--dark), var(--dark-light)) !important;
    color: var(--gold) !important;
    font-weight: 500 !important;
    font-size: 0.65rem !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 8px !important;
    border: none !important;
    white-space: nowrap;
}

.rpa-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.15s ease;
}

.rpa-table tbody tr:hover {
    background: rgba(201, 160, 80, 0.05) !important;
}

.rpa-table tbody td {
    padding: 8px !important;
    vertical-align: middle !important;
}

.participant-name {
    font-weight: 600;
    font-size: 0.82rem;
    color: #333;
}

.participant-id {
    font-size: 0.6rem;
    color: #999;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Cacher la flèche du select commercial */
.mini-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none !important;
    padding-right: 8px !important;
    text-align: center;
}

.mini-input {
    min-width: 50px;
    width: 100%;
    padding: 3px 5px !important;
    font-size: 0.68rem !important;
}
.note-input {
    min-width: 70px;
    width: 100%;
    padding: 3px 5px !important;
    font-size: 0.68rem !important;
}

.action-btn {
    opacity: 0.7;
    transition: all 0.15s ease;
}

.action-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}


/* Style du lien ADF vers la table inscription */
.adf-link:hover {
    color: #C9A050 !important;
    text-decoration: underline !important;
}


/* ============================================
   FOOTER
   ============================================ */
.rpa-footer {
    background: var(--dark);
    padding: 4px 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.55rem;
    color: #888;
}

/* ============================================
   SCROLLBAR
   ============================================ */
.rpa-table-container::-webkit-scrollbar,
.rpa-sidebar::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.rpa-table-container::-webkit-scrollbar-track,
.rpa-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.rpa-table-container::-webkit-scrollbar-thumb,
.rpa-sidebar::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 3px;
}

.rpa-table-container::-webkit-scrollbar-thumb:hover,
.rpa-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--gold-dark);
}

/* ============================================
   MODAL
   ============================================ */
.rpa-modal .modal-header {
    background: linear-gradient(135deg, var(--dark), var(--dark-light));
    color: var(--gold);
}

.rpa-modal .modal-title {
    font-family: 'Cormorant Garamond', serif;
    letter-spacing: 1px;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.rpa-login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 50%, var(--dark-blue) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rpa-login-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 100%;
}

.rpa-login-logo {
    height: 140px;
    display: block;
    margin: 0 auto 20px;
}

.rpa-login-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    color: var(--dark);
    text-align: center;
    margin-bottom: 5px;
    letter-spacing: 2px;
}

.rpa-login-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    color: #888;
    text-align: center;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rpa-login-btn {
    background: linear-gradient(135deg, var(--gold), var(--gold-light)) !important;
    border: none !important;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 500 !important;
    letter-spacing: 1px;
    padding: 10px 20px !important;
    transition: all 0.2s ease;
}

.rpa-login-btn:hover {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold)) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(201, 160, 80, 0.4);
}

/* ============================================
   PAGINATION
   ============================================ */
.rpa-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3px 10px;
    gap: 3px;
    font-size: 0.7rem;
}
.rpa-pagination .btn {
    font-size: 0.7rem;
    padding: 2px 6px;
    min-width: 24px;
}
.rpa-pagination input {
    width: 35px;
    padding: 2px 4px;
    font-size: 0.7rem;
}

/* ============================================
   ONGLET ACTIONS COMMERCIALES
   ============================================ */
.rpa-ac-form {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.rpa-ac-logs {
    max-height: 300px;
    overflow-y: auto;
    background: var(--dark);
    color: #0f0;
    font-family: monospace;
    font-size: 0.7rem;
    padding: 15px;
    border-radius: 6px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .rpa-sidebar {
        width: 170px;
        min-width: 170px;
    }
}

@media (max-width: 992px) {
    .rpa-stats-bar {
        padding: 5px 10px;
    }
    
    .rpa-stat-item {
        padding: 3px 8px;
        margin-right: 5px;
    }
    
    .rpa-stat-value {
        font-size: 0.9rem;
    }
}



/* ============================================
   BOUTONS DOCUMENTS (CVT, DPC, FAF, MAS)
   Style 1 : Badges colorés arrondis
   ============================================ */
.btn-doc {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 600;
    border-radius: 15px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    margin: 1px;
}

.btn-doc:hover {
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.btn-doc:active {
    transform: scale(0.95);
}

/* Convention - Bleu */
.btn-doc-cvt {
    background: #3498db;
    color: white;
}
.btn-doc-cvt:hover {
    background: #2980b9;
    color: white;
}

/* DPC FAFCEA - Violet */
.btn-doc-dpc {
    background: #9b59b6;
    color: white;
}
.btn-doc-dpc:hover {
    background: #8e44ad;
    color: white;
}

/* Débit FAF - Orange */
.btn-doc-faf {
    background: #e67e22;
    color: white;
}
.btn-doc-faf:hover {
    background: #d35400;
    color: white;
}

/* Marche à suivre - Vert */
.btn-doc-mas {
    background: #27ae60;
    color: white;
}
.btn-doc-mas:hover {
    background: #1e8449;
    color: white;
}

/* Container pour aligner les boutons */
.btn-doc-container {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
}

/* ZIP tous documents - Doré/Gold (style RP Academy) */
.btn-doc-zip {
    background: linear-gradient(135deg, #C9A050 0%, #A67C00 100%);
    color: white;
}
.btn-doc-zip:hover {
    background: linear-gradient(135deg, #D4B060 0%, #B8860B 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(201, 160, 80, 0.4);
}




/* ============================================
   STYLES AUTOCOMPLETE DROPDOWNS
   ============================================ */

/* Permettre au dropdown de dépasser la sidebar */
.rpa-sidebar {
    overflow: visible !important;
}

.rpa-filter-group {
    position: relative;
}

.rpa-autocomplete-dropdown {
    font-size: 0.85rem !important;
    position: relative;
}

.rpa-autocomplete-dropdown .Select-menu-outer {
    font-size: 0.85rem !important;
    z-index: 9999 !important;
    position: absolute !important;
    left: 0 !important;
    min-width: 500px !important;  /* Augmenté */
    width: max-content !important;
    max-width: 700px !important;  /* Augmenté */
    max-height: 400px !important;  /* Plus haut */
    background: white !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
}

.rpa-autocomplete-dropdown .Select-menu {
    max-height: 398px !important;
}

.rpa-autocomplete-dropdown .Select-option {
    padding: 10px 12px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.4 !important;
}

.rpa-autocomplete-dropdown .Select-option:hover {
    background-color: #f8f9fa !important;
}

.rpa-autocomplete-dropdown .Select-option.is-focused {
    background-color: #e9ecef !important;
}
