/* public/assets/css/style.css */
/* Version Complète Finale v3 (Design Modale + Autres) */

/* Variables & Reset */
:root {
  --bs-primary-rgb: 41, 128, 185; --bs-secondary-rgb: 108, 117, 125;
  --bs-success-rgb: 25, 135, 84; --bs-info-rgb: 13, 202, 240;
  --bs-warning-rgb: 255, 193, 7; --bs-danger-rgb: 220, 53, 69;
  --bs-light-rgb: 248, 249, 250; --bs-dark-rgb: 33, 37, 41;
  --primary-color: rgb(var(--bs-primary-rgb));
  --secondary-color: rgb(var(--bs-secondary-rgb));
  --dark-color: #2c3e50; /* Sidebar custom dark */
  --light-color: #ecf0f1;
  --success-color: rgb(var(--bs-success-rgb));
  --warning-color: rgb(var(--bs-warning-rgb));
  --danger-color: rgb(var(--bs-danger-rgb));
  --info-color: rgb(var(--bs-info-rgb));
  --bg-light: #f8f9fa;
  --bg-page: #eef2f7;
  --text-color: #212529;
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 75px;
  --topbar-height: 60px;
  --bs-body-font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-font-size: 0.93rem;
  --bs-border-radius: 0.375rem;
  --bs-border-color: #dee2e6;
  --bs-card-box-shadow: 0 0.1rem 0.4rem rgba(0, 0, 0, 0.06);
  --bs-modal-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--bs-body-font-family); font-size: var(--bs-body-font-size); font-weight: 400; line-height: 1.6; color: var(--text-color); background-color: var(--bg-page); -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); overflow-x: hidden; }
a { color: var(--primary-color); text-decoration: none; } a:hover { color: darken(var(--primary-color), 10%); text-decoration: none; }
.h-100 { height: 100% !important; } .w-100 { width: 100% !important; }
.form-label-sm { font-size: 0.8rem; margin-bottom: 0.2rem; }

/* Login Page */
.login-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-form { background-color: #fff; border-radius: var(--bs-border-radius); box-shadow: var(--bs-modal-box-shadow); padding: 30px 40px; width: 420px; max-width: 100%; }
.login-logo { text-align: center; margin-bottom: 2rem; } .login-logo i { margin-bottom: 0.5rem; } .login-logo h2 { color: var(--primary-color); margin-top: 0; margin-bottom: 0.25rem; font-weight: 600; font-size: 1.6rem;} .login-logo p { color: #6c757d; font-size: 0.95em; }
#togglePassword { border-left: 0; color: #6c757d; } #togglePassword:hover { background-color: #f8f9fa;}
#forgotPasswordLink { font-size: 0.85em; }

/* Sidebar */
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-width); background-color: var(--dark-color); transition: width 0.3s ease-in-out; z-index: 1030; display: flex; flex-direction: column; box-shadow: 0.1rem 0 0.5rem rgba(0,0,0,0.1); }
.sidebar-brand { display: flex; align-items: center; justify-content: flex-start; height: var(--topbar-height); padding: 0 1.5rem; color: white; font-size: 1.3rem; font-weight: 600; background-color: rgba(0,0,0,0.2); flex-shrink: 0; white-space: nowrap; overflow: hidden; }
.sidebar-brand i { margin-right: 12px; font-size: 1.6rem; min-width: 25px; text-align: center; }
.sidebar-brand span { transition: opacity 0.2s ease-in-out; }
.sidebar-menu { flex-grow: 1; overflow-y: auto; padding-top: 10px; }
.sidebar-menu-item { margin: 2px 10px; border-radius: var(--bs-border-radius); }
.sidebar-menu-item a.nav-link { color: rgba(255, 255, 255, 0.75); display: flex; align-items: center; padding: 0.65rem 1rem; font-size: 0.95rem; border-radius: var(--bs-border-radius); transition: background-color 0.2s ease, color 0.2s ease; white-space: nowrap; overflow: hidden; }
.sidebar-menu-item a.nav-link i { margin-right: 15px; font-size: 1.1rem; min-width: 25px; text-align: center; transition: margin 0.3s ease-in-out; }
.sidebar-menu-item.active > a.nav-link { background-color: var(--primary-color); color: white; font-weight: 500; }
.sidebar-menu-item:not(.active) a.nav-link:hover { background-color: rgba(255, 255, 255, 0.1); color: white; }
.sidebar-menu-item.mt-auto { margin-top: auto !important; border-top: 1px solid rgba(255, 255, 255, 0.15); padding-top: 10px; margin-bottom: 10px;}

