/* ==========================
   Accueil / Dashboard (index.php)
========================== */
.hero-banner {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border-radius: 16px;
    color: white;
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(13, 110, 253, 0.2);
    margin-bottom: 2.5rem;
}
.hero-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
}
.quick-link-card {
    background: white;
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.05);
    padding: 1.5rem;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.quick-link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    border-color: #0d6efd;
}
.quick-link-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.ql-blue { background: rgba(13, 110, 253, 0.1); color: #0d6efd; }
.ql-purple { background: rgba(111, 66, 193, 0.1); color: #6f42c1; }
.ql-green { background: rgba(25, 135, 84, 0.1); color: #198754; }
.ql-orange { background: rgba(253, 126, 20, 0.1); color: #fd7e14; }

.quick-link-title {
    font-weight: 700;
    color: #2b3440;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}
.quick-link-desc {
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0;
}
.ql-gray { background: rgba(108, 117, 125, 0.1); color: #6c757d; }

/* ==========================
   Footer
========================== */
.footer {
    background: linear-gradient(45deg, #007bff, #00d4ff);
    /* Optionnel : si tu veux un fond sombre plus raccord avec l'admin,
       tu peux essayer : background: #2c3e50; */
}
/* Garder le footer en bas */
html, body {
    height: 100%;
}
body {
    display: flex;
    flex-direction: column;
}
.main-content {
    flex: 1 0 auto; /* Permet au contenu de s'étirer pour repousser le footer */
}

/* ==========================
   Gestion des URLs (url_admin.php)
========================== */
.link-card {
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,.03);
    overflow: hidden;
}

.link-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 18px;
    align-items: center;
}

.link-grid > * { min-width: 0; }
.g-dest, .g-url { min-width: 0; }

.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.slug { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; }
.badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.badge-soft { border: 1px solid rgba(0,0,0,.08); background: #f6f7fb; color: #445; padding: 4px 8px; border-radius: 999px; font-size: .8rem; }
.badge-active { background: #e9f7ef; color: #166534; border-color: #bbf7d0; }
.badge-inactive { background: #f5f5f5; color: #6b7280; }
.badge-perma { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; }
.badge-tempo { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }

.short-url { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }

.dest-wrap {
    position: relative; overflow: hidden; border-radius: 8px;
    background: #f9fafb; padding: 6px 10px; border: 1px solid #eef2f7;
    width: 100%; box-sizing: border-box;
}
.dest {
    display: block; max-width: 100%; box-sizing: border-box;
    white-space: nowrap; overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none;
}
.dest::-webkit-scrollbar { display: none; }

.dest-line { display: inline-block; color: #111827; font-size: .96rem; line-height: 1.5; padding-right: 8px; }
.dest.is-long .dest-line { color: #374151; }

.dest-slider {
    width: 100%; appearance: none; height: 4px; background: #e5e7eb;
    border-radius: 999px; outline: none; margin-top: 6px; display: none;
}
.dest-slider::-webkit-slider-thumb {
    appearance: none; width: 12px; height: 12px; background: #4b5563; border-radius: 50%; cursor: pointer; margin-top: -4px;
}
.dest-slider::-moz-range-thumb {
    width: 12px; height: 12px; background: #4b5563; border: none; border-radius: 50%; cursor: pointer;
}

.meta-line { color: #6b7280; font-size: .9rem; }
.stats-line { color: #6b7280; font-size: .9rem; margin: 2px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.actions .btn { padding: 6px 10px; }

/* ==========================
   Config Google Calendar (gcal_manage.php)
========================== */
.gcal-spinner-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
}
.cursor-pointer { cursor: pointer; }
.small-muted { font-size: .925rem; color: #6c757d; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ==========================
   Éditeur de Programme (programme_builder.php)
========================== */
.container-narrow {
    max-width: 1100px;
}

/* Barre d'outils flottante */
.editor-toolbar {
    position: sticky;
    top: 1rem; /* Si ton menu principal est fixé en haut, remplace 1rem par 80px */
    z-index: 990 !important; /* Doit être inférieur à 1000 pour laisser passer le menu principal */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    border-radius: 1rem;
}

/* Onglets modernes (Pills) */
.nav-pills-custom .nav-link {
    border-radius: 50rem;
    color: #495057;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}
.nav-pills-custom .nav-link:hover {
    background-color: #e9ecef;
}
.nav-pills-custom .nav-link.active {
    background-color: #0d6efd;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.3);
}

/* Cartes interactives */
.builder-card {
    border-radius: 1rem;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    margin-bottom: 1.25rem;
    transition: transform 0.2s;
}
.builder-card-header {
    background-color: #fff;
    border-bottom: none;
    border-radius: 1rem !important;
    padding: 1.25rem;
    cursor: pointer;
    transition: background-color 0.2s;
}
.builder-card-header:hover {
    background-color: #f8f9fa;
}
.builder-card .collapse.show + .card-body,
.builder-card .collapsing + .card-body {
    border-top: 1px solid #f1f1f1;
}

/* Boutons ronds des actions */
.btn-action-circle {
    width: 32px; height: 32px;
    padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
}

/* Iframe preview mobile */
.preview-wrapper {
    background: #f8f9fa;
    border-radius: 1rem;
    padding: 1rem;
    border: 2px dashed #dee2e6;
}
#publicPreviewFrame {
    width: 100%;
    height: 85vh;
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    background: #fff;
}

/* ==========================
   Corrections de visibilité & Menus déroulants
========================== */

/* 1. Forcer le texte sombre dans les formulaires */
.form-select,
.form-control {
    color: #212529 !important; 
    background-color: #fff !important;
}

/* 2. Élément de menu par défaut (Normal) */
.dropdown-menu .dropdown-item {
    color: #212529 !important; /* Texte sombre */
    border-radius: 6px;        /* Bords arrondis pour tous les éléments */
    margin: 2px 4px;           /* Espace pour ne pas toucher les bords du menu */
    width: calc(100% - 8px);
    transition: background-color 0.2s, color 0.2s; /* Animation douce */
}

/* 3. Élément au survol (Hover) */
.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
    background-color: #f8f9fa !important; /* Gris très clair */
    color: #0d6efd !important;            /* Texte bleu */
}

/* 4. Élément de la page en cours (Actif) */
.dropdown-menu .dropdown-item.active,
.dropdown-menu .dropdown-item:active {
    background-color: #eef2ff !important; /* Fond bleu très clair (nouveau design) */
    color: #0d6efd !important;            /* Texte bleu */
    font-weight: 600;                     /* Texte légèrement plus gras */
}

/* 5. S'assurer que les icônes suivent la couleur bleue au survol et à l'activation */
.dropdown-menu .dropdown-item:hover i,
.dropdown-menu .dropdown-item.active i {
    color: #0d6efd !important;
}

/* ==========================
   Menu Principal (Navbar) - Design adouci
========================== */
.navbar-nav .nav-link {
    border-radius: 50rem !important; /* Rendre les bords totalement arrondis */
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    margin: 0 0.15rem; /* Petit espace entre les boutons */
    transition: all 0.2s ease-in-out;
}

/* Effet au survol de la souris */
.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Effet quand le menu est actif (page courante) */
.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2) !important; /* Blanc semi-transparent, fini le bleu foncé ! */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* ==========================
   Gestion des Utilisateurs - Version Compacte
========================== */
.user-row {
    background: #fff;
    border-radius: 8px; /* Bords un peu moins ronds, plus sérieux */
    padding: 0.5rem 1rem; /* Beaucoup moins haut ! */
    margin-bottom: 0.4rem; /* Les lignes sont plus resserrées */
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.user-row:hover {
    transform: translateX(4px); /* Petit effet discret */
    box-shadow: 0 4px 12px rgba(0,0,0,0.06) !important;
    border-color: #0d6efd;
}

.user-info-main { flex: 2; min-width: 200px; }
.user-roles-box { flex: 2; min-width: 180px; }
.user-stats-box { flex: 1; min-width: 130px; border-left: 1px solid #eee; padding-left: 1rem; font-size: 0.75rem; }
.user-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* Status Dot (En Ligne / Hors Ligne) */
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}
.status-dot.online { background-color: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
.status-dot.offline { background-color: #cbd5e1; }

/* Badges de Rôles miniatures */
.role-badge {
    background-color: #f1f5f9; color: #475569;
    border: 1px solid #e2e8f0;
    font-weight: 500;
    font-size: 0.7rem; /* Plus petit */
    padding: 0.2em 0.6em;
}
.role-badge.super-admin { background-color: #fef2f2; color: #dc2626; border-color: #fecaca; }

/* Boutons d'actions miniatures */
.user-actions .btn {
    width: 28px; height: 28px; /* De petits cercles parfaits */
    padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
}

/* ==========================
   Suivi des Commandes HelloAsso
========================== */
.order-row {
    background: #fff;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}
.order-row:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-color: #0d6efd;
}
.order-row .collapse.show {
    border-top: 1px dashed var(--bs-border-color-translucent);
    margin-top: 1rem;
    padding-top: 1rem;
}
.recap-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e9ecef;
    border-radius: 16px;
}
.empty-state {
    border: 2px dashed var(--bs-border-color-translucent);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    background-color: #fff;
}
.detail-block {
    border-left: 3px solid #dee2e6;
    padding-left: 1rem;
    margin-top: 0.5rem;
    background-color: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 0 8px 8px 0;
}
.toolbar-glass {
    position: sticky;
    top: 1rem;
    z-index: 900;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.04);
}

/* ==========================
   Configuration d'Accès (access_config.php)
========================== */
/* Onglets Bulles */
.nav-pills-custom .nav-link {
    border-radius: 50rem;
    color: #495057;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.nav-pills-custom .nav-link:hover { background-color: #f8f9fa; border-color: #dee2e6; }
.nav-pills-custom .nav-link.active { background-color: #0d6efd; color: #fff !important; box-shadow: 0 4px 10px rgba(13, 110, 253, 0.3); border-color: #0d6efd; }

/* Chips (Pilules de permissions) */
.perm-chip {
    display: inline-flex;
    align-items: center;
    background: #eef2ff;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0.15rem;
    font-family: var(--bs-font-monospace);
}

/* Matrice de permissions */
.matrix-table th { background-color: #f8fafc; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid #e2e8f0; }
.matrix-table td { vertical-align: middle; padding: 0.75rem; border-bottom: 1px solid #f1f5f9; }
.matrix-table tbody tr:hover { background-color: #f8f9fa; }
.perm-key-cell { min-width: 250px; }
.perm-key-title { font-family: var(--bs-font-monospace); font-weight: bold; color: #1e293b; font-size: 0.95rem; }
.perm-key-desc { font-size: 0.8rem; color: #64748b; margin-top: 2px; }

/* Boutons de sélection rapide dans la matrice */
.select-all-btn, .select-none-btn {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.1s;
}
.select-all-btn { background: #d1fae5; color: #059669; border: 1px solid #a7f3d0; }
.select-all-btn:hover { background: #a7f3d0; }
.select-none-btn { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.select-none-btn:hover { background: #fecaca; }

/* Checkbox plus grand dans la matrice */
.matrix-checkbox { width: 1.2em; height: 1.2em; cursor: pointer; }

/* Grille de sélection des permissions (Ajout Modal/Form) */
.perm-grid-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.2s;
    height: 100%;
}
.perm-grid-item:hover { border-color: #94a3b8; }
.perm-grid-item .form-check-input:checked ~ .form-check-label { color: #0d6efd; }

.floating-alerts { position: fixed; top: 20px; right: 20px; z-index: 1055; min-width: 320px; }

/* ==========================
   Paramètres Serveur (admin_settings.php)
========================== */

/* Menu latéral (Tabs Verticales) */
.nav-pills-custom .nav-link {
    color: #495057;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-align: left;
    border: 1px solid transparent;
}
.nav-pills-custom .nav-link:hover {
    background-color: #e9ecef;
}
.nav-pills-custom .nav-link.active {
    background-color: #fff !important;
    color: #0d6efd !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-color: #dee2e6;
}
.nav-pills-custom .nav-link i {
    font-size: 1.2rem;
    width: 30px;
    display: inline-block;
}

/* Cartes de paramètres */
.settings-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    background: #fff;
}
.settings-header {
    border-bottom: 1px solid #f1f4f9;
    padding: 2rem;
}
.settings-body {
    padding: 2rem;
}

/* Composants Reçus Fiscaux & Signature */
.signature-container {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 10px;
    text-align: center;
}
.signature-pad {
    width: 100%;
    max-width: 500px;
    height: 200px;
    touch-action: none;
    background: #fff;
    border-radius: 8px;
    cursor: crosshair;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.preview-box { 
    border: 1px solid #dee2e6; 
    border-radius: 12px; 
    padding: 1rem; 
    background: #fff; 
    text-align: center; 
    min-height: 160px; /* <-- La correction est ici (on enlève le height 100%) */
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center;
}
.preview-img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
}

/* Alertes Volantes (Toasts) */
.floating-alerts {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1055;
    min-width: 300px;
}

/* ==========================
   Liste Devis & Factures (devis_liste.php)
========================== */
.document-table {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    overflow: hidden;
    border: 1px solid #edf2f7;
}
.document-table thead th {
    background-color: #f8fafc;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid #e2e8f0;
}
.document-table tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}
.document-table tbody tr:hover {
    background-color: #f8fafc;
}
.doc-number {
    font-family: var(--bs-font-monospace);
    font-weight: 700;
    color: #0f172a;
}
.doc-client {
    font-weight: 600;
    color: #1e293b;
}
.doc-date {
    font-size: 0.85rem;
    color: #64748b;
}
.doc-total {
    font-weight: 700;
    font-size: 1.1rem;
}
.action-buttons {
    display: flex;
    gap: 0.4rem;
    flex-wrap: nowrap;
}
.action-buttons .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    transition: all 0.2s;
}
.action-buttons .btn:hover {
    transform: translateY(-2px);
}
.btn-generate-invoice {
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.2);
}



/* Ancien style */

/* On utilise l'alert-banner existant dans ton style.css,
   mais on lui ajoute une variante si besoin, ou on garde le tien tel quel ! */
.alert-banner.admin-alert {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* ==========================
   Page d'accueil simple (index.php)
========================== */
body.home-simple {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #e5e7eb;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.home-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 15px;
}

.home-card {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(14px);
    padding: 40px 40px 50px;
    border-radius: 18px;
    text-align: center;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 12px 32px rgba(0,0,0,0.35);
    animation: fadeIn .6s ease-out;
}

.home-logo {
    max-width: 160px;
    margin-bottom: 20px;
}

.home-card h1 {
    font-size: 2.2rem;
    margin-bottom: 5px;
    color: #fff;
}

.home-subtitle {
    margin-bottom: 20px;
    color: #94a3b8;
}

.home-user {
    margin-bottom: 25px;
    color: #cbd5e1;
}

/* Message d'alerte */
.alert-banner {
    background: rgba(255,213,0,0.1);
    border: 1px solid rgba(255,213,0,0.4);
    color: #fbbf24;
    padding: 10px 15px;
    border-radius: 10px;
    max-width: 600px;
    margin: 0 auto 20px;
    text-align: center;
    animation: fadeIn .4s ease-out;
}

/* Animation simple */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ==========================
   Page recrutement (recrutement.php)
========================== */

/* on met .recruitment-page seul + body.recruitment-page, comme ça on couvre tous les cas */
.recruitment-page,
body.recruitment-page {
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.recruitment-container {
    max-width: 720px;
    margin-top: 40px;
    margin-bottom: 40px;
}

.recruitment-title {
    font-weight: 700;
    color: #1f2933;
    margin-bottom: 24px;
}

/* Carte formulaire */
.recruitment-form {
    background: #ffffff;
    border-radius: 18px;
    padding: 28px 26px 30px;
    box-shadow: 0 10px 24px rgba(15,23,42,0.12);
    border: 1px solid rgba(148,163,184,0.4);
}

/* Labels */
.recruitment-form .form-label {
    font-weight: 600;
    color: #111827;
}

/* Petit texte d'aide */
.small-help {
    font-size: 0.9rem;
    color: #6b7280;
}

/* Champs formulaire */
.recruitment-form .form-control {
    border-radius: 0.6rem;
}

/* Bouton submit customisé */
.recruitment-submit {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: none;
    font-weight: 600;
}
.recruitment-submit:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}
.recruitment-submit:active {
    transform: translateY(1px);
}

/* Radios */
.recruitment-form .form-check-input:checked {
    background-color: #2563eb;
    border-color: #2563eb;
}