/* Main Content Area */
.main-content { margin-left: var(--sidebar-width); padding: 20px; transition: margin-left 0.3s ease-in-out; padding-top: calc(var(--topbar-height) + 20px); }

/* Topbar */
.topbar { display: flex; justify-content: space-between; align-items: center; background-color: white; padding: 0 20px; border-bottom: 1px solid var(--bs-border-color); height: var(--topbar-height); position: fixed; top: 0; left: var(--sidebar-width); right: 0; z-index: 1020; transition: left 0.3s ease-in-out; }
.topbar .page-title { color: var(--dark-color); font-size: 1.25rem; font-weight: 600;}
.user-info { display: flex; align-items: center; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background-color: var(--primary-color); color: white; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 1rem; }

/* Content Pages */
.content-page { display: none; animation: fadeIn 0.4s ease-in-out; } .content-page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* Dashboard Cards */
.dashboard-card { background-color: white; border-radius: var(--bs-border-radius); box-shadow: var(--bs-card-box-shadow); padding: 20px; transition: transform 0.2s ease-out, box-shadow 0.2s ease-out; display: flex; flex-direction: column; border: 1px solid var(--bs-border-color); }
.dashboard-card:hover { transform: translateY(-2px); box-shadow: 0 0.3rem 0.8rem rgba(0,0,0,0.1); }
.dashboard-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.dashboard-card-title { font-size: 0.85rem; font-weight: 600; color: #6c757d; text-transform: uppercase; letter-spacing: 0.5px; margin: 0; }
.dashboard-card-icon { width: 38px; height: 38px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: white; flex-shrink: 0; }
.bg-primary-gradient { background: linear-gradient(45deg, #5dade2, var(--primary-color)); } .bg-success-gradient { background: linear-gradient(45deg, #58d68d, var(--success-color)); } .bg-warning-gradient { background: linear-gradient(45deg, #f4d03f, var(--warning-color)); } .bg-danger-gradient { background: linear-gradient(45deg, #ec7063, var(--danger-color)); }
.dashboard-card-value { font-size: 1.8rem; font-weight: 700; margin: 0 0 5px 0; color: var(--dark-color); flex-grow: 1; line-height: 1.2; }
.dashboard-card-label { color: #95a5a6; font-size: 0.8rem; margin: 0; }
.dashboard-card-value .placeholder { background-color: #e9ecef; border-radius: 0.2rem; }

/* Charts */
.chart-container { position: relative; min-height: 320px; width: 100%; }

/* Data Tables Enhancements */
.dt-container { padding: 0; }
div.dataTables_wrapper div.dataTables_filter input, div.dataTables_wrapper div.dataTables_length select { border: 1px solid #ced4da; padding: 0.3rem 0.6rem; border-radius: var(--bs-border-radius); font-size: 0.9rem; background-color: #fff; margin-left: 0.5em; }
div.dataTables_wrapper div.dataTables_filter input:focus, div.dataTables_wrapper div.dataTables_length select:focus { border-color: var(--primary-color); box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25); outline: 0; }
div.dataTables_wrapper div.dt-buttons { margin-top: 0.5rem; text-align: center; } div.dataTables_wrapper div.dt-buttons .btn { margin: 0 3px; }
#collectorsTable thead th { text-align: center; vertical-align: middle; background-color: #f1f5f9; font-size: 0.85rem; font-weight: 600; color: #495057; border-bottom-width: 1px; padding: 0.75rem 0.5rem;}
#collectorsTable tbody td { vertical-align: middle; font-size: 0.9rem; padding: 0.5rem; border-color: #eaedf1; }
/* Alignment classes */
#collectorsTable .dt-body-center, #collectorsTable th.dt-head-center { text-align: center; } #collectorsTable .dt-body-right, #collectorsTable th.dt-head-right { text-align: right; } #collectorsTable .dt-body-left, #collectorsTable th.dt-head-left { text-align: left; }
/* Specific columns */
#collectorsTable .collector-id-column span { cursor: help; white-space: nowrap; }
#collectorsTable .actions-column { min-width: 105px; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* Status Badges */
.status-badge { padding: 0.25em 0.65em; border-radius: var(--bs-border-radius); font-size: 0.8rem; font-weight: 600; text-transform: capitalize; border: 1px solid transparent; display: inline-block; line-height: 1.2; }
.status-pending { background-color: rgba(var(--bs-warning-rgb), 0.1); color: darken(rgb(var(--bs-warning-rgb)), 15%); border-color: rgba(var(--bs-warning-rgb), 0.3);}
.status-approved { background-color: rgba(var(--bs-success-rgb), 0.1); color: darken(rgb(var(--bs-success-rgb)), 15%); border-color: rgba(var(--bs-success-rgb), 0.3);}
.status-rejected { background-color: rgba(var(--bs-danger-rgb), 0.1); color: darken(rgb(var(--bs-danger-rgb)), 15%); border-color: rgba(var(--bs-danger-rgb), 0.3);}


/* Collector Details Modal Styling (Design Amélioré v3) */
.modal-body { font-size: 0.93rem; }
#collectorDetailsContent .modal-section-title { /* Applied to h5 */
    font-size: 1rem; /* Taille légèrement réduite */
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6; /* Ligne de séparation plus nette */
    display: flex;
    align-items: center;
    font-weight: 600;
}
#collectorDetailsContent .modal-section-title i {
    font-size: 1.1rem;
    margin-right: 0.6rem;
    opacity: 0.8;
}
/* Style des lignes Clé/Valeur */
#collectorDetailsContent .detail-row {
     padding: 0.15rem 0; /* Espacement vertical entre lignes */
     border-bottom: 1px solid #f8f9fa; /* Très légère ligne entre détails */
}
#collectorDetailsContent .detail-row:last-child {
    border-bottom: none;
}
#collectorDetailsContent .detail-label {
    /* col-sm-4 col-lg-3 */
    color: #6c757d; /* text-muted */
    font-weight: 500; /* Moins gras que bold */
    text-align: left;
    padding-right: 5px;
    word-break: keep-all;
    white-space: nowrap;
    font-size: 0.9em; /* Label légèrement plus petit */
    line-height: 1.5; /* Pour alignement vertical avec valeur */
}
#collectorDetailsContent .detail-value {
    /* col-sm-8 col-lg-9 */
    padding-left: 5px;
    word-break: break-word;
    color: #212529; /* Texte standard */
    line-height: 1.5;
}
#collectorDetailsContent .detail-value em.small {
    font-size: 0.9em;
    font-style: normal;
    color: #999; /* N/A plus discret */
}
#collectorDetailsContent .detail-comment-box { /* Style pour les commentaires */
    white-space: pre-wrap;
    max-height: 120px; /* Hauteur max commentaires */
    overflow-y: auto;
    font-size: 0.9em;
    background-color: #f8f9fa;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid #eee;
    line-height: 1.5;
    margin-top: -0.5rem; /* Rapprocher de son label */
}
#collectorDetailsContent a.file-link { /* Style pour le lien fichier */
    font-size: 0.9em;
    text-decoration: none;
    display: inline-flex; /* Pour aligner icone et texte */
    align-items: center;
    max-width: 100%; /* Empêche le débordement */
}
#collectorDetailsContent a.file-link i {
    margin-right: 4px;
    font-size: 1.1em; /* Taille icône */
}
#collectorDetailsContent a.file-link span { /* Optionnel: tronquer nom fichier trop long */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    max-width: calc(100% - 25px); /* Laisser place pour icône */
    vertical-align: bottom;
}
#collectorDetailsContent hr { border-top: 1px dashed #ccc; margin-top: 1rem; margin-bottom: 1rem; }

/* Responsive modal details */
@media (max-width: 767.98px) {
    #collectorDetailsContent .detail-label { text-align: left; margin-bottom: 0.1rem; font-weight: 600; }
    #collectorDetailsContent .detail-value { margin-bottom: 0.6rem; }
}


/* Responsive Adjustments Globaux */
@media (max-width: 991.98px) {
  .sidebar { width: var(--sidebar-collapsed-width); }
  .sidebar .sidebar-brand span, .sidebar .sidebar-menu-item span { opacity: 0; visibility: hidden; transition: opacity 0.1s ease-out; }
  .sidebar .sidebar-menu-item a i { margin-right: 0; }
  .main-content { margin-left: var(--sidebar-collapsed-width); }
  .topbar { left: var(--sidebar-collapsed-width); }
  .sidebar:hover { width: var(--sidebar-width); box-shadow: 0.2rem 0 1rem rgba(0,0,0,0.15); z-index: 1031; }
  .sidebar:hover .sidebar-brand span, .sidebar:hover .sidebar-menu-item span { opacity: 1; visibility: visible; transition-delay: 0.15s; }
  .sidebar:hover .sidebar-menu-item a i { margin-right: 15px; }
}
@media (max-width: 767.98px) {
    .main-content { padding: 15px; padding-top: calc(var(--topbar-height) + 15px); }
    .topbar { padding: 0 15px; }
    .topbar .page-title { font-size: 1.1rem; }
    .user-info .small { display: none; }
    #overviewPage .row > [class*="col-"] { margin-bottom: 1rem; }
}

/* Spinner & Placeholders */
button .spinner-border { margin-right: 5px; vertical-align: middle; }
.placeholder { background-color: #e9ecef; border-radius: 0.2rem; }
.placeholder-glow .placeholder { animation: placeholder-glow 2s ease-in-out infinite; }

/* Required Asterisk */
label.required::after { content: " *"; color: var(--bs-danger); }




/* ... (vos styles existants) ... */

/* Style pour le nouveau bouton/lien externe dans la sidebar */
.sidebar-menu-item a.nav-link.external-link-btn {
    /* S'assure qu'il a le même padding et alignement que les autres liens de la sidebar */
    color: rgba(255, 255, 255, 0.75); /* Couleur standard des liens sidebar */
    background-color: transparent; /* Pas de fond spécial par défaut */
}

.sidebar-menu-item a.nav-link.external-link-btn:hover {
    background-color: rgba(255, 255, 255, 0.1); /* Effet de survol standard */
    color: white;
}

/* Si vous voulez qu'il se démarque un peu plus, vous pouvez ajouter : */

.sidebar-menu-item a.nav-link.external-link-btn {
    background-color: #28a745; // Un vert par exemple
    color: white !important;
}
.sidebar-menu-item a.nav-link.external-link-btn:hover {
    background-color: #218838; // Vert plus foncé
}


/* Styles pour le label requis (déjà présent dans votre CSS, juste pour rappel) */
label.required::after { 
    content: " *"; 
    color: var(--bs-danger); 
}

/* Assurez-vous que les icônes dans la sidebar sont bien alignées */
.sidebar-menu-item a.nav-link i { 
    margin-right: 15px; 
    font-size: 1.1rem; 
    min-width: 25px; 
    text-align: center; 
    transition: margin 0.3s ease-in-out; 
}